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.435 by sf-exg, Fri Feb 11 01:24:46 2011 UTC vs.
Revision 1.458 by sf-exg, Sun Jan 1 17:43:47 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
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 308
313/* special (internal) prefix for font commands */
314#define FONT_CMD '#'
315#define FONT_DN "#-"
316#define FONT_UP "#+"
317
318/* flags for rxvt_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 */
322 RELATIVE = C_RELATIVE | R_RELATIVE, 313 RELATIVE = C_RELATIVE | R_RELATIVE,
323}; 314};
324 315
325/* modes for rxvt_scr_insdel_chars (), rxvt_scr_insdel_lines () */ 316/* modes for rxvt_term::scr_insdel_chars (), rxvt_term::scr_insdel_lines () */
326enum { 317enum {
327 INSERT = -1, /* don't change these values */ 318 INSERT = -1, /* don't change these values */
328 DELETE = +1, 319 DELETE = +1,
329 ERASE = +2, 320 ERASE = +2,
330}; 321};
331 322
332/* modes for rxvt_scr_page () - scroll page. used by scrollbar window */ 323/* modes for rxvt_term::scr_page () - scroll page. used by scrollbar window */
333enum page_dirn { 324enum page_dirn {
334 UP, 325 UP,
335 DN, 326 DN,
336 NO_DIR, 327 NO_DIR,
337}; 328};
338 329
339/* arguments for rxvt_scr_change_screen () */ 330/* arguments for rxvt_term::scr_change_screen () */
340enum { 331enum {
341 PRIMARY = 0, 332 PRIMARY = 0,
342 SECONDARY, 333 SECONDARY,
343}; 334};
344 335
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))
897 int saveLines; /* number of lines that fit in scrollback */ 888 int saveLines; /* number of lines that fit in scrollback */
898 int total_rows; /* total number of rows in this terminal */ 889 int total_rows; /* total number of rows in this terminal */
899 int term_start; /* term lines start here */ 890 int term_start; /* term lines start here */
900 int view_start; /* scrollback view starts here */ 891 int view_start; /* scrollback view starts here */
901 int top_row; /* topmost row index of scrollback */ 892 int top_row; /* topmost row index of scrollback */
902 Window parent[6]; /* parent identifiers - we're parent[0] */ 893 Window parent; /* parent identifier */
903 Window vt; /* vt100 window */ 894 Window vt; /* vt100 window */
904 GC gc; /* GC for drawing */ 895 GC gc; /* GC for drawing */
905 Pixmap pixmap; 896 Pixmap pixmap;
906 rxvt_drawable *drawable; 897 rxvt_drawable *drawable;
907 rxvt_fontset *fontset[4]; 898 rxvt_fontset *fontset[4];
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;
1089/* ---------- */ 1080/* ---------- */
1090 Atom *xa; 1081 Atom *xa;
1091/* ---------- */ 1082/* ---------- */
1092 Time selection_time, 1083 Time selection_time,
1093 clipboard_time; 1084 clipboard_time;
1085 rxvt_selection *selection_req;
1094 pid_t cmd_pid; /* process id of child */ 1086 pid_t cmd_pid; /* process id of child */
1095/* ---------- */ 1087/* ---------- */
1096 struct mouse_event MEvent; 1088 struct mouse_event MEvent;
1097 XComposeStatus compose; 1089 XComposeStatus compose;
1098 static struct termios def_tio; 1090 static struct termios def_tio;
1107 BG_NEEDS_TINT = 1 << 1, 1099 BG_NEEDS_TINT = 1 << 1,
1108 BG_NEEDS_BLUR = 1 << 2, 1100 BG_NEEDS_BLUR = 1 << 2,
1109 1101
1110 BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR, 1102 BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR,
1111 1103
1112 BG_PROP_SCALE = 1 << 3, 1104 BG_KEEP_ASPECT = 1 << 3,
1113 BG_ROOT_ALIGN = 1 << 4, 1105 BG_ROOT_ALIGN = 1 << 4,
1106 BG_TILE = 1 << 14,
1114 BG_GEOMETRY_FLAGS = BG_PROP_SCALE | BG_ROOT_ALIGN, 1107 BG_GEOMETRY_FLAGS = BG_KEEP_ASPECT | BG_ROOT_ALIGN | BG_TILE,
1115 1108
1116 BG_TINT_SET = 1 << 5, 1109 BG_TINT_SET = 1 << 5,
1117 BG_TINT_BITAND = 1 << 6, 1110 BG_TINT_BITAND = 1 << 6,
1118 BG_TINT_FLAGS = BG_NEEDS_TINT | BG_TINT_BITAND, 1111 BG_TINT_FLAGS = BG_NEEDS_TINT | BG_TINT_BITAND,
1119 1112
1168 bool bg_set_shade (const char *shade_str); 1161 bool bg_set_shade (const char *shade_str);
1169 bool bg_set_blur (const char *geom); 1162 bool bg_set_blur (const char *geom);
1170 1163
1171 bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height); 1164 bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height);
1172 bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); 1165 bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height);
1166 void tint_ximage (Visual *visual, XImage *ximage);
1173 unsigned long make_transparency_pixmap (); 1167 unsigned long make_transparency_pixmap ();
1174# endif 1168# endif
1175 1169
1176 ev_tstamp bg_valid_since; 1170 ev_tstamp bg_valid_since;
1177 1171
1288 void child_cb (ev::child &w, int revents); ev::child child_ev; 1282 void child_cb (ev::child &w, int revents); ev::child child_ev;
1289 void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev; 1283 void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev;
1290 void refresh_check (); 1284 void refresh_check ();
1291 void flush (); 1285 void flush ();
1292 void flush_cb (ev::timer &w, int revents); ev::timer flush_ev; 1286 void flush_cb (ev::timer &w, int revents); ev::timer flush_ev;
1287 void cmdbuf_reify ();
1288 void cmdbuf_append (const char *str, size_t count);
1293 bool pty_fill (); 1289 bool pty_fill ();
1294 void pty_cb (ev::io &w, int revents); ev::io pty_ev; 1290 void pty_cb (ev::io &w, int revents); ev::io pty_ev;
1295 1291
1296#ifdef CURSOR_BLINK 1292#ifdef CURSOR_BLINK
1297 void cursor_blink_cb (ev::timer &w, int revents); ev::timer cursor_blink_ev; 1293 void cursor_blink_cb (ev::timer &w, int revents); ev::timer cursor_blink_ev;
1320 void pointer_unblank (); 1316 void pointer_unblank ();
1321 1317
1322 void tt_printf (const char *fmt,...); 1318 void tt_printf (const char *fmt,...);
1323 void tt_write (const char *data, unsigned int len); 1319 void tt_write (const char *data, unsigned int len);
1324 void pty_write (); 1320 void pty_write ();
1325
1326 void init (stringvec *argv, stringvec *envv)
1327 {
1328 this->argv = argv;
1329 init (argv->size (), argv->begin (), envv);
1330 }
1331 1321
1332 void make_current () const // make this the "currently active" urxvt instance 1322 void make_current () const // make this the "currently active" urxvt instance
1333 { 1323 {
1334 SET_R (this); 1324 SET_R (this);
1335 set_environ (envv); 1325 set_environ (envv);
1347 void im_set_size (XRectangle &size); 1337 void im_set_size (XRectangle &size);
1348 void im_set_position (XPoint &pos) NOTHROW; 1338 void im_set_position (XPoint &pos) NOTHROW;
1349 void im_set_color (unsigned long &fg, unsigned long &bg); 1339 void im_set_color (unsigned long &fg, unsigned long &bg);
1350 void im_set_preedit_area (XRectangle &preedit_rect, XRectangle &status_rect, const XRectangle &needed_rect); 1340 void im_set_preedit_area (XRectangle &preedit_rect, XRectangle &status_rect, const XRectangle &needed_rect);
1351 1341
1352 bool IMisRunning (); 1342 bool im_is_running ();
1353 void IMSendSpot (); 1343 void im_send_spot ();
1354 bool IM_get_IC (const char *modifiers); 1344 bool im_get_ic (const char *modifiers);
1355 void IMSetPosition (); 1345 void im_set_position ();
1356#endif 1346#endif
1357 1347
1358 // command.C 1348 // command.C
1359 void key_press (XKeyEvent &ev); 1349 void key_press (XKeyEvent &ev);
1360 void key_release (XKeyEvent &ev); 1350 void key_release (XKeyEvent &ev);
1361 unsigned int cmd_write (const char *str, unsigned int count);
1362 1351
1363 wchar_t next_char () NOTHROW; 1352 wchar_t next_char () NOTHROW;
1364 wchar_t cmd_getc () THROW ((class out_of_input)); 1353 wchar_t cmd_getc () THROW ((class out_of_input));
1365 uint32_t next_octet () NOTHROW; 1354 uint32_t next_octet () NOTHROW;
1366 uint32_t cmd_get8 () THROW ((class out_of_input)); 1355 uint32_t cmd_get8 () THROW ((class out_of_input));
1393 void process_color_seq (int report, int color, const char *str, char resp); 1382 void process_color_seq (int report, int color, const char *str, char resp);
1394 void process_xterm_seq (int op, char *str, char resp); 1383 void process_xterm_seq (int op, char *str, char resp);
1395 int privcases (int mode, unsigned long bit); 1384 int privcases (int mode, unsigned long bit);
1396 void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg); 1385 void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg);
1397 void process_sgr_mode (unsigned int nargs, const int *arg); 1386 void process_sgr_mode (unsigned int nargs, const int *arg);
1398 void process_graphics ();
1399 // init.C 1387 // init.C
1388 void init (stringvec *argv, stringvec *envv);
1389 void init (int argc, const char *const *argv, const char *const *envv);
1390 void init2 (int argc, const char *const *argv);
1400 void init_vars (); 1391 void init_vars ();
1401 const char **init_resources (int argc, const char *const *argv); 1392 const char **init_resources (int argc, const char *const *argv);
1402 void init (int argc, const char *const *argv, stringvec *envv);
1403 void init_env (); 1393 void init_env ();
1404 void set_locale (const char *locale); 1394 void set_locale (const char *locale);
1405 void init_xlocale (); 1395 void init_xlocale ();
1406 void init_command (const char *const *argv); 1396 void init_command (const char *const *argv);
1407 void run_command (const char *const *argv); 1397 void run_command (const char *const *argv);
1470#ifndef NO_BRIGHTCOLOR 1460#ifndef NO_BRIGHTCOLOR
1471 if (r & RS_Bold 1461 if (r & RS_Bold
1472# if ENABLE_STYLES 1462# if ENABLE_STYLES
1473 && option (Opt_intensityStyles) 1463 && option (Opt_intensityStyles)
1474# endif 1464# endif
1475 && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) 1465 && IN_RANGE_EXC (base, minCOLOR, minBrightCOLOR))
1476 base += minBrightCOLOR - minCOLOR; 1466 base += minBrightCOLOR - minCOLOR;
1477#endif 1467#endif
1478 return base; 1468 return base;
1479 } 1469 }
1480 1470
1484#ifndef NO_BRIGHTCOLOR 1474#ifndef NO_BRIGHTCOLOR
1485 if (r & RS_Blink 1475 if (r & RS_Blink
1486# if ENABLE_STYLES 1476# if ENABLE_STYLES
1487 && option (Opt_intensityStyles) 1477 && option (Opt_intensityStyles)
1488# endif 1478# endif
1489 && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) 1479 && IN_RANGE_EXC (base, minCOLOR, minBrightCOLOR))
1490 base += minBrightCOLOR - minCOLOR; 1480 base += minBrightCOLOR - minCOLOR;
1491#endif 1481#endif
1492 return base; 1482 return base;
1493 } 1483 }
1494 1484
1496 { 1486 {
1497 return options[opt >> 3] & (1 << (opt & 7)); 1487 return options[opt >> 3] & (1 << (opt & 7));
1498 } 1488 }
1499 1489
1500 void set_option (uint8_t opt, bool set = true) NOTHROW; 1490 void set_option (uint8_t opt, bool set = true) NOTHROW;
1501
1502 void set_privmode (unsigned bit, int set) NOTHROW
1503 {
1504 if (set)
1505 priv_modes |= bit;
1506 else
1507 priv_modes &= ~bit;
1508 }
1509 1491
1510 // modifies first argument(!) 1492 // modifies first argument(!)
1511 void tt_paste (char *data, unsigned int len) NOTHROW; 1493 void tt_paste (char *data, unsigned int len) NOTHROW;
1512 void paste (char *data, unsigned int len) NOTHROW; 1494 void paste (char *data, unsigned int len) NOTHROW;
1513 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; 1495 void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW;
1584 void selection_click (int clicks, int x, int y) NOTHROW; 1566 void selection_click (int clicks, int x, int y) NOTHROW;
1585 void selection_extend (int x, int y, int flag) NOTHROW; 1567 void selection_extend (int x, int y, int flag) NOTHROW;
1586 void selection_rotate (int x, int y) NOTHROW; 1568 void selection_rotate (int x, int y) NOTHROW;
1587 1569
1588 // xdefaults.C 1570 // xdefaults.C
1589 void get_options (int argc, const char *const *argv); 1571 const char **get_options (int argc, const char *const *argv);
1590 int parse_keysym (const char *str, const char *arg); 1572 int parse_keysym (const char *str, const char *arg);
1591 const char *x_resource (const char *name); 1573 const char *x_resource (const char *name);
1592 void extract_resources (); 1574 void extract_resources ();
1575 void extract_keysym_resources ();
1593}; 1576};
1594 1577
1595#endif /* _RXVT_H_ */ 1578#endif /* _RXVT_H_ */
1596 1579

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines