mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2025-02-25 22:29:09 +00:00
use Child monitor for incoming data/process dead.
git-svn-id: svn://qnap.local/TwoTerm/trunk@2003 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
parent
d4917dafb1
commit
480d7ef93a
@ -11,6 +11,7 @@
|
||||
|
||||
@class EmulatorView;
|
||||
@class CurveView;
|
||||
@class ChildMonitor;
|
||||
|
||||
@protocol Emulator;
|
||||
|
||||
@ -25,12 +26,16 @@
|
||||
|
||||
NSObject <Emulator> *_emulator;
|
||||
|
||||
ChildMonitor *_childMonitor;
|
||||
|
||||
int _child;
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) NSDictionary *parameters;
|
||||
|
||||
@property (nonatomic, retain) IBOutlet ChildMonitor *childMonitor;
|
||||
|
||||
@property (nonatomic, retain) IBOutlet EmulatorView *emulatorView;
|
||||
@property (nonatomic, retain) IBOutlet CurveView *curveView;
|
||||
|
||||
|
@ -10,6 +10,9 @@
|
||||
#import "EmulatorView.h"
|
||||
#import "CurveView.h"
|
||||
|
||||
#import "ChildMonitor.h"
|
||||
|
||||
|
||||
#import "VT52.h"
|
||||
#import "PTSE.h"
|
||||
|
||||
@ -35,6 +38,7 @@
|
||||
|
||||
@synthesize parameters = _parameters;
|
||||
|
||||
@synthesize childMonitor = _childMonitor;
|
||||
|
||||
|
||||
+(id)new
|
||||
@ -43,12 +47,16 @@
|
||||
}
|
||||
|
||||
-(void)dealloc
|
||||
{
|
||||
{
|
||||
|
||||
[_childMonitor release];
|
||||
|
||||
[_emulator release];
|
||||
[_emulatorView release];
|
||||
[_curveView release];
|
||||
|
||||
[_parameters release];
|
||||
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
@ -165,10 +173,21 @@
|
||||
[window setStyleMask: mask & ~NSResizableWindowMask];
|
||||
}
|
||||
|
||||
|
||||
if (!_childMonitor)
|
||||
{
|
||||
_childMonitor = [ChildMonitor new];
|
||||
[_childMonitor setDelegate: _emulatorView];
|
||||
}
|
||||
|
||||
[_childMonitor setChildPID: pid];
|
||||
[_childMonitor setFd: fd];
|
||||
|
||||
_child = pid;
|
||||
|
||||
[_emulatorView setFd: fd];
|
||||
[_emulatorView startBackgroundReader];
|
||||
//[_emulatorView startBackgroundReader];
|
||||
[_childMonitor start];
|
||||
}
|
||||
|
||||
|
||||
@ -223,7 +242,7 @@
|
||||
|
||||
//[_curveView initScanLines];
|
||||
//[_curveView setColor: [NSColor blueColor]];
|
||||
|
||||
|
||||
[self initPTY];
|
||||
|
||||
[window setMinSize: [window frame].size];
|
||||
@ -231,6 +250,9 @@
|
||||
|
||||
-(void)windowWillClose:(NSNotification *)notification
|
||||
{
|
||||
[_childMonitor setDelegate: nil];
|
||||
[_childMonitor cancel];
|
||||
|
||||
[self autorelease];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user