ucolor.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  ucolor.hpp
00004  *  Ubit Project
00005  *  Author: Eric Lecolinet
00006  *  Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs
00007  *  (C) 1999-2006 / Eric Lecolinet / ENST Paris
00008  *
00009  * ***********************************************************************
00010  * COPYRIGHT NOTICE : 
00011  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 
00012  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
00013  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 
00014  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 
00015  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00016  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
00017  * ***********************************************************************
00018  * ==================================================== [(c)Elc] ======= *
00019  * ==================================================== ======== ======= */
00020 
00021 #ifndef _ucolor_hpp_
00022 #define _ucolor_hpp_
00023 //pragma ident  "@(#)ucolor.hpp ubit:05.05.00"
00024 #include <ubit/uprop.hpp>
00025 namespace ubit {
00026 
00027 class  UColorImpl;
00028 
00029 /* ==================================================== ===== ======= */
00040 class UColor : public UProp {
00041 public:
00042   UBIT_ATTR_CLASS(UColor, UProp)
00043 
00044   
00045   static UColor none, inherit, white, black, grey, lightgrey, darkgrey, 
00046     navy, lightblue, blue, red, green, yellow, orange, wheat, teal, disabled;
00047   
00048   UColor();
00049   UColor(const UColor&);
00050   UColor(int r, int g, int b);
00051   UColor(const char* color_spec);
00052   UColor(const UStr& color_spec);
00059   friend UColor& ucolor(const UColor& c) {return *new UColor(c);}
00060   friend UColor& ucolor(int r, int g, int b) {return *new UColor(r,g,b);}
00061   friend UColor& ucolor(const char* c)   {return *new UColor(c);}
00062   friend UColor& ucolor(const UStr& c)   {return *new UColor(c);}
00064 
00065   ~UColor();
00066 
00067   UColor& operator=(const UColor& c) {set(c); return *this;}
00068   virtual void set(const UColor&);
00069   virtual void set(int r, int g, int b);
00070   virtual void set(const char* color_spec);
00071   virtual void set(const UStr& color_spec);
00073 
00074   bool operator==(const UColor& c) const {return equals(c);}
00075   bool operator!=(const UColor& c) const {return !equals(c);}
00076   virtual bool equals(const UColor&) const;
00077 
00078   // - - - impl - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00079 
00080   virtual void update();
00082 
00083   bool realize(UDisp*);
00090 #ifndef NO_DOC
00091   UColor(const UColor&, UMask);
00092   UColor(UColorImpl*, UMask); 
00093   UColorImpl& getImpl() const {return *ci;}
00094   virtual void putProp(UContext*, UControl*);
00095 protected:
00096   uptr<UColorImpl> ci;
00097 #endif
00098 };
00099 
00100 }
00101 #endif
00102 /* ==================================================== [TheEnd] ======= */
00103 /* ==================================================== [(c)Elc] ======= */
00104 

Generated on Mon Jan 29 00:20:37 2007 for Ubit by  doxygen 1.4.7