X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fimagecontrol.cc;h=09823b8e2499e8f30ed8ee0d3dead765727de8b3;hb=a2de94e91e1c0e7775c97745ae11d14e5c5f5659;hp=7120f1cf9306be8bc84db9a52fd97ba8a6862367;hpb=373de009f7e98b0c6f3a78f31c1e5c120cd722ed;p=chaz%2Fopenbox diff --git a/otk/imagecontrol.cc b/otk/imagecontrol.cc index 7120f1cf..09823b8e 100644 --- a/otk/imagecontrol.cc +++ b/otk/imagecontrol.cc @@ -1,4 +1,4 @@ -// -*- mode: C++; indent-tabs-mode: nil; -*- +// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- #ifdef HAVE_CONFIG_H # include "../config.h" @@ -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; @@ -69,10 +69,10 @@ BImageControl::BImageControl(const ScreenInfo *scrn, sqrt_table = (unsigned long *) 0; - screen_depth = screeninfo->getDepth(); - window = screeninfo->getRootWindow(); - screen_number = screeninfo->getScreenNumber(); - colormap = screeninfo->getColormap(); + screen_depth = screeninfo->depth(); + window = screeninfo->rootWindow(); + screen_number = screeninfo->screen(); + colormap = screeninfo->colormap(); int count; XPixmapFormatValues *pmv = XListPixmapFormats(OBDisplay::display, @@ -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); } }