… | |
… | |
314 | enum { |
314 | enum { |
315 | PRIMARY = 0, |
315 | PRIMARY = 0, |
316 | SECONDARY |
316 | SECONDARY |
317 | }; |
317 | }; |
318 | |
318 | |
319 | enum { |
|
|
320 | SBYTE = 0, |
|
|
321 | WBYTE |
|
|
322 | }; |
|
|
323 | |
|
|
324 | |
|
|
325 | #define RS_None 0 /* Normal */ |
319 | #define RS_None 0 /* Normal */ |
326 | |
320 | |
327 | #define RS_fgMask 0x000001FFu /* 512 colors */ |
321 | #define RS_fgMask 0x000001FFu /* 512 colors */ |
328 | #define RS_bgMask 0x0003FE00u /* 512 colors */ |
322 | #define RS_bgMask 0x0003FE00u /* 512 colors */ |
329 | #define RS_Bold 0x00040000u /* bold */ |
323 | #define RS_Bold 0x00040000u /* bold */ |
330 | #define RS_Blink 0x00080000u /* blink */ |
324 | #define RS_Blink 0x00080000u /* blink */ |
331 | #define RS_RVid 0x00100000u /* reverse video */ |
325 | #define RS_RVid 0x00100000u /* reverse video */ |
332 | #define RS_Uline 0x00200000u /* underline */ |
326 | #define RS_Uline 0x00200000u /* underline */ |
333 | |
327 | |
334 | #define RS_wide 0x00400000u /* only multibyte characters */ |
|
|
335 | #define IS_WIDE(r) ((r) & RS_wide) |
|
|
336 | |
|
|
337 | #define RS_fontMask 0xff000000u /* plenty(?) of fonts */ |
328 | #define RS_fontMask 0xffc00000u /* plenty(?) of fonts */ |
338 | #define RS_fontShift 24 |
329 | #define RS_fontShift 22 |
339 | |
330 | |
340 | #define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) |
331 | #define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) |
341 | #define RS_attrMask (RS_baseattrMask|RS_fontMask|RS_wide) |
332 | #define RS_attrMask (RS_baseattrMask|RS_fontMask) |
342 | |
333 | |
343 | #define Sel_none 0 /* Not waiting */ |
334 | #define Sel_none 0 /* Not waiting */ |
344 | #define Sel_normal 0x01 /* normal selection */ |
335 | #define Sel_normal 0x01 /* normal selection */ |
345 | #define Sel_incr 0x02 /* incremental selection */ |
336 | #define Sel_incr 0x02 /* incremental selection */ |
346 | #define Sel_direct 0x00 |
337 | #define Sel_direct 0x00 |
347 | #define Sel_Primary 0x01 |
338 | #define Sel_Primary 0x01 |
348 | #define Sel_Secondary 0x02 |
339 | #define Sel_Secondary 0x02 |
349 | #define Sel_Clipboard 0x03 |
340 | #define Sel_Clipboard 0x03 |
350 | #define Sel_whereMask 0x0f |
341 | #define Sel_whereMask 0x0f |
351 | #define Sel_CompoundText 0x10 /* last request was Compound */ |
342 | #define Sel_CompoundText 0x10 /* last request was COMPOUND_TEXT */ |
|
|
343 | #define Sel_UTF8String 0x20 /* last request was UTF8_STRING */ |
352 | |
344 | |
353 | enum { |
345 | enum { |
354 | C0_NUL = 0x00, |
346 | C0_NUL = 0x00, |
355 | C0_SOH, C0_STX, C0_ETX, C0_EOT, C0_ENQ, C0_ACK, C0_BEL, |
347 | C0_SOH, C0_STX, C0_ETX, C0_EOT, C0_ENQ, C0_ACK, C0_BEL, |
356 | C0_BS , C0_HT , C0_LF , C0_VT , C0_FF , C0_CR , C0_SO , C0_SI , |
348 | C0_BS , C0_HT , C0_LF , C0_VT , C0_FF , C0_CR , C0_SO , C0_SI , |
… | |
… | |
451 | TOTAL_COLORS = NRS_COLORS /* */ |
443 | TOTAL_COLORS = NRS_COLORS /* */ |
452 | #endif |
444 | #endif |
453 | }; |
445 | }; |
454 | |
446 | |
455 | #define Color_Bits 9 |
447 | #define Color_Bits 9 |
456 | #define NPIXCLR_SETS 9 /* (256 + 14) bits / 32 bits */ |
448 | #define NPIXCLR_SETS ((TOTAL_COLORS + 31) / 32) |
457 | #define NPIXCLR_BITS 32 |
449 | #define NPIXCLR_BITS 32 |
458 | |
450 | |
459 | #define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<Color_Bits)) |
451 | #define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<Color_Bits)) |
460 | |
452 | |
461 | /* |
453 | /* |
462 | * Resource list |
454 | * Resource list |
463 | */ |
455 | */ |
464 | enum { |
456 | enum { |
… | |
… | |
551 | Rs_pointerBlankDelay, |
543 | Rs_pointerBlankDelay, |
552 | Rs_imLocale, |
544 | Rs_imLocale, |
553 | NUM_RESOURCES |
545 | NUM_RESOURCES |
554 | }; |
546 | }; |
555 | |
547 | |
|
|
548 | // see init.C:xa_named, which must be kept in sync |
556 | enum { |
549 | enum { |
|
|
550 | XA_TEXT = 0, |
557 | XA_COMPOUND_TEXT = 0, |
551 | XA_COMPOUND_TEXT, |
|
|
552 | XA_UTF8_STRING, |
558 | XA_MULTIPLE, |
553 | XA_MULTIPLE, |
559 | XA_TARGETS, |
554 | XA_TARGETS, |
560 | XA_TEXT, |
|
|
561 | XA_TIMESTAMP, |
555 | XA_TIMESTAMP, |
562 | XA_VT_SELECTION, |
556 | XA_VT_SELECTION, |
563 | XA_INCR, |
557 | XA_INCR, |
564 | XA_WMDELETEWINDOW, |
558 | XA_WMDELETEWINDOW, |
565 | #ifdef TRANSPARENT |
559 | #ifdef TRANSPARENT |
… | |
… | |
570 | XA_DNDSELECTION, |
564 | XA_DNDSELECTION, |
571 | #endif /* OFFIX_DND */ |
565 | #endif /* OFFIX_DND */ |
572 | XA_CLIPBOARD, |
566 | XA_CLIPBOARD, |
573 | NUM_XA |
567 | NUM_XA |
574 | }; |
568 | }; |
575 | |
|
|
576 | /* |
|
|
577 | * number of graphics points |
|
|
578 | * divisible by 2 (num lines) |
|
|
579 | * divisible by 4 (num rect) |
|
|
580 | */ |
|
|
581 | #define NGRX_PTS 1000 |
|
|
582 | |
569 | |
583 | /* DEC private modes */ |
570 | /* DEC private modes */ |
584 | #define PrivMode_132 (1LU<<0) |
571 | #define PrivMode_132 (1LU<<0) |
585 | #define PrivMode_132OK (1LU<<1) |
572 | #define PrivMode_132OK (1LU<<1) |
586 | #define PrivMode_rVideo (1LU<<2) |
573 | #define PrivMode_rVideo (1LU<<2) |
… | |
… | |
617 | #else |
604 | #else |
618 | # define PrivMode_Default \ |
605 | # define PrivMode_Default \ |
619 | (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
606 | (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
620 | #endif |
607 | #endif |
621 | |
608 | |
622 | #ifdef PREFER_24BIT |
|
|
623 | # define XDEPTH R->Xdepth |
609 | #define XDEPTH R->Xdepth |
624 | # define XCMAP R->Xcmap |
610 | #define XCMAP R->Xcmap |
625 | # define XVISUAL R->Xvisual |
611 | #define XVISUAL R->Xvisual |
626 | #else |
612 | |
627 | # ifdef DEBUG_DEPTH |
|
|
628 | # define XDEPTH DEBUG_DEPTH |
|
|
629 | # else |
|
|
630 | # define XDEPTH DefaultDepth(R->Xdisplay,Xscreen) |
|
|
631 | # define XCMAP DefaultColormap(R->Xdisplay,Xscreen) |
|
|
632 | # define XVISUAL DefaultVisual(R->Xdisplay,Xscreen) |
|
|
633 | # endif |
|
|
634 | #endif |
|
|
635 | #define IMBUFSIZ 128 /* input modifier buffer sizes */ |
613 | #define IMBUFSIZ 128 /* input modifier buffer sizes */ |
636 | #ifndef BUFSIZ |
614 | #ifndef BUFSIZ |
637 | # define BUFSIZ 4096 |
615 | # define BUFSIZ 4096 |
638 | #endif |
616 | #endif |
639 | #define KBUFSZ 512 /* size of keyboard mapping buffer */ |
617 | #define KBUFSZ 512 /* size of keyboard mapping buffer */ |
640 | |
618 | |
641 | /* |
619 | /* |
642 | ***************************************************************************** |
620 | ***************************************************************************** |
643 | * MACRO DEFINES |
621 | * MACRO DEFINES |
644 | ***************************************************************************** |
622 | ***************************************************************************** |
… | |
… | |
670 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fheight) |
648 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fheight) |
671 | |
649 | |
672 | #define TermWin_TotalWidth() ((int32_t)TermWin.width + 2 * (int32_t)TermWin.int_bwidth) |
650 | #define TermWin_TotalWidth() ((int32_t)TermWin.width + 2 * (int32_t)TermWin.int_bwidth) |
673 | #define TermWin_TotalHeight() ((int32_t)TermWin.height + 2 * (int32_t)TermWin.int_bwidth) |
651 | #define TermWin_TotalHeight() ((int32_t)TermWin.height + 2 * (int32_t)TermWin.int_bwidth) |
674 | |
652 | |
675 | #define Xscreen DefaultScreen(R->Xdisplay) |
|
|
676 | #define Xroot DefaultRootWindow(R->Xdisplay) |
653 | #define Xroot DefaultRootWindow(R->Xdisplay) |
677 | |
654 | |
678 | /* how to build & extract colors and attributes */ |
655 | /* how to build & extract colors and attributes */ |
679 | #define GET_BASEFG(x) (((x) & RS_fgMask)) |
656 | #define GET_BASEFG(x) (((x) & RS_fgMask)) |
680 | #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) |
657 | #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) |
… | |
… | |
707 | #define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | (fg)) |
684 | #define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | (fg)) |
708 | #define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg)<<Color_Bits)) |
685 | #define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg)<<Color_Bits)) |
709 | #define SET_ATTR(x,a) (((x) & ~RS_attrMask)| (a)) |
686 | #define SET_ATTR(x,a) (((x) & ~RS_attrMask)| (a)) |
710 | |
687 | |
711 | #define SET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS))) |
688 | #define SET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] |= (1 << ((x) % NPIXCLR_BITS))) |
712 | #define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) |
689 | #define ISSET_PIXCOLOR(h, x) ((h)->pixcolor_set[(x) / NPIXCLR_BITS] & (1 << ((x) % NPIXCLR_BITS))) |
713 | |
690 | |
714 | #ifdef HAVE_SCROLLBARS |
691 | #ifdef HAVE_SCROLLBARS |
715 | # define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2) |
692 | # define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2) |
716 | #else |
693 | #else |
717 | # define scrollbar_TotalWidth() (0) |
694 | # define scrollbar_TotalWidth() (0) |
… | |
… | |
827 | #ifdef MENUBAR |
804 | #ifdef MENUBAR |
828 | # include "menubar.h" |
805 | # include "menubar.h" |
829 | #endif |
806 | #endif |
830 | |
807 | |
831 | #define BLINK_INTERVAL 0.5 |
808 | #define BLINK_INTERVAL 0.5 |
|
|
809 | #define TEXT_BLINK_INTERVAL 0.5 |
832 | |
810 | |
833 | struct mbstate { |
811 | struct mbstate { |
834 | mbstate_t mbs; |
812 | mbstate_t mbs; |
835 | |
813 | |
836 | mbstate () |
814 | mbstate () |
… | |
… | |
854 | hate_those_clicks:1, /* a.k.a. keep mark position */ |
832 | hate_those_clicks:1, /* a.k.a. keep mark position */ |
855 | num_scr_allow:1, |
833 | num_scr_allow:1, |
856 | bypass_keystate:1, |
834 | bypass_keystate:1, |
857 | #ifdef CURSOR_BLINK |
835 | #ifdef CURSOR_BLINK |
858 | hidden_cursor:1, |
836 | hidden_cursor:1, |
|
|
837 | #endif |
|
|
838 | #ifdef TEXT_BLINK |
|
|
839 | hidden_text:1, |
859 | #endif |
840 | #endif |
860 | #ifdef POINTER_BLANK |
841 | #ifdef POINTER_BLANK |
861 | hidden_pointer:1, |
842 | hidden_pointer:1, |
862 | #endif |
843 | #endif |
863 | parsed_geometry:1, |
844 | parsed_geometry:1, |
… | |
… | |
917 | fnum, /* logical font number */ |
898 | fnum, /* logical font number */ |
918 | last_bot, /* scrollbar last bottom position */ |
899 | last_bot, /* scrollbar last bottom position */ |
919 | last_top, /* scrollbar last top position */ |
900 | last_top, /* scrollbar last top position */ |
920 | last_state, /* scrollbar last state */ |
901 | last_state, /* scrollbar last state */ |
921 | scrollbar_len, |
902 | scrollbar_len, |
922 | currmaxcol, |
|
|
923 | #ifdef MENUBAR |
903 | #ifdef MENUBAR |
924 | menu_readonly, /* okay to alter menu? */ |
904 | menu_readonly, /* okay to alter menu? */ |
925 | Arrows_x, |
905 | Arrows_x, |
926 | #endif |
906 | #endif |
927 | #if MENUBAR_MAX > 1 |
907 | #if MENUBAR_MAX > 1 |
… | |
… | |
944 | #endif |
924 | #endif |
945 | ttymode; |
925 | ttymode; |
946 | unsigned long PrivateModes, |
926 | unsigned long PrivateModes, |
947 | SavedModes; |
927 | SavedModes; |
948 | /* ---------- */ |
928 | /* ---------- */ |
949 | #ifdef PREFER_24BIT |
|
|
950 | Visual *Xvisual; |
|
|
951 | #endif |
|
|
952 | /* ---------- */ |
|
|
953 | Atom xa[NUM_XA]; |
929 | Atom xa[NUM_XA]; |
954 | /* ---------- */ |
930 | /* ---------- */ |
955 | #ifdef MENUBAR |
931 | #ifdef MENUBAR |
956 | GC menubarGC; |
932 | GC menubarGC; |
957 | #endif |
933 | #endif |
… | |
… | |
1061 | /* these three don't need to be kept but do so to placate some mem checkers */ |
1037 | /* these three don't need to be kept but do so to placate some mem checkers */ |
1062 | char *env_windowid; /* environmental variable WINDOWID */ |
1038 | char *env_windowid; /* environmental variable WINDOWID */ |
1063 | char *env_display; /* environmental variable DISPLAY */ |
1039 | char *env_display; /* environmental variable DISPLAY */ |
1064 | char *env_term; /* environmental variable TERM */ |
1040 | char *env_term; /* environmental variable TERM */ |
1065 | char *env_colorfgbg; |
1041 | char *env_colorfgbg; |
1066 | char *buffer; |
|
|
1067 | char *locale; |
1042 | char *locale; |
1068 | char *codeset; |
1043 | char *codeset; |
1069 | char charsets[4]; |
1044 | char charsets[4]; |
1070 | unsigned char *v_buffer; /* pointer to physical buffer */ |
1045 | unsigned char *v_buffer; /* pointer to physical buffer */ |
1071 | unsigned int v_buflen; /* size of area to write */ |
1046 | unsigned int v_buflen; /* size of area to write */ |
… | |
… | |
1092 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
1067 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
1093 | |
1068 | |
1094 | void incr_cb (time_watcher &w); time_watcher incr_ev; |
1069 | void incr_cb (time_watcher &w); time_watcher incr_ev; |
1095 | |
1070 | |
1096 | #ifdef CURSOR_BLINK |
1071 | #ifdef CURSOR_BLINK |
|
|
1072 | void cursor_blink_cb (time_watcher &w); time_watcher cursor_blink_ev; |
|
|
1073 | #endif |
|
|
1074 | #ifdef TEXT_BLINK |
1097 | void blink_cb (time_watcher &w); time_watcher blink_ev; |
1075 | void text_blink_cb (time_watcher &w); time_watcher text_blink_ev; |
1098 | #endif |
1076 | #endif |
1099 | |
1077 | |
1100 | #ifdef POINTER_BLANK |
1078 | #ifdef POINTER_BLANK |
1101 | void pointer_cb (time_watcher &w); time_watcher pointer_ev; |
1079 | void pointer_cb (time_watcher &w); time_watcher pointer_ev; |
1102 | void pointer_blank (); |
1080 | void pointer_blank (); |
… | |
… | |
1160 | void scr_reset (); |
1138 | void scr_reset (); |
1161 | void scr_reset_realloc (); |
1139 | void scr_reset_realloc (); |
1162 | void scr_release (); |
1140 | void scr_release (); |
1163 | void scr_clear (); |
1141 | void scr_clear (); |
1164 | void scr_refresh (unsigned char refresh_type); |
1142 | void scr_refresh (unsigned char refresh_type); |
|
|
1143 | bool scr_refresh_rend (rend_t mask, rend_t value); |
1165 | void scr_erase_screen (int mode); |
1144 | void scr_erase_screen (int mode); |
1166 | void scr_touch (bool refresh); |
1145 | void scr_touch (bool refresh); |
1167 | void scr_expose (int x, int y, int width, int height, bool refresh); |
1146 | void scr_expose (int x, int y, int width, int height, bool refresh); |
1168 | }; |
1147 | }; |
1169 | |
1148 | |