uwinImpl.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  uwinImpl.hpp : Window Implementation
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 _uwinImpl_hpp_
00021 #define _uwinImpl_hhp_
00022 //pragma ident  "@(#)uwinImpl.hpp       ubit:05.02.00"
00023 #include <ubit/uprop.hpp>
00024 #include <ubit/uboxGeom.hpp>
00025 #include <ubit/uboxLayout.hpp>
00026 #include <ubit/ugraph.hpp>
00027 namespace ubit {
00028 
00029 class UWinImpl {
00030 public:
00031   virtual ~UWinImpl() {};
00032 };
00033 
00034 /* ==================================================== ======== ======= */
00035 
00036 class USoftWinImpl : public UWinImpl {
00037 public:
00038   USoftWinImpl(UWin&);
00039   virtual ~USoftWinImpl();
00040 
00041   UPos&  getPos() {return pos;}
00042   UView* checkCurrentView(UView* winview) const;
00043   void   setCurrentView(UView* winview);
00044   void   update(const UUpdate&, UWin*, UView* winview);
00045 
00046 private:
00047   UPos pos;
00048   UView* current_view;  
00049 };
00050 
00051 /* ==================================================== ======== ======= */
00052 
00053 class UHardWinImpl : public UWinImpl {
00054 public:
00055   UHardWinImpl(UWin&);
00056   virtual ~UHardWinImpl();
00057 
00058   void init(UDisp&);
00063   bool      isRealized() const;
00065   UWin*     getWin()    {return win;}
00066   UDisp*    getDisp()   {return disp;}
00067   int       getDispID() const {return disp->id;}  
00068   UNatDisp* getNatDisp(){return disp->natdisp;}
00069   UNatWin*  getNatWin() {return natwin;}
00070     
00071   void update(const UUpdate&, UWin*, UView* winview);
00072   void updateImpl(const UUpdate&, UWin*, UView* winview, bool impose_size, int w, int h);
00073 
00074   UChildren* getSoftWinList();
00075   UGroup* getSoftWins();
00076   void setSoftWinList(UGroup* softwin_list);
00077   void removeSoftWin(UWin* softwin);
00078   
00079   void addSoftWin(UWin* softwin, UWin* hardwin, UDisp* disp, bool add_to_the_end);
00081   
00082 private:
00083   friend class UWin;
00084   friend class USoftwinImpl;
00085   friend class UView;
00086   friend class UGraph;
00087   friend class UGraphElem;
00088   friend class UFontMetrics;
00089 
00090   UDisp* disp;       // display
00091   UWin*  win;        // the corresponding window
00092   UNatWin* natwin;   // pointer to the (hidden) Native Window
00093   UChildren softwin_list;
00094 };
00095 
00096 }
00097 #endif
00098 /* ==================================================== [TheEnd] ======= */
00099 /* ==================================================== [(c)Elc] ======= */
00100 

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