16 #define GETTEXT_DOMAIN "wesnoth-lib"
43 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
49 , clipping_rectangle_()
51 , debug_border_color_(0,0,0,0)
53 DBG_GUI_LF <<
"widget create: " <<
static_cast<void*
>(
this);
65 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
68 , linked_group_(builder.linked_group)
71 , clipping_rectangle_()
72 , debug_border_mode_(builder.debug_border_mode)
73 , debug_border_color_(builder.debug_border_color)
75 DBG_GUI_LF <<
"widget create: " <<
static_cast<void*
>(
this);
81 <<
"widget destroy: " <<
static_cast<void*
>(
this)
82 <<
" (id: " <<
id_ <<
')';
104 <<
"set id of " <<
static_cast<void*
>(
this) <<
" to '" <<
id <<
"' "
105 <<
"(was '" <<
id_ <<
"'). Widget type: "
129 return dynamic_cast<window*
>(result);
137 const widget* result =
this;
143 return dynamic_cast<const window*
>(result);
149 while(result &&
dynamic_cast<grid*
>(result) ==
nullptr) {
153 return result ?
dynamic_cast<grid*
>(result) :
nullptr;
199 if(result ==
point()) {
205 result.x = std::max(result.x, linked_size.x);
206 result.y = std::max(result.y, linked_size.y);
210 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
211 last_best_size_ = result;
259 <<
" screen origin " <<
x_ <<
',' <<
y_
386 dest.
shift(-window_origin);
408 dest.
shift(-window_origin);
429 dest.
shift(-window_origin);
551 const bool must_be_active)
const
558 return id_ ==
id ? this :
nullptr;
564 return id_ ==
id ? this :
nullptr;
Main class to show messages to the user.
bool fire(const ui_event event, widget &target)
Fires an event which has no extra parameters.
static const unsigned HORIZONTAL_MASK
void set_child_alignment(widget *widget, unsigned set_flag, unsigned mode_mask)
Modifies the widget alignment data of a child cell containing a specific widget.
static const unsigned VERTICAL_MASK
base class of top level items, the only item which needs to store the final canvases to draw on.
void invalidate_layout()
Updates the size of the window.
void add_linked_widget(const std::string &id, widget *widget)
Adds a widget to a linked size group.
point get_linked_size(const std::string &linked_group_id) const
void remove_linked_widget(const std::string &id, const widget *widget)
Removes a widget from a linked size group.
void queue_rerender(const rect ®ion)
Queue a rerender of the internal render buffer.
This file contains the definitions for the gui2::event::message class.
Drawing functions, for drawing things on the screen.
Define the common log macros for the gui toolkit.
std::string id
Text to match against addon_info.tags()
void invalidate_region(const rect ®ion)
Mark a region of the screen as requiring redraw.
viewport_setter set_viewport(const SDL_Rect &viewport)
Set the viewport.
clip_setter reduce_clip(const SDL_Rect &clip)
Set the clipping area to the intersection of the current clipping area and the given rectangle.
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.
void point(int x, int y)
Draw a single point.
void rect(const SDL_Rect &rect)
Draw a rectangle.
unsigned get_v_align(const std::string &v_align)
Returns the vertical alignment.
unsigned get_h_align(const std::string &h_align)
Returns the horizontal alignment.
bool new_widgets
Do we wish to use the new library or not.
constexpr const SDL_Rect empty_rect
map_location coordinate
Contains an x and y coordinate used for starting positions in maps.
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
Contains the SDL_Rect helper code.
This file contains the settings handling of the widget library.
The basic class for representing 8-bit RGB or RGBA colour values.
The message callbacks hold a reference to a message.
An abstract description of a rectangle with integer coordinates.
bool empty() const
False if both w and h are > 0, true otherwise.
bool contains(int x, int y) const
Whether the given point lies within the rectangle.
void shift(const point &p)
Shift the rectangle by the given relative position.
rect intersect(const SDL_Rect &r) const
Calculates the intersection of this rectangle and another; that is, the maximal rectangle that is con...