The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Classes | Typedefs | Functions | Variables
gui2 Namespace Reference

A class inherited from ttext_box that displays its input as stars. More...

Namespaces

 event
 
 implementation
 
 iterator
 
 policy
 Contains the policies for the tgenerator class.
 
 settings
 This namespace contains the 'global' settings.
 
 tip
 
 tips
 

Classes

class  event_mode_controller
 Controller for WML event and menu item handler views. More...
 
struct  lobby_delay_gamelist_update_guard
 
class  side_controller
 
class  single_mode_controller
 
class  taddon_connect
 Addon connect dialog. More...
 
class  taddon_description
 
class  taddon_filter_options
 
class  taddon_list
 Shows the list of addons on the server. More...
 
class  taddon_uninstall_list
 
class  tadvanced_graphics_options
 
struct  tbuilder_grid
 
struct  tbuilder_widget
 Contains the info needed to instantiate a widget. More...
 
class  tbutton
 Simple push button. More...
 
struct  tbutton_definition
 
class  tcampaign_difficulty
 
class  tcampaign_selection
 
class  tcampaign_settings
 
class  tcanvas
 A simple canvas which can be drawn upon. More...
 
class  tchat_log
 
class  tclickable_
 Small concept class. More...
 
class  tcombobox
 Simple push button. More...
 
struct  tcombobox_definition
 
class  tcontainer_
 A generic container base class. More...
 
class  tcontrol
 Base class for all visible items. More...
 
struct  tcontrol_definition
 
class  tcontrol_NEW
 
class  tcore_selection
 
class  tcustom_tod
 
class  tdebug_clock
 Clock to test the draw events. More...
 
class  tdepcheck_confirm_change
 
class  tdepcheck_select_new
 
class  tdialog
 Abstract base class for all dialogs. More...
 
class  tdrawing
 A widget to draw upon. More...
 
struct  tdrawing_definition
 
class  tdrop_down_list
 Used by the combobox widget. More...
 
class  team_mode_controller
 
class  tedit_label
 
class  tedit_text
 
class  teditor_edit_label
 
class  teditor_edit_scenario
 
class  teditor_edit_side
 
class  teditor_generate_map
 The dialog for selecting which random generator to use in the editor. More...
 
class  teditor_new_map
 
class  teditor_resize_map
 
class  teditor_set_starting_position
 
class  tevent_executor
 Event execution calls. More...
 
class  texecutor
 Helper to make removing a timer in a callback safe. More...
 
class  tfield
 Template class to implement the generic field implementation. More...
 
class  tfield_
 Abstract base class for the fields. More...
 
class  tfield_bool
 Specialized field class for boolean. More...
 
class  tfield_label
 Specialized field class for a control, used for labels and images. More...
 
class  tfield_text
 Specialized field class for text. More...
 
class  tfolder_create
 
class  tformula
 Template class can hold a value or a formula to calculate the value. More...
 
class  tformula_debugger
 
class  tgame_cache_options
 
class  tgame_delete
 
class  tgame_load
 
class  tgame_save
 
class  tgame_save_message
 
class  tgame_save_oos
 
class  tgame_version
 
class  tgamestate_inspector
 
class  tgenerator
 Basic template class to generate new items. More...
 
class  tgenerator_
 Abstract base class for the generator. More...
 
class  tgrid
 Base container class. More...
 
struct  tgrid_implementation
 Helper to implement private functions without modifying the header. More...
 
class  tgroup
 
struct  tgui_definition
 
class  thorizontal_scrollbar
 A horizontal scrollbar. More...
 
struct  thorizontal_scrollbar_definition
 
class  timage
 An image. More...
 
struct  timage_definition
 
class  tinteger_selector_
 Small abstract helper class. More...
 
struct  tkey
 Key type for the cache. More...
 
class  tlabel
 Label showing a text. More...
 
struct  tlabel_definition
 
class  tlabel_settings
 
class  tlanguage_selection
 
struct  tlayout_exception_height_resize_failed
 Exception thrown when the height resizing has failed. More...
 
struct  tlayout_exception_resize_failed
 Basic exception when the layout doesn't fit. More...
 
struct  tlayout_exception_width_modified
 Exception thrown when the width has been modified during resizing. More...
 
struct  tlayout_exception_width_resize_failed
 Exception thrown when the width resizing has failed. More...
 
class  tlegacy_menu_item
 Implements simple parsing of legacy GUI1 item markup. More...
 
class  tlistbox
 The listbox class. More...
 
struct  tlistbox_definition
 
class  tloadscreen
 
struct  tlobby_chat_window
 
class  tlobby_main
 
class  tlobby_player_info
 
class  tlogging
 
class  tlua_interpreter
 
class  tmatrix
 The matrix class. More...
 
struct  tmatrix_definition
 
class  tmessage
 Main class to show messages to the user. More...
 
struct  tmessage_implementation
 Helper to implement private functions without modifying the header. More...
 
class  tminimap
 The basic minimap class. More...
 
struct  tminimap_definition
 
class  tmp_alerts_options
 
class  tmp_change_control
 
class  tmp_cmd_wrapper
 
class  tmp_connect
 
class  tmp_create_game
 
class  tmp_create_game_set_password
 
class  tmp_host_game_prompt
 
class  tmp_join_game_password_prompt
 
class  tmp_login
 
class  tmp_method_selection
 
class  tmulti_page
 The multi page class. More...
 
struct  tmulti_page_definition
 
class  tnetwork_transmission
 Dialog that tracks network transmissions. More...
 
class  tnotifiee
 Helper class to implement callbacks with lifetime management. More...
 
class  tnotifier
 Helper class to implement callbacks with lifetime management. More...
 
class  tpane
 
struct  tpane_implementation
 Helper to implement private functions without modifying the header. More...
 
class  tpanel
 Visible container to hold multiple widgets. More...
 
struct  tpanel_definition
 
class  tpassword_box
 
class  tplacer_
 Base class for the placement helper. More...
 
struct  tplayer_list
 
struct  tpoint
 Holds a 2D point. More...
 
class  tpopup
 The popup class shows windows that are shown non-modal. More...
 
class  tpreferences
 
class  tprogress_bar
 
struct  tprogress_bar_definition
 
class  trepeating_button
 
struct  trepeating_button_definition
 
struct  tresolution_definition_
 Base class of a resolution, contains the common keys for a resolution. More...
 
class  tscreenshot_notification
 
class  tscroll_label
 Label showing a text. More...
 
struct  tscroll_label_definition
 
class  tscrollbar_
 Base class for a scroll bar. More...
 
class  tscrollbar_container
 Base class for creating containers with one or two scrollbar(s). More...
 
struct  tscrollbar_container_implementation
 Helper to implement private functions without modifying the header. More...
 
class  tscrollbar_panel
 Visible container to hold multiple widgets. More...
 
struct  tscrollbar_panel_definition
 
class  tselect_orb_colors
 
class  tselectable_
 Small abstract helper class. More...
 
class  tsimple_item_selector
 
class  tslider
 A slider. More...
 
struct  tslider_definition
 
class  tspacer
 An empty widget. More...
 
struct  tspacer_definition
 
class  tstacked_widget
 
struct  tstacked_widget_definition
 
class  tstate_default
 
struct  tstate_definition
 Contains the state info for a resolution. More...
 
struct  tsub_player_list
 
class  tsynced_choice_wait
 
class  ttext_
 Abstract base class for text items. More...
 
class  ttext_box
 Class for a single line text area. More...
 
struct  ttext_box_definition
 
class  ttext_history
 Class for text input history. More...
 
class  ttheme_list
 
struct  ttimer
 
class  ttip
 The tips of day structure. More...
 
class  ttitle_screen
 This class implements the title screen. More...
 
class  ttoggle_button
 Class for a toggle button. More...
 
struct  ttoggle_button_definition
 
class  ttoggle_panel
 Class for a toggle button. More...
 
struct  ttoggle_panel_definition
 
class  ttransient_message
 Shows a transient message. More...
 
class  ttree_view
 
struct  ttree_view_definition
 
class  ttree_view_node
 
struct  ttree_view_node_implementation
 
class  tunit_attack
 
class  tunit_create
 
class  tunit_preview_pane
 
struct  tunit_preview_pane_definition
 
class  tunit_recruit
 
class  tunit_test_access_only
 Special helper class to get the list of registered windows. More...
 
struct  tvalue
 Value type for the cache. More...
 
class  tvertical_scrollbar
 A vertical scrollbar. More...
 
struct  tvertical_scrollbar_definition
 
class  tviewport
 
struct  tviewport_implementation
 Helper to implement private functions without modifying the header. More...
 
class  twidget
 Base class for all widgets. More...
 
class  twindow
 base class of top level items, the only item which needs to store the final canvases to draw on More...
 
class  twindow_builder
 
struct  twindow_builder_invalid_id
 Helper struct to signal that get_window_builder failed. More...
 
struct  twindow_definition
 
struct  twindow_implementation
 Helper to implement private functions without modifying the header. More...
 
class  twml_error
 WML preprocessor/parser error report dialog. More...
 
class  twml_message_
 Base class for the wml generated messages. More...
 
class  twml_message_left
 Shows a dialog with the portrait on the left side. More...
 
class  twml_message_option
 Helper class for message options. More...
 
class  twml_message_right
 Shows a dialog with the portrait on the right side. More...
 
class  unit_mode_controller
 
class  variable_mode_controller
 

Typedefs

typedef tfield< int,
tinteger_selector_
tfield_integer
 
typedef boost::intrusive_ptr
< tresolution_definition_
tresolution_definition_ptr
 
typedef boost::intrusive_ptr
< const
tresolution_definition_
tresolution_definition_const_ptr
 
typedef boost::intrusive_ptr
< tcontrol_definition
tcontrol_definition_ptr
 
typedef boost::intrusive_ptr
< tbuilder_widget
tbuilder_widget_ptr
 
typedef boost::intrusive_ptr
< const tbuilder_widget
const_tbuilder_widget_ptr
 
typedef boost::intrusive_ptr
< tbuilder_grid
tbuilder_grid_ptr
 
typedef boost::intrusive_ptr
< const tbuilder_grid
tbuilder_grid_const_ptr
 
typedef std::function< void(twindow &)> dialog_member_func_type
 
typedef tcontrol_NEW
< tstate_default
tbase
 
typedef std::map< tkey, tvaluetcache
 The cache. More...
 
typedef std::map< std::string,
std::function< void(tgui_definition
&, const std::string &, const
config &, const char *key)> > 
tregistered_widget_type
 

Functions

template<class T >
bool sort (const tpane::titem &lhs, const tpane::titem &rhs, const std::string &tag, const bool ascending)
 
bool contains (const tpane::titem &item, const std::string &tag, const ttext_box &text_box)
 A filter testing whether a search string is used in a text. More...
 
template<class T >
T & get_parent (twidget &widget)
 Returns the first parent of a widget with a certain type. More...
 
template<class T >
T * find_widget (typename utils::tconst_clone< twidget, T >::pointer widget, const std::string &id, const bool must_be_active, const bool must_exist)
 Gets a widget with the wanted id. More...
 
template<class T >
T & find_widget (typename utils::tconst_clone< twidget, T >::pointer widget, const std::string &id, const bool must_be_active)
 Gets a widget with the wanted id. More...
 
bool is_in_dialog ()
 Is a dialog open? More...
 
std::ostream & operator<< (std::ostream &stream, const tpoint &point)
 
static Uint32 timer_callback (Uint32, void *id)
 
size_t add_timer (const Uint32 interval, const std::function< void(size_t id)> &callback, const bool repeat=false)
 Adds a new timer. More...
 
bool remove_timer (const size_t id)
 Removes a timer. More...
 
bool execute_timer (const size_t id)
 Executes a timer. More...
 
template<class T >
const T & cast (tresolution_definition_const_ptr ptr)
 Casts a tresolution_definition_const_ptr to another type. More...
 
static std::map< std::string,
std::function
< tbuilder_widget_ptr(config)> > & 
builder_widget_lookup ()
 
twindowbuild (CVideo &video, const twindow_builder::tresolution *res)
 Builds a window. More...
 
twindowbuild (CVideo &video, const std::string &type)
 Builds a window. More...
 
void register_builder_widget (const std::string &id, std::function< tbuilder_widget_ptr(config)> functor)
 Registers a widget to be build. More...
 
tbuilder_widget_ptr create_builder_widget (const config &cfg)
 Create a widget builder. More...
 
template<class T >
tbuilder_widget_ptr build_widget (const config &cfg)
 Helper to generate a widget from a WML widget instance. More...
 
static std::string colorify_addon_state_string (const std::string &str, const addon_tracking_info &state, bool verbose=false)
 
static std::string describe_status_simple (const addon_tracking_info &info)
 
static std::string describe_status_verbose (const addon_tracking_info &state)
 
static std::string format_addon_time (time_t time)
 
static int resize_grid_xy_to_idx (const int x, const int y)
 Convert a coordinate on a 3 by 3 grid to an index, return 9 for out of bounds. More...
 
static bool get_dont_ask_again ()
 Helper to invert preferences::ask_delete_saves. More...
 
static void set_dont_ask_again (const bool ask_again)
 Helper to invert preferences::set_ask_delete_saves. More...
 
template<class D , class V , void(V::*)() fptr>
void dialog_view_callback (twidget &caller)
 Template for dialog callbacks for dialogs using model-view-controller architecture pattern. More...
 
template<class D , void(D::*)(twindow &) fptr>
void dialog_callback (twidget &caller)
 Template for dialog callbacks. More...
 
void make_dialog_callback_helper (const dialog_member_func_type &t, twidget &caller)
 
std::function< void(twidget &)> make_dialog_callback (dialog_member_func_type func)
 
 REGISTER_DIALOG (label_settings)
 
static bool fullscreen (CVideo &video)
 
void show_message (CVideo &video, const std::string &title, const std::string &message, const std::string &button_caption="", const bool auto_close=true, const bool message_use_markup=false)
 Shows a message to the user. More...
 
int show_message (CVideo &video, const std::string &title, const std::string &message, const tmessage::tbutton_style button_style, bool message_use_markup=false, bool title_use_markup=false)
 Shows a message to the user. More...
 
void show_error_message (CVideo &video, const std::string &message, bool message_use_markup=false)
 Shows an error message to the user. More...
 
static ttoggle_buttonsetup_pref_toggle_button (const std::string &id, bool def, twindow &window)
 
static void setup_item (const std::string &item, twindow &window)
 
static void set_pref_and_button (const std::string &id, bool value, twindow &window)
 
static void revert_to_default_pref_values (twindow &window)
 
static void show_server_list (CVideo &video, twindow &window, tfield_text *host_name)
 
static bool get_do_not_show_again ()
 Helper for preferences::ask_delete_saves. More...
 
static void set_do_not_show_again (const bool do_not_show_again)
 Helper for preferences::set_ask_delete_saves. More...
 
static std::string disambiguate_widget_value (const ttoggle_button &parent_widget)
 
static std::string disambiguate_widget_value (const tcombobox &parent_widget)
 
static std::string disambiguate_widget_value (const tslider &parent_widget)
 
static std::string get_max_autosaves_status_label (const tslider &slider)
 
static void set_resolution_list (tcombobox &res_list, CVideo &video)
 
static tgridget_advanced_row_grid (tlistbox &list, const int selected_row)
 
static int index_in_pager_range (const int &first, const tstacked_widget &pager)
 
 REGISTER_DIALOG (select_orb_colors)
 
static bool hotkey (twindow &window, const ttitle_screen::tresult result)
 
static bool fullscreen (CVideo &video)
 
static bool launch_lua_console (twindow &window)
 
void show_transient_message (CVideo &video, const std::string &title, const std::string &message, const std::string &image=std::string(), const bool message_use_markup=false, const bool title_use_markup=false, const bool restore_background=false)
 Shows a transient message to the user. More...
 
void show_transient_error_message (CVideo &video, const std::string &message, const std::string &image=std::string(), const bool message_use_markup=false)
 Shows a transient error message to the user. More...
 
template<class T >
static void set_label (twindow &window, const std::string &id, const std::string &label)
 
static std::string format_stats (const unit &u)
 
static std::string get_image_mods (const unit &u)
 
static void set_attacker_info (twindow &window, const unit &u)
 
static void set_defender_info (twindow &window, const unit &u)
 
static void set_weapon_info (twindow &window, const std::vector< battle_context > &weapons, const int best_weapon)
 
static std::string can_afford_unit (const std::string &text, const bool can_afford)
 
int show_wml_message (const bool left_side, CVideo &video, const std::string &title, const std::string &message, const std::string &portrait, const bool mirror, const bool has_input, const std::string &input_caption, std::string *input_text, const unsigned maximum_length, const std::vector< twml_message_option > &option_list, int *chosen_option)
 Helper function to show a portrait. More...
 
void set_single_child (tgrid &grid, twidget *widget)
 Sets the single child in a grid. More...
 
bool init ()
 Initializes the gui subsystems. More...
 
SDL_Rect create_rect (const tpoint &origin, const tpoint &size)
 Creates a rectangle. More...
 
unsigned decode_font_style (const std::string &style)
 Converts a font style string to a font style. More...
 
boost::uint32_t decode_color (const std::string &color)
 Converts a color string to a color. More...
 
PangoAlignment decode_text_alignment (const std::string &alignment)
 Converts a text alignment string to a text alignment. More...
 
std::string encode_text_alignment (const PangoAlignment alignment)
 Converts a text alignment to its string representation. More...
 
t_string missing_widget (const std::string &id)
 Returns a default error message if a mandatory widget is omitted. More...
 
void get_screen_size_variables (game_logic::map_formula_callable &variable)
 Gets a formula object with the screen size. More...
 
game_logic::map_formula_callable get_screen_size_variables ()
 Gets a formula object with the screen size. More...
 
tpoint get_mouse_position ()
 Returns the current mouse position. More...
 
std::string debug_truncate (const std::string &text)
 Returns a truncated version of the text. More...
 
template<class R , class F >
function_wrapper (const R result, const F &function)
 Helper for function wrappers. More...
 
static bool operator< (const tkey &lhs, const tkey &rhs)
 
static bool compare (const std::pair< unsigned, tcache::iterator > &lhs, const std::pair< unsigned, tcache::iterator > &rhs)
 
static void shrink_cache ()
 
static void set_scrollbar_mode (tgrid *scrollbar_grid, tscrollbar_ *scrollbar, tscrollbar_container::tscrollbar_mode &scrollbar_mode, const unsigned items, const unsigned visible_items)
 
static bool is_inserted_before (unsigned insertion_pos, unsigned old_item_count, unsigned old_position, unsigned visible_items)
 
static void adjust_scrollbar_mode (tgrid *scrollbar_grid, tscrollbar_ *scrollbar, tscrollbar_container::tscrollbar_mode &scrollbar_mode, const unsigned items_before, const unsigned items_after, const int insertion_pos, const unsigned visible_items)
 
static std::vector< std::string > & registered_window_types ()
 Returns the list of registered windows. More...
 
static tregistered_widget_typeregistred_widget_type ()
 
void register_window (const std::string &id)
 Registers a window. More...
 
void load_settings ()
 Loads the setting for the theme. More...
 
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. More...
 
void load_widget_definitions (tgui_definition &gui_definition, const std::string &definition_type, const std::vector< tcontrol_definition_ptr > &definitions)
 Loads the definitions of a widget. More...
 
tresolution_definition_ptr get_control (const std::string &control_type, const std::string &definition)
 
std::vector
< twindow_builder::tresolution >
::const_iterator 
get_window_builder (const std::string &type)
 Returns an interator to the requested builder. More...
 
template<class T >
void load_widget_definitions (tgui_definition &gui_definition, const std::string &definition_type, const config &cfg, const char *key)
 Loads the definitions of a widget. More...
 
static t_string default_value_label_generator (const std::vector< t_string > &value_labels, int item_position, int max)
 
std::vector< std::string > & unit_test_registered_window_list ()
 
std::string unit_test_mark_as_tested (const tdialog &dialog)
 
std::string unit_test_mark_popup_as_tested (const tpopup &dialog)
 
twindowunit_test_window (const tpopup &dialog)
 
tdialogunit_test_mp_server_list ()
 

Variables

lg::log_domain log_gui_draw ("gui/draw")
 
lg::log_domain log_gui_event ("gui/event")
 
lg::log_domain log_gui_general ("gui/general")
 
lg::log_domain log_gui_iterator ("gui/iterator")
 
lg::log_domain log_gui_lifetime ("gui/lifetime")
 
lg::log_domain log_gui_layout ("gui/layout")
 
lg::log_domain log_gui_parse ("gui/parse")
 
static size_t id = 0
 Ids for the timers. More...
 
static std::map< size_t, ttimertimers
 The active timers. More...
 
static size_t executing_id = 0
 The id of the event being executed, 0 if none. More...
 
static bool executing_id_removed = false
 Did somebody try to remove the timer during its execution? More...
 
bool show_debug_clock_button = false
 Do we wish to show the button for the debug clock. More...
 
static const size_t cache_max_size = 100
 Maximum number of items in the cache (multiple of 4). More...
 
static const ::configterrain = nullptr
 The terrain used to create the cache. More...
 
static tcache cache
 
bool new_widgets = false
 Do we wish to use the new library or not. More...
 
static std::map< std::string,
twindow_builder
windows
 Map with all known windows, (the builder class builds a window). More...
 
static std::map< std::string,
tgui_definition
guis
 Map with all known guis. More...
 
static std::map< std::string,
tgui_definition >
::const_iterator 
current_gui = guis.end()
 Points to the current gui. More...
 

Detailed Description

A class inherited from ttext_box that displays its input as stars.

Todo:
The items below are not implemented yet.
Note
it might be that tooltips will be shown independent of a window and in their own window, therefore the code will be cleaned up after that has been determined.
Todo:
This implementation is quite a hack that needs to be rewritten cleanly

Typedef Documentation

Definition at line 77 of file window_builder.hpp.

typedef std::function<void(twindow &)> gui2::dialog_member_func_type

Definition at line 40 of file helper.hpp.

Definition at line 98 of file matrix.hpp.

Definition at line 151 of file window_builder.hpp.

Definition at line 150 of file window_builder.hpp.

Definition at line 76 of file window_builder.hpp.

typedef std::map<tkey, tvalue> gui2::tcache

The cache.

Definition at line 138 of file minimap.cpp.

Definition at line 109 of file widget_definition.hpp.

Definition at line 37 of file field-fwd.hpp.

typedef std::map<std::string, std::function<void(tgui_definition&, const std::string&, const config&, const char* key)> > gui2::tregistered_widget_type

Definition at line 90 of file settings.cpp.

Definition at line 70 of file widget_definition.hpp.

Definition at line 67 of file widget_definition.hpp.

Function Documentation

size_t gui2::add_timer ( const Uint32  interval,
const std::function< void(size_t id)> &  callback,
const bool  repeat = false 
)

Adds a new timer.

Parameters
intervalThe timer interval in ms.
callbackThe function to call when the timer expires, the id send as parameter is the id of the timer.
repeatIf true the timer will restart after it expires.
Returns
The id of the timer.
Return values
[0]Failed to create a timer.

Definition at line 112 of file timer.cpp.

References gui2::ttimer::callback, DBG_GUI_E, id, gui2::ttimer::interval, gui2::ttimer::sdl_id, timer_callback(), and WRN_GUI_E.

Referenced by gui2::tloadscreen::pre_show(), gui2::tlobby_main::pre_show(), gui2::trepeating_button::signal_handler_left_button_down(), and gui2::event::tmouse_motion::start_hover_timer().

static void gui2::adjust_scrollbar_mode ( tgrid *  scrollbar_grid,
tscrollbar_ *  scrollbar,
tscrollbar_container::tscrollbar_mode &  scrollbar_mode,
const unsigned  items_before,
const unsigned  items_after,
const int  insertion_pos,
const unsigned  visible_items 
)
static
twindow * gui2::build ( CVideo video,
const twindow_builder::tresolution *  definition 
)
twindow * gui2::build ( CVideo video,
const std::string type 
)

Builds a window.

Parameters
videoThe frame buffer to draw upon.
typeThe type id string of the window, this window must be registered at startup.

Definition at line 129 of file window_builder.cpp.

References build(), get_window_builder(), and gui2::twidget::set_id().

template<class T >
tbuilder_widget_ptr gui2::build_widget ( const config cfg)

Helper to generate a widget from a WML widget instance.

Mainly used as functor for register_builder_widget.

Parameters
cfgThe config with the information to Instantiate the widget.
Returns
A generic widget builder pointer.

Definition at line 116 of file window_builder.hpp.

static std::map<std::string, std::function<tbuilder_widget_ptr(config)> >& gui2::builder_widget_lookup ( )
static

Definition at line 54 of file window_builder.cpp.

Referenced by create_builder_widget(), and register_builder_widget().

static std::string gui2::can_afford_unit ( const std::string text,
const bool  can_afford 
)
static

Definition at line 53 of file unit_recruit.cpp.

Referenced by gui2::tunit_recruit::pre_show().

template<class T >
const T& gui2::cast ( tresolution_definition_const_ptr  ptr)

Casts a tresolution_definition_const_ptr to another type.

Template Parameters
TThe type to cast to, the non const version.
Parameters
ptrThe pointer to cast.
Returns
A reference to type casted to.

Definition at line 82 of file widget_definition.hpp.

static std::string gui2::colorify_addon_state_string ( const std::string str,
const addon_tracking_info state,
bool  verbose = false 
)
static
static bool gui2::compare ( const std::pair< unsigned, tcache::iterator > &  lhs,
const std::pair< unsigned, tcache::iterator > &  rhs 
)
static

Definition at line 141 of file minimap.cpp.

Referenced by shrink_cache().

bool gui2::contains ( const tpane::titem &  item,
const std::string tag,
const ttext_box &  text_box 
)
inline

A filter testing whether a search string is used in a text.

The comparison is a lower-case comparison.

The function is expected to be used as a functor for gui2::tpane::filter().

Parameters
itemThe pane item to search in.
tagThe tag of the field containing the text to search in.
Note
This text field should already contain lower-cased text only.
Parameters
text_boxA text box object whose text is the search string. The text in the text box will be converted to lower-cased text before the comparison is done.
Returns
Whether or not the comparison found a match.

Definition at line 66 of file filter.hpp.

References utf8::lowercase(), gui2::tpane::titem::tags, and gui2::ttext_::text().

Referenced by mp::gamebrowser::game_matches_filter(), and arrow::path_contains().

tbuilder_widget_ptr gui2::create_builder_widget ( const config cfg)

Create a widget builder.

This object holds the instance builder for a single widget.

Parameters
cfgThe config object holding the information regarding the widget instance.
Returns
The builder for the widget instance.

Definition at line 155 of file window_builder.cpp.

References config::all_children_range(), builder_widget_lookup(), config::child(), ERROR_LOG, TRY, and VALIDATE.

Referenced by gui2::tbuilder_grid::tbuilder_grid().

SDL_Rect gui2::create_rect ( const tpoint &  origin,
const tpoint &  size 
)

Creates a rectangle.

Parameters
originThe top left corner.
sizeThe width (x) and height (y).
Returns
SDL_Rect with the proper rectangle.

Definition at line 50 of file helper.cpp.

References sdl::create_rect(), gui2::tpoint::x, and gui2::tpoint::y.

Referenced by gui2::twidget::get_rectangle().

std::string gui2::debug_truncate ( const std::string text)

Returns a truncated version of the text.

For debugging it's sometimes useful to get a part of the label of the widget. This function shows the first part.

Parameters
textThe text to truncate.
Returns
The truncated text.

Definition at line 157 of file helper.cpp.

Referenced by gui2::tcontrol::calculate_best_size(), gui2::tcontrol::get_best_text_size(), gui2::tcontrol::impl_draw_background(), font::ttext::recalculate(), and gui2::tcontrol::request_reduce_width().

boost::uint32_t gui2::decode_color ( const std::string color)

Converts a color string to a color.

Parameters
colorA color string see http://www.wesnoth.org/wiki/GUIVariable for more info.
Returns
The color.

Definition at line 73 of file helper.cpp.

References i, and utils::split().

unsigned gui2::decode_font_style ( const std::string style)

Converts a font style string to a font style.

Parameters
styleA font style string see http://www.wesnoth.org/wiki/GUIVariable for more info.
Returns
The font style.

Definition at line 55 of file helper.cpp.

References ERR_GUI_G.

PangoAlignment gui2::decode_text_alignment ( const std::string alignment)

Converts a text alignment string to a text alignment.

Parameters
alignmentAn alignment string see http://www.wesnoth.org/wiki/GUIVariable for more info.
Returns
The text alignment.

Definition at line 92 of file helper.cpp.

References ERR_GUI_E.

Referenced by gui2::tformula< T >::convert(), gui2::tformula< T >::execute(), and gui2::tcontrol::set_members().

static t_string gui2::default_value_label_generator ( const std::vector< t_string > &  value_labels,
int  item_position,
int  max 
)
static

Definition at line 290 of file slider.cpp.

Referenced by gui2::tslider::set_value_labels().

static std::string gui2::describe_status_simple ( const addon_tracking_info info)
static
static std::string gui2::describe_status_verbose ( const addon_tracking_info state)
static
template<class D , void(D::*)(twindow &) fptr>
void gui2::dialog_callback ( twidget &  caller)

Template for dialog callbacks.

Example usage: widget->set_callback(dialog_callback<my_dialog_class, &my_dialog_class::member_function>);

Definition at line 31 of file helper.hpp.

References gui2::twidget::dialog(), and gui2::twidget::get_window().

Referenced by gui2::tpreferences::initialize_tabs(), lua_gui2::intf_set_dialog_callback(), gui2::tcore_selection::pre_show(), gui2::tcampaign_selection::pre_show(), gui2::tpreferences::pre_show(), gui2::teditor_resize_map::pre_show(), and gui2::tlobby_main::pre_show().

template<class D , class V , void(V::*)() fptr>
void gui2::dialog_view_callback ( twidget &  caller)

Template for dialog callbacks for dialogs using model-view-controller architecture pattern.

It allows delegating of the callback to a private view class, which should be accessible via dialog->get_view() (and return a pointer to the view class). Example usage: widget->set_callback(dialog_callback<my_dialog_class, my_dialog_class::inner_view_class &my_dialog_class::inner_view_class::member_function>);

Definition at line 122 of file gamestate_inspector.cpp.

References gui2::twidget::dialog().

Referenced by gui2::tmp_change_control::view::bind(), and gui2::tgamestate_inspector::view::bind().

static std::string gui2::disambiguate_widget_value ( const ttoggle_button &  parent_widget)
static
static std::string gui2::disambiguate_widget_value ( const tcombobox &  parent_widget)
static

Definition at line 139 of file preferences_dialog.cpp.

References gui2::tcombobox::get_value_string().

static std::string gui2::disambiguate_widget_value ( const tslider &  parent_widget)
static

Definition at line 144 of file preferences_dialog.cpp.

References gui2::tslider::get_value_label().

std::string gui2::encode_text_alignment ( const PangoAlignment  alignment)

Converts a text alignment to its string representation.

Parameters
alignmentAn alignment.
Returns
An alignment string see http://www.wesnoth.org/wiki/GUIVariable for more info.

Definition at line 107 of file helper.cpp.

Referenced by gui2::tcontrol::update_canvas().

bool gui2::execute_timer ( const size_t  id)

Executes a timer.

Note
this function is only meant to be executed by the event handling system.
Parameters
idThe id of the timer to execute, this is the id returned by add_timer.
Returns
Status, false if the timer couldn't be executed.

Definition at line 175 of file timer.cpp.

References DBG_GUI_E, itor, and LOG_GUI_E.

Referenced by gui2::event::thandler::handle_event().

template<class T >
T* gui2::find_widget ( typename utils::tconst_clone< twidget, T >::pointer  widget,
const std::string id,
const bool  must_be_active,
const bool  must_exist 
)

Gets a widget with the wanted id.

This template function doesn't return a pointer to a generic widget but returns the wanted type and tests for its existence if required.

Parameters
widgetThe widget test or find a child with the wanted id.
idThe id of the widget to find.
must_be_activeThe widget should be active, not all widgets have an active flag, those who don't ignore flag.
must_existThe widget should be exist, the function will fail if the widget doesn't exist or is inactive and must be active. Upon failure a wml_error is thrown.
Returns
The widget with the id.

Definition at line 69 of file find_widget.hpp.

References missing_widget(), and VALIDATE.

template<class T >
T& gui2::find_widget ( typename utils::tconst_clone< twidget, T >::pointer  widget,
const std::string id,
const bool  must_be_active 
)

Gets a widget with the wanted id.

This template function doesn't return a reference to a generic widget but returns a reference to the wanted type

Parameters
widgetThe widget test or find a child with the wanted id.
idThe id of the widget to find.
must_be_activeThe widget should be active, not all widgets have an active flag, those who don't ignore flag.
Returns
The widget with the id.

Definition at line 96 of file find_widget.hpp.

References id.

static std::string gui2::format_addon_time ( time_t  time)
static
static std::string gui2::format_stats ( const unit u)
static
static bool gui2::fullscreen ( CVideo video)
static

Definition at line 143 of file title_screen.cpp.

References preferences::fullscreen(), and CVideo::set_fullscreen().

static bool gui2::fullscreen ( CVideo video)
static
template<class R , class F >
R gui2::function_wrapper ( const R  result,
const F &  function 
)

Helper for function wrappers.

For boost bind the a function sometimes needs to return a value although the function called doesn't return one. This wrapper function can return a fixed result for a certain functor.

Template Parameters
RThe return type.
FThe type of the functor.
Parameters
resultThe result value.
functionThe functor to call.
Returns
result.

Definition at line 172 of file helper.hpp.

Referenced by gui2::ttitle_screen::post_build(), and gui2::tlobby_main::post_build().

static tgrid* gui2::get_advanced_row_grid ( tlistbox &  list,
const int  selected_row 
)
static
tresolution_definition_ptr gui2::get_control ( const std::string control_type,
const std::string definition 
)
static bool gui2::get_do_not_show_again ( )
static
static bool gui2::get_dont_ask_again ( )
static

Helper to invert preferences::ask_delete_saves.

The value stored and the way shown is inverted.

Definition at line 46 of file game_delete.cpp.

References preferences::ask_delete_saves().

Referenced by gui2::tgame_delete::tgame_delete().

static std::string gui2::get_image_mods ( const unit u)
static
static std::string gui2::get_max_autosaves_status_label ( const tslider &  slider)
static
tpoint gui2::get_mouse_position ( )
template<class T >
T& gui2::get_parent ( twidget &  widget)

Returns the first parent of a widget with a certain type.

Parameters
widgetThe widget to get the parent from,
Template Parameters
TThe class of the widget to return.
Returns
The parent widget.

Definition at line 35 of file find_widget.hpp.

References gui2::twidget::parent().

void gui2::get_screen_size_variables ( game_logic::map_formula_callable variable)

Gets a formula object with the screen size.

Parameters
variableA formula object in which the screen_width, screen_height, gamemap_width and gamemap_height variable will set to the current values of these in settings. It modifies the object send.

Definition at line 132 of file helper.cpp.

References game_logic::map_formula_callable::add(), gui2::settings::gamemap_height, gui2::settings::gamemap_width, gui2::settings::gamemap_x_offset, gui2::settings::screen_height, and gui2::settings::screen_width.

Referenced by gui2::implementation::tbuilder_spacer::build(), gui2::implementation::tbuilder_drawing::build(), gui2::tcanvas::draw(), get_screen_size_variables(), and gui2::twindow::layout().

game_logic::map_formula_callable gui2::get_screen_size_variables ( )

Gets a formula object with the screen size.

Returns
Formula object with the screen_width, screen_height, gamemap_width and gamemap_height variable set to the current values of these in settings.

Definition at line 141 of file helper.cpp.

References get_screen_size_variables().

std::vector< twindow_builder::tresolution >::const_iterator gui2::get_window_builder ( const std::string type)

Returns an interator to the requested builder.

The builder is determined by the type and the current screen resolution.

Precondition
There is a valid builder for type at the current resolution.
Exceptions
twindow_builder_invalid_idWhen the precondition is violated.
Parameters
typeThe type of builder window to get.
Returns
An iterator to the requested builder.

Definition at line 624 of file settings.cpp.

References ERROR_LOG, itor, and gui2::twindow::update_screen_size().

Referenced by build().

static bool gui2::hotkey ( twindow &  window,
const ttitle_screen::tresult  result 
)
static

Definition at line 127 of file title_screen.cpp.

static int gui2::index_in_pager_range ( const int first,
const tstacked_widget &  pager 
)
static
bool gui2::init ( )
bool gui2::is_in_dialog ( )

Is a dialog open?

Note
added as backwards compatibility for gui::is_in_dialog.

Definition at line 960 of file handler.cpp.

References gui2::event::thandler::dispatchers_, and gui2::event::handler.

Referenced by gui::dialog_manager::dialog_manager(), gui::in_dialog(), and gui::dialog_manager::~dialog_manager().

static bool gui2::is_inserted_before ( unsigned  insertion_pos,
unsigned  old_item_count,
unsigned  old_position,
unsigned  visible_items 
)
static

Definition at line 365 of file scrollbar_container.cpp.

Referenced by adjust_scrollbar_mode().

static bool gui2::launch_lua_console ( twindow &  window)
static
void gui2::load_settings ( )
template<class T >
void gui2::load_widget_definitions ( tgui_definition &  gui_definition,
const std::string definition_type,
const config cfg,
const char *  key 
)

Loads the definitions of a widget.

This function is templated and kept small so only loads the definitions from the config and then lets the real job be done by the load_widget_definitions above.

Parameters
gui_definitionThe gui definition the widget definition belongs to.
definition_typeThe type of the widget whose definitions are to be loaded.
cfgThe config to serialise the definitions from.
keyOptional id of the definition to load.

Definition at line 120 of file settings.hpp.

References config::child_range(), and load_widget_definitions().

void gui2::load_widget_definitions ( tgui_definition &  gui_definition,
const std::string definition_type,
const std::vector< tcontrol_definition_ptr > &  definitions 
)

Loads the definitions of a widget.

Parameters
gui_definitionThe gui definition the widget definition belongs to.
definition_typeThe type of the widget whose definitions are to be loaded.
definitionsThe definitions serialized from a config object.

Definition at line 568 of file settings.cpp.

References DBG_GUI_P, and gui2::tgui_definition::load_widget_definitions().

Referenced by load_widget_definitions().

std::function<void(twidget &)> gui2::make_dialog_callback ( dialog_member_func_type  func)
inline

Definition at line 50 of file helper.hpp.

References make_dialog_callback_helper().

Referenced by gui2::tpreferences::initialize_members().

void gui2::make_dialog_callback_helper ( const dialog_member_func_type &  t,
twidget &  caller 
)
inline

Definition at line 42 of file helper.hpp.

References gui2::twidget::get_window().

Referenced by make_dialog_callback().

t_string gui2::missing_widget ( const std::string id)

Returns a default error message if a mandatory widget is omitted.

Parameters
idThe id of the omitted widget.
Returns
The error message.

Definition at line 123 of file helper.cpp.

References id, and vgettext().

Referenced by find_widget(), and gui2::tcampaign_selection::pre_show().

static bool gui2::operator< ( const tkey &  lhs,
const tkey &  rhs 
)
static

Definition at line 83 of file minimap.cpp.

References gui2::tkey::h, gui2::tkey::map_data, and gui2::tkey::w.

std::ostream & gui2::operator<< ( std::ostream &  stream,
const tpoint &  point 
)

Definition at line 38 of file point.cpp.

References gui2::tpoint::x, and gui2::tpoint::y.

void gui2::register_builder_widget ( const std::string id,
std::function< tbuilder_widget_ptr(config)>  functor 
)

Registers a widget to be build.

Warning
This function runs before main() so needs to be careful regarding the static initialization problem.
Parameters
idThe id of the widget as used in WML.
functorThe functor to create the widget.

Definition at line 149 of file window_builder.cpp.

References builder_widget_lookup(), and functor().

gui2::REGISTER_DIALOG ( select_orb_colors  )
gui2::REGISTER_DIALOG ( label_settings  )
void gui2::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.

This function registers the available widgets defined in WML. All widgets need to register themselves before gui2::init) is called.

Warning
This function runs before main() so needs to be careful regarding the static initialization problem.
Parameters
idThe id of the widget to register.
functorThe function to load the definitions.

Definition at line 558 of file settings.cpp.

References functor(), and registred_widget_type().

void gui2::register_window ( const std::string id)

Registers a window.

This function registers the available windows defined in WML. All windows need to register themselves before gui2::init) is called.

Warning
This function runs before main() so needs to be careful regarding the static initialization problem.
Note
Double registering a window can't hurt, but no way to probe for it, this can be added if needed. The same for an unregister function.
Parameters
idThe id of the window to register.

Definition at line 467 of file settings.cpp.

References gui2::event::find(), itor, and registered_window_types().

static std::vector<std::string>& gui2::registered_window_types ( )
static

Returns the list of registered windows.

The function can be used the look for registered windows or to add them.

Definition at line 79 of file settings.cpp.

Referenced by gui2::tunit_test_access_only::get_registered_window_list(), gui2::tgui_definition::read(), and register_window().

static tregistered_widget_type& gui2::registred_widget_type ( )
static

Definition at line 92 of file settings.cpp.

Referenced by gui2::tgui_definition::read(), and register_widget().

bool gui2::remove_timer ( const size_t  id)

Removes a timer.

It's save to remove a timer in its own callback, only the value returned might not be accurate. The destruction is postponed until the execution is finished and the return value is whether the postponing was successful.

Parameters
idThe id of the timer to remove, this is the id returned by add_timer.
Returns
Status, false if the timer couldn't be removed.

Definition at line 144 of file timer.cpp.

References DBG_GUI_E, itor, and LOG_GUI_E.

Referenced by gui2::tloadscreen::post_show(), gui2::tlobby_main::post_show(), gui2::trepeating_button::set_state(), gui2::trepeating_button::signal_handler_left_button_up(), gui2::event::tmouse_motion::stop_hover_timer(), gui2::texecutor::~texecutor(), gui2::tlobby_main::~tlobby_main(), and gui2::trepeating_button::~trepeating_button().

static int gui2::resize_grid_xy_to_idx ( const int  x,
const int  y 
)
static

Convert a coordinate on a 3 by 3 grid to an index, return 9 for out of bounds.

Definition at line 141 of file resize_map.cpp.

Referenced by gui2::teditor_resize_map::update_expand_direction().

static void gui2::revert_to_default_pref_values ( twindow &  window)
static
static void gui2::set_attacker_info ( twindow &  window,
const unit u 
)
static
static void gui2::set_defender_info ( twindow &  window,
const unit u 
)
static
static void gui2::set_do_not_show_again ( const bool  do_not_show_again)
static
static void gui2::set_dont_ask_again ( const bool  ask_again)
static

Helper to invert preferences::set_ask_delete_saves.

The value stored and the way shown is inverted.

Definition at line 56 of file game_delete.cpp.

References preferences::set_ask_delete_saves().

Referenced by gui2::tgame_delete::tgame_delete().

template<class T >
static void gui2::set_label ( twindow &  window,
const std::string id,
const std::string label 
)
static
static void gui2::set_pref_and_button ( const std::string id,
bool  value,
twindow &  window 
)
static
static void gui2::set_resolution_list ( tcombobox &  res_list,
CVideo video 
)
static
static void gui2::set_scrollbar_mode ( tgrid *  scrollbar_grid,
tscrollbar_ *  scrollbar,
tscrollbar_container::tscrollbar_mode &  scrollbar_mode,
const unsigned  items,
const unsigned  visible_items 
)
static
void gui2::set_single_child ( tgrid &  grid,
twidget *  widget 
)

Sets the single child in a grid.

The function initializes the grid to 1 x 1 and adds the widget with the grow to client flags.

Parameters
gridThe grid to add the child to.
widgetThe widget to add as child to the grid.

Definition at line 1021 of file grid.cpp.

References gui2::tgrid::HORIZONTAL_GROW_SEND_TO_CLIENT, gui2::tgrid::set_child(), gui2::tgrid::set_rows_cols(), and gui2::tgrid::VERTICAL_GROW_SEND_TO_CLIENT.

static void gui2::set_weapon_info ( twindow &  window,
const std::vector< battle_context > &  weapons,
const int  best_weapon 
)
static
static void gui2::setup_item ( const std::string item,
twindow &  window 
)
static
static ttoggle_button* gui2::setup_pref_toggle_button ( const std::string id,
bool  def,
twindow &  window 
)
static
void gui2::show_error_message ( CVideo video,
const std::string message,
bool  message_use_markup = false 
)
void gui2::show_message ( CVideo video,
const std::string title,
const std::string message,
const std::string button_caption = "",
const bool  auto_close = true,
const bool  message_use_markup = false 
)
int gui2::show_message ( CVideo video,
const std::string title,
const std::string message,
const tmessage::tbutton_style  button_style,
bool  message_use_markup = false,
bool  title_use_markup = false 
)

Shows a message to the user.

Note
this function is rather untested, and the API might change in the near future.
Parameters
videoThe video which contains the surface to draw upon.
titleThe title of the dialog.
messageThe message to show in the dialog.
button_styleThe style of the button(s) shown.
message_use_markupUse markup for the message?
title_use_markupUse markup for the title?
Returns
The retval of the dialog shown.

Definition at line 155 of file message.cpp.

References _(), gui2::tmessage::auto_close, gui2::tmessage::cancel, gui2::tmessage::cancel_button, gui2::tmessage::close_button, gui2::tdialog::get_retval(), gui2::tmessage::ok, gui2::tmessage::ok_button, gui2::tmessage::ok_cancel_buttons, gui2::tmessage::set_button_caption(), gui2::tmessage::set_button_visible(), gui2::tdialog::show(), gui2::twidget::tvisible::visible, and gui2::tmessage::yes_no_buttons.

static void gui2::show_server_list ( CVideo video,
twindow &  window,
tfield_text *  host_name 
)
static

Definition at line 153 of file mp_connect.cpp.

References gui2::twindow::OK.

Referenced by gui2::tmp_connect::pre_show().

void gui2::show_transient_error_message ( CVideo video,
const std::string message,
const std::string image = std::string(),
const bool  message_use_markup = false 
)

Shows a transient error message to the user.

This shows a dialog with a short message which can be dismissed with a single click.

Parameters
videoThe video which contains the surface to draw upon.
messageThe message to show in the dialog.
imageAn image to show in the dialog.
message_use_markupUse markup for the message?

Definition at line 71 of file transient_message.cpp.

References _(), lg::err(), lg::general(), LOG_STREAM, and show_transient_message().

Referenced by dialogs::file_dialog::action(), savegame::loadgame::load_multiplayer_game(), and gui2::tpreferences::remove_friend_list_entry().

void gui2::show_transient_message ( CVideo video,
const std::string title,
const std::string message,
const std::string image = std::string(),
const bool  message_use_markup = false,
const bool  title_use_markup = false,
const bool  restore_background = false 
)

Shows a transient message to the user.

This shows a dialog with a short message which can be dismissed with a single click.

Note
The message should be small enough to fit on the window, the text can contain newlines and will wrap when needed.
Parameters
videoThe video which contains the surface to draw upon.
titleThe title of the dialog.
messageThe message to show in the dialog.
imageAn image to show in the dialog.
message_use_markupUse markup for the message?
title_use_markupUse markup for the title?
restore_backgroundRestore the background to the state it was before the message appeared

Definition at line 56 of file transient_message.cpp.

References gui2::tdialog::set_restore(), and gui2::tdialog::show().

Referenced by gui2::tpreferences::add_friend_list_entry(), editor::context_manager::apply_mask_dialog(), editor::context_manager::check_switch_open_map(), mp::create::create(), editor::context_manager::create_mask_to_dialog(), gui2::tpreferences::default_hotkey_callback(), events::menu_handler::do_recruit(), events::console_handler::do_show_var(), events::menu_handler::end_turn(), editor::context_manager::generate_map_dialog(), help::help_browser::handle_event(), editor::context_manager::load_map(), savegame::loadgame::load_multiplayer_game(), editor::editor_controller::main_loop(), events::mouse_handler::move_unit_along_route(), game_launcher::play_multiplayer(), playsingle_controller::play_scenario(), playsingle_controller::play_scenario_init(), mp::create::process_event_impl(), mp::configure::process_event_impl(), mp::wait::process_network_data(), events::menu_handler::recall(), events::menu_handler::recruit(), actions::undo::recruit_action::redo(), actions::undo::recall_action::redo(), savegame::savegame::save_game(), events::menu_handler::save_map(), editor::context_manager::save_map_as(), editor::context_manager::save_scenario_as(), events::mouse_handler::show_attack_dialog(), campaign_controller::show_carryover_message(), savegame::loadgame::show_dialog(), help::show_help(), dialogs::show_objectives(), lua_gui2::show_popup_dialog(), preferences::show_theme_dialog(), show_transient_error_message(), playsingle_controller::show_turn_dialog(), editor::context_manager::write_map(), and editor::context_manager::write_scenario().

int gui2::show_wml_message ( const bool  left_side,
CVideo video,
const std::string title,
const std::string message,
const std::string portrait,
const bool  mirror,
const bool  has_input,
const std::string input_caption,
std::string input_text,
const unsigned  maximum_length,
const std::vector< twml_message_option > &  option_list,
int chosen_option 
)

Helper function to show a portrait.

Parameters
left_sideIf true the portrait is shown on the left, on the right side otherwise.
videoThe display variable.
titleThe title of the dialog.
messageThe message to show.
portraitFilename of the portrait.
mirrorDoes the portrait need to be mirrored?
has_inputDo we need to show the input box.
input_captionThe caption for the optional input text box. If this value != "" there is an input and the input text parameter is mandatory.
input_textPointer to the initial text value will be set to the result.
maximum_lengthThe maximum length of the text.
option_listA list of options to select in the dialog.
chosen_optionPointer to the initially chosen option. Will be set to the chosen option when the dialog closes.

Definition at line 152 of file wml_message.cpp.

Referenced by lua_gui2::show_message_dialog().

static void gui2::shrink_cache ( )
static

Definition at line 147 of file minimap.cpp.

References cache, cache_max_size, compare(), DBG_GUI_D, mp_ui_alerts::items, and itor.

Referenced by gui2::tminimap::get_image().

template<class T >
bool gui2::sort ( const tpane::titem &  lhs,
const tpane::titem &  rhs,
const std::string tag,
const bool  ascending 
)
inline

Definition at line 33 of file filter.hpp.

References lexical_cast(), and gui2::tpane::titem::tags.

static Uint32 gui2::timer_callback ( Uint32  ,
void id 
)
static

Definition at line 84 of file timer.cpp.

References DBG_GUI_E, id, itor, and TIMER_EVENT.

Referenced by add_timer().

std::string gui2::unit_test_mark_as_tested ( const tdialog &  dialog)

This is used in the unit tests, but these implementation details shouldn't be used in the normal code.

Definition at line 107 of file test_gui2.cpp.

References schema_validation::remove, unit_test_registered_window_list(), and gui2::tdialog::window_id().

std::string gui2::unit_test_mark_popup_as_tested ( const tpopup &  dialog)

This is used in the unit tests, but these implementation details shouldn't be used in the normal code.

Definition at line 116 of file test_gui2.cpp.

References schema_validation::remove, unit_test_registered_window_list(), and gui2::tpopup::window_id().

tdialog* gui2::unit_test_mp_server_list ( )

Definition at line 132 of file test_gui2.cpp.

References gui2::tmp_connect::mp_server_list_for_unit_test().

std::vector<std::string>& gui2::unit_test_registered_window_list ( )
twindow* gui2::unit_test_window ( const tpopup &  dialog)

This is used in the unit tests, but these implementation details shouldn't be used in the normal code.

Definition at line 125 of file test_gui2.cpp.

References gui2::tpopup::window_.

Variable Documentation

tcache gui2::cache
static
const size_t gui2::cache_max_size = 100
static

Maximum number of items in the cache (multiple of 4).

No testing on the optimal number is done, just seems a nice number.

Definition at line 125 of file minimap.cpp.

Referenced by gui2::tminimap::get_image(), and shrink_cache().

std::map<std::string, tgui_definition>::const_iterator gui2::current_gui = guis.end()
static

Points to the current gui.

Definition at line 465 of file settings.cpp.

size_t gui2::executing_id = 0
static

The id of the event being executed, 0 if none.

Definition at line 45 of file timer.cpp.

Referenced by gui2::texecutor::~texecutor().

bool gui2::executing_id_removed = false
static

Did somebody try to remove the timer during its execution?

Definition at line 48 of file timer.cpp.

std::map<std::string, tgui_definition> gui2::guis
static

Map with all known guis.

Definition at line 462 of file settings.cpp.

size_t gui2::id = 0
static
lg::log_domain gui2::log_gui_draw
lg::log_domain gui2::log_gui_event

Definition at line 34 of file log.hpp.

lg::log_domain gui2::log_gui_general

Definition at line 40 of file log.hpp.

Referenced by gui2::tbuilder_grid::build(), and gui2::tcontainer_::init_grid().

lg::log_domain gui2::log_gui_iterator

Definition at line 46 of file log.hpp.

lg::log_domain gui2::log_gui_layout
lg::log_domain gui2::log_gui_lifetime

Definition at line 63 of file log.hpp.

lg::log_domain gui2::log_gui_parse

Definition at line 68 of file log.hpp.

Referenced by gui2::tcanvas::parse_cfg(), and gui2::tbuilder_grid::tbuilder_grid().

bool gui2::new_widgets = false
bool gui2::show_debug_clock_button = false

Do we wish to show the button for the debug clock.

Definition at line 125 of file title_screen.cpp.

Referenced by game_launcher::game_launcher(), gui2::ttitle_screen::pre_show(), and gui2::ttitle_screen::show_debug_clock_window().

const ::config* gui2::terrain = nullptr
static

The terrain used to create the cache.

If another terrain config is used the cache needs to be cleared, this normally doesn't happen a lot so the clearing of the cache is rather unusual.

Definition at line 135 of file minimap.cpp.

Referenced by movetype::terrain_info::data::calc_value(), game_board::change_terrain(), ai::ai_default_rca::move_cost_calculator::cost(), pathfind::shortest_path_calculator::cost(), pathfind::move_type_path_calculator::cost(), create_terrain_maps(), default_map_generator_job::default_generate_map(), editor::terrain_palette::draw_item(), editor::editor_map::expand_bottom(), editor::editor_map::expand_top(), ai::default_recruitment::recruitment::get_average_defense(), editor::editor_map::get_contiguous_terrain_tiles(), gui2::tminimap::get_image(), terrain_type_data::get_underlying_terrain_string(), image::getMinimap(), unit_animation_component::invalidate(), preferences::manager::manager(), help::unit_topic_generator::operator()(), operator<<(), gamemap::overlay(), terrain_builder::parse_mapstring(), placing_score(), ai::readonly_context_impl::power_projection(), ai::ai_default_rca::aspect_attacks_base::rate_terrain(), ai::default_ai_context_impl::rate_terrain(), t_translation::read_builder_map(), t_translation::read_game_map(), t_translation::read_list(), unit_drawer::redraw_unit(), REPORT_GENERATOR(), editor::terrain_palette::select_bg_item(), editor::terrain_palette::select_fg_item(), gui2::tminimap::set_config(), unit_type_data::set_config(), terrain_type_data::underlying_def_terrain(), terrain_type_data::underlying_mvt_terrain(), terrain_type_data::underlying_union_terrain(), unit_box_at(), unit_defense(), unit_moves(), and preferences::manager::~manager().

std::map<size_t, ttimer> gui2::timers
static

The active timers.

Definition at line 42 of file timer.cpp.

std::map<std::string, twindow_builder> gui2::windows
static

Map with all known windows, (the builder class builds a window).

Definition at line 459 of file settings.cpp.

Referenced by create(), destroy(), and modify().