// Ryzom - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . #ifndef NL_INTERFACE_POINTER_H #define NL_INTERFACE_POINTER_H #include "nel/misc/resource_ptr.h" namespace NLGUI { class CInterfaceElement; class CCtrlBase; class CCtrlBaseButton; class CInterfaceGroup; class CViewText; class CViewTextMenu; class CCtrlTextButton; class CGroupContainer; } using namespace NLGUI; CInterfaceElement *getInterfaceResource(const std::string &key); /** Interface element ptr * This pointer uses the NLMISC::CResourcePtr */ template class CInterfacePtr { public: static void *getResource (const std::string &key) { if (key.empty()) return NULL; else return dynamic_cast(getInterfaceResource(key)); } /* In FINAL_VERSION, use an interface pointer without memory or cpu overhead because we don't need the runtime reloading feature. */ #if FINAL_VERSION typedef NLMISC::CStaticResourcePtr > TInterfacePtr; #else // FINAL_VERSION typedef NLMISC::CResourcePtr > TInterfacePtr; #endif // FINAL_VERSION }; // Some pointers typedef CInterfacePtr::TInterfacePtr CInterfaceElementPtr; typedef CInterfacePtr::TInterfacePtr CInterfaceGroupPtr; typedef CInterfacePtr::TInterfacePtr CCtrlTextButtonPtr; typedef CInterfacePtr::TInterfacePtr CViewTextPtr; typedef CInterfacePtr::TInterfacePtr CViewTextMenuPtr; typedef CInterfacePtr::TInterfacePtr CCtrlBasePtr; typedef CInterfacePtr::TInterfacePtr CCtrlBaseButtonPtr; typedef CInterfacePtr::TInterfacePtr CGroupContainerPtr; #endif // NL_INTERFACE_POINTER_H /* End of interface_pointer.h */