27 Commits
r0 ... 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
Kelvin Sherlock dc097da462 version bump 2018-02-09 22:58:49 -05:00
Kelvin Sherlock 41c311fb8a Squashed commit of the following:
commit b9723cf13690c3a6ecefeee81b1d95a23bde0422
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Fri Feb 9 22:41:59 2018 -0500

    remove most gui config stuff from new window.

commit c690c5ebd99d6268f605094f429114a39ab3c180
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Thu Feb 8 11:48:29 2018 -0500

    crosshatch cursor, push/pop cursor state when no longer key window.

commit ebaa0e535ee52a85a514efbaa872f891f7e817f1
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Thu Feb 8 11:47:20 2018 -0500

    child monitor - removeAll

commit e591630339f3cd22ca461f2006f4c360fa43d026
Author: Kelvin Sherlock <ksherlock@gmail.com>
Date:   Thu Feb 8 11:46:19 2018 -0500

    add config popup for the term window.
2018-02-09 22:47:20 -05:00
Kelvin Sherlock 4507998f1d version bump 2018-01-31 22:54:46 -05:00
Kelvin Sherlock 9fcf9f333f fix (?) some bugs with IIe/gsos high-bit characters. 2018-01-31 22:37:52 -05:00
Kelvin Sherlock 6a117c7b8a include the a2-terminfo database 2018-01-31 22:37:23 -05:00
Kelvin Sherlock 5bd035e33e add terminfo submodule 2018-01-31 22:02:21 -05:00
Kelvin Sherlock 66040a8366 add ChildMonitor sources to xcode project. 2018-01-31 21:19:31 -05:00
Kelvin Sherlock b63b60826d set TERMINFO_DIRS to bundle/Resources/terminfo. 2018-01-31 21:19:05 -05:00
Kelvin Sherlock e0bc21d663 move all the child/fd/kevent monitoring to a dedicated thread / class. 2018-01-31 21:17:31 -05:00
Kelvin Sherlock 8d282293f0 version bump. 2018-01-29 21:35:26 -05:00
Kelvin Sherlock c41a520ef8 Merge branch 'master' of https://github.com/ksherlock/TwoTerm 2018-01-29 21:24:51 -05:00
Kelvin Sherlock 42b9206abe replace grand-central io/pid monitoring with a dedicated thread and kevents.
based on testing, the pty EOF is never flagged. Instead, exit the thread when the child pid dies.
2018-01-29 21:24:15 -05:00
Kelvin Sherlock 3542ed50ce fix scroll-right bug (PTSE) 2018-01-29 21:22:08 -05:00
ksherlock b25935338e Create README.md 2018-01-27 14:43:44 -05:00
Kelvin Sherlock 6299c68117 pics 2018-01-27 14:42:24 -05:00
Kelvin Sherlock 0044693288 pics 2018-01-27 14:34:02 -05:00
Kelvin Sherlock 4f1e79178f use ragel version of gno console emulator 2018-01-27 13:26:15 -05:00
Kelvin Sherlock 38dad13969 dispatch_io_create() is supposed to be the correct way to read from a stream. However, it doesn't seem to work and I believe it's due to poll() not working with pseudo terminals in OS X.
Leaving the code in just for fun.

Underlying issue - when the pty closes, the block doesn't always get notified so the fd doesn't close until the window closes.
2018-01-27 08:59:40 -05:00
Kelvin Sherlock a6408fc242 in high sierra, estimated read size always seems to be 0. handle that situation. 2018-01-18 15:43:13 -05:00
Kelvin Sherlock de8810b8e2 name edits. 2017-11-30 14:43:04 -05:00
Kelvin Sherlock 57021b2cba project update. 2017-11-30 14:42:48 -05:00
52 changed files with 1502 additions and 907 deletions
+3
View File
@@ -0,0 +1,3 @@
[submodule "a2-terminfo"]
path = a2-terminfo
url = https://github.com/ksherlock/a2-terminfo
+2 -2
View File
@@ -11,8 +11,8 @@
@interface CharacterGenerator : NSObject
{
CGImageRef _image;
NSMutableArray *_characters;
NSImage *_image;
NSImage *_characters[256];
NSSize _size;
}
+88 -70
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;
+21
View File
@@ -0,0 +1,21 @@
//
// ChildMonitor.h
// TwoTerm
//
// Created by Kelvin Sherlock on 1/31/2018.
//
#import <Foundation/Foundation.h>
@class TermWindowController;
@interface ChildMonitor : NSObject {
}
+(id)monitor;
-(void)removeController: (TermWindowController *)controller;
-(void)addController: (TermWindowController *)controller pid: (pid_t)pid fd: (int)fd;
-(void)removeAll;
@end
+255
View File
@@ -0,0 +1,255 @@
//
// ChildMonitor.m
// TwoTerm
//
// Created by Kelvin Sherlock on 1/31/2018.
//
#import "ChildMonitor.h"
#import "TermWindowController.h"
#include "Lock.h"
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <vector>
#include <algorithm>
namespace {
struct entry {
pid_t pid;
int fd;
TermWindowController *controller;
};
typedef std::vector<entry> entry_vector;
entry_vector::iterator find_controller(entry_vector &table, TermWindowController *controller) {
return std::find_if(table.begin(), table.end(), [=](const entry &e){
return e.controller == controller;
});
}
entry_vector::iterator find_pid(entry_vector &table, pid_t pid) {
return std::find_if(table.begin(), table.end(), [=](const entry &e){
return e.pid == pid;
});
}
entry_vector::iterator find_fd(entry_vector &table, int fd) {
return std::find_if(table.begin(), table.end(), [=](const entry &e){
return e.fd == fd;
});
}
/* return NO on EOF */
BOOL read(int fd, TermWindowController *controller) {
size_t total = 0;
for (;;) {
uint8_t buffer[2048];
ssize_t ok = ::read(fd, buffer, sizeof(buffer));
if (ok == 0) return total > 0;
if (ok < 1) {
if (errno == EINTR) continue;
if (errno == EAGAIN) return YES;
return YES;
}
[controller processData: buffer size: ok];
if (ok < sizeof(buffer)) return YES;
total += ok;
}
}
}
@interface ChildMonitor() {
std::vector<entry> _table;
int _kq;
Lock _lock;
}
@end
@implementation ChildMonitor
+(id)monitor {
static ChildMonitor *me = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
me = [ChildMonitor new];
[NSThread detachNewThreadSelector: @selector(run) toTarget: me withObject: nil];
});
return me;
}
-(id)init {
if ((self = [super init])) {
_kq = kqueue();
}
return self;
}
-(void)dealloc {
_lock.lock();
close(_kq);
for (const auto &e : _table) {
if (e.fd >= 0) close(e.fd);
if (e.pid > 0) kill(e.pid, SIGHUP);
if (e.controller) [e.controller release];
}
_lock.unlock();
[super dealloc];
}
-(void)removeAll {
Locker l(_lock);
for (auto &e : _table) {
if (e.controller) {
[e.controller release];
e.controller = nil;
}
if (e.pid > 0) {
kill(e.pid, SIGHUP);
e.pid = -1;
}
}
}
-(void)removeController: (TermWindowController *)controller {
if (!controller) return;
Locker l(_lock);
auto iter = find_controller(_table, controller);
if (iter != _table.end()) {
[iter->controller release];
iter->controller = nil;
if (iter->pid > 0) kill(iter->pid, SIGHUP);
}
}
-(void)addController: (TermWindowController *)controller pid: (pid_t)pid fd: (int)fd {
NSLog(@"Adding pid: %d fd: %d", pid, fd);
int flags;
// non-blocking io.
if (fcntl(fd, F_GETFL, &flags) < 0) flags = 0;
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
Locker l(_lock);
_table.emplace_back(entry{pid, fd, [controller retain]});
struct kevent events[2] = {};
EV_SET(&events[0], fd, EVFILT_READ, EV_ADD | EV_RECEIPT, 0, 0, NULL);
EV_SET(&events[1], pid, EVFILT_PROC, EV_ADD | EV_ONESHOT | EV_RECEIPT, NOTE_EXIT | NOTE_EXITSTATUS, 0, NULL);
kevent(_kq, events, 2, NULL, 0, NULL);
}
-(void) run {
struct kevent events[16] = {};
for(;;) {
@autoreleasepool {
int n = kevent(_kq, NULL, 0, events, 2, NULL);
if (n < 0) {
NSLog(@"kevent: %s", strerror(errno));
continue;
}
if (n == 0) {
continue;
}
Locker l(_lock);
// should process twice, first for reading, second for dead children.
std::for_each(events, events + n, [&](const struct kevent &e){
if (e.filter != EVFILT_READ) return;
int fd = (int)e.ident;
if (e.flags & EV_EOF) {
NSLog(@"EV_EOF %d", fd);
return;
}
if (e.flags & EV_ERROR) {
NSLog(@"EV_ERROR %d", fd);
return;
}
auto iter = find_fd(_table, fd);
if (iter == _table.end() || iter->controller == nil) {
NSLog(@"Closing fd %d (not found)", fd);
close(fd); // should automatically remove itself from kevent
iter->fd = -1;
} else {
BOOL ok = read(fd, iter->controller);
if (!ok) {
NSLog(@"Closing fd %d (eof)", fd);
close(fd); // should automatically remove itself from kevent
iter->fd = -1;
}
}
});
std::for_each(events, events + n, [&](const struct kevent &e){
if (e.filter != EVFILT_PROC) return;
pid_t pid = (pid_t)e.ident;
int status = 0;
for(;;) {
int ok = waitpid(pid, &status, WNOHANG);
if (ok >= 0) break;
if (errno == EINTR) continue;
NSLog(@"waitpid(%d): %s", pid, strerror(errno));
break;
}
auto iter = find_pid(_table, pid);
if (iter == _table.end()) {
} else {
if (iter->fd >= 0) {
// check for pending i/o ?
if (iter->controller)
read(iter->fd, iter->controller);
NSLog(@"Closing fd %d (child exited)", iter->fd);
close(iter->fd);
iter->fd = -1;
}
[iter->controller childFinished: status];
[iter->controller release];
iter->controller = nil;
*iter = std::move(_table.back());
_table.pop_back();
}
NSLog(@"Child %d finished", pid);
});
}
}
}
@end
+24
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>
+4 -4
View File
@@ -220,26 +220,26 @@
| 0x80 .. 0x9f ${
/* uppercase inverse/normal */
uint8_t flag = ~(_context.flags & Screen::FlagInverse);
uint8_t flag = _context.flags ^ Screen::FlagInverse;
screen->putc(fc - 0x40, _context.cursor, flag);
} $advance
| 0xa0 .. 0xbf ${
/* special inverse/normal */
uint8_t flag = ~(_context.flags & Screen::FlagInverse);
uint8_t flag = _context.flags ^ Screen::FlagInverse;
screen->putc(fc - 0x80, _context.cursor, flag);
} $advance
| 0xc0 .. 0xdf ${
/* uppercase normal / mouse text. */
uint8_t flag = ~(_context.flags & Screen::FlagInverse);
uint8_t flag = _context.flags ^ Screen::FlagInverse;
if (flag) flag |= Screen::FlagMouseText;
screen->putc(fc - 0x80, _context.cursor, flag);
} $advance
| 0xe0 .. 0xff ${
/* special inverse/normal */
uint8_t flag = ~(_context.flags & Screen::FlagInverse);
uint8_t flag = _context.flags ^ Screen::FlagInverse;
screen->putc(fc - 0x80, _context.cursor, flag);
} $advance
+1 -4
View File
@@ -357,7 +357,7 @@
screen->eraseRect(tmp);
}
// hmmm ... embedded control characters seem to be processed as control characters...
# hmmm ... embedded control characters seem to be processed as control characters...
| 0x1e arg1 arg2 ${
// CTRL('^'):
// goto x y
@@ -390,9 +390,6 @@
@implementation GNOConsole
+(void)load
{
[EmulatorManager registerClass: self];
+5 -5
View File
@@ -178,7 +178,7 @@ static void advance(Screen *screen, gsos_context &ctx) {
*/
if (cursor.y < window.maxY()-1) cursor.y++;
else if (_context.consScroll)
screen->scrollUp(window);
screen->scrollUp(window);
}
| 0x0b ${
@@ -420,26 +420,26 @@ static void advance(Screen *screen, gsos_context &ctx) {
| 0x80 .. 0x9f ${
/* uppercase inverse/normal */
uint8_t flags = ~(_context.flags & Screen::FlagInverse);
uint8_t flags = _context.flags ^ Screen::FlagInverse;
screen->putc(fc - 0x40, cursor, flags);
} $advance_if
| 0xa0 .. 0xbf ${
/* special inverse/normal */
uint8_t flags = ~(_context.flags & Screen::FlagInverse);
uint8_t flags = _context.flags ^ Screen::FlagInverse;
screen->putc(fc - 0x80, cursor, flags);
} $advance_if
| 0xc0 .. 0xdf ${
/* uppercase normal / mouse text. */
uint8_t flags = ~(_context.flags & Screen::FlagInverse);
uint8_t flags = _context.flags ^ Screen::FlagInverse;
if (flags) flags |= Screen::FlagMouseText;
screen->putc(fc - 0x80, cursor, flags);
} $advance_if
| 0xe0 .. 0xff ${
/* special inverse/normal */
uint8_t flags = ~(_context.flags & Screen::FlagInverse);
uint8_t flags = _context.flags ^ Screen::FlagInverse;
screen->putc(fc - 0x80, cursor, flags);
} $advance_if
+15 -271
View File
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -10,13 +11,13 @@
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<menu title="AMainMenu" systemMenu="main" id="29">
<items>
<menuItem title="2Term" id="56">
<menu key="submenu" title="2Term" systemMenu="apple" id="57">
<menuItem title="TwoTerm" id="56" userLabel="TwoTerm">
<menu key="submenu" title="TwoTerm" systemMenu="apple" id="57">
<items>
<menuItem title="About 2Term" id="58">
<menuItem title="About TwoTerm" id="58">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
@@ -35,7 +36,7 @@
<menuItem isSeparatorItem="YES" id="144">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Hide 2Term" keyEquivalent="h" id="134">
<menuItem title="Hide TwoTerm" keyEquivalent="h" id="134">
<connections>
<action selector="hide:" target="-1" id="367"/>
</connections>
@@ -54,7 +55,7 @@
<menuItem isSeparatorItem="YES" id="149">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Quit 2Term" keyEquivalent="q" id="136">
<menuItem title="Quit TwoTerm" keyEquivalent="q" id="136">
<connections>
<action selector="terminate:" target="-3" id="449"/>
</connections>
@@ -341,268 +342,6 @@
</items>
</menu>
</menuItem>
<menuItem title="Format" id="375">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Format" id="376">
<items>
<menuItem title="Font" id="377">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Font" systemMenu="font" id="388">
<items>
<menuItem title="Show Fonts" keyEquivalent="t" id="389">
<connections>
<action selector="orderFrontFontPanel:" target="420" id="424"/>
</connections>
</menuItem>
<menuItem title="Bold" tag="2" keyEquivalent="b" id="390">
<connections>
<action selector="addFontTrait:" target="420" id="421"/>
</connections>
</menuItem>
<menuItem title="Italic" tag="1" keyEquivalent="i" id="391">
<connections>
<action selector="addFontTrait:" target="420" id="422"/>
</connections>
</menuItem>
<menuItem title="Underline" keyEquivalent="u" id="392">
<connections>
<action selector="underline:" target="-1" id="432"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="393"/>
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="394">
<connections>
<action selector="modifyFont:" target="420" id="425"/>
</connections>
</menuItem>
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="395">
<connections>
<action selector="modifyFont:" target="420" id="423"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="396"/>
<menuItem title="Kern" id="397">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Kern" id="415">
<items>
<menuItem title="Use Default" id="416">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardKerning:" target="-1" id="438"/>
</connections>
</menuItem>
<menuItem title="Use None" id="417">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffKerning:" target="-1" id="441"/>
</connections>
</menuItem>
<menuItem title="Tighten" id="418">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="tightenKerning:" target="-1" id="431"/>
</connections>
</menuItem>
<menuItem title="Loosen" id="419">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="loosenKerning:" target="-1" id="435"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Ligature" id="398">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Ligature" id="411">
<items>
<menuItem title="Use Default" id="412">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardLigatures:" target="-1" id="439"/>
</connections>
</menuItem>
<menuItem title="Use None" id="413">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffLigatures:" target="-1" id="440"/>
</connections>
</menuItem>
<menuItem title="Use All" id="414">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useAllLigatures:" target="-1" id="434"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Baseline" id="399">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Baseline" id="405">
<items>
<menuItem title="Use Default" id="406">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unscript:" target="-1" id="437"/>
</connections>
</menuItem>
<menuItem title="Superscript" id="407">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="superscript:" target="-1" id="430"/>
</connections>
</menuItem>
<menuItem title="Subscript" id="408">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="subscript:" target="-1" id="429"/>
</connections>
</menuItem>
<menuItem title="Raise" id="409">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="raiseBaseline:" target="-1" id="426"/>
</connections>
</menuItem>
<menuItem title="Lower" id="410">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowerBaseline:" target="-1" id="427"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="400"/>
<menuItem title="Show Colors" keyEquivalent="C" id="401">
<connections>
<action selector="orderFrontColorPanel:" target="-1" id="433"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="402"/>
<menuItem title="Copy Style" keyEquivalent="c" id="403">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="copyFont:" target="-1" id="428"/>
</connections>
</menuItem>
<menuItem title="Paste Style" keyEquivalent="v" id="404">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteFont:" target="-1" id="436"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Text" id="496">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Text" id="497">
<items>
<menuItem title="Align Left" keyEquivalent="{" id="498">
<connections>
<action selector="alignLeft:" target="-1" id="524"/>
</connections>
</menuItem>
<menuItem title="Center" keyEquivalent="|" id="499">
<connections>
<action selector="alignCenter:" target="-1" id="518"/>
</connections>
</menuItem>
<menuItem title="Justify" id="500">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="alignJustified:" target="-1" id="523"/>
</connections>
</menuItem>
<menuItem title="Align Right" keyEquivalent="}" id="501">
<connections>
<action selector="alignRight:" target="-1" id="521"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="502"/>
<menuItem title="Writing Direction" id="503">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Writing Direction" id="508">
<items>
<menuItem title="Paragraph" enabled="NO" id="509">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="510">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionNatural:" target="-1" id="525"/>
</connections>
</menuItem>
<menuItem id="511">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="526"/>
</connections>
</menuItem>
<menuItem id="512">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="527"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="513"/>
<menuItem title="Selection" enabled="NO" id="514">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="515">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionNatural:" target="-1" id="528"/>
</connections>
</menuItem>
<menuItem id="516">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="529"/>
</connections>
</menuItem>
<menuItem id="517">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="530"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="504"/>
<menuItem title="Show Ruler" id="505">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleRuler:" target="-1" id="520"/>
</connections>
</menuItem>
<menuItem title="Copy Ruler" keyEquivalent="c" id="506">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="copyRuler:" target="-1" id="522"/>
</connections>
</menuItem>
<menuItem title="Paste Ruler" keyEquivalent="v" id="507">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="pasteRuler:" target="-1" id="519"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="View" id="295">
<menu key="submenu" title="View" id="296">
<items>
@@ -617,6 +356,11 @@
<action selector="runToolbarCustomizationPalette:" target="-1" id="365"/>
</connections>
</menuItem>
<menuItem title="Configure" keyEquivalent="i" id="6in-Fp-JDh">
<connections>
<action selector="configure:" target="-1" id="5yK-Bh-svP"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
@@ -648,7 +392,7 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="491">
<items>
<menuItem title="2Term Help" keyEquivalent="?" id="492">
<menuItem title="TwoTerm Help" keyEquivalent="?" id="492">
<connections>
<action selector="showHelp:" target="-1" id="493"/>
</connections>
+30 -151
View File
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<capability name="box content view" minToolsVersion="7.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -9,16 +10,9 @@
<customObject id="-2" userLabel="File's Owner" customClass="NewTerminalWindowController">
<connections>
<outlet property="backgroundColorControl" destination="53" id="65"/>
<outlet property="bloomSlider" destination="MVc-mQ-qGn" id="TzC-h7-eSd"/>
<outlet property="blurSlider" destination="78" id="100"/>
<outlet property="colorSchemeButton" destination="68" id="92"/>
<outlet property="darkenSlider" destination="84" id="99"/>
<outlet property="effectsButton" destination="62" id="93"/>
<outlet property="exampleView" destination="123" id="129"/>
<outlet property="foregroundColorControl" destination="49" id="64"/>
<outlet property="lightenSlider" destination="82" id="101"/>
<outlet property="terminalTypeButton" destination="55" id="67"/>
<outlet property="vignetteSlider" destination="vAv-z0-AKd" id="tmI-Tz-29w"/>
<outlet property="window" destination="1" id="38"/>
</connections>
</customObject>
@@ -27,14 +21,14 @@
<window title="New Terminal" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="1">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" texturedBackground="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="232" width="400" height="613"/>
<rect key="contentRect" x="196" y="232" width="400" height="218"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
<view key="contentView" wantsLayer="YES" misplaced="YES" id="2">
<rect key="frame" x="0.0" y="0.0" width="400" height="613"/>
<rect key="frame" x="0.0" y="0.0" width="400" height="218"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField verticalHuggingPriority="750" id="9">
<rect key="frame" x="17" y="573" width="99" height="17"/>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="9">
<rect key="frame" x="17" y="178" width="99" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Terminal Type:" id="10">
<font key="font" metaFont="system"/>
@@ -42,9 +36,9 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" id="17">
<button verticalHuggingPriority="750" misplaced="YES" id="17">
<rect key="frame" x="262" y="18" width="118" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="roundTextured" title="Connect" bezelStyle="texturedRounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="18">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
@@ -56,22 +50,8 @@ DQ
<action selector="connectButton:" target="-2" id="41"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="19">
<rect key="frame" x="20" y="18" width="118" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="roundTextured" title="Cancel" bezelStyle="texturedRounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="20">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancelButton:" target="-2" id="40"/>
</connections>
</button>
<popUpButton verticalHuggingPriority="750" id="55">
<rect key="frame" x="121" y="568" width="259" height="25"/>
<rect key="frame" x="121" y="173" width="259" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="roundTextured" title="Item 1" bezelStyle="texturedRounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" selectedItem="58" id="56">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -86,13 +66,13 @@ Gw
</popUpButtonCell>
</popUpButton>
<box autoresizesSubviews="NO" borderType="line" title="Colors" id="76">
<rect key="frame" x="17" y="441" width="366" height="124"/>
<rect key="frame" x="17" y="46" width="366" height="124"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<view key="contentView" id="xsD-uS-uc3">
<rect key="frame" x="1" y="1" width="364" height="108"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" id="50">
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="50">
<rect key="frame" x="15" y="48" width="83" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Foreground:" id="51">
@@ -101,7 +81,7 @@ Gw
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="90">
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="90">
<rect key="frame" x="15" y="79" width="83" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Scheme:" id="91">
@@ -110,7 +90,7 @@ Gw
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="52">
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="52">
<rect key="frame" x="15" y="17" width="83" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Background:" id="54">
@@ -124,7 +104,7 @@ Gw
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="color" red="0.0" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="128"/>
<action selector="colorChanged:" target="-2" id="3vl-pH-esq"/>
</connections>
</colorWell>
<colorWell id="53">
@@ -132,7 +112,7 @@ Gw
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="color" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="127"/>
<action selector="colorChanged:" target="-2" id="ljb-zv-K8U"/>
</connections>
</colorWell>
<popUpButton verticalHuggingPriority="750" id="68">
@@ -156,128 +136,27 @@ Gw
</subviews>
</view>
</box>
<box autoresizesSubviews="NO" misplaced="YES" borderType="line" title="Effects" id="77">
<rect key="frame" x="17" y="238" width="366" height="199"/>
<button verticalHuggingPriority="750" misplaced="YES" id="19">
<rect key="frame" x="20" y="18" width="118" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<view key="contentView" id="Pmg-yY-Yvg">
<rect key="frame" x="1" y="1" width="364" height="183"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<slider verticalHuggingPriority="750" misplaced="YES" id="78">
<rect key="frame" x="85" y="131" width="263" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" tickMarkPosition="above" sliderType="linear" id="79"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="124"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="115"/>
</connections>
</slider>
<slider verticalHuggingPriority="750" misplaced="YES" id="82">
<rect key="frame" x="85" y="79" width="263" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.25" tickMarkPosition="above" sliderType="linear" id="83"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="125"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="117"/>
</connections>
</slider>
<textField verticalHuggingPriority="750" misplaced="YES" id="80">
<rect key="frame" x="25" y="134" width="56" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Blur:" id="81">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" misplaced="YES" id="86">
<rect key="frame" x="17" y="84" width="64" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Backlight:" id="87">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" misplaced="YES" id="88">
<rect key="frame" x="15" y="59" width="66" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Scanlines:" id="89">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<slider verticalHuggingPriority="750" misplaced="YES" id="84">
<rect key="frame" x="85" y="56" width="263" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.5" tickMarkPosition="above" sliderType="linear" id="85"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="126"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="119"/>
</connections>
</slider>
<slider verticalHuggingPriority="750" misplaced="YES" id="vAv-z0-AKd">
<rect key="frame" x="85" y="31" width="263" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="1" tickMarkPosition="above" sliderType="linear" id="6ek-4n-F91"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="xT7-DI-d9v"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="Zom-p6-sns"/>
</connections>
</slider>
<button misplaced="YES" id="62">
<rect key="frame" x="83" y="157" width="118" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Effects Enabled" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="63">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="effectsEnabled" id="107"/>
</connections>
</button>
<textField verticalHuggingPriority="750" misplaced="YES" id="p8Y-GX-qsU">
<rect key="frame" x="33" y="109" width="46" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Bloom:" id="JPr-iB-JMl">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<slider verticalHuggingPriority="750" misplaced="YES" id="MVc-mQ-qGn">
<rect key="frame" x="83" y="106" width="263" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.75" tickMarkPosition="above" sliderType="linear" id="rry-su-ojc"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="QKT-s7-pAK"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="DfY-jU-vle"/>
</connections>
</slider>
<textField verticalHuggingPriority="750" misplaced="YES" id="7Qa-e5-7OW">
<rect key="frame" x="20" y="33" width="59" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Vignette:" id="x41-sA-EDR">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
</box>
<customView id="123" customClass="ExampleView">
<rect key="frame" x="20" y="50" width="360" height="145"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
</customView>
<buttonCell key="cell" type="roundTextured" title="Cancel" bezelStyle="texturedRounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="20">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancelButton:" target="-2" id="40"/>
</connections>
</button>
</subviews>
</view>
<contentBorderThickness minY="0.0" maxY="0.0"/>
<connections>
<outlet property="delegate" destination="-2" id="39"/>
</connections>
<point key="canvasLocation" x="116" y="220.5"/>
<point key="canvasLocation" x="116" y="23"/>
</window>
<userDefaultsController representsSharedInstance="YES" id="102"/>
</objects>
+259
View File
@@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<capability name="box content view" minToolsVersion="7.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="TermWindowController">
<connections>
<outlet property="_bg" destination="y7X-B6-fK7" id="8g8-jL-Hgq"/>
<outlet property="_bloomSlider" destination="zfR-wC-m69" id="NUl-l7-LxH"/>
<outlet property="_blurSlider" destination="HTX-GL-dSw" id="nzS-Rs-opd"/>
<outlet property="_darkenSlider" destination="rzo-AM-xgS" id="cQU-IX-Ayk"/>
<outlet property="_effectsButton" destination="45n-1u-DD3" id="RO9-5L-rw0"/>
<outlet property="_fg" destination="h2m-UV-1jK" id="vUr-6N-hct"/>
<outlet property="_lightenSlider" destination="Yyg-Jb-Ehs" id="VIu-nj-6sy"/>
<outlet property="_vignetteSlider" destination="m3R-Cx-hoV" id="yQC-Hh-YhM"/>
<outlet property="popover" destination="Ezq-gE-d2Y" id="kjM-1e-QEy"/>
<outlet property="popoverViewController" destination="OVV-qD-BBZ" id="GrG-Nb-XmA"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<viewController id="OVV-qD-BBZ" userLabel="Popover View Controller">
<connections>
<outlet property="view" destination="I75-XO-Tcx" id="wDA-e4-3DT"/>
</connections>
</viewController>
<popover behavior="semitransient" id="Ezq-gE-d2Y">
<connections>
<outlet property="contentViewController" destination="OVV-qD-BBZ" id="0a5-yM-Gvw"/>
<outlet property="delegate" destination="-2" id="kCQ-Mx-dwQ"/>
</connections>
</popover>
<view misplaced="YES" id="I75-XO-Tcx">
<rect key="frame" x="0.0" y="0.0" width="480" height="386"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<box autoresizesSubviews="NO" misplaced="YES" borderType="line" title="Colors" id="9nf-mJ-BR9">
<rect key="frame" x="-3" y="214" width="486" height="152"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<view key="contentView" id="Yk4-q6-pft">
<rect key="frame" x="1" y="1" width="484" height="136"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="FUz-bX-GbP">
<rect key="frame" x="15" y="76" width="83" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Foreground:" id="xJP-lw-Tbc">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="dnI-BK-Rcv">
<rect key="frame" x="15" y="107" width="83" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Scheme:" id="KcE-bJ-jXO">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="bBS-WW-w8G">
<rect key="frame" x="15" y="45" width="83" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Background:" id="yQ3-OB-2JZ">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<colorWell misplaced="YES" tag="101" id="h2m-UV-1jK">
<rect key="frame" x="103" y="73" width="44" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="color" red="0.0" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="3Ru-PH-hSQ"/>
<binding destination="-2" name="value" keyPath="foregroundColor" id="rBL-Ts-HGk"/>
</connections>
</colorWell>
<colorWell tag="102" id="y7X-B6-fK7">
<rect key="frame" x="103" y="42" width="44" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="color" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="R4l-cG-wwp"/>
<binding destination="-2" name="value" keyPath="backgroundColor" id="bvR-yG-ANl"/>
</connections>
</colorWell>
<popUpButton verticalHuggingPriority="750" id="3sV-7a-zHB">
<rect key="frame" x="103" y="102" width="363" height="25"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="roundTextured" title="Item 1" bezelStyle="texturedRounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" selectedItem="Fvo-nW-HxK" id="4D2-1v-aHi">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" title="OtherViews" id="MbT-U8-boD">
<items>
<menuItem title="Item 1" state="on" id="Fvo-nW-HxK"/>
<menuItem title="Item 2" id="M9V-09-Hcy"/>
<menuItem title="Item 3" id="Fc7-mh-zWC"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<button verticalHuggingPriority="750" misplaced="YES" id="KyB-fP-aHS">
<rect key="frame" x="103" y="10" width="75" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="roundTextured" title="Swap" bezelStyle="texturedRounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="jAf-VI-BPe">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="swapColors:" target="-2" id="chW-So-Y92"/>
</connections>
</button>
</subviews>
</view>
</box>
<box autoresizesSubviews="NO" misplaced="YES" borderType="line" title="Effects" id="KgG-2I-L3k">
<rect key="frame" x="-3" y="11" width="486" height="199"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<view key="contentView" id="Ugn-Ms-tK7">
<rect key="frame" x="1" y="1" width="484" height="183"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<slider verticalHuggingPriority="750" id="HTX-GL-dSw">
<rect key="frame" x="85" y="131" width="383" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" tickMarkPosition="above" sliderType="linear" id="L90-Mv-v8n"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="f7g-CF-VXa"/>
<binding destination="-2" name="value" keyPath="blurValue" id="D5Z-q9-Rlv"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="zaD-eS-SmB"/>
</connections>
</slider>
<slider verticalHuggingPriority="750" id="Yyg-Jb-Ehs">
<rect key="frame" x="85" y="79" width="383" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.25" tickMarkPosition="above" sliderType="linear" id="u6M-Gg-qBE"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="x62-Id-NWe"/>
<binding destination="-2" name="value" keyPath="backlightValue" id="VfT-3v-Gax"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="PUq-u9-d6F"/>
</connections>
</slider>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="H0z-mE-bY7">
<rect key="frame" x="25" y="134" width="56" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Blur:" id="JNK-dk-099">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="Z01-Bk-h4V">
<rect key="frame" x="17" y="84" width="64" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Backlight:" id="5mr-bX-5bG">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="q1N-n8-Z3T">
<rect key="frame" x="15" y="59" width="66" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Scanlines:" id="7S4-8E-SbL">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<slider verticalHuggingPriority="750" id="rzo-AM-xgS">
<rect key="frame" x="85" y="56" width="383" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.5" tickMarkPosition="above" sliderType="linear" id="938-Rg-ZhB"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="I4v-8E-7m0"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="lKZ-pD-cDA"/>
<binding destination="-2" name="value" keyPath="scanlineValue" id="jM9-zH-7OX"/>
</connections>
</slider>
<slider verticalHuggingPriority="750" id="m3R-Cx-hoV">
<rect key="frame" x="85" y="31" width="383" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="1" tickMarkPosition="above" sliderType="linear" id="XLJ-uB-JVF"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="UIJ-Xs-mea"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="xHh-22-Gmn"/>
<binding destination="-2" name="value" keyPath="vignetteValue" id="MOU-47-YUb"/>
</connections>
</slider>
<button id="45n-1u-DD3">
<rect key="frame" x="83" y="157" width="118" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Effects Enabled" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="4dP-ze-wtI">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="filterParameterChanged:" target="-2" id="92u-Vv-Leg"/>
<binding destination="-2" name="value" keyPath="effectsEnabled" id="hEB-Mh-eRD"/>
</connections>
</button>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="V15-3Z-rcp">
<rect key="frame" x="33" y="109" width="46" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Bloom:" id="hao-V0-JkY">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<slider verticalHuggingPriority="750" id="zfR-wC-m69">
<rect key="frame" x="83" y="106" width="383" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.75" tickMarkPosition="above" sliderType="linear" id="KU3-BX-dWp"/>
<connections>
<action selector="filterParameterChanged:" target="-2" id="IxY-Oe-aaz"/>
<binding destination="-2" name="value" keyPath="bloomValue" id="3cg-US-D8y"/>
<binding destination="-2" name="enabled" keyPath="effectsEnabled" id="pKA-B0-P4C"/>
</connections>
</slider>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" id="oc8-uX-jXl">
<rect key="frame" x="20" y="33" width="59" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Vignette:" id="kD4-LV-p7U">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</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>
+8 -5
View File
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="TermWindowController">
<connections>
<outlet property="colorView" destination="2" id="3TK-Yg-hmS"/>
<outlet property="emulatorView" destination="5" id="14"/>
<outlet property="_colorView" destination="2" id="QiD-Qe-7pg"/>
<outlet property="_emulatorView" destination="5" id="JNn-UY-fjw"/>
<outlet property="window" destination="1" id="3"/>
</connections>
</customObject>
@@ -44,5 +46,6 @@
<outlet property="textLabel" destination="jhD-Y5-62e" id="Zzx-CJ-wV8"/>
</connections>
</window>
<userDefaultsController representsSharedInstance="YES" id="mq9-aV-tAe"/>
</objects>
</document>
+1 -3
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>1</string>
<string>5</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
-24
View File
@@ -19,18 +19,6 @@
NSColorWell *_foregroundColorControl;
NSColorWell *_backgroundColorControl;
NSButton *_effectsButton;
NSSlider *_blurSlider;
NSSlider *_lightenSlider;
NSSlider *_darkenSlider;
ExampleView *_exampleView;
BOOL _effectsEnabled;
}
@property (nonatomic, assign) IBOutlet ExampleView *exampleView;
@@ -42,15 +30,6 @@
@property (nonatomic, assign) IBOutlet NSColorWell *foregroundColorControl;
@property (nonatomic, assign) IBOutlet NSColorWell *backgroundColorControl;
@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;
-(IBAction)cancelButton: (id)sender;
@@ -59,10 +38,7 @@
-(IBAction)colorChanged: (id)sender;
-(IBAction)setColorScheme: (id)sender;
-(IBAction)filterParameterChanged: (id)sender;
-(NSMenu *)colorMenu;
-(NSColor *)recalcBackground;
@end
+3 -61
View File
@@ -18,16 +18,9 @@
@synthesize terminalTypeButton = _terminalTypeButton;
@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,
@@ -59,12 +52,11 @@ enum {
[super windowDidLoad];
window = [self window];
//[[window contentView] setWantsLayer: YES];
//[window setAutorecalculatesContentBorderThickness: NO forEdge: NSMinYEdge];
//[window setAutorecalculatesContentBorderThickness: NO forEdge: NSMaxYEdge];
[self setEffectsEnabled: YES];
[_terminalTypeButton setMenu: [EmulatorManager emulatorMenu]];
@@ -143,16 +135,11 @@ enum {
[userInfo setObject: klass forKey: kClass];
[userInfo setObject: [_foregroundColorControl color] forKey: kForegroundColor];
[userInfo setObject: [self recalcBackground] forKey: kBackgroundColor];
if (_effectsEnabled)
{
[userInfo setObject: [_exampleView contentFilters] forKey: kContentFilters];
}
[userInfo setObject: [_backgroundColorControl color] forKey: kBackgroundColor];
[nc postNotificationName: kNotificationNewTerminal object: self userInfo: userInfo];
// post notificiation...
}
@@ -205,43 +192,9 @@ enum {
}
[self filterParameterChanged: nil];
}
-(IBAction)filterParameterChanged: (id)sender
{
[_exampleView setForegroundColor: [_foregroundColorControl color]];
[_exampleView setColor: [self recalcBackground]];
if (_effectsEnabled)
{
[_exampleView setBlur: [_blurSlider 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 setDarken: 0.0];
[_exampleView setBloom: 0.0];
[_exampleView setVignette: 0.0];
}
[_exampleView updateEffects];
[_exampleView setNeedsDisplay: YES];
}
-(void)setEffectsEnabled:(BOOL)effectsEnabled
{
_effectsEnabled = effectsEnabled;
[self filterParameterChanged: nil];
}
#pragma mark -
#pragma mark NSWindowDelegate
@@ -254,17 +207,6 @@ 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
+12
View File
@@ -0,0 +1,12 @@
# TwoTerm
Apple-II inspired terminal emulator for OS X
Uses the Apple II character generator font but also emulates the GS/OS Console, GNO/ME Console, etc.
You'll probably need a [termcap](https://github.com/ksherlock/a2-terminfo) entry.
![](screenshots/vim.png?raw=true)
![](screenshots/cal.png?raw=true)
+49 -16
View File
@@ -7,39 +7,72 @@
//
#import <Cocoa/Cocoa.h>
#include <atomic>
@class EmulatorView;
@class ColorView;
@protocol Emulator;
@interface TermWindowController : NSWindowController <NSWindowDelegate> {
NSDictionary *_parameters;
EmulatorView *_emulatorView;
ColorView *_colorView;
@interface TermWindowController : NSWindowController <NSWindowDelegate, NSPopoverDelegate> {
IBOutlet EmulatorView *_emulatorView;
IBOutlet ColorView *_colorView;
NSObject <Emulator> *_emulator;
int _fd;
pid_t _pid;
dispatch_source_t _read_source;
dispatch_source_t _wait_source;
/* popover configuration options */
IBOutlet NSColorWell *_fg;
IBOutlet NSColorWell *_bg;
IBOutlet NSButton *_effectsButton;
IBOutlet NSSlider *_blurSlider;
IBOutlet NSSlider *_lightenSlider;
IBOutlet NSSlider *_darkenSlider;
IBOutlet NSSlider *_bloomSlider;
IBOutlet NSSlider *_vignetteSlider;
}
@property (nonatomic, retain) NSDictionary *parameters;
@property (nonatomic, retain) IBOutlet NSViewController *popoverViewController;
@property (nonatomic, retain) IBOutlet NSPopover *popover;
@property (nonatomic, retain) IBOutlet EmulatorView *emulatorView;
@property (nonatomic, retain) IBOutlet ColorView *colorView;
@property (nonatomic, retain) NSObject<Emulator> *emulator;
@property (nonatomic, assign) BOOL effectsEnabled;
@property (nonatomic, assign) double blurValue;
@property (nonatomic, assign) double bloomValue;
@property (nonatomic, assign) double backlightValue;
@property (nonatomic, assign) double scanlineValue;
@property (nonatomic, assign) double vignetteValue;
@property (nonatomic, retain) NSColor *foregroundColor;
@property (nonatomic, retain) NSColor *backgroundColor;
-(void)initPTY;
-(void)childFinished: (int)status;
-(void)processData: (const void *)buffer size: (size_t)size;
-(void)setParameters: (NSDictionary *)parameters;
@end
@interface TermWindowController (Config)
- (IBAction)configure: (id)sender;
- (IBAction)foregroundColor:(id)sender;
- (IBAction)backgroundColor:(id)sender;
- (IBAction)swapColors:(id)sender;
- (IBAction)filterParameterChanged: (id)sender;
-(void) updateBackgroundColor;
-(void) updateForegroundColor;
-(NSArray *)effectsFilter;
@end
+285 -207
View File
@@ -6,13 +6,19 @@
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <CoreImage/CoreImage.h>
#import "ScanLineFilter.h"
#import "TermWindowController.h"
#import "EmulatorView.h"
#import "CurveView.h"
#import "EmulatorWindow.h"
//#import "VT52.h"
//#import "PTSE.h"
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <atomic>
#include <utility>
#import "Defaults.h"
@@ -28,13 +34,12 @@
#include <string>
#include <vector>
#include "ChildMonitor.h"
#include "ColorView.h"
@implementation TermWindowController
@synthesize emulator = _emulator;
@synthesize emulatorView = _emulatorView;
@synthesize colorView = _colorView;
@synthesize parameters = _parameters;
+(id)new
{
@@ -43,36 +48,94 @@
-(void)dealloc
{
[_emulator release];
[_emulatorView release];
[_colorView release];
[_parameters release];
[[ChildMonitor monitor] removeController: self];
[_emulator release];
[_popover release];
[_popoverViewController release];
[_foregroundColor release];
[_backgroundColor release];
[super dealloc];
}
/*
-(void)awakeFromNib
{
[self initPTY];
-(id)initWithWindow:(NSWindow *)window {
if ((self = [super initWithWindow: window])) {
_foregroundColor = [[NSColor greenColor] retain];
_backgroundColor = [[NSColor blackColor] retain];
_bloomValue = 0.75;
_blurValue = 0.0;
_backlightValue = 0.25;
_scanlineValue = 0.5;
_vignetteValue = 0.5;
_effectsEnabled = YES;
}
return self;
}
*/
-(void)setParameters: (NSDictionary *)parameters {
NSColor *o;
Class klass;
o = [parameters objectForKey: kForegroundColor];
o = o ? (NSColor *)o : [NSColor greenColor];
[self setForegroundColor: o];
o = [parameters objectForKey: kBackgroundColor];
o = o ? (NSColor *)o : [NSColor blackColor];
[self setBackgroundColor: o];
klass = [parameters objectForKey: kClass];
if (!klass || ![klass conformsToProtocol: @protocol(Emulator)])
{
klass = Nil;
//klass = [VT52 class];
}
[self willChangeValueForKey: @"emulator"];
_emulator = [klass new];
[self didChangeValueForKey: @"emulator"];
#if 0
[self updateBackgroundColor];
[self updateForegroundColor];
#endif
}
-(void)initPTY
{
static std::string username;
static std::string terminfo;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// getlogin() sometimes returns crap.
username = [NSUserName() UTF8String];
char *cp = getenv("TERMINFO_DIRS");
if (cp && *cp) {
terminfo = cp;
terminfo.push_back(':');
}
NSString *s = [[NSBundle mainBundle] resourcePath];
s = [s stringByAppendingPathComponent: @"terminfo"];
terminfo += [s UTF8String];
});
pid_t pid;
int fd;
struct termios term;
struct winsize ws = [_emulator defaultSize];
memset(&term, 0, sizeof(term));
//term.c_oflag = OPOST | ONLCR;
//term.c_lflag = ECHO;
//term.c_iflag = ICRNL; // | ICANON | ECHOE | ISIG;
term.c_oflag = TTYDEF_OFLAG;
term.c_lflag = TTYDEF_LFLAG;
term.c_iflag = TTYDEF_IFLAG;
@@ -86,28 +149,23 @@
[_emulator initTerm: &term];
// getlogin() sometimes returns crap.
if (username.empty()) {
username = [NSUserName() UTF8String];
}
//NSLog(@"%@ %s %s", NSUserName(), getlogin(), getpwent()->pw_name);
_pid = forkpty(&_fd, NULL, &term, &ws);
pid = forkpty(&fd, NULL, &term, &ws);
if (_pid < 0)
if (pid < 0)
{
fprintf(stderr, "forkpty failed\n");
fflush(stderr);
return;
}
if (_pid == 0)
if (pid == 0)
{
std::vector<const char *> environ;
std::string s;
s.append("TERM_PROGRAM=2Term");
s.append("TERM_PROGRAM=TwoTerm");
s.append(1, (char)0);
s.append("LANG=C");
@@ -115,8 +173,12 @@
s.append("TERM=");
s.append([_emulator termName]);
s.append(1, (char)0);
s.append("TERMINFO_DIRS=");
s.append(terminfo.c_str());
s.append(1, (char)0);
s.append(1, (char)0);
for (std::string::size_type index = 0;;)
@@ -172,213 +234,229 @@
[window setMinSize: [window frame].size];
[_emulatorView setFd: _fd];
[self monitor];
/*
if (!_childMonitor)
{
_childMonitor = [ChildMonitor new];
[_childMonitor setDelegate: _emulatorView];
}
*/
[_emulatorView setFd: fd];
[[ChildMonitor monitor] addController: self pid: pid fd: fd];
}
-(void)monitor {
int fd = _fd;
int pid = _pid;
int flags;
// non-blocking io.
if (fcntl(_fd, F_GETFL, &flags) < 0) flags = 0;
fcntl(_fd, F_SETFL, flags | O_NONBLOCK);
[_emulatorView childBegan];
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
_wait_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_PROC,
pid, DISPATCH_PROC_EXIT, queue);
if (_wait_source)
{
dispatch_source_set_event_handler(_wait_source, ^{
int status = 0;
int ok;
for(;;) {
ok = waitpid(pid, &status, WNOHANG);
if (ok >= 0) break;
if (errno == EINTR) continue;
break;
}
_pid = 0;
//dispatch_async(dispatch_get_main_queue(), ^(){
[_emulatorView childFinished: status];
//});
dispatch_source_cancel(_wait_source);
dispatch_release(_wait_source);
_wait_source = nullptr;
});
dispatch_resume(_wait_source);
}
_read_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ,
fd, 0, queue);
if (_read_source)
{
// Install the event handler
dispatch_source_set_event_handler(_read_source, ^{
static uint8_t sbuffer[1024];
size_t estimated = dispatch_source_get_data(_read_source);
uint8_t *buffer = estimated > sizeof(sbuffer) ? (uint8_t *)malloc(estimated) : sbuffer;
if (buffer)
{
ssize_t actual;
for (;;) {
actual = read(fd, buffer, (estimated));
if (actual < 0) {
if (errno == EINTR) continue;
if (errno == EAGAIN) {
if (buffer != sbuffer) free(buffer);
return;
}
NSLog(@"read: %s", strerror(errno));
dispatch_source_cancel(_read_source);
dispatch_release(_read_source);
_read_source = nullptr;
}
break;
}
if (actual > 0) [_emulatorView processData: buffer size: actual];
if (buffer != sbuffer) free(buffer);
if (actual == 0) {
NSLog(@"closing fd");
dispatch_source_cancel(_read_source);
dispatch_release(_read_source);
_read_source = nullptr;
}
}
});
dispatch_source_set_cancel_handler(_read_source, ^{
_fd = -1;
[_emulatorView setFd: -1];
close(fd);
});
dispatch_resume(_read_source);
}
-(void)childFinished: (int)status {
[_emulatorView childFinished: status];
}
-(void)processData: (const void *)buffer size: (size_t)size {
[_emulatorView processData: (uint8_t *)buffer size: size];
}
#pragma mark -
#pragma mark NSWindowDelegate
- (void)windowDidLoad
{
NSColor *foregroundColor;
NSColor *backgroundColor;
Class klass;
id o;
NSWindow *window;
[super windowDidLoad];
window = [self window];
//[(CurveView *)[window contentView] setColor: [NSColor clearColor]];
//[window setContentView: _curveView];
// resize in 2.0 height increments to prevent jittering the scan lines.
//[window setResizeIncrements: NSMakeSize(1.0, 2.0)];
klass = [_parameters objectForKey: kClass];
if (!klass || ![klass conformsToProtocol: @protocol(Emulator)])
{
klass = Nil;
//klass = [VT52 class];
}
o = [_parameters objectForKey: kForegroundColor];
foregroundColor = o ? (NSColor *)o : [NSColor greenColor];
o = [_parameters objectForKey: kBackgroundColor];
backgroundColor = o ? (NSColor *)o : [NSColor blackColor];
[self willChangeValueForKey: @"emulator"];
_emulator = [klass new];
[self didChangeValueForKey: @"emulator"];
[window setBackgroundColor: backgroundColor];
[(EmulatorWindow *)window setTitleTextColor: foregroundColor];
window = [self window];
[_emulatorView setEmulator: _emulator];
[_emulatorView setForegroundColor: foregroundColor];
[_emulatorView setBackgroundColor: backgroundColor];
//[_emulatorView setScanLines: scanLines];
[self updateBackgroundColor];
[self updateForegroundColor];
[_colorView setColor: backgroundColor];
o = [_parameters objectForKey: kContentFilters];
if (o)
{
[_colorView setWantsLayer: YES];
[_colorView setContentFilters: (NSArray *)o];
}
[_colorView setWantsLayer: YES];
[_colorView setContentFilters: [self effectsFilter]];
[self initPTY];
}
-(void)windowWillClose:(NSNotification *)notification
{
if (_wait_source) {
dispatch_source_cancel(_wait_source);
dispatch_release(_wait_source);
}
if (_read_source) {
dispatch_source_cancel(_read_source);
dispatch_release(_read_source);
}
int status;
int ok;
if (_pid) {
kill(_pid, 9);
for(;;) {
ok = waitpid(_pid, &status, 0);
if (ok >= 0) break;
if (errno == EINTR) continue;
perror("waitpid: ");
break;
}
}
[[ChildMonitor monitor] removeController: self];
[self autorelease];
}
-(void)windowDidBecomeKey:(NSNotification *)notification {
[_emulatorView popCursor];
}
-(void)windowDidResignKey:(NSNotification *)notification {
[_emulatorView pushCursor: Screen::CursorTypeBlock];
}
-(void)popoverWillClose:(NSNotification *)notification {
[_fg deactivate];
[_bg deactivate];
[[NSColorPanel sharedColorPanel] orderOut: self];
}
@end
@implementation TermWindowController (Config)
-(NSColor *)recalcBackgroundColor {
if (_effectsEnabled) {
return [_backgroundColor blendedColorWithFraction: _backlightValue ofColor: _foregroundColor];
}
return _backgroundColor;
}
-(IBAction)filterParameterChanged:(id)sender {
if (sender == _effectsButton) sender = nil;
if (sender == nil || sender == _fg) {
[self updateForegroundColor];
}
if (sender == nil || sender == _fg || sender == _bg || sender == _lightenSlider) {
[self updateBackgroundColor];
}
if (sender == nil || sender == _vignetteSlider || sender == _darkenSlider || sender == _bloomSlider) {
[_colorView setContentFilters: [self effectsFilter]];
}
#if 0
CIFilter *filter = [_contentFilters objectAtIndex: 0];
[filter setValue: @(_vignetteValue) forKey: @"inputIntensity"];
}
if (sender == _darkenSlider) {
CIFilter *filter = [_contentFilters objectAtIndex: 1];
[filter setValue: @(_scanlineValue) forKey: @"inputDarken"];
}
if (sender == _bloomSlider) {
CIFilter *filter = [_contentFilters objectAtIndex: 2];
[filter setValue: @(_bloomValue) forKey: @"inputIntensity"];
}
#endif
}
-(NSArray *)effectsFilter {
if (!_effectsEnabled) return @[];
CIFilter *filter;
NSMutableArray *filters = [NSMutableArray arrayWithCapacity: 5];
// 1. vignette effect
filter = [CIFilter filterWithName: @"CIVignette"];
[filter setDefaults];
[filter setValue: @(_vignetteValue) forKey: @"inputIntensity"];
[filter setValue: @(2.0) forKey: @"inputRadius"];
[filters addObject: filter];
// 2. add the scanlines
filter = [[ScanLineFilter new] autorelease];
[filter setValue: @(_scanlineValue) forKey: @"inputDarken"];
[filter setValue: @(0.0) forKey: @"inputLighten"];
[filters addObject: filter];
// 3. bloom it...
filter = [CIFilter filterWithName: @"CIBloom"];
[filter setDefaults];
[filter setValue: @2.0 forKey: @"inputRadius"];
[filter setValue: @(_bloomValue) forKey: @"inputIntensity"];
[filters addObject: filter];
#if 0
//4. blur it a bit...
filter = [CIFilter filterWithName: @"CIGaussianBlur"];
[filter setDefaults];
[filter setValue: @(_blurValue) forKey: @"inputRadius"];
[filters addObject: filter];
#endif
return filters;
}
#pragma mark - IBActions
-(IBAction)configure: (id)sender {
if (!_popover) {
NSNib *nib = [[NSNib alloc] initWithNibNamed: @"TermConfig" bundle: nil];
// n.b. - instantiateWithOwner (10.8+) does not +1 refcount top level objects.
[nib instantiateWithOwner: self topLevelObjects: nil];
[nib release];
}
if ([_popover isShown]) {
[_popover close];
} else {
[_popover showRelativeToRect: NSZeroRect ofView: _emulatorView preferredEdge: NSRectEdgeMaxX];
}
}
- (IBAction)foregroundColor:(id)sender {
[self updateForegroundColor];
}
- (IBAction)backgroundColor:(id)sender {
[self updateBackgroundColor];
}
- (IBAction)swapColors:(id)sender {
[self willChangeValueForKey: @"foregroundColor"];
[self willChangeValueForKey: @"backgroundColor"];
std::swap(_foregroundColor, _backgroundColor);
[self didChangeValueForKey: @"foregroundColor"];
[self didChangeValueForKey: @"backgroundColor"];
[self updateBackgroundColor];
[self updateForegroundColor];
if ([_fg isActive]) {
[_bg activate: YES];
} else if ([_bg isActive]) {
[_fg activate: YES];
}
}
-(void)updateForegroundColor {
NSColor *color = _foregroundColor;
NSWindow *window = [self window];
[(EmulatorWindow *)window setTitleTextColor: color];
[_emulatorView setForegroundColor: color];
}
-(void)updateBackgroundColor {
NSColor *color = [self recalcBackgroundColor];
NSWindow *window = [self window];
[window setBackgroundColor: color];
[_colorView setColor: color];
[_emulatorView setBackgroundColor: color];
}
@end
+110 -2
View File
@@ -33,6 +33,7 @@
B61EF7D81482FB6D008C1891 /* titlebar-left.png in Resources */ = {isa = PBXBuildFile; fileRef = B61EF7D51482FB6D008C1891 /* titlebar-left.png */; };
B61EF7D91482FB6D008C1891 /* titlebar-right.png in Resources */ = {isa = PBXBuildFile; fileRef = B61EF7D61482FB6D008C1891 /* titlebar-right.png */; };
B638188214A179D60027D007 /* ColorView.m in Sources */ = {isa = PBXBuildFile; fileRef = B638188114A179D60027D007 /* ColorView.m */; };
B6407805201CE93500D3F2D1 /* GNOConsole.mm.ragel in Sources */ = {isa = PBXBuildFile; fileRef = B612F45B12DD5DF1005D1B77 /* GNOConsole.mm.ragel */; };
B66412391480A070003BC8D3 /* EmulatorWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = B66412381480A070003BC8D3 /* EmulatorWindow.m */; };
B675F4A81E540394004B0D9C /* Screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B612F44D12DD5DAD005D1B77 /* Screen.cpp */; };
B675F4A91E561D20004B0D9C /* Apple80.mm.ragel in Sources */ = {isa = PBXBuildFile; fileRef = B612F45712DD5DF1005D1B77 /* Apple80.mm.ragel */; };
@@ -43,9 +44,23 @@
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 */; };
B6ACA2AC1E5C8BEC000E774B /* GNOConsole.mm in Sources */ = {isa = PBXBuildFile; fileRef = B6ACA2AB1E5C8BEC000E774B /* GNOConsole.mm */; };
B69D0FBA202799B10073CCB7 /* TermConfig.xib in Resources */ = {isa = PBXBuildFile; fileRef = B69D0FB8202799B10073CCB7 /* TermConfig.xib */; };
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 */; };
@@ -62,6 +77,7 @@
isEditable = 1;
outputFiles = (
);
script = "";
};
B6C173931D32A8840024E360 /* PBXBuildRule */ = {
isa = PBXBuildRule;
@@ -101,6 +117,10 @@
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* TwoTerm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TwoTerm.app; sourceTree = BUILT_PRODUCTS_DIR; };
B60B98712022BAF100E688E3 /* appleIIgs.ti */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = appleIIgs.ti; sourceTree = "<group>"; };
B60B98732022BAF100E688E3 /* gno-console.ti */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "gno-console.ti"; sourceTree = "<group>"; };
B60B98742022BAF100E688E3 /* gsos-console.ti */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "gsos-console.ti"; sourceTree = "<group>"; };
B60B98762022BAF100E688E3 /* proterm-special.ti */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "proterm-special.ti"; sourceTree = "<group>"; };
B60EBD1111E8DEEF00C1974F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
B60EBDE111E90FC300C1974F /* ScanLineFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanLineFilter.h; sourceTree = "<group>"; };
B60EBDE211E90FC300C1974F /* ScanLineFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScanLineFilter.m; sourceTree = "<group>"; };
@@ -158,11 +178,28 @@
B6801BD812EB549300B22E9E /* vt100-charset.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vt100-charset.png"; sourceTree = "<group>"; };
B68E632812FF909C00EAFF5F /* ExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExampleView.h; sourceTree = "<group>"; };
B68E632912FF909C00EAFF5F /* ExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ExampleView.m; sourceTree = "<group>"; };
B69D0FB9202799B10073CCB7 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/TermConfig.xib; sourceTree = "<group>"; };
B69E32A820221C9E0086D7B1 /* ChildMonitor.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ChildMonitor.mm; sourceTree = "<group>"; };
B69E32AA20221CCA0086D7B1 /* ChildMonitor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ChildMonitor.h; sourceTree = "<group>"; };
B6ACA2AB1E5C8BEC000E774B /* GNOConsole.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GNOConsole.mm; sourceTree = "<group>"; };
B6ACA2AE1E635CEC000E774B /* vt52-charset.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "vt52-charset.png"; 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>"; };
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>"; };
@@ -199,6 +236,8 @@
B6EBE2B411E0EA9100EA0458 /* CharacterGenerator.mm */,
B60EBDE111E90FC300C1974F /* ScanLineFilter.h */,
B60EBDE211E90FC300C1974F /* ScanLineFilter.m */,
B69E32A820221C9E0086D7B1 /* ChildMonitor.mm */,
B69E32AA20221CCA0086D7B1 /* ChildMonitor.h */,
);
name = Classes;
sourceTree = "<group>";
@@ -259,13 +298,17 @@
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 */,
B61EF7C714815AF8008C1891 /* NewTerminal.xib */,
B69D0FB8202799B10073CCB7 /* TermConfig.xib */,
B61EF7CD148163E7008C1891 /* TitleBarView.xib */,
);
name = Resources;
@@ -280,6 +323,17 @@
name = Frameworks;
sourceTree = "<group>";
};
B60B98702022BAF100E688E3 /* a2-terminfo */ = {
isa = PBXGroup;
children = (
B60B98712022BAF100E688E3 /* appleIIgs.ti */,
B60B98732022BAF100E688E3 /* gno-console.ti */,
B60B98742022BAF100E688E3 /* gsos-console.ti */,
B60B98762022BAF100E688E3 /* proterm-special.ti */,
);
path = "a2-terminfo";
sourceTree = "<group>";
};
B612F44612DD5DAD005D1B77 /* cpp */ = {
isa = PBXGroup;
children = (
@@ -340,6 +394,8 @@
B6ECFF261D2EEA2B00871A81 /* TextLabel.m */,
B638188014A179D60027D007 /* ColorView.h */,
B638188114A179D60027D007 /* ColorView.m */,
B6C21CD42033580200671774 /* RolloverButton.h */,
B6C21CD52033580200671774 /* RolloverButton.m */,
);
path = Views;
sourceTree = "<group>";
@@ -347,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 */,
@@ -359,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>";
@@ -374,6 +440,7 @@
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
B61D0D57125B728D001C713B /* CopyFiles */,
B60B98802022BF5900E688E3 /* ShellScript */,
);
buildRules = (
B6C173931D32A8840024E360 /* PBXBuildRule */,
@@ -417,29 +484,58 @@
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;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
B60B98802022BF5900E688E3 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "for x in \"$PROJECT_DIR/a2-terminfo/\"*.ti ; do\ntic -N -s -o \"$BUILT_PRODUCTS_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/terminfo\" \"$x\"\ndone";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
@@ -448,6 +544,9 @@
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 */,
256AC3DA0F4B6AC300CF3369 /* TwoTermAppDelegate.mm in Sources */,
B676063B11DEAD3500D6B66C /* TermWindowController.mm in Sources */,
@@ -456,7 +555,6 @@
B61D0D60125B7ACA001C713B /* NewTerminalWindowController.mm in Sources */,
B61D0D69125B8E06001C713B /* Defaults.m in Sources */,
B6ECFF271D2EEA2B00871A81 /* TextLabel.m in Sources */,
B6ACA2AC1E5C8BEC000E774B /* GNOConsole.mm in Sources */,
B612F45012DD5DAD005D1B77 /* iGeometry.cpp in Sources */,
B612F45112DD5DAD005D1B77 /* Lock.cpp in Sources */,
B612F45212DD5DAD005D1B77 /* OutputChannel.cpp in Sources */,
@@ -516,6 +614,14 @@
name = TermWindow.xib;
sourceTree = "<group>";
};
B69D0FB8202799B10073CCB7 /* TermConfig.xib */ = {
isa = PBXVariantGroup;
children = (
B69D0FB9202799B10073CCB7 /* English */,
);
name = TermConfig.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
@@ -523,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;
@@ -541,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;
@@ -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

+15 -6
View File
@@ -13,7 +13,7 @@
#import "Defaults.h"
//#import "VT52.h"
#import "GNOConsole.h"
#import "ChildMonitor.h"
#import "ScanLineFilter.h"
@implementation TwoTermAppDelegate
@@ -27,15 +27,20 @@
TermWindowController *controller;
NSMutableArray *filters;
NSDictionary *parameters;
CIFilter *filter;
#if 0
struct sigaction sa = {};
sa.sa_handler = SIG_IGN;
sa.sa_flags = SA_RESTART;
sigaction(SIGCHLD, &sa, NULL);
#endif
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver: self selector: @selector(newTerminal:) name: kNotificationNewTerminal object: nil];
#if 0
filters = [NSMutableArray arrayWithCapacity: 5];
@@ -69,12 +74,12 @@
[filter setValue: @2.0 forKey: @"inputRadius"];
[filter setValue: @(0.75) forKey: @"inputIntensity"];
#endif
parameters = @{
kClass: [GNOConsole class],
kContentFilters: filters,
//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]
};
@@ -85,6 +90,10 @@
// this leak is ok.
}
-(void)applicationWillTerminate:(NSNotification *)notification {
[[ChildMonitor monitor] removeAll];
}
-(void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver: self];
+4 -1
View File
@@ -73,13 +73,14 @@ private:
unsigned _cursorType;
NSImage *_cursors[4];
NSImage *_cursors[5];
#ifdef __cplusplus
ring_buffer<1024> _debug_buffer;
ViewScreen _screen;
#endif
std::vector<unsigned> _cursorStack;
}
@property (nonatomic, assign) BOOL scanLines;
@@ -121,5 +122,7 @@ private:
-(void)cursorTimer: (NSTimer *)timer;
-(void)startCursorTimer;
-(void)pushCursor: (unsigned)type;
-(void)popCursor;
@end
+24 -73
View File
@@ -58,6 +58,7 @@
[_cursorTimer release];
_cursorTimer = nil;
_cursorOn = YES;
iRect r(_screen.cursor(), iSize(1,1));
[self invalidateIRect: r];
}
@@ -95,30 +96,24 @@
{
return _cursorType;
}
#if 0
dispatch_async(dispatch_get_main_queue(), ^(){
if (_cursorType == cursorType) return;
-(void)pushCursor:(unsigned)type {
if (_fd < 0) return;
unsigned char c;
switch (cursorType) {
default:
case Screen::CursorTypeUnderscore: c = '_'; break;
case Screen::CursorTypePipe: c = '|'; break;
case Screen::CursorTypeBlock: c = 0x80; break;
}
[_cursorImg release];
_cursorType = cursorType;
_cursorImg = [[_charGen imageForCharacter: c] retain];
iRect r(_screen.cursor(), iSize(1,1));
[self invalidateIRect: r];
});
#endif
_cursorStack.push_back(_cursorType);
[self setCursorType: type];
[self stopCursorTimer];
}
-(void)popCursor {
if (_fd < 0) return;
if (!_cursorStack.empty()) {
[self setCursorType: _cursorStack.back()];
_cursorStack.pop_back();
if (_cursorStack.empty()) [self startCursorTimer];
}
}
@end
@@ -160,7 +155,7 @@ dispatch_async(dispatch_get_main_queue(), ^(){
_paddingLeft = 8;
_paddingTop = 8;
_paddingBottom = 8;
_fd = -1;
//_foregroundColor = [[NSColor greenColor] retain];
//_backgroundColor = [[NSColor blackColor] retain];
@@ -181,6 +176,7 @@ dispatch_async(dispatch_get_main_queue(), ^(){
_cursors[Screen::CursorTypeUnderscore] = [[_charGen imageForCharacter: '_'] retain];
_cursors[Screen::CursorTypePipe] = [[_charGen imageForCharacter: '|'] retain];
_cursors[Screen::CursorTypeBlock] = [[_charGen imageForCharacter: 0x80] retain];
_cursors[Screen::CursorTypeCrossHatch] = [[_charGen imageForCharacter: 0x7f] retain];
size = [_charGen characterSize];
@@ -214,49 +210,6 @@ dispatch_async(dispatch_get_main_queue(), ^(){
[self setNeedsDisplay: YES];
}
-(void)setScanLines:(BOOL)scanLines
{
if (_scanLines == scanLines) return;
_scanLines = scanLines;
if (_scanLines)
{
NSMutableArray *filters;
CIFilter *filter;
[self setWantsLayer: YES];
filters = [NSMutableArray arrayWithCapacity: 3];
//add the scanlines
filter = [[ScanLineFilter new] autorelease];
[filter setValue: [NSNumber numberWithFloat: 1.0] forKey: @"inputDarken"];
[filter setValue: [NSNumber numberWithFloat: 0.025] forKey: @"inputLighten"];
[filters addObject: filter];
//blur it a bit...
filter = [CIFilter filterWithName: @"CIGaussianBlur"];
[filter setDefaults];
[filter setValue: [NSNumber numberWithFloat: 0.33] forKey: @"inputRadius"];
[filters addObject: filter];
[self setContentFilters: filters];
}
else
{
[self setContentFilters: @[]];
}
}
-(BOOL)isFlipped
{
return YES;
@@ -273,11 +226,6 @@ dispatch_async(dispatch_get_main_queue(), ^(){
[self startCursorTimer];
/*
[[self window] display];
[[self window] setHasShadow: NO];
[[self window] setHasShadow: YES];
*/
}
-(void)viewDidMoveToSuperview
@@ -285,6 +233,10 @@ dispatch_async(dispatch_get_main_queue(), ^(){
[self becomeFirstResponder];
}
-(BOOL)canBecomeKeyView {
return YES;
}
-(BOOL)acceptsFirstResponder
{
return YES;
@@ -467,8 +419,6 @@ dispatch_async(dispatch_get_main_queue(), ^(){
-(void)dealloc
{
close(_fd);
[_foregroundColor release];
[_backgroundColor release];
@@ -531,11 +481,12 @@ dispatch_async(dispatch_get_main_queue(), ^(){
//NSLog(@"[process complete]");
_fd = -1;
dispatch_async(dispatch_get_main_queue(), ^(){
iRect updateRect;
[self setCursorType: Screen::CursorTypeNone];
[self setCursorType: Screen::CursorTypeCrossHatch];
[self stopCursorTimer];
//_screen.setCursorType(Screen::CursorTypeNone);
@@ -802,7 +753,7 @@ dispatch_async(dispatch_get_main_queue(), ^(){
SEL cmd = [anItem action];
if (cmd == @selector(paste:)) {
return _fd >= 1;
return _fd >= 0;
}
if (cmd == @selector(copy:)) return NO;
if (cmd == @selector(copyDebugData:)) return YES;
+16
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
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
Submodule
+1
Submodule a2-terminfo added at b91763ed70
+1 -1
View File
@@ -321,7 +321,7 @@ void Screen::scrollRight(iRect rect, int n) {
auto xIter = line.begin() + rect.minX();
auto xEnd = line.begin() + rect.maxX();
auto iter = std::copy(xIter, xEnd-n, xEnd);
auto iter = std::copy_backward(xIter, xEnd-n, xEnd);
while (n--) { --iter; *iter = char_info(); }
}
+2 -1
View File
@@ -69,7 +69,8 @@ public:
CursorTypeNone,
CursorTypeUnderscore,
CursorTypePipe,
CursorTypeBlock
CursorTypeBlock,
CursorTypeCrossHatch,
};
Screen(unsigned height = 24, unsigned width = 80);
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB