chiark / gitweb /
*** empty log message ***
[sympathy.git] / src / vt102.h
1 /*
2  * vt102.h:
3  *
4  * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
5  * All rights reserved.
6  *
7  */
8
9 /*
10  * $Id$
11  */
12
13 /*
14  * $Log$
15  * Revision 1.5  2008/02/06 15:53:22  james
16  * *** empty log message ***
17  *
18  * Revision 1.4  2008/02/06 11:30:37  james
19  * *** empty log message ***
20  *
21  * Revision 1.3  2008/02/04 20:23:55  james
22  * *** empty log message ***
23  *
24  * Revision 1.2  2008/02/04 02:05:06  james
25  * *** empty log message ***
26  *
27  * Revision 1.1  2008/02/03 23:36:41  james
28  * *** empty log message ***
29  *
30  */
31
32 #ifndef __VT102_H__
33 #define __VT102_H__
34
35 #define VT102_CSI_LEN 128
36
37 #define VT102_ROWS              24
38 #define VT102_COLS              80
39 #define VT102_STATUS_ROW        24
40
41 #define VT102_NMODES            32
42
43 typedef struct
44 {
45   int in_escape;
46   int in_csi;
47   int csi_ptr;
48   char csi_buf[VT102_CSI_LEN];
49 } VT102_parser;
50
51 typedef struct
52 {
53   CRT_Pos top_margin, bottom_margin;
54   CRT_Pos screen_start, screen_end;
55   VT102_parser parser;
56   int attr;
57   CRT crt;
58
59   int pending_wrap;
60   CRT_Pos pos,current_line;
61   
62
63
64
65   uint8_t modes[VT102_NMODES];
66   uint8_t private_modes[VT102_NMODES];
67
68   uint8_t tabs[VT102_COLS];
69
70 } VT102;
71
72 #define VT102_PRIVATE_MODE_CURSOR_MODE          1
73 #define VT102_PRIVATE_MODE_VT52                 2
74 #define VT102_PRIVATE_MODE_132COLS              3
75 #define VT102_PRIVATE_MODE_SMOOTH_SCROLL        4
76 #define VT102_PRIVATE_MODE_REVERSE_SCREEN       5
77 #define VT102_PRIVATE_MODE_ORIGIN_MODE          6
78 #define VT102_PRIVATE_MODE_AUTO_WRAP            7
79 #define VT102_PRIVATE_MODE_AUTO_REPEAT          8
80
81 #define VT102_MODE_KEYBOARD_DISABLE             2
82 #define VT102_MODE_INSERT                       4
83 #define VT102_PRIVATE_MODE_LOCAL_ECHO_OFF       12
84 #define VT102_MODE_NEWLINE_MODE                 20
85
86 #endif /* __VT102_H__ */