… | |
… | |
15 | #endif |
15 | #endif |
16 | |
16 | |
17 | #if ENABLE_FRILLS |
17 | #if ENABLE_FRILLS |
18 | # define ENABLE_XEMBED 1 |
18 | # define ENABLE_XEMBED 1 |
19 | # define ENABLE_EWMH 1 |
19 | # define ENABLE_EWMH 1 |
|
|
20 | # define ENABLE_XIM_ONTHESPOT 1 |
20 | # define CURSOR_BLINK 1 |
21 | # define CURSOR_BLINK 1 |
21 | #else |
22 | #else |
22 | # define ENABLE_MINIMAL 1 |
23 | # define ENABLE_MINIMAL 1 |
23 | #endif |
24 | #endif |
24 | |
25 | |
… | |
… | |
169 | extern char **environ; |
170 | extern char **environ; |
170 | extern char **rxvt_environ; // the original environ pointer |
171 | extern char **rxvt_environ; // the original environ pointer |
171 | |
172 | |
172 | inline void set_environ (stringvec *envv) |
173 | inline void set_environ (stringvec *envv) |
173 | { |
174 | { |
|
|
175 | #if ENABLE_PERL |
|
|
176 | assert (envv); |
|
|
177 | #else |
174 | if (envv) |
178 | if (envv) |
|
|
179 | #endif |
175 | environ = (char **)envv->begin (); |
180 | environ = (char **)envv->begin (); |
176 | } |
181 | } |
177 | |
182 | |
178 | inline void set_environ (char **envv) |
183 | inline void set_environ (char **envv) |
179 | { |
184 | { |
|
|
185 | #if ENABLE_PERL |
|
|
186 | assert (envv); |
|
|
187 | #else |
180 | if (envv) |
188 | if (envv) |
|
|
189 | #endif |
181 | environ = envv; |
190 | environ = envv; |
182 | } |
191 | } |
183 | |
192 | |
184 | /* |
193 | /* |
185 | ***************************************************************************** |
194 | ***************************************************************************** |
… | |
… | |
728 | ***************************************************************************** |
737 | ***************************************************************************** |
729 | */ |
738 | */ |
730 | #define dLocal(type,name) type const name = this->name |
739 | #define dLocal(type,name) type const name = this->name |
731 | #define dDisp Display *disp = this->display->display |
740 | #define dDisp Display *disp = this->display->display |
732 | |
741 | |
|
|
742 | // for speed reasons, we assume that all latin1 characters |
|
|
743 | // are single-width (the first unicdoe combining character |
|
|
744 | // is actually 0x300, but ascii is what matters most). |
|
|
745 | #define WCWIDTH(c) ((c) < 0x100 ? 1 : wcwidth (c)) |
|
|
746 | |
733 | /* convert pixel dimensions to row/column values. Everything as int32_t */ |
747 | /* convert pixel dimensions to row/column values. Everything as int32_t */ |
734 | #define Pixel2Col(x) Pixel2Width((int32_t)(x)) |
748 | #define Pixel2Col(x) Pixel2Width((int32_t)(x)) |
735 | #define Pixel2Row(y) Pixel2Height((int32_t)(y)) |
749 | #define Pixel2Row(y) Pixel2Height((int32_t)(y)) |
736 | #define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth) |
750 | #define Pixel2Width(x) ((int32_t)(x) / (int32_t)fwidth) |
737 | #define Pixel2Height(y) ((int32_t)(y) / (int32_t)fheight) |
751 | #define Pixel2Height(y) ((int32_t)(y) / (int32_t)fheight) |
… | |
… | |
813 | |
827 | |
814 | #ifdef XPM_BACKGROUND |
828 | #ifdef XPM_BACKGROUND |
815 | # define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g)) |
829 | # define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g)) |
816 | #else |
830 | #else |
817 | # define XPMClearArea(a, b, c, d, e, f, g) |
831 | # define XPMClearArea(a, b, c, d, e, f, g) |
818 | #endif |
|
|
819 | |
|
|
820 | #ifdef DEBUG_CMD |
|
|
821 | # define D_CMD(x) fprintf x ; fputc('\n', stderr) |
|
|
822 | #else |
|
|
823 | # define D_CMD(x) |
|
|
824 | #endif |
|
|
825 | #ifdef DEBUG_INIT |
|
|
826 | # define D_INIT(x) fprintf x ; fputc('\n', stderr) |
|
|
827 | #else |
|
|
828 | # define D_INIT(x) |
|
|
829 | #endif |
|
|
830 | #ifdef DEBUG_MAIN |
|
|
831 | # define D_MAIN(x) fprintf x ; fputc('\n', stderr) |
|
|
832 | #else |
|
|
833 | # define D_MAIN(x) |
|
|
834 | #endif |
|
|
835 | #ifdef DEBUG_SIZE |
|
|
836 | # define D_SIZE(x) fprintf x ; fputc('\n', stderr) |
|
|
837 | #else |
|
|
838 | # define D_SIZE(x) |
|
|
839 | #endif |
832 | #endif |
840 | |
833 | |
841 | typedef callback1<void, const char *> log_callback; |
834 | typedef callback1<void, const char *> log_callback; |
842 | typedef callback1<int, int> getfd_callback; |
835 | typedef callback1<int, int> getfd_callback; |
843 | |
836 | |
… | |
… | |
1149 | #endif |
1142 | #endif |
1150 | |
1143 | |
1151 | // modifies first argument(!) |
1144 | // modifies first argument(!) |
1152 | void paste (char *data, unsigned int len) NOTHROW; |
1145 | void paste (char *data, unsigned int len) NOTHROW; |
1153 | |
1146 | |
1154 | long vt_emask, vt_emask_perl; |
1147 | long vt_emask, vt_emask_perl, vt_emask_xim; |
1155 | |
1148 | |
1156 | void vt_select_input () const NOTHROW |
1149 | void vt_select_input () const NOTHROW |
1157 | { |
1150 | { |
1158 | XSelectInput (display->display, vt, vt_emask | vt_emask_perl); |
1151 | XSelectInput (display->display, vt, vt_emask | vt_emask_perl | vt_emask_xim); |
1159 | } |
1152 | } |
1160 | |
1153 | |
1161 | #if TRANSPARENT |
1154 | #if TRANSPARENT |
1162 | void rootwin_cb (XEvent &xev); |
1155 | void rootwin_cb (XEvent &xev); |
1163 | xevent_watcher rootwin_ev; |
1156 | xevent_watcher rootwin_ev; |
… | |
… | |
1249 | void create_windows (int argc, const char *const *argv); |
1242 | void create_windows (int argc, const char *const *argv); |
1250 | void resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent); |
1243 | void resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent); |
1251 | void window_calc (unsigned int newwidth, unsigned int newheight); |
1244 | void window_calc (unsigned int newwidth, unsigned int newheight); |
1252 | |
1245 | |
1253 | #if USE_XIM |
1246 | #if USE_XIM |
1254 | rxvt_xim *input_method; |
1247 | rxvt_xim *input_method; |
1255 | XIC Input_Context; |
1248 | XIC Input_Context; |
1256 | XIMStyle input_style; |
1249 | XIMStyle input_style; |
1257 | XPoint spot; // most recently sent spot position |
1250 | XPoint spot; // most recently sent spot position |
1258 | |
1251 | |
1259 | void im_destroy (); |
1252 | void im_destroy (); |
1260 | void im_cb (); im_watcher im_ev; |
1253 | void im_cb (); im_watcher im_ev; |
1261 | void im_set_size (XRectangle &size); |
1254 | void im_set_size (XRectangle &size); |
1262 | void im_set_position (XPoint &pos) NOTHROW; |
1255 | void im_set_position (XPoint &pos) NOTHROW; |
… | |
… | |
1320 | int rXParseAllocColor (rxvt_color * screen_in_out, const char *colour); |
1313 | int rXParseAllocColor (rxvt_color * screen_in_out, const char *colour); |
1321 | void set_widthheight (unsigned int newwidth, unsigned int newheight); |
1314 | void set_widthheight (unsigned int newwidth, unsigned int newheight); |
1322 | |
1315 | |
1323 | // screen.C |
1316 | // screen.C |
1324 | |
1317 | |
1325 | void lalloc (line_t &l) const NOTHROW |
1318 | void lalloc (line_t &l) const |
1326 | { |
1319 | { |
1327 | l.t = (text_t *)talloc->alloc (); |
1320 | l.t = (text_t *)talloc->alloc (); |
1328 | l.r = (rend_t *)ralloc->alloc (); |
1321 | l.r = (rend_t *)ralloc->alloc (); |
1329 | } |
1322 | } |
1330 | |
1323 | |
… | |
… | |
1334 | talloc->free (l.t); |
1327 | talloc->free (l.t); |
1335 | ralloc->free (l.r); |
1328 | ralloc->free (l.r); |
1336 | } |
1329 | } |
1337 | #endif |
1330 | #endif |
1338 | |
1331 | |
1339 | void lresize (line_t &l) const NOTHROW |
1332 | void lresize (line_t &l) const |
1340 | { |
1333 | { |
1341 | if (!l.t) |
1334 | if (!l.t) |
1342 | return; |
1335 | return; |
1343 | |
1336 | |
1344 | l.t = (text_t *)talloc->alloc (l.t, prev_ncol * sizeof (text_t)); |
1337 | l.t = (text_t *)talloc->alloc (l.t, prev_ncol * sizeof (text_t)); |
… | |
… | |
1412 | void scr_remap_chars () NOTHROW; |
1405 | void scr_remap_chars () NOTHROW; |
1413 | void scr_remap_chars (line_t &l) NOTHROW; |
1406 | void scr_remap_chars (line_t &l) NOTHROW; |
1414 | |
1407 | |
1415 | enum cursor_mode { SAVE, RESTORE }; |
1408 | enum cursor_mode { SAVE, RESTORE }; |
1416 | |
1409 | |
1417 | void scr_poweron () NOTHROW; |
1410 | void scr_poweron (); |
1418 | void scr_cursor (cursor_mode mode) NOTHROW; |
1411 | void scr_cursor (cursor_mode mode) NOTHROW; |
1419 | void scr_do_wrap () NOTHROW; |
1412 | void scr_do_wrap () NOTHROW; |
|
|
1413 | void scr_swap_screen () NOTHROW; |
1420 | int scr_change_screen (int scrn) NOTHROW; |
1414 | void scr_change_screen (int scrn); |
1421 | void scr_color (unsigned int color, int fgbg) NOTHROW; |
1415 | void scr_color (unsigned int color, int fgbg) NOTHROW; |
1422 | void scr_rendition (int set, int style) NOTHROW; |
1416 | void scr_rendition (int set, int style) NOTHROW; |
1423 | void scr_add_lines (const wchar_t *str, int len, int minlines = 0) NOTHROW; |
1417 | void scr_add_lines (const wchar_t *str, int len, int minlines = 0) NOTHROW; |
1424 | void scr_backspace () NOTHROW; |
1418 | void scr_backspace () NOTHROW; |
1425 | void scr_tab (int count, bool ht = false) NOTHROW; |
1419 | void scr_tab (int count, bool ht = false) NOTHROW; |
… | |
… | |
1517 | # define __PROTO(p) p |
1511 | # define __PROTO(p) p |
1518 | #else |
1512 | #else |
1519 | # define __PROTO(p) () |
1513 | # define __PROTO(p) () |
1520 | #endif |
1514 | #endif |
1521 | |
1515 | |
1522 | #ifdef DEBUG_malloc |
|
|
1523 | # include "dmalloc.h" /* This comes last */ |
|
|
1524 | #endif |
|
|
1525 | |
|
|
1526 | #endif /* _RXVT_H_ */ |
1516 | #endif /* _RXVT_H_ */ |
1527 | |
1517 | |