From 2e08a6f99d5985022be8a71e8558ec7c4872b23b Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 9 Jul 2010 02:40:04 +0000 Subject: [PATCH] git-svn-id: svn://qnap.local/TwoTerm/trunk@1652 5590a31f-7b70-45f8-8c82-aa3a8e5f4507 --- 2Term.xcodeproj/kelvin.pbxuser | 132 +++++++++++++++++++++++---- 2Term.xcodeproj/kelvin.perspectivev3 | 25 +++-- 2Term.xcodeproj/project.pbxproj | 6 ++ CurveView.h | 19 ++++ CurveView.m | 70 ++++++++++++++ English.lproj/TermWindow.xib | 47 ++++++++-- 6 files changed, 258 insertions(+), 41 deletions(-) create mode 100644 CurveView.h create mode 100644 CurveView.m diff --git a/2Term.xcodeproj/kelvin.pbxuser b/2Term.xcodeproj/kelvin.pbxuser index 8ae9e1f..2bf8943 100644 --- a/2Term.xcodeproj/kelvin.pbxuser +++ b/2Term.xcodeproj/kelvin.pbxuser @@ -206,6 +206,14 @@ B6697A0211E6BED3002ED475 /* PBXBookmark */ = B6697A0211E6BED3002ED475 /* PBXBookmark */; B6697A0511E6BEDA002ED475 /* PBXBookmark */ = B6697A0511E6BEDA002ED475 /* PBXBookmark */; B6697A0911E6BEFD002ED475 /* PBXBookmark */ = B6697A0911E6BEFD002ED475 /* PBXBookmark */; + B6697A1A11E6C28A002ED475 /* PBXBookmark */ = B6697A1A11E6C28A002ED475 /* PBXBookmark */; + B6697A1B11E6C28A002ED475 /* PBXTextBookmark */ = B6697A1B11E6C28A002ED475 /* PBXTextBookmark */; + B6697A1C11E6C28A002ED475 /* PBXTextBookmark */ = B6697A1C11E6C28A002ED475 /* PBXTextBookmark */; + B6697A1D11E6C28A002ED475 /* PBXTextBookmark */ = B6697A1D11E6C28A002ED475 /* PBXTextBookmark */; + B6697A2211E6C2ED002ED475 /* PBXTextBookmark */ = B6697A2211E6C2ED002ED475 /* PBXTextBookmark */; + B6697A2811E6C394002ED475 /* PBXTextBookmark */ = B6697A2811E6C394002ED475 /* PBXTextBookmark */; + B6697A2E11E6C426002ED475 /* PBXTextBookmark */ = B6697A2E11E6C426002ED475 /* PBXTextBookmark */; + B6697A3211E6C439002ED475 /* PBXTextBookmark */ = B6697A3211E6C439002ED475 /* PBXTextBookmark */; B676058811DAE21100D6B66C = B676058811DAE21100D6B66C /* PBXTextBookmark */; B676058911DAE21100D6B66C = B676058911DAE21100D6B66C /* PBXTextBookmark */; B676058B11DAE21100D6B66C = B676058B11DAE21100D6B66C /* PlistBookmark */; @@ -270,7 +278,7 @@ ignoreCount = 0; lineNumber = 460; location = 2Term; - modificationTime = 300334844.715422; + modificationTime = 300336184.692893; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -288,7 +296,7 @@ ignoreCount = 0; lineNumber = 107; location = 2Term; - modificationTime = 300334844.715555; + modificationTime = 300336184.693003; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -306,7 +314,7 @@ ignoreCount = 0; lineNumber = 598; location = 2Term; - modificationTime = 300334844.715661; + modificationTime = 300336184.693103; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -324,7 +332,7 @@ ignoreCount = 0; lineNumber = 607; location = 2Term; - modificationTime = 300334844.715782; + modificationTime = 300336184.69322; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -342,7 +350,7 @@ ignoreCount = 0; lineNumber = 170; location = 2Term; - modificationTime = 300334844.715892; + modificationTime = 300336184.69333; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -360,7 +368,7 @@ ignoreCount = 0; lineNumber = 113; location = 2Term; - modificationTime = 300334844.716018; + modificationTime = 300336184.693467; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -388,7 +396,7 @@ ignoreCount = 0; lineNumber = 66; location = 2Term; - modificationTime = 300334844.715145; + modificationTime = 300336184.692614; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -825,7 +833,7 @@ ignoreCount = 0; lineNumber = 184; location = 2Term; - modificationTime = 300334844.716124; + modificationTime = 300336184.693575; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -843,7 +851,7 @@ ignoreCount = 0; lineNumber = 183; location = 2Term; - modificationTime = 300334844.716232; + modificationTime = 300336184.707938; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -901,7 +909,7 @@ ignoreCount = 0; lineNumber = 278; location = 2Term; - modificationTime = 300334844.716379; + modificationTime = 300336184.708157; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -929,7 +937,7 @@ ignoreCount = 0; lineNumber = 272; location = 2Term; - modificationTime = 300334844.716527; + modificationTime = 300336184.708302; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -957,7 +965,7 @@ ignoreCount = 0; lineNumber = 240; location = 2Term; - modificationTime = 300334844.716646; + modificationTime = 300336184.708412; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -1132,7 +1140,7 @@ ignoreCount = 0; lineNumber = 30; location = 2Term; - modificationTime = 300334844.716761; + modificationTime = 300336184.708524; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -1237,6 +1245,94 @@ isa = PBXBookmark; fRef = B66979CF11E6BCAE002ED475 /* sl25.png */; }; + B6697A0D11E6BF95002ED475 /* CurveView.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1249, 955}}"; + sepNavSelRange = "{267, 0}"; + sepNavVisRange = "{0, 274}"; + }; + }; + B6697A0E11E6BF95002ED475 /* CurveView.m */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {653, 1313}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 553}"; + }; + }; + B6697A1A11E6C28A002ED475 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = B66979CF11E6BCAE002ED475 /* sl25.png */; + }; + B6697A1B11E6C28A002ED475 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = B6697A0D11E6BF95002ED475 /* CurveView.h */; + name = "CurveView.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 206; + vrLoc = 0; + }; + B6697A1C11E6C28A002ED475 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = B6697A0E11E6BF95002ED475 /* CurveView.m */; + name = "CurveView.m: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 416; + vrLoc = 0; + }; + B6697A1D11E6C28A002ED475 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = B6697A0E11E6BF95002ED475 /* CurveView.m */; + name = "CurveView.m: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 572; + vrLoc = 0; + }; + B6697A2211E6C2ED002ED475 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = B6697A0E11E6BF95002ED475 /* CurveView.m */; + name = "CurveView.m: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 572; + vrLoc = 0; + }; + B6697A2811E6C394002ED475 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = B6697A0E11E6BF95002ED475 /* CurveView.m */; + name = "CurveView.m: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 553; + vrLoc = 0; + }; + B6697A2E11E6C426002ED475 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = B6697A0E11E6BF95002ED475 /* CurveView.m */; + name = "CurveView.m: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 553; + vrLoc = 0; + }; + B6697A3211E6C439002ED475 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = B6697A0E11E6BF95002ED475 /* CurveView.m */; + name = "CurveView.m: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 553; + vrLoc = 0; + }; B676053511DADB8100D6B66C /* 2Term */ = { isa = PBXExecutable; activeArgIndices = ( @@ -1396,7 +1492,7 @@ ignoreCount = 0; lineNumber = 34; location = 2Term; - modificationTime = 300334844.712226; + modificationTime = 300336184.691373; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -1414,7 +1510,7 @@ ignoreCount = 0; lineNumber = 31; location = 2Term; - modificationTime = 300334844.71468; + modificationTime = 300336184.692088; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -1432,7 +1528,7 @@ ignoreCount = 0; lineNumber = 97; location = 2Term; - modificationTime = 300334844.714833; + modificationTime = 300336184.692205; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -1450,7 +1546,7 @@ ignoreCount = 0; lineNumber = 97; location = 2Term; - modificationTime = 300334844.714936; + modificationTime = 300336184.692303; originalNumberOfMultipleMatches = 1; state = 2; }; @@ -1525,7 +1621,7 @@ ignoreCount = 0; lineNumber = 97; location = 2Term; - modificationTime = 300334844.715037; + modificationTime = 300336184.692435; originalNumberOfMultipleMatches = 1; state = 0; }; diff --git a/2Term.xcodeproj/kelvin.perspectivev3 b/2Term.xcodeproj/kelvin.perspectivev3 index d1c108d..1168992 100644 --- a/2Term.xcodeproj/kelvin.perspectivev3 +++ b/2Term.xcodeproj/kelvin.perspectivev3 @@ -282,15 +282,9 @@ PBXSmartGroupTreeModuleOutlineStateSelectionKey + 37 + 36 27 - 26 - 25 - 0 - - - 28 - 26 - 25 0 @@ -328,7 +322,7 @@ PBXProjectModuleGUID B676054211DADB9000D6B66C PBXProjectModuleLabel - sl25.png + CurveView.m PBXSplitModuleInNavigatorKey Split0 @@ -336,11 +330,11 @@ PBXProjectModuleGUID B676054311DADB9000D6B66C PBXProjectModuleLabel - sl25.png + CurveView.m _historyCapacity 0 bookmark - B6697A0911E6BEFD002ED475 + B6697A3211E6C439002ED475 history B676058811DAE21100D6B66C @@ -368,7 +362,9 @@ B66979BD11E6ACB9002ED475 B66979D811E6BD4B002ED475 B66979FE11E6BEC3002ED475 - B66979FF11E6BEC3002ED475 + B6697A1A11E6C28A002ED475 + B6697A1B11E6C28A002ED475 + B6697A1C11E6C28A002ED475 SplitCount @@ -706,11 +702,12 @@ 5 WindowOrderList - B6697A0A11E6BEFD002ED475 + B6697A3311E6C439002ED475 B669796711E6A606002ED475 B669796811E6A606002ED475 - /Users/kelvin/Projects/2Term/2Term.xcodeproj B66979DC11E6BD4B002ED475 + /Users/kelvin/Projects/2Term/2Term.xcodeproj + B6697A1F11E6C28A002ED475 WindowString 203 218 1060 902 0 0 1920 1178 diff --git a/2Term.xcodeproj/project.pbxproj b/2Term.xcodeproj/project.pbxproj index 822f930..c7ae72d 100644 --- a/2Term.xcodeproj/project.pbxproj +++ b/2Term.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ B66979D111E6BCAE002ED475 /* sl25.png in Resources */ = {isa = PBXBuildFile; fileRef = B66979CF11E6BCAE002ED475 /* sl25.png */; }; B66979FA11E6BEB5002ED475 /* sl75.png in Resources */ = {isa = PBXBuildFile; fileRef = B66979F811E6BEB5002ED475 /* sl75.png */; }; B66979FB11E6BEB5002ED475 /* sl50.png in Resources */ = {isa = PBXBuildFile; fileRef = B66979F911E6BEB5002ED475 /* sl50.png */; }; + B6697A0F11E6BF95002ED475 /* CurveView.m in Sources */ = {isa = PBXBuildFile; fileRef = B6697A0E11E6BF95002ED475 /* CurveView.m */; }; B676063B11DEAD3500D6B66C /* TermWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B676063A11DEAD3500D6B66C /* TermWindowController.m */; }; B676065111DEBAE900D6B66C /* TermWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = B676065011DEBAE900D6B66C /* TermWindow.xib */; }; B67606DA11DF6DAB00D6B66C /* EmulatorView.mm in Sources */ = {isa = PBXBuildFile; fileRef = B67606D911DF6DAB00D6B66C /* EmulatorView.mm */; }; @@ -44,6 +45,8 @@ B66979CF11E6BCAE002ED475 /* sl25.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sl25.png; sourceTree = ""; }; B66979F811E6BEB5002ED475 /* sl75.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sl75.png; sourceTree = ""; }; B66979F911E6BEB5002ED475 /* sl50.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sl50.png; sourceTree = ""; }; + B6697A0D11E6BF95002ED475 /* CurveView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CurveView.h; sourceTree = ""; }; + B6697A0E11E6BF95002ED475 /* CurveView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CurveView.m; sourceTree = ""; }; B676063911DEAD3500D6B66C /* TermWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TermWindowController.h; sourceTree = ""; }; B676063A11DEAD3500D6B66C /* TermWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TermWindowController.m; sourceTree = ""; }; B676064D11DEBAE300D6B66C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TermWindow.xib; sourceTree = ""; }; @@ -98,6 +101,8 @@ B699A03211E528DE00F54CC8 /* iGeometry.h */, B699A05B11E54D4500F54CC8 /* OutputChannel.h */, B699A05C11E54D4500F54CC8 /* OutputChannel.cpp */, + B6697A0D11E6BF95002ED475 /* CurveView.h */, + B6697A0E11E6BF95002ED475 /* CurveView.m */, ); name = Classes; sourceTree = ""; @@ -249,6 +254,7 @@ B699A05D11E54D4500F54CC8 /* OutputChannel.cpp in Sources */, B699A09111E572A300F54CC8 /* VT52.mm in Sources */, B669798511E6A786002ED475 /* Lock.cpp in Sources */, + B6697A0F11E6BF95002ED475 /* CurveView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/CurveView.h b/CurveView.h new file mode 100644 index 0000000..151195e --- /dev/null +++ b/CurveView.h @@ -0,0 +1,19 @@ +// +// CurveView.h +// 2Term +// +// Created by Kelvin Sherlock on 7/8/2010. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import + + +@interface CurveView : NSView { + + NSColor *_color; +} + +@property (nonatomic, retain) NSColor *color; + +@end diff --git a/CurveView.m b/CurveView.m new file mode 100644 index 0000000..ea803d4 --- /dev/null +++ b/CurveView.m @@ -0,0 +1,70 @@ +// +// CurveView.m +// 2Term +// +// Created by Kelvin Sherlock on 7/8/2010. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import "CurveView.h" + + +@implementation CurveView + +@synthesize color = _color; + +- (id)initWithFrame:(NSRect)frame { + self = [super initWithFrame:frame]; + if (self) { + // Initialization code here. + } + return self; +} + +#define curveSize 4 + +- (void)drawRect:(NSRect)dirtyRect { + + NSGraphicsContext *nsgc = [NSGraphicsContext currentContext]; + CGContextRef ctx = [nsgc graphicsPort]; + + + NSRect bounds = [self bounds]; + + [_color setFill]; + + + CGContextMoveToPoint(ctx, 0, curveSize); + + CGContextAddLineToPoint(ctx, 0, bounds.size.height - curveSize); + CGContextAddQuadCurveToPoint(ctx, 0, bounds.size.height, curveSize, bounds.size.height); + + CGContextAddLineToPoint(ctx, bounds.size.width - curveSize, bounds.size.height); + CGContextAddQuadCurveToPoint(ctx, bounds.size.width, bounds.size.height, bounds.size.width, bounds.size.height - curveSize); + + + CGContextAddLineToPoint(ctx, bounds.size.width, curveSize); + CGContextAddQuadCurveToPoint(ctx, bounds.size.width, 0, bounds.size.width - curveSize, 0); + + + CGContextAddLineToPoint(ctx, curveSize, 0); + + CGContextAddQuadCurveToPoint(ctx, 0, 0, 0, curveSize); + + CGContextFillPath(ctx); + +} + +-(void)setColor:(NSColor *)color +{ + if (_color == color) return; + [_color release]; + _color = [color retain]; + [self setNeedsDisplay: YES]; +} + +-(void)dealloc +{ + [_color release]; +} +@end diff --git a/English.lproj/TermWindow.xib b/English.lproj/TermWindow.xib index c791d1a..8022c66 100644 --- a/English.lproj/TermWindow.xib +++ b/English.lproj/TermWindow.xib @@ -12,7 +12,7 @@ YES - + YES @@ -52,12 +52,22 @@ 256 YES - + 268 - {{30, 30}, {560, 384}} + + YES + + + 268 + {{10, 10}, {560, 384}} + + EmulatorView + + + {{20, 20}, {580, 404}} - EmulatorView + CurveView {620, 444} @@ -136,14 +146,23 @@ YES - + + + 9 + + + YES + + + + 5 - + Emulator View @@ -160,17 +179,19 @@ 1.editorWindowContentRectSynchronizationRect 2.IBPluginDependency 5.IBPluginDependency + 9.IBPluginDependency YES - {{367, 306}, {620, 444}} + {{527, 376}, {620, 444}} com.apple.InterfaceBuilder.CocoaPlugin - {{367, 306}, {620, 444}} + {{527, 376}, {620, 444}} {196, 240} {{202, 428}, {480, 270}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin @@ -189,11 +210,19 @@ - 8 + 9 YES + + CurveView + NSView + + IBProjectSource + CurveView.h + + EmulatorView NSView