1 | /* |
1 | /* |
2 | * $Id: rxvt.h,v 1.10 2003/12/02 21:49:46 pcg Exp $ |
2 | * $Id: rxvt.h,v 1.17 2003/12/18 07:31:19 pcg Exp $ |
3 | */ |
3 | */ |
4 | |
4 | |
5 | #ifndef _RXVT_H_ /* include once only */ |
5 | #ifndef _RXVT_H_ /* include once only */ |
6 | #define _RXVT_H_ |
6 | #define _RXVT_H_ |
7 | |
7 | |
… | |
… | |
15 | #include <X11/Xatom.h> |
15 | #include <X11/Xatom.h> |
16 | |
16 | |
17 | #include "defaultfont.h" |
17 | #include "defaultfont.h" |
18 | #include "rxvtcolor.h" |
18 | #include "rxvtcolor.h" |
19 | #include "iom.h" |
19 | #include "iom.h" |
|
|
20 | #include "salloc.h" |
|
|
21 | |
|
|
22 | #include <wchar.h> |
20 | |
23 | |
21 | /* |
24 | /* |
22 | ***************************************************************************** |
25 | ***************************************************************************** |
23 | * SYSTEM HACKS |
26 | * SYSTEM HACKS |
24 | ***************************************************************************** |
27 | ***************************************************************************** |
… | |
… | |
480 | Rs_backgroundPixmap, |
483 | Rs_backgroundPixmap, |
481 | #endif |
484 | #endif |
482 | #if (MENUBAR_MAX) |
485 | #if (MENUBAR_MAX) |
483 | Rs_menu, |
486 | Rs_menu, |
484 | #endif |
487 | #endif |
485 | #ifndef NO_BOLDFONT |
|
|
486 | Rs_boldFont, |
|
|
487 | #endif |
|
|
488 | #ifdef GREEK_SUPPORT |
488 | #ifdef GREEK_SUPPORT |
489 | Rs_greek_keyboard, |
489 | Rs_greek_keyboard, |
490 | Rs_greektoggle_key, |
490 | Rs_greektoggle_key, |
491 | #endif |
491 | #endif |
492 | Rs_loginShell, |
492 | Rs_loginShell, |
… | |
… | |
551 | Rs_answerbackstring, |
551 | Rs_answerbackstring, |
552 | Rs_tripleclickwords, |
552 | Rs_tripleclickwords, |
553 | Rs_cursorBlink, |
553 | Rs_cursorBlink, |
554 | Rs_pointerBlank, |
554 | Rs_pointerBlank, |
555 | Rs_pointerBlankDelay, |
555 | Rs_pointerBlankDelay, |
|
|
556 | Rs_imLocale, |
556 | NUM_RESOURCES |
557 | NUM_RESOURCES |
557 | }; |
|
|
558 | |
|
|
559 | enum { |
|
|
560 | TIMEOUT_INCR = 0, |
|
|
561 | NUM_TIMEOUTS |
|
|
562 | }; |
558 | }; |
563 | |
559 | |
564 | enum { |
560 | enum { |
565 | XA_COMPOUND_TEXT = 0, |
561 | XA_COMPOUND_TEXT = 0, |
566 | XA_MULTIPLE, |
562 | XA_MULTIPLE, |
… | |
… | |
728 | #define scrollbar_isUp() (R->scrollBar.state == 'U') |
724 | #define scrollbar_isUp() (R->scrollBar.state == 'U') |
729 | #define scrollbar_isDn() (R->scrollBar.state == 'D') |
725 | #define scrollbar_isDn() (R->scrollBar.state == 'D') |
730 | #define scrollbar_isUpDn() isupper (R->scrollBar.state) |
726 | #define scrollbar_isUpDn() isupper (R->scrollBar.state) |
731 | #define isScrollbarWindow(w) (R->scrollBar.state && (w) == R->scrollBar.win) |
727 | #define isScrollbarWindow(w) (R->scrollBar.state && (w) == R->scrollBar.win) |
732 | |
728 | |
733 | #define scrollbar_setIdle() R->scrollBar.state = 1 |
|
|
734 | #define scrollbar_setMotion() R->scrollBar.state = 'm' |
|
|
735 | #define scrollbar_setUp() R->scrollBar.state = 'U' |
|
|
736 | #define scrollbar_setDn() R->scrollBar.state = 'D' |
|
|
737 | |
|
|
738 | #define scrollbarnext_dnval() (R->scrollBar.end + (R->scrollBar.width + 1)) |
729 | #define scrollbarnext_dnval() (R->scrollBar.end + (R->scrollBar.width + 1)) |
739 | #define scrollbarnext_upButton(y) ((y) > R->scrollBar.end \ |
730 | #define scrollbarnext_upButton(y) ((y) > R->scrollBar.end \ |
740 | && (y) <= scrollbarnext_dnval()) |
731 | && (y) <= scrollbarnext_dnval()) |
741 | #define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval()) |
732 | #define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval()) |
742 | #define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT |
733 | #define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT |
… | |
… | |
773 | |
764 | |
774 | #ifndef STRICT_FONT_CHECKING |
765 | #ifndef STRICT_FONT_CHECKING |
775 | # define rxvt_get_fontwidest(font) ((font)->max_bounds.width) |
766 | # define rxvt_get_fontwidest(font) ((font)->max_bounds.width) |
776 | #endif |
767 | #endif |
777 | |
768 | |
778 | #define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (r, 'P',(x),(y)) |
769 | #define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (R, 'P',(x),(y)) |
779 | #define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (r, 'R',(x),(y)) |
770 | #define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (R, 'R',(x),(y)) |
780 | |
771 | |
781 | #ifdef UTMP_SUPPORT |
772 | #ifdef UTMP_SUPPORT |
782 | # if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) |
773 | # if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) |
783 | # undef HAVE_UTMPX_H |
774 | # undef HAVE_UTMPX_H |
784 | # undef HAVE_STRUCT_UTMPX |
775 | # undef HAVE_STRUCT_UTMPX |
… | |
… | |
842 | #endif |
833 | #endif |
843 | |
834 | |
844 | #define BLINK_INTERVAL 0.5 |
835 | #define BLINK_INTERVAL 0.5 |
845 | |
836 | |
846 | struct mbstate { |
837 | struct mbstate { |
847 | unsigned char orig; |
838 | mbstate_t mbs; |
848 | uint32_t reg; |
|
|
849 | int cnt; |
|
|
850 | |
839 | |
851 | mbstate () |
840 | mbstate () |
852 | { |
841 | { |
853 | cnt = 0; |
842 | MEMSET (&mbs, 0, sizeof (mbs)); |
854 | } |
843 | } |
855 | }; |
844 | }; |
856 | |
845 | |
857 | struct rxvt_term : rxvt_vars { |
846 | struct rxvt_term : rxvt_vars { |
858 | struct mbstate mbstate; |
847 | struct mbstate mbstate; |
… | |
… | |
874 | #endif |
863 | #endif |
875 | #ifdef POINTER_BLANK |
864 | #ifdef POINTER_BLANK |
876 | hidden_pointer:1, |
865 | hidden_pointer:1, |
877 | #endif |
866 | #endif |
878 | parsed_geometry:1, |
867 | parsed_geometry:1, |
879 | seen_input:1; /* wether any input has been seen so far */ |
868 | seen_input:1, /* wether any input has been seen so far */ |
|
|
869 | enc_utf8:1; /* wether terminal reads/writes utf-8 */ |
880 | |
870 | |
881 | unsigned char refresh_type, |
871 | unsigned char refresh_type, |
882 | #ifdef UTMP_SUPPORT |
872 | #ifdef UTMP_SUPPORT |
883 | next_utmp_action, |
873 | next_utmp_action, |
884 | #endif |
874 | #endif |
… | |
… | |
895 | #ifdef GREEK_SUPPORT |
885 | #ifdef GREEK_SUPPORT |
896 | short greek_mode; /* greek keyboard mode */ |
886 | short greek_mode; /* greek keyboard mode */ |
897 | #endif |
887 | #endif |
898 | short rvideo; |
888 | short rvideo; |
899 | int16_t num_scr; /* screen: number lines scrolled */ |
889 | int16_t num_scr; /* screen: number lines scrolled */ |
900 | uint16_t prev_ncol, /* screen: previous number of columns */ |
890 | uint16_t prev_ncol, /* screen: previous number of columns */ |
901 | prev_nrow; /* screen: previous number of rows */ |
891 | prev_nrow; /* screen: previous number of rows */ |
902 | #ifdef RXVT_GRAPHICS |
892 | #ifdef RXVT_GRAPHICS |
903 | uint16_t gr_prev_start; |
893 | uint16_t gr_prev_start; |
904 | #endif |
894 | #endif |
905 | /* ---------- */ |
895 | /* ---------- */ |
906 | rend_t rstyle; |
896 | rend_t rstyle; |
907 | /* ---------- */ |
897 | /* ---------- */ |
908 | uint32_t pixcolor_set[NPIXCLR_SETS]; |
898 | uint32_t pixcolor_set[NPIXCLR_SETS]; |
909 | /* ---------- */ |
899 | /* ---------- */ |
910 | #ifdef SELECTION_SCROLLING |
900 | #ifdef SELECTION_SCROLLING |
911 | int scroll_selection_delay, |
901 | int scroll_selection_delay, |
912 | scroll_selection_lines; |
902 | scroll_selection_lines; |
913 | enum page_dirn scroll_selection_dir; |
903 | enum page_dirn scroll_selection_dir; |
… | |
… | |
1069 | struct timeval lastcursorchange; |
1059 | struct timeval lastcursorchange; |
1070 | #endif |
1060 | #endif |
1071 | #ifdef POINTER_BLANK |
1061 | #ifdef POINTER_BLANK |
1072 | struct timeval lastmotion; |
1062 | struct timeval lastmotion; |
1073 | #endif |
1063 | #endif |
1074 | struct timeval timeout[NUM_TIMEOUTS]; |
|
|
1075 | |
1064 | |
1076 | /* these three don't need to be kept but do so to placate some mem checkers */ |
1065 | /* these three don't need to be kept but do so to placate some mem checkers */ |
1077 | char *env_windowid; /* environmental variable WINDOWID */ |
1066 | char *env_windowid; /* environmental variable WINDOWID */ |
1078 | char *env_display; /* environmental variable DISPLAY */ |
1067 | char *env_display; /* environmental variable DISPLAY */ |
1079 | char *env_term; /* environmental variable TERM */ |
1068 | char *env_term; /* environmental variable TERM */ |
1080 | char *env_colorfgbg; |
1069 | char *env_colorfgbg; |
1081 | char *buffer; |
1070 | char *buffer; |
1082 | char *locale; |
1071 | char *locale; |
|
|
1072 | char *codeset; |
1083 | char charsets[4]; |
1073 | char charsets[4]; |
1084 | unsigned char *v_buffer; /* pointer to physical buffer */ |
1074 | unsigned char *v_buffer; /* pointer to physical buffer */ |
1085 | unsigned int v_buflen; /* size of area to write */ |
1075 | unsigned int v_buflen; /* size of area to write */ |
1086 | char *newfont[MAX_NFONTS]; |
1076 | char *newfont[MAX_NFONTS]; |
1087 | #ifdef KEYSYM_RESOURCE |
1077 | #ifdef KEYSYM_RESOURCE |
… | |
… | |
1091 | /* command input buffering */ |
1081 | /* command input buffering */ |
1092 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1082 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1093 | unsigned char cmdbuf_base[BUFSIZ]; |
1083 | unsigned char cmdbuf_base[BUFSIZ]; |
1094 | unsigned char kbuf[KBUFSZ]; |
1084 | unsigned char kbuf[KBUFSZ]; |
1095 | |
1085 | |
|
|
1086 | rxvt_salloc *ralloc; |
|
|
1087 | rxvt_salloc *talloc; |
|
|
1088 | |
|
|
1089 | void paste (const unsigned char *data, unsigned int len); |
|
|
1090 | |
1096 | void flush (); |
1091 | void flush (); |
1097 | |
1092 | |
1098 | void check_cb (check_watcher &w); check_watcher check_ev; |
1093 | void check_cb (check_watcher &w); check_watcher check_ev; |
1099 | void destroy_cb (time_watcher &w); time_watcher destroy_ev; |
1094 | void destroy_cb (time_watcher &w); time_watcher destroy_ev; |
1100 | |
1095 | |
1101 | void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; |
1096 | void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; |
1102 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
1097 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
|
|
1098 | |
|
|
1099 | void incr_cb (time_watcher &w); time_watcher incr_ev; |
1103 | |
1100 | |
1104 | #ifdef CURSOR_BLINK |
1101 | #ifdef CURSOR_BLINK |
1105 | void blink_cb (time_watcher &w); time_watcher blink_ev; |
1102 | void blink_cb (time_watcher &w); time_watcher blink_ev; |
1106 | #endif |
1103 | #endif |
1107 | |
1104 | |
… | |
… | |
1128 | bool pty_fill (); |
1125 | bool pty_fill (); |
1129 | void process_x_events (); |
1126 | void process_x_events (); |
1130 | |
1127 | |
1131 | void *operator new (size_t s); |
1128 | void *operator new (size_t s); |
1132 | void operator delete (void *p, size_t s); |
1129 | void operator delete (void *p, size_t s); |
|
|
1130 | |
|
|
1131 | void init_secondary (); |
|
|
1132 | const char **init_resources (int argc, const char *const *argv); |
|
|
1133 | void init_env (); |
|
|
1134 | void set_locale (const char *locale); |
|
|
1135 | void init_xlocale (); |
|
|
1136 | void init_command (const char *const *argv); |
|
|
1137 | int run_command (const char *const *argv); |
|
|
1138 | int run_child (const char *const *argv); |
|
|
1139 | |
|
|
1140 | void color_aliases(int idx); |
|
|
1141 | void recolour_cursor (); |
|
|
1142 | |
|
|
1143 | /* screen(!) */ |
|
|
1144 | void scr_blank_line (text_t *et, rend_t *er, unsigned int width, rend_t efs); |
|
|
1145 | void scr_blank_screen_mem (text_t **tp, rend_t **rp, unsigned int row, rend_t efs); |
|
|
1146 | int scr_scroll_text (int row1, int row2, int count, int spec); |
|
|
1147 | void scr_reset (); |
|
|
1148 | void scr_reset_realloc (); |
|
|
1149 | void scr_release (); |
1133 | }; |
1150 | }; |
|
|
1151 | |
|
|
1152 | #define SET_LOCALE(locale) rxvt_set_locale (locale) |
|
|
1153 | extern void rxvt_set_locale (const char *locale); |
1134 | |
1154 | |
1135 | #ifndef __attribute__ |
1155 | #ifndef __attribute__ |
1136 | # ifdef __GNUC__ |
1156 | # ifdef __GNUC__ |
1137 | # if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2) |
1157 | # if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2) |
1138 | # define __attribute__(x) |
1158 | # define __attribute__(x) |