uicore::ViewTree Class Referenceabstract

Base class for managing a tree of views. More...

#include <view_tree.h>

+ Inheritance diagram for uicore::ViewTree:

Public Member Functions

 ViewTree ()
 
virtual ~ViewTree ()
 
void add_child (const std::shared_ptr< View > &view)
 Add a child view. More...
 
template<typename T , typename... Types>
std::shared_ptr< T > add_child (Types &&...args)
 
std::shared_ptr< Viewadd_child ()
 
virtual CanvasPtr canvas () const =0
 Gets the current canvas used to render. More...
 
virtual DisplayWindowPtr display_window ()=0
 
Viewfocus_view () const
 The view receiving keyboard events or nullptr if no view has the focus. More...
 
const std::shared_ptr< View > & root_view () const
 Retrieves the root of the view tree. More...
 
void set_root_view (std::shared_ptr< View > root_view)
 Sets a new root view controller for the view tree. More...
 

Protected Member Functions

virtual Pointf client_to_screen_pos (const Pointf &pos)=0
 Map from client to screen coordinates. More...
 
void dispatch_activation_change (ActivationChangeType type)
 Dispatch activation change event to all views. More...
 
void render (const CanvasPtr &canvas, const Rectf &margin_box)
 Renders view into the specified canvas. More...
 
virtual Pointf screen_to_client_pos (const Pointf &pos)=0
 Map from screen to client coordinates. More...
 
void set_focus_view (View *view)
 Set or clears the focus. More...
 
virtual void set_needs_render ()=0
 Signals that the root view needs to be rendered again. More...
 

Friends

class PositionedLayout
 
class View
 
class ViewController
 
class ViewImpl
 

Detailed Description

Base class for managing a tree of views.

Constructor & Destructor Documentation

uicore::ViewTree::ViewTree ( )
virtual uicore::ViewTree::~ViewTree ( )
virtual

Member Function Documentation

void uicore::ViewTree::add_child ( const std::shared_ptr< View > &  view)
inline

Add a child view.

References root_view().

template<typename T , typename... Types>
std::shared_ptr<T> uicore::ViewTree::add_child ( Types &&...  args)
inline

References add_child().

std::shared_ptr<View> uicore::ViewTree::add_child ( )
inline

Referenced by add_child().

virtual CanvasPtr uicore::ViewTree::canvas ( ) const
pure virtual

Gets the current canvas used to render.

Implemented in uicore::TextureWindow, and uicore::TopLevelWindow.

virtual Pointf uicore::ViewTree::client_to_screen_pos ( const Pointf pos)
protectedpure virtual

Map from client to screen coordinates.

Implemented in uicore::TextureWindow, and uicore::TopLevelWindow.

void uicore::ViewTree::dispatch_activation_change ( ActivationChangeType  type)
protected

Dispatch activation change event to all views.

virtual DisplayWindowPtr uicore::ViewTree::display_window ( )
pure virtual

Gets the display window used

This may return a null DisplayWindow

Implemented in uicore::TextureWindow, and uicore::TopLevelWindow.

View* uicore::ViewTree::focus_view ( ) const

The view receiving keyboard events or nullptr if no view has the focus.

void uicore::ViewTree::render ( const CanvasPtr canvas,
const Rectf margin_box 
)
protected

Renders view into the specified canvas.

const std::shared_ptr<View>& uicore::ViewTree::root_view ( ) const

Retrieves the root of the view tree.

Referenced by add_child().

virtual Pointf uicore::ViewTree::screen_to_client_pos ( const Pointf pos)
protectedpure virtual

Map from screen to client coordinates.

Implemented in uicore::TextureWindow, and uicore::TopLevelWindow.

void uicore::ViewTree::set_focus_view ( View view)
protected

Set or clears the focus.

virtual void uicore::ViewTree::set_needs_render ( )
protectedpure virtual

Signals that the root view needs to be rendered again.

Implemented in uicore::TextureWindow, and uicore::TopLevelWindow.

void uicore::ViewTree::set_root_view ( std::shared_ptr< View root_view)

Sets a new root view controller for the view tree.

Friends And Related Function Documentation

friend class PositionedLayout
friend
friend class View
friend
friend class ViewController
friend
friend class ViewImpl
friend

The documentation for this class was generated from the following file: