1 | /* |
|
|
2 | * $Id: rxvtlib.h.in,v 1.6 2003/12/17 09:00:35 pcg Exp $ |
|
|
3 | */ |
|
|
4 | |
|
|
5 | #ifndef _RXVTLIB_H_ /* include once only */ |
1 | #ifndef _RXVTLIB_H_ /* include once only */ |
6 | #define _RXVTLIB_H_ |
2 | #define _RXVTLIB_H_ |
7 | |
3 | |
8 | /* |
|
|
9 | * section 1 generated by GNU autoconf for @build@ |
|
|
10 | * this section may be changed as appropriate _before_ building |
|
|
11 | */ |
|
|
12 | /***************************************************************************** |
|
|
13 | * SECTION 1 * |
|
|
14 | *****************************************************************************/ |
|
|
15 | |
|
|
16 | /* |
|
|
17 | * The following line MUST not be changed without also changing |
|
|
18 | * config.h in the main directory before building |
|
|
19 | */ |
|
|
20 | // none anymore |
|
|
21 | |
|
|
22 | /***************************************************************************** |
|
|
23 | * INCLUDES * |
|
|
24 | *****************************************************************************/ |
|
|
25 | |
|
|
26 | #include <stdio.h> |
4 | #include <cstdio> |
27 | #include <ctype.h> |
5 | #include <cctype> |
28 | #include <errno.h> |
6 | #include <cerrno> |
29 | @include_stdarg_h@ |
7 | @include_stdarg_h@ |
30 | @include_stdlib_h@ |
8 | @include_stdlib_h@ |
31 | @include_stdint_h@ |
9 | @include_stdint_h@ |
32 | #include <sys/types.h> |
10 | #include <sys/types.h> |
33 | @include_unistd_h@ |
11 | @include_unistd_h@ |
… | |
… | |
42 | @include_sys_strredir_h@ |
20 | @include_sys_strredir_h@ |
43 | |
21 | |
44 | #include <sys/wait.h> |
22 | #include <sys/wait.h> |
45 | #include <sys/stat.h> |
23 | #include <sys/stat.h> |
46 | |
24 | |
|
|
25 | #include <cwchar> |
|
|
26 | |
47 | extern "C" { |
27 | extern "C" { |
48 | #include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */ |
28 | #include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */ |
49 | } |
29 | } |
50 | |
30 | |
51 | /* |
31 | /* |
… | |
… | |
60 | /* whatever normal size corresponds to a integer pointer */ |
40 | /* whatever normal size corresponds to a integer pointer */ |
61 | @rxvt_intp_define@ |
41 | @rxvt_intp_define@ |
62 | /* whatever normal size corresponds to a unsigned integer pointer */ |
42 | /* whatever normal size corresponds to a unsigned integer pointer */ |
63 | @rxvt_u_intp_define@ |
43 | @rxvt_u_intp_define@ |
64 | |
44 | |
65 | /***************************************************************************** |
|
|
66 | * SECTION 2 * |
|
|
67 | * DO NOT TOUCH ANYTHING BELOW HERE * |
|
|
68 | *****************************************************************************/ |
|
|
69 | |
|
|
70 | struct rxvt_fontset; |
45 | struct rxvt_fontset; |
71 | struct rxvt_color; |
46 | struct rxvt_color; |
72 | struct rxvt_vars; /* defined later on */ |
47 | struct rxvt_vars; /* defined later on */ |
73 | struct rxvt_term; |
48 | struct rxvt_term; |
|
|
49 | struct rxvt_display; |
|
|
50 | struct rxvt_im; |
|
|
51 | struct rxvt_drawable; |
74 | |
52 | |
75 | typedef struct rxvt_term *rxvt_t; |
53 | typedef struct rxvt_term *rxvt_t; |
76 | |
54 | |
77 | extern rxvt_t rxvt_current_term; |
55 | extern rxvt_t rxvt_current_term; |
78 | |
|
|
79 | #define EXPLICIT_CONTEXT 1 |
|
|
80 | |
|
|
81 | #if EXPLICIT_CONTEXT |
|
|
82 | |
|
|
83 | # define pR rxvt_t rxvt_term |
|
|
84 | # define aR rxvt_term |
|
|
85 | # define pR_ pR, |
|
|
86 | # define aR_ aR, |
|
|
87 | |
|
|
88 | # define R rxvt_term |
|
|
89 | |
56 | |
90 | # define SET_R(r) rxvt_current_term = (r) |
57 | # define SET_R(r) rxvt_current_term = (r) |
91 | # define GET_R rxvt_current_term |
58 | # define GET_R rxvt_current_term |
92 | |
59 | |
93 | #else |
|
|
94 | |
|
|
95 | # define pR |
|
|
96 | # define pR_ |
|
|
97 | # define aR |
|
|
98 | # define aR_ |
|
|
99 | |
|
|
100 | # define R rxvt_current_term |
|
|
101 | |
|
|
102 | # define SET_R(r) rxvt_current_term = (r) |
|
|
103 | # define GET_R R |
|
|
104 | |
|
|
105 | #endif |
|
|
106 | |
|
|
107 | #define dR rxvt_t rxvt_term = GET_R |
|
|
108 | |
|
|
109 | #define scrollbar_visible(rxvtvars) ((rxvtvars)->scrollBar.state) |
60 | #define scrollbar_visible() scrollBar.state |
110 | #define menubar_visible(rxvtvars) ((rxvtvars)->menuBar.state) |
61 | #define menubar_visible() menuBar.state |
111 | |
62 | |
112 | typedef struct { |
63 | typedef struct { |
113 | int32_t row; |
64 | int32_t row; |
114 | int32_t col; |
65 | int32_t col; |
115 | } row_col_t; |
66 | } row_col_t; |
116 | |
67 | |
117 | #if UNICODE3 |
68 | #if UNICODE_3 |
118 | typedef uint32_t text_t; |
69 | typedef uint32_t text_t; |
119 | #else |
70 | #else |
120 | typedef uint16_t text_t; // saves lots of memory |
71 | typedef uint16_t text_t; // saves lots of memory |
121 | #endif |
72 | #endif |
122 | typedef uint32_t rend_t; |
73 | typedef uint32_t rend_t; |
… | |
… | |
152 | Window parent[6]; /* parent identifiers - we're parent[0] */ |
103 | Window parent[6]; /* parent identifiers - we're parent[0] */ |
153 | Window vt; /* vt100 window */ |
104 | Window vt; /* vt100 window */ |
154 | GC gc; /* GC for drawing */ |
105 | GC gc; /* GC for drawing */ |
155 | Pixmap pixmap; |
106 | Pixmap pixmap; |
156 | rxvt_fontset *fontset; |
107 | rxvt_fontset *fontset; |
|
|
108 | rxvt_drawable *drawable; |
157 | } TermWin_t; |
109 | } TermWin_t; |
158 | |
110 | |
159 | /* |
111 | /* |
160 | * screen accounting: |
112 | * screen accounting: |
161 | * screen_t elements |
113 | * screen_t elements |
… | |
… | |
207 | SELECTION_CONT, /* continued selection */ |
159 | SELECTION_CONT, /* continued selection */ |
208 | SELECTION_DONE /* selection put in CUT_BUFFER0 */ |
160 | SELECTION_DONE /* selection put in CUT_BUFFER0 */ |
209 | }; |
161 | }; |
210 | |
162 | |
211 | typedef struct { |
163 | typedef struct { |
212 | unsigned char *text; /* selected text */ |
164 | wchar_t *text; /* selected text */ |
213 | uint32_t len; /* length of selected text */ |
165 | uint32_t len; /* length of selected text */ |
214 | short screen; /* screen being used */ |
166 | short screen; /* screen being used */ |
215 | short clicks; /* number of clicks */ |
167 | short clicks; /* number of clicks */ |
216 | selection_op_t op; /* current operation */ |
168 | selection_op_t op; /* current operation */ |
217 | row_col_t beg; /* beginning of selection <= mark */ |
169 | row_col_t beg; /* beginning of selection <= mark */ |
… | |
… | |
247 | #define Opt_meta8 (1LU<<10) |
199 | #define Opt_meta8 (1LU<<10) |
248 | #define Opt_scrollTtyOutput (1LU<<11) |
200 | #define Opt_scrollTtyOutput (1LU<<11) |
249 | #define Opt_scrollTtyKeypress (1LU<<12) |
201 | #define Opt_scrollTtyKeypress (1LU<<12) |
250 | #define Opt_transparent (1LU<<13) |
202 | #define Opt_transparent (1LU<<13) |
251 | #define Opt_transparent_all (1LU<<14) |
203 | #define Opt_transparent_all (1LU<<14) |
252 | #define Opt_mc_hack (1LU<<15) |
204 | #define Opt_15 (1LU<<15) // UNALLOCATED |
253 | #define Opt_tripleclickwords (1LU<<16) |
205 | #define Opt_tripleclickwords (1LU<<16) |
254 | #define Opt_scrollWithBuffer (1LU<<17) |
206 | #define Opt_scrollWithBuffer (1LU<<17) |
255 | #define Opt_jumpScroll (1LU<<18) |
207 | #define Opt_jumpScroll (1LU<<18) |
256 | #define Opt_mouseWheelScrollPage (1LU<<19) |
208 | #define Opt_mouseWheelScrollPage (1LU<<19) |
257 | #define Opt_pointerBlank (1LU<<20) |
209 | #define Opt_pointerBlank (1LU<<20) |
… | |
… | |
266 | /* ------------------------------------------------------------------------- */ |
218 | /* ------------------------------------------------------------------------- */ |
267 | |
219 | |
268 | typedef struct { |
220 | typedef struct { |
269 | short state; |
221 | short state; |
270 | Window win; |
222 | Window win; |
|
|
223 | struct rxvt_drawable *drawable; |
271 | } menuBar_t; |
224 | } menuBar_t; |
272 | |
225 | |
273 | typedef struct { |
226 | typedef struct { |
274 | char state; /* scrollbar state */ |
227 | char state; /* scrollbar state */ |
275 | char init; /* scrollbar has been initialised */ |
228 | char init; /* scrollbar has been initialised */ |
… | |
… | |
278 | short top; /* slider top position */ |
231 | short top; /* slider top position */ |
279 | short bot; /* slider bottom position */ |
232 | short bot; /* slider bottom position */ |
280 | short style; /* style: rxvt, xterm, next */ |
233 | short style; /* style: rxvt, xterm, next */ |
281 | short width; /* scrollbar width */ |
234 | short width; /* scrollbar width */ |
282 | Window win; |
235 | Window win; |
283 | int (*update)(pR_ int, int, int, int); |
236 | int (rxvt_term::*update)(int, int, int, int); |
|
|
237 | |
|
|
238 | void setIdle() { state = 1 ; } |
|
|
239 | void setMotion() { state = 'm'; } |
|
|
240 | void setUp() { state = 'U'; } |
|
|
241 | void setDn() { state = 'D'; } |
284 | } scrollBar_t; |
242 | } scrollBar_t; |
285 | |
243 | |
286 | struct rxvt_vars { |
244 | struct rxvt_vars { |
287 | TermWin_t TermWin; |
245 | TermWin_t TermWin; |
288 | scrollBar_t scrollBar; |
246 | scrollBar_t scrollBar; |
289 | menuBar_t menuBar; |
247 | menuBar_t menuBar; |
290 | Display *Xdisplay; |
|
|
291 | unsigned long Options; |
248 | unsigned long Options; |
292 | XSizeHints szHint; |
249 | XSizeHints szHint; |
293 | Colormap Xcmap; |
250 | rxvt_display *display; |
294 | rxvt_color *PixColors; |
251 | rxvt_color *PixColors; |
295 | short numPixColors; |
252 | short numPixColors; |
296 | Cursor TermWin_cursor; /* cursor for vt window */ |
253 | Cursor TermWin_cursor; /* cursor for vt window */ |
297 | int Xdepth; |
|
|
298 | int sb_shadow; /* scrollbar shadow width */ |
254 | int sb_shadow; /* scrollbar shadow width */ |
299 | int Xfd; /* file descriptor of X server connection */ |
|
|
300 | int cmd_fd; /* pty file descriptor; connected to command */ |
255 | int cmd_fd; /* pty file descriptor; connected to command */ |
301 | int tty_fd; /* tty file descriptor; connected to child */ |
256 | int tty_fd; /* tty file descriptor; connected to child */ |
302 | int numlock_state; |
257 | int numlock_state; |
303 | text_t **drawn_text; /* text drawn on screen (characters) */ |
258 | text_t **drawn_text; /* text drawn on screen (characters) */ |
304 | rend_t **drawn_rend; /* text drawn on screen (rendition) */ |
259 | rend_t **drawn_rend; /* text drawn on screen (rendition) */ |