--- rxvt-unicode/src/rxvtimg.h 2012/06/08 20:35:43 1.25 +++ rxvt-unicode/src/rxvtimg.h 2012/06/09 17:28:03 1.29 @@ -1,13 +1,13 @@ #ifndef IMG_H #define IMG_H -#if HAVE_BG_PIXMAP && BG_IMAGE_FROM_FILE && ENABLE_TRANSPARENCY && HAVE_PIXBUF +#if HAVE_BG_PIXMAP #define HAVE_IMG 1 #endif #if HAVE_IMG -#define float_to_component(d) (uint16_t)((d) * 65535.99) +#define float_to_component(d) (int32_t)((d) * 65535.99) #include @@ -40,8 +40,10 @@ rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int x, int y, int width, int height, int repeat = RepeatNormal); rxvt_img (const rxvt_img &img); +# if HAVE_PIXBUF static rxvt_img *new_from_pixbuf (rxvt_screen *s, GdkPixbuf *pb); // from pixbuf static rxvt_img *new_from_file (rxvt_screen *s, const char *filename); // via pixbuf +# endif static rxvt_img *new_from_root (rxvt_screen *s); // get root pixmap ~rxvt_img (); @@ -66,8 +68,11 @@ void unshare (); // prepare for write void fill (const rxvt_color &c); - void brightness (uint16_t r, uint16_t g, uint16_t b, uint16_t a); - void contrast (uint16_t r, uint16_t g, uint16_t b, uint16_t a); + //void linear_gradient (const XLinearGradient *gradient, const XFixed *stops, const XRenderColor *colors, int nstops); + //void radial_gradient (const XRadialGradient *gradient, const XFixed *stops, const XRenderColor *colors, int nstops); + //void conical_gradient (const XConicalGradient *gradient, const XFixed *stops, const XRenderColor *colors, int nstops); + void brightness (int32_t r, int32_t g, int32_t b, int32_t a); + void contrast (int32_t r, int32_t g, int32_t b, int32_t a); void brightness (double r, double g, double b, double a = 1.) { @@ -95,6 +100,14 @@ rxvt_img *rotate (int new_width, int new_height, int x, int y, double phi); rxvt_img *convert_format (XRenderPictFormat *format, const rxvt_color &bg); rxvt_img *blend (rxvt_img *img, double factor); + + // egregiuous helper category + rxvt_img *replace (rxvt_img *&p) + { + delete p; + p = this; + return this; + } }; #endif