X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fimagecontrol.cc;h=8cc6b2afb8750c5b7eabd62946348abaa56e24aa;hb=ed4696f6910047ae596a874ef3f1f85b5390aadb;hp=7120f1cf9306be8bc84db9a52fd97ba8a6862367;hpb=373de009f7e98b0c6f3a78f31c1e5c120cd722ed;p=chaz%2Fopenbox diff --git a/otk/imagecontrol.cc b/otk/imagecontrol.cc index 7120f1cf..8cc6b2af 100644 --- a/otk/imagecontrol.cc +++ b/otk/imagecontrol.cc @@ -41,7 +41,8 @@ static unsigned long bsqrt(unsigned long x) { BImageControl *ctrl = 0; -BImageControl::BImageControl(const ScreenInfo *scrn, +BImageControl::BImageControl(OBTimerQueueManager *timermanager, + const ScreenInfo *scrn, bool _dither, int _cpc, unsigned long cache_timeout, unsigned long cmax) { @@ -53,12 +54,11 @@ BImageControl::BImageControl(const ScreenInfo *scrn, cache_max = cmax; if (cache_timeout) { - // XXX: FIX THIS - timer = 0;/*new BTimer(this); + timer = new OBTimer(timermanager, (OBTimeoutHandler)timeout, this); timer->setTimeout(cache_timeout); - timer->start();*/ + timer->start(); } else { - timer = (ob::OBTimer *) 0; + timer = (OBTimer *) 0; } colors = (XColor *) 0; @@ -420,7 +420,7 @@ Pixmap BImageControl::renderImage(unsigned int width, unsigned int height, "forcing cleanout\n"); #endif // DEBUG - timeout(); + timeout(this); } return pixmap; @@ -440,7 +440,7 @@ void BImageControl::removeImage(Pixmap pixmap) { } if (! timer) - timeout(); + timeout(this); } @@ -553,10 +553,10 @@ struct CacheCleaner { }; -void BImageControl::timeout(void) { +void BImageControl::timeout(BImageControl *t) { CacheCleaner cleaner; - std::for_each(cache.begin(), cache.end(), cleaner); - cache.remove_if(cleaner.ref_check); + std::for_each(t->cache.begin(), t->cache.end(), cleaner); + t->cache.remove_if(cleaner.ref_check); } }