… | |
… | |
79 | # include <afterimage.h> |
79 | # include <afterimage.h> |
80 | #undef min |
80 | #undef min |
81 | #undef max |
81 | #undef max |
82 | #endif |
82 | #endif |
83 | |
83 | |
|
|
84 | #include "background.h" |
|
|
85 | |
84 | #ifndef STDIN_FILENO |
86 | #ifndef STDIN_FILENO |
85 | # define STDIN_FILENO 0 |
87 | # define STDIN_FILENO 0 |
86 | # define STDOUT_FILENO 1 |
88 | # define STDOUT_FILENO 1 |
87 | # define STDERR_FILENO 2 |
89 | # define STDERR_FILENO 2 |
88 | #endif |
90 | #endif |
… | |
… | |
99 | ***************************************************************************** |
101 | ***************************************************************************** |
100 | * PROTOTYPES |
102 | * PROTOTYPES |
101 | ***************************************************************************** |
103 | ***************************************************************************** |
102 | */ |
104 | */ |
103 | // main.C |
105 | // main.C |
104 | RETSIGTYPE rxvt_Child_signal (int sig) NOTHROW; |
|
|
105 | RETSIGTYPE rxvt_Exit_signal (int sig) NOTHROW; |
|
|
106 | void rxvt_clean_exit () NOTHROW; |
|
|
107 | void * rxvt_malloc (size_t size); |
106 | void * rxvt_malloc (size_t size); |
108 | void * rxvt_calloc (size_t number, size_t size); |
107 | void * rxvt_calloc (size_t number, size_t size); |
109 | void * rxvt_realloc (void *ptr, size_t size); |
108 | void * rxvt_realloc (void *ptr, size_t size); |
110 | |
109 | |
111 | // misc.C |
110 | // misc.C |
… | |
… | |
114 | char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); |
113 | char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); |
115 | wchar_t * rxvt_utf8towcs (const char *str, int len = -1); |
114 | wchar_t * rxvt_utf8towcs (const char *str, int len = -1); |
116 | |
115 | |
117 | #define rxvt_strdup(s) ((s) ? strdup(s) : 0) |
116 | #define rxvt_strdup(s) ((s) ? strdup(s) : 0) |
118 | |
117 | |
119 | char * rxvt_r_basename (const char *str) NOTHROW; |
118 | char * rxvt_basename (const char *str) NOTHROW; |
120 | void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; |
119 | void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; |
121 | void rxvt_log (const char *fmt,...) NOTHROW; |
120 | void rxvt_log (const char *fmt,...) NOTHROW; |
122 | void rxvt_warn (const char *fmt,...) NOTHROW; |
121 | void rxvt_warn (const char *fmt,...) NOTHROW; |
123 | void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN; |
122 | void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN; |
124 | void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; |
123 | void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; |
125 | |
124 | |
126 | int rxvt_Str_match (const char *s1, const char *s2) NOTHROW; |
|
|
127 | const char * rxvt_Str_skip_space (const char *str) NOTHROW; |
|
|
128 | char * rxvt_Str_trim (char *str) NOTHROW; |
125 | char * rxvt_strtrim (char *str) NOTHROW; |
129 | int rxvt_Str_escaped (char *str) NOTHROW; |
|
|
130 | char ** rxvt_splitcommastring (const char *cs) NOTHROW; |
126 | char ** rxvt_splitcommastring (const char *cs) NOTHROW; |
131 | void rxvt_freecommastring (char **cs) NOTHROW; |
127 | void rxvt_freecommastring (char **cs) NOTHROW; |
132 | |
128 | |
133 | ///////////////////////////////////////////////////////////////////////////// |
129 | ///////////////////////////////////////////////////////////////////////////// |
134 | |
130 | |
135 | // temporarily replace the process environment |
131 | // temporarily replace the process environment |
136 | extern char **environ; |
132 | extern char **environ; |
137 | extern char **rxvt_environ; // the original environ pointer |
133 | extern char **rxvt_environ; // the original environ pointer |
138 | |
134 | |
139 | inline void set_environ (stringvec *envv) |
135 | static inline void set_environ (stringvec *envv) |
140 | { |
136 | { |
141 | #if ENABLE_PERL |
137 | #if ENABLE_PERL |
142 | assert (envv); |
138 | assert (envv); |
143 | #else |
139 | #else |
144 | if (envv) |
140 | if (envv) |
145 | #endif |
141 | #endif |
146 | environ = (char **)envv->begin (); |
142 | environ = (char **)envv->begin (); |
147 | } |
143 | } |
148 | |
144 | |
149 | inline void set_environ (char **envv) |
145 | static inline void set_environ (char **envv) |
150 | { |
146 | { |
151 | #if ENABLE_PERL |
147 | #if ENABLE_PERL |
152 | assert (envv); |
148 | assert (envv); |
153 | #else |
149 | #else |
154 | if (envv) |
150 | if (envv) |
… | |
… | |
168 | */ |
164 | */ |
169 | #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) |
165 | #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) |
170 | # define KEEP_SCROLLCOLOR 1 |
166 | # define KEEP_SCROLLCOLOR 1 |
171 | #else |
167 | #else |
172 | # undef KEEP_SCROLLCOLOR |
168 | # undef KEEP_SCROLLCOLOR |
173 | #endif |
|
|
174 | |
|
|
175 | #ifdef XPM_BACKGROUND |
|
|
176 | typedef struct { |
|
|
177 | short w, h, x, y; |
|
|
178 | bool auto_resize ; |
|
|
179 | Pixmap pixmap; |
|
|
180 | } bgPixmap_t; |
|
|
181 | #endif |
169 | #endif |
182 | |
170 | |
183 | /* |
171 | /* |
184 | * the 'essential' information for reporting Mouse Events |
172 | * the 'essential' information for reporting Mouse Events |
185 | * pared down from XButtonEvent |
173 | * pared down from XButtonEvent |
… | |
… | |
232 | ***************************************************************************** |
220 | ***************************************************************************** |
233 | */ |
221 | */ |
234 | |
222 | |
235 | /* COLORTERM, TERM environment variables */ |
223 | /* COLORTERM, TERM environment variables */ |
236 | #define COLORTERMENV "rxvt" |
224 | #define COLORTERMENV "rxvt" |
237 | #ifdef XPM_BACKGROUND |
225 | #ifdef BG_IMAGE_FROM_FILE |
238 | # define COLORTERMENVFULL COLORTERMENV "-xpm" |
226 | # define COLORTERMENVFULL COLORTERMENV "-xpm" |
239 | #else |
227 | #else |
240 | # define COLORTERMENVFULL COLORTERMENV |
228 | # define COLORTERMENVFULL COLORTERMENV |
241 | #endif |
229 | #endif |
242 | #ifndef TERMENV |
230 | #ifndef TERMENV |
… | |
… | |
559 | #endif |
547 | #endif |
560 | #ifdef KEEP_SCROLLCOLOR |
548 | #ifdef KEEP_SCROLLCOLOR |
561 | Color_scroll, |
549 | Color_scroll, |
562 | Color_trough, |
550 | Color_trough, |
563 | #endif |
551 | #endif |
564 | #if TINTING |
552 | #if ENABLE_TRANSPARENCY |
565 | Color_tint, |
553 | Color_tint, |
566 | #endif |
554 | #endif |
567 | #if OFF_FOCUS_FADING |
555 | #if OFF_FOCUS_FADING |
568 | Color_fade, |
556 | Color_fade, |
569 | #endif |
557 | #endif |
… | |
… | |
614 | #define PrivMode_LFNL (1UL<<19) |
602 | #define PrivMode_LFNL (1UL<<19) |
615 | /* too annoying to implement X11 highlight tracking */ |
603 | /* too annoying to implement X11 highlight tracking */ |
616 | /* #define PrivMode_MouseX11Track (1LU<<20) */ |
604 | /* #define PrivMode_MouseX11Track (1LU<<20) */ |
617 | |
605 | |
618 | #define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11) |
606 | #define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11) |
619 | #define PrivMode(test,bit) \ |
|
|
620 | if (test) \ |
|
|
621 | priv_modes |= (bit); \ |
|
|
622 | else \ |
|
|
623 | priv_modes &= ~(bit) |
|
|
624 | |
607 | |
625 | #ifdef ALLOW_132_MODE |
608 | #ifdef ALLOW_132_MODE |
626 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) |
609 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) |
627 | #else |
610 | #else |
628 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
611 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
… | |
… | |
885 | rxvt_perl_term perl; |
868 | rxvt_perl_term perl; |
886 | #endif |
869 | #endif |
887 | struct mbstate mbstate; // current input multibyte state |
870 | struct mbstate mbstate; // current input multibyte state |
888 | |
871 | |
889 | unsigned char want_refresh:1, |
872 | unsigned char want_refresh:1, |
890 | #ifdef ENABLE_TRANSPARENCY |
|
|
891 | want_full_refresh:1, /* awaiting full screen refresh */ |
|
|
892 | am_transparent:1, /* is a transparent term */ |
|
|
893 | am_pixmap_trans:1, /* transparency w/known root pixmap */ |
|
|
894 | #endif |
|
|
895 | current_screen:1, /* primary or secondary */ |
873 | current_screen:1, /* primary or secondary */ |
896 | num_scr_allow:1, |
874 | num_scr_allow:1, |
897 | bypass_keystate:1, |
875 | bypass_keystate:1, |
898 | #ifdef CURSOR_BLINK |
876 | #ifdef CURSOR_BLINK |
899 | hidden_cursor:1, |
877 | hidden_cursor:1, |
… | |
… | |
994 | char * incr_buf; |
972 | char * incr_buf; |
995 | size_t incr_buf_size, incr_buf_fill; |
973 | size_t incr_buf_size, incr_buf_fill; |
996 | /* ---------- */ |
974 | /* ---------- */ |
997 | Cursor leftptr_cursor; |
975 | Cursor leftptr_cursor; |
998 | /* ---------- */ |
976 | /* ---------- */ |
999 | #ifndef NO_BACKSPACE_KEY |
|
|
1000 | const char *key_backspace; |
|
|
1001 | #endif |
|
|
1002 | #ifndef NO_DELETE_KEY |
|
|
1003 | const char *key_delete; |
|
|
1004 | #endif |
|
|
1005 | struct mouse_event MEvent; |
977 | struct mouse_event MEvent; |
1006 | XComposeStatus compose; |
978 | XComposeStatus compose; |
1007 | ttymode_t tio; |
979 | ttymode_t tio; |
1008 | row_col_t oldcursor; |
980 | row_col_t oldcursor; |
1009 | #ifdef XPM_BACKGROUND |
981 | #ifdef HAVE_BG_PIXMAP |
1010 | bgPixmap_t bgPixmap; |
982 | bgPixmap_t bgPixmap; |
1011 | struct ASVisual *asv; |
983 | #endif |
|
|
984 | #ifdef HAVE_AFTERIMAGE |
|
|
985 | ASVisual *asv; |
1012 | ASImageManager *asimman; |
986 | ASImageManager *asimman; |
1013 | ASImage *original_asim; |
|
|
1014 | struct { unsigned int width, height; } xpmAttr; /* all we need is width/height */ |
|
|
1015 | #endif |
987 | #endif |
1016 | |
988 | |
1017 | #if ENABLE_OVERLAY |
989 | #if ENABLE_OVERLAY |
1018 | int ov_x, ov_y, ov_w, ov_h; // overlay dimensions |
990 | int ov_x, ov_y, ov_w, ov_h; // overlay dimensions |
1019 | text_t **ov_text; |
991 | text_t **ov_text; |
… | |
… | |
1081 | |
1053 | |
1082 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
1054 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
1083 | void rootwin_cb (XEvent &xev); |
1055 | void rootwin_cb (XEvent &xev); |
1084 | xevent_watcher rootwin_ev; |
1056 | xevent_watcher rootwin_ev; |
1085 | #endif |
1057 | #endif |
1086 | #if ENABLE_TRANSPARENCY |
1058 | #ifdef HAVE_BG_PIXMAP |
1087 | int check_our_parents (); |
1059 | int update_background (); |
1088 | void check_our_parents_cb (time_watcher &w); |
1060 | void update_background_cb (time_watcher &w); |
1089 | time_watcher check_our_parents_ev; |
1061 | time_watcher update_background_ev; |
1090 | #endif |
1062 | #endif |
1091 | |
1063 | |
1092 | void x_cb (XEvent &xev); |
1064 | void x_cb (XEvent &xev); |
1093 | void flush (); |
1065 | void flush (); |
1094 | xevent_watcher termwin_ev; |
1066 | xevent_watcher termwin_ev; |
… | |
… | |
1245 | void set_window_color (int idx, const char *color); |
1217 | void set_window_color (int idx, const char *color); |
1246 | void set_colorfgbg (); |
1218 | void set_colorfgbg (); |
1247 | bool set_color (rxvt_color &color, const char *name); |
1219 | bool set_color (rxvt_color &color, const char *name); |
1248 | void alias_color (int dst, int src); |
1220 | void alias_color (int dst, int src); |
1249 | void set_widthheight (unsigned int newwidth, unsigned int newheight); |
1221 | void set_widthheight (unsigned int newwidth, unsigned int newheight); |
|
|
1222 | void get_window_origin (int &x, int &y); |
|
|
1223 | Pixmap get_pixmap_property (int prop_id); |
1250 | |
1224 | |
1251 | // screen.C |
1225 | // screen.C |
1252 | |
1226 | |
1253 | void lalloc (line_t &l) const |
1227 | void lalloc (line_t &l) const |
1254 | { |
1228 | { |
… | |
… | |
1315 | { |
1289 | { |
1316 | if (set) |
1290 | if (set) |
1317 | options[opt >> 3] |= (1 << (opt & 7)); |
1291 | options[opt >> 3] |= (1 << (opt & 7)); |
1318 | else |
1292 | else |
1319 | options[opt >> 3] &= ~(1 << (opt & 7)); |
1293 | options[opt >> 3] &= ~(1 << (opt & 7)); |
|
|
1294 | } |
|
|
1295 | |
|
|
1296 | void PrivMode (int set, unsigned bit) NOTHROW |
|
|
1297 | { |
|
|
1298 | if (set) |
|
|
1299 | priv_modes |= bit; |
|
|
1300 | else |
|
|
1301 | priv_modes &= ~bit; |
1320 | } |
1302 | } |
1321 | |
1303 | |
1322 | void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; |
1304 | void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; |
1323 | void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; |
1305 | void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; |
1324 | int scr_scroll_text (int row1, int row2, int count) NOTHROW; |
1306 | int scr_scroll_text (int row1, int row2, int count) NOTHROW; |
… | |
… | |
1429 | // xdefaults.C |
1411 | // xdefaults.C |
1430 | void get_options (int argc, const char *const *argv); |
1412 | void get_options (int argc, const char *const *argv); |
1431 | int parse_keysym (const char *str, const char *arg); |
1413 | int parse_keysym (const char *str, const char *arg); |
1432 | void get_xdefaults (FILE *stream, const char *name); |
1414 | void get_xdefaults (FILE *stream, const char *name); |
1433 | void extract_resources (); |
1415 | void extract_resources (); |
1434 | // xpm.C |
|
|
1435 | int scale_pixmap (const char *geom); |
|
|
1436 | void resize_pixmap (); |
|
|
1437 | Pixmap set_bgPixmap (const char *file); |
|
|
1438 | }; |
1416 | }; |
1439 | |
1417 | |
1440 | /* |
|
|
1441 | ***************************************************************************** |
|
|
1442 | * PROTOTYPES |
|
|
1443 | ***************************************************************************** |
|
|
1444 | */ |
|
|
1445 | #ifdef PROTOTYPES |
|
|
1446 | # define __PROTO(p) p |
|
|
1447 | #else |
|
|
1448 | # define __PROTO(p) () |
|
|
1449 | #endif |
|
|
1450 | |
|
|
1451 | #endif /* _RXVT_H_ */ |
1418 | #endif /* _RXVT_H_ */ |
1452 | |
1419 | |