ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/background.h
Revision: 1.46
Committed: Sun Jan 23 12:54:42 2011 UTC (13 years, 4 months ago) by sf-exg
Content type: text/plain
Branch: MAIN
Changes since 1.45: +3 -8 lines
Log Message:
Simplify handling of bg effects flags.

File Contents

# User Rev Content
1 sasha 1.1 /*
2     * background.h
3     */
4    
5     #ifndef BACKGROUND_H_
6     #define BACKGROUND_H_
7    
8     #ifdef HAVE_AFTERIMAGE
9 sasha 1.4 # include <afterimage.h>
10     # undef min
11     # undef max
12 sasha 1.1 #endif
13    
14 sf-exg 1.20 #ifdef HAVE_PIXBUF
15 sf-exg 1.38 #include <gdk-pixbuf/gdk-pixbuf.h>
16 sf-exg 1.20 #endif
17    
18 sasha 1.2 #if defined(BG_IMAGE_FROM_FILE) || defined(ENABLE_TRANSPARENCY)
19 ayin 1.15 # define HAVE_BG_PIXMAP 1 /* to simplify further usage */
20 root 1.10 struct bgPixmap_t
21     {
22     bgPixmap_t ();
23     void destroy ();
24 sasha 1.2
25 sasha 1.1 enum {
26 root 1.16 propScale = 1 << 1,
27 sf-exg 1.23 rootAlign = 1 << 2,
28 sf-exg 1.36 geometryFlags = propScale | rootAlign,
29 root 1.16
30     tintSet = 1 << 8,
31     tintNeeded = 1 << 9,
32     tintWholesome = 1 << 10,
33 sf-exg 1.44 tintFlags = tintNeeded | tintWholesome,
34 root 1.16
35 sf-exg 1.34 blurNeeded = 1 << 11,
36    
37 sf-exg 1.46 effectsFlags = tintNeeded | blurNeeded,
38    
39 sf-exg 1.34 HAS_RENDER = 1 << 12,
40     HAS_RENDER_CONV = 1 << 13,
41 sf-exg 1.40 CLIENT_RENDER = 1 << 14,
42 root 1.16
43     isTransparent = 1 << 16,
44 sf-exg 1.45 isValid = 1 << 17,
45 root 1.16 hasChanged = 1 << 19,
46 sf-exg 1.22 sizeSensitive = 1 << 20,
47 sasha 1.1 };
48    
49 root 1.16 unsigned int flags;
50 sasha 1.1
51 sasha 1.2 # ifdef BG_IMAGE_FROM_FILE
52 sasha 1.1 # ifdef HAVE_AFTERIMAGE
53     ASImage *original_asim;
54     # endif
55    
56 sf-exg 1.20 # ifdef HAVE_PIXBUF
57     GdkPixbuf *pixbuf;
58 sf-exg 1.38 bool pixbuf_to_pixmap (GdkPixbuf *pixbuf, Pixmap pixmap, GC gc,
59     int src_x, int src_y, int dst_x, int dst_y,
60     unsigned int width, unsigned int height);
61 sf-exg 1.20 # endif
62    
63 sf-exg 1.21 void get_image_geometry (int image_width, int image_height, int &w, int &h, int &x, int &y);
64 sf-exg 1.19 bool render_image (unsigned long background_flags);
65 sf-exg 1.18 bool have_image;
66    
67 sasha 1.11 enum {
68     noScale = 0,
69     windowScale = 100,
70     defaultScale = windowScale,
71     centerAlign = 50,
72     defaultAlign = centerAlign,
73     };
74 sasha 1.1
75     unsigned int h_scale, v_scale;/* percents of the window size */
76     int h_align, v_align; /* percents of the window size:
77     0 - left align, 50 - center, 100 - right */
78 sf-exg 1.36 bool set_geometry (const char *geom, bool update = false);
79 sasha 1.1 void set_defaultGeometry ()
80     {
81     h_scale = v_scale = defaultScale;
82     h_align = v_align = defaultAlign;
83 sf-exg 1.35 }
84 sasha 1.1
85     bool set_file (const char *file);
86 sasha 1.2 # endif /* BG_IMAGE_FROM_FILE */
87 sasha 1.1
88     rxvt_term *target;
89 sf-exg 1.33 void set_target (rxvt_term *new_target);
90 sasha 1.1
91     # ifdef ENABLE_TRANSPARENCY
92     Pixmap root_pixmap; /* current root pixmap set */
93     rxvt_color tint;
94     int shade;
95     int h_blurRadius, v_blurRadius;
96    
97     bool set_transparent ();
98     bool set_blur_radius (const char *geom);
99     bool set_tint (rxvt_color &new_tint);
100     bool set_shade (const char *shade_str);
101 sf-exg 1.28 bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height);
102 sf-exg 1.27 bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height);
103 sf-exg 1.30 void set_root_pixmap ();
104 sasha 1.1
105 sf-exg 1.46 unsigned long make_transparency_pixmap ();
106 sasha 1.1 # endif
107 sf-exg 1.42 double valid_since;
108 sasha 1.1
109     Pixmap pixmap;
110     unsigned int pmap_width, pmap_height;
111    
112 sf-exg 1.37 int target_x;
113     int target_y;
114     bool set_position (int x, int y);
115 sasha 1.1 bool window_size_sensitive ();
116 sasha 1.9 bool window_position_sensitive ();
117 sasha 1.1
118     bool render ();
119 root 1.12 void invalidate ()
120     {
121 sf-exg 1.45 flags &= ~isValid;
122 sf-exg 1.35 }
123 sasha 1.1 };
124     #else
125     # undef HAVE_BG_PIXMAP
126     #endif
127    
128    
129    
130 ayin 1.8 #endif /* _BACKGROUND_H_ */