From 9b6e5f9cf49df78be25720f9c4b33a733b856c9b Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 18 Jan 2003 07:23:28 +0000 Subject: provide RenderControls to all otk from the display class. initialize them all there. try use bitshifts instead of color tables in the TrueRenderControl class for finding correct rgbs. Move the image/pixmap/xftdraw into the surface class, and it maintains them, recreating them when it resizes. --- otk/surface.hh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'otk/surface.hh') diff --git a/otk/surface.hh b/otk/surface.hh index b027f796..53738128 100644 --- a/otk/surface.hh +++ b/otk/surface.hh @@ -7,28 +7,42 @@ extern "C" { #include +#define _XFT_NO_COMPAT_ // no Xft 1 API +#include } namespace otk { +class ScreenInfo; + class Surface { + int _screen; Point _size; + XImage *_im; Pixmap _pm; + XftDraw *_xftdraw; + void createObjects(); + void destroyObjects(); + protected: - Surface(); - Surface(const Point &size); + Surface(int screen); + Surface(int screen, const Point &size); virtual void setSize(int w, int h); public: virtual ~Surface(); + inline int screen(void) const { return _screen; } virtual const Point& size() const { return _size; } virtual int width() const { return _size.x(); } virtual int height() const { return _size.y(); } virtual Pixmap pixmap() const { return _pm; } // TEMP + // 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; friend class TrueRenderControl; }; -- cgit v1.2.3