]> icculus.org git repositories - mikachu/openbox.git/blob - otk/surface.hh
provide RenderControls to all otk from the display class. initialize them all there...
[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   XImage *_im;
22   Pixmap _pm;
23   XftDraw *_xftdraw;
24
25   void createObjects();
26   void destroyObjects();
27   
28 protected:
29   Surface(int screen);
30   Surface(int screen, const Point &size);
31
32   virtual void setSize(int w, int h);
33
34 public:
35   virtual ~Surface();
36
37   inline int screen(void) const { return _screen; }
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   virtual Pixmap pixmap() const { return _pm; } // TEMP
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