]> icculus.org git repositories - mikachu/openbox.git/blob - otk/surface.hh
widegt using new render system
[mikachu/openbox.git] / 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
18 class Surface {
19   int _screen;
20   Point _size;
21   Pixmap _pixmap;
22   XftDraw *_xftdraw;
23
24 protected:
25   void createObjects();
26   void destroyObjects();
27
28   void setPixmap(XImage *image);
29   void setPixmap(const Color &color);
30   
31 public:
32   Surface(int screen, const Point &size);
33   virtual ~Surface();
34
35   inline int screen(void) const { return _screen; }
36
37   virtual const Point& size() const { return _size; }
38   virtual int width() const { return _size.x(); }
39   virtual int height() const { return _size.y(); }
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 };
48
49 }
50
51 #endif // __surface_hh