unatwin.hpp

00001 /* ==================================================== ======== ======= *
00002 *
00003 *  unatwin.cpp  [Native Layer: platform dependent implementation]
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 EricLecolinet / ENST Paris / http://www.enst.fr/~elc/ubit
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 _unatwin_hpp_
00022 #define _unatwin_hpp_
00023 //pragma ident  "@(#)unatwin.hpp        ubit:05.05.00"
00024 #include <ubit/unatgraph.hpp>
00025 namespace ubit {
00026 
00027 /* ==================================================== ====== ======= */
00030 class UNatWin {
00031 public:
00032   enum {  // window types
00033     NONE     = 0, 
00034     BUFFER   = 1<<0, 
00035     EXTERNAL = 1<<1,
00036     FRAME    = 1<<2, 
00037     MAINFRAME, DIALOG, MENU, CHILDWIN
00038   };
00039 
00040   ~UNatWin();
00041   UNatWin();    
00042   UNatWin(UNatDisp*, unsigned short _wintype);
00043   UNatWin(const UNatWin&);
00044   UNatWin& operator=(const UNatWin&);
00045   
00046   static UNatWin* createBuffer(UNatDisp*, int width, int height);
00047 
00048   bool       isRealized()   const {return (sys_win != USysNull);}
00049   USysWin    getSysWin()    const {return sys_win;}
00050   USysScreen getSysScreen() const {return sys_screen;}
00051   USysDisp   getSysDisp()   const;
00052 
00053   void setTitle(const UStr&);
00054   void show(bool);
00055   void toBack();
00056   void toFront();
00057 
00058   void setPos(int x_screen_x, int y_screen);
00059   void getPos(int& x_screen_x, int& y_screen);
00060 
00061   void setSize(int width, int height);
00062   void getSize(int& width, int& height);
00063   //int  getWidth();
00064   //int  getHeight();
00065   
00066 private:
00067   friend class UDisp;
00068   friend class UGraph;
00069   friend class UNatGraph;
00070   friend class UNatDisp;
00071   friend class UHardWinImpl;
00072 
00073   unsigned short wintype;
00074   bool own_sys_win;       
00075   USysWin sys_win;
00076   USysScreen sys_screen;
00077 
00078   USysWin createWinImpl(UNatDisp*, unsigned short _wintype);
00079   void reshapeCB(UNatDisp*, UWin*);
00080 };
00081 
00082 }
00083 #endif
00084 /* ==================================================== [TheEnd] ======= */
00085 /* ==================================================== [(c)Elc] ======= */

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