/* gitg-preferences-commit.c generated by valac 0.56.19, the Vala compiler
 * generated from gitg-preferences-commit.vala, do not modify */

/*
 * This file is part of gitg
 *
 * Copyright (C) 2013 - Jesse van den Kieboom
 *
 * gitg is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * gitg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gitg. If not, see <http://www.gnu.org/licenses/>.
 */

#include <gtk/gtk.h>
#include "libgitg-ext.h"
#include <glib-object.h>
#include <gspell/gspell.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "config.h"
#include <glib/gi18n-lib.h>
#include <gio/gio.h>

#define GITG_PREFERENCES_COMMIT_version VERSION
#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 GITG_TYPE_PREFERENCES_COMMIT (gitg_preferences_commit_get_type ())
#define GITG_PREFERENCES_COMMIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GITG_TYPE_PREFERENCES_COMMIT, GitgPreferencesCommit))
#define GITG_PREFERENCES_COMMIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GITG_TYPE_PREFERENCES_COMMIT, GitgPreferencesCommitClass))
#define GITG_IS_PREFERENCES_COMMIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GITG_TYPE_PREFERENCES_COMMIT))
#define GITG_IS_PREFERENCES_COMMIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GITG_TYPE_PREFERENCES_COMMIT))
#define GITG_PREFERENCES_COMMIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GITG_TYPE_PREFERENCES_COMMIT, GitgPreferencesCommitClass))

typedef struct _GitgPreferencesCommit GitgPreferencesCommit;
typedef struct _GitgPreferencesCommitClass GitgPreferencesCommitClass;
typedef struct _GitgPreferencesCommitPrivate GitgPreferencesCommitPrivate;
enum  {
	GITG_PREFERENCES_COMMIT_0_PROPERTY,
	GITG_PREFERENCES_COMMIT_WIDGET_PROPERTY,
	GITG_PREFERENCES_COMMIT_ID_PROPERTY,
	GITG_PREFERENCES_COMMIT_DISPLAY_NAME_PROPERTY,
	GITG_PREFERENCES_COMMIT_DATETIME_SELECTION_PROPERTY,
	GITG_PREFERENCES_COMMIT_NUM_PROPERTIES
};
static GParamSpec* gitg_preferences_commit_properties[GITG_PREFERENCES_COMMIT_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _GitgPreferencesCommit {
	GtkGrid parent_instance;
	GitgPreferencesCommitPrivate * priv;
};

struct _GitgPreferencesCommitClass {
	GtkGridClass parent_class;
};

struct _GitgPreferencesCommitPrivate {
	GtkCheckButton* d_check_button_show_markup;
	GtkGrid* d_grid_show_markup;
	GtkCheckButton* d_check_button_show_subject_margin;
	GtkGrid* d_spin_button_subject_margin_grid;
	GtkSpinButton* d_spin_button_subject_margin;
	GtkCheckButton* d_check_button_show_right_margin;
	GtkGrid* d_spin_button_right_margin_grid;
	GtkSpinButton* d_spin_button_right_margin;
	GspellLanguageChooserButton* d_spell_language_button;
	GtkCheckButton* d_enable_spell_checking;
	GtkSpinButton* d_spin_button_max_num_commit_messages;
	GtkSpinButton* d_spin_button_max_num_days_commit_messages;
	GtkRadioButton* d_predefined_datetime;
	GtkRadioButton* d_custom_datetime;
	GtkComboBox* d_predefined_datetime_combo;
	GtkEntry* d_custom_datetime_entry;
};

static gint GitgPreferencesCommit_private_offset;
static gpointer gitg_preferences_commit_parent_class = NULL;
static GitgExtPreferencesIface * gitg_preferences_commit_gitg_ext_preferences_parent_iface = NULL;

VALA_EXTERN GType gitg_preferences_commit_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GitgPreferencesCommit, g_object_unref)
VALA_EXTERN GitgPreferencesCommit* gitg_preferences_commit_new (void);
VALA_EXTERN GitgPreferencesCommit* gitg_preferences_commit_construct (GType object_type);
VALA_EXTERN const gchar* gitg_preferences_commit_get_datetime_selection (GitgPreferencesCommit* self);
VALA_EXTERN void gitg_preferences_commit_set_datetime_selection (GitgPreferencesCommit* self,
                                                     const gchar* value);
static GObject * gitg_preferences_commit_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void _gitg_preferences_commit___lambda138_ (GitgPreferencesCommit* self);
static void __gitg_preferences_commit___lambda138__g_object_notify (GObject* _sender,
                                                             GParamSpec* pspec,
                                                             gpointer self);
static void _gitg_preferences_commit___lambda139_ (GitgPreferencesCommit* self);
static void __gitg_preferences_commit___lambda139__g_object_notify (GObject* _sender,
                                                             GParamSpec* pspec,
                                                             gpointer self);
static void gitg_preferences_commit_finalize (GObject * obj);
static GType gitg_preferences_commit_get_type_once (void);
static void _vala_gitg_preferences_commit_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_gitg_preferences_commit_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);

static inline gpointer
gitg_preferences_commit_get_instance_private (GitgPreferencesCommit* self)
{
	return G_STRUCT_MEMBER_P (self, GitgPreferencesCommit_private_offset);
}

GitgPreferencesCommit*
gitg_preferences_commit_construct (GType object_type)
{
	GitgPreferencesCommit * self = NULL;
	self = (GitgPreferencesCommit*) g_object_new (object_type, NULL);
	return self;
}

GitgPreferencesCommit*
gitg_preferences_commit_new (void)
{
	return gitg_preferences_commit_construct (GITG_TYPE_PREFERENCES_COMMIT);
}

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

static GtkWidget*
gitg_preferences_commit_real_get_widget (GitgExtPreferences* base)
{
	GtkWidget* result;
	GitgPreferencesCommit* self;
	GtkWidget* _tmp0_;
	self = (GitgPreferencesCommit*) base;
	_tmp0_ = _g_object_ref0 ((GtkWidget*) self);
	result = _tmp0_;
	return result;
}

static gchar*
gitg_preferences_commit_real_get_id (GitgExtPreferences* base)
{
	gchar* result;
	GitgPreferencesCommit* self;
	gchar* _tmp0_;
	self = (GitgPreferencesCommit*) base;
	_tmp0_ = g_strdup ("/org/gnome/gitg/Preferences/Commit");
	result = _tmp0_;
	return result;
}

static gchar*
gitg_preferences_commit_real_get_display_name (GitgExtPreferences* base)
{
	gchar* result;
	GitgPreferencesCommit* self;
	gchar* _tmp0_;
	self = (GitgPreferencesCommit*) base;
	_tmp0_ = g_strdup (C_ ("Preferences", "Commit"));
	result = _tmp0_;
	return result;
}

const gchar*
gitg_preferences_commit_get_datetime_selection (GitgPreferencesCommit* self)
{
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	GtkRadioButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->d_custom_datetime;
	_tmp2_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_tmp0_ = "custom";
	} else {
		_tmp0_ = "predefined";
	}
	result = _tmp0_;
	return result;
}

void
gitg_preferences_commit_set_datetime_selection (GitgPreferencesCommit* self,
                                                const gchar* value)
{
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, "custom") == 0) {
		GtkRadioButton* _tmp0_;
		_tmp0_ = self->priv->d_custom_datetime;
		gtk_toggle_button_set_active ((GtkToggleButton*) _tmp0_, TRUE);
	} else {
		GtkRadioButton* _tmp1_;
		_tmp1_ = self->priv->d_predefined_datetime;
		gtk_toggle_button_set_active ((GtkToggleButton*) _tmp1_, TRUE);
	}
	g_object_notify_by_pspec ((GObject *) self, gitg_preferences_commit_properties[GITG_PREFERENCES_COMMIT_DATETIME_SELECTION_PROPERTY]);
}

static void
_gitg_preferences_commit___lambda138_ (GitgPreferencesCommit* self)
{
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->d_predefined_datetime;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		g_object_notify ((GObject*) self, "datetime-selection");
	}
}

static void
__gitg_preferences_commit___lambda138__g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self)
{
	_gitg_preferences_commit___lambda138_ ((GitgPreferencesCommit*) self);
}

static void
_gitg_preferences_commit___lambda139_ (GitgPreferencesCommit* self)
{
	GtkRadioButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->d_custom_datetime;
	_tmp1_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		g_object_notify ((GObject*) self, "datetime-selection");
	}
}

static void
__gitg_preferences_commit___lambda139__g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self)
{
	_gitg_preferences_commit___lambda139_ ((GitgPreferencesCommit*) self);
}

static GObject *
gitg_preferences_commit_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GitgPreferencesCommit * self;
	GSettings* settings = NULL;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	GtkCheckButton* _tmp2_;
	GSettings* _tmp3_;
	GtkGrid* _tmp4_;
	GSettings* _tmp5_;
	GtkCheckButton* _tmp6_;
	GSettings* _tmp7_;
	GtkGrid* _tmp8_;
	GSettings* _tmp9_;
	GtkSpinButton* _tmp10_;
	GSettings* _tmp11_;
	GtkCheckButton* _tmp12_;
	GSettings* _tmp13_;
	GtkGrid* _tmp14_;
	GSettings* _tmp15_;
	GtkSpinButton* _tmp16_;
	GSettings* _tmp17_;
	GtkCheckButton* _tmp18_;
	GSettings* _tmp19_;
	GspellLanguageChooserButton* _tmp20_;
	GSettings* _tmp21_;
	GtkSpinButton* _tmp22_;
	GSettings* _tmp23_;
	GtkSpinButton* _tmp24_;
	GSettings* _tmp25_;
	GtkComboBox* _tmp26_;
	GSettings* _tmp27_;
	GtkEntry* _tmp28_;
	GSettings* _tmp29_;
	GtkRadioButton* _tmp30_;
	GtkRadioButton* _tmp31_;
	parent_class = G_OBJECT_CLASS (gitg_preferences_commit_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_PREFERENCES_COMMIT, GitgPreferencesCommit);
	_tmp0_ = g_settings_new (APPLICATION_ID ".preferences.commit.message");
	settings = _tmp0_;
	_tmp1_ = settings;
	_tmp2_ = self->priv->d_check_button_show_markup;
	g_settings_bind (_tmp1_, "show-markup", (GObject*) _tmp2_, "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp3_ = settings;
	_tmp4_ = self->priv->d_grid_show_markup;
	g_settings_bind (_tmp3_, "show-markup", (GObject*) _tmp4_, "sensitive", G_SETTINGS_BIND_GET);
	_tmp5_ = settings;
	_tmp6_ = self->priv->d_check_button_show_subject_margin;
	g_settings_bind (_tmp5_, "show-subject-margin", (GObject*) _tmp6_, "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp7_ = settings;
	_tmp8_ = self->priv->d_spin_button_subject_margin_grid;
	g_settings_bind (_tmp7_, "show-subject-margin", (GObject*) _tmp8_, "sensitive", G_SETTINGS_BIND_GET);
	_tmp9_ = settings;
	_tmp10_ = self->priv->d_spin_button_subject_margin;
	g_settings_bind (_tmp9_, "subject-margin-position", (GObject*) _tmp10_, "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp11_ = settings;
	_tmp12_ = self->priv->d_check_button_show_right_margin;
	g_settings_bind (_tmp11_, "show-right-margin", (GObject*) _tmp12_, "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp13_ = settings;
	_tmp14_ = self->priv->d_spin_button_right_margin_grid;
	g_settings_bind (_tmp13_, "show-right-margin", (GObject*) _tmp14_, "sensitive", G_SETTINGS_BIND_GET);
	_tmp15_ = settings;
	_tmp16_ = self->priv->d_spin_button_right_margin;
	g_settings_bind (_tmp15_, "right-margin-position", (GObject*) _tmp16_, "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp17_ = settings;
	_tmp18_ = self->priv->d_enable_spell_checking;
	g_settings_bind (_tmp17_, "enable-spell-checking", (GObject*) _tmp18_, "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp19_ = settings;
	_tmp20_ = self->priv->d_spell_language_button;
	g_settings_bind (_tmp19_, "spell-checking-language", (GObject*) _tmp20_, "language-code", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp21_ = settings;
	_tmp22_ = self->priv->d_spin_button_max_num_commit_messages;
	g_settings_bind (_tmp21_, "max-number-commit-messages", (GObject*) _tmp22_, "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp23_ = settings;
	_tmp24_ = self->priv->d_spin_button_max_num_days_commit_messages;
	g_settings_bind (_tmp23_, "max-number-days-commit-messages", (GObject*) _tmp24_, "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp25_ = settings;
	_tmp26_ = self->priv->d_predefined_datetime_combo;
	g_settings_bind (_tmp25_, "predefined-datetime", (GObject*) _tmp26_, "active-id", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp27_ = settings;
	_tmp28_ = self->priv->d_custom_datetime_entry;
	g_settings_bind (_tmp27_, "custom-datetime", (GObject*) _tmp28_, "text", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp29_ = settings;
	g_settings_bind (_tmp29_, "datetime-selection", (GObject*) self, "datetime-selection", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
	_tmp30_ = self->priv->d_predefined_datetime;
	g_signal_connect_object ((GObject*) _tmp30_, "notify::active", (GCallback) __gitg_preferences_commit___lambda138__g_object_notify, self, 0);
	_tmp31_ = self->priv->d_custom_datetime;
	g_signal_connect_object ((GObject*) _tmp31_, "notify::active", (GCallback) __gitg_preferences_commit___lambda139__g_object_notify, self, 0);
	_g_object_unref0 (settings);
	return obj;
}

static void
gitg_preferences_commit_class_init (GitgPreferencesCommitClass * klass,
                                    gpointer klass_data)
{
	gitg_preferences_commit_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GitgPreferencesCommit_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gitg_preferences_commit_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gitg_preferences_commit_set_property;
	G_OBJECT_CLASS (klass)->constructor = gitg_preferences_commit_constructor;
	G_OBJECT_CLASS (klass)->finalize = gitg_preferences_commit_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_PREFERENCES_COMMIT_WIDGET_PROPERTY, gitg_preferences_commit_properties[GITG_PREFERENCES_COMMIT_WIDGET_PROPERTY] = g_param_spec_object ("widget", "widget", "widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_PREFERENCES_COMMIT_ID_PROPERTY, gitg_preferences_commit_properties[GITG_PREFERENCES_COMMIT_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_PREFERENCES_COMMIT_DISPLAY_NAME_PROPERTY, gitg_preferences_commit_properties[GITG_PREFERENCES_COMMIT_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GITG_PREFERENCES_COMMIT_DATETIME_SELECTION_PROPERTY, gitg_preferences_commit_properties[GITG_PREFERENCES_COMMIT_DATETIME_SELECTION_PROPERTY] = g_param_spec_string ("datetime-selection", "datetime-selection", "datetime-selection", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/gitg/ui/gitg-preferences-commit.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "check_button_show_markup", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_check_button_show_markup));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "grid_show_markup", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_grid_show_markup));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "check_button_show_subject_margin", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_check_button_show_subject_margin));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spin_button_subject_margin_grid", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_spin_button_subject_margin_grid));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spin_button_subject_margin", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_spin_button_subject_margin));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "check_button_show_right_margin", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_check_button_show_right_margin));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spin_button_right_margin_grid", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_spin_button_right_margin_grid));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spin_button_right_margin", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_spin_button_right_margin));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spell_language_button", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_spell_language_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "enable_spell_checking", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_enable_spell_checking));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spin_button_max_num_commit_messages", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_spin_button_max_num_commit_messages));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "spin_button_max_num_days_commit_messages", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_spin_button_max_num_days_commit_messages));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "radiobutton_predefined_datetime", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_predefined_datetime));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "radiobutton_custom_datetime", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_custom_datetime));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "combobox_predefined_datetime", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_predefined_datetime_combo));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "custom_datetime", FALSE, GitgPreferencesCommit_private_offset + G_STRUCT_OFFSET (GitgPreferencesCommitPrivate, d_custom_datetime_entry));
}

static void
gitg_preferences_commit_gitg_ext_preferences_interface_init (GitgExtPreferencesIface * iface,
                                                             gpointer iface_data)
{
	gitg_preferences_commit_gitg_ext_preferences_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_widget = gitg_preferences_commit_real_get_widget;
	iface->get_id = gitg_preferences_commit_real_get_id;
	iface->get_display_name = gitg_preferences_commit_real_get_display_name;
}

static void
gitg_preferences_commit_instance_init (GitgPreferencesCommit * self,
                                       gpointer klass)
{
	self->priv = gitg_preferences_commit_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
gitg_preferences_commit_finalize (GObject * obj)
{
	GitgPreferencesCommit * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GITG_TYPE_PREFERENCES_COMMIT, GitgPreferencesCommit);
	G_OBJECT_CLASS (gitg_preferences_commit_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
gitg_preferences_commit_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GitgPreferencesCommitClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gitg_preferences_commit_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GitgPreferencesCommit), 0, (GInstanceInitFunc) gitg_preferences_commit_instance_init, NULL };
	static const GInterfaceInfo gitg_ext_preferences_info = { (GInterfaceInitFunc) gitg_preferences_commit_gitg_ext_preferences_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gitg_preferences_commit_type_id;
	gitg_preferences_commit_type_id = g_type_register_static (gtk_grid_get_type (), "GitgPreferencesCommit", &g_define_type_info, 0);
	g_type_add_interface_static (gitg_preferences_commit_type_id, GITG_EXT_TYPE_PREFERENCES, &gitg_ext_preferences_info);
	GitgPreferencesCommit_private_offset = g_type_add_instance_private (gitg_preferences_commit_type_id, sizeof (GitgPreferencesCommitPrivate));
	return gitg_preferences_commit_type_id;
}

GType
gitg_preferences_commit_get_type (void)
{
	static gsize gitg_preferences_commit_type_id__once = 0;
	if (g_once_init_enter (&gitg_preferences_commit_type_id__once)) {
		GType gitg_preferences_commit_type_id;
		gitg_preferences_commit_type_id = gitg_preferences_commit_get_type_once ();
		g_once_init_leave (&gitg_preferences_commit_type_id__once, gitg_preferences_commit_type_id);
	}
	return gitg_preferences_commit_type_id__once;
}

static void
_vala_gitg_preferences_commit_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	GitgPreferencesCommit * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_PREFERENCES_COMMIT, GitgPreferencesCommit);
	switch (property_id) {
		case GITG_PREFERENCES_COMMIT_WIDGET_PROPERTY:
		g_value_take_object (value, gitg_ext_preferences_get_widget ((GitgExtPreferences*) self));
		break;
		case GITG_PREFERENCES_COMMIT_ID_PROPERTY:
		g_value_take_string (value, gitg_ext_preferences_get_id ((GitgExtPreferences*) self));
		break;
		case GITG_PREFERENCES_COMMIT_DISPLAY_NAME_PROPERTY:
		g_value_take_string (value, gitg_ext_preferences_get_display_name ((GitgExtPreferences*) self));
		break;
		case GITG_PREFERENCES_COMMIT_DATETIME_SELECTION_PROPERTY:
		g_value_set_string (value, gitg_preferences_commit_get_datetime_selection (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gitg_preferences_commit_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	GitgPreferencesCommit * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GITG_TYPE_PREFERENCES_COMMIT, GitgPreferencesCommit);
	switch (property_id) {
		case GITG_PREFERENCES_COMMIT_DATETIME_SELECTION_PROPERTY:
		gitg_preferences_commit_set_datetime_selection (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

