]> Dogcows Code - chaz/openbox/blob - otk/surface.hh
7a202491f188392b5e0f5d7e354bf2ea6f6febb2
[chaz/openbox] / otk / surface.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 #ifndef __surface_hh
3 #define __surface_hh
4
5 #include "size.hh"
6 #include "truerendercontrol.hh"
7 #include "pseudorendercontrol.hh"
8
9 extern "C" {
10 #include <X11/Xlib.h>
11 #define _XFT_NO_COMPAT_ // no Xft 1 API
12 #include <X11/Xft/Xft.h>
13 }
14
15 namespace otk {
16
17 class ScreenInfo;
18 class RenderColor;
19
20 class Surface {
21 int _screen;
22 Size _size;
23 Pixmap _pixmap;
24 XftDraw *_xftdraw;
25
26 protected:
27 void createObjects();
28 void destroyObjects();
29
30 void setPixmap(XImage *image);
31 void setPixmap(const RenderColor &color);
32
33 public:
34 Surface(int screen, const Size &size);
35 virtual ~Surface();
36
37 inline int screen(void) const { return _screen; }
38
39 virtual const Size& size() const { return _size; }
40
41 virtual Pixmap pixmap() const { return _pixmap; }
42
43 // The RenderControl classes use the internal objects in this class to render
44 // to it. Noone else needs them tho, so they are private.
45 friend class RenderControl;
46 friend class TrueRenderControl;
47 friend class PseudoRenderControl;
48 };
49
50 }
51
52 #endif // __surface_hh
This page took 0.037834 seconds and 3 git commands to generate.