/usr/include/mirclient/mir_toolkit/mir_input_device.h is in libmirclient-dev 0.26.3+16.04.20170605-0ubuntu1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | /*
* Copyright © 2015-2016 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef MIR_TOOLKIT_MIR_INPUT_DEVICE_H_
#define MIR_TOOLKIT_MIR_INPUT_DEVICE_H_
#include "mir_toolkit/client_types.h"
#include "mir_toolkit/mir_input_device_types.h"
/**
* \addtogroup mir_toolkit
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* Retrieve the number of available input devices.
*
* \param [in] config The input configuration snapshot
*
* \return Number of input devices
*/
size_t mir_input_config_device_count(MirInputConfig const* config);
/**
* Retrieve the input device at given \a index.
*
* The pointer returned stays valid until mir_input_config_release
* is called with \a config.
*
* \param [in] config The input configuration snapshot
* \param [in] index The index of the input device to return.
* \return input device
*/
MirInputDevice const* mir_input_config_get_device(
MirInputConfig const* config,
size_t index);
/**
* Retrieve the input device by \a id.
*
* The MirInputDevice returned stays valid until mir_input_config_release
* is called with \a config. If no device with the given \a id is found
* NULL will be returned.
*
* \param [in] config The input configuration snapshot
* \param [in] id The input device id to search for
*
* \return input device
*/
MirInputDevice const* mir_input_config_get_device_by_id(
MirInputConfig const* config,
MirInputDeviceId id);
/**
* Retrieve the input device at given \a index.
*
* The pointer returned stays valid until mir_input_config_release
* is called with \a config.
*
* \param [in] config The input configuration snapshot
* \param [in] index The index of the input device to return.
* \return input device
*/
MirInputDevice* mir_input_config_get_mutable_device(
MirInputConfig* config,
size_t index);
/**
* Retrieve the input device by \a id.
*
* The MirInputDevice returned stays valid until mir_input_config_release
* is called with \a config. If no device with the given \a id is found
* NULL will be returned.
*
* \param [in] config The input configuration snapshot
* \param [in] id The input device id to search for
*
* \return input device
*/
MirInputDevice* mir_input_config_get_mutable_device_by_id(
MirInputConfig* config,
MirInputDeviceId id);
/**
* Retrieve the capabilities of the input device at the given index.
*
* \param [in] device The input device
*
* \return The capability flags of the input device
*/
MirInputDeviceCapabilities mir_input_device_get_capabilities(
MirInputDevice const* device);
/**
* Retrieve the device id of the input device.
* The device id is a unique integer value, only valid while the device is
* attached. The device id matches the device id attached every input event.
*
* \param [in] device The input device
*
* \return The device id of the input device
*/
MirInputDeviceId mir_input_device_get_id(MirInputDevice const* device);
/**
* Retrieve the name of the input device.
* The string pointed to will be valid as long as MirInputDevice is valid.
* The name may be empty but never NULL.
*
* \param [in] device The input device
*
* \return The name of the input device
*/
char const* mir_input_device_get_name(MirInputDevice const* device);
/**
* Retrieve the unique id of the input device.
* The string pointed to will be valid as long as \a device is valid.
* The value of the unique id of a given device should be valid across mir
* connections session and servers of the same version.
*
* \param [in] device The input device
*
* \return The unique id of the input device
*/
char const* mir_input_device_get_unique_id(MirInputDevice const* device);
/**
* Retrieve a structure containing the pointer related config options
* of the input device.
*
* If the input device does not control the mouse cursor, there will be no
* config options, and the function will return a null pointer.
*
* \param [in] device The input device
*
* \return The pointer config
*/
MirPointerConfig const* mir_input_device_get_pointer_config(
MirInputDevice const* device);
/**
* Retrieve the cursor acceleration profile.
*
* \param [in] conf The pointer config
*
* \return The acceleration profile
*/
MirPointerAcceleration mir_pointer_config_get_acceleration(
MirPointerConfig const* conf);
/**
* Retrieve the cursor acceleration bias.
*
* The value will be in the range of [-1, 1]:
* - 0: default acceleration
* - [-1, 0): reduced acceleration
* - (0, 1]: increased acceleration
*
* \param [in] conf The pointer config
*
* \return The acceleration bias
*/
double mir_pointer_config_get_acceleration_bias(
MirPointerConfig const* conf);
/**
* Retrieve the horizontal scroll scale.
*
* The value is a signed linear scale of the horizontal scroll axis. A Negative
* value indicates 'natural scrolling'.
*
* \param [in] conf The pointer config
*
* \return The horizontal scroll scale
*/
double mir_pointer_config_get_horizontal_scroll_scale(
MirPointerConfig const* conf);
/**
* Retrieve the vertical scroll scale.
*
* The value is a signed linear scale of the vertical scroll axis. A Negative
* value indicates 'natural scrolling'.
*
* \param [in] conf The pointer config
*
* \return The vertical scroll scale
*/
double mir_pointer_config_get_vertical_scroll_scale(
MirPointerConfig const* conf);
/**
* Retrieve whether the pointer device is configured for right or left handed
* use.
*
* \param [in] conf The pointer config
*
* \return Right or left handed
*/
MirPointerHandedness mir_pointer_config_get_handedness(
MirPointerConfig const* conf);
/**
* Retrieve a structure containing the pointer related config options
* of the input device that can be manipulated.
*
* If the input device does not control the mouse cursor, there will be no
* config options, and the function will return a null pointer.
*
* \param [in] device The input device
*
* \return The pointer config
*/
MirPointerConfig* mir_input_device_get_mutable_pointer_config(
MirInputDevice* device);
/**
* Set the acceleration mode of the pointer device.
*
* See \ref MirPointerAcceleration for reference.
*
* \param [in] conf The pointer config
* \param [in] acceleration The acceleration mode
*/
void mir_pointer_config_set_acceleration(
MirPointerConfig* conf,
MirPointerAcceleration acceleration);
/**
* Set the acceleration bias of the pointer device.
*
* The acceleration bias must be in the range of [-1, 1]:
* - 0: default acceleration
* - [-1, 0): reduced acceleration
* - (0, 1]: increased acceleration
*
* \param [in] conf The pointer config
* \param [in] acceleration_bias The acceleration bias
*/
void mir_pointer_config_set_acceleration_bias(
MirPointerConfig* conf,
double acceleration_bias);
/**
* Set the horizontal scroll scale.
*
* The horizontal scroll scale is a signed linear scale of scroll motion along
* the horizontal axis. Negative scales can be used to configure 'natural
* scrolling'.
*
* \param [in] conf The pointer config
* \param [in] horizontal_scroll_scale The horizontal scroll scale
*/
void mir_pointer_config_set_horizontal_scroll_scale(
MirPointerConfig* conf,
double horizontal_scroll_scale);
/**
* Set the vertical scroll scale.
*
* The vertical scroll scale is a signed linear scale of scroll motion along
* the vertical axis. Negative scales can be used to configure 'natural
* scrolling'.
*
* \param [in] conf The pointer config
* \param [in] vertical_scroll_scale The vertical scroll scale
*/
void mir_pointer_config_set_vertical_scroll_scale(
MirPointerConfig* conf,
double vertical_scroll_scale);
/**
* Configure left and right hand use of the pointer device.
*
* This configures which buttons will be used as primary and secondary buttons.
*
* \param [in] conf The pointer config
* \param [in] handedness left or right handed use
*/
void mir_pointer_config_set_handedness(
MirPointerConfig* conf,
MirPointerHandedness handedness);
/**
* Retrieve a structure containing the touchpad related config options
* of the input device.
*
* If the input device is not a touchpad this function will return null pointer.
*
* \param [in] device The input device
*
* \return The touchpad config
*/
MirTouchpadConfig const* mir_input_device_get_touchpad_config(
MirInputDevice const* device);
/**
* Retrieve the click modes of the touchpad.
*
* See \ref MirTouchpadClickMode for reference.
*
* \param [in] conf The touchpad config
*
* \return The touchpad click modes
*/
MirTouchpadClickModes mir_touchpad_config_get_click_modes(
MirTouchpadConfig const* conf);
/**
* Retrieve the scroll modes of the touchpad.
*
* See \ref MirTouchpadScrollMode for reference.
*
* \param [in] conf The touchpad config
*
* \return The touchpad click modes
*/
MirTouchpadScrollModes mir_touchpad_config_get_scroll_modes(
MirTouchpadConfig const* conf);
/**
* Retrieve the configured button down for button down scroll mode.
*
* See \ref MirTouchpadScrollMode for reference.
*
* \param [in] conf The touchpad config
*
* \return The touchpad click modes
*/
int mir_touchpad_config_get_button_down_scroll_button(
MirTouchpadConfig const* conf);
/**
* Retrieve whether a tap gesture generates pointer button events.
*
* \param [in] conf The touchpad config
*
* \return whether tap to click is enabled
*/
bool mir_touchpad_config_get_tap_to_click(
MirTouchpadConfig const* conf);
/**
* Retrieve whether middle mouse button should be emulated.
*
* \param [in] conf The touchpad config
*
* \return whether middle mouse button emulation is enabled
*/
bool mir_touchpad_config_get_middle_mouse_button_emulation(
MirTouchpadConfig const* conf);
/**
* Retrieve whether the touchpad should be disabled when an external pointer
* device like a mouse is connected.
*
* \param [in] conf The touchpad config
*
* \return whether touchpad is disabled with an external mouse
*/
bool mir_touchpad_config_get_disable_with_mouse(
MirTouchpadConfig const* conf);
/**
* Retrieve whether the touchpad events should be blocked while the user types.
*
* \param [in] conf The touchpad config
*
* \return whether touchpad is disabled during typing
*/
bool mir_touchpad_config_get_disable_while_typing(
MirTouchpadConfig const* conf);
/**
* Retrieve a structure containing the touchpad related config options
* of the input device that can be manipulated.
*
* If the input device is not a touchpad this function will return null pointer.
*
* \param [in] device The input device
*
* \return A mutable touchpad config
*/
MirTouchpadConfig* mir_input_device_get_mutable_touchpad_config(
MirInputDevice* device);
/**
* Configure the enable click modes for the touchpad.
*
* \param [in] conf The touchpad config
* \param [in] modes the enabled click modes
*/
void mir_touchpad_config_set_click_modes(
MirTouchpadConfig* conf, MirTouchpadClickModes modes);
/**
* Configure the enabled scroll modes for the touchpad.
*
* \param [in] conf The touchpad config
* \param [in] modes the enabled scroll modes
*/
void mir_touchpad_config_set_scroll_modes(
MirTouchpadConfig* conf, MirTouchpadScrollModes modes);
/**
* Configure the button for button down scroll mode
*
* \param [in] conf The touchpad config
* \param [in] button the button
*/
void mir_touchpad_config_set_button_down_scroll_button(
MirTouchpadConfig* conf, int button);
/**
* Configure whether tap to click should be enabled
*
* \param [in] conf The touchpad config
* \param [in] tap_to_click
*/
void mir_touchpad_config_set_tap_to_click(
MirTouchpadConfig* conf, bool tap_to_click);
/**
* Configure whether middle mouse button emulation should be enabled
*
* \param [in] conf The touchpad config
* \param [in] middle_mouse_button_emulation
*/
void mir_touchpad_config_set_middle_mouse_button_emulation(
MirTouchpadConfig* conf, bool middle_emulation);
/**
* Configure whether the touchpad should be turned off while a mouse is attached.
*
* \param [in] conf The touchpad config
* \param [in] active disable touchpad with mouse
*/
void mir_touchpad_config_set_disable_with_mouse(
MirTouchpadConfig* conf, bool active);
/**
* Configure whether the touchpad should be turned off while typing
*
* \param [in] conf The touchpad config
* \param [in] active disable touchpad while typing
*/
void mir_touchpad_config_set_disable_while_typing(
MirTouchpadConfig* conf, bool active);
#ifdef __cplusplus
}
#endif
/**@}*/
#endif
|