00001 // /////////////////////////////////////////////////////////////////////////// 00002 // xrb_singleton.hpp by Victor Dods, created 2005/02/10 00003 // /////////////////////////////////////////////////////////////////////////// 00004 // Unless a different license was explicitly granted in writing by the 00005 // copyright holder (Victor Dods), this software is freely distributable under 00006 // the terms of the GNU General Public License, version 2. Any works deriving 00007 // from this work must also be released under the GNU GPL. See the included 00008 // file LICENSE for details. 00009 // /////////////////////////////////////////////////////////////////////////// 00010 00011 #if !defined(_XRB_SINGLETON_HPP_) 00012 #define _XRB_SINGLETON_HPP_ 00013 00014 // this header is included by xrb.h 00015 00016 // this header declares all the singletons which behave essentially as 00017 // "devices". e.g. the keyboard/mouse button input, the resource manager. 00018 // (possibly move the screen into this category). 00019 00020 namespace Xrb 00021 { 00022 00023 class InputState; 00024 class KeyMap; 00025 class Pal; 00026 class ResourceLibrary; 00027 00028 typedef Pal *(*PalFactory)(); 00029 00036 namespace Singleton 00037 { 00040 InputState &InputState (); 00043 KeyMap const &KeyMap (); 00047 Pal &Pal (); 00050 ResourceLibrary &ResourceLibrary (); 00051 00070 void Initialize (PalFactory CreatePal, char const *key_map_name); 00075 void Shutdown (); 00076 } // end of namespace Singleton 00077 00078 } // end of namespace Xrb 00079 00080 #endif // !defined(_XRB_SINGLETON_HPP_) 00081