Changeset 437 for trunk/data

Show
Ignore:
Timestamp:
08/22/08 09:04:39 (3 months ago)
Author:
saurik
Message:

Upgraded to the ashikase MobileTerminal? and Phase 1/2 for author fix.

Location:
trunk/data/mobileterminal
Files:
1 removed
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/data/mobileterminal/_metadata/description

    r390 r437  
    11local UIKit-based Terminal emulator 
    2 This is a Terminal emulator for the iPhone. With it you can do all of your standard system administration tasks from anywhere: ssh into remote boxes, download files, edit configuration files. Please note, though, that this package does not fully work yet on iPhoneOS 2.x. For more information (and a status update) please click below for More Information. 
     2This is a Terminal emulator for the iPhone. With it you can do all of your standard system administration tasks from anywhere: ssh into remote boxes, download files, edit configuration files, whatever. Please note, though, that this package does not fully work yet on iPhoneOS 2.x. For more information (and a status update) please click below for More Information. 
  • trunk/data/mobileterminal/port.diff

    r391 r437  
    1 diff -ru mobileterminal-286/main.m mobileterminal-286+iPhone/main.m 
    2 --- mobileterminal-286/main.m   2008-05-07 08:07:55.000000000 +0000 
    3 +++ mobileterminal-286+iPhone/main.m    2008-07-25 09:22:12.000000000 +0000 
    4 @@ -3,6 +3,8 @@ 
    5  #import "MobileTerminal.h" 
    6  #import "Settings.h" 
    7   
    8 +void UIApplicationUseLegacyEvents(BOOL use); 
    9 + 
    10  int main(int argc, char **argv) 
    11  { 
    12    [[NSAutoreleasePool alloc] init]; 
    13 @@ -27,5 +29,6 @@ 
    14      [[Settings sharedInstance] setArguments:args]; 
    15    } 
    16   
    17 +  UIApplicationUseLegacyEvents(1); 
    18    return UIApplicationMain(argc, argv, [MobileTerminal class]); 
    19  } 
    201diff -r -u mobileterminal-286/GestureView.m mobileterminal-286+iPhone/GestureView.m 
    212--- mobileterminal-286/GestureView.m    2008-05-07 08:33:09.000000000 +0000 
    223+++ mobileterminal-286+iPhone/GestureView.m     2008-07-06 19:51:22.000000000 +0000 
    23 @@ -77,9 +82,9 @@ 
    24   
    25  //_______________________________________________________________________________ 
    26   
     4@@ -13,6 +13,11 @@ 
     5 #import "Tools.h" 
     6 #include <math.h> 
     7  
     8+@protocol UITouchCompatibility 
     9+- (CGPoint)locationInView:(UIView *)view; 
     10+- (CGPoint)previousLocationInView:(UIView *)view; 
     11+@end 
     12+ 
     13 @implementation GestureView 
     14  
     15 //_______________________________________________________________________________ 
     16@@ -77,9 +82,23 @@ 
     17  
     18 //_______________________________________________________________________________ 
     19  
     20+- (BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event { 
     21+    return [self beginTrackingAt:[touch locationInView:self] withEvent:event]; 
     22+} 
     23+ 
     24+- (BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event { 
     25+    return [self continueTrackingAt:[touch locationInView:self] previous:[touch previousLocationInView:self] withEvent:event]; 
     26+} 
     27+ 
     28+- (void)endTrackingWithTouch:(id)touch withEvent:(id)event { 
     29+    return [self endTrackingAt:[touch locationInView:self] previous:[touch previousLocationInView:self] withEvent:event]; 
     30+} 
     31+ 
     32+//_______________________________________________________________________________ 
     33+ 
    2734 - (void) mouseDown:(GSEvent*)event 
    2835 { 
     
    7380  
    7481 //_______________________________________________________________________________ 
     82diff -r -u mobileterminal-286/main.m mobileterminal-286+iPhone/main.m 
     83--- mobileterminal-286/main.m   2008-05-07 08:07:55.000000000 +0000 
     84+++ mobileterminal-286+iPhone/main.m    2008-08-02 09:38:12.000000000 +0000 
     85@@ -2,6 +2,9 @@ 
     86 #import <UIKit/UIKit.h> 
     87 #import "MobileTerminal.h" 
     88 #import "Settings.h" 
     89+#include <objc/runtime.h> 
     90+ 
     91+void UIApplicationUseLegacyEvents(BOOL use); 
     92  
     93 int main(int argc, char **argv) 
     94 { 
     95@@ -27,5 +30,6 @@ 
     96     [[Settings sharedInstance] setArguments:args]; 
     97   } 
     98  
     99+  UIApplicationUseLegacyEvents(1); 
     100   return UIApplicationMain(argc, argv, [MobileTerminal class]); 
     101 } 
    75102diff -r -u mobileterminal-286/Makefile.build mobileterminal-286+iPhone/Makefile.build 
    76103--- mobileterminal-286/Makefile.build   2008-05-07 08:07:55.000000000 +0000 
     
    120147diff -r -u mobileterminal-286/MobileTerminal.m mobileterminal-286+iPhone/MobileTerminal.m 
    121148--- mobileterminal-286/MobileTerminal.m 2008-05-07 08:33:09.000000000 +0000 
    122 +++ mobileterminal-286+iPhone/MobileTerminal.m  2008-07-06 19:43:12.000000000 +0000 
     149+++ mobileterminal-286+iPhone/MobileTerminal.m  2008-08-02 09:40:25.000000000 +0000 
    123150@@ -17,9 +17,17 @@ 
    124151 #import <Foundation/Foundation.h> 
     
    177204        } 
    178205         
    179 @@ -356,7 +364,7 @@ 
     206@@ -112,7 +120,6 @@ 
     207                [mainView addSubview:[scrollers objectAtIndex:i]]; 
     208   } 
     209   [mainView addSubview:keyboardView];   
     210-  [mainView addSubview:[keyboardView inputView]]; 
     211   [mainView addSubview:gestureView]; 
     212        [mainView addSubview:[MenuView sharedInstance]]; 
     213        activeView = mainView; 
     214@@ -131,7 +138,7 @@ 
     215   [[MenuView sharedInstance] hideSlow:YES]; 
     216  
     217   // Input focus 
     218-  [[keyboardView inputView] becomeFirstResponder]; 
     219+  [keyboardView enable]; 
     220                 
     221        if (numTerminals > 1) 
     222        { 
     223@@ -165,10 +172,9 @@ 
     224                [keyboardView setAlpha:0.0f];            
     225   }   
     226         
     227-       [mainView addSubview:[keyboardView inputView]]; 
     228        [mainView bringSubviewToFront:gestureView]; 
     229        [mainView bringSubviewToFront:[MenuView sharedInstance]]; 
     230-       [[keyboardView inputView] becomeFirstResponder]; 
     231+    [keyboardView enable]; 
     232         
     233        [self setActiveTerminal:0]; 
     234        [self updateStatusBar]; 
     235@@ -198,7 +204,6 @@ 
     236   if (activeView != mainView) // preferences active 
     237     [self togglePreferences]; 
     238    
     239-  [[keyboardView inputView] removeFromSuperview]; 
     240   [keyboardView removeFromSuperview]; 
     241         
     242        for (i = 0; i < MAXTERMINALS; i++) 
     243@@ -356,7 +361,7 @@ 
    180244   } 
    181245   else 
     
    186250 } 
    187251  
    188 @@ -404,7 +412,7 @@ 
     252@@ -404,7 +409,7 @@ 
    189253 { 
    190254        if (numTerminals > 1) 
     
    195259                if (pos.x > width/2 && pos.x < width*3/4) 
    196260                { 
    197 @@ -679,20 +687,18 @@ 
     261@@ -679,20 +684,18 @@ 
    198262        { 
    199263     //log(@"create terminal");     
     
    221285     //log(@"create textview");     
    222286  
    223 @@ -702,6 +708,8 @@ 
     287@@ -702,6 +705,8 @@ 
    224288                                                                                                                                                                                                                 identifier: numTerminals];              
    225289     //log(@"textview created");     
     
    390454  
    391455     NSMutableArray * ca = [NSMutableArray arrayWithCapacity:NUM_TERMINAL_COLORS]; 
     456diff -r -u mobileterminal-286/ShellKeyboard.h mobileterminal-286+iPhone/ShellKeyboard.h 
     457--- mobileterminal-286/ShellKeyboard.h  2008-05-07 08:07:55.000000000 +0000 
     458+++ mobileterminal-286+iPhone/ShellKeyboard.h   2008-08-02 09:40:25.000000000 +0000 
     459@@ -11,12 +11,12 @@ 
     460 @interface ShellKeyboard : UIKeyboard<KeyboardInputProtocol> 
     461 { 
     462   id inputDelegate; 
     463-  UITextView* inputView; 
     464+  id handler; 
     465 } 
     466  
     467 - (id)initWithFrame:(CGRect)frame; 
     468-- (UITextView*)inputView; 
     469 - (void)setInputDelegate:(id)delegate; 
     470 - (void)handleKeyPress:(unichar)c; 
     471+- (void)enable; 
     472  
     473 @end 
    392474diff -r -u mobileterminal-286/ShellKeyboard.m mobileterminal-286+iPhone/ShellKeyboard.m 
    393475--- mobileterminal-286/ShellKeyboard.m  2008-05-07 08:07:55.000000000 +0000 
    394 +++ mobileterminal-286+iPhone/ShellKeyboard.m   2008-07-06 19:33:23.000000000 +0000 
    395 @@ -1,6 +1,56 @@ 
     476+++ mobileterminal-286+iPhone/ShellKeyboard.m   2008-08-02 09:40:49.000000000 +0000 
     477@@ -1,22 +1,69 @@ 
    396478 // ShellKeyboard.m 
    397479 #import "ShellKeyboard.h" 
    398   
     480+#include <objc/runtime.h> 
     481+#import <UIKit/UIDefaultKeyboardInput.h> 
     482  
     483-// Override settings of the default keyboard implementation 
     484-@implementation UIKeyboardImpl (DisableFeatures) 
    399485+/* iPhoneOS 2.0 Compatibility {{{ */ 
    400486+#ifdef __OBJC2__ 
    401487+@interface UICGColor : NSObject { 
    402488+} 
    403 + 
     489  
     490-- (BOOL)autoCapitalizationPreference 
     491-{ 
     492-  return false; 
    404493+- (id) initWithCGColor:(CGColorRef)color; 
    405494+@end 
    406495+ 
    407496+@interface UIFont { 
    408 +} 
    409 + 
     497 } 
     498  
     499-- (BOOL)autoCorrectionPreference 
     500-{ 
     501-  return false; 
    410502+- (UIFont *) fontWithSize:(CGFloat)size; 
    411503+@end 
     
    421513+- (CGColorRef) cgColor { 
    422514+    return [self CGColor]; 
    423 +} 
    424 + 
     515 } 
     516  
    425517+- (CGColorRef) CGColor { 
    426518+    return (CGColorRef) self; 
     
    444536+ 
    445537+@end 
     538+ 
     539+@interface UIDefaultKeyboardInput (iPhoneOS) 
     540+- (id)textInputTraits; 
     541+@end 
     542+ 
     543+@interface UITextInputTraits 
     544+- (void)setAutocorrectionType:(int)type; 
     545+- (void)setAutocapitalizationType:(int)type; 
     546+- (void)setEnablesReturnKeyAutomatically:(BOOL)val; 
     547 @end 
    446548+#endif 
    447549+/* }}} */ 
    448 + 
    449  // Override settings of the default keyboard implementation 
    450  @implementation UIKeyboardImpl (DisableFeatures) 
    451   
    452 @@ -37,6 +87,14 @@ 
     550  
     551-@interface TextInputHandler : UITextView 
     552+@interface TextInputHandler : UIDefaultKeyboardInput 
     553 { 
     554   ShellKeyboard* shellKeyboard; 
     555 } 
     556@@ -30,26 +77,49 @@ 
     557 - (id)initWithKeyboard:(ShellKeyboard*)keyboard; 
     558 { 
     559   self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)]; 
     560-  shellKeyboard = keyboard; 
     561+  if ( self ) { 
     562+      shellKeyboard = keyboard; 
     563+      [[self textInputTraits] setAutocorrectionType:1]; 
     564+      [[self textInputTraits] setAutocapitalizationType:0]; 
     565+      [[self textInputTraits] setEnablesReturnKeyAutomatically:NO]; 
     566+  } 
     567   return self; 
     568 } 
     569  
     570+#if 0 
    453571 - (BOOL)webView:(id)fp8 shouldDeleteDOMRange:(id)fp12 
    454572 { 
     
    457575+} 
    458576+ 
    459 +- (BOOL)webView:(id)fp8 doCommandBySelector:(SEL)fp12 
     577+#endif 
     578+ 
     579+- (void)deleteBackward 
    460580+{ 
    461 +  if (fp12 == @selector(deleteBackward:)) 
    462581+    [shellKeyboard handleKeyPress:0x08]; 
    463 +  return false; 
    464  } 
    465   
    466  - (BOOL)webView:(id)fp8 shouldInsertText:(id)character 
    467 @@ -48,6 +106,17 @@ 
    468      return false; 
     582 } 
     583  
     584-- (BOOL)webView:(id)fp8 shouldInsertText:(id)character 
     585-                       replacingDOMRange:(id)fp16 
     586-                             givenAction:(int)fp20 
     587+- (void)insertText:(id)character 
     588 { 
     589   if ([character length] != 1) { 
     590     [NSException raise:@"Unsupported" format:@"Unhandled multi-char insert!"]; 
     591-    return false; 
    469592   } 
    470593   [shellKeyboard handleKeyPress:[character characterAtIndex:0]]; 
    471 +  return false; 
    472 +} 
    473 + 
     594 } 
     595  
     596+#if 0 // for Debugging 
    474597+- (NSMethodSignature *) methodSignatureForSelector:(SEL)selector { 
    475598+    fprintf(stderr, "[%s]S-%s\n", class_getName(self->isa), sel_getName(selector)); 
     
    480603+    fprintf(stderr, "[%s]R-%s\n", class_getName(self->isa), sel_getName(selector)); 
    481604+    return [super respondsToSelector:selector]; 
    482  } 
    483   
     605+} 
     606+#endif 
     607+ 
     608 @end 
     609  
     610 // ShellKeyboard 
     611@@ -59,16 +129,12 @@ 
     612 - (id)initWithFrame:(CGRect)frame 
     613 { 
     614   self = [super initWithFrame:frame]; 
     615-  inputDelegate = nil; 
     616-  inputView = [[TextInputHandler alloc] initWithKeyboard:self]; 
     617+  if ( self ) { 
     618+      handler = [[TextInputHandler alloc] initWithKeyboard:self]; 
     619+  } 
     620   return self; 
     621 } 
     622  
     623-- (UITextView*)inputView 
     624-{ 
     625-  return inputView; 
     626-} 
     627- 
     628 - (void)setInputDelegate:(id)delegate; 
     629 { 
     630   inputDelegate = delegate; 
     631@@ -79,4 +145,17 @@ 
     632   [inputDelegate handleKeyPress:c]; 
     633 } 
     634  
     635+- (void)enable 
     636+{ 
     637+    [self activate]; 
     638+    [[UIKeyboardImpl activeInstance] setDelegate:handler]; 
     639+} 
     640+ 
     641+- (void)dealloc 
     642+{ 
     643+    [handler release]; 
     644+ 
     645+    [super dealloc]; 
     646+} 
     647+ 
    484648 @end 
    485649diff -r -u mobileterminal-286/SubProcess.m mobileterminal-286+iPhone/SubProcess.m