ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtlib.h.in
(Generate patch)

Comparing rxvt-unicode/src/rxvtlib.h.in (file contents):
Revision 1.8 by pcg, Mon Jan 19 17:26:43 2004 UTC vs.
Revision 1.16 by pcg, Sat Mar 6 00:05:01 2004 UTC

1/*
2 * $Id: rxvtlib.h.in,v 1.8 2004/01/19 17:26:43 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
47extern "C" { 27extern "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
70struct rxvt_fontset; 45struct rxvt_fontset;
71struct rxvt_color; 46struct rxvt_color;
72struct rxvt_vars; /* defined later on */ 47struct rxvt_vars; /* defined later on */
73struct rxvt_term; 48struct rxvt_term;
49struct rxvt_display;
50struct rxvt_im;
51struct rxvt_drawable;
74 52
75typedef struct rxvt_term *rxvt_t; 53typedef struct rxvt_term *rxvt_t;
76 54
77extern rxvt_t rxvt_current_term; 55extern 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
112typedef struct { 63typedef 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
118typedef uint32_t text_t; 69typedef uint32_t text_t;
119#else 70#else
120typedef uint16_t text_t; // saves lots of memory 71typedef uint16_t text_t; // saves lots of memory
121#endif 72#endif
122typedef uint32_t rend_t; 73typedef 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
211typedef struct { 163typedef 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
268typedef struct { 220typedef 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
273typedef struct { 226typedef 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);
284 237
285 void setIdle() { state = 1 ; } 238 void setIdle() { state = 1 ; }
286 void setMotion() { state = 'm'; } 239 void setMotion() { state = 'm'; }
287 void setUp() { state = 'U'; } 240 void setUp() { state = 'U'; }
288 void setDn() { state = 'D'; } 241 void setDn() { state = 'D'; }
292 TermWin_t TermWin; 245 TermWin_t TermWin;
293 scrollBar_t scrollBar; 246 scrollBar_t scrollBar;
294 menuBar_t menuBar; 247 menuBar_t menuBar;
295 unsigned long Options; 248 unsigned long Options;
296 XSizeHints szHint; 249 XSizeHints szHint;
297 Display *Xdisplay; 250 rxvt_display *display;
298 int Xdepth;
299 int Xscreen;
300 Visual *Xvisual;
301 Colormap Xcmap;
302 rxvt_color *PixColors; 251 rxvt_color *PixColors;
303 short numPixColors; 252 short numPixColors;
304 Cursor TermWin_cursor; /* cursor for vt window */ 253 Cursor TermWin_cursor; /* cursor for vt window */
305 int sb_shadow; /* scrollbar shadow width */ 254 int sb_shadow; /* scrollbar shadow width */
306 int Xfd; /* file descriptor of X server connection */
307 int cmd_fd; /* pty file descriptor; connected to command */ 255 int cmd_fd; /* pty file descriptor; connected to command */
308 int tty_fd; /* tty file descriptor; connected to child */ 256 int tty_fd; /* tty file descriptor; connected to child */
309 int numlock_state; 257 int numlock_state;
310 text_t **drawn_text; /* text drawn on screen (characters) */ 258 text_t **drawn_text; /* text drawn on screen (characters) */
311 rend_t **drawn_rend; /* text drawn on screen (rendition) */ 259 rend_t **drawn_rend; /* text drawn on screen (rendition) */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines