1 | /* |
|
|
2 | * $Id: rxvtlib.h.in,v 1.3 2003/11/25 11:52:42 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 | |
|
|
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 | |
3 | |
26 | #include <stdio.h> |
4 | #include <stdio.h> |
27 | #include <ctype.h> |
5 | #include <ctype.h> |
28 | #include <errno.h> |
6 | #include <errno.h> |
29 | @include_stdarg_h@ |
7 | @include_stdarg_h@ |
… | |
… | |
60 | /* whatever normal size corresponds to a integer pointer */ |
38 | /* whatever normal size corresponds to a integer pointer */ |
61 | @rxvt_intp_define@ |
39 | @rxvt_intp_define@ |
62 | /* whatever normal size corresponds to a unsigned integer pointer */ |
40 | /* whatever normal size corresponds to a unsigned integer pointer */ |
63 | @rxvt_u_intp_define@ |
41 | @rxvt_u_intp_define@ |
64 | |
42 | |
65 | /***************************************************************************** |
|
|
66 | * SECTION 2 * |
|
|
67 | * DO NOT TOUCH ANYTHING BELOW HERE * |
|
|
68 | *****************************************************************************/ |
|
|
69 | |
|
|
70 | struct rxvt_fontset; |
43 | struct rxvt_fontset; |
71 | struct rxvt_color; |
44 | struct rxvt_color; |
72 | struct rxvt_vars; /* defined later on */ |
45 | struct rxvt_vars; /* defined later on */ |
73 | struct rxvt_term; |
46 | struct rxvt_term; |
|
|
47 | struct rxvt_display; |
|
|
48 | struct rxvt_im; |
|
|
49 | struct rxvt_drawable; |
74 | |
50 | |
75 | typedef struct rxvt_term *rxvt_t; |
51 | typedef struct rxvt_term *rxvt_t; |
76 | |
52 | |
77 | extern rxvt_t rxvt_current_term; |
53 | 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 | |
54 | |
90 | # define SET_R(r) rxvt_current_term = (r) |
55 | # define SET_R(r) rxvt_current_term = (r) |
91 | # define GET_R rxvt_current_term |
56 | # define GET_R rxvt_current_term |
92 | |
57 | |
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) |
58 | #define scrollbar_visible() scrollBar.state |
110 | #define menubar_visible(rxvtvars) ((rxvtvars)->menuBar.state) |
59 | #define menubar_visible() menuBar.state |
111 | |
60 | |
112 | typedef struct { |
61 | typedef struct { |
113 | int32_t row; |
62 | int32_t row; |
114 | int32_t col; |
63 | int32_t col; |
115 | } row_col_t; |
64 | } row_col_t; |
… | |
… | |
152 | Window parent[6]; /* parent identifiers - we're parent[0] */ |
101 | Window parent[6]; /* parent identifiers - we're parent[0] */ |
153 | Window vt; /* vt100 window */ |
102 | Window vt; /* vt100 window */ |
154 | GC gc; /* GC for drawing */ |
103 | GC gc; /* GC for drawing */ |
155 | Pixmap pixmap; |
104 | Pixmap pixmap; |
156 | rxvt_fontset *fontset; |
105 | rxvt_fontset *fontset; |
|
|
106 | rxvt_drawable *drawable; |
157 | } TermWin_t; |
107 | } TermWin_t; |
158 | |
108 | |
159 | /* |
109 | /* |
160 | * screen accounting: |
110 | * screen accounting: |
161 | * screen_t elements |
111 | * screen_t elements |
… | |
… | |
184 | * scrollback region : we're only here if TermWin.view_start != 0 |
134 | * scrollback region : we're only here if TermWin.view_start != 0 |
185 | * Rows [TermWin.saveLines] ... [TermWin.saveLines + TermWin.nrow - 1] |
135 | * Rows [TermWin.saveLines] ... [TermWin.saveLines + TermWin.nrow - 1] |
186 | * normal `unscrolled' screen region |
136 | * normal `unscrolled' screen region |
187 | */ |
137 | */ |
188 | typedef struct { |
138 | typedef struct { |
|
|
139 | int16_t *tlen; /* length of each text line */ |
189 | text_t **text; /* _all_ the text */ |
140 | text_t **text; /* _all_ the text */ |
190 | int16_t *tlen; /* length of each text line */ |
|
|
191 | rend_t **rend; /* rendition, uses RS_ flags */ |
141 | rend_t **rend; /* rendition, uses RS_ flags */ |
192 | row_col_t cur; /* cursor position on the screen */ |
142 | row_col_t cur; /* cursor position on the screen */ |
193 | uint16_t tscroll; /* top of settable scroll region */ |
143 | uint16_t tscroll; /* top of settable scroll region */ |
194 | uint16_t bscroll; /* bottom of settable scroll region */ |
144 | uint16_t bscroll; /* bottom of settable scroll region */ |
195 | uint16_t charset; /* character set number [0..3] */ |
145 | uint16_t charset; /* character set number [0..3] */ |
… | |
… | |
266 | /* ------------------------------------------------------------------------- */ |
216 | /* ------------------------------------------------------------------------- */ |
267 | |
217 | |
268 | typedef struct { |
218 | typedef struct { |
269 | short state; |
219 | short state; |
270 | Window win; |
220 | Window win; |
|
|
221 | struct rxvt_drawable *drawable; |
271 | } menuBar_t; |
222 | } menuBar_t; |
272 | |
223 | |
273 | typedef struct { |
224 | typedef struct { |
274 | char state; /* scrollbar state */ |
225 | char state; /* scrollbar state */ |
275 | char init; /* scrollbar has been initialised */ |
226 | char init; /* scrollbar has been initialised */ |
… | |
… | |
278 | short top; /* slider top position */ |
229 | short top; /* slider top position */ |
279 | short bot; /* slider bottom position */ |
230 | short bot; /* slider bottom position */ |
280 | short style; /* style: rxvt, xterm, next */ |
231 | short style; /* style: rxvt, xterm, next */ |
281 | short width; /* scrollbar width */ |
232 | short width; /* scrollbar width */ |
282 | Window win; |
233 | Window win; |
283 | int (*update)(pR_ int, int, int, int); |
234 | int (rxvt_term::*update)(int, int, int, int); |
|
|
235 | |
|
|
236 | void setIdle() { state = 1 ; } |
|
|
237 | void setMotion() { state = 'm'; } |
|
|
238 | void setUp() { state = 'U'; } |
|
|
239 | void setDn() { state = 'D'; } |
284 | } scrollBar_t; |
240 | } scrollBar_t; |
285 | |
241 | |
286 | struct rxvt_vars { |
242 | struct rxvt_vars { |
287 | TermWin_t TermWin; |
243 | TermWin_t TermWin; |
288 | scrollBar_t scrollBar; |
244 | scrollBar_t scrollBar; |
289 | menuBar_t menuBar; |
245 | menuBar_t menuBar; |
290 | Display *Xdisplay; |
|
|
291 | unsigned long Options; |
246 | unsigned long Options; |
292 | XSizeHints szHint; |
247 | XSizeHints szHint; |
293 | Colormap Xcmap; |
248 | rxvt_display *display; |
294 | rxvt_color *PixColors; |
249 | rxvt_color *PixColors; |
295 | short numPixColors; |
250 | short numPixColors; |
296 | Cursor TermWin_cursor; /* cursor for vt window */ |
251 | Cursor TermWin_cursor; /* cursor for vt window */ |
297 | int Xdepth; |
|
|
298 | int sb_shadow; /* scrollbar shadow width */ |
252 | 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 */ |
253 | int cmd_fd; /* pty file descriptor; connected to command */ |
301 | int tty_fd; /* tty file descriptor; connected to child */ |
254 | int tty_fd; /* tty file descriptor; connected to child */ |
302 | int num_fds; /* number of file descriptors being used */ |
|
|
303 | int numlock_state; |
255 | int numlock_state; |
304 | text_t **drawn_text; /* text drawn on screen (characters) */ |
256 | text_t **drawn_text; /* text drawn on screen (characters) */ |
305 | rend_t **drawn_rend; /* text drawn on screen (rendition) */ |
257 | rend_t **drawn_rend; /* text drawn on screen (rendition) */ |
306 | text_t **buf_text; |
258 | text_t **buf_text; |
307 | rend_t **buf_rend; |
259 | rend_t **buf_rend; |
… | |
… | |
310 | screen_t swap; |
262 | screen_t swap; |
311 | selection_t selection; |
263 | selection_t selection; |
312 | sstyle_t selection_style; |
264 | sstyle_t selection_style; |
313 | }; |
265 | }; |
314 | |
266 | |
|
|
267 | void rxvt_init_signals (); |
315 | rxvt_t rxvt_init (int argc, const char *const *argv); |
268 | rxvt_t rxvt_init (int argc, const char *const *argv); |
316 | |
269 | |
317 | #endif /* _RXVTLIB_H_ */ |
270 | #endif /* _RXVTLIB_H_ */ |
318 | |
271 | |