## ClutterClickAction ClutterClickAction — Action for clickable actors |

## Synopsis

    struct              ClutterClickAction;
    struct              ClutterClickActionClass;
    ClutterAction *     clutter_click_action_new            (void);
    guint               clutter_click_action_get_button     (ClutterClickAction *action);
    ClutterModifierType  clutter_click_action_get_state     (ClutterClickAction *action);

    void                clutter_click_action_release        (ClutterClickAction *action);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterActorMeta
                   +----ClutterAction
                         +----ClutterClickAction

## Properties

      "held"                     gboolean              : Read
      "pressed"                  gboolean              : Read

## Signals

      "clicked"                                        : Run Last

## Description

ClutterClickAction is a sub-class of ClutterAction that implements the logic for clickable actors, by using the low level events of ClutterActor, such as "button-press-event" and "button-release-event", to synthesize the high level "clicked" signal.

To use ClutterClickAction you just need to apply it to a ClutterActor using `clutter_actor_add_action()` and connect to the "clicked" signal:

    1
    2
    3
    4
    5
    ClutterAction *action = clutter_click_action_new ();

    clutter_actor_add_action (actor, action);

    g_signal_connect (action, "clicked", G_CALLBACK (on_clicked), NULL);

ClutterClickAction is available since Clutter 1.4

## Details

### struct ClutterClickAction

    struct ClutterClickAction;

The ClutterClickAction structure contains only private data and should be accessed using the provided API

Since 1.4

### struct ClutterClickActionClass

    struct ClutterClickActionClass {
      void (* clicked) (ClutterClickAction *action,
                        ClutterActor       *actor);
    };

The ClutterClickActionClass structure contains only private data

`clicked` () | class handler for the "clicked" signal

Since 1.4

### clutter_click_action_new ()

    ClutterAction *     clutter_click_action_new            (void);

Creates a new ClutterClickAction instance

Returns : | the newly created ClutterClickAction

Since 1.4

### clutter_click_action_get_button ()

    guint               clutter_click_action_get_button     (ClutterClickAction *action);

Retrieves the button that was pressed.

`action` : | a ClutterClickAction
Returns : | the button value

Since 1.4

### clutter_click_action_get_state ()

    ClutterModifierType  clutter_click_action_get_state     (ClutterClickAction *action);

Retrieves the modifier state of the click action.

`action` : | a ClutterClickAction
Returns : | the modifier state parameter, or 0

Since 1.6

### clutter_click_action_release ()

    void                clutter_click_action_release        (ClutterClickAction *action);

Emulates a release of the pointer button, which ungrabs the pointer and unsets the "pressed" state.

This function is useful to break a grab, for instance after a certain amount of time has passed.

`action` : | a ClutterClickAction

Since 1.4

## Property Details

### The `"held"` property

      "held"                     gboolean              : Read

Whether the clickable actor has the pointer grabbed

Default value: FALSE

Since 1.4

### The `"pressed"` property

      "pressed"                  gboolean              : Read

Whether the clickable actor should be in "pressed" state

Default value: FALSE

Since 1.4

## Signal Details

### The `"clicked"` signal

    void                user_function                      (ClutterClickAction *action,
                                                            ClutterActor       *actor,
                                                            gpointer            user_data)      : Run Last

The ::clicked signal is emitted when the ClutterActor to which a ClutterClickAction has been applied should respond to a pointer button press and release events

`action` : | the ClutterClickAction that emitted the signal
`actor` : | the ClutterActor attached to the `action`
`user_data` : | user data set when the signal handler was connected.

Since 1.4