From 36d45b660fc86619345bfe4f2837037f3a164d5d Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 26 Aug 2010 16:36:59 +0100 Subject: [PATCH] click-action: Add get_button() Allow retrieving the pointer button that caused the ::clicked signal to be emitted. http://bugzilla.clutter-project.org/show_bug.cgi?id=2287 --- clutter/clutter-click-action.c | 18 ++++++++++++++++++ clutter/clutter-click-action.h | 6 ++++-- doc/reference/clutter/clutter-sections.txt | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/clutter/clutter-click-action.c b/clutter/clutter-click-action.c index c63621427..116e75e5f 100644 --- a/clutter/clutter-click-action.c +++ b/clutter/clutter-click-action.c @@ -332,3 +332,21 @@ clutter_click_action_release (ClutterClickAction *action) click_action_set_pressed (action, FALSE); } + +/** + * clutter_click_action_get_button: + * @action: a #ClutterClickAction + * + * Retrieves the button that was pressed. + * + * Return value: the button value + * + * Since: 1.4 + */ +guint +clutter_click_action_get_button (ClutterClickAction *action) +{ + g_return_val_if_fail (CLUTTER_IS_CLICK_ACTION (action), 0); + + return action->priv->press_button; +} diff --git a/clutter/clutter-click-action.h b/clutter/clutter-click-action.h index 1735bf711..6b2aa7137 100644 --- a/clutter/clutter-click-action.h +++ b/clutter/clutter-click-action.h @@ -93,8 +93,10 @@ struct _ClutterClickActionClass GType clutter_click_action_get_type (void) G_GNUC_CONST; -ClutterAction *clutter_click_action_new (void); -void clutter_click_action_release (ClutterClickAction *action); +ClutterAction *clutter_click_action_new (void); + +guint clutter_click_action_get_button (ClutterClickAction *action); +void clutter_click_action_release (ClutterClickAction *action); G_END_DECLS diff --git a/doc/reference/clutter/clutter-sections.txt b/doc/reference/clutter/clutter-sections.txt index 1de42ca16..4cffc258b 100644 --- a/doc/reference/clutter/clutter-sections.txt +++ b/doc/reference/clutter/clutter-sections.txt @@ -2346,6 +2346,7 @@ ClutterStatePrivate ClutterClickAction ClutterClickActionClass clutter_click_action_new +clutter_click_action_get_button clutter_click_action_release