28 typedef std::map<std::string, t_string>
string_map;
33 struct builder_widget;
51 friend class debug_layout_graph;
148 virtual ~
widget()
override;
156 void set_id(
const std::string&
id);
157 const std::string& id()
const;
185 const window* get_window()
const;
193 grid* get_parent_grid();
197 void set_parent(
widget* parent);
244 virtual void layout_initialize(
const bool full_initialization);
256 virtual void request_reduce_width(
const unsigned maximum_width) = 0;
270 virtual void demand_reduce_width(
const unsigned maximum_width);
283 virtual void request_reduce_height(
const unsigned maximum_height);
297 virtual void demand_reduce_height(
const unsigned maximum_height);
308 point get_best_size()
const;
320 virtual point calculate_best_size()
const = 0;
336 virtual bool can_wrap()
const;
348 virtual void set_origin(
const point& origin);
359 virtual void set_size(
const point&
size);
370 virtual void place(
const point& origin,
const point& size);
384 virtual void move(
const int x_offset,
const int y_offset);
391 virtual void set_horizontal_alignment(
const std::string& alignment);
398 virtual void set_vertical_alignment(
const std::string& alignment);
408 virtual void layout_children();
415 point get_origin()
const;
422 point get_size()
const;
429 SDL_Rect get_rectangle()
const;
437 unsigned get_width()
const;
439 unsigned get_height()
const;
442 void set_layout_size(
const point& size);
443 const point& layout_size()
const;
455 void set_linked_group(
const std::string& linked_group);
484 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS 492 mutable point last_best_size_;
523 SDL_Rect calculate_blitting_rectangle(
const int x_offset,
538 SDL_Rect calculate_clipping_rectangle(
const int x_offset,
569 void draw_children(
surface& frame_buffer,
int x_offset,
int y_offset);
586 void draw_foreground(
surface& frame_buffer,
int x_offset,
int y_offset);
634 void populate_dirty_list(
window& caller,
650 child_populate_dirty_list(
window& caller,
651 const std::vector<widget*>& call_stack);
662 SDL_Rect get_dirty_rectangle()
const;
672 virtual void set_visible_rectangle(
const SDL_Rect& rectangle);
676 void set_is_dirty(
const bool is_dirty);
677 bool get_is_dirty()
const;
684 void set_debug_border_mode(
const unsigned debug_border_mode);
686 void set_debug_border_color(
const color_t debug_border_color);
727 void draw_debug_border();
728 void draw_debug_border(
int x_offset,
int y_offset);
747 const bool must_be_active);
751 const bool must_be_active)
const;
768 virtual widget* find(
const std::string&
id,
const bool must_be_active);
771 virtual const widget* find(
const std::string&
id,
772 const bool must_be_active)
const;
816 bool recursive_is_visible(
const widget*
widget,
const bool must_be_active)
const;
822 virtual bool disable_click_dismiss()
const = 0;
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.
The walker abstract base class.
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...
static std::deque< std::string > call_stack