--- rxvt-unicode/src/rxvt.h 2012/05/19 02:23:07 1.479 +++ rxvt-unicode/src/rxvt.h 2012/05/25 08:27:47 1.484 @@ -232,43 +232,30 @@ struct rxvt_image { + int id; + unsigned short alpha; uint8_t flags; 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 */ # ifdef HAVE_PIXBUF - GdkPixbuf *pixbuf; -# endif - - ~rxvt_image () - { -# ifdef HAVE_PIXBUF - if (pixbuf) - g_object_unref (pixbuf); -# endif - } + auto_ptr pixbuf; int width () { -# ifdef HAVE_PIXBUF return gdk_pixbuf_get_width (pixbuf); -# endif } int height () { -# ifdef HAVE_PIXBUF return gdk_pixbuf_get_height (pixbuf); -# endif } +# endif + + rxvt_image (); + bool set_file_geometry (const char *file); bool set_file (const char *file); bool set_geometry (const char *geom, bool update = false); - void set_default_geometry () - { - h_scale = v_scale = defaultScale; - h_align = v_align = defaultAlign; - flags |= IM_IS_SIZE_SENSITIVE; - } }; # endif #endif @@ -1166,9 +1153,15 @@ uint8_t bg_flags; # ifdef BG_IMAGE_FROM_FILE - rxvt_image bg_image; + vector image_vec; + rxvt_image *new_image () + { + image_vec.resize (image_vec.size () + 1); + return &image_vec.back (); + } void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y); bool render_image (rxvt_image &image); + void parse_image (int id, const char *type, const char *arg); # endif # ifdef ENABLE_TRANSPARENCY @@ -1212,7 +1205,7 @@ #ifdef HAVE_PIXBUF bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, int src_x, int src_y, int dst_x, int dst_y, - unsigned int width, unsigned int height); + unsigned int width, unsigned int height, bool argb); #endif #if ENABLE_OVERLAY @@ -1582,6 +1575,15 @@ const char *x_resource (const char *name); void extract_resources (); void extract_keysym_resources (); + void find_resources (const char *n_prefix, const char *c_prefix, int mode, + Bool (*proc)(XrmDatabase *, XrmBindingList, XrmQuarkList, XrmRepresentation *, XrmValue *, XPointer)); + bool parse_bool_resource (const char *str) + { + return (!strcasecmp (str, "TRUE") + || !strcasecmp (str, "YES") + || !strcasecmp (str, "ON") + || !strcasecmp (str, "1")); + } }; #endif /* _RXVT_H_ */