2003-01-18 03:52:58 +00:00
|
|
|
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
|
|
|
|
#ifndef __surface_hh
|
|
|
|
#define __surface_hh
|
|
|
|
|
2003-02-08 07:33:48 +00:00
|
|
|
#include "size.hh"
|
2003-01-18 04:06:39 +00:00
|
|
|
#include "truerendercontrol.hh"
|
2003-02-03 07:06:45 +00:00
|
|
|
#include "pseudorendercontrol.hh"
|
2003-01-18 03:52:58 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#include <X11/Xlib.h>
|
2003-01-18 07:23:28 +00:00
|
|
|
#define _XFT_NO_COMPAT_ // no Xft 1 API
|
|
|
|
#include <X11/Xft/Xft.h>
|
2003-01-18 03:52:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace otk {
|
|
|
|
|
2003-01-18 07:23:28 +00:00
|
|
|
class ScreenInfo;
|
2003-01-20 07:07:13 +00:00
|
|
|
class RenderColor;
|
2003-01-18 07:23:28 +00:00
|
|
|
|
2003-01-18 03:52:58 +00:00
|
|
|
class Surface {
|
2003-01-18 07:23:28 +00:00
|
|
|
int _screen;
|
2003-02-08 07:33:48 +00:00
|
|
|
Size _size;
|
2003-01-20 06:11:12 +00:00
|
|
|
Pixmap _pixmap;
|
2003-01-18 07:23:28 +00:00
|
|
|
XftDraw *_xftdraw;
|
2003-01-18 03:52:58 +00:00
|
|
|
|
2003-01-20 06:11:12 +00:00
|
|
|
protected:
|
2003-01-18 07:23:28 +00:00
|
|
|
void createObjects();
|
|
|
|
void destroyObjects();
|
2003-01-18 03:52:58 +00:00
|
|
|
|
2003-01-20 06:11:12 +00:00
|
|
|
void setPixmap(XImage *image);
|
2003-01-20 07:07:13 +00:00
|
|
|
void setPixmap(const RenderColor &color);
|
2003-01-20 06:11:12 +00:00
|
|
|
|
2003-01-18 03:52:58 +00:00
|
|
|
public:
|
2003-02-08 07:33:48 +00:00
|
|
|
Surface(int screen, const Size &size);
|
2003-01-18 03:52:58 +00:00
|
|
|
virtual ~Surface();
|
|
|
|
|
2003-01-18 07:23:28 +00:00
|
|
|
inline int screen(void) const { return _screen; }
|
2003-01-20 06:11:12 +00:00
|
|
|
|
2003-02-08 07:33:48 +00:00
|
|
|
virtual const Size& size() const { return _size; }
|
2003-01-20 06:11:12 +00:00
|
|
|
|
|
|
|
virtual Pixmap pixmap() const { return _pixmap; }
|
2003-01-18 04:06:39 +00:00
|
|
|
|
2003-01-18 07:23:28 +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-02-03 07:06:45 +00:00
|
|
|
friend class PseudoRenderControl;
|
2003-01-18 03:52:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __surface_hh
|