openbox/otk/surface.hh

52 lines
1.1 KiB
C++
Raw Normal View History

2003-01-18 03:52:58 +00:00
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
#ifndef __surface_hh
#define __surface_hh
#include "point.hh"
2003-01-18 04:06:39 +00:00
#include "truerendercontrol.hh"
2003-01-18 03:52:58 +00:00
extern "C" {
#include <X11/Xlib.h>
#define _XFT_NO_COMPAT_ // no Xft 1 API
#include <X11/Xft/Xft.h>
2003-01-18 03:52:58 +00:00
}
namespace otk {
class ScreenInfo;
2003-01-18 03:52:58 +00:00
class Surface {
int _screen;
2003-01-18 03:52:58 +00:00
Point _size;
XImage *_im;
2003-01-18 03:52:58 +00:00
Pixmap _pm;
XftDraw *_xftdraw;
2003-01-18 03:52:58 +00:00
void createObjects();
void destroyObjects();
2003-01-18 03:52:58 +00:00
protected:
Surface(int screen);
Surface(int screen, const Point &size);
2003-01-18 03:52:58 +00:00
virtual void setSize(int w, int h);
public:
virtual ~Surface();
inline int screen(void) const { return _screen; }
2003-01-18 03:52:58 +00:00
virtual const Point& size() const { return _size; }
virtual int width() const { return _size.x(); }
virtual int height() const { return _size.y(); }
2003-01-18 04:10:17 +00:00
virtual Pixmap pixmap() const { return _pm; } // TEMP
2003-01-18 04:06:39 +00:00
// The RenderControl classes use the internal objects in this class to render
// to it. Noone else needs them tho, so they are private.
friend class RenderControl;
2003-01-18 04:06:39 +00:00
friend class TrueRenderControl;
2003-01-18 03:52:58 +00:00
};
}
#endif // __surface_hh