Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

ucolor.hpp

00001 /* ==================================================== ======== ======= * 00002 * 00003 * ucolor.hh 00004 * Ubit Project [Elc][2003] 00005 * Author: Eric Lecolinet 00006 * 00007 * Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs 00008 * 00009 * (C) 1999-2003 Eric Lecolinet @ ENST Paris 00010 * WWW: http://www.enst.fr/~elc/ubit Email: elc@enst.fr (subject: ubit) 00011 * 00012 * *********************************************************************** 00013 * COPYRIGHT NOTICE : 00014 * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 00015 * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 00016 * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 00017 * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 00018 * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION. 00019 * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS. 00020 * *********************************************************************** 00021 * 00022 * ==================================================== [Elc:03] ======= * 00023 * ==================================================== ======== ======= */ 00024 00025 #ifndef _ucolor_h 00026 #define _ucolor_h 00027 //pragma ident "@(#)ucolor.hh ubit:03.04.02" 00028 #include <ubit/uprop.hpp> 00029 00032 class UColor : public UProp { 00033 public: 00035 static UColor none, inherit, white, black, grey, lightgrey, darkgrey, 00036 navy, blue, red, green, yellow, lightyellow, orange, wheat, teal, 00037 disabled; 00038 00039 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00040 00041 UColor(); 00043 00044 UColor(const UColor&); 00046 00047 UColor(const char *color_spec); 00048 UColor(const UStr& color_spec); 00053 // UColor(unsigned long pixel); 00054 // creates a new UColor from an X Pixel value. 00055 00056 friend UColor& ucolor(const UColor& c) {return *new UColor(c);} 00057 friend UColor& ucolor(const char* c) {return *new UColor(c);} 00058 friend UColor& ucolor(const UStr& c) {return *new UColor(c);} 00060 00061 ~UColor(); 00062 00063 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00064 00065 UColor& operator=(const UColor&); 00067 00068 virtual void set(const UColor&); 00069 virtual void set(const char* color_spec); 00070 virtual void set(const UStr& color_spec); 00072 00073 virtual bool equals(const UColor&) const; 00075 00076 //unsigned long getPixel() const; {return pixel;} 00078 00079 const char* getCharSpec() const; 00081 00082 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00083 00084 virtual void update(); 00086 00087 bool realize(class UDisp*); 00095 #ifndef NO_DOC 00096 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00097 // implementation 00098 00099 UColor(const UColor&, u_modes); 00100 UColor(class UColorImpl*, u_modes); 00101 00102 UColorImpl& getImpl() const {return *ci;} 00103 virtual void putProp(class UContext*, class UCtrl*); 00104 00105 protected: 00106 uptr<class UColorImpl> ci; 00107 #endif 00108 }; 00109 00110 /* ==================================================== [Elc:03] ======= */ 00111 /* ==================================================== ======== ======= */ 00112 00115 class UBgcolor : public UColor { 00116 public: 00117 static UBgcolor none, inherit, white, black, grey, lightgrey, darkgrey, 00118 navy, blue, red, green, yellow, lightyellow, orange, wheat, teal; 00120 00121 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00122 00123 UBgcolor(); 00124 UBgcolor(const UColor&); 00125 UBgcolor(const char* color_spec); 00126 UBgcolor(const UStr& color_spec); 00128 00129 friend UBgcolor& ubgcolor(const UColor& c) {return *new UBgcolor(c);} 00130 friend UBgcolor& ubgcolor(const char* c) {return *new UBgcolor(c);} 00131 friend UBgcolor& ubgcolor(const UStr& c) {return *new UBgcolor(c);} 00133 00134 UBgcolor& operator=(const UColor&); 00136 00137 #ifndef NO_DOC 00138 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00139 // implementation 00140 00141 UBgcolor(const UColor&, u_modes); 00142 UBgcolor(class UColorImpl*, u_modes); 00143 00144 virtual void putProp(class UContext*, class UCtrl*); 00145 #endif 00146 }; 00147 00148 00149 #endif 00150 /* ==================================================== [TheEnd] ======= */ 00151 /* ==================================================== [Elc:03] ======= */ 00152

Generated on Tue Jul 27 18:01:55 2004 for Ubit[Eric.Lecolinet@enst.fr] by doxygen 1.3.7