X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fimage.hh;h=da489323af7e7d1112511d9dbf70d965b0a0a89e;hb=e5eb783aa22440625d497a07fa079cae93bdaa86;hp=85ad287d19930dd1538b7c2160fc526e8c08f571;hpb=85c41a1aec90b8daefc425596ea34b6f9d0e643c;p=chaz%2Fopenbox diff --git a/otk/image.hh b/otk/image.hh index 85ad287d..da489323 100644 --- a/otk/image.hh +++ b/otk/image.hh @@ -9,12 +9,15 @@ extern "C" { #include -#include "timer.hh" -#include "basedisplay.hh" #include "color.hh" +#include "screeninfo.hh" +#include "timer.hh" + +namespace otk { class BImageControl; class BTexture; +class ScreenInfo; class BImage { private: @@ -63,30 +66,31 @@ public: }; -class BImageControl : public TimeoutHandler { +class BImageControl { public: +#ifndef SWIG struct CachedImage { Pixmap pixmap; unsigned int count, width, height; unsigned long pixel1, pixel2, texture; }; +#endif - BImageControl(BaseDisplay *dpy, const ScreenInfo *scrn, + BImageControl(otk::OBTimerQueueManager *timermanager, + const otk::ScreenInfo *scrn, bool _dither= False, int _cpc = 4, unsigned long cache_timeout = 300000l, unsigned long cmax = 200l); virtual ~BImageControl(void); - inline BaseDisplay *getBaseDisplay(void) const { return basedisplay; } - inline bool doDither(void) { return dither; } - inline const ScreenInfo *getScreenInfo(void) { return screeninfo; } + inline const ScreenInfo* getScreenInfo() const { return screeninfo; } inline Window getDrawable(void) const { return window; } - inline Visual *getVisual(void) { return screeninfo->getVisual(); } + inline Visual *getVisual(void) { return screeninfo->visual(); } inline int getBitsPerPixel(void) const { return bits_per_pixel; } inline int getDepth(void) const { return screen_depth; } @@ -96,7 +100,7 @@ public: unsigned long getSqrt(unsigned int x); Pixmap renderImage(unsigned int width, unsigned int height, - const BTexture &texture); + const otk::BTexture &texture); void installRootColormap(void); void removeImage(Pixmap pixmap); @@ -110,13 +114,12 @@ public: void setDither(bool d) { dither = d; } void setColorsPerChannel(int cpc); - virtual void timeout(void); + static void timeout(BImageControl *t); private: bool dither; - BaseDisplay *basedisplay; const ScreenInfo *screeninfo; - BTimer *timer; + OBTimer *timer; Colormap colormap; @@ -139,6 +142,7 @@ private: const BColor &c1, const BColor &c2); }; +} #endif // __Image_hh