diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-08-27 13:33:37 +1000 |
|---|---|---|
| committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-09-10 11:25:09 +1000 |
| commit | ab2f20bfd6ad632b1ab5c41a0aac54d8bf2e0bc3 (patch) | |
| tree | 3d638f2b951faa74bb6bc4c4dd917e10df86c605 /libevdev/libevdev.h | |
| parent | 14ac764ec86452ca607403f314b0f8355d80290c (diff) | |
| download | libevdev-ab2f20bfd6ad632b1ab5c41a0aac54d8bf2e0bc3.tar.gz | |
Revamp the API once again
Another look at the current API showed some inconsistencies, rectified
in this commit:
libevdev_kernel_*: modify the underlying kernel device
libevdev_event_type_*: something with an event type
libevdev_event_code_*: something with an event code
libevdev_event_*: struct input_event-related functions (i.e. not device-related)
libevdev_property_*: something with a property
libevdev_*: anything applying to a device
Hopefully that's the last API change. Current symbols deprecated and aliased.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Diffstat (limited to 'libevdev/libevdev.h')
| -rw-r--r-- | libevdev/libevdev.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/libevdev/libevdev.h b/libevdev/libevdev.h index 82142d6..472e1b9 100644 --- a/libevdev/libevdev.h +++ b/libevdev/libevdev.h @@ -1255,7 +1255,7 @@ int libevdev_kernel_set_led_values(struct libevdev *dev, ...); * @return 1 if the event type matches the given type, 0 otherwise (or if * type is invalid) */ -int libevdev_is_event_type(const struct input_event *ev, unsigned int type); +int libevdev_event_is_type(const struct input_event *ev, unsigned int type); /** * @ingroup misc @@ -1280,7 +1280,7 @@ int libevdev_is_event_type(const struct input_event *ev, unsigned int type); * @return 1 if the event type matches the given type and code, 0 otherwise * (or if type/code are invalid) */ -int libevdev_is_event_code(const struct input_event *ev, unsigned int type, unsigned int code); +int libevdev_event_is_code(const struct input_event *ev, unsigned int type, unsigned int code); /** * @ingroup misc @@ -1293,7 +1293,7 @@ int libevdev_is_event_code(const struct input_event *ev, unsigned int type, unsi * @note The list of names is compiled into libevdev. If the kernel adds new * defines for new properties libevdev will not automatically pick these up. */ -const char * libevdev_get_event_type_name(unsigned int type); +const char * libevdev_event_type_get_name(unsigned int type); /** * @ingroup misc * @@ -1306,7 +1306,7 @@ const char * libevdev_get_event_type_name(unsigned int type); * @note The list of names is compiled into libevdev. If the kernel adds new * defines for new properties libevdev will not automatically pick these up. */ -const char * libevdev_get_event_code_name(unsigned int type, unsigned int code); +const char * libevdev_event_code_get_name(unsigned int type, unsigned int code); /** * @ingroup misc @@ -1319,9 +1319,9 @@ const char * libevdev_get_event_code_name(unsigned int type, unsigned int code); * @note The list of names is compiled into libevdev. If the kernel adds new * defines for new properties libevdev will not automatically pick these up. * @note On older kernels input properties may not be defined and - * libevdev_get_input_prop_name() will always return NULL + * libevdev_property_get_name() will always return NULL */ -const char* libevdev_get_property_name(unsigned int prop); +const char* libevdev_property_get_name(unsigned int prop); /** * @ingroup misc @@ -1335,7 +1335,7 @@ const char* libevdev_get_property_name(unsigned int prop); * @note The max value is compiled into libevdev. If the kernel changes the * max value, libevdev will not automatically pick these up. */ -int libevdev_get_event_type_max(unsigned int type); +int libevdev_event_type_get_max(unsigned int type); /** * @ingroup bits @@ -1363,8 +1363,26 @@ int libevdev_get_repeat(struct libevdev *dev, int *delay, int *period); /* replacement: libevdev_kernel_set_abs_info */ int libevdev_kernel_set_abs_value(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs) LIBEVDEV_DEPRECATED; + /* replacement: libevdev_set_log_function */ void libevdev_set_log_handler(struct libevdev *dev, libevdev_log_func_t logfunc) LIBEVDEV_DEPRECATED; + +/** replacement: libevdev_event_type_get_max */ +int libevdev_get_event_type_max(unsigned int type) LIBEVDEV_DEPRECATED; + +/** replacement: libevdev_property_get_name */ +const char* libevdev_get_property_name(unsigned int prop); + +/** replacement: libevdev_event_type_get_name */ +const char * libevdev_get_event_type_name(unsigned int type) LIBEVDEV_DEPRECATED; +/** replacement: libevdev_event_code_get_name */ +const char * libevdev_get_event_code_name(unsigned int type, unsigned int code) LIBEVDEV_DEPRECATED; + +/** replacement: libevdev_event_is_type */ +int libevdev_is_event_type(const struct input_event *ev, unsigned int type); + +/** replacement: libevdev_event_is_code */ +int libevdev_is_event_code(const struct input_event *ev, unsigned int type, unsigned int code); /**************************************/ #ifdef __cplusplus |
