1 | /* |
|
|
2 | * $Id: rxvt.h,v 1.18 2003/12/18 13:33:03 pcg Exp $ |
|
|
3 | */ |
|
|
4 | |
|
|
5 | #ifndef _RXVT_H_ /* include once only */ |
1 | #ifndef RXVT_H_ /* include once only */ |
6 | #define _RXVT_H_ |
2 | #define RXVT_H_ |
7 | |
3 | |
8 | #include "rxvtlib.h" |
4 | #include "rxvtlib.h" |
9 | |
5 | |
10 | #include "feature.h" |
6 | #include "feature.h" |
11 | |
7 | |
… | |
… | |
318 | enum { |
314 | enum { |
319 | PRIMARY = 0, |
315 | PRIMARY = 0, |
320 | SECONDARY |
316 | SECONDARY |
321 | }; |
317 | }; |
322 | |
318 | |
323 | enum { |
|
|
324 | SBYTE = 0, |
|
|
325 | WBYTE |
|
|
326 | }; |
|
|
327 | |
|
|
328 | |
|
|
329 | #define RS_None 0 /* Normal */ |
319 | #define RS_None 0 /* Normal */ |
330 | |
320 | |
331 | #define RS_fgMask 0x000001FFu /* 512 colors */ |
321 | #define RS_fgMask 0x000001FFu /* 512 colors */ |
332 | #define RS_bgMask 0x0003FE00u /* 512 colors */ |
322 | #define RS_bgMask 0x0003FE00u /* 512 colors */ |
333 | #define RS_Bold 0x00040000u /* bold */ |
323 | #define RS_Bold 0x00040000u /* bold */ |
334 | #define RS_Blink 0x00080000u /* blink */ |
324 | #define RS_Blink 0x00080000u /* blink */ |
335 | #define RS_RVid 0x00100000u /* reverse video */ |
325 | #define RS_RVid 0x00100000u /* reverse video */ |
336 | #define RS_Uline 0x00200000u /* underline */ |
326 | #define RS_Uline 0x00200000u /* underline */ |
337 | |
327 | |
338 | #define RS_wide 0x00400000u /* only multibyte characters */ |
|
|
339 | #define IS_WIDE(r) ((r) & RS_wide) |
|
|
340 | |
|
|
341 | #define RS_fontMask 0xff000000u /* plenty(?) of fonts */ |
328 | #define RS_fontMask 0xffc00000u /* plenty(?) of fonts */ |
342 | #define RS_fontShift 24 |
329 | #define RS_fontShift 22 |
343 | |
330 | |
344 | #define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) |
331 | #define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) |
345 | #define RS_attrMask (RS_baseattrMask|RS_fontMask|RS_wide) |
332 | #define RS_attrMask (RS_baseattrMask|RS_fontMask) |
346 | |
333 | |
347 | #define Sel_none 0 /* Not waiting */ |
334 | #define Sel_none 0 /* Not waiting */ |
348 | #define Sel_normal 0x01 /* normal selection */ |
335 | #define Sel_normal 0x01 /* normal selection */ |
349 | #define Sel_incr 0x02 /* incremental selection */ |
336 | #define Sel_incr 0x02 /* incremental selection */ |
350 | #define Sel_direct 0x00 |
337 | #define Sel_direct 0x00 |
351 | #define Sel_Primary 0x01 |
338 | #define Sel_Primary 0x01 |
352 | #define Sel_Secondary 0x02 |
339 | #define Sel_Secondary 0x02 |
353 | #define Sel_Clipboard 0x03 |
340 | #define Sel_Clipboard 0x03 |
354 | #define Sel_whereMask 0x0f |
341 | #define Sel_whereMask 0x0f |
355 | #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 */ |
356 | |
344 | |
357 | enum { |
345 | enum { |
358 | C0_NUL = 0x00, |
346 | C0_NUL = 0x00, |
359 | 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, |
360 | 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 , |
… | |
… | |
455 | TOTAL_COLORS = NRS_COLORS /* */ |
443 | TOTAL_COLORS = NRS_COLORS /* */ |
456 | #endif |
444 | #endif |
457 | }; |
445 | }; |
458 | |
446 | |
459 | #define Color_Bits 9 |
447 | #define Color_Bits 9 |
460 | #define NPIXCLR_SETS 9 /* (256 + 14) bits / 32 bits */ |
448 | #define NPIXCLR_SETS ((TOTAL_COLORS + 31) / 32) |
461 | #define NPIXCLR_BITS 32 |
449 | #define NPIXCLR_BITS 32 |
462 | |
450 | |
463 | #define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<Color_Bits)) |
451 | #define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<<Color_Bits)) |
464 | |
452 | |
465 | /* |
453 | /* |
466 | * Resource list |
454 | * Resource list |
467 | */ |
455 | */ |
468 | enum { |
456 | enum { |
… | |
… | |
555 | Rs_pointerBlankDelay, |
543 | Rs_pointerBlankDelay, |
556 | Rs_imLocale, |
544 | Rs_imLocale, |
557 | NUM_RESOURCES |
545 | NUM_RESOURCES |
558 | }; |
546 | }; |
559 | |
547 | |
|
|
548 | // see init.C:xa_named, which must be kept in sync |
560 | enum { |
549 | enum { |
|
|
550 | XA_TEXT = 0, |
561 | XA_COMPOUND_TEXT = 0, |
551 | XA_COMPOUND_TEXT, |
|
|
552 | XA_UTF8_STRING, |
562 | XA_MULTIPLE, |
553 | XA_MULTIPLE, |
563 | XA_TARGETS, |
554 | XA_TARGETS, |
564 | XA_TEXT, |
|
|
565 | XA_TIMESTAMP, |
555 | XA_TIMESTAMP, |
566 | XA_VT_SELECTION, |
556 | XA_VT_SELECTION, |
567 | XA_INCR, |
557 | XA_INCR, |
568 | XA_WMDELETEWINDOW, |
558 | XA_WMDELETEWINDOW, |
569 | #ifdef TRANSPARENT |
559 | #ifdef TRANSPARENT |
… | |
… | |
574 | XA_DNDSELECTION, |
564 | XA_DNDSELECTION, |
575 | #endif /* OFFIX_DND */ |
565 | #endif /* OFFIX_DND */ |
576 | XA_CLIPBOARD, |
566 | XA_CLIPBOARD, |
577 | NUM_XA |
567 | NUM_XA |
578 | }; |
568 | }; |
579 | |
|
|
580 | /* |
|
|
581 | * number of graphics points |
|
|
582 | * divisible by 2 (num lines) |
|
|
583 | * divisible by 4 (num rect) |
|
|
584 | */ |
|
|
585 | #define NGRX_PTS 1000 |
|
|
586 | |
569 | |
587 | /* DEC private modes */ |
570 | /* DEC private modes */ |
588 | #define PrivMode_132 (1LU<<0) |
571 | #define PrivMode_132 (1LU<<0) |
589 | #define PrivMode_132OK (1LU<<1) |
572 | #define PrivMode_132OK (1LU<<1) |
590 | #define PrivMode_rVideo (1LU<<2) |
573 | #define PrivMode_rVideo (1LU<<2) |
… | |
… | |
621 | #else |
604 | #else |
622 | # define PrivMode_Default \ |
605 | # define PrivMode_Default \ |
623 | (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
606 | (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) |
624 | #endif |
607 | #endif |
625 | |
608 | |
626 | #ifdef PREFER_24BIT |
|
|
627 | # define XDEPTH R->Xdepth |
609 | #define XDEPTH R->Xdepth |
628 | # define XCMAP R->Xcmap |
610 | #define XCMAP R->Xcmap |
629 | # define XVISUAL R->Xvisual |
611 | #define XVISUAL R->Xvisual |
630 | #else |
612 | |
631 | # ifdef DEBUG_DEPTH |
|
|
632 | # define XDEPTH DEBUG_DEPTH |
|
|
633 | # else |
|
|
634 | # define XDEPTH DefaultDepth(R->Xdisplay,Xscreen) |
|
|
635 | # define XCMAP DefaultColormap(R->Xdisplay,Xscreen) |
|
|
636 | # define XVISUAL DefaultVisual(R->Xdisplay,Xscreen) |
|
|
637 | # endif |
|
|
638 | #endif |
|
|
639 | #define IMBUFSIZ 128 /* input modifier buffer sizes */ |
613 | #define IMBUFSIZ 128 /* input modifier buffer sizes */ |
640 | #ifndef BUFSIZ |
614 | #ifndef BUFSIZ |
641 | # define BUFSIZ 4096 |
615 | # define BUFSIZ 4096 |
642 | #endif |
616 | #endif |
643 | #define KBUFSZ 512 /* size of keyboard mapping buffer */ |
617 | #define KBUFSZ 512 /* size of keyboard mapping buffer */ |
644 | |
618 | |
645 | /* |
619 | /* |
646 | ***************************************************************************** |
620 | ***************************************************************************** |
647 | * MACRO DEFINES |
621 | * MACRO DEFINES |
648 | ***************************************************************************** |
622 | ***************************************************************************** |
… | |
… | |
674 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fheight) |
648 | #define Height2Pixel(n) ((int32_t)(n) * (int32_t)TermWin.fheight) |
675 | |
649 | |
676 | #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) |
677 | #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) |
678 | |
652 | |
679 | #define Xscreen DefaultScreen(R->Xdisplay) |
|
|
680 | #define Xroot DefaultRootWindow(R->Xdisplay) |
653 | #define Xroot DefaultRootWindow(R->Xdisplay) |
681 | |
654 | |
682 | /* how to build & extract colors and attributes */ |
655 | /* how to build & extract colors and attributes */ |
683 | #define GET_BASEFG(x) (((x) & RS_fgMask)) |
656 | #define GET_BASEFG(x) (((x) & RS_fgMask)) |
684 | #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) |
657 | #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) |
… | |
… | |
711 | #define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | (fg)) |
684 | #define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | (fg)) |
712 | #define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg)<<Color_Bits)) |
685 | #define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg)<<Color_Bits)) |
713 | #define SET_ATTR(x,a) (((x) & ~RS_attrMask)| (a)) |
686 | #define SET_ATTR(x,a) (((x) & ~RS_attrMask)| (a)) |
714 | |
687 | |
715 | #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))) |
716 | #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))) |
717 | |
690 | |
718 | #ifdef HAVE_SCROLLBARS |
691 | #ifdef HAVE_SCROLLBARS |
719 | # define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2) |
692 | # define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2) |
720 | #else |
693 | #else |
721 | # define scrollbar_TotalWidth() (0) |
694 | # define scrollbar_TotalWidth() (0) |
… | |
… | |
831 | #ifdef MENUBAR |
804 | #ifdef MENUBAR |
832 | # include "menubar.h" |
805 | # include "menubar.h" |
833 | #endif |
806 | #endif |
834 | |
807 | |
835 | #define BLINK_INTERVAL 0.5 |
808 | #define BLINK_INTERVAL 0.5 |
|
|
809 | #define TEXT_BLINK_INTERVAL 0.5 |
836 | |
810 | |
837 | struct mbstate { |
811 | struct mbstate { |
838 | mbstate_t mbs; |
812 | mbstate_t mbs; |
839 | |
813 | |
840 | mbstate () |
814 | mbstate () |
… | |
… | |
859 | num_scr_allow:1, |
833 | num_scr_allow:1, |
860 | bypass_keystate:1, |
834 | bypass_keystate:1, |
861 | #ifdef CURSOR_BLINK |
835 | #ifdef CURSOR_BLINK |
862 | hidden_cursor:1, |
836 | hidden_cursor:1, |
863 | #endif |
837 | #endif |
|
|
838 | #ifdef TEXT_BLINK |
|
|
839 | hidden_text:1, |
|
|
840 | #endif |
864 | #ifdef POINTER_BLANK |
841 | #ifdef POINTER_BLANK |
865 | hidden_pointer:1, |
842 | hidden_pointer:1, |
866 | #endif |
843 | #endif |
867 | parsed_geometry:1, |
844 | parsed_geometry:1, |
868 | seen_input:1, /* wether any input has been seen so far */ |
845 | seen_input:1, /* wether any input has been seen so far */ |
… | |
… | |
885 | #ifdef GREEK_SUPPORT |
862 | #ifdef GREEK_SUPPORT |
886 | short greek_mode; /* greek keyboard mode */ |
863 | short greek_mode; /* greek keyboard mode */ |
887 | #endif |
864 | #endif |
888 | short rvideo; |
865 | short rvideo; |
889 | int16_t num_scr; /* screen: number lines scrolled */ |
866 | int16_t num_scr; /* screen: number lines scrolled */ |
890 | uint16_t prev_ncol, /* screen: previous number of columns */ |
867 | unsigned int prev_ncol, /* screen: previous number of columns */ |
891 | prev_nrow; /* screen: previous number of rows */ |
868 | prev_nrow; /* screen: previous number of rows */ |
892 | #ifdef RXVT_GRAPHICS |
869 | #ifdef RXVT_GRAPHICS |
893 | uint16_t gr_prev_start; |
870 | uint16_t gr_prev_start; |
894 | #endif |
871 | #endif |
895 | /* ---------- */ |
872 | /* ---------- */ |
… | |
… | |
948 | #endif |
925 | #endif |
949 | ttymode; |
926 | ttymode; |
950 | unsigned long PrivateModes, |
927 | unsigned long PrivateModes, |
951 | SavedModes; |
928 | SavedModes; |
952 | /* ---------- */ |
929 | /* ---------- */ |
953 | #ifdef PREFER_24BIT |
|
|
954 | Visual *Xvisual; |
|
|
955 | #endif |
|
|
956 | /* ---------- */ |
|
|
957 | Atom xa[NUM_XA]; |
930 | Atom xa[NUM_XA]; |
958 | /* ---------- */ |
931 | /* ---------- */ |
959 | #ifdef MENUBAR |
932 | #ifdef MENUBAR |
960 | GC menubarGC; |
933 | GC menubarGC; |
961 | #endif |
934 | #endif |
… | |
… | |
1079 | #endif |
1052 | #endif |
1080 | const char *rs[NUM_RESOURCES]; |
1053 | const char *rs[NUM_RESOURCES]; |
1081 | /* command input buffering */ |
1054 | /* command input buffering */ |
1082 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1055 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1083 | unsigned char cmdbuf_base[BUFSIZ]; |
1056 | unsigned char cmdbuf_base[BUFSIZ]; |
1084 | unsigned char kbuf[KBUFSZ]; |
|
|
1085 | |
1057 | |
1086 | rxvt_salloc *ralloc; |
1058 | rxvt_salloc *ralloc; |
1087 | rxvt_salloc *talloc; |
1059 | rxvt_salloc *talloc; |
1088 | |
1060 | |
1089 | void paste (const unsigned char *data, unsigned int len); |
1061 | void paste (const unsigned char *data, unsigned int len); |
… | |
… | |
1097 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
1069 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
1098 | |
1070 | |
1099 | void incr_cb (time_watcher &w); time_watcher incr_ev; |
1071 | void incr_cb (time_watcher &w); time_watcher incr_ev; |
1100 | |
1072 | |
1101 | #ifdef CURSOR_BLINK |
1073 | #ifdef CURSOR_BLINK |
|
|
1074 | void cursor_blink_cb (time_watcher &w); time_watcher cursor_blink_ev; |
|
|
1075 | #endif |
|
|
1076 | #ifdef TEXT_BLINK |
1102 | void blink_cb (time_watcher &w); time_watcher blink_ev; |
1077 | void text_blink_cb (time_watcher &w); time_watcher text_blink_ev; |
1103 | #endif |
1078 | #endif |
1104 | |
1079 | |
1105 | #ifdef POINTER_BLANK |
1080 | #ifdef POINTER_BLANK |
1106 | void pointer_cb (time_watcher &w); time_watcher pointer_ev; |
1081 | void pointer_cb (time_watcher &w); time_watcher pointer_ev; |
1107 | void pointer_blank (); |
1082 | void pointer_blank (); |
… | |
… | |
1165 | void scr_reset (); |
1140 | void scr_reset (); |
1166 | void scr_reset_realloc (); |
1141 | void scr_reset_realloc (); |
1167 | void scr_release (); |
1142 | void scr_release (); |
1168 | void scr_clear (); |
1143 | void scr_clear (); |
1169 | void scr_refresh (unsigned char refresh_type); |
1144 | void scr_refresh (unsigned char refresh_type); |
|
|
1145 | bool scr_refresh_rend (rend_t mask, rend_t value); |
1170 | void scr_erase_screen (int mode); |
1146 | void scr_erase_screen (int mode); |
1171 | void scr_touch (bool refresh); |
1147 | void scr_touch (bool refresh); |
1172 | void scr_expose (int x, int y, int width, int height, bool refresh); |
1148 | void scr_expose (int x, int y, int width, int height, bool refresh); |
1173 | }; |
1149 | }; |
1174 | |
1150 | |