XfwApplication

XfwApplication — An object representing a desktop application

Stability Level

Unstable, unless otherwise indicated

Functions

Properties

guint64 id Read
gpointer instances Read
char * name Read
gpointer windows Read

Signals

void icon-changed Run Last

Types and Values

Object Hierarchy

    GInterface
    ╰── XfwApplication

Prerequisites

XfwApplication requires GObject.

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.

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.

[nullable][transfer none]


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]

Types and Values

XfwApplication

typedef struct _XfwApplication XfwApplication;

struct XfwApplicationInstance

struct XfwApplicationInstance {
    gint pid;
    gchar *name;
    GList *windows;
};

A structure representing an instance of an XfwApplication.

Members

gint pid;

the process ID.

 

gchar *name;

the instance name, which can often be the same as the application name.

 

GList *windows;

the list of XfwWindow belonging to the instance.

 

XfwApplicationIface

typedef struct _XfwApplicationInterface XfwApplicationIface;

Property Details

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