ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.h
Revision: 1.9
Committed: Thu Nov 15 18:40:10 2007 UTC (16 years, 6 months ago) by sasha
Content type: text/plain
Branch: MAIN
Changes since 1.8: +5 -4 lines
Log Message:
added new geometry op of :root to implement automove-background functionality internally , since absolute pixmap placement no longer supported

File Contents

# Content
1 /*
2 * background.h
3 */
4
5 #ifndef BACKGROUND_H_
6 #define BACKGROUND_H_
7
8 #ifdef HAVE_AFTERIMAGE
9 # include <afterimage.h>
10 # undef min
11 # undef max
12 #endif
13
14 #if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY)
15 # define HAVE_BG_PIXMAP 1/* to simplify further usage */
16 struct bgPixmap_t {
17
18 bgPixmap_t();
19 ~bgPixmap_t();
20
21 enum {
22 geometrySet = (1UL<<0),
23 propScale = (1UL<<1),
24 geometryFlags = (geometrySet|propScale),
25
26 tintSet = (1UL<<8),
27 tintNeeded = (1UL<<9),
28 tintWholesome = (1UL<<10),
29 tintServerSide = (1UL<<11),
30 tintFlags = (tintSet|tintServerSide|tintNeeded|tintWholesome),
31 blurNeeded = (1UL<<12),
32 blurServerSide = (1UL<<13), /* this don't work yet */
33
34 isTransparent = (1UL<<16),
35 isInvalid = (1UL<<17),
36 isVtOrigin = (1UL<<18), /* if set pixmap has origin at corner of
37 vt window instead of parent[0]! */
38 hasChanged = (1UL<<19)
39 };
40
41 unsigned long flags;
42
43 enum {
44 transpPmapTiled = (1UL<<0),
45 transpPmapTinted = tintNeeded,
46 transpPmapBlured = blurNeeded,
47 transpTransformations = (tintNeeded|blurNeeded)
48 }; /* this flags are returned by make_transparency_pixmap if called */
49
50 bool check_clearChanged () { bool r = flags & hasChanged; flags &= ~hasChanged; return r; };
51
52 # ifdef BG_IMAGE_FROM_FILE
53 # ifdef HAVE_AFTERIMAGE
54 ASImage *original_asim;
55 bool render_asim (ASImage *background, ARGB32 background_tint);
56 # endif
57
58 enum {
59 noScale = 0, windowScale = 100, defaultScale = windowScale,
60 centerAlign = 50, defaultAlign = centerAlign,
61 rootAlign = -10000 };
62
63 unsigned int h_scale, v_scale;/* percents of the window size */
64 int h_align, v_align; /* percents of the window size:
65 0 - left align, 50 - center, 100 - right */
66 void unset_geometry () { flags = flags & ~geometryFlags; };
67 bool set_geometry (const char *geom);
68 void set_defaultGeometry ()
69 {
70 h_scale = v_scale = defaultScale;
71 h_align = v_align = defaultAlign;
72 flags |= geometrySet;
73 };
74
75 bool set_file (const char *file);
76 # endif /* BG_IMAGE_FROM_FILE */
77
78 rxvt_term *target;
79 bool set_target (rxvt_term *new_target);
80
81 # ifdef ENABLE_TRANSPARENCY
82 int root_depth; /* obtained when target is set */
83 Pixmap root_pixmap; /* current root pixmap set */
84 rxvt_color tint;
85 int shade;
86 int h_blurRadius, v_blurRadius;
87
88 bool set_transparent ();
89 bool set_blur_radius (const char *geom);
90 bool set_tint (rxvt_color &new_tint);
91 bool unset_tint ();
92 bool set_shade (const char *shade_str);
93 bool set_root_pixmap ();
94
95 unsigned long make_transparency_pixmap ();/* returns combination of the transpTransformations flags */
96 # endif
97 double invalid_since;
98
99 Pixmap pixmap;
100 unsigned int pmap_width, pmap_height;
101 unsigned int pmap_depth;
102
103 bool window_size_sensitive ();
104 bool window_position_sensitive ();
105
106 bool is_parentOrigin () {
107 return !(flags & isVtOrigin);
108 };
109
110 bool need_client_side_rendering ();
111 void apply ();
112 bool render ();
113 void invalidate () {
114 if (!(flags & isInvalid))
115 {
116 flags |= isInvalid;
117 invalid_since = ev::now ();
118 }
119 };
120 };
121 #else
122 # undef HAVE_BG_PIXMAP
123 #endif
124
125
126
127 #endif /* _BACKGROUND_H_ */