… | |
… | |
70 | |
70 | |
71 | #ifndef HAVE_XPOINTER |
71 | #ifndef HAVE_XPOINTER |
72 | typedef char *XPointer; |
72 | typedef char *XPointer; |
73 | #endif |
73 | #endif |
74 | |
74 | |
75 | #ifdef HAVE_TERMIOS_H |
|
|
76 | # include <termios.h> |
75 | #include <termios.h> |
77 | typedef struct termios ttymode_t; |
76 | typedef struct termios ttymode_t; |
78 | #else |
|
|
79 | # include <sgtty.h> |
|
|
80 | typedef struct { |
|
|
81 | struct sgttyb sg; |
|
|
82 | struct tchars tc; |
|
|
83 | struct ltchars lc; |
|
|
84 | int line; |
|
|
85 | int local; |
|
|
86 | } ttymode_t; |
|
|
87 | #endif |
|
|
88 | |
77 | |
89 | #ifdef XPM_BACKGROUND |
78 | #ifdef HAVE_AFTERIMAGE |
90 | # ifdef XPM_INC_X11 |
79 | # include <afterimage.h> |
91 | # include <X11/xpm.h> |
80 | #undef min |
92 | # else |
81 | #undef max |
93 | # include <xpm.h> |
|
|
94 | # endif |
|
|
95 | #endif |
82 | #endif |
96 | |
83 | |
97 | #ifndef STDIN_FILENO |
84 | #ifndef STDIN_FILENO |
98 | # define STDIN_FILENO 0 |
85 | # define STDIN_FILENO 0 |
99 | # define STDOUT_FILENO 1 |
86 | # define STDOUT_FILENO 1 |
… | |
… | |
112 | ***************************************************************************** |
99 | ***************************************************************************** |
113 | * PROTOTYPES |
100 | * PROTOTYPES |
114 | ***************************************************************************** |
101 | ***************************************************************************** |
115 | */ |
102 | */ |
116 | // main.C |
103 | // main.C |
117 | RETSIGTYPE rxvt_Child_signal (int sig) NOTHROW; |
|
|
118 | RETSIGTYPE rxvt_Exit_signal (int sig) NOTHROW; |
|
|
119 | void rxvt_clean_exit () NOTHROW; |
|
|
120 | void * rxvt_malloc (size_t size); |
104 | void * rxvt_malloc (size_t size); |
121 | void * rxvt_calloc (size_t number, size_t size); |
105 | void * rxvt_calloc (size_t number, size_t size); |
122 | void * rxvt_realloc (void *ptr, size_t size); |
106 | void * rxvt_realloc (void *ptr, size_t size); |
123 | |
107 | |
124 | // misc.C |
108 | // misc.C |
125 | char * rxvt_wcstombs (const wchar_t *str, int len = -1); |
109 | char * rxvt_wcstombs (const wchar_t *str, int len = -1); |
126 | wchar_t * rxvt_mbstowcs (const char *str, int len = -1); |
110 | wchar_t * rxvt_mbstowcs (const char *str, int len = -1); |
127 | char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); |
111 | char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); |
128 | wchar_t * rxvt_utf8towcs (const char *str, int len = -1); |
112 | wchar_t * rxvt_utf8towcs (const char *str, int len = -1); |
129 | char * rxvt_strdup_cpp (const char *str); |
|
|
130 | |
113 | |
131 | #define rxvt_strdup(s) ((s) ? strdup(s) : 0) |
114 | #define rxvt_strdup(s) ((s) ? strdup(s) : 0) |
132 | |
115 | |
133 | char * rxvt_r_basename (const char *str) NOTHROW; |
116 | char * rxvt_basename (const char *str) NOTHROW; |
134 | void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; |
117 | void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; |
135 | void rxvt_log (const char *fmt,...) NOTHROW; |
118 | void rxvt_log (const char *fmt,...) NOTHROW; |
136 | void rxvt_warn (const char *fmt,...) NOTHROW; |
119 | void rxvt_warn (const char *fmt,...) NOTHROW; |
137 | void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN; |
120 | void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN; |
138 | void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; |
121 | void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; |
139 | |
122 | |
140 | int rxvt_Str_match (const char *s1, const char *s2) NOTHROW; |
|
|
141 | const char * rxvt_Str_skip_space (const char *str) NOTHROW; |
|
|
142 | char * rxvt_Str_trim (char *str) NOTHROW; |
123 | char * rxvt_strtrim (char *str) NOTHROW; |
143 | int rxvt_Str_escaped (char *str) NOTHROW; |
|
|
144 | char ** rxvt_splitcommastring (const char *cs) NOTHROW; |
124 | char ** rxvt_splitcommastring (const char *cs) NOTHROW; |
145 | void rxvt_freecommastring (char **cs) NOTHROW; |
125 | void rxvt_freecommastring (char **cs) NOTHROW; |
146 | char * rxvt_File_find (const char *file, const char *ext, const char *path) NOTHROW; |
|
|
147 | |
126 | |
148 | ///////////////////////////////////////////////////////////////////////////// |
127 | ///////////////////////////////////////////////////////////////////////////// |
149 | |
128 | |
150 | // temporarily replace the process environment |
129 | // temporarily replace the process environment |
151 | extern char **environ; |
130 | extern char **environ; |
152 | extern char **rxvt_environ; // the original environ pointer |
131 | extern char **rxvt_environ; // the original environ pointer |
153 | |
132 | |
154 | inline void set_environ (stringvec *envv) |
133 | static inline void set_environ (stringvec *envv) |
155 | { |
134 | { |
156 | #if ENABLE_PERL |
135 | #if ENABLE_PERL |
157 | assert (envv); |
136 | assert (envv); |
158 | #else |
137 | #else |
159 | if (envv) |
138 | if (envv) |
160 | #endif |
139 | #endif |
161 | environ = (char **)envv->begin (); |
140 | environ = (char **)envv->begin (); |
162 | } |
141 | } |
163 | |
142 | |
164 | inline void set_environ (char **envv) |
143 | static inline void set_environ (char **envv) |
165 | { |
144 | { |
166 | #if ENABLE_PERL |
145 | #if ENABLE_PERL |
167 | assert (envv); |
146 | assert (envv); |
168 | #else |
147 | #else |
169 | if (envv) |
148 | if (envv) |
… | |
… | |
185 | # define KEEP_SCROLLCOLOR 1 |
164 | # define KEEP_SCROLLCOLOR 1 |
186 | #else |
165 | #else |
187 | # undef KEEP_SCROLLCOLOR |
166 | # undef KEEP_SCROLLCOLOR |
188 | #endif |
167 | #endif |
189 | |
168 | |
|
|
169 | #if defined(XPM_BACKGROUND) || defined(ENABLE_TRANSPARENCY) |
|
|
170 | # define HAVE_BG_PIXMAP 1/* to simplify further usage */ |
|
|
171 | struct bgPixmap_t { |
|
|
172 | |
|
|
173 | enum { |
|
|
174 | geometrySet = (1UL<<0), |
|
|
175 | propScale = (1UL<<1), |
|
|
176 | geometryFlags = (geometrySet|propScale), |
|
|
177 | |
|
|
178 | tintSet = (1UL<<8), |
|
|
179 | tintNeeded = (1UL<<9), |
|
|
180 | tintWholesome = (1UL<<10), |
|
|
181 | tintServerSide = (1UL<<11), |
|
|
182 | tintFlags = (tintSet|tintServerSide|tintNeeded|tintWholesome), |
|
|
183 | blurNeeded = (1UL<<12), |
|
|
184 | blurServerSide = (1UL<<13), /* this don't work yet */ |
|
|
185 | |
|
|
186 | isTransparent = (1UL<<16), |
|
|
187 | isInvalid = (1UL<<17), |
|
|
188 | isVtOrigin = (1UL<<18) /* if set pixmap has origin at corner of |
|
|
189 | vt window instead of parent[0]! */ |
|
|
190 | }; |
|
|
191 | |
|
|
192 | unsigned long flags; |
|
|
193 | |
|
|
194 | enum { |
|
|
195 | transpPmapTiled = (1UL<<0), |
|
|
196 | transpPmapTinted = tintNeeded, |
|
|
197 | transpPmapBlured = blurNeeded, |
|
|
198 | transpTransformations = (tintNeeded|blurNeeded) |
|
|
199 | }; /* this flags are returned by make_transparency_pixmap if called */ |
|
|
200 | |
190 | #ifdef XPM_BACKGROUND |
201 | # ifdef XPM_BACKGROUND |
191 | typedef struct { |
202 | # ifdef HAVE_AFTERIMAGE |
192 | short w, h, x, y; |
203 | ASImage *original_asim; |
|
|
204 | bool render_asim (ASImage *background, ARGB32 background_tint); |
|
|
205 | # endif |
|
|
206 | |
|
|
207 | enum { defaultScale = 100, defaultAlign = 50 }; |
|
|
208 | |
|
|
209 | unsigned int h_scale, v_scale;/* percents of the window size */ |
|
|
210 | int h_align, v_align; /* percents of the window size: |
|
|
211 | 0 - left align, 50 - center, 100 - right */ |
|
|
212 | void unset_geometry () { flags = flags & ~geometryFlags; }; |
|
|
213 | bool set_geometry (const char *geom); |
|
|
214 | void set_defaultGeometry () |
|
|
215 | { |
|
|
216 | h_scale = v_scale = defaultScale; |
|
|
217 | h_align = v_align = defaultAlign; |
|
|
218 | flags |= geometrySet; |
|
|
219 | }; |
|
|
220 | |
|
|
221 | bool set_file (const char *file); |
|
|
222 | # endif /* XPM_BACKGROUND */ |
|
|
223 | |
|
|
224 | rxvt_term *target; |
|
|
225 | bool set_target (rxvt_term *new_target); |
|
|
226 | |
|
|
227 | # ifdef ENABLE_TRANSPARENCY |
|
|
228 | int root_depth; /* obtained when target is set */ |
|
|
229 | Pixmap root_pixmap; /* current root pixmap set */ |
|
|
230 | rxvt_color tint; |
|
|
231 | int shade; |
|
|
232 | int h_blurRadius, v_blurRadius; |
|
|
233 | |
|
|
234 | bool set_transparent (); |
|
|
235 | bool set_blur_radius (const char *geom); |
|
|
236 | bool set_tint (rxvt_color &new_tint); |
|
|
237 | bool unset_tint (); |
|
|
238 | bool set_shade (const char *shade_str); |
|
|
239 | bool set_root_pixmap (); |
|
|
240 | |
|
|
241 | unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */ |
|
|
242 | # endif |
|
|
243 | double invalid_since; |
|
|
244 | |
193 | Pixmap pixmap; |
245 | Pixmap pixmap; |
194 | } bgPixmap_t; |
246 | unsigned int pmap_width, pmap_height; |
|
|
247 | unsigned int pmap_depth; |
|
|
248 | |
|
|
249 | bool window_size_sensitive (); |
|
|
250 | bool window_position_sensitive () { |
|
|
251 | return (flags & isTransparent); |
|
|
252 | }; |
|
|
253 | |
|
|
254 | bool is_parentOrigin () { |
|
|
255 | return !(flags & isVtOrigin); |
|
|
256 | }; |
|
|
257 | |
|
|
258 | bool need_client_side_rendering (); |
|
|
259 | void apply (); |
|
|
260 | bool render (); |
|
|
261 | void invalidate () { |
|
|
262 | if (!(flags & isInvalid)) |
|
|
263 | { |
|
|
264 | flags |= isInvalid; |
|
|
265 | invalid_since = NOW; |
|
|
266 | } |
|
|
267 | }; |
|
|
268 | }; |
|
|
269 | #else |
|
|
270 | # undef HAVE_BG_PIXMAP |
195 | #endif |
271 | #endif |
196 | |
272 | |
197 | /* |
273 | /* |
198 | * the 'essential' information for reporting Mouse Events |
274 | * the 'essential' information for reporting Mouse Events |
199 | * pared down from XButtonEvent |
275 | * pared down from XButtonEvent |
… | |
… | |
520 | * on the unnecessary items, e.g. Color_pointer, but won't bother |
596 | * on the unnecessary items, e.g. Color_pointer, but won't bother |
521 | * until we need to. Also, be aware of usage in pixcolor_set |
597 | * until we need to. Also, be aware of usage in pixcolor_set |
522 | */ |
598 | */ |
523 | |
599 | |
524 | enum colour_list { |
600 | enum colour_list { |
|
|
601 | Color_none = -2, |
|
|
602 | Color_transparent = -1, |
525 | Color_fg = 0, |
603 | Color_fg = 0, |
526 | Color_bg, |
604 | Color_bg, |
527 | minCOLOR, /* 2 */ |
605 | minCOLOR, /* 2 */ |
528 | Color_Black = minCOLOR, |
606 | Color_Black = minCOLOR, |
529 | Color_Red3, |
607 | Color_Red3, |
… | |
… | |
571 | #endif |
649 | #endif |
572 | #ifdef KEEP_SCROLLCOLOR |
650 | #ifdef KEEP_SCROLLCOLOR |
573 | Color_scroll, |
651 | Color_scroll, |
574 | Color_trough, |
652 | Color_trough, |
575 | #endif |
653 | #endif |
576 | #if TINTING |
654 | #if ENABLE_TRANSPARENCY |
577 | Color_tint, |
655 | Color_tint, |
578 | #endif |
656 | #endif |
579 | #if OFF_FOCUS_FADING |
657 | #if OFF_FOCUS_FADING |
580 | Color_fade, |
658 | Color_fade, |
581 | #endif |
659 | #endif |
… | |
… | |
626 | #define PrivMode_LFNL (1UL<<19) |
704 | #define PrivMode_LFNL (1UL<<19) |
627 | /* too annoying to implement X11 highlight tracking */ |
705 | /* too annoying to implement X11 highlight tracking */ |
628 | /* #define PrivMode_MouseX11Track (1LU<<20) */ |
706 | /* #define PrivMode_MouseX11Track (1LU<<20) */ |
629 | |
707 | |
630 | #define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11) |
708 | #define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11) |
631 | #define PrivMode(test,bit) \ |
|
|
632 | if (test) \ |
|
|
633 | priv_modes |= (bit); \ |
|
|
634 | else \ |
|
|
635 | priv_modes &= ~(bit) |
|
|
636 | |
709 | |
637 | #ifdef ALLOW_132_MODE |
710 | #ifdef ALLOW_132_MODE |
638 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) |
711 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) |
639 | #else |
712 | #else |
640 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
713 | # define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
… | |
… | |
682 | * MACRO DEFINES |
755 | * MACRO DEFINES |
683 | ***************************************************************************** |
756 | ***************************************************************************** |
684 | */ |
757 | */ |
685 | #define dLocal(type,name) type const name = this->name |
758 | #define dLocal(type,name) type const name = this->name |
686 | |
759 | |
687 | // for speed reasons, we assume that all latin1 characters |
760 | // for speed reasons, we assume that all codepoints 32 to 126 are |
688 | // are single-width (the first unicode combining character |
761 | // single-width. |
689 | // is actually 0x300, but ascii is what matters most). |
762 | #define WCWIDTH(c) (IN_RANGE_INC (c, 0x20, 0x7e) ? 1 : wcwidth (c)) |
690 | #define WCWIDTH(c) ((c) & ~0xff ? wcwidth (c) : 1) |
|
|
691 | |
763 | |
692 | /* convert pixel dimensions to row/column values. Everything as int32_t */ |
764 | /* convert pixel dimensions to row/column values. Everything as int32_t */ |
693 | #define Pixel2Col(x) Pixel2Width((int32_t)(x)) |
765 | #define Pixel2Col(x) Pixel2Width((int32_t)(x)) |
694 | #define Pixel2Row(y) Pixel2Height((int32_t)(y)) |
766 | #define Pixel2Row(y) Pixel2Height((int32_t)(y)) |
695 | #define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth) |
767 | #define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth) |
… | |
… | |
697 | #define Col2Pixel(col) ((int32_t)Width2Pixel(col)) |
769 | #define Col2Pixel(col) ((int32_t)Width2Pixel(col)) |
698 | #define Row2Pixel(row) ((int32_t)Height2Pixel(row)) |
770 | #define Row2Pixel(row) ((int32_t)Height2Pixel(row)) |
699 | #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) |
771 | #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) |
700 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) |
772 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) |
701 | |
773 | |
702 | #define OPTION(opt) (options & (opt)) |
|
|
703 | #define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \ |
|
|
704 | | Opt_jumpScroll | Opt_secondaryScreen \ |
|
|
705 | | Opt_pastableTabs | Opt_intensityStyles) |
|
|
706 | |
|
|
707 | // for m >= -n, ensure remainder lies between 0..n-1 |
774 | // for m >= -n, ensure remainder lies between 0..n-1 |
708 | #define MOD(m,n) (((m) + (n)) % (n)) |
775 | #define MOD(m,n) (((m) + (n)) % (n)) |
709 | |
776 | |
710 | #define LINENO(n) MOD (term_start + int(n), total_rows) |
777 | #define LINENO(n) MOD (term_start + int(n), total_rows) |
711 | #define ROW(n) row_buf [LINENO (n)] |
778 | #define ROW(n) row_buf [LINENO (n)] |
… | |
… | |
767 | #define scrollbar_above_slider(y) ((y) < scrollBar.top) |
834 | #define scrollbar_above_slider(y) ((y) < scrollBar.top) |
768 | #define scrollbar_below_slider(y) ((y) > scrollBar.bot) |
835 | #define scrollbar_below_slider(y) ((y) > scrollBar.bot) |
769 | #define scrollbar_position(y) ((y) - scrollBar.beg) |
836 | #define scrollbar_position(y) ((y) - scrollBar.beg) |
770 | #define scrollbar_size() (scrollBar.end - scrollBar.beg \ |
837 | #define scrollbar_size() (scrollBar.end - scrollBar.beg \ |
771 | - scrollbar_minheight ()) |
838 | - scrollbar_minheight ()) |
772 | |
|
|
773 | #ifdef XPM_BACKGROUND |
|
|
774 | # define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g)) |
|
|
775 | #else |
|
|
776 | # define XPMClearArea(a, b, c, d, e, f, g) |
|
|
777 | #endif |
|
|
778 | |
839 | |
779 | typedef callback<void (const char *)> log_callback; |
840 | typedef callback<void (const char *)> log_callback; |
780 | typedef callback<int (int)> getfd_callback; |
841 | typedef callback<int (int)> getfd_callback; |
781 | |
842 | |
782 | #define SET_LOCALE(locale) rxvt_set_locale (locale) |
843 | #define SET_LOCALE(locale) rxvt_set_locale (locale) |
… | |
… | |
909 | rxvt_perl_term perl; |
970 | rxvt_perl_term perl; |
910 | #endif |
971 | #endif |
911 | struct mbstate mbstate; // current input multibyte state |
972 | struct mbstate mbstate; // current input multibyte state |
912 | |
973 | |
913 | unsigned char want_refresh:1, |
974 | unsigned char want_refresh:1, |
914 | #ifdef TRANSPARENT |
|
|
915 | want_full_refresh:1, /* awaiting full screen refresh */ |
|
|
916 | #endif |
|
|
917 | #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
|
|
918 | am_transparent:1, /* is a transparent term */ |
|
|
919 | am_pixmap_trans:1, /* transparency w/known root pixmap */ |
|
|
920 | #endif |
|
|
921 | current_screen:1, /* primary or secondary */ |
975 | current_screen:1, /* primary or secondary */ |
922 | num_scr_allow:1, |
976 | num_scr_allow:1, |
923 | bypass_keystate:1, |
977 | bypass_keystate:1, |
924 | #ifdef CURSOR_BLINK |
978 | #ifdef CURSOR_BLINK |
925 | hidden_cursor:1, |
979 | hidden_cursor:1, |
… | |
… | |
965 | /* give proper Scroll behaviour */ |
1019 | /* give proper Scroll behaviour */ |
966 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
1020 | #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) |
967 | mouse_slip_wheel_speed, |
1021 | mouse_slip_wheel_speed, |
968 | #endif |
1022 | #endif |
969 | refresh_count, |
1023 | refresh_count, |
970 | refresh_limit, |
|
|
971 | last_bot, /* scrollbar last bottom position */ |
1024 | last_bot, /* scrollbar last bottom position */ |
972 | last_top, /* scrollbar last top position */ |
1025 | last_top, /* scrollbar last top position */ |
973 | last_state, /* scrollbar last state */ |
1026 | last_state, /* scrollbar last state */ |
974 | scrollbar_len, |
1027 | scrollbar_len, |
975 | window_vt_x, |
1028 | window_vt_x, |
… | |
… | |
1021 | char * incr_buf; |
1074 | char * incr_buf; |
1022 | size_t incr_buf_size, incr_buf_fill; |
1075 | size_t incr_buf_size, incr_buf_fill; |
1023 | /* ---------- */ |
1076 | /* ---------- */ |
1024 | Cursor leftptr_cursor; |
1077 | Cursor leftptr_cursor; |
1025 | /* ---------- */ |
1078 | /* ---------- */ |
1026 | #ifndef NO_BACKSPACE_KEY |
|
|
1027 | const char *key_backspace; |
|
|
1028 | #endif |
|
|
1029 | #ifndef NO_DELETE_KEY |
|
|
1030 | const char *key_delete; |
|
|
1031 | #endif |
|
|
1032 | struct mouse_event MEvent; |
1079 | struct mouse_event MEvent; |
1033 | XComposeStatus compose; |
1080 | XComposeStatus compose; |
1034 | ttymode_t tio; |
1081 | ttymode_t tio; |
1035 | row_col_t oldcursor; |
1082 | row_col_t oldcursor; |
1036 | #ifdef XPM_BACKGROUND |
1083 | #ifdef HAVE_BG_PIXMAP |
1037 | bgPixmap_t bgPixmap; |
1084 | bgPixmap_t bgPixmap; |
1038 | XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ |
1085 | #endif |
|
|
1086 | #ifdef HAVE_AFTERIMAGE |
|
|
1087 | ASVisual *asv; |
|
|
1088 | ASImageManager *asimman; |
1039 | #endif |
1089 | #endif |
1040 | |
1090 | |
1041 | #if ENABLE_OVERLAY |
1091 | #if ENABLE_OVERLAY |
1042 | int ov_x, ov_y, ov_w, ov_h; // overlay dimensions |
1092 | int ov_x, ov_y, ov_w, ov_h; // overlay dimensions |
1043 | text_t **ov_text; |
1093 | text_t **ov_text; |
… | |
… | |
1101 | void vt_select_input () const NOTHROW |
1151 | void vt_select_input () const NOTHROW |
1102 | { |
1152 | { |
1103 | XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim); |
1153 | XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim); |
1104 | } |
1154 | } |
1105 | |
1155 | |
1106 | #if TRANSPARENT || ENABLE_PERL |
1156 | #if ENABLE_TRANSPARENCY || ENABLE_PERL |
1107 | void rootwin_cb (XEvent &xev); |
1157 | void rootwin_cb (XEvent &xev); |
1108 | xevent_watcher rootwin_ev; |
1158 | xevent_watcher rootwin_ev; |
|
|
1159 | #endif |
|
|
1160 | #ifdef HAVE_BG_PIXMAP |
|
|
1161 | int update_background (); |
|
|
1162 | void update_background_cb (time_watcher &w); |
|
|
1163 | time_watcher update_background_ev; |
1109 | #endif |
1164 | #endif |
1110 | |
1165 | |
1111 | void x_cb (XEvent &xev); |
1166 | void x_cb (XEvent &xev); |
1112 | void flush (); |
1167 | void flush (); |
1113 | xevent_watcher termwin_ev; |
1168 | xevent_watcher termwin_ev; |
… | |
… | |
1231 | void button_press (XButtonEvent &ev); |
1286 | void button_press (XButtonEvent &ev); |
1232 | void button_release (XButtonEvent &ev); |
1287 | void button_release (XButtonEvent &ev); |
1233 | void focus_in (); |
1288 | void focus_in (); |
1234 | void focus_out (); |
1289 | void focus_out (); |
1235 | void update_fade_color (unsigned int idx); |
1290 | void update_fade_color (unsigned int idx); |
1236 | int check_our_parents (); |
|
|
1237 | #ifdef PRINTPIPE |
1291 | #ifdef PRINTPIPE |
1238 | FILE *popen_printer (); |
1292 | FILE *popen_printer (); |
1239 | int pclose_printer (FILE *stream); |
1293 | int pclose_printer (FILE *stream); |
1240 | #endif |
1294 | #endif |
1241 | void process_print_pipe (); |
1295 | void process_print_pipe (); |
… | |
… | |
1302 | { |
1356 | { |
1303 | int base = GET_BASEFG (r); |
1357 | int base = GET_BASEFG (r); |
1304 | #ifndef NO_BRIGHTCOLOR |
1358 | #ifndef NO_BRIGHTCOLOR |
1305 | if (r & RS_Bold |
1359 | if (r & RS_Bold |
1306 | # if ENABLE_STYLES |
1360 | # if ENABLE_STYLES |
1307 | && OPTION (Opt_intensityStyles) |
1361 | && option (Opt_intensityStyles) |
1308 | # endif |
1362 | # endif |
1309 | && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) |
1363 | && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) |
1310 | base += minBrightCOLOR - minCOLOR; |
1364 | base += minBrightCOLOR - minCOLOR; |
1311 | #endif |
1365 | #endif |
1312 | return base; |
1366 | return base; |
… | |
… | |
1316 | { |
1370 | { |
1317 | int base = GET_BASEBG (r); |
1371 | int base = GET_BASEBG (r); |
1318 | #ifndef NO_BRIGHTCOLOR |
1372 | #ifndef NO_BRIGHTCOLOR |
1319 | if (r & RS_Blink |
1373 | if (r & RS_Blink |
1320 | # if ENABLE_STYLES |
1374 | # if ENABLE_STYLES |
1321 | && OPTION (Opt_intensityStyles) |
1375 | && option (Opt_intensityStyles) |
1322 | # endif |
1376 | # endif |
1323 | && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) |
1377 | && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) |
1324 | base += minBrightCOLOR - minCOLOR; |
1378 | base += minBrightCOLOR - minCOLOR; |
1325 | #endif |
1379 | #endif |
1326 | return base; |
1380 | return base; |
1327 | } |
1381 | } |
1328 | |
1382 | |
1329 | bool option (uint32_t opt) const NOTHROW |
1383 | bool option (uint8_t opt) const NOTHROW |
1330 | { |
1384 | { |
1331 | return OPTION (opt); |
1385 | return options[opt >> 3] & (1 << (opt & 7)); |
1332 | } |
1386 | } |
1333 | |
1387 | |
1334 | void set_option (uint32_t opt, bool set) NOTHROW |
1388 | void set_option (uint8_t opt, bool set = true) NOTHROW |
1335 | { |
1389 | { |
1336 | if (set) |
1390 | if (set) |
1337 | options |= opt; |
1391 | options[opt >> 3] |= (1 << (opt & 7)); |
1338 | else |
1392 | else |
1339 | options &= ~opt; |
1393 | options[opt >> 3] &= ~(1 << (opt & 7)); |
|
|
1394 | } |
|
|
1395 | |
|
|
1396 | void PrivMode (int set, unsigned bit) NOTHROW |
|
|
1397 | { |
|
|
1398 | if (set) |
|
|
1399 | priv_modes |= bit; |
|
|
1400 | else |
|
|
1401 | priv_modes &= ~bit; |
1340 | } |
1402 | } |
1341 | |
1403 | |
1342 | void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; |
1404 | void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; |
1343 | void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; |
1405 | void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; |
1344 | int scr_scroll_text (int row1, int row2, int count) NOTHROW; |
1406 | int scr_scroll_text (int row1, int row2, int count) NOTHROW; |
… | |
… | |
1450 | void get_options (int argc, const char *const *argv); |
1512 | void get_options (int argc, const char *const *argv); |
1451 | int parse_keysym (const char *str, const char *arg); |
1513 | int parse_keysym (const char *str, const char *arg); |
1452 | void get_xdefaults (FILE *stream, const char *name); |
1514 | void get_xdefaults (FILE *stream, const char *name); |
1453 | void extract_resources (); |
1515 | void extract_resources (); |
1454 | // xpm.C |
1516 | // xpm.C |
1455 | int scale_pixmap (const char *geom); |
1517 | void get_window_origin (int &x, int &y); |
1456 | void resize_pixmap (); |
1518 | Pixmap get_pixmap_property (int prop_id); |
1457 | Pixmap set_bgPixmap (const char *file); |
|
|
1458 | }; |
1519 | }; |
1459 | |
1520 | |
1460 | /* |
|
|
1461 | ***************************************************************************** |
|
|
1462 | * PROTOTYPES |
|
|
1463 | ***************************************************************************** |
|
|
1464 | */ |
|
|
1465 | #ifdef PROTOTYPES |
|
|
1466 | # define __PROTO(p) p |
|
|
1467 | #else |
|
|
1468 | # define __PROTO(p) () |
|
|
1469 | #endif |
|
|
1470 | |
|
|
1471 | #endif /* _RXVT_H_ */ |
1521 | #endif /* _RXVT_H_ */ |
1472 | |
1522 | |