uinput.hpp

00001 /* ==================================================== ======== ======= *
00002 *
00003 *  uinput.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 _uinput_hpp_
00021 #define _uinput_hpp_
00022 //pragma ident  "@(#)uinput.hpp ubit:05.05.00"
00023 #include <ubit/ubrick.hpp>
00024 namespace ubit {
00025 
00026 /* ==================================================== ======== ======= */
00040 class UInput : public UBrick {
00041 public:
00042   UBIT_CLASS(UInput,UBrick)
00043   
00044   UInput();
00045   UInput(int source);
00046   virtual ~UInput();
00047 
00048   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00049   
00050   virtual void onAction(UCall& call);
00051   virtual void onInput(UCall& call) {onAction(call);}
00057   virtual void onClose(UCall& call);
00059 
00060   virtual void open(int source);
00062 
00063   virtual void close();
00065      
00066   int getSource() const {return source;}
00067 
00068   bool isOpened() const {return is_opened;}
00070         
00071 private:
00072   friend class UNatAppli;
00073   bool is_opened;
00074   int  source;
00075 #ifdef WITH_GDK
00076   int gid;
00077 #endif
00078 
00079   virtual void fireInput();
00080   virtual void fireClose();
00081 };
00082 
00083 }
00084 #endif
00085 /* ==================================================== [TheEnd] ======= */
00086 /* ==================================================== [(c)Elc] ======= */

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