6 Commits
r4 ... r5

Author SHA1 Message Date
Kelvin Sherlock
5b8c8fec17 version bump 2018-02-16 22:22:29 -05:00
Kelvin Sherlock
92e1805694 move colors, etc, to a defaults file... 2018-02-16 17:56:21 -05:00
Kelvin Sherlock
24248e768b add icons. 2018-02-16 17:54:36 -05:00
Kelvin Sherlock
01c89f4715 retina character generator. 2018-02-16 17:52:41 -05:00
Kelvin Sherlock
bf7e733e8b emulator view - init fd to -1 2018-02-14 11:14:51 -05:00
Kelvin Sherlock
49b165a56d add close button to config window. 2018-02-14 11:14:36 -05:00
31 changed files with 471 additions and 76 deletions

View File

@@ -11,8 +11,8 @@
@interface CharacterGenerator : NSObject
{
CGImageRef _image;
NSMutableArray *_characters;
NSImage *_image;
NSImage *_characters[256];
NSSize _size;
}

View File

@@ -10,10 +10,15 @@
#import "CharacterGenerator.h"
@interface CharacterGenerator ()
-(void)loadImageNamed: (NSString *)imageName;
@end
@implementation CharacterGenerator
@synthesize characterSize = _size;
#if 0
static CGImageRef PNGImage(NSString *path)
{
CGImageRef image = NULL;
@@ -31,89 +36,99 @@ static CGImageRef PNGImage(NSString *path)
return image;
}
#endif
+(id)generator
{
return [[self new] autorelease];
static CharacterGenerator *singleton = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
singleton = [[CharacterGenerator alloc] init];
});
return singleton;
}
-(id)init
{
if ((self = [super init]))
{
NSBundle *mainBundle;
NSString *imagePath;
CGImageRef mask;
CGImageRef src;
NSSize size;
mainBundle = [NSBundle mainBundle];
imagePath = [mainBundle pathForResource: @"a2-charset-80" ofType: @"png"];
//imagePath = [mainBundle pathForResource: @"vt100-charset" ofType: @"png"];
//imagePath = [mainBundle pathForResource: @"vt52-charset" ofType: @"png"];
_characters = [[NSMutableArray alloc] initWithCapacity: 256];
_size = NSMakeSize(7, 16);
src = PNGImage(imagePath);
size.width = CGImageGetWidth(src);
size.height = CGImageGetHeight(src);
size.width /= 16;
size.height /= 16;
_size = size;
if (src)
{
mask = CGImageMaskCreate(CGImageGetWidth(src),
CGImageGetHeight(src),
CGImageGetBitsPerComponent(src),
CGImageGetBitsPerPixel(src),
CGImageGetBytesPerRow(src),
CGImageGetDataProvider(src),
NULL, NO);
for (unsigned i = 0; i < 16; ++i)
{
for (unsigned j = 0; j < 16; ++j)
{
CGImageRef cgimg = CGImageCreateWithImageInRect(mask, CGRectMake(j * _size.width, i * _size.height, _size.width, _size.height));
NSImage *nsimg = [[NSImage alloc] initWithCGImage: cgimg size: _size];
[_characters addObject: nsimg];
CGImageRelease(cgimg);
[nsimg release];
}
}
CGImageRelease(src);
CGImageRelease(mask);
}
[self loadImageNamed: @"a2-charset-80"];
}
return self;
}
/*
* This loads the image then split it up into 256 images.
*
* All representations are handled so it retins any @2x artwork.
*
*/
-(void)loadImageNamed:(NSString *)imageName {
_image = [[NSImage imageNamed: imageName] retain];
_size = [_image size];
_size.width /= 16;
_size.height /= 16;
for (unsigned i = 0; i < sizeof(_characters) / sizeof(_characters[0]); ++i)
_characters[i] = [[NSImage alloc] initWithSize: _size];
for (NSImageRep *rep in [_image representations]) {
CGImageRef mask;
CGImageRef src;
NSSize size;
/* src will auto release */
src = [rep CGImageForProposedRect: NULL context: nil hints: nil];
size.width = CGImageGetWidth(src) / 16;
size.height = CGImageGetHeight(src) / 16;
mask = CGImageMaskCreate(CGImageGetWidth(src),
CGImageGetHeight(src),
CGImageGetBitsPerComponent(src),
CGImageGetBitsPerPixel(src),
CGImageGetBytesPerRow(src),
CGImageGetDataProvider(src),
NULL, NO);
for (unsigned i = 0; i < 16; ++i)
{
for (unsigned j = 0; j < 16; ++j)
{
CGImageRef cgimg = CGImageCreateWithImageInRect(mask, CGRectMake(j * size.width, i * size.height, size.width, size.height));
NSBitmapImageRep *rep = [[NSBitmapImageRep alloc] initWithCGImage: cgimg];
NSImage *nsimg = _characters[i * 16 + j];
[nsimg addRepresentation: rep];
[rep release];
CGImageRelease(cgimg);
}
}
CGImageRelease(mask);
}
}
-(void)dealloc
{
if (_image) CGImageRelease(_image);
[_characters release];
[_image release];
for (auto &o : _characters) [o release];
[super dealloc];
}
@@ -121,14 +136,17 @@ static CGImageRef PNGImage(NSString *path)
-(NSImage *)imageForCharacter: (unsigned)character
{
if (character > [_characters count]) return nil;
if (character >= sizeof(_characters) / sizeof(_characters[0])) return nil;
return (NSImage *)[_characters objectAtIndex: character];
return _characters[character];
}
-(void)drawCharacter: (unsigned)character atPoint: (NSPoint)point
{
NSImage *img = [self imageForCharacter: character];
if (character >= sizeof(_characters) / sizeof(_characters[0])) return;
NSImage *img = _characters[character];
if (!img) return;

24
Defaults.plist Normal file
View File

@@ -0,0 +1,24 @@
<?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">
<array>
<dict>
<key>Name</key>
<string>Green Black</string>
<key>Foreground</key>
<integer>65280</integer>
<key>Background</key>
<integer>0</integer>
<key>Effects</key>
<false/>
<key>Bloom</key>
<integer>0</integer>
<key>Backlight</key>
<integer>0</integer>
<key>Scanlines</key>
<integer>0</integer>
<key>Vignette</key>
<integer>0</integer>
</dict>
</array>
</plist>

View File

@@ -236,9 +236,24 @@
</subviews>
</view>
</box>
<button misplaced="YES" id="b5f-6s-ZI2">
<rect key="frame" x="451" y="357" width="24" height="24"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="TabClose" imagePosition="only" alignment="center" alternateImage="TabClose_Pressed" inset="2" id="Fi8-z7-gn2">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="performClose:" target="Ezq-gE-d2Y" id="CcO-2x-8Vw"/>
</connections>
</button>
</subviews>
<point key="canvasLocation" x="-521" y="413"/>
</view>
<userDefaultsController representsSharedInstance="YES" id="mq9-aV-tAe"/>
</objects>
<resources>
<image name="TabClose" width="12" height="13"/>
<image name="TabClose_Pressed" width="12" height="13"/>
</resources>
</document>

View File

@@ -6,8 +6,6 @@
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
@@ -21,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4</string>
<string>5</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>

View File

@@ -48,6 +48,19 @@
B69E32A920221C9E0086D7B1 /* ChildMonitor.mm in Sources */ = {isa = PBXBuildFile; fileRef = B69E32A820221C9E0086D7B1 /* ChildMonitor.mm */; };
B6ACA2AD1E614E38000E774B /* VT52.mm in Sources */ = {isa = PBXBuildFile; fileRef = B612F46312DD5DF1005D1B77 /* VT52.mm */; };
B6ACA2AF1E635CEC000E774B /* vt52-charset.png in Resources */ = {isa = PBXBuildFile; fileRef = B6ACA2AE1E635CEC000E774B /* vt52-charset.png */; };
B6C21CCE2033382B00671774 /* TabClose_Busy.tiff in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CC82033382A00671774 /* TabClose_Busy.tiff */; };
B6C21CCF2033382B00671774 /* TabClose_Busy_Pressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CC92033382A00671774 /* TabClose_Busy_Pressed.tiff */; };
B6C21CD02033382B00671774 /* TabClose.tiff in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CCA2033382A00671774 /* TabClose.tiff */; };
B6C21CD12033382B00671774 /* TabClose_Pressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CCB2033382B00671774 /* TabClose_Pressed.tiff */; };
B6C21CD22033382B00671774 /* TabClose_Rollover.tiff in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CCC2033382B00671774 /* TabClose_Rollover.tiff */; };
B6C21CD32033382B00671774 /* TabClose_Busy_Rollover.tiff in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CCD2033382B00671774 /* TabClose_Busy_Rollover.tiff */; };
B6C21CD62033580200671774 /* RolloverButton.m in Sources */ = {isa = PBXBuildFile; fileRef = B6C21CD52033580200671774 /* RolloverButton.m */; };
B6C21CDC20349C8E00671774 /* vt100-charset@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CD820349C8D00671774 /* vt100-charset@2x.png */; };
B6C21CDD20349C8E00671774 /* vt52-charset@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CD920349C8D00671774 /* vt52-charset@2x.png */; };
B6C21CDE20349C8E00671774 /* a2-charset-40@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CDA20349C8E00671774 /* a2-charset-40@2x.png */; };
B6C21CDF2034A37B00671774 /* a2-charset-80@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CD720349C8C00671774 /* a2-charset-80@2x.png */; };
B6C21CE1203510CC00671774 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CE0203510CC00671774 /* Images.xcassets */; };
B6C21CE52035262200671774 /* Defaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = B6C21CE42035262200671774 /* Defaults.plist */; };
B6C704EF15CCC64100CC0401 /* titlebar-center@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B6C704EC15CCC64100CC0401 /* titlebar-center@2x.png */; };
B6C704F015CCC64100CC0401 /* titlebar-left@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B6C704ED15CCC64100CC0401 /* titlebar-left@2x.png */; };
B6C704F115CCC64100CC0401 /* titlebar-right@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = B6C704EE15CCC64100CC0401 /* titlebar-right@2x.png */; };
@@ -173,6 +186,20 @@
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>"; };
B6C21CC82033382A00671774 /* TabClose_Busy.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Busy.tiff; sourceTree = "<group>"; };
B6C21CC92033382A00671774 /* TabClose_Busy_Pressed.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Busy_Pressed.tiff; sourceTree = "<group>"; };
B6C21CCA2033382A00671774 /* TabClose.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose.tiff; sourceTree = "<group>"; };
B6C21CCB2033382B00671774 /* TabClose_Pressed.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Pressed.tiff; sourceTree = "<group>"; };
B6C21CCC2033382B00671774 /* TabClose_Rollover.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Rollover.tiff; sourceTree = "<group>"; };
B6C21CCD2033382B00671774 /* TabClose_Busy_Rollover.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = TabClose_Busy_Rollover.tiff; sourceTree = "<group>"; };
B6C21CD42033580200671774 /* RolloverButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RolloverButton.h; sourceTree = "<group>"; };
B6C21CD52033580200671774 /* RolloverButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RolloverButton.m; sourceTree = "<group>"; };
B6C21CD720349C8C00671774 /* a2-charset-80@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "a2-charset-80@2x.png"; sourceTree = "<group>"; };
B6C21CD820349C8D00671774 /* vt100-charset@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vt100-charset@2x.png"; sourceTree = "<group>"; };
B6C21CD920349C8D00671774 /* vt52-charset@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vt52-charset@2x.png"; sourceTree = "<group>"; };
B6C21CDA20349C8E00671774 /* a2-charset-40@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "a2-charset-40@2x.png"; sourceTree = "<group>"; };
B6C21CE0203510CC00671774 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = TwoTerm/Images.xcassets; sourceTree = "<group>"; };
B6C21CE42035262200671774 /* Defaults.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Defaults.plist; 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>"; };
@@ -271,10 +298,12 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
B6C21CE0203510CC00671774 /* Images.xcassets */,
B60B98702022BAF100E688E3 /* a2-terminfo */,
B60EBDE711E9143F00C1974F /* ScanLineFilter.cikernel */,
B66979CE11E6BCAE002ED475 /* images */,
8D1107310486CEB800E47090 /* Info.plist */,
B6C21CE42035262200671774 /* Defaults.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
B676065011DEBAE900D6B66C /* TermWindow.xib */,
@@ -365,6 +394,8 @@
B6ECFF261D2EEA2B00871A81 /* TextLabel.m */,
B638188014A179D60027D007 /* ColorView.h */,
B638188114A179D60027D007 /* ColorView.m */,
B6C21CD42033580200671774 /* RolloverButton.h */,
B6C21CD52033580200671774 /* RolloverButton.m */,
);
path = Views;
sourceTree = "<group>";
@@ -372,6 +403,12 @@
B66979CE11E6BCAE002ED475 /* images */ = {
isa = PBXGroup;
children = (
B6C21CC92033382A00671774 /* TabClose_Busy_Pressed.tiff */,
B6C21CCD2033382B00671774 /* TabClose_Busy_Rollover.tiff */,
B6C21CC82033382A00671774 /* TabClose_Busy.tiff */,
B6C21CCB2033382B00671774 /* TabClose_Pressed.tiff */,
B6C21CCC2033382B00671774 /* TabClose_Rollover.tiff */,
B6C21CCA2033382A00671774 /* TabClose.tiff */,
B61EF7D41482FB6D008C1891 /* titlebar-center.png */,
B61EF7D51482FB6D008C1891 /* titlebar-left.png */,
B61EF7D61482FB6D008C1891 /* titlebar-right.png */,
@@ -384,6 +421,10 @@
B6ACA2AE1E635CEC000E774B /* vt52-charset.png */,
B67B3CE312B6FA040033AE07 /* a2-charset-40.png */,
B67B3CE412B6FA040033AE07 /* a2-charset-80.png */,
B6C21CDA20349C8E00671774 /* a2-charset-40@2x.png */,
B6C21CD720349C8C00671774 /* a2-charset-80@2x.png */,
B6C21CD920349C8D00671774 /* vt52-charset@2x.png */,
B6C21CD820349C8D00671774 /* vt100-charset@2x.png */,
);
path = images;
sourceTree = "<group>";
@@ -443,24 +484,36 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
B6C21CE52035262200671774 /* Defaults.plist in Resources */,
B6C21CDD20349C8E00671774 /* vt52-charset@2x.png in Resources */,
B60EBE2B11E918D500C1974F /* ScanLineFilter.cikernel in Resources */,
B6C21CD12033382B00671774 /* TabClose_Pressed.tiff in Resources */,
B6C21CCF2033382B00671774 /* TabClose_Busy_Pressed.tiff in Resources */,
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
B69D0FBA202799B10073CCB7 /* TermConfig.xib in Resources */,
1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */,
B676065111DEBAE900D6B66C /* TermWindow.xib in Resources */,
B6C21CDC20349C8E00671774 /* vt100-charset@2x.png in Resources */,
B67B3CE512B6FA040033AE07 /* a2-charset-40.png in Resources */,
B6C21CD02033382B00671774 /* TabClose.tiff in Resources */,
B67B3CE612B6FA040033AE07 /* a2-charset-80.png in Resources */,
B6C21CDE20349C8E00671774 /* a2-charset-40@2x.png in Resources */,
B6801BD912EB549300B22E9E /* vt100-charset.png in Resources */,
B6C21CCE2033382B00671774 /* TabClose_Busy.tiff in Resources */,
B6C21CD32033382B00671774 /* TabClose_Busy_Rollover.tiff in Resources */,
B61EF7C51481561E008C1891 /* titlebar-corner.png in Resources */,
B61EF7C61481561E008C1891 /* titlebar-middle.png in Resources */,
B61EF7C914815AF8008C1891 /* NewTerminal.xib in Resources */,
B61EF7CF148163E7008C1891 /* TitleBarView.xib in Resources */,
B61EF7D71482FB6D008C1891 /* titlebar-center.png in Resources */,
B6C21CE1203510CC00671774 /* Images.xcassets in Resources */,
B61EF7D81482FB6D008C1891 /* titlebar-left.png in Resources */,
B61EF7D91482FB6D008C1891 /* titlebar-right.png in Resources */,
B6C704EF15CCC64100CC0401 /* titlebar-center@2x.png in Resources */,
B6C704F015CCC64100CC0401 /* titlebar-left@2x.png in Resources */,
B6C704F115CCC64100CC0401 /* titlebar-right@2x.png in Resources */,
B6C21CDF2034A37B00671774 /* a2-charset-80@2x.png in Resources */,
B6C21CD22033382B00671774 /* TabClose_Rollover.tiff in Resources */,
B6ACA2AF1E635CEC000E774B /* vt52-charset.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -491,6 +544,7 @@
B675F4A91E561D20004B0D9C /* Apple80.mm.ragel in Sources */,
B675F4AC1E56A7F2004B0D9C /* GSOSConsole.mm.ragel in Sources */,
B6D1CD071E577E7D00C4A6BC /* PTSE.mm.ragel in Sources */,
B6C21CD62033580200671774 /* RolloverButton.m in Sources */,
B69E32A920221C9E0086D7B1 /* ChildMonitor.mm in Sources */,
B6407805201CE93500D3F2D1 /* GNOConsole.mm.ragel in Sources */,
8D11072D0486CEB800E47090 /* main.m in Sources */,
@@ -575,6 +629,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
@@ -593,6 +648,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;

View File

@@ -0,0 +1,66 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon-32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon-32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon-128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon-128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon-256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon-256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon-512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "icon-512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 KiB

View File

@@ -155,7 +155,7 @@
_paddingLeft = 8;
_paddingTop = 8;
_paddingBottom = 8;
_fd = 1;
_fd = -1;
//_foregroundColor = [[NSColor greenColor] retain];
//_backgroundColor = [[NSColor blackColor] retain];
@@ -233,6 +233,10 @@
[self becomeFirstResponder];
}
-(BOOL)canBecomeKeyView {
return YES;
}
-(BOOL)acceptsFirstResponder
{
return YES;

16
Views/RolloverButton.h Normal file
View File

@@ -0,0 +1,16 @@
//
// RolloverButton.h
// TwoTerm
//
// Created by Kelvin Sherlock on 2/13/2018.
//
#import <Cocoa/Cocoa.h>
@interface RolloverButton : NSButton {
NSImage *_image;
NSImage *_rolloverImage;
NSTrackingArea *_trackingArea;
BOOL _rollOver;
}
@end

98
Views/RolloverButton.m Normal file
View File

@@ -0,0 +1,98 @@
//
// RolloverButton.m
// TwoTerm
//
// Created by Kelvin Sherlock on 2/13/2018.
//
#import "RolloverButton.h"
@implementation RolloverButton
#if 0
- (void)createTrackingArea
{
NSTrackingAreaOptions focusTrackingAreaOptions = 0;
focusTrackingAreaOptions |= NSTrackingActiveInActiveApp;
focusTrackingAreaOptions |= NSTrackingMouseEnteredAndExited;
//focusTrackingAreaOptions |= NSTrackingAssumeInside;
focusTrackingAreaOptions |= NSTrackingInVisibleRect;
NSTrackingArea *focusTrackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect
options:focusTrackingAreaOptions
owner:self userInfo:nil];
[self addTrackingArea:focusTrackingArea];
[focusTrackingArea release];
}
#endif
- (void) updateTrackingAreas {
[super updateTrackingAreas];
if (_trackingArea) {
[self removeTrackingArea: _trackingArea];
[_trackingArea release];
}
NSTrackingAreaOptions options = 0;
options |= NSTrackingActiveInActiveApp;
options |= NSTrackingMouseEnteredAndExited;
//options |= NSTrackingAssumeInside;
options |= NSTrackingInVisibleRect;
_trackingArea = [[NSTrackingArea alloc] initWithRect:NSZeroRect
options:options
owner:self
userInfo:nil];
[self addTrackingArea: _trackingArea];
}
-(void)setImage:(NSImage *)image {
if (_image != image) {
[_image release];
_image = [image retain];
}
if (!_rollOver) [super setImage: image];
}
-(void)setRolloverImage: (NSImage *)image {
if (_rolloverImage != image) {
[_rolloverImage release];
_rolloverImage = [image retain];
}
if (_rollOver) [super setImage: image];
}
-(void)awakeFromNib {
[super awakeFromNib];
//[self createTrackingArea];
[self setImage: [NSImage imageNamed: @"TabClose"]];
[self setRolloverImage: [NSImage imageNamed: @"TabClose_Rollover"]];
[[self cell] setHighlightsBy: NSContentsCellMask];
}
-(void)dealloc {
[_image release];
[_rolloverImage release];
[super dealloc];
}
-(void)mouseExited:(NSEvent *)event {
[[self cell] setImage: _image];
_rollOver = NO;
[super mouseExited: event];
}
-(void) mouseEntered:(NSEvent *)event {
[[self cell] setImage: _rolloverImage];
_rollOver = YES;
[super mouseEntered: event];
}
@end

BIN
images/TabClose.tiff Normal file

Binary file not shown.

100
images/TabCloseButton.pdf Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

BIN
images/TabClose_Busy.tiff Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
images/TabNewButton.tiff Normal file

Binary file not shown.

BIN
images/a2-charset-40@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
images/a2-charset-80@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
images/vt100-charset@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
images/vt52-charset@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB