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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <adwaita.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include "libdino.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 DINO_UI_TYPE_CHANGE_PASSWORD_DIALOG (dino_ui_change_password_dialog_get_type ())
#define DINO_UI_CHANGE_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiChangePasswordDialog))
#define DINO_UI_CHANGE_PASSWORD_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiChangePasswordDialogClass))
#define DINO_UI_IS_CHANGE_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CHANGE_PASSWORD_DIALOG))
#define DINO_UI_IS_CHANGE_PASSWORD_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CHANGE_PASSWORD_DIALOG))
#define DINO_UI_CHANGE_PASSWORD_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiChangePasswordDialogClass))

typedef struct _DinoUiChangePasswordDialog DinoUiChangePasswordDialog;
typedef struct _DinoUiChangePasswordDialogClass DinoUiChangePasswordDialogClass;
typedef struct _DinoUiChangePasswordDialogPrivate DinoUiChangePasswordDialogPrivate;

#define DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG (dino_ui_view_model_change_password_dialog_get_type ())
#define DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiViewModelChangePasswordDialog))
#define DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiViewModelChangePasswordDialogClass))
#define DINO_UI_VIEW_MODEL_IS_CHANGE_PASSWORD_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG))
#define DINO_UI_VIEW_MODEL_IS_CHANGE_PASSWORD_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG))
#define DINO_UI_VIEW_MODEL_CHANGE_PASSWORD_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiViewModelChangePasswordDialogClass))

typedef struct _DinoUiViewModelChangePasswordDialog DinoUiViewModelChangePasswordDialog;
typedef struct _DinoUiViewModelChangePasswordDialogClass DinoUiViewModelChangePasswordDialogClass;
enum  {
	DINO_UI_CHANGE_PASSWORD_DIALOG_0_PROPERTY,
	DINO_UI_CHANGE_PASSWORD_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dino_ui_change_password_dialog_properties[DINO_UI_CHANGE_PASSWORD_DIALOG_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))
typedef struct _DinoUiChangePasswordDialogOnChangePasswordButtonClickedData DinoUiChangePasswordDialogOnChangePasswordButtonClickedData;

struct _DinoUiChangePasswordDialog {
	GtkDialog parent_instance;
	DinoUiChangePasswordDialogPrivate * priv;
};

struct _DinoUiChangePasswordDialogClass {
	GtkDialogClass parent_class;
};

struct _DinoUiChangePasswordDialogPrivate {
	GtkButton* change_password_button;
	GtkStack* change_password_stack;
	GtkButton* cancel_button;
	AdwPasswordEntryRow* current_password_entry;
	AdwPasswordEntryRow* new_password_entry;
	AdwPasswordEntryRow* confirm_new_password_entry;
	GtkLabel* change_password_error_label;
	DinoUiViewModelChangePasswordDialog* model;
};

struct _DinoUiChangePasswordDialogOnChangePasswordButtonClickedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DinoUiChangePasswordDialog* self;
	gchar* pw_input;
	AdwPasswordEntryRow* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* new_pw_input;
	AdwPasswordEntryRow* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
	const gchar* _tmp7_;
	DinoUiViewModelChangePasswordDialog* _tmp8_;
	DinoEntitiesAccount* _tmp9_;
	DinoEntitiesAccount* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	GtkButton* _tmp14_;
	GtkStack* _tmp15_;
	gchar* ret;
	DinoUiViewModelChangePasswordDialog* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	GtkButton* _tmp19_;
	GtkStack* _tmp20_;
	const gchar* _tmp21_;
	GtkLabel* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	GtkLabel* _tmp26_;
};

static gint DinoUiChangePasswordDialog_private_offset;
static gpointer dino_ui_change_password_dialog_parent_class = NULL;

VALA_EXTERN GType dino_ui_change_password_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiChangePasswordDialog, g_object_unref)
VALA_EXTERN GType dino_ui_view_model_change_password_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelChangePasswordDialog, g_object_unref)
VALA_EXTERN DinoUiChangePasswordDialog* dino_ui_change_password_dialog_new (DinoUiViewModelChangePasswordDialog* model);
VALA_EXTERN DinoUiChangePasswordDialog* dino_ui_change_password_dialog_construct (GType object_type,
                                                                      DinoUiViewModelChangePasswordDialog* model);
VALA_EXTERN void dino_ui_util_force_error_color (GtkWidget* widget,
                                     const gchar* selector);
static void __lambda270_ (DinoUiChangePasswordDialog* self);
static void ___lambda270__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void dino_ui_change_password_dialog_is_form_filled (DinoUiChangePasswordDialog* self);
static void _dino_ui_change_password_dialog_is_form_filled_gtk_editable_changed (GtkEditable* _sender,
                                                                          gpointer self);
static void dino_ui_change_password_dialog_on_change_password_button_clicked (DinoUiChangePasswordDialog* self,
                                                                       GAsyncReadyCallback _callback_,
                                                                       gpointer _user_data_);
static void dino_ui_change_password_dialog_on_change_password_button_clicked_finish (DinoUiChangePasswordDialog* self,
                                                                              GAsyncResult* _res_);
static void _dino_ui_change_password_dialog_on_change_password_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                           gpointer self);
static void dino_ui_change_password_dialog_on_change_password_button_clicked_data_free (gpointer _data);
static gboolean dino_ui_change_password_dialog_on_change_password_button_clicked_co (DinoUiChangePasswordDialogOnChangePasswordButtonClickedData* _data_);
VALA_EXTERN DinoEntitiesAccount* dino_ui_view_model_change_password_dialog_get_account (DinoUiViewModelChangePasswordDialog* self);
VALA_EXTERN void dino_ui_view_model_change_password_dialog_change_password (DinoUiViewModelChangePasswordDialog* self,
                                                                const gchar* new_password,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
VALA_EXTERN gchar* dino_ui_view_model_change_password_dialog_change_password_finish (DinoUiViewModelChangePasswordDialog* self,
                                                                         GAsyncResult* _res_);
static void dino_ui_change_password_dialog_on_change_password_button_clicked_ready (GObject* source_object,
                                                                             GAsyncResult* _res_,
                                                                             gpointer _user_data_);
static void dino_ui_change_password_dialog_finalize (GObject * obj);
static GType dino_ui_change_password_dialog_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_change_password_dialog_get_instance_private (DinoUiChangePasswordDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiChangePasswordDialog_private_offset);
}

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

static void
__lambda270_ (DinoUiChangePasswordDialog* self)
{
	g_signal_emit_by_name ((GtkDialog*) self, "close");
}

static void
___lambda270__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda270_ ((DinoUiChangePasswordDialog*) self);
}

static void
_dino_ui_change_password_dialog_is_form_filled_gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self)
{
	dino_ui_change_password_dialog_is_form_filled ((DinoUiChangePasswordDialog*) self);
}

static void
_dino_ui_change_password_dialog_on_change_password_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                                      gpointer self)
{
	dino_ui_change_password_dialog_on_change_password_button_clicked ((DinoUiChangePasswordDialog*) self, NULL, NULL);
}

DinoUiChangePasswordDialog*
dino_ui_change_password_dialog_construct (GType object_type,
                                          DinoUiViewModelChangePasswordDialog* model)
{
	DinoUiChangePasswordDialog * self = NULL;
	DinoUiViewModelChangePasswordDialog* _tmp0_;
	GtkLabel* _tmp1_;
	GtkButton* _tmp2_;
	AdwPasswordEntryRow* _tmp3_;
	AdwPasswordEntryRow* _tmp4_;
	AdwPasswordEntryRow* _tmp5_;
	GtkButton* _tmp6_;
	g_return_val_if_fail (model != NULL, NULL);
	self = (DinoUiChangePasswordDialog*) g_object_new (object_type, "use-header-bar", 1, NULL);
	_tmp0_ = _g_object_ref0 (model);
	_g_object_unref0 (self->priv->model);
	self->priv->model = _tmp0_;
	_tmp1_ = self->priv->change_password_error_label;
	dino_ui_util_force_error_color ((GtkWidget*) _tmp1_, "*");
	_tmp2_ = self->priv->cancel_button;
	g_signal_connect_object (_tmp2_, "clicked", (GCallback) ___lambda270__gtk_button_clicked, self, 0);
	_tmp3_ = self->priv->current_password_entry;
	g_signal_connect_object ((GtkEditable*) _tmp3_, "changed", (GCallback) _dino_ui_change_password_dialog_is_form_filled_gtk_editable_changed, self, 0);
	_tmp4_ = self->priv->new_password_entry;
	g_signal_connect_object ((GtkEditable*) _tmp4_, "changed", (GCallback) _dino_ui_change_password_dialog_is_form_filled_gtk_editable_changed, self, 0);
	_tmp5_ = self->priv->confirm_new_password_entry;
	g_signal_connect_object ((GtkEditable*) _tmp5_, "changed", (GCallback) _dino_ui_change_password_dialog_is_form_filled_gtk_editable_changed, self, 0);
	_tmp6_ = self->priv->change_password_button;
	g_signal_connect_object (_tmp6_, "clicked", (GCallback) _dino_ui_change_password_dialog_on_change_password_button_clicked_gtk_button_clicked, self, 0);
	return self;
}

DinoUiChangePasswordDialog*
dino_ui_change_password_dialog_new (DinoUiViewModelChangePasswordDialog* model)
{
	return dino_ui_change_password_dialog_construct (DINO_UI_TYPE_CHANGE_PASSWORD_DIALOG, model);
}

static void
dino_ui_change_password_dialog_is_form_filled (DinoUiChangePasswordDialog* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	AdwPasswordEntryRow* _tmp3_;
	const gchar* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp3_ = self->priv->current_password_entry;
	_tmp4_ = gtk_editable_get_text ((GtkEditable*) _tmp3_);
	_tmp5_ = strlen (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ > 0) {
		AdwPasswordEntryRow* _tmp7_;
		const gchar* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		_tmp7_ = self->priv->new_password_entry;
		_tmp8_ = gtk_editable_get_text ((GtkEditable*) _tmp7_);
		_tmp9_ = strlen (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp2_ = _tmp10_ > 0;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		AdwPasswordEntryRow* _tmp11_;
		const gchar* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		_tmp11_ = self->priv->confirm_new_password_entry;
		_tmp12_ = gtk_editable_get_text ((GtkEditable*) _tmp11_);
		_tmp13_ = strlen (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp1_ = _tmp14_ > 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		AdwPasswordEntryRow* _tmp15_;
		const gchar* _tmp16_;
		AdwPasswordEntryRow* _tmp17_;
		const gchar* _tmp18_;
		_tmp15_ = self->priv->new_password_entry;
		_tmp16_ = gtk_editable_get_text ((GtkEditable*) _tmp15_);
		_tmp17_ = self->priv->confirm_new_password_entry;
		_tmp18_ = gtk_editable_get_text ((GtkEditable*) _tmp17_);
		_tmp0_ = g_strcmp0 (_tmp16_, _tmp18_) == 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkButton* _tmp19_;
		_tmp19_ = self->priv->change_password_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp19_, TRUE);
	} else {
		GtkButton* _tmp20_;
		_tmp20_ = self->priv->change_password_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp20_, FALSE);
	}
}

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

static void
dino_ui_change_password_dialog_on_change_password_button_clicked (DinoUiChangePasswordDialog* self,
                                                                  GAsyncReadyCallback _callback_,
                                                                  gpointer _user_data_)
{
	DinoUiChangePasswordDialogOnChangePasswordButtonClickedData* _data_;
	DinoUiChangePasswordDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DinoUiChangePasswordDialogOnChangePasswordButtonClickedData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dino_ui_change_password_dialog_on_change_password_button_clicked_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dino_ui_change_password_dialog_on_change_password_button_clicked_co (_data_);
}

static void
dino_ui_change_password_dialog_on_change_password_button_clicked_finish (DinoUiChangePasswordDialog* self,
                                                                         GAsyncResult* _res_)
{
	DinoUiChangePasswordDialogOnChangePasswordButtonClickedData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dino_ui_change_password_dialog_on_change_password_button_clicked_ready (GObject* source_object,
                                                                        GAsyncResult* _res_,
                                                                        gpointer _user_data_)
{
	DinoUiChangePasswordDialogOnChangePasswordButtonClickedData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dino_ui_change_password_dialog_on_change_password_button_clicked_co (_data_);
}

static gboolean
dino_ui_change_password_dialog_on_change_password_button_clicked_co (DinoUiChangePasswordDialogOnChangePasswordButtonClickedData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->current_password_entry;
	_data_->_tmp1_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp0_);
	_data_->_tmp2_ = g_strdup (_data_->_tmp1_);
	_data_->pw_input = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->self->priv->new_password_entry;
	_data_->_tmp4_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp3_);
	_data_->_tmp5_ = g_strdup (_data_->_tmp4_);
	_data_->new_pw_input = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->pw_input;
	if (_data_->_tmp7_ != NULL) {
		_data_->_tmp8_ = _data_->self->priv->model;
		_data_->_tmp9_ = dino_ui_view_model_change_password_dialog_get_account (_data_->_tmp8_);
		_data_->_tmp10_ = _data_->_tmp9_;
		_data_->_tmp11_ = dino_entities_account_get_password (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp13_ = _data_->pw_input;
		_data_->_tmp6_ = g_strcmp0 (_data_->_tmp12_, _data_->_tmp13_) == 0;
	} else {
		_data_->_tmp6_ = FALSE;
	}
	if (_data_->_tmp6_) {
		_data_->_tmp14_ = _data_->self->priv->change_password_button;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp14_, FALSE);
		_data_->_tmp15_ = _data_->self->priv->change_password_stack;
		gtk_stack_set_visible_child_name (_data_->_tmp15_, "spinner");
		_data_->_tmp16_ = _data_->self->priv->model;
		_data_->_tmp17_ = _data_->new_pw_input;
		_data_->_state_ = 1;
		dino_ui_view_model_change_password_dialog_change_password (_data_->_tmp16_, _data_->_tmp17_, dino_ui_change_password_dialog_on_change_password_button_clicked_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp18_ = dino_ui_view_model_change_password_dialog_change_password_finish (_data_->_tmp16_, _data_->_res_);
		_data_->ret = _data_->_tmp18_;
		_data_->_tmp19_ = _data_->self->priv->change_password_button;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp19_, TRUE);
		_data_->_tmp20_ = _data_->self->priv->change_password_stack;
		gtk_stack_set_visible_child_name (_data_->_tmp20_, "label");
		_data_->_tmp21_ = _data_->ret;
		if (_data_->_tmp21_ == NULL) {
			g_signal_emit_by_name ((GtkDialog*) _data_->self, "close");
		}
		_data_->_tmp22_ = _data_->self->priv->change_password_error_label;
		_data_->_tmp23_ = _data_->ret;
		_data_->_tmp24_ = g_strdup_printf ("Error: %s", _data_->_tmp23_);
		_data_->_tmp25_ = _data_->_tmp24_;
		gtk_label_set_label (_data_->_tmp22_, _data_->_tmp25_);
		_g_free0 (_data_->_tmp25_);
		_g_free0 (_data_->ret);
	} else {
		_data_->_tmp26_ = _data_->self->priv->change_password_error_label;
		gtk_label_set_label (_data_->_tmp26_, "Wrong current password");
	}
	_g_free0 (_data_->new_pw_input);
	_g_free0 (_data_->pw_input);
	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 void
dino_ui_change_password_dialog_class_init (DinoUiChangePasswordDialogClass * klass,
                                           gpointer klass_data)
{
	dino_ui_change_password_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiChangePasswordDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dino_ui_change_password_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/im/dino/Dino/preferences_window/change_password_dialog.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "change_password_button", FALSE, DinoUiChangePasswordDialog_private_offset + G_STRUCT_OFFSET (DinoUiChangePasswordDialogPrivate, change_password_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "change_password_stack", FALSE, DinoUiChangePasswordDialog_private_offset + G_STRUCT_OFFSET (DinoUiChangePasswordDialogPrivate, change_password_stack));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "cancel_button", FALSE, DinoUiChangePasswordDialog_private_offset + G_STRUCT_OFFSET (DinoUiChangePasswordDialogPrivate, cancel_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "current_password_entry", FALSE, DinoUiChangePasswordDialog_private_offset + G_STRUCT_OFFSET (DinoUiChangePasswordDialogPrivate, current_password_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "new_password_entry", FALSE, DinoUiChangePasswordDialog_private_offset + G_STRUCT_OFFSET (DinoUiChangePasswordDialogPrivate, new_password_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "confirm_new_password_entry", FALSE, DinoUiChangePasswordDialog_private_offset + G_STRUCT_OFFSET (DinoUiChangePasswordDialogPrivate, confirm_new_password_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "change_password_error_label", FALSE, DinoUiChangePasswordDialog_private_offset + G_STRUCT_OFFSET (DinoUiChangePasswordDialogPrivate, change_password_error_label));
}

static void
dino_ui_change_password_dialog_instance_init (DinoUiChangePasswordDialog * self,
                                              gpointer klass)
{
	self->priv = dino_ui_change_password_dialog_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
dino_ui_change_password_dialog_finalize (GObject * obj)
{
	DinoUiChangePasswordDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_CHANGE_PASSWORD_DIALOG, DinoUiChangePasswordDialog);
	_g_object_unref0 (self->priv->model);
	G_OBJECT_CLASS (dino_ui_change_password_dialog_parent_class)->finalize (obj);
}

static GType
dino_ui_change_password_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiChangePasswordDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_change_password_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiChangePasswordDialog), 0, (GInstanceInitFunc) dino_ui_change_password_dialog_instance_init, NULL };
	GType dino_ui_change_password_dialog_type_id;
	dino_ui_change_password_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "DinoUiChangePasswordDialog", &g_define_type_info, 0);
	DinoUiChangePasswordDialog_private_offset = g_type_add_instance_private (dino_ui_change_password_dialog_type_id, sizeof (DinoUiChangePasswordDialogPrivate));
	return dino_ui_change_password_dialog_type_id;
}

GType
dino_ui_change_password_dialog_get_type (void)
{
	static volatile gsize dino_ui_change_password_dialog_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_change_password_dialog_type_id__once)) {
		GType dino_ui_change_password_dialog_type_id;
		dino_ui_change_password_dialog_type_id = dino_ui_change_password_dialog_get_type_once ();
		g_once_init_leave (&dino_ui_change_password_dialog_type_id__once, dino_ui_change_password_dialog_type_id);
	}
	return dino_ui_change_password_dialog_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;
}

