testing new loginfo script
[wmaker-crm.git] / src / texture.h
blob19fd5140052afe6dcffc29f128dc5cab7257241d
1 /*
2 * Window Maker window manager
3 *
4 * Copyright (c) 1997-2000 Alfredo K. Kojima
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 * USA.
23 #ifndef WMTEXTURE_H_
24 #define WMTEXTURE_H_
26 #include "screen.h"
27 #include "wcore.h"
29 /* texture relief */
30 #define WREL_RAISED 0
31 #define WREL_SUNKEN 1
32 #define WREL_FLAT 2
33 #define WREL_ICON 4
34 #define WREL_MENUENTRY 6
36 /* texture types */
37 #define WREL_BORDER_MASK 1
39 #define WTEX_SOLID ((1<<1)|WREL_BORDER_MASK)
40 #define WTEX_HGRADIENT ((1<<2)|WREL_BORDER_MASK)
41 #define WTEX_VGRADIENT ((1<<3)|WREL_BORDER_MASK)
42 #define WTEX_DGRADIENT ((1<<4)|WREL_BORDER_MASK)
43 #define WTEX_MHGRADIENT ((1<<5)|WREL_BORDER_MASK)
44 #define WTEX_MVGRADIENT ((1<<6)|WREL_BORDER_MASK)
45 #define WTEX_MDGRADIENT ((1<<7)|WREL_BORDER_MASK)
46 #define WTEX_IGRADIENT ((1<<8)|WREL_BORDER_MASK)
47 #define WTEX_PIXMAP (1<<10)
48 #define WTEX_THGRADIENT ((1<<11)|WREL_BORDER_MASK)
49 #define WTEX_TVGRADIENT ((1<<12)|WREL_BORDER_MASK)
50 #define WTEX_TDGRADIENT ((1<<13)|WREL_BORDER_MASK)
51 #define WTEX_FUNCTION ((1<<14)|WREL_BORDER_MASK)
53 /* pixmap subtypes */
54 #define WTP_TILE 2
55 #define WTP_SCALE 4
56 #define WTP_CENTER 6
59 typedef struct {
60 short type; /* type of texture */
61 char subtype; /* subtype of the texture */
62 XColor color; /* default background color */
63 GC gc; /* gc for the background color */
64 } WTexAny;
67 typedef struct WTexSolid {
68 short type;
69 char subtype;
70 XColor normal;
71 GC normal_gc;
73 GC light_gc;
74 GC dim_gc;
75 GC dark_gc;
77 XColor light;
78 XColor dim;
79 XColor dark;
80 } WTexSolid;
83 typedef struct WTexGradient {
84 short type;
85 char subtype;
86 XColor normal;
87 GC normal_gc;
89 RColor color1;
90 RColor color2;
91 } WTexGradient;
94 typedef struct WTexMGradient {
95 short type;
96 char subtype;
97 XColor normal;
98 GC normal_gc;
100 RColor **colors;
101 } WTexMGradient;
104 typedef struct WTexIGradient {
105 short type;
106 char dummy;
107 XColor normal;
108 GC normal_gc;
110 RColor colors1[2];
111 RColor colors2[2];
112 int thickness1;
113 int thickness2;
114 } WTexIGradient;
117 typedef struct WTexPixmap {
118 short type;
119 char subtype;
120 XColor normal;
121 GC normal_gc;
123 struct RImage *pixmap;
124 } WTexPixmap;
126 typedef struct WTexTGradient {
127 short type;
128 char subtype;
129 XColor normal;
130 GC normal_gc;
132 RColor color1;
133 RColor color2;
134 struct RImage *pixmap;
135 int opacity;
136 } WTexTGradient;
138 typedef struct WTexFunction {
139 short type;
140 char subtype;
141 XColor normal;
142 GC normal_gc;
144 void *handle;
145 RImage *(*render) (int, char**, int, int, int);
146 int argc;
147 char **argv;
148 } WTexFunction;
150 typedef union WTexture {
151 WTexAny any;
152 WTexSolid solid;
153 WTexGradient gradient;
154 WTexIGradient igradient;
155 WTexMGradient mgradient;
156 WTexPixmap pixmap;
157 WTexTGradient tgradient;
158 WTexFunction function;
159 } WTexture;
162 WTexSolid *wTextureMakeSolid(WScreen*, XColor*);
163 WTexGradient *wTextureMakeGradient(WScreen*, int, RColor*, RColor*);
164 WTexMGradient *wTextureMakeMGradient(WScreen*, int, RColor**);
165 WTexTGradient *wTextureMakeTGradient(WScreen*, int, RColor*, RColor*, char *, int);
166 WTexIGradient *wTextureMakeIGradient(WScreen*, int, RColor[], int, RColor[]);
167 WTexPixmap *wTextureMakePixmap(WScreen *scr, int style, char *pixmap_file,
168 XColor *color);
169 #ifdef TEXTURE_PLUGIN
170 WTexFunction *wTextureMakeFunction(WScreen*, char *, char *, int, char **);
171 #endif
172 void wTextureDestroy(WScreen*, WTexture*);
173 void wTexturePaint(WTexture *, Pixmap *, WCoreWindow*, int, int);
174 void wTextureRender(WScreen*, WTexture*, Pixmap*, int, int, int);
175 struct RImage *wTextureRenderImage(WTexture*, int, int, int);
178 void wTexturePaintTitlebar(struct WWindow *wwin, WTexture *texture, Pixmap *tdata,
179 int repaint);
182 #define FREE_PIXMAP(p) if ((p)!=None) XFreePixmap(dpy, (p)), (p)=None
184 void wDrawBevel(Drawable d, unsigned width, unsigned height,
185 WTexSolid *texture, int relief);
187 #endif