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