diff --git a/2Term.xcodeproj/project.pbxproj b/2Term.xcodeproj/project.pbxproj index cf4cfd9..d9b9720 100644 --- a/2Term.xcodeproj/project.pbxproj +++ b/2Term.xcodeproj/project.pbxproj @@ -165,6 +165,7 @@ B68E632912FF909C00EAFF5F /* ExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleView.m; sourceTree = ""; }; B6C173901D31D2B80024E360 /* GSOSConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GSOSConsole.h; sourceTree = ""; }; B6C173911D31D2B80024E360 /* GSOSConsole.mm.ragel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GSOSConsole.mm.ragel; sourceTree = ""; }; + B6C173941D35546A0024E360 /* algorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = algorithm.h; sourceTree = ""; }; B6C704EC15CCC64100CC0401 /* titlebar-center@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "titlebar-center@2x.png"; sourceTree = ""; }; B6C704ED15CCC64100CC0401 /* titlebar-left@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "titlebar-left@2x.png"; sourceTree = ""; }; B6C704EE15CCC64100CC0401 /* titlebar-right@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "titlebar-right@2x.png"; sourceTree = ""; }; @@ -285,6 +286,7 @@ isa = PBXGroup; children = ( B612F44712DD5DAD005D1B77 /* iGeometry.cpp */, + B6C173941D35546A0024E360 /* algorithm.h */, B612F44812DD5DAD005D1B77 /* iGeometry.h */, B612F44912DD5DAD005D1B77 /* Lock.cpp */, B612F44A12DD5DAD005D1B77 /* Lock.h */, @@ -392,7 +394,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0730; + LastUpgradeCheck = 0800; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "2Term" */; compatibilityVersion = "Xcode 3.2"; @@ -547,7 +549,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = _Term_Prefix.pch; + GCC_PREFIX_HEADER = TwoTerm_Prefix.pch; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; PRODUCT_BUNDLE_IDENTIFIER = "com.ksherlock.${PRODUCT_NAME:rfc1034identifier}"; @@ -558,13 +560,16 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -588,13 +593,16 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/English.lproj/NewTerminal.xib b/English.lproj/NewTerminal.xib index 560f430..cabc941 100644 --- a/English.lproj/NewTerminal.xib +++ b/English.lproj/NewTerminal.xib @@ -1,1577 +1,283 @@ - - - 1070 - 11C74 - 1938 - 1138.23 - 567.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1938 - - - YES - NSUserDefaultsController - NSPopUpButton - NSMenuItem - NSMenu - NSButtonCell - NSButton - NSTextFieldCell - NSBox - NSColorWell - NSSlider - NSSliderCell - NSCustomObject - NSCustomView - NSView - NSWindowTemplate - NSTextField - NSPopUpButtonCell - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - NewTerminalWindowController - - - FirstResponder - - - NSApplication - - - 263 - 2 - {{196, 232}, {400, 500}} - 544736256 - New Terminal - NSWindow - - - - - 256 - - YES - - - 268 - {{17, 460}, {99, 17}} - - - - YES - - 68288064 - 71304192 - Terminal Type: - - LucidaGrande - 13 - 1044 - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 289 - {{262, 18}, {118, 25}} - - - - YES - - -2080244224 - 134217728 - Connect - - - -2038152961 - 163 - - DQ - 400 - 75 - - - - - 292 - {{20, 18}, {118, 25}} - - - - YES - - -2080244224 - 134217728 - Cancel - - - -2038152961 - 163 - - Gw - 400 - 75 - - - - - 268 - {{121, 455}, {259, 25}} - - - - YES - - -2080244160 - 2048 - - - -2036186881 - 163 - - - - 400 - 75 - - - Item 1 - - 1048576 - 2147483647 - 1 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - - YES - - OtherViews - - YES - - - - Item 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Item 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - - 1 - YES - YES - 2 - - - - - 12 - - YES - - - 274 - - 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}} - - - - - - {{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 - - - 274 - - 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, 500} - - - - - {{0, 0}, {1920, 1178}} - {10000000000000, 10000000000000} - NO - NO - YES - - - YES - - - - - YES - - - window - - - - 38 - - - - cancelButton: - - - - 40 - - - - connectButton: - - - - 41 - - - - foregroundColorControl - - - - 64 - - - - backgroundColorControl - - - - 65 - - - - terminalTypeButton - - - - 67 - - - - colorSchemeButton - - - - 92 - - - - effectsButton - - - - 93 - - - - darkenSlider - - - - 99 - - - - blurSlider - - - - 100 - - - - lightenSlider - - - - 101 - - - - setColorScheme: - - - - 122 - - - - filterParameterChanged: - - - - 124 - - - - filterParameterChanged: - - - - 125 - - - - filterParameterChanged: - - - - 126 - - - - filterParameterChanged: - - - - 127 - - - - filterParameterChanged: - - - - 128 - - - - exampleView - - - - 129 - - - - delegate - - - - 39 - - - - 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 - - - - - YES - - 0 - - YES - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - YES - - - - - - 2 - - - YES - - - - - - - - - - - - 9 - - - YES - - - - - - 10 - - - - - 17 - - - YES - - - - - - 18 - - - - - 19 - - - YES - - - - - - 20 - - - - - 55 - - - YES - - - - - - 56 - - - YES - - - - - - 57 - - - YES - - - - - - - - 58 - - - - - 59 - - - - - 60 - - - - - 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 - - - YES - - - - - - 63 - - - - - 90 - - - YES - - - - - - 91 - - - - - 68 - - - YES - - - - - - 69 - - - YES - - - - - - 70 - - - YES - - - - - - - - 71 - - - - - 72 - - - - - 73 - - - - - 102 - - - - - 123 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 1.IBPluginDependency - 1.IBWindowTemplateEditedContentRect - 1.NSWindowTemplate.visibleAtLaunch - 10.IBPluginDependency - 102.IBPluginDependency - 123.IBPluginDependency - 17.IBPluginDependency - 18.IBPluginDependency - 19.IBPluginDependency - 2.IBPluginDependency - 20.IBPluginDependency - 49.IBPluginDependency - 50.IBPluginDependency - 50.IBViewIntegration.shadowBlurRadius - 50.IBViewIntegration.shadowColor - 50.IBViewIntegration.shadowOffsetHeight - 50.IBViewIntegration.shadowOffsetWidth - 51.IBPluginDependency - 52.IBPluginDependency - 53.IBPluginDependency - 54.IBPluginDependency - 55.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 59.IBPluginDependency - 60.IBPluginDependency - 62.IBPluginDependency - 63.IBPluginDependency - 68.IBPluginDependency - 69.IBPluginDependency - 70.IBPluginDependency - 71.IBPluginDependency - 72.IBPluginDependency - 73.IBPluginDependency - 76.IBPluginDependency - 77.IBPluginDependency - 78.IBPluginDependency - 79.IBPluginDependency - 80.IBPluginDependency - 81.IBPluginDependency - 82.IBPluginDependency - 83.IBPluginDependency - 84.IBPluginDependency - 85.IBPluginDependency - 86.IBPluginDependency - 87.IBPluginDependency - 88.IBPluginDependency - 89.IBPluginDependency - 9.IBPluginDependency - 90.IBPluginDependency - 90.IBViewIntegration.shadowBlurRadius - 90.IBViewIntegration.shadowColor - 90.IBViewIntegration.shadowOffsetHeight - 90.IBViewIntegration.shadowOffsetWidth - 91.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{107, 469}, {400, 200}} - - 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 - 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 - 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 - 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 - 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 - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 131 - - - - YES - - CurveView - NSView - - IBProjectSource - ./Classes/CurveView.h - - - - ExampleView - CurveView - - IBProjectSource - ./Classes/ExampleView.h - - - - NewTerminalWindowController - NSWindowController - - YES - - YES - cancelButton: - colorChanged: - connectButton: - filterParameterChanged: - setColorScheme: - - - YES - id - id - id - id - id - - - - YES - - YES - cancelButton: - colorChanged: - connectButton: - filterParameterChanged: - setColorScheme: - - - YES - - cancelButton: - id - - - colorChanged: - id - - - connectButton: - id - - - filterParameterChanged: - id - - - setColorScheme: - id - - - - - YES - - YES - backgroundColorControl - blurSlider - colorSchemeButton - darkenSlider - effectsButton - exampleView - foregroundColorControl - lightenSlider - terminalTypeButton - - - YES - NSColorWell - NSSlider - NSPopUpButton - NSSlider - NSButton - ExampleView - NSColorWell - NSSlider - NSPopUpButton - - - - YES - - YES - backgroundColorControl - blurSlider - colorSchemeButton - darkenSlider - effectsButton - exampleView - foregroundColorControl - lightenSlider - terminalTypeButton - - - YES - - backgroundColorControl - NSColorWell - - - blurSlider - NSSlider - - - colorSchemeButton - NSPopUpButton - - - darkenSlider - NSSlider - - - effectsButton - NSButton - - - exampleView - ExampleView - - - foregroundColorControl - NSColorWell - - - lightenSlider - NSSlider - - - terminalTypeButton - NSPopUpButton - - - - - IBProjectSource - ./Classes/NewTerminalWindowController.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - NSSwitch - - - YES - {9, 8} - {7, 2} - {15, 15} - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NewTerminalWindowController.h b/NewTerminalWindowController.h index 6bbe03d..df60617 100644 --- a/NewTerminalWindowController.h +++ b/NewTerminalWindowController.h @@ -33,19 +33,21 @@ } -@property (nonatomic, retain) IBOutlet ExampleView *exampleView; +@property (nonatomic, assign) IBOutlet ExampleView *exampleView; -@property (nonatomic, retain) IBOutlet NSPopUpButton *terminalTypeButton; -@property (nonatomic, retain) IBOutlet NSPopUpButton *colorSchemeButton; +@property (nonatomic, assign) IBOutlet NSPopUpButton *terminalTypeButton; +@property (nonatomic, assign) IBOutlet NSPopUpButton *colorSchemeButton; -@property (nonatomic, retain) IBOutlet NSColorWell *foregroundColorControl; -@property (nonatomic, retain) IBOutlet NSColorWell *backgroundColorControl; +@property (nonatomic, assign) IBOutlet NSColorWell *foregroundColorControl; +@property (nonatomic, assign) 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) IBOutlet NSButton *effectsButton; +@property (nonatomic, assign) IBOutlet NSSlider *blurSlider; +@property (nonatomic, assign) IBOutlet NSSlider *lightenSlider; +@property (nonatomic, assign) IBOutlet NSSlider *darkenSlider; +@property (nonatomic, assign) IBOutlet NSSlider *bloomSlider; +@property (nonatomic, assign) IBOutlet NSSlider *vignetteSlider; @property (nonatomic, assign) BOOL effectsEnabled; @@ -61,4 +63,6 @@ -(NSMenu *)colorMenu; +-(NSColor *)recalcBackground; + @end diff --git a/NewTerminalWindowController.mm b/NewTerminalWindowController.mm index f576ada..7c3e9ad 100644 --- a/NewTerminalWindowController.mm +++ b/NewTerminalWindowController.mm @@ -26,6 +26,7 @@ @synthesize lightenSlider = _lightenSlider; @synthesize darkenSlider = _darkenSlider; + @synthesize effectsEnabled = _effectsEnabled; // colors enum { @@ -46,21 +47,6 @@ enum { - (void)dealloc { // Clean-up code here. - [_terminalTypeButton release]; - [_colorSchemeButton release]; - - - [_foregroundColorControl release]; - [_backgroundColorControl release]; - - - [_effectsButton release]; - [_blurSlider release]; - [_lightenSlider release]; - [_darkenSlider release]; - - [_exampleView release]; - [super dealloc]; } @@ -144,7 +130,7 @@ enum { [userInfo setObject: klass forKey: kClass]; [userInfo setObject: [_foregroundColorControl color] forKey: kForegroundColor]; - [userInfo setObject: [_backgroundColorControl color] forKey: kBackgroundColor]; + [userInfo setObject: [self recalcBackground] forKey: kBackgroundColor]; if (_effectsEnabled) { @@ -204,19 +190,24 @@ enum { { [_exampleView setForegroundColor: [_foregroundColorControl color]]; - [_exampleView setColor: [_backgroundColorControl color]]; + [_exampleView setColor: [self recalcBackground]]; if (_effectsEnabled) { [_exampleView setBlur: [_blurSlider floatValue]]; - [_exampleView setLighten: [_lightenSlider floatValue]]; + //[_exampleView setLighten: [_lightenSlider floatValue]]; [_exampleView setDarken: [_darkenSlider floatValue]]; + [_exampleView setBloom: [_bloomSlider floatValue]]; + [_exampleView setVignette: [_vignetteSlider floatValue]]; + } else { [_exampleView setBlur: 0.0]; - [_exampleView setLighten: 0.0]; + //[_exampleView setLighten: 0.0]; [_exampleView setDarken: 0.0]; + [_exampleView setBloom: 0.0]; + [_exampleView setVignette: 0.0]; } [_exampleView updateEffects]; @@ -240,4 +231,17 @@ enum { [self autorelease]; } +-(NSColor *)recalcBackground { + + NSColor *bg = [_backgroundColorControl color]; + NSColor *fg = [_foregroundColorControl color]; + CGFloat value = [_lightenSlider doubleValue]; + + if (_effectsEnabled) { + bg = [bg blendedColorWithFraction: value ofColor: fg]; + } + return bg; +} + + @end diff --git a/TermWindowController.mm b/TermWindowController.mm index a3a083b..a776e9a 100644 --- a/TermWindowController.mm +++ b/TermWindowController.mm @@ -287,7 +287,6 @@ - (void)windowDidLoad { - BOOL scanLines; NSColor *foregroundColor; NSColor *backgroundColor; Class klass; @@ -313,9 +312,6 @@ klass = [VT52 class]; } - o = [_parameters objectForKey: kScanLines]; - scanLines = o ? [(NSNumber *)o boolValue] : YES; - o = [_parameters objectForKey: kForegroundColor]; foregroundColor = o ? (NSColor *)o : [NSColor greenColor]; diff --git a/TwoTermAppDelegate.mm b/TwoTermAppDelegate.mm index e7ad65f..741a627 100644 --- a/TwoTermAppDelegate.mm +++ b/TwoTermAppDelegate.mm @@ -11,7 +11,8 @@ #import "TermWindowController.h" #import "NewTerminalWindowController.h" #import "Defaults.h" -#import "VT52.h" +//#import "VT52.h" +#import "GNOConsole.h" #import "ScanLineFilter.h" @@ -35,26 +36,49 @@ [nc addObserver: self selector: @selector(newTerminal:) name: kNotificationNewTerminal object: nil]; - filters = [NSMutableArray arrayWithCapacity: 3]; + filters = [NSMutableArray arrayWithCapacity: 5]; + + + // vignette effect + filter = [CIFilter filterWithName: @"CIVignette"]; + [filter setDefaults]; + [filter setValue: @(1.0) forKey: @"inputIntensity"]; + [filter setValue: @(1.0) forKey: @"inputRadius"]; + [filters addObject: filter]; + +#if 0 + //blur it a bit... + filter = [CIFilter filterWithName: @"CIGaussianBlur"]; + [filter setDefaults]; + [filter setValue: @(.33) forKey: @"inputRadius"]; + [filters addObject: filter]; +#endif //add the scanlines filter = [[ScanLineFilter new] autorelease]; - [filter setValue: [NSNumber numberWithFloat: .5] forKey: @"inputDarken"]; - [filter setValue: [NSNumber numberWithFloat: .02] forKey: @"inputLighten"]; + [filter setValue: @(0.5) forKey: @"inputDarken"]; + //[filter setValue: @(0.02) forKey: @"inputLighten"]; [filters addObject: filter]; - //blur it a bit... + - filter = [CIFilter filterWithName: @"CIGaussianBlur"]; + filter = [CIFilter filterWithName: @"CIBloom"]; [filter setDefaults]; - [filter setValue: [NSNumber numberWithFloat: .33] forKey: @"inputRadius"]; + [filter setValue: @2.0 forKey: @"inputRadius"]; + [filter setValue: @(0.75) forKey: @"inputIntensity"]; - [filters addObject: filter]; - - parameters = [NSDictionary dictionaryWithObject: filters forKey: kContentFilters]; + + + parameters = @{ + kClass: [GNOConsole class], + kContentFilters: filters, + kForegroundColor: [NSColor colorWithRed: 0.0 green: 1.0 blue: 0.6 alpha: 1.0], + kBackgroundColor: [NSColor colorWithRed: 0.0 green: .25 blue: .15 alpha: 1.0] + }; + controller = [TermWindowController new]; [controller setParameters: parameters]; [controller showWindow: nil]; diff --git a/Views/EmulatorWindow.m b/Views/EmulatorWindow.m index f58b449..61929d3 100644 --- a/Views/EmulatorWindow.m +++ b/Views/EmulatorWindow.m @@ -27,7 +27,7 @@ } -(id)initWithContentRect:(NSRect)contentRect - styleMask:(NSUInteger)styleMask + styleMask:(NSWindowStyleMask)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag { @@ -45,7 +45,7 @@ -(id)initWithContentRect:(NSRect)contentRect - styleMask:(NSUInteger)styleMask + styleMask:(NSWindowStyleMask)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag screen:(NSScreen *)screen diff --git a/Views/ExampleView.h b/Views/ExampleView.h index a3795c8..73017cf 100644 --- a/Views/ExampleView.h +++ b/Views/ExampleView.h @@ -18,6 +18,8 @@ CGFloat _blur; CGFloat _lighten; CGFloat _darken; + CGFloat _bloom; + CGFloat _vignette; CharacterGenerator *_charGenerator; @@ -27,6 +29,8 @@ @property (nonatomic, assign) CGFloat lighten; @property (nonatomic, assign) CGFloat darken; @property (nonatomic, assign) CGFloat blur; +@property (nonatomic, assign) CGFloat bloom; +@property (nonatomic, assign) CGFloat vignette; -(void)updateEffects; diff --git a/Views/ExampleView.m b/Views/ExampleView.m index 49bd826..b48068a 100644 --- a/Views/ExampleView.m +++ b/Views/ExampleView.m @@ -16,6 +16,9 @@ @synthesize lighten = _lighten; @synthesize darken = _darken; @synthesize blur = _blur; +@synthesize vignette = _vignette; +@synthesize bloom = _bloom; + @synthesize foregroundColor = _foregroundColor; @@ -77,26 +80,48 @@ NSMutableArray *filters; CIFilter *filter; - filters = [NSMutableArray arrayWithCapacity: 3]; - - - //add the scanlines + filters = [NSMutableArray arrayWithCapacity: 5]; - 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"]; + // vignette effect + filter = [CIFilter filterWithName: @"CIVignette"]; [filter setDefaults]; - [filter setValue: [NSNumber numberWithFloat: _blur] forKey: @"inputRadius"]; + [filter setValue: @(_vignette) forKey: @"inputIntensity"]; + [filter setValue: @(1.0) forKey: @"inputRadius"]; [filters addObject: filter]; + + //add the scanlines + + filter = [[ScanLineFilter new] autorelease]; + [filter setValue: @(_darken) forKey: @"inputDarken"]; + [filter setValue: @(_lighten) forKey: @"inputLighten"]; + [filters addObject: filter]; + + + // bloom it... + + filter = [CIFilter filterWithName: @"CIBloom"]; + [filter setDefaults]; + [filter setValue: @2.0 forKey: @"inputRadius"]; + [filter setValue: @(_bloom) forKey: @"inputIntensity"]; + + [filters addObject: filter]; + +#if 0 + //blur it a bit... + + filter = [CIFilter filterWithName: @"CIGaussianBlur"]; + [filter setDefaults]; + [filter setValue: @(_blur) forKey: @"inputRadius"]; + + [filters addObject: filter]; +#endif + + + [self setContentFilters: filters]; diff --git a/Views/TermContentView.m b/Views/TermContentView.m index c862390..c8d7d81 100644 --- a/Views/TermContentView.m +++ b/Views/TermContentView.m @@ -59,7 +59,6 @@ -(void)dealloc { [_trackingArea release]; - [_titleBar release]; [super dealloc]; }