ucolorImpl.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  ucolorImpl.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 / http://www.enst.fr/~elc/ubit
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 _ucolorImpl_hpp_
00021 #define _ucolorImpl_hpp_
00022 //pragma ident  "@(#)ucolorImpl.hpp     ubit:05.05.00"
00023 namespace ubit {
00024 
00027 class UColorImpl {
00028 public:
00029   /* !!ATT: cette implementation suppose que les pixels ne sont utilises
00030    * que sur les 24 bits de droite !
00031    * de plus, il faut:  valid pixels < UNDEF < NONE < INHERIT <= ULONG_MAX
00032    */
00033   static const USysPixel UNDEF, NONE, INHERIT;
00034 
00035   UColorImpl(int r, int g, int b);
00036   UColorImpl(const char* colspec);   // error if arg is null!
00037   UColorImpl(const char* colspec, USysPixel);
00038   ~UColorImpl();
00039 
00040   bool equals(const UColorImpl& color2) const;
00041   void addPtr() {refcount++;}
00042   void removePtr();
00043   unsigned int getPtrCount() const {return refcount;}
00044 
00045 private:
00046   friend class UColor;
00047   friend class UNatDisp;
00048   unsigned short refcount;
00049   char* natspec;          // native ascii color spec.
00050   std::vector<USysPixel> colors;
00051 };
00052 }
00053 #endif
00054 /* ==================================================== [TheEnd] ======= */
00055 /* ==================================================== [(c)Elc] ======= */
00056 

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