## DzlShortcutTheme

DzlShortcutTheme

## Functions

DzlShortcutTheme * | dzl_shortcut_theme_new ()
const gchar * | dzl_shortcut_theme_get_name ()
const gchar * | dzl_shortcut_theme_get_title ()
const gchar * | dzl_shortcut_theme_get_subtitle ()
DzlShortcutTheme * | dzl_shortcut_theme_get_parent ()
const gchar * | dzl_shortcut_theme_get_parent_name ()
void | dzl_shortcut_theme_set_parent_name ()
DzlShortcutContext * | dzl_shortcut_theme_find_default_context ()
DzlShortcutContext * | dzl_shortcut_theme_find_context_by_name ()
void | dzl_shortcut_theme_add_command ()
void | dzl_shortcut_theme_add_context ()
void | dzl_shortcut_theme_set_chord_for_action ()
const DzlShortcutChord * | dzl_shortcut_theme_get_chord_for_action ()
void | dzl_shortcut_theme_set_accel_for_action ()
void | dzl_shortcut_theme_set_chord_for_command ()
const DzlShortcutChord * | dzl_shortcut_theme_get_chord_for_command ()
void | dzl_shortcut_theme_set_accel_for_command ()
gboolean | dzl_shortcut_theme_load_from_data ()
gboolean | dzl_shortcut_theme_load_from_file ()
gboolean | dzl_shortcut_theme_load_from_path ()
gboolean | dzl_shortcut_theme_save_to_file ()
gboolean | dzl_shortcut_theme_save_to_stream ()
gboolean | dzl_shortcut_theme_save_to_path ()
void | dzl_shortcut_theme_add_css_resource ()
void | dzl_shortcut_theme_remove_css_resource ()

## Properties

char * | name | Read / Write / Construct Only
char * | parent-name | Read / Write
char * | subtitle | Read / Write
char * | title | Read / Write

## Types and Values

#define | DZL_TYPE_SHORTCUT_THEME
struct | DzlShortcutThemeClass
| DzlShortcutTheme

## Object Hierarchy

        GObject
        ╰── DzlShortcutTheme

## Description

## Functions

### dzl_shortcut_theme_new ()

    DzlShortcutTheme *
    dzl_shortcut_theme_new (const gchar *name);

### dzl_shortcut_theme_get_name ()

    const gchar *
    dzl_shortcut_theme_get_name (DzlShortcutTheme *self);

### dzl_shortcut_theme_get_title ()

    const gchar *
    dzl_shortcut_theme_get_title (DzlShortcutTheme *self);

### dzl_shortcut_theme_get_subtitle ()

    const gchar *
    dzl_shortcut_theme_get_subtitle (DzlShortcutTheme *self);

### dzl_shortcut_theme_get_parent ()

    DzlShortcutTheme *
    dzl_shortcut_theme_get_parent (DzlShortcutTheme *self);

If the “parent-name” property has been set, this will fetch the parent DzlShortcutTheme.

#### Parameters

self | a DzlShortcutTheme |

#### Returns

A DzlShortcutTheme or `NULL`.

[transfer none][nullable]

### dzl_shortcut_theme_get_parent_name ()

    const gchar *
    dzl_shortcut_theme_get_parent_name (DzlShortcutTheme *self);

Gets the name of the parent shortcut theme.

This is used to resolve shortcuts from the parent theme without having to copy them directly into this shortcut theme. It allows for some level of copy-on-write (CoW).

#### Parameters

self | a DzlShortcutTheme |

#### Returns

The name of the parent theme, or `NULL` if none is set.

[nullable]

### dzl_shortcut_theme_set_parent_name ()

    void
    dzl_shortcut_theme_set_parent_name (DzlShortcutTheme *self,
                                        const gchar *parent_name);

### dzl_shortcut_theme_find_default_context ()

    DzlShortcutContext *
    dzl_shortcut_theme_find_default_context
                                   (DzlShortcutTheme *self,
                                    GtkWidget *widget);

Finds the default context in the theme for `widget` .

#### Returns

An DzlShortcutContext or `NULL`.

[nullable][transfer none]

### dzl_shortcut_theme_find_context_by_name ()

    DzlShortcutContext *
    dzl_shortcut_theme_find_context_by_name
                                   (DzlShortcutTheme *self,
                                    const gchar *name);

Gets the context named `name` . If the context does not exist, it will be created.

#### Parameters

self | An DzlShortcutContext |
name | The name of the context |

#### Returns

An DzlShortcutContext.

[not nullable][transfer none]

### dzl_shortcut_theme_add_command ()

    void
    dzl_shortcut_theme_add_command (DzlShortcutTheme *self,
                                    const gchar *accelerator,
                                    const gchar *command);

### dzl_shortcut_theme_add_context ()

    void
    dzl_shortcut_theme_add_context (DzlShortcutTheme *self,
                                    DzlShortcutContext *context);

### dzl_shortcut_theme_set_chord_for_action ()

    void
    dzl_shortcut_theme_set_chord_for_action
                                   (DzlShortcutTheme *self,
                                    const gchar *detailed_action_name,
                                    const DzlShortcutChord *chord,
                                    DzlShortcutPhase phase);

### dzl_shortcut_theme_get_chord_for_action ()

    const DzlShortcutChord *
    dzl_shortcut_theme_get_chord_for_action
                                   (DzlShortcutTheme *self,
                                    const gchar *detailed_action_name);

### dzl_shortcut_theme_set_accel_for_action ()

    void
    dzl_shortcut_theme_set_accel_for_action
                                   (DzlShortcutTheme *self,
                                    const gchar *detailed_action_name,
                                    const gchar *accel,
                                    DzlShortcutPhase phase);

### dzl_shortcut_theme_set_chord_for_command ()

    void
    dzl_shortcut_theme_set_chord_for_command
                                   (DzlShortcutTheme *self,
                                    const gchar *command,
                                    const DzlShortcutChord *chord,
                                    DzlShortcutPhase phase);

This will set the command to execute when `chord` is pressed. If command is `NULL`, the accelerator will be cleared. If `chord` is `NULL`, all accelerators for `command` will be cleared.

#### Parameters

self | a DzlShortcutTheme |
chord | the chord for the command. | [nullable]
command | the command to be executed. | [nullable]
phase | the phase to activate within, or 0 for the default |

### dzl_shortcut_theme_get_chord_for_command ()

    const DzlShortcutChord *
    dzl_shortcut_theme_get_chord_for_command
                                   (DzlShortcutTheme *self,
                                    const gchar *command);

### dzl_shortcut_theme_set_accel_for_command ()

    void
    dzl_shortcut_theme_set_accel_for_command
                                   (DzlShortcutTheme *self,
                                    const gchar *command,
                                    const gchar *accel,
                                    DzlShortcutPhase phase);

This will set the command to execute when `accel` is pressed. If command is `NULL`, the accelerator will be cleared. If accelerator is `NULL`, all accelerators for `command` will be cleared.

#### Parameters

self | a DzlShortcutTheme |
command | the command to be executed. | [nullable]
accel | the shortcut accelerator. | [nullable]
phase | the phase to activate within, or 0 for the default |

### dzl_shortcut_theme_load_from_data ()

    gboolean
    dzl_shortcut_theme_load_from_data (DzlShortcutTheme *self,
                                       const gchar *data,
                                       gssize len,
                                       GError **error);

### dzl_shortcut_theme_load_from_file ()

    gboolean
    dzl_shortcut_theme_load_from_file (DzlShortcutTheme *self,
                                       GFile *file,
                                       GCancellable *cancellable,
                                       GError **error);

### dzl_shortcut_theme_load_from_path ()

    gboolean
    dzl_shortcut_theme_load_from_path (DzlShortcutTheme *self,
                                       const gchar *path,
                                       GCancellable *cancellable,
                                       GError **error);

### dzl_shortcut_theme_save_to_file ()

    gboolean
    dzl_shortcut_theme_save_to_file (DzlShortcutTheme *self,
                                     GFile *file,
                                     GCancellable *cancellable,
                                     GError **error);

### dzl_shortcut_theme_save_to_stream ()

    gboolean
    dzl_shortcut_theme_save_to_stream (DzlShortcutTheme *self,
                                       GOutputStream *stream,
                                       GCancellable *cancellable,
                                       GError **error);

### dzl_shortcut_theme_save_to_path ()

    gboolean
    dzl_shortcut_theme_save_to_path (DzlShortcutTheme *self,
                                     const gchar *path,
                                     GCancellable *cancellable,
                                     GError **error);

### dzl_shortcut_theme_add_css_resource ()

    void
    dzl_shortcut_theme_add_css_resource (DzlShortcutTheme *self,
                                         const gchar *path);

### dzl_shortcut_theme_remove_css_resource ()

    void
    dzl_shortcut_theme_remove_css_resource
                                   (DzlShortcutTheme *self,
                                    const gchar *path);

## Types and Values

### DZL_TYPE_SHORTCUT_THEME

    #define DZL_TYPE_SHORTCUT_THEME (dzl_shortcut_theme_get_type())

### struct DzlShortcutThemeClass

    struct DzlShortcutThemeClass {
      GObjectClass parent_class;

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

### DzlShortcutTheme

    typedef struct _DzlShortcutTheme DzlShortcutTheme;

## Property Details

### The `“name”` property

      “name”                     char *

The name of the theme.

Owner: DzlShortcutTheme

Flags: Read / Write / Construct Only

Default value: NULL

### The `“parent-name”` property

      “parent-name”              char *

The name of the parent shortcut theme.

Owner: DzlShortcutTheme

Flags: Read / Write

Default value: NULL

### The `“subtitle”` property

      “subtitle”                 char *

The subtitle of the theme as used for UI elements.

Owner: DzlShortcutTheme

Flags: Read / Write

Default value: NULL

### The `“title”` property

      “title”                    char *

The title of the theme as used for UI elements.

Owner: DzlShortcutTheme

Flags: Read / Write

Default value: NULL