… | |
… | |
230 | defaultAlign = centerAlign, |
230 | defaultAlign = centerAlign, |
231 | }; |
231 | }; |
232 | |
232 | |
233 | struct rxvt_image |
233 | struct rxvt_image |
234 | { |
234 | { |
|
|
235 | int id; |
|
|
236 | unsigned short alpha; |
235 | uint8_t flags; |
237 | uint8_t flags; |
236 | unsigned int h_scale, v_scale; /* percents of the window size */ |
238 | unsigned int h_scale, v_scale; /* percents of the window size */ |
237 | int h_align, v_align; /* percents of the window size: |
239 | int h_align, v_align; /* percents of the window size: |
238 | 0 - left align, 50 - center, 100 - right */ |
240 | 0 - left align, 50 - center, 100 - right */ |
239 | |
241 | |
240 | # ifdef HAVE_PIXBUF |
242 | # ifdef HAVE_PIXBUF |
241 | GdkPixbuf *pixbuf; |
243 | GdkPixbuf *pixbuf; |
242 | |
244 | |
243 | ~rxvt_image () |
245 | void destroy () |
244 | { |
246 | { |
245 | if (pixbuf) |
247 | if (pixbuf) |
246 | g_object_unref (pixbuf); |
248 | g_object_unref (pixbuf); |
247 | } |
249 | } |
248 | |
250 | |
… | |
… | |
254 | { |
256 | { |
255 | return gdk_pixbuf_get_height (pixbuf); |
257 | return gdk_pixbuf_get_height (pixbuf); |
256 | } |
258 | } |
257 | # endif |
259 | # endif |
258 | |
260 | |
|
|
261 | rxvt_image (); |
|
|
262 | bool set_file_geometry (const char *file); |
259 | bool set_file (const char *file); |
263 | bool set_file (const char *file); |
260 | bool set_geometry (const char *geom, bool update = false); |
264 | bool set_geometry (const char *geom, bool update = false); |
261 | }; |
265 | }; |
262 | # endif |
266 | # endif |
263 | #endif |
267 | #endif |
… | |
… | |
1153 | }; |
1157 | }; |
1154 | |
1158 | |
1155 | uint8_t bg_flags; |
1159 | uint8_t bg_flags; |
1156 | |
1160 | |
1157 | # ifdef BG_IMAGE_FROM_FILE |
1161 | # ifdef BG_IMAGE_FROM_FILE |
|
|
1162 | vector<rxvt_image> image_vec; |
1158 | rxvt_image bg_image; |
1163 | rxvt_image *new_image () |
|
|
1164 | { |
|
|
1165 | image_vec.resize (image_vec.size () + 1); |
|
|
1166 | return &image_vec.back (); |
|
|
1167 | } |
1159 | void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y); |
1168 | void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y); |
1160 | bool render_image (rxvt_image &image); |
1169 | bool render_image (rxvt_image &image); |
|
|
1170 | void parse_image (int id, const char *type, const char *arg); |
1161 | # endif |
1171 | # endif |
1162 | |
1172 | |
1163 | # ifdef ENABLE_TRANSPARENCY |
1173 | # ifdef ENABLE_TRANSPARENCY |
1164 | Pixmap root_pixmap; /* current root pixmap set */ |
1174 | Pixmap root_pixmap; /* current root pixmap set */ |
1165 | rxvt_color tint; |
1175 | rxvt_color tint; |
… | |
… | |
1199 | } |
1209 | } |
1200 | #endif |
1210 | #endif |
1201 | #ifdef HAVE_PIXBUF |
1211 | #ifdef HAVE_PIXBUF |
1202 | bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, |
1212 | bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, |
1203 | int src_x, int src_y, int dst_x, int dst_y, |
1213 | int src_x, int src_y, int dst_x, int dst_y, |
1204 | unsigned int width, unsigned int height); |
1214 | unsigned int width, unsigned int height, bool argb); |
1205 | #endif |
1215 | #endif |
1206 | |
1216 | |
1207 | #if ENABLE_OVERLAY |
1217 | #if ENABLE_OVERLAY |
1208 | overlay_base ov; |
1218 | overlay_base ov; |
1209 | |
1219 | |
… | |
… | |
1569 | const char **get_options (int argc, const char *const *argv); |
1579 | const char **get_options (int argc, const char *const *argv); |
1570 | int parse_keysym (const char *str, const char *arg); |
1580 | int parse_keysym (const char *str, const char *arg); |
1571 | const char *x_resource (const char *name); |
1581 | const char *x_resource (const char *name); |
1572 | void extract_resources (); |
1582 | void extract_resources (); |
1573 | void extract_keysym_resources (); |
1583 | void extract_keysym_resources (); |
|
|
1584 | void find_resources (const char *n_prefix, const char *c_prefix, int mode, |
|
|
1585 | Bool (*proc)(XrmDatabase *, XrmBindingList, XrmQuarkList, XrmRepresentation *, XrmValue *, XPointer)); |
|
|
1586 | bool parse_bool_resource (const char *str) |
|
|
1587 | { |
|
|
1588 | return (!strcasecmp (str, "TRUE") |
|
|
1589 | || !strcasecmp (str, "YES") |
|
|
1590 | || !strcasecmp (str, "ON") |
|
|
1591 | || !strcasecmp (str, "1")); |
|
|
1592 | } |
1574 | }; |
1593 | }; |
1575 | |
1594 | |
1576 | #endif /* _RXVT_H_ */ |
1595 | #endif /* _RXVT_H_ */ |
1577 | |
1596 | |