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.467 by root, Thu Jan 19 17:10:51 2012 UTC vs.
Revision 1.484 by sf-exg, Fri May 25 08:27:47 2012 UTC

70#include <X11/cursorfont.h> 70#include <X11/cursorfont.h>
71#include <X11/keysym.h> 71#include <X11/keysym.h>
72#include <X11/keysymdef.h> 72#include <X11/keysymdef.h>
73#include <X11/Xatom.h> 73#include <X11/Xatom.h>
74 74
75#ifdef HAVE_AFTERIMAGE
76# include <afterimage.h>
77# undef min
78# undef max
79#endif
80
81#ifdef HAVE_PIXBUF 75#ifdef HAVE_PIXBUF
82# include <gdk-pixbuf/gdk-pixbuf.h> 76# include <gdk-pixbuf/gdk-pixbuf.h>
83#endif 77#endif
84 78
85#if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY) 79#if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY)
86# define HAVE_BG_PIXMAP 1 80# define HAVE_BG_PIXMAP 1
87#endif 81#endif
88 82
83#include <ecb.h>
89#include "encoding.h" 84#include "encoding.h"
90#include "rxvtutil.h" 85#include "rxvtutil.h"
91#include "rxvtfont.h" 86#include "rxvtfont.h"
92#include "rxvttoolkit.h" 87#include "rxvttoolkit.h"
93#include "scrollbar.h" 88#include "scrollbar.h"
213 ~localise_env () 208 ~localise_env ()
214 { 209 {
215 environ = orig_env; 210 environ = orig_env;
216 } 211 }
217}; 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
218 262
219/* 263/*
220 ***************************************************************************** 264 *****************************************************************************
221 * STRUCTURES AND TYPEDEFS 265 * STRUCTURES AND TYPEDEFS
222 ***************************************************************************** 266 *****************************************************************************
775// that are not representable in unicode, as well as characters 819// that are not representable in unicode, as well as characters
776// not fitting in the BMP. 820// not fitting in the BMP.
777struct compose_char 821struct compose_char
778{ 822{
779 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
780 compose_char (unicode_t c1, unicode_t c2) 827 compose_char (unicode_t c1, unicode_t c2)
781 : c1(c1), c2(c2) 828 : c1(c1), c2(c2)
782 { } 829 { }
783}; 830};
784 831
1088#ifdef HAVE_BG_PIXMAP 1135#ifdef HAVE_BG_PIXMAP
1089 void bg_init (); 1136 void bg_init ();
1090 void bg_destroy (); 1137 void bg_destroy ();
1091 1138
1092 enum { 1139 enum {
1093 //subset returned by make_transparency_pixmap
1094 BG_IS_VALID = 1 << 0, 1140 BG_IS_VALID = 1 << 0,
1095 BG_NEEDS_TINT = 1 << 1,
1096 BG_NEEDS_BLUR = 1 << 2,
1097 1141
1098 BG_EFFECTS_FLAGS = BG_NEEDS_TINT | BG_NEEDS_BLUR,
1099
1100 BG_KEEP_ASPECT = 1 << 3,
1101 BG_ROOT_ALIGN = 1 << 4,
1102 BG_TILE = 1 << 14,
1103 BG_GEOMETRY_FLAGS = BG_KEEP_ASPECT | BG_ROOT_ALIGN | BG_TILE,
1104
1105 BG_TINT_SET = 1 << 5,
1106 BG_TINT_BITAND = 1 << 6,
1107 BG_TINT_FLAGS = BG_NEEDS_TINT | BG_TINT_BITAND,
1108
1109 BG_HAS_RENDER = 1 << 7,
1110 BG_HAS_RENDER_CONV = 1 << 8,
1111 BG_CLIENT_RENDER = 1 << 9,
1112
1113 BG_IS_TRANSPARENT = 1 << 10, 1142 BG_IS_TRANSPARENT = 1 << 1,
1114 BG_NEEDS_REFRESH = 1 << 11, 1143 BG_NEEDS_REFRESH = 1 << 2,
1115 BG_IS_SIZE_SENSITIVE = 1 << 12, 1144
1116 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,
1117 }; 1151 };
1118 1152
1119 unsigned int bg_flags; 1153 uint8_t bg_flags;
1120 1154
1121# ifdef BG_IMAGE_FROM_FILE 1155# ifdef BG_IMAGE_FROM_FILE
1122 void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y); 1156 vector<rxvt_image> image_vec;
1123 bool render_image (unsigned long tr_flags); 1157 rxvt_image *new_image ()
1124 1158 {
1125 enum { 1159 image_vec.resize (image_vec.size () + 1);
1126 noScale = 0, 1160 return &image_vec.back ();
1127 windowScale = 100,
1128 defaultScale = windowScale,
1129 centerAlign = 50,
1130 defaultAlign = centerAlign,
1131 }; 1161 }
1132 1162 void get_image_geometry (rxvt_image &image, int &w, int &h, int &x, int &y);
1133 unsigned int h_scale, v_scale; /* percents of the window size */ 1163 bool render_image (rxvt_image &image);
1134 int h_align, v_align; /* percents of the window size: 1164 void parse_image (int id, const char *type, const char *arg);
1135 0 - left align, 50 - center, 100 - right */
1136
1137 bool bg_set_geometry (const char *geom, bool update = false);
1138 void bg_set_default_geometry ()
1139 {
1140 h_scale = v_scale = defaultScale;
1141 h_align = v_align = defaultAlign;
1142 }
1143
1144 bool bg_set_file (const char *file);
1145# endif 1165# endif
1146 1166
1147# ifdef ENABLE_TRANSPARENCY 1167# ifdef ENABLE_TRANSPARENCY
1148 Pixmap root_pixmap; /* current root pixmap set */ 1168 Pixmap root_pixmap; /* current root pixmap set */
1149 rxvt_color tint; 1169 rxvt_color tint;
1150 int shade; 1170 int shade;
1151 int h_blurRadius, v_blurRadius; 1171 int h_blurRadius, v_blurRadius;
1152 1172
1153 bool bg_set_transparent (); 1173 void bg_set_transparent ()
1174 {
1175 bg_flags |= BG_IS_TRANSPARENT;
1176 }
1154 void bg_set_root_pixmap (); 1177 void bg_set_root_pixmap ();
1155 void set_tint_shade_flags ();
1156 bool bg_set_tint (rxvt_color &new_tint); 1178 bool bg_set_tint (rxvt_color &new_tint);
1157 bool bg_set_shade (const char *shade_str); 1179 bool bg_set_shade (const char *shade_str);
1158 bool bg_set_blur (const char *geom); 1180 bool bg_set_blur (const char *geom);
1159 1181
1160 bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height, int depth); 1182 bool blur_pixmap (Pixmap pixmap, int width, int height);
1161 bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height); 1183 bool tint_pixmap (Pixmap pixmap, int width, int height);
1162 void tint_ximage (Visual *visual, XImage *ximage); 1184 void tint_ximage (XImage *ximage);
1163 unsigned long make_transparency_pixmap (); 1185 bool make_transparency_pixmap ();
1164# endif 1186# endif
1165 1187
1166 ev_tstamp bg_valid_since; 1188 ev_tstamp bg_valid_since;
1167 1189
1168 Pixmap bg_pixmap; 1190 Pixmap bg_pixmap;
1178 void bg_invalidate () 1200 void bg_invalidate ()
1179 { 1201 {
1180 bg_flags &= ~BG_IS_VALID; 1202 bg_flags &= ~BG_IS_VALID;
1181 } 1203 }
1182#endif 1204#endif
1183#ifdef HAVE_AFTERIMAGE
1184 ASImage *original_asim;
1185 ASVisual *asv;
1186 ASImageManager *asimman;
1187
1188 void init_asv ()
1189 {
1190 if (!asv)
1191 asv = create_asvisual_for_id (dpy, display->screen, depth, XVisualIDFromVisual (visual), cmap, NULL);
1192 }
1193#endif
1194#ifdef HAVE_PIXBUF 1205#ifdef HAVE_PIXBUF
1195 GdkPixbuf *pixbuf;
1196 bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc, 1206 bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc,
1197 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,
1198 unsigned int width, unsigned int height); 1208 unsigned int width, unsigned int height, bool argb);
1199#endif 1209#endif
1200 1210
1201#if ENABLE_OVERLAY 1211#if ENABLE_OVERLAY
1202 overlay_base ov; 1212 overlay_base ov;
1203 1213
1279 void cmdbuf_append (const char *str, size_t count); 1289 void cmdbuf_append (const char *str, size_t count);
1280 bool pty_fill (); 1290 bool pty_fill ();
1281 void pty_cb (ev::io &w, int revents); ev::io pty_ev; 1291 void pty_cb (ev::io &w, int revents); ev::io pty_ev;
1282 1292
1283#ifdef CURSOR_BLINK 1293#ifdef CURSOR_BLINK
1294 void cursor_blink_reset ();
1284 void cursor_blink_cb (ev::timer &w, int revents); ev::timer cursor_blink_ev; 1295 void cursor_blink_cb (ev::timer &w, int revents); ev::timer cursor_blink_ev;
1285#endif 1296#endif
1286#ifdef TEXT_BLINK 1297#ifdef TEXT_BLINK
1287 void text_blink_cb (ev::timer &w, int revents); ev::timer text_blink_ev; 1298 void text_blink_cb (ev::timer &w, int revents); ev::timer text_blink_ev;
1288#endif 1299#endif
1562 const char **get_options (int argc, const char *const *argv); 1573 const char **get_options (int argc, const char *const *argv);
1563 int parse_keysym (const char *str, const char *arg); 1574 int parse_keysym (const char *str, const char *arg);
1564 const char *x_resource (const char *name); 1575 const char *x_resource (const char *name);
1565 void extract_resources (); 1576 void extract_resources ();
1566 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 }
1567}; 1587};
1568 1588
1569#endif /* _RXVT_H_ */ 1589#endif /* _RXVT_H_ */
1570 1590

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines