--- rxvt-unicode/src/rxvt.h 2011/01/30 18:38:01 1.433 +++ rxvt-unicode/src/rxvt.h 2012/01/09 18:41:58 1.463 @@ -129,10 +129,6 @@ # define EXIT_FAILURE 1 /* exit function failure */ #endif -#ifndef PATH_MAX -# define PATH_MAX 16384 -#endif - /****************************************************************************/ // exception thrown on fatal (per-instance) errors @@ -163,8 +159,8 @@ void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; void rxvt_log (const char *fmt,...) NOTHROW; void rxvt_warn (const char *fmt,...) NOTHROW; -void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) NORETURN; -void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) NORETURN; +void rxvt_fatal (const char *fmt, ...) THROW ((class rxvt_failure_exception)) ecb_noreturn; +void rxvt_exit_failure () THROW ((class rxvt_failure_exception)) ecb_noreturn; char * rxvt_strtrim (char *str) NOTHROW; char ** rxvt_strsplit (char delim, const char *str) NOTHROW; @@ -310,33 +306,28 @@ # define NSCREENS 1 #endif -/* special (internal) prefix for font commands */ -#define FONT_CMD '#' -#define FONT_DN "#-" -#define FONT_UP "#+" - -/* flags for rxvt_scr_gotorc () */ +/* flags for rxvt_term::scr_gotorc () */ enum { C_RELATIVE = 1, /* col movement is relative */ R_RELATIVE = 2, /* row movement is relative */ RELATIVE = C_RELATIVE | R_RELATIVE, }; -/* modes for rxvt_scr_insdel_chars (), rxvt_scr_insdel_lines () */ +/* modes for rxvt_term::scr_insdel_chars (), rxvt_term::scr_insdel_lines () */ enum { INSERT = -1, /* don't change these values */ DELETE = +1, ERASE = +2, }; -/* modes for rxvt_scr_page () - scroll page. used by scrollbar window */ +/* modes for rxvt_term::scr_page () - scroll page. used by scrollbar window */ enum page_dirn { UP, DN, NO_DIR, }; -/* arguments for rxvt_scr_change_screen () */ +/* arguments for rxvt_term::scr_change_screen () */ enum { PRIMARY = 0, SECONDARY, @@ -389,17 +380,6 @@ #define DEFAULT_RSTYLE (RS_None | (Color_fg << RS_fgShift) | (Color_bg << RS_bgShift)) #define OVERLAY_RSTYLE (RS_None | (Color_Black << RS_fgShift) | (Color_Yellow << RS_bgShift)) -#define Sel_none 0 /* Not waiting */ -#define Sel_normal 0x01 /* normal selection */ -#define Sel_incr 0x02 /* incremental selection */ -#define Sel_direct 0x00 -#define Sel_Primary 0x01 -#define Sel_Secondary 0x02 -#define Sel_Clipboard 0x03 -#define Sel_whereMask 0x0f -#define Sel_CompoundText 0x10 /* last request was COMPOUND_TEXT */ -#define Sel_UTF8String 0x20 /* last request was UTF8_STRING */ - enum { C0_NUL = 0x00, C0_SOH, C0_STX, C0_ETX, C0_EOT, C0_ENQ, C0_ACK, C0_BEL, @@ -689,7 +669,7 @@ // return attributes defining the background, encoding doesn't matter // depends on RS_fgShift > RS_bgShift #define GET_BGATTR(x) \ - (expect_false ((x) & RS_RVid) \ + (ecb_unlikely ((x) & RS_RVid) \ ? (((x) & (RS_attrMask & ~RS_RVid)) \ | (((x) & RS_fgMask) >> (RS_fgShift - RS_bgShift))) \ : ((x) & (RS_attrMask | RS_bgMask))) @@ -910,10 +890,9 @@ int term_start; /* term lines start here */ int view_start; /* scrollback view starts here */ int top_row; /* topmost row index of scrollback */ - Window parent[6]; /* parent identifiers - we're parent[0] */ + Window parent; /* parent identifier */ Window vt; /* vt100 window */ GC gc; /* GC for drawing */ - Pixmap pixmap; rxvt_drawable *drawable; rxvt_fontset *fontset[4]; }; @@ -1003,7 +982,7 @@ XSizeHints szHint; rxvt_color *pix_colors; Cursor TermWin_cursor; /* cursor for vt window */ - line_t *row_buf; // all lines, scrollback + terminal, circular, followed by temp_buf + line_t *row_buf; // all lines, scrollback + terminal, circular line_t *drawn_buf; // text on screen line_t *swap_buf; // lines for swap buffer char *tabs; /* per location: 1 == tab-stop */ @@ -1050,14 +1029,13 @@ enc_utf8:1, /* whether locale uses utf-8 */ seen_input:1, /* whether we have seen some program output yet */ seen_resize:1, /* whether we had a resize event */ + init_done:1, parsed_geometry:1; unsigned char refresh_type, #ifdef META8_OPTION - meta_char, /* Alt-key prefix */ + meta_char; /* Alt-key prefix */ #endif - selection_wait, - selection_type; /* ---------- */ bool rvideo_state, rvideo_mode; #ifndef NO_BELL @@ -1095,19 +1073,15 @@ unsigned int ModLevel3Mask, ModMetaMask, ModNumLockMask; - int old_width, /* last used width in screen resize */ - old_height; /* last used height in screen resize */ unsigned long priv_modes, SavedModes; /* ---------- */ Atom *xa; /* ---------- */ Time selection_time, - selection_request_time, clipboard_time; + rxvt_selection *selection_req; pid_t cmd_pid; /* process id of child */ - char * incr_buf; - size_t incr_buf_size, incr_buf_fill; /* ---------- */ struct mouse_event MEvent; XComposeStatus compose; @@ -1125,9 +1099,10 @@ BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR, - BG_PROP_SCALE = 1 << 3, + BG_KEEP_ASPECT = 1 << 3, BG_ROOT_ALIGN = 1 << 4, - BG_GEOMETRY_FLAGS = BG_PROP_SCALE | BG_ROOT_ALIGN, + BG_TILE = 1 << 14, + BG_GEOMETRY_FLAGS = BG_KEEP_ASPECT | BG_ROOT_ALIGN | BG_TILE, BG_TINT_SET = 1 << 5, BG_TINT_BITAND = 1 << 6, @@ -1186,6 +1161,7 @@ bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height); bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); + void tint_ximage (Visual *visual, XImage *ximage); unsigned long make_transparency_pixmap (); # endif @@ -1239,11 +1215,6 @@ vector allocated; // free these memory blocks with free() - char env_windowid[21]; /* environmental variable WINDOWID */ - char env_colorfgbg[sizeof ("COLORFGBG=default;default;bg") + 1]; - char *env_display; /* environmental variable DISPLAY */ - char *env_term; /* environmental variable TERM */ - char *locale; char charsets[4]; char *v_buffer; /* pointer to physical buffer */ @@ -1306,9 +1277,10 @@ void refresh_check (); void flush (); void flush_cb (ev::timer &w, int revents); ev::timer flush_ev; + void cmdbuf_reify (); + void cmdbuf_append (const char *str, size_t count); bool pty_fill (); void pty_cb (ev::io &w, int revents); ev::io pty_ev; - void incr_cb (ev::timer &w, int revents) NOTHROW; ev::timer incr_ev; #ifdef CURSOR_BLINK void cursor_blink_cb (ev::timer &w, int revents); ev::timer cursor_blink_ev; @@ -1340,12 +1312,6 @@ void tt_write (const char *data, unsigned int len); void pty_write (); - void init (stringvec *argv, stringvec *envv) - { - this->argv = argv; - init (argv->size (), argv->begin (), envv); - } - void make_current () const // make this the "currently active" urxvt instance { SET_R (this); @@ -1366,16 +1332,15 @@ void im_set_color (unsigned long &fg, unsigned long &bg); void im_set_preedit_area (XRectangle &preedit_rect, XRectangle &status_rect, const XRectangle &needed_rect); - bool IMisRunning (); - void IMSendSpot (); - bool IM_get_IC (const char *modifiers); - void IMSetPosition (); + bool im_is_running (); + void im_send_spot (); + bool im_get_ic (const char *modifiers); + void im_set_position (); #endif // command.C void key_press (XKeyEvent &ev); void key_release (XKeyEvent &ev); - unsigned int cmd_write (const char *str, unsigned int count); wchar_t next_char () NOTHROW; wchar_t cmd_getc () THROW ((class out_of_input)); @@ -1412,11 +1377,12 @@ int privcases (int mode, unsigned long bit); void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg); void process_sgr_mode (unsigned int nargs, const int *arg); - void process_graphics (); // init.C + void init (stringvec *argv, stringvec *envv); + void init (int argc, const char *const *argv, const char *const *envv); + void init2 (int argc, const char *const *argv); void init_vars (); const char **init_resources (int argc, const char *const *argv); - void init (int argc, const char *const *argv, stringvec *envv); void init_env (); void set_locale (const char *locale); void init_xlocale (); @@ -1444,7 +1410,7 @@ void set_title (const char *str); void set_icon_name (const char *str); void set_window_color (int idx, const char *color); - void set_colorfgbg (); + char *get_colorfgbg (); bool set_color (rxvt_color &color, const char *name); void alias_color (int dst, int src); void set_widthheight (unsigned int newwidth, unsigned int newheight); @@ -1489,7 +1455,7 @@ # if ENABLE_STYLES && option (Opt_intensityStyles) # endif - && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) + && IN_RANGE_EXC (base, minCOLOR, minBrightCOLOR)) base += minBrightCOLOR - minCOLOR; #endif return base; @@ -1503,7 +1469,7 @@ # if ENABLE_STYLES && option (Opt_intensityStyles) # endif - && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR)) + && IN_RANGE_EXC (base, minCOLOR, minBrightCOLOR)) base += minBrightCOLOR - minCOLOR; #endif return base; @@ -1516,14 +1482,6 @@ void set_option (uint8_t opt, bool set = true) NOTHROW; - void set_privmode (unsigned bit, int set) NOTHROW - { - if (set) - priv_modes |= bit; - else - priv_modes &= ~bit; - } - // modifies first argument(!) void tt_paste (char *data, unsigned int len) NOTHROW; void paste (char *data, unsigned int len) NOTHROW; @@ -1589,10 +1547,7 @@ void scr_dump (int fd) NOTHROW; void selection_check (int check_more) NOTHROW; - void selection_paste (Window win, Atom prop, bool delete_prop) NOTHROW; - void selection_property (Window win, Atom prop) NOTHROW; void selection_request (Time tm, int selnum = Sel_Primary) NOTHROW; - int selection_request_other (Atom target, int selnum) NOTHROW; void selection_clear (bool clipboard = false) NOTHROW; void selection_make (Time tm); bool selection_grab (Time tm, bool clipboard = false) NOTHROW; @@ -1606,10 +1561,11 @@ void selection_rotate (int x, int y) NOTHROW; // xdefaults.C - void get_options (int argc, const char *const *argv); + const char **get_options (int argc, const char *const *argv); int parse_keysym (const char *str, const char *arg); const char *x_resource (const char *name); void extract_resources (); + void extract_keysym_resources (); }; #endif /* _RXVT_H_ */