summaryrefslogtreecommitdiff
path: root/data/mobileterminal
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-08-22 09:04:39 +0000
committerJay Freeman <saurik@saurik.com>2008-08-22 09:04:39 +0000
commit3e86e9cc68714a7b04601097356e46abfebc47e9 (patch)
tree7967e2c5b40911273133d53c77031272baae4477 /data/mobileterminal
parent7430be9aa558234bcd8abaa0e33bdc26ec98c309 (diff)
Upgraded to the ashikase MobileTerminal and Phase 1/2 for author fix.
git-svn-id: http://svn.telesphoreo.org/trunk@437 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'data/mobileterminal')
l---------data/mobileterminal/_metadata/author1
-rw-r--r--data/mobileterminal/_metadata/description2
-rw-r--r--data/mobileterminal/port.diff254
3 files changed, 210 insertions, 47 deletions
diff --git a/data/mobileterminal/_metadata/author b/data/mobileterminal/_metadata/author
deleted file mode 120000
index 6b51acfe8..000000000
--- a/data/mobileterminal/_metadata/author
+++ /dev/null
@@ -1 +0,0 @@
-../../../people/vaumnou \ No newline at end of file
diff --git a/data/mobileterminal/_metadata/description b/data/mobileterminal/_metadata/description
index 690d54314..4ebb86e09 100644
--- a/data/mobileterminal/_metadata/description
+++ b/data/mobileterminal/_metadata/description
@@ -1,2 +1,2 @@
local UIKit-based Terminal emulator
-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.
+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, 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.
diff --git a/data/mobileterminal/port.diff b/data/mobileterminal/port.diff
index 59981092d..220463525 100644
--- a/data/mobileterminal/port.diff
+++ b/data/mobileterminal/port.diff
@@ -1,29 +1,36 @@
-diff -ru mobileterminal-286/main.m mobileterminal-286+iPhone/main.m
---- mobileterminal-286/main.m 2008-05-07 08:07:55.000000000 +0000
-+++ mobileterminal-286+iPhone/main.m 2008-07-25 09:22:12.000000000 +0000
-@@ -3,6 +3,8 @@
- #import "MobileTerminal.h"
- #import "Settings.h"
-
-+void UIApplicationUseLegacyEvents(BOOL use);
-+
- int main(int argc, char **argv)
- {
- [[NSAutoreleasePool alloc] init];
-@@ -27,5 +29,6 @@
- [[Settings sharedInstance] setArguments:args];
- }
-
-+ UIApplicationUseLegacyEvents(1);
- return UIApplicationMain(argc, argv, [MobileTerminal class]);
- }
diff -r -u mobileterminal-286/GestureView.m mobileterminal-286+iPhone/GestureView.m
--- mobileterminal-286/GestureView.m 2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/GestureView.m 2008-07-06 19:51:22.000000000 +0000
-@@ -77,9 +82,9 @@
+@@ -13,6 +13,11 @@
+ #import "Tools.h"
+ #include <math.h>
+
++@protocol UITouchCompatibility
++- (CGPoint)locationInView:(UIView *)view;
++- (CGPoint)previousLocationInView:(UIView *)view;
++@end
++
+ @implementation GestureView
+
+ //_______________________________________________________________________________
+@@ -77,9 +82,23 @@
//_______________________________________________________________________________
++- (BOOL)beginTrackingWithTouch:(id)touch withEvent:(id)event {
++ return [self beginTrackingAt:[touch locationInView:self] withEvent:event];
++}
++
++- (BOOL)continueTrackingWithTouch:(id)touch withEvent:(id)event {
++ return [self continueTrackingAt:[touch locationInView:self] previous:[touch previousLocationInView:self] withEvent:event];
++}
++
++- (void)endTrackingWithTouch:(id)touch withEvent:(id)event {
++ return [self endTrackingAt:[touch locationInView:self] previous:[touch previousLocationInView:self] withEvent:event];
++}
++
++//_______________________________________________________________________________
++
- (void) mouseDown:(GSEvent*)event
{
- mouseDownPos = [delegate viewPointForWindowPoint:GSEventGetLocationInWindow(event)];
@@ -72,6 +79,26 @@ diff -r -u mobileterminal-286/Log.m mobileterminal-286+iPhone/Log.m
}
//_______________________________________________________________________________
+diff -r -u mobileterminal-286/main.m mobileterminal-286+iPhone/main.m
+--- mobileterminal-286/main.m 2008-05-07 08:07:55.000000000 +0000
++++ mobileterminal-286+iPhone/main.m 2008-08-02 09:38:12.000000000 +0000
+@@ -2,6 +2,9 @@
+ #import <UIKit/UIKit.h>
+ #import "MobileTerminal.h"
+ #import "Settings.h"
++#include <objc/runtime.h>
++
++void UIApplicationUseLegacyEvents(BOOL use);
+
+ int main(int argc, char **argv)
+ {
+@@ -27,5 +30,6 @@
+ [[Settings sharedInstance] setArguments:args];
+ }
+
++ UIApplicationUseLegacyEvents(1);
+ return UIApplicationMain(argc, argv, [MobileTerminal class]);
+ }
diff -r -u mobileterminal-286/Makefile.build mobileterminal-286+iPhone/Makefile.build
--- mobileterminal-286/Makefile.build 2008-05-07 08:07:55.000000000 +0000
+++ mobileterminal-286+iPhone/Makefile.build 2008-07-20 04:23:48.000000000 +0000
@@ -119,7 +146,7 @@ diff -r -u mobileterminal-286/Menu.m mobileterminal-286+iPhone/Menu.m
MenuItem * item = [[menu items] objectAtIndex:i];
diff -r -u mobileterminal-286/MobileTerminal.m mobileterminal-286+iPhone/MobileTerminal.m
--- mobileterminal-286/MobileTerminal.m 2008-05-07 08:33:09.000000000 +0000
-+++ mobileterminal-286+iPhone/MobileTerminal.m 2008-07-06 19:43:12.000000000 +0000
++++ mobileterminal-286+iPhone/MobileTerminal.m 2008-08-02 09:40:25.000000000 +0000
@@ -17,9 +17,17 @@
#import <Foundation/Foundation.h>
#import <GraphicsServices/GraphicsServices.h>
@@ -176,7 +203,44 @@ diff -r -u mobileterminal-286/MobileTerminal.m mobileterminal-286+iPhone/MobileT
[textviews addObject:textview];
}
-@@ -356,7 +364,7 @@
+@@ -112,7 +120,6 @@
+ [mainView addSubview:[scrollers objectAtIndex:i]];
+ }
+ [mainView addSubview:keyboardView];
+- [mainView addSubview:[keyboardView inputView]];
+ [mainView addSubview:gestureView];
+ [mainView addSubview:[MenuView sharedInstance]];
+ activeView = mainView;
+@@ -131,7 +138,7 @@
+ [[MenuView sharedInstance] hideSlow:YES];
+
+ // Input focus
+- [[keyboardView inputView] becomeFirstResponder];
++ [keyboardView enable];
+
+ if (numTerminals > 1)
+ {
+@@ -165,10 +172,9 @@
+ [keyboardView setAlpha:0.0f];
+ }
+
+- [mainView addSubview:[keyboardView inputView]];
+ [mainView bringSubviewToFront:gestureView];
+ [mainView bringSubviewToFront:[MenuView sharedInstance]];
+- [[keyboardView inputView] becomeFirstResponder];
++ [keyboardView enable];
+
+ [self setActiveTerminal:0];
+ [self updateStatusBar];
+@@ -198,7 +204,6 @@
+ if (activeView != mainView) // preferences active
+ [self togglePreferences];
+
+- [[keyboardView inputView] removeFromSuperview];
+ [keyboardView removeFromSuperview];
+
+ for (i = 0; i < MAXTERMINALS; i++)
+@@ -356,7 +361,7 @@
}
else
{
@@ -185,7 +249,7 @@ diff -r -u mobileterminal-286/MobileTerminal.m mobileterminal-286+iPhone/MobileT
}
}
-@@ -404,7 +412,7 @@
+@@ -404,7 +409,7 @@
{
if (numTerminals > 1)
{
@@ -194,7 +258,7 @@ diff -r -u mobileterminal-286/MobileTerminal.m mobileterminal-286+iPhone/MobileT
float width = landscape ? window.frame.size.height : window.frame.size.width;
if (pos.x > width/2 && pos.x < width*3/4)
{
-@@ -679,20 +687,18 @@
+@@ -679,20 +684,18 @@
{
//log(@"create terminal");
VT100Terminal * terminal = [[VT100Terminal alloc] init];
@@ -220,7 +284,7 @@ diff -r -u mobileterminal-286/MobileTerminal.m mobileterminal-286+iPhone/MobileT
//log(@"create textview");
-@@ -702,6 +708,8 @@
+@@ -702,6 +705,8 @@
identifier: numTerminals];
//log(@"textview created");
[textviews addObject:textview];
@@ -389,24 +453,52 @@ diff -r -u mobileterminal-286/Settings.m mobileterminal-286+iPhone/Settings.m
[tc setObject:(i > 0 ? @"clear" : @"") forKey:@"args"];
NSMutableArray * ca = [NSMutableArray arrayWithCapacity:NUM_TERMINAL_COLORS];
+diff -r -u mobileterminal-286/ShellKeyboard.h mobileterminal-286+iPhone/ShellKeyboard.h
+--- mobileterminal-286/ShellKeyboard.h 2008-05-07 08:07:55.000000000 +0000
++++ mobileterminal-286+iPhone/ShellKeyboard.h 2008-08-02 09:40:25.000000000 +0000
+@@ -11,12 +11,12 @@
+ @interface ShellKeyboard : UIKeyboard<KeyboardInputProtocol>
+ {
+ id inputDelegate;
+- UITextView* inputView;
++ id handler;
+ }
+
+ - (id)initWithFrame:(CGRect)frame;
+-- (UITextView*)inputView;
+ - (void)setInputDelegate:(id)delegate;
+ - (void)handleKeyPress:(unichar)c;
++- (void)enable;
+
+ @end
diff -r -u mobileterminal-286/ShellKeyboard.m mobileterminal-286+iPhone/ShellKeyboard.m
--- mobileterminal-286/ShellKeyboard.m 2008-05-07 08:07:55.000000000 +0000
-+++ mobileterminal-286+iPhone/ShellKeyboard.m 2008-07-06 19:33:23.000000000 +0000
-@@ -1,6 +1,56 @@
++++ mobileterminal-286+iPhone/ShellKeyboard.m 2008-08-02 09:40:49.000000000 +0000
+@@ -1,22 +1,69 @@
// ShellKeyboard.m
#import "ShellKeyboard.h"
++#include <objc/runtime.h>
++#import <UIKit/UIDefaultKeyboardInput.h>
+-// Override settings of the default keyboard implementation
+-@implementation UIKeyboardImpl (DisableFeatures)
+/* iPhoneOS 2.0 Compatibility {{{ */
+#ifdef __OBJC2__
+@interface UICGColor : NSObject {
+}
-+
+
+-- (BOOL)autoCapitalizationPreference
+-{
+- return false;
+- (id) initWithCGColor:(CGColorRef)color;
+@end
+
+@interface UIFont {
-+}
-+
+ }
+
+-- (BOOL)autoCorrectionPreference
+-{
+- return false;
+- (UIFont *) fontWithSize:(CGFloat)size;
+@end
+
@@ -420,8 +512,8 @@ diff -r -u mobileterminal-286/ShellKeyboard.m mobileterminal-286+iPhone/ShellKey
+
+- (CGColorRef) cgColor {
+ return [self CGColor];
-+}
-+
+ }
+
+- (CGColorRef) CGColor {
+ return (CGColorRef) self;
+}
@@ -443,34 +535,65 @@ diff -r -u mobileterminal-286/ShellKeyboard.m mobileterminal-286+iPhone/ShellKey
+}
+
+@end
++
++@interface UIDefaultKeyboardInput (iPhoneOS)
++- (id)textInputTraits;
++@end
++
++@interface UITextInputTraits
++- (void)setAutocorrectionType:(int)type;
++- (void)setAutocapitalizationType:(int)type;
++- (void)setEnablesReturnKeyAutomatically:(BOOL)val;
+ @end
+#endif
+/* }}} */
-+
- // Override settings of the default keyboard implementation
- @implementation UIKeyboardImpl (DisableFeatures)
-@@ -37,6 +87,14 @@
+-@interface TextInputHandler : UITextView
++@interface TextInputHandler : UIDefaultKeyboardInput
+ {
+ ShellKeyboard* shellKeyboard;
+ }
+@@ -30,26 +77,49 @@
+ - (id)initWithKeyboard:(ShellKeyboard*)keyboard;
+ {
+ self = [super initWithFrame:CGRectMake(0.0f, 0.0f, 0.0f, 0.0f)];
+- shellKeyboard = keyboard;
++ if ( self ) {
++ shellKeyboard = keyboard;
++ [[self textInputTraits] setAutocorrectionType:1];
++ [[self textInputTraits] setAutocapitalizationType:0];
++ [[self textInputTraits] setEnablesReturnKeyAutomatically:NO];
++ }
+ return self;
+ }
+
++#if 0
- (BOOL)webView:(id)fp8 shouldDeleteDOMRange:(id)fp12
{
[shellKeyboard handleKeyPress:0x08];
+ return false;
+}
+
-+- (BOOL)webView:(id)fp8 doCommandBySelector:(SEL)fp12
++#endif
++
++- (void)deleteBackward
+{
-+ if (fp12 == @selector(deleteBackward:))
+ [shellKeyboard handleKeyPress:0x08];
-+ return false;
}
- - (BOOL)webView:(id)fp8 shouldInsertText:(id)character
-@@ -48,6 +106,17 @@
- return false;
+-- (BOOL)webView:(id)fp8 shouldInsertText:(id)character
+- replacingDOMRange:(id)fp16
+- givenAction:(int)fp20
++- (void)insertText:(id)character
+ {
+ if ([character length] != 1) {
+ [NSException raise:@"Unsupported" format:@"Unhandled multi-char insert!"];
+- return false;
}
[shellKeyboard handleKeyPress:[character characterAtIndex:0]];
-+ return false;
-+}
-+
+ }
+
++#if 0 // for Debugging
+- (NSMethodSignature *) methodSignatureForSelector:(SEL)selector {
+ fprintf(stderr, "[%s]S-%s\n", class_getName(self->isa), sel_getName(selector));
+ return [super methodSignatureForSelector:selector];
@@ -479,8 +602,49 @@ diff -r -u mobileterminal-286/ShellKeyboard.m mobileterminal-286+iPhone/ShellKey
+- (BOOL) respondsToSelector:(SEL)selector {
+ fprintf(stderr, "[%s]R-%s\n", class_getName(self->isa), sel_getName(selector));
+ return [super respondsToSelector:selector];
++}
++#endif
++
+ @end
+
+ // ShellKeyboard
+@@ -59,16 +129,12 @@
+ - (id)initWithFrame:(CGRect)frame
+ {
+ self = [super initWithFrame:frame];
+- inputDelegate = nil;
+- inputView = [[TextInputHandler alloc] initWithKeyboard:self];
++ if ( self ) {
++ handler = [[TextInputHandler alloc] initWithKeyboard:self];
++ }
+ return self;
+ }
+
+-- (UITextView*)inputView
+-{
+- return inputView;
+-}
+-
+ - (void)setInputDelegate:(id)delegate;
+ {
+ inputDelegate = delegate;
+@@ -79,4 +145,17 @@
+ [inputDelegate handleKeyPress:c];
}
++- (void)enable
++{
++ [self activate];
++ [[UIKeyboardImpl activeInstance] setDelegate:handler];
++}
++
++- (void)dealloc
++{
++ [handler release];
++
++ [super dealloc];
++}
++
@end
diff -r -u mobileterminal-286/SubProcess.m mobileterminal-286+iPhone/SubProcess.m
--- mobileterminal-286/SubProcess.m 2008-05-07 08:33:09.000000000 +0000