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