… | |
… | |
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 | ***************************************************************************** |
… | |
… | |
358 | */ |
356 | */ |
359 | enum { |
357 | enum { |
360 | XTerm_name = 0, |
358 | XTerm_name = 0, |
361 | XTerm_iconName = 1, |
359 | XTerm_iconName = 1, |
362 | XTerm_title = 2, |
360 | XTerm_title = 2, |
363 | XTerm_property = 3, /* change X property, not yet implemented */ |
361 | XTerm_property = 3, // change X property, not yet implemented |
364 | XTerm_Color = 4, /* change colors */ |
362 | XTerm_Color = 4, // change colors |
365 | XTerm_Color00 = 10, /* not implemented, CLASH! */ |
363 | XTerm_Color00 = 10, // not implemented, CLASH! |
366 | XTerm_Color01 = 11, /* not implemented */ |
364 | XTerm_Color01 = 11, // not implemented |
367 | XTerm_Color_cursor = 12, /* change actual 'Cursor' color */ |
365 | XTerm_Color_cursor = 12, // change actual 'Cursor' color |
368 | XTerm_Color_pointer = 13, /* change actual 'Pointer' color */ |
366 | XTerm_Color_pointer = 13, // change actual 'Pointer' color |
369 | XTerm_Color04 = 14, /* not implemented */ |
367 | XTerm_Color04 = 14, // not implemented |
370 | XTerm_Color05 = 15, /* not implemented */ |
368 | XTerm_Color05 = 15, // not implemented |
371 | XTerm_Color06 = 16, /* not implemented */ |
369 | XTerm_Color06 = 16, // not implemented |
372 | XTerm_Color_RV = 17, /* change actual 'Highlight' color */ |
370 | XTerm_Color_RV = 17, // change actual 'Highlight' color |
373 | XTerm_logfile = 46, /* not implemented */ |
371 | XTerm_logfile = 46, // not implemented |
374 | XTerm_font = 50, |
372 | XTerm_font = 50, |
375 | |
373 | |
376 | XTerm_konsole30 = 30, /* reserved for konsole */ |
374 | XTerm_konsole30 = 30, // reserved for konsole |
377 | XTerm_konsole31 = 31, /* reserved for konsole */ |
375 | XTerm_konsole31 = 31, // reserved for konsole |
378 | XTerm_emacs51 = 51, /* reserved for emacs shell */ |
376 | XTerm_emacs51 = 51, // reserved for emacs shell |
379 | /* |
377 | /* |
380 | * rxvt extensions of XTerm OSCs: ESC ] Ps;Pt (ST|BEL) |
378 | * rxvt extensions of XTerm OSCs: ESC ] Ps;Pt (ST|BEL) |
381 | */ |
379 | */ |
382 | XTerm_locale = 9, /* change locale */ |
|
|
383 | XTerm_Menu = 10, /* set menu item */ |
380 | XTerm_Menu = 10, // set menu item |
384 | XTerm_Color_BD = 18, /* change actual 'Bold' color */ |
381 | XTerm_Color_BD = 18, // change actual 'Bold' color |
385 | XTerm_Color_UL = 19, /* change actual 'Underline' color */ |
382 | XTerm_Color_UL = 19, // change actual 'Underline' color |
386 | XTerm_Pixmap = 20, /* new bg pixmap */ |
383 | XTerm_Pixmap = 20, // new bg pixmap |
387 | XTerm_restoreFG = 39, /* change default fg color */ |
384 | XTerm_restoreFG = 39, // change default fg color |
388 | XTerm_restoreBG = 49, /* change default bg color */ |
385 | XTerm_restoreBG = 49, // change default bg color |
389 | 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) |
390 | }; |
389 | }; |
391 | |
390 | |
392 | /* Words starting with `Color_' are colours. Others are counts */ |
391 | /* Words starting with `Color_' are colours. Others are counts */ |
393 | /* |
392 | /* |
394 | * The following comment is mostly obsolete since pixcolor_set was expanded: |
393 | * The following comment is mostly obsolete since pixcolor_set was expanded: |
… | |
… | |
831 | operator mbstate_t *() { return &mbs; } |
830 | operator mbstate_t *() { return &mbs; } |
832 | void reset () { MEMSET (&mbs, 0, sizeof (mbs)); } |
831 | void reset () { MEMSET (&mbs, 0, sizeof (mbs)); } |
833 | mbstate () { reset (); } |
832 | mbstate () { reset (); } |
834 | }; |
833 | }; |
835 | |
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 | |
836 | struct rxvt_term : rxvt_vars { |
873 | struct rxvt_term : rxvt_vars { |
837 | struct mbstate mbstate; |
874 | struct mbstate mbstate; |
838 | |
875 | |
839 | unsigned char want_refresh:1, |
876 | unsigned char want_refresh:1, |
840 | #ifdef TRANSPARENT |
877 | #ifdef TRANSPARENT |
841 | want_full_refresh:1, /* awaiting full screen refresh */ |
878 | want_full_refresh:1, /* awaiting full screen refresh */ |
842 | #endif |
879 | #endif |