OGRE  1.9.0
OgreWindowEventUtilities.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef __OgreWindowEventUtils_H__
29#define __OgreWindowEventUtils_H__
30
31#include "OgrePrerequisites.h"
32#include "OgrePlatform.h"
33#include "OgreCommon.h"
34#include "OgreHeaderPrefix.h"
35
36#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
37# if !defined(WIN32_LEAN_AND_MEAN)
38# define WIN32_LEAN_AND_MEAN
39# endif
40# if !defined(NOMINMAX) && defined(_MSC_VER)
41# define NOMINMAX // required to stop windows.h messing up std::min
42# endif
43# include <windows.h>
44#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE && !defined(__LP64__)
45# include <Carbon/Carbon.h>
46#endif
47
48
49
50namespace Ogre
51{
63 {
64 public:
66
73 virtual void windowMoved(RenderWindow* rw)
74 { (void)rw; }
75
82 virtual void windowResized(RenderWindow* rw)
83 { (void)rw; }
84
92 virtual bool windowClosing(RenderWindow* rw)
93 { (void)rw; return true; }
94
105 virtual void windowClosed(RenderWindow* rw)
106 { (void)rw; }
107
115 { (void)rw; }
116 };
117
123 {
124 public:
130 static void messagePump();
131
142 static void addWindowEventListener( RenderWindow* window, WindowEventListener* listener );
143
153
161 static void _addRenderWindow(RenderWindow* window);
162
170 static void _removeRenderWindow(RenderWindow* window);
171
172#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
174 static LRESULT CALLBACK _WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
175#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE && !defined __OBJC__ && !defined(__LP64__)
177 static OSStatus _CarbonWindowHandler(EventHandlerCallRef nextHandler, EventRef event, void* wnd);
178#endif
179
180 //These are public only so GLXProc can access them without adding Xlib headers header
184 };
187}
188
189#include "OgreHeaderSuffix.h"
190
191#endif
#define _OgreExport
Manages the target rendering window.
virtual void windowResized(RenderWindow *rw)
virtual void windowFocusChange(RenderWindow *rw)
virtual void windowMoved(RenderWindow *rw)
virtual void windowClosed(RenderWindow *rw)
virtual bool windowClosing(RenderWindow *rw)
static void addWindowEventListener(RenderWindow *window, WindowEventListener *listener)
multimap< RenderWindow *, WindowEventListener * >::type WindowEventListeners
static WindowEventListeners _msListeners
static void _addRenderWindow(RenderWindow *window)
static void _removeRenderWindow(RenderWindow *window)
static void removeWindowEventListener(RenderWindow *window, WindowEventListener *listener)
vector< RenderWindow * >::type RenderWindowList
Render window container.
Definition OgreCommon.h:764
std::multimap< K, V, P, A > type