Android-cuttlefish cvd tool
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cuttlefish::TouchDevice Class Reference

#include <input_devices.h>

Inheritance diagram for cuttlefish::TouchDevice:
Inheritance graph
[legend]
Collaboration diagram for cuttlefish::TouchDevice:
Collaboration graph
[legend]

Public Member Functions

 TouchDevice (InputConnection conn)
 
Result< void > SendTouchEvent (int x, int y, bool down)
 
Result< void > SendMultiTouchEvent (const std::vector< MultitouchSlot > &slots, bool down)
 
void OnDisconnectedSource (void *source)
 
- Public Member Functions inherited from cuttlefish::InputDevice
 InputDevice (InputConnection conn)
 
virtual ~InputDevice ()=default
 

Private Member Functions

bool HasSlot (void *source, int32_t id)
 
int32_t GetOrAcquireSlot (void *source, int32_t id)
 
void ReleaseSlot (void *source, int32_t id)
 
size_t NumActiveSlots ()
 
int NewTrackingId ()
 
int32_t UseNewSlot ()
 

Private Attributes

std::mutex slots_mtx_
 
std::map< std::pair< void *, int32_t >, int32_t > slots_by_source_and_id_
 
std::vector< bool > active_slots_
 
std::atomic< int > tracking_id_ = 0
 

Additional Inherited Members

- Protected Member Functions inherited from cuttlefish::InputDevice
Result< void > WriteEvents (const EventBuffer &buffer)
 

Constructor & Destructor Documentation

◆ TouchDevice()

cuttlefish::TouchDevice::TouchDevice ( InputConnection  conn)
inline

Member Function Documentation

◆ GetOrAcquireSlot()

int32_t cuttlefish::TouchDevice::GetOrAcquireSlot ( void *  source,
int32_t  id 
)
private

◆ HasSlot()

bool cuttlefish::TouchDevice::HasSlot ( void *  source,
int32_t  id 
)
private

◆ NewTrackingId()

int cuttlefish::TouchDevice::NewTrackingId ( )
inlineprivate

◆ NumActiveSlots()

size_t cuttlefish::TouchDevice::NumActiveSlots ( )
inlineprivate

◆ OnDisconnectedSource()

void cuttlefish::TouchDevice::OnDisconnectedSource ( void *  source)

◆ ReleaseSlot()

void cuttlefish::TouchDevice::ReleaseSlot ( void *  source,
int32_t  id 
)
private

◆ SendMultiTouchEvent()

Result< void > cuttlefish::TouchDevice::SendMultiTouchEvent ( const std::vector< MultitouchSlot > &  slots,
bool  down 
)

◆ SendTouchEvent()

Result< void > cuttlefish::TouchDevice::SendTouchEvent ( int  x,
int  y,
bool  down 
)

◆ UseNewSlot()

int32_t cuttlefish::TouchDevice::UseNewSlot ( )
private

Member Data Documentation

◆ active_slots_

std::vector<bool> cuttlefish::TouchDevice::active_slots_
private

◆ slots_by_source_and_id_

std::map<std::pair<void*, int32_t>, int32_t> cuttlefish::TouchDevice::slots_by_source_and_id_
private

◆ slots_mtx_

std::mutex cuttlefish::TouchDevice::slots_mtx_
private

◆ tracking_id_

std::atomic<int> cuttlefish::TouchDevice::tracking_id_ = 0
private

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