/* preferences-panel-keyboard-shortcuts.c generated by valac 0.56.19, the Vala compiler
 * generated from preferences-panel-keyboard-shortcuts.vala, do not modify */

/*
 * Copyright (c) 2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "ft_ui.h"
#include <adwaita.h>
#include "ft_core.h"
#include <glib-object.h>
#include <glib.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.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

enum  {
	FT_PREFERENCES_PANEL_KEYBOARD_SHORTCUTS_0_PROPERTY,
	FT_PREFERENCES_PANEL_KEYBOARD_SHORTCUTS_NUM_PROPERTIES
};
static GParamSpec* ft_preferences_panel_keyboard_shortcuts_properties[FT_PREFERENCES_PANEL_KEYBOARD_SHORTCUTS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _FtPreferencesPanelKeyboardShortcutsPrivate {
	AdwPreferencesPage* page;
	FtAcceleratorRow* start_stop_timer_row;
	FtAcceleratorRow* start_pause_resume_timer_row;
	FtAcceleratorRow* start_timer_row;
	FtAcceleratorRow* stop_timer_row;
	FtAcceleratorRow* pause_timer_row;
	FtAcceleratorRow* resume_timer_row;
	FtAcceleratorRow* skip_timer_row;
	FtAcceleratorRow* rewind_timer_row;
	FtAcceleratorRow* toggle_window_row;
	FtKeyboardManager* keyboard_manager;
};

static gint FtPreferencesPanelKeyboardShortcuts_private_offset;
static gpointer ft_preferences_panel_keyboard_shortcuts_parent_class = NULL;

static void ft_preferences_panel_keyboard_shortcuts_open_edit_dialog (FtPreferencesPanelKeyboardShortcuts* self);
VALA_EXTERN void ft_get_window_identifier (GtkWindow* window,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN gchar* ft_get_window_identifier_finish (GAsyncResult* _res_);
static void __lambda82_ (FtPreferencesPanelKeyboardShortcuts* self,
                  GObject* obj,
                  GAsyncResult* res);
static void ___lambda82__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
static void ft_preferences_panel_keyboard_shortcuts_update_accelerator (FtPreferencesPanelKeyboardShortcuts* self,
                                                                 const gchar* shortcut_name,
                                                                 const gchar* shortcut_accelerator);
static void ft_preferences_panel_keyboard_shortcuts_update_accelerators (FtPreferencesPanelKeyboardShortcuts* self);
static void __lambda83_ (FtPreferencesPanelKeyboardShortcuts* self,
                  const gchar* shortcut_name,
                  const gchar* shortcut_accelerator);
static void ___lambda83__ft_foreach_accelerator_func (const gchar* shortcut_name,
                                               const gchar* shortcut_accelerator,
                                               gpointer self);
static void ft_preferences_panel_keyboard_shortcuts_on_shortcut_changed (FtPreferencesPanelKeyboardShortcuts* self,
                                                                  const gchar* shortcut_name);
static void ft_preferences_panel_keyboard_shortcuts_on_edit_button_clicked (FtPreferencesPanelKeyboardShortcuts* self,
                                                                     GtkButton* button);
static void _ft_preferences_panel_keyboard_shortcuts_on_edit_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                         gpointer self);
static AdwPreferencesPage* ft_preferences_panel_keyboard_shortcuts_real_get_preferences_page (FtPreferencesPanel* base);
static void ft_preferences_panel_keyboard_shortcuts_real_dispose (GObject* base);
static GObject * ft_preferences_panel_keyboard_shortcuts_constructor (GType type,
                                                               guint n_construct_properties,
                                                               GObjectConstructParam * construct_properties);
static void _ft_preferences_panel_keyboard_shortcuts_on_shortcut_changed_ft_keyboard_manager_shortcut_changed (FtKeyboardManager* _sender,
                                                                                                        const gchar* shortcut_name,
                                                                                                        gpointer self);
static void ft_preferences_panel_keyboard_shortcuts_finalize (GObject * obj);
static GType ft_preferences_panel_keyboard_shortcuts_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
ft_preferences_panel_keyboard_shortcuts_get_instance_private (FtPreferencesPanelKeyboardShortcuts* self)
{
	return G_STRUCT_MEMBER_P (self, FtPreferencesPanelKeyboardShortcuts_private_offset);
}

static void
__lambda82_ (FtPreferencesPanelKeyboardShortcuts* self,
             GObject* obj,
             GAsyncResult* res)
{
	gchar* window_identifier = NULL;
	gchar* _tmp0_;
	FtKeyboardManager* _tmp1_;
	g_return_if_fail (res != NULL);
	_tmp0_ = ft_get_window_identifier_finish (res);
	window_identifier = _tmp0_;
	_tmp1_ = self->priv->keyboard_manager;
	ft_keyboard_manager_open_edit_dialog (_tmp1_, window_identifier);
	_g_free0 (window_identifier);
}

static void
___lambda82__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda82_ ((FtPreferencesPanelKeyboardShortcuts*) self, source_object, res);
	g_object_unref (self);
}

static void
ft_preferences_panel_keyboard_shortcuts_open_edit_dialog (FtPreferencesPanelKeyboardShortcuts* self)
{
	GtkRoot* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_root ((GtkWidget*) self);
	ft_get_window_identifier (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_window_get_type ()) ? ((GtkWindow*) _tmp0_) : NULL, ___lambda82__gasync_ready_callback, g_object_ref (self));
}

static void
ft_preferences_panel_keyboard_shortcuts_update_accelerator (FtPreferencesPanelKeyboardShortcuts* self,
                                                            const gchar* shortcut_name,
                                                            const gchar* shortcut_accelerator)
{
	gchar* _tmp0_ = NULL;
	gchar* accelerator = NULL;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	GQuark _tmp7_ = 0U;
	static GQuark _tmp6_label0 = 0;
	static GQuark _tmp6_label1 = 0;
	static GQuark _tmp6_label2 = 0;
	static GQuark _tmp6_label3 = 0;
	static GQuark _tmp6_label4 = 0;
	static GQuark _tmp6_label5 = 0;
	static GQuark _tmp6_label6 = 0;
	static GQuark _tmp6_label7 = 0;
	static GQuark _tmp6_label8 = 0;
	static GQuark _tmp6_label9 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (shortcut_name != NULL);
	if (shortcut_accelerator != NULL) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup (shortcut_accelerator);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp1_;
	} else {
		FtKeyboardManager* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = self->priv->keyboard_manager;
		_tmp3_ = ft_keyboard_manager_lookup_accelerator (_tmp2_, shortcut_name);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp3_;
	}
	_tmp4_ = _tmp0_;
	_tmp0_ = NULL;
	accelerator = _tmp4_;
	_tmp5_ = shortcut_name;
	_tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
	if ((_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("timer.toggle")))) || (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("timer.start-stop"))))) {
		switch (0) {
			default:
			{
				FtAcceleratorRow* _tmp8_;
				const gchar* _tmp9_;
				_tmp8_ = self->priv->start_stop_timer_row;
				_tmp9_ = accelerator;
				ft_accelerator_row_set_accelerator (_tmp8_, _tmp9_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label2) ? _tmp6_label2 : (_tmp6_label2 = g_quark_from_static_string ("timer.start-pause-resume")))) {
		switch (0) {
			default:
			{
				FtAcceleratorRow* _tmp10_;
				const gchar* _tmp11_;
				_tmp10_ = self->priv->start_pause_resume_timer_row;
				_tmp11_ = accelerator;
				ft_accelerator_row_set_accelerator (_tmp10_, _tmp11_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label3) ? _tmp6_label3 : (_tmp6_label3 = g_quark_from_static_string ("timer.start")))) {
		switch (0) {
			default:
			{
				FtAcceleratorRow* _tmp12_;
				const gchar* _tmp13_;
				_tmp12_ = self->priv->start_timer_row;
				_tmp13_ = accelerator;
				ft_accelerator_row_set_accelerator (_tmp12_, _tmp13_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label4) ? _tmp6_label4 : (_tmp6_label4 = g_quark_from_static_string ("timer.reset")))) {
		switch (0) {
			default:
			{
				FtAcceleratorRow* _tmp14_;
				const gchar* _tmp15_;
				_tmp14_ = self->priv->stop_timer_row;
				_tmp15_ = accelerator;
				ft_accelerator_row_set_accelerator (_tmp14_, _tmp15_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label5) ? _tmp6_label5 : (_tmp6_label5 = g_quark_from_static_string ("timer.pause")))) {
		switch (0) {
			default:
			{
				FtAcceleratorRow* _tmp16_;
				const gchar* _tmp17_;
				_tmp16_ = self->priv->pause_timer_row;
				_tmp17_ = accelerator;
				ft_accelerator_row_set_accelerator (_tmp16_, _tmp17_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label6) ? _tmp6_label6 : (_tmp6_label6 = g_quark_from_static_string ("timer.resume")))) {
		switch (0) {
			default:
			{
				FtAcceleratorRow* _tmp18_;
				const gchar* _tmp19_;
				_tmp18_ = self->priv->resume_timer_row;
				_tmp19_ = accelerator;
				ft_accelerator_row_set_accelerator (_tmp18_, _tmp19_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label7) ? _tmp6_label7 : (_tmp6_label7 = g_quark_from_static_string ("session-manager.advance")))) {
		switch (0) {
			default:
			{
				FtAcceleratorRow* _tmp20_;
				const gchar* _tmp21_;
				_tmp20_ = self->priv->skip_timer_row;
				_tmp21_ = accelerator;
				ft_accelerator_row_set_accelerator (_tmp20_, _tmp21_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label8) ? _tmp6_label8 : (_tmp6_label8 = g_quark_from_static_string ("timer.rewind")))) {
		switch (0) {
			default:
			{
				FtAcceleratorRow* _tmp22_;
				const gchar* _tmp23_;
				_tmp22_ = self->priv->rewind_timer_row;
				_tmp23_ = accelerator;
				ft_accelerator_row_set_accelerator (_tmp22_, _tmp23_);
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label9) ? _tmp6_label9 : (_tmp6_label9 = g_quark_from_static_string ("app.toggle-window")))) {
		switch (0) {
			default:
			{
				FtAcceleratorRow* _tmp24_;
				const gchar* _tmp25_;
				_tmp24_ = self->priv->toggle_window_row;
				_tmp25_ = accelerator;
				ft_accelerator_row_set_accelerator (_tmp24_, _tmp25_);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				g_warning ("preferences-panel-keyboard-shortcuts.vala:101: Unhandled shortcut '%s'", shortcut_name);
				break;
			}
		}
	}
	_g_free0 (accelerator);
	_g_free0 (_tmp0_);
}

static void
__lambda83_ (FtPreferencesPanelKeyboardShortcuts* self,
             const gchar* shortcut_name,
             const gchar* shortcut_accelerator)
{
	g_return_if_fail (shortcut_name != NULL);
	g_return_if_fail (shortcut_accelerator != NULL);
	ft_preferences_panel_keyboard_shortcuts_update_accelerator (self, shortcut_name, shortcut_accelerator);
}

static void
___lambda83__ft_foreach_accelerator_func (const gchar* shortcut_name,
                                          const gchar* shortcut_accelerator,
                                          gpointer self)
{
	__lambda83_ ((FtPreferencesPanelKeyboardShortcuts*) self, shortcut_name, shortcut_accelerator);
}

static void
ft_preferences_panel_keyboard_shortcuts_update_accelerators (FtPreferencesPanelKeyboardShortcuts* self)
{
	FtKeyboardManager* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->keyboard_manager;
	ft_keyboard_manager_foreach_accelerator (_tmp0_, ___lambda83__ft_foreach_accelerator_func, self);
}

static void
ft_preferences_panel_keyboard_shortcuts_on_shortcut_changed (FtPreferencesPanelKeyboardShortcuts* self,
                                                             const gchar* shortcut_name)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (shortcut_name != NULL);
	ft_preferences_panel_keyboard_shortcuts_update_accelerator (self, shortcut_name, NULL);
}

static void
ft_preferences_panel_keyboard_shortcuts_on_edit_button_clicked (FtPreferencesPanelKeyboardShortcuts* self,
                                                                GtkButton* button)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	ft_preferences_panel_keyboard_shortcuts_open_edit_dialog (self);
}

static void
_ft_preferences_panel_keyboard_shortcuts_on_edit_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                    gpointer self)
{
	ft_preferences_panel_keyboard_shortcuts_on_edit_button_clicked ((FtPreferencesPanelKeyboardShortcuts*) self, _sender);
}

static AdwPreferencesPage*
ft_preferences_panel_keyboard_shortcuts_real_get_preferences_page (FtPreferencesPanel* base)
{
	FtPreferencesPanelKeyboardShortcuts * self;
	AdwPreferencesPage* _tmp0_;
	AdwPreferencesPage* result;
	self = (FtPreferencesPanelKeyboardShortcuts*) base;
	_tmp0_ = self->priv->page;
	result = _tmp0_;
	return result;
}

static void
ft_preferences_panel_keyboard_shortcuts_real_dispose (GObject* base)
{
	FtPreferencesPanelKeyboardShortcuts * self;
	self = (FtPreferencesPanelKeyboardShortcuts*) base;
	_g_object_unref0 (self->priv->keyboard_manager);
	self->priv->keyboard_manager = NULL;
	G_OBJECT_CLASS (ft_preferences_panel_keyboard_shortcuts_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, FT_TYPE_PREFERENCES_PANEL, FtPreferencesPanel));
}

FtPreferencesPanelKeyboardShortcuts*
ft_preferences_panel_keyboard_shortcuts_construct (GType object_type)
{
	FtPreferencesPanelKeyboardShortcuts * self = NULL;
	self = (FtPreferencesPanelKeyboardShortcuts*) ft_preferences_panel_construct (object_type);
	return self;
}

FtPreferencesPanelKeyboardShortcuts*
ft_preferences_panel_keyboard_shortcuts_new (void)
{
	return ft_preferences_panel_keyboard_shortcuts_construct (FT_TYPE_PREFERENCES_PANEL_KEYBOARD_SHORTCUTS);
}

static void
_ft_preferences_panel_keyboard_shortcuts_on_shortcut_changed_ft_keyboard_manager_shortcut_changed (FtKeyboardManager* _sender,
                                                                                                   const gchar* shortcut_name,
                                                                                                   gpointer self)
{
	ft_preferences_panel_keyboard_shortcuts_on_shortcut_changed ((FtPreferencesPanelKeyboardShortcuts*) self, shortcut_name);
}

static GObject *
ft_preferences_panel_keyboard_shortcuts_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	FtPreferencesPanelKeyboardShortcuts * self;
	FtKeyboardManager* _tmp0_;
	FtKeyboardManager* _tmp1_;
	parent_class = G_OBJECT_CLASS (ft_preferences_panel_keyboard_shortcuts_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_PREFERENCES_PANEL_KEYBOARD_SHORTCUTS, FtPreferencesPanelKeyboardShortcuts);
	_tmp0_ = ft_keyboard_manager_new ();
	_g_object_unref0 (self->priv->keyboard_manager);
	self->priv->keyboard_manager = _tmp0_;
	_tmp1_ = self->priv->keyboard_manager;
	g_signal_connect_object (_tmp1_, "shortcut-changed", (GCallback) _ft_preferences_panel_keyboard_shortcuts_on_shortcut_changed_ft_keyboard_manager_shortcut_changed, self, 0);
	ft_preferences_panel_keyboard_shortcuts_update_accelerators (self);
	return obj;
}

static void
ft_preferences_panel_keyboard_shortcuts_class_init (FtPreferencesPanelKeyboardShortcutsClass * klass,
                                                    gpointer klass_data)
{
	ft_preferences_panel_keyboard_shortcuts_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtPreferencesPanelKeyboardShortcuts_private_offset);
	((FtPreferencesPanelClass *) klass)->get_preferences_page = (AdwPreferencesPage* (*) (FtPreferencesPanel*)) ft_preferences_panel_keyboard_shortcuts_real_get_preferences_page;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_preferences_panel_keyboard_shortcuts_real_dispose;
	G_OBJECT_CLASS (klass)->constructor = ft_preferences_panel_keyboard_shortcuts_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_preferences_panel_keyboard_shortcuts_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/io/github/focustimerhq/FocusTimer/ui/preferences/keyboard-shortcuts/preferences-panel-keyboard-shortcuts.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "page", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, page));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "start_stop_timer_row", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, start_stop_timer_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "start_pause_resume_timer_row", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, start_pause_resume_timer_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "start_timer_row", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, start_timer_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "stop_timer_row", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, stop_timer_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "pause_timer_row", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, pause_timer_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "resume_timer_row", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, resume_timer_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "skip_timer_row", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, skip_timer_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "rewind_timer_row", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, rewind_timer_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "toggle_window_row", FALSE, FtPreferencesPanelKeyboardShortcuts_private_offset + G_STRUCT_OFFSET (FtPreferencesPanelKeyboardShortcutsPrivate, toggle_window_row));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_edit_button_clicked", G_CALLBACK(_ft_preferences_panel_keyboard_shortcuts_on_edit_button_clicked_gtk_button_clicked));
}

static void
ft_preferences_panel_keyboard_shortcuts_instance_init (FtPreferencesPanelKeyboardShortcuts * self,
                                                       gpointer klass)
{
	self->priv = ft_preferences_panel_keyboard_shortcuts_get_instance_private (self);
	self->priv->keyboard_manager = NULL;
	g_type_ensure (FT_TYPE_ACCELERATOR_ROW);
	g_type_ensure (FT_TYPE_ACCELERATOR_ROW);
	g_type_ensure (FT_TYPE_ACCELERATOR_ROW);
	g_type_ensure (FT_TYPE_ACCELERATOR_ROW);
	g_type_ensure (FT_TYPE_ACCELERATOR_ROW);
	g_type_ensure (FT_TYPE_ACCELERATOR_ROW);
	g_type_ensure (FT_TYPE_ACCELERATOR_ROW);
	g_type_ensure (FT_TYPE_ACCELERATOR_ROW);
	g_type_ensure (FT_TYPE_ACCELERATOR_ROW);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
ft_preferences_panel_keyboard_shortcuts_finalize (GObject * obj)
{
	FtPreferencesPanelKeyboardShortcuts * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_PREFERENCES_PANEL_KEYBOARD_SHORTCUTS, FtPreferencesPanelKeyboardShortcuts);
	_g_object_unref0 (self->priv->keyboard_manager);
	G_OBJECT_CLASS (ft_preferences_panel_keyboard_shortcuts_parent_class)->finalize (obj);
}

static GType
ft_preferences_panel_keyboard_shortcuts_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtPreferencesPanelKeyboardShortcutsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_preferences_panel_keyboard_shortcuts_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtPreferencesPanelKeyboardShortcuts), 0, (GInstanceInitFunc) ft_preferences_panel_keyboard_shortcuts_instance_init, NULL };
	GType ft_preferences_panel_keyboard_shortcuts_type_id;
	ft_preferences_panel_keyboard_shortcuts_type_id = g_type_register_static (FT_TYPE_PREFERENCES_PANEL, "FtPreferencesPanelKeyboardShortcuts", &g_define_type_info, 0);
	FtPreferencesPanelKeyboardShortcuts_private_offset = g_type_add_instance_private (ft_preferences_panel_keyboard_shortcuts_type_id, sizeof (FtPreferencesPanelKeyboardShortcutsPrivate));
	return ft_preferences_panel_keyboard_shortcuts_type_id;
}

GType
ft_preferences_panel_keyboard_shortcuts_get_type (void)
{
	static volatile gsize ft_preferences_panel_keyboard_shortcuts_type_id__once = 0;
	if (g_once_init_enter (&ft_preferences_panel_keyboard_shortcuts_type_id__once)) {
		GType ft_preferences_panel_keyboard_shortcuts_type_id;
		ft_preferences_panel_keyboard_shortcuts_type_id = ft_preferences_panel_keyboard_shortcuts_get_type_once ();
		g_once_init_leave (&ft_preferences_panel_keyboard_shortcuts_type_id__once, ft_preferences_panel_keyboard_shortcuts_type_id);
	}
	return ft_preferences_panel_keyboard_shortcuts_type_id__once;
}

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;
}

