merge updated effects.

git-svn-id: svn://qnap.local/TwoTerm/trunk@3146 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
Kelvin Sherlock 2016-09-28 03:13:50 +00:00
parent e1cf110542
commit 1fec3f120c
11 changed files with 427 additions and 1637 deletions

View File

@ -165,6 +165,7 @@
B68E632912FF909C00EAFF5F /* ExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleView.m; sourceTree = "<group>"; };
B6C173901D31D2B80024E360 /* GSOSConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GSOSConsole.h; sourceTree = "<group>"; };
B6C173911D31D2B80024E360 /* GSOSConsole.mm.ragel */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GSOSConsole.mm.ragel; sourceTree = "<group>"; };
B6C173941D35546A0024E360 /* algorithm.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = algorithm.h; sourceTree = "<group>"; };
B6C704EC15CCC64100CC0401 /* titlebar-center@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "titlebar-center@2x.png"; sourceTree = "<group>"; };
B6C704ED15CCC64100CC0401 /* titlebar-left@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "titlebar-left@2x.png"; sourceTree = "<group>"; };
B6C704EE15CCC64100CC0401 /* titlebar-right@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "titlebar-right@2x.png"; sourceTree = "<group>"; };
@ -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;

View File

@ -6,6 +6,13 @@
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
/*
* See Apple IIe Tech Ref page 273.
* See Apple IIgs Firmware Reference page 77
*
*
*/
#import "Apple80.h"
#include <sys/ttydefaults.h>
@ -130,9 +137,17 @@ enum {
screen->setFlagBit(Screen::FlagInverse);
break;
case CTRL('Q'):
// 40 column mode.
break;
case CTRL('R'):
// 80 column mode
break;
case CTRL('S'):
// stop listing until another key pressed.
break;
case CTRL('U'):
// deactivate 80 column firmware
@ -157,11 +172,16 @@ enum {
// cursor home
screen->setCursor(0, 0, true, true);
break;
case CTRL('Z'):
// clear entire line
screen->erase(Screen::EraseLineAll);
break;
case CTRL('['):
// mouse text on
screen->setFlagBit(Screen::FlagMouseText);
break;
case CTRL('\\'):

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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

View File

@ -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];

View File

@ -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];

View File

@ -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

View File

@ -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;

View File

@ -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];

View File

@ -59,7 +59,6 @@
-(void)dealloc
{
[_trackingArea release];
[_titleBar release];
[super dealloc];
}