git-svn-id: svn://qnap.local/TwoTerm/trunk@1649 5590a31f-7b70-45f8-8c82-aa3a8e5f4507

This commit is contained in:
Kelvin Sherlock 2010-07-08 22:26:58 +00:00
parent 9801f511c3
commit 0ea3270420
28 changed files with 11411 additions and 0 deletions

View File

@ -0,0 +1,864 @@
// !$*UTF8*$!
{
256AC3D80F4B6AC300CF3369 /* TwoTermAppDelegate.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {769, 248}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 397}";
};
};
256AC3D90F4B6AC300CF3369 /* TwoTermAppDelegate.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {653, 507}}";
sepNavSelRange = "{778, 0}";
sepNavVisRange = "{0, 778}";
};
};
256AC3F00F4B6AF500CF3369 /* TwoTerm_Prefix.pch */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {769, 271}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 141}";
};
};
29B97313FDCFA39411CA2CEA /* Project object */ = {
activeBuildConfigurationName = Debug;
activeExecutable = B676053511DADB8100D6B66C /* 2Term */;
activeTarget = 8D1107260486CEB800E47090 /* 2Term */;
addToTargets = (
8D1107260486CEB800E47090 /* 2Term */,
);
breakpoints = (
B676066111DEBFB000D6B66C /* TwoTermAppDelegate.m:35 */,
B676066711DEC06900D6B66C /* TermWindowController.m:31 */,
B676069511DEC97D00D6B66C /* TermWindowController.m:97 */,
B67606B011DECD4E00D6B66C /* TermWindowController.m:97 */,
B676070811DF8F4100D6B66C /* TermWindowController.m:97 */,
B65FA27911E29E8D00EB447E /* EmulatorView.mm:64 */,
B649E13D11E2BC7A0061921F /* VT52View.mm:460 */,
B649E15211E2BF130061921F /* VT52View.mm:107 */,
B649E17111E2C3C50061921F /* VT52View.mm:598 */,
B649E17311E2C3C80061921F /* VT52View.mm:607 */,
B649E18B11E2CC4A0061921F /* VT52View.mm:170 */,
B649E19511E2CC800061921F /* VT52View.mm:113 */,
);
codeSenseManager = B676054911DADB9100D6B66C /* Code sense */;
executables = (
B676053511DADB8100D6B66C /* 2Term */,
);
perUserDictionary = {
"PBXConfiguration.PBXBreakpointsDataSource.v1:1CA23EDF0692099D00951B8B" = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXBreakpointsDataSource_BreakpointID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
20,
239,
20,
139,
139,
68,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXBreakpointsDataSource_ActionID,
PBXBreakpointsDataSource_TypeID,
PBXBreakpointsDataSource_BreakpointID,
PBXBreakpointsDataSource_UseID,
PBXBreakpointsDataSource_LocationID,
PBXBreakpointsDataSource_ConditionID,
PBXBreakpointsDataSource_IgnoreCountID,
PBXBreakpointsDataSource_ContinueID,
);
};
PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
475,
20,
48,
43,
43,
20,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
PBXFileDataSource_Target_ColumnID,
);
};
PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
PBXFileTableDataSourceColumnWidthsKey = (
20,
551,
60,
20,
48.16259765625,
43,
43,
);
PBXFileTableDataSourceColumnsKey = (
PBXFileDataSource_FiletypeID,
PBXFileDataSource_Filename_ColumnID,
PBXTargetDataSource_PrimaryAttribute,
PBXFileDataSource_Built_ColumnID,
PBXFileDataSource_ObjectSize_ColumnID,
PBXFileDataSource_Errors_ColumnID,
PBXFileDataSource_Warnings_ColumnID,
);
};
PBXPerProjectTemplateStateSaveDate = 300230821;
PBXWorkspaceStateSaveDate = 300230821;
};
perUserProjectItems = {
B649E0B511E2A88D0061921F /* PBXTextBookmark */ = B649E0B511E2A88D0061921F /* PBXTextBookmark */;
B649E1B211E2CDDE0061921F /* PBXTextBookmark */ = B649E1B211E2CDDE0061921F /* PBXTextBookmark */;
B65FA28111E29EDE00EB447E /* PBXTextBookmark */ = B65FA28111E29EDE00EB447E /* PBXTextBookmark */;
B65FA2AD11E29F9300EB447E /* PBXTextBookmark */ = B65FA2AD11E29F9300EB447E /* PBXTextBookmark */;
B65FA2B411E29F9A00EB447E /* PBXTextBookmark */ = B65FA2B411E29F9A00EB447E /* PBXTextBookmark */;
B65FA2FE11E2A5D200EB447E /* PBXTextBookmark */ = B65FA2FE11E2A5D200EB447E /* PBXTextBookmark */;
B676058811DAE21100D6B66C /* PBXTextBookmark */ = B676058811DAE21100D6B66C /* PBXTextBookmark */;
B676058911DAE21100D6B66C /* PBXTextBookmark */ = B676058911DAE21100D6B66C /* PBXTextBookmark */;
B676058B11DAE21100D6B66C /* PlistBookmark */ = B676058B11DAE21100D6B66C /* PlistBookmark */;
B676058C11DAE21100D6B66C /* PBXTextBookmark */ = B676058C11DAE21100D6B66C /* PBXTextBookmark */;
B676060711DD4FA600D6B66C /* PBXTextBookmark */ = B676060711DD4FA600D6B66C /* PBXTextBookmark */;
B676062F11DE96AE00D6B66C /* PBXTextBookmark */ = B676062F11DE96AE00D6B66C /* PBXTextBookmark */;
B676064811DEB80600D6B66C /* PBXTextBookmark */ = B676064811DEB80600D6B66C /* PBXTextBookmark */;
B67606C811DED91C00D6B66C /* PBXTextBookmark */ = B67606C811DED91C00D6B66C /* PBXTextBookmark */;
B699A0BE11E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0BE11E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0BF11E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0BF11E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0C011E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0C011E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0C111E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0C111E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0C211E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0C211E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0C311E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0C311E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0C411E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0C411E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0C511E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0C511E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0C611E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0C611E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0C711E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0C711E58D3B00F54CC8 /* PBXTextBookmark */;
B699A0C811E58D3B00F54CC8 /* PBXTextBookmark */ = B699A0C811E58D3B00F54CC8 /* PBXTextBookmark */;
B6EBE2CA11E0FF3E00EA0458 /* PBXTextBookmark */ = B6EBE2CA11E0FF3E00EA0458 /* PBXTextBookmark */;
B6F444CD11E41C7200C3A836 /* PBXTextBookmark */ = B6F444CD11E41C7200C3A836 /* PBXTextBookmark */;
B6F444CF11E41C7200C3A836 /* PBXTextBookmark */ = B6F444CF11E41C7200C3A836 /* PBXTextBookmark */;
};
sourceControlManager = B676054811DADB9100D6B66C /* Source Control */;
userBuildSettings = {
};
};
29B97316FDCFA39411CA2CEA /* main.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {769, 271}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 256}";
};
};
8D1107260486CEB800E47090 /* 2Term */ = {
activeExec = 0;
executables = (
B676053511DADB8100D6B66C /* 2Term */,
);
};
B649E0B511E2A88D0061921F /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B6EBE2B411E0EA9100EA0458 /* CharacterGenerator.m */;
name = "CharacterGenerator.m: 1276";
rLen = 0;
rLoc = 23463;
rType = 0;
vrLen = 635;
vrLoc = 828;
};
B649E13D11E2BC7A0061921F /* VT52View.mm:460 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B67606D311DEDB4100D6B66C /* VT52View.mm */;
functionName = "-processCharacter:";
hitCount = 0;
ignoreCount = 0;
lineNumber = 460;
location = 2Term;
modificationTime = 300162433.359401;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B649E15211E2BF130061921F /* VT52View.mm:107 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B67606D311DEDB4100D6B66C /* VT52View.mm */;
functionName = "-keyDown:";
hitCount = 0;
ignoreCount = 0;
lineNumber = 107;
location = 2Term;
modificationTime = 300162433.3597261;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B649E17111E2C3C50061921F /* VT52View.mm:598 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B67606D311DEDB4100D6B66C /* VT52View.mm */;
functionName = "-processCharacter:";
hitCount = 0;
ignoreCount = 0;
lineNumber = 598;
location = 2Term;
modificationTime = 300162433.360043;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B649E17311E2C3C80061921F /* VT52View.mm:607 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B67606D311DEDB4100D6B66C /* VT52View.mm */;
functionName = "-processCharacter:";
hitCount = 0;
ignoreCount = 0;
lineNumber = 607;
location = 2Term;
modificationTime = 300162433.360378;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B649E18B11E2CC4A0061921F /* VT52View.mm:170 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B67606D311DEDB4100D6B66C /* VT52View.mm */;
functionName = "-keyDown:";
hitCount = 0;
ignoreCount = 0;
lineNumber = 170;
location = 2Term;
modificationTime = 300162433.360708;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B649E19511E2CC800061921F /* VT52View.mm:113 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B67606D311DEDB4100D6B66C /* VT52View.mm */;
functionName = "-keyDown:";
hitCount = 0;
ignoreCount = 0;
lineNumber = 113;
location = 2Term;
modificationTime = 300162433.36103;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B649E1B211E2CDDE0061921F /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B67606D911DF6DAB00D6B66C /* EmulatorView.mm */;
name = "EmulatorView.mm: 56";
rLen = 0;
rLoc = 869;
rType = 0;
vrLen = 396;
vrLoc = 597;
};
B65FA27911E29E8D00EB447E /* EmulatorView.mm:64 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B67606D911DF6DAB00D6B66C /* EmulatorView.mm */;
functionName = "-drawRect:";
hitCount = 0;
ignoreCount = 0;
lineNumber = 64;
location = 2Term;
modificationTime = 300162433.359032;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B65FA28111E29EDE00EB447E /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B6EBE2B311E0EA9100EA0458 /* CharacterGenerator.h */;
name = "CharacterGenerator.h: 18";
rLen = 0;
rLoc = 289;
rType = 0;
vrLen = 360;
vrLoc = 0;
};
B65FA2AD11E29F9300EB447E /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B67606D811DF6DAB00D6B66C /* EmulatorView.h */;
name = "EmulatorView.h: 45";
rLen = 0;
rLoc = 826;
rType = 0;
vrLen = 578;
vrLoc = 567;
};
B65FA2B411E29F9A00EB447E /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 256AC3D90F4B6AC300CF3369 /* TwoTermAppDelegate.m */;
name = "TwoTermAppDelegate.m: 36";
rLen = 0;
rLoc = 778;
rType = 0;
vrLen = 778;
vrLoc = 0;
};
B65FA2FE11E2A5D200EB447E /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B65FA2FF11E2A5D200EB447E /* stl_vector.h */;
name = "stl_vector.h: 602";
rLen = 0;
rLoc = 20767;
rType = 0;
vrLen = 648;
vrLoc = 20466;
};
B65FA2FF11E2A5D200EB447E /* stl_vector.h */ = {
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = stl_vector.h;
path = "/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/stl_vector.h";
sourceTree = "<absolute>";
};
B676053511DADB8100D6B66C /* 2Term */ = {
isa = PBXExecutable;
activeArgIndices = (
);
argumentStrings = (
);
autoAttachOnCrash = 1;
breakpointsEnabled = 1;
configStateDict = {
};
customDataFormattersEnabled = 1;
dataTipCustomDataFormattersEnabled = 1;
dataTipShowTypeColumn = 1;
dataTipSortType = 0;
debuggerPlugin = GDBDebugging;
disassemblyDisplayState = 0;
dylibVariantSuffix = "";
enableDebugStr = 1;
environmentEntries = (
);
executableSystemSymbolLevel = 0;
executableUserSymbolLevel = 0;
libgmallocEnabled = 0;
name = 2Term;
savedGlobals = {
};
showTypeColumn = 0;
sourceDirectories = (
);
variableFormatDictionary = {
};
};
B676054811DADB9100D6B66C /* Source Control */ = {
isa = PBXSourceControlManager;
fallbackIsa = XCSourceControlManager;
isSCMEnabled = 0;
scmConfiguration = {
repositoryNamesForRoots = {
"" = "";
};
};
};
B676054911DADB9100D6B66C /* Code sense */ = {
isa = PBXCodeSenseManager;
indexTemplatePath = "";
};
B676058811DAE21100D6B66C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 29B97316FDCFA39411CA2CEA /* main.m */;
name = "main.m: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 256;
vrLoc = 0;
};
B676058911DAE21100D6B66C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B676058A11DAE21100D6B66C /* Cocoa.h */;
name = "Cocoa.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 485;
vrLoc = 0;
};
B676058A11DAE21100D6B66C /* Cocoa.h */ = {
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = Cocoa.h;
path = /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h;
sourceTree = "<absolute>";
};
B676058B11DAE21100D6B66C /* PlistBookmark */ = {
isa = PlistBookmark;
fRef = 8D1107310486CEB800E47090 /* TwoTerm-Info.plist */;
fallbackIsa = PBXBookmark;
isK = 0;
kPath = (
);
name = "/Users/kelvin/Projects/2Term/TwoTerm-Info.plist";
rLen = 0;
rLoc = 9223372036854775808;
};
B676058C11DAE21100D6B66C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 256AC3F00F4B6AF500CF3369 /* TwoTerm_Prefix.pch */;
name = "TwoTerm_Prefix.pch: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 141;
vrLoc = 0;
};
B67605BA11DAE85700D6B66C /* NSObjCRuntime.h */ = {
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = NSObjCRuntime.h;
path = /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h;
sourceTree = "<absolute>";
};
B676060711DD4FA600D6B66C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B67605BA11DAE85700D6B66C /* NSObjCRuntime.h */;
name = "NSObjCRuntime.h: 180";
rLen = 0;
rLoc = 6179;
rType = 0;
vrLen = 522;
vrLoc = 0;
};
B676062F11DE96AE00D6B66C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 256AC3D80F4B6AC300CF3369 /* TwoTermAppDelegate.h */;
name = "TwoTermAppDelegate.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 397;
vrLoc = 0;
};
B676063911DEAD3500D6B66C /* TermWindowController.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 978}}";
sepNavSelRange = "{175, 0}";
sepNavVisRange = "{0, 343}";
};
};
B676063A11DEAD3500D6B66C /* TermWindowController.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {653, 1261}}";
sepNavSelRange = "{492, 0}";
sepNavVisRange = "{948, 685}";
};
};
B676064811DEB80600D6B66C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B676063911DEAD3500D6B66C /* TermWindowController.h */;
name = "TermWindowController.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 374;
vrLoc = 0;
};
B676066111DEBFB000D6B66C /* TwoTermAppDelegate.m:35 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = 256AC3D90F4B6AC300CF3369 /* TwoTermAppDelegate.m */;
functionName = "-applicationDidFinishLaunching:";
hitCount = 0;
ignoreCount = 0;
lineNumber = 35;
location = 2Term;
modificationTime = 300162433.356804;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B676066711DEC06900D6B66C /* TermWindowController.m:31 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B676063A11DEAD3500D6B66C /* TermWindowController.m */;
functionName = "-awakeFromNib";
hitCount = 0;
ignoreCount = 0;
lineNumber = 31;
location = 2Term;
modificationTime = 300162433.357529;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B676069511DEC97D00D6B66C /* TermWindowController.m:97 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B676063A11DEAD3500D6B66C /* TermWindowController.m */;
functionName = "-readPTY";
hitCount = 0;
ignoreCount = 0;
lineNumber = 97;
location = 2Term;
modificationTime = 300162433.357888;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B67606B011DECD4E00D6B66C /* TermWindowController.m:97 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B676063A11DEAD3500D6B66C /* TermWindowController.m */;
functionName = "-readPTY";
hitCount = 0;
ignoreCount = 0;
lineNumber = 97;
location = 2Term;
modificationTime = 300162433.358252;
originalNumberOfMultipleMatches = 1;
state = 2;
};
B67606C811DED91C00D6B66C /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B67606C911DED91C00D6B66C /* poll.h */;
name = "poll.h: 90";
rLen = 61;
rLoc = 4064;
rType = 0;
vrLen = 275;
vrLoc = 4393;
};
B67606C911DED91C00D6B66C /* poll.h */ = {
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = poll.h;
path = /Developer/SDKs/MacOSX10.6.sdk/usr/include/sys/poll.h;
sourceTree = "<absolute>";
};
B67606D211DEDB4100D6B66C /* VT52View.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 978}}";
sepNavSelRange = "{514, 0}";
sepNavVisRange = "{0, 515}";
};
};
B67606D311DEDB4100D6B66C /* VT52View.mm */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 8684}}";
sepNavSelRange = "{3570, 521}";
sepNavVisRange = "{8318, 1919}";
};
};
B67606D811DF6DAB00D6B66C /* EmulatorView.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 1040}}";
sepNavSelRange = "{826, 0}";
sepNavVisRange = "{32, 1378}";
};
};
B67606D911DF6DAB00D6B66C /* EmulatorView.mm */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {653, 2418}}";
sepNavSelRange = "{869, 0}";
sepNavVisRange = "{597, 396}";
};
};
B676070811DF8F4100D6B66C /* TermWindowController.m:97 */ = {
isa = PBXFileBreakpoint;
actions = (
);
breakpointStyle = 0;
continueAfterActions = 0;
countType = 0;
delayBeforeContinue = 0;
fileReference = B676063A11DEAD3500D6B66C /* TermWindowController.m */;
functionName = "-keyDown:";
hitCount = 0;
ignoreCount = 0;
lineNumber = 97;
modificationTime = 300162443.237363;
originalNumberOfMultipleMatches = 1;
state = 1;
};
B699A02E11E528BC00F54CC8 /* Screen.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 1664}}";
sepNavSelRange = "{652, 155}";
sepNavVisRange = "{0, 1466}";
};
};
B699A02F11E528BC00F54CC8 /* Screen.cpp */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 3198}}";
sepNavSelRange = "{1592, 0}";
sepNavVisRange = "{277, 1316}";
};
};
B699A03211E528DE00F54CC8 /* iGeometry.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 978}}";
sepNavSelRange = "{818, 0}";
sepNavVisRange = "{0, 983}";
};
};
B699A05B11E54D4500F54CC8 /* OutputChannel.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {653, 468}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 620}";
};
};
B699A05C11E54D4500F54CC8 /* OutputChannel.cpp */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 978}}";
sepNavSelRange = "{595, 0}";
sepNavVisRange = "{0, 1348}";
};
};
B699A08B11E5720F00F54CC8 /* Emulator.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {663, 432}}";
sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 497}";
};
};
B699A08F11E572A300F54CC8 /* VT52.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 978}}";
sepNavSelRange = "{383, 0}";
sepNavVisRange = "{0, 390}";
};
};
B699A09011E572A300F54CC8 /* VT52.mm */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {653, 5967}}";
sepNavSelRange = "{11766, 0}";
sepNavVisRange = "{6465, 1113}";
};
};
B699A0BE11E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B676063A11DEAD3500D6B66C /* TermWindowController.m */;
name = "TermWindowController.m: 30";
rLen = 0;
rLoc = 492;
rType = 0;
vrLen = 685;
vrLoc = 948;
};
B699A0BF11E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B699A02E11E528BC00F54CC8 /* Screen.h */;
name = "Screen.h: 19";
rLen = 0;
rLoc = 284;
rType = 0;
vrLen = 564;
vrLoc = 16;
};
B699A0C011E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B699A02F11E528BC00F54CC8 /* Screen.cpp */;
name = "Screen.cpp: 160";
rLen = 0;
rLoc = 3566;
rType = 0;
vrLen = 881;
vrLoc = 2845;
};
B699A0C111E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B699A03211E528DE00F54CC8 /* iGeometry.h */;
name = "iGeometry.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 550;
vrLoc = 0;
};
B699A0C211E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B699A05C11E54D4500F54CC8 /* OutputChannel.cpp */;
name = "OutputChannel.cpp: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 177;
vrLoc = 0;
};
B699A0C311E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B699A05B11E54D4500F54CC8 /* OutputChannel.h */;
name = "OutputChannel.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 620;
vrLoc = 0;
};
B699A0C411E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B6F444C711E41AC000C3A836 /* VT05.mm */;
name = "VT05.mm: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 532;
vrLoc = 0;
};
B699A0C511E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B699A08B11E5720F00F54CC8 /* Emulator.h */;
name = "Emulator.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 497;
vrLoc = 0;
};
B699A0C611E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B699A08F11E572A300F54CC8 /* VT52.h */;
name = "VT52.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 339;
vrLoc = 0;
};
B699A0C711E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B699A09011E572A300F54CC8 /* VT52.mm */;
name = "VT52.mm: 392";
rLen = 0;
rLoc = 11766;
rType = 0;
vrLen = 1113;
vrLoc = 6465;
};
B699A0C811E58D3B00F54CC8 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B699A09011E572A300F54CC8 /* VT52.mm */;
name = "VT52.mm: 395";
rLen = 0;
rLoc = 11766;
rType = 0;
vrLen = 1113;
vrLoc = 6465;
};
B6EBE2B311E0EA9100EA0458 /* CharacterGenerator.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {653, 468}}";
sepNavSelRange = "{289, 0}";
sepNavVisRange = "{0, 360}";
};
};
B6EBE2B411E0EA9100EA0458 /* CharacterGenerator.m */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 17602}}";
sepNavSelRange = "{23301, 0}";
sepNavVisRange = "{22129, 1885}";
};
};
B6EBE2CA11E0FF3E00EA0458 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B67606D211DEDB4100D6B66C /* VT52View.h */;
name = "VT52View.h: 23";
rLen = 0;
rLoc = 475;
rType = 0;
vrLen = 515;
vrLoc = 0;
};
B6F444C611E41AC000C3A836 /* VT05.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 978}}";
sepNavSelRange = "{387, 0}";
sepNavVisRange = "{0, 387}";
};
};
B6F444C711E41AC000C3A836 /* VT05.mm */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1249, 3016}}";
sepNavSelRange = "{5073, 0}";
sepNavVisRange = "{3747, 2067}";
};
};
B6F444CD11E41C7200C3A836 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B67606D311DEDB4100D6B66C /* VT52View.mm */;
name = "VT52View.mm: 147";
rLen = 0;
rLoc = 2820;
rType = 0;
vrLen = 772;
vrLoc = 1448;
};
B6F444CF11E41C7200C3A836 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = B6F444C611E41AC000C3A836 /* VT05.h */;
name = "VT05.h: 1";
rLen = 0;
rLoc = 0;
rType = 0;
vrLen = 198;
vrLoc = 0;
};
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,347 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
256AC3DA0F4B6AC300CF3369 /* TwoTermAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* TwoTermAppDelegate.m */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
B676063B11DEAD3500D6B66C /* TermWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B676063A11DEAD3500D6B66C /* TermWindowController.m */; };
B676065111DEBAE900D6B66C /* TermWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = B676065011DEBAE900D6B66C /* TermWindow.xib */; };
B67606D411DEDB4100D6B66C /* VT52View.mm in Sources */ = {isa = PBXBuildFile; fileRef = B67606D311DEDB4100D6B66C /* VT52View.mm */; };
B67606DA11DF6DAB00D6B66C /* EmulatorView.mm in Sources */ = {isa = PBXBuildFile; fileRef = B67606D911DF6DAB00D6B66C /* EmulatorView.mm */; };
B699A03011E528BC00F54CC8 /* Screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B699A02F11E528BC00F54CC8 /* Screen.cpp */; };
B699A05D11E54D4500F54CC8 /* OutputChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B699A05C11E54D4500F54CC8 /* OutputChannel.cpp */; };
B699A09111E572A300F54CC8 /* VT52.mm in Sources */ = {isa = PBXBuildFile; fileRef = B699A09011E572A300F54CC8 /* VT52.mm */; };
B6EBE2B511E0EA9100EA0458 /* CharacterGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = B6EBE2B411E0EA9100EA0458 /* CharacterGenerator.m */; };
B6F444C811E41AC000C3A836 /* VT05.mm in Sources */ = {isa = PBXBuildFile; fileRef = B6F444C711E41AC000C3A836 /* VT05.mm */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
256AC3D80F4B6AC300CF3369 /* TwoTermAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TwoTermAppDelegate.h; sourceTree = "<group>"; };
256AC3D90F4B6AC300CF3369 /* TwoTermAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TwoTermAppDelegate.m; sourceTree = "<group>"; };
256AC3F00F4B6AF500CF3369 /* TwoTerm_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TwoTerm_Prefix.pch; sourceTree = "<group>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
8D1107310486CEB800E47090 /* TwoTerm-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "TwoTerm-Info.plist"; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* 2Term.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 2Term.app; sourceTree = BUILT_PRODUCTS_DIR; };
B676063911DEAD3500D6B66C /* TermWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TermWindowController.h; sourceTree = "<group>"; };
B676063A11DEAD3500D6B66C /* TermWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TermWindowController.m; sourceTree = "<group>"; };
B676064D11DEBAE300D6B66C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TermWindow.xib; sourceTree = "<group>"; };
B67606D211DEDB4100D6B66C /* VT52View.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VT52View.h; sourceTree = "<group>"; };
B67606D311DEDB4100D6B66C /* VT52View.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VT52View.mm; sourceTree = "<group>"; };
B67606D811DF6DAB00D6B66C /* EmulatorView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulatorView.h; sourceTree = "<group>"; };
B67606D911DF6DAB00D6B66C /* EmulatorView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EmulatorView.mm; sourceTree = "<group>"; };
B699A02E11E528BC00F54CC8 /* Screen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Screen.h; sourceTree = "<group>"; };
B699A02F11E528BC00F54CC8 /* Screen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Screen.cpp; sourceTree = "<group>"; };
B699A03211E528DE00F54CC8 /* iGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iGeometry.h; sourceTree = "<group>"; };
B699A05B11E54D4500F54CC8 /* OutputChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OutputChannel.h; sourceTree = "<group>"; };
B699A05C11E54D4500F54CC8 /* OutputChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OutputChannel.cpp; sourceTree = "<group>"; };
B699A08B11E5720F00F54CC8 /* Emulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Emulator.h; sourceTree = "<group>"; };
B699A08F11E572A300F54CC8 /* VT52.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VT52.h; sourceTree = "<group>"; };
B699A09011E572A300F54CC8 /* VT52.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VT52.mm; sourceTree = "<group>"; };
B6EBE2B311E0EA9100EA0458 /* CharacterGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterGenerator.h; sourceTree = "<group>"; };
B6EBE2B411E0EA9100EA0458 /* CharacterGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CharacterGenerator.m; sourceTree = "<group>"; };
B6F444C611E41AC000C3A836 /* VT05.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VT05.h; sourceTree = "<group>"; };
B6F444C711E41AC000C3A836 /* VT05.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VT05.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
256AC3D80F4B6AC300CF3369 /* TwoTermAppDelegate.h */,
256AC3D90F4B6AC300CF3369 /* TwoTermAppDelegate.m */,
B676063911DEAD3500D6B66C /* TermWindowController.h */,
B676063A11DEAD3500D6B66C /* TermWindowController.m */,
B67606D211DEDB4100D6B66C /* VT52View.h */,
B67606D311DEDB4100D6B66C /* VT52View.mm */,
B67606D811DF6DAB00D6B66C /* EmulatorView.h */,
B67606D911DF6DAB00D6B66C /* EmulatorView.mm */,
B6EBE2B311E0EA9100EA0458 /* CharacterGenerator.h */,
B6EBE2B411E0EA9100EA0458 /* CharacterGenerator.m */,
B6F444C611E41AC000C3A836 /* VT05.h */,
B699A08B11E5720F00F54CC8 /* Emulator.h */,
B699A08F11E572A300F54CC8 /* VT52.h */,
B699A09011E572A300F54CC8 /* VT52.mm */,
B6F444C711E41AC000C3A836 /* VT05.mm */,
B699A02E11E528BC00F54CC8 /* Screen.h */,
B699A02F11E528BC00F54CC8 /* Screen.cpp */,
B699A03211E528DE00F54CC8 /* iGeometry.h */,
B699A05B11E54D4500F54CC8 /* OutputChannel.h */,
B699A05C11E54D4500F54CC8 /* OutputChannel.cpp */,
);
name = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* 2Term.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* 2Term */ = {
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = 2Term;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
256AC3F00F4B6AF500CF3369 /* TwoTerm_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
8D1107310486CEB800E47090 /* TwoTerm-Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
B676065011DEBAE900D6B66C /* TermWindow.xib */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* 2Term */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "2Term" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = 2Term;
productInstallPath = "$(HOME)/Applications";
productName = 2Term;
productReference = 8D1107320486CEB800E47090 /* 2Term.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "2Term" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 29B97314FDCFA39411CA2CEA /* 2Term */;
projectDirPath = "";
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* 2Term */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
B676065111DEBAE900D6B66C /* TermWindow.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
256AC3DA0F4B6AC300CF3369 /* TwoTermAppDelegate.m in Sources */,
B676063B11DEAD3500D6B66C /* TermWindowController.m in Sources */,
B67606D411DEDB4100D6B66C /* VT52View.mm in Sources */,
B67606DA11DF6DAB00D6B66C /* EmulatorView.mm in Sources */,
B6EBE2B511E0EA9100EA0458 /* CharacterGenerator.m in Sources */,
B6F444C811E41AC000C3A836 /* VT05.mm in Sources */,
B699A03011E528BC00F54CC8 /* Screen.cpp in Sources */,
B699A05D11E54D4500F54CC8 /* OutputChannel.cpp in Sources */,
B699A09111E572A300F54CC8 /* VT52.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C165DFE840E0CC02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
1DDD58150DA1D0A300B32029 /* English */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
B676065011DEBAE900D6B66C /* TermWindow.xib */ = {
isa = PBXVariantGroup;
children = (
B676064D11DEBAE300D6B66C /* English */,
);
name = TermWindow.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = TwoTerm_Prefix.pch;
INFOPLIST_FILE = "TwoTerm-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = 2Term;
};
name = Debug;
};
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = _Term_Prefix.pch;
INFOPLIST_FILE = "TwoTerm-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = 2Term;
};
name = Release;
};
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
};
name = Debug;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = macosx10.6;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "2Term" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4B08A954540054247B /* Debug */,
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "2Term" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4F08A954540054247B /* Debug */,
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}

22
CharacterGenerator.h Normal file
View File

@ -0,0 +1,22 @@
//
// CharacterGenerator.h
// 2Term
//
// Created by Kelvin Sherlock on 7/4/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface CharacterGenerator : NSObject {
unsigned _base;
NSArray *_characters;
}
+(CharacterGenerator *)generator;
-(NSImage *)imageForCharacter: (unsigned)character;
@end

1343
CharacterGenerator.m Normal file

File diff suppressed because it is too large Load Diff

26
Emulator.h Normal file
View File

@ -0,0 +1,26 @@
//
// Emulator.h
// 2Term
//
// Created by Kelvin Sherlock on 7/7/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
@class NSEvent;
#ifdef __cplusplus
class Screen;
class OutputChannel;
#else
#define Screen void
#define OutputChannel void;
#endif
@protocol Emulator
-(void)processCharacter: (uint8_t)c screen: (Screen *)screen output: (OutputChannel *)output;
-(void)keyDown: (NSEvent *)event screen: (Screen *)screen output: (OutputChannel *)output;
-(void)reset;
@end

79
EmulatorView.h Normal file
View File

@ -0,0 +1,79 @@
//
// EmulatorView.h
// 2Term
//
// Created by Kelvin Sherlock on 7/3/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#ifdef __cplusplus
#include <vector>
#endif
struct CursorPosition {
#ifdef __cplusplus
CursorPosition(int _x, int _y) throw() : x(_x), y(_y) {}
CursorPosition() throw() : x(0), y(0) {}
bool operator == (const CursorPosition& rhs) throw()
{ return rhs.x == x && rhs.y == y; }
bool operator != (const CursorPosition& rhs) throw()
{ return ! (*this == rhs); }
#endif
int x;
int y;
};
struct CharInfo {
char c;
uint8_t flags;
};
@class CharacterGenerator;
@interface EmulatorView : NSView {
int _fd;
/* these should not be modified without locking */
struct CursorPosition _cursor;
struct CharInfo _screen[24][80];
/* end locking */
NSThread *_readerThread;
NSLock *_lock;
CharacterGenerator *_charGen;
NSColor *_backgroundColor;
NSColor *_foregroundColor;
CGFloat _charHeight;
CGFloat _charWidth;
unsigned _height;
unsigned _width;
#ifdef __cplusplus
//std::vector< std::vector<CharInfo> > _screen;
#endif
}
-(void)startBackgroundReader;
-(void)dataAvailable;
@property (nonatomic, assign) int fd;
@property (nonatomic, assign) struct CursorPosition cursorPosition;
@end

175
EmulatorView.mm Normal file
View File

@ -0,0 +1,175 @@
//
// EmulatorView.m
// 2Term
//
// Created by Kelvin Sherlock on 7/3/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "EmulatorView.h"
#import "CharacterGenerator.h"
@implementation EmulatorView
@synthesize fd = _fd;
@synthesize cursorPosition = _cursor;
-(void)awakeFromNib
{
_charWidth = 7;
_charHeight = 16;
_height = 24;
_width = 80;
_foregroundColor = [[NSColor greenColor] retain];
_backgroundColor = [[NSColor blackColor] retain];
_charGen = [[CharacterGenerator generator] retain];
_lock = [NSLock new];
std::memset(_screen, 0, sizeof(_screen));
_cursor = CursorPosition(0, 0);
}
-(BOOL)isFlipped
{
return YES;
}
-(void)viewDidMoveToWindow
{
[self becomeFirstResponder];
}
-(void)viewDidMoveToSuperview
{
[self becomeFirstResponder];
}
-(BOOL)acceptsFirstResponder
{
return YES;
}
-(void)drawRect:(NSRect)dirtyRect
{
NSRect bounds = [self bounds];
unsigned x, y;
unsigned minX = floor(dirtyRect.origin.x / _charWidth);
unsigned maxX = ceil((dirtyRect.origin.x + dirtyRect.size.width) / _charWidth);
unsigned minY = floor(dirtyRect.origin.y / _charHeight);
unsigned maxY = ceil((dirtyRect.origin.y + dirtyRect.size.height) / _charHeight);
// x/y are 0-indexed here.
maxY = std::min(_height - 1, maxY);
maxX = std::min(_width - 1, maxX);
[_backgroundColor setFill];
NSRectFill(dirtyRect);
[_foregroundColor setFill];
[_lock lock];
for (x = minX; x <= maxX; ++x)
{
for (y = minY; y <= maxY; ++y)
{
NSImage *img;
CharInfo ci = _screen[y][x];
// todo -- check flags to determine fg/bg color, etc.
img = [_charGen imageForCharacter: ci.c];
/*
[img drawAtPoint: NSMakePoint(x * _charWidth, y * _charHeight)
fromRect: NSZeroRect
operation:NSCompositeCopy
fraction: 1.0];
*/
if (img)
{
[img drawInRect: NSMakeRect(x * _charWidth, y *_charHeight, _charWidth, _charHeight)
fromRect: NSZeroRect operation: NSCompositeCopy
fraction: 1.0
respectFlipped: YES
hints: nil];
}
}
}
[_lock unlock];
}
-(void)dealloc
{
[_readerThread release];
[_lock release];
[super dealloc];
}
-(void)startBackgroundReader
{
if (_readerThread) return;
_readerThread = [[NSThread alloc] initWithTarget: self selector: @selector(_readerThread) object: nil];
[_readerThread start];
}
-(void)_readerThread
{
// I would prefer to poll(2) but it's broken on os x for ptys.
int fd = _fd;
for(;;)
{
int n;
fd_set read_set;
fd_set error_set;
FD_ZERO(&read_set);
FD_SET(fd, &read_set);
FD_ZERO(&error_set);
FD_SET(fd, &error_set);
n = select(fd + 1, &read_set, NULL, &error_set, NULL);
if (n == 0) continue;
if (n < 0) break;
if (FD_ISSET(fd, &error_set)) break;
if (FD_ISSET(fd, &read_set)) [self dataAvailable];
}
}
-(void)dataAvailable { }
@end

View File

@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

4182
English.lproj/MainMenu.xib Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,658 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">10F569</string>
<string key="IBDocument.InterfaceBuilderVersion">788</string>
<string key="IBDocument.AppKitVersion">1038.29</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">788</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomObject" id="1001">
<string key="NSClassName">TermWindowController</string>
</object>
<object class="NSCustomObject" id="1003">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1004">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="1005">
<int key="NSWindowStyleMask">271</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{196, 66}, {620, 444}}</string>
<int key="NSWTFlags">544735232</int>
<string key="NSWindowTitle">Two Term [VT52]</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<object class="NSView" key="NSWindowView" id="1006">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomView" id="296370061">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSCustomView" id="59249513">
<reference key="NSNextResponder" ref="296370061"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{10, 10}, {560, 384}}</string>
<reference key="NSSuperview" ref="296370061"/>
<string key="NSClassName">VT52View</string>
</object>
</object>
<string key="NSFrame">{{20, 20}, {580, 404}}</string>
<reference key="NSSuperview" ref="1006"/>
<string key="NSClassName">NSView</string>
</object>
</object>
<string key="NSFrameSize">{620, 444}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="1005"/>
</object>
<int key="connectionID">3</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="1005"/>
<reference key="destination" ref="1001"/>
</object>
<int key="connectionID">4</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_emulatorView</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="59249513"/>
</object>
<int key="connectionID">6</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1001"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1003"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1004"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="1005"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="1006"/>
</object>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="1006"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="296370061"/>
</object>
<reference key="parent" ref="1005"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="296370061"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="59249513"/>
</object>
<reference key="parent" ref="1006"/>
<string key="objectName">Back View</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="59249513"/>
<reference key="parent" ref="296370061"/>
<string key="objectName">Emulator View</string>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBPluginDependency</string>
<string>1.IBWindowTemplateEditedContentRect</string>
<string>1.NSWindowTemplate.visibleAtLaunch</string>
<string>1.WindowOrigin</string>
<string>1.editorWindowContentRectSynchronizationRect</string>
<string>2.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>7.IBPluginDependency</string>
<string>7.IBViewIntegration.shadowColor</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>{{367, 306}, {620, 444}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{367, 306}, {620, 444}}</string>
<integer value="1"/>
<string>{196, 240}</string>
<string>{{202, 428}, {480, 270}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">8</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">EmulatorView</string>
<string key="superclassName">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">EmulatorView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">TermWindowController</string>
<string key="superclassName">NSWindowController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">_emulatorView</string>
<string key="NS.object.0">EmulatorView</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">_emulatorView</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">_emulatorView</string>
<string key="candidateClassName">EmulatorView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">TermWindowController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VT52View</string>
<string key="superclassName">EmulatorView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">VT52View.h</string>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="267188615">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="248065508">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="371645594">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSApplication</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSMenu</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="476434228">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="267188615"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="248065508"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="371645594"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<reference key="sourceIdentifier" ref="476434228"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="921292085">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSResponder</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSView</string>
<string key="superclassName">NSResponder</string>
<reference key="sourceIdentifier" ref="921292085"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<string key="superclassName">NSResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSWindowController</string>
<string key="superclassName">NSResponder</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">showWindow:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">showWindow:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">showWindow:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
</object>
</object>
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1060" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
<integer value="3000" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">../2Term.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>

75
OutputChannel.cpp Normal file
View File

@ -0,0 +1,75 @@
/*
* OutputChannel.cpp
* 2Term
*
* Created by Kelvin Sherlock on 7/7/2010.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#include "OutputChannel.h"
#include <unistd.h>
#include <fcntl.h>
#include <cstring>
#include <cerrno>
bool OutputChannel::write(uint8_t c)
{
return write(&c, 1);
}
bool OutputChannel::write(const char *str)
{
return write(str, std::strlen(str));
}
bool OutputChannel::write(const void *vp, size_t size)
{
if (!size) return true;
for (unsigned i = 0; ;)
{
ssize_t s = ::write(_fd, vp, size);
if (s < 0)
{
switch (errno)
{
case EAGAIN:
case EINTR:
if (++i < 3) break;
default:
_error = errno;
// throw?
return false;
}
}
else if (size == s)
{
return true;
}
else if (s == 0)
{
if (++i == 3)
{
_error = EIO;
return false;
}
}
else
{
size -= s;
vp = (uint8_t *)vp + s;
if (size == 0) return true;
}
}
return false;
}

36
OutputChannel.h Normal file
View File

@ -0,0 +1,36 @@
/*
* OutputChannel.h
* 2Term
*
* Created by Kelvin Sherlock on 7/7/2010.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#ifndef __OUTPUT_CHANNEL_H__
#define __OUTPUT_CHANNEL_H__
#include <stdint.h>
#include <sys/types.h>
class OutputChannel
{
public:
OutputChannel(int fd) : _fd(fd), _error(0) {};
bool write(uint8_t);
bool write(const char *);
bool write(const void *, size_t);
int error() const { return _error; }
private:
OutputChannel(const OutputChannel&);
OutputChannel& operator=(const OutputChannel&);
int _fd;
int _error;
};
#endif

229
Screen.cpp Normal file
View File

@ -0,0 +1,229 @@
/*
* Screen.cpp
* 2Term
*
* Created by Kelvin Sherlock on 7/7/2010.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#include "Screen.h"
#include <algorithm>
Screen::Screen(unsigned height, unsigned width)
{
_height = height;
_width = width;
_flag = 0;
_screen.resize(_height);
for (ScreenIterator iter = _screen.begin(); iter != _screen.end(); ++iter)
{
iter->resize(_width);
}
}
void Screen::beginUpdate()
{
_updates.clear();
}
iRect Screen::endUpdate()
{
int maxX = -1;
int maxY = -1;
int minX = _width;
int minY = _height;
for (UpdateIterator iter = _updates.begin(); iter != _updates.end(); ++iter)
{
maxX = std::max(maxX, iter->x);
maxY = std::max(maxY, iter->y);
minX = std::min(minX, iter->x);
minY = std::min(minY, iter->y);
}
return iRect(iPoint(minX, minY), iSize(maxX + 1 - minX, maxY + 1 - minY));
}
void Screen::setFlag(uint8_t flag)
{
_flag = flag;
}
void Screen::putc(uint8_t c, bool incrementX)
{
if (_cursor.x < _width)
{
_updates.push_back(_cursor);
_screen[_cursor.y][_cursor.x] = CharInfo(c, _flag);
if (incrementX && _cursor.x < _width - 1) ++_cursor.x;
}
}
void Screen::setX(int x, bool clamp)
{
if (x < 0)
{
if (clamp) _cursor.x = 0;
return;
}
if (x >= _width)
{
if (clamp) _cursor.x = _width - 1;
return;
}
_cursor.x = x;
}
void Screen::setY(int y, bool clamp)
{
if (y < 0)
{
if (clamp) _cursor.y = 0;
return;
}
if (y >= _height)
{
if (clamp) _cursor.y = _height - 1;
return;
}
_cursor.y = y;
}
int Screen::incrementX(bool clamp)
{
setX(_cursor.x + 1, clamp);
return _cursor.x;
}
int Screen::decrementX(bool clamp)
{
setX(_cursor.x - 1, clamp);
return _cursor.x;
}
int Screen::incrementY(bool clamp)
{
setY(_cursor.y + 1, clamp);
return _cursor.y;
}
int Screen::decrementY(bool clamp)
{
setY(_cursor.y - 1, clamp);
return _cursor.y;
}
void Screen::eraseLine()
{
// erases everything to the right of, and including, the cursor
for (CharInfoIterator ciIter = _screen[_cursor.y].begin() + _cursor.x; ciIter < _screen[_cursor.y].end(); ++ciIter)
{
*ciIter = CharInfo(0, _flag);
}
_updates.push_back(_cursor);
_updates.push_back(iPoint(_width - 1, _cursor.y));
}
void Screen::eraseScreen()
{
// returns everything to the right of, and including, the cursor as well as all subsequent lines.
eraseLine();
if (_cursor.y == _height -1) return;
for (ScreenIterator iter = _screen.begin() + _cursor.y; iter < _screen.end(); ++iter)
{
for (CharInfoIterator ciIter = iter->begin(); ciIter < iter->end(); ++ciIter)
{
*ciIter = CharInfo(0, _flag);
}
}
_updates.push_back(iPoint(0, _cursor.y + 1));
_updates.push_back(iPoint(_width - 1, _height - 1));
}
void Screen::lineFeed()
{
// moves the screen up one row, inserting a blank line at the bottom.
if (_cursor.y == _height - 1)
{
// move lines 1..end up 1 line.
for (ScreenIterator iter = _screen.begin() + 1; iter < _screen.end(); ++iter)
{
iter[-1] = *iter;
}
// reset the bottom line
//_screen.back().clear();
//_screen.back().resize(_width);
for (CharInfoIterator ciIter = _screen.back().begin(); ciIter < _screen.back().end(); ++ciIter)
{
*ciIter = CharInfo(0, 0);
}
_updates.push_back(iPoint(0, 0));
_updates.push_back(iPoint(_width - 1, _height - 1));
}
else
{
_cursor.y++;
}
}
void Screen::reverseLineFeed()
{
// moves the cursor down one row, inserting a blank line at the top.
if (_cursor.y == 0)
{
for (ReverseScreenIterator iter = _screen.rbegin() + 1; iter < _screen.rend(); ++iter)
{
iter[-1] = *iter;
}
// reset the top line
//_screen.front().clear();
//_screen.front().resize(_width);
for (CharInfoIterator ciIter = _screen.front().begin(); ciIter < _screen.front().end(); ++ciIter)
{
*ciIter = CharInfo(0, 0);
}
_updates.push_back(iPoint(0, 0));
_updates.push_back(iPoint(_width - 1, _height - 1));
}
else
{
_cursor.y--;
}
}

133
Screen.h Normal file
View File

@ -0,0 +1,133 @@
/*
* Screen.h
* 2Term
*
* Created by Kelvin Sherlock on 7/7/2010.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#ifndef __SCREEN_H__
#define __SCREEN_H__
#include "iGeometry.h"
#include <vector>
typedef struct CharInfo {
CharInfo() : c(0), flag(0) {}
CharInfo(uint8_t cc, uint8_t ff) : c(cc), flag(ff) {}
uint8_t c;
uint8_t flag;
} CharInfo;
class Screen {
public:
Screen(unsigned height, unsigned width);
int x() const;
int y() const;
iPoint cursor() const;
uint8_t flag() const;
unsigned height() const;
unsigned width() const;
int incrementX(bool clamp = true);
int decrementX(bool clamp = true);
int incrementY(bool clamp = true);
int decrementY(bool clamp = true);
void setX(int x, bool clamp = true);
void setY(int y, bool clamp = true);
void setCursor(iPoint point, bool clampX = true, bool clampY = true);
void setCursor(int x, int y, bool clampX = true, bool clampY = true);
void setFlag(uint8_t flag);
void putc(uint8_t c, bool incrementX = true);
void eraseLine();
void eraseScreen();
void lineFeed();
void reverseLineFeed();
void beginUpdate();
iRect endUpdate();
private:
iPoint _cursor;
unsigned _height;
unsigned _width;
uint8_t _flag;
std::vector< std::vector< CharInfo > > _screen;
std::vector<iPoint> _updates;
typedef std::vector< std::vector< CharInfo > >::iterator ScreenIterator;
typedef std::vector< std::vector< CharInfo > >::reverse_iterator ReverseScreenIterator;
typedef std::vector<CharInfo>::iterator CharInfoIterator;
typedef std::vector<iPoint>::iterator UpdateIterator;
};
int Screen::x() const
{
return _cursor.x;
}
int Screen::y() const
{
return _cursor.y;
}
iPoint Screen::cursor() const
{
return _cursor;
}
uint8_t Screen::flag() const
{
return _flag;
}
unsigned Screen::height() const
{
return _height;
}
unsigned Screen::width() const
{
return _width;
}
void Screen::setCursor(iPoint point, bool clampX, bool clampY)
{
setX(point.x, clampX);
setY(point.y, clampY);
}
void Screen::setCursor(int x, int y, bool clampX, bool clampY)
{
setX(x, clampX);
setY(y, clampY);
}
#endif

24
TermWindowController.h Normal file
View File

@ -0,0 +1,24 @@
//
// TermWindowController.h
// 2Term
//
// Created by Kelvin Sherlock on 7/2/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class EmulatorView;
@interface TermWindowController : NSWindowController {
IBOutlet EmulatorView *_emulatorView;
int _child;
}
-(void)initPTY;
@end

98
TermWindowController.m Normal file
View File

@ -0,0 +1,98 @@
//
// TermWindowController.m
// 2Term
//
// Created by Kelvin Sherlock on 7/2/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "TermWindowController.h"
#import "EmulatorView.h"
#define TTYDEFCHARS
#include <util.h>
#include <unistd.h>
#include <fcntl.h>
#include <poll.h>
#include <errno.h>
#include <sys/ttydefaults.h>
@implementation TermWindowController
+(id)new
{
return [[self alloc] initWithWindowNibName: @"TermWindow"];
}
-(void)awakeFromNib
{
[self initPTY];
}
-(void)initPTY
{
int pid;
int fd;
struct termios term;
struct winsize ws = { 24, 80, 0, 0 };
//int flags;
memset(&term, 0, sizeof(term));
//term.c_oflag = OPOST | ONLCR;
//term.c_lflag = ECHO;
//term.c_iflag = ICRNL; // | ICANON | ECHOE | ISIG;
term.c_oflag = TTYDEF_OFLAG;
term.c_lflag = TTYDEF_LFLAG;
term.c_iflag = TTYDEF_IFLAG;
term.c_cflag = TTYDEF_CFLAG;
term.c_ispeed = term.c_ospeed = TTYDEF_SPEED;
memcpy(term.c_cc, ttydefchars, sizeof(ttydefchars));
pid = forkpty(&fd, NULL, &term, &ws);
if (pid < 0)
{
//error
return;
}
if (pid == 0)
{
const char *environ[] = {
"TERM=vt52",
"LANG=C",
"TERM_PROGRAM=2Term",
NULL
};
// call login -f [username]
// export TERM=...
execle("/usr/bin/login", "login", "-f", "kelvin", NULL, environ);
fprintf(stderr, "execle failed\n");
fflush(stderr);
exit(-1);
// child
}
/*
if (fcntl(fd, F_GETFL, &flags) < 0) flags = 0;
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
*/
_child = pid;
[_emulatorView setFd: fd];
[_emulatorView startBackgroundReader];
}
@end

32
TwoTerm-Info.plist Normal file
View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

18
TwoTermAppDelegate.h Normal file
View File

@ -0,0 +1,18 @@
//
// TwoTermAppDelegate.h
// 2Term
//
// Created by Kelvin Sherlock on 6/29/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface TwoTermAppDelegate : NSObject <NSApplicationDelegate> {
NSWindow *window;
NSImageView *imageView;
}
@property (assign) IBOutlet NSWindow *window;
@property (assign) IBOutlet NSImageView *imageView;
@end

38
TwoTermAppDelegate.m Normal file
View File

@ -0,0 +1,38 @@
//
// TwoTermAppDelegate.m
// 2Term
//
// Created by Kelvin Sherlock on 6/29/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import "TwoTermAppDelegate.h"
#include "chars.h"
#import "TermWindowController.h"
@implementation TwoTermAppDelegate
@synthesize window;
@synthesize imageView;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
/*
NSImage *image;
CGImageRef imgRef = ImageForCharacter('A');
image = [[NSImage alloc] initWithCGImage: imgRef size: CGSizeZero];
[imageView setImage: image];
[image release];
CGImageRelease(imgRef);
*/
NSWindowController * win = [TermWindowController new];
[win showWindow: nil];
}
@end

27
VT05.h Normal file
View File

@ -0,0 +1,27 @@
//
// VT05.h
// 2Term
//
// Created by Kelvin Sherlock on 7/6/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Emulator.h"
#include "iGeometry.h"
class OutputChannel;
class Screen;
@interface VT05 : NSObject <Emulator> {
unsigned _state;
struct iPoint _dca;
BOOL _upperCase;
}
-(void)tab: (Screen *)screen;
@end

231
VT05.mm Normal file
View File

@ -0,0 +1,231 @@
//
// VT05.m
// 2Term
//
// Created by Kelvin Sherlock on 7/6/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#include <sys/ttydefaults.h>
#include <cctype>
#import "VT05.h"
#include "OutputChannel.h"
#include "Screen.h"
@implementation VT05
enum {
StateText,
StateDCAY,
StateDCAX
};
enum {
VTBell = 07,
VTCursorLeft = 010,
VTTab = 011,
VTLineFeed = 012,
VTCursorDown = 013,
VTCarriageReturn = 015,
VTCAD = 016,
VTCursorRight = 030,
VTCursorUp = 032,
VTHome = 035,
VTEOL = 036,
VTEOS = 037
};
-(void)reset
{
_state = StateText;
}
-(void)keyDown: (NSEvent *)event screen: (Screen *)screen output: (OutputChannel *)output
{
unsigned flags = [event modifierFlags];
NSString *chars = [event charactersIgnoringModifiers];
unsigned length = [chars length];
for (unsigned i = 0; i < length; ++i)
{
unichar uc = [chars characterAtIndex: i];
uint8_t c;
switch (uc)
{
case NSLeftArrowFunctionKey:
output->write(VTCursorLeft);
break;
case NSRightArrowFunctionKey:
output->write(VTCursorRight);
break;
case NSUpArrowFunctionKey:
output->write(VTCursorUp);
break;
case NSDownArrowFunctionKey:
output->write(VTCursorDown);
break;
case NSHomeFunctionKey:
output->write(VTHome);
break;
case NSDeleteCharacter:
output->write(0x7f);
break;
default:
if (uc > 0x7f) break;
c = uc;
if (flags & NSControlKeyMask)
{
c = CTRL(c);
}
output->write(c);
break;
}
}
}
-(void)processCharacter: (uint8_t)c screen: (Screen *)screen output: (OutputChannel *)output
{
switch (_state)
{
case StateText:
{
switch (c)
{
case 0x00:
case 0x7f:
// padding.
break;
case VTBell:
/*
* Produces an audible tone.
*/
NSBeep();
break;
case VTCursorLeft:
// backspace aka left arrow.
screen->decrementX();
break;
case VTTab:
[self tab: screen];
break;
case VTLineFeed:
// line feed.
screen->lineFeed();
break;
case VTCursorDown:
// arrow down.
screen->incrementY();
break;
case VTCarriageReturn:
// carriage return;
screen->setX(0);
break;
case VTCAD:
// CAD
_state = StateDCAY;
break;
case VTCursorRight:
// right arrow.
screen->incrementX();
break;
case VTCursorUp:
// up arrow
screen->decrementY();
break;
case VTHome:
// home
screen->setCursor(0, 0);
break;
case VTEOL:
// erase line
screen->eraseLine();
break;
case VTEOS:
// erase screen,
screen->eraseScreen();
break;
default:
if (c >= ' ' && c < 0x7f)
{
// if cursor at end of screen, overwrite previous contents, doesn't advance cursor.
if (_upperCase) c = toupper(c);
screen->putc(c);
}
break;
}
break;
}
case StateDCAY:
{
// not sure how invalid values are handled.
if (c != 0x00)
{
_state = StateDCAX;
_dca.y = c - ' ';
}
break;
}
case StateDCAX:
{
if (c != 0x00)
{
_state = StateText;
_dca.x = c - ' ';
screen->setCursor(_dca);
}
break;
}
}
}
-(void)tab: (Screen *)screen
{
/*
* TAB (011_8) causes the cursor to move right to the next TAB stop each time the TAB code is received.
* TAB stops are preset eight character spaces apart. TAB stop locations are at characters positions 1, 9,
* 17, 25, 33, 41, 49, 57, and 65. Once the cursor reaches character position 65, all TAB commands
* received thereafter will cause the cursor to move only one character position. Once the cursor reaches
* character position 72, receipt of the the TAB code has no effect.
*/
int x = screen->x();
if (x >= screen->width() - 8)
{
screen->setX(x + 1);
}
else
{
screen->setX((x + 8) & ~7);
}
}
@end

27
VT52.h Normal file
View File

@ -0,0 +1,27 @@
//
// VT52.h
// 2Term
//
// Created by Kelvin Sherlock on 7/7/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "Emulator.h"
#include "iGeometry.h"
@interface VT52 : NSObject <Emulator> {
unsigned _model;
unsigned _state;
iPoint _dca;
BOOL _altKeyPad;
BOOL _graphics;
}
-(void)tab: (Screen *)screen;
@end

454
VT52.mm Normal file
View File

@ -0,0 +1,454 @@
//
// VT52.mm
// 2Term
//
// Created by Kelvin Sherlock on 7/7/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#include <sys/ttydefaults.h>
#include <cctype>
#import "VT52.h"
#include "OutputChannel.h"
#include "Screen.h"
enum {
StateText,
StateEsc,
StateDCAY,
StateDCAX
};
// VT52 is 24 x 80 upper/lowercase.
// 50/50H is 12 * 80, uppercase only. H has a keypad.
// The 50s only display/transmit uppercase characters and lack `~ {} characters on the keypad.
// VT55 is a VT52 with extra graphic display capabilites.
enum {
ModelVT52,
ModelVT50H,
ModelVT50,
ModelVT55
};
#define ESC "\x1b"
@implementation VT52
-(void)keyDown: (NSEvent *)event screen: (Screen *)screen output: (OutputChannel *)output
{
unsigned flags = [event modifierFlags];
NSString *chars = [event charactersIgnoringModifiers];
unsigned length = [chars length];
for (unsigned i = 0; i < length; ++i)
{
unichar uc = [chars characterAtIndex: i];
uint8_t c;
if (flags & NSNumericPadKeyMask)
{
if (_altKeyPad)
{
const char *str = NULL;
switch (uc)
{
case '0':
str = ESC "?p";
break;
case '1':
str = ESC "?q";
break;
case '2':
str = ESC "?r";
break;
case '3':
str = ESC "?s";
break;
case '4':
str = ESC "?t";
break;
case '5':
str = ESC "?u";
break;
case '6':
str = ESC "?v";
break;
case '7':
str = ESC "?w";
break;
case '8':
str = ESC "?x";
break;
case '9':
str = ESC "?y";
break;
case '.':
str = ESC "?n";
break;
case NSNewlineCharacter: //?
case NSEnterCharacter:
str = ESC "?M";
break;
}
if (str)
{
output->write(str);
break;
}
}
}
switch (uc)
{
case NSEnterCharacter:
output->write('\r');
break;
case NSDeleteCharacter:
output->write(0x7f);
break;
case NSUpArrowFunctionKey:
output->write(ESC "A");
break;
case NSDownArrowFunctionKey:
output->write(ESC "B");
break;
case NSRightArrowFunctionKey:
output->write(ESC "C");
break;
case NSLeftArrowFunctionKey:
output->write(ESC "D");
break;
default:
if (uc > 0x7f) break;
c = uc;
if (flags & NSControlKeyMask)
{
c = CTRL(c);
}
output->write(c);
break;
}
}
}
-(void)reset
{
_state = StateText;
}
-(void)processCharacter: (uint8_t)c screen: (Screen *)screen output: (OutputChannel *)output
{
switch (_state)
{
case StateEsc:
{
switch (c)
{
case 0x00:
case 0x7f:
// filler.
break;
case 0x1b:
/*
* If the VT50 or VT50H receives ESC ESC from the host, the second ESC will cancel the Escape Sequence ...
* If the VT52 receies ESC ESC, it will still be prepared to interpret rather than display the next displayable character.
*/
switch (_model) {
case ModelVT50:
case ModelVT50H:
_state = StateText;
break;
}
break;
// cursor control.
case 'A':
/* cursor up */
screen->decrementY();
_state = StateText;
break;
case 'C':
/* cursor right */
screen->incrementX();
_state = StateText;
break;
case 'B':
/* cursor down (not on VT50) */
if (_model != ModelVT50)
screen->incrementY();
_state = StateText;
break;
case 'D':
/* cursor left (not on the VT50) */
if (_model != ModelVT50)
screen->decrementX();
_state = StateText;
break;
case 'H':
/* home */
screen->setCursor(0, 0);
_state = StateText;
case 'Y':
/* direct cursor addressing (not on the VT50) */
if (_model == ModelVT50)
{
_state = StateText;
}
else
{
_state = StateDCAY;
}
break;
case 'I':
// reverse line feed
switch (_model) {
case ModelVT52:
case ModelVT55:
screen->reverseLineFeed();
break;
}
_state = StateText;
break;
// erasing
case 'K':
// erase to end of line
screen->eraseLine();
_state = StateText;
break;
case 'J':
// erase to end of screen.
screen->eraseScreen();
_state = StateText;
break;
// alternate keypad mode
case '=':
switch (_model) {
case ModelVT52:
case ModelVT55:
_altKeyPad = YES;
break;
}
_state = StateText;
break;
case '>':
switch (_model) {
case ModelVT52:
case ModelVT55:
_altKeyPad = NO;
break;
}
_state = StateText;
break;
// graphics.
case 'F':
switch (_model) {
case ModelVT52:
case ModelVT55:
_graphics = YES;
break;
}
_state = StateText;
break;
case 'G':
switch (_model) {
case ModelVT52:
case ModelVT55:
_graphics = NO;
break;
}
_state = StateText;
break;
case 'Z':
// identify terminal.
// NB -- these indicate no copier.
switch(_model) {
case ModelVT50:
output->write(ESC "/A");
break;
case ModelVT50H:
output->write(ESC "/H");
break;
case ModelVT52:
output->write(ESC "/K");
break;
case ModelVT55:
output->write(ESC "/C"); // E?
break;
}
break;
// hold screen unsupported.
// ESC 1 -- (VT55) -- enter graph drawing
// ESC 2 -- (VT55) -- exit graph drawing
default:
std::fprintf(stderr, "Unrecognized escape sequence: %02x (%c)\n", (int)c, c);
_state = StateText;
break;
}
break;
}
case StateDCAY:
{
if (c == 0x00) break;
_dca.y = c - 0x20;
_state = StateDCAX;
break;
}
case StateDCAX:
{
if (c == 0x00) break;
_dca.x = c - 0x20;
/*
* If the line # does not specify a line that exists on the screen, the VT50H
* will move the cursor to the bottom line of the screen. However, the VT52 will
* not move the cursor vertically if the vertical parameter is out of bounds.
*/
/*
* If the column number is greater than 157 and, therefore, does not specify a column
* that exists on the screen, the cursor is moved to the rightmost column on a line on all models.
*/
screen->setCursor(_dca, true, _model == ModelVT50H);
_state = StateText;
break;
}
case StateText:
{
switch(c)
{
case 0x00:
case 0x7f:
// filler
break;
case 0x1b:
_state = StateEsc;
break;
case 0x07:
NSBeep();
break;
case 0x08:
// backspace
screen->decrementX();
break;
case 0x09:
[self tab: screen];
case 0x0a:
screen->lineFeed();
break;
case 0x0d:
screen->setX(0);
break;
case 0x0e:
// VT52H only -- backwards compatability with the VT05.
if (_model == ModelVT50H)
_state = StateDCAY;
break;
default:
if (c >= 0x20 && c < 0x7f)
{
// VT50x cannot display anything in the range 0140--0176
if (c >= 0140 && (_model == ModelVT50 || _model == ModelVT50H))
c -= 040;
output->write(c);
}
}
break;
}
}
}
-(void)tab: (Screen *)screen
{
/*
* TAB (011_8) causes the cursor to move right to the next TAB stop each time the TAB code is received.
* TAB stops are preset eight character spaces apart. TAB stop locations are at characters positions 1, 9,
* 17, 25, 33, 41, 49, 57, and 65. Once the cursor reaches character position 65, all TAB commands
* received thereafter will cause the cursor to move only one character position. Once the cursor reaches
* character position 72, receipt of the the TAB code has no effect.
*/
int x = screen->x();
if (x >= screen->width() - 8)
{
screen->setX(x + 1);
}
else
{
screen->setX((x + 8) & ~7);
}
}
@end

36
VT52View.h Normal file
View File

@ -0,0 +1,36 @@
//
// VT52View.h
// 2Term
//
// Created by Kelvin Sherlock on 7/2/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "EmulatorView.h"
#include <string>
#include <vector>
@interface VT52View : EmulatorView {
BOOL _altKeyPad;
BOOL _vt50;
// terminal emulator implemented as a state machine.
unsigned _state;
// only used by child thread.
std::vector<struct CursorPosition> _updates;
char _yTemp[2];
}
@end

676
VT52View.mm Normal file
View File

@ -0,0 +1,676 @@
//
// VT52View.mm
// 2Term
//
// Created by Kelvin Sherlock on 7/2/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#include <cctype>
#include <algorithm>
#import "VT52View.h"
const char esc = 0x1b;
#define ESC "\x1b"
enum {
StateText,
StateEscape,
StateEscapeY1,
StateEscapeY2
};
@interface VT52View (Cursor)
-(void)cursorLeft;
-(void)cursorRight;
-(void)cursorUp;
-(void)cursorDown;
-(void)cursorHome;
-(void)_setCursor: (CursorPosition)cursor;
-(void)lineFeed;
-(void)reverseLineFeed;
-(void)carriageReturn;
-(void)tab;
@end
@interface VT52View (Private)
-(void)invalidate;
-(void)processCharacter: (uint8_t)c;
-(void)appendChar: (uint8_t)c;
-(void)eraseLine;
-(void)eraseScreen;
@end
@implementation VT52View
-(void)dataAvailable
{
//NB -- this is not the main thread.
// actually read the data
for(;;)
{
ssize_t i;
uint8_t buffer[512];
ssize_t size = read(_fd, buffer, sizeof(buffer));
NSAutoreleasePool *pool;
if (size == 0) break;
if (size < 0)
{
if (errno == EAGAIN) break;
perror("[VT52View dataAvailable] : read: ");
break;
}
[_lock lock];
pool = [NSAutoreleasePool new];
for (i = 0 ; i < size; ++i)
{
//if (buffer[i] < ' ') std::fprintf(stderr, "%02x\n", (int)buffer[i]);
[self processCharacter: buffer[i]];
}
[self invalidate];
[_lock unlock];
[pool release];
}
}
-(void)keyDown: (NSEvent *)theEvent
{
unsigned flags = [theEvent modifierFlags];
NSString *chars = [theEvent charactersIgnoringModifiers];
unsigned length = [chars length];
unsigned i;
if (flags & NSCommandKeyMask) return;
// length should always be 1...
for (i = 0 ; i < length; ++i)
{
unichar uc = [chars characterAtIndex: i];
char c;
if (flags & NSNumericPadKeyMask)
{
const char *str = NULL;
if (_altKeyPad)
{
switch (uc)
{
case '0':
str = ESC "?p";
break;
case '1':
str = ESC "?q";
break;
case '2':
str = ESC "?r";
break;
case '3':
str = ESC "?s";
break;
case '4':
str = ESC "?t";
break;
case '5':
str = ESC "?u";
break;
case '6':
str = ESC "?v";
break;
case '7':
str = ESC "?w";
break;
case '8':
str = ESC "?x";
break;
case '9':
str = ESC "?y";
break;
case '.':
str = ESC "?n";
break;
case NSNewlineCharacter:
case NSEnterCharacter:
str = ESC "?M";
break;
}
}
switch (uc)
{
case NSEnterCharacter:
uc = '\r';
break;
case NSUpArrowFunctionKey:
str = ESC "A";
break;
case NSDownArrowFunctionKey:
str = ESC "B";
break;
case NSRightArrowFunctionKey:
str = ESC "C";
break;
case NSLeftArrowFunctionKey:
str = ESC "D";
break;
}
if (str)
{
ssize_t size = write(_fd, str, strlen(str));
if (size < 0)
{
perror("keyDown: write");
}
continue;
}
}
if (uc > 0x7f) continue;
c = uc;
if (flags & NSControlKeyMask)
{
// 040, 0100, and 0140 are all equivalent
c &= 0x1f;
}
/*
else
{
if (c == NSEnterCharacter) c = '\r';
}
*/
write(_fd, &c, 1);
}
}
@end
@implementation VT52View (Cursor)
// these are not thread safe...
#pragma mark -
#pragma mark Cursor Control
-(void)setCursor: (CursorPosition)cursor
{
[_lock lock];
[self _setCursor: cursor];
//[self invalidate];
[_lock unlock];
}
-(void)_setCursor: (CursorPosition)cursor
{
if (cursor.x < 0) cursor.x = 0;
if (cursor.x >= _width) cursor.x = _width - 1;
if (cursor.y < 0) cursor.y = 0;
if (cursor.y >= _height) cursor.y = _height - 1;
if (cursor == _cursor) return;
// TODO -- cursor should be a child view, to handle blinking, cursor style, etc.
//_updates.push_back(_cursor);
//_updates.push_back(cursor);
_cursor = cursor;
}
-(void)cursorLeft
{
if (_cursor.x == 0) return;
[self _setCursor: CursorPosition(_cursor.x - 1, _cursor.y)];
}
-(void)cursorRight
{
if (_cursor.x == (_width - 1)) return;
[self _setCursor: CursorPosition(_cursor.x + 1, _cursor.y)];
}
-(void)cursorUp
{
if (_cursor.y == 0) return;
[self _setCursor: CursorPosition(_cursor.x, _cursor.y - 1)];
}
-(void)cursorDown
{
if (_cursor.y == (_height - 1)) return;
[self _setCursor: CursorPosition(_cursor.x, _cursor.y + 1)];
}
-(void)lineFeed
{
// increment line, column doesn't change. If already on the bottom line, a 1-line scroll occurs.
if (_cursor.y == _height - 1)
{
CharInfo tmp = {0,0};
// scroll all the lines....
for (unsigned y = 1; y < _height; ++y)
{
for (unsigned x = 0; x < _width; ++x)
{
_screen[y-1][x] = _screen[y][x];
}
}
for (unsigned x = 0; x < _width; ++x)
{
_screen[_height -1][x] = tmp;
}
[self setNeedsDisplay: YES];
}
else
{
[self _setCursor: CursorPosition(_cursor.x, _cursor.y + 1)];
}
}
-(void)reverseLineFeed
{
// decrement line, column doesn't change. If already on the bottom line, a 1-line scroll occurs.
if (_cursor.y == 0)
{
CharInfo tmp = {0,0};
// scroll all the lines....
for (unsigned y = 0; y < _height - 1; ++y)
{
for (unsigned x = 0; x < _width; ++x)
{
_screen[y+1][x] = _screen[y][x];
}
}
for (unsigned x = 0; x < _width; ++x)
{
_screen[0][x] = tmp;
}
[self setNeedsDisplay: YES];
}
else
{
[self _setCursor: CursorPosition(_cursor.x, _cursor.y - 1)];
}
}
-(void)carriageReturn
{
// move x to 0.
if (_cursor.x == 0) return;
[self _setCursor: CursorPosition(0, _cursor.y)];
}
-(void)cursorHome
{
[self _setCursor: CursorPosition(0,0)];
}
-(void)tab
{
// TODO -- does this insert spaces?
// move right 1 (or more) positions.
// stops (1-based): 9, 17, 25, 33, 41, 49, 57, 65, 73,
// if x >= 73, move right 1. If x == _width
int x = _cursor.x;
if (x == _width -1) return;
//x += 1;
// doesn't handle end case...
x = (x + 8) & ~0x07;
[self _setCursor: CursorPosition(x, _cursor.y)];
}
@end
@implementation VT52View (Private)
-(void)invalidate
{
// caller must lock prior to calling.
// resets the _updates list.
std::vector<struct CursorPosition>::iterator iter;
int minX = _width - 1;
int maxX = 0;
int minY = _height - 1;
int maxY = 0;
if (_updates.empty()) return;
for (iter = _updates.begin(); iter != _updates.end(); ++iter)
{
minX = std::min(minX, iter->x);
maxX = std::max(maxX, iter->x);
minY = std::min(minY, iter->y);
maxY = std::max(maxY, iter->y);
}
// TODO -- character height/width sizes.
[self setNeedsDisplayInRect: NSMakeRect(minX * _charWidth, minY * _charHeight, (maxX - minX + 1) * _charWidth, (maxY - minY + 1) * _charHeight)];
_updates.clear();
}
// state machine.
-(void)processCharacter: (uint8_t)c
{
switch (_state)
{
case StateText:
{
switch (c)
{
case 0x00:
case 0x7f:
// padding;
break;
case 0x1b:
_state = StateEscape;
break;
case 0x07:
// bell...
NSBeep();
break;
case 0x08:
[self cursorLeft];
// backspace
break;
case 0x09:
// tab
[self tab];
break;
case 0x0a:
case 0x0b:
case 0x0c:
// lf
[self lineFeed];
break;
case 0x0d:
// cr
[self carriageReturn];
break;
case 0x0e:
case 0x0f:
// g0/g1 char set
break;
default:
if (c >= 0x20 && c <= 0x7f)
[self appendChar: c];
break;
}
break;
}
case StateEscape:
{
switch (c)
{
case 0x00:
case 0x7f:
break;
case 0x1b:
// on vt52 is ignored, on vt50 cancels escape sequence.
if (_vt50) _state = StateText;
break;
case 'A':
_state = StateText;
[self cursorUp];
break;
case 'B':
_state = StateText;
[self cursorDown];
break;
case 'C':
_state = StateText;
[self cursorRight];
break;
case 'D':
_state = StateText;
[self cursorLeft];
break;
case 'I':
_state = StateText;
if (!_vt50)
[self reverseLineFeed];
break;
case 'H':
_state = StateText;
[self _setCursor: CursorPosition(0,0)];
break;
case 'J':
_state = StateText;
[self eraseScreen];
break;
case 'K':
_state = StateText;
[self eraseLine];
break;
case 'Y':
_state = StateEscapeY1;
break;
case '=':
_state = StateText;
_altKeyPad = YES;
break;
case '>':
_state = StateText;
_altKeyPad = NO;
break;
case 'Z':
//identity
_state = StateText;
write(_fd, _vt50 ? ESC "/A" : ESC "/K", 3);
break;
case '1':
case '2':
// alt graphic modes (unsupported)
_state = StateText;
break;
case 'F':
case 'G':
_state = StateText;
// graphic/ascii char set (unsupported)
break;
/*
case '<':
//ANSI mode (vt100)
_state = StateText;
break;
*/
default:
_state = StateText;
std::fprintf(stderr, "Unrecognized escape character: %c\n", c);
break;
}
break;
}
/*
* ESC Y line# column#
* line# 040--067
*
* vt50H moved to bottom line if out of bounds.
* vt52 does not adjust if out of bounds.
*
* column# 040--0157
* if out of bounds, moves to the rightmost column.
*/
case StateEscapeY1:
{
_state = StateEscapeY2;
if (c >= 0x20) c -= 0x20;
else c = -1;
_yTemp[0] = c;
break;
}
case StateEscapeY2:
{
CursorPosition cp = _cursor;
_state = StateText;
if (c >= 0x20) c -= 0x20;
else c = -1;
_yTemp[1] = c;
// vt52 style.
if (_yTemp[0] < _height) cp.y = _yTemp[0];
if (_yTemp[1] < _width) cp.x = _yTemp[1];
[self _setCursor: cp];
break;
}
}
}
-(void)appendChar: (uint8_t)c
{
CharInfo ci = { c, 0 };
int x = _cursor.x;
int y = _cursor.y;
if (y == _width) return; // eol.
_screen[y][x] = ci;
_updates.push_back(_cursor);
[self _setCursor: CursorPosition(x + 1, y)];
}
-(void)eraseLine
{
CharInfo clear = {0, 0};
for (unsigned x = _cursor.x; x < _width; ++x)
{
_screen[_cursor.y][x] = clear;
}
// everything in between will be redrawn...
_updates.push_back(_cursor);
_updates.push_back(CursorPosition(_width - 1, _cursor.y));
}
-(void)eraseScreen
{
CharInfo clear = {0, 0};
// erase line and all lines below.
[self eraseLine];
for (unsigned y = _cursor.y + 1; y < _height; ++y)
{
for (unsigned x = 0; x < _width; ++x)
{
_screen[y][x] = clear;
}
}
_updates.push_back(CursorPosition(0, _cursor.y + 1));
_updates.push_back(CursorPosition(_width - 1, _height - 1));
}
@end

54
iGeometry.h Normal file
View File

@ -0,0 +1,54 @@
/*
* iGeometry.h
* 2Term
*
* Created by Kelvin Sherlock on 7/7/2010.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#ifndef __IGEOMETRY_H__
#define __IGEOMETRY_H__
typedef struct iPoint {
int x;
int y;
#ifdef __cplusplus
iPoint() : x(0), y(0) {}
iPoint(const iPoint &aPoint) : x(aPoint.x), y(aPoint.y) {}
iPoint(int xx, int yy) : x(xx), y(yy) {}
#endif
} iPoint;
typedef struct iSize {
int width;
int height;
#ifdef __cplusplus
iSize() : width(0), height(0) {}
iSize(const iSize &aSize) : width(aSize.width), height(aSize.width) {}
iSize(int w, int h) : width(w), height(h) {}
#endif
} iSize;
typedef struct iRect {
iPoint origin;
iSize size;
#ifdef __cplusplus
iRect() {}
iRect(const iRect &aRect) : origin(aRect.origin), size(aRect.size) {}
iRect(const iPoint &aPoint, const iSize &aSize) : origin(aPoint), size(aSize) {}
#endif
} iRect;
#endif;

14
main.m Normal file
View File

@ -0,0 +1,14 @@
//
// main.m
// 2Term
//
// Created by Kelvin Sherlock on 6/29/2010.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}