--- rxvt-unicode/src/rxvt.h 2007/07/12 22:33:16 1.277 +++ rxvt-unicode/src/rxvt.h 2007/08/04 07:05:31 1.285 @@ -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,41 @@ # 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; +# 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); + +# 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 /* @@ -568,7 +590,7 @@ Color_scroll, Color_trough, #endif -#if TINTING +#if ENABLE_TRANSPARENCY Color_tint, #endif #if OFF_FOCUS_FADING @@ -759,12 +781,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,19 +1035,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; - /* to get libAfterImage to work with multiple displays we use that hack : */ - /* should not need that with libAfterImage version >= 1.15 */ -#define AFTERIMAGE_DPY_OP(_op) ({::dpy = dpy; _op;}) +#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 @@ -1452,9 +1461,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); }; /*