summaryrefslogtreecommitdiff
path: root/data/mobileterminal/port.diff
blob: 390d620c0fcc14fab0070c3d1cbf8b1075d2c05e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
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
@@ -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)];
+	mouseDownPos = [delegate viewPointForWindowPoint:GSEventGetLocationInWindow(event).origin];
   [delegate showMenu:mouseDownPos];
 	
 	[super mouseDown:event];
@@ -132,7 +151,7 @@
 	
 	if (![[MenuView sharedInstance] visible])
 	{
-		CGPoint end = [delegate viewPointForWindowPoint:GSEventGetLocationInWindow(event)];
+		CGPoint end = [delegate viewPointForWindowPoint:GSEventGetLocationInWindow(event).origin];
 		CGPoint vector = CGPointMake(end.x - mouseDownPos.x, end.y - mouseDownPos.y);
 
 		float r = sqrtf(vector.x*vector.x + vector.y*vector.y);
@@ -168,7 +187,7 @@
 		}
     else if (r < 10.0f)
     {
-      mouseDownPos = [delegate viewPointForWindowPoint:GSEventGetLocationInWindow(event)];
+      mouseDownPos = [delegate viewPointForWindowPoint:GSEventGetLocationInWindow(event).origin];
       if ([[MenuView sharedInstance] visible])
       {
         [[MenuView sharedInstance] hide];
diff -r -u mobileterminal-286/Log.h mobileterminal-286+iPhone/Log.h
--- mobileterminal-286/Log.h	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/Log.h	2008-05-07 08:15:04.000000000 +0000
@@ -1,6 +1,7 @@
 
 #include <Foundation/Foundation.h>
 #include <CoreFoundation/CoreFoundation.h>
+#include <CoreGraphics/CGGeometry.h>
 
 #define logf(s,...)    [FileLog logFile:__FILE__ lineNumber:__LINE__ format:(s),##__VA_ARGS__]
 #define logfRect(s, r) [FileLog logFile:__FILE__ lineNumber:__LINE__ string:(s) rect:(r)] 
diff -r -u mobileterminal-286/Log.m mobileterminal-286+iPhone/Log.m
--- mobileterminal-286/Log.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/Log.m	2008-05-07 08:16:51.000000000 +0000
@@ -21,7 +21,7 @@
 	aFileHandle = [NSFileHandle fileHandleForWritingAtPath:aFile];
 	[aFileHandle truncateFileAtOffset:[aFileHandle seekToEndOfFile]];
 	
-	[aFileHandle writeData:[[NSString stringWithFormat: @"%@\n", str] dataUsingEncoding:nil]];
+	[aFileHandle writeData:[[NSString stringWithFormat: @"%@\n", str] dataUsingEncoding:kCFStringEncodingUTF8]];
 }
 
 //_______________________________________________________________________________
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
@@ -2,9 +2,18 @@
 
 CFLAGS=-Wall -O7
 
+ifeq ($(PKG_ARCH),iphoneos-arm)
+QUARTZ=QuartzCore -framework ImageIO
+i20=-I/apl/i20
+else
+QUARTZ=LayerKit
+i20=
+endif
+
 LDFLAGS=-lobjc -framework CoreFoundation -framework Foundation \
-        -framework UIKit -framework LayerKit -framework CoreGraphics \
-        -framework GraphicsServices -lcurses  -lobjc
+        -framework UIKit -framework $(QUARTZ) -framework CoreGraphics \
+        -framework GraphicsServices -lcurses  -lobjc \
+	-F${PKG_ROOT}/System/Library/PrivateFrameworks
 
 all:	Terminal
 
@@ -27,7 +36,7 @@
 	$(CC) $(LDFLAGS) -o $@ $^
 
 %.o:	%.m
-	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ $(i20)
 
 depend:
 	@makedepend *.m &> /dev/null
diff -r -u mobileterminal-286/Menu.m mobileterminal-286+iPhone/Menu.m
--- mobileterminal-286/Menu.m	2008-05-07 08:07:55.000000000 +0000
+++ mobileterminal-286+iPhone/Menu.m	2008-07-05 21:29:08.000000000 +0000
@@ -127,7 +127,7 @@
 + (Menu*) menuWithArray:(NSArray*)array
 {
   int i;
-  Menu * menu = [[Menu alloc] init];
+  Menu * menu = [[[Menu alloc] init] autorelease];
   for (i = 0; i < 12; i++)
   {
     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
@@ -17,9 +17,17 @@
 #import <Foundation/Foundation.h>
 #import <GraphicsServices/GraphicsServices.h>
 #import <UIKit/UIView-Geometry.h>
-#import <LayerKit/LKAnimation.h>
 #import <CoreGraphics/CoreGraphics.h>
 
+#ifdef __OBJC2__
+#import <QuartzCore/CoreAnimation.h>
+#define LKAnimation CAAnimation
+#define LKTimingFunction CAMediaTimingFunction
+#define LKTransition CATransition
+#else
+#import <LayerKit/LKAnimation.h>
+#endif
+
 //_______________________________________________________________________________
 //_______________________________________________________________________________
 
@@ -57,7 +65,7 @@
 	[settings registerDefaults];
 	[settings readUserDefaults];
 
-  menu = [Menu menuWithArray:[settings menu]];
+  menu = [[Menu menuWithArray:[settings menu]] retain];
   
 	activeTerminal = 0;
 	
@@ -78,10 +86,10 @@
   	
 	for (numTerminals = 0; numTerminals < ([settings multipleTerminals] ? MAXTERMINALS : 1); numTerminals++)
 	{
-		VT100Terminal * terminal = [[VT100Terminal alloc] init];
-		VT100Screen   * screen   = [[VT100Screen alloc] initWithIdentifier: numTerminals];
-		SubProcess    * process  = [[SubProcess alloc] initWithDelegate:self identifier: numTerminals];
-		UIScroller    * scroller = [[UIScroller alloc] init];
+		VT100Terminal * terminal = [[[VT100Terminal alloc] init] autorelease];
+		VT100Screen   * screen   = [[[VT100Screen alloc] initWithIdentifier: numTerminals] autorelease];
+		SubProcess    * process  = [[[SubProcess alloc] initWithDelegate:self identifier: numTerminals] autorelease];
+		UIScroller    * scroller = [[[UIScroller alloc] init] autorelease];
 		
 		[screens   addObject: screen];
 		[terminals addObject: terminal];
@@ -91,10 +99,10 @@
 		[screen setTerminal:terminal];
 		[terminal setScreen:screen];		
 		
-		PTYTextView * textview = [[PTYTextView alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 244.0f)
+		PTYTextView * textview = [[[PTYTextView alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 244.0f)
 																												 source: screen
 																											 scroller: scroller
-																										 identifier: numTerminals];		
+																										 identifier: numTerminals] autorelease];		
 		[textviews addObject:textview];
 	}
 	
@@ -356,7 +364,7 @@
   }
   else
   {
-    [[self activeProcess] write:[input cString] length:[input length]];
+    [[self activeProcess] write:[input UTF8String] length:[input length]];
   }    
 }
 
@@ -404,7 +412,7 @@
 {
 	if (numTerminals > 1)
 	{
-		CGPoint pos = GSEventGetLocationInWindow(event);
+		CGPoint pos = GSEventGetLocationInWindow(event).origin;
 		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 @@
 	{
     //log(@"create terminal");    
 		VT100Terminal * terminal = [[VT100Terminal alloc] init];
+		[terminals addObject: terminal];
     //log(@"create screen");    
 		VT100Screen   * screen   = [[VT100Screen alloc] initWithIdentifier: numTerminals];
+		[screens   addObject: screen];
+		[screen setTerminal:terminal];
+		[terminal setScreen:screen];		
     //log(@"create process");    
-		SubProcess    * process  = [[SubProcess alloc] initWithDelegate:self identifier: numTerminals];
     //log(@"process created");    
 		UIScroller    * scroller = [[UIScroller alloc] init];
-
-		[screens   addObject: screen];
-		[terminals addObject: terminal];
-		[processes addObject: process];
 		[scrollers addObject: scroller];
+
 		
-		[screen setTerminal:terminal];
-		[terminal setScreen:screen];		
 
     //log(@"create textview");    
 
@@ -702,6 +708,8 @@
 																										 identifier: numTerminals];		
     //log(@"textview created");    
 		[textviews addObject:textview];		
+		SubProcess    * process  = [[SubProcess alloc] initWithDelegate:self identifier: numTerminals];
+		[processes addObject: process];
 	}
 
 	[self addStatusBarImageNamed:[NSString stringWithFormat:@"MobileTerminal0"] removeOnAbnormalExit:YES];
diff -r -u mobileterminal-286/PieView.m mobileterminal-286+iPhone/PieView.m
--- mobileterminal-286/PieView.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/PieView.m	2008-05-07 08:13:35.000000000 +0000
@@ -71,7 +71,7 @@
   float height = 14.0f;
 
   NSString *fontName = @"HelveticaBold";
-  CGContextSelectFont(context, [fontName cString], height, kCGEncodingMacRoman);
+  CGContextSelectFont(context, [fontName UTF8String], height, kCGEncodingMacRoman);
   CGFontRef font = CGContextGetFont(context);
 
   NSString * text = [self title];
diff -r -u mobileterminal-286/Preferences.h mobileterminal-286+iPhone/Preferences.h
--- mobileterminal-286/Preferences.h	2008-05-07 08:07:55.000000000 +0000
+++ mobileterminal-286+iPhone/Preferences.h	2008-07-04 09:50:46.000000000 +0000
@@ -10,7 +10,6 @@
 #import <UIKit/UISwitchControl.h>
 #import "UINavigationController.h"
 #import <UIKit/UIPickerView.h>
-#import <UIKit/UIPickerTable.h>
 #import <UIKit/UIPickerTableCell.h>
 #import "Color.h"
 
@@ -24,7 +23,7 @@
 
 //_______________________________________________________________________________
 
-@interface UIPickerTable (PickerTableExtensions)
+@interface UITable (PickerTableExtensions)
 @end
 
 @interface UIPickerView (PickerViewExtensions)
@@ -39,7 +38,7 @@
 	NSArray * fontNames;
 	
 	UIPickerView * fontPicker;
-	UIPickerTable * pickerTable;
+	UITable * pickerTable;
 	
 	NSString * selectedFont;
 }
diff -r -u mobileterminal-286/Preferences.m mobileterminal-286+iPhone/Preferences.m
--- mobileterminal-286/Preferences.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/Preferences.m	2008-07-04 09:51:01.000000000 +0000
@@ -13,12 +13,12 @@
 #import "Log.h"
 
 #import <UIKit/UISimpleTableCell.h> 
-#import "UIFieldEditor.h"
+#import <UIKit/UIFieldEditor.h>
 
 //_______________________________________________________________________________
 //_______________________________________________________________________________
 
-@implementation UIPickerTable (PickerTableExtensions)
+@implementation UITable (PickerTableExtensions)
 
 //_______________________________________________________________________________
 
@@ -40,7 +40,9 @@
 @implementation UIPickerView (PickerViewExtensions)
 
 -(float) tableRowHeight { return 22.0f; }
+#ifndef __OBJC2__
 -(id) delegate { return _delegate; }
+#endif
 
 //_______________________________________________________________________________
 
@@ -50,7 +52,7 @@
 	
 	for (c = 0; c < [self numberOfColumns]; c++)
 	{
-		UIPickerTable * table = [self tableForColumn:c];
+		UITable * table = [self tableForColumn:c];
 		for (r = 0; r < [table numberOfRows]; r++)
 		{
 			[[[table cellAtRow:r column:0] iconImageView] setFrame:CGRectMake(0,0,0,0)]; 
diff -r -u mobileterminal-286/PTYTextView.m mobileterminal-286+iPhone/PTYTextView.m
--- mobileterminal-286/PTYTextView.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/PTYTextView.m	2008-07-05 21:25:52.000000000 +0000
@@ -238,11 +238,13 @@
 	if (!fontRef) 
 	{		
 		TerminalConfig * config = [[[Settings sharedInstance] terminalConfigs] objectAtIndex:termid];
-		const char * font = [config.font cString];
+		const char * font = [config.font UTF8String];
     // First time through: cache the fontRef. This lookup is expensive.
 		fontSize = config.fontSize;
     CGContextSelectFont(context, font, floor(lineHeight), kCGEncodingMacRoman);
-    fontRef = (CGFontRef)CFRetain(CGContextGetFont(context));
+    fontRef = CGContextGetFont(context);
+    if (fontRef != NULL)
+    fontRef = (CGFontRef)CFRetain(fontRef);
   } 
 	else 
 	{
diff -r -u mobileterminal-286/Settings.h mobileterminal-286+iPhone/Settings.h
--- mobileterminal-286/Settings.h	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/Settings.h	2008-05-07 08:30:30.000000000 +0000
@@ -18,12 +18,13 @@
   NSString * font;
   NSString * args;
   
-  RGBAColor colors[NUM_TERMINAL_COLORS];
+  RGBAColor _colors[NUM_TERMINAL_COLORS];
 }
 
 - (NSString*) fontDescription;
+- (RGBAColor *) colors;
 
-@property RGBAColor * colors;
+@property (getter = colors) RGBAColor *colors;
 @property BOOL autosize;
 @property int width;
 @property int fontSize;
diff -r -u mobileterminal-286/Settings.m mobileterminal-286+iPhone/Settings.m
--- mobileterminal-286/Settings.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/Settings.m	2008-07-20 04:29:04.000000000 +0000
@@ -24,7 +24,7 @@
   width = 45;
   fontSize = 12;
   fontWidth = 0.6f;
-  font = @"CourierNewBold";
+  font = @"CourierNewPS-BoldMT";
   args = @"";
   
   return self;
@@ -62,7 +62,7 @@
 }
 
 - (RGBAColor*) colors {
-  return colors;
+  return _colors;
 }
 
 //_______________________________________________________________________________
@@ -97,11 +97,11 @@
 {
   self = [super init];
 
-  terminalConfigs = [NSArray arrayWithObjects:
+  terminalConfigs = [[NSArray arrayWithObjects:
                      [[TerminalConfig alloc] init],
                      [[TerminalConfig alloc] init],
                      [[TerminalConfig alloc] init],
-                     [[TerminalConfig alloc] init], nil];
+                     [[TerminalConfig alloc] init], nil] retain];
   
   gestureFrameColor = RGBAColorMake(1.0f, 1.0f, 1.0f, 0.05f);
   multipleTerminals = NO;
@@ -154,7 +154,7 @@
     [tc setObject:[NSNumber numberWithInt:45]     forKey:@"width"];
     [tc setObject:[NSNumber numberWithInt:12]     forKey:@"fontSize"];
     [tc setObject:[NSNumber numberWithFloat:0.6f] forKey:@"fontWidth"];
-    [tc setObject:@"CourierNewBold" forKey:@"font"];
+    [tc setObject:@"CourierNewPS-BoldMT" forKey:@"font"];
     [tc setObject:(i > 0 ? @"clear" : @"") forKey:@"args"];
 
     NSMutableArray * ca = [NSMutableArray arrayWithCapacity:NUM_TERMINAL_COLORS];
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 @@
 // ShellKeyboard.m
 #import "ShellKeyboard.h"
 
+/* iPhoneOS 2.0 Compatibility {{{ */
+#ifdef __OBJC2__
+@interface UICGColor : NSObject {
+}
+
+- (id) initWithCGColor:(CGColorRef)color;
+@end
+
+@interface UIFont {
+}
+
+- (UIFont *) fontWithSize:(CGFloat)size;
+@end
+
+@interface NSObject (iPhoneOS)
+- (CGColorRef) cgColor;
+- (CGColorRef) CGColor;
+- (void) set;
+@end
+
+@implementation NSObject (iPhoneOS)
+
+- (CGColorRef) cgColor {
+    return [self CGColor];
+}
+
+- (CGColorRef) CGColor {
+    return (CGColorRef) self;
+}
+
+- (void) set {
+    [[[[objc_getClass("UICGColor") alloc] initWithCGColor:[self CGColor]] autorelease] set];
+}
+
+@end
+
+@interface UITextView (iPhoneOS)
+- (void) setTextSize:(float)size;
+@end
+
+@implementation UITextView (iPhoneOS)
+
+- (void) setTextSize:(float)size {
+    [self setFont:[[self font] fontWithSize:size]];
+}
+
+@end
+#endif
+/* }}} */
+
 // Override settings of the default keyboard implementation
 @implementation UIKeyboardImpl (DisableFeatures)
 
@@ -37,6 +87,14 @@
 - (BOOL)webView:(id)fp8 shouldDeleteDOMRange:(id)fp12
 {
   [shellKeyboard handleKeyPress:0x08];
+  return false;
+}
+
+- (BOOL)webView:(id)fp8 doCommandBySelector:(SEL)fp12
+{
+  if (fp12 == @selector(deleteBackward:))
+    [shellKeyboard handleKeyPress:0x08];
+  return false;
 }
 
 - (BOOL)webView:(id)fp8 shouldInsertText:(id)character
@@ -48,6 +106,17 @@
     return false;
   }
   [shellKeyboard handleKeyPress:[character characterAtIndex:0]];
+  return false;
+}
+
+- (NSMethodSignature *) methodSignatureForSelector:(SEL)selector {
+    fprintf(stderr, "[%s]S-%s\n", class_getName(self->isa), sel_getName(selector));
+    return [super methodSignatureForSelector:selector];
+}
+
+- (BOOL) respondsToSelector:(SEL)selector {
+    fprintf(stderr, "[%s]R-%s\n", class_getName(self->isa), sel_getName(selector));
+    return [super respondsToSelector:selector];
 }
 
 @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
+++ mobileterminal-286+iPhone/SubProcess.m	2008-05-07 08:13:35.000000000 +0000
@@ -140,7 +140,7 @@
   if (arg != nil && [arg length] > 0) 
   {    
     // A command line argument was passed to the program
-    const char* path = [arg cString];
+    const char* path = [arg UTF8String];
     struct stat st;
     if ((stat(path, &st) == 0) && ((st.st_mode & S_IFDIR) != 0)) // it's a path, issue a cd command
     {
@@ -150,7 +150,7 @@
     } 
     else // just print the command 
     {
-      write(fd, [arg cString], [arg length]);
+      write(fd, [arg UTF8String], [arg length]);
       write(fd, "\n", 1);
     }
   }
@@ -186,7 +186,7 @@
 {
   // HACK: Just pretend the message came from the child
   NSLog(message);
-  [delegate handleStreamOutput:[message cString] length:[message length] identifier:termid];
+  [delegate handleStreamOutput:[message UTF8String] length:[message length] identifier:termid];
 }
 
 - (void)setWidth:(int)width height:(int)height
diff -r -u mobileterminal-286/svnversion.h mobileterminal-286+iPhone/svnversion.h
--- mobileterminal-286/svnversion.h	2008-05-07 08:13:19.000000000 +0000
+++ mobileterminal-286+iPhone/svnversion.h	2008-07-06 19:26:10.000000000 +0000
@@ -1 +1 @@
-#define SVN_VERSION @"287"
+#define SVN_VERSION @"298"
diff -r -u mobileterminal-286/Tools.h mobileterminal-286+iPhone/Tools.h
--- mobileterminal-286/Tools.h	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/Tools.h	2008-05-07 08:19:04.000000000 +0000
@@ -3,6 +3,7 @@
 //  Terminal
 
 #import <Foundation/Foundation.h>
+#import <CoreGraphics/CGImage.h>
 
 //_______________________________________________________________________________
 
diff -r -u mobileterminal-286/Tools.m mobileterminal-286+iPhone/Tools.m
--- mobileterminal-286/Tools.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/Tools.m	2008-05-07 08:21:40.000000000 +0000
@@ -4,6 +4,7 @@
 
 #import "Tools.h"
 #import "Log.h"
+#include <ImageIO/CGImageDestination.h>
 
 //_______________________________________________________________________________
 //_______________________________________________________________________________
@@ -28,7 +29,7 @@
 BOOL writeImageToPNG (CGImageRef image, NSString * filePath) 
 {
   if (image == nil) { log(@"[ERROR] no image"); return NO; }
-  CFURLRef cfurl = CFURLCreateFromFileSystemRepresentation (NULL, (const UInt8 *)[filePath cString], [filePath length], 0);
+  CFURLRef cfurl = CFURLCreateFromFileSystemRepresentation (NULL, (const UInt8 *)[filePath UTF8String], [filePath length], 0);
   CGImageDestinationRef imageDest = CGImageDestinationCreateWithURL(cfurl, (CFStringRef)@"public.png", 1, nil);
   if (imageDest==nil) { log(@"[ERROR] no image destination"); return NO; }  
   CGImageDestinationAddImage(imageDest, image, nil);
diff -r -u mobileterminal-286/VT100Terminal.m mobileterminal-286+iPhone/VT100Terminal.m
--- mobileterminal-286/VT100Terminal.m	2008-05-07 08:33:09.000000000 +0000
+++ mobileterminal-286+iPhone/VT100Terminal.m	2008-05-07 08:13:35.000000000 +0000
@@ -1226,12 +1226,12 @@
   static int issetup = 0;
   if (!issetup) { issetup = 1;
   // this crashes on non-Cydia systems when called multiple times  
-  setupterm((char *)[termType cString], fileno(stdout), &r);
+  setupterm((char *)[termType UTF8String], fileno(stdout), &r);
   }
 
   if (r!=1) 
   {
-    log(@"Terminal type %s is not defined (%d)", [termType cString], r);
+    log(@"Terminal type %s is not defined (%d)", [termType UTF8String], r);
     for(i = 0; i < TERMINFO_KEYS; i ++) 
     {
       if (key_strings[i]) free(key_strings[i]);