ueventflow.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  ueventflow.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 _ueventflow_hpp_
00022 #define _ueventflow_hpp_
00023 //pragma ident  "@(#)ueventflow.hpp     ubit:05.05.00"
00024 #include <ubit/uappli.hpp>
00025 #include <ubit/uevent.hpp>
00026 namespace ubit {
00027 
00028 class UMenuManager;
00029   
00030 /* ==================================================== ====== ======= */
00039 class UEventFlow {
00040 public:
00041   UEventFlow(UDisp&, int channel);
00046   virtual ~UEventFlow();
00047 
00048   int getID() const {return id;}
00055   int getChannel() const {return channel;}
00066   UDisp& getDisp() const {return disp;}
00068     
00069   USelection* getSelection() {return &selection;}
00071 
00072   void setUserData(UObject* obj) {user_data = obj;}
00073   UObject* getUserData() {return user_data;}
00075   
00076   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00077 
00078   void setCursor(UEvent&, const UCursor*);
00079   void winMousePress(UWin*, UMouseEvent&);
00080   void winMouseRelease(UWin*, UMouseEvent&);
00081   void winMouseMove(UWin*, UMouseEvent&);
00082   void winWheel(UWin*, UWheelEvent&);
00083   void winKeyPress(UWin*, UKeyEvent&);
00084   void winKeyRelease(UWin*, UKeyEvent&);
00085   void winLeave(UWin*, UEvent&);
00086   void winDestroy(UWin*, UEvent&);
00088   
00089   UBox* findBox(const UEvent& e, UMask, UView*& found_view);
00090   void boxEnter(UEvent&, UBox*, int bstyle);
00091   void boxLeave(UEvent&);
00092   void boxMousePress(UMouseEvent&);
00093   void boxMouseRelease(UMouseEvent&);
00094   void boxMouseMove(UMouseEvent&);
00095   void boxWheel(UWheelEvent&);
00096   void boxKeyPress(UKeyEvent&);
00097   void boxKeyRelease(UKeyEvent&);
00099 
00100   void startAutoRepeat(UEvent&);
00101   void stopAutoRepeat(UEvent&);
00102   void autoRepeatCB(UEvent&);
00103   void openTipRequest(UEvent&);
00104   void closeTipRequest(UEvent&);
00105   void openTipCB(UEvent&);
00107 
00108   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00109 
00110   UGroup* getBrowsingGroup() const {return browsing_group;}
00111   void setBrowsingGroup (UGroup* grp) {browsing_group = grp;}
00113 
00114   UMenuManager& getMenuManager() const {return menu_man;}   // virer le const!
00116 
00117   UWin* retrieveTelePointer(UDisp*);
00118   void showTelePointers(UMouseEvent&, int mode = 0);
00120   
00121   void deleteNotify(UView* deleted_view);
00122   void deleteNotify(UGroup* deleted_group);
00124 
00125   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00126 
00127 private:
00128   friend class UAppli;
00129   friend class UEvent;
00130   friend class UControl;
00131   
00132   int id, channel;
00133   UDisp& disp;
00135   UEvent lastEnteredEvent;
00136   UMouseEvent lastPressedEvent;
00137   UControl *lastPressed, *lastArmed, *dragSource, *dropTarget;
00138   uptr<UControl> inAction;
00139   UView *lastEnteredView;
00140   UBox  *lastEnteredBox;
00141   UControl* clicking;
00142   int   click_x, click_y;
00143   int   click_count;
00144   long  click_time;
00145 
00147   const class UCursor* lastCursor;
00148 
00151   UGroup* browsing_group;
00152 
00154   UTimer& auto_repeat_timer;
00155 
00157   UTimer& tip_timer;
00158   UWin& tip_win;
00159     
00161   UMenuManager& menu_man;
00162 
00164   USelection& selection;
00165 
00167   std::vector<class UWin*> tele_pointers;
00168   
00169   UObject* user_data;
00170 };
00171 
00172 }
00173 #endif
00174 /* ==================================================== [TheEnd] ======= */
00175 /* ==================================================== [(c)Elc] ======= */

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