55 friend class debug_layout_graph;
154 virtual ~
widget()
override;
162 void set_id(
const std::string&
id);
163 const std::string&
id()
const;
199 grid* get_parent_grid();
203 void set_parent(
widget* parent);
250 virtual void layout_initialize(
const bool full_initialization);
262 virtual void request_reduce_width(
const unsigned maximum_width) = 0;
276 virtual void demand_reduce_width(
const unsigned maximum_width);
289 virtual void request_reduce_height(
const unsigned maximum_height);
303 virtual void demand_reduce_height(
const unsigned maximum_height);
314 point get_best_size()
const;
326 virtual point calculate_best_size()
const = 0;
342 virtual bool can_wrap()
const;
353 virtual void set_origin(
const point& origin);
364 virtual void set_size(
const point&
size);
375 virtual void place(
const point& origin,
const point& size);
389 virtual void move(
const int x_offset,
const int y_offset);
396 virtual void set_horizontal_alignment(
const std::string& alignment);
403 virtual void set_vertical_alignment(
const std::string& alignment);
413 virtual void layout_children();
420 point get_origin()
const;
434 rect get_rectangle()
const;
442 unsigned get_width()
const;
444 unsigned get_height()
const;
447 void set_layout_size(
const point& size);
448 const point& layout_size()
const;
460 void set_linked_group(
const std::string& linked_group);
489 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS 497 mutable point last_best_size_;
524 SDL_Rect calculate_blitting_rectangle()
const;
534 SDL_Rect calculate_clipping_rectangle()
const;
542 void draw_background();
552 void draw_children();
563 void draw_foreground();
590 SDL_Rect get_dirty_rectangle()
const;
600 virtual void set_visible_rectangle(
const SDL_Rect& rectangle);
616 void queue_redraw(
const rect& region);
625 void set_debug_border_mode(
const debug_border debug_border_mode);
627 void set_debug_border_color(
const color_t debug_border_color);
652 void draw_debug_border();
671 const bool must_be_active);
675 const bool must_be_active)
const;
692 virtual widget* find(
const std::string&
id,
const bool must_be_active);
695 virtual const widget* find(
const std::string&
id,
696 const bool must_be_active)
const;
740 bool recursive_is_visible(
const widget*
widget,
const bool must_be_active)
const;
746 virtual bool disable_click_dismiss()
const = 0;
std::unique_ptr< class walker_base > walker_ptr
Base class for event handling.
point get_size(const locator &i_locator, bool skip_cache)
Returns the width and height of an image.
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
std::map< std::string, t_string > widget_item
The basic class for representing 8-bit RGB or RGBA colour values.
std::string id
Text to match against addon_info.tags()
An abstract description of a rectangle with integer coordinates.
SDL_Window * get_window()
Contains the SDL_Rect helper code.
void point(int x, int y)
Draw a single point.
std::map< std::string, widget_item > widget_data
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...
void fill(const SDL_Rect &rect, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Fill an area with the given colour.