[clutter] event: Expose is-pointer-emulated flag
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] event: Expose is-pointer-emulated flag
- Date: Fri, 20 Jul 2012 01:58:30 +0000 (UTC)
commit 1c03be7346ba0c72518ee1972674007a2417c2a2
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Jul 18 10:32:53 2012 -0400
event: Expose is-pointer-emulated flag
Clutter on X11 already stores this flag to distinguish between events
that have been synthesized by the X server and real events.
https://bugzilla.gnome.org/show_bug.cgi?id=680174
clutter/clutter-event.c | 23 +++++++++++++++++++++++
clutter/clutter-event.h | 2 ++
clutter/clutter.symbols | 1 +
3 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-event.c b/clutter/clutter-event.c
index 48e7aee..e963c28 100644
--- a/clutter/clutter-event.c
+++ b/clutter/clutter-event.c
@@ -1627,3 +1627,26 @@ clutter_event_has_control_modifier (const ClutterEvent *event)
{
return (clutter_event_get_state (event) & CLUTTER_CONTROL_MASK) != FALSE;
}
+
+/**
+ * clutter_event_is_pointer_emulated:
+ * @event: a #ClutterEvent
+ *
+ * Checks whether a pointer @event has been generated by the windowing
+ * system. The returned value can be used to distinguish between events
+ * synthesized by the windowing system itself (as opposed by Clutter).
+ *
+ * Return value: %TRUE if the event is pointer emulated
+ *
+ * Since: 1.12
+ */
+gboolean
+clutter_event_is_pointer_emulated (const ClutterEvent *event)
+{
+ g_return_val_if_fail (event != NULL, FALSE);
+
+ if (!is_event_allocated (event))
+ return FALSE;
+
+ return ((ClutterEventPrivate *) event)->is_pointer_emulated;
+}
diff --git a/clutter/clutter-event.h b/clutter/clutter-event.h
index 0569b13..34566c7 100644
--- a/clutter/clutter-event.h
+++ b/clutter/clutter-event.h
@@ -460,6 +460,8 @@ CLUTTER_AVAILABLE_IN_1_12
gboolean clutter_event_has_shift_modifier (const ClutterEvent *event);
CLUTTER_AVAILABLE_IN_1_12
gboolean clutter_event_has_control_modifier (const ClutterEvent *event);
+CLUTTER_AVAILABLE_IN_1_12
+gboolean clutter_event_is_pointer_emulated (const ClutterEvent *event);
void clutter_event_set_key_symbol (ClutterEvent *event,
guint key_sym);
diff --git a/clutter/clutter.symbols b/clutter/clutter.symbols
index d3a5dd2..22a4b8d 100644
--- a/clutter/clutter.symbols
+++ b/clutter/clutter.symbols
@@ -670,6 +670,7 @@ clutter_event_get_time
clutter_event_get
clutter_event_has_control_modifier
clutter_event_has_shift_modifier
+clutter_event_is_pointer_emulated
clutter_event_new
clutter_event_peek
clutter_event_put
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]