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.327 by ayin, Fri Nov 30 01:26:32 2007 UTC vs.
Revision 1.336 by ayin, Wed Dec 26 13:52:11 2007 UTC

79# define STDIN_FILENO 0 79# define STDIN_FILENO 0
80# define STDOUT_FILENO 1 80# define STDOUT_FILENO 1
81# define STDERR_FILENO 2 81# define STDERR_FILENO 2
82#endif 82#endif
83 83
84#if !defined (EACCESS) && defined(EAGAIN)
85# define EACCESS EAGAIN
86#endif
87
88#ifndef EXIT_SUCCESS /* missing from <stdlib.h> */
89# define EXIT_SUCCESS 0 /* exit function success */
90# define EXIT_FAILURE 1 /* exit function failure */
91#endif
92
93#ifndef PATH_MAX
94# define PATH_MAX 16384
95#endif
96
84/****************************************************************************/ 97/****************************************************************************/
85 98
86// exception thrown on fatal (per-instance) errors 99// exception thrown on fatal (per-instance) errors
87class rxvt_failure_exception { }; 100class rxvt_failure_exception { };
88 101
120 133
121// temporarily replace the process environment 134// temporarily replace the process environment
122extern char **environ; 135extern char **environ;
123extern char **rxvt_environ; // the original environ pointer 136extern char **rxvt_environ; // the original environ pointer
124 137
138static inline void
125static inline void set_environ (stringvec *envv) 139set_environ (stringvec *envv)
126{ 140{
127#if ENABLE_PERL 141#if ENABLE_PERL
128 assert (envv); 142 assert (envv);
129#else 143#else
130 if (envv) 144 if (envv)
131#endif 145#endif
132 environ = (char **)envv->begin (); 146 environ = (char **)envv->begin ();
133} 147}
134 148
135static inline void set_environ (char **envv) 149static inline void
150set_environ (char **envv)
136{ 151{
137#if ENABLE_PERL 152#if ENABLE_PERL
138 assert (envv); 153 assert (envv);
139#else 154#else
140 if (envv) 155 if (envv)
145/* 160/*
146 ***************************************************************************** 161 *****************************************************************************
147 * STRUCTURES AND TYPEDEFS 162 * STRUCTURES AND TYPEDEFS
148 ***************************************************************************** 163 *****************************************************************************
149 */ 164 */
150struct grwin_t;
151 165
152/* If we're using either the rxvt scrollbar, keep the 166/* If we're using either the rxvt scrollbar, keep the
153 * scrollColor resource. 167 * scrollColor resource.
154 */ 168 */
155#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) 169#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR)
211# define TERMENV "rxvt-unicode" 225# define TERMENV "rxvt-unicode"
212#endif 226#endif
213 227
214#if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR) 228#if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR)
215# define NO_MOUSE_REPORT_SCROLLBAR 1 229# define NO_MOUSE_REPORT_SCROLLBAR 1
216#endif
217
218/* now look for other badly set stuff */
219
220#if !defined (EACCESS) && defined(EAGAIN)
221# define EACCESS EAGAIN
222#endif
223
224#ifndef EXIT_SUCCESS /* missing from <stdlib.h> */
225# define EXIT_SUCCESS 0 /* exit function success */
226# define EXIT_FAILURE 1 /* exit function failure */
227#endif 230#endif
228 231
229#define scrollBar_esc 30 232#define scrollBar_esc 30
230 233
231#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR) 234#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR)
580#define PrivMode_smoothScroll (1UL<<17) 583#define PrivMode_smoothScroll (1UL<<17)
581#define PrivMode_vt52 (1UL<<18) 584#define PrivMode_vt52 (1UL<<18)
582#define PrivMode_LFNL (1UL<<19) 585#define PrivMode_LFNL (1UL<<19)
583#define PrivMode_MouseBtnEvent (1UL<<20) 586#define PrivMode_MouseBtnEvent (1UL<<20)
584#define PrivMode_MouseAnyEvent (1UL<<21) 587#define PrivMode_MouseAnyEvent (1UL<<21)
585/* too annoying to implement X11 highlight tracking */
586/* #define PrivMode_MouseX11Track (1LU<<20) */
587 588
588#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent) 589#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent)
589 590
590#ifdef ALLOW_132_MODE 591#ifdef ALLOW_132_MODE
591# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) 592# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK)
596// do not change these constants lightly, there are many interdependencies 597// do not change these constants lightly, there are many interdependencies
597#define IMBUFSIZ 128 // input modifier buffer sizes 598#define IMBUFSIZ 128 // input modifier buffer sizes
598#define KBUFSZ 512 // size of keyboard mapping buffer 599#define KBUFSZ 512 // size of keyboard mapping buffer
599#define CBUFSIZ 2048 // size of command buffer 600#define CBUFSIZ 2048 // size of command buffer
600#define UBUFSIZ 2048 // character buffer 601#define UBUFSIZ 2048 // character buffer
601
602#ifndef PATH_MAX
603# define PATH_MAX 16384
604#endif
605 602
606#if ENABLE_FRILLS 603#if ENABLE_FRILLS
607# include <X11/Xmd.h> 604# include <X11/Xmd.h>
608typedef struct _mwmhints { 605typedef struct _mwmhints {
609 CARD32 flags; 606 CARD32 flags;
659#define Pixel2Height(y) ((int32_t)(y) / (int32_t)fheight) 656#define Pixel2Height(y) ((int32_t)(y) / (int32_t)fheight)
660#define Col2Pixel(col) ((int32_t)Width2Pixel(col)) 657#define Col2Pixel(col) ((int32_t)Width2Pixel(col))
661#define Row2Pixel(row) ((int32_t)Height2Pixel(row)) 658#define Row2Pixel(row) ((int32_t)Height2Pixel(row))
662#define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) 659#define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth)
663#define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) 660#define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight)
664
665// for m >= -n, ensure remainder lies between 0..n-1
666#define MOD(m,n) (((m) + (n)) % (n))
667 661
668#define LINENO(n) MOD (term_start + int(n), total_rows) 662#define LINENO(n) MOD (term_start + int(n), total_rows)
669#define ROW(n) row_buf [LINENO (n)] 663#define ROW(n) row_buf [LINENO (n)]
670 664
671/* how to build & extract colors and attributes */ 665/* how to build & extract colors and attributes */
1049#if ENABLE_TRANSPARENCY || ENABLE_PERL 1043#if ENABLE_TRANSPARENCY || ENABLE_PERL
1050 void rootwin_cb (XEvent &xev); 1044 void rootwin_cb (XEvent &xev);
1051 xevent_watcher rootwin_ev; 1045 xevent_watcher rootwin_ev;
1052#endif 1046#endif
1053#ifdef HAVE_BG_PIXMAP 1047#ifdef HAVE_BG_PIXMAP
1054 int update_background (); 1048 void update_background ();
1055#if TRACE_PIXMAPS 1049#if TRACE_PIXMAPS
1056 int trace_update_background (const char *file, int line); 1050 void trace_update_background (const char *file, int line);
1057# define update_background() trace_update_background (__FILE__, __LINE__) 1051# define update_background() trace_update_background (__FILE__, __LINE__)
1058#endif 1052#endif
1059 void update_background_cb (ev::timer &w, int revents); 1053 void update_background_cb (ev::timer &w, int revents);
1060 ev::timer update_background_ev; 1054 ev::timer update_background_ev;
1061#endif 1055#endif
1066#ifdef HAVE_SCROLLBARS 1060#ifdef HAVE_SCROLLBARS
1067 xevent_watcher scrollbar_ev; 1061 xevent_watcher scrollbar_ev;
1068#endif 1062#endif
1069 1063
1070 void child_cb (ev::child &w, int revents); ev::child child_ev; 1064 void child_cb (ev::child &w, int revents); ev::child child_ev;
1071 void prepare_cb (ev::prepare &w, int revents); ev::prepare prepare_ev;
1072 void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev; 1065 void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev;
1066 void refresh_check ();
1073 void flush (); 1067 void flush ();
1074 void flush_cb (ev::timer &w, int revents); ev::timer flush_ev; 1068 void flush_cb (ev::timer &w, int revents); ev::timer flush_ev;
1075 bool pty_fill (); 1069 bool pty_fill ();
1076 void pty_cb (ev::io &w, int revents); ev::io pty_ev; 1070 void pty_cb (ev::io &w, int revents); ev::io pty_ev;
1077 void incr_cb (ev::timer &w, int revents) NOTHROW; ev::timer incr_ev; 1071 void incr_cb (ev::timer &w, int revents) NOTHROW; ev::timer incr_ev;
1104 1098
1105 void tt_printf (const char *fmt,...); 1099 void tt_printf (const char *fmt,...);
1106 void tt_write (const char *data, unsigned int len); 1100 void tt_write (const char *data, unsigned int len);
1107 void pty_write (); 1101 void pty_write ();
1108 1102
1109 bool init (stringvec *argv, stringvec *envv) 1103 void init (stringvec *argv, stringvec *envv)
1110 { 1104 {
1111 this->argv = argv; 1105 this->argv = argv;
1112 return init (argv->size (), argv->begin (), envv); 1106 init (argv->size (), argv->begin (), envv);
1113 } 1107 }
1114 1108
1115 void make_current () const // make this the "currently active" urxvt instance 1109 void make_current () const // make this the "currently active" urxvt instance
1116 { 1110 {
1117 SET_R (this); 1111 SET_R (this);
1173 int privcases (int mode, unsigned long bit); 1167 int privcases (int mode, unsigned long bit);
1174 void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg); 1168 void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg);
1175 void process_sgr_mode (unsigned int nargs, const int *arg); 1169 void process_sgr_mode (unsigned int nargs, const int *arg);
1176 void process_graphics (); 1170 void process_graphics ();
1177 // init.C 1171 // init.C
1178 bool init_vars (); 1172 void init_vars ();
1179 void init_secondary (); 1173 void init_secondary ();
1180 const char **init_resources (int argc, const char *const *argv); 1174 const char **init_resources (int argc, const char *const *argv);
1181 void init_env (); 1175 void init_env ();
1182 void set_locale (const char *locale); 1176 void set_locale (const char *locale);
1183 void init_xlocale (); 1177 void init_xlocale ();
1192 void tt_winch (); 1186 void tt_winch ();
1193 rxvt_term (); 1187 rxvt_term ();
1194 ~rxvt_term (); 1188 ~rxvt_term ();
1195 void destroy (); 1189 void destroy ();
1196 void emergency_cleanup (); 1190 void emergency_cleanup ();
1197 bool init (int argc, const char *const *argv, stringvec *envv); 1191 void init (int argc, const char *const *argv, stringvec *envv);
1198 void recolour_cursor (); 1192 void recolour_cursor ();
1199 void resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent); 1193 void resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent);
1200 void window_calc (unsigned int newwidth, unsigned int newheight); 1194 void window_calc (unsigned int newwidth, unsigned int newheight);
1201 bool set_fonts (); 1195 bool set_fonts ();
1202 void set_string_property (Atom prop, const char *str, int len = -1); 1196 void set_string_property (Atom prop, const char *str, int len = -1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines