eloop: move prefix to "ev_" instead of "kmscon_"
[platform/upstream/kmscon.git] / src / input.h
index 9b70e31..417a9f6 100644 (file)
@@ -30,7 +30,7 @@
  * Its use should be as simple as the following (but also see below):
  * - Create a new input object.
  * - Provide a callback function to receive the events.
- * - Connect the input object to a kmscon_eloop.
+ * - Connect the input object to a ev_eloop.
  * - Wake up the input object to begin receiving input events through the
  *   event loop.
  *
@@ -49,6 +49,7 @@
 #define KMSCON_INPUT_H
 
 #include <inttypes.h>
+#include <limits.h>
 #include <stdbool.h>
 #include "eloop.h"
 
@@ -82,11 +83,17 @@ void kmscon_input_ref(struct kmscon_input *input);
 void kmscon_input_unref(struct kmscon_input *input);
 
 int kmscon_input_connect_eloop(struct kmscon_input *input,
-               struct kmscon_eloop *eloop, kmscon_input_cb cb, void *data);
+               struct ev_eloop *eloop, kmscon_input_cb cb, void *data);
 void kmscon_input_disconnect_eloop(struct kmscon_input *input);
 
 void kmscon_input_sleep(struct kmscon_input *input);
 void kmscon_input_wake_up(struct kmscon_input *input);
 bool kmscon_input_is_asleep(struct kmscon_input *input);
 
+/* Querying the results of evdev ioctl's. Also used by kbd backends. */
+static inline bool kmscon_evdev_bit_is_set(const unsigned long *array, int bit)
+{
+       return !!(array[bit / LONG_BIT] & (1LL << (bit % LONG_BIT)));
+}
+
 #endif /* KMSCON_INPUT_H */