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.296 by ayin, Sun Aug 26 16:25:59 2007 UTC vs.
Revision 1.305 by sasha, Wed Sep 12 20:29:24 2007 UTC

79# include <afterimage.h> 79# include <afterimage.h>
80#undef min 80#undef min
81#undef max 81#undef max
82#endif 82#endif
83 83
84#include "background.h"
85
84#ifndef STDIN_FILENO 86#ifndef STDIN_FILENO
85# define STDIN_FILENO 0 87# define STDIN_FILENO 0
86# define STDOUT_FILENO 1 88# define STDOUT_FILENO 1
87# define STDERR_FILENO 2 89# define STDERR_FILENO 2
88#endif 90#endif
111char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); 113char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1);
112wchar_t * rxvt_utf8towcs (const char *str, int len = -1); 114wchar_t * rxvt_utf8towcs (const char *str, int len = -1);
113 115
114#define rxvt_strdup(s) ((s) ? strdup(s) : 0) 116#define rxvt_strdup(s) ((s) ? strdup(s) : 0)
115 117
116char * rxvt_r_basename (const char *str) NOTHROW; 118char * rxvt_basename (const char *str) NOTHROW;
117void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; 119void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW;
118void rxvt_log (const char *fmt,...) NOTHROW; 120void rxvt_log (const char *fmt,...) NOTHROW;
119void rxvt_warn (const char *fmt,...) NOTHROW; 121void rxvt_warn (const char *fmt,...) NOTHROW;
120void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN; 122void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN;
121void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; 123void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN;
122 124
123int rxvt_Str_match (const char *s1, const char *s2) NOTHROW;
124const char * rxvt_Str_skip_space (const char *str) NOTHROW;
125char * rxvt_Str_trim (char *str) NOTHROW; 125char * rxvt_strtrim (char *str) NOTHROW;
126int rxvt_Str_escaped (char *str) NOTHROW;
127char ** rxvt_splitcommastring (const char *cs) NOTHROW; 126char ** rxvt_splitcommastring (const char *cs) NOTHROW;
128void rxvt_freecommastring (char **cs) NOTHROW; 127void rxvt_freecommastring (char **cs) NOTHROW;
129 128
130///////////////////////////////////////////////////////////////////////////// 129/////////////////////////////////////////////////////////////////////////////
131 130
132// temporarily replace the process environment 131// temporarily replace the process environment
133extern char **environ; 132extern char **environ;
134extern char **rxvt_environ; // the original environ pointer 133extern char **rxvt_environ; // the original environ pointer
135 134
136inline void set_environ (stringvec *envv) 135static inline void set_environ (stringvec *envv)
137{ 136{
138#if ENABLE_PERL 137#if ENABLE_PERL
139 assert (envv); 138 assert (envv);
140#else 139#else
141 if (envv) 140 if (envv)
142#endif 141#endif
143 environ = (char **)envv->begin (); 142 environ = (char **)envv->begin ();
144} 143}
145 144
146inline void set_environ (char **envv) 145static inline void set_environ (char **envv)
147{ 146{
148#if ENABLE_PERL 147#if ENABLE_PERL
149 assert (envv); 148 assert (envv);
150#else 149#else
151 if (envv) 150 if (envv)
165 */ 164 */
166#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR) 165#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(PLAIN_SCROLLBAR)
167# define KEEP_SCROLLCOLOR 1 166# define KEEP_SCROLLCOLOR 1
168#else 167#else
169# undef KEEP_SCROLLCOLOR 168# undef KEEP_SCROLLCOLOR
170#endif
171
172#if defined(XPM_BACKGROUND) || defined(ENABLE_TRANSPARENCY)
173# define HAVE_BG_PIXMAP 1/* to simplify further usage */
174struct bgPixmap_t {
175
176 enum {
177 geometrySet = (1UL<<0),
178 propScale = (1UL<<1),
179 geometryFlags = (geometrySet|propScale),
180
181 tintSet = (1UL<<8),
182 tintNeeded = (1UL<<9),
183 tintWholesome = (1UL<<10),
184 tintServerSide = (1UL<<11),
185 tintFlags = (tintSet|tintServerSide|tintNeeded|tintWholesome),
186 blurNeeded = (1UL<<12),
187
188 isTransparent = (1UL<<16),
189 isInvalid = (1UL<<17)
190 };
191
192 unsigned long flags;
193
194 enum {
195 transpPmapTiled = (1UL<<0),
196 transpPmapTinted = tintNeeded,
197 transpPmapBlured = blurNeeded,
198 transpTransformations = (tintNeeded|blurNeeded)
199 }; /* this flags are returned by make_transparency_pixmap if called */
200
201# ifdef XPM_BACKGROUND
202# ifdef HAVE_AFTERIMAGE
203 ASImage *original_asim;
204 bool render_asim (ASImage *background, ARGB32 background_tint);
205# endif
206
207 enum { defaultScale = 100, defaultAlign = 50 };
208
209 unsigned int h_scale, v_scale;/* percents of the window size */
210 int h_align, v_align; /* percents of the window size:
211 0 - left align, 50 - center, 100 - right */
212 void unset_geometry () { flags = flags & ~geometryFlags; };
213 bool set_geometry (const char *geom);
214 void set_defaultGeometry ()
215 {
216 h_scale = v_scale = defaultScale;
217 h_align = v_align = defaultAlign;
218 flags |= geometrySet;
219 };
220
221 bool set_file (const char *file);
222# endif /* XPM_BACKGROUND */
223
224 rxvt_term *target;
225 bool set_target (rxvt_term *new_target);
226
227# ifdef ENABLE_TRANSPARENCY
228 int root_depth; /* obtained when target is set */
229 Pixmap root_pixmap; /* current root pixmap set */
230 rxvt_color tint;
231 int shade;
232 int h_blurRadius, v_blurRadius;
233
234 bool set_transparent ();
235 bool set_blur_radius (const char *geom);
236 bool set_tint (rxvt_color &new_tint);
237 bool unset_tint ();
238 bool set_shade (const char *shade_str);
239 bool set_root_pixmap ();
240
241 unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */
242# endif
243 double invalid_since;
244
245 Pixmap pixmap;
246 unsigned int pmap_width, pmap_height;
247 unsigned int pmap_depth;
248
249 bool window_size_sensitive ();
250 bool need_client_side_rendering ();
251 void apply ();
252 bool render ();
253 void invalidate () {
254 if (!(flags & isInvalid))
255 {
256 flags |= isInvalid;
257 invalid_since = NOW;
258 }
259 };
260};
261#else
262# undef HAVE_BG_PIXMAP
263#endif 169#endif
264 170
265/* 171/*
266 * the 'essential' information for reporting Mouse Events 172 * the 'essential' information for reporting Mouse Events
267 * pared down from XButtonEvent 173 * pared down from XButtonEvent
696#define PrivMode_LFNL (1UL<<19) 602#define PrivMode_LFNL (1UL<<19)
697/* too annoying to implement X11 highlight tracking */ 603/* too annoying to implement X11 highlight tracking */
698/* #define PrivMode_MouseX11Track (1LU<<20) */ 604/* #define PrivMode_MouseX11Track (1LU<<20) */
699 605
700#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11) 606#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11)
701#define PrivMode(test,bit) \
702 if (test) \
703 priv_modes |= (bit); \
704 else \
705 priv_modes &= ~(bit)
706 607
707#ifdef ALLOW_132_MODE 608#ifdef ALLOW_132_MODE
708# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK) 609# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor|PrivMode_132OK)
709#else 610#else
710# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor) 611# define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor)
967 rxvt_perl_term perl; 868 rxvt_perl_term perl;
968#endif 869#endif
969 struct mbstate mbstate; // current input multibyte state 870 struct mbstate mbstate; // current input multibyte state
970 871
971 unsigned char want_refresh:1, 872 unsigned char want_refresh:1,
972#ifdef ENABLE_TRANSPARENCY
973 want_full_refresh:1, /* awaiting full screen refresh */
974#endif
975 current_screen:1, /* primary or secondary */ 873 current_screen:1, /* primary or secondary */
976 num_scr_allow:1, 874 num_scr_allow:1,
977 bypass_keystate:1, 875 bypass_keystate:1,
978#ifdef CURSOR_BLINK 876#ifdef CURSOR_BLINK
979 hidden_cursor:1, 877 hidden_cursor:1,
1074 char * incr_buf; 972 char * incr_buf;
1075 size_t incr_buf_size, incr_buf_fill; 973 size_t incr_buf_size, incr_buf_fill;
1076/* ---------- */ 974/* ---------- */
1077 Cursor leftptr_cursor; 975 Cursor leftptr_cursor;
1078/* ---------- */ 976/* ---------- */
1079#ifndef NO_BACKSPACE_KEY
1080 const char *key_backspace;
1081#endif
1082#ifndef NO_DELETE_KEY
1083 const char *key_delete;
1084#endif
1085 struct mouse_event MEvent; 977 struct mouse_event MEvent;
1086 XComposeStatus compose; 978 XComposeStatus compose;
1087 ttymode_t tio; 979 ttymode_t tio;
1088 row_col_t oldcursor; 980 row_col_t oldcursor;
1089#ifdef HAVE_BG_PIXMAP 981#ifdef HAVE_BG_PIXMAP
1325 void set_window_color (int idx, const char *color); 1217 void set_window_color (int idx, const char *color);
1326 void set_colorfgbg (); 1218 void set_colorfgbg ();
1327 bool set_color (rxvt_color &color, const char *name); 1219 bool set_color (rxvt_color &color, const char *name);
1328 void alias_color (int dst, int src); 1220 void alias_color (int dst, int src);
1329 void set_widthheight (unsigned int newwidth, unsigned int newheight); 1221 void set_widthheight (unsigned int newwidth, unsigned int newheight);
1222 void get_window_origin (int &x, int &y);
1223 Pixmap get_pixmap_property (int prop_id);
1330 1224
1331 // screen.C 1225 // screen.C
1332 1226
1333 void lalloc (line_t &l) const 1227 void lalloc (line_t &l) const
1334 { 1228 {
1395 { 1289 {
1396 if (set) 1290 if (set)
1397 options[opt >> 3] |= (1 << (opt & 7)); 1291 options[opt >> 3] |= (1 << (opt & 7));
1398 else 1292 else
1399 options[opt >> 3] &= ~(1 << (opt & 7)); 1293 options[opt >> 3] &= ~(1 << (opt & 7));
1294 }
1295
1296 void PrivMode (int set, unsigned bit) NOTHROW
1297 {
1298 if (set)
1299 priv_modes |= bit;
1300 else
1301 priv_modes &= ~bit;
1400 } 1302 }
1401 1303
1402 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; 1304 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW;
1403 void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; 1305 void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW;
1404 int scr_scroll_text (int row1, int row2, int count) NOTHROW; 1306 int scr_scroll_text (int row1, int row2, int count) NOTHROW;
1509 // xdefaults.C 1411 // xdefaults.C
1510 void get_options (int argc, const char *const *argv); 1412 void get_options (int argc, const char *const *argv);
1511 int parse_keysym (const char *str, const char *arg); 1413 int parse_keysym (const char *str, const char *arg);
1512 void get_xdefaults (FILE *stream, const char *name); 1414 void get_xdefaults (FILE *stream, const char *name);
1513 void extract_resources (); 1415 void extract_resources ();
1514 // xpm.C
1515 void get_window_origin (int &x, int &y);
1516 Pixmap get_pixmap_property (int prop_id);
1517}; 1416};
1518 1417
1519#endif /* _RXVT_H_ */ 1418#endif /* _RXVT_H_ */
1520 1419

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines