X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Fcolor.hh;h=7fe281b475c2733f2c81e68a8d209d5b522523f0;hb=23940f9e034af023af610c56e915a6044ea436ec;hp=387c81bf109775625c514dba24279f26cfaa4f89;hpb=fa8cefef63feb1d559c40db3cf9407e5bd1ac4df;p=chaz%2Fopenbox diff --git a/otk/color.hh b/otk/color.hh index 387c81bf..7fe281b4 100644 --- a/otk/color.hh +++ b/otk/color.hh @@ -1,6 +1,6 @@ // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -#ifndef COLOR_HH -#define COLOR_HH +#ifndef __color_hh +#define __color_hh extern "C" { #include @@ -11,12 +11,12 @@ extern "C" { namespace otk { -class BColor { +class Color { public: - BColor(unsigned int _screen = ~(0u)); - BColor(int _r, int _g, int _b, unsigned int _screen = ~(0u)); - BColor(const std::string &_name, unsigned int _screen = ~(0u)); - ~BColor(void); + Color(unsigned int _screen = ~(0u)); + Color(int _r, int _g, int _b, unsigned int _screen = ~(0u)); + Color(const std::string &_name, unsigned int _screen = ~(0u)); + ~Color(void); inline const std::string &name(void) const { return colorname; } @@ -40,10 +40,12 @@ public: unsigned long pixel(void) const; // operators - BColor &operator=(const BColor &c); - inline bool operator==(const BColor &c) const +#ifndef SWIG + Color &operator=(const Color &c); +#endif + inline bool operator==(const Color &c) const { return (r == c.r && b == c.b && b == c.b); } - inline bool operator!=(const BColor &c) const + inline bool operator!=(const Color &c) const { return (! operator==(c)); } static void cleanupColorCache(void); @@ -97,4 +99,4 @@ private: } -#endif // COLOR_HH +#endif // __color_hh