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.474 by sf-exg, Sun May 13 21:12:01 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 1141
1089 BG_KEEP_ASPECT = 1 << 3,
1090 BG_ROOT_ALIGN = 1 << 4,
1091 BG_TILE = 1 << 14,
1092 BG_GEOMETRY_FLAGS = BG_KEEP_ASPECT | BG_ROOT_ALIGN | BG_TILE,
1093
1094 BG_TINT_SET = 1 << 5,
1095 BG_TINT_BITAND = 1 << 6,
1096
1097 BG_HAS_RENDER = 1 << 7,
1098 BG_HAS_RENDER_CONV = 1 << 8,
1099 BG_CLIENT_RENDER = 1 << 9,
1100
1101 BG_IS_TRANSPARENT = 1 << 10, 1142 BG_IS_TRANSPARENT = 1 << 1,
1102 BG_NEEDS_REFRESH = 1 << 11, 1143 BG_NEEDS_REFRESH = 1 << 2,
1103 BG_IS_SIZE_SENSITIVE = 1 << 12, 1144
1104 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,
1105 }; 1151 };
1106 1152
1107 unsigned int bg_flags; 1153 uint8_t bg_flags;
1108 1154
1109# ifdef BG_IMAGE_FROM_FILE 1155# ifdef BG_IMAGE_FROM_FILE
1110 void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y); 1156 vector<rxvt_image> image_vec;
1111 bool render_image (bool transparent); 1157 rxvt_image *new_image ()
1112 1158 {
1113 enum { 1159 image_vec.resize (image_vec.size () + 1);
1114 noScale = 0, 1160 return &image_vec.back ();
1115 windowScale = 100,
1116 defaultScale = windowScale,
1117 centerAlign = 50,
1118 defaultAlign = centerAlign,
1119 }; 1161 }
1120 1162 void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y);
1121 unsigned int h_scale, v_scale; /* percents of the window size */ 1163 bool render_image (rxvt_image &image);
1122 int h_align, v_align; /* percents of the window size: 1164 void parse_image (int id, const char *type, const char *arg);
1123 0 - left align, 50 - center, 100 - right */
1124
1125 bool bg_set_geometry (const char *geom, bool update = false);
1126 void bg_set_default_geometry ()
1127 {
1128 h_scale = v_scale = defaultScale;
1129 h_align = v_align = defaultAlign;
1130 }
1131
1132 bool bg_set_file (const char *file);
1133# endif 1165# endif
1134 1166
1135# ifdef ENABLE_TRANSPARENCY 1167# ifdef ENABLE_TRANSPARENCY
1136 Pixmap root_pixmap; /* current root pixmap set */ 1168 Pixmap root_pixmap; /* current root pixmap set */
1137 rxvt_color tint; 1169 rxvt_color tint;
1169 { 1201 {
1170 bg_flags &= ~BG_IS_VALID; 1202 bg_flags &= ~BG_IS_VALID;
1171 } 1203 }
1172#endif 1204#endif
1173#ifdef HAVE_PIXBUF 1205#ifdef HAVE_PIXBUF
1174 GdkPixbuf *pixbuf;
1175 bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, 1206 bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc,
1176 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,
1177 unsigned int width, unsigned int height); 1208 unsigned int width, unsigned int height, bool argb);
1178#endif 1209#endif
1179 1210
1180#if ENABLE_OVERLAY 1211#if ENABLE_OVERLAY
1181 overlay_base ov; 1212 overlay_base ov;
1182 1213
1542 const char **get_options (int argc, const char *const *argv); 1573 const char **get_options (int argc, const char *const *argv);
1543 int parse_keysym (const char *str, const char *arg); 1574 int parse_keysym (const char *str, const char *arg);
1544 const char *x_resource (const char *name); 1575 const char *x_resource (const char *name);
1545 void extract_resources (); 1576 void extract_resources ();
1546 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 }
1547}; 1587};
1548 1588
1549#endif /* _RXVT_H_ */ 1589#endif /* _RXVT_H_ */
1550 1590

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines