|
NXWidgets
1.19
|
#include <ctouchscreen.hxx>
Public Member Functions | |
| CTouchscreen (NXWidgets::CNxServer *server, struct nxgl_size_s *windowSize) | |
| ~CTouchscreen (void) | |
| bool | start (void) |
| void | setEnabled (bool enable) |
| bool | isCalibrated (void) const |
| void | setCalibrationData (const struct SCalibrationData &caldata) |
| bool | getCalibrationData (struct SCalibrationData &caldata) const |
| bool | waitRawTouchData (struct touch_sample_s *touch) |
Private Types | |
| enum | EListenerState { LISTENER_NOTRUNNING = 0, LISTENER_STARTED, LISTENER_RUNNING, LISTENER_STOPREQUESTED, LISTENER_TERMINATED, LISTENER_FAILED } |
Private Member Functions | |
| void | handleMouseInput (struct touch_sample_s *sample) |
Static Private Member Functions | |
| static FAR void * | listener (FAR void *arg) |
Private Attributes | |
| NXWidgets::CNxServer * | m_server |
| int | m_touchFd |
| sem_t | m_waitSem |
| pthread_t | m_thread |
| enum EListenerState | m_state |
| volatile bool | m_enabled |
| volatile bool | m_capture |
| volatile bool | m_calibrated |
| struct nxgl_size_s | m_windowSize |
| struct SCalibrationData | m_calibData |
| struct touch_sample_s | m_sample |
| struct touch_sample_s * | m_touch |
The CTouchscreen class provides the the calibration window and obtains callibration data.
Definition at line 68 of file ctouchscreen.hxx.
|
private |
The state of the listener thread.
Definition at line 75 of file ctouchscreen.hxx.
| CTouchscreen::CTouchscreen | ( | NXWidgets::CNxServer * | server, |
| struct nxgl_size_s * | windowSize | ||
| ) |
CTouchscreen Constructor
| server. | An instance of the NX server. This will be needed for injecting mouse data. |
| windowSize. | The size of the physical window in pixels. This is needed for touchscreen scaling. |
Definition at line 97 of file ctouchscreen.cxx.
| CTouchscreen::~CTouchscreen | ( | void | ) |
CTouchscreen Destructor
Definition at line 123 of file ctouchscreen.cxx.
|
inline |
Recover the calibration data so that it can be saved to non-volatile storage.
| data. | A reference to the touchscreen data. |
Definition at line 198 of file ctouchscreen.hxx.
|
private |
Inject touchscreen data into NX as mouse intput
| sample. | The buffer where data was collected. |
Inject touchscreen data into NX as mouse intput
Definition at line 389 of file ctouchscreen.cxx.
|
inline |
Is the touchscreen calibrated?
Definition at line 175 of file ctouchscreen.hxx.
|
staticprivate |
The touchscreen listener thread. This is the entry point of a thread that listeners for and dispatches touchscreens events to the NX server.
| arg. | The CTouchscreen 'this' pointer cast to a void*. |
The touchscreen listener thread. This is the entry point of a thread that listeners for and dispatches touchscreen events to the NX server.
| arg. | The CTouchscreen 'this' pointer cast to a void*. |
Definition at line 277 of file ctouchscreen.cxx.
| void CTouchscreen::setCalibrationData | ( | const struct SCalibrationData & | caldata | ) |
Provide touchscreen calibration data. If calibration data is received (and the touchscreen is enabled), then received touchscreen data will be scaled using the calibration data and forward to the NX layer which dispatches the touchscreen events in window-relative positions to the correct NX window.
| data. | A reference to the touchscreen data. |
Definition at line 209 of file ctouchscreen.cxx.
|
inline |
Enable/disable touchscreen data processing. When enabled, touchscreen events are calibrated and forwarded to the NX layer which dispatches the touchscreen events in window-relative positions to the correct NX window.
When disabled, touchscreen data is not forwarded to NX, but is instead captured and made available for touchscreen calibration. The touchscreen driver is initially disabled and must be specifically enabled be begin normal processing. Normal processing also requires calibration data (see method setCalibrationData)
| capture. | True enables capture mode; false disables. |
Definition at line 161 of file ctouchscreen.hxx.
| bool CTouchscreen::start | ( | void | ) |
Start the touchscreen listener thread.
Definition at line 153 of file ctouchscreen.cxx.
| bool CTouchscreen::waitRawTouchData | ( | struct touch_sample_s * | touch | ) |
Capture raw driver data. This method will capture mode one raw touchscreen input. The normal use of this method is for touchscreen calibration.
This function is not re-entrant: There may be only one thread waiting for raw touchscreen data.
Capture raw driver data. This method will capture mode one raw touchscreen input. The normal use of this method is for touchscreen calibration.
This function is not re-entrant: There may be only one thread waiting for raw touchscreen data.
Definition at line 236 of file ctouchscreen.cxx.
|
private |
Calibration data
Definition at line 98 of file ctouchscreen.hxx.
|
private |
True: If have calibration data
Definition at line 96 of file ctouchscreen.hxx.
|
private |
True: There is a thread waiting for raw touch data
Definition at line 95 of file ctouchscreen.hxx.
|
private |
True: Normal touchscreen processing
Definition at line 94 of file ctouchscreen.hxx.
|
private |
In normal mode, touch data is collected here
Definition at line 99 of file ctouchscreen.hxx.
|
private |
CTouchscreen state dataThe current NX server
Definition at line 89 of file ctouchscreen.hxx.
|
private |
The state of the listener thread
Definition at line 93 of file ctouchscreen.hxx.
|
private |
The listener thread ID
Definition at line 92 of file ctouchscreen.hxx.
|
private |
Points to the current touch data buffer
Definition at line 100 of file ctouchscreen.hxx.
|
private |
File descriptor of the opened touchscreen device
Definition at line 90 of file ctouchscreen.hxx.
|
private |
Semaphore the supports waits for touchscreen data
Definition at line 91 of file ctouchscreen.hxx.
|
private |
The size of the physical display
Definition at line 97 of file ctouchscreen.hxx.
1.8.13