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.269 by root, Tue May 1 21:30:01 2007 UTC vs.
Revision 1.302 by ayin, Sat Sep 8 21:25:56 2007 UTC

73#endif 73#endif
74 74
75#include <termios.h> 75#include <termios.h>
76typedef struct termios ttymode_t; 76typedef struct termios ttymode_t;
77 77
78#ifdef XPM_BACKGROUND 78#ifdef HAVE_AFTERIMAGE
79# ifdef XPM_INC_X11 79# include <afterimage.h>
80# include <X11/xpm.h> 80#undef min
81# else 81#undef max
82# include <xpm.h>
83# endif
84#endif 82#endif
85 83
86#ifndef STDIN_FILENO 84#ifndef STDIN_FILENO
87# define STDIN_FILENO 0 85# define STDIN_FILENO 0
88# define STDOUT_FILENO 1 86# define STDOUT_FILENO 1
101 ***************************************************************************** 99 *****************************************************************************
102 * PROTOTYPES 100 * PROTOTYPES
103 ***************************************************************************** 101 *****************************************************************************
104 */ 102 */
105// main.C 103// main.C
106RETSIGTYPE rxvt_Child_signal (int sig) NOTHROW;
107RETSIGTYPE rxvt_Exit_signal (int sig) NOTHROW;
108void rxvt_clean_exit () NOTHROW;
109void * rxvt_malloc (size_t size); 104void * rxvt_malloc (size_t size);
110void * rxvt_calloc (size_t number, size_t size); 105void * rxvt_calloc (size_t number, size_t size);
111void * rxvt_realloc (void *ptr, size_t size); 106void * rxvt_realloc (void *ptr, size_t size);
112 107
113// misc.C 108// misc.C
114char * rxvt_wcstombs (const wchar_t *str, int len = -1); 109char * rxvt_wcstombs (const wchar_t *str, int len = -1);
115wchar_t * rxvt_mbstowcs (const char *str, int len = -1); 110wchar_t * rxvt_mbstowcs (const char *str, int len = -1);
116char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); 111char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1);
117wchar_t * rxvt_utf8towcs (const char *str, int len = -1); 112wchar_t * rxvt_utf8towcs (const char *str, int len = -1);
118char * rxvt_strdup_cpp (const char *str);
119 113
120#define rxvt_strdup(s) ((s) ? strdup(s) : 0) 114#define rxvt_strdup(s) ((s) ? strdup(s) : 0)
121 115
122char * rxvt_r_basename (const char *str) NOTHROW; 116char * rxvt_basename (const char *str) NOTHROW;
123void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; 117void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW;
124void rxvt_log (const char *fmt,...) NOTHROW; 118void rxvt_log (const char *fmt,...) NOTHROW;
125void rxvt_warn (const char *fmt,...) NOTHROW; 119void rxvt_warn (const char *fmt,...) NOTHROW;
126void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN; 120void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN;
127void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; 121void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN;
128 122
129int rxvt_Str_match (const char *s1, const char *s2) NOTHROW;
130const char * rxvt_Str_skip_space (const char *str) NOTHROW;
131char * rxvt_Str_trim (char *str) NOTHROW; 123char * rxvt_strtrim (char *str) NOTHROW;
132int rxvt_Str_escaped (char *str) NOTHROW;
133char ** rxvt_splitcommastring (const char *cs) NOTHROW; 124char ** rxvt_splitcommastring (const char *cs) NOTHROW;
134void rxvt_freecommastring (char **cs) NOTHROW; 125void rxvt_freecommastring (char **cs) NOTHROW;
135char * rxvt_File_find (const char *file, const char *ext, const char *path) NOTHROW;
136 126
137///////////////////////////////////////////////////////////////////////////// 127/////////////////////////////////////////////////////////////////////////////
138 128
139// temporarily replace the process environment 129// temporarily replace the process environment
140extern char **environ; 130extern char **environ;
141extern char **rxvt_environ; // the original environ pointer 131extern char **rxvt_environ; // the original environ pointer
142 132
143inline void set_environ (stringvec *envv) 133static inline void set_environ (stringvec *envv)
144{ 134{
145#if ENABLE_PERL 135#if ENABLE_PERL
146 assert (envv); 136 assert (envv);
147#else 137#else
148 if (envv) 138 if (envv)
149#endif 139#endif
150 environ = (char **)envv->begin (); 140 environ = (char **)envv->begin ();
151} 141}
152 142
153inline void set_environ (char **envv) 143static inline void set_environ (char **envv)
154{ 144{
155#if ENABLE_PERL 145#if ENABLE_PERL
156 assert (envv); 146 assert (envv);
157#else 147#else
158 if (envv) 148 if (envv)
174# define KEEP_SCROLLCOLOR 1 164# define KEEP_SCROLLCOLOR 1
175#else 165#else
176# undef KEEP_SCROLLCOLOR 166# undef KEEP_SCROLLCOLOR
177#endif 167#endif
178 168
169#if defined(XPM_BACKGROUND) || defined(ENABLE_TRANSPARENCY)
170# define HAVE_BG_PIXMAP 1/* to simplify further usage */
171struct bgPixmap_t {
172
173 enum {
174 geometrySet = (1UL<<0),
175 propScale = (1UL<<1),
176 geometryFlags = (geometrySet|propScale),
177
178 tintSet = (1UL<<8),
179 tintNeeded = (1UL<<9),
180 tintWholesome = (1UL<<10),
181 tintServerSide = (1UL<<11),
182 tintFlags = (tintSet|tintServerSide|tintNeeded|tintWholesome),
183 blurNeeded = (1UL<<12),
184
185 isTransparent = (1UL<<16),
186 isInvalid = (1UL<<17)
187 };
188
189 unsigned long flags;
190
191 enum {
192 transpPmapTiled = (1UL<<0),
193 transpPmapTinted = tintNeeded,
194 transpPmapBlured = blurNeeded,
195 transpTransformations = (tintNeeded|blurNeeded)
196 }; /* this flags are returned by make_transparency_pixmap if called */
197
179#ifdef XPM_BACKGROUND 198# ifdef XPM_BACKGROUND
180typedef struct { 199# ifdef HAVE_AFTERIMAGE
181 short w, h, x, y; 200 ASImage *original_asim;
201 bool render_asim (ASImage *background, ARGB32 background_tint);
202# endif
203
204 enum { defaultScale = 100, defaultAlign = 50 };
205
206 unsigned int h_scale, v_scale;/* percents of the window size */
207 int h_align, v_align; /* percents of the window size:
208 0 - left align, 50 - center, 100 - right */
209 void unset_geometry () { flags = flags & ~geometryFlags; };
210 bool set_geometry (const char *geom);
211 void set_defaultGeometry ()
212 {
213 h_scale = v_scale = defaultScale;
214 h_align = v_align = defaultAlign;
215 flags |= geometrySet;
216 };
217
218 bool set_file (const char *file);
219# endif /* XPM_BACKGROUND */
220
221 rxvt_term *target;
222 bool set_target (rxvt_term *new_target);
223
224# ifdef ENABLE_TRANSPARENCY
225 int root_depth; /* obtained when target is set */
226 Pixmap root_pixmap; /* current root pixmap set */
227 rxvt_color tint;
228 int shade;
229 int h_blurRadius, v_blurRadius;
230
231 bool set_transparent ();
232 bool set_blur_radius (const char *geom);
233 bool set_tint (rxvt_color &new_tint);
234 bool unset_tint ();
235 bool set_shade (const char *shade_str);
236 bool set_root_pixmap ();
237
238 unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */
239# endif
240 double invalid_since;
241
182 Pixmap pixmap; 242 Pixmap pixmap;
183} bgPixmap_t; 243 unsigned int pmap_width, pmap_height;
244 unsigned int pmap_depth;
245
246 bool window_size_sensitive ();
247 bool need_client_side_rendering ();
248 void apply ();
249 bool render ();
250 void invalidate () {
251 if (!(flags & isInvalid))
252 {
253 flags |= isInvalid;
254 invalid_since = NOW;
255 }
256 };
257};
258#else
259# undef HAVE_BG_PIXMAP
184#endif 260#endif
185 261
186/* 262/*
187 * the 'essential' information for reporting Mouse Events 263 * the 'essential' information for reporting Mouse Events
188 * pared down from XButtonEvent 264 * pared down from XButtonEvent
562#endif 638#endif
563#ifdef KEEP_SCROLLCOLOR 639#ifdef KEEP_SCROLLCOLOR
564 Color_scroll, 640 Color_scroll,
565 Color_trough, 641 Color_trough,
566#endif 642#endif
567#if TINTING 643#if ENABLE_TRANSPARENCY
568 Color_tint, 644 Color_tint,
569#endif 645#endif
570#if OFF_FOCUS_FADING 646#if OFF_FOCUS_FADING
571 Color_fade, 647 Color_fade,
572#endif 648#endif
617#define PrivMode_LFNL (1UL<<19) 693#define PrivMode_LFNL (1UL<<19)
618/* too annoying to implement X11 highlight tracking */ 694/* too annoying to implement X11 highlight tracking */
619/* #define PrivMode_MouseX11Track (1LU<<20) */ 695/* #define PrivMode_MouseX11Track (1LU<<20) */
620 696
621#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11) 697#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11)
622#define PrivMode(test,bit) \
623 if (test) \
624 priv_modes |= (bit); \
625 else \
626 priv_modes &= ~(bit)
627 698
628#ifdef ALLOW_132_MODE 699#ifdef ALLOW_132_MODE
629# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) 700# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK)
630#else 701#else
631# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor) 702# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor)
753#define scrollbar_below_slider(y) ((y) > scrollBar.bot) 824#define scrollbar_below_slider(y) ((y) > scrollBar.bot)
754#define scrollbar_position(y) ((y) - scrollBar.beg) 825#define scrollbar_position(y) ((y) - scrollBar.beg)
755#define scrollbar_size() (scrollBar.end - scrollBar.beg \ 826#define scrollbar_size() (scrollBar.end - scrollBar.beg \
756 - scrollbar_minheight ()) 827 - scrollbar_minheight ())
757 828
758#ifdef XPM_BACKGROUND
759# define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g))
760#else
761# define XPMClearArea(a, b, c, d, e, f, g)
762#endif
763
764typedef callback<void (const char *)> log_callback; 829typedef callback<void (const char *)> log_callback;
765typedef callback<int (int)> getfd_callback; 830typedef callback<int (int)> getfd_callback;
766 831
767#define SET_LOCALE(locale) rxvt_set_locale (locale) 832#define SET_LOCALE(locale) rxvt_set_locale (locale)
768extern bool rxvt_set_locale (const char *locale) NOTHROW; 833extern bool rxvt_set_locale (const char *locale) NOTHROW;
894 rxvt_perl_term perl; 959 rxvt_perl_term perl;
895#endif 960#endif
896 struct mbstate mbstate; // current input multibyte state 961 struct mbstate mbstate; // current input multibyte state
897 962
898 unsigned char want_refresh:1, 963 unsigned char want_refresh:1,
899#ifdef TRANSPARENT 964#ifdef ENABLE_TRANSPARENCY
900 want_full_refresh:1, /* awaiting full screen refresh */ 965 want_full_refresh:1, /* awaiting full screen refresh */
901 am_transparent:1, /* is a transparent term */
902 am_pixmap_trans:1, /* transparency w/known root pixmap */
903#endif 966#endif
904 current_screen:1, /* primary or secondary */ 967 current_screen:1, /* primary or secondary */
905 num_scr_allow:1, 968 num_scr_allow:1,
906 bypass_keystate:1, 969 bypass_keystate:1,
907#ifdef CURSOR_BLINK 970#ifdef CURSOR_BLINK
948 /* give proper Scroll behaviour */ 1011 /* give proper Scroll behaviour */
949#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 1012#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
950 mouse_slip_wheel_speed, 1013 mouse_slip_wheel_speed,
951#endif 1014#endif
952 refresh_count, 1015 refresh_count,
953 refresh_limit,
954 last_bot, /* scrollbar last bottom position */ 1016 last_bot, /* scrollbar last bottom position */
955 last_top, /* scrollbar last top position */ 1017 last_top, /* scrollbar last top position */
956 last_state, /* scrollbar last state */ 1018 last_state, /* scrollbar last state */
957 scrollbar_len, 1019 scrollbar_len,
958 window_vt_x, 1020 window_vt_x,
1014#endif 1076#endif
1015 struct mouse_event MEvent; 1077 struct mouse_event MEvent;
1016 XComposeStatus compose; 1078 XComposeStatus compose;
1017 ttymode_t tio; 1079 ttymode_t tio;
1018 row_col_t oldcursor; 1080 row_col_t oldcursor;
1019#ifdef XPM_BACKGROUND 1081#ifdef HAVE_BG_PIXMAP
1020 bgPixmap_t bgPixmap; 1082 bgPixmap_t bgPixmap;
1021 XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ 1083#endif
1084#ifdef HAVE_AFTERIMAGE
1085 ASVisual *asv;
1086 ASImageManager *asimman;
1022#endif 1087#endif
1023 1088
1024#if ENABLE_OVERLAY 1089#if ENABLE_OVERLAY
1025 int ov_x, ov_y, ov_w, ov_h; // overlay dimensions 1090 int ov_x, ov_y, ov_w, ov_h; // overlay dimensions
1026 text_t **ov_text; 1091 text_t **ov_text;
1084 void vt_select_input () const NOTHROW 1149 void vt_select_input () const NOTHROW
1085 { 1150 {
1086 XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim); 1151 XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim);
1087 } 1152 }
1088 1153
1089#if TRANSPARENT || ENABLE_PERL 1154#if ENABLE_TRANSPARENCY || ENABLE_PERL
1090 void rootwin_cb (XEvent &xev); 1155 void rootwin_cb (XEvent &xev);
1091 xevent_watcher rootwin_ev; 1156 xevent_watcher rootwin_ev;
1157#endif
1158#ifdef HAVE_BG_PIXMAP
1159 int update_background ();
1160 void update_background_cb (time_watcher &w);
1161 time_watcher update_background_ev;
1092#endif 1162#endif
1093 1163
1094 void x_cb (XEvent &xev); 1164 void x_cb (XEvent &xev);
1095 void flush (); 1165 void flush ();
1096 xevent_watcher termwin_ev; 1166 xevent_watcher termwin_ev;
1214 void button_press (XButtonEvent &ev); 1284 void button_press (XButtonEvent &ev);
1215 void button_release (XButtonEvent &ev); 1285 void button_release (XButtonEvent &ev);
1216 void focus_in (); 1286 void focus_in ();
1217 void focus_out (); 1287 void focus_out ();
1218 void update_fade_color (unsigned int idx); 1288 void update_fade_color (unsigned int idx);
1219 int check_our_parents ();
1220#ifdef PRINTPIPE 1289#ifdef PRINTPIPE
1221 FILE *popen_printer (); 1290 FILE *popen_printer ();
1222 int pclose_printer (FILE *stream); 1291 int pclose_printer (FILE *stream);
1223#endif 1292#endif
1224 void process_print_pipe (); 1293 void process_print_pipe ();
1318 { 1387 {
1319 if (set) 1388 if (set)
1320 options[opt >> 3] |= (1 << (opt & 7)); 1389 options[opt >> 3] |= (1 << (opt & 7));
1321 else 1390 else
1322 options[opt >> 3] &= ~(1 << (opt & 7)); 1391 options[opt >> 3] &= ~(1 << (opt & 7));
1392 }
1393
1394 void PrivMode (int set, unsigned bit) NOTHROW
1395 {
1396 if (set)
1397 priv_modes |= bit;
1398 else
1399 priv_modes &= ~bit;
1323 } 1400 }
1324 1401
1325 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; 1402 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW;
1326 void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; 1403 void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW;
1327 int scr_scroll_text (int row1, int row2, int count) NOTHROW; 1404 int scr_scroll_text (int row1, int row2, int count) NOTHROW;
1433 void get_options (int argc, const char *const *argv); 1510 void get_options (int argc, const char *const *argv);
1434 int parse_keysym (const char *str, const char *arg); 1511 int parse_keysym (const char *str, const char *arg);
1435 void get_xdefaults (FILE *stream, const char *name); 1512 void get_xdefaults (FILE *stream, const char *name);
1436 void extract_resources (); 1513 void extract_resources ();
1437 // xpm.C 1514 // xpm.C
1438 int scale_pixmap (const char *geom); 1515 void get_window_origin (int &x, int &y);
1439 void resize_pixmap (); 1516 Pixmap get_pixmap_property (int prop_id);
1440 Pixmap set_bgPixmap (const char *file);
1441}; 1517};
1442 1518
1443/*
1444 *****************************************************************************
1445 * PROTOTYPES
1446 *****************************************************************************
1447 */
1448#ifdef PROTOTYPES
1449# define __PROTO(p) p
1450#else
1451# define __PROTO(p) ()
1452#endif
1453
1454#endif /* _RXVT_H_ */ 1519#endif /* _RXVT_H_ */
1455 1520

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines