]> icculus.org git repositories - dana/openbox.git/blob - render2/surface.h
add support for shaped surfaces
[dana/openbox.git] / render2 / surface.h
1 #ifndef __render_surface_h
2 #define __render_surface_h
3
4 #include "render.h"
5 #include "texture.h"
6 #include "planar.h"
7 #include <glib.h>
8
9 struct RrNonPlanarSurface {
10     int foo;
11 };
12
13 union RrSurfaceData {
14     struct RrPlanarSurface planar;
15     struct RrNonPlanarSurface nonplanar;
16 };
17
18 struct RrSurface {
19     struct RrInstance *inst;
20
21     enum RrSurfaceType type;
22     union RrSurfaceData data;
23
24     /* This member is created inside Render if parent != NULL, but is passed
25        in if parent == NULL and should not be destroyed!
26
27        Always check for this to be None before rendering it. Just skip by
28        (and assert) if it is None.
29     */
30     Window win; /* XXX this can optionally be None if parent != NULL ... */
31
32     Window shape_base;
33     int shape_base_x;
34     int shape_base_y;
35
36     int ntextures;
37     struct RrTexture *texture;
38
39     struct RrSurface *parent;
40
41     int x;
42     int y;
43     int w;
44     int h;
45
46     int visible : 1;
47
48     GSList *children;
49 };
50
51 struct RrTexture *RrSurfaceTexture(struct RrSurface *sur, int texnum);
52
53 #define RrSurfaceInstance(sur) ((sur)->inst)
54 #define RrSurfaceType(sur) ((sur)->type)
55
56 #define RrSurfaceParent(sur) ((sur)->parent)
57
58 #define RrSurfaceX(sur) ((sur)->x)
59 #define RrSurfaceY(sur) ((sur)->y)
60 #define RrSurfaceWidth(sur) ((sur)->w)
61 #define RrSurfaceHeight(sur) ((sur)->h)
62
63 #define RrSurfaceChildren(sur) ((sur)->children)
64
65 #endif