news download themes documentation links










Color.hh

00001 // Color.hh for Fluxbox Window Manager 
00002 // Copyright (c) 2002 Henrik Kinnunen (fluxgen@users.sourceforge.net)
00003 //
00004 // from Image.hh for Blackbox - an X11 Window manager
00005 // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
00006 //
00007 // Permission is hereby granted, free of charge, to any person obtaining a
00008 // copy of this software and associated documentation files (the "Software"),
00009 // to deal in the Software without restriction, including without limitation
00010 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011 // and/or sell copies of the Software, and to permit persons to whom the
00012 // Software is furnished to do so, subject to the following conditions:
00013 //
00014 // The above copyright notice and this permission notice shall be included in
00015 // all copies or substantial portions of the Software.
00016 //
00017 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00020 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00021 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00022 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00023 // DEALINGS IN THE SOFTWARE.
00024 
00025 // $Id: Color.hh,v 1.6 2003/12/16 17:06:49 fluxgen Exp $
00026 
00027 #ifndef FBTK_COLOR_HH
00028 #define FBTK_COLOR_HH
00029 
00030 #include "NotCopyable.hh"
00031 
00032 namespace FbTk {
00033 
00035 class Color {
00036 public:
00037     Color();
00038     explicit Color(unsigned long pixel);
00039     Color(const Color &col_copy);
00040     Color(unsigned short red, unsigned short green, unsigned short blue, int screen);
00042     Color(const char *color_string, int screen);
00043     ~Color();
00044 
00046     bool setFromString(const char *color_string, int screen);
00048     void setPixel(unsigned long pixel) { m_pixel = pixel; }
00049     // TODO
00050     //Color &operator = (const Color &col_copy);
00051     
00052     inline bool isAllocated() const { return m_allocated; }
00053     inline unsigned short red() const { return m_red; }
00054     inline unsigned short green() const { return m_green; }
00055     inline unsigned short blue() const { return m_blue; }
00056     inline unsigned long pixel() const { return m_pixel; }
00057     
00058 private:
00059     void free();
00060     void copy(const Color &col);
00061     void allocate(unsigned short red, unsigned short green, 
00062                   unsigned short blue, int screen);
00063     inline void setAllocated(bool a) { m_allocated = a; }
00064     void setRGB(unsigned short red, unsigned short green, unsigned short blue);
00065 
00066 
00067     unsigned short m_red, m_green, m_blue;
00068     unsigned long m_pixel;
00069     bool m_allocated;
00070     int m_screen;
00071 };
00072 
00073 } // end namespace FbTk
00074 
00075 #endif // FBTK_COLOR_HH

Fluxbox CVS-Jan-2003




      



Got comments about the page? Send them to webmaster.
If you have general Fluxbox related questions ask them on our irc channel or mailing lists.

Show Source








Designed by aLEczapKA