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

Comparing rxvt-unicode/src/background.h (file contents):
Revision 1.1 by sasha, Wed Sep 12 20:29:24 2007 UTC vs.
Revision 1.13 by sasha, Fri Jan 4 21:25:57 2008 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines