OgreWindowEventUtilities.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __OgreWindowEventUtils_H__
#define __OgreWindowEventUtils_H__
#include "OgrePrerequisites.h"
#include "OgrePlatform.h"
#include "OgreCommon.h"
#include "OgreHeaderPrefix.h"
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
# if !defined(WIN32_LEAN_AND_MEAN)
# define WIN32_LEAN_AND_MEAN
# endif
# if !defined(NOMINMAX) && defined(_MSC_VER)
# define NOMINMAX // required to stop windows.h messing up std::min
# endif
# include <windows.h>
#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE && !defined(__LP64__)
# include <Carbon/Carbon.h>
#endif
namespace Ogre
{
class _OgreExport WindowEventListener
{
public:
virtual ~WindowEventListener() {}
virtual void windowMoved(RenderWindow* rw)
{ (void)rw; }
virtual void windowResized(RenderWindow* rw)
{ (void)rw; }
virtual bool windowClosing(RenderWindow* rw)
{ (void)rw; return true; }
virtual void windowClosed(RenderWindow* rw)
{ (void)rw; }
virtual void windowFocusChange(RenderWindow* rw)
{ (void)rw; }
};
class _OgreExport WindowEventUtilities
{
public:
static void messagePump();
static void addWindowEventListener( RenderWindow* window, WindowEventListener* listener );
static void removeWindowEventListener( RenderWindow* window, WindowEventListener* listener );
static void _addRenderWindow(RenderWindow* window);
static void _removeRenderWindow(RenderWindow* window);
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
static LRESULT CALLBACK _WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE && !defined __OBJC__ && !defined(__LP64__)
static OSStatus _CarbonWindowHandler(EventHandlerCallRef nextHandler, EventRef event, void* wnd);
#endif
//These are public only so GLXProc can access them without adding Xlib headers header
typedef multimap<RenderWindow*, WindowEventListener*>::type WindowEventListeners;
static WindowEventListeners _msListeners;
static RenderWindowList _msWindows;
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::WindowEventListener::windowClosing
virtual bool windowClosing(RenderWindow *rw)
Definition: OgreWindowEventUtilities.h:92
Ogre::WindowEventListener
Definition: OgreWindowEventUtilities.h:62
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::RenderWindowList
vector< RenderWindow * >::type RenderWindowList
Render window container.
Definition: OgreCommon.h:764
OgreCommon.h
Ogre::WindowEventUtilities
Definition: OgreWindowEventUtilities.h:122
OgrePlatform.h
OgrePrerequisites.h
Ogre::WindowEventListener::windowResized
virtual void windowResized(RenderWindow *rw)
Definition: OgreWindowEventUtilities.h:82
Ogre::WindowEventListener::~WindowEventListener
virtual ~WindowEventListener()
Definition: OgreWindowEventUtilities.h:65
OgreHeaderSuffix.h
Ogre::multimap::type
std::multimap< K, V, P, A > type
Definition: OgrePrerequisites.h:550
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::WindowEventListener::windowFocusChange
virtual void windowFocusChange(RenderWindow *rw)
Definition: OgreWindowEventUtilities.h:114
Ogre::RenderWindow
Manages the target rendering window.
Definition: OgreRenderWindow.h:62
OgreHeaderPrefix.h
Ogre::WindowEventUtilities::WindowEventListeners
multimap< RenderWindow *, WindowEventListener * >::type WindowEventListeners
Definition: OgreWindowEventUtilities.h:181
Ogre::WindowEventUtilities::_msListeners
static WindowEventListeners _msListeners
Definition: OgreWindowEventUtilities.h:182
Ogre::WindowEventListener::windowMoved
virtual void windowMoved(RenderWindow *rw)
Definition: OgreWindowEventUtilities.h:73
Ogre::WindowEventListener::windowClosed
virtual void windowClosed(RenderWindow *rw)
Definition: OgreWindowEventUtilities.h:105
Ogre::WindowEventUtilities::_msWindows
static RenderWindowList _msWindows
Definition: OgreWindowEventUtilities.h:183

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.