X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Fimage.hh;h=225660cfba494cc07cdfb812ab7b41fed5033019;hb=f94dc995c60462a2e308c61123ede83cc8680736;hp=881656060965caa1d828d3e8194be02ec1060a98;hpb=fa8cefef63feb1d559c40db3cf9407e5bd1ac4df;p=chaz%2Fopenbox diff --git a/otk/image.hh b/otk/image.hh index 88165606..225660cf 100644 --- a/otk/image.hh +++ b/otk/image.hh @@ -1,6 +1,6 @@ -// -*- mode: C++; indent-tabs-mode: nil; -*- -#ifndef __Image_hh -#define __Image_hh +// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- +#ifndef __image_hh +#define __image_hh extern "C" { #include @@ -9,23 +9,23 @@ extern "C" { #include -#include "timer.hh" #include "color.hh" #include "screeninfo.hh" +#include "timer.hh" namespace otk { -class BImageControl; -class BTexture; +class ImageControl; +class Texture; class ScreenInfo; -class BImage { +class Image { private: - BImageControl *control; + ImageControl *control; bool interlaced; XColor *colors; - BColor from, to; + Color from, to; int red_offset, green_offset, blue_offset, red_bits, green_bits, blue_bits, ncolors, cpc, cpccpc; unsigned char *red, *green, *blue, *red_table, *green_table, *blue_table; @@ -39,15 +39,15 @@ private: #endif Pixmap renderPixmap(void); - Pixmap render_solid(const BTexture &texture); - Pixmap render_gradient(const BTexture &texture); + Pixmap render_solid(const Texture &texture); + Pixmap render_gradient(const Texture &texture); XImage *renderXImage(void); void invert(void); void bevel1(void); void bevel2(void); - void border(const BTexture &texture); + void border(const Texture &texture); void dgradient(void); void egradient(void); void hgradient(void); @@ -59,27 +59,29 @@ private: public: - BImage(BImageControl *c, int w, int h); - ~BImage(void); + Image(ImageControl *c, int w, int h); + ~Image(void); - Pixmap render(const BTexture &texture); + Pixmap render(const Texture &texture); }; -class BImageControl : public TimeoutHandler { +class ImageControl { public: +#ifndef SWIG struct CachedImage { Pixmap pixmap; unsigned int count, width, height; unsigned long pixel1, pixel2, texture; }; +#endif - BImageControl(const ScreenInfo *scrn, - bool _dither= False, int _cpc = 4, - unsigned long cache_timeout = 300000l, - unsigned long cmax = 200l); - virtual ~BImageControl(void); + ImageControl(const otk::ScreenInfo *scrn, + bool _dither= False, int _cpc = 4, + unsigned long cache_timeout = 300000l, + unsigned long cmax = 200l); + virtual ~ImageControl(void); inline bool doDither(void) { return dither; } @@ -87,7 +89,7 @@ public: 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; } @@ -97,7 +99,7 @@ public: unsigned long getSqrt(unsigned int x); Pixmap renderImage(unsigned int width, unsigned int height, - const BTexture &texture); + const Texture &texture); void installRootColormap(void); void removeImage(Pixmap pixmap); @@ -111,12 +113,12 @@ public: void setDither(bool d) { dither = d; } void setColorsPerChannel(int cpc); - virtual void timeout(void); + static void timeout(ImageControl *t); private: bool dither; const ScreenInfo *screeninfo; - BTimer *timer; + Timer *timer; Colormap colormap; @@ -136,10 +138,10 @@ private: Pixmap searchCache(const unsigned int width, const unsigned int height, const unsigned long texture, - const BColor &c1, const BColor &c2); + const Color &c1, const Color &c2); }; } -#endif // __Image_hh +#endif // __image_hh