CoreComponents 4.0.0
A Modern C++ Toolkit
Loading...
Searching...
No Matches
View Class Reference

User interface building block More...

#include <cc/View>

Inheritance diagram for View:

Classes

class  Layout
 Automatic geometry for children views More...
 
struct  State
 Internal state \hideinheritancegraph. More...
 

Public Types

using Id = double
 View identifier
 
- Public Types inherited from Object
using NullAccess = cc::NullAccess
 Error thrown when trying to access a null object.
 
using VirginityTestFailed = cc::VirginityTestFailed
 Error thrown when trying to initialize an object with a non-virgin state.
 

Protected Types

using CreateState = State *()
 

Protected Member Functions

 View (State *newState)
 Initialize view.
 
 View (CreateState onDemand)
 Initialize view.
 
template<class T >
grab ()
 Get a weak reference version of this object.
 
template<class T >
T & associate (Out< T > self)
 Convenience method to associate a weak reference to this objet.
 
template<class T >
T & get ()
 Get access to the object's state (create it if needed)
 
template<class T >
const T & get () const
 Get access to the object's state (create it if needed)
 
Stateme ()
 
const Stateme () const
 
bool operator== (const State *other) const
 
- Protected Member Functions inherited from Surface
 Surface (State *newState)
 
State & me ()
 
const State & me () const
 
- Protected Member Functions inherited from Object
template<class T >
weak () const
 
template<class T >
void initOnce ()
 Create the object state when called the first time.
 
template<class T >
void initOncePerThread ()
 Create a distinct object state for each thread when called the first time in that thread.
 
 Object (State *newState)
 Initialize object with newState.
 
 Object (State *state, Alias)
 
 Object (State *state, Weak)
 
Objectoperator= (std::nullptr_t)
 

Static Protected Member Functions

template<class T >
static View::StateonDemand ()
 
- Static Protected Member Functions inherited from Object
template<class T >
static T alias (const State *state)
 Create an alias object for the given state.
 
template<class T >
static T weak (const State *state)
 

Construction

 View ()=default
 Create a primordial view.
 
 View (Out< View > self)
 Create a view.
 
 View (const Size &size, Out< View > self=None{})
 Create a view of initial size.
 
 View (double width, double height, Out< View > self=None{})
 Create a view of initial size (width, height)
 
 View (const Layout &layout, Out< View > self=None{})
 Create a view organizing its children with layout.
 
Viewassociate (Out< View > self)
 Get a weak reference in self.
 
Viewpopulate (const Function< void(View)> &&f)
 Invoke custom initialization function f.
 
void touch ()
 Materialize if this view is still primordial.
 
void show ()
 Convenience method to show this view.
 
int run ()
 Convenience method to show this view and run the application loop.
 

View Properties

Color paper () const
 Get/bind value of # paper

 
auto paper (this auto &&self, Color newValue) -> decltype(auto)
 Set value of # paper

 
auto paper (this auto &&self, Definition< Color > &&f) -> decltype(auto)
 Define value of # paper

 
bool visible () const
 Get/bind value of # visible

 
auto visible (this auto &&self, bool newValue) -> decltype(auto)
 Set value of # visible

 
auto visible (this auto &&self, Definition< bool > &&f) -> decltype(auto)
 Define value of # visible

 
double opacity () const
 Get/bind value of # opacity

 
auto opacity (this auto &&self, double newValue) -> decltype(auto)
 Set value of # opacity

 
auto opacity (this auto &&self, Definition< double > &&f) -> decltype(auto)
 Define value of # opacity

 
auto opacityEasing (this auto &&self, const EasingCurve &curve, double duration, Function< bool()> &&direct=nullptr) -> decltype(auto)
 Set the easing curve and duration of # opacity

 
bool clip () const
 Get/bind value of # clip

 
auto clip (this auto &&self, bool newValue) -> decltype(auto)
 Set value of # clip

 
auto clip (this auto &&self, Definition< bool > &&f) -> decltype(auto)
 Define value of # clip

 
bool moving () const
 Get/bind value of # moving

 
auto moving (this auto &&self, bool newValue) -> decltype(auto)
 Set value of # moving

 
auto moving (this auto &&self, Definition< bool > &&f) -> decltype(auto)
 Define value of # moving

 
Point pos () const
 Get/bind value of # pos

 
auto pos (this auto &&self, Point newValue) -> decltype(auto)
 Set value of # pos

 
auto pos (this auto &&self, Definition< Point > &&f) -> decltype(auto)
 Define value of # pos

 
auto posEasing (this auto &&self, const EasingCurve &curve, double duration, Function< bool()> &&direct=nullptr) -> decltype(auto)
 Set the easing curve and duration of # pos

 
Size size () const
 Get/bind value of # size

 
auto size (this auto &&self, Size newValue) -> decltype(auto)
 Set value of # size

 
auto size (this auto &&self, Definition< Size > &&f) -> decltype(auto)
 Define value of # size

 
auto sizeEasing (this auto &&self, const EasingCurve &curve, double duration, Function< bool()> &&direct=nullptr) -> decltype(auto)
 Set the easing curve and duration of # size

 
Padding padding () const
 Get/bind value of # padding

 
auto padding (this auto &&self, Padding newValue) -> decltype(auto)
 Set value of # padding

 
auto padding (this auto &&self, Definition< Padding > &&f) -> decltype(auto)
 Define value of # padding

 
Point pivot () const
 Get/bind value of # pivot

 
auto pivot (this auto &&self, Point newValue) -> decltype(auto)
 Set value of # pivot

 
auto pivot (this auto &&self, Definition< Point > &&f) -> decltype(auto)
 Define value of # pivot

 
auto pivotEasing (this auto &&self, const EasingCurve &curve, double duration, Function< bool()> &&direct=nullptr) -> decltype(auto)
 Set the easing curve and duration of # pivot

 
double angle () const
 Get/bind value of # angle

 
auto angle (this auto &&self, double newValue) -> decltype(auto)
 Set value of # angle

 
auto angle (this auto &&self, Definition< double > &&f) -> decltype(auto)
 Define value of # angle

 
auto angleEasing (this auto &&self, const EasingCurve &curve, double duration, Function< bool()> &&direct=nullptr) -> decltype(auto)
 Set the easing curve and duration of # angle

 
double scale () const
 Get/bind value of # scale

 
auto scale (this auto &&self, double newValue) -> decltype(auto)
 Set value of # scale

 
auto scale (this auto &&self, Definition< double > &&f) -> decltype(auto)
 Define value of # scale

 
auto scaleEasing (this auto &&self, const EasingCurve &curve, double duration, Function< bool()> &&direct=nullptr) -> decltype(auto)
 Set the easing curve and duration of # scale

 
View decoration () const
 Get/bind value of # decoration

 
auto decoration (this auto &&self, View newValue) -> decltype(auto)
 Set value of # decoration

 
auto decoration (this auto &&self, Definition< View > &&f) -> decltype(auto)
 Define value of # decoration

 
Viewpaint (Definition< void > &&f)
 Define the foreground.
 
double x () const
 Get pos()[0].
 
double y () const
 Get pos()[1].
 
double width () const
 Get size()[0].
 
double height () const
 Get size()[1].
 
double innerWidth () const
 Get inner width.
 
double innerHeight () const
 Get inner height.
 
Size preferredSize () const
 Get preferred size.
 
Size minSize () const
 Get minimal size.
 
Size maxSize () const
 Get maximal size.
 
Color basePaper () const
 Get the background paper.
 
const char * objectName () const
 Get the object name (for debugging)
 
ViewobjectName (const char *name)
 Set the object name
 
bool hasWindow () const
 Check if this view is already shown in a window.
 
Window window () const
 Get the window this view is shown in.
 
bool isHandheld () const
 Get window().display().isHandheld()
 

View Hierarchy

Id id () const
 Get view identifier.
 
List< IdfullId () const
 Get view identifier heritage list.
 
bool operator== (const View &other) const
 Equality operator.
 
std::strong_ordering operator<=> (const View &other) const
 Ordering operator.
 
bool hasParent () const
 Check if this is a child view.
 
View parent () const
 Get parent view.
 
View root () const
 Get the root view of this window.
 
long childrenCount () const
 Number of children.
 
long count () const
 Number of children.
 
bool hasChildren () const
 Check if there are any children.
 
auto add (this auto &&self, const View &child) -> decltype(auto)
 Add new child placed visually above all existing children.
 
auto addAbove (this auto &&self, const View &child) -> decltype(auto)
 Add new child placed visually above all existing children.
 
auto addBelow (this auto &&self, const View &child) -> decltype(auto)
 Add child place visually below all existing children.
 
auto insertAt (this auto &&self, Locator target, const View &child) -> decltype(auto)
 Insert new child at target.
 
auto insertAt (this auto &&self, long index, const View &child) -> decltype(auto)
 Insert new child at index.
 
void remove (const View &child)
 Remove a child.
 
auto operator() (this auto &&self, const View &child) -> decltype(auto)
 Syntax sugar for adding a child.
 
auto push (this auto &&self, const View &child) -> decltype(auto)
 Add new child placed visually above all existing children.
 
void pop ()
 Remove the top-most visible child.
 
void deplete ()
 Remove all children.
 
void moveToTop ()
 Make this view be visible above any other visible sibling.
 
void moveToBottom ()
 Make this view be visible beneath any other visible sibling.
 
const Set< View > & children () const
 Get all child views.
 
const Set< View > & visibleChildren () const
 Get visible child views.
 
Rect childrenRect () const
 Get bounding box containing all visible child views including their paddings.
 
Point mapToGlobal (Point l) const
 Map view coordinates l to window coordinates
 
Point mapToLocal (Point g) const
 Map window coordinates g to view coordinates
 
Point mapToChild (const View &child, Point l) const
 Map local coordinates l to child coordinates
 
Point mapToParent (const View &parent, Point l) const
 Map local coordinates l to parent coordinates
 
bool containsLocal (Point l) const
 Check if local point l lays inside this view.
 
bool containsGlobal (Point g) const
 Check if global point l lays inside this view.
 
View findChild (Point l) const
 Find the first child which contains local point l.
 
Control findControl (Point l) const
 Find the first control which contains local point l.
 
bool isParentOf (const View &other) const
 Check if this view is parent of other.
 
bool laysInsideOf (const View &other, double margin) const
 Check if this view is fully visible inside other with given surrounding margin.
 
void update ()
 Manually force repaint.
 
template<class T >
void collectVisible (InOut< List< T > > collection) const
 Get a list of all visible children in this view tree which are of type T.
 
Layout layout () const
 Get layout.
 
auto layout (this auto &&self, const Layout &newValue) -> decltype(auto)
 Set layout
 
void renderTo (Image &image) const
 Capture a rendered image of this view (including its children) as rendered on the screen.
 

Positional Anchors

double top () const
 Get y-coordinate of this view's top border.
 
double bottom () const
 Get y-coordinate of this view's bottom border.
 
double left () const
 Get x-coordinate of this view's left border.
 
double right () const
 Get x-coordinate of this view's right border.
 
Point topLeft () const
 Get this view's top-left corner.
 
Point topCenter () const
 Get this view's top-center point.
 
Point topRight () const
 Get this view's top-right corner.
 
Point bottomLeft () const
 Get this view's bottom-left corner.
 
Point bottomCenter () const
 Get this view's bottom-center point.
 
Point bottomRight () const
 Get this view's bottom-right corner.
 
Point centerLeft () const
 Get this view's center-left point.
 
Point centerRight () const
 Get this view's center-right point.
 
auto topLeft (this auto &&self, Point newValue) -> decltype(auto)
 Make this view's top-left match newValue.
 
auto topCenter (this auto &&self, Point newValue) -> decltype(auto)
 Make this view's top-center match newValue.
 
auto topRight (this auto &&self, Point newValue) -> decltype(auto)
 Make this view's top-right match newValue.
 
auto bottomLeft (this auto &&self, Point newValue) -> decltype(auto)
 Make this view's bottom-left match newValue.
 
auto bottomCenter (this auto &&self, Point newValue) -> decltype(auto)
 Make this view's bottom-center match newValue.
 
auto bottomRight (this auto &&self, Point newValue) -> decltype(auto)
 Make this view's bottom-right match newValue.
 
auto centerLeft (this auto &&self, Point newValue) -> decltype(auto)
 Make this view's center-left match newValue.
 
auto centerRight (this auto &&self, Point newValue) -> decltype(auto)
 Make this view's center-right match newValue.
 
auto center (this auto &&self, Point newValue) -> decltype(auto)
 Make this view's center match newValue.
 
auto topLeft (this auto &&self, Definition< Point > &&a) -> decltype(auto)
 Anchor the top-left corner to a
 
auto topCenter (this auto &&self, Definition< Point > &&a) -> decltype(auto)
 Anchor the top-center corner to a
 
auto topRight (this auto &&self, Definition< Point > &&a) -> decltype(auto)
 Anchor the top-right corner to a
 
auto bottomLeft (this auto &&self, Definition< Point > &&a) -> decltype(auto)
 Anchor the bottom-left corner to a
 
auto bottomCenter (this auto &&self, Definition< Point > &&a) -> decltype(auto)
 Anchor the bottom-center corner to a
 
auto bottomRight (this auto &&self, Definition< Point > &&a) -> decltype(auto)
 Anchor the bottom-right corner to a
 
auto centerLeft (this auto &&self, Definition< Point > &&a) -> decltype(auto)
 Anchor the center-left to a
 
auto centerRight (this auto &&self, Definition< Point > &&a) -> decltype(auto)
 Anchor the center-right to a
 
auto center (this auto &&self, Definition< Point > &&a) -> decltype(auto)
 Anchor the center to a
 
auto centerInParent (this auto &&self) -> decltype(auto)
 Anchor this view's center to its parent's center.
 

Triggers and Events

auto onWindowEntered (this auto &&self, Function< void()> &&f) -> decltype(auto)
 Handle window enter event
 
auto onWindowLeft (this auto &&self, Function< void()> &&f) -> decltype(auto)
 Handle window leave event
 
auto onPointerPressed (this auto &&self, Filter< PointerEvent > &&f) -> decltype(auto)
 Handle pointer pressed event
 
auto onPointerReleased (this auto &&self, Filter< PointerEvent > &&f) -> decltype(auto)
 Handle pointer release event
 
auto onPointerMoved (this auto &&self, Filter< PointerEvent > &&f) -> decltype(auto)
 Handle pointer moved event
 
auto onMousePressed (this auto &&self, Filter< MouseEvent > &&f) -> decltype(auto)
 Handle mouse pressed event
 
auto onMouseReleased (this auto &&self, Filter< MouseEvent > &&f) -> decltype(auto)
 Handle mouse release event
 
auto onMouseMoved (this auto &&self, Filter< MouseEvent > &&f) -> decltype(auto)
 Handle mouse moved event
 
auto onFingerPressed (this auto &&self, Filter< FingerEvent > &&f) -> decltype(auto)
 Handle finger pressed event
 
auto onFingerReleased (this auto &&self, Filter< FingerEvent > &&f) -> decltype(auto)
 Handle finger released event
 
auto onFingerMoved (this auto &&self, Filter< FingerEvent > &&f) -> decltype(auto)
 Handle finger moved event
 
auto onPenMoved (this auto &&self, Filter< PenEvent > &&f) -> decltype(auto)
 Handle pen touched/moved event
 
auto onPenHovered (this auto &&self, Filter< PenEvent > &&f) -> decltype(auto)
 Handle pen hovered event
 
auto onPenPressed (this auto &&self, Filter< PenEvent > &&f) -> decltype(auto)
 Handle pen button pressed event
 
auto onPenReleased (this auto &&self, Filter< PenEvent > &&f) -> decltype(auto)
 Handle pen button released event
 
auto onWheelMoved (this auto &&self, Filter< WheelEvent > &&f) -> decltype(auto)
 Handle mouse wheel moved event
 
auto onKeyPressed (this auto &&self, Filter< KeyEvent > &&f) -> decltype(auto)
 Handle key pressed event
 
auto onKeyReleased (this auto &&self, Filter< KeyEvent > &&f) -> decltype(auto)
 Handle key released event
 
auto onEndOfLife (this auto &&self, Function< void()> &&f) -> decltype(auto)
 Get notified when the View's lifetime ends.
 
auto attach (this auto &&self, const Object &other) -> decltype(auto)
 Attach a non-visual object (e.g.
 
auto attach (this auto &&self, Function< void()> &&f) -> decltype(auto)
 Convenience method for attaching a monitor.
 

Additional Inherited Members

- Public Member Functions inherited from Surface
 Surface ()=default
 Create a null surface.
 
void nextPage (bool clear=true)
 Open next page.
 
cairo_surface_t * cairoSurface ()
 Get a pointer to the underlying Cairo surface.
 
void polish ()
 Prepare surface before start painting.
 
- Public Member Functions inherited from Object
 Object ()=default
 Create a null object.
 
 operator bool () const
 Check if this is a non-null object.
 
bool isNull () const
 Check if this is a null object.
 
int useCount () const
 Reference count.
 
template<class T >
bool is () const
 Check if this object is of type T.
 
template<class T >
as () const
 Cast this object to type T.
 
bool isWeak () const
 Check if the underlying object reference is weak.
 
bool operator== (const Object &other) const
 Equality operator.
 
std::strong_ordering operator<=> (const Object &other) const
 Ordering operator.
 
- Protected Attributes inherited from Object
Handle< Stateme
 Internal object state
 

Detailed Description

User interface building block

Member Typedef Documentation

◆ Id

using Id = double

View identifier

Constructor & Destructor Documentation

◆ View() [1/7]

View ( )
default

Create a primordial view.

◆ View() [2/7]

View ( Out< View self)
explicit

Create a view.

◆ View() [3/7]

View ( const Size size,
Out< View self = None{} 
)
explicit

Create a view of initial size.

◆ View() [4/7]

View ( double  width,
double  height,
Out< View self = None{} 
)

Create a view of initial size (width, height)

◆ View() [5/7]

View ( const Layout layout,
Out< View self = None{} 
)
explicit

Create a view organizing its children with layout.

◆ View() [6/7]

View ( State newState)
explicitprotected

Initialize view.

◆ View() [7/7]

View ( CreateState  onDemand)
explicitprotected

Initialize view.

Member Function Documentation

◆ associate() [1/2]

View & associate ( Out< View self)

Get a weak reference in self.

Todo:
Remove overloads in specialized classes and make this method protected.

◆ populate()

View & populate ( const Function< void(View)> &&  f)

Invoke custom initialization function f.

◆ touch()

void touch ( )

Materialize if this view is still primordial.

◆ show()

void show ( )

Convenience method to show this view.

◆ run()

int run ( )

Convenience method to show this view and run the application loop.

◆ paper() [1/3]

Color paper ( ) const

Get/bind value of # paper

◆ paper() [2/3]

auto paper ( this auto &&  self,
Color  newValue 
) -> decltype(auto)

Set value of # paper

◆ paper() [3/3]

auto paper ( this auto &&  self,
Definition< Color > &&  f 
) -> decltype(auto)

Define value of # paper

◆ visible() [1/3]

bool visible ( ) const

Get/bind value of # visible

◆ visible() [2/3]

auto visible ( this auto &&  self,
bool  newValue 
) -> decltype(auto)

Set value of # visible

◆ visible() [3/3]

auto visible ( this auto &&  self,
Definition< bool > &&  f 
) -> decltype(auto)

Define value of # visible

◆ opacity() [1/3]

double opacity ( ) const

Get/bind value of # opacity

◆ opacity() [2/3]

auto opacity ( this auto &&  self,
double  newValue 
) -> decltype(auto)

Set value of # opacity

◆ opacity() [3/3]

auto opacity ( this auto &&  self,
Definition< double > &&  f 
) -> decltype(auto)

Define value of # opacity

◆ opacityEasing()

auto opacityEasing ( this auto &&  self,
const EasingCurve &  curve,
double  duration,
Function< bool()> &&  direct = nullptr 
) -> decltype(auto)

Set the easing curve and duration of # opacity

◆ clip() [1/3]

bool clip ( ) const

Get/bind value of # clip

◆ clip() [2/3]

auto clip ( this auto &&  self,
bool  newValue 
) -> decltype(auto)

Set value of # clip

◆ clip() [3/3]

auto clip ( this auto &&  self,
Definition< bool > &&  f 
) -> decltype(auto)

Define value of # clip

◆ moving() [1/3]

bool moving ( ) const

Get/bind value of # moving

◆ moving() [2/3]

auto moving ( this auto &&  self,
bool  newValue 
) -> decltype(auto)

Set value of # moving

◆ moving() [3/3]

auto moving ( this auto &&  self,
Definition< bool > &&  f 
) -> decltype(auto)

Define value of # moving

◆ pos() [1/3]

Point pos ( ) const

Get/bind value of # pos

◆ pos() [2/3]

auto pos ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Set value of # pos

◆ pos() [3/3]

auto pos ( this auto &&  self,
Definition< Point > &&  f 
) -> decltype(auto)

Define value of # pos

◆ posEasing()

auto posEasing ( this auto &&  self,
const EasingCurve &  curve,
double  duration,
Function< bool()> &&  direct = nullptr 
) -> decltype(auto)

Set the easing curve and duration of # pos

◆ size() [1/3]

Size size ( ) const

Get/bind value of # size

◆ size() [2/3]

auto size ( this auto &&  self,
Size  newValue 
) -> decltype(auto)

Set value of # size

◆ size() [3/3]

auto size ( this auto &&  self,
Definition< Size > &&  f 
) -> decltype(auto)

Define value of # size

◆ sizeEasing()

auto sizeEasing ( this auto &&  self,
const EasingCurve &  curve,
double  duration,
Function< bool()> &&  direct = nullptr 
) -> decltype(auto)

Set the easing curve and duration of # size

◆ padding() [1/3]

Padding padding ( ) const

Get/bind value of # padding

◆ padding() [2/3]

auto padding ( this auto &&  self,
Padding  newValue 
) -> decltype(auto)

Set value of # padding

◆ padding() [3/3]

auto padding ( this auto &&  self,
Definition< Padding > &&  f 
) -> decltype(auto)

Define value of # padding

◆ pivot() [1/3]

Point pivot ( ) const

Get/bind value of # pivot

◆ pivot() [2/3]

auto pivot ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Set value of # pivot

◆ pivot() [3/3]

auto pivot ( this auto &&  self,
Definition< Point > &&  f 
) -> decltype(auto)

Define value of # pivot

◆ pivotEasing()

auto pivotEasing ( this auto &&  self,
const EasingCurve &  curve,
double  duration,
Function< bool()> &&  direct = nullptr 
) -> decltype(auto)

Set the easing curve and duration of # pivot

◆ angle() [1/3]

double angle ( ) const

Get/bind value of # angle

◆ angle() [2/3]

auto angle ( this auto &&  self,
double  newValue 
) -> decltype(auto)

Set value of # angle

◆ angle() [3/3]

auto angle ( this auto &&  self,
Definition< double > &&  f 
) -> decltype(auto)

Define value of # angle

◆ angleEasing()

auto angleEasing ( this auto &&  self,
const EasingCurve &  curve,
double  duration,
Function< bool()> &&  direct = nullptr 
) -> decltype(auto)

Set the easing curve and duration of # angle

◆ scale() [1/3]

double scale ( ) const

Get/bind value of # scale

◆ scale() [2/3]

auto scale ( this auto &&  self,
double  newValue 
) -> decltype(auto)

Set value of # scale

◆ scale() [3/3]

auto scale ( this auto &&  self,
Definition< double > &&  f 
) -> decltype(auto)

Define value of # scale

◆ scaleEasing()

auto scaleEasing ( this auto &&  self,
const EasingCurve &  curve,
double  duration,
Function< bool()> &&  direct = nullptr 
) -> decltype(auto)

Set the easing curve and duration of # scale

◆ decoration() [1/3]

View decoration ( ) const

Get/bind value of # decoration

◆ decoration() [2/3]

auto decoration ( this auto &&  self,
View  newValue 
) -> decltype(auto)

Set value of # decoration

◆ decoration() [3/3]

auto decoration ( this auto &&  self,
Definition< View > &&  f 
) -> decltype(auto)

Define value of # decoration

◆ paint()

View & paint ( Definition< void > &&  f)

Define the foreground.

◆ x()

double x ( ) const

Get pos()[0].

◆ y()

double y ( ) const

Get pos()[1].

◆ width()

double width ( ) const

Get size()[0].

◆ height()

double height ( ) const

Get size()[1].

◆ innerWidth()

double innerWidth ( ) const

Get inner width.

◆ innerHeight()

double innerHeight ( ) const

Get inner height.

◆ preferredSize()

Size preferredSize ( ) const

Get preferred size.

◆ minSize()

Size minSize ( ) const

Get minimal size.

◆ maxSize()

Size maxSize ( ) const

Get maximal size.

◆ basePaper()

Color basePaper ( ) const

Get the background paper.

◆ objectName() [1/2]

const char * objectName ( ) const

Get the object name (for debugging)

◆ objectName() [2/2]

View & objectName ( const char *  name)

Set the object name

◆ hasWindow()

bool hasWindow ( ) const

Check if this view is already shown in a window.

◆ window()

Window window ( ) const

Get the window this view is shown in.

◆ isHandheld()

bool isHandheld ( ) const

Get window().display().isHandheld()

◆ id()

Id id ( ) const

Get view identifier.

◆ fullId()

List< Id > fullId ( ) const

Get view identifier heritage list.

◆ operator==()

bool operator== ( const View other) const

Equality operator.

◆ operator<=>()

std::strong_ordering operator<=> ( const View other) const

Ordering operator.

◆ hasParent()

bool hasParent ( ) const

Check if this is a child view.

◆ parent()

View parent ( ) const

Get parent view.

◆ root()

View root ( ) const

Get the root view of this window.

◆ childrenCount()

long childrenCount ( ) const

Number of children.

◆ count()

long count ( ) const

Number of children.

◆ hasChildren()

bool hasChildren ( ) const

Check if there are any children.

◆ add()

auto add ( this auto &&  self,
const View child 
) -> decltype(auto)

Add new child placed visually above all existing children.

◆ addAbove()

auto addAbove ( this auto &&  self,
const View child 
) -> decltype(auto)

Add new child placed visually above all existing children.

◆ addBelow()

auto addBelow ( this auto &&  self,
const View child 
) -> decltype(auto)

Add child place visually below all existing children.

◆ insertAt() [1/2]

auto insertAt ( this auto &&  self,
Locator  target,
const View child 
) -> decltype(auto)

Insert new child at target.

◆ insertAt() [2/2]

auto insertAt ( this auto &&  self,
long  index,
const View child 
) -> decltype(auto)

Insert new child at index.

◆ remove()

void remove ( const View child)

Remove a child.

◆ operator()()

auto operator() ( this auto &&  self,
const View child 
) -> decltype(auto)

Syntax sugar for adding a child.

◆ push()

auto push ( this auto &&  self,
const View child 
) -> decltype(auto)

Add new child placed visually above all existing children.

◆ pop()

void pop ( )

Remove the top-most visible child.

◆ deplete()

void deplete ( )

Remove all children.

◆ moveToTop()

void moveToTop ( )

Make this view be visible above any other visible sibling.

◆ moveToBottom()

void moveToBottom ( )

Make this view be visible beneath any other visible sibling.

◆ children()

const Set< View > & children ( ) const

Get all child views.

◆ visibleChildren()

const Set< View > & visibleChildren ( ) const

Get visible child views.

◆ childrenRect()

Rect childrenRect ( ) const

Get bounding box containing all visible child views including their paddings.

◆ mapToGlobal()

Point mapToGlobal ( Point  l) const

Map view coordinates l to window coordinates

◆ mapToLocal()

Point mapToLocal ( Point  g) const

Map window coordinates g to view coordinates

◆ mapToChild()

Point mapToChild ( const View child,
Point  l 
) const

Map local coordinates l to child coordinates

◆ mapToParent()

Point mapToParent ( const View parent,
Point  l 
) const

Map local coordinates l to parent coordinates

◆ containsLocal()

bool containsLocal ( Point  l) const

Check if local point l lays inside this view.

◆ containsGlobal()

bool containsGlobal ( Point  g) const

Check if global point l lays inside this view.

◆ findChild()

View findChild ( Point  l) const

Find the first child which contains local point l.

◆ findControl()

Control findControl ( Point  l) const

Find the first control which contains local point l.

◆ isParentOf()

bool isParentOf ( const View other) const

Check if this view is parent of other.

◆ laysInsideOf()

bool laysInsideOf ( const View other,
double  margin 
) const

Check if this view is fully visible inside other with given surrounding margin.

◆ update()

void update ( )

Manually force repaint.

◆ collectVisible()

template<class T >
void collectVisible ( InOut< List< T > >  collection) const

Get a list of all visible children in this view tree which are of type T.

◆ layout() [1/2]

Layout layout ( ) const

Get layout.

◆ layout() [2/2]

auto layout ( this auto &&  self,
const Layout newValue 
) -> decltype(auto)

Set layout

◆ renderTo()

void renderTo ( Image image) const

Capture a rendered image of this view (including its children) as rendered on the screen.

Parameters
imageOutput image (needs to be allocated by the caller)

◆ top()

double top ( ) const

Get y-coordinate of this view's top border.

◆ bottom()

double bottom ( ) const

Get y-coordinate of this view's bottom border.

◆ left()

double left ( ) const

Get x-coordinate of this view's left border.

◆ right()

double right ( ) const

Get x-coordinate of this view's right border.

◆ topLeft() [1/3]

Point topLeft ( ) const

Get this view's top-left corner.

◆ topCenter() [1/3]

Point topCenter ( ) const

Get this view's top-center point.

◆ topRight() [1/3]

Point topRight ( ) const

Get this view's top-right corner.

◆ bottomLeft() [1/3]

Point bottomLeft ( ) const

Get this view's bottom-left corner.

◆ bottomCenter() [1/3]

Point bottomCenter ( ) const

Get this view's bottom-center point.

◆ bottomRight() [1/3]

Point bottomRight ( ) const

Get this view's bottom-right corner.

◆ centerLeft() [1/3]

Point centerLeft ( ) const

Get this view's center-left point.

◆ centerRight() [1/3]

Point centerRight ( ) const

Get this view's center-right point.

◆ topLeft() [2/3]

auto topLeft ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Make this view's top-left match newValue.

◆ topCenter() [2/3]

auto topCenter ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Make this view's top-center match newValue.

◆ topRight() [2/3]

auto topRight ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Make this view's top-right match newValue.

◆ bottomLeft() [2/3]

auto bottomLeft ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Make this view's bottom-left match newValue.

◆ bottomCenter() [2/3]

auto bottomCenter ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Make this view's bottom-center match newValue.

◆ bottomRight() [2/3]

auto bottomRight ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Make this view's bottom-right match newValue.

◆ centerLeft() [2/3]

auto centerLeft ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Make this view's center-left match newValue.

◆ centerRight() [2/3]

auto centerRight ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Make this view's center-right match newValue.

◆ center() [1/2]

auto center ( this auto &&  self,
Point  newValue 
) -> decltype(auto)

Make this view's center match newValue.

◆ topLeft() [3/3]

auto topLeft ( this auto &&  self,
Definition< Point > &&  a 
) -> decltype(auto)

Anchor the top-left corner to a

◆ topCenter() [3/3]

auto topCenter ( this auto &&  self,
Definition< Point > &&  a 
) -> decltype(auto)

Anchor the top-center corner to a

◆ topRight() [3/3]

auto topRight ( this auto &&  self,
Definition< Point > &&  a 
) -> decltype(auto)

Anchor the top-right corner to a

◆ bottomLeft() [3/3]

auto bottomLeft ( this auto &&  self,
Definition< Point > &&  a 
) -> decltype(auto)

Anchor the bottom-left corner to a

◆ bottomCenter() [3/3]

auto bottomCenter ( this auto &&  self,
Definition< Point > &&  a 
) -> decltype(auto)

Anchor the bottom-center corner to a

◆ bottomRight() [3/3]

auto bottomRight ( this auto &&  self,
Definition< Point > &&  a 
) -> decltype(auto)

Anchor the bottom-right corner to a

◆ centerLeft() [3/3]

auto centerLeft ( this auto &&  self,
Definition< Point > &&  a 
) -> decltype(auto)

Anchor the center-left to a

◆ centerRight() [3/3]

auto centerRight ( this auto &&  self,
Definition< Point > &&  a 
) -> decltype(auto)

Anchor the center-right to a

◆ center() [2/2]

auto center ( this auto &&  self,
Definition< Point > &&  a 
) -> decltype(auto)

Anchor the center to a

◆ centerInParent()

auto centerInParent ( this auto &&  self) -> decltype(auto)

Anchor this view's center to its parent's center.

◆ onWindowEntered()

auto onWindowEntered ( this auto &&  self,
Function< void()> &&  f 
) -> decltype(auto)

Handle window enter event

◆ onWindowLeft()

auto onWindowLeft ( this auto &&  self,
Function< void()> &&  f 
) -> decltype(auto)

Handle window leave event

◆ onPointerPressed()

auto onPointerPressed ( this auto &&  self,
Filter< PointerEvent > &&  f 
) -> decltype(auto)

Handle pointer pressed event

◆ onPointerReleased()

auto onPointerReleased ( this auto &&  self,
Filter< PointerEvent > &&  f 
) -> decltype(auto)

Handle pointer release event

◆ onPointerMoved()

auto onPointerMoved ( this auto &&  self,
Filter< PointerEvent > &&  f 
) -> decltype(auto)

Handle pointer moved event

◆ onMousePressed()

auto onMousePressed ( this auto &&  self,
Filter< MouseEvent > &&  f 
) -> decltype(auto)

Handle mouse pressed event

◆ onMouseReleased()

auto onMouseReleased ( this auto &&  self,
Filter< MouseEvent > &&  f 
) -> decltype(auto)

Handle mouse release event

◆ onMouseMoved()

auto onMouseMoved ( this auto &&  self,
Filter< MouseEvent > &&  f 
) -> decltype(auto)

Handle mouse moved event

◆ onFingerPressed()

auto onFingerPressed ( this auto &&  self,
Filter< FingerEvent > &&  f 
) -> decltype(auto)

Handle finger pressed event

◆ onFingerReleased()

auto onFingerReleased ( this auto &&  self,
Filter< FingerEvent > &&  f 
) -> decltype(auto)

Handle finger released event

◆ onFingerMoved()

auto onFingerMoved ( this auto &&  self,
Filter< FingerEvent > &&  f 
) -> decltype(auto)

Handle finger moved event

◆ onPenMoved()

auto onPenMoved ( this auto &&  self,
Filter< PenEvent > &&  f 
) -> decltype(auto)

Handle pen touched/moved event

◆ onPenHovered()

auto onPenHovered ( this auto &&  self,
Filter< PenEvent > &&  f 
) -> decltype(auto)

Handle pen hovered event

◆ onPenPressed()

auto onPenPressed ( this auto &&  self,
Filter< PenEvent > &&  f 
) -> decltype(auto)

Handle pen button pressed event

◆ onPenReleased()

auto onPenReleased ( this auto &&  self,
Filter< PenEvent > &&  f 
) -> decltype(auto)

Handle pen button released event

◆ onWheelMoved()

auto onWheelMoved ( this auto &&  self,
Filter< WheelEvent > &&  f 
) -> decltype(auto)

Handle mouse wheel moved event

◆ onKeyPressed()

auto onKeyPressed ( this auto &&  self,
Filter< KeyEvent > &&  f 
) -> decltype(auto)

Handle key pressed event

◆ onKeyReleased()

auto onKeyReleased ( this auto &&  self,
Filter< KeyEvent > &&  f 
) -> decltype(auto)

Handle key released event

◆ onEndOfLife()

auto onEndOfLife ( this auto &&  self,
Function< void()> &&  f 
) -> decltype(auto)

Get notified when the View's lifetime ends.

◆ attach() [1/2]

auto attach ( this auto &&  self,
const Object other 
) -> decltype(auto)

Attach a non-visual object (e.g.

a Monitor)

◆ attach() [2/2]

auto attach ( this auto &&  self,
Function< void()> &&  f 
) -> decltype(auto)

Convenience method for attaching a monitor.

◆ grab()

template<class T >
T grab ( )
protected

Get a weak reference version of this object.

◆ associate() [2/2]

template<class T >
T & associate ( Out< T >  self)
protected

Convenience method to associate a weak reference to this objet.

◆ get() [1/2]

template<class T >
T & get ( )
protected

Get access to the object's state (create it if needed)

Template Parameters
TType of internal state

◆ get() [2/2]

template<class T >
const T & get ( ) const
protected

Get access to the object's state (create it if needed)

Template Parameters
TType of internal state