15 #define GETTEXT_DOMAIN "wesnoth-lib" 39 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
46 , clipping_rectangle_()
47 , debug_border_mode_(0)
48 , debug_border_color_(0,0,0,0)
50 DBG_GUI_LF <<
"widget create: " <<
static_cast<void*
>(
this) <<
"\n";
62 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
73 DBG_GUI_LF <<
"widget create: " <<
static_cast<void*
>(
this) <<
"\n";
79 <<
"widget destroy: " <<
static_cast<void*
>(
this) <<
" (id: " <<
id_ 102 <<
"set id of " <<
static_cast<void*
>(
this) <<
" to '" <<
id <<
"' " 103 <<
"(was '" <<
id_ <<
"'). Widget type: " 127 return dynamic_cast<window*
>(result);
135 const widget* result =
this;
141 return dynamic_cast<const window*
>(result);
147 while(result && dynamic_cast<grid*>(result) ==
nullptr) {
151 return result ?
dynamic_cast<grid*
>(result) :
nullptr;
197 if(result ==
point()) {
203 result.
x = std::max(result.
x, linked_size.
x);
204 result.
y = std::max(result.
y, linked_size.
y);
208 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS 209 last_best_size_ = result;
255 <<
" screen origin " <<
x_ <<
',' <<
y_ 355 result.x += x_offset;
356 result.y += y_offset;
364 result.x += x_offset;
365 result.y += y_offset;
374 const SDL_Rect clipping_rectangle
391 const SDL_Rect clipping_rectangle
406 const SDL_Rect clipping_rectangle
419 assert(call_stack.empty() || call_stack.back() !=
this);
429 call_stack.push_back(
this);
441 const std::vector<widget*>& )
574 return is_at(coordinate, must_be_active) ? this :
nullptr;
578 const bool must_be_active)
const 580 return is_at(coordinate, must_be_active) ? this :
nullptr;
585 return id_ ==
id ? this :
nullptr;
591 return id_ ==
id ? this :
nullptr;
596 return &widget ==
this;
601 return is_at(coordinate,
true);
Define the common log macros for the gui toolkit.
bool new_widgets
Do we wish to use the new library or not.
SDL_Rect create_rect(const point &origin, const point &size)
Creates a rectangle.
Main class to show messages to the user.
SDL_Rect intersect_rects(const SDL_Rect &rect1, const SDL_Rect &rect2)
Calculates the intersection of two rectangles.
static const unsigned HORIZONTAL_MASK
point get_linked_size(const std::string &linked_group_id) const
The message callbacks hold a reference to a message.
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
Request to place the widget.
This file contains the settings handling of the widget library.
Sent by a widget to notify others it's being destroyed.
void draw_rectangle(const SDL_Rect &rect, const color_t &color)
Draw a rectangle outline.
This file contains the definitions for the gui2::event::message class.
bool point_in_rect(int x, int y, const SDL_Rect &rect)
Tests whether a point is inside a rectangle.
void add_linked_widget(const std::string &id, widget *widget)
Adds a widget to a linked size group.
void add_to_dirty_list(const std::vector< widget *> &call_stack)
Adds an item to the dirty_list_.
static const unsigned VERTICAL_MASK
unsigned get_v_align(const std::string &v_align)
Returns the vertical alignment.
Contains the SDL_Rect helper code.
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.
constexpr const SDL_Rect empty_rect
void fill_rectangle(const SDL_Rect &rect, const color_t &color)
Draws a filled rectangle.
bool fire(const ui_event event, widget &target)
Fires an event which has no extra parameters.
void invalidate_layout()
Updates the size of the window.
void remove_linked_widget(const std::string &id, const widget *widget)
Removes a widget from a linked size group.
map_location coordinate
Contains an x and y coordinate used for starting positions in maps.
unsigned get_h_align(const std::string &h_align)
Returns the horizontal alignment.
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