From 8275ab5ec5f7787f56209badbc0b7c2354692440 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 20 Jan 2011 02:33:46 +0000 Subject: [PATCH] use child monitor for data available. git-svn-id: svn://qnap.local/TwoTerm/trunk@1999 5590a31f-7b70-45f8-8c82-aa3a8e5f4507 --- Views/EmulatorView.h | 6 ++++++ Views/EmulatorView.mm | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Views/EmulatorView.h b/Views/EmulatorView.h index cb92efc..562999b 100644 --- a/Views/EmulatorView.h +++ b/Views/EmulatorView.h @@ -9,6 +9,7 @@ #import #include "Emulator.h" +#include "ChildMonitor.h" #include "iGeometry.h" @@ -104,3 +105,8 @@ private: @end + + +@interface EmulatorView (ChildMonitor) + +@end \ No newline at end of file diff --git a/Views/EmulatorView.mm b/Views/EmulatorView.mm index 5375a55..ae10c2c 100644 --- a/Views/EmulatorView.mm +++ b/Views/EmulatorView.mm @@ -266,6 +266,8 @@ if (_foregroundColor != currentFront) setFront = YES; if (setFront) [currentFront setFill]; + // need to apply the scanline filter here. + [_charGen drawCharacter: c atPoint: NSMakePoint(_paddingLeft + x * _charWidth, _paddingTop + y * _charHeight)]; @@ -375,6 +377,8 @@ -(void)startBackgroundReader { + return; + if (_readerThread) return; _readerThread = [[NSThread alloc] initWithTarget: self selector: @selector(_readerThread) object: nil]; @@ -708,6 +712,23 @@ @end +@implementation EmulatorView (ChildMonitor) + +-(void)childDataAvailable: (ChildMonitor *)monitor +{ + // this is called from a separate thread. + [self dataAvailable]; +} + +-(void)childFinished: (ChildMonitor *)monitor +{ + NSLog(@"[process complete]"); + // writeline "[process complete]" +} + +@end + + void ViewScreen::setSize(unsigned width, unsigned height) {