ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvt.h
(Generate patch)

Comparing rxvt-unicode/src/rxvt.h (file contents):
Revision 1.471 by sf-exg, Wed Apr 11 10:20:00 2012 UTC vs.
Revision 1.484 by sf-exg, Fri May 25 08:27:47 2012 UTC

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"
207 ~localise_env () 208 ~localise_env ()
208 { 209 {
209 environ = orig_env; 210 environ = orig_env;
210 } 211 }
211}; 212};
213
214#ifdef HAVE_BG_PIXMAP
215# ifdef BG_IMAGE_FROM_FILE
216enum {
217 IM_IS_SET = 1 << 0,
218 IM_IS_SIZE_SENSITIVE = 1 << 1,
219 IM_KEEP_ASPECT = 1 << 2,
220 IM_ROOT_ALIGN = 1 << 3,
221 IM_TILE = 1 << 4,
222 IM_GEOMETRY_FLAGS = IM_KEEP_ASPECT | IM_ROOT_ALIGN | IM_TILE,
223};
224
225enum {
226 noScale = 0,
227 windowScale = 100,
228 defaultScale = windowScale,
229 centerAlign = 50,
230 defaultAlign = centerAlign,
231};
232
233struct rxvt_image
234{
235 int id;
236 unsigned short alpha;
237 uint8_t flags;
238 unsigned int h_scale, v_scale; /* percents of the window size */
239 int h_align, v_align; /* percents of the window size:
240 0 - left align, 50 - center, 100 - right */
241
242# ifdef HAVE_PIXBUF
243 auto_ptr<GdkPixbuf> pixbuf;
244
245 int width ()
246 {
247 return gdk_pixbuf_get_width (pixbuf);
248 }
249 int height ()
250 {
251 return gdk_pixbuf_get_height (pixbuf);
252 }
253# endif
254
255 rxvt_image ();
256 bool set_file_geometry (const char *file);
257 bool set_file (const char *file);
258 bool set_geometry (const char *geom, bool update = false);
259};
260# endif
261#endif
212 262
213/* 263/*
214 ***************************************************************************** 264 *****************************************************************************
215 * STRUCTURES AND TYPEDEFS 265 * STRUCTURES AND TYPEDEFS
216 ***************************************************************************** 266 *****************************************************************************
769// that are not representable in unicode, as well as characters 819// that are not representable in unicode, as well as characters
770// not fitting in the BMP. 820// not fitting in the BMP.
771struct compose_char 821struct compose_char
772{ 822{
773 unicode_t c1, c2; // any chars != NOCHAR are valid 823 unicode_t c1, c2; // any chars != NOCHAR are valid
824 #if __cplusplus >= 201103L || ECB_GCC_VERSION(4,4)
825 compose_char () = default;
826 #endif
774 compose_char (unicode_t c1, unicode_t c2) 827 compose_char (unicode_t c1, unicode_t c2)
775 : c1(c1), c2(c2) 828 : c1(c1), c2(c2)
776 { } 829 { }
777}; 830};
778 831
1082#ifdef HAVE_BG_PIXMAP 1135#ifdef HAVE_BG_PIXMAP
1083 void bg_init (); 1136 void bg_init ();
1084 void bg_destroy (); 1137 void bg_destroy ();
1085 1138
1086 enum { 1139 enum {
1087 BG_IS_VALID = 1 << 0, 1140 BG_IS_VALID = 1 << 0,
1088 BG_NEEDS_TINT = 1 << 1,
1089 BG_NEEDS_BLUR = 1 << 2,
1090 1141
1091 BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR,
1092
1093 BG_KEEP_ASPECT = 1 << 3,
1094 BG_ROOT_ALIGN = 1 << 4,
1095 BG_TILE = 1 << 14,
1096 BG_GEOMETRY_FLAGS = BG_KEEP_ASPECT | BG_ROOT_ALIGN | BG_TILE,
1097
1098 BG_TINT_SET = 1 << 5,
1099 BG_TINT_BITAND = 1 << 6,
1100
1101 BG_HAS_RENDER = 1 << 7,
1102 BG_HAS_RENDER_CONV = 1 << 8,
1103 BG_CLIENT_RENDER = 1 << 9,
1104
1105 BG_IS_TRANSPARENT = 1 << 10, 1142 BG_IS_TRANSPARENT = 1 << 1,
1106 BG_NEEDS_REFRESH = 1 << 11, 1143 BG_NEEDS_REFRESH = 1 << 2,
1107 BG_IS_SIZE_SENSITIVE = 1 << 12, 1144
1108 BG_IS_FROM_FILE = 1 << 13, 1145 BG_HAS_RENDER = 1 << 3,
1146 BG_HAS_RENDER_CONV = 1 << 4,
1147 BG_CLIENT_RENDER = 1 << 5,
1148
1149 BG_TINT_SET = 1 << 6,
1150 BG_TINT_BITAND = 1 << 7,
1109 }; 1151 };
1110 1152
1111 unsigned int bg_flags; 1153 uint8_t bg_flags;
1112 1154
1113# ifdef BG_IMAGE_FROM_FILE 1155# ifdef BG_IMAGE_FROM_FILE
1114 void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y); 1156 vector<rxvt_image> image_vec;
1115 bool render_image (bool transparent); 1157 rxvt_image *new_image ()
1116 1158 {
1117 enum { 1159 image_vec.resize (image_vec.size () + 1);
1118 noScale = 0, 1160 return &image_vec.back ();
1119 windowScale = 100,
1120 defaultScale = windowScale,
1121 centerAlign = 50,
1122 defaultAlign = centerAlign,
1123 }; 1161 }
1124 1162 void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y);
1125 unsigned int h_scale, v_scale; /* percents of the window size */ 1163 bool render_image (rxvt_image &image);
1126 int h_align, v_align; /* percents of the window size: 1164 void parse_image (int id, const char *type, const char *arg);
1127 0 - left align, 50 - center, 100 - right */
1128
1129 bool bg_set_geometry (const char *geom, bool update = false);
1130 void bg_set_default_geometry ()
1131 {
1132 h_scale = v_scale = defaultScale;
1133 h_align = v_align = defaultAlign;
1134 }
1135
1136 bool bg_set_file (const char *file);
1137# endif 1165# endif
1138 1166
1139# ifdef ENABLE_TRANSPARENCY 1167# ifdef ENABLE_TRANSPARENCY
1140 Pixmap root_pixmap; /* current root pixmap set */ 1168 Pixmap root_pixmap; /* current root pixmap set */
1141 rxvt_color tint; 1169 rxvt_color tint;
1142 int shade; 1170 int shade;
1143 int h_blurRadius, v_blurRadius; 1171 int h_blurRadius, v_blurRadius;
1144 1172
1145 bool bg_set_transparent (); 1173 void bg_set_transparent ()
1174 {
1175 bg_flags |= BG_IS_TRANSPARENT;
1176 }
1146 void bg_set_root_pixmap (); 1177 void bg_set_root_pixmap ();
1147 void set_tint_shade_flags ();
1148 bool bg_set_tint (rxvt_color &new_tint); 1178 bool bg_set_tint (rxvt_color &new_tint);
1149 bool bg_set_shade (const char *shade_str); 1179 bool bg_set_shade (const char *shade_str);
1150 bool bg_set_blur (const char *geom); 1180 bool bg_set_blur (const char *geom);
1151 1181
1152 bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height, int depth); 1182 bool blur_pixmap (Pixmap pixmap, int width, int height);
1153 bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); 1183 bool tint_pixmap (Pixmap pixmap, int width, int height);
1154 void tint_ximage (Visual *visual, XImage *ximage); 1184 void tint_ximage (XImage *ximage);
1155 bool make_transparency_pixmap (); 1185 bool make_transparency_pixmap ();
1156# endif 1186# endif
1157 1187
1158 ev_tstamp bg_valid_since; 1188 ev_tstamp bg_valid_since;
1159 1189
1171 { 1201 {
1172 bg_flags &= ~BG_IS_VALID; 1202 bg_flags &= ~BG_IS_VALID;
1173 } 1203 }
1174#endif 1204#endif
1175#ifdef HAVE_PIXBUF 1205#ifdef HAVE_PIXBUF
1176 GdkPixbuf *pixbuf;
1177 bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, 1206 bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc,
1178 int src_x, int src_y, int dst_x, int dst_y, 1207 int src_x, int src_y, int dst_x, int dst_y,
1179 unsigned int width, unsigned int height); 1208 unsigned int width, unsigned int height, bool argb);
1180#endif 1209#endif
1181 1210
1182#if ENABLE_OVERLAY 1211#if ENABLE_OVERLAY
1183 overlay_base ov; 1212 overlay_base ov;
1184 1213
1544 const char **get_options (int argc, const char *const *argv); 1573 const char **get_options (int argc, const char *const *argv);
1545 int parse_keysym (const char *str, const char *arg); 1574 int parse_keysym (const char *str, const char *arg);
1546 const char *x_resource (const char *name); 1575 const char *x_resource (const char *name);
1547 void extract_resources (); 1576 void extract_resources ();
1548 void extract_keysym_resources (); 1577 void extract_keysym_resources ();
1578 void find_resources (const char *n_prefix, const char *c_prefix, int mode,
1579 Bool (*proc)(XrmDatabase *, XrmBindingList, XrmQuarkList, XrmRepresentation *, XrmValue *, XPointer));
1580 bool parse_bool_resource (const char *str)
1581 {
1582 return (!strcasecmp (str, "TRUE")
1583 || !strcasecmp (str, "YES")
1584 || !strcasecmp (str, "ON")
1585 || !strcasecmp (str, "1"));
1586 }
1549}; 1587};
1550 1588
1551#endif /* _RXVT_H_ */ 1589#endif /* _RXVT_H_ */
1552 1590

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines