… | |
… | |
78 | |
78 | |
79 | #if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY) |
79 | #if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY) |
80 | # define HAVE_BG_PIXMAP 1 |
80 | # define HAVE_BG_PIXMAP 1 |
81 | #endif |
81 | #endif |
82 | |
82 | |
|
|
83 | #include <ecb.h> |
83 | #include "encoding.h" |
84 | #include "encoding.h" |
84 | #include "rxvtutil.h" |
85 | #include "rxvtutil.h" |
85 | #include "rxvtfont.h" |
86 | #include "rxvtfont.h" |
86 | #include "rxvttoolkit.h" |
87 | #include "rxvttoolkit.h" |
87 | #include "scrollbar.h" |
88 | #include "scrollbar.h" |
… | |
… | |
236 | int h_align, v_align; /* percents of the window size: |
237 | int h_align, v_align; /* percents of the window size: |
237 | 0 - left align, 50 - center, 100 - right */ |
238 | 0 - left align, 50 - center, 100 - right */ |
238 | |
239 | |
239 | # ifdef HAVE_PIXBUF |
240 | # ifdef HAVE_PIXBUF |
240 | GdkPixbuf *pixbuf; |
241 | GdkPixbuf *pixbuf; |
241 | # endif |
|
|
242 | |
242 | |
243 | ~rxvt_image () |
243 | ~rxvt_image () |
244 | { |
244 | { |
245 | # ifdef HAVE_PIXBUF |
|
|
246 | if (pixbuf) |
245 | if (pixbuf) |
247 | g_object_unref (pixbuf); |
246 | g_object_unref (pixbuf); |
248 | # endif |
|
|
249 | } |
247 | } |
250 | |
248 | |
251 | int width () |
249 | int width () |
252 | { |
250 | { |
253 | # ifdef HAVE_PIXBUF |
|
|
254 | return gdk_pixbuf_get_width (pixbuf); |
251 | return gdk_pixbuf_get_width (pixbuf); |
255 | # endif |
|
|
256 | } |
252 | } |
257 | int height () |
253 | int height () |
258 | { |
254 | { |
259 | # ifdef HAVE_PIXBUF |
|
|
260 | return gdk_pixbuf_get_height (pixbuf); |
255 | return gdk_pixbuf_get_height (pixbuf); |
|
|
256 | } |
261 | # endif |
257 | # endif |
262 | } |
258 | |
263 | bool set_file (const char *file); |
259 | bool set_file (const char *file); |
264 | bool set_geometry (const char *geom, bool update = false); |
260 | bool set_geometry (const char *geom, bool update = false); |
265 | void set_default_geometry () |
|
|
266 | { |
|
|
267 | h_scale = v_scale = defaultScale; |
|
|
268 | h_align = v_align = defaultAlign; |
|
|
269 | flags |= IM_IS_SIZE_SENSITIVE; |
|
|
270 | } |
|
|
271 | }; |
261 | }; |
272 | # endif |
262 | # endif |
273 | #endif |
263 | #endif |
274 | |
264 | |
275 | /* |
265 | /* |
… | |
… | |
831 | // that are not representable in unicode, as well as characters |
821 | // that are not representable in unicode, as well as characters |
832 | // not fitting in the BMP. |
822 | // not fitting in the BMP. |
833 | struct compose_char |
823 | struct compose_char |
834 | { |
824 | { |
835 | unicode_t c1, c2; // any chars != NOCHAR are valid |
825 | unicode_t c1, c2; // any chars != NOCHAR are valid |
|
|
826 | #if __cplusplus >= 201103L || ECB_GCC_VERSION(4,4) |
|
|
827 | compose_char () = default; |
|
|
828 | #endif |
836 | compose_char (unicode_t c1, unicode_t c2) |
829 | compose_char (unicode_t c1, unicode_t c2) |
837 | : c1(c1), c2(c2) |
830 | : c1(c1), c2(c2) |
838 | { } |
831 | { } |
839 | }; |
832 | }; |
840 | |
833 | |
… | |
… | |
1144 | #ifdef HAVE_BG_PIXMAP |
1137 | #ifdef HAVE_BG_PIXMAP |
1145 | void bg_init (); |
1138 | void bg_init (); |
1146 | void bg_destroy (); |
1139 | void bg_destroy (); |
1147 | |
1140 | |
1148 | enum { |
1141 | enum { |
1149 | BG_IS_VALID = 1 << 0, |
1142 | BG_IS_VALID = 1 << 0, |
1150 | |
1143 | |
1151 | BG_TINT_SET = 1 << 5, |
|
|
1152 | BG_TINT_BITAND = 1 << 6, |
|
|
1153 | |
|
|
1154 | BG_HAS_RENDER = 1 << 7, |
|
|
1155 | BG_HAS_RENDER_CONV = 1 << 8, |
|
|
1156 | BG_CLIENT_RENDER = 1 << 9, |
|
|
1157 | |
|
|
1158 | BG_IS_TRANSPARENT = 1 << 10, |
1144 | BG_IS_TRANSPARENT = 1 << 1, |
1159 | BG_NEEDS_REFRESH = 1 << 11, |
1145 | BG_NEEDS_REFRESH = 1 << 2, |
|
|
1146 | |
|
|
1147 | BG_HAS_RENDER = 1 << 3, |
|
|
1148 | BG_HAS_RENDER_CONV = 1 << 4, |
|
|
1149 | BG_CLIENT_RENDER = 1 << 5, |
|
|
1150 | |
|
|
1151 | BG_TINT_SET = 1 << 6, |
|
|
1152 | BG_TINT_BITAND = 1 << 7, |
1160 | }; |
1153 | }; |
1161 | |
1154 | |
1162 | unsigned int bg_flags; |
1155 | uint8_t bg_flags; |
1163 | |
1156 | |
1164 | # ifdef BG_IMAGE_FROM_FILE |
1157 | # ifdef BG_IMAGE_FROM_FILE |
1165 | rxvt_image bg_image; |
1158 | rxvt_image bg_image; |
1166 | void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y); |
1159 | void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y); |
1167 | bool render_image (rxvt_image &image); |
1160 | bool render_image (rxvt_image &image); |