Louvre
v2.13.0-1
C++ library for Wayland compositors
|
Base class for LScene views. More...
Classes | |
struct | PaintEventParams |
Parameters used within a paintEvent(). More... | |
Public Types | |
enum | Type : UInt8 |
Types of views included with Louvre. More... | |
Public Member Functions | |
LView (UInt32 type, bool renderable, LView *parent) noexcept | |
Construct an LView object. More... | |
~LView () noexcept | |
Destructor for the LView class. More... | |
void | enablePointerEvents (bool enabled) noexcept |
Toggles pointer events. More... | |
bool | pointerEventsEnabled () const noexcept |
Checks if pointer events are enabled. More... | |
bool | pointerIsOver () const noexcept |
Checks if the view has pointer focus. More... | |
void | enableBlockPointer (bool enabled) noexcept |
Toggles blocking pointer events to views behind the view's input region. More... | |
bool | blockPointerEnabled () const noexcept |
Checks if blocking of pointer events is enabled. More... | |
void | enableKeyboardEvents (bool enabled) noexcept |
Toggles keyboard events. More... | |
bool | keyboardEventsEnabled () const noexcept |
Checks if keyboard events are enabled. More... | |
void | enableTouchEvents (bool enabled) noexcept |
Toggles touch events. More... | |
bool | touchEventsEnabled () const noexcept |
Checks if touch events are enabled. More... | |
void | enableBlockTouch (bool enabled) noexcept |
Toggles blocking touch events to views behind the view's input region. More... | |
bool | blockTouchEnabled () const noexcept |
Checks if blocking of touch events to views behind the view's input region is enabled. More... | |
void | damageAll () noexcept |
Forces a complete repaint of the view in the next rendering frame. More... | |
LScene * | scene () const noexcept |
Gets the scene in which this view is currently embedded. More... | |
bool | isLScene () const noexcept |
Checks if the view is an LScene::mainView(). More... | |
LSceneView * | parentSceneView () const noexcept |
Gets the closest parent LSceneView. More... | |
UInt32 | type () const noexcept |
Gets the identifier for the type of view. More... | |
bool | isRenderable () const noexcept |
Checks if the view is renderable. More... | |
void | repaint () const noexcept |
Schedules a repaint for all outputs where this view is currently visible. More... | |
LView * | parent () const noexcept |
Gets the parent of the view. More... | |
void | setParent (LView *view) noexcept |
Sets the new parent for the view and insert it at the end of its children list. More... | |
void | insertAfter (LView *prev) noexcept |
Inserts the view after the specified 'prev' view. More... | |
const std::list< LView * > & | children () const noexcept |
Children views. More... | |
void | enableParentOffset (bool enabled) noexcept |
Toggles the parent position offset. More... | |
bool | parentOffsetEnabled () const noexcept |
Checks if pos() includes the parent's position. More... | |
const LPoint & | pos () const noexcept |
Gets the current position of the view with applied transformations. More... | |
const LSize & | size () const noexcept |
Gets the current size of the view with applied transformations. More... | |
void | enableClipping (bool enabled) noexcept |
Toggles the use of the clippingRect() property. More... | |
bool | clippingEnabled () const noexcept |
Checks if the view is currently being clipped to the clippingRect() property. More... | |
void | setClippingRect (const LRect &rect) noexcept |
Sets a custom clipping rect. More... | |
const LRect & | clippingRect () const noexcept |
Gets the clipping rect set with setClippingRect(). More... | |
void | enableParentClipping (bool enabled) noexcept |
Toggles parent clipping. More... | |
bool | parentClippingEnabled () const noexcept |
Checks if the view is clipped to the parent view rect. More... | |
void | enableScaling (bool enabled) noexcept |
Toggles the use of the scalingVector(). More... | |
bool | scalingEnabled () const noexcept |
Checks if the scalingVector() is enabled. More... | |
void | setScalingVector (const LSizeF &scalingVector) noexcept |
Sets the scalingVector() property. More... | |
const LSizeF & | scalingVector (bool forceIgnoreParent=false) const noexcept |
Gets the scaling vector. More... | |
void | enableParentScaling (bool enabled) noexcept |
Toggles the scaling of size and position by the parent's scaling vector. More... | |
bool | parentScalingEnabled () const noexcept |
Checks if the size and position are scaled by the parent's scalingVector(). More... | |
void | setVisible (bool visible) noexcept |
Toggles the view visibility. More... | |
bool | visible () const noexcept |
Checks if the view is marked as visible. More... | |
bool | mapped () const noexcept |
Checks if the view should be rendered, taking into consideration several conditions. More... | |
void | setOpacity (Float32 opacity) noexcept |
Set the view opacity. More... | |
Float32 | opacity (bool forceIgnoreParent=false) const noexcept |
Gets the view opacity. More... | |
void | enableParentOpacity (bool enabled) noexcept |
Toggles the use of the parent's opacity. More... | |
bool | parentOpacityEnabled () const noexcept |
Checks if the view's opacity is multiplied by its parent's opacity. More... | |
void | enableForceRequestNextFrame (bool enabled) noexcept |
Toggles forcing triggering the requestNextFrame() event. More... | |
bool | forceRequestNextFrameEnabled () const noexcept |
Checks if forcing requestNextFrame() is enabled. More... | |
void | setBlendFunc (const LBlendFunc &blendFunc) noexcept |
Sets a custom alpha/color blending function for the view. More... | |
const LBlendFunc & | blendFunc () const noexcept |
Gets the blending function set with setBlendFunc(). More... | |
void | enableAutoBlendFunc (bool enabled) noexcept |
Toggles the automatic blend function adjustment. More... | |
bool | autoBlendFuncEnabled () const noexcept |
Checks whether the automatic blend function adjustment is enabled. More... | |
void | setColorFactor (const LRGBAF &colorFactor) noexcept |
Set the color factor. More... | |
const LRGBAF & | colorFactor () const noexcept |
Gets the color factor. More... | |
LBox | boundingBox () const noexcept |
Gets the bounding box of the view and all its mapped children. More... | |
virtual bool | nativeMapped () const noexcept=0 |
Tells whether the view should be rendered. More... | |
virtual const LPoint & | nativePos () const noexcept=0 |
Gets the position of the view without any transformations applied. More... | |
virtual const LSize & | nativeSize () const noexcept=0 |
Gets the size of the view without any transformations applied. More... | |
virtual Float32 | bufferScale () const noexcept=0 |
Gets the scale of the view buffer content. More... | |
virtual void | enteredOutput (LOutput *output) noexcept=0 |
Notifies that portion of the view is visible on the given output. More... | |
virtual void | leftOutput (LOutput *output) noexcept=0 |
Notifies that the view is no longer visible on the given output. More... | |
virtual const std::vector< LOutput * > & | outputs () const noexcept=0 |
Gets a vector of output pointers on which the view is currently visible. More... | |
virtual void | requestNextFrame (LOutput *output) noexcept=0 |
Notifies that the view has been rendered on the given output. More... | |
virtual const LRegion * | damage () const noexcept=0 |
Gets the region within the view rect that needs to be repainted. More... | |
virtual const LRegion * | translucentRegion () const noexcept=0 |
Gets the current translucent region. More... | |
virtual const LRegion * | opaqueRegion () const noexcept=0 |
Gets the current opaque region. More... | |
virtual const LRegion * | inputRegion () const noexcept=0 |
Gets the current input region. More... | |
virtual void | paintEvent (const PaintEventParams ¶ms) noexcept=0 |
Requests to paint a region of the view to the current framebuffer. More... | |
virtual void | pointerEnterEvent (const LPointerEnterEvent &event) |
Handles a pointer enter event within the view. More... | |
virtual void | pointerMoveEvent (const LPointerMoveEvent &event) |
Handle a pointer move event within the view. More... | |
virtual void | pointerLeaveEvent (const LPointerLeaveEvent &event) |
Handle a pointer leave event within the view. More... | |
virtual void | pointerButtonEvent (const LPointerButtonEvent &event) |
Handle a pointer button event within the view. More... | |
virtual void | pointerScrollEvent (const LPointerScrollEvent &event) |
Handle a pointer scroll event within the view. More... | |
virtual void | pointerSwipeBeginEvent (const LPointerSwipeBeginEvent &event) |
Handle a pointer swipe begin event within the view. More... | |
virtual void | pointerSwipeUpdateEvent (const LPointerSwipeUpdateEvent &event) |
Handle a pointer swipe update event within the view. More... | |
virtual void | pointerSwipeEndEvent (const LPointerSwipeEndEvent &event) |
Handle a pointer swipe end event within the view. More... | |
virtual void | pointerPinchBeginEvent (const LPointerPinchBeginEvent &event) |
Handle a pointer pinch begin event within the view. More... | |
virtual void | pointerPinchUpdateEvent (const LPointerPinchUpdateEvent &event) |
Handle a pointer pinch update event within the view. More... | |
virtual void | pointerPinchEndEvent (const LPointerPinchEndEvent &event) |
Handle a pointer pinch end event within the view. More... | |
virtual void | pointerHoldBeginEvent (const LPointerHoldBeginEvent &event) |
Handle a pointer hold begin event within the view. More... | |
virtual void | pointerHoldEndEvent (const LPointerHoldEndEvent &event) |
Handle a pointer hold end event within the view. More... | |
virtual void | keyEvent (const LKeyboardKeyEvent &event) |
Handle the key event within the view. More... | |
virtual void | touchDownEvent (const LTouchDownEvent &event) |
Handle a touch down event within the view. More... | |
virtual void | touchMoveEvent (const LTouchMoveEvent &event) |
Handle a touch move event within the view. More... | |
virtual void | touchUpEvent (const LTouchUpEvent &event) |
Handle a touch up event within the view. More... | |
virtual void | touchFrameEvent (const LTouchFrameEvent &event) |
Handle a touch frame event within the view. More... | |
virtual void | touchCancelEvent (const LTouchCancelEvent &event) |
Handle a touch cancel event within the view. More... | |
Public Member Functions inherited from LObject | |
LObject (const LObject &) noexcept | |
Copy constructor. More... | |
LObject & | operator= (const LObject &) noexcept |
Assignment operator (each object has its own individual LWeak reference count). More... | |
void | setUserData (UIntPtr data) const noexcept |
Store an unsigned integer value/pointer. More... | |
UIntPtr | userData () const noexcept |
Retrieves the stored unsigned integer value/pointer. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from LObject | |
LObject () noexcept=default | |
Constructor of the LObject class. More... | |
virtual | ~LObject () noexcept |
Destructor of the LObject class. More... | |
void | notifyDestruction () noexcept |
Notifies the object destruction. More... | |
Base class for LScene views.
The LView class provides a base interface for creating views that can be shown in an LScene.
This class should be used for creating custom views that are different from those shipped with Louvre.
Louvre provides a pre-made set of views for most common purposes:
Each view can have a parent and multiple children. This hierarchy and the order given by their children views list determine the stacking order in which they are rendered.
Children views are always stacked on top of its parent, and the last view in a children list is the one stacked on top the rest.
To create a custom view, you must implement several virtual methods. In summary, for an LScene or LSceneView to be able to render an LView, it must provide the following information:
The position of the view in surface coordinates must be returned by the nativePos() virtual method.
This method is used by the pos() method, which returns the position equal to nativePos(), or transformed if parent offset or parent scaling is enabled.
The size of the view in surface coordinates should be implemented in the nativeSize() virtual method. This size is then returned by the size() method if no transformation is applied, or may differ if scaling or parent scaling is enabled.
To tell a scene if the view is visible, the nativeMapped() bool method must be implemented. This is then returned by the mapped() method, which may differ from nativeMapped() if the visible() property is different, or if the view has no parent, or if its parent is mapped. In summary, a view can only be mapped if nativeMapped() is true
, the visible() property is true
, it has a parent, and the parent is also mapped.
If the view has content that can be rendered, for example, a texture, then the isRenderable() method must return true
. On the other hand, if the view is simply a container for other views and is not renderable on its own, then it should return false
.
The outputs() virtual method must return a vector with the outputs where the view is currently visible. When the view changes, repaint() is called, and all those intersected outputs are scheduled for repainting. The scene informs which outputs a view is currently on based on its rect through the enteredOutput() and leftOutput() virtual methods. So, those methods must be used to update the intersected outputs vector.
If the view is renderable, the paintEvent() method must be implemented. This method is called by the scene to request the view to render itself into the current framebuffer. It provides an LPainter, the region of the view to be rendered in global compositor coordinates, and a boolean variable indicating whether blending is enabled. The paintEvent() method is called twice per frame: once for drawing only the opaque regions of the view (blending disabled), and a second pass for the translucent regions (blending enabled).
nullptr
(see the "Opaque and Translucent Regions" section). This way, only a single paintEvent() with blending enabled will be triggered.To inform the scene about which rects within the view must be re-rendered (due to changes), the damage() virtual method must return an LRegion containing the damaged rects. If nullptr
is returned, the entire view is considered damaged.
The scene automatically damages the entire view if its position, size, or stacking order changes from one frame to another, so it's not necessary to add damage in those cases. Usually, the damage should be cleared once the view has been rendered. To determine if a view was rendered on a specific output, the requestNextFrame() method is invoked by the scene. So within that method, the damage should be cleared.
To prevent the scene view from rendering views occluded by opaque regions, the translucentRegion() and opaqueRegion() must be implemented. They must return an LRegion with the translucent and opaque regions, respectively, in surface coordinates.
If translucentRegion() returns nullptr
, the entire view is considered translucent. On the other hand, if opaqueRegion is nullptr
, the opaque region is considered the inverse of the translucentRegion(). So normally, it's only needed to specify the translucent region. The opaque region must be specified if it has been calculated before so that the scene can use that information and prevent re-calculating the inverse translucent region.
To define which parts of the view can receive pointer or touch events, the inputRegion() must be implemented.
If nullptr
is returned, the entire view is considered capable of receiving events.
Scenes can trigger specific input events on views through the pointerEnterEvent(), pointerMoveEvent(), keyEvent(), and other related methods.
Implement these virtual methods to listen and respond to those events if needed.
struct Louvre::LView::PaintEventParams |
Parameters used within a paintEvent().
Class Members | ||
---|---|---|
LPainter * | painter | LPainter object to perform the painting. |
LRegion * | region | Region to draw in global compositor coordinates. |
bool | blending | Indicates if the region to render is opaque (false) or translucent (true) |
Types of views included with Louvre.
Enumerator | |
---|---|
UndefinedType | Undefined type. |
LayerType | |
SurfaceType | |
TextureType | |
SolidColorType | |
SceneType |
Construct an LView object.
type | Type ID of the view, such as those listed in LView::Type. |
parent | Parent view. |
|
noexcept |
Toggles pointer events.
Only views with this property enabled can appear on the LScene::pointerFocus() list after an LScene::handlePointerMoveEvent().
Disabled by default in all view types except for LSurfaceView.
enabled | If true , the view will receive pointer events. |
|
inlinenoexcept |
Checks if pointer events are enabled.
true
if the view receives pointer and touch events, false
otherwise.
|
inlinenoexcept |
Checks if the view has pointer focus.
Even if the scene pointer is over the input region it may return false
if another view with block pointer enabled is in front.
true
.true
if the pointer/cursor is inside the input region; otherwise, false
.
|
inlinenoexcept |
Toggles blocking pointer events to views behind the view's input region.
true
.Enabled by default.
enabled | true to enable blocking; false to disable. |
|
inlinenoexcept |
Checks if blocking of pointer events is enabled.
true
if blocking is enabled; otherwise, false
.
|
noexcept |
Toggles keyboard events.
When enabled, the view will receive keyboard events and will be added to its parent LScene::keyboardFocus() vector.
Unlike pointer or touch events, keyboard events for views do not have focus semantics, this means that when enabled, the view will always receive all keyboard events emitted by its parent scene.
Disabled by default in all view types.
enabled | true to enable keyboard events, false to disable. |
|
inlinenoexcept |
Checks if keyboard events are enabled.
true
if keyboard events are enabled, false
otherwise. Keyboard events are disabled by default.
|
noexcept |
Toggles touch events.
A view can be touched by multiple touch points simultaneously, see LScene::touchPoints() and LSceneTouchPoint::views()
Disabled by default in all view types except for LSurfaceView.
enabled | Set to true to enable touch events, false to disable them. |
|
inlinenoexcept |
Checks if touch events are enabled.
true
if touch events are enabled, false
otherwise.
|
inlinenoexcept |
Toggles blocking touch events to views behind the view's input region.
true
.Enabled by default.
enabled | true to enable blocking; false to disable. |
|
inlinenoexcept |
Checks if blocking of touch events to views behind the view's input region is enabled.
true
if blocking is enabled; otherwise, false
.
|
inlinenoexcept |
Forces a complete repaint of the view in the next rendering frame.
|
inlinenoexcept |
Gets the scene in which this view is currently embedded.
nullptr
if the view is not part of any scene.
|
inlinenoexcept |
Checks if the view is an LScene::mainView().
|
inlinenoexcept |
Gets the closest parent LSceneView.
nullptr
if the view is not part of any LSceneView.
|
inlinenoexcept |
Gets the identifier for the type of view.
|
inlinenoexcept |
Checks if the view is renderable.
This property indicates whether the view is capable of rendering content (check paintEvent()).
For example, all view types included in Louvre are renderable, except for LLayerView, which serves as a container for other views but does not produce any output by itself.
true
if the view is renderable; otherwise, false
.
|
noexcept |
Schedules a repaint for all outputs where this view is currently visible.
This method triggers a repaint for all outputs where this view is currently visible.
Outputs are those returned by the LView::outputs() method.
|
inlinenoexcept |
Gets the parent of the view.
nullptr
if the view has no parent.
|
noexcept |
Sets the new parent for the view and insert it at the end of its children list.
This method sets the new parent for the view and inserts it at the end of its parent's children list. If 'view' is set to nullptr
, the parent is unset, and the view is unmapped.
view | The new parent view to be set. |
|
noexcept |
Inserts the view after the specified 'prev' view.
prev
has another parent view.prev | The view after which this view will be inserted. If set to nullptr , the view will be inserted at the beginning of its current parent's children list. |
|
inlinenoexcept |
Children views.
|
inlinenoexcept |
|
inlinenoexcept |
Checks if pos() includes the parent's position.
true
if the parent's offset is applied to the view position, false
otherwise.
|
inlinenoexcept |
Gets the current position of the view with applied transformations.
This method returns the current position of the view with any applied transformations.
|
inlinenoexcept |
Gets the current size of the view with applied transformations.
This method returns the current size of the view with any applied transformations.
|
inlinenoexcept |
Toggles the use of the clippingRect() property.
If enabled, the view will be clipped to the clippingRect() property.
Disabled by default.
|
inlinenoexcept |
Checks if the view is currently being clipped to the clippingRect() property.
This method returns true
if the view is currently being clipped to the clippingRect() property.
true
if the view is being clipped to clippingRect(), false
otherwise.
|
inlinenoexcept |
Sets a custom clipping rect.
true
.rect | The clipping rect in compositor-global coordinates. |
|
inlinenoexcept |
Gets the clipping rect set with setClippingRect().
|
inlinenoexcept |
Toggles parent clipping.
If enabled, the view will be clipped to the current parent view rect.
Disabled by default.
enabled | If true , the view will be clipped to the current parent view rect. |
|
inlinenoexcept |
Checks if the view is clipped to the parent view rect.
true
if the view is clipped to the current parent view rect, false
otherwise.
|
inlinenoexcept |
Toggles the use of the scalingVector().
If enabled, the view's size will be multiplied by the scalingVector().
Disabled by default.
enabled | If true , the view's size will be scaled. |
|
inlinenoexcept |
Checks if the scalingVector() is enabled.
|
inlinenoexcept |
Sets the scalingVector() property.
If scalingEnabled() is true
, the view's size will be scaled using the provided scaling vector (nativeSize() * scalingVector()).
The default value is (1.f, 1.f).
|
inlinenoexcept |
Gets the scaling vector.
forceIgnoreParent | If set to false , the vector is multiplied by the parent scaling vector. |
|
inlinenoexcept |
Toggles the scaling of size and position by the parent's scaling vector.
If enabled, the view's size and position will be scaled by the parent's scalingVector().
Disabled by default.
enabled | If true , the view's size and position will be scaled by the parent's scaling vector. |
|
inlinenoexcept |
Checks if the size and position are scaled by the parent's scalingVector().
Disabled by default.
|
inlinenoexcept |
Toggles the view visibility.
Enabled by default.
|
inlinenoexcept |
Checks if the view is marked as visible.
This method indicates whether the view is marked as visible. However, it does not directly indicate if the view will be rendered. To check if the view will be rendered, use the mapped() property instead.
true
if the view is marked as visible, false
otherwise.
|
inlinenoexcept |
Checks if the view should be rendered, taking into consideration several conditions.
This method indicates whether the view should be rendered, considering the nativeMapped() && visible() && parent() && parent()->mapped() condition.
true
if the view should be rendered, false
otherwise.
|
inlinenoexcept |
Set the view opacity.
This method sets the view's opacity.
The default value is 1.f.
opacity | The opacity value in the range [0.f, 1.f]. |
|
inlinenoexcept |
Gets the view opacity.
forceIgnoreParent | If set to false , the result is multiplied by the parent's opacity. |
|
inlinenoexcept |
Toggles the use of the parent's opacity.
If enabled, the view's opacity will be multiplied by its parent's opacity.
Enabled by default.
|
inlinenoexcept |
Checks if the view's opacity is multiplied by its parent's opacity.
|
inlinenoexcept |
Toggles forcing triggering the requestNextFrame() event.
When enabled, requestNextFrame() will be called even if the view is occluded or not mapped.
Disabled by default.
|
inlinenoexcept |
Checks if forcing requestNextFrame() is enabled.
|
inlinenoexcept |
Sets a custom alpha/color blending function for the view.
Sets the OpenGL blend function for the view. Refer to the documentation of glBlendFuncSeparate() for more information.
|
inlinenoexcept |
Gets the blending function set with setBlendFunc().
|
inlinenoexcept |
Toggles the automatic blend function adjustment.
When enabled, the blend function dynamically adjusts based on whether the rendered content is premultiplied alpha or not.
Enabled by default.
|
inlinenoexcept |
Checks whether the automatic blend function adjustment is enabled.
|
inlinenoexcept |
Set the color factor.
Multiplies the view's RGBA color components by the given values.
Set to (1.0, 1.0, 1.0, 1.0) by default, which has no effect on the colors.
|
inlinenoexcept |
Gets the color factor.
See setColorFactor().
|
inlinenoexcept |
Gets the bounding box of the view and all its mapped children.
This method returns a box containing the view and all its mapped children, even if the children are outside or clipped by the view's rect.
|
pure virtualnoexcept |
Tells whether the view should be rendered.
true
if the view should be rendered without considering visible(), otherwise false
. Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Gets the position of the view without any transformations applied.
Must return the position of the view in compositor-global coordinates.
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Gets the size of the view without any transformations applied.
Must return the size of the view in surface coordinates.
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Gets the scale of the view buffer content.
This property is primarily used by views that contain a buffer like for example the LSceneView, LSurfaceView and LTextureView types.
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Notifies that portion of the view is visible on the given output.
This method is invoked by a LScene when the view's rect intersects an output.
output | The LOutput where the view is visible. |
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Notifies that the view is no longer visible on the given output.
This method is invoked by a LScene when the view's rect no longer intersects an output.
output | The LOutput from which the view is no longer visible. |
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Gets a vector of output pointers on which the view is currently visible.
Must return a vector of output pointers where the view is currently visible.
Use the enteredOutput() and leftOutput() methods to update the vector.
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Notifies that the view has been rendered on the given output.
This method is called by the closest parent scene view and should be used to clear the previous view damage or update its content.
If forceRequestNextFrameEnabled() is true
, this method is always called.
output | The LOutput on which the view is rendered. |
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Gets the region within the view rect that needs to be repainted.
The region rects are specified in surface coordinates within the view, without any scaling, clipping, or offset transformations applied.
It should be cleared after requestNextFrame() is called.
If nullptr
is returned, the entire view rect will be considered damaged.
If the view has no damage, simply pass an empty LRegion (not nullptr
).
nullptr
if the entire view rect is damaged. Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Gets the current translucent region.
The region must be specified in surface-local coordinates, without any scaling, clipping, or offset transformations applied.
If nullptr
is returned, the entire view rect will be considered translucent.
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Gets the current opaque region.
The region must be specified in surface-local coordinates without any scaling, clipping, or offset transformations applied.
If nullptr
is returned, the inverse of the translucent region will be considered opaque.
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Gets the current input region.
Region within the view rect that can receive pointer and touch events.
The region must be specified in surface-local coordinates without any scaling, clipping, or offset transformations applied.
If nullptr
is returned, the entire view will receive input.
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
pure virtualnoexcept |
Requests to paint a region of the view to the current framebuffer.
This method is used by the closest parent LSceneView to request the view to paint a specified region on the current framebuffer. Painting can be performed using the provided LPainter object.
Implemented in LTextureView, LSurfaceView, LSolidColorView, LSceneView, and LLayerView.
|
inlinevirtual |
Handles a pointer enter event within the view.
This event is only triggered if pointerEventsEnabled() is set to true
.
|
inlinevirtual |
Handle a pointer move event within the view.
This event is only triggered if pointerEnterEvent() was called before, and therefore when hasPointerFocus() returns true
.
|
inlinevirtual |
Handle a pointer leave event within the view.
This event is only triggered if pointerEnterEvent() was called before, and therefore when hasPointerFocus() returns true
.
|
inlinevirtual |
Handle a pointer button event within the view.
This event is only triggered if pointerEnterEvent() was called before, and therefore when hasPointerFocus() returns true
.
|
inlinevirtual |
Handle a pointer scroll event within the view.
This event is only triggered if pointerEnterEvent() was called before, and therefore when hasPointerFocus() returns true
.
|
inlinevirtual |
Handle a pointer swipe begin event within the view.
This event is only triggered if pointerEnterEvent() was called before, and therefore when hasPointerFocus() returns true
.
|
inlinevirtual |
Handle a pointer swipe update event within the view.
This event is only triggered if pointerSwipeBeginEvent() was called before.
|
inlinevirtual |
Handle a pointer swipe end event within the view.
This event is only triggered if pointerSwipeBeginEvent() was called before.
|
inlinevirtual |
Handle a pointer pinch begin event within the view.
This event is only triggered if pointerEnterEvent() was called before, and therefore when hasPointerFocus() returns true
.
|
inlinevirtual |
Handle a pointer pinch update event within the view.
This event is only triggered if pointerPinchBeginEvent() was called before.
|
inlinevirtual |
Handle a pointer pinch end event within the view.
This event is only triggered if pointerPinchBeginEvent() was called before.
|
inlinevirtual |
Handle a pointer hold begin event within the view.
This event is only triggered if pointerEnterEvent() was called before, and therefore when hasPointerFocus() returns true
.
|
inlinevirtual |
Handle a pointer hold end event within the view.
This event is only triggered if pointerHoldBeginEvent() was called before.
|
inlinevirtual |
Handle the key event within the view.
Keyboard events are triggered only if keyboardEventsEnabled() is set to true
.
|
inlinevirtual |
Handle a touch down event within the view.
Touch events are triggered only if touchEventsEnabled() is set to true
.
|
inlinevirtual |
Handle a touch move event within the view.
This event is only triggered if a touchDownEvent() was emitted before.
|
inlinevirtual |
Handle a touch up event within the view.
This event is only triggered if a touchDownEvent() was emitted before.
|
inlinevirtual |
Handle a touch frame event within the view.
This event is only triggered if a touchDownEvent() was emitted before.
|
inlinevirtual |
Handle a touch cancel event within the view.
This event is only triggered if a touchDownEvent() was emitted before.