The Battle for Wesnoth  1.19.5+dev
Namespaces | Macros
generator.cpp File Reference
#include "gui/widgets/generator_private.hpp"
#include "wml_exception.hpp"
#include <numeric>
#include <cmath>
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 1150 of file generator.cpp.

◆ 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 1137 of file generator.cpp.

◆ GENERATE_PLACEMENT

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

Definition at line 1102 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:64

Definition at line 1124 of file generator.cpp.

◆ GETTEXT_DOMAIN

#define GETTEXT_DOMAIN   "wesnoth-lib"

Definition at line 16 of file generator.cpp.