[gtk+] gdk: add bindings-friendly alias for GDK_EVENT_2BUTTON_PRESS



commit 154ce014a8ff6961ace3a78359f3ca9aed2e681b
Author: Dan Winship <danw gnome org>
Date:   Fri Mar 2 10:33:52 2012 -0500

    gdk: add bindings-friendly alias for GDK_EVENT_2BUTTON_PRESS
    
    GDK_EVENT_2BUTTON_PRESS and GDK_EVENT_3BUTTON_PRESS can't be used from
    some bindings because they'd translate to something syntactically
    invalid. Add GDK_EVENT_DOUBLE_BUTTON_PRESS and
    GDK_EVENT_TRIPLE_BUTTON_PRESS aliases to work around that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671025

 gdk/gdkevents.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index 73c9e83..7557c4c 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -225,8 +225,10 @@ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
  * @GDK_2BUTTON_PRESS: a mouse button has been double-clicked (clicked twice
  *   within a short period of time). Note that each click also generates a
  *   %GDK_BUTTON_PRESS event.
+ * @GDK_DOUBLE_BUTTON_PRESS: alias for %GDK_2BUTTON_PRESS, added in 3.6.
  * @GDK_3BUTTON_PRESS: a mouse button has been clicked 3 times in a short period
  *   of time. Note that each click also generates a %GDK_BUTTON_PRESS event.
+ * @GDK_TRIPLE_BUTTON_PRESS: alias for %GDK_3BUTTON_PRESS, added in 3.6.
  * @GDK_BUTTON_RELEASE: a mouse button has been released.
  * @GDK_KEY_PRESS: a key has been pressed.
  * @GDK_KEY_RELEASE: a key has been released.
@@ -280,6 +282,13 @@ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent,
  * Do not confuse these events with the signals that GTK+ widgets emit.
  * Although many of these events result in corresponding signals being emitted,
  * the events are often transformed or filtered along the way.
+ *
+ * In some language bindings, the values %GDK_2BUTTON_PRESS and
+ * %GDK_3BUTTON_PRESS would translate into something syntactically
+ * invalid (eg <literal>Gdk.EventType.2ButtonPress</literal>, where a
+ * symbol is not allowed to start with a number). In that case, the
+ * aliases %GDK_DOUBLE_BUTTON_PRESS and %GDK_TRIPLE_BUTTON_PRESS can
+ * be used instead.
  */
 typedef enum
 {
@@ -290,7 +299,9 @@ typedef enum
   GDK_MOTION_NOTIFY	= 3,
   GDK_BUTTON_PRESS	= 4,
   GDK_2BUTTON_PRESS	= 5,
+  GDK_DOUBLE_BUTTON_PRESS = GDK_2BUTTON_PRESS,
   GDK_3BUTTON_PRESS	= 6,
+  GDK_TRIPLE_BUTTON_PRESS = GDK_3BUTTON_PRESS,
   GDK_BUTTON_RELEASE	= 7,
   GDK_KEY_PRESS		= 8,
   GDK_KEY_RELEASE	= 9,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]