upix.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  upix.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 _upix_hpp_
00022 #define _upix_hpp_
00023 //pragma ident  "@(#)upix.hpp   ubit:05.05.00"
00024 #include <ubit/uima.hpp>
00025 namespace ubit {
00026 
00027 /* ==================================================== ===== ======= */
00033 class UPix: public UIma {
00034 public:
00035   UBIT_DATA_ELEMENT_CLASS(UPix,UIma)
00036   
00037   static UPix
00038     folder, ofolder, doc, diskette, plus, minus, ellipsis, rball,
00039     select, edit, cross, check, zoom, undo, stop, question, hslider, vslider,
00040     left, right, up, down, leftarrow, rightarrow, uparrow, downarrow,
00041     bigFolder, bigDoc, bigText, bigIma, bigUp, bigDown, bigLeft, bigRight,
00042     ray, eyes, windows, book, colors, metal, velin;
00050   UPix(const UStr& filename, bool load_now = false);
00051   UPix(const char* filename = null, bool load_now = false);
00052   UPix(const char** xpm_data, bool load_now = false);
00060   UPix(const char** xpm_data, UMask);
00062   
00063   friend UPix& upix(const UStr& filename)  {return *new UPix(filename);}
00064   friend UPix& upix(const char* filename)  {return *new UPix(filename);}
00065   friend UPix& upix(const char** xpm_data) {return *new UPix(xpm_data);}
00067 
00068   virtual ~UPix();
00069 
00070   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00071   // implementation
00072 
00073   std::vector<UNatPix*>& getNatPixs() const {return natpixs;}
00074   //< [impl]
00075 
00076   virtual UNatPix* getOrCreatePix(UNatDisp*, float xyscale) const;
00077 
00078 #ifndef NO_DOC
00079   virtual void cleanCache();
00080   virtual void getSize(UContext&, int& w, int& h) const;
00081   virtual void paint(UGraph&, UContext&, const URegion&) const;
00082 #endif
00083 
00084 private:
00085   mutable std::vector<UNatPix*> natpixs;
00086 };
00087 }
00088 #endif
00089 /* ==================================================== [TheEnd] ======= */
00090 /* ==================================================== [(c)Elc] ======= */

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