ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
include
asw
modules
ui
root.h
Go to the documentation of this file.
1
8
9
#ifndef ASW_UI_ROOT_H
10
#define ASW_UI_ROOT_H
11
12
#include "
context.h
"
13
#include "
panel.h
"
14
15
namespace
asw::ui
{
16
19
class
Root
{
20
public
:
23
Root
();
24
26
Context
ctx
;
27
29
Panel
root
;
30
36
void
set_size
(
float
w,
float
h);
37
40
void
rebuild_focus_if_needed
();
41
48
Widget
*
hit_test
(
Widget
& w,
const
asw::Vec2<float>
& pointer_pos);
49
55
bool
dispatch_pointer
(
const
UIEvent
& e);
56
62
bool
dispatch_to_focused
(
const
UIEvent
& e);
63
66
void
update
();
67
70
void
draw
();
71
};
72
73
}
// namespace asw::ui
74
75
#endif
// ASW_UI_ROOT_H
asw::Vec2
A 2D vector in space.
Definition
geometry.h:21
asw::ui::Context
Shared state for the UI system.
Definition
context.h:75
asw::ui::Panel
A container widget with a background color or image.
Definition
panel.h:20
asw::ui::Root
Root container that manages the UI tree, input, and rendering.
Definition
root.h:19
asw::ui::Root::root
Panel root
The root panel widget.
Definition
root.h:29
asw::ui::Root::Root
Root()
Default constructor.
Definition
root.cpp:5
asw::ui::Root::dispatch_pointer
bool dispatch_pointer(const UIEvent &e)
Route a pointer event to the appropriate widget.
Definition
root.cpp:54
asw::ui::Root::hit_test
Widget * hit_test(Widget &w, const asw::Vec2< float > &pointer_pos)
Find the deepest widget at a given pointer position.
Definition
root.cpp:31
asw::ui::Root::dispatch_to_focused
bool dispatch_to_focused(const UIEvent &e)
Dispatch an event to the currently focused widget.
Definition
root.cpp:73
asw::ui::Root::rebuild_focus_if_needed
void rebuild_focus_if_needed()
Rebuild the focus list if the tree has changed.
Definition
root.cpp:20
asw::ui::Root::update
void update()
Process input and dispatch UI events.
Definition
root.cpp:87
asw::ui::Root::ctx
Context ctx
The UI context.
Definition
root.h:26
asw::ui::Root::draw
void draw()
Draw the UI tree.
Definition
root.cpp:223
asw::ui::Root::set_size
void set_size(float w, float h)
Set the size of the root panel.
Definition
root.cpp:11
asw::ui::Widget
Base class for all UI widgets.
Definition
widget.h:28
context.h
UI context and focus management for the ASW UI module.
asw::ui
Definition
button.h:19
panel.h
Panel widget for the ASW UI module.
asw::ui::UIEvent
Event structure for UI interactions.
Definition
event.h:21
Generated by
1.12.0