16 #define GETTEXT_DOMAIN "wesnoth-lib"
42 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
48 , clipping_rectangle_()
50 , debug_border_color_(0,0,0,0)
52 DBG_GUI_LF <<
"widget create: " <<
static_cast<void*
>(
this);
64 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
67 , linked_group_(builder.linked_group)
70 , clipping_rectangle_()
71 , debug_border_mode_(builder.debug_border_mode)
72 , debug_border_color_(builder.debug_border_color)
74 DBG_GUI_LF <<
"widget create: " <<
static_cast<void*
>(
this);
80 <<
"widget destroy: " <<
static_cast<void*
>(
this)
81 <<
" (id: " <<
id_ <<
')';
103 <<
"set id of " <<
static_cast<void*
>(
this) <<
" to '" <<
id <<
"' "
104 <<
"(was '" <<
id_ <<
"'). Widget type: "
128 return dynamic_cast<window*
>(result);
136 const widget* result =
this;
142 return dynamic_cast<const window*
>(result);
148 while(result &&
dynamic_cast<grid*
>(result) ==
nullptr) {
152 return result ?
dynamic_cast<grid*
>(result) :
nullptr;
158 while(result &&
dynamic_cast<const grid*
>(result) ==
nullptr) {
162 return result ?
dynamic_cast<const grid*
>(result) :
nullptr;
208 if(result ==
point()) {
213 result.x = std::max(result.x, linked_size.x);
214 result.y = std::max(result.y, linked_size.y);
218 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
219 last_best_size_ = result;
267 <<
" screen origin " <<
x_ <<
',' <<
y_
394 dest.
shift(-window_origin);
415 dest.
shift(-window_origin);
436 dest.
shift(-window_origin);
555 const bool must_be_active)
const
562 return id_ ==
id ? this :
nullptr;
567 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(std::string_view 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...