]> icculus.org git repositories - dana/openbox.git/blob - otk/surface.hh
remove the XImage from Surface
[dana/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 _pm;
22   XftDraw *_xftdraw;
23
24   void createObjects();
25   void destroyObjects();
26   
27 protected:
28   Surface(int screen);
29   Surface(int screen, const Point &size);
30
31   virtual void setSize(int w, int h);
32
33 public:
34   virtual ~Surface();
35
36   inline int screen(void) const { return _screen; }
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   virtual Pixmap pixmap() const { return _pm; } // TEMP
41
42   // The RenderControl classes use the internal objects in this class to render
43   // to it. Noone else needs them tho, so they are private.
44   friend class RenderControl;
45   friend class TrueRenderControl;
46 };
47
48 }
49
50 #endif // __surface_hh