## MxApplication MxApplication |

## Synopsis

    struct              MxApplication;
    struct              MxApplicationClass;
    enum                MxApplicationFlags;
    MxApplication *     mx_application_new                  (gint *argc,
                                                             gchar ***argv,
                                                             const gchar *name,
                                                             MxApplicationFlags flags);
    void                mx_application_run                  (MxApplication *application);
    void                mx_application_quit                 (MxApplication *application);
    MxWindow *          mx_application_create_window        (MxApplication *application);
    MxApplicationFlags  mx_application_get_flags            (MxApplication *application);
    void                mx_application_add_window           (MxApplication *application,
                                                             MxWindow *window);
    void                mx_application_remove_window        (MxApplication *application,
                                                             MxWindow *window);
    const GList *       mx_application_get_windows          (MxApplication *application);
    void                mx_application_add_action           (MxApplication *application,
                                                             MxAction *action);
    void                mx_application_remove_action        (MxApplication *application,
                                                             const gchar *name);
    GList *             mx_application_get_actions          (MxApplication *application);
    void                mx_application_invoke_action        (MxApplication *application,
                                                             const gchar *name);
    gboolean            mx_application_is_running           (MxApplication *application);

## Object Hierarchy

      GObject
       +----MxApplication

## Properties

      "application-name"         gchar*                : Read / Write / Construct Only
      "flags"                    guint                 : Read / Write / Construct Only

## Signals

      "actions-changed"                                : Run Last

## Description

## Details

### struct MxApplication

    struct MxApplication;

The contents of this structure are private and should only be accessed through the public API.

### struct MxApplicationClass

    struct MxApplicationClass {
      GObjectClass parent_class;

      /* vfuncs */
      MxWindow* (*create_window)   (MxApplication *application);
      void      (*raise)           (MxApplication *application);

      /* signals */
      void          (*actions_changed) (MxApplication *app);

      /* padding for future expansion */
      void (*_padding_0) (void);
      void (*_padding_1) (void);
      void (*_padding_2) (void);
      void (*_padding_3) (void);
      void (*_padding_4) (void);
    };

### enum MxApplicationFlags

    typedef enum
    {
      MX_APPLICATION_SINGLE_INSTANCE = 1,
      MX_APPLICATION_KEEP_ALIVE      = 1 << 2,
    } MxApplicationFlags;

### mx_application_new ()

    MxApplication *     mx_application_new                  (gint *argc,
                                                             gchar ***argv,
                                                             const gchar *name,
                                                             MxApplicationFlags flags);

Intialises everything needed to operate Clutter and use MxApplication. See `clutter_init()`.

`argc` : | The number of arguments in argv. [inout]
`argv` : | A pointer to an array of arguments. [array length=argc][inout][allow-none]
`name` : | Unique application name.
`flags` : | Application flags.
Returns : | the MxApplication singleton.

### mx_application_run ()

    void                mx_application_run                  (MxApplication *application);

Run the main loop of the application and start processing events. This function will not return until the application is quit. If the application is single instance and an existing instance is already running, this will cause the existing instance to be raised and the function will complete immediately.

`application` : | an MxApplication

### mx_application_quit ()

    void                mx_application_quit                 (MxApplication *application);

Stop the application from running and quit the main loop. This will cause the call to `mx_application_run()` to complete.

`application` : | an MxApplication

### mx_application_create_window ()

    MxWindow *          mx_application_create_window        (MxApplication *application);

Creates a window and associates it with the application.

`application` : | The MxApplication
Returns : | An MxWindow. [transfer none]

### mx_application_get_flags ()

    MxApplicationFlags  mx_application_get_flags            (MxApplication *application);

Get the application flags that where set on `application` when created.

`application` : | an MxApplication
Returns : | the application flags

### mx_application_add_window ()

    void                mx_application_add_window           (MxApplication *application,
                                                             MxWindow *window);

Adds a window to the list of windows associated with `application`. If this is the first window, it will be treated as the primary window and used for startup notification.

This function does not take a reference on `window`.

`application` : | The MxApplication
`window` : | The MxWindow to add to the application. [transfer full]

### mx_application_remove_window ()

    void                mx_application_remove_window        (MxApplication *application,
                                                             MxWindow *window);

Remove the specified window from the application. This will cause the window to be unreferenced and destroyed unless another reference is held on it.

`application` : | an MxApplication
`window` : | an MxWindow

### mx_application_get_windows ()

    const GList *       mx_application_get_windows          (MxApplication *application);

Retrieves all windows added to `application`.

`application` : | an MxApplication
Returns : | a list of MxWindows. The returned list is owned by `application` and must not be altered. [element-type MxWindow][transfer none]

### mx_application_add_action ()

    void                mx_application_add_action           (MxApplication *application,
                                                             MxAction *action);

Add an action to the application.

`application` : | an MxApplication
`action` : | an MxAction

### mx_application_remove_action ()

    void                mx_application_remove_action        (MxApplication *application,
                                                             const gchar *name);

Remove the action with the specified name from the application.

`application` : | an MxApplication
`name` : | name of the action to remove

### mx_application_get_actions ()

    GList *             mx_application_get_actions          (MxApplication *application);

Retrieves all actions registered on `application`.

`application` : | an MxApplication
Returns : | a list of MxActions. Use `g_list_free()` on the returned list when done. [element-type Mx.Action][transfer container]

### mx_application_invoke_action ()

    void                mx_application_invoke_action        (MxApplication *application,
                                                             const gchar *name);

Run the named action for the application.

`application` : | an MxApplication
`name` : | name of the action to invoke

### mx_application_is_running ()

    gboolean            mx_application_is_running           (MxApplication *application);

Query whether MxApplication is running. This will also return TRUE if the given MxApplication is single instance and there is an instance already running.

`application` : | an MxApplication
Returns : | TRUE if the application is running

## Property Details

### The `"application-name"` property

      "application-name"         gchar*                : Read / Write / Construct Only

Name of the application.

Default value: ""

### The `"flags"` property

      "flags"                    guint                 : Read / Write / Construct Only

Application Flags.

Allowed values: <= G_MAXINT

Default value: 0

## Signal Details

### The `"actions-changed"` signal

    void                user_function                      (MxApplication *arg0,
                                                            gpointer       user_data)      : Run Last

Emitted when an action has been added or removed from the MxApplication.

`user_data` : | user data set when the signal handler was connected.