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
This commit is contained in:
Emmanuele Bassi 2010-08-26 16:36:59 +01:00
parent 550d5ab621
commit 36d45b660f
3 changed files with 23 additions and 2 deletions

View File

@ -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;
}

View File

@ -94,6 +94,8 @@ struct _ClutterClickActionClass
GType clutter_click_action_get_type (void) G_GNUC_CONST;
ClutterAction *clutter_click_action_new (void);
guint clutter_click_action_get_button (ClutterClickAction *action);
void clutter_click_action_release (ClutterClickAction *action);
G_END_DECLS

View File

@ -2346,6 +2346,7 @@ ClutterStatePrivate
ClutterClickAction
ClutterClickActionClass
clutter_click_action_new
clutter_click_action_get_button
clutter_click_action_release
<SUBSECTION Standard>