1 | /* |
1 | /* |
2 | * $Id: rxvt.h,v 1.4 2003/11/25 15:25:17 pcg Exp $ |
2 | * $Id: rxvt.h,v 1.11 2003/12/16 23:04:13 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 | |
… | |
… | |
555 | Rs_pointerBlankDelay, |
555 | Rs_pointerBlankDelay, |
556 | NUM_RESOURCES |
556 | NUM_RESOURCES |
557 | }; |
557 | }; |
558 | |
558 | |
559 | enum { |
559 | enum { |
560 | TIMEOUT_INCR = 0, |
|
|
561 | NUM_TIMEOUTS |
|
|
562 | }; |
|
|
563 | |
|
|
564 | enum { |
|
|
565 | XA_COMPOUND_TEXT = 0, |
560 | XA_COMPOUND_TEXT = 0, |
566 | XA_MULTIPLE, |
561 | XA_MULTIPLE, |
567 | XA_TARGETS, |
562 | XA_TARGETS, |
568 | XA_TEXT, |
563 | XA_TEXT, |
569 | XA_TIMESTAMP, |
564 | XA_TIMESTAMP, |
… | |
… | |
839 | */ |
834 | */ |
840 | #ifdef MENUBAR |
835 | #ifdef MENUBAR |
841 | # include "menubar.h" |
836 | # include "menubar.h" |
842 | #endif |
837 | #endif |
843 | |
838 | |
|
|
839 | #define BLINK_INTERVAL 0.5 |
|
|
840 | |
844 | struct mbstate { |
841 | struct mbstate { |
845 | unsigned char orig; |
842 | unsigned char orig; |
846 | uint32_t reg; |
843 | uint32_t reg; |
847 | int cnt; |
844 | int cnt; |
848 | |
845 | |
… | |
… | |
852 | } |
849 | } |
853 | }; |
850 | }; |
854 | |
851 | |
855 | struct rxvt_term : rxvt_vars { |
852 | struct rxvt_term : rxvt_vars { |
856 | struct mbstate mbstate; |
853 | struct mbstate mbstate; |
857 | #ifdef __GNUC__ |
854 | |
858 | unsigned char want_refresh:1, |
855 | unsigned char want_refresh:1, |
859 | want_full_refresh:1, |
856 | #ifdef TRANSPARENT |
860 | am_transparent:1, |
857 | want_full_refresh:1, /* awaiting full screen refresh */ |
861 | am_pixmap_trans:1, |
858 | #endif |
862 | current_screen:1, |
859 | #if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
863 | hate_those_clicks:1, |
860 | am_transparent:1, /* is a transparent term */ |
|
|
861 | am_pixmap_trans:1, /* transparency w/known root pixmap */ |
|
|
862 | #endif |
|
|
863 | current_screen:1, /* primary or secondary */ |
|
|
864 | hate_those_clicks:1, /* a.k.a. keep mark position */ |
864 | num_scr_allow:1, |
865 | num_scr_allow:1, |
865 | bypass_keystate:1; |
866 | bypass_keystate:1, |
866 | unsigned char chstat:1, |
867 | #ifdef CURSOR_BLINK |
867 | lost_multi:1, |
|
|
868 | multi_byte:1, |
|
|
869 | hidden_cursor:1, |
868 | hidden_cursor:1, |
|
|
869 | #endif |
|
|
870 | #ifdef POINTER_BLANK |
870 | hidden_pointer:1, |
871 | hidden_pointer:1, |
|
|
872 | #endif |
871 | parsed_geometry:1; |
873 | parsed_geometry:1, |
872 | #else |
874 | seen_input:1; /* wether any input has been seen so far */ |
873 | unsigned char want_refresh, |
|
|
874 | # ifdef TRANSPARENT |
|
|
875 | want_full_refresh, /* awaiting full screen refresh */ |
|
|
876 | # endif |
|
|
877 | # if defined(XPM_BACKGROUND) || defined(TRANSPARENT) |
|
|
878 | am_transparent, /* is a transparent term */ |
|
|
879 | am_pixmap_trans, /* transparency w/known root pixmap */ |
|
|
880 | # endif |
|
|
881 | current_screen, /* primary or secondary */ |
|
|
882 | hate_those_clicks, /* a.k.a. keep mark position */ |
|
|
883 | num_scr_allow, |
|
|
884 | bypass_keystate, |
|
|
885 | # ifdef MULTICHAR_SET |
|
|
886 | chstat, |
|
|
887 | lost_multi, /* set ==> we only got half a glyph */ |
|
|
888 | multi_byte, /* set ==> currently using 2 bytes per glyph */ |
|
|
889 | # endif |
|
|
890 | # ifdef CURSOR_BLINK |
|
|
891 | hidden_cursor, |
|
|
892 | # endif |
|
|
893 | # ifdef POINTER_BLANK |
|
|
894 | hidden_pointer, |
|
|
895 | # endif |
|
|
896 | parsed_geometry; |
|
|
897 | #endif /* !__GNUC__ */ |
|
|
898 | |
875 | |
899 | unsigned char refresh_type, |
876 | unsigned char refresh_type, |
900 | #ifdef UTMP_SUPPORT |
877 | #ifdef UTMP_SUPPORT |
901 | next_utmp_action, |
878 | next_utmp_action, |
902 | #endif |
879 | #endif |
… | |
… | |
954 | currmaxcol, |
931 | currmaxcol, |
955 | #ifdef MENUBAR |
932 | #ifdef MENUBAR |
956 | menu_readonly, /* okay to alter menu? */ |
933 | menu_readonly, /* okay to alter menu? */ |
957 | Arrows_x, |
934 | Arrows_x, |
958 | #endif |
935 | #endif |
959 | #if (MENUBAR_MAX > 1) |
936 | #if MENUBAR_MAX > 1 |
960 | Nbars, |
937 | Nbars, |
961 | #endif |
938 | #endif |
962 | window_vt_x, |
939 | window_vt_x, |
963 | window_vt_y, |
940 | window_vt_y, |
964 | window_sb_x, |
941 | window_sb_x, |
… | |
… | |
1016 | #if (defined(HAVE_SETEUID) || defined(HAVE_SETREUID)) && !defined(__CYGWIN32__) |
993 | #if (defined(HAVE_SETEUID) || defined(HAVE_SETREUID)) && !defined(__CYGWIN32__) |
1017 | uid_t euid; |
994 | uid_t euid; |
1018 | gid_t egid; |
995 | gid_t egid; |
1019 | #endif |
996 | #endif |
1020 | /* ---------- */ |
997 | /* ---------- */ |
1021 | Cursor pointer_leftptr; |
998 | Cursor leftptr_cursor; |
1022 | #ifdef POINTER_BLANK |
999 | #ifdef POINTER_BLANK |
1023 | Cursor pointer_blank; |
1000 | Cursor blank_cursor; |
1024 | #endif |
1001 | #endif |
1025 | /* ---------- */ |
1002 | /* ---------- */ |
1026 | const char *ttydev; /* pty/tty name */ |
1003 | const char *ttydev; /* pty/tty name */ |
1027 | #ifndef NO_BACKSPACE_KEY |
1004 | #ifndef NO_BACKSPACE_KEY |
1028 | const char *key_backspace; |
1005 | const char *key_backspace; |
… | |
… | |
1087 | struct timeval lastcursorchange; |
1064 | struct timeval lastcursorchange; |
1088 | #endif |
1065 | #endif |
1089 | #ifdef POINTER_BLANK |
1066 | #ifdef POINTER_BLANK |
1090 | struct timeval lastmotion; |
1067 | struct timeval lastmotion; |
1091 | #endif |
1068 | #endif |
1092 | struct timeval timeout[NUM_TIMEOUTS]; |
|
|
1093 | |
1069 | |
1094 | /* these three don't need to be kept but do so to placate some mem checkers */ |
1070 | /* these three don't need to be kept but do so to placate some mem checkers */ |
1095 | char *env_windowid; /* environmental variable WINDOWID */ |
1071 | char *env_windowid; /* environmental variable WINDOWID */ |
1096 | char *env_display; /* environmental variable DISPLAY */ |
1072 | char *env_display; /* environmental variable DISPLAY */ |
1097 | char *env_term; /* environmental variable TERM */ |
1073 | char *env_term; /* environmental variable TERM */ |
1098 | char *env_colorfgbg; |
1074 | char *env_colorfgbg; |
1099 | char *buffer; |
1075 | char *buffer; |
1100 | char *locale; |
1076 | char *locale; |
1101 | char charsets[4]; |
1077 | char charsets[4]; |
1102 | unsigned char *v_buffer; /* pointer to physical buffer */ |
1078 | unsigned char *v_buffer; /* pointer to physical buffer */ |
1103 | unsigned char *v_bufstr; /* beginning of area to write */ |
|
|
1104 | unsigned char *v_bufptr; /* end of area to write */ |
1079 | unsigned int v_buflen; /* size of area to write */ |
1105 | unsigned char *v_bufend; /* end of physical buffer */ |
|
|
1106 | char *newfont[MAX_NFONTS]; |
1080 | char *newfont[MAX_NFONTS]; |
1107 | #ifdef KEYSYM_RESOURCE |
1081 | #ifdef KEYSYM_RESOURCE |
1108 | const unsigned char *Keysym_map[256]; |
1082 | const unsigned char *Keysym_map[256]; |
1109 | #endif |
1083 | #endif |
1110 | const char *rs[NUM_RESOURCES]; |
1084 | const char *rs[NUM_RESOURCES]; |
1111 | /* command input buffering */ |
1085 | /* command input buffering */ |
1112 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1086 | unsigned char *cmdbuf_ptr, *cmdbuf_endp; |
1113 | unsigned char cmdbuf_base[BUFSIZ]; |
1087 | unsigned char cmdbuf_base[BUFSIZ]; |
1114 | unsigned char kbuf[KBUFSZ]; |
1088 | unsigned char kbuf[KBUFSZ]; |
1115 | |
1089 | |
|
|
1090 | void paste (const unsigned char *data, unsigned int len); |
|
|
1091 | |
|
|
1092 | void flush (); |
|
|
1093 | |
|
|
1094 | void check_cb (check_watcher &w); check_watcher check_ev; |
|
|
1095 | void destroy_cb (time_watcher &w); time_watcher destroy_ev; |
|
|
1096 | |
1116 | void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; |
1097 | void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; |
1117 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
1098 | void x_cb (io_watcher &w, short revents); io_watcher x_ev; |
1118 | |
1099 | |
1119 | void flush (); |
1100 | void incr_cb (time_watcher &w); time_watcher incr_ev; |
|
|
1101 | |
|
|
1102 | #ifdef CURSOR_BLINK |
|
|
1103 | void blink_cb (time_watcher &w); time_watcher blink_ev; |
|
|
1104 | #endif |
|
|
1105 | |
|
|
1106 | #ifdef POINTER_BLANK |
|
|
1107 | void pointer_cb (time_watcher &w); time_watcher pointer_ev; |
|
|
1108 | void pointer_blank (); |
|
|
1109 | void pointer_unblank (); |
|
|
1110 | #endif |
|
|
1111 | |
|
|
1112 | void tt_printf (const char *fmt,...); |
|
|
1113 | void tt_write (const unsigned char *data, unsigned int len); |
|
|
1114 | |
|
|
1115 | void tt_winch (); |
1120 | |
1116 | |
1121 | rxvt_term (); |
1117 | rxvt_term (); |
1122 | ~rxvt_term (); |
1118 | ~rxvt_term (); |
|
|
1119 | void destroy (); |
1123 | |
1120 | |
1124 | bool init (int argc, const char *const *argv); |
1121 | bool init (int argc, const char *const *argv); |
1125 | bool init_vars (); |
1122 | bool init_vars (); |
1126 | |
1123 | |
1127 | uint32_t next_char (); |
1124 | uint32_t next_char (); |
1128 | |
1125 | |
1129 | bool pty_fill (size_t count); |
1126 | bool pty_fill (); |
1130 | void process_x_events (); |
1127 | void process_x_events (); |
1131 | |
1128 | |
1132 | void *operator new (size_t s); |
1129 | void *operator new (size_t s); |
1133 | void operator delete (void *p, size_t s); |
1130 | void operator delete (void *p, size_t s); |
1134 | }; |
1131 | }; |
… | |
… | |
1157 | #ifdef DEBUG_malloc |
1154 | #ifdef DEBUG_malloc |
1158 | # include "dmalloc.h" /* This comes last */ |
1155 | # include "dmalloc.h" /* This comes last */ |
1159 | #endif |
1156 | #endif |
1160 | |
1157 | |
1161 | #endif /* _RXVT_H_ */ |
1158 | #endif /* _RXVT_H_ */ |
|
|
1159 | |