forked from hbang/NewTerm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VT100.h
61 lines (47 loc) · 1.89 KB
/
VT100.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// VT100.h
// MobileTerminal
//
// This file contains the bridge between the higher level text drawing
// controls and the lower level terminal state pieces (screen and terminal).
// The VT100 interface should be the only access from those components to the
// VT100 subsystem. This layer mostly exists to keep the complexity/mess of
// the VT100Terminal and VT100 screen away from everything else.
#import "VT100Types.h"
// Forward declarations
@class VT100Terminal;
@class VT100Screen;
// VT100 is the public interface that combines the terminal subcomponents. The
// caller is expected to provide the raw terminal data into the VT100 object
// via calls to handleInputStream. VT100 exposes the contents of the screen by
// implementing the ScreenBuffer protocol.
@interface VT100 : NSObject <ScreenBuffer, ScreenBufferRefreshDelegate> {
@private
VT100Screen *screen;
VT100Terminal *terminal;
id <ScreenBufferRefreshDelegate> refreshDelegate;
// Points on the screen
ScreenPosition selectionStart;
ScreenPosition selectionEnd;
}
@property (nonatomic, retain) id <ScreenBufferRefreshDelegate> refreshDelegate;
// Initialize a VT100
- (id)init;
- (void)setRefreshDelegate:(id <ScreenBufferRefreshDelegate>)refreshDelegate;
// Reads raw character data into the terminal character processor. This will
// almost certainly cause updates to the screen buffer.
- (void)readInputStream:(NSData *)data;
// ScreenBuffer methods for obtaining information about the characters
// currently on the screen.
- (void)setScreenSize:(ScreenSize)size;
- (ScreenSize)screenSize;
// The row specified here also includes the scrollback buffer.
- (screen_char_t*)bufferForRow:(int)row;
- (int)numberOfRows;
- (unsigned)scrollbackLines;
- (ScreenPosition)cursorPosition;
- (void)clearScreen;
- (void)clearSelection;
- (BOOL)hasSelection;
- (void)setSelectionStart:(ScreenPosition)point;
- (void)setSelectionEnd:(ScreenPosition)point;
@end