BamfApplication: libbamf Reference Manual

## BamfApplication BamfApplication — The base class for all applications |

## Functions

const gchar * | bamf_application_get_application_type ()
const gchar * | bamf_application_get_desktop_file ()
gchar ** | bamf_application_get_supported_mime_types ()
GList * | bamf_application_get_windows ()
GArray * | bamf_application_get_xids ()
BamfView * | bamf_application_get_focusable_child ()
gboolean | bamf_application_get_show_menu_stubs ()
BamfWindow * | bamf_application_get_window_for_xid ()
gboolean | bamf_application_get_application_menu ()

## Signals

void | desktop-file-updated |
void | window-added |
void | window-removed |

## Types and Values

#define | BAMF_TYPE_APPLICATION
#define | BAMF_APPLICATION_SIGNAL_DESKTOP_FILE_UPDATED
#define | BAMF_APPLICATION_SIGNAL_WINDOW_ADDED
#define | BAMF_APPLICATION_SIGNAL_WINDOW_REMOVED
struct | BamfApplicationClass
| BamfApplication

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── BamfView
                ╰── BamfApplication

## Description

BamfApplication is the base class that all applications need to derive from.

## Functions

### bamf_application_get_application_type ()

    const gchar *
    bamf_application_get_application_type (BamfApplication *application);

### bamf_application_get_desktop_file ()

    const gchar *
    bamf_application_get_desktop_file (BamfApplication *application);

Used to fetch the path to the .desktop file associated with the passed application. If none exists, the result is NULL.

#### Parameters

application | a BamfApplication |

#### Returns

A string representing the path to the desktop file.

### bamf_application_get_supported_mime_types ()

    gchar **
    bamf_application_get_supported_mime_types
                                   (BamfApplication *application);

#### Parameters

application | a BamfApplication |

#### Returns

A string array containing the supported mime-types.

[transfer full][array zero-terminated=1]

### bamf_application_get_windows ()

    GList *
    bamf_application_get_windows (BamfApplication *application);

Used to fetch all BamfWindow's associated with the passed BamfApplication.

#### Parameters

application | a BamfApplication |

#### Returns

A list of BamfWindow's.

[element-type Bamf.Window][transfer container]

### bamf_application_get_xids ()

    GArray *
    bamf_application_get_xids (BamfApplication *application);

Used to fetch all BamfWindow's xids associated with the passed BamfApplication.

#### Parameters

application | a BamfApplication |

#### Returns

An array of xids.

[element-type guint32][transfer full]

### bamf_application_get_focusable_child ()

    BamfView *
    bamf_application_get_focusable_child (BamfApplication *application);

#### Parameters

application | a BamfApplication |

#### Returns

The focusable child for this application.

[transfer none]

### bamf_application_get_show_menu_stubs ()

    gboolean
    bamf_application_get_show_menu_stubs (BamfApplication *application);

Used to discover whether the application wants menu stubs shown.

#### Parameters

application | a BamfApplication |

#### Returns

Whether the stubs should be shown.

### bamf_application_get_window_for_xid ()

    BamfWindow *
    bamf_application_get_window_for_xid (BamfApplication *application,
                                         guint32 xid);

Used to fetch the application contains a Window with given `xid` .

#### Parameters

application | a BamfApplication |
xid | an X11 Window ID |

#### Returns

a BamfWindow for the passed `xid` or `NULL` if not found.

[transfer none]

Since: 0.5.2

### bamf_application_get_application_menu ()

    gboolean
    bamf_application_get_application_menu (BamfApplication *application,
                                           gchar **name,
                                           gchar **object_path);

`bamf_application_get_application_menu` has been deprecated since version 0.5.0 and should not be used in newly-written code.

Used to fetch the bus name and the object path of the remote application menu.

#### Parameters

application | a BamfApplication |
name | the bus name. | [out]
object_path | the object path. | [out]

#### Returns

`TRUE` if found, `FALSE` otherwise.

## Types and Values

### BAMF_TYPE_APPLICATION

    #define BAMF_TYPE_APPLICATION (bamf_application_get_type ())

### BAMF_APPLICATION_SIGNAL_DESKTOP_FILE_UPDATED

    #define BAMF_APPLICATION_SIGNAL_DESKTOP_FILE_UPDATED "desktop-file-updated"

### BAMF_APPLICATION_SIGNAL_WINDOW_ADDED

    #define BAMF_APPLICATION_SIGNAL_WINDOW_ADDED         "window-added"

### BAMF_APPLICATION_SIGNAL_WINDOW_REMOVED

    #define BAMF_APPLICATION_SIGNAL_WINDOW_REMOVED       "window-removed"

### struct BamfApplicationClass

    struct BamfApplicationClass {
      BamfViewClass parent_class;
    };

### BamfApplication

    typedef struct _BamfApplication BamfApplication;

## Signal Details

### The `“desktop-file-updated”` signal

    void
    user_function (BamfApplication *bamfapplication,
                   char            *arg1,
                   gpointer         user_data)

### The `“window-added”` signal

    void
    user_function (BamfApplication *bamfapplication,
                   BamfWindow      *arg1,
                   gpointer         user_data)

### The `“window-removed”` signal

    void
    user_function (BamfApplication *bamfapplication,
                   BamfWindow      *arg1,
                   gpointer         user_data)