event: Add symbolic names for left, middle, and right buttons

Symbolic names are better than magic numbers, even if they are
well-established and won't likely change.

This maps to a commit in GTK+ that introduced the same names; it
was decided to go for PRIMARY, MIDDLE, and SECONDARY because of
the confusion that may arise when the button order gets flipped
in left-handed configurations - the "left" button (i.e. 1) becomes
the right-most button, and the "right" button (i.e. 3) becomes
the left-most button.

https://bugzilla.gnome.org/show_bug.cgi?id=668692
This commit is contained in:
Emmanuele Bassi 2012-01-27 09:43:06 +00:00
parent 90397bf06c
commit 60cddbd28e

View File

@ -33,7 +33,7 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define CLUTTER_TYPE_EVENT (clutter_event_get_type ()) #define CLUTTER_TYPE_EVENT (clutter_event_get_type ())
/** /**
* CLUTTER_PRIORITY_EVENTS: * CLUTTER_PRIORITY_EVENTS:
@ -42,7 +42,7 @@ G_BEGIN_DECLS
* *
* Since: 0.4 * Since: 0.4
*/ */
#define CLUTTER_PRIORITY_EVENTS (G_PRIORITY_DEFAULT) #define CLUTTER_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
/** /**
* CLUTTER_CURRENT_TIME: * CLUTTER_CURRENT_TIME:
@ -51,7 +51,7 @@ G_BEGIN_DECLS
* *
* Since: 0.4 * Since: 0.4
*/ */
#define CLUTTER_CURRENT_TIME 0L #define CLUTTER_CURRENT_TIME (0L)
/** /**
* CLUTTER_EVENT_PROPAGATE: * CLUTTER_EVENT_PROPAGATE:
@ -61,7 +61,7 @@ G_BEGIN_DECLS
* *
* Since: 1.10 * Since: 1.10
*/ */
#define CLUTTER_EVENT_PROPAGATE FALSE #define CLUTTER_EVENT_PROPAGATE (FALSE)
/** /**
* CLUTTER_EVENT_STOP: * CLUTTER_EVENT_STOP:
@ -71,7 +71,40 @@ G_BEGIN_DECLS
* *
* Since: 1.10 * Since: 1.10
*/ */
#define CLUTTER_EVENT_STOP TRUE #define CLUTTER_EVENT_STOP (TRUE)
/**
* CLUTTER_BUTTON_PRIMARY:
*
* The primary button of a pointer device.
*
* This is typically the left mouse button in a right-handed
* mouse configuration.
*
* Since: 1.10
*/
#define CLUTTER_BUTTON_PRIMARY (1)
/**
* CLUTTER_BUTTON_MIDDLE:
*
* The middle button of a pointer device.
*
* Since: 1.10
*/
#define CLUTTER_BUTTON_MIDDLE (2)
/**
* CLUTTER_BUTTON_SECONDARY:
*
* The secondary button of a pointer device.
*
* This is typically the right mouse button in a right-handed
* mouse configuration.
*
* Since: 1.10
*/
#define CLUTTER_BUTTON_SECONDARY (3)
typedef struct _ClutterAnyEvent ClutterAnyEvent; typedef struct _ClutterAnyEvent ClutterAnyEvent;
typedef struct _ClutterButtonEvent ClutterButtonEvent; typedef struct _ClutterButtonEvent ClutterButtonEvent;