diff --git a/2Term.xcodeproj/project.pbxproj b/2Term.xcodeproj/project.pbxproj index b873ff8..5edfd8f 100644 --- a/2Term.xcodeproj/project.pbxproj +++ b/2Term.xcodeproj/project.pbxproj @@ -33,10 +33,13 @@ B61D0D5D125B740C001C713B /* NewTerminal.xib in Resources */ = {isa = PBXBuildFile; fileRef = B61D0D5B125B740C001C713B /* NewTerminal.xib */; }; B61D0D60125B7ACA001C713B /* NewTerminalWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = B61D0D5F125B7ACA001C713B /* NewTerminalWindowController.m */; }; B61D0D69125B8E06001C713B /* Defaults.m in Sources */ = {isa = PBXBuildFile; fileRef = B61D0D68125B8E06001C713B /* Defaults.m */; }; + B627333B12E3FF5B00A14C94 /* ChildMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = B627333A12E3FF5B00A14C94 /* ChildMonitor.m */; }; B676063B11DEAD3500D6B66C /* TermWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = B676063A11DEAD3500D6B66C /* TermWindowController.mm */; }; B676065111DEBAE900D6B66C /* TermWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = B676065011DEBAE900D6B66C /* TermWindow.xib */; }; B67B3CE512B6FA040033AE07 /* a2-charset-40.png in Resources */ = {isa = PBXBuildFile; fileRef = B67B3CE312B6FA040033AE07 /* a2-charset-40.png */; }; B67B3CE612B6FA040033AE07 /* a2-charset-80.png in Resources */ = {isa = PBXBuildFile; fileRef = B67B3CE412B6FA040033AE07 /* a2-charset-80.png */; }; + B6801BD912EB549300B22E9E /* vt100-charset.png in Resources */ = {isa = PBXBuildFile; fileRef = B6801BD812EB549300B22E9E /* vt100-charset.png */; }; + B68E632A12FF909D00EAFF5F /* ExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = B68E632912FF909C00EAFF5F /* ExampleView.m */; }; B6EBE2B511E0EA9100EA0458 /* CharacterGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = B6EBE2B411E0EA9100EA0458 /* CharacterGenerator.m */; }; /* End PBXBuildFile section */ @@ -74,8 +77,8 @@ 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* TwoTerm-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "TwoTerm-Info.plist"; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* 2Term.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 2Term.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8D1107320486CEB800E47090 /* TwoTerm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TwoTerm.app; sourceTree = BUILT_PRODUCTS_DIR; }; B60EBD1111E8DEEF00C1974F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = ""; }; B60EBDE111E90FC300C1974F /* ScanLineFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanLineFilter.h; sourceTree = ""; }; B60EBDE211E90FC300C1974F /* ScanLineFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScanLineFilter.m; sourceTree = ""; }; @@ -113,11 +116,17 @@ B61D0D5F125B7ACA001C713B /* NewTerminalWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewTerminalWindowController.m; sourceTree = ""; }; B61D0D67125B8E06001C713B /* Defaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Defaults.h; sourceTree = ""; }; B61D0D68125B8E06001C713B /* Defaults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Defaults.m; sourceTree = ""; }; + B627333912E3FF5B00A14C94 /* ChildMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildMonitor.h; sourceTree = ""; }; + B627333A12E3FF5B00A14C94 /* ChildMonitor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChildMonitor.m; sourceTree = ""; }; B676063911DEAD3500D6B66C /* TermWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TermWindowController.h; sourceTree = ""; }; B676063A11DEAD3500D6B66C /* TermWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TermWindowController.mm; sourceTree = ""; }; B676064D11DEBAE300D6B66C /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TermWindow.xib; sourceTree = ""; }; B67B3CE312B6FA040033AE07 /* a2-charset-40.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "a2-charset-40.png"; sourceTree = ""; }; B67B3CE412B6FA040033AE07 /* a2-charset-80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "a2-charset-80.png"; sourceTree = ""; }; + B6801BD812EB549300B22E9E /* vt100-charset.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vt100-charset.png"; sourceTree = ""; }; + B68E632812FF909C00EAFF5F /* ExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExampleView.h; sourceTree = ""; }; + B68E632912FF909C00EAFF5F /* ExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleView.m; sourceTree = ""; }; + B68E632B130990DD00EAFF5F /* en */ = {isa = PBXFileReference; lastKnownFileType = file; name = en; path = en.lproj/NewTerminal.xib; sourceTree = ""; }; B6EBE2B311E0EA9100EA0458 /* CharacterGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterGenerator.h; sourceTree = ""; }; B6EBE2B411E0EA9100EA0458 /* CharacterGenerator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CharacterGenerator.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -138,6 +147,8 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( + B627333912E3FF5B00A14C94 /* ChildMonitor.h */, + B627333A12E3FF5B00A14C94 /* ChildMonitor.m */, B61D0D5E125B7ACA001C713B /* NewTerminalWindowController.h */, B61D0D5F125B7ACA001C713B /* NewTerminalWindowController.m */, 256AC3D80F4B6AC300CF3369 /* TwoTermAppDelegate.h */, @@ -174,7 +185,7 @@ 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( - 8D1107320486CEB800E47090 /* 2Term.app */, + 8D1107320486CEB800E47090 /* TwoTerm.app */, ); name = Products; sourceTree = ""; @@ -210,7 +221,7 @@ children = ( B60EBDE711E9143F00C1974F /* ScanLineFilter.cikernel */, B66979CE11E6BCAE002ED475 /* images */, - 8D1107310486CEB800E47090 /* TwoTerm-Info.plist */, + 8D1107310486CEB800E47090 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, B676065011DEBAE900D6B66C /* TermWindow.xib */, @@ -269,6 +280,8 @@ B612F46B12DD5E02005D1B77 /* Views */ = { isa = PBXGroup; children = ( + B68E632812FF909C00EAFF5F /* ExampleView.h */, + B68E632912FF909C00EAFF5F /* ExampleView.m */, B612F46C12DD5E02005D1B77 /* CurveView.h */, B612F46D12DD5E02005D1B77 /* CurveView.m */, B612F46E12DD5E02005D1B77 /* EmulatorView.h */, @@ -280,6 +293,7 @@ B66979CE11E6BCAE002ED475 /* images */ = { isa = PBXGroup; children = ( + B6801BD812EB549300B22E9E /* vt100-charset.png */, B67B3CE312B6FA040033AE07 /* a2-charset-40.png */, B67B3CE412B6FA040033AE07 /* a2-charset-80.png */, ); @@ -306,7 +320,7 @@ name = 2Term; productInstallPath = "$(HOME)/Applications"; productName = 2Term; - productReference = 8D1107320486CEB800E47090 /* 2Term.app */; + productReference = 8D1107320486CEB800E47090 /* TwoTerm.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -343,6 +357,7 @@ B61D0D5D125B740C001C713B /* NewTerminal.xib in Resources */, B67B3CE512B6FA040033AE07 /* a2-charset-40.png in Resources */, B67B3CE612B6FA040033AE07 /* a2-charset-80.png in Resources */, + B6801BD912EB549300B22E9E /* vt100-charset.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -375,6 +390,8 @@ B612F47112DD5E02005D1B77 /* EmulatorView.mm in Sources */, B612F47412DDEBA9005D1B77 /* Screen_obsolete.cpp in Sources */, B612F47512DDEBA9005D1B77 /* Screen_TextPort.cpp in Sources */, + B627333B12E3FF5B00A14C94 /* ChildMonitor.m in Sources */, + B68E632A12FF909D00EAFF5F /* ExampleView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -401,6 +418,7 @@ isa = PBXVariantGroup; children = ( B61D0D5C125B740C001C713B /* NewTerminal.xib */, + B68E632B130990DD00EAFF5F /* en */, ); name = NewTerminal.xib; sourceTree = ""; @@ -427,9 +445,9 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = TwoTerm_Prefix.pch; - INFOPLIST_FILE = "TwoTerm-Info.plist"; + INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = 2Term; + PRODUCT_NAME = TwoTerm; }; name = Debug; }; @@ -441,9 +459,9 @@ GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = _Term_Prefix.pch; - INFOPLIST_FILE = "TwoTerm-Info.plist"; + INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = 2Term; + PRODUCT_NAME = TwoTerm; }; name = Release; }; @@ -456,7 +474,7 @@ GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; PREBINDING = NO; SDKROOT = macosx10.6; }; @@ -470,6 +488,7 @@ 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; }; diff --git a/Defaults.h b/Defaults.h index 6afbeb2..e3b03f2 100644 --- a/Defaults.h +++ b/Defaults.h @@ -20,6 +20,8 @@ extern "C" { extern NSString *kScanLines; extern NSString *kClass; + extern NSString *kContentFilters; + #ifdef __cplusplus diff --git a/Defaults.m b/Defaults.m index a5ec199..7bd54f5 100644 --- a/Defaults.m +++ b/Defaults.m @@ -16,4 +16,6 @@ NSString *kForegroundColor = @"Foreground Color"; NSString *kBackgroundColor = @"Background Color"; NSString *kScanLines = @"Scan Lines"; -NSString *kClass = @"Class"; \ No newline at end of file +NSString *kClass = @"Class"; + +NSString *kContentFilters = @"Content Filters"; \ No newline at end of file diff --git a/English.lproj/NewTerminal.xib b/English.lproj/NewTerminal.xib index 7d259c5..df57a76 100644 --- a/English.lproj/NewTerminal.xib +++ b/English.lproj/NewTerminal.xib @@ -2,17 +2,33 @@ 1060 - 10H574 - 823 + 10J567 + 1294 1038.35 - 461.00 + 462.00 com.apple.InterfaceBuilder.CocoaPlugin - 823 + 1294 - + YES - + NSUserDefaultsController + NSPopUpButton + NSMenuItem + NSMenu + NSButtonCell + NSButton + NSTextFieldCell + NSBox + NSColorWell + NSSlider + NSSliderCell + NSCustomObject + NSCustomView + NSView + NSWindowTemplate + NSTextField + NSPopUpButtonCell YES @@ -23,9 +39,7 @@ YES - - YES - + YES @@ -41,12 +55,11 @@ 263 2 - {{196, 232}, {400, 200}} + {{196, 232}, {400, 500}} 544736256 New Terminal NSWindow - {1.79769e+308, 1.79769e+308} 256 @@ -55,9 +68,10 @@ 268 - {{17, 160}, {99, 17}} + {{17, 460}, {99, 17}} - + + YES 68288064 @@ -89,27 +103,13 @@ - - - 268 - {{17, 129}, {99, 17}} - - YES - - 68288064 - 71304192 - Foreground: - - - - - - 289 {{262, 18}, {118, 25}} + + YES -2080244224 @@ -130,6 +130,7 @@ 292 {{20, 18}, {118, 25}} + YES @@ -146,73 +147,22 @@ 75 - - - 268 - - YES - - YES - NSColor pasteboard type - - - {{121, 126}, {44, 23}} - - YES - YES - - 1 - MCAxIDAAA - - - - - 268 - {{17, 101}, {99, 17}} - - YES - - 68288064 - 71304192 - Background: - - - - - - - - - 268 - - YES - - YES - NSColor pasteboard type - - - {{121, 98}, {44, 23}} - - YES - YES - - 1 - MCAwIDAAA - - 268 - {{121, 155}, {259, 25}} + {{121, 455}, {259, 25}} + + YES - -2076049856 + -2080244160 2048 - -2036317953 + -2036186881 163 + 400 @@ -272,40 +222,433 @@ 2 - + - 268 - {{119, 74}, {88, 18}} - - YES - - -2080244224 - 0 - Scan Lines - - - 1211912703 - 2 - - NSImage - NSSwitch + 12 + + YES + + + 256 + + YES + + + 268 + {{15, 48}, {83, 17}} + + + + YES + + 68288064 + 71304192 + Foreground: + + + + + + + + + 268 + {{15, 79}, {83, 17}} + + + + YES + + 68288064 + 71304192 + Scheme: + + + + + + + + + 268 + {{15, 17}, {83, 17}} + + + + YES + + 68288064 + 71304192 + Background: + + + + + + + + + 268 + + YES + + YES + NSColor pasteboard type + + + {{103, 45}, {44, 23}} + + + + YES + YES + + 1 + MCAxIDAAA + + + + + 268 + + YES + + YES + NSColor pasteboard type + + + {{103, 14}, {44, 23}} + + + + YES + YES + + 1 + MCAwIDAAA + + + + + 266 + {{103, 74}, {243, 25}} + + + + YES + + -2080244160 + 2048 + + + -2038284033 + 163 + + + + 400 + 75 + + + Item 1 + + 1048576 + 2147483647 + 1 + + + _popUpItemAction: + + + YES + + OtherViews + + YES + + + + Item 2 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + Item 3 + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + 1 + YES + YES + 2 + + + + {{1, 1}, {364, 108}} + + + - - NSSwitch - - - - 200 - 25 + {{17, 328}, {366, 124}} + + + + {0, 0} + + 67239424 + 0 + Colors + + LucidaGrande + 11 + 3100 + + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 0 + 2 + NO + + + + 12 + + YES + + + 256 + + YES + + + 266 + {{74, 57}, {274, 21}} + + + + YES + + -2079981824 + 0 + + + 1 + 0.0 + 0.33000000000000002 + 0.0 + 0 + 1 + NO + NO + + + + + 266 + {{74, 34}, {274, 21}} + + + + YES + + -2079981824 + 0 + + + 1 + 0.0 + 0.02 + 0.0 + 0 + 1 + NO + NO + + + + + 268 + {{15, 60}, {56, 17}} + + + + YES + + 68288064 + 71304192 + Blur: + + + + + + + + + 268 + {{15, 37}, {56, 17}} + + + + YES + + 68288064 + 71304192 + Lighten: + + + + + + + + + 268 + {{15, 14}, {56, 17}} + + + + YES + + 68288064 + 71304192 + Darken: + + + + + + + + + 266 + {{74, 11}, {274, 21}} + + + + YES + + -2079981824 + 0 + + + 1 + 0.0 + 0.5 + 0.0 + 0 + 1 + NO + NO + + + + + 268 + {{74, 83}, {118, 18}} + + + + YES + + -2080244224 + 0 + Effects Enabled + + + 1211912703 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + + + {{1, 1}, {364, 109}} + + + + + + {{17, 199}, {366, 125}} + + + + {0, 0} + + 67239424 + 0 + Effects + + + + 3 + MCAwLjgwMDAwMDAxMTkAA + + + + 1 + 0 + 2 + NO + + + + 274 + {{20, 50}, {360, 145}} + + + + ExampleView - {400, 200} + {{7, 11}, {400, 500}} + {{0, 0}, {1920, 1178}} - {1.79769e+308, 1.79769e+308} + {1e+13, 1e+13} + + + YES @@ -359,14 +702,6 @@ 65 - - - scanLineButton - - - - 66 - terminalTypeButton @@ -375,6 +710,166 @@ 67 + + + colorSchemeButton + + + + 92 + + + + effectsButton + + + + 93 + + + + darkenSlider + + + + 99 + + + + blurSlider + + + + 100 + + + + lightenSlider + + + + 101 + + + + value: effectsEnabled + + + + + + value: effectsEnabled + value + effectsEnabled + 2 + + + 107 + + + + enabled: effectsEnabled + + + + + + enabled: effectsEnabled + enabled + effectsEnabled + 2 + + + 115 + + + + enabled: effectsEnabled + + + + + + enabled: effectsEnabled + enabled + effectsEnabled + 2 + + + 117 + + + + enabled: effectsEnabled + + + + + + enabled: effectsEnabled + enabled + effectsEnabled + 2 + + + 119 + + + + setColorScheme: + + + + 122 + + + + filterParameterChanged: + + + + 124 + + + + filterParameterChanged: + + + + 125 + + + + filterParameterChanged: + + + + 126 + + + + filterParameterChanged: + + + + 127 + + + + filterParameterChanged: + + + + 128 + + + + exampleView + + + + 129 + @@ -420,12 +915,10 @@ - - - - - + + + @@ -471,44 +964,6 @@ - - 49 - - - - - 50 - - - YES - - - - - - 51 - - - - - 52 - - - YES - - - - - - 53 - - - - - 54 - - - 55 @@ -553,6 +1008,157 @@ + + 76 + + + YES + + + + + + + + + + + 50 + + + YES + + + + + + 51 + + + + + 52 + + + YES + + + + + + 54 + + + + + 49 + + + + + 53 + + + + + 77 + + + YES + + + + + + + + + + + + 78 + + + YES + + + + + + 79 + + + + + 80 + + + YES + + + + + + 81 + + + + + 82 + + + YES + + + + + + 83 + + + + + 84 + + + YES + + + + + + 85 + + + + + 86 + + + YES + + + + + + 87 + + + + + 88 + + + YES + + + + + + 89 + + + 62 @@ -560,13 +1166,81 @@ YES - + 63 + + 90 + + + YES + + + + + + 91 + + + + + 68 + + + YES + + + + + + 69 + + + YES + + + + + + 70 + + + YES + + + + + + + + 71 + + + + + 72 + + + + + 73 + + + + + 102 + + + + + 123 + + + @@ -583,6 +1257,7 @@ 1.WindowOrigin 1.editorWindowContentRectSynchronizationRect 10.IBPluginDependency + 123.IBPluginDependency 17.IBPluginDependency 18.IBPluginDependency 19.IBPluginDependency @@ -613,8 +1288,34 @@ 62.IBPluginDependency 62.IBViewBoundsToFrameTransform 63.IBPluginDependency + 68.IBPluginDependency + 69.IBPluginDependency + 76.IBPluginDependency + 77.IBPluginDependency + 78.IBPluginDependency + 79.IBPluginDependency + 80.IBPluginDependency + 80.IBViewBoundsToFrameTransform + 81.IBPluginDependency + 82.IBPluginDependency + 83.IBPluginDependency + 84.IBPluginDependency + 85.IBPluginDependency + 86.IBPluginDependency + 86.IBViewBoundsToFrameTransform + 87.IBPluginDependency + 88.IBPluginDependency + 88.IBViewBoundsToFrameTransform + 89.IBPluginDependency 9.IBPluginDependency 9.IBViewBoundsToFrameTransform + 90.IBPluginDependency + 90.IBViewBoundsToFrameTransform + 90.IBViewIntegration.shadowBlurRadius + 90.IBViewIntegration.shadowColor + 90.IBViewIntegration.shadowOffsetHeight + 90.IBViewIntegration.shadowOffsetWidth + 91.IBPluginDependency YES @@ -634,6 +1335,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin AULyAABCygAAA @@ -671,32 +1373,78 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBuAAAwrYAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBuAAAwrYAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBuAAAwrYAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin P4AAAL+AAABBiAAAwxYAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBuAAAwu4AAA + + + + + + com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES - - YES - + - 67 + 129 YES + + CurveView + NSView + + IBProjectSource + ./Classes/CurveView.h + + + + ExampleView + CurveView + + IBProjectSource + ./Classes/ExampleView.h + + NewTerminalWindowController NSWindowController @@ -705,12 +1453,18 @@ YES cancelButton: + colorChanged: connectButton: + filterParameterChanged: + setColorScheme: YES id id + id + id + id @@ -718,7 +1472,10 @@ YES cancelButton: + colorChanged: connectButton: + filterParameterChanged: + setColorScheme: YES @@ -726,10 +1483,22 @@ cancelButton: id + + colorChanged: + id + connectButton: id + + filterParameterChanged: + id + + + setColorScheme: + id + @@ -737,15 +1506,25 @@ YES backgroundColorControl + blurSlider + colorSchemeButton + darkenSlider + effectsButton + exampleView foregroundColorControl - scanLineButton + lightenSlider terminalTypeButton YES NSColorWell - NSColorWell + NSSlider + NSPopUpButton + NSSlider NSButton + ExampleView + NSColorWell + NSSlider NSPopUpButton @@ -754,8 +1533,13 @@ YES backgroundColorControl + blurSlider + colorSchemeButton + darkenSlider + effectsButton + exampleView foregroundColorControl - scanLineButton + lightenSlider terminalTypeButton @@ -764,13 +1548,33 @@ backgroundColorControl NSColorWell + + blurSlider + NSSlider + + + colorSchemeButton + NSPopUpButton + + + darkenSlider + NSSlider + + + effectsButton + NSButton + + + exampleView + ExampleView + foregroundColorControl NSColorWell - scanLineButton - NSButton + lightenSlider + NSSlider terminalTypeButton @@ -780,509 +1584,7 @@ IBProjectSource - NewTerminalWindowController.h - - - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSColorWell - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSColorWell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSMenuItem - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSMenuItemCell - NSButtonCell - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItemCell.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CIImageProvider.h - - - - NSPopUpButton - NSButton - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButton.h - - - - NSPopUpButtonCell - NSMenuItemCell - - IBFrameworkSource - AppKit.framework/Headers/NSPopUpButtonCell.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - NSWindowController - NSResponder - - showWindow: - id - - - showWindow: - - showWindow: - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSWindowController.h + ./Classes/NewTerminalWindowController.h @@ -1298,7 +1600,6 @@ YES - ../2Term.xcodeproj 3 YES diff --git a/NewTerminalWindowController.h b/NewTerminalWindowController.h index 6adeb6e..6bbe03d 100644 --- a/NewTerminalWindowController.h +++ b/NewTerminalWindowController.h @@ -8,26 +8,57 @@ #import +@class ExampleView; @interface NewTerminalWindowController : NSWindowController { @private NSPopUpButton *_terminalTypeButton; - NSButton *_scanLineButton; + NSPopUpButton *_colorSchemeButton; + NSColorWell *_foregroundColorControl; NSColorWell *_backgroundColorControl; + + NSButton *_effectsButton; + NSSlider *_blurSlider; + NSSlider *_lightenSlider; + NSSlider *_darkenSlider; + + + ExampleView *_exampleView; + + BOOL _effectsEnabled; + } +@property (nonatomic, retain) IBOutlet ExampleView *exampleView; + @property (nonatomic, retain) IBOutlet NSPopUpButton *terminalTypeButton; -@property (nonatomic, retain) IBOutlet NSButton *scanLineButton; +@property (nonatomic, retain) IBOutlet NSPopUpButton *colorSchemeButton; + + @property (nonatomic, retain) IBOutlet NSColorWell *foregroundColorControl; @property (nonatomic, retain) IBOutlet NSColorWell *backgroundColorControl; +@property (nonatomic, retain) IBOutlet NSButton *effectsButton; +@property (nonatomic, retain) IBOutlet NSSlider *blurSlider; +@property (nonatomic, retain) IBOutlet NSSlider *lightenSlider; +@property (nonatomic, retain) IBOutlet NSSlider *darkenSlider; + +@property (nonatomic, assign) BOOL effectsEnabled; + + + -(IBAction)cancelButton: (id)sender; -(IBAction)connectButton: (id)sender; +-(IBAction)colorChanged: (id)sender; +-(IBAction)setColorScheme: (id)sender; +-(IBAction)filterParameterChanged: (id)sender; + +-(NSMenu *)colorMenu; @end diff --git a/NewTerminalWindowController.m b/NewTerminalWindowController.m index cb32c68..89246a3 100644 --- a/NewTerminalWindowController.m +++ b/NewTerminalWindowController.m @@ -9,14 +9,31 @@ #import "NewTerminalWindowController.h" #import "Emulator.h" #import "Defaults.h" +#import "ExampleView.h" @implementation NewTerminalWindowController +@synthesize exampleView = _exampleView; + @synthesize terminalTypeButton = _terminalTypeButton; -@synthesize scanLineButton = _scanLineButton; +@synthesize colorSchemeButton = _colorSchemeButton; + +@synthesize effectsButton = _effectsButton; @synthesize foregroundColorControl = _foregroundColorControl; @synthesize backgroundColorControl = _backgroundColorControl; +@synthesize blurSlider = _blurSlider; +@synthesize lightenSlider = _lightenSlider; +@synthesize darkenSlider = _darkenSlider; + +@synthesize effectsEnabled = _effectsEnabled; +// colors +enum { + kCustom = 0, + kGreenBlack, + kWhiteBlue, + kAmberBlack +}; +(id)new { @@ -27,25 +44,71 @@ - (void)dealloc { // Clean-up code here. - + [_terminalTypeButton release]; - [_backgroundColorControl release]; + [_colorSchemeButton release]; + + [_foregroundColorControl release]; - [_scanLineButton release]; + [_backgroundColorControl release]; + + + [_effectsButton release]; + [_blurSlider release]; + [_lightenSlider release]; + [_darkenSlider release]; + + [_exampleView release]; [super dealloc]; } - (void)windowDidLoad { - + [super windowDidLoad]; + [self setEffectsEnabled: YES]; + [_terminalTypeButton setMenu: [EmulatorManager emulatorMenu]]; + // set color schemes. + [_colorSchemeButton setMenu: [self colorMenu]]; + } +-(NSMenu *)colorMenu +{ + NSMenuItem *item; + + NSMenu *menu = [[NSMenu new] autorelease]; + + item = [[NSMenuItem new] autorelease]; + [item setTitle: @"Green Black"]; + [item setTag: kGreenBlack]; + [menu addItem: item]; + + item = [[NSMenuItem new] autorelease]; + [item setTitle: @"White Blue"]; + [item setTag: kWhiteBlue]; + [menu addItem: item]; + + item = [[NSMenuItem new] autorelease]; + [item setTitle: @"Amber Black"]; + [item setTag: kAmberBlack]; + [menu addItem: item]; + + + item = [[NSMenuItem new] autorelease]; + [item setTitle: @"Custom"]; + [item setTag: kCustom]; + [menu addItem: item]; + + return menu; +} +#pragma mark - +#pragma mark IBActions -(IBAction)cancelButton: (id)sender { @@ -63,12 +126,16 @@ if (klass) { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: - klass, kClass, - [NSNumber numberWithBool: [_scanLineButton intValue]], kScanLines, - [_foregroundColorControl color], kForegroundColor, - [_backgroundColorControl color], kBackgroundColor, - nil]; + NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithCapacity: 5]; + + [userInfo setObject: klass forKey: kClass]; + [userInfo setObject: [_foregroundColorControl color] forKey: kForegroundColor]; + [userInfo setObject: [_backgroundColorControl color] forKey: kBackgroundColor]; + + if (_effectsEnabled) + { + [userInfo setObject: [_exampleView contentFilters] forKey: kContentFilters]; + } [nc postNotificationName: kNotificationNewTerminal object: self userInfo: userInfo]; @@ -79,12 +146,77 @@ [[self window] performClose: self]; } +-(IBAction)colorChanged:(id)sender +{ + [_colorSchemeButton selectItemWithTag: kCustom]; + // redraw sample... +} + +-(IBAction)setColorScheme:(id)sender +{ + switch ([_colorSchemeButton selectedTag]) + { + case kGreenBlack: + [_foregroundColorControl setColor: [NSColor greenColor]]; + [_backgroundColorControl setColor: [NSColor blackColor]]; + break; + + case kWhiteBlue: + [_foregroundColorControl setColor: [NSColor whiteColor]]; + [_backgroundColorControl setColor: [NSColor blueColor]]; + break; + + case kAmberBlack: + [_foregroundColorControl setColor: [NSColor orangeColor]]; + [_backgroundColorControl setColor: [NSColor blackColor]]; + break; + + case kCustom: + break; + + + } + [self filterParameterChanged: nil]; +} + + +-(IBAction)filterParameterChanged: (id)sender +{ + + [_exampleView setForegroundColor: [_foregroundColorControl color]]; + [_exampleView setColor: [_backgroundColorControl color]]; + + if (_effectsEnabled) + { + [_exampleView setBlur: [_blurSlider floatValue]]; + [_exampleView setLighten: [_lightenSlider floatValue]]; + [_exampleView setDarken: [_darkenSlider floatValue]]; + } + else + { + [_exampleView setBlur: 0.0]; + [_exampleView setLighten: 0.0]; + [_exampleView setDarken: 0.0]; + } + + [_exampleView updateEffects]; + [_exampleView setNeedsDisplay: YES]; +} + +-(void)setEffectsEnabled:(BOOL)effectsEnabled +{ + _effectsEnabled = effectsEnabled; + [self filterParameterChanged: nil]; +} #pragma mark - #pragma mark NSWindowDelegate -(void)windowWillClose:(NSNotification *)notification { + [_foregroundColorControl deactivate]; + [_backgroundColorControl deactivate]; + [self autorelease]; } diff --git a/TermWindowController.mm b/TermWindowController.mm index 227e2a7..3486c43 100644 --- a/TermWindowController.mm +++ b/TermWindowController.mm @@ -237,8 +237,16 @@ [_emulatorView setEmulator: _emulator]; [_emulatorView setForegroundColor: foregroundColor]; [_emulatorView setBackgroundColor: backgroundColor]; - [_emulatorView setScanLines: scanLines]; + //[_emulatorView setScanLines: scanLines]; + [_curveView setColor: backgroundColor]; + + o = [_parameters objectForKey: kContentFilters]; + if (o) + { + [_curveView setWantsLayer: YES]; + [_curveView setContentFilters: (NSArray *)o]; + } //[_curveView initScanLines]; //[_curveView setColor: [NSColor blueColor]]; diff --git a/TwoTermAppDelegate.m b/TwoTermAppDelegate.m index dc93982..e7ad65f 100644 --- a/TwoTermAppDelegate.m +++ b/TwoTermAppDelegate.m @@ -13,6 +13,8 @@ #import "Defaults.h" #import "VT52.h" +#import "ScanLineFilter.h" + @implementation TwoTermAppDelegate @synthesize window; @@ -24,12 +26,37 @@ TermWindowController *controller; + NSMutableArray *filters; + NSDictionary *parameters; + CIFilter *filter; + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver: self selector: @selector(newTerminal:) name: kNotificationNewTerminal object: nil]; + + filters = [NSMutableArray arrayWithCapacity: 3]; + + + //add the scanlines + + filter = [[ScanLineFilter new] autorelease]; + [filter setValue: [NSNumber numberWithFloat: .5] forKey: @"inputDarken"]; + [filter setValue: [NSNumber numberWithFloat: .02] forKey: @"inputLighten"]; + [filters addObject: filter]; + + //blur it a bit... + + filter = [CIFilter filterWithName: @"CIGaussianBlur"]; + [filter setDefaults]; + [filter setValue: [NSNumber numberWithFloat: .33] forKey: @"inputRadius"]; + + [filters addObject: filter]; + + parameters = [NSDictionary dictionaryWithObject: filters forKey: kContentFilters]; controller = [TermWindowController new]; + [controller setParameters: parameters]; [controller showWindow: nil]; // this leak is ok. } diff --git a/Views/CurveView.m b/Views/CurveView.m index 6f4c156..0d08718 100644 --- a/Views/CurveView.m +++ b/Views/CurveView.m @@ -21,6 +21,10 @@ return self; } +-(void)awakeFromNib +{ + _color = [[NSColor blackColor] retain]; +} #define curveSize 4 diff --git a/Views/ExampleView.h b/Views/ExampleView.h new file mode 100644 index 0000000..a3795c8 --- /dev/null +++ b/Views/ExampleView.h @@ -0,0 +1,35 @@ +// +// ExampleView.h +// 2Term +// +// Created by Kelvin Sherlock on 2/6/2011. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "CurveView.h" +@class CharacterGenerator; + +@interface ExampleView : CurveView { + + NSColor *_foregroundColor; + + CGFloat _blur; + CGFloat _lighten; + CGFloat _darken; + + CharacterGenerator *_charGenerator; + +} + +@property (nonatomic, retain) NSColor *foregroundColor; +@property (nonatomic, assign) CGFloat lighten; +@property (nonatomic, assign) CGFloat darken; +@property (nonatomic, assign) CGFloat blur; + + +-(void)updateEffects; + +@end + diff --git a/Views/ExampleView.m b/Views/ExampleView.m new file mode 100644 index 0000000..49bd826 --- /dev/null +++ b/Views/ExampleView.m @@ -0,0 +1,105 @@ +// +// ExampleView.m +// 2Term +// +// Created by Kelvin Sherlock on 2/6/2011. +// Copyright 2011 __MyCompanyName__. All rights reserved. +// + +#import "ExampleView.h" + +#import "ScanLineFilter.h" +#import "CharacterGenerator.h" + +@implementation ExampleView + +@synthesize lighten = _lighten; +@synthesize darken = _darken; +@synthesize blur = _blur; +@synthesize foregroundColor = _foregroundColor; + + +-(void)awakeFromNib +{ + [super awakeFromNib]; + + _foregroundColor = [[NSColor greenColor] retain]; + _charGenerator = [[CharacterGenerator generator] retain]; + [self setWantsLayer: YES]; +} + +- (void)dealloc +{ + [_foregroundColor release]; + [_charGenerator release]; + [super dealloc]; + +} + +-(BOOL)isFlipped +{ + return YES; +} + +-(void)drawRect:(NSRect)dirtyRect +{ + CGFloat paddingLeft = 10.0; + CGFloat paddingTop = 10.0; + + const char *string = "Two Term"; + + NSSize size = [_charGenerator characterSize]; + + [super drawRect: dirtyRect]; + + [_foregroundColor set]; + + for (unsigned i = 0; string[i]; ++i) + { + [_charGenerator drawCharacter: string[i] atPoint: NSMakePoint( i * size.width + paddingLeft, paddingTop)]; + } + + // draw inversed on the next line. + + for (unsigned i = 0; string[i]; ++i) + { + [_foregroundColor set]; + NSRectFill(NSMakeRect( i * size.width + paddingLeft, size.height + paddingTop, size.width, size.height)); + + [_color set]; + [_charGenerator drawCharacter: string[i] atPoint: NSMakePoint( i * size.width + paddingLeft, size.height + paddingTop)]; + } +} + +-(void)updateEffects +{ + + NSMutableArray *filters; + CIFilter *filter; + + filters = [NSMutableArray arrayWithCapacity: 3]; + + + //add the scanlines + + filter = [[ScanLineFilter new] autorelease]; + [filter setValue: [NSNumber numberWithFloat: _darken] forKey: @"inputDarken"]; + [filter setValue: [NSNumber numberWithFloat: _lighten] forKey: @"inputLighten"]; + [filters addObject: filter]; + + //blur it a bit... + + filter = [CIFilter filterWithName: @"CIGaussianBlur"]; + [filter setDefaults]; + [filter setValue: [NSNumber numberWithFloat: _blur] forKey: @"inputRadius"]; + + [filters addObject: filter]; + + + + [self setContentFilters: filters]; + + +} + +@end