]> Dogcows Code - chaz/openbox/blob - render/render.h
make the ~/.openbox dir on startup
[chaz/openbox] / render / render.h
1 #ifndef __render_h
2 #define __render_h
3
4 #include <X11/Xlib.h>
5 #define _XFT_NO_COMPAT_ /* no Xft 1 API */
6 #include <X11/Xft/Xft.h>
7 #include <glib.h>
8 #include "color.h"
9
10 typedef enum {
11 Surface_Planar,
12 Surface_Nonplanar
13 } SurfaceType;
14
15 typedef enum {
16 Flat,
17 Raised,
18 Sunken
19 } ReliefType;
20
21 typedef enum {
22 Bevel1,
23 Bevel2
24 } BevelType;
25
26 typedef enum {
27 Background_ParentRelative,
28 Background_Solid,
29 Background_Horizontal,
30 Background_Vertical,
31 Background_Diagonal,
32 Background_CrossDiagonal,
33 Background_PipeCross,
34 Background_Rectangle,
35 Background_Pyramid,
36 Background_Elliptic
37 } SurfaceColorType;
38
39 typedef enum {
40 Bitmask,
41 Text,
42 RGBA
43 } TextureType;
44
45 typedef struct PlanarSurface {
46 SurfaceColorType grad;
47 ReliefType relief;
48 BevelType bevel;
49 color_rgb *primary;
50 color_rgb *secondary;
51 color_rgb *border_color;
52 gboolean interlaced;
53 gboolean border;
54 pixel32 *pixel_data;
55 } PlanarSurface;
56
57 typedef struct NonplanarSurface {
58 int poo;
59 } NonplanarSurface;
60
61 typedef union {
62 PlanarSurface planar;
63 NonplanarSurface nonplanar;
64 } SurfaceData;
65
66 typedef struct Surface {
67 SurfaceType type;
68 SurfaceColorType colortype;
69 SurfaceData data;
70 } Surface;
71
72 typedef struct {
73 XftFont *xftfont;
74 int height;
75 } ObFont;
76
77 typedef enum {
78 Justify_Center,
79 Justify_Left,
80 Justify_Right
81 } Justify;
82
83 typedef struct TextureText {
84 ObFont *font;
85 Justify justify;
86 int shadow;
87 unsigned char tint;
88 unsigned char offset;
89 color_rgb *color;
90 char *string;
91 } TextureText;
92
93 typedef struct {
94 Pixmap mask;
95 guint w, h;
96 } pixmap_mask;
97
98 typedef struct TextureMask {
99 color_rgb *color;
100 pixmap_mask *mask;
101 } TextureMask;
102
103 typedef struct TextureRGBA {
104 int poo;
105 } TextureRGBA;
106
107 typedef union {
108 TextureRGBA rgba;
109 TextureText text;
110 TextureMask mask;
111 } TextureData;
112
113 typedef struct Texture {
114 TextureType type;
115 TextureData data;
116 } Texture;
117
118 typedef struct Appearance {
119 Surface surface;
120 int textures;
121 Texture *texture;
122 Pixmap pixmap;
123 XftDraw *xftdraw;
124 } Appearance;
125
126 extern Visual *render_visual;
127 extern int render_depth;
128 extern Colormap render_colormap;
129
130 void (*paint)(Window win, Appearance *l, int x, int y, int w, int h);
131
132 void render_startup(void);
133 void init_appearance(Appearance *l);
134 void x_paint(Window win, Appearance *l, int x, int y, int w, int h);
135 void render_shutdown(void);
136 Appearance *appearance_new(SurfaceType type, int numtex);
137 Appearance *appearance_copy(Appearance *a);
138 void appearance_free(Appearance *a);
139 void truecolor_startup(void);
140 #endif /*__render_h*/
This page took 0.03884 seconds and 4 git commands to generate.