00001 /* ==================================================== ======== ======= * 00002 * 00003 * usymbol.hpp 00004 * Ubit Project 00005 * Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs 00006 * (C) 1999-2006 Eric Lecolinet / ENST Paris 00007 * 00008 * *********************************************************************** 00009 * COPYRIGHT NOTICE : 00010 * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 00011 * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 00012 * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 00013 * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 00014 * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION. 00015 * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS. 00016 * *********************************************************************** 00017 * ==================================================== [(c)Elc] ======= * 00018 * ==================================================== ======== ======= */ 00019 00020 #ifndef _usymbol_hpp_ 00021 #define _usymbol_hpp_ 00022 //pragma ident "@(#)usymbol_hpp ubit:05.05.00" 00023 #include <ubit/udata.hpp> 00024 namespace ubit { 00025 00026 /* ==================================================== ======== ======= */ 00029 class USymbol: public UData { 00030 public: 00031 UBIT_DATA_ELEMENT_CLASS(USymbol, UData) 00032 00033 00034 static USymbol left, right, up, down, check, radio, square, smallSquare, circle; 00035 00036 USymbol(const USymbol& = USymbol::left); 00037 friend USymbol& usymbol(const USymbol&); 00038 00039 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00040 00041 void set(const USymbol&); 00042 virtual void update(); 00043 00044 void setColor(const UColor&); 00045 void setFrontShadowColor(const UColor&); 00046 void setBackShadowColor(const UColor&); 00047 00048 // - impl. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 00049 00050 protected: 00051 friend class UBox; 00052 enum { 00053 S_LEFT, S_RIGHT, S_UP, S_DOWN, S_CHECK, S_RADIO, S_SQUARE, 00054 S_SMALL_SQUARE, S_CIRCLE 00055 }; 00056 00057 // private constructor (internal implementation): 00058 USymbol(int ix, UMask bmodes = 0); 00059 int ix; // internal index 00060 const class UColor *color, *frontShadowColor, *backShadowColor; 00061 virtual void getSize(UContext&, int& w, int& h) const; 00062 virtual void paint(UGraph&, UContext&, const URegion&) const; 00063 }; 00064 } 00065 #endif 00066 /* ==================================================== [TheEnd] ======= */