ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvt.h
(Generate patch)

Comparing rxvt-unicode/src/rxvt.h (file contents):
Revision 1.7 by pcg, Wed Nov 26 10:42:34 2003 UTC vs.
Revision 1.16 by pcg, Thu Dec 18 05:45:11 2003 UTC

1/* 1/*
2 * $Id: rxvt.h,v 1.7 2003/11/26 10:42:34 pcg Exp $ 2 * $Id: rxvt.h,v 1.16 2003/12/18 05:45:11 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"
20 21
21/* 22/*
22 ***************************************************************************** 23 *****************************************************************************
23 * SYSTEM HACKS 24 * SYSTEM HACKS
24 ***************************************************************************** 25 *****************************************************************************
480 Rs_backgroundPixmap, 481 Rs_backgroundPixmap,
481#endif 482#endif
482#if (MENUBAR_MAX) 483#if (MENUBAR_MAX)
483 Rs_menu, 484 Rs_menu,
484#endif 485#endif
485#ifndef NO_BOLDFONT
486 Rs_boldFont,
487#endif
488#ifdef GREEK_SUPPORT 486#ifdef GREEK_SUPPORT
489 Rs_greek_keyboard, 487 Rs_greek_keyboard,
490 Rs_greektoggle_key, 488 Rs_greektoggle_key,
491#endif 489#endif
492 Rs_loginShell, 490 Rs_loginShell,
551 Rs_answerbackstring, 549 Rs_answerbackstring,
552 Rs_tripleclickwords, 550 Rs_tripleclickwords,
553 Rs_cursorBlink, 551 Rs_cursorBlink,
554 Rs_pointerBlank, 552 Rs_pointerBlank,
555 Rs_pointerBlankDelay, 553 Rs_pointerBlankDelay,
554 Rs_imLocale,
556 NUM_RESOURCES 555 NUM_RESOURCES
557};
558
559enum {
560 TIMEOUT_INCR = 0,
561 NUM_TIMEOUTS
562}; 556};
563 557
564enum { 558enum {
565 XA_COMPOUND_TEXT = 0, 559 XA_COMPOUND_TEXT = 0,
566 XA_MULTIPLE, 560 XA_MULTIPLE,
728#define scrollbar_isUp() (R->scrollBar.state == 'U') 722#define scrollbar_isUp() (R->scrollBar.state == 'U')
729#define scrollbar_isDn() (R->scrollBar.state == 'D') 723#define scrollbar_isDn() (R->scrollBar.state == 'D')
730#define scrollbar_isUpDn() isupper (R->scrollBar.state) 724#define scrollbar_isUpDn() isupper (R->scrollBar.state)
731#define isScrollbarWindow(w) (R->scrollBar.state && (w) == R->scrollBar.win) 725#define isScrollbarWindow(w) (R->scrollBar.state && (w) == R->scrollBar.win)
732 726
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)) 727#define scrollbarnext_dnval() (R->scrollBar.end + (R->scrollBar.width + 1))
739#define scrollbarnext_upButton(y) ((y) > R->scrollBar.end \ 728#define scrollbarnext_upButton(y) ((y) > R->scrollBar.end \
740 && (y) <= scrollbarnext_dnval()) 729 && (y) <= scrollbarnext_dnval())
741#define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval()) 730#define scrollbarnext_dnButton(y) ((y) > scrollbarnext_dnval())
742#define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT 731#define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT
773 762
774#ifndef STRICT_FONT_CHECKING 763#ifndef STRICT_FONT_CHECKING
775# define rxvt_get_fontwidest(font) ((font)->max_bounds.width) 764# define rxvt_get_fontwidest(font) ((font)->max_bounds.width)
776#endif 765#endif
777 766
778#define rxvt_Gr_ButtonPress(x,y) rxvt_Gr_ButtonReport (r, 'P',(x),(y)) 767#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)) 768#define rxvt_Gr_ButtonRelease(x,y) rxvt_Gr_ButtonReport (R, 'R',(x),(y))
780 769
781#ifdef UTMP_SUPPORT 770#ifdef UTMP_SUPPORT
782# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX) 771# if !defined(RXVT_UTMPX_FILE) || !defined(HAVE_STRUCT_UTMPX)
783# undef HAVE_UTMPX_H 772# undef HAVE_UTMPX_H
784# undef HAVE_STRUCT_UTMPX 773# undef HAVE_STRUCT_UTMPX
854 } 843 }
855}; 844};
856 845
857struct rxvt_term : rxvt_vars { 846struct rxvt_term : rxvt_vars {
858 struct mbstate mbstate; 847 struct mbstate mbstate;
859#ifdef __GNUC__ 848
860 unsigned char want_refresh:1, 849 unsigned char want_refresh:1,
861 want_full_refresh:1, 850#ifdef TRANSPARENT
862 am_transparent:1, 851 want_full_refresh:1, /* awaiting full screen refresh */
863 am_pixmap_trans:1, 852#endif
864 current_screen:1, 853#if defined(XPM_BACKGROUND) || defined(TRANSPARENT)
865 hate_those_clicks:1, 854 am_transparent:1, /* is a transparent term */
855 am_pixmap_trans:1, /* transparency w/known root pixmap */
856#endif
857 current_screen:1, /* primary or secondary */
858 hate_those_clicks:1, /* a.k.a. keep mark position */
866 num_scr_allow:1, 859 num_scr_allow:1,
867 bypass_keystate:1; 860 bypass_keystate:1,
868 unsigned char chstat:1, 861#ifdef CURSOR_BLINK
869 lost_multi:1,
870 multi_byte:1,
871 hidden_cursor:1, 862 hidden_cursor:1,
863#endif
864#ifdef POINTER_BLANK
872 hidden_pointer:1, 865 hidden_pointer:1,
866#endif
873 parsed_geometry:1; 867 parsed_geometry:1,
874#else 868 seen_input:1; /* wether any input has been seen so far */
875 unsigned char want_refresh,
876# ifdef TRANSPARENT
877 want_full_refresh, /* awaiting full screen refresh */
878# endif
879# if defined(XPM_BACKGROUND) || defined(TRANSPARENT)
880 am_transparent, /* is a transparent term */
881 am_pixmap_trans, /* transparency w/known root pixmap */
882# endif
883 current_screen, /* primary or secondary */
884 hate_those_clicks, /* a.k.a. keep mark position */
885 num_scr_allow,
886 bypass_keystate,
887# ifdef MULTICHAR_SET
888 chstat,
889 lost_multi, /* set ==> we only got half a glyph */
890 multi_byte, /* set ==> currently using 2 bytes per glyph */
891# endif
892# ifdef CURSOR_BLINK
893 hidden_cursor,
894# endif
895# ifdef POINTER_BLANK
896 hidden_pointer,
897# endif
898 parsed_geometry;
899#endif /* !__GNUC__ */
900 869
901 unsigned char refresh_type, 870 unsigned char refresh_type,
902#ifdef UTMP_SUPPORT 871#ifdef UTMP_SUPPORT
903 next_utmp_action, 872 next_utmp_action,
904#endif 873#endif
956 currmaxcol, 925 currmaxcol,
957#ifdef MENUBAR 926#ifdef MENUBAR
958 menu_readonly, /* okay to alter menu? */ 927 menu_readonly, /* okay to alter menu? */
959 Arrows_x, 928 Arrows_x,
960#endif 929#endif
961#if (MENUBAR_MAX > 1) 930#if MENUBAR_MAX > 1
962 Nbars, 931 Nbars,
963#endif 932#endif
964 window_vt_x, 933 window_vt_x,
965 window_vt_y, 934 window_vt_y,
966 window_sb_x, 935 window_sb_x,
1089 struct timeval lastcursorchange; 1058 struct timeval lastcursorchange;
1090#endif 1059#endif
1091#ifdef POINTER_BLANK 1060#ifdef POINTER_BLANK
1092 struct timeval lastmotion; 1061 struct timeval lastmotion;
1093#endif 1062#endif
1094 struct timeval timeout[NUM_TIMEOUTS];
1095 1063
1096/* these three don't need to be kept but do so to placate some mem checkers */ 1064/* these three don't need to be kept but do so to placate some mem checkers */
1097 char *env_windowid; /* environmental variable WINDOWID */ 1065 char *env_windowid; /* environmental variable WINDOWID */
1098 char *env_display; /* environmental variable DISPLAY */ 1066 char *env_display; /* environmental variable DISPLAY */
1099 char *env_term; /* environmental variable TERM */ 1067 char *env_term; /* environmental variable TERM */
1100 char *env_colorfgbg; 1068 char *env_colorfgbg;
1101 char *buffer; 1069 char *buffer;
1102 char *locale; 1070 char *locale;
1071 char *codeset;
1103 char charsets[4]; 1072 char charsets[4];
1104 unsigned char *v_buffer; /* pointer to physical buffer */ 1073 unsigned char *v_buffer; /* pointer to physical buffer */
1105 unsigned char *v_bufstr; /* beginning of area to write */
1106 unsigned char *v_bufptr; /* end of area to write */ 1074 unsigned int v_buflen; /* size of area to write */
1107 unsigned char *v_bufend; /* end of physical buffer */
1108 char *newfont[MAX_NFONTS]; 1075 char *newfont[MAX_NFONTS];
1109#ifdef KEYSYM_RESOURCE 1076#ifdef KEYSYM_RESOURCE
1110 const unsigned char *Keysym_map[256]; 1077 const unsigned char *Keysym_map[256];
1111#endif 1078#endif
1112 const char *rs[NUM_RESOURCES]; 1079 const char *rs[NUM_RESOURCES];
1113/* command input buffering */ 1080/* command input buffering */
1114 unsigned char *cmdbuf_ptr, *cmdbuf_endp; 1081 unsigned char *cmdbuf_ptr, *cmdbuf_endp;
1115 unsigned char cmdbuf_base[BUFSIZ]; 1082 unsigned char cmdbuf_base[BUFSIZ];
1116 unsigned char kbuf[KBUFSZ]; 1083 unsigned char kbuf[KBUFSZ];
1117 1084
1085 rxvt_salloc *ralloc;
1086 rxvt_salloc *talloc;
1087
1088 void paste (const unsigned char *data, unsigned int len);
1089
1090 void flush ();
1091
1092 void check_cb (check_watcher &w); check_watcher check_ev;
1093 void destroy_cb (time_watcher &w); time_watcher destroy_ev;
1094
1118 void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; 1095 void pty_cb (io_watcher &w, short revents); io_watcher pty_ev;
1119 void x_cb (io_watcher &w, short revents); io_watcher x_ev; 1096 void x_cb (io_watcher &w, short revents); io_watcher x_ev;
1097
1098 void incr_cb (time_watcher &w); time_watcher incr_ev;
1120 1099
1121#ifdef CURSOR_BLINK 1100#ifdef CURSOR_BLINK
1122 void blink_cb (time_watcher &w); time_watcher blink_ev; 1101 void blink_cb (time_watcher &w); time_watcher blink_ev;
1123#endif 1102#endif
1124 1103
1126 void pointer_cb (time_watcher &w); time_watcher pointer_ev; 1105 void pointer_cb (time_watcher &w); time_watcher pointer_ev;
1127 void pointer_blank (); 1106 void pointer_blank ();
1128 void pointer_unblank (); 1107 void pointer_unblank ();
1129#endif 1108#endif
1130 1109
1131 void flush (); 1110 void tt_printf (const char *fmt,...);
1111 void tt_write (const unsigned char *data, unsigned int len);
1112
1113 void tt_winch ();
1132 1114
1133 rxvt_term (); 1115 rxvt_term ();
1134 ~rxvt_term (); 1116 ~rxvt_term ();
1117 void destroy ();
1135 1118
1136 bool init (int argc, const char *const *argv); 1119 bool init (int argc, const char *const *argv);
1137 bool init_vars (); 1120 bool init_vars ();
1138 1121
1139 uint32_t next_char (); 1122 uint32_t next_char ();
1141 bool pty_fill (); 1124 bool pty_fill ();
1142 void process_x_events (); 1125 void process_x_events ();
1143 1126
1144 void *operator new (size_t s); 1127 void *operator new (size_t s);
1145 void operator delete (void *p, size_t s); 1128 void operator delete (void *p, size_t s);
1129
1130 void init_secondary ();
1131 const char **init_resources (int argc, const char *const *argv);
1132 void init_env ();
1133 void init_xlocale ();
1134 void init_command (const char *const *argv);
1135 int run_command (const char *const *argv);
1136 int run_child (const char *const *argv);
1137
1138 void color_aliases(int idx);
1139 void recolour_cursor ();
1140
1141 /* screen(!) */
1142 void scr_blank_line (text_t *et, rend_t *er, unsigned int width, rend_t efs);
1143 void scr_blank_screen_mem (text_t **tp, rend_t **rp, unsigned int row, rend_t efs);
1144 int scr_scroll_text (int row1, int row2, int count, int spec);
1145 void scr_reset ();
1146 void scr_reset_realloc ();
1147 void scr_release ();
1146}; 1148};
1149
1150#define SET_LOCALE(locale) rxvt_set_locale (locale)
1151extern void rxvt_set_locale (const char *locale);
1147 1152
1148#ifndef __attribute__ 1153#ifndef __attribute__
1149# ifdef __GNUC__ 1154# ifdef __GNUC__
1150# if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2) 1155# if (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || (__GNUC__ < 2)
1151# define __attribute__(x) 1156# define __attribute__(x)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines