--- rxvt-unicode/src/rxvt.h 2011/08/09 18:41:31 1.446 +++ rxvt-unicode/src/rxvt.h 2012/05/13 15:50:18 1.473 @@ -1,17 +1,17 @@ #ifndef RXVT_H_ /* include once only */ #define RXVT_H_ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #ifdef HAVE_STDINT_H #include #endif #include #include -#include +#include #include #ifdef HAVE_SYS_IOCTL_H #include @@ -20,16 +20,12 @@ #include #endif -#if HAVE_CWCHAR -# include -#elif HAVE_WCHAR_H +#if HAVE_WCHAR_H # include #else // stdlib.h might provide it #endif -using namespace std; - // we assume that Xlib.h defines XPointer, and it does since at least 1994... extern "C" { @@ -76,12 +72,6 @@ #include #include -#ifdef HAVE_AFTERIMAGE -# include -# undef min -# undef max -#endif - #ifdef HAVE_PIXBUF # include #endif @@ -872,6 +862,8 @@ struct TermWin_t { + int vt_width; /* actual window width [pixels] */ + int vt_height; /* actual window height [pixels] */ int width; /* window width [pixels] */ int height; /* window height [pixels] */ int fwidth; /* font width [pixels] */ @@ -893,7 +885,6 @@ Window parent; /* parent identifier */ Window vt; /* vt100 window */ GC gc; /* GC for drawing */ - Pixmap pixmap; rxvt_drawable *drawable; rxvt_fontset *fontset[4]; }; @@ -1030,6 +1021,7 @@ 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, @@ -1073,8 +1065,6 @@ 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; /* ---------- */ @@ -1094,21 +1084,15 @@ void bg_destroy (); enum { - //subset returned by make_transparency_pixmap BG_IS_VALID = 1 << 0, - BG_NEEDS_TINT = 1 << 1, - BG_NEEDS_BLUR = 1 << 2, - 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_TILE = 1 << 14, - BG_GEOMETRY_FLAGS = BG_PROP_SCALE | BG_ROOT_ALIGN | BG_TILE, + BG_GEOMETRY_FLAGS = BG_KEEP_ASPECT | BG_ROOT_ALIGN | BG_TILE, BG_TINT_SET = 1 << 5, BG_TINT_BITAND = 1 << 6, - BG_TINT_FLAGS = BG_NEEDS_TINT | BG_TINT_BITAND, BG_HAS_RENDER = 1 << 7, BG_HAS_RENDER_CONV = 1 << 8, @@ -1124,7 +1108,7 @@ # ifdef BG_IMAGE_FROM_FILE void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y); - bool render_image (unsigned long tr_flags); + bool render_image (bool transparent); enum { noScale = 0, @@ -1154,16 +1138,19 @@ int shade; int h_blurRadius, v_blurRadius; - bool bg_set_transparent (); + void bg_set_transparent () + { + bg_flags |= BG_IS_TRANSPARENT; + } void bg_set_root_pixmap (); - void set_tint_shade_flags (); bool bg_set_tint (rxvt_color &new_tint); bool bg_set_shade (const char *shade_str); bool bg_set_blur (const char *geom); - bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height); + bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height, int depth); bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); - unsigned long make_transparency_pixmap (); + void tint_ximage (Visual *visual, XImage *ximage); + bool make_transparency_pixmap (); # endif ev_tstamp bg_valid_since; @@ -1183,17 +1170,6 @@ bg_flags &= ~BG_IS_VALID; } #endif -#ifdef HAVE_AFTERIMAGE - ASImage *original_asim; - ASVisual *asv; - ASImageManager *asimman; - - void init_asv () - { - if (!asv) - asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL); - } -#endif #ifdef HAVE_PIXBUF GdkPixbuf *pixbuf; bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, @@ -1216,11 +1192,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 */ @@ -1289,6 +1260,7 @@ void pty_cb (ev::io &w, int revents); ev::io pty_ev; #ifdef CURSOR_BLINK + void cursor_blink_reset (); void cursor_blink_cb (ev::timer &w, int revents); ev::timer cursor_blink_ev; #endif #ifdef TEXT_BLINK @@ -1318,12 +1290,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); @@ -1390,9 +1356,11 @@ void process_terminal_mode (int mode, int priv, unsigned int nargs, const int *arg); void process_sgr_mode (unsigned int nargs, const int *arg); // 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 (); @@ -1420,7 +1388,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); @@ -1465,7 +1433,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; @@ -1479,7 +1447,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; @@ -1492,14 +1460,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; @@ -1579,10 +1539,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_ */