mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2025-02-21 11:29:04 +00:00
git-svn-id: svn://qnap.local/TwoTerm/trunk@1888 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
parent
53d6e2db54
commit
98e13cb172
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>ActivePerspectiveName</key>
|
||||
<string>Project</string>
|
||||
<string>Debug</string>
|
||||
<key>AllowedModules</key>
|
||||
<array>
|
||||
<dict>
|
||||
@ -272,6 +272,7 @@
|
||||
<string>080E96DDFE201D6D7F000001</string>
|
||||
<string>29B97315FDCFA39411CA2CEA</string>
|
||||
<string>29B97317FDCFA39411CA2CEA</string>
|
||||
<string>B66979CE11E6BCAE002ED475</string>
|
||||
<string>1DDD58140DA1D0A300B32029</string>
|
||||
<string>B676065011DEBAE900D6B66C</string>
|
||||
<string>29B97323FDCFA39411CA2CEA</string>
|
||||
@ -284,13 +285,13 @@
|
||||
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
|
||||
<array>
|
||||
<array>
|
||||
<integer>12</integer>
|
||||
<integer>8</integer>
|
||||
<integer>26</integer>
|
||||
<integer>19</integer>
|
||||
<integer>0</integer>
|
||||
</array>
|
||||
</array>
|
||||
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
|
||||
<string>{{0, 151}, {324, 1060}}</string>
|
||||
<string>{{0, 0}, {324, 1060}}</string>
|
||||
</dict>
|
||||
<key>PBXTopSmartGroupGIDs</key>
|
||||
<array/>
|
||||
@ -306,8 +307,6 @@
|
||||
<string>MainColumn</string>
|
||||
<real>324</real>
|
||||
</array>
|
||||
<key>RubberWindowFrame</key>
|
||||
<string>0 59 1920 1119 0 0 1920 1178 </string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXSmartGroupTreeModule</string>
|
||||
@ -323,7 +322,7 @@
|
||||
<key>PBXProjectModuleGUID</key>
|
||||
<string>B676054211DADB9000D6B66C</string>
|
||||
<key>PBXProjectModuleLabel</key>
|
||||
<string>PTSE.mm</string>
|
||||
<string>EmulatorView.mm</string>
|
||||
<key>PBXSplitModuleInNavigatorKey</key>
|
||||
<dict>
|
||||
<key>Split0</key>
|
||||
@ -331,11 +330,11 @@
|
||||
<key>PBXProjectModuleGUID</key>
|
||||
<string>B676054311DADB9000D6B66C</string>
|
||||
<key>PBXProjectModuleLabel</key>
|
||||
<string>PTSE.mm</string>
|
||||
<string>EmulatorView.mm</string>
|
||||
<key>_historyCapacity</key>
|
||||
<integer>0</integer>
|
||||
<key>bookmark</key>
|
||||
<string>B67287F012BD29A100774C3B</string>
|
||||
<string>B6C99E6912BF064F00C379FF</string>
|
||||
<key>history</key>
|
||||
<array>
|
||||
<string>B676058811DAE21100D6B66C</string>
|
||||
@ -349,7 +348,6 @@
|
||||
<string>B699A0C211E58D3B00F54CC8</string>
|
||||
<string>B66979BD11E6ACB9002ED475</string>
|
||||
<string>B6697A1B11E6C28A002ED475</string>
|
||||
<string>B6697A5211E7E072002ED475</string>
|
||||
<string>B6697A5311E7E072002ED475</string>
|
||||
<string>B6697A5411E7E072002ED475</string>
|
||||
<string>B6697A5511E7E072002ED475</string>
|
||||
@ -367,15 +365,16 @@
|
||||
<string>B6FA9C5411FCE85B00F38EC1</string>
|
||||
<string>B6FA9C6611FCE9BC00F38EC1</string>
|
||||
<string>B6D1D11711FFA83D00196D8E</string>
|
||||
<string>B644FBDD1269343B009523CE</string>
|
||||
<string>B67B3CD912B6F9F50033AE07</string>
|
||||
<string>B67B3D0E12B724790033AE07</string>
|
||||
<string>B67B3D1212B724790033AE07</string>
|
||||
<string>B61069C412B72942007204C0</string>
|
||||
<string>B672878912B9C36800774C3B</string>
|
||||
<string>B67287EC12BD29A100774C3B</string>
|
||||
<string>B67287ED12BD29A100774C3B</string>
|
||||
<string>B67287EF12BD29A100774C3B</string>
|
||||
<string>B662524E12BD9D14002B1529</string>
|
||||
<string>B6F243C512BD9E070071AF8A</string>
|
||||
<string>B6F243D812BD9E1A0071AF8A</string>
|
||||
<string>B6F243F112BDA12E0071AF8A</string>
|
||||
<string>B637CCFC12BEA992009FDC31</string>
|
||||
<string>B6C99E2712BEF7BF00C379FF</string>
|
||||
<string>B6C99E4D12BF011300C379FF</string>
|
||||
</array>
|
||||
</dict>
|
||||
<key>SplitCount</key>
|
||||
@ -389,18 +388,16 @@
|
||||
<key>GeometryConfiguration</key>
|
||||
<dict>
|
||||
<key>Frame</key>
|
||||
<string>{{0, 0}, {1574, 414}}</string>
|
||||
<key>RubberWindowFrame</key>
|
||||
<string>0 59 1920 1119 0 0 1920 1178 </string>
|
||||
<string>{{0, 0}, {1574, 361}}</string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXNavigatorGroup</string>
|
||||
<key>Proportion</key>
|
||||
<string>414pt</string>
|
||||
<string>361pt</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Proportion</key>
|
||||
<string>659pt</string>
|
||||
<string>712pt</string>
|
||||
<key>Tabs</key>
|
||||
<array>
|
||||
<dict>
|
||||
@ -414,7 +411,7 @@
|
||||
<key>GeometryConfiguration</key>
|
||||
<dict>
|
||||
<key>Frame</key>
|
||||
<string>{{10, 27}, {1574, 632}}</string>
|
||||
<string>{{10, 27}, {1574, 685}}</string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>XCDetailModule</string>
|
||||
@ -430,14 +427,12 @@
|
||||
<key>GeometryConfiguration</key>
|
||||
<dict>
|
||||
<key>Frame</key>
|
||||
<string>{{10, 27}, {1574, 560}}</string>
|
||||
<string>{{10, 27}, {1574, 685}}</string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXProjectFindModule</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>BecomeActive</key>
|
||||
<true/>
|
||||
<key>ContentConfiguration</key>
|
||||
<dict>
|
||||
<key>PBXCVSModuleFilterTypeKey</key>
|
||||
@ -471,9 +466,7 @@
|
||||
<key>GeometryConfiguration</key>
|
||||
<dict>
|
||||
<key>Frame</key>
|
||||
<string>{{10, 27}, {1574, 632}}</string>
|
||||
<key>RubberWindowFrame</key>
|
||||
<string>0 59 1920 1119 0 0 1920 1178 </string>
|
||||
<string>{{10, 27}, {1574, 645}}</string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXCVSModule</string>
|
||||
@ -493,7 +486,7 @@
|
||||
<key>GeometryConfiguration</key>
|
||||
<dict>
|
||||
<key>Frame</key>
|
||||
<string>{{10, 27}, {1574, 571}}</string>
|
||||
<string>{{10, 27}, {1574, 685}}</string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXBuildResultsModule</string>
|
||||
@ -521,11 +514,11 @@
|
||||
</array>
|
||||
<key>TableOfContents</key>
|
||||
<array>
|
||||
<string>B672875112B9BF4800774C3B</string>
|
||||
<string>B6C99DFA12BEF1DC00C379FF</string>
|
||||
<string>1CA23ED40692098700951B8B</string>
|
||||
<string>B672875212B9BF4800774C3B</string>
|
||||
<string>B6C99DFB12BEF1DC00C379FF</string>
|
||||
<string>B676054211DADB9000D6B66C</string>
|
||||
<string>B672875312B9BF4800774C3B</string>
|
||||
<string>B6C99DFC12BEF1DC00C379FF</string>
|
||||
<string>1CA23EDF0692099D00951B8B</string>
|
||||
<string>1CA23EE00692099D00951B8B</string>
|
||||
<string>1CA23EE10692099D00951B8B</string>
|
||||
@ -577,6 +570,8 @@
|
||||
<dict>
|
||||
<key>Frame</key>
|
||||
<string>{{0, 0}, {1920, 403}}</string>
|
||||
<key>RubberWindowFrame</key>
|
||||
<string>-1 59 1920 1119 0 0 1920 1178 </string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXDebugCLIModule</string>
|
||||
@ -651,7 +646,11 @@
|
||||
</array>
|
||||
<key>Frame</key>
|
||||
<string>{{937, 0}, {983, 328}}</string>
|
||||
<key>RubberWindowFrame</key>
|
||||
<string>-1 59 1920 1119 0 0 1920 1178 </string>
|
||||
</dict>
|
||||
<key>RubberWindowFrame</key>
|
||||
<string>-1 59 1920 1119 0 0 1920 1178 </string>
|
||||
</dict>
|
||||
<key>Module</key>
|
||||
<string>PBXDebugSessionModule</string>
|
||||
@ -674,14 +673,14 @@
|
||||
</array>
|
||||
<key>TableOfContents</key>
|
||||
<array>
|
||||
<string>B672876412B9C27F00774C3B</string>
|
||||
<string>B6C99DFD12BEF1DC00C379FF</string>
|
||||
<string>1CCC7628064C1048000F2A68</string>
|
||||
<string>1CCC7629064C1048000F2A68</string>
|
||||
<string>B672876512B9C27F00774C3B</string>
|
||||
<string>B672876612B9C27F00774C3B</string>
|
||||
<string>B672876712B9C27F00774C3B</string>
|
||||
<string>B672876812B9C27F00774C3B</string>
|
||||
<string>B672876912B9C27F00774C3B</string>
|
||||
<string>B6C99DFE12BEF1DC00C379FF</string>
|
||||
<string>B6C99DFF12BEF1DC00C379FF</string>
|
||||
<string>B6C99E0012BEF1DC00C379FF</string>
|
||||
<string>B6C99E0112BEF1DC00C379FF</string>
|
||||
<string>B6C99E0212BEF1DC00C379FF</string>
|
||||
</array>
|
||||
<key>ToolbarConfigUserDefaultsMinorVersion</key>
|
||||
<string>2</string>
|
||||
@ -716,13 +715,16 @@
|
||||
<key>WindowOrderList</key>
|
||||
<array>
|
||||
<string>1C530D5B069F1CE1000CFCEE</string>
|
||||
<string>B67287F212BD29A100774C3B</string>
|
||||
<string>B672876B12B9C27F00774C3B</string>
|
||||
<string>B672876C12B9C27F00774C3B</string>
|
||||
<string>B6C99E3812BEF98500C379FF</string>
|
||||
<string>B6C99E3912BEF98500C379FF</string>
|
||||
<string>B6C99E0412BEF1DC00C379FF</string>
|
||||
<string>B6C99E0612BEF1DC00C379FF</string>
|
||||
<string>B6C99E2A12BEF7BF00C379FF</string>
|
||||
<string>/Users/kelvin/Projects/2Term/2Term.xcodeproj</string>
|
||||
<string>B6C99E2B12BEF7BF00C379FF</string>
|
||||
</array>
|
||||
<key>WindowString</key>
|
||||
<string>0 59 1920 1119 0 0 1920 1178 </string>
|
||||
<string>-1 59 1920 1119 0 0 1920 1178 </string>
|
||||
<key>WindowToolsV3</key>
|
||||
<array>
|
||||
<dict>
|
||||
@ -1095,7 +1097,7 @@
|
||||
<key>TableOfContents</key>
|
||||
<array>
|
||||
<string>1C530D5B069F1CE1000CFCEE</string>
|
||||
<string>B67287F112BD29A100774C3B</string>
|
||||
<string>B6C99E6A12BF064F00C379FF</string>
|
||||
<string>1C78EAAC065D492600B07095</string>
|
||||
</array>
|
||||
<key>ToolbarConfiguration</key>
|
||||
|
@ -16,6 +16,5 @@
|
||||
|
||||
@property (nonatomic, retain) NSColor *color;
|
||||
|
||||
-(void)initScanLines;
|
||||
|
||||
@end
|
||||
|
28
CurveView.m
28
CurveView.m
@ -21,33 +21,7 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initScanLines
|
||||
{
|
||||
NSMutableArray *filters;
|
||||
CIFilter *filter;
|
||||
|
||||
[self setWantsLayer: YES];
|
||||
|
||||
filters = [NSMutableArray arrayWithCapacity: 3];
|
||||
|
||||
|
||||
|
||||
//add the scanlines (which are vertical and must therfore be rotated
|
||||
|
||||
filter = [[ScanLineFilter new] autorelease];
|
||||
[filter setValue: [NSNumber numberWithFloat: 0.75] forKey: @"inputOpacity"];
|
||||
[filters addObject: filter];
|
||||
|
||||
//blur it a bit...
|
||||
|
||||
filter = [CIFilter filterWithName: @"CIGaussianBlur"];
|
||||
[filter setDefaults];
|
||||
[filter setValue: [NSNumber numberWithFloat: 0.33] forKey: @"inputRadius"];
|
||||
|
||||
[filters addObject: filter];
|
||||
|
||||
[self setContentFilters: filters];
|
||||
}
|
||||
|
||||
|
||||
#define curveSize 4
|
||||
|
||||
|
@ -14,6 +14,12 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern NSString *kNotificationNewTerminal;
|
||||
|
||||
extern NSString *kForegroundColor;
|
||||
extern NSString *kBackgroundColor;
|
||||
extern NSString *kScanLines;
|
||||
extern NSString *kClass;
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -9,4 +9,11 @@
|
||||
#import "Defaults.h"
|
||||
|
||||
|
||||
NSString *kNotificationNewTerminal = @"com.ksherlock.iiTerm: New Terminal";
|
||||
NSString *kNotificationNewTerminal = @"com.ksherlock.TwoTerm: New Terminal";
|
||||
|
||||
|
||||
NSString *kForegroundColor = @"Foreground Color";
|
||||
NSString *kBackgroundColor = @"Background Color";
|
||||
NSString *kScanLines = @"Scan Lines";
|
||||
|
||||
NSString *kClass = @"Class";
|
@ -65,6 +65,11 @@ private:
|
||||
NSImage *_cursorImg;
|
||||
NSTimer *_cursorTimer;
|
||||
BOOL _cursorOn;
|
||||
|
||||
|
||||
BOOL _scanLines;
|
||||
BOOL _inResizeTo;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -73,12 +78,15 @@ private:
|
||||
#endif
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) BOOL scanLines;
|
||||
@property (nonatomic, assign) int fd;
|
||||
|
||||
@property (nonatomic, retain) NSColor *foregroundColor;
|
||||
@property (nonatomic, retain) NSColor *backgroundColor;
|
||||
@property (nonatomic, retain) NSObject<Emulator> *emulator;
|
||||
|
||||
//@property (nonatomic, assign) iPoint cursor;
|
||||
|
||||
|
||||
-(void)startBackgroundReader;
|
||||
-(void)dataAvailable;
|
||||
-(void)invalidateIRect: (iRect)rect;
|
||||
|
185
EmulatorView.mm
185
EmulatorView.mm
@ -27,6 +27,11 @@
|
||||
@synthesize fd = _fd;
|
||||
@synthesize emulator = _emulator;
|
||||
|
||||
@synthesize foregroundColor = _foregroundColor;
|
||||
@synthesize backgroundColor = _backgroundColor;
|
||||
@synthesize scanLines = _scanLines;
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark properties
|
||||
|
||||
@ -40,12 +45,11 @@
|
||||
|
||||
-(void)awakeFromNib
|
||||
{
|
||||
//CIFilter *filter;
|
||||
//NSMutableArray *filters;
|
||||
|
||||
_charWidth = 7;
|
||||
_charHeight = 16;
|
||||
|
||||
_paddingLeft = 8;
|
||||
_paddingTop = 8;
|
||||
|
||||
|
||||
//_foregroundColor = [[NSColor greenColor] retain];
|
||||
@ -54,36 +58,16 @@
|
||||
_foregroundColor = [[NSColor whiteColor] retain];
|
||||
_backgroundColor = [[NSColor blueColor] retain];
|
||||
|
||||
/*
|
||||
[self setWantsLayer: YES];
|
||||
|
||||
filters = [NSMutableArray arrayWithCapacity: 3];
|
||||
|
||||
|
||||
|
||||
//add the scanlines (which are vertical and must therfore be rotated
|
||||
|
||||
filter = [[ScanLineFilter new] autorelease];
|
||||
[filter setValue: [NSNumber numberWithFloat: 0.75] forKey: @"inputOpacity"];
|
||||
[filters addObject: filter];
|
||||
|
||||
//blur it a bit...
|
||||
|
||||
filter = [CIFilter filterWithName: @"CIGaussianBlur"];
|
||||
[filter setDefaults];
|
||||
[filter setValue: [NSNumber numberWithFloat: 0.33] forKey: @"inputRadius"];
|
||||
|
||||
[filters addObject: filter];
|
||||
|
||||
[self setContentFilters: filters];
|
||||
*/
|
||||
|
||||
|
||||
//[self initScanLines];
|
||||
|
||||
_screen.setFD(_fd);
|
||||
_screen.setView(self);
|
||||
|
||||
_charGen = [[CharacterGenerator generator] retain];
|
||||
|
||||
_cursorImg = [[_charGen imageForCharacter: 0x7f] retain];
|
||||
_cursorImg = [[_charGen imageForCharacter: '_'] retain];
|
||||
|
||||
//_emulator = [VT52 new];
|
||||
|
||||
@ -95,6 +79,65 @@
|
||||
|
||||
}
|
||||
|
||||
-(void)setBackgroundColor:(NSColor *)color
|
||||
{
|
||||
if (_backgroundColor == color) return;
|
||||
|
||||
[_backgroundColor release];
|
||||
_backgroundColor = [color retain];
|
||||
|
||||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
|
||||
-(void)setForegroundColor:(NSColor *)color
|
||||
{
|
||||
if (_foregroundColor == color) return;
|
||||
|
||||
[_foregroundColor release];
|
||||
_foregroundColor = [color retain];
|
||||
|
||||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
|
||||
-(void)setScanLines:(BOOL)scanLines
|
||||
{
|
||||
if (_scanLines == scanLines) return;
|
||||
|
||||
_scanLines = scanLines;
|
||||
|
||||
if (_scanLines)
|
||||
{
|
||||
NSMutableArray *filters;
|
||||
CIFilter *filter;
|
||||
|
||||
[self setWantsLayer: YES];
|
||||
|
||||
filters = [NSMutableArray arrayWithCapacity: 3];
|
||||
|
||||
|
||||
|
||||
//add the scanlines (which are vertical and must therfore be rotated
|
||||
|
||||
filter = [[ScanLineFilter new] autorelease];
|
||||
[filter setValue: [NSNumber numberWithFloat: 0.75] forKey: @"inputOpacity"];
|
||||
[filters addObject: filter];
|
||||
|
||||
//blur it a bit...
|
||||
|
||||
filter = [CIFilter filterWithName: @"CIGaussianBlur"];
|
||||
[filter setDefaults];
|
||||
[filter setValue: [NSNumber numberWithFloat: 0.33] forKey: @"inputRadius"];
|
||||
|
||||
[filters addObject: filter];
|
||||
|
||||
[self setContentFilters: filters];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setContentFilters: nil];
|
||||
}
|
||||
}
|
||||
|
||||
-(BOOL)isFlipped
|
||||
{
|
||||
return YES;
|
||||
@ -181,9 +224,10 @@
|
||||
for (y = minY; y <= maxY; ++y)
|
||||
{
|
||||
NSRect charRect = NSMakeRect(_paddingLeft + x * _charWidth, _paddingTop + y *_charHeight, _charWidth, _charHeight);
|
||||
NSImage *img;
|
||||
//NSImage *img;
|
||||
CharInfo ci = _screen.getc(x, y);
|
||||
unsigned flag = ci.flag;
|
||||
uint8_t c = ci.c;
|
||||
|
||||
// todo -- check flags to determine fg/bg color, etc.
|
||||
// need to draw background individually....
|
||||
@ -196,7 +240,13 @@
|
||||
currentFront = _boldColor;
|
||||
|
||||
|
||||
img = [_charGen imageForCharacter: ci.c];
|
||||
if (flag & Screen::FlagMouseText)
|
||||
{
|
||||
if (c >= '@' && c <= '_') c |= 0x80;
|
||||
}
|
||||
|
||||
|
||||
//img = [_charGen imageForCharacter: c];
|
||||
|
||||
if (flag & Screen::FlagInverse)
|
||||
{
|
||||
@ -211,26 +261,12 @@
|
||||
}
|
||||
|
||||
if (_foregroundColor != currentFront) setFront = YES;
|
||||
|
||||
if (setFront) [currentFront setFill];
|
||||
|
||||
[_charGen drawCharacter: c atPoint: NSMakePoint(_paddingLeft + x * _charWidth, _paddingTop + y * _charHeight)];
|
||||
|
||||
|
||||
/*
|
||||
[img drawAtPoint: NSMakePoint(x * _charWidth, y * _charHeight)
|
||||
fromRect: NSZeroRect
|
||||
operation:NSCompositeCopy
|
||||
fraction: 1.0];
|
||||
*/
|
||||
if (img)
|
||||
{
|
||||
if (setFront) [currentFront setFill];
|
||||
|
||||
[img drawInRect: charRect
|
||||
fromRect: NSZeroRect
|
||||
operation: NSCompositeCopy
|
||||
fraction: 1.0
|
||||
respectFlipped: YES
|
||||
hints: nil];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,6 +407,7 @@
|
||||
uint8_t buffer[512];
|
||||
ssize_t size;
|
||||
|
||||
|
||||
size = read(_fd, buffer, sizeof(buffer));
|
||||
|
||||
if (size == 0) break;
|
||||
@ -381,8 +418,13 @@
|
||||
perror("[EmulatorView dataAvailable]");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
FILE *debug = fopen("/tmp/debug.txt", "a");
|
||||
fwrite(buffer, 1, size, debug);
|
||||
fflush(debug);
|
||||
fclose(debug);
|
||||
#endif
|
||||
pool = [NSAutoreleasePool new];
|
||||
_screen.beginUpdate();
|
||||
|
||||
@ -447,7 +489,9 @@
|
||||
wframe.size.height += newSize.height - bounds.size.height;
|
||||
wframe.size.width += newSize.width - bounds.size.width;
|
||||
|
||||
_inResizeTo = YES;
|
||||
[window setFrame: wframe display: YES animate: YES];
|
||||
_inResizeTo = NO;
|
||||
}
|
||||
|
||||
|
||||
@ -470,29 +514,52 @@
|
||||
#if 0
|
||||
-(void)viewWillStartLiveResize
|
||||
{
|
||||
NSLog(@"%s", sel_getName(_cmd));
|
||||
}
|
||||
|
||||
-(void)viewDidEndLiveResize
|
||||
{
|
||||
NSLog(@"%s", sel_getName(_cmd));
|
||||
//NSLog(@"%s", sel_getName(_cmd));
|
||||
|
||||
}
|
||||
#endif
|
||||
-(void)viewDidEndLiveResize
|
||||
{
|
||||
//NSLog(@"%s", sel_getName(_cmd));
|
||||
[super viewDidEndLiveResize];
|
||||
|
||||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* inLiveResize indicates the user is resizing the window -or- the -(void)setWindowFrame: animated: YES.
|
||||
* non-live resize indicates zooming or resizeTo w/o animation.
|
||||
*
|
||||
*
|
||||
*/
|
||||
-(void)setFrame:(NSRect)frameRect
|
||||
{
|
||||
//NSLog(@"%s", sel_getName(_cmd));
|
||||
|
||||
if ([self inLiveResize])
|
||||
BOOL inLiveResize = [self inLiveResize];
|
||||
|
||||
[super setFrame: frameRect];
|
||||
|
||||
|
||||
if (inLiveResize && _inResizeTo)
|
||||
{
|
||||
unsigned width = floor((frameRect.size.width - _paddingLeft) / _charWidth);
|
||||
unsigned height = floor((frameRect.size.height - _paddingTop) / _charHeight);
|
||||
return;
|
||||
}
|
||||
|
||||
if (/* inLiveResize */ YES)
|
||||
{
|
||||
// user is resizing window.
|
||||
// or zoom.
|
||||
unsigned width = floor((frameRect.size.width - _paddingLeft * 2) / _charWidth);
|
||||
unsigned height = floor((frameRect.size.height - _paddingTop * 2) / _charHeight);
|
||||
|
||||
_screen.lock();
|
||||
_screen.setSize(width, height, false);
|
||||
_screen.unlock();
|
||||
|
||||
return;
|
||||
}
|
||||
[super setFrame: frameRect];
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
<object class="NSWindowTemplate" id="1005">
|
||||
<int key="NSWindowStyleMask">263</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{196, 240}, {400, 175}}</string>
|
||||
<string key="NSWindowRect">{{196, 232}, {400, 200}}</string>
|
||||
<int key="NSWTFlags">544736256</int>
|
||||
<string key="NSWindowTitle">New Terminal</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
@ -52,86 +52,22 @@
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSPopUpButton" id="988010808">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">266</int>
|
||||
<string key="NSFrame">{{121, 130}, {259, 26}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSNextKeyView" ref="391841165"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSPopUpButtonCell" key="NSCell" id="49383316">
|
||||
<int key="NSCellFlags">-2080244160</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<object class="NSFont" key="NSSupport" id="1027415380">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="988010808"/>
|
||||
<int key="NSButtonFlags">-2035269377</int>
|
||||
<int key="NSButtonFlags2">163</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
<object class="NSMenuItem" key="NSMenuItem" id="16760045">
|
||||
<reference key="NSMenu" ref="526655665"/>
|
||||
<string key="NSTitle">VT 52</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<int key="NSState">1</int>
|
||||
<object class="NSCustomResource" key="NSOnImage" id="1036081624">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">NSMenuCheckmark</string>
|
||||
</object>
|
||||
<object class="NSCustomResource" key="NSMixedImage" id="1030983755">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">NSMenuMixedState</string>
|
||||
</object>
|
||||
<string key="NSAction">_popUpItemAction:</string>
|
||||
<int key="NSTag">1</int>
|
||||
<reference key="NSTarget" ref="49383316"/>
|
||||
</object>
|
||||
<bool key="NSMenuItemRespectAlignment">YES</bool>
|
||||
<object class="NSMenu" key="NSMenu" id="526655665">
|
||||
<string key="NSTitle">OtherViews</string>
|
||||
<object class="NSMutableArray" key="NSMenuItems">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="16760045"/>
|
||||
<object class="NSMenuItem" id="526046963">
|
||||
<reference key="NSMenu" ref="526655665"/>
|
||||
<string key="NSTitle">VT 100</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="1036081624"/>
|
||||
<reference key="NSMixedImage" ref="1030983755"/>
|
||||
<string key="NSAction">_popUpItemAction:</string>
|
||||
<int key="NSTag">2</int>
|
||||
<reference key="NSTarget" ref="49383316"/>
|
||||
</object>
|
||||
</object>
|
||||
<reference key="NSMenuFont" ref="1027415380"/>
|
||||
</object>
|
||||
<int key="NSPreferredEdge">2</int>
|
||||
<bool key="NSUsesItemFromMenu">YES</bool>
|
||||
<bool key="NSAltersState">YES</bool>
|
||||
<int key="NSArrowPosition">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="497952356">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 135}, {99, 17}}</string>
|
||||
<string key="NSFrame">{{17, 160}, {99, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<reference key="NSNextKeyView" ref="988010808"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="1072357374">
|
||||
<int key="NSCellFlags">68288064</int>
|
||||
<int key="NSCellFlags2">71304192</int>
|
||||
<string key="NSContents">Terminal Type:</string>
|
||||
<reference key="NSSupport" ref="1027415380"/>
|
||||
<object class="NSFont" key="NSSupport" id="1027415380">
|
||||
<string key="NSName">LucidaGrande</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">1044</int>
|
||||
</object>
|
||||
<reference key="NSControlView" ref="497952356"/>
|
||||
<object class="NSColor" key="NSBackgroundColor" id="717723982">
|
||||
<int key="NSColorSpace">6</int>
|
||||
@ -156,7 +92,7 @@
|
||||
<object class="NSTextField" id="252954094">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 104}, {99, 17}}</string>
|
||||
<string key="NSFrame">{{17, 129}, {99, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="371472469">
|
||||
@ -220,19 +156,19 @@
|
||||
<string>NSColor pasteboard type</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{121, 101}, {44, 23}}</string>
|
||||
<string key="NSFrame">{{121, 126}, {44, 23}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<bool key="NSIsBordered">YES</bool>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4wNTgxMzA0OTg5OCAwLjA1NTU0MTg5OTA2IDEAA</bytes>
|
||||
<bytes key="NSRGB">MCAxIDAAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSTextField" id="20738307">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 76}, {99, 17}}</string>
|
||||
<string key="NSFrame">{{17, 101}, {99, 17}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSTextFieldCell" key="NSCell" id="517790854">
|
||||
@ -255,17 +191,116 @@
|
||||
<string>NSColor pasteboard type</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{121, 73}, {44, 23}}</string>
|
||||
<string key="NSFrame">{{121, 98}, {44, 23}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<bool key="NSIsBordered">YES</bool>
|
||||
<object class="NSColor" key="NSColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4wNTgxMzA0OTg5OCAwLjA1NTU0MTg5OTA2IDEAA</bytes>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSPopUpButton" id="74709640">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{121, 155}, {259, 25}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSPopUpButtonCell" key="NSCell" id="193198991">
|
||||
<int key="NSCellFlags">-2076049856</int>
|
||||
<int key="NSCellFlags2">2048</int>
|
||||
<reference key="NSSupport" ref="1027415380"/>
|
||||
<reference key="NSControlView" ref="74709640"/>
|
||||
<int key="NSButtonFlags">-2036317953</int>
|
||||
<int key="NSButtonFlags2">163</int>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
<object class="NSMenuItem" key="NSMenuItem" id="397979225">
|
||||
<reference key="NSMenu" ref="915707117"/>
|
||||
<string key="NSTitle">Item 1</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<int key="NSState">1</int>
|
||||
<object class="NSCustomResource" key="NSOnImage" id="572076606">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">NSMenuCheckmark</string>
|
||||
</object>
|
||||
<object class="NSCustomResource" key="NSMixedImage" id="797709943">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">NSMenuMixedState</string>
|
||||
</object>
|
||||
<string key="NSAction">_popUpItemAction:</string>
|
||||
<reference key="NSTarget" ref="193198991"/>
|
||||
</object>
|
||||
<bool key="NSMenuItemRespectAlignment">YES</bool>
|
||||
<object class="NSMenu" key="NSMenu" id="915707117">
|
||||
<string key="NSTitle">OtherViews</string>
|
||||
<object class="NSMutableArray" key="NSMenuItems">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="397979225"/>
|
||||
<object class="NSMenuItem" id="916917000">
|
||||
<reference key="NSMenu" ref="915707117"/>
|
||||
<string key="NSTitle">Item 2</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="572076606"/>
|
||||
<reference key="NSMixedImage" ref="797709943"/>
|
||||
<string key="NSAction">_popUpItemAction:</string>
|
||||
<reference key="NSTarget" ref="193198991"/>
|
||||
</object>
|
||||
<object class="NSMenuItem" id="382632528">
|
||||
<reference key="NSMenu" ref="915707117"/>
|
||||
<string key="NSTitle">Item 3</string>
|
||||
<string key="NSKeyEquiv"/>
|
||||
<int key="NSKeyEquivModMask">1048576</int>
|
||||
<int key="NSMnemonicLoc">2147483647</int>
|
||||
<reference key="NSOnImage" ref="572076606"/>
|
||||
<reference key="NSMixedImage" ref="797709943"/>
|
||||
<string key="NSAction">_popUpItemAction:</string>
|
||||
<reference key="NSTarget" ref="193198991"/>
|
||||
</object>
|
||||
</object>
|
||||
<reference key="NSMenuFont" ref="1027415380"/>
|
||||
</object>
|
||||
<int key="NSPreferredEdge">1</int>
|
||||
<bool key="NSUsesItemFromMenu">YES</bool>
|
||||
<bool key="NSAltersState">YES</bool>
|
||||
<int key="NSArrowPosition">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSButton" id="802777145">
|
||||
<reference key="NSNextResponder" ref="1006"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{119, 74}, {88, 18}}</string>
|
||||
<reference key="NSSuperview" ref="1006"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="273357152">
|
||||
<int key="NSCellFlags">-2080244224</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Scan Lines</string>
|
||||
<reference key="NSSupport" ref="1027415380"/>
|
||||
<reference key="NSControlView" ref="802777145"/>
|
||||
<int key="NSButtonFlags">1211912703</int>
|
||||
<int key="NSButtonFlags2">2</int>
|
||||
<object class="NSCustomResource" key="NSNormalImage">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">NSSwitch</string>
|
||||
</object>
|
||||
<object class="NSButtonImageSource" key="NSAlternateImage">
|
||||
<string key="NSImageName">NSSwitch</string>
|
||||
</object>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">200</int>
|
||||
<int key="NSPeriodicInterval">25</int>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{400, 175}</string>
|
||||
<string key="NSFrameSize">{400, 200}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSNextKeyView" ref="497952356"/>
|
||||
</object>
|
||||
@ -310,11 +345,35 @@
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">_terminalTypeButton</string>
|
||||
<string key="label">foregroundColorControl</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="988010808"/>
|
||||
<reference key="destination" ref="1050894810"/>
|
||||
</object>
|
||||
<int key="connectionID">42</int>
|
||||
<int key="connectionID">64</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">backgroundColorControl</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="257625175"/>
|
||||
</object>
|
||||
<int key="connectionID">65</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">scanLineButton</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="802777145"/>
|
||||
</object>
|
||||
<int key="connectionID">66</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">terminalTypeButton</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="74709640"/>
|
||||
</object>
|
||||
<int key="connectionID">67</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
@ -359,54 +418,17 @@
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="497952356"/>
|
||||
<reference ref="988010808"/>
|
||||
<reference ref="391841165"/>
|
||||
<reference ref="839562449"/>
|
||||
<reference ref="257625175"/>
|
||||
<reference ref="252954094"/>
|
||||
<reference ref="20738307"/>
|
||||
<reference ref="1050894810"/>
|
||||
<reference ref="74709640"/>
|
||||
<reference ref="802777145"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1005"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">3</int>
|
||||
<reference key="object" ref="988010808"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="49383316"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="49383316"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="526655665"/>
|
||||
</object>
|
||||
<reference key="parent" ref="988010808"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="526655665"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="16760045"/>
|
||||
<reference ref="526046963"/>
|
||||
</object>
|
||||
<reference key="parent" ref="49383316"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="16760045"/>
|
||||
<reference key="parent" ref="526655665"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">7</int>
|
||||
<reference key="object" ref="526046963"/>
|
||||
<reference key="parent" ref="526655665"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">9</int>
|
||||
<reference key="object" ref="497952356"/>
|
||||
@ -487,6 +509,64 @@
|
||||
<reference key="object" ref="517790854"/>
|
||||
<reference key="parent" ref="20738307"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">55</int>
|
||||
<reference key="object" ref="74709640"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="193198991"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">56</int>
|
||||
<reference key="object" ref="193198991"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="915707117"/>
|
||||
</object>
|
||||
<reference key="parent" ref="74709640"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">57</int>
|
||||
<reference key="object" ref="915707117"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="397979225"/>
|
||||
<reference ref="916917000"/>
|
||||
<reference ref="382632528"/>
|
||||
</object>
|
||||
<reference key="parent" ref="193198991"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">58</int>
|
||||
<reference key="object" ref="397979225"/>
|
||||
<reference key="parent" ref="915707117"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">59</int>
|
||||
<reference key="object" ref="916917000"/>
|
||||
<reference key="parent" ref="915707117"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">60</int>
|
||||
<reference key="object" ref="382632528"/>
|
||||
<reference key="parent" ref="915707117"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">62</int>
|
||||
<reference key="object" ref="802777145"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="273357152"/>
|
||||
</object>
|
||||
<reference key="parent" ref="1006"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">63</int>
|
||||
<reference key="object" ref="273357152"/>
|
||||
<reference key="parent" ref="802777145"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
@ -508,8 +588,6 @@
|
||||
<string>19.IBPluginDependency</string>
|
||||
<string>2.IBPluginDependency</string>
|
||||
<string>20.IBPluginDependency</string>
|
||||
<string>3.IBPluginDependency</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
<string>49.IBPluginDependency</string>
|
||||
<string>49.IBViewBoundsToFrameTransform</string>
|
||||
<string>50.IBPluginDependency</string>
|
||||
@ -524,6 +602,17 @@
|
||||
<string>53.IBPluginDependency</string>
|
||||
<string>53.IBViewBoundsToFrameTransform</string>
|
||||
<string>54.IBPluginDependency</string>
|
||||
<string>55.IBPluginDependency</string>
|
||||
<string>55.IBViewBoundsToFrameTransform</string>
|
||||
<string>56.IBPluginDependency</string>
|
||||
<string>57.IBEditorWindowLastContentRect</string>
|
||||
<string>57.IBPluginDependency</string>
|
||||
<string>58.IBPluginDependency</string>
|
||||
<string>59.IBPluginDependency</string>
|
||||
<string>60.IBPluginDependency</string>
|
||||
<string>62.IBPluginDependency</string>
|
||||
<string>62.IBViewBoundsToFrameTransform</string>
|
||||
<string>63.IBPluginDependency</string>
|
||||
<string>9.IBPluginDependency</string>
|
||||
<string>9.IBViewBoundsToFrameTransform</string>
|
||||
</object>
|
||||
@ -532,9 +621,9 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{107, 494}, {400, 175}}</string>
|
||||
<string>{{107, 469}, {400, 200}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{107, 494}, {400, 175}}</string>
|
||||
<string>{{107, 469}, {400, 200}}</string>
|
||||
<boolean value="NO"/>
|
||||
<string>{196, 240}</string>
|
||||
<string>{{357, 418}, {480, 270}}</string>
|
||||
@ -545,8 +634,6 @@
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSAffineTransform">
|
||||
<bytes key="NSTransformStruct">AULyAABCygAAA</bytes>
|
||||
</object>
|
||||
@ -569,6 +656,21 @@
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSAffineTransform">
|
||||
<bytes key="NSTransformStruct">P4AAAL+AAABDjAAAwxoAAA</bytes>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{217, 586}, {259, 63}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSAffineTransform">
|
||||
<bytes key="NSTransformStruct">P4AAAL+AAABB8AAAwswAAA</bytes>
|
||||
</object>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSAffineTransform">
|
||||
<bytes key="NSTransformStruct">P4AAAL+AAABBiAAAwxYAAA</bytes>
|
||||
</object>
|
||||
@ -590,7 +692,7 @@
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">54</int>
|
||||
<int key="maxID">67</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@ -631,14 +733,49 @@
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">_terminalTypeButton</string>
|
||||
<string key="NS.object.0">NSPopUpButton</string>
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>backgroundColorControl</string>
|
||||
<string>foregroundColorControl</string>
|
||||
<string>scanLineButton</string>
|
||||
<string>terminalTypeButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSColorWell</string>
|
||||
<string>NSColorWell</string>
|
||||
<string>NSButton</string>
|
||||
<string>NSPopUpButton</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">_terminalTypeButton</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">_terminalTypeButton</string>
|
||||
<string key="candidateClassName">NSPopUpButton</string>
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>backgroundColorControl</string>
|
||||
<string>foregroundColorControl</string>
|
||||
<string>scanLineButton</string>
|
||||
<string>terminalTypeButton</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">backgroundColorControl</string>
|
||||
<string key="candidateClassName">NSColorWell</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">foregroundColorControl</string>
|
||||
<string key="candidateClassName">NSColorWell</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">scanLineButton</string>
|
||||
<string key="candidateClassName">NSButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">terminalTypeButton</string>
|
||||
<string key="candidateClassName">NSPopUpButton</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
@ -1169,11 +1306,13 @@
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSMenuCheckmark</string>
|
||||
<string>NSMenuMixedState</string>
|
||||
<string>NSSwitch</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>{9, 8}</string>
|
||||
<string>{7, 2}</string>
|
||||
<string>{15, 15}</string>
|
||||
</object>
|
||||
</object>
|
||||
</data>
|
||||
|
@ -12,9 +12,19 @@
|
||||
@interface NewTerminalWindowController : NSWindowController <NSWindowDelegate> {
|
||||
@private
|
||||
|
||||
IBOutlet NSPopUpButton *_terminalTypeButton;
|
||||
NSPopUpButton *_terminalTypeButton;
|
||||
NSButton *_scanLineButton;
|
||||
|
||||
NSColorWell *_foregroundColorControl;
|
||||
NSColorWell *_backgroundColorControl;
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet NSPopUpButton *terminalTypeButton;
|
||||
@property (nonatomic, retain) IBOutlet NSButton *scanLineButton;
|
||||
@property (nonatomic, retain) IBOutlet NSColorWell *foregroundColorControl;
|
||||
@property (nonatomic, retain) IBOutlet NSColorWell *backgroundColorControl;
|
||||
|
||||
-(IBAction)cancelButton: (id)sender;
|
||||
-(IBAction)connectButton: (id)sender;
|
||||
|
||||
|
@ -12,6 +12,11 @@
|
||||
|
||||
@implementation NewTerminalWindowController
|
||||
|
||||
@synthesize terminalTypeButton = _terminalTypeButton;
|
||||
@synthesize scanLineButton = _scanLineButton;
|
||||
@synthesize foregroundColorControl = _foregroundColorControl;
|
||||
@synthesize backgroundColorControl = _backgroundColorControl;
|
||||
|
||||
|
||||
+(id)new
|
||||
{
|
||||
@ -23,7 +28,10 @@
|
||||
- (void)dealloc {
|
||||
// Clean-up code here.
|
||||
|
||||
//[_terminalTypeButton release];
|
||||
[_terminalTypeButton release];
|
||||
[_backgroundColorControl release];
|
||||
[_foregroundColorControl release];
|
||||
[_scanLineButton release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
@ -56,7 +64,10 @@
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
klass, @"Class",
|
||||
klass, kClass,
|
||||
[NSNumber numberWithBool: [_scanLineButton intValue]], kScanLines,
|
||||
[_foregroundColorControl color], kForegroundColor,
|
||||
[_backgroundColorControl color], kBackgroundColor,
|
||||
nil];
|
||||
|
||||
[nc postNotificationName: kNotificationNewTerminal object: self userInfo: userInfo];
|
||||
|
30
PTSE.mm
30
PTSE.mm
@ -107,11 +107,12 @@ enum {
|
||||
break;
|
||||
case CTRL('J'):
|
||||
//Move cursor down one line.
|
||||
screen->incrementY();
|
||||
//screen->incrementY();
|
||||
screen->lineFeed();
|
||||
break;
|
||||
case CTRL('I'):
|
||||
//Move cursor to next tab stop (every 8 chars).
|
||||
screen->setX((screen->x() + 8) & ~0x07);
|
||||
screen->tabTo((screen->x() + 8) & ~0x07);
|
||||
break;
|
||||
case CTRL('A'):
|
||||
//Move cursor to beginning of line.
|
||||
@ -132,7 +133,7 @@ enum {
|
||||
break;
|
||||
|
||||
case CTRL('M'):
|
||||
screen->lineFeed();
|
||||
//screen->lineFeed();
|
||||
screen->setX(0);
|
||||
break;
|
||||
|
||||
@ -140,15 +141,23 @@ enum {
|
||||
case CTRL('D'):
|
||||
//Delete current character (under cursor).
|
||||
// TODO -- does this shift the rest of the row?
|
||||
screen->deletec();
|
||||
break;
|
||||
case CTRL('F'):
|
||||
//Insert space at cursor.
|
||||
screen->insertc(' ');
|
||||
break;
|
||||
|
||||
case CTRL('Z'):
|
||||
//Delete current line.
|
||||
screen->removeLine(screen->y());
|
||||
break;
|
||||
case CTRL('V'):
|
||||
//Insert blank like.
|
||||
// TODO -- verify if the line is before or after the current line,
|
||||
// TODO -- verify if x/y change
|
||||
// TODO -- verify scrolling behavior.
|
||||
screen->addLine(screen->y());
|
||||
break;
|
||||
case CTRL('Y'):
|
||||
//Clear to end of line.
|
||||
@ -278,6 +287,20 @@ enum {
|
||||
|
||||
switch (uc)
|
||||
{
|
||||
case NSEnterCharacter:
|
||||
output->write(CTRL('M'));
|
||||
break;
|
||||
|
||||
case NSDeleteCharacter:
|
||||
output->write(0x7f);
|
||||
break;
|
||||
|
||||
|
||||
// backspace and left arrow use the same code, alas.
|
||||
case NSBackspaceCharacter:
|
||||
output->write(CTRL('H'));
|
||||
break;
|
||||
|
||||
case NSLeftArrowFunctionKey:
|
||||
output->write(CTRL('H'));
|
||||
break;
|
||||
@ -293,6 +316,7 @@ enum {
|
||||
case NSDownArrowFunctionKey:
|
||||
output->write(CTRL('J'));
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
if (uc <= 0x7f)
|
||||
|
@ -13,7 +13,7 @@ kernel vec4 scanline(sampler image, float opacity)
|
||||
// isOdd == 0 --> return pixel
|
||||
// isOdd == 1 --> return pixel * opacity
|
||||
|
||||
float multiplier = compare(isOdd - 1.0, 1.0, opacity);
|
||||
|
||||
//float multiplier = compare(isOdd - 1.0, 1.0, opacity);
|
||||
float multiplier = isOdd == 0.0 ? 1.0 : opacity;
|
||||
return pixel * multiplier;
|
||||
}
|
||||
|
49
Screen.cpp
49
Screen.cpp
@ -87,6 +87,52 @@ void Screen::putc(uint8_t c, bool incrementX)
|
||||
}
|
||||
}
|
||||
|
||||
void Screen::deletec()
|
||||
{
|
||||
// delete character at cursor.
|
||||
// move following character up
|
||||
// set final character to ' ' (retaining flags from previous char)
|
||||
|
||||
if (_cursor.x >= _width) return;
|
||||
|
||||
_updates.push_back(_cursor);
|
||||
_updates.push_back(iPoint(_width - 1, _cursor.y));
|
||||
|
||||
|
||||
CharInfoIterator end = _screen[_cursor.y].end() - 1;
|
||||
CharInfoIterator iter = _screen[_cursor.y].begin() + _cursor.x;
|
||||
|
||||
|
||||
for ( ; iter != end; ++iter)
|
||||
{
|
||||
iter[0] = iter[1];
|
||||
|
||||
}
|
||||
// retain the flags previously there.
|
||||
end->c = ' ';
|
||||
}
|
||||
|
||||
void Screen::insertc(uint8_t c)
|
||||
{
|
||||
// insert character at cursor.
|
||||
// move following characters up (retaining flags).
|
||||
|
||||
if (_cursor.x >= _width) return;
|
||||
|
||||
_updates.push_back(_cursor);
|
||||
_updates.push_back(iPoint(_width - 1, _cursor.y));
|
||||
|
||||
CharInfoIterator end = _screen[_cursor.y].end() - 1;
|
||||
CharInfoIterator iter = _screen[_cursor.y].begin() + _cursor.x;
|
||||
|
||||
for ( ; iter != end; ++iter)
|
||||
{
|
||||
iter[1] = iter[0];
|
||||
}
|
||||
|
||||
iter->c = ' ';
|
||||
}
|
||||
|
||||
|
||||
void Screen::tabTo(unsigned xPos)
|
||||
{
|
||||
@ -96,6 +142,9 @@ void Screen::tabTo(unsigned xPos)
|
||||
xPos = std::min(xPos, _width - 1);
|
||||
|
||||
|
||||
_updates.push_back(_cursor);
|
||||
_updates.push_back(iPoint(xPos, _cursor.y));
|
||||
|
||||
for (unsigned x = _cursor.x; x < xPos; ++x)
|
||||
{
|
||||
_screen[_cursor.y][x] = clear;
|
||||
|
5
Screen.h
5
Screen.h
@ -83,10 +83,13 @@ public:
|
||||
void setFlag(uint8_t flag);
|
||||
|
||||
void putc(uint8_t c, bool incrementX = true);
|
||||
CharInfo getc(int x, int y) const;
|
||||
|
||||
void deletec();
|
||||
void insertc(uint8_t c);
|
||||
|
||||
void tabTo(unsigned x);
|
||||
|
||||
CharInfo getc(int x, int y) const;
|
||||
|
||||
|
||||
void erase(EraseRegion);
|
||||
|
@ -16,15 +16,21 @@
|
||||
|
||||
@interface TermWindowController : NSWindowController <NSWindowDelegate> {
|
||||
|
||||
NSDictionary *_parameters;
|
||||
|
||||
EmulatorView *_emulatorView;
|
||||
CurveView *_curveView;
|
||||
|
||||
|
||||
|
||||
NSObject <Emulator> *_emulator;
|
||||
|
||||
int _child;
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSDictionary *parameters;
|
||||
|
||||
@property (nonatomic, retain) IBOutlet EmulatorView *emulatorView;
|
||||
@property (nonatomic, retain) IBOutlet CurveView *curveView;
|
||||
|
||||
|
@ -13,6 +13,9 @@
|
||||
#import "VT52.h"
|
||||
#import "PTSE.h"
|
||||
|
||||
#import "Defaults.h"
|
||||
|
||||
|
||||
#define TTYDEFCHARS
|
||||
|
||||
#include <util.h>
|
||||
@ -30,6 +33,10 @@
|
||||
@synthesize emulatorView = _emulatorView;
|
||||
@synthesize curveView = _curveView;
|
||||
|
||||
@synthesize parameters = _parameters;
|
||||
|
||||
|
||||
|
||||
+(id)new
|
||||
{
|
||||
return [[self alloc] initWithWindowNibName: @"TermWindow"];
|
||||
@ -41,6 +48,7 @@
|
||||
[_emulatorView release];
|
||||
[_curveView release];
|
||||
|
||||
[_parameters release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
@ -138,6 +146,8 @@
|
||||
if (fcntl(fd, F_GETFL, &flags) < 0) flags = 0;
|
||||
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
||||
*/
|
||||
|
||||
[_emulatorView resizeTo: iSize(ws.ws_col, ws.ws_row)];
|
||||
|
||||
if (![_emulator resizable])
|
||||
{
|
||||
@ -163,20 +173,44 @@
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
|
||||
BOOL scanLines;
|
||||
NSColor *foregroundColor;
|
||||
NSColor *backgroundColor;
|
||||
Class klass;
|
||||
id o;
|
||||
|
||||
[super windowDidLoad];
|
||||
|
||||
if (!_emulator)
|
||||
klass = [_parameters objectForKey: kClass];
|
||||
if (!klass || ![klass conformsToProtocol: @protocol(Emulator)])
|
||||
{
|
||||
// window title is bound to _emulator
|
||||
[self willChangeValueForKey: @"emulator"];
|
||||
_emulator = [PTSE new];
|
||||
[self didChangeValueForKey: @"emulator"];
|
||||
klass = [VT52 class];
|
||||
}
|
||||
|
||||
[_emulatorView setEmulator: _emulator];
|
||||
o = [_parameters objectForKey: kScanLines];
|
||||
scanLines = o ? [(NSNumber *)o boolValue] : YES;
|
||||
|
||||
[_curveView initScanLines];
|
||||
[_curveView setColor: [NSColor blueColor]];
|
||||
o = [_parameters objectForKey: kForegroundColor];
|
||||
foregroundColor = o ? (NSColor *)o : [NSColor greenColor];
|
||||
|
||||
o = [_parameters objectForKey: kBackgroundColor];
|
||||
backgroundColor = o ? (NSColor *)o : [NSColor blackColor];
|
||||
|
||||
|
||||
[self willChangeValueForKey: @"emulator"];
|
||||
_emulator = [klass new];
|
||||
[self didChangeValueForKey: @"emulator"];
|
||||
|
||||
|
||||
[_emulatorView setEmulator: _emulator];
|
||||
[_emulatorView setForegroundColor: foregroundColor];
|
||||
[_emulatorView setBackgroundColor: backgroundColor];
|
||||
[_emulatorView setScanLines: scanLines];
|
||||
|
||||
|
||||
//[_curveView initScanLines];
|
||||
//[_curveView setColor: [NSColor blueColor]];
|
||||
|
||||
[self initPTY];
|
||||
}
|
||||
|
@ -61,15 +61,17 @@
|
||||
|
||||
NSDictionary *userInfo = [notification userInfo];
|
||||
|
||||
|
||||
/*
|
||||
Class klass = [userInfo objectForKey: @"Class"];
|
||||
if (![klass conformsToProtocol: @protocol(Emulator)])
|
||||
klass = [VT52 class];
|
||||
|
||||
|
||||
*/
|
||||
|
||||
controller = [TermWindowController new];
|
||||
[controller setEmulator: [[klass new] autorelease]];
|
||||
[controller setParameters: userInfo];
|
||||
|
||||
//[controller setEmulator: [[klass new] autorelease]];
|
||||
[controller showWindow: nil];
|
||||
// this leak is ok.
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user