openbox/otk/surface.hh

53 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;
class RenderColor;
2003-01-18 03:52:58 +00:00
class Surface {
int _screen;
2003-01-18 03:52:58 +00:00
Point _size;
2003-01-20 06:11:12 +00:00
Pixmap _pixmap;
XftDraw *_xftdraw;
2003-01-18 03:52:58 +00:00
2003-01-20 06:11:12 +00:00
protected:
void createObjects();
void destroyObjects();
2003-01-18 03:52:58 +00:00
2003-01-20 06:11:12 +00:00
void setPixmap(XImage *image);
void setPixmap(const RenderColor &color);
2003-01-20 06:11:12 +00:00
2003-01-18 03:52:58 +00:00
public:
2003-01-20 06:11:12 +00:00
Surface(int screen, const Point &size);
2003-01-18 03:52:58 +00:00
virtual ~Surface();
inline int screen(void) const { return _screen; }
2003-01-20 06:11:12 +00:00
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-20 06:11:12 +00:00
virtual Pixmap pixmap() const { return _pixmap; }
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