GG
|
00001 // -*- C++ -*- 00002 /* GG is a GUI for SDL and OpenGL. 00003 Copyright (C) 2007 T. Zachary Laine 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public License 00007 as published by the Free Software Foundation; either version 2.1 00008 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00018 02111-1307 USA 00019 00020 If you do not wish to comply with the terms of the LGPL please 00021 contact the author as other terms are available for a fee. 00022 00023 Zach Laine 00024 whatwasthataddress@gmail.com */ 00025 00030 #ifndef _GG_OgreGUIInputPlugin_h_ 00031 #define _GG_OgreGUIInputPlugin_h_ 00032 00033 #include <OgrePlugin.h> 00034 00035 #include <GG/PtRect.h> 00036 00037 #include <boost/signals.hpp> 00038 00039 00040 #ifdef _MSC_VER 00041 # ifdef GiGiOgrePlugin_OIS_EXPORTS 00042 # define GG_OGRE_PLUGIN_API __declspec(dllexport) 00043 # else 00044 # define GG_OGRE_PLUGIN_API __declspec(dllimport) 00045 # endif 00046 #else 00047 # define GG_OGRE_PLUGIN_API 00048 #endif 00049 00050 namespace Ogre { class RenderWindow; } 00051 00052 namespace GG { 00053 00064 class GG_OGRE_PLUGIN_API OgreGUIInputPlugin : 00065 public Ogre::Plugin 00066 { 00067 public: 00068 OgreGUIInputPlugin(); 00069 virtual ~OgreGUIInputPlugin(); 00070 00072 static void SetRenderWindow(Ogre::RenderWindow* window); 00073 00075 static Ogre::RenderWindow* GetRenderWindow(); 00076 00077 protected: 00078 void ConnectHandlers(); 00079 void DisconnectHandlers(); 00080 00081 private: 00082 virtual void HandleSystemEvents() = 0; 00083 virtual void HandleWindowResize(X width, Y height); 00084 virtual void HandleWindowClose(); 00085 00086 boost::signals::connection m_handle_events_connection; 00087 boost::signals::connection m_resize_connection; 00088 boost::signals::connection m_close_connection; 00089 00090 static Ogre::RenderWindow* s_render_window; 00091 }; 00092 00093 } // namespace GG 00094 00095 #endif // _GG_OgreGUIInputPlugin_h_