… | |
… | |
21 | |
21 | |
22 | #include <sys/wait.h> |
22 | #include <sys/wait.h> |
23 | #include <sys/stat.h> |
23 | #include <sys/stat.h> |
24 | |
24 | |
25 | #include <cwchar> |
25 | #include <cwchar> |
|
|
26 | |
|
|
27 | #include "ptytty.h" |
26 | |
28 | |
27 | extern "C" { |
29 | extern "C" { |
28 | #include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */ |
30 | #include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */ |
29 | } |
31 | } |
30 | |
32 | |
… | |
… | |
104 | Window vt; /* vt100 window */ |
106 | Window vt; /* vt100 window */ |
105 | GC gc; /* GC for drawing */ |
107 | GC gc; /* GC for drawing */ |
106 | Pixmap pixmap; |
108 | Pixmap pixmap; |
107 | rxvt_fontset *fontset; |
109 | rxvt_fontset *fontset; |
108 | rxvt_drawable *drawable; |
110 | rxvt_drawable *drawable; |
|
|
111 | uint16_t ascii_map[0x7f - 0x20]; // map ascii chars to fonts for speed |
109 | } TermWin_t; |
112 | } TermWin_t; |
110 | |
113 | |
111 | /* |
114 | /* |
112 | * screen accounting: |
115 | * screen accounting: |
113 | * screen_t elements |
116 | * screen_t elements |
… | |
… | |
179 | #define Screen_Autowrap (1<<2) /* auto-wrap flag */ |
182 | #define Screen_Autowrap (1<<2) /* auto-wrap flag */ |
180 | #define Screen_Insert (1<<3) /* insert mode (vs. overstrike) */ |
183 | #define Screen_Insert (1<<3) /* insert mode (vs. overstrike) */ |
181 | #define Screen_WrapNext (1<<4) /* need to wrap for next char? */ |
184 | #define Screen_WrapNext (1<<4) /* need to wrap for next char? */ |
182 | #define Screen_DefaultFlags (Screen_VisibleCursor|Screen_Autowrap) |
185 | #define Screen_DefaultFlags (Screen_VisibleCursor|Screen_Autowrap) |
183 | |
186 | |
184 | /* rxvt_vars.Options */ |
187 | /* rxvt_vars.options */ |
185 | #define Opt_console (1UL<<0) |
188 | #define Opt_console (1UL<<0) |
186 | #define Opt_loginShell (1UL<<1) |
189 | #define Opt_loginShell (1UL<<1) |
187 | #define Opt_iconic (1UL<<2) |
190 | #define Opt_iconic (1UL<<2) |
188 | #define Opt_visualBell (1UL<<3) |
191 | #define Opt_visualBell (1UL<<3) |
189 | #define Opt_mapAlert (1UL<<4) |
192 | #define Opt_mapAlert (1UL<<4) |
… | |
… | |
202 | #define Opt_scrollWithBuffer (1UL<<17) |
205 | #define Opt_scrollWithBuffer (1UL<<17) |
203 | #define Opt_jumpScroll (1UL<<18) |
206 | #define Opt_jumpScroll (1UL<<18) |
204 | #define Opt_mouseWheelScrollPage (1UL<<19) |
207 | #define Opt_mouseWheelScrollPage (1UL<<19) |
205 | #define Opt_pointerBlank (1UL<<20) |
208 | #define Opt_pointerBlank (1UL<<20) |
206 | #define Opt_cursorBlink (1UL<<21) |
209 | #define Opt_cursorBlink (1UL<<21) |
207 | #ifdef NO_FRILLS |
210 | #define Opt_secondaryScreen (1UL<<22) |
208 | # define Opt_insecure 0 |
211 | #define Opt_secondaryScroll (1UL<<23) |
|
|
212 | #if ENABLE_FRILLS |
|
|
213 | # define Opt_insecure (1UL<<24) // insecure esc sequences |
|
|
214 | # define Opt_borderLess (1UL<<25) // mem borderless hints |
209 | #else |
215 | #else |
210 | # define Opt_insecure (1UL<<22) // insecure esc sequences |
216 | # define Opt_insecure 0 |
|
|
217 | # define Opt_borderLess 0 |
211 | #endif |
218 | #endif |
212 | #define Opt_secondaryScreen (1UL<<23) |
|
|
213 | #define Opt_secondaryScroll (1UL<<24) |
|
|
214 | /* place holder used for parsing command-line options */ |
219 | /* place holder used for parsing command-line options */ |
215 | #define Opt_Reverse (1UL<<30) |
220 | #define Opt_Reverse (1UL<<30) |
216 | #define Opt_Boolean (1UL<<31) |
221 | #define Opt_Boolean (1UL<<31) |
217 | |
222 | |
218 | #define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput | \ |
223 | #define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput | \ |
… | |
… | |
246 | |
251 | |
247 | struct rxvt_vars { |
252 | struct rxvt_vars { |
248 | TermWin_t TermWin; |
253 | TermWin_t TermWin; |
249 | scrollBar_t scrollBar; |
254 | scrollBar_t scrollBar; |
250 | menuBar_t menuBar; |
255 | menuBar_t menuBar; |
251 | unsigned long Options; |
256 | unsigned long options; |
252 | XSizeHints szHint; |
257 | XSizeHints szHint; |
253 | rxvt_display *display; |
258 | rxvt_display *display; |
254 | rxvt_color *PixColors; |
259 | rxvt_color *pix_colors; |
255 | rxvt_color *PixColorsFocused; |
260 | rxvt_color *pix_colors_focused; |
256 | #ifdef OFF_FOCUS_FADING |
261 | #ifdef OFF_FOCUS_FADING |
257 | rxvt_color *PixColorsUnFocused; |
262 | rxvt_color *pix_colors_unfocused; |
258 | #endif |
263 | #endif |
259 | short numPixColors; |
264 | short numpix_colors; |
260 | Cursor TermWin_cursor; /* cursor for vt window */ |
265 | Cursor TermWin_cursor; /* cursor for vt window */ |
261 | int sb_shadow; /* scrollbar shadow width */ |
266 | int sb_shadow; /* scrollbar shadow width */ |
262 | int cmd_fd; /* pty file descriptor; connected to command */ |
267 | rxvt_ptytty pty; |
263 | int tty_fd; /* tty file descriptor; connected to child */ |
|
|
264 | int numlock_state; |
268 | int numlock_state; |
265 | text_t **drawn_text; /* text drawn on screen (characters) */ |
269 | text_t **drawn_text; /* text drawn on screen (characters) */ |
266 | rend_t **drawn_rend; /* text drawn on screen (rendition) */ |
270 | rend_t **drawn_rend; /* text drawn on screen (rendition) */ |
267 | text_t **buf_text; |
271 | text_t **buf_text; |
268 | rend_t **buf_rend; |
272 | rend_t **buf_rend; |
… | |
… | |
270 | screen_t screen; |
274 | screen_t screen; |
271 | screen_t swap; |
275 | screen_t swap; |
272 | selection_t selection; |
276 | selection_t selection; |
273 | }; |
277 | }; |
274 | |
278 | |
275 | void rxvt_init_signals (); |
279 | void rxvt_init (); |
276 | rxvt_t rxvt_init (int argc, const char *const *argv); |
|
|
277 | |
280 | |
278 | #endif /* _RXVTLIB_H_ */ |
281 | #endif /* _RXVTLIB_H_ */ |
279 | |
282 | |