… | |
… | |
12 | |
12 | |
13 | #include "defaultfont.h" |
13 | #include "defaultfont.h" |
14 | #include "rxvtcolor.h" |
14 | #include "rxvtcolor.h" |
15 | #include "iom.h" |
15 | #include "iom.h" |
16 | #include "salloc.h" |
16 | #include "salloc.h" |
17 | |
|
|
18 | #include <wchar.h> |
|
|
19 | |
17 | |
20 | /* |
18 | /* |
21 | ***************************************************************************** |
19 | ***************************************************************************** |
22 | * SYSTEM HACKS |
20 | * SYSTEM HACKS |
23 | ***************************************************************************** |
21 | ***************************************************************************** |
… | |
… | |
141 | |
139 | |
142 | #if defined (NO_OLD_SELECTION) && defined(NO_NEW_SELECTION) |
140 | #if defined (NO_OLD_SELECTION) && defined(NO_NEW_SELECTION) |
143 | # error if you disable both selection styles, how can you select, silly? |
141 | # error if you disable both selection styles, how can you select, silly? |
144 | #endif |
142 | #endif |
145 | |
143 | |
146 | #define APL_CLASS "XTerm" /* class name */ |
|
|
147 | #define APL_SUBCLASS "Rxvt" /* also check resources under this name */ |
|
|
148 | #define APL_NAME "rxvt" /* normal name */ |
|
|
149 | |
|
|
150 | /* COLORTERM, TERM environment variables */ |
144 | /* COLORTERM, TERM environment variables */ |
151 | #define COLORTERMENV "rxvt" |
145 | #define COLORTERMENV "rxvt" |
152 | #ifdef XPM_BACKGROUND |
146 | #ifdef XPM_BACKGROUND |
153 | # define COLORTERMENVFULL COLORTERMENV "-xpm" |
147 | # define COLORTERMENVFULL COLORTERMENV "-xpm" |
154 | #else |
148 | #else |
155 | # define COLORTERMENVFULL COLORTERMENV |
149 | # define COLORTERMENVFULL COLORTERMENV |
156 | #endif |
150 | #endif |
157 | #ifndef TERMENV |
151 | #ifndef TERMENV |
158 | # define TERMENV "xterm" |
152 | # define TERMENV "rxvt" |
159 | #endif |
153 | #endif |
160 | |
154 | |
161 | #if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR) |
155 | #if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR) |
162 | # define NO_MOUSE_REPORT_SCROLLBAR |
156 | # define NO_MOUSE_REPORT_SCROLLBAR |
163 | #endif |
157 | #endif |
… | |
… | |
362 | */ |
356 | */ |
363 | enum { |
357 | enum { |
364 | XTerm_name = 0, |
358 | XTerm_name = 0, |
365 | XTerm_iconName = 1, |
359 | XTerm_iconName = 1, |
366 | XTerm_title = 2, |
360 | XTerm_title = 2, |
367 | XTerm_property = 3, /* change X property, not yet implemented */ |
361 | XTerm_property = 3, // change X property, not yet implemented |
368 | XTerm_Color = 4, /* change colors */ |
362 | XTerm_Color = 4, // change colors |
369 | XTerm_Color00 = 10, /* not implemented, CLASH! */ |
363 | XTerm_Color00 = 10, // not implemented, CLASH! |
370 | XTerm_Color01 = 11, /* not implemented */ |
364 | XTerm_Color01 = 11, // not implemented |
371 | XTerm_Color_cursor = 12, /* change actual 'Cursor' color */ |
365 | XTerm_Color_cursor = 12, // change actual 'Cursor' color |
372 | XTerm_Color_pointer = 13, /* change actual 'Pointer' color */ |
366 | XTerm_Color_pointer = 13, // change actual 'Pointer' color |
373 | XTerm_Color04 = 14, /* not implemented */ |
367 | XTerm_Color04 = 14, // not implemented |
374 | XTerm_Color05 = 15, /* not implemented */ |
368 | XTerm_Color05 = 15, // not implemented |
375 | XTerm_Color06 = 16, /* not implemented */ |
369 | XTerm_Color06 = 16, // not implemented |
376 | XTerm_Color_RV = 17, /* change actual 'Highlight' color */ |
370 | XTerm_Color_RV = 17, // change actual 'Highlight' color |
377 | XTerm_logfile = 46, /* not implemented */ |
371 | XTerm_logfile = 46, // not implemented |
378 | XTerm_font = 50, |
372 | XTerm_font = 50, |
379 | |
373 | |
380 | XTerm_konsole30 = 30, /* reserved for konsole */ |
374 | XTerm_konsole30 = 30, // reserved for konsole |
381 | XTerm_konsole31 = 31, /* reserved for konsole */ |
375 | XTerm_konsole31 = 31, // reserved for konsole |
382 | XTerm_emacs51 = 51, /* reserved for emacs shell */ |
376 | XTerm_emacs51 = 51, // reserved for emacs shell |
383 | /* |
377 | /* |
384 | * rxvt extensions of XTerm OSCs: ESC ] Ps;Pt (ST|BEL) |
378 | * rxvt extensions of XTerm OSCs: ESC ] Ps;Pt (ST|BEL) |
385 | */ |
379 | */ |
386 | XTerm_locale = 9, /* change locale */ |
|
|
387 | XTerm_Menu = 10, /* set menu item */ |
380 | XTerm_Menu = 10, // set menu item |
388 | XTerm_Color_BD = 18, /* change actual 'Bold' color */ |
381 | XTerm_Color_BD = 18, // change actual 'Bold' color |
389 | XTerm_Color_UL = 19, /* change actual 'Underline' color */ |
382 | XTerm_Color_UL = 19, // change actual 'Underline' color |
390 | XTerm_Pixmap = 20, /* new bg pixmap */ |
383 | XTerm_Pixmap = 20, // new bg pixmap |
391 | XTerm_restoreFG = 39, /* change default fg color */ |
384 | XTerm_restoreFG = 39, // change default fg color |
392 | XTerm_restoreBG = 49, /* change default bg color */ |
385 | XTerm_restoreBG = 49, // change default bg color |
393 | XTerm_dumpscreen = 55, /* dump scrollback and all of screen */ |
386 | XTerm_dumpscreen = 55, // dump scrollback and all of screen |
|
|
387 | XTerm_locale = 701, // change locale |
|
|
388 | XTerm_findfont = 702, // find font of given character (in decimal) |
394 | }; |
389 | }; |
395 | |
390 | |
396 | /* Words starting with `Color_' are colours. Others are counts */ |
391 | /* Words starting with `Color_' are colours. Others are counts */ |
397 | /* |
392 | /* |
398 | * The following comment is mostly obsolete since pixcolor_set was expanded: |
393 | * The following comment is mostly obsolete since pixcolor_set was expanded: |
… | |
… | |
835 | operator mbstate_t *() { return &mbs; } |
830 | operator mbstate_t *() { return &mbs; } |
836 | void reset () { MEMSET (&mbs, 0, sizeof (mbs)); } |
831 | void reset () { MEMSET (&mbs, 0, sizeof (mbs)); } |
837 | mbstate () { reset (); } |
832 | mbstate () { reset (); } |
838 | }; |
833 | }; |
839 | |
834 | |
|
|
835 | #if UNICODE3 |
|
|
836 | # define COMPOSE_LO 0x40000000UL |
|
|
837 | # define COMPOSE_HI 0x400fffffUL |
|
|
838 | # define IS_COMPOSE(n) ((int32_t)(n) >= COMPOSE_LO) |
|
|
839 | #else |
|
|
840 | # define COMPOSE_LO 0xd800UL |
|
|
841 | # define COMPOSE_HI 0xf8ffUL // dfff should be safer, but... |
|
|
842 | # define IS_COMPOSE(n) (COMPOSE_LO <= (n) && (n) <= COMPOSE_HI) |
|
|
843 | #endif |
|
|
844 | |
|
|
845 | #if ENCODING_COMPOSE |
|
|
846 | // compose chars are used to represent composite characters |
|
|
847 | // that are not representable in unicode, as well as characters |
|
|
848 | // not fitting in the BMP. |
|
|
849 | struct compose_char { |
|
|
850 | uint32_t c1, c2; // any chars != NOCHAR are valid |
|
|
851 | compose_char (uint32_t c1, uint32_t c2) |
|
|
852 | : c1(c1), c2(c2) |
|
|
853 | { } |
|
|
854 | }; |
|
|
855 | |
|
|
856 | class rxvt_composite_vec { |
|
|
857 | vector<compose_char> v; |
|
|
858 | public: |
|
|
859 | text_t compose (uint32_t c1, uint32_t c2 = NOCHAR); |
|
|
860 | int expand (uint32_t c, wchar_t *r); |
|
|
861 | compose_char *operator [](text_t c) |
|
|
862 | { |
|
|
863 | return c >= COMPOSE_LO && c < COMPOSE_LO + v.size () |
|
|
864 | ? &v[c - COMPOSE_LO] |
|
|
865 | : 0; |
|
|
866 | } |
|
|
867 | }; |
|
|
868 | |
|
|
869 | extern class rxvt_composite_vec rxvt_composite; |
|
|
870 | #endif |
|
|
871 | |
|
|
872 | |
840 | struct rxvt_term : rxvt_vars { |
873 | struct rxvt_term : rxvt_vars { |
841 | struct mbstate mbstate; |
874 | struct mbstate mbstate; |
842 | |
875 | |
843 | unsigned char want_refresh:1, |
876 | unsigned char want_refresh:1, |
844 | #ifdef TRANSPARENT |
877 | #ifdef TRANSPARENT |
845 | want_full_refresh:1, /* awaiting full screen refresh */ |
878 | want_full_refresh:1, /* awaiting full screen refresh */ |
846 | #endif |
879 | #endif |
… | |
… | |
1159 | void scr_blank_screen_mem (text_t **tp, rend_t **rp, unsigned int row, rend_t efs); |
1192 | void scr_blank_screen_mem (text_t **tp, rend_t **rp, unsigned int row, rend_t efs); |
1160 | int scr_scroll_text (int row1, int row2, int count, int spec); |
1193 | int scr_scroll_text (int row1, int row2, int count, int spec); |
1161 | void scr_reset (); |
1194 | void scr_reset (); |
1162 | void scr_reset_realloc (); |
1195 | void scr_reset_realloc (); |
1163 | void scr_release (); |
1196 | void scr_release (); |
1164 | void scr_clear (); |
1197 | void scr_clear (bool really = true); |
1165 | void scr_refresh (unsigned char refresh_type); |
1198 | void scr_refresh (unsigned char refresh_type); |
1166 | bool scr_refresh_rend (rend_t mask, rend_t value); |
1199 | bool scr_refresh_rend (rend_t mask, rend_t value); |
1167 | void scr_erase_screen (int mode); |
1200 | void scr_erase_screen (int mode); |
1168 | void scr_touch (bool refresh); |
1201 | void scr_touch (bool refresh); |
1169 | void scr_expose (int x, int y, int width, int height, bool refresh); |
1202 | void scr_expose (int x, int y, int width, int height, bool refresh); |