31#include "../View/view.h"
32#include "../Events/activation_change_event.h"
70 template<
typename T,
typename... Types>
73 auto child = std::make_shared<T>(std::forward<Types>(args)...);
106 std::unique_ptr<ViewTreeImpl> impl;
2D Graphics Canvas
Definition canvas.h:72
Top-level window class.
Definition display_window.h:101
2D (x,y) point structure - Float
Definition point.h:72
2D (left,top,right,bottom) rectangle structure - Float
Definition rect.h:460
friend class View
Definition view_tree.h:108
void dispatch_activation_change(ActivationChangeType type)
Dispatch activation change event to all views.
friend class PositionedLayout
Definition view_tree.h:111
virtual void set_needs_render()=0
Signals that the root view needs to be rendered again.
virtual DisplayWindow display_window()=0
virtual Canvas canvas() const =0
Gets the current canvas used to render.
std::shared_ptr< T > add_child(Types &&... args)
Definition view_tree.h:71
friend class ViewImpl
Definition view_tree.h:109
std::shared_ptr< View > add_child()
Definition view_tree.h:78
friend class ViewController
Definition view_tree.h:110
void add_child(const std::shared_ptr< View > &view)
Add a child view.
Definition view_tree.h:65
void set_root_view(std::shared_ptr< View > root_view)
Sets a new root view controller for the view tree.
const std::shared_ptr< View > & root_view() const
Retrieves the root of the view tree.
virtual Pointf screen_to_client_pos(const Pointf &pos)=0
Map from screen to client coordinates.
virtual Pointf client_to_screen_pos(const Pointf &pos)=0
Map from client to screen coordinates.
View * focus_view() const
The view receiving keyboard events or nullptr if no view has the focus.
void set_focus_view(View *view)
Set or clears the focus.
void render(Canvas &canvas, const Rectf &margin_box)
Renders view into the specified canvas.
ActivationChangeType
Window activation change.
Definition activation_change_event.h:37