2010-07-08 22:26:58 +00:00
|
|
|
//
|
|
|
|
// EmulatorView.h
|
|
|
|
// 2Term
|
|
|
|
//
|
|
|
|
// Created by Kelvin Sherlock on 7/3/2010.
|
|
|
|
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2010-07-09 01:18:30 +00:00
|
|
|
#include "Emulator.h"
|
|
|
|
|
|
|
|
#include "iGeometry.h"
|
2010-07-08 22:26:58 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2010-07-09 01:18:30 +00:00
|
|
|
#include "Screen.h"
|
2010-07-08 22:26:58 +00:00
|
|
|
|
2010-07-12 02:18:37 +00:00
|
|
|
@class EmulatorView;
|
2010-09-11 20:27:26 +00:00
|
|
|
|
2010-07-12 02:18:37 +00:00
|
|
|
class ViewScreen: public Screen
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void setSize(unsigned width, unsigned height);
|
|
|
|
|
|
|
|
void setSize(unsigned width, unsigned height, bool resizeView);
|
|
|
|
|
|
|
|
void setView(EmulatorView *view) { _view = view; }
|
|
|
|
void setFD(int fd) { _fd = fd; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
EmulatorView *_view;
|
|
|
|
int _fd;
|
|
|
|
};
|
|
|
|
|
2010-07-08 22:26:58 +00:00
|
|
|
|
2010-07-09 01:18:30 +00:00
|
|
|
#endif
|
2010-07-08 22:26:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
@class CharacterGenerator;
|
|
|
|
|
|
|
|
@interface EmulatorView : NSView {
|
2010-07-09 01:18:30 +00:00
|
|
|
|
2010-07-08 22:26:58 +00:00
|
|
|
int _fd;
|
|
|
|
|
2010-07-09 01:18:30 +00:00
|
|
|
NSObject<Emulator> *_emulator;
|
2010-07-08 22:26:58 +00:00
|
|
|
|
|
|
|
NSThread *_readerThread;
|
|
|
|
|
|
|
|
CharacterGenerator *_charGen;
|
|
|
|
|
|
|
|
NSColor *_backgroundColor;
|
|
|
|
NSColor *_foregroundColor;
|
2010-07-10 16:15:09 +00:00
|
|
|
NSColor *_boldColor;
|
2010-07-08 22:26:58 +00:00
|
|
|
|
|
|
|
CGFloat _charHeight;
|
|
|
|
CGFloat _charWidth;
|
2010-07-09 01:18:30 +00:00
|
|
|
|
|
|
|
CGFloat _paddingTop;
|
|
|
|
CGFloat _paddingBottom;
|
|
|
|
CGFloat _paddingLeft;
|
|
|
|
CGFloat _paddingRight;
|
2010-07-08 22:26:58 +00:00
|
|
|
|
2010-07-12 02:18:37 +00:00
|
|
|
NSImage *_cursorImg;
|
|
|
|
NSTimer *_cursorTimer;
|
|
|
|
BOOL _cursorOn;
|
2010-07-11 15:26:53 +00:00
|
|
|
|
2010-07-08 22:26:58 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2010-07-12 02:18:37 +00:00
|
|
|
ViewScreen _screen;
|
2010-07-08 22:26:58 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2010-09-11 20:27:26 +00:00
|
|
|
@property (nonatomic, assign) int fd;
|
|
|
|
//@property (nonatomic, assign) iPoint cursor;
|
|
|
|
|
|
|
|
|
2010-07-08 22:26:58 +00:00
|
|
|
-(void)startBackgroundReader;
|
|
|
|
-(void)dataAvailable;
|
2010-07-11 15:26:53 +00:00
|
|
|
-(void)invalidateIRect: (iRect)rect;
|
2010-07-08 22:26:58 +00:00
|
|
|
|
2010-07-12 02:18:37 +00:00
|
|
|
-(void)resizeTo: (iSize)size;
|
|
|
|
|
|
|
|
-(void)cursorTimer: (NSTimer *)timer;
|
|
|
|
|
2010-09-11 20:27:26 +00:00
|
|
|
|
|
|
|
-(void)autoTypeText: (NSString *)text;
|
|
|
|
|
|
|
|
-(IBAction)paste: (id)sender;
|
|
|
|
-(IBAction)copy: (id)sender;
|
|
|
|
|
2010-07-08 22:26:58 +00:00
|
|
|
|
|
|
|
@end
|