## gok-action gok-action |

## Synopsis

    #define             ACTION_TYPE_SWITCH
    #define             ACTION_TYPE_MOUSEBUTTON
    #define             ACTION_TYPE_MOUSEPOINTER
    #define             ACTION_TYPE_DWELL
    enum                ActionState;
    GokAction *         gok_action_new                      (void);
    void                gok_action_free                     (GokAction *action);
    gboolean            gok_action_open                     (void);
    void                gok_action_close                    (void);
    GokAction *         gok_action_get_first_action         (void);
    void                gok_action_set_modified             (gboolean bTrueFalse);
    void                gok_action_delete_action            (GokAction *pActionDelete);
    GokAction *         gok_action_find_action              (gchar *NameAction,
                                                             gboolean bDisplayName);
    void                gok_action_add_action               (GokAction *pActionNew);

## Description

## Details

### ACTION_TYPE_SWITCH

    #define ACTION_TYPE_SWITCH 1

### ACTION_TYPE_MOUSEBUTTON

    #define ACTION_TYPE_MOUSEBUTTON 2

### ACTION_TYPE_MOUSEPOINTER

    #define ACTION_TYPE_MOUSEPOINTER 4

### ACTION_TYPE_DWELL

    #define ACTION_TYPE_DWELL 8

### enum ActionState

    typedef enum {
    ACTION_STATE_UNDEFINED,
    ACTION_STATE_PRESS,
    ACTION_STATE_RELEASE,
    ACTION_STATE_CLICK,
    ACTION_STATE_DOUBLECLICK,
    ACTION_STATE_ENTER,
    ACTION_STATE_LEAVE
    } ActionState;

### gok_action_new ()

    GokAction *         gok_action_new                      (void);

Allocates memory for a new GokAction and initializes its attributes to default values. Please free the returned GokAction using gok_action_free.

Returns : | a new GokAction

### gok_action_free ()

    void                gok_action_free                     (GokAction *action);

Frees a GokAction and associated resources.

`action` : | a GokAction

### gok_action_open ()

    gboolean            gok_action_open                     (void);

Initializes the gok actions and reads them from GConf.

Returns : | TRUE if the actions were initialized without problem, FALSE if problems occured.

### gok_action_close ()

    void                gok_action_close                    (void);

Closes the gok actions and saves them in GConf.

### gok_action_get_first_action ()

    GokAction *         gok_action_get_first_action         (void);

Returns : | A pointer to the first action in the list of actions.

### gok_action_set_modified ()

    void                gok_action_set_modified             (gboolean bTrueFalse);

Sets the 'modified' flag for the gok actions. If the flag is TRUE then the actions are written to a file when the program ends. This should be called any time an action is added or modified.

`bTrueFalse` : | New state of the 'modified' flag for the gok actions.

### gok_action_delete_action ()

    void                gok_action_delete_action            (GokAction *pActionDelete);

`pActionDelete` : | Pointer to the action that will be deleted.

### gok_action_find_action ()

    GokAction *         gok_action_find_action              (gchar *NameAction,
                                                             gboolean bDisplayName);

Finds the action from within our list of actions.

`NameAction` : | Name of the action you're trying to find.
`bDisplayName` : | This should be set TRUE if you are passing in the display name of the action. It should be set FALSE if passing in the actual name of the action.
Returns : | A pointer to the action, NULL if not found.

### gok_action_add_action ()

    void                gok_action_add_action               (GokAction *pActionNew);

`pActionNew` : | Pointer to an action that gets added to our list of actions.