The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros
register_widget.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define REGISTER_WIDGET3(type, id, key)
 Registers a widget. More...
 
#define REGISTER_WIDGET(id)   REGISTER_WIDGET3(t##id##_definition, id, _4)
 Wrapper for REGISTER_WIDGET3. More...
 

Macro Definition Documentation

#define REGISTER_WIDGET (   id)    REGISTER_WIDGET3(t##id##_definition, id, _4)

Wrapper for REGISTER_WIDGET3.

"Calls" REGISTER_WIDGET3(tid_definition, id, _4)

Definition at line 68 of file register_widget.hpp.

#define REGISTER_WIDGET3 (   type,
  id,
  key 
)
Value:
namespace \
{ \
\
namespace ns_##type \
{ \
\
struct tregister_helper \
{ \
tregister_helper() \
{ \
std::bind(load_widget_definitions<type>, \
_1, \
_2, \
_3, \
key)); \
#id, \
std::bind( \
build_widget<implementation::tbuilder_##id>, \
_1)); \
} \
}; \
\
static tregister_helper register_helper; \
} \
}
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1221
void register_widget(const std::string &id, std::function< void(tgui_definition &gui_definition, const std::string &definition_type, const config &cfg, const char *key)> functor)
Registers a widgets.
Definition: settings.cpp:558
void register_builder_widget(const std::string &id, std::function< tbuilder_widget_ptr(config)> functor)
Registers a widget to be build.

Registers a widget.

Call this function to register a widget. Use this macro in the implementation, inside the gui2 namespace.

See gui2::load_widget_definitions for more information.

Note
When the type is tfoo_definition, the id "foo" and no special key best use RESISTER_WIDGET(foo) instead.
Parameters
typeClass type of the window to register.
idId of the widget
keyThe id to load if differs from id.

Definition at line 33 of file register_widget.hpp.