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.7  2008/02/06 20:26:58  james
16  * *** empty log message ***
17  *
18  * Revision 1.6  2008/02/06 17:53:28  james
19  * *** empty log message ***
20  *
21  * Revision 1.5  2008/02/06 15:53:22  james
22  * *** empty log message ***
23  *
24  * Revision 1.4  2008/02/06 11:30:37  james
25  * *** empty log message ***
26  *
27  * Revision 1.3  2008/02/04 20:23:55  james
28  * *** empty log message ***
29  *
30  * Revision 1.2  2008/02/04 02:05:06  james
31  * *** empty log message ***
32  *
33  * Revision 1.1  2008/02/03 23:36:41  james
34  * *** empty log message ***
35  *
36  */
37
38 #ifndef __VT102_H__
39 #define __VT102_H__
40
41 #define VT102_CSI_LEN 128
42
43 #define VT102_ROWS              24
44 #define VT102_COLS              80
45 #define VT102_STATUS_ROW        24
46
47 #define VT102_NMODES            32
48
49 typedef struct
50 {
51   int in_escape;
52   int in_csi;
53   int csi_ptr;
54   char csi_buf[VT102_CSI_LEN];
55 } VT102_parser;
56
57 typedef struct
58 {
59   CRT_Pos pos;
60   int attr;
61   int origin_mode;
62 } VT102_State;
63
64
65 typedef struct
66 {
67   CRT_Pos top_margin, bottom_margin;
68   CRT_Pos screen_start, screen_end;
69   VT102_parser parser;
70   int attr;
71   CRT crt;
72
73   int pending_wrap;
74   CRT_Pos pos, current_line;
75
76   VT102_State saved;
77
78   uint8_t modes[VT102_NMODES];
79   uint8_t private_modes[VT102_NMODES];
80
81   uint8_t tabs[VT102_COLS];
82
83   int application_keypad_mode;
84
85   TTY *t;
86
87 } VT102;
88
89 #define VT102_PRIVATE_MODE_CURSOR_MODE          1
90 #define VT102_PRIVATE_MODE_VT52                 2
91 #define VT102_PRIVATE_MODE_132COLS              3
92 #define VT102_PRIVATE_MODE_SMOOTH_SCROLL        4
93 #define VT102_PRIVATE_MODE_REVERSE_SCREEN       5
94 #define VT102_PRIVATE_MODE_ORIGIN_MODE          6
95 #define VT102_PRIVATE_MODE_AUTO_WRAP            7
96 #define VT102_PRIVATE_MODE_AUTO_REPEAT          8
97 #define VT102_PRIVATE_MODE_SHOW_CURSOR          25
98
99 #define VT102_MODE_KEYBOARD_DISABLE             2
100 #define VT102_MODE_INSERT                       4
101 #define VT102_MODE_LOCAL_ECHO_OFF               12
102 #define VT102_MODE_NEWLINE_MODE                 20
103
104 #endif /* __VT102_H__ */