DzlApplication: Dazzle Reference Manual

## DzlApplication DzlApplication — Application base class with goodies |

## Functions

DzlApplication * | dzl_application_new ()
DzlMenuManager * | dzl_application_get_menu_manager ()
DzlShortcutManager * | dzl_application_get_shortcut_manager ()
DzlThemeManager * | dzl_application_get_theme_manager ()
GMenu * | dzl_application_get_menu_by_id ()
void | dzl_application_add_resources ()
void | dzl_application_remove_resources ()

## Properties

DzlMenuManager * | menu-manager | Read
DzlShortcutManager * | shortcut-manager | Read
DzlThemeManager * | theme-manager | Read

## Types and Values

#define | DZL_APPLICATION_DEFAULT
#define | DZL_TYPE_APPLICATION
struct | DzlApplicationClass
| DzlApplication

## Object Hierarchy

        GObject
        ╰── GApplication
            ╰── GtkApplication
                ╰── DzlApplication

## Implemented Interfaces

DzlApplication implements GActionGroup and GActionMap.

## Description

DzlApplication is an extension of GtkApplication with extra features to integrate various libdazzle subsystems with your application. We suggest subclassing DzlApplication.

The DzlApplication class provides:

- Automatic menu merging including the "app-menu".

- Automatic Icon loading based on resources-base-path.

- Automatic theme tracking to load CSS variants based on user themes.

The DzlApplication class automatically manages loading alternate CSS based on the active theme by tracking “gtk-theme-name”. Additionally, it supports menu merging including the base "app-menu" as loaded by automatic GResources in “resource-base-path”. It will autom

## Functions

### dzl_application_new ()

    DzlApplication *
    dzl_application_new (const gchar *application_id,
                         GApplicationFlags flags);

### dzl_application_get_menu_manager ()

    DzlMenuManager *
    dzl_application_get_menu_manager (DzlApplication *self);

Gets the menu manager for the application.

#### Parameters

self | a DzlApplication |

#### Returns

A DzlMenuManager.

[transfer none]

### dzl_application_get_shortcut_manager ()

    DzlShortcutManager *
    dzl_application_get_shortcut_manager (DzlApplication *self);

Gets the DzlShortcutManager for the application.

#### Parameters

self | a DzlApplication |

#### Returns

A DzlShortcutManager.

[transfer none]

### dzl_application_get_theme_manager ()

    DzlThemeManager *
    dzl_application_get_theme_manager (DzlApplication *self);

Get the theme manager for the application.

#### Parameters

self | a DzlApplication |

#### Returns

A DzlThemeManager.

[transfer none]

### dzl_application_get_menu_by_id ()

    GMenu *
    dzl_application_get_menu_by_id (DzlApplication *self,
                                    const gchar *menu_id);

Similar to `gtk_application_get_menu_by_id()` but takes into account menu merging which could have occurred upon loading plugins.

#### Parameters

self | a DzlApplication |
menu_id | the id of the menu to locate |

#### Returns

A GMenu.

[transfer none]

### dzl_application_add_resources ()

    void
    dzl_application_add_resources (DzlApplication *self,
                                   const gchar *resource_path);

This adds `resource_path` to the list of "automatic resources".

If `resource_path` starts with "resource://", then the corresponding GResources path will be searched for resources. Otherwise, `resource_path` should be a path to a location on disk.

The DzlApplication will locate resources such as CSS themes, icons, and keyboard shortcuts using `resource_path` .

#### Parameters

self | a DzlApplication |
resource_path | the location of the resources. |

### dzl_application_remove_resources ()

    void
    dzl_application_remove_resources (DzlApplication *self,
                                      const gchar *resource_path);

This attempts to undo as many side-effects as possible from a call to `dzl_application_add_resources()`.

#### Parameters

self | a DzlApplication |
resource_path | the location of the resources. |

## Types and Values

### DZL_APPLICATION_DEFAULT

    #define DZL_APPLICATION_DEFAULT (DZL_APPLICATION (g_application_get_default ()))

### DZL_TYPE_APPLICATION

    #define DZL_TYPE_APPLICATION    (dzl_application_get_type())

### struct DzlApplicationClass

    struct DzlApplicationClass {
      GtkApplicationClass parent_class;

      void (*add_resources)    (DzlApplication *self,
                                const gchar    *resource_path);
      void (*remove_resources) (DzlApplication *self,
                                const gchar    *resource_path);

      gpointer _reserved1;
      gpointer _reserved2;
      gpointer _reserved3;
      gpointer _reserved4;
      gpointer _reserved5;
      gpointer _reserved6;
      gpointer _reserved7;
      gpointer _reserved8;
    };

### DzlApplication

    typedef struct _DzlApplication DzlApplication;

## Property Details

### The `“menu-manager”` property

      “menu-manager”             DzlMenuManager *

Owner: DzlApplication

Flags: Read

### The `“shortcut-manager”` property

      “shortcut-manager”         DzlShortcutManager *

Owner: DzlApplication

Flags: Read

### The `“theme-manager”` property

      “theme-manager”            DzlThemeManager *

Owner: DzlApplication

Flags: Read