2013-11-10 17:55:40 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright © 2013 Jonas Ådahl
|
|
|
|
|
*
|
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software and
|
|
|
|
|
* its documentation for any purpose is hereby granted without fee, provided
|
|
|
|
|
* that the above copyright notice appear in all copies and that both that
|
|
|
|
|
* copyright notice and this permission notice appear in supporting
|
|
|
|
|
* documentation, and that the name of the copyright holders not be used in
|
|
|
|
|
* advertising or publicity pertaining to distribution of the software
|
|
|
|
|
* without specific, written prior permission. The copyright holders make
|
|
|
|
|
* no representations about the suitability of this software for any
|
|
|
|
|
* purpose. It is provided "as is" without express or implied warranty.
|
|
|
|
|
*
|
|
|
|
|
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
|
|
|
|
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
|
|
|
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
|
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
|
|
|
|
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
|
|
|
|
* CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
|
|
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef LIBINPUT_H
|
|
|
|
|
#define LIBINPUT_H
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <stdint.h>
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
#include <libudev.h>
|
2013-11-10 17:55:40 +01:00
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @mainpage
|
|
|
|
|
* libinput is a generic input device handling library. It abstracts
|
|
|
|
|
* commonly-used concepts such as keyboard, pointer and touchpad handling
|
|
|
|
|
* behind an API.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2013-12-19 11:05:29 +10:00
|
|
|
* @ingroup fixed_point
|
|
|
|
|
*
|
2013-12-06 09:58:00 +10:00
|
|
|
* libinput 24.8 fixed point real number.
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
typedef int32_t li_fixed_t;
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Capabilities on a device. A device may have one or more capabilities
|
|
|
|
|
* at a time, and capabilities may appear or disappear during the
|
|
|
|
|
* lifteime of the device.
|
|
|
|
|
*/
|
2013-11-13 22:11:34 +01:00
|
|
|
enum libinput_device_capability {
|
|
|
|
|
LIBINPUT_DEVICE_CAP_KEYBOARD = 0,
|
|
|
|
|
LIBINPUT_DEVICE_CAP_POINTER = 1,
|
2013-12-06 14:29:01 +10:00
|
|
|
LIBINPUT_DEVICE_CAP_TOUCH = 2
|
2013-11-10 17:55:40 +01:00
|
|
|
};
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Logical state of a key. Note that the logical state may not represent
|
|
|
|
|
* the physical state of the key.
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
enum libinput_keyboard_key_state {
|
|
|
|
|
LIBINPUT_KEYBOARD_KEY_STATE_RELEASED = 0,
|
2013-12-06 14:29:01 +10:00
|
|
|
LIBINPUT_KEYBOARD_KEY_STATE_PRESSED = 1
|
2013-11-10 17:55:40 +01:00
|
|
|
};
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Mask reflecting LEDs on a device.
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
enum libinput_led {
|
|
|
|
|
LIBINPUT_LED_NUM_LOCK = (1 << 0),
|
|
|
|
|
LIBINPUT_LED_CAPS_LOCK = (1 << 1),
|
2013-12-06 14:29:01 +10:00
|
|
|
LIBINPUT_LED_SCROLL_LOCK = (1 << 2)
|
2013-11-10 17:55:40 +01:00
|
|
|
};
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Logical state of a physical button. Note that the logical state may not
|
|
|
|
|
* represent the physical state of the button.
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
enum libinput_pointer_button_state {
|
|
|
|
|
LIBINPUT_POINTER_BUTTON_STATE_RELEASED = 0,
|
2013-12-06 14:29:01 +10:00
|
|
|
LIBINPUT_POINTER_BUTTON_STATE_PRESSED = 1
|
2013-11-10 17:55:40 +01:00
|
|
|
};
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Axes on a device that are not x or y coordinates.
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
enum libinput_pointer_axis {
|
|
|
|
|
LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL = 0,
|
2013-12-06 14:29:01 +10:00
|
|
|
LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL = 1
|
2013-11-10 17:55:40 +01:00
|
|
|
};
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Logical touch state of a touch point. A touch point usually follows the
|
|
|
|
|
* sequence down, motion, up, with the number of motion events being zero or
|
|
|
|
|
* greater. If a touch point was used for gesture interpretation internally
|
|
|
|
|
* and will not generate any further events, the touchpoint is cancelled.
|
|
|
|
|
*
|
|
|
|
|
* A frame event is set after a set of touchpoints that constitute one
|
|
|
|
|
* logical set of points at a sampling point.
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
enum libinput_touch_type {
|
|
|
|
|
LIBINPUT_TOUCH_TYPE_DOWN = 0,
|
|
|
|
|
LIBINPUT_TOUCH_TYPE_UP = 1,
|
|
|
|
|
LIBINPUT_TOUCH_TYPE_MOTION = 2,
|
|
|
|
|
LIBINPUT_TOUCH_TYPE_FRAME = 3,
|
2013-12-06 14:29:01 +10:00
|
|
|
LIBINPUT_TOUCH_TYPE_CANCEL = 4
|
2013-11-10 17:55:40 +01:00
|
|
|
};
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* Event type for events returned by libinput_get_event().
|
|
|
|
|
*/
|
2013-11-16 19:32:46 +01:00
|
|
|
enum libinput_event_type {
|
2013-12-13 17:49:38 +10:00
|
|
|
LIBINPUT_EVENT_NONE = 0,
|
2013-12-19 12:04:24 +10:00
|
|
|
LIBINPUT_EVENT_DEVICE_ADDED,
|
|
|
|
|
LIBINPUT_EVENT_DEVICE_REMOVED,
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
|
2013-11-16 19:32:46 +01:00
|
|
|
LIBINPUT_EVENT_KEYBOARD_KEY = 300,
|
|
|
|
|
|
|
|
|
|
LIBINPUT_EVENT_POINTER_MOTION = 400,
|
|
|
|
|
LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE,
|
|
|
|
|
LIBINPUT_EVENT_POINTER_BUTTON,
|
|
|
|
|
LIBINPUT_EVENT_POINTER_AXIS,
|
|
|
|
|
|
2013-12-06 14:29:01 +10:00
|
|
|
LIBINPUT_EVENT_TOUCH_TOUCH = 500
|
2013-11-16 19:32:46 +01:00
|
|
|
};
|
|
|
|
|
|
2013-12-05 17:50:47 +10:00
|
|
|
struct libinput;
|
|
|
|
|
struct libinput_device;
|
|
|
|
|
struct libinput_seat;
|
|
|
|
|
|
2013-12-08 12:36:27 +01:00
|
|
|
struct libinput_event;
|
2014-01-15 17:10:30 +10:00
|
|
|
struct libinput_event_device_notify;
|
2013-12-19 16:40:48 +10:00
|
|
|
struct libinput_event_keyboard;
|
2013-12-19 13:15:28 +10:00
|
|
|
struct libinput_event_pointer;
|
2013-12-19 17:16:19 +10:00
|
|
|
struct libinput_event_touch;
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
|
2013-12-15 17:47:45 +01:00
|
|
|
/**
|
|
|
|
|
* @defgroup fixed_point Fixed point utilities
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup fixed_point
|
|
|
|
|
*
|
|
|
|
|
* Convert li_fixed_t to a double
|
|
|
|
|
*
|
|
|
|
|
* @param f fixed point number
|
|
|
|
|
* @return Converted double
|
|
|
|
|
*/
|
|
|
|
|
static inline double
|
|
|
|
|
li_fixed_to_double (li_fixed_t f)
|
|
|
|
|
{
|
|
|
|
|
union {
|
|
|
|
|
double d;
|
|
|
|
|
int64_t i;
|
|
|
|
|
} u;
|
|
|
|
|
|
|
|
|
|
u.i = ((1023LL + 44LL) << 52) + (1LL << 51) + f;
|
|
|
|
|
|
|
|
|
|
return u.d - (3LL << 43);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup fixed_point
|
|
|
|
|
*
|
|
|
|
|
* Convert li_fixed_t to a int. The fraction part is discarded.
|
|
|
|
|
*
|
|
|
|
|
* @param f fixed point number
|
|
|
|
|
* @return Converted int
|
|
|
|
|
*/
|
|
|
|
|
static inline int
|
|
|
|
|
li_fixed_to_int(li_fixed_t f)
|
|
|
|
|
{
|
|
|
|
|
return f / 256;
|
|
|
|
|
}
|
|
|
|
|
|
2013-12-08 12:36:27 +01:00
|
|
|
/**
|
|
|
|
|
* @defgroup event Acessing and destruction of events
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
|
2013-12-08 16:30:13 +01:00
|
|
|
/**
|
|
|
|
|
* @ingroup event
|
|
|
|
|
*
|
|
|
|
|
* Destroy the event.
|
|
|
|
|
*
|
|
|
|
|
* @param event An event retrieved by libinput_get_event().
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
libinput_event_destroy(struct libinput_event *event);
|
|
|
|
|
|
2013-12-08 16:35:04 +01:00
|
|
|
/**
|
|
|
|
|
* @ingroup event
|
|
|
|
|
*
|
|
|
|
|
* Get the type of the event.
|
|
|
|
|
*
|
|
|
|
|
* @param event An event retrieved by libinput_get_event().
|
|
|
|
|
*/
|
2013-12-08 12:36:27 +01:00
|
|
|
enum libinput_event_type
|
|
|
|
|
libinput_event_get_type(struct libinput_event *event);
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
|
2013-12-19 11:22:53 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup event
|
|
|
|
|
*
|
|
|
|
|
* Get the libinput context from the event.
|
|
|
|
|
*
|
|
|
|
|
* @param event The libinput event
|
|
|
|
|
* @return The libinput context for this event.
|
|
|
|
|
*/
|
|
|
|
|
struct libinput*
|
|
|
|
|
libinput_event_get_context(struct libinput_event *event);
|
|
|
|
|
|
2013-12-08 12:36:27 +01:00
|
|
|
/**
|
2014-01-17 17:59:30 +10:00
|
|
|
* @ingroup event
|
|
|
|
|
*
|
|
|
|
|
* Return the device associated with this event, if applicable. For device
|
|
|
|
|
* added/removed events this is the device added or removed. For all other
|
|
|
|
|
* device events, this is the device that generated the event.
|
|
|
|
|
*
|
|
|
|
|
* This device is not refcounted and its lifetime is that of the event. Use
|
|
|
|
|
* libinput_device_ref() before using the device outside of this scope.
|
|
|
|
|
*
|
|
|
|
|
* @return The device associated with this event
|
2013-12-08 12:36:27 +01:00
|
|
|
*/
|
2013-11-16 19:32:46 +01:00
|
|
|
|
2014-01-17 17:59:30 +10:00
|
|
|
struct libinput_device*
|
|
|
|
|
libinput_event_get_device(struct libinput_event *event);
|
2013-11-16 19:32:46 +01:00
|
|
|
|
2013-12-08 12:36:27 +01:00
|
|
|
/**
|
|
|
|
|
* @defgroup event_keyboard_key Keyboard key event
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
uint32_t
|
2013-12-19 16:40:48 +10:00
|
|
|
libinput_event_keyboard_get_time(
|
|
|
|
|
struct libinput_event_keyboard *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
uint32_t
|
2013-12-19 16:40:48 +10:00
|
|
|
libinput_event_keyboard_get_key(
|
|
|
|
|
struct libinput_event_keyboard *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
enum libinput_keyboard_key_state
|
2013-12-19 16:40:48 +10:00
|
|
|
libinput_event_keyboard_get_key_state(
|
|
|
|
|
struct libinput_event_keyboard *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
/**
|
2013-12-19 13:15:28 +10:00
|
|
|
* @defgroup event_pointer Pointer motion event
|
2013-12-08 12:36:27 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
uint32_t
|
2013-12-19 13:15:28 +10:00
|
|
|
libinput_event_pointer_get_time(
|
|
|
|
|
struct libinput_event_pointer *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
li_fixed_t
|
2013-12-19 13:15:28 +10:00
|
|
|
libinput_event_pointer_get_dx(
|
|
|
|
|
struct libinput_event_pointer *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
li_fixed_t
|
2013-12-19 13:15:28 +10:00
|
|
|
libinput_event_pointer_get_dy(
|
|
|
|
|
struct libinput_event_pointer *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
/**
|
2013-12-19 13:15:28 +10:00
|
|
|
* @defgroup event_pointer_absolute Absolute pointer motion event
|
2013-12-08 12:36:27 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
li_fixed_t
|
2013-12-19 13:15:28 +10:00
|
|
|
libinput_event_pointer_get_absolute_x(
|
|
|
|
|
struct libinput_event_pointer *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
li_fixed_t
|
2013-12-19 13:15:28 +10:00
|
|
|
libinput_event_pointer_get_absolute_y(
|
|
|
|
|
struct libinput_event_pointer *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @defgroup event_pointer_button Pointer button event
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
uint32_t
|
2013-12-19 13:15:28 +10:00
|
|
|
libinput_event_pointer_get_button(
|
|
|
|
|
struct libinput_event_pointer *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
enum libinput_pointer_button_state
|
2013-12-19 13:15:28 +10:00
|
|
|
libinput_event_pointer_get_button_state(
|
|
|
|
|
struct libinput_event_pointer *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @defgroup event_pointer_axis Pointer axis event
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
enum libinput_pointer_axis
|
2013-12-19 13:15:28 +10:00
|
|
|
libinput_event_pointer_get_axis(
|
|
|
|
|
struct libinput_event_pointer *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
li_fixed_t
|
2013-12-19 13:15:28 +10:00
|
|
|
libinput_event_pointer_get_axis_value(
|
|
|
|
|
struct libinput_event_pointer *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @defgroup event_pointer_button Pointer button event
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
uint32_t
|
2013-12-19 17:16:19 +10:00
|
|
|
libinput_event_touch_get_time(
|
|
|
|
|
struct libinput_event_touch *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
uint32_t
|
2013-12-19 17:16:19 +10:00
|
|
|
libinput_event_touch_get_slot(
|
|
|
|
|
struct libinput_event_touch *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
li_fixed_t
|
2013-12-19 17:16:19 +10:00
|
|
|
libinput_event_touch_get_x(
|
|
|
|
|
struct libinput_event_touch *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
li_fixed_t
|
2013-12-19 17:16:19 +10:00
|
|
|
libinput_event_touch_get_y(
|
|
|
|
|
struct libinput_event_touch *event);
|
2013-12-08 12:36:27 +01:00
|
|
|
|
|
|
|
|
enum libinput_touch_type
|
2013-12-19 17:16:19 +10:00
|
|
|
libinput_event_touch_get_touch_type(
|
|
|
|
|
struct libinput_event_touch *event);
|
2013-11-16 19:32:46 +01:00
|
|
|
|
2013-12-08 12:35:40 +01:00
|
|
|
/**
|
|
|
|
|
* @defgroup base Initialization and manipulation of libinput contexts
|
|
|
|
|
*/
|
|
|
|
|
|
2013-11-17 19:31:34 +01:00
|
|
|
struct libinput_interface {
|
2013-12-13 11:04:01 +10:00
|
|
|
/**
|
|
|
|
|
* Open the device at the given path with the flags provided and
|
|
|
|
|
* return the fd.
|
|
|
|
|
*
|
|
|
|
|
* @param path The device path to open
|
|
|
|
|
* @param flags Flags as defined by open(2)
|
|
|
|
|
* @param user_data The user_data provided in
|
|
|
|
|
* libinput_create_from_udev()
|
|
|
|
|
*
|
|
|
|
|
* @return the file descriptor, or a negative errno on failure.
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
int (*open_restricted)(const char *path, int flags, void *user_data);
|
2013-12-13 11:04:01 +10:00
|
|
|
/**
|
|
|
|
|
* Close the file descriptor.
|
|
|
|
|
*
|
|
|
|
|
* @param fd The file descriptor to close
|
|
|
|
|
* @param user_data The user_data provided in
|
|
|
|
|
* libinput_create_from_udev()
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
void (*close_restricted)(int fd, void *user_data);
|
|
|
|
|
|
2013-11-17 19:31:34 +01:00
|
|
|
void (*get_current_screen_dimensions)(struct libinput_device *device,
|
|
|
|
|
int *width,
|
2013-11-10 17:55:40 +01:00
|
|
|
int *height,
|
2013-11-17 19:31:34 +01:00
|
|
|
void *user_data);
|
2013-11-10 17:55:40 +01:00
|
|
|
};
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* Create a new libinput context from udev, for input devices matching
|
|
|
|
|
* the given seat ID. New devices or devices removed will appear as events
|
|
|
|
|
* during libinput_dispatch.
|
|
|
|
|
*
|
|
|
|
|
* @param interface The callback interface
|
|
|
|
|
* @param user_data Caller-specific data passed to the various callback
|
|
|
|
|
* interfaces.
|
|
|
|
|
* @param udev An already initialized udev context
|
|
|
|
|
* @param seat_id A seat identifier. This string must not be NULL.
|
|
|
|
|
*
|
2013-12-10 11:33:29 +10:00
|
|
|
* @return An initialized libinput context, ready to handle events or NULL on
|
2013-12-06 09:58:00 +10:00
|
|
|
* error.
|
|
|
|
|
*/
|
2013-11-17 11:19:50 +01:00
|
|
|
struct libinput *
|
2013-12-05 18:35:32 +10:00
|
|
|
libinput_create_from_udev(const struct libinput_interface *interface,
|
|
|
|
|
void *user_data,
|
|
|
|
|
struct udev *udev,
|
|
|
|
|
const char *seat_id);
|
2013-12-10 13:20:36 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* Create a new libinput context from the given path. This context
|
|
|
|
|
* represents one single device only, it will not respond to new devices
|
|
|
|
|
* being added and reading from the device after it was removed will fail.
|
|
|
|
|
*
|
|
|
|
|
* @param interface The callback interface
|
|
|
|
|
* @param user_data Caller-specific data passed to the various callback
|
|
|
|
|
* interfaces.
|
|
|
|
|
* @param path Path to an input device
|
|
|
|
|
*
|
|
|
|
|
* @return An initialized libinput context, ready to handle events or NULL on
|
|
|
|
|
* error.
|
|
|
|
|
*/
|
|
|
|
|
struct libinput *
|
|
|
|
|
libinput_create_from_path(const struct libinput_interface *interface,
|
|
|
|
|
void *user_data,
|
|
|
|
|
const char *path);
|
2013-11-10 17:55:40 +01:00
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* libinput keeps a single file descriptor for all events. Call into
|
|
|
|
|
* libinput_dispatch() if any events become available on this fd.
|
|
|
|
|
*
|
|
|
|
|
* @return the file descriptor used to notify of pending events.
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
int
|
2013-11-17 11:19:50 +01:00
|
|
|
libinput_get_fd(struct libinput *libinput);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* Main event dispatchment function. Reads events of the file descriptors
|
2013-12-13 17:50:49 +10:00
|
|
|
* and processes them internally. Use libinput_get_event() to retrieve the
|
2013-12-06 09:58:00 +10:00
|
|
|
* events.
|
|
|
|
|
*
|
2013-12-30 22:08:35 +01:00
|
|
|
* Dispatching does not necessarily queue libinput events.
|
|
|
|
|
*
|
2013-12-06 09:58:00 +10:00
|
|
|
* @param libinput A previously initialized libinput context
|
|
|
|
|
*
|
|
|
|
|
* @return 0 on success, or a negative errno on failure
|
|
|
|
|
*/
|
2013-11-17 11:19:50 +01:00
|
|
|
int
|
|
|
|
|
libinput_dispatch(struct libinput *libinput);
|
2013-11-10 17:55:40 +01:00
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* Retrieve the next event from libinput's internal event queue.
|
|
|
|
|
*
|
2013-12-07 16:41:43 +01:00
|
|
|
* After handling the retrieved event, the caller must destroy it using
|
|
|
|
|
* libinput_event_destroy().
|
2013-12-07 14:06:55 +01:00
|
|
|
*
|
2013-12-06 09:58:00 +10:00
|
|
|
* @param libinput A previously initialized libinput context
|
|
|
|
|
* @return The next available event, or NULL if no event is available.
|
|
|
|
|
*/
|
2013-11-16 19:32:46 +01:00
|
|
|
struct libinput_event *
|
2013-11-17 11:19:50 +01:00
|
|
|
libinput_get_event(struct libinput *libinput);
|
|
|
|
|
|
2013-12-13 17:58:50 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* Return the type of the next event in the internal queue. This function
|
|
|
|
|
* does not pop the event off the queue and the next call to
|
|
|
|
|
* libinput_get_event() returns that event.
|
|
|
|
|
*
|
|
|
|
|
* @param libinput A previously initialized libinput context
|
|
|
|
|
* @return The event type of the next available event or LIBINPUT_EVENT_NONE
|
|
|
|
|
* if no event is availble.
|
|
|
|
|
*/
|
|
|
|
|
enum libinput_event_type
|
|
|
|
|
libinput_next_event_type(struct libinput *libinput);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* @param libinput A previously initialized libinput context
|
|
|
|
|
* @return the caller-specific data previously assigned in
|
|
|
|
|
* libinput_create_udev().
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
void *
|
|
|
|
|
libinput_get_user_data(struct libinput *libinput);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* Resume a suspended libinput context. This re-enables device
|
|
|
|
|
* monitoring and adds existing devices.
|
|
|
|
|
*
|
|
|
|
|
* @param libinput A previously initialized libinput context
|
|
|
|
|
* @see libinput_suspend
|
|
|
|
|
*
|
|
|
|
|
* @return 0 on success or -1 on failure
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
int
|
|
|
|
|
libinput_resume(struct libinput *libinput);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
|
|
|
|
* Suspend monitoring for new devices and close existing devices.
|
|
|
|
|
* This all but terminates libinput but does keep the context
|
|
|
|
|
* valid to be resumed with libinput_resume().
|
|
|
|
|
*
|
|
|
|
|
* @param libinput A previously initialized libinput context
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
void
|
|
|
|
|
libinput_suspend(struct libinput *libinput);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup base
|
|
|
|
|
*
|
2013-12-31 16:11:03 +01:00
|
|
|
* Destroy the libinput context. After this, object references associated with
|
|
|
|
|
* the destroyed context are invalid and may not be interacted with.
|
2013-12-06 09:58:00 +10:00
|
|
|
*
|
|
|
|
|
* @param libinput A previously initialized libinput context
|
|
|
|
|
*/
|
2013-11-17 11:19:50 +01:00
|
|
|
void
|
|
|
|
|
libinput_destroy(struct libinput *libinput);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @defgroup seat Initialization and manipulation of seats
|
2014-01-15 17:04:00 +10:00
|
|
|
*
|
|
|
|
|
* A seat has two identifiers, the physical name and the logical name. The
|
|
|
|
|
* physical name is summarized as the list of devices a process on the same
|
|
|
|
|
* physical seat has access to.
|
|
|
|
|
*
|
|
|
|
|
* The logical seat name is the seat name for a logical group of devices. A
|
|
|
|
|
* compositor may use that to create additonal seats as independent device
|
|
|
|
|
* sets. Alternatively, a compositor may limit itself to a single logical
|
|
|
|
|
* seat, leaving a second compositor to manage devices on the other logical
|
|
|
|
|
* seats.
|
|
|
|
|
*
|
|
|
|
|
* @code
|
|
|
|
|
* +---+--------+------------+------------------------+------------+
|
|
|
|
|
* | | event0 | | | log seat A |
|
|
|
|
|
* | K +--------+ | +------------+
|
|
|
|
|
* | e | event1 | phys seat0 | libinput context 1 | |
|
|
|
|
|
* | r +--------+ | | log seat B |
|
|
|
|
|
* | n | event2 | | | |
|
|
|
|
|
* | e +--------+------------+------------------------+------------+
|
|
|
|
|
* | l | event3 | phys seat1 | libinput context 2 | log seat C |
|
|
|
|
|
* +---+--------+------------+------------------------+------------+
|
|
|
|
|
* @endcode
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
*/
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup seat
|
|
|
|
|
*
|
|
|
|
|
* Increase the refcount of the seat. A seat will be freed whenever the
|
|
|
|
|
* refcount reaches 0. This may happen during dispatch if the
|
|
|
|
|
* seat was removed from the system. A caller must ensure to reference
|
|
|
|
|
* the seat correctly to avoid dangling pointers.
|
|
|
|
|
*
|
|
|
|
|
* @param seat A previously obtained seat
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
void
|
|
|
|
|
libinput_seat_ref(struct libinput_seat *seat);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup seat
|
|
|
|
|
*
|
|
|
|
|
* Decrease the refcount of the seat. A seat will be freed whenever the
|
|
|
|
|
* refcount reaches 0. This may happen during dispatch if the
|
|
|
|
|
* seat was removed from the system. A caller must ensure to reference
|
|
|
|
|
* the seat correctly to avoid dangling pointers.
|
|
|
|
|
*
|
|
|
|
|
* @param seat A previously obtained seat
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
void
|
|
|
|
|
libinput_seat_unref(struct libinput_seat *seat);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup seat
|
|
|
|
|
*
|
|
|
|
|
* Set caller-specific data associated with this seat. libinput does
|
|
|
|
|
* not manage, look at, or modify this data. The caller must ensure the
|
|
|
|
|
* data is valid.
|
|
|
|
|
*
|
|
|
|
|
* @param seat A previously obtained seat
|
|
|
|
|
* @param user_data Caller-specific data pointer
|
|
|
|
|
* @see libinput_seat_get_user_data
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
void
|
|
|
|
|
libinput_seat_set_user_data(struct libinput_seat *seat, void *user_data);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup seat
|
|
|
|
|
*
|
|
|
|
|
* Get the caller-specific data associated with this seat, if any.
|
|
|
|
|
*
|
|
|
|
|
* @param seat A previously obtained seat
|
|
|
|
|
* @return Caller-specific data pointer or NULL if none was set
|
|
|
|
|
* @see libinput_seat_set_user_data
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
void *
|
|
|
|
|
libinput_seat_get_user_data(struct libinput_seat *seat);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup seat
|
|
|
|
|
*
|
2014-01-15 17:04:00 +10:00
|
|
|
* Return the physical name of the seat. For libinput contexts created from
|
|
|
|
|
* udev, this is always the same value as passed into
|
|
|
|
|
* libinput_create_from_udev() and all seats from that context will have the
|
|
|
|
|
* same physical name.
|
|
|
|
|
*
|
|
|
|
|
* The physical name of the seat is one that is usually set by the system or
|
|
|
|
|
* lower levels of the stack. In most cases, this is the base filter for
|
|
|
|
|
* devices - devices assigned to seats outside the current seat will not
|
|
|
|
|
* be available to the caller.
|
|
|
|
|
*
|
|
|
|
|
* @param seat A previously obtained seat
|
|
|
|
|
* @return the physical name of this seat
|
|
|
|
|
*/
|
|
|
|
|
const char *
|
|
|
|
|
libinput_seat_get_physical_name(struct libinput_seat *seat);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ingroup seat
|
|
|
|
|
*
|
|
|
|
|
* Return the logical name of the seat. This is an identifier to group sets
|
|
|
|
|
* of devices within the compositor.
|
|
|
|
|
*
|
2013-12-06 09:58:00 +10:00
|
|
|
* @param seat A previously obtained seat
|
2014-01-15 17:04:00 +10:00
|
|
|
* @return the logical name of this seat
|
2013-12-06 09:58:00 +10:00
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
const char *
|
2014-01-15 17:04:00 +10:00
|
|
|
libinput_seat_get_logical_name(struct libinput_seat *seat);
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @defgroup device Initialization and manipulation of input devices
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
*/
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Increase the refcount of the input device. An input device will be freed
|
|
|
|
|
* whenever the refcount reaches 0. This may happen during dispatch if the
|
|
|
|
|
* device was removed from the system. A caller must ensure to reference
|
|
|
|
|
* the device correctly to avoid dangling pointers.
|
|
|
|
|
*
|
|
|
|
|
* @param device A previously obtained device
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
void
|
|
|
|
|
libinput_device_ref(struct libinput_device *device);
|
2013-11-16 19:32:46 +01:00
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Decrease the refcount of the input device. An input device will be freed
|
|
|
|
|
* whenever the refcount reaches 0. This may happen during dispatch if the
|
|
|
|
|
* device was removed from the system. A caller must ensure to reference
|
|
|
|
|
* the device correctly to avoid dangling pointers.
|
|
|
|
|
*
|
|
|
|
|
* @param device A previously obtained device
|
|
|
|
|
*/
|
2013-11-17 16:59:09 +01:00
|
|
|
void
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
libinput_device_unref(struct libinput_device *device);
|
2013-11-17 16:59:09 +01:00
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Set caller-specific data associated with this input device. libinput does
|
|
|
|
|
* not manage, look at, or modify this data. The caller must ensure the
|
|
|
|
|
* data is valid.
|
|
|
|
|
*
|
|
|
|
|
* @param device A previously obtained device
|
|
|
|
|
* @param user_data Caller-specific data pointer
|
|
|
|
|
* @see libinput_device_get_user_data
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
void
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
libinput_device_set_user_data(struct libinput_device *device, void *user_data);
|
2013-11-10 17:55:40 +01:00
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Get the caller-specific data associated with this input device, if any.
|
|
|
|
|
*
|
|
|
|
|
* @param device A previously obtained device
|
|
|
|
|
* @return Caller-specific data pointer or NULL if none was set
|
|
|
|
|
* @see libinput_device_set_user_data
|
|
|
|
|
*/
|
2013-11-17 11:19:50 +01:00
|
|
|
void *
|
|
|
|
|
libinput_device_get_user_data(struct libinput_device *device);
|
|
|
|
|
|
2013-12-15 17:50:04 +01:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Get the system name of the device.
|
|
|
|
|
*
|
|
|
|
|
* @param device A previously obtained device
|
|
|
|
|
* @return System name of the device
|
|
|
|
|
*/
|
|
|
|
|
const char *
|
|
|
|
|
libinput_device_get_sysname(struct libinput_device *device);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* A device may be mapped to a single output, or all available outputs. If a
|
|
|
|
|
* device is mapped to a single output only, a relative device may not move
|
|
|
|
|
* beyond the boundaries of this output. An absolute device has its input
|
|
|
|
|
* coordinates mapped to the extents of this output.
|
|
|
|
|
*
|
|
|
|
|
* @return the name of the output this device is mapped to, or NULL if no
|
|
|
|
|
* output is set
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
const char *
|
|
|
|
|
libinput_device_get_output_name(struct libinput_device *device);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Get the seat associated with this input device.
|
|
|
|
|
*
|
|
|
|
|
* @param device A previously obtained device
|
|
|
|
|
* @return The seat this input device belongs to
|
|
|
|
|
*/
|
Port udev-seat to be used in libinput
This patch ports udev-seat from weston to libinput, including adapting
libinput internals and API to provide seat and device discovery.
The public API is extended with device discovery, object reference, a
seat object. As libinput takes care of creating and destroying its
objects user data getter/setter is added in order to make it possible
for the client to directly associate an object application side with an
object library side.
Device discovery API is made up of the 'seat added', 'seat removed',
'device added' and 'device removed' events. The seat added/removed
events contains a pointer to a libinput_seat struct, while the device
added/removed events contains a pointer to a libinput_device event.
The objects are reference counted with libinput holding one reference by
default. The application can increase the reference count with
libinput_seat_ref() and libinput_device_ref() and decrease the reference
count with libinput_seat_unref() and libinput_device_unref().
The basic event struct is changed to have a 'target' union parameter
that can be either a libinput, libinput_seat or libinput_device struct
pointer.
There is one known problem with the current API that is the potentially
racy initialization.
The problem is when a device is both discovered and lost during initial
dispatchig, causing libinput to first queue a 'added' message, creating
the device with default reference count 1, then before going back to the
application queuing a 'removed' message, while at same time decreasing
reference count of the device to 0, causing it o be destroyed. The queue
will at this state contain two messages with pointers to free:ed memory.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2013-11-23 13:04:32 +01:00
|
|
|
struct libinput_seat *
|
|
|
|
|
libinput_device_get_seat(struct libinput_device *device);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Update the LEDs on the device, if any. If the device does not have
|
|
|
|
|
* LEDs, or does not have one or more of the LEDs given in the mask, this
|
|
|
|
|
* function does nothing.
|
|
|
|
|
*
|
|
|
|
|
* @param device A previously obtained device
|
|
|
|
|
* @param leds A mask of the LEDs to set, or unset.
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
void
|
|
|
|
|
libinput_device_led_update(struct libinput_device *device,
|
|
|
|
|
enum libinput_led leds);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Set the bitmask in keys to the bitmask of the keys present on the device
|
|
|
|
|
* (see linux/input.h), up to size characters.
|
|
|
|
|
*
|
|
|
|
|
* @param device A current input device
|
|
|
|
|
* @param keys An array filled with the bitmask for the keys
|
|
|
|
|
* @param size Size of the keys array
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
int
|
|
|
|
|
libinput_device_get_keys(struct libinput_device *device,
|
|
|
|
|
char *keys, size_t size);
|
|
|
|
|
|
2013-12-06 09:58:00 +10:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Apply the 3x3 transformation matrix to absolute device coordinates. This
|
|
|
|
|
* matrix has no effect on relative events.
|
|
|
|
|
*
|
|
|
|
|
* Given a 6-element array [a, b, c, d, e, f], the matrix is applied as
|
|
|
|
|
* @code
|
|
|
|
|
* [ a b c ] [ x ]
|
|
|
|
|
* [ d e f ] * [ y ]
|
|
|
|
|
* [ 0 0 1 ] [ 1 ]
|
|
|
|
|
* @endcode
|
|
|
|
|
*/
|
2013-11-10 17:55:40 +01:00
|
|
|
void
|
|
|
|
|
libinput_device_calibrate(struct libinput_device *device,
|
|
|
|
|
float calibration[6]);
|
|
|
|
|
|
2013-12-15 17:45:02 +01:00
|
|
|
/**
|
|
|
|
|
* @ingroup device
|
|
|
|
|
*
|
|
|
|
|
* Check if the given device has the specified capability
|
|
|
|
|
*
|
|
|
|
|
* @return 1 if the given device has the capability or 0 if not
|
|
|
|
|
*/
|
|
|
|
|
int
|
|
|
|
|
libinput_device_has_capability(struct libinput_device *device,
|
|
|
|
|
enum libinput_device_capability capability);
|
|
|
|
|
|
2013-11-10 17:55:40 +01:00
|
|
|
#endif /* LIBINPUT_H */
|