28 typedef std::map<std::string, t_string>
string_map;
33 struct builder_widget;
51 friend class debug_layout_graph;
156 virtual ~
widget()
override;
164 void set_id(
const std::string&
id);
165 const std::string&
id()
const;
193 const window* get_window()
const;
201 grid* get_parent_grid();
205 void set_parent(
widget* parent);
252 virtual void layout_initialize(
const bool full_initialization);
264 virtual void request_reduce_width(
const unsigned maximum_width) = 0;
278 virtual void demand_reduce_width(
const unsigned maximum_width);
291 virtual void request_reduce_height(
const unsigned maximum_height);
305 virtual void demand_reduce_height(
const unsigned maximum_height);
316 point get_best_size()
const;
328 virtual point calculate_best_size()
const = 0;
344 virtual bool can_wrap()
const;
356 virtual void set_origin(
const point& origin);
367 virtual void set_size(
const point&
size);
378 virtual void place(
const point& origin,
const point& size);
392 virtual void move(
const int x_offset,
const int y_offset);
399 virtual void set_horizontal_alignment(
const std::string& alignment);
406 virtual void set_vertical_alignment(
const std::string& alignment);
416 virtual void layout_children();
423 point get_origin()
const;
430 point get_size()
const;
437 SDL_Rect get_rectangle()
const;
445 unsigned get_width()
const;
447 unsigned get_height()
const;
450 void set_layout_size(
const point& size);
451 const point& layout_size()
const;
463 void set_linked_group(
const std::string& linked_group);
492 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS 500 mutable point last_best_size_;
531 SDL_Rect calculate_blitting_rectangle(
const int x_offset,
546 SDL_Rect calculate_clipping_rectangle(
const int x_offset,
575 void draw_children(
int x_offset,
int y_offset);
591 void draw_foreground(
int x_offset,
int y_offset);
628 void populate_dirty_list(
window& caller,
644 child_populate_dirty_list(
window& caller,
645 const std::vector<widget*>& call_stack);
656 SDL_Rect get_dirty_rectangle()
const;
666 virtual void set_visible_rectangle(
const SDL_Rect& rectangle);
670 void set_is_dirty(
const bool is_dirty);
671 bool get_is_dirty()
const;
678 void set_debug_border_mode(
const debug_border debug_border_mode);
680 void set_debug_border_color(
const color_t debug_border_color);
716 void draw_debug_border();
717 void draw_debug_border(
int x_offset,
int y_offset);
736 const bool must_be_active);
740 const bool must_be_active)
const;
757 virtual widget* find(
const std::string&
id,
const bool must_be_active);
760 virtual const widget* find(
const std::string&
id,
761 const bool must_be_active)
const;
805 bool recursive_is_visible(
const widget*
widget,
const bool must_be_active)
const;
811 virtual bool disable_click_dismiss()
const = 0;
std::unique_ptr< class walker_base > walker_ptr
Base class for event handling.
static void draw_background(surface screen, const SDL_Rect &area, const std::string &image)
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
static thread_local std::deque< std::string > call_stack
For printing error messages when WFL parsing or evaluation fails, this contains the names of the WFL ...
std::string id
Text to match against addon_info.tags()
map_location coordinate
Contains an x and y coordinate used for starting positions in maps.
base class of top level items, the only item which needs to store the final canvases to draw on...