The Battle for Wesnoth  1.15.1+dev
Namespaces | Macros
generator.cpp File Reference
#include "gui/widgets/generator_private.hpp"
#include "gui/widgets/window.hpp"
#include "wml_exception.hpp"
#include <numeric>
Include dependency graph for generator.cpp:

Go to the source code of this file.

Namespaces

 gui2
 Generic file dialog.
 
 gui2::policy
 Contains the policies for the generator class.
 
 gui2::policy::minimum_selection
 Contains the policy for the minimum number of selected items.
 
 gui2::policy::placement
 Controls how new items are placed.
 
 gui2::policy::select_action
 Contains the policy for which action to take when an item is selected or deselected.
 

Macros

#define GETTEXT_DOMAIN   "wesnoth-lib"
 
#define GENERATE_PLACEMENT
 
#define GENERATE_SELECT
 
#define GENERATE_MAXIMUM
 
#define GENERATE_BODY
 

Macro Definition Documentation

◆ GENERATE_BODY

#define GENERATE_BODY
Value:
if(has_minimum) { \
typedef policy::minimum_selection::one_item minimum; \
GENERATE_MAXIMUM \
} else { \
typedef policy::minimum_selection::no_item minimum; \
GENERATE_MAXIMUM \
}

Definition at line 1156 of file generator.cpp.

Referenced by gui2::generator_base::build().

◆ GENERATE_MAXIMUM

#define GENERATE_MAXIMUM
Value:
if(has_maximum) { \
typedef policy::maximum_selection::one_item maximum; \
GENERATE_SELECT \
} else { \
typedef policy::maximum_selection::many_items maximum; \
GENERATE_SELECT \
}

Definition at line 1143 of file generator.cpp.

◆ GENERATE_PLACEMENT

#define GENERATE_PLACEMENT
Value:
switch(placement) { \
case generator_base::horizontal_list: \
result = new generator<minimum, maximum, policy::placement::horizontal_list, select_action>; \
break; \
case generator_base::vertical_list: \
result = new generator<minimum, maximum, policy::placement::vertical_list, select_action>; \
break; \
case generator_base::table: \
result = new generator<minimum, maximum, policy::placement::table, select_action>; \
break; \
case generator_base::independent: \
result = new generator<minimum, maximum, policy::placement::independent, select_action>; \
break; \
default: \
assert(false); \
}

Definition at line 1108 of file generator.cpp.

◆ GENERATE_SELECT

#define GENERATE_SELECT
Value:
if(select) { \
typedef policy::select_action::selection select_action; \
GENERATE_PLACEMENT \
} else { \
typedef policy::select_action::show select_action; \
GENERATE_PLACEMENT \
}
void show(const std::string &window_id, const t_string &message, const point &mouse, const SDL_Rect &source_rect)
Shows a tip.
Definition: tooltip.cpp:154

Definition at line 1130 of file generator.cpp.

◆ GETTEXT_DOMAIN

#define GETTEXT_DOMAIN   "wesnoth-lib"

Definition at line 15 of file generator.cpp.