15 #define GETTEXT_DOMAIN "wesnoth-lib"
35 , layout_size_(
tpoint(0, 0))
36 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
37 , last_best_size_(
tpoint(0, 0))
43 , clipping_rectangle_()
45 , debug_border_mode_(0)
46 , debug_border_colour_(0)
49 DBG_GUI_LF <<
"widget create: " <<
static_cast<void*
>(
this) <<
"\n";
59 , layout_size_(
tpoint(0, 0))
60 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
61 , last_best_size_(
tpoint(0, 0))
63 , linked_group_(builder.linked_group)
67 , clipping_rectangle_()
69 , debug_border_mode_(builder.debug_border_mode)
70 , debug_border_colour_(builder.debug_border_color)
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: "
147 return window ? window->
dialog() :
nullptr;
193 if(result ==
tpoint(0, 0)) {
199 result.
x = std::max(result.
x, linked_size.
x);
200 result.
y = std::max(result.
y, linked_size.
y);
204 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
251 <<
" screen origin " <<
x_ <<
',' <<
y_
325 result.x += x_offset;
326 result.y += y_offset;
334 result.x += x_offset;
335 result.y += y_offset;
344 const SDL_Rect clipping_rectangle
361 const SDL_Rect clipping_rectangle
376 const SDL_Rect clipping_rectangle
387 std::vector<twidget*>& call_stack)
389 assert(call_stack.empty() || call_stack.back() !=
this);
399 call_stack.push_back(
this);
411 const std::vector<twidget*>& )
549 return is_at(coordinate, must_be_active) ?
this :
nullptr;
553 const bool must_be_active)
const
555 return is_at(coordinate, must_be_active) ?
this :
nullptr;
560 return id_ ==
id ?
this :
nullptr;
566 return id_ ==
id ?
this :
nullptr;
571 return &widget ==
this;
576 return is_at(coordinate,
true);
599 return coordinate.
x >=
x_ && coordinate.
x < (
x_ +
static_cast<int>(
width_))
600 && coordinate.
y >=
y_
601 && coordinate.
y < (
y_ +
static_cast<int>(
height_));
Define the common log macros for the gui toolkit.
bool new_widgets
Do we wish to use the new library or not.
SDL_Rect intersect_rects(SDL_Rect const &rect1, SDL_Rect const &rect2)
Calculates the intersection of two rectangles.
tformula< unsigned > x_
The x coordinate of the rectangle.
void fill_rect(surface &dst, SDL_Rect *dst_rect, const Uint32 color)
Fill a rectangle on a given surface.
virtual const std::string & get_control_type() const =0
Returns the control_type of the control.
const SDL_Rect empty_rect
SDL_Rect create_rect(const tpoint &origin, const tpoint &size)
Creates a rectangle.
base class of top level items, the only item which needs to store the final canvases to draw on ...
A class inherited from ttext_box that displays its input as stars.
tdialog * dialog()
Inherited from twidget.
bool fire(const tevent event, twidget &target)
Fires an event which has no extra parameters.
Abstract base class for all dialogs.
This file contains the defintions for the gui2::event::tmessage class.
Request for somebody to place the widget.
tformula< unsigned > y_
The y coordinate of the rectangle.
GLdouble GLdouble GLdouble r
Send by a widget to notify others it's being destroyed.
Base class for all visible items.
GLuint const GLchar * name
void add_to_dirty_list(const std::vector< twidget * > &call_stack)
Adds an item to the dirty_list_.
Contains the SDL_Rect helper code.
void add_linked_widget(const std::string &id, twidget *widget)
Adds a widget to a linked size group.
GLsizei GLenum GLuint GLuint GLsizei char * message
tpoint get_linked_size(const std::string &linked_group_id) const
GLsizei const GLcharARB ** string
void draw_rectangle(int x, int y, int w, int h, Uint32 color, surface target)
Draw a colored rectangle on a surface.
void invalidate_layout()
Updates the size of the window.