libvirtualhid 15
Cross-platform C++ library for virtual HID devices.
lvh::PenTablet Class Referencefinal

Virtual pen tablet device handle. More...

#include <src/include/libvirtualhid/runtime.hpp>

Inheritance diagram for lvh::PenTablet:
[legend]
Collaboration diagram for lvh::PenTablet:
[legend]

Public Member Functions

OperationStatus button (PenButton button, bool pressed)
 Submit a tablet button transition.
 
OperationStatus close () override
 Close the virtual device.
 
DeviceId device_id () const override
 Get the device identifier assigned by the runtime.
 
std::vector< DeviceNodedevice_nodes () const override
 Get platform-visible nodes associated with the device.
 
bool is_open () const override
 Check whether the device is open.
 
PenToolState last_submitted_tool () const
 Get the most recently submitted tool state.
 
PenTabletoperator= (const PenTablet &)=delete
 Copy assignment is disabled because the handle owns device lifetime.
 
PenTabletoperator= (PenTablet &&other) noexcept
 Move assign a pen tablet handle.
 
 PenTablet (const PenTablet &)=delete
 Copy construction is disabled because the handle owns device lifetime.
 
 PenTablet (detail::RuntimeConstructionToken token, std::shared_ptr< detail::PenTabletDevice > device)
 Construct a pen tablet handle for Runtime-owned state.
 
 PenTablet (PenTablet &&other) noexcept
 Move construct a pen tablet handle.
 
OperationStatus place_tool (const PenToolState &state)
 Place or move the active tablet tool.
 
const DeviceProfileprofile () const override
 Get the profile used to create this device.
 
std::size_t submit_count () const
 Get the number of successful submit operations.
 
 ~PenTablet () override
 Destroy the pen tablet handle.
 
- Public Member Functions inherited from lvh::VirtualDevice
virtual ~VirtualDevice ()=default
 Destroy the virtual device handle.
 

Detailed Description

Virtual pen tablet device handle.

Constructor & Destructor Documentation

◆ PenTablet() [1/2]

lvh::PenTablet::PenTablet ( PenTablet && other)
noexcept

Move construct a pen tablet handle.

Parameters
otherHandle to move from.

◆ PenTablet() [2/2]

lvh::PenTablet::PenTablet ( detail::RuntimeConstructionToken token,
std::shared_ptr< detail::PenTabletDevice > device )

Construct a pen tablet handle for Runtime-owned state.

Parameters
tokenRuntime construction token.
deviceShared pen tablet state.

Member Function Documentation

◆ button()

OperationStatus lvh::PenTablet::button ( PenButton button,
bool pressed )

Submit a tablet button transition.

Parameters
buttonButton to update.
pressedWhether the button is pressed.
Returns
Submit operation status.

◆ close()

OperationStatus lvh::PenTablet::close ( )
overridevirtual

Close the virtual device.

Returns
Close operation status.

Implements lvh::VirtualDevice.

◆ device_id()

DeviceId lvh::PenTablet::device_id ( ) const
overridevirtual

Get the device identifier assigned by the runtime.

Returns
Device identifier.

Implements lvh::VirtualDevice.

◆ device_nodes()

std::vector< DeviceNode > lvh::PenTablet::device_nodes ( ) const
overridevirtual

Get platform-visible nodes associated with the device.

Returns
Device nodes and diagnostic paths currently known to the backend.

Implements lvh::VirtualDevice.

◆ is_open()

bool lvh::PenTablet::is_open ( ) const
overridevirtual

Check whether the device is open.

Returns
true when the device can accept operations.

Implements lvh::VirtualDevice.

◆ last_submitted_tool()

PenToolState lvh::PenTablet::last_submitted_tool ( ) const

Get the most recently submitted tool state.

Returns
Last submitted tool state.

◆ operator=() [1/2]

PenTablet & lvh::PenTablet::operator= ( const PenTablet & )
delete

Copy assignment is disabled because the handle owns device lifetime.

Returns
This pen tablet handle.

◆ operator=() [2/2]

PenTablet & lvh::PenTablet::operator= ( PenTablet && other)
noexcept

Move assign a pen tablet handle.

Parameters
otherHandle to move from.
Returns
This pen tablet handle.

◆ place_tool()

OperationStatus lvh::PenTablet::place_tool ( const PenToolState & state)

Place or move the active tablet tool.

Parameters
stateTool state.
Returns
Submit operation status.

◆ profile()

const DeviceProfile & lvh::PenTablet::profile ( ) const
overridevirtual

Get the profile used to create this device.

Returns
Device profile.

Implements lvh::VirtualDevice.

◆ submit_count()

std::size_t lvh::PenTablet::submit_count ( ) const

Get the number of successful submit operations.

Returns
Submit count.

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