XfwApplication: libxfce4windowing Reference Manual

## XfwApplication XfwApplication — An object representing a desktop application |

## Stability Level

Unstable, unless otherwise indicated

## Functions

guint64 | xfw_application_get_id ()
const gchar * | xfw_application_get_name ()
GdkPixbuf * | xfw_application_get_icon ()
GIcon * | xfw_application_get_gicon ()
gboolean | xfw_application_icon_is_fallback ()
GList * | xfw_application_get_windows ()
GList * | xfw_application_get_instances ()
XfwApplicationInstance * | xfw_application_get_instance ()
gint | xfw_application_instance_get_pid ()
const gchar * | xfw_application_instance_get_name ()
GList * | xfw_application_instance_get_windows ()

## Properties

GIcon * | gicon | Read
guint64 | id | Read
gpointer | instances | Read
char * | name | Read
gpointer | windows | Read

## Signals

void | icon-changed | Run Last

## Types and Values

| XfwApplication
| XfwApplicationInstance

## Object Hierarchy

        GObject
        ╰── XfwApplication

## Includes

    #include <libxfce4windowing/libxfce4windowing.h>

## Description

XfwApplication represents an application in the common or abstract sense, i.e. it can have several windows belonging to different instances, identified by their process ID.

Note that XfwApplication is actually an interface; when obtaining an instance, an instance of a windowing-environment-specific object that implements this interface will be returned.

## Functions

### xfw_application_get_id ()

    guint64
    xfw_application_get_id (XfwApplication *app);

Fetches this application's ID, which is the “id” of the first window in “windows”.

#### Parameters

app | an XfwApplication. |

#### Returns

A unique integer identifying the application.

### xfw_application_get_name ()

    const gchar *
    xfw_application_get_name (XfwApplication *app);

Fetches this application's human-readable name.

#### Parameters

app | an XfwApplication. |

#### Returns

A UTF-8 formatted string, owned by `app` .

[not nullable][transfer none]

### xfw_application_get_icon ()

    GdkPixbuf *
    xfw_application_get_icon (XfwApplication *app,
                              gint size,
                              gint scale);

Fetches `app` 's icon. If `app` has no icon, a fallback icon may be returned. Whether or not the returned icon is a fallback icon can be determined using `xfw_application_icon_is_fallback()`.

#### Parameters

app | an XfwApplication. |
size | the desired icon size. |
scale | the UI scale factor. |

#### Returns

a GdkPixbuf, owned by `app` , or `NULL` if `app` has no icon and a fallback cannot be rendered.

[nullable][transfer none]

### xfw_application_get_gicon ()

    GIcon *
    xfw_application_get_gicon (XfwApplication *app);

Fetches `app` 's icon as a size-independent GIcon. If an icon cannot be found, a GIcon representing a fallback icon will be returned. Whether or not the returned icon is a fallback icon can be determined using `xfw_application_icon_is_fallback()`.

#### Parameters

app | an XfwApplication. |

#### Returns

a GIcon, owned by `app` .

[not nullable][transfer none]

Since: 4.19.1

### xfw_application_icon_is_fallback ()

    gboolean
    xfw_application_icon_is_fallback (XfwApplication *app);

Determines if `app` does not have an icon, and thus a fallback icon will be returned from `xfw_application_get_icon()` and `xfw_application_get_gicon()`.

#### Parameters

app | an XfwApplication. |

#### Returns

`TRUE` or `FALSE`, depending on if `app` 's icon uses a fallback icon or not.

Since: 4.19.1

### xfw_application_get_windows ()

    GList *
    xfw_application_get_windows (XfwApplication *app);

Lists all windows belonging to the application.

#### Parameters

app | an XfwApplication. |

#### Returns

The list of XfwWindow belonging to `app` . The list and its contents are owned by `app` .

[not nullable][element-type XfwWindow][transfer none]

### xfw_application_get_instances ()

    GList *
    xfw_application_get_instances (XfwApplication *app);

Lists all instances of the application.

#### Parameters

app | an XfwApplication. |

#### Returns

The list of XfwApplicationInstance of `app` , or `NULL` if listing instances is not supported on the windowing environment in use. The list and its contents are owned by `app` .

[nullable][element-type XfwApplicationInstance][transfer none]

### xfw_application_get_instance ()

    XfwApplicationInstance *
    xfw_application_get_instance (XfwApplication *app,
                                  XfwWindow *window);

Finds the XfwApplicationInstance to which `window` belongs.

#### Parameters

app | an XfwApplication. |
window | the application window you want to get the instance of. |

#### Returns

The XfwApplicationInstance to which `window` belongs, or `NULL` if `window` does not belong to `app` , or if listing instances is not supported on the windowing environment in use. The returned XfwApplicationInstance is owned by `app` .

[nullable][transfer none]

### xfw_application_instance_get_pid ()

    gint
    xfw_application_instance_get_pid (XfwApplicationInstance *instance);

Fetches `instance` 's PID.

#### Parameters

instance | an XfwApplicationInstance. |

#### Returns

The process ID of `instance` , or 0 if none is available.

Since: 4.19.1

### xfw_application_instance_get_name ()

    const gchar *
    xfw_application_instance_get_name (XfwApplicationInstance *instance);

Fetches `instance` 's name, which can often be the same as the application name.

#### Parameters

instance | an XfwApplicationInstance. |

#### Returns

A string owned by `instance` .

[not nullable][transfer none]

Since: 4.19.1

### xfw_application_instance_get_windows ()

    GList *
    xfw_application_instance_get_windows (XfwApplicationInstance *instance);

Lists all windows belonging to the application instance.

#### Parameters

instance | an XfwApplicationInstance. |

#### Returns

The list of XfwWindow belonging to `instance` . The list and its contents are owned by `instance` .

[not nullable][element-type XfwWindow][transfer none]

Since: 4.19.1

## Types and Values

### XfwApplication

    typedef struct _XfwApplication XfwApplication;

### XfwApplicationInstance

    typedef struct _XfwApplicationInstance XfwApplicationInstance;

An opaque structure representing an instance of an XfwApplication.

## Property Details

### The `“gicon”` property

      “gicon”                    GIcon *

The GIcon that represents this application.

Owner: XfwApplication

Flags: Read

### The `“id”` property

      “id”                       guint64

The “id” of the first window in “windows”.

Owner: XfwApplication

Flags: Read

Default value: 0

### The `“instances”` property

      “instances”                gpointer

The list of XfwApplicationInstance belonging to the application.

Owner: XfwApplication

Flags: Read

### The `“name”` property

      “name”                     char *

The application name.

Owner: XfwApplication

Flags: Read

Default value: NULL

### The `“windows”` property

      “windows”                  gpointer

The list of XfwWindow belonging to the application.

Owner: XfwApplication

Flags: Read

## Signal Details

### The `“icon-changed”` signal

    void
    user_function (XfwApplication *app,
                   gpointer        user_data)

Emitted when `app` 's icon changes.

#### Parameters

app | the object which received the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last