]> Pileus Git - ~andy/gtk/commitdiff
gdk: add bindings-friendly alias for GDK_EVENT_2BUTTON_PRESS
authorDan Winship <danw@gnome.org>
Fri, 2 Mar 2012 15:33:52 +0000 (10:33 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 4 May 2012 01:22:39 +0000 (21:22 -0400)
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

index 73c9e83dec2ff3c154b5d5384664e83e5e4e7bab..7557c4ca69f03a4088efce55de399176c69aac0a 100644 (file)
@@ -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,