Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreEventDispatcher.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://ogre.sourceforge.net/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 
00026 /***************************************************************************
00027 OgreEventDispatcher.h  -  
00028     Handles the Dispatching of events to a EventTarget (mainly a PositionTarget for 
00029     mouse moving). The EventTargets are managed by a target manager.
00030 
00031     A EventDispatcher is needed for each TargetManager. ie 1 dispatcher for the OverlayManager,
00032     for managing the 2D GUI components, and another EventDispatcher for a SceneManager 
00033     managing the 3D objects.(NOTE currently the SceneManager isn't a TargetManager.. this is a TODO).
00034 
00035 -------------------
00036 begin                : Nov 19 2002
00037 copyright            : (C) 2002 by Kenny Sabir
00038 email                : kenny@sparksuit.com
00039 ***************************************************************************/
00040 
00041 
00042 
00043 #ifndef __EventDispatcher_H__
00044 #define __EventDispatcher_H__
00045 
00046 #include "OgrePrerequisites.h"
00047 
00048 namespace Ogre {
00049 
00058     class _OgreExport EventDispatcher
00059     {
00060     protected:
00061     TargetManager* mTargetManager;      
00062     EventProcessor* mEventProcessor;
00063 
00070      PositionTarget* mFocus;    // isn't implemented yet
00071 
00078      PositionTarget* mMousePositionTarget;
00079 
00083       PositionTarget* mCursorOn;    // isn't implemented yet
00084 
00088       PositionTarget* mTargetLastEntered;
00089 
00095      bool mDragging;
00096 
00097      int mEventMask;
00098 
00099      //-------------------
00100      // protected methods   
00101 
00110     bool processMouseEvent(MouseEvent* e) ;
00111 
00121     void retargetMouseEvent(PositionTarget* target, int id, MouseEvent* e) ;
00122 
00128     void setMouseTarget(PositionTarget* target, MouseEvent* e) ;
00129 
00130     /*
00131      * Generates enter/exit events as mouse moves over lw PositionTargets
00132      * @param targetOver    Target mouse is over (including native container)
00133      * @param e         Mouse event in native container
00134      */
00135 
00136     void trackMouseEnterExit(PositionTarget* targetOver, MouseEvent* e) ;
00137 
00138     public:
00139         EventDispatcher(TargetManager* pTargetManager, EventProcessor* pEventProcessor);
00140         virtual ~EventDispatcher();       
00141 
00149         bool dispatchEvent(InputEvent* e) ;
00150     };
00151 
00152 
00153 
00154 }
00155 
00156 
00157 #endif 

Copyright © 2002 by The OGRE Team