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.440 by sf-exg, Tue Apr 26 16:19:45 2011 UTC vs.
Revision 1.462 by sf-exg, Mon Jan 9 15:45:45 2012 UTC

125#endif 125#endif
126 126
127#ifndef EXIT_SUCCESS /* missing from <stdlib.h> */ 127#ifndef EXIT_SUCCESS /* missing from <stdlib.h> */
128# define EXIT_SUCCESS 0 /* exit function success */ 128# define EXIT_SUCCESS 0 /* exit function success */
129# define EXIT_FAILURE 1 /* exit function failure */ 129# define EXIT_FAILURE 1 /* exit function failure */
130#endif
131
132#ifndef PATH_MAX
133# define PATH_MAX 16384
134#endif 130#endif
135 131
136/****************************************************************************/ 132/****************************************************************************/
137 133
138// exception thrown on fatal (per-instance) errors 134// exception thrown on fatal (per-instance) errors
161 157
162const char * rxvt_basename (const char *str) NOTHROW; 158const char * rxvt_basename (const char *str) NOTHROW;
163void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; 159void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW;
164void rxvt_log (const char *fmt,...) NOTHROW; 160void rxvt_log (const char *fmt,...) NOTHROW;
165void rxvt_warn (const char *fmt,...) NOTHROW; 161void rxvt_warn (const char *fmt,...) NOTHROW;
166void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN; 162void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) ecb_noreturn;
167void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; 163void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) ecb_noreturn;
168 164
169char * rxvt_strtrim (char *str) NOTHROW; 165char * rxvt_strtrim (char *str) NOTHROW;
170char ** rxvt_strsplit (char delim, const char *str) NOTHROW; 166char ** rxvt_strsplit (char delim, const char *str) NOTHROW;
171 167
172static inline void 168static inline void
307#ifdef NO_SECONDARY_SCREEN 303#ifdef NO_SECONDARY_SCREEN
308# define NSCREENS 0 304# define NSCREENS 0
309#else 305#else
310# define NSCREENS 1 306# define NSCREENS 1
311#endif 307#endif
312
313/* special (internal) prefix for font commands */
314#define FONT_CMD '#'
315#define FONT_DN "#-"
316#define FONT_UP "#+"
317 308
318/* flags for rxvt_term::scr_gotorc () */ 309/* flags for rxvt_term::scr_gotorc () */
319enum { 310enum {
320 C_RELATIVE = 1, /* col movement is relative */ 311 C_RELATIVE = 1, /* col movement is relative */
321 R_RELATIVE = 2, /* row movement is relative */ 312 R_RELATIVE = 2, /* row movement is relative */
676 667
677#define GET_ATTR(x) (((x) & RS_attrMask)) 668#define GET_ATTR(x) (((x) & RS_attrMask))
678// return attributes defining the background, encoding doesn't matter 669// return attributes defining the background, encoding doesn't matter
679// depends on RS_fgShift > RS_bgShift 670// depends on RS_fgShift > RS_bgShift
680#define GET_BGATTR(x) \ 671#define GET_BGATTR(x) \
681 (expect_false ((x) & RS_RVid) \ 672 (ecb_unlikely ((x) & RS_RVid) \
682 ? (((x) & (RS_attrMask & ~RS_RVid)) \ 673 ? (((x) & (RS_attrMask & ~RS_RVid)) \
683 | (((x) & RS_fgMask) >> (RS_fgShift - RS_bgShift))) \ 674 | (((x) & RS_fgMask) >> (RS_fgShift - RS_bgShift))) \
684 : ((x) & (RS_attrMask | RS_bgMask))) 675 : ((x) & (RS_attrMask | RS_bgMask)))
685#define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | ((fg) << RS_fgShift)) 676#define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | ((fg) << RS_fgShift))
686#define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg) << RS_bgShift)) 677#define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg) << RS_bgShift))
990 scrollBar_t scrollBar; 981 scrollBar_t scrollBar;
991 uint8_t options[(Opt_count + 7) >> 3]; 982 uint8_t options[(Opt_count + 7) >> 3];
992 XSizeHints szHint; 983 XSizeHints szHint;
993 rxvt_color *pix_colors; 984 rxvt_color *pix_colors;
994 Cursor TermWin_cursor; /* cursor for vt window */ 985 Cursor TermWin_cursor; /* cursor for vt window */
995 line_t *row_buf; // all lines, scrollback + terminal, circular, followed by temp_buf 986 line_t *row_buf; // all lines, scrollback + terminal, circular
996 line_t *drawn_buf; // text on screen 987 line_t *drawn_buf; // text on screen
997 line_t *swap_buf; // lines for swap buffer 988 line_t *swap_buf; // lines for swap buffer
998 char *tabs; /* per location: 1 == tab-stop */ 989 char *tabs; /* per location: 1 == tab-stop */
999 screen_t screen; 990 screen_t screen;
1000 screen_t swap; 991 screen_t swap;
1037 hidden_pointer:1, 1028 hidden_pointer:1,
1038#endif 1029#endif
1039 enc_utf8:1, /* whether locale uses utf-8 */ 1030 enc_utf8:1, /* whether locale uses utf-8 */
1040 seen_input:1, /* whether we have seen some program output yet */ 1031 seen_input:1, /* whether we have seen some program output yet */
1041 seen_resize:1, /* whether we had a resize event */ 1032 seen_resize:1, /* whether we had a resize event */
1033 init_done:1,
1042 parsed_geometry:1; 1034 parsed_geometry:1;
1043 1035
1044 unsigned char refresh_type, 1036 unsigned char refresh_type,
1045#ifdef META8_OPTION 1037#ifdef META8_OPTION
1046 meta_char; /* Alt-key prefix */ 1038 meta_char; /* Alt-key prefix */
1080 allowedxerror; 1072 allowedxerror;
1081/* ---------- */ 1073/* ---------- */
1082 unsigned int ModLevel3Mask, 1074 unsigned int ModLevel3Mask,
1083 ModMetaMask, 1075 ModMetaMask,
1084 ModNumLockMask; 1076 ModNumLockMask;
1085 int old_width, /* last used width in screen resize */
1086 old_height; /* last used height in screen resize */
1087 unsigned long priv_modes, 1077 unsigned long priv_modes,
1088 SavedModes; 1078 SavedModes;
1089/* ---------- */ 1079/* ---------- */
1090 Atom *xa; 1080 Atom *xa;
1091/* ---------- */ 1081/* ---------- */
1108 BG_NEEDS_TINT = 1 << 1, 1098 BG_NEEDS_TINT = 1 << 1,
1109 BG_NEEDS_BLUR = 1 << 2, 1099 BG_NEEDS_BLUR = 1 << 2,
1110 1100
1111 BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR, 1101 BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR,
1112 1102
1113 BG_PROP_SCALE = 1 << 3, 1103 BG_KEEP_ASPECT = 1 << 3,
1114 BG_ROOT_ALIGN = 1 << 4, 1104 BG_ROOT_ALIGN = 1 << 4,
1105 BG_TILE = 1 << 14,
1115 BG_GEOMETRY_FLAGS = BG_PROP_SCALE | BG_ROOT_ALIGN, 1106 BG_GEOMETRY_FLAGS = BG_KEEP_ASPECT | BG_ROOT_ALIGN | BG_TILE,
1116 1107
1117 BG_TINT_SET = 1 << 5, 1108 BG_TINT_SET = 1 << 5,
1118 BG_TINT_BITAND = 1 << 6, 1109 BG_TINT_BITAND = 1 << 6,
1119 BG_TINT_FLAGS = BG_NEEDS_TINT | BG_TINT_BITAND, 1110 BG_TINT_FLAGS = BG_NEEDS_TINT | BG_TINT_BITAND,
1120 1111
1169 bool bg_set_shade (const char *shade_str); 1160 bool bg_set_shade (const char *shade_str);
1170 bool bg_set_blur (const char *geom); 1161 bool bg_set_blur (const char *geom);
1171 1162
1172 bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height); 1163 bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height);
1173 bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); 1164 bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height);
1165 void tint_ximage (Visual *visual, XImage *ximage);
1174 unsigned long make_transparency_pixmap (); 1166 unsigned long make_transparency_pixmap ();
1175# endif 1167# endif
1176 1168
1177 ev_tstamp bg_valid_since; 1169 ev_tstamp bg_valid_since;
1178 1170
1221 void scr_overlay_set (int x, int y, const char *s) NOTHROW; 1213 void scr_overlay_set (int x, int y, const char *s) NOTHROW;
1222 void scr_overlay_set (int x, int y, const wchar_t *s) NOTHROW; 1214 void scr_overlay_set (int x, int y, const wchar_t *s) NOTHROW;
1223#endif 1215#endif
1224 1216
1225 vector<void *> allocated; // free these memory blocks with free() 1217 vector<void *> allocated; // free these memory blocks with free()
1226
1227 char env_windowid[21]; /* environmental variable WINDOWID */
1228 char env_colorfgbg[sizeof ("COLORFGBG=default;default;bg") + 1];
1229 char *env_display; /* environmental variable DISPLAY */
1230 char *env_term; /* environmental variable TERM */
1231 1218
1232 char *locale; 1219 char *locale;
1233 char charsets[4]; 1220 char charsets[4];
1234 char *v_buffer; /* pointer to physical buffer */ 1221 char *v_buffer; /* pointer to physical buffer */
1235 unsigned int v_buflen; /* size of area to write */ 1222 unsigned int v_buflen; /* size of area to write */
1324 1311
1325 void tt_printf (const char *fmt,...); 1312 void tt_printf (const char *fmt,...);
1326 void tt_write (const char *data, unsigned int len); 1313 void tt_write (const char *data, unsigned int len);
1327 void pty_write (); 1314 void pty_write ();
1328 1315
1329 void init (stringvec *argv, stringvec *envv)
1330 {
1331 this->argv = argv;
1332 init (argv->size (), argv->begin (), envv);
1333 }
1334
1335 void make_current () const // make this the "currently active" urxvt instance 1316 void make_current () const // make this the "currently active" urxvt instance
1336 { 1317 {
1337 SET_R (this); 1318 SET_R (this);
1338 set_environ (envv); 1319 set_environ (envv);
1339 rxvt_set_locale (locale); 1320 rxvt_set_locale (locale);
1350 void im_set_size (XRectangle &size); 1331 void im_set_size (XRectangle &size);
1351 void im_set_position (XPoint &pos) NOTHROW; 1332 void im_set_position (XPoint &pos) NOTHROW;
1352 void im_set_color (unsigned long &fg, unsigned long &bg); 1333 void im_set_color (unsigned long &fg, unsigned long &bg);
1353 void im_set_preedit_area (XRectangle &preedit_rect, XRectangle &status_rect, const XRectangle &needed_rect); 1334 void im_set_preedit_area (XRectangle &preedit_rect, XRectangle &status_rect, const XRectangle &needed_rect);
1354 1335
1355 bool IMisRunning (); 1336 bool im_is_running ();
1356 void IMSendSpot (); 1337 void im_send_spot ();
1357 bool IM_get_IC (const char *modifiers); 1338 bool im_get_ic (const char *modifiers);
1358 void IMSetPosition (); 1339 void im_set_position ();
1359#endif 1340#endif
1360 1341
1361 // command.C 1342 // command.C
1362 void key_press (XKeyEvent &ev); 1343 void key_press (XKeyEvent &ev);
1363 void key_release (XKeyEvent &ev); 1344 void key_release (XKeyEvent &ev);
1396 void process_xterm_seq (int op, char *str, char resp); 1377 void process_xterm_seq (int op, char *str, char resp);
1397 int privcases (int mode, unsigned long bit); 1378 int privcases (int mode, unsigned long bit);
1398 void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg); 1379 void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg);
1399 void process_sgr_mode (unsigned int nargs, const int *arg); 1380 void process_sgr_mode (unsigned int nargs, const int *arg);
1400 // init.C 1381 // init.C
1382 void init (stringvec *argv, stringvec *envv);
1383 void init (int argc, const char *const *argv, const char *const *envv);
1384 void init2 (int argc, const char *const *argv);
1401 void init_vars (); 1385 void init_vars ();
1402 const char **init_resources (int argc, const char *const *argv); 1386 const char **init_resources (int argc, const char *const *argv);
1403 void init (int argc, const char *const *argv, stringvec *envv);
1404 void init_env (); 1387 void init_env ();
1405 void set_locale (const char *locale); 1388 void set_locale (const char *locale);
1406 void init_xlocale (); 1389 void init_xlocale ();
1407 void init_command (const char *const *argv); 1390 void init_command (const char *const *argv);
1408 void run_command (const char *const *argv); 1391 void run_command (const char *const *argv);
1426 void set_mbstring_property (Atom prop, const char *str, int len = -1); 1409 void set_mbstring_property (Atom prop, const char *str, int len = -1);
1427 void set_utf8_property (Atom prop, const char *str, int len = -1); 1410 void set_utf8_property (Atom prop, const char *str, int len = -1);
1428 void set_title (const char *str); 1411 void set_title (const char *str);
1429 void set_icon_name (const char *str); 1412 void set_icon_name (const char *str);
1430 void set_window_color (int idx, const char *color); 1413 void set_window_color (int idx, const char *color);
1431 void set_colorfgbg (); 1414 char *get_colorfgbg ();
1432 bool set_color (rxvt_color &color, const char *name); 1415 bool set_color (rxvt_color &color, const char *name);
1433 void alias_color (int dst, int src); 1416 void alias_color (int dst, int src);
1434 void set_widthheight (unsigned int newwidth, unsigned int newheight); 1417 void set_widthheight (unsigned int newwidth, unsigned int newheight);
1435 void get_window_origin (int &x, int &y); 1418 void get_window_origin (int &x, int &y);
1436 Pixmap get_pixmap_property (Atom property); 1419 Pixmap get_pixmap_property (Atom property);
1471#ifndef NO_BRIGHTCOLOR 1454#ifndef NO_BRIGHTCOLOR
1472 if (r & RS_Bold 1455 if (r & RS_Bold
1473# if ENABLE_STYLES 1456# if ENABLE_STYLES
1474 && option (Opt_intensityStyles) 1457 && option (Opt_intensityStyles)
1475# endif 1458# endif
1476 && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) 1459 && IN_RANGE_EXC (base, minCOLOR, minBrightCOLOR))
1477 base += minBrightCOLOR - minCOLOR; 1460 base += minBrightCOLOR - minCOLOR;
1478#endif 1461#endif
1479 return base; 1462 return base;
1480 } 1463 }
1481 1464
1485#ifndef NO_BRIGHTCOLOR 1468#ifndef NO_BRIGHTCOLOR
1486 if (r & RS_Blink 1469 if (r & RS_Blink
1487# if ENABLE_STYLES 1470# if ENABLE_STYLES
1488 && option (Opt_intensityStyles) 1471 && option (Opt_intensityStyles)
1489# endif 1472# endif
1490 && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) 1473 && IN_RANGE_EXC (base, minCOLOR, minBrightCOLOR))
1491 base += minBrightCOLOR - minCOLOR; 1474 base += minBrightCOLOR - minCOLOR;
1492#endif 1475#endif
1493 return base; 1476 return base;
1494 } 1477 }
1495 1478
1497 { 1480 {
1498 return options[opt >> 3] & (1 << (opt & 7)); 1481 return options[opt >> 3] & (1 << (opt & 7));
1499 } 1482 }
1500 1483
1501 void set_option (uint8_t opt, bool set = true) NOTHROW; 1484 void set_option (uint8_t opt, bool set = true) NOTHROW;
1502
1503 void set_privmode (unsigned bit, int set) NOTHROW
1504 {
1505 if (set)
1506 priv_modes |= bit;
1507 else
1508 priv_modes &= ~bit;
1509 }
1510 1485
1511 // modifies first argument(!) 1486 // modifies first argument(!)
1512 void tt_paste (char *data, unsigned int len) NOTHROW; 1487 void tt_paste (char *data, unsigned int len) NOTHROW;
1513 void paste (char *data, unsigned int len) NOTHROW; 1488 void paste (char *data, unsigned int len) NOTHROW;
1514 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; 1489 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW;
1585 void selection_click (int clicks, int x, int y) NOTHROW; 1560 void selection_click (int clicks, int x, int y) NOTHROW;
1586 void selection_extend (int x, int y, int flag) NOTHROW; 1561 void selection_extend (int x, int y, int flag) NOTHROW;
1587 void selection_rotate (int x, int y) NOTHROW; 1562 void selection_rotate (int x, int y) NOTHROW;
1588 1563
1589 // xdefaults.C 1564 // xdefaults.C
1590 void get_options (int argc, const char *const *argv); 1565 const char **get_options (int argc, const char *const *argv);
1591 int parse_keysym (const char *str, const char *arg); 1566 int parse_keysym (const char *str, const char *arg);
1592 const char *x_resource (const char *name); 1567 const char *x_resource (const char *name);
1593 void extract_resources (); 1568 void extract_resources ();
1569 void extract_keysym_resources ();
1594}; 1570};
1595 1571
1596#endif /* _RXVT_H_ */ 1572#endif /* _RXVT_H_ */
1597 1573

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines