--- rxvt-unicode/src/rxvt.h 2007/06/09 13:04:27 1.271 +++ rxvt-unicode/src/rxvt.h 2007/08/07 22:43:33 1.288 @@ -79,12 +79,6 @@ # include #undef min #undef max -#elif defined(XPM_BACKGROUND) -# ifdef XPM_INC_X11 -# include -# else -# include -# endif #endif #ifndef STDIN_FILENO @@ -119,7 +113,6 @@ wchar_t * rxvt_mbstowcs (const char *str, int len = -1); char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); wchar_t * rxvt_utf8towcs (const char *str, int len = -1); -char * rxvt_strdup_cpp (const char *str); #define rxvt_strdup(s) ((s) ? strdup(s) : 0) @@ -136,7 +129,6 @@ int rxvt_Str_escaped (char *str) NOTHROW; char ** rxvt_splitcommastring (const char *cs) NOTHROW; void rxvt_freecommastring (char **cs) NOTHROW; -char * rxvt_File_find (const char *file, const char *ext, const char *path) NOTHROW; ///////////////////////////////////////////////////////////////////////////// @@ -180,12 +172,48 @@ # undef KEEP_SCROLLCOLOR #endif -#ifdef XPM_BACKGROUND -typedef struct { - short w, h, x, y; - bool auto_resize ; +#if defined(XPM_BACKGROUND) || defined(ENABLE_TRANSPARENCY) +# define HAVE_BG_PIXMAP 1/* to simplify further usage */ +struct bgPixmap_t { +# ifdef XPM_BACKGROUND + +# ifdef HAVE_AFTERIMAGE + ASImage *original_asim; + + bool render_asim (rxvt_term *target, ASImage *background, ARGB32 background_tint); +# endif + +#define bgPmap_defaultScale 100 +#define bgPmap_defaultAlign 50 + unsigned int h_scale, v_scale;/* percents of the window size */ + int h_align, v_align; /* percents of the window size: + 0 - left align, 50 - center, 100 - right */ + + bool handle_geometry (const char *geom); + void set_defaultGeometry () + { + h_scale = v_scale = bgPmap_defaultScale; + h_align = v_align = bgPmap_defaultAlign; + }; + +# endif + +# define bgPmap_geometrySet (1UL<<0) +# define bgPmap_propScale (1UL<<1) +# define bgPmap_geometryFlags (bgPmap_geometrySet|bgPmap_propScale) + +# define bgPmap_Transparent (1UL<<16) + unsigned long flags; + Pixmap pixmap; -} bgPixmap_t; + unsigned int pmap_width, pmap_height; + unsigned int pmap_depth; + + bool window_size_sensitive(); + +}; +#else +# undef HAVE_BG_PIXMAP #endif /* @@ -569,7 +597,7 @@ Color_scroll, Color_trough, #endif -#if TINTING +#if ENABLE_TRANSPARENCY Color_tint, #endif #if OFF_FOCUS_FADING @@ -760,12 +788,6 @@ #define scrollbar_size() (scrollBar.end - scrollBar.beg \ - scrollbar_minheight ()) -#ifdef XPM_BACKGROUND -# define XPMClearArea(a, b, c, d, e, f, g) XClearArea((a), (b), (c), (d), (e), (f), (g)) -#else -# define XPMClearArea(a, b, c, d, e, f, g) -#endif - typedef callback log_callback; typedef callback getfd_callback; @@ -901,7 +923,7 @@ struct mbstate mbstate; // current input multibyte state unsigned char want_refresh:1, -#ifdef TRANSPARENT +#ifdef ENABLE_TRANSPARENCY want_full_refresh:1, /* awaiting full screen refresh */ am_transparent:1, /* is a transparent term */ am_pixmap_trans:1, /* transparency w/known root pixmap */ @@ -955,7 +977,6 @@ mouse_slip_wheel_speed, #endif refresh_count, - refresh_limit, last_bot, /* scrollbar last bottom position */ last_top, /* scrollbar last top position */ last_state, /* scrollbar last state */ @@ -1021,15 +1042,12 @@ XComposeStatus compose; ttymode_t tio; row_col_t oldcursor; -#ifdef XPM_BACKGROUND +#ifdef HAVE_BG_PIXMAP bgPixmap_t bgPixmap; -#ifdef HAVE_AFTERIMAGE +#endif +#ifdef HAVE_AFTERIMAGE + ASVisual *asv; ASImageManager *asimman; - ASImage *original_asim; - struct { unsigned int width, height; } xpmAttr; /* all we need is width/height */ -#else - XpmAttributes xpmAttr; /* originally loaded pixmap and its scaling */ -#endif #endif #if ENABLE_OVERLAY @@ -1097,9 +1115,12 @@ XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim); } -#if TRANSPARENT || ENABLE_PERL +#if ENABLE_TRANSPARENCY || ENABLE_PERL void rootwin_cb (XEvent &xev); xevent_watcher rootwin_ev; +#endif +#if ENABLE_TRANSPARENCY + int check_our_parents (); void check_our_parents_cb (time_watcher &w); time_watcher check_our_parents_ev; #endif @@ -1229,7 +1250,6 @@ void focus_in (); void focus_out (); void update_fade_color (unsigned int idx); - int check_our_parents (); #ifdef PRINTPIPE FILE *popen_printer (); int pclose_printer (FILE *stream); @@ -1448,9 +1468,9 @@ void get_xdefaults (FILE *stream, const char *name); void extract_resources (); // xpm.C - int scale_pixmap (const char *geom); +//int scale_pixmap (const char *geom); void resize_pixmap (); - Pixmap set_bgPixmap (const char *file); + void set_bgPixmap (const char *file); }; /*