mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2024-12-22 07:30:40 +00:00
41c311fb8a
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.
129 lines
2.4 KiB
Objective-C
129 lines
2.4 KiB
Objective-C
//
|
|
// EmulatorView.h
|
|
// 2Term
|
|
//
|
|
// Created by Kelvin Sherlock on 7/3/2010.
|
|
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
|
//
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
#include "Emulator.h"
|
|
|
|
#include "iGeometry.h"
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#include "Screen.h"
|
|
|
|
#include "ring_buffer.h"
|
|
|
|
@class EmulatorView;
|
|
|
|
class ViewScreen: public Screen
|
|
{
|
|
public:
|
|
|
|
virtual void setSize(unsigned width, unsigned height);
|
|
virtual void setCursorType(CursorType cursorType);
|
|
|
|
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;
|
|
};
|
|
|
|
|
|
#endif
|
|
|
|
|
|
@class CharacterGenerator;
|
|
|
|
@interface EmulatorView : NSView {
|
|
|
|
int _fd;
|
|
|
|
NSObject<Emulator> *_emulator;
|
|
|
|
CharacterGenerator *_charGen;
|
|
|
|
NSColor *_backgroundColor;
|
|
NSColor *_foregroundColor;
|
|
NSColor *_boldColor;
|
|
|
|
CGFloat _charHeight;
|
|
CGFloat _charWidth;
|
|
|
|
CGFloat _paddingTop;
|
|
CGFloat _paddingBottom;
|
|
CGFloat _paddingLeft;
|
|
CGFloat _paddingRight;
|
|
|
|
//NSImage *_cursorImg;
|
|
NSTimer *_cursorTimer;
|
|
BOOL _cursorOn;
|
|
|
|
|
|
BOOL _scanLines;
|
|
BOOL _inResizeTo;
|
|
|
|
unsigned _cursorType;
|
|
|
|
NSImage *_cursors[5];
|
|
#ifdef __cplusplus
|
|
|
|
ring_buffer<1024> _debug_buffer;
|
|
ViewScreen _screen;
|
|
|
|
#endif
|
|
std::vector<unsigned> _cursorStack;
|
|
}
|
|
|
|
@property (nonatomic, assign) BOOL scanLines;
|
|
@property (atomic, assign) int fd;
|
|
@property (nonatomic, assign) unsigned cursorType;
|
|
|
|
@property (nonatomic, retain) NSColor *foregroundColor;
|
|
@property (nonatomic, retain) NSColor *backgroundColor;
|
|
@property (nonatomic, retain) NSObject<Emulator> *emulator;
|
|
|
|
//@property (nonatomic, assign) iPoint cursor;
|
|
|
|
-(void)invalidateIRect: (iRect)rect;
|
|
|
|
//-(void)resizeTo: (iSize)size;
|
|
-(void)resizeTo: (iSize)size animated: (BOOL)animated;
|
|
|
|
|
|
|
|
-(void)autoTypeText: (NSString *)text;
|
|
|
|
-(IBAction)paste: (id)sender;
|
|
-(IBAction)copy: (id)sender;
|
|
-(IBAction)copyDebugData:(id)sender;
|
|
-(IBAction)clearDebugData:(id)sender;
|
|
|
|
|
|
-(void)processData: (uint8_t *)data size: (size_t)size;
|
|
-(void)childFinished: (int)status;
|
|
-(void)childBegan;
|
|
@end
|
|
|
|
|
|
|
|
|
|
@interface EmulatorView (Cursor)
|
|
|
|
-(void)stopCursorTimer;
|
|
-(void)cursorTimer: (NSTimer *)timer;
|
|
-(void)startCursorTimer;
|
|
|
|
-(void)pushCursor: (unsigned)type;
|
|
-(void)popCursor;
|
|
|
|
@end
|