/* ApplicationShortcuts.c generated by valac 0.56.19, the Vala compiler
 * generated from ApplicationShortcuts.vala, do not modify */

/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: 2025 elementary, Inc. (https://elementary.io)
 */

#include <glib-object.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <gio/gdesktopappinfo.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define SETTINGS_DAEMON_BACKENDS_TYPE_APPLICATION_SHORTCUTS (settings_daemon_backends_application_shortcuts_get_type ())
#define SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETTINGS_DAEMON_BACKENDS_TYPE_APPLICATION_SHORTCUTS, SettingsDaemonBackendsApplicationShortcuts))
#define SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SETTINGS_DAEMON_BACKENDS_TYPE_APPLICATION_SHORTCUTS, SettingsDaemonBackendsApplicationShortcutsClass))
#define SETTINGS_DAEMON_BACKENDS_IS_APPLICATION_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SETTINGS_DAEMON_BACKENDS_TYPE_APPLICATION_SHORTCUTS))
#define SETTINGS_DAEMON_BACKENDS_IS_APPLICATION_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SETTINGS_DAEMON_BACKENDS_TYPE_APPLICATION_SHORTCUTS))
#define SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SETTINGS_DAEMON_BACKENDS_TYPE_APPLICATION_SHORTCUTS, SettingsDaemonBackendsApplicationShortcutsClass))

typedef struct _SettingsDaemonBackendsApplicationShortcuts SettingsDaemonBackendsApplicationShortcuts;
typedef struct _SettingsDaemonBackendsApplicationShortcutsClass SettingsDaemonBackendsApplicationShortcutsClass;
typedef struct _SettingsDaemonBackendsApplicationShortcutsPrivate SettingsDaemonBackendsApplicationShortcutsPrivate;

#define TYPE_SHELL_KEY_GRABBER (shell_key_grabber_get_type ())
#define SHELL_KEY_GRABBER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SHELL_KEY_GRABBER, ShellKeyGrabber))
#define IS_SHELL_KEY_GRABBER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SHELL_KEY_GRABBER))
#define SHELL_KEY_GRABBER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_SHELL_KEY_GRABBER, ShellKeyGrabberIface))

typedef struct _ShellKeyGrabber ShellKeyGrabber;
typedef struct _ShellKeyGrabberIface ShellKeyGrabberIface;

#define TYPE_SHELL_KEY_GRABBER_PROXY (shell_key_grabber_proxy_get_type ())
typedef enum  {
	ACTION_MODE_NONE = 0,
	ACTION_MODE_NORMAL = 1 << 0,
	ACTION_MODE_OVERVIEW = 1 << 1,
	ACTION_MODE_LOCK_SCREEN = 1 << 2,
	ACTION_MODE_UNLOCK_SCREEN = 1 << 3,
	ACTION_MODE_LOGIN_SCREEN = 1 << 4,
	ACTION_MODE_SYSTEM_MODAL = 1 << 5,
	ACTION_MODE_LOOKING_GLASS = 1 << 6,
	ACTION_MODE_POPUP = 1 << 7
} ActionMode;

#define TYPE_ACTION_MODE (action_mode_get_type ())
typedef enum  {
	META_KEY_BINDING_FLAGS_NONE = 0,
	META_KEY_BINDING_FLAGS_PER_WINDOW = 1 << 0,
	META_KEY_BINDING_FLAGS_BUILTIN = 1 << 1,
	META_KEY_BINDING_FLAGS_IS_REVERSED = 1 << 2,
	META_KEY_BINDING_FLAGS_NON_MASKABLE = 1 << 3,
	META_KEY_BINDING_FLAGS_IGNORE_AUTOREPEAT = 1 << 4
} MetaKeyBindingFlags;

#define META_TYPE_KEY_BINDING_FLAGS (meta_key_binding_flags_get_type ())

#define TYPE_ACCELERATOR (accelerator_get_type ())
typedef struct _Accelerator Accelerator;

#define TYPE_DESKTOP_INTEGRATION (desktop_integration_get_type ())
#define DESKTOP_INTEGRATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DESKTOP_INTEGRATION, DesktopIntegration))
#define IS_DESKTOP_INTEGRATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DESKTOP_INTEGRATION))
#define DESKTOP_INTEGRATION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_DESKTOP_INTEGRATION, DesktopIntegrationIface))

typedef struct _DesktopIntegration DesktopIntegration;
typedef struct _DesktopIntegrationIface DesktopIntegrationIface;

#define TYPE_DESKTOP_INTEGRATION_PROXY (desktop_integration_proxy_get_type ())

#define DESKTOP_INTEGRATION_TYPE_RUNNING_APPLICATION (desktop_integration_running_application_get_type ())
typedef struct _DesktopIntegrationRunningApplication DesktopIntegrationRunningApplication;

#define DESKTOP_INTEGRATION_TYPE_WINDOW (desktop_integration_window_get_type ())
typedef struct _DesktopIntegrationWindow DesktopIntegrationWindow;

#define SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_TYPE_ACTION_INFO (settings_daemon_backends_application_shortcuts_action_info_get_type ())
typedef struct _SettingsDaemonBackendsApplicationShortcutsActionInfo SettingsDaemonBackendsApplicationShortcutsActionInfo;
typedef enum  {
	SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_ACTION_TYPE_DESKTOP_FILE,
	SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_ACTION_TYPE_COMMAND_LINE
} SettingsDaemonBackendsApplicationShortcutsActionType;

#define SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_TYPE_ACTION_TYPE (settings_daemon_backends_application_shortcuts_action_type_get_type ())
enum  {
	SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_0_PROPERTY,
	SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_NUM_PROPERTIES
};
static GParamSpec* settings_daemon_backends_application_shortcuts_properties[SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_settings_schema_unref0(var) ((var == NULL) ? NULL : (var = (g_settings_schema_unref (var), NULL)))

#define SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_TYPE_PARSED (settings_daemon_backends_application_shortcuts_parsed_get_type ())
typedef struct _SettingsDaemonBackendsApplicationShortcutsParsed SettingsDaemonBackendsApplicationShortcutsParsed;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _settings_daemon_backends_application_shortcuts_action_info_free0(var) ((var == NULL) ? NULL : (var = (settings_daemon_backends_application_shortcuts_action_info_free (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _SettingsDaemonBackendsApplicationShortcuts {
	GObject parent_instance;
	SettingsDaemonBackendsApplicationShortcutsPrivate * priv;
};

struct _SettingsDaemonBackendsApplicationShortcutsClass {
	GObjectClass parent_class;
};

struct _Accelerator {
	gchar* name;
	ActionMode mode_flags;
	MetaKeyBindingFlags grab_flags;
};

struct _ShellKeyGrabberIface {
	GTypeInterface parent_iface;
	guint (*grab_accelerator) (ShellKeyGrabber* self, const gchar* accelerator, ActionMode mode_flags, MetaKeyBindingFlags grab_flags, GError** error);
	guint* (*grab_accelerators) (ShellKeyGrabber* self, Accelerator* accelerators, gint accelerators_length1, gint* result_length1, GError** error);
	gboolean (*ungrab_accelerator) (ShellKeyGrabber* self, guint action, GError** error);
	gboolean (*ungrab_accelerators) (ShellKeyGrabber* self, guint* actions, gint actions_length1, GError** error);
	void (*show_osd) (ShellKeyGrabber* self, GHashTable* parameters_dict, GError** error);
};

struct _DesktopIntegrationRunningApplication {
	gchar* app_id;
	GHashTable* details;
};

struct _DesktopIntegrationWindow {
	guint64 uid;
	GHashTable* properties;
};

struct _DesktopIntegrationIface {
	GTypeInterface parent_iface;
	DesktopIntegrationRunningApplication* (*get_running_applications) (DesktopIntegration* self, gint* result_length1, GError** error);
	DesktopIntegrationWindow* (*get_windows) (DesktopIntegration* self, gint* result_length1, GError** error);
	void (*focus_window) (DesktopIntegration* self, guint64 uid, GError** error);
};

struct _SettingsDaemonBackendsApplicationShortcutsActionInfo {
	SettingsDaemonBackendsApplicationShortcutsActionType type;
	gchar* target;
	GHashTable* parameters;
};

struct _SettingsDaemonBackendsApplicationShortcutsPrivate {
	GSettings* application_settings;
	ShellKeyGrabber* key_grabber;
	DesktopIntegration* desktop_integration;
	gulong key_grabber_id;
	GHashTable* saved_action_ids;
};

struct _SettingsDaemonBackendsApplicationShortcutsParsed {
	SettingsDaemonBackendsApplicationShortcutsActionType type;
	gchar* target;
	GHashTable* parameters;
	gchar** keybindings;
	gint keybindings_length1;
	gint _keybindings_size_;
};

struct _SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	SettingsDaemonBackendsApplicationShortcuts* self;
	GSettingsSchemaSource* settings_schema;
	GSettingsSchemaSource* _tmp0_;
	GSettingsSchemaSource* _tmp1_;
	GSettingsSchema* _tmp2_;
	GSettingsSchema* _tmp3_;
	gboolean _tmp4_;
	SettingsDaemonBackendsApplicationShortcutsParsed* value;
	GSettings* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	SettingsDaemonBackendsApplicationShortcutsParsed* _tmp8_;
	gint _tmp8__length1;
	SettingsDaemonBackendsApplicationShortcutsParsed* _tmp9_;
	gint _tmp9__length1;
	gint value_length1;
	gint _value_size_;
	GSettings* gsd_settings;
	GSettings* _tmp10_;
	gchar** enabled_keybindings;
	GSettings* _tmp11_;
	gchar** _tmp12_;
	gchar** _tmp13_;
	gint enabled_keybindings_length1;
	gint _enabled_keybindings_size_;
	gint i;
	gboolean _tmp14_;
	gint _tmp15_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	GSettings* settings;
	gchar** _tmp17_;
	gint _tmp17__length1;
	const gchar* _tmp18_;
	GSettings* _tmp19_;
	SettingsDaemonBackendsApplicationShortcutsParsed new_shortcut;
	GSettings* _tmp20_;
	gchar* _tmp21_;
	GHashTable* _tmp22_;
	GSettings* _tmp23_;
	gchar* _tmp24_;
	gchar** _tmp25_;
	SettingsDaemonBackendsApplicationShortcutsParsed _tmp26_;
	SettingsDaemonBackendsApplicationShortcutsParsed _tmp27_;
	SettingsDaemonBackendsApplicationShortcutsParsed _tmp28_;
	SettingsDaemonBackendsApplicationShortcutsParsed _tmp29_;
	GSettings* _tmp30_;
	SettingsDaemonBackendsApplicationShortcutsParsed* _tmp31_;
	gint _tmp31__length1;
	GVariant* _tmp43_;
	GSettings* _tmp44_;
	gchar** _tmp45_;
	gchar** _tmp46_;
	gint _tmp46__length1;
};

static gint SettingsDaemonBackendsApplicationShortcuts_private_offset;
static gpointer settings_daemon_backends_application_shortcuts_parent_class = NULL;

VALA_EXTERN GType settings_daemon_backends_application_shortcuts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SettingsDaemonBackendsApplicationShortcuts, g_object_unref)
VALA_EXTERN GType shell_key_grabber_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint shell_key_grabber_register_object (void* object,
                                         GDBusConnection* connection,
                                         const gchar* path,
                                         GError** error);
VALA_EXTERN GType action_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType meta_key_binding_flags_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType accelerator_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Accelerator* accelerator_dup (const Accelerator* self);
VALA_EXTERN void accelerator_free (Accelerator* self);
VALA_EXTERN void accelerator_copy (const Accelerator* self,
                       Accelerator* dest);
VALA_EXTERN void accelerator_destroy (Accelerator* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (Accelerator, accelerator_destroy)
VALA_EXTERN GType shell_key_grabber_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShellKeyGrabber, g_object_unref)
VALA_EXTERN GType desktop_integration_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint desktop_integration_register_object (void* object,
                                           GDBusConnection* connection,
                                           const gchar* path,
                                           GError** error);
VALA_EXTERN GType desktop_integration_running_application_get_type (void) G_GNUC_CONST ;
VALA_EXTERN DesktopIntegrationRunningApplication* desktop_integration_running_application_dup (const DesktopIntegrationRunningApplication* self);
VALA_EXTERN void desktop_integration_running_application_free (DesktopIntegrationRunningApplication* self);
VALA_EXTERN void desktop_integration_running_application_copy (const DesktopIntegrationRunningApplication* self,
                                                   DesktopIntegrationRunningApplication* dest);
VALA_EXTERN void desktop_integration_running_application_destroy (DesktopIntegrationRunningApplication* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (DesktopIntegrationRunningApplication, desktop_integration_running_application_destroy)
VALA_EXTERN GType desktop_integration_window_get_type (void) G_GNUC_CONST ;
VALA_EXTERN DesktopIntegrationWindow* desktop_integration_window_dup (const DesktopIntegrationWindow* self);
VALA_EXTERN void desktop_integration_window_free (DesktopIntegrationWindow* self);
VALA_EXTERN void desktop_integration_window_copy (const DesktopIntegrationWindow* self,
                                      DesktopIntegrationWindow* dest);
VALA_EXTERN void desktop_integration_window_destroy (DesktopIntegrationWindow* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (DesktopIntegrationWindow, desktop_integration_window_destroy)
VALA_EXTERN GType desktop_integration_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DesktopIntegration, g_object_unref)
static GType settings_daemon_backends_application_shortcuts_action_info_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GType settings_daemon_backends_application_shortcuts_action_type_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static SettingsDaemonBackendsApplicationShortcutsActionInfo* settings_daemon_backends_application_shortcuts_action_info_dup (const SettingsDaemonBackendsApplicationShortcutsActionInfo* self);
static void settings_daemon_backends_application_shortcuts_action_info_free (SettingsDaemonBackendsApplicationShortcutsActionInfo* self);
static void settings_daemon_backends_application_shortcuts_action_info_copy (const SettingsDaemonBackendsApplicationShortcutsActionInfo* self,
                                                                      SettingsDaemonBackendsApplicationShortcutsActionInfo* dest);
static void settings_daemon_backends_application_shortcuts_action_info_destroy (SettingsDaemonBackendsApplicationShortcutsActionInfo* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (SettingsDaemonBackendsApplicationShortcutsActionInfo, settings_daemon_backends_application_shortcuts_action_info_destroy)
static void settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts_data_free (gpointer _data);
static void settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts (SettingsDaemonBackendsApplicationShortcuts* self,
                                                                           GAsyncReadyCallback _callback_,
                                                                           gpointer _user_data_);
static void settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts_finish (SettingsDaemonBackendsApplicationShortcuts* self,
                                                                                  GAsyncResult* _res_);
static gboolean settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts_co (SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData* _data_);
static GType settings_daemon_backends_application_shortcuts_parsed_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static SettingsDaemonBackendsApplicationShortcutsParsed* settings_daemon_backends_application_shortcuts_parsed_dup (const SettingsDaemonBackendsApplicationShortcutsParsed* self);
static void settings_daemon_backends_application_shortcuts_parsed_free (SettingsDaemonBackendsApplicationShortcutsParsed* self);
static void settings_daemon_backends_application_shortcuts_parsed_copy (const SettingsDaemonBackendsApplicationShortcutsParsed* self,
                                                                 SettingsDaemonBackendsApplicationShortcutsParsed* dest);
static void settings_daemon_backends_application_shortcuts_parsed_destroy (SettingsDaemonBackendsApplicationShortcutsParsed* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (SettingsDaemonBackendsApplicationShortcutsParsed, settings_daemon_backends_application_shortcuts_parsed_destroy)
static SettingsDaemonBackendsApplicationShortcutsParsed* _variant_get1 (GVariant* value,
                                                                 gint* result_length1);
static void _g_free0_ (gpointer var);
static void _g_variant_unref0_ (gpointer var);
static void _vala_array_add1 (SettingsDaemonBackendsApplicationShortcutsParsed* * array,
                       gint* length,
                       gint* size,
                       const SettingsDaemonBackendsApplicationShortcutsParsed* value);
static GVariant* _variant_new1 (SettingsDaemonBackendsApplicationShortcutsParsed* value,
                         gint value_length1);
static void _vala_SettingsDaemonBackendsApplicationShortcutsParsed_array_free (SettingsDaemonBackendsApplicationShortcutsParsed * array,
                                                                        gssize array_length);
static void settings_daemon_backends_application_shortcuts_setup_grabs (SettingsDaemonBackendsApplicationShortcuts* self);
static SettingsDaemonBackendsApplicationShortcutsParsed* _variant_get2 (GVariant* value,
                                                                 gint* result_length1);
static gchar** _vala_array_dup2 (gchar** self,
                          gssize length);
static void _vala_array_add2 (Accelerator* * array,
                       gint* length,
                       gint* size,
                       const Accelerator* value);
VALA_EXTERN guint* shell_key_grabber_grab_accelerators (ShellKeyGrabber* self,
                                            Accelerator* accelerators,
                                            gint accelerators_length1,
                                            gint* result_length1,
                                            GError** error);
static void _vala_Accelerator_array_free (Accelerator * array,
                                   gssize array_length);
static void settings_daemon_backends_application_shortcuts_on_accelerator_activated (SettingsDaemonBackendsApplicationShortcuts* self,
                                                                              guint action,
                                                                              GHashTable* parameters_dict);
static void _settings_daemon_backends_application_shortcuts_on_accelerator_activated_shell_key_grabber_accelerator_activated (ShellKeyGrabber* _sender,
                                                                                                                       guint action,
                                                                                                                       GHashTable* parameters_dict,
                                                                                                                       gpointer self);
static guint32 _variant_get3 (GVariant* value);
VALA_EXTERN DesktopIntegrationRunningApplication* desktop_integration_get_running_applications (DesktopIntegration* self,
                                                                                    gint* result_length1,
                                                                                    GError** error);
static void _vala_DesktopIntegrationRunningApplication_array_free (DesktopIntegrationRunningApplication * array,
                                                            gssize array_length);
static void settings_daemon_backends_application_shortcuts_launch_app (SettingsDaemonBackendsApplicationShortcuts* self,
                                                                const gchar* desktop_file_name,
                                                                GdkAppLaunchContext* context);
VALA_EXTERN DesktopIntegrationWindow* desktop_integration_get_windows (DesktopIntegration* self,
                                                           gint* result_length1,
                                                           GError** error);
VALA_EXTERN void desktop_integration_focus_window (DesktopIntegration* self,
                                       guint64 uid,
                                       GError** error);
static void _vala_DesktopIntegrationWindow_array_free (DesktopIntegrationWindow * array,
                                                gssize array_length);
VALA_EXTERN SettingsDaemonBackendsApplicationShortcuts* settings_daemon_backends_application_shortcuts_new (void);
VALA_EXTERN SettingsDaemonBackendsApplicationShortcuts* settings_daemon_backends_application_shortcuts_construct (GType object_type);
static gchar** _vala_array_dup3 (gchar** self,
                          gssize length);
static GObject * settings_daemon_backends_application_shortcuts_constructor (GType type,
                                                                      guint n_construct_properties,
                                                                      GObjectConstructParam * construct_properties);
static void _settings_daemon_backends_application_shortcuts_action_info_free0_ (gpointer var);
static void _settings_daemon_backends_application_shortcuts___lambda17_ (SettingsDaemonBackendsApplicationShortcuts* self);
VALA_EXTERN gboolean shell_key_grabber_ungrab_accelerators (ShellKeyGrabber* self,
                                                guint* actions,
                                                gint actions_length1,
                                                GError** error);
static void __settings_daemon_backends_application_shortcuts___lambda17__g_settings_changed (GSettings* _sender,
                                                                                      const gchar* key,
                                                                                      gpointer self);
static void _settings_daemon_backends_application_shortcuts___lambda18_ (SettingsDaemonBackendsApplicationShortcuts* self,
                                                                  GObject* obj,
                                                                  GAsyncResult* res);
static void __settings_daemon_backends_application_shortcuts___lambda18__gasync_ready_callback (GObject* source_object,
                                                                                         GAsyncResult* res,
                                                                                         gpointer self);
static void _settings_daemon_backends_application_shortcuts___lambda19_ (SettingsDaemonBackendsApplicationShortcuts* self,
                                                                  GObject* obj,
                                                                  GAsyncResult* res);
static void __settings_daemon_backends_application_shortcuts___lambda19__gasync_ready_callback (GObject* source_object,
                                                                                         GAsyncResult* res,
                                                                                         gpointer self);
static void settings_daemon_backends_application_shortcuts_finalize (GObject * obj);
static GType settings_daemon_backends_application_shortcuts_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
settings_daemon_backends_application_shortcuts_get_instance_private (SettingsDaemonBackendsApplicationShortcuts* self)
{
	return G_STRUCT_MEMBER_P (self, SettingsDaemonBackendsApplicationShortcuts_private_offset);
}

static GType
settings_daemon_backends_application_shortcuts_action_type_get_type_once (void)
{
	static const GEnumValue values[] = {{SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_ACTION_TYPE_DESKTOP_FILE, "SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_ACTION_TYPE_DESKTOP_FILE", "desktop-file"}, {SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_ACTION_TYPE_COMMAND_LINE, "SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_ACTION_TYPE_COMMAND_LINE", "command-line"}, {0, NULL, NULL}};
	GType settings_daemon_backends_application_shortcuts_action_type_type_id;
	settings_daemon_backends_application_shortcuts_action_type_type_id = g_enum_register_static ("SettingsDaemonBackendsApplicationShortcutsActionType", values);
	return settings_daemon_backends_application_shortcuts_action_type_type_id;
}

static GType
settings_daemon_backends_application_shortcuts_action_type_get_type (void)
{
	static volatile gsize settings_daemon_backends_application_shortcuts_action_type_type_id__once = 0;
	if (g_once_init_enter (&settings_daemon_backends_application_shortcuts_action_type_type_id__once)) {
		GType settings_daemon_backends_application_shortcuts_action_type_type_id;
		settings_daemon_backends_application_shortcuts_action_type_type_id = settings_daemon_backends_application_shortcuts_action_type_get_type_once ();
		g_once_init_leave (&settings_daemon_backends_application_shortcuts_action_type_type_id__once, settings_daemon_backends_application_shortcuts_action_type_type_id);
	}
	return settings_daemon_backends_application_shortcuts_action_type_type_id__once;
}

static void
settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts_data_free (gpointer _data)
{
	SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData, _data_);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts (SettingsDaemonBackendsApplicationShortcuts* self,
                                                                      GAsyncReadyCallback _callback_,
                                                                      gpointer _user_data_)
{
	SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData* _data_;
	SettingsDaemonBackendsApplicationShortcuts* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts_co (_data_);
}

static void
settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts_finish (SettingsDaemonBackendsApplicationShortcuts* self,
                                                                             GAsyncResult* _res_)
{
	SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static SettingsDaemonBackendsApplicationShortcutsParsed*
_variant_get1 (GVariant* value,
               gint* result_length1)
{
	SettingsDaemonBackendsApplicationShortcutsParsed* _tmp0_;
	gint _tmp0__length;
	gint _tmp0__size;
	gint _tmp0__length1;
	GVariantIter _tmp1_;
	GVariant* _tmp2_;
	_tmp0_ = g_new (SettingsDaemonBackendsApplicationShortcutsParsed, 5);
	_tmp0__length = 0;
	_tmp0__size = 4;
	_tmp0__length1 = 0;
	g_variant_iter_init (&_tmp1_, value);
	for (; (_tmp2_ = g_variant_iter_next_value (&_tmp1_)) != NULL; _tmp0__length1++) {
		SettingsDaemonBackendsApplicationShortcutsParsed _tmp3_;
		GVariantIter _tmp4_;
		GVariant* _tmp5_;
		GVariant* _tmp6_;
		GVariant* _tmp7_;
		GHashTable* _tmp8_;
		GVariantIter _tmp9_;
		GVariant* _tmp10_;
		GVariant* _tmp11_;
		GVariant* _tmp12_;
		gchar** _tmp13_;
		gint _tmp13__length;
		gint _tmp13__size;
		gint _tmp13__length1;
		GVariantIter _tmp14_;
		GVariant* _tmp15_;
		if (_tmp0__size == _tmp0__length) {
			_tmp0__size = 2 * _tmp0__size;
			_tmp0_ = g_renew (SettingsDaemonBackendsApplicationShortcutsParsed, _tmp0_, _tmp0__size + 1);
		}
		g_variant_iter_init (&_tmp4_, _tmp2_);
		_tmp5_ = g_variant_iter_next_value (&_tmp4_);
		_tmp3_.type = g_variant_get_int32 (_tmp5_);
		g_variant_unref (_tmp5_);
		_tmp6_ = g_variant_iter_next_value (&_tmp4_);
		_tmp3_.target = g_variant_dup_string (_tmp6_, NULL);
		g_variant_unref (_tmp6_);
		_tmp7_ = g_variant_iter_next_value (&_tmp4_);
		_tmp8_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
		g_variant_iter_init (&_tmp9_, _tmp7_);
		while (g_variant_iter_loop (&_tmp9_, "{?*}", &_tmp10_, &_tmp11_)) {
			g_hash_table_insert (_tmp8_, g_variant_dup_string (_tmp10_, NULL), g_variant_get_variant (_tmp11_));
		}
		_tmp3_.parameters = _tmp8_;
		g_variant_unref (_tmp7_);
		_tmp12_ = g_variant_iter_next_value (&_tmp4_);
		_tmp13_ = g_new (gchar*, 5);
		_tmp13__length = 0;
		_tmp13__size = 4;
		_tmp13__length1 = 0;
		g_variant_iter_init (&_tmp14_, _tmp12_);
		for (; (_tmp15_ = g_variant_iter_next_value (&_tmp14_)) != NULL; _tmp13__length1++) {
			if (_tmp13__size == _tmp13__length) {
				_tmp13__size = 2 * _tmp13__size;
				_tmp13_ = g_renew (gchar*, _tmp13_, _tmp13__size + 1);
			}
			_tmp13_[_tmp13__length++] = g_variant_dup_string (_tmp15_, NULL);
			g_variant_unref (_tmp15_);
		}
		_tmp3_.keybindings_length1 = _tmp13__length1;
		_tmp13_[_tmp13__length] = NULL;
		_tmp3_.keybindings = _tmp13_;
		g_variant_unref (_tmp12_);
		_tmp0_[_tmp0__length++] = _tmp3_;
		g_variant_unref (_tmp2_);
	}
	*result_length1 = _tmp0__length1;
	return _tmp0_;
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_g_variant_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
}

static void
_vala_array_add1 (SettingsDaemonBackendsApplicationShortcutsParsed* * array,
                  gint* length,
                  gint* size,
                  const SettingsDaemonBackendsApplicationShortcutsParsed* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (SettingsDaemonBackendsApplicationShortcutsParsed, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static GVariant*
_variant_new1 (SettingsDaemonBackendsApplicationShortcutsParsed* value,
               gint value_length1)
{
	SettingsDaemonBackendsApplicationShortcutsParsed* _tmp32_;
	GVariantBuilder _tmp33_;
	gint _tmp34_;
	_tmp32_ = value;
	g_variant_builder_init (&_tmp33_, G_VARIANT_TYPE ("a(isa{sv}as)"));
	for (_tmp34_ = 0; _tmp34_ < value_length1; _tmp34_++) {
		GVariantBuilder _tmp35_;
		GVariantBuilder _tmp36_;
		GHashTableIter _tmp37_;
		gpointer _tmp38_;
		gpointer _tmp39_;
		gchar** _tmp40_;
		GVariantBuilder _tmp41_;
		gint _tmp42_;
		g_variant_builder_init (&_tmp35_, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_tmp35_, g_variant_new_int32 ((*_tmp32_).type));
		g_variant_builder_add_value (&_tmp35_, g_variant_new_string ((*_tmp32_).target));
		g_hash_table_iter_init (&_tmp37_, (*_tmp32_).parameters);
		g_variant_builder_init (&_tmp36_, G_VARIANT_TYPE ("a{sv}"));
		while (g_hash_table_iter_next (&_tmp37_, &_tmp38_, &_tmp39_)) {
			gchar* _key;
			GVariant* _value;
			_key = (gchar*) _tmp38_;
			_value = (GVariant*) _tmp39_;
			g_variant_builder_add (&_tmp36_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
		}
		g_variant_builder_add_value (&_tmp35_, g_variant_builder_end (&_tmp36_));
		_tmp40_ = (*_tmp32_).keybindings;
		g_variant_builder_init (&_tmp41_, G_VARIANT_TYPE ("as"));
		for (_tmp42_ = 0; _tmp42_ < (*_tmp32_).keybindings_length1; _tmp42_++) {
			g_variant_builder_add_value (&_tmp41_, g_variant_new_string (*_tmp40_));
			_tmp40_++;
		}
		g_variant_builder_add_value (&_tmp35_, g_variant_builder_end (&_tmp41_));
		g_variant_builder_add_value (&_tmp33_, g_variant_builder_end (&_tmp35_));
		_tmp32_++;
	}
	return g_variant_ref_sink (g_variant_builder_end (&_tmp33_));
}

static void
_vala_SettingsDaemonBackendsApplicationShortcutsParsed_array_free (SettingsDaemonBackendsApplicationShortcutsParsed * array,
                                                                   gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			settings_daemon_backends_application_shortcuts_parsed_destroy (&array[i]);
		}
	}
	g_free (array);
}

static gboolean
settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts_co (SettingsDaemonBackendsApplicationShortcutsMigrateGsdShortcutsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = g_settings_schema_source_get_default ();
	_data_->settings_schema = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->settings_schema;
	_data_->_tmp2_ = g_settings_schema_source_lookup (_data_->_tmp1_, "org.gnome.settings-daemon.plugins.media-keys", FALSE);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = _data_->_tmp3_ != NULL;
	_g_settings_schema_unref0 (_data_->_tmp3_);
	if (_data_->_tmp4_) {
		_data_->_tmp5_ = _data_->self->priv->application_settings;
		_data_->_tmp6_ = g_settings_get_value (_data_->_tmp5_, "application-shortcuts");
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = NULL;
		_data_->_tmp8__length1 = 0;
		_data_->_tmp8_ = _variant_get1 (_data_->_tmp7_, &_data_->_tmp8__length1);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp9__length1 = _data_->_tmp8__length1;
		_g_variant_unref0 (_data_->_tmp7_);
		_data_->value = _data_->_tmp9_;
		_data_->value_length1 = _data_->_tmp9__length1;
		_data_->_value_size_ = _data_->value_length1;
		_data_->_tmp10_ = g_settings_new ("org.gnome.settings-daemon.plugins.media-keys");
		_data_->gsd_settings = _data_->_tmp10_;
		_data_->_tmp11_ = _data_->gsd_settings;
		_data_->_tmp13_ = _data_->_tmp12_ = g_settings_get_strv (_data_->_tmp11_, "custom-keybindings");
		_data_->enabled_keybindings = _data_->_tmp13_;
		_data_->enabled_keybindings_length1 = _vala_array_length (_data_->_tmp12_);
		_data_->_enabled_keybindings_size_ = _data_->enabled_keybindings_length1;
		{
			_data_->i = 0;
			{
				_data_->_tmp14_ = TRUE;
				while (TRUE) {
					if (!_data_->_tmp14_) {
						_data_->_tmp15_ = _data_->i;
						_data_->i = _data_->_tmp15_ + 1;
					}
					_data_->_tmp14_ = FALSE;
					_data_->_tmp16_ = _data_->enabled_keybindings;
					_data_->_tmp16__length1 = _data_->enabled_keybindings_length1;
					if (!(_data_->i < _data_->_tmp16__length1)) {
						break;
					}
					_data_->_tmp17_ = _data_->enabled_keybindings;
					_data_->_tmp17__length1 = _data_->enabled_keybindings_length1;
					_data_->_tmp18_ = _data_->_tmp17_[_data_->i];
					_data_->_tmp19_ = g_settings_new_with_path ("org.gnome.settings-daemon.plugins.media-keys.custom-keybinding", _data_->_tmp18_);
					_data_->settings = _data_->_tmp19_;
					_data_->_tmp20_ = _data_->settings;
					_data_->_tmp21_ = g_settings_get_string (_data_->_tmp20_, "command");
					_data_->_tmp22_ = g_hash_table_new_full (NULL, NULL, _g_free0_, _g_variant_unref0_);
					_data_->_tmp23_ = _data_->settings;
					_data_->_tmp24_ = g_settings_get_string (_data_->_tmp23_, "binding");
					_data_->_tmp25_ = g_new0 (gchar*, 1 + 1);
					_data_->_tmp25_[0] = _data_->_tmp24_;
					memset (&_data_->_tmp26_, 0, sizeof (SettingsDaemonBackendsApplicationShortcutsParsed));
					_data_->_tmp26_.type = SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_ACTION_TYPE_COMMAND_LINE;
					_g_free0 (_data_->_tmp26_.target);
					_data_->_tmp26_.target = _data_->_tmp21_;
					_g_hash_table_unref0 (_data_->_tmp26_.parameters);
					_data_->_tmp26_.parameters = _data_->_tmp22_;
					_data_->_tmp26_.keybindings = (_vala_array_free (_data_->_tmp26_.keybindings, _data_->_tmp26_.keybindings_length1, (GDestroyNotify) g_free), NULL);
					_data_->_tmp26_.keybindings = _data_->_tmp25_;
					_data_->_tmp26_.keybindings_length1 = 1;
					_data_->_tmp26_._keybindings_size_ = _data_->_tmp26_.keybindings_length1;
					_data_->new_shortcut = _data_->_tmp26_;
					_data_->_tmp27_ = _data_->new_shortcut;
					_data_->_tmp28_ = _data_->_tmp27_;
					memset (&_data_->_tmp29_, 0, sizeof (SettingsDaemonBackendsApplicationShortcutsParsed));
					settings_daemon_backends_application_shortcuts_parsed_copy (&_data_->_tmp28_, &_data_->_tmp29_);
					_vala_array_add1 (&_data_->value, &_data_->value_length1, &_data_->_value_size_, &_data_->_tmp29_);
					settings_daemon_backends_application_shortcuts_parsed_destroy (&_data_->new_shortcut);
					_g_object_unref0 (_data_->settings);
				}
			}
		}
		_data_->_tmp30_ = _data_->self->priv->application_settings;
		_data_->_tmp31_ = _data_->value;
		_data_->_tmp31__length1 = _data_->value_length1;
		_data_->_tmp43_ = _variant_new1 (_data_->_tmp31_, _data_->_tmp31__length1);
		g_settings_set_value (_data_->_tmp30_, "application-shortcuts", _data_->_tmp43_);
		_g_variant_unref0 (_data_->_tmp43_);
		_data_->_tmp44_ = _data_->gsd_settings;
		_data_->_tmp45_ = g_new0 (gchar*, 0 + 1);
		_data_->_tmp46_ = _data_->_tmp45_;
		_data_->_tmp46__length1 = 0;
		g_settings_set_strv (_data_->_tmp44_, "custom-keybindings", _data_->_tmp46_);
		_data_->_tmp46_ = (_vala_array_free (_data_->_tmp46_, _data_->_tmp46__length1, (GDestroyNotify) g_free), NULL);
		_data_->enabled_keybindings = (_vala_array_free (_data_->enabled_keybindings, _data_->enabled_keybindings_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (_data_->gsd_settings);
		_data_->value = (_vala_SettingsDaemonBackendsApplicationShortcutsParsed_array_free (_data_->value, _data_->value_length1), NULL);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static SettingsDaemonBackendsApplicationShortcutsParsed*
_variant_get2 (GVariant* value,
               gint* result_length1)
{
	SettingsDaemonBackendsApplicationShortcutsParsed* _tmp0_;
	gint _tmp0__length;
	gint _tmp0__size;
	gint _tmp0__length1;
	GVariantIter _tmp1_;
	GVariant* _tmp2_;
	_tmp0_ = g_new (SettingsDaemonBackendsApplicationShortcutsParsed, 5);
	_tmp0__length = 0;
	_tmp0__size = 4;
	_tmp0__length1 = 0;
	g_variant_iter_init (&_tmp1_, value);
	for (; (_tmp2_ = g_variant_iter_next_value (&_tmp1_)) != NULL; _tmp0__length1++) {
		SettingsDaemonBackendsApplicationShortcutsParsed _tmp3_;
		GVariantIter _tmp4_;
		GVariant* _tmp5_;
		GVariant* _tmp6_;
		GVariant* _tmp7_;
		GHashTable* _tmp8_;
		GVariantIter _tmp9_;
		GVariant* _tmp10_;
		GVariant* _tmp11_;
		GVariant* _tmp12_;
		gchar** _tmp13_;
		gint _tmp13__length;
		gint _tmp13__size;
		gint _tmp13__length1;
		GVariantIter _tmp14_;
		GVariant* _tmp15_;
		if (_tmp0__size == _tmp0__length) {
			_tmp0__size = 2 * _tmp0__size;
			_tmp0_ = g_renew (SettingsDaemonBackendsApplicationShortcutsParsed, _tmp0_, _tmp0__size + 1);
		}
		g_variant_iter_init (&_tmp4_, _tmp2_);
		_tmp5_ = g_variant_iter_next_value (&_tmp4_);
		_tmp3_.type = g_variant_get_int32 (_tmp5_);
		g_variant_unref (_tmp5_);
		_tmp6_ = g_variant_iter_next_value (&_tmp4_);
		_tmp3_.target = g_variant_dup_string (_tmp6_, NULL);
		g_variant_unref (_tmp6_);
		_tmp7_ = g_variant_iter_next_value (&_tmp4_);
		_tmp8_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
		g_variant_iter_init (&_tmp9_, _tmp7_);
		while (g_variant_iter_loop (&_tmp9_, "{?*}", &_tmp10_, &_tmp11_)) {
			g_hash_table_insert (_tmp8_, g_variant_dup_string (_tmp10_, NULL), g_variant_get_variant (_tmp11_));
		}
		_tmp3_.parameters = _tmp8_;
		g_variant_unref (_tmp7_);
		_tmp12_ = g_variant_iter_next_value (&_tmp4_);
		_tmp13_ = g_new (gchar*, 5);
		_tmp13__length = 0;
		_tmp13__size = 4;
		_tmp13__length1 = 0;
		g_variant_iter_init (&_tmp14_, _tmp12_);
		for (; (_tmp15_ = g_variant_iter_next_value (&_tmp14_)) != NULL; _tmp13__length1++) {
			if (_tmp13__size == _tmp13__length) {
				_tmp13__size = 2 * _tmp13__size;
				_tmp13_ = g_renew (gchar*, _tmp13_, _tmp13__size + 1);
			}
			_tmp13_[_tmp13__length++] = g_variant_dup_string (_tmp15_, NULL);
			g_variant_unref (_tmp15_);
		}
		_tmp3_.keybindings_length1 = _tmp13__length1;
		_tmp13_[_tmp13__length] = NULL;
		_tmp3_.keybindings = _tmp13_;
		g_variant_unref (_tmp12_);
		_tmp0_[_tmp0__length++] = _tmp3_;
		g_variant_unref (_tmp2_);
	}
	*result_length1 = _tmp0__length1;
	return _tmp0_;
}

static gchar**
_vala_array_dup2 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
_vala_array_add2 (Accelerator* * array,
                  gint* length,
                  gint* size,
                  const Accelerator* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (Accelerator, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_Accelerator_array_free (Accelerator * array,
                              gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			accelerator_destroy (&array[i]);
		}
	}
	g_free (array);
}

static gpointer
_g_hash_table_ref0 (gpointer self)
{
	return self ? g_hash_table_ref (self) : NULL;
}

static gpointer
_settings_daemon_backends_application_shortcuts_action_info_dup0 (gpointer self)
{
	return self ? settings_daemon_backends_application_shortcuts_action_info_dup (self) : NULL;
}

static void
_settings_daemon_backends_application_shortcuts_on_accelerator_activated_shell_key_grabber_accelerator_activated (ShellKeyGrabber* _sender,
                                                                                                                  guint action,
                                                                                                                  GHashTable* parameters_dict,
                                                                                                                  gpointer self)
{
	settings_daemon_backends_application_shortcuts_on_accelerator_activated ((SettingsDaemonBackendsApplicationShortcuts*) self, action, parameters_dict);
}

static void
settings_daemon_backends_application_shortcuts_setup_grabs (SettingsDaemonBackendsApplicationShortcuts* self)
{
	ShellKeyGrabber* _tmp0_;
	Accelerator* accelerators = NULL;
	Accelerator* _tmp1_;
	gint accelerators_length1;
	gint _accelerators_size_;
	SettingsDaemonBackendsApplicationShortcutsParsed* parsed_value = NULL;
	GSettings* _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	SettingsDaemonBackendsApplicationShortcutsParsed* _tmp5_ = NULL;
	gint _tmp5__length1 = 0;
	SettingsDaemonBackendsApplicationShortcutsParsed* _tmp6_;
	gint _tmp6__length1;
	gint parsed_value_length1;
	gint _parsed_value_size_;
	guint* action_ids = NULL;
	gint action_ids_length1 = 0;
	gint _action_ids_size_ = 0;
	ShellKeyGrabber* _tmp49_;
	gulong _tmp50_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->key_grabber;
	_vala_return_if_fail (_tmp0_ != NULL, "key_grabber != null");
	_tmp1_ = g_new0 (Accelerator, 0);
	accelerators = _tmp1_;
	accelerators_length1 = 0;
	_accelerators_size_ = accelerators_length1;
	_tmp2_ = self->priv->application_settings;
	_tmp3_ = g_settings_get_value (_tmp2_, "application-shortcuts");
	_tmp4_ = _tmp3_;
	_tmp5_ = _variant_get2 (_tmp4_, &_tmp5__length1);
	_tmp6_ = _tmp5_;
	_tmp6__length1 = _tmp5__length1;
	_g_variant_unref0 (_tmp4_);
	parsed_value = _tmp6_;
	parsed_value_length1 = _tmp6__length1;
	_parsed_value_size_ = parsed_value_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp7_ = FALSE;
			_tmp7_ = TRUE;
			while (TRUE) {
				SettingsDaemonBackendsApplicationShortcutsParsed* _tmp9_;
				gint _tmp9__length1;
				gchar** keybindings = NULL;
				SettingsDaemonBackendsApplicationShortcutsParsed* _tmp10_;
				gint _tmp10__length1;
				SettingsDaemonBackendsApplicationShortcutsParsed _tmp11_;
				gchar** _tmp12_;
				gint _tmp12__length1;
				gchar** _tmp13_;
				gint _tmp13__length1;
				gint keybindings_length1;
				gint _keybindings_size_;
				if (!_tmp7_) {
					gint _tmp8_;
					_tmp8_ = i;
					i = _tmp8_ + 1;
				}
				_tmp7_ = FALSE;
				_tmp9_ = parsed_value;
				_tmp9__length1 = parsed_value_length1;
				if (!(i < _tmp9__length1)) {
					break;
				}
				_tmp10_ = parsed_value;
				_tmp10__length1 = parsed_value_length1;
				_tmp11_ = _tmp10_[i];
				_tmp12_ = _tmp11_.keybindings;
				_tmp12__length1 = _tmp11_.keybindings_length1;
				_tmp13_ = (_tmp12_ != NULL) ? _vala_array_dup2 (_tmp12_, _tmp12__length1) : _tmp12_;
				_tmp13__length1 = _tmp12__length1;
				keybindings = _tmp13_;
				keybindings_length1 = _tmp13__length1;
				_keybindings_size_ = keybindings_length1;
				{
					gint j = 0;
					j = 0;
					{
						gboolean _tmp14_ = FALSE;
						_tmp14_ = TRUE;
						while (TRUE) {
							gchar** _tmp16_;
							gint _tmp16__length1;
							gchar** _tmp17_;
							gint _tmp17__length1;
							const gchar* _tmp18_;
							gchar* _tmp19_;
							Accelerator _tmp20_ = {0};
							if (!_tmp14_) {
								gint _tmp15_;
								_tmp15_ = j;
								j = _tmp15_ + 1;
							}
							_tmp14_ = FALSE;
							_tmp16_ = keybindings;
							_tmp16__length1 = keybindings_length1;
							if (!(j < _tmp16__length1)) {
								break;
							}
							_tmp17_ = keybindings;
							_tmp17__length1 = keybindings_length1;
							_tmp18_ = _tmp17_[j];
							_tmp19_ = g_strdup (_tmp18_);
							memset (&_tmp20_, 0, sizeof (Accelerator));
							_g_free0 (_tmp20_.name);
							_tmp20_.name = _tmp19_;
							_tmp20_.mode_flags = ACTION_MODE_NONE;
							_tmp20_.grab_flags = META_KEY_BINDING_FLAGS_NONE;
							_vala_array_add2 (&accelerators, &accelerators_length1, &_accelerators_size_, &_tmp20_);
						}
					}
				}
				keybindings = (_vala_array_free (keybindings, keybindings_length1, (GDestroyNotify) g_free), NULL);
			}
		}
	}
	{
		guint* _tmp21_ = NULL;
		ShellKeyGrabber* _tmp22_;
		Accelerator* _tmp23_;
		gint _tmp23__length1;
		gint _tmp24_ = 0;
		guint* _tmp25_;
		gint _tmp21__length1;
		gint __tmp21__size_;
		guint* _tmp26_;
		gint _tmp26__length1;
		_tmp22_ = self->priv->key_grabber;
		_tmp23_ = accelerators;
		_tmp23__length1 = accelerators_length1;
		_tmp25_ = shell_key_grabber_grab_accelerators (_tmp22_, _tmp23_, (gint) _tmp23__length1, &_tmp24_, &_inner_error0_);
		_tmp21_ = _tmp25_;
		_tmp21__length1 = _tmp24_;
		__tmp21__size_ = _tmp21__length1;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp26_ = _tmp21_;
		_tmp26__length1 = _tmp21__length1;
		_tmp21_ = NULL;
		_tmp21__length1 = 0;
		action_ids = (g_free (action_ids), NULL);
		action_ids = _tmp26_;
		action_ids_length1 = _tmp26__length1;
		_action_ids_size_ = action_ids_length1;
		_tmp21_ = (g_free (_tmp21_), NULL);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp27_;
		const gchar* _tmp28_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp27_ = e;
		_tmp28_ = _tmp27_->message;
		g_critical ("ApplicationShortcuts.vala:127: %s", _tmp28_);
		_g_error_free0 (e);
		action_ids = (g_free (action_ids), NULL);
		parsed_value = (_vala_SettingsDaemonBackendsApplicationShortcutsParsed_array_free (parsed_value, parsed_value_length1), NULL);
		accelerators = (_vala_Accelerator_array_free (accelerators, accelerators_length1), NULL);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		action_ids = (g_free (action_ids), NULL);
		parsed_value = (_vala_SettingsDaemonBackendsApplicationShortcutsParsed_array_free (parsed_value, parsed_value_length1), NULL);
		accelerators = (_vala_Accelerator_array_free (accelerators, accelerators_length1), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp29_ = FALSE;
			_tmp29_ = TRUE;
			while (TRUE) {
				guint* _tmp31_;
				gint _tmp31__length1;
				SettingsDaemonBackendsApplicationShortcutsParsed parsed_value_i = {0};
				SettingsDaemonBackendsApplicationShortcutsParsed* _tmp32_;
				gint _tmp32__length1;
				SettingsDaemonBackendsApplicationShortcutsParsed _tmp33_;
				SettingsDaemonBackendsApplicationShortcutsParsed _tmp34_;
				SettingsDaemonBackendsApplicationShortcutsParsed _tmp35_ = {0};
				GHashTable* _tmp36_;
				guint* _tmp37_;
				gint _tmp37__length1;
				guint _tmp38_;
				SettingsDaemonBackendsApplicationShortcutsParsed _tmp39_;
				SettingsDaemonBackendsApplicationShortcutsParsed _tmp40_;
				const gchar* _tmp41_;
				gchar* _tmp42_;
				SettingsDaemonBackendsApplicationShortcutsParsed _tmp43_;
				GHashTable* _tmp44_;
				GHashTable* _tmp45_;
				SettingsDaemonBackendsApplicationShortcutsActionInfo _tmp46_ = {0};
				SettingsDaemonBackendsApplicationShortcutsActionInfo _tmp47_;
				SettingsDaemonBackendsApplicationShortcutsActionInfo* _tmp48_;
				if (!_tmp29_) {
					gint _tmp30_;
					_tmp30_ = i;
					i = _tmp30_ + 1;
				}
				_tmp29_ = FALSE;
				_tmp31_ = action_ids;
				_tmp31__length1 = action_ids_length1;
				if (!(i < _tmp31__length1)) {
					break;
				}
				_tmp32_ = parsed_value;
				_tmp32__length1 = parsed_value_length1;
				_tmp33_ = _tmp32_[i];
				_tmp34_ = _tmp33_;
				settings_daemon_backends_application_shortcuts_parsed_copy (&_tmp34_, &_tmp35_);
				parsed_value_i = _tmp35_;
				_tmp36_ = self->priv->saved_action_ids;
				_tmp37_ = action_ids;
				_tmp37__length1 = action_ids_length1;
				_tmp38_ = _tmp37_[i];
				_tmp39_ = parsed_value_i;
				_tmp40_ = parsed_value_i;
				_tmp41_ = _tmp40_.target;
				_tmp42_ = g_strdup (_tmp41_);
				_tmp43_ = parsed_value_i;
				_tmp44_ = _tmp43_.parameters;
				_tmp45_ = _g_hash_table_ref0 (_tmp44_);
				_tmp46_.type = _tmp39_.type;
				_g_free0 (_tmp46_.target);
				_tmp46_.target = _tmp42_;
				_g_hash_table_unref0 (_tmp46_.parameters);
				_tmp46_.parameters = _tmp45_;
				_tmp47_ = _tmp46_;
				_tmp48_ = _settings_daemon_backends_application_shortcuts_action_info_dup0 (&_tmp47_);
				g_hash_table_insert (_tmp36_, (gpointer) ((guintptr) _tmp38_), _tmp48_);
				settings_daemon_backends_application_shortcuts_action_info_destroy (&_tmp47_);
				settings_daemon_backends_application_shortcuts_parsed_destroy (&parsed_value_i);
			}
		}
	}
	_tmp49_ = self->priv->key_grabber;
	_tmp50_ = g_signal_connect_object (_tmp49_, "accelerator-activated", (GCallback) _settings_daemon_backends_application_shortcuts_on_accelerator_activated_shell_key_grabber_accelerator_activated, self, 0);
	self->priv->key_grabber_id = _tmp50_;
	action_ids = (g_free (action_ids), NULL);
	parsed_value = (_vala_SettingsDaemonBackendsApplicationShortcutsParsed_array_free (parsed_value, parsed_value_length1), NULL);
	accelerators = (_vala_Accelerator_array_free (accelerators, accelerators_length1), NULL);
}

static guint32
_variant_get3 (GVariant* value)
{
	return g_variant_get_uint32 (value);
}

static void
_vala_DesktopIntegrationRunningApplication_array_free (DesktopIntegrationRunningApplication * array,
                                                       gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			desktop_integration_running_application_destroy (&array[i]);
		}
	}
	g_free (array);
}

static void
_vala_DesktopIntegrationWindow_array_free (DesktopIntegrationWindow * array,
                                           gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			desktop_integration_window_destroy (&array[i]);
		}
	}
	g_free (array);
}

static void
settings_daemon_backends_application_shortcuts_on_accelerator_activated (SettingsDaemonBackendsApplicationShortcuts* self,
                                                                         guint action,
                                                                         GHashTable* parameters_dict)
{
	SettingsDaemonBackendsApplicationShortcutsActionInfo* action_info = NULL;
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	SettingsDaemonBackendsApplicationShortcutsActionInfo* _tmp2_;
	SettingsDaemonBackendsApplicationShortcutsActionInfo* _tmp3_;
	GdkAppLaunchContext* context = NULL;
	GdkDisplay* _tmp4_;
	GdkAppLaunchContext* _tmp5_;
	guint32 _tmp6_ = 0U;
	GdkAppLaunchContext* _tmp9_;
	GHashTable* action_parameters = NULL;
	SettingsDaemonBackendsApplicationShortcutsActionInfo* _tmp10_;
	GHashTable* _tmp11_;
	GHashTable* _tmp12_;
	SettingsDaemonBackendsApplicationShortcutsActionInfo* _tmp13_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (parameters_dict != NULL);
	_tmp0_ = self->priv->saved_action_ids;
	_tmp1_ = g_hash_table_lookup (_tmp0_, (gpointer) ((guintptr) action));
	_tmp2_ = _settings_daemon_backends_application_shortcuts_action_info_dup0 ((SettingsDaemonBackendsApplicationShortcutsActionInfo*) _tmp1_);
	action_info = _tmp2_;
	_tmp3_ = action_info;
	if (_tmp3_ == NULL) {
		_settings_daemon_backends_application_shortcuts_action_info_free0 (action_info);
		return;
	}
	_tmp4_ = gdk_display_get_default ();
	_tmp5_ = gdk_display_get_app_launch_context (_tmp4_);
	context = _tmp5_;
	if (g_hash_table_contains (parameters_dict, "timestamp")) {
		gconstpointer _tmp7_;
		guint32 _tmp8_;
		_tmp7_ = g_hash_table_lookup (parameters_dict, "timestamp");
		_tmp8_ = _variant_get3 ((GVariant*) _tmp7_);
		_tmp6_ = _tmp8_;
	} else {
		_tmp6_ = (guint32) GDK_CURRENT_TIME;
	}
	_tmp9_ = context;
	gdk_app_launch_context_set_timestamp (_tmp9_, _tmp6_);
	_tmp10_ = action_info;
	_tmp11_ = (*_tmp10_).parameters;
	_tmp12_ = _g_hash_table_ref0 (_tmp11_);
	action_parameters = _tmp12_;
	_tmp13_ = action_info;
	switch ((*_tmp13_).type) {
		case SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_ACTION_TYPE_DESKTOP_FILE:
		{
			gchar* desktop_file_name = NULL;
			SettingsDaemonBackendsApplicationShortcutsActionInfo* _tmp14_;
			const gchar* _tmp15_;
			gchar* _tmp16_;
			DesktopIntegrationRunningApplication* apps = NULL;
			DesktopIntegrationRunningApplication* _tmp17_;
			gint apps_length1;
			gint _apps_size_;
			DesktopIntegration* _tmp18_;
			gboolean already_launched = FALSE;
			GHashTable* _tmp33_;
			_tmp14_ = action_info;
			_tmp15_ = (*_tmp14_).target;
			_tmp16_ = g_strdup (_tmp15_);
			desktop_file_name = _tmp16_;
			_tmp17_ = g_new0 (DesktopIntegrationRunningApplication, 0);
			apps = _tmp17_;
			apps_length1 = 0;
			_apps_size_ = apps_length1;
			_tmp18_ = self->priv->desktop_integration;
			if (_tmp18_ != NULL) {
				{
					DesktopIntegrationRunningApplication* _tmp19_ = NULL;
					DesktopIntegration* _tmp20_;
					gint _tmp21_ = 0;
					DesktopIntegrationRunningApplication* _tmp22_;
					gint _tmp19__length1;
					gint __tmp19__size_;
					DesktopIntegrationRunningApplication* _tmp23_;
					gint _tmp23__length1;
					_tmp20_ = self->priv->desktop_integration;
					_tmp22_ = desktop_integration_get_running_applications (_tmp20_, &_tmp21_, &_inner_error0_);
					_tmp19_ = _tmp22_;
					_tmp19__length1 = _tmp21_;
					__tmp19__size_ = _tmp19__length1;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
					_tmp23_ = _tmp19_;
					_tmp23__length1 = _tmp19__length1;
					_tmp19_ = NULL;
					_tmp19__length1 = 0;
					apps = (_vala_DesktopIntegrationRunningApplication_array_free (apps, apps_length1), NULL);
					apps = _tmp23_;
					apps_length1 = _tmp23__length1;
					_apps_size_ = apps_length1;
					_tmp19_ = (_vala_DesktopIntegrationRunningApplication_array_free (_tmp19_, _tmp19__length1), NULL);
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* e = NULL;
					GError* _tmp24_;
					const gchar* _tmp25_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp24_ = e;
					_tmp25_ = _tmp24_->message;
					g_warning ("ApplicationShortcuts.vala:159: %s", _tmp25_);
					_g_error_free0 (e);
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					apps = (_vala_DesktopIntegrationRunningApplication_array_free (apps, apps_length1), NULL);
					_g_free0 (desktop_file_name);
					_g_hash_table_unref0 (action_parameters);
					_g_object_unref0 (context);
					_settings_daemon_backends_application_shortcuts_action_info_free0 (action_info);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
			}
			already_launched = FALSE;
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp26_ = FALSE;
					_tmp26_ = TRUE;
					while (TRUE) {
						DesktopIntegrationRunningApplication* _tmp28_;
						gint _tmp28__length1;
						DesktopIntegrationRunningApplication* _tmp29_;
						gint _tmp29__length1;
						DesktopIntegrationRunningApplication _tmp30_;
						const gchar* _tmp31_;
						const gchar* _tmp32_;
						if (!_tmp26_) {
							gint _tmp27_;
							_tmp27_ = i;
							i = _tmp27_ + 1;
						}
						_tmp26_ = FALSE;
						_tmp28_ = apps;
						_tmp28__length1 = apps_length1;
						if (!(i < _tmp28__length1)) {
							break;
						}
						_tmp29_ = apps;
						_tmp29__length1 = apps_length1;
						_tmp30_ = _tmp29_[i];
						_tmp31_ = _tmp30_.app_id;
						_tmp32_ = desktop_file_name;
						if (g_strcmp0 (_tmp31_, _tmp32_) == 0) {
							already_launched = TRUE;
							break;
						}
					}
				}
			}
			_tmp33_ = action_parameters;
			if (g_hash_table_contains (_tmp33_, "action")) {
				const gchar* action_name = NULL;
				GHashTable* _tmp34_;
				gconstpointer _tmp35_;
				const gchar* _tmp36_;
				const gchar* _tmp37_;
				GDesktopAppInfo* _tmp38_;
				GDesktopAppInfo* _tmp39_;
				const gchar* _tmp40_;
				GdkAppLaunchContext* _tmp41_;
				_tmp34_ = action_parameters;
				_tmp35_ = g_hash_table_lookup (_tmp34_, "action");
				_tmp36_ = g_variant_get_string ((GVariant*) _tmp35_, NULL);
				action_name = _tmp36_;
				_tmp37_ = desktop_file_name;
				_tmp38_ = g_desktop_app_info_new (_tmp37_);
				_tmp39_ = _tmp38_;
				_tmp40_ = action_name;
				_tmp41_ = context;
				g_desktop_app_info_launch_action (_tmp39_, _tmp40_, (GAppLaunchContext*) _tmp41_);
				_g_object_unref0 (_tmp39_);
			} else {
				gboolean _tmp42_ = FALSE;
				if (!already_launched) {
					_tmp42_ = TRUE;
				} else {
					DesktopIntegration* _tmp43_;
					_tmp43_ = self->priv->desktop_integration;
					_tmp42_ = _tmp43_ == NULL;
				}
				if (_tmp42_) {
					const gchar* _tmp44_;
					GdkAppLaunchContext* _tmp45_;
					_tmp44_ = desktop_file_name;
					_tmp45_ = context;
					settings_daemon_backends_application_shortcuts_launch_app (self, _tmp44_, _tmp45_);
				} else {
					{
						gboolean found_window = FALSE;
						DesktopIntegrationWindow* windows = NULL;
						DesktopIntegration* _tmp46_;
						gint _tmp47_ = 0;
						DesktopIntegrationWindow* _tmp48_;
						gint windows_length1;
						gint _windows_size_;
						found_window = FALSE;
						_tmp46_ = self->priv->desktop_integration;
						_tmp48_ = desktop_integration_get_windows (_tmp46_, &_tmp47_, &_inner_error0_);
						windows = _tmp48_;
						windows_length1 = _tmp47_;
						_windows_size_ = windows_length1;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch1_g_error;
						}
						{
							gint i = 0;
							i = 0;
							{
								gboolean _tmp49_ = FALSE;
								_tmp49_ = TRUE;
								while (TRUE) {
									DesktopIntegrationWindow* _tmp51_;
									gint _tmp51__length1;
									DesktopIntegrationWindow* _tmp52_;
									gint _tmp52__length1;
									DesktopIntegrationWindow _tmp53_;
									GHashTable* _tmp54_;
									gconstpointer _tmp55_;
									const gchar* _tmp56_;
									const gchar* _tmp57_;
									if (!_tmp49_) {
										gint _tmp50_;
										_tmp50_ = i;
										i = _tmp50_ + 1;
									}
									_tmp49_ = FALSE;
									_tmp51_ = windows;
									_tmp51__length1 = windows_length1;
									if (!(i < _tmp51__length1)) {
										break;
									}
									_tmp52_ = windows;
									_tmp52__length1 = windows_length1;
									_tmp53_ = _tmp52_[i];
									_tmp54_ = _tmp53_.properties;
									_tmp55_ = g_hash_table_lookup (_tmp54_, "app-id");
									_tmp56_ = g_variant_get_string ((GVariant*) _tmp55_, NULL);
									_tmp57_ = desktop_file_name;
									if (g_strcmp0 (_tmp56_, _tmp57_) == 0) {
										DesktopIntegration* _tmp58_;
										DesktopIntegrationWindow* _tmp59_;
										gint _tmp59__length1;
										DesktopIntegrationWindow _tmp60_;
										found_window = TRUE;
										_tmp58_ = self->priv->desktop_integration;
										_tmp59_ = windows;
										_tmp59__length1 = windows_length1;
										_tmp60_ = _tmp59_[i];
										desktop_integration_focus_window (_tmp58_, _tmp60_.uid, &_inner_error0_);
										if (G_UNLIKELY (_inner_error0_ != NULL)) {
											windows = (_vala_DesktopIntegrationWindow_array_free (windows, windows_length1), NULL);
											goto __catch1_g_error;
										}
										break;
									}
								}
							}
						}
						if (!found_window) {
							const gchar* _tmp61_;
							GdkAppLaunchContext* _tmp62_;
							_tmp61_ = desktop_file_name;
							_tmp62_ = context;
							settings_daemon_backends_application_shortcuts_launch_app (self, _tmp61_, _tmp62_);
						}
						windows = (_vala_DesktopIntegrationWindow_array_free (windows, windows_length1), NULL);
					}
					goto __finally1;
					__catch1_g_error:
					{
						GError* e = NULL;
						GError* _tmp63_;
						const gchar* _tmp64_;
						const gchar* _tmp65_;
						GdkAppLaunchContext* _tmp66_;
						e = _inner_error0_;
						_inner_error0_ = NULL;
						_tmp63_ = e;
						_tmp64_ = _tmp63_->message;
						g_warning ("ApplicationShortcuts.vala:192: %s", _tmp64_);
						_tmp65_ = desktop_file_name;
						_tmp66_ = context;
						settings_daemon_backends_application_shortcuts_launch_app (self, _tmp65_, _tmp66_);
						_g_error_free0 (e);
					}
					__finally1:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						apps = (_vala_DesktopIntegrationRunningApplication_array_free (apps, apps_length1), NULL);
						_g_free0 (desktop_file_name);
						_g_hash_table_unref0 (action_parameters);
						_g_object_unref0 (context);
						_settings_daemon_backends_application_shortcuts_action_info_free0 (action_info);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return;
					}
				}
			}
			apps = (_vala_DesktopIntegrationRunningApplication_array_free (apps, apps_length1), NULL);
			_g_free0 (desktop_file_name);
			break;
		}
		case SETTINGS_DAEMON_BACKENDS_APPLICATION_SHORTCUTS_ACTION_TYPE_COMMAND_LINE:
		{
			gchar* commandline = NULL;
			SettingsDaemonBackendsApplicationShortcutsActionInfo* _tmp67_;
			const gchar* _tmp68_;
			gchar* _tmp69_;
			_tmp67_ = action_info;
			_tmp68_ = (*_tmp67_).target;
			_tmp69_ = g_strdup (_tmp68_);
			commandline = _tmp69_;
			{
				GAppInfo* _tmp70_ = NULL;
				const gchar* _tmp71_;
				GAppInfo* _tmp72_;
				GdkAppLaunchContext* _tmp73_;
				_tmp71_ = commandline;
				_tmp72_ = g_app_info_create_from_commandline (_tmp71_, NULL, G_APP_INFO_CREATE_NONE, &_inner_error0_);
				_tmp70_ = _tmp72_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch2_g_error;
				}
				_tmp73_ = context;
				g_app_info_launch (_tmp70_, NULL, (GAppLaunchContext*) _tmp73_, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (_tmp70_);
					goto __catch2_g_error;
				}
				_g_object_unref0 (_tmp70_);
			}
			goto __finally2;
			__catch2_g_error:
			{
				GError* e = NULL;
				const gchar* _tmp74_;
				GError* _tmp75_;
				const gchar* _tmp76_;
				e = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp74_ = commandline;
				_tmp75_ = e;
				_tmp76_ = _tmp75_->message;
				g_warning ("ApplicationShortcuts.vala:204: Couldn't launch %s: %s", _tmp74_, _tmp76_);
				_g_error_free0 (e);
			}
			__finally2:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (commandline);
				_g_hash_table_unref0 (action_parameters);
				_g_object_unref0 (context);
				_settings_daemon_backends_application_shortcuts_action_info_free0 (action_info);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return;
			}
			_g_free0 (commandline);
			break;
		}
		default:
		break;
	}
	_g_hash_table_unref0 (action_parameters);
	_g_object_unref0 (context);
	_settings_daemon_backends_application_shortcuts_action_info_free0 (action_info);
}

static void
settings_daemon_backends_application_shortcuts_launch_app (SettingsDaemonBackendsApplicationShortcuts* self,
                                                           const gchar* desktop_file_name,
                                                           GdkAppLaunchContext* context)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (desktop_file_name != NULL);
	g_return_if_fail (context != NULL);
	{
		GDesktopAppInfo* _tmp0_;
		GDesktopAppInfo* _tmp1_;
		_tmp0_ = g_desktop_app_info_new (desktop_file_name);
		_tmp1_ = _tmp0_;
		g_app_info_launch ((GAppInfo*) _tmp1_, NULL, (GAppLaunchContext*) context, &_inner_error0_);
		_g_object_unref0 (_tmp1_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = e;
		_tmp3_ = _tmp2_->message;
		g_warning ("ApplicationShortcuts.vala:214: Couldn't launch %s: %s", desktop_file_name, _tmp3_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

SettingsDaemonBackendsApplicationShortcuts*
settings_daemon_backends_application_shortcuts_construct (GType object_type)
{
	SettingsDaemonBackendsApplicationShortcuts * self = NULL;
	self = (SettingsDaemonBackendsApplicationShortcuts*) g_object_new (object_type, NULL);
	return self;
}

SettingsDaemonBackendsApplicationShortcuts*
settings_daemon_backends_application_shortcuts_new (void)
{
	return settings_daemon_backends_application_shortcuts_construct (SETTINGS_DAEMON_BACKENDS_TYPE_APPLICATION_SHORTCUTS);
}

static gchar**
_vala_array_dup3 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static void
settings_daemon_backends_application_shortcuts_parsed_copy (const SettingsDaemonBackendsApplicationShortcutsParsed* self,
                                                            SettingsDaemonBackendsApplicationShortcutsParsed* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	gchar** _tmp5_;
	gint _tmp5__length1;
	(*dest).type = (*self).type;
	_tmp0_ = (*self).target;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).target);
	(*dest).target = _tmp1_;
	_tmp2_ = (*self).parameters;
	_tmp3_ = _g_hash_table_ref0 (_tmp2_);
	_g_hash_table_unref0 ((*dest).parameters);
	(*dest).parameters = _tmp3_;
	_tmp4_ = (*self).keybindings;
	_tmp4__length1 = (*self).keybindings_length1;
	_tmp5_ = (_tmp4_ != NULL) ? _vala_array_dup3 (_tmp4_, _tmp4__length1) : _tmp4_;
	_tmp5__length1 = _tmp4__length1;
	(*dest).keybindings = (_vala_array_free ((*dest).keybindings, (*dest).keybindings_length1, (GDestroyNotify) g_free), NULL);
	(*dest).keybindings = _tmp5_;
	(*dest).keybindings_length1 = _tmp5__length1;
	(*dest)._keybindings_size_ = (*dest).keybindings_length1;
}

static void
settings_daemon_backends_application_shortcuts_parsed_destroy (SettingsDaemonBackendsApplicationShortcutsParsed* self)
{
	_g_free0 ((*self).target);
	_g_hash_table_unref0 ((*self).parameters);
	(*self).keybindings = (_vala_array_free ((*self).keybindings, (*self).keybindings_length1, (GDestroyNotify) g_free), NULL);
}

static SettingsDaemonBackendsApplicationShortcutsParsed*
settings_daemon_backends_application_shortcuts_parsed_dup (const SettingsDaemonBackendsApplicationShortcutsParsed* self)
{
	SettingsDaemonBackendsApplicationShortcutsParsed* dup;
	dup = g_new0 (SettingsDaemonBackendsApplicationShortcutsParsed, 1);
	settings_daemon_backends_application_shortcuts_parsed_copy (self, dup);
	return dup;
}

static void
settings_daemon_backends_application_shortcuts_parsed_free (SettingsDaemonBackendsApplicationShortcutsParsed* self)
{
	settings_daemon_backends_application_shortcuts_parsed_destroy (self);
	g_free (self);
}

static GType
settings_daemon_backends_application_shortcuts_parsed_get_type_once (void)
{
	GType settings_daemon_backends_application_shortcuts_parsed_type_id;
	settings_daemon_backends_application_shortcuts_parsed_type_id = g_boxed_type_register_static ("SettingsDaemonBackendsApplicationShortcutsParsed", (GBoxedCopyFunc) settings_daemon_backends_application_shortcuts_parsed_dup, (GBoxedFreeFunc) settings_daemon_backends_application_shortcuts_parsed_free);
	return settings_daemon_backends_application_shortcuts_parsed_type_id;
}

static GType
settings_daemon_backends_application_shortcuts_parsed_get_type (void)
{
	static volatile gsize settings_daemon_backends_application_shortcuts_parsed_type_id__once = 0;
	if (g_once_init_enter (&settings_daemon_backends_application_shortcuts_parsed_type_id__once)) {
		GType settings_daemon_backends_application_shortcuts_parsed_type_id;
		settings_daemon_backends_application_shortcuts_parsed_type_id = settings_daemon_backends_application_shortcuts_parsed_get_type_once ();
		g_once_init_leave (&settings_daemon_backends_application_shortcuts_parsed_type_id__once, settings_daemon_backends_application_shortcuts_parsed_type_id);
	}
	return settings_daemon_backends_application_shortcuts_parsed_type_id__once;
}

static void
settings_daemon_backends_application_shortcuts_action_info_copy (const SettingsDaemonBackendsApplicationShortcutsActionInfo* self,
                                                                 SettingsDaemonBackendsApplicationShortcutsActionInfo* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* _tmp3_;
	(*dest).type = (*self).type;
	_tmp0_ = (*self).target;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).target);
	(*dest).target = _tmp1_;
	_tmp2_ = (*self).parameters;
	_tmp3_ = _g_hash_table_ref0 (_tmp2_);
	_g_hash_table_unref0 ((*dest).parameters);
	(*dest).parameters = _tmp3_;
}

static void
settings_daemon_backends_application_shortcuts_action_info_destroy (SettingsDaemonBackendsApplicationShortcutsActionInfo* self)
{
	_g_free0 ((*self).target);
	_g_hash_table_unref0 ((*self).parameters);
}

static SettingsDaemonBackendsApplicationShortcutsActionInfo*
settings_daemon_backends_application_shortcuts_action_info_dup (const SettingsDaemonBackendsApplicationShortcutsActionInfo* self)
{
	SettingsDaemonBackendsApplicationShortcutsActionInfo* dup;
	dup = g_new0 (SettingsDaemonBackendsApplicationShortcutsActionInfo, 1);
	settings_daemon_backends_application_shortcuts_action_info_copy (self, dup);
	return dup;
}

static void
settings_daemon_backends_application_shortcuts_action_info_free (SettingsDaemonBackendsApplicationShortcutsActionInfo* self)
{
	settings_daemon_backends_application_shortcuts_action_info_destroy (self);
	g_free (self);
}

static GType
settings_daemon_backends_application_shortcuts_action_info_get_type_once (void)
{
	GType settings_daemon_backends_application_shortcuts_action_info_type_id;
	settings_daemon_backends_application_shortcuts_action_info_type_id = g_boxed_type_register_static ("SettingsDaemonBackendsApplicationShortcutsActionInfo", (GBoxedCopyFunc) settings_daemon_backends_application_shortcuts_action_info_dup, (GBoxedFreeFunc) settings_daemon_backends_application_shortcuts_action_info_free);
	return settings_daemon_backends_application_shortcuts_action_info_type_id;
}

static GType
settings_daemon_backends_application_shortcuts_action_info_get_type (void)
{
	static volatile gsize settings_daemon_backends_application_shortcuts_action_info_type_id__once = 0;
	if (g_once_init_enter (&settings_daemon_backends_application_shortcuts_action_info_type_id__once)) {
		GType settings_daemon_backends_application_shortcuts_action_info_type_id;
		settings_daemon_backends_application_shortcuts_action_info_type_id = settings_daemon_backends_application_shortcuts_action_info_get_type_once ();
		g_once_init_leave (&settings_daemon_backends_application_shortcuts_action_info_type_id__once, settings_daemon_backends_application_shortcuts_action_info_type_id);
	}
	return settings_daemon_backends_application_shortcuts_action_info_type_id__once;
}

static void
_settings_daemon_backends_application_shortcuts_action_info_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (settings_daemon_backends_application_shortcuts_action_info_free (var), NULL));
}

static void
_settings_daemon_backends_application_shortcuts___lambda17_ (SettingsDaemonBackendsApplicationShortcuts* self)
{
	ShellKeyGrabber* _tmp0_;
	GError* _inner_error0_ = NULL;
	_tmp0_ = self->priv->key_grabber;
	if (_tmp0_ != NULL) {
		{
			ShellKeyGrabber* _tmp1_;
			GHashTable* _tmp2_;
			guint _tmp3_ = 0;
			gconstpointer* _tmp4_;
			guint* _tmp5_;
			gint _tmp5__length1;
			_tmp1_ = self->priv->key_grabber;
			_tmp2_ = self->priv->saved_action_ids;
			_tmp4_ = g_hash_table_get_keys_as_array (_tmp2_, &_tmp3_);
			_tmp5_ = _tmp4_;
			_tmp5__length1 = _tmp3_;
			shell_key_grabber_ungrab_accelerators (_tmp1_, _tmp5_, (gint) _tmp3_, &_inner_error0_);
			_tmp5_ = (g_free (_tmp5_), NULL);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp6_;
			const gchar* _tmp7_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp6_ = e;
			_tmp7_ = _tmp6_->message;
			g_critical ("ApplicationShortcuts.vala:42: Couldn't ungrab accelerators: %s", _tmp7_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		if (self->priv->key_grabber_id != ((gulong) 0)) {
			ShellKeyGrabber* _tmp8_;
			_tmp8_ = self->priv->key_grabber;
			g_signal_handler_disconnect ((GObject*) _tmp8_, self->priv->key_grabber_id);
			self->priv->key_grabber_id = (gulong) 0;
		}
		settings_daemon_backends_application_shortcuts_setup_grabs (self);
	}
}

static void
__settings_daemon_backends_application_shortcuts___lambda17__g_settings_changed (GSettings* _sender,
                                                                                 const gchar* key,
                                                                                 gpointer self)
{
	_settings_daemon_backends_application_shortcuts___lambda17_ ((SettingsDaemonBackendsApplicationShortcuts*) self);
}

static void
_settings_daemon_backends_application_shortcuts___lambda18_ (SettingsDaemonBackendsApplicationShortcuts* self,
                                                             GObject* obj,
                                                             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		ShellKeyGrabber* _tmp0_ = NULL;
		ShellKeyGrabber* _tmp1_;
		ShellKeyGrabber* _tmp2_;
		ShellKeyGrabber* _tmp3_;
		_tmp1_ = g_async_result_get_source_object (res);
		_tmp2_ = (ShellKeyGrabber*) g_async_initable_new_finish ((GAsyncInitable *) _tmp1_, res, &_inner_error0_);
		g_object_unref (_tmp1_);
		_tmp0_ = (ShellKeyGrabber*) _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->key_grabber);
		self->priv->key_grabber = _tmp3_;
		settings_daemon_backends_application_shortcuts_setup_grabs (self);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_critical ("ApplicationShortcuts.vala:63: %s", _tmp5_);
		_g_object_unref0 (self->priv->key_grabber);
		self->priv->key_grabber = NULL;
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
__settings_daemon_backends_application_shortcuts___lambda18__gasync_ready_callback (GObject* source_object,
                                                                                    GAsyncResult* res,
                                                                                    gpointer self)
{
	_settings_daemon_backends_application_shortcuts___lambda18_ ((SettingsDaemonBackendsApplicationShortcuts*) self, source_object, res);
	g_object_unref (self);
}

static void
_settings_daemon_backends_application_shortcuts___lambda19_ (SettingsDaemonBackendsApplicationShortcuts* self,
                                                             GObject* obj,
                                                             GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		DesktopIntegration* _tmp0_ = NULL;
		DesktopIntegration* _tmp1_;
		DesktopIntegration* _tmp2_;
		DesktopIntegration* _tmp3_;
		_tmp1_ = g_async_result_get_source_object (res);
		_tmp2_ = (DesktopIntegration*) g_async_initable_new_finish ((GAsyncInitable *) _tmp1_, res, &_inner_error0_);
		g_object_unref (_tmp1_);
		_tmp0_ = (DesktopIntegration*) _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (self->priv->desktop_integration);
		self->priv->desktop_integration = _tmp3_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = e;
		_tmp5_ = _tmp4_->message;
		g_critical ("ApplicationShortcuts.vala:77: %s", _tmp5_);
		_g_object_unref0 (self->priv->desktop_integration);
		self->priv->desktop_integration = NULL;
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
__settings_daemon_backends_application_shortcuts___lambda19__gasync_ready_callback (GObject* source_object,
                                                                                    GAsyncResult* res,
                                                                                    gpointer self)
{
	_settings_daemon_backends_application_shortcuts___lambda19_ ((SettingsDaemonBackendsApplicationShortcuts*) self, source_object, res);
	g_object_unref (self);
}

static GObject *
settings_daemon_backends_application_shortcuts_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SettingsDaemonBackendsApplicationShortcuts * self;
	GSettings* _tmp0_;
	GHashTable* _tmp1_;
	GSettings* _tmp2_;
	GError* _inner_error0_ = NULL;
	parent_class = G_OBJECT_CLASS (settings_daemon_backends_application_shortcuts_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SETTINGS_DAEMON_BACKENDS_TYPE_APPLICATION_SHORTCUTS, SettingsDaemonBackendsApplicationShortcuts);
	_tmp0_ = g_settings_new ("io.elementary.settings-daemon.applications");
	_g_object_unref0 (self->priv->application_settings);
	self->priv->application_settings = _tmp0_;
	_tmp1_ = g_hash_table_new_full (NULL, NULL, NULL, _settings_daemon_backends_application_shortcuts_action_info_free0_);
	_g_hash_table_unref0 (self->priv->saved_action_ids);
	self->priv->saved_action_ids = _tmp1_;
	settings_daemon_backends_application_shortcuts_migrate_gsd_shortcuts (self, NULL, NULL);
	_tmp2_ = self->priv->application_settings;
	g_signal_connect_object (_tmp2_, "changed", (GCallback) __settings_daemon_backends_application_shortcuts___lambda17__g_settings_changed, self, 0);
	g_async_initable_new_async (TYPE_SHELL_KEY_GRABBER_PROXY, 0, NULL, __settings_daemon_backends_application_shortcuts___lambda18__gasync_ready_callback, g_object_ref (self), "g-flags", G_DBUS_PROXY_FLAGS_NONE, "g-name", "org.gnome.Shell", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/gnome/Shell", "g-interface-name", "org.gnome.Shell", NULL);
	g_async_initable_new_async (TYPE_DESKTOP_INTEGRATION_PROXY, 0, NULL, __settings_daemon_backends_application_shortcuts___lambda19__gasync_ready_callback, g_object_ref (self), "g-flags", G_DBUS_PROXY_FLAGS_NONE, "g-name", "org.pantheon.gala", "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", "/org/pantheon/gala/DesktopInterface", "g-interface-name", "org.pantheon.gala.DesktopIntegration", NULL);
	return obj;
}

static void
settings_daemon_backends_application_shortcuts_class_init (SettingsDaemonBackendsApplicationShortcutsClass * klass,
                                                           gpointer klass_data)
{
	settings_daemon_backends_application_shortcuts_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SettingsDaemonBackendsApplicationShortcuts_private_offset);
	G_OBJECT_CLASS (klass)->constructor = settings_daemon_backends_application_shortcuts_constructor;
	G_OBJECT_CLASS (klass)->finalize = settings_daemon_backends_application_shortcuts_finalize;
}

static void
settings_daemon_backends_application_shortcuts_instance_init (SettingsDaemonBackendsApplicationShortcuts * self,
                                                              gpointer klass)
{
	self->priv = settings_daemon_backends_application_shortcuts_get_instance_private (self);
	self->priv->key_grabber_id = (gulong) 0;
}

static void
settings_daemon_backends_application_shortcuts_finalize (GObject * obj)
{
	SettingsDaemonBackendsApplicationShortcuts * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SETTINGS_DAEMON_BACKENDS_TYPE_APPLICATION_SHORTCUTS, SettingsDaemonBackendsApplicationShortcuts);
	_g_object_unref0 (self->priv->application_settings);
	_g_object_unref0 (self->priv->key_grabber);
	_g_object_unref0 (self->priv->desktop_integration);
	_g_hash_table_unref0 (self->priv->saved_action_ids);
	G_OBJECT_CLASS (settings_daemon_backends_application_shortcuts_parent_class)->finalize (obj);
}

static GType
settings_daemon_backends_application_shortcuts_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SettingsDaemonBackendsApplicationShortcutsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) settings_daemon_backends_application_shortcuts_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SettingsDaemonBackendsApplicationShortcuts), 0, (GInstanceInitFunc) settings_daemon_backends_application_shortcuts_instance_init, NULL };
	GType settings_daemon_backends_application_shortcuts_type_id;
	settings_daemon_backends_application_shortcuts_type_id = g_type_register_static (G_TYPE_OBJECT, "SettingsDaemonBackendsApplicationShortcuts", &g_define_type_info, 0);
	SettingsDaemonBackendsApplicationShortcuts_private_offset = g_type_add_instance_private (settings_daemon_backends_application_shortcuts_type_id, sizeof (SettingsDaemonBackendsApplicationShortcutsPrivate));
	return settings_daemon_backends_application_shortcuts_type_id;
}

GType
settings_daemon_backends_application_shortcuts_get_type (void)
{
	static volatile gsize settings_daemon_backends_application_shortcuts_type_id__once = 0;
	if (g_once_init_enter (&settings_daemon_backends_application_shortcuts_type_id__once)) {
		GType settings_daemon_backends_application_shortcuts_type_id;
		settings_daemon_backends_application_shortcuts_type_id = settings_daemon_backends_application_shortcuts_get_type_once ();
		g_once_init_leave (&settings_daemon_backends_application_shortcuts_type_id__once, settings_daemon_backends_application_shortcuts_type_id);
	}
	return settings_daemon_backends_application_shortcuts_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

