--- rxvt-unicode/src/rxvt.h 2007/07/26 16:17:50 1.279 +++ rxvt-unicode/src/rxvt.h 2007/08/09 22:08:21 1.290 @@ -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) @@ -179,12 +172,56 @@ # 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 { +# 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; + +# ifdef XPM_BACKGROUND +# ifdef HAVE_AFTERIMAGE + ASImage *original_asim; + bool render_asim (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; + flags |= bgPmap_geometrySet; + }; + +# endif /* XPM_BACKGROUND */ + + rxvt_term *target; + bool set_target (rxvt_term *new_target); + +# ifdef ENABLE_TRANSPARENCY + int root_depth; /* obtained when target is set */ + Pixmap root_pixmap; /* current root pixmap set */ + bool make_transparency_pixmap (); +# endif + Pixmap pixmap; -} bgPixmap_t; + unsigned int pmap_width, pmap_height; + unsigned int pmap_depth; + + bool window_size_sensitive (); + void apply_background (); + +}; +#else +# undef HAVE_BG_PIXMAP #endif /* @@ -568,7 +605,7 @@ Color_scroll, Color_trough, #endif -#if TINTING +#if ENABLE_TRANSPARENCY Color_tint, #endif #if OFF_FOCUS_FADING @@ -759,12 +796,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; @@ -1019,16 +1050,12 @@ XComposeStatus compose; ttymode_t tio; row_col_t oldcursor; -#ifdef XPM_BACKGROUND +#ifdef HAVE_BG_PIXMAP bgPixmap_t bgPixmap; -#ifdef HAVE_AFTERIMAGE - struct ASVisual *asv; +#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 @@ -1449,9 +1476,11 @@ 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); + void get_window_origin (int &x, int &y); + Pixmap get_pixmap_property (int prop_id); }; /*