use child monitor for data available.

git-svn-id: svn://qnap.local/TwoTerm/trunk@1999 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
Kelvin Sherlock 2011-01-20 02:33:46 +00:00
parent 91878398b4
commit 8275ab5ec5
2 changed files with 27 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#import <Cocoa/Cocoa.h>
#include "Emulator.h"
#include "ChildMonitor.h"
#include "iGeometry.h"
@ -104,3 +105,8 @@ private:
@end
@interface EmulatorView (ChildMonitor) <ChildMonitorDelegate>
@end

View File

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