Changeset View
Changeset View
Standalone View
Standalone View
src/common/libwacomwrapper.cpp
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 61 | { | |||
---|---|---|---|---|---|
82 | // TODO: are these properties even used anywhere? | 82 | // TODO: are these properties even used anywhere? | ||
83 | tabletInfo.set(TabletInfo::CompanyName, QString()); | 83 | tabletInfo.set(TabletInfo::CompanyName, QString()); | ||
84 | tabletInfo.set(TabletInfo::TabletModel, QString()); | 84 | tabletInfo.set(TabletInfo::TabletModel, QString()); | ||
85 | // TODO: Seems like there's no info about the pad wheel in libwacom | 85 | // TODO: Seems like there's no info about the pad wheel in libwacom | ||
86 | // Only a couple of tablets have the wheel anyway, so it probably can be hacked around | 86 | // Only a couple of tablets have the wheel anyway, so it probably can be hacked around | ||
87 | tabletInfo.set(TabletInfo::HasWheel, false); | 87 | tabletInfo.set(TabletInfo::HasWheel, false); | ||
88 | // TODO: Returns more detailed information than we expect, | 88 | // TODO: Returns more detailed information than we expect, | ||
89 | // current LED code is broken anyway so this should be untangled later | 89 | // current LED code is broken anyway so this should be untangled later | ||
90 | tabletInfo.set(TabletInfo::StatusLEDs, 0); | 90 | int numStatusLeds = 0; | ||
91 | int numLedGroups; | ||||
valeriymalov: Initialize to zero just in case | |||||
92 | const WacomStatusLEDs *ledGroups = libwacom_get_status_leds(device.get(), &numLedGroups); | ||||
93 | for (int i = 0; i < numLedGroups; i++) { | ||||
94 | int groupModes = 0; | ||||
95 | switch (ledGroups[i]) { | ||||
Add explicit do-nothing case in the end for WACOM_STATUS_LED_UNAVAILABLE to suppress a warning and so we'll catch when new led groups will be added valeriymalov: Add explicit do-nothing case in the end for WACOM_STATUS_LED_UNAVAILABLE to suppress a warning… | |||||
96 | case WACOM_STATUS_LED_RING: | ||||
97 | groupModes = libwacom_get_ring_num_modes(device.get()); | ||||
98 | break; | ||||
99 | case WACOM_STATUS_LED_RING2: | ||||
100 | groupModes = libwacom_get_ring2_num_modes(device.get()); | ||||
101 | break; | ||||
102 | case WACOM_STATUS_LED_TOUCHSTRIP: | ||||
103 | groupModes = libwacom_get_strips_num_modes(device.get()); | ||||
104 | break; | ||||
105 | case WACOM_STATUS_LED_TOUCHSTRIP2: | ||||
106 | groupModes = libwacom_get_strips_num_modes(device.get()); | ||||
107 | break; | ||||
108 | } | ||||
109 | numStatusLeds += groupModes; | ||||
110 | } | ||||
111 | tabletInfo.set(TabletInfo::StatusLEDs, numStatusLeds); | ||||
I think it's worth putting a TODO or FIXME comment somewhere that it needs checking with Cintiq 24HD (see my general comment) valeriymalov: I think it's worth putting a TODO or FIXME comment somewhere that it needs checking with Cintiq… | |||||
91 | 112 | | |||
92 | tabletInfo.set(TabletInfo::TabletName, QString::fromLatin1(libwacom_get_name(device.get()))); | 113 | tabletInfo.set(TabletInfo::TabletName, QString::fromLatin1(libwacom_get_name(device.get()))); | ||
93 | 114 | | |||
94 | const int padButtonNumber = libwacom_get_num_buttons(device.get()); | 115 | const int padButtonNumber = libwacom_get_num_buttons(device.get()); | ||
95 | tabletInfo.set(TabletInfo::NumPadButtons, padButtonNumber); | 116 | tabletInfo.set(TabletInfo::NumPadButtons, padButtonNumber); | ||
96 | 117 | | |||
97 | // Convert button evdev codes to buttonMap | 118 | // Convert button evdev codes to buttonMap | ||
98 | if (libwacom_get_num_buttons(device.get()) > 0) { | 119 | if (libwacom_get_num_buttons(device.get()) > 0) { | ||
▲ Show 20 Lines • Show All 103 Lines • Show Last 20 Lines |
Initialize to zero just in case