![]() |
Louvre
v2.9.0-1
C++ library for Wayland compositors
|
Touch point within a touch device. More...
Public Member Functions | |
Int32 | id () const noexcept |
Gets the unique identifier of the touch point. More... | |
bool | pressed () const noexcept |
Check if the touch point is currently being pressed. More... | |
LSurface * | surface () const noexcept |
Gets the surface currently being touched by this touch point. More... | |
const LTouchDownEvent & | lastDownEvent () const noexcept |
Gets the last touch-down event sent with sendDownEvent(). More... | |
const LTouchMoveEvent & | lastMoveEvent () const noexcept |
Gets the last touch move event sent with sendMoveEvent(). More... | |
const LTouchUpEvent & | lastUpEvent () const noexcept |
Gets the last touch-up event sent with sendUpEvent(). More... | |
const LPointF & | pos () const noexcept |
Gets the position of the touch point assigned by the last touch-down or move event. More... | |
bool | sendDownEvent (const LTouchDownEvent &event, LSurface *surface=nullptr) noexcept |
Mark the touch point as pressed. More... | |
bool | sendMoveEvent (const LTouchMoveEvent &event) noexcept |
Notify the client about the movement of the touch point (if there is a surface assigned). More... | |
bool | sendUpEvent (const LTouchUpEvent &event) noexcept |
Notify the client about the touch point being released (if there is a surface assigned). More... | |
![]() | |
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 | |
![]() | |
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... | |
Touch point within a touch device.
An instance of this class is created using LTouch::createOrGetTouchPoint() and is typically destroyed after calling LTouch::sendFrameEvent() when the touch point is no longer pressed, or when invoking LTouch::sendCancelEvent().
A touch point can be assigned to a single surface at a time or none at all. This assignment is performed using the sendDownEvent() method.
To gain a comprehensive understanding of touch events, please refer to the documentation of LTouch.
localPos
. Be sure to set its value properly to the local surface coordinate before dispatching these events.
|
inlinenoexcept |
Gets the unique identifier of the touch point.
Each touch point is assigned a unique identifier, ensuring that there are no two touch points with the same ID.
|
inlinenoexcept |
Check if the touch point is currently being pressed.
This method indicates whether the touch point is in a pressed state. Initially, all touch points are marked as pressed upon creation. The state can change if either the sendDownEvent() or sendUpEvent() methods are invoked.
If LTouch::sendFrameEvent() is called and the touch point is no longer pressed, it will be automatically destroyed.
true
if the touch point is currently pressed, false
otherwise.
|
inlinenoexcept |
Gets the surface currently being touched by this touch point.
The surface associated with this touch point is set using the sendDownEvent() method. If no surface is assigned to this touch point, this method returns nullptr
.
nullptr
if no surface is assigned.
|
inlinenoexcept |
Gets the last touch-down event sent with sendDownEvent().
|
inlinenoexcept |
Gets the last touch move event sent with sendMoveEvent().
|
inlinenoexcept |
Gets the last touch-up event sent with sendUpEvent().
|
inlinenoexcept |
Gets the position of the touch point assigned by the last touch-down or move event.
The position is represented in a coordinate space ranging from 0 to 1 for both the x and y axes.
|
noexcept |
Mark the touch point as pressed.
If a surface is specified, the event is sent to that surface. If the surface is different from the current surface, the previous surface receives a touch-up event and a frame event. If the surface parameter is nullptr
, it unsets the current surface. If the current assigned surface is destroyed, it is automatically unset.
event | The touch-down event with information about the touch point |
surface | The surface to which the event should be sent. If nullptr , unsets the surface. |
true
on success, false
if the IDs don't match.
|
noexcept |
Notify the client about the movement of the touch point (if there is a surface assigned).
event | The touch move event containing information about the touch point movement. |
true
on success, false
if the IDs don't match.
|
noexcept |
Notify the client about the touch point being released (if there is a surface assigned).
If LTouch::sendFrameEvent() is called and the touch point is no longer pressed, it is automatically destroyed.
event | The touch-up event containing information about the touch point release. |
true
on success, false
if the IDs don't match.