Fix css style order when using external css files
[ryzomcore.git] / ryzom / client / src / interface_v3 / interface_pointer.h
blobe71f245af991d44e95084ebbea883094ee2ee4f7
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef NL_INTERFACE_POINTER_H
23 #define NL_INTERFACE_POINTER_H
25 #include "nel/misc/resource_ptr.h"
27 namespace NLGUI
29 class CInterfaceElement;
30 class CCtrlBase;
31 class CCtrlBaseButton;
32 class CInterfaceGroup;
33 class CViewText;
34 class CViewTextMenu;
35 class CCtrlTextButton;
36 class CGroupContainer;
39 using namespace NLGUI;
41 CInterfaceElement *getInterfaceResource(const std::string &key);
43 /** Interface element ptr
44 * This pointer uses the NLMISC::CResourcePtr
46 template<class TPtr>
47 class CInterfacePtr
49 public:
50 static void *getResource (const std::string &key)
52 if (key.empty())
53 return NULL;
54 else
55 return dynamic_cast<TPtr*>(getInterfaceResource(key));
58 /* In FINAL_VERSION, use an interface pointer without memory or cpu overhead because we don't need the runtime reloading feature. */
59 #if FINAL_VERSION
60 typedef NLMISC::CStaticResourcePtr<TPtr, std::string, CInterfacePtr<TPtr> > TInterfacePtr;
61 #else // FINAL_VERSION
62 typedef NLMISC::CResourcePtr<TPtr, std::string, CInterfacePtr<TPtr> > TInterfacePtr;
63 #endif // FINAL_VERSION
66 // Some pointers
67 typedef CInterfacePtr<CInterfaceElement>::TInterfacePtr CInterfaceElementPtr;
68 typedef CInterfacePtr<CInterfaceGroup>::TInterfacePtr CInterfaceGroupPtr;
69 typedef CInterfacePtr<CCtrlTextButton>::TInterfacePtr CCtrlTextButtonPtr;
70 typedef CInterfacePtr<CViewText>::TInterfacePtr CViewTextPtr;
71 typedef CInterfacePtr<CViewTextMenu>::TInterfacePtr CViewTextMenuPtr;
72 typedef CInterfacePtr<CCtrlBase>::TInterfacePtr CCtrlBasePtr;
73 typedef CInterfacePtr<CCtrlBaseButton>::TInterfacePtr CCtrlBaseButtonPtr;
74 typedef CInterfacePtr<CGroupContainer>::TInterfacePtr CGroupContainerPtr;
76 #endif // NL_INTERFACE_POINTER_H
78 /* End of interface_pointer.h */