Changeset View
Changeset View
Standalone View
Standalone View
libinput/device.cpp
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Line(s) | |||||
153 | 153 | | |||
154 | Device::Device(libinput_device *device, QObject *parent) | 154 | Device::Device(libinput_device *device, QObject *parent) | ||
155 | : QObject(parent) | 155 | : QObject(parent) | ||
156 | , m_device(device) | 156 | , m_device(device) | ||
157 | , m_keyboard(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_KEYBOARD)) | 157 | , m_keyboard(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_KEYBOARD)) | ||
158 | , m_pointer(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_POINTER)) | 158 | , m_pointer(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_POINTER)) | ||
159 | , m_touch(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_TOUCH)) | 159 | , m_touch(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_TOUCH)) | ||
160 | , m_tabletTool(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_TABLET_TOOL)) | 160 | , m_tabletTool(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_TABLET_TOOL)) | ||
161 | #if 0 | | |||
162 | // next libinput version | | |||
163 | , m_tabletPad(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_TABLET_PAD)) | 161 | , m_tabletPad(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_TABLET_PAD)) | ||
164 | #else | | |||
165 | , m_tabletPad(false) | | |||
166 | #endif | | |||
167 | , m_supportsGesture(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_GESTURE)) | 162 | , m_supportsGesture(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_GESTURE)) | ||
168 | , m_switch(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_SWITCH)) | 163 | , m_switch(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_SWITCH)) | ||
169 | , m_lidSwitch(m_switch ? libinput_device_switch_has_switch(m_device, LIBINPUT_SWITCH_LID) : false) | 164 | , m_lidSwitch(m_switch ? libinput_device_switch_has_switch(m_device, LIBINPUT_SWITCH_LID) : false) | ||
170 | , m_tabletSwitch(m_switch ? libinput_device_switch_has_switch(m_device, LIBINPUT_SWITCH_TABLET_MODE) : false) | 165 | , m_tabletSwitch(m_switch ? libinput_device_switch_has_switch(m_device, LIBINPUT_SWITCH_TABLET_MODE) : false) | ||
171 | , m_name(QString::fromLocal8Bit(libinput_device_get_name(m_device))) | 166 | , m_name(QString::fromLocal8Bit(libinput_device_get_name(m_device))) | ||
172 | , m_sysName(QString::fromLocal8Bit(libinput_device_get_sysname(m_device))) | 167 | , m_sysName(QString::fromLocal8Bit(libinput_device_get_sysname(m_device))) | ||
173 | , m_outputName(QString::fromLocal8Bit(libinput_device_get_output_name(m_device))) | 168 | , m_outputName(QString::fromLocal8Bit(libinput_device_get_output_name(m_device))) | ||
174 | , m_product(libinput_device_get_id_product(m_device)) | 169 | , m_product(libinput_device_get_id_product(m_device)) | ||
▲ Show 20 Lines • Show All 247 Lines • ▼ Show 20 Line(s) | 416 | if (libinput_device_config_tap_set_button_map(m_device, map) == LIBINPUT_CONFIG_STATUS_SUCCESS) { | |||
422 | if (m_tapButtonMap != map) { | 417 | if (m_tapButtonMap != map) { | ||
423 | m_tapButtonMap = map; | 418 | m_tapButtonMap = map; | ||
424 | writeEntry(ConfigKey::LmrTapButtonMap, set); | 419 | writeEntry(ConfigKey::LmrTapButtonMap, set); | ||
425 | emit tapButtonMapChanged(); | 420 | emit tapButtonMapChanged(); | ||
426 | } | 421 | } | ||
427 | } | 422 | } | ||
428 | } | 423 | } | ||
429 | 424 | | |||
425 | int Device::stripsCount() const | ||||
426 | { | ||||
427 | return libinput_device_tablet_pad_get_num_strips(m_device); | ||||
428 | } | ||||
429 | | ||||
430 | int Device::ringsCount() const | ||||
431 | { | ||||
432 | return libinput_device_tablet_pad_get_num_rings(m_device); | ||||
433 | } | ||||
434 | | ||||
430 | #define CONFIG(method, condition, function, variable, key) \ | 435 | #define CONFIG(method, condition, function, variable, key) \ | ||
431 | void Device::method(bool set) \ | 436 | void Device::method(bool set) \ | ||
432 | { \ | 437 | { \ | ||
433 | if (condition) { \ | 438 | if (condition) { \ | ||
434 | return; \ | 439 | return; \ | ||
435 | } \ | 440 | } \ | ||
436 | if (libinput_device_config_##function(m_device, set) == LIBINPUT_CONFIG_STATUS_SUCCESS) { \ | 441 | if (libinput_device_config_##function(m_device, set) == LIBINPUT_CONFIG_STATUS_SUCCESS) { \ | ||
437 | if (m_##variable != set) { \ | 442 | if (m_##variable != set) { \ | ||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |