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.280 by ayin, Sun Jul 29 08:56:36 2007 UTC vs.
Revision 1.301 by ayin, Sat Sep 8 20:55:49 2007 UTC

77 77
78#ifdef HAVE_AFTERIMAGE 78#ifdef HAVE_AFTERIMAGE
79# include <afterimage.h> 79# include <afterimage.h>
80#undef min 80#undef min
81#undef max 81#undef max
82#elif defined(XPM_BACKGROUND)
83# ifdef XPM_INC_X11
84# include <X11/xpm.h>
85# else
86# include <xpm.h>
87# endif
88#endif 82#endif
89 83
90#ifndef STDIN_FILENO 84#ifndef STDIN_FILENO
91# define STDIN_FILENO 0 85# define STDIN_FILENO 0
92# define STDOUT_FILENO 1 86# define STDOUT_FILENO 1
105 ***************************************************************************** 99 *****************************************************************************
106 * PROTOTYPES 100 * PROTOTYPES
107 ***************************************************************************** 101 *****************************************************************************
108 */ 102 */
109// main.C 103// main.C
110RETSIGTYPE rxvt_Child_signal (int sig) NOTHROW;
111RETSIGTYPE rxvt_Exit_signal (int sig) NOTHROW;
112void rxvt_clean_exit () NOTHROW;
113void * rxvt_malloc (size_t size); 104void * rxvt_malloc (size_t size);
114void * rxvt_calloc (size_t number, size_t size); 105void * rxvt_calloc (size_t number, size_t size);
115void * rxvt_realloc (void *ptr, size_t size); 106void * rxvt_realloc (void *ptr, size_t size);
116 107
117// misc.C 108// misc.C
127void rxvt_log (const char *fmt,...) NOTHROW; 118void rxvt_log (const char *fmt,...) NOTHROW;
128void rxvt_warn (const char *fmt,...) NOTHROW; 119void rxvt_warn (const char *fmt,...) NOTHROW;
129void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN; 120void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN;
130void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; 121void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN;
131 122
132int rxvt_Str_match (const char *s1, const char *s2) NOTHROW;
133const char * rxvt_Str_skip_space (const char *str) NOTHROW;
134char * rxvt_Str_trim (char *str) NOTHROW; 123char * rxvt_Str_trim (char *str) NOTHROW;
135int rxvt_Str_escaped (char *str) NOTHROW;
136char ** rxvt_splitcommastring (const char *cs) NOTHROW; 124char ** rxvt_splitcommastring (const char *cs) NOTHROW;
137void rxvt_freecommastring (char **cs) NOTHROW; 125void rxvt_freecommastring (char **cs) NOTHROW;
138 126
139///////////////////////////////////////////////////////////////////////////// 127/////////////////////////////////////////////////////////////////////////////
140 128
141// temporarily replace the process environment 129// temporarily replace the process environment
142extern char **environ; 130extern char **environ;
143extern char **rxvt_environ; // the original environ pointer 131extern char **rxvt_environ; // the original environ pointer
144 132
145inline void set_environ (stringvec *envv) 133static inline void set_environ (stringvec *envv)
146{ 134{
147#if ENABLE_PERL 135#if ENABLE_PERL
148 assert (envv); 136 assert (envv);
149#else 137#else
150 if (envv) 138 if (envv)
151#endif 139#endif
152 environ = (char **)envv->begin (); 140 environ = (char **)envv->begin ();
153} 141}
154 142
155inline void set_environ (char **envv) 143static inline void set_environ (char **envv)
156{ 144{
157#if ENABLE_PERL 145#if ENABLE_PERL
158 assert (envv); 146 assert (envv);
159#else 147#else
160 if (envv) 148 if (envv)
176# define KEEP_SCROLLCOLOR 1 164# define KEEP_SCROLLCOLOR 1
177#else 165#else
178# undef KEEP_SCROLLCOLOR 166# undef KEEP_SCROLLCOLOR
179#endif 167#endif
180 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
181#ifdef XPM_BACKGROUND 198# ifdef XPM_BACKGROUND
182typedef struct { 199# ifdef HAVE_AFTERIMAGE
183 short w, h, x, y; 200 ASImage *original_asim;
184 bool auto_resize ; 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
185 Pixmap pixmap; 242 Pixmap pixmap;
186} 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
187#endif 260#endif
188 261
189/* 262/*
190 * the 'essential' information for reporting Mouse Events 263 * the 'essential' information for reporting Mouse Events
191 * pared down from XButtonEvent 264 * pared down from XButtonEvent
565#endif 638#endif
566#ifdef KEEP_SCROLLCOLOR 639#ifdef KEEP_SCROLLCOLOR
567 Color_scroll, 640 Color_scroll,
568 Color_trough, 641 Color_trough,
569#endif 642#endif
570#if TINTING 643#if ENABLE_TRANSPARENCY
571 Color_tint, 644 Color_tint,
572#endif 645#endif
573#if OFF_FOCUS_FADING 646#if OFF_FOCUS_FADING
574 Color_fade, 647 Color_fade,
575#endif 648#endif
620#define PrivMode_LFNL (1UL<<19) 693#define PrivMode_LFNL (1UL<<19)
621/* too annoying to implement X11 highlight tracking */ 694/* too annoying to implement X11 highlight tracking */
622/* #define PrivMode_MouseX11Track (1LU<<20) */ 695/* #define PrivMode_MouseX11Track (1LU<<20) */
623 696
624#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11) 697#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11)
625#define PrivMode(test,bit) \
626 if (test) \
627 priv_modes |= (bit); \
628 else \
629 priv_modes &= ~(bit)
630 698
631#ifdef ALLOW_132_MODE 699#ifdef ALLOW_132_MODE
632# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) 700# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK)
633#else 701#else
634# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor) 702# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor)
756#define scrollbar_below_slider(y) ((y) > scrollBar.bot) 824#define scrollbar_below_slider(y) ((y) > scrollBar.bot)
757#define scrollbar_position(y) ((y) - scrollBar.beg) 825#define scrollbar_position(y) ((y) - scrollBar.beg)
758#define scrollbar_size() (scrollBar.end - scrollBar.beg \ 826#define scrollbar_size() (scrollBar.end - scrollBar.beg \
759 - scrollbar_minheight ()) 827 - scrollbar_minheight ())
760 828
761#ifdef XPM_BACKGROUND
762# define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g))
763#else
764# define XPMClearArea(a, b, c, d, e, f, g)
765#endif
766
767typedef callback<void (const char *)> log_callback; 829typedef callback<void (const char *)> log_callback;
768typedef callback<int (int)> getfd_callback; 830typedef callback<int (int)> getfd_callback;
769 831
770#define SET_LOCALE(locale) rxvt_set_locale (locale) 832#define SET_LOCALE(locale) rxvt_set_locale (locale)
771extern bool rxvt_set_locale (const char *locale) NOTHROW; 833extern bool rxvt_set_locale (const char *locale) NOTHROW;
899 struct mbstate mbstate; // current input multibyte state 961 struct mbstate mbstate; // current input multibyte state
900 962
901 unsigned char want_refresh:1, 963 unsigned char want_refresh:1,
902#ifdef ENABLE_TRANSPARENCY 964#ifdef ENABLE_TRANSPARENCY
903 want_full_refresh:1, /* awaiting full screen refresh */ 965 want_full_refresh:1, /* awaiting full screen refresh */
904 am_transparent:1, /* is a transparent term */
905 am_pixmap_trans:1, /* transparency w/known root pixmap */
906#endif 966#endif
907 current_screen:1, /* primary or secondary */ 967 current_screen:1, /* primary or secondary */
908 num_scr_allow:1, 968 num_scr_allow:1,
909 bypass_keystate:1, 969 bypass_keystate:1,
910#ifdef CURSOR_BLINK 970#ifdef CURSOR_BLINK
1016#endif 1076#endif
1017 struct mouse_event MEvent; 1077 struct mouse_event MEvent;
1018 XComposeStatus compose; 1078 XComposeStatus compose;
1019 ttymode_t tio; 1079 ttymode_t tio;
1020 row_col_t oldcursor; 1080 row_col_t oldcursor;
1021#ifdef XPM_BACKGROUND 1081#ifdef HAVE_BG_PIXMAP
1022 bgPixmap_t bgPixmap; 1082 bgPixmap_t bgPixmap;
1083#endif
1023#ifdef HAVE_AFTERIMAGE 1084#ifdef HAVE_AFTERIMAGE
1024 struct ASVisual *asv; 1085 ASVisual *asv;
1025 ASImageManager *asimman; 1086 ASImageManager *asimman;
1026 ASImage *original_asim;
1027 struct { unsigned int width, height; } xpmAttr; /* all we need is width/height */
1028#else
1029 XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */
1030#endif
1031#endif 1087#endif
1032 1088
1033#if ENABLE_OVERLAY 1089#if ENABLE_OVERLAY
1034 int ov_x, ov_y, ov_w, ov_h; // overlay dimensions 1090 int ov_x, ov_y, ov_w, ov_h; // overlay dimensions
1035 text_t **ov_text; 1091 text_t **ov_text;
1097 1153
1098#if ENABLE_TRANSPARENCY || ENABLE_PERL 1154#if ENABLE_TRANSPARENCY || ENABLE_PERL
1099 void rootwin_cb (XEvent &xev); 1155 void rootwin_cb (XEvent &xev);
1100 xevent_watcher rootwin_ev; 1156 xevent_watcher rootwin_ev;
1101#endif 1157#endif
1102#if ENABLE_TRANSPARENCY 1158#ifdef HAVE_BG_PIXMAP
1103 int check_our_parents (); 1159 int update_background ();
1104 void check_our_parents_cb (time_watcher &w); 1160 void update_background_cb (time_watcher &w);
1105 time_watcher check_our_parents_ev; 1161 time_watcher update_background_ev;
1106#endif 1162#endif
1107 1163
1108 void x_cb (XEvent &xev); 1164 void x_cb (XEvent &xev);
1109 void flush (); 1165 void flush ();
1110 xevent_watcher termwin_ev; 1166 xevent_watcher termwin_ev;
1331 { 1387 {
1332 if (set) 1388 if (set)
1333 options[opt >> 3] |= (1 << (opt & 7)); 1389 options[opt >> 3] |= (1 << (opt & 7));
1334 else 1390 else
1335 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;
1336 } 1400 }
1337 1401
1338 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;
1339 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;
1340 int scr_scroll_text (int row1, int row2, int count) NOTHROW; 1404 int scr_scroll_text (int row1, int row2, int count) NOTHROW;
1446 void get_options (int argc, const char *const *argv); 1510 void get_options (int argc, const char *const *argv);
1447 int parse_keysym (const char *str, const char *arg); 1511 int parse_keysym (const char *str, const char *arg);
1448 void get_xdefaults (FILE *stream, const char *name); 1512 void get_xdefaults (FILE *stream, const char *name);
1449 void extract_resources (); 1513 void extract_resources ();
1450 // xpm.C 1514 // xpm.C
1451 int scale_pixmap (const char *geom); 1515 void get_window_origin (int &x, int &y);
1452 void resize_pixmap (); 1516 Pixmap get_pixmap_property (int prop_id);
1453 Pixmap set_bgPixmap (const char *file);
1454}; 1517};
1455 1518
1456/*
1457 *****************************************************************************
1458 * PROTOTYPES
1459 *****************************************************************************
1460 */
1461#ifdef PROTOTYPES
1462# define __PROTO(p) p
1463#else
1464# define __PROTO(p) ()
1465#endif
1466
1467#endif /* _RXVT_H_ */ 1519#endif /* _RXVT_H_ */
1468 1520

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines