MatewnckApplication

## MatewnckApplication MatewnckApplication — an object representing a group of windows of the same application. |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <libmatewnck/libmatewnck.h>

                        MatewnckApplication;
    MatewnckApplication * matewnck_application_get          (gulong xwindow);
    gulong              matewnck_application_get_xid        (MatewnckApplication *app);
    const char *        matewnck_application_get_name       (MatewnckApplication *app);
    const char *        matewnck_application_get_icon_name  (MatewnckApplication *app);
    int                 matewnck_application_get_pid        (MatewnckApplication *app);
    gboolean            matewnck_application_get_icon_is_fallback
                                                            (MatewnckApplication *app);
    GdkPixbuf *         matewnck_application_get_icon       (MatewnckApplication *app);
    GdkPixbuf *         matewnck_application_get_mini_icon  (MatewnckApplication *app);
    const char *        matewnck_application_get_startup_id (MatewnckApplication *app);
    GList *             matewnck_application_get_windows    (MatewnckApplication *app);
    int                 matewnck_application_get_n_windows  (MatewnckApplication *app);

## Object Hierarchy

      GObject
       +----MatewnckApplication

## Signals

      "icon-changed"                                   : Run Last
      "name-changed"                                   : Run Last

## Description

The MatewnckApplication is a group of MatewnckWindow that are all in the same application. It can be used to represent windows by applications, group windows by applications or to manipulate all windows of a particular application.

A MatewnckApplication is identified by the group leader of the MatewnckWindow belonging to it, and new MatewnckWindow are added to a MatewnckApplication if and only if they have the group leader of the MatewnckApplication.

The MatewnckApplication objects are always owned by libmatewnck and must not be referenced or unreferenced.

## Details

### MatewnckApplication

    typedef struct _MatewnckApplication MatewnckApplication;

The MatewnckApplication struct contains only private fields and should not be directly accessed.

### matewnck_application_get ()

    MatewnckApplication * matewnck_application_get          (gulong xwindow);

Gets the MatewnckApplication corresponding to the group leader with `xwindow` as X window ID.

`xwindow` : | the X window ID of a group leader.
Returns : | the MatewnckApplication corresponding to `xwindow`, or `NULL` if there no such MatewnckApplication could be found. The returned MatewnckApplication is owned by libmatewnck and must not be referenced or unreferenced. [transfer none]

### matewnck_application_get_xid ()

    gulong              matewnck_application_get_xid        (MatewnckApplication *app);

Gets the X window ID of the group leader window for `app`.

`app` : | a MatewnckApplication.
Returns : | the X window ID of the group leader window for `app`.

### matewnck_application_get_name ()

    const char *        matewnck_application_get_name       (MatewnckApplication *app);

Gets the name of `app`. Since there is no way to properly find this name, various suboptimal heuristics are used to find it. GTK+ should probably have a function to allow applications to set the _NET_WM_NAME property on the group leader as the application name, and the EWMH should say that this is where the application name goes.

`app` : | a MatewnckApplication.
Returns : | the name of `app`, or a fallback name if no name is available.

### matewnck_application_get_icon_name ()

    const char *        matewnck_application_get_icon_name  (MatewnckApplication *app);

Gets the icon name of `app` (to be used when `app` is minimized). Since there is no way to properly find this name, various suboptimal heuristics are used to find it.

`app` : | a MatewnckApplication
Returns : | the icon name of `app`, or a fallback icon name if no icon name is available.

### matewnck_application_get_pid ()

    int                 matewnck_application_get_pid        (MatewnckApplication *app);

Gets the process ID of `app`.

`app` : | a MatewnckApplication.
Returns : | the process ID of `app`, or 0 if none is available.

### matewnck_application_get_icon_is_fallback ()

    gboolean            matewnck_application_get_icon_is_fallback
                                                            (MatewnckApplication *app);

Gets whether a default fallback icon is used for `app` (because none was set on `app`).

`app` : | a MatewnckApplication
Returns : | `TRUE` if the icon for `app` is a fallback, `FALSE` otherwise.

### matewnck_application_get_icon ()

    GdkPixbuf *         matewnck_application_get_icon       (MatewnckApplication *app);

Gets the icon to be used for `app`. If no icon is set for `app`, a suboptimal heuristic is used to find an appropriate icon. If no icon was found, a fallback icon is used.

`app` : | a MatewnckApplication.
Returns : | the icon for `app`. The caller should reference the returned `GdkPixbuf` if it needs to keep the icon around.

### matewnck_application_get_mini_icon ()

    GdkPixbuf *         matewnck_application_get_mini_icon  (MatewnckApplication *app);

Gets the mini-icon to be used for `app`. If no mini-icon is set for `app`, a suboptimal heuristic is used to find an appropriate icon. If no mini-icon was found, a fallback mini-icon is used.

`app` : | a MatewnckApplication.
Returns : | the mini-icon for `app`. The caller should reference the returned `GdkPixbuf` if it needs to keep the mini-icon around.

### matewnck_application_get_startup_id ()

    const char *        matewnck_application_get_startup_id (MatewnckApplication *app);

Gets the startup sequence ID used for startup notification of `app`.

`app` : | a MatewnckApplication.
Returns : | the startup sequence ID used for startup notification of `app`, or `NULL` if none is available.

Since 2.2

### matewnck_application_get_windows ()

    GList *             matewnck_application_get_windows    (MatewnckApplication *app);

Gets the list of MatewnckWindow belonging to `app`.

`app` : | a MatewnckApplication.
Returns : | the list of MatewnckWindow belonging to `app`, or `NULL` if the application contains no window. The list should not be modified nor freed, as it is owned by `app`. [element-type MatewnckWindow][transfer none]

### matewnck_application_get_n_windows ()

    int                 matewnck_application_get_n_windows  (MatewnckApplication *app);

Gets the number of MatewnckWindow belonging to `app`.

`app` : | a MatewnckApplication.
Returns : | the number of MatewnckWindow belonging to `app`.

## Signal Details

### The `"icon-changed"` signal

    void                user_function                      (MatewnckApplication *app,
                                                            gpointer             user_data)      : Run Last

Emitted when the icon of `app` changes.

`app` : | the MatewnckApplication which emitted the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"name-changed"` signal

    void                user_function                      (MatewnckApplication *app,
                                                            gpointer             user_data)      : Run Last

Emitted when the name of `app` changes.

`app` : | the MatewnckApplication which emitted the signal.
`user_data` : | user data set when the signal handler was connected.

## See Also

matewnck_window_get_application()