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

/*
 * Copyright 2025 elementary, Inc. <https://elementary.io>
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "onlineaccounts.h"
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <granite-7.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  {
	ONLINE_ACCOUNTS_FINALIZE_PAGE_0_PROPERTY,
	ONLINE_ACCOUNTS_FINALIZE_PAGE_CANCELLABLE_PROPERTY,
	ONLINE_ACCOUNTS_FINALIZE_PAGE_ICON_PROPERTY,
	ONLINE_ACCOUNTS_FINALIZE_PAGE_NUM_PROPERTIES
};
static GParamSpec* online_accounts_finalize_page_properties[ONLINE_ACCOUNTS_FINALIZE_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _OnlineAccountsFinalizePagePrivate {
	GCancellable* _cancellable;
	GIcon* _icon;
	GtkImage* badge;
	GtkLabel* description_label;
	GtkButton* back_button;
	GtkButton* close_button;
};

static gint OnlineAccountsFinalizePage_private_offset;
static gpointer online_accounts_finalize_page_parent_class = NULL;

static GObject * online_accounts_finalize_page_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
static void _online_accounts_finalize_page___lambda13_ (OnlineAccountsFinalizePage* self);
static void __online_accounts_finalize_page___lambda13__gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self);
static void _online_accounts_finalize_page___lambda14_ (OnlineAccountsFinalizePage* self);
static void __online_accounts_finalize_page___lambda14__adw_navigation_page_hidden (AdwNavigationPage* _sender,
                                                                             gpointer self);
static void _online_accounts_finalize_page___lambda15_ (OnlineAccountsFinalizePage* self);
static void __online_accounts_finalize_page___lambda15__gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self);
static void online_accounts_finalize_page_finalize (GObject * obj);
static GType online_accounts_finalize_page_get_type_once (void);
static void _vala_online_accounts_finalize_page_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_online_accounts_finalize_page_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
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 inline gpointer
online_accounts_finalize_page_get_instance_private (OnlineAccountsFinalizePage* self)
{
	return G_STRUCT_MEMBER_P (self, OnlineAccountsFinalizePage_private_offset);
}

/**
     * Constructs a new {@link FinalizePage}
     *
     * @param icon The {@link GLib.Icon} to represent the type of account
     *
     * @param cancellable The {@link GLib.Cancellable} to cancel when
     * navigating away from this page
     */
OnlineAccountsFinalizePage*
online_accounts_finalize_page_construct (GType object_type,
                                         GIcon* icon,
                                         GCancellable* cancellable)
{
	OnlineAccountsFinalizePage * self = NULL;
	g_return_val_if_fail (icon != NULL, NULL);
	g_return_val_if_fail (cancellable != NULL, NULL);
	self = (OnlineAccountsFinalizePage*) g_object_new (object_type, "cancellable", cancellable, "icon", icon, NULL);
	return self;
}

OnlineAccountsFinalizePage*
online_accounts_finalize_page_new (GIcon* icon,
                                   GCancellable* cancellable)
{
	return online_accounts_finalize_page_construct (ONLINE_ACCOUNTS_TYPE_FINALIZE_PAGE, icon, cancellable);
}

/**
     * Show a success page when saving an account has succeeded
     */
static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
online_accounts_finalize_page_show_success (OnlineAccountsFinalizePage* self)
{
	GtkLabel* _tmp0_;
	GtkImage* _tmp1_;
	GtkWidget* _tmp2_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GtkWidget* _tmp5_;
	AdwNavigationPage* _tmp6_;
	AdwNavigationPage** _tmp7_;
	AdwNavigationPage** _tmp8_;
	gint _tmp8__length1;
	g_return_if_fail (self != NULL);
	adw_navigation_page_set_title ((AdwNavigationPage*) self, _ ("Ready to go"));
	_tmp0_ = self->priv->description_label;
	gtk_label_set_label (_tmp0_, _ ("Account saved"));
	_tmp1_ = self->priv->badge;
	g_object_set (_tmp1_, "icon-name", "process-completed", NULL);
	_tmp2_ = gtk_widget_get_ancestor ((GtkWidget*) self, gtk_window_get_type ());
	_tmp3_ = self->priv->close_button;
	gtk_window_set_default_widget (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_window_get_type (), GtkWindow), (GtkWidget*) _tmp3_);
	_tmp4_ = self->priv->back_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp4_, FALSE);
	_tmp5_ = gtk_widget_get_ancestor ((GtkWidget*) self, adw_navigation_view_get_type ());
	_tmp6_ = _g_object_ref0 ((AdwNavigationPage*) self);
	_tmp7_ = g_new0 (AdwNavigationPage*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 1;
	adw_navigation_view_replace (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, adw_navigation_view_get_type (), AdwNavigationView), _tmp8_, (gint) 1);
	_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_object_unref), NULL);
}

/**
     * Show an error message when saving an account has failed
     */
void
online_accounts_finalize_page_show_error (OnlineAccountsFinalizePage* self,
                                          const gchar* message)
{
	GtkLabel* _tmp0_;
	GtkImage* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (message != NULL);
	adw_navigation_page_set_title ((AdwNavigationPage*) self, _ ("Could not save the account"));
	_tmp0_ = self->priv->description_label;
	gtk_label_set_label (_tmp0_, message);
	_tmp1_ = self->priv->badge;
	g_object_set (_tmp1_, "icon-name", "dialog-error", NULL);
}

GCancellable*
online_accounts_finalize_page_get_cancellable (OnlineAccountsFinalizePage* self)
{
	GCancellable* result;
	GCancellable* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_cancellable;
	result = _tmp0_;
	return result;
}

static void
online_accounts_finalize_page_set_cancellable (OnlineAccountsFinalizePage* self,
                                               GCancellable* value)
{
	GCancellable* old_value;
	g_return_if_fail (self != NULL);
	old_value = online_accounts_finalize_page_get_cancellable (self);
	if (old_value != value) {
		GCancellable* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_cancellable);
		self->priv->_cancellable = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, online_accounts_finalize_page_properties[ONLINE_ACCOUNTS_FINALIZE_PAGE_CANCELLABLE_PROPERTY]);
	}
}

GIcon*
online_accounts_finalize_page_get_icon (OnlineAccountsFinalizePage* self)
{
	GIcon* result;
	GIcon* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_icon;
	result = _tmp0_;
	return result;
}

static void
online_accounts_finalize_page_set_icon (OnlineAccountsFinalizePage* self,
                                        GIcon* value)
{
	GIcon* old_value;
	g_return_if_fail (self != NULL);
	old_value = online_accounts_finalize_page_get_icon (self);
	if (old_value != value) {
		GIcon* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_icon);
		self->priv->_icon = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, online_accounts_finalize_page_properties[ONLINE_ACCOUNTS_FINALIZE_PAGE_ICON_PROPERTY]);
	}
}

static void
_online_accounts_finalize_page___lambda13_ (OnlineAccountsFinalizePage* self)
{
	GtkWidget* _tmp0_;
	_tmp0_ = gtk_widget_get_ancestor ((GtkWidget*) self, adw_navigation_view_get_type ());
	adw_navigation_view_pop (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, adw_navigation_view_get_type (), AdwNavigationView));
}

static void
__online_accounts_finalize_page___lambda13__gtk_button_clicked (GtkButton* _sender,
                                                                gpointer self)
{
	_online_accounts_finalize_page___lambda13_ ((OnlineAccountsFinalizePage*) self);
}

static void
_online_accounts_finalize_page___lambda14_ (OnlineAccountsFinalizePage* self)
{
	GCancellable* _tmp0_;
	_tmp0_ = self->priv->_cancellable;
	if (_tmp0_ != NULL) {
		GCancellable* _tmp1_;
		_tmp1_ = self->priv->_cancellable;
		g_cancellable_cancel (_tmp1_);
	}
}

static void
__online_accounts_finalize_page___lambda14__adw_navigation_page_hidden (AdwNavigationPage* _sender,
                                                                        gpointer self)
{
	_online_accounts_finalize_page___lambda14_ ((OnlineAccountsFinalizePage*) self);
}

static void
_online_accounts_finalize_page___lambda15_ (OnlineAccountsFinalizePage* self)
{
	GCancellable* _tmp0_;
	GtkWidget* _tmp2_;
	_tmp0_ = self->priv->_cancellable;
	if (_tmp0_ != NULL) {
		GCancellable* _tmp1_;
		_tmp1_ = self->priv->_cancellable;
		g_cancellable_cancel (_tmp1_);
	}
	_tmp2_ = gtk_widget_get_ancestor ((GtkWidget*) self, gtk_window_get_type ());
	gtk_window_close (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_window_get_type (), GtkWindow));
}

static void
__online_accounts_finalize_page___lambda15__gtk_button_clicked (GtkButton* _sender,
                                                                gpointer self)
{
	_online_accounts_finalize_page___lambda15_ ((OnlineAccountsFinalizePage*) self);
}

static GObject *
online_accounts_finalize_page_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	OnlineAccountsFinalizePage * self;
	GtkImage* image = NULL;
	GIcon* _tmp0_;
	GtkImage* _tmp1_ = NULL;
	GtkImage* _tmp2_ = NULL;
	GtkOverlay* overlay = NULL;
	GtkImage* _tmp3_;
	GtkWidget* _tmp4_;
	GtkOverlay* _tmp5_ = NULL;
	GtkOverlay* _tmp6_;
	GtkImage* _tmp7_;
	GtkLabel* title_label = NULL;
	GtkLabel* _tmp8_ = NULL;
	GtkLabel* _tmp9_;
	GtkLabel* _tmp10_ = NULL;
	GtkLabel* _tmp11_;
	GtkBox* content_box = NULL;
	GtkBox* _tmp12_;
	GtkBox* _tmp13_;
	GtkOverlay* _tmp14_;
	GtkBox* _tmp15_;
	GtkLabel* _tmp16_;
	GtkBox* _tmp17_;
	GtkLabel* _tmp18_;
	GtkButton* _tmp19_;
	GtkButton* _tmp20_;
	GtkButton* _tmp21_;
	GtkBox* action_area = NULL;
	GtkBox* _tmp22_ = NULL;
	GtkBox* _tmp23_;
	GtkBox* _tmp24_;
	GtkButton* _tmp25_;
	GtkBox* _tmp26_;
	GtkButton* _tmp27_;
	GtkBox* box = NULL;
	GtkBox* _tmp28_;
	GtkBox* _tmp29_;
	GtkBox* _tmp30_;
	GtkBox* _tmp31_;
	GtkBox* _tmp32_;
	GtkBox* _tmp33_;
	GtkLabel* _tmp34_;
	GtkButton* _tmp35_;
	GtkButton* _tmp36_;
	parent_class = G_OBJECT_CLASS (online_accounts_finalize_page_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONLINE_ACCOUNTS_TYPE_FINALIZE_PAGE, OnlineAccountsFinalizePage);
	_tmp0_ = self->priv->_icon;
	_tmp1_ = (GtkImage*) gtk_image_new_from_gicon (_tmp0_);
	gtk_image_set_icon_size (_tmp1_, GTK_ICON_SIZE_LARGE);
	g_object_ref_sink (_tmp1_);
	image = _tmp1_;
	_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name ("emblem-synchronized");
	gtk_widget_set_halign ((GtkWidget*) _tmp2_, GTK_ALIGN_END);
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_END);
	gtk_image_set_icon_size (_tmp2_, GTK_ICON_SIZE_NORMAL);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->badge);
	self->priv->badge = _tmp2_;
	_tmp3_ = image;
	_tmp4_ = _g_object_ref0 ((GtkWidget*) _tmp3_);
	_tmp5_ = (GtkOverlay*) gtk_overlay_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp5_, GTK_ALIGN_CENTER);
	gtk_overlay_set_child (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	overlay = _tmp5_;
	_tmp6_ = overlay;
	_tmp7_ = self->priv->badge;
	gtk_overlay_add_overlay (_tmp6_, (GtkWidget*) _tmp7_);
	_tmp8_ = (GtkLabel*) gtk_label_new ("");
	gtk_widget_set_halign ((GtkWidget*) _tmp8_, GTK_ALIGN_CENTER);
	gtk_label_set_justify (_tmp8_, GTK_JUSTIFY_CENTER);
	gtk_label_set_wrap (_tmp8_, TRUE);
	gtk_label_set_max_width_chars (_tmp8_, 50);
	gtk_label_set_use_markup (_tmp8_, TRUE);
	g_object_ref_sink (_tmp8_);
	title_label = _tmp8_;
	_tmp9_ = title_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp9_, GRANITE_STYLE_CLASS_H1_LABEL);
	_tmp10_ = (GtkLabel*) gtk_label_new ("");
	gtk_widget_set_halign ((GtkWidget*) _tmp10_, GTK_ALIGN_CENTER);
	gtk_label_set_justify (_tmp10_, GTK_JUSTIFY_CENTER);
	gtk_label_set_wrap (_tmp10_, TRUE);
	gtk_label_set_max_width_chars (_tmp10_, 50);
	gtk_label_set_use_markup (_tmp10_, TRUE);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->description_label);
	self->priv->description_label = _tmp10_;
	_tmp11_ = self->priv->description_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp11_, GRANITE_STYLE_CLASS_DIM_LABEL);
	_tmp12_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp12_);
	content_box = _tmp12_;
	_tmp13_ = content_box;
	_tmp14_ = overlay;
	gtk_box_append (_tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = content_box;
	_tmp16_ = title_label;
	gtk_box_append (_tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = content_box;
	_tmp18_ = self->priv->description_label;
	gtk_box_append (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = (GtkButton*) gtk_button_new_with_label (_ ("Back"));
	g_object_ref_sink (_tmp19_);
	_g_object_unref0 (self->priv->back_button);
	self->priv->back_button = _tmp19_;
	_tmp20_ = (GtkButton*) gtk_button_new_with_label (_ ("Close"));
	g_object_ref_sink (_tmp20_);
	_g_object_unref0 (self->priv->close_button);
	self->priv->close_button = _tmp20_;
	_tmp21_ = self->priv->close_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp21_, GRANITE_STYLE_CLASS_SUGGESTED_ACTION);
	_tmp22_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_valign ((GtkWidget*) _tmp22_, GTK_ALIGN_END);
	gtk_widget_set_halign ((GtkWidget*) _tmp22_, GTK_ALIGN_END);
	gtk_box_set_homogeneous (_tmp22_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp22_, TRUE);
	g_object_ref_sink (_tmp22_);
	action_area = _tmp22_;
	_tmp23_ = action_area;
	gtk_widget_add_css_class ((GtkWidget*) _tmp23_, "action-area");
	_tmp24_ = action_area;
	_tmp25_ = self->priv->back_button;
	gtk_box_append (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = action_area;
	_tmp27_ = self->priv->close_button;
	gtk_box_append (_tmp26_, (GtkWidget*) _tmp27_);
	_tmp28_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp28_);
	box = _tmp28_;
	_tmp29_ = box;
	_tmp30_ = content_box;
	gtk_box_append (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = box;
	_tmp32_ = action_area;
	gtk_box_append (_tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = box;
	adw_navigation_page_set_child ((AdwNavigationPage*) self, (GtkWidget*) _tmp33_);
	adw_navigation_page_set_title ((AdwNavigationPage*) self, _ ("Setting up the account…"));
	gtk_widget_add_css_class ((GtkWidget*) self, "oa-finalize");
	_tmp34_ = title_label;
	g_object_bind_property_with_closures ((GObject*) self, "title", (GObject*) _tmp34_, "label", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp35_ = self->priv->back_button;
	g_signal_connect_object (_tmp35_, "clicked", (GCallback) __online_accounts_finalize_page___lambda13__gtk_button_clicked, self, 0);
	g_signal_connect_object ((AdwNavigationPage*) self, "hidden", (GCallback) __online_accounts_finalize_page___lambda14__adw_navigation_page_hidden, self, 0);
	_tmp36_ = self->priv->close_button;
	g_signal_connect_object (_tmp36_, "clicked", (GCallback) __online_accounts_finalize_page___lambda15__gtk_button_clicked, self, 0);
	_g_object_unref0 (box);
	_g_object_unref0 (action_area);
	_g_object_unref0 (content_box);
	_g_object_unref0 (title_label);
	_g_object_unref0 (overlay);
	_g_object_unref0 (image);
	return obj;
}

static void
online_accounts_finalize_page_class_init (OnlineAccountsFinalizePageClass * klass,
                                          gpointer klass_data)
{
	online_accounts_finalize_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &OnlineAccountsFinalizePage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_online_accounts_finalize_page_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_online_accounts_finalize_page_set_property;
	G_OBJECT_CLASS (klass)->constructor = online_accounts_finalize_page_constructor;
	G_OBJECT_CLASS (klass)->finalize = online_accounts_finalize_page_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), ONLINE_ACCOUNTS_FINALIZE_PAGE_CANCELLABLE_PROPERTY, online_accounts_finalize_page_properties[ONLINE_ACCOUNTS_FINALIZE_PAGE_CANCELLABLE_PROPERTY] = g_param_spec_object ("cancellable", "cancellable", "cancellable", g_cancellable_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), ONLINE_ACCOUNTS_FINALIZE_PAGE_ICON_PROPERTY, online_accounts_finalize_page_properties[ONLINE_ACCOUNTS_FINALIZE_PAGE_ICON_PROPERTY] = g_param_spec_object ("icon", "icon", "icon", g_icon_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
online_accounts_finalize_page_instance_init (OnlineAccountsFinalizePage * self,
                                             gpointer klass)
{
	self->priv = online_accounts_finalize_page_get_instance_private (self);
}

static void
online_accounts_finalize_page_finalize (GObject * obj)
{
	OnlineAccountsFinalizePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONLINE_ACCOUNTS_TYPE_FINALIZE_PAGE, OnlineAccountsFinalizePage);
	_g_object_unref0 (self->priv->_cancellable);
	_g_object_unref0 (self->priv->_icon);
	_g_object_unref0 (self->priv->badge);
	_g_object_unref0 (self->priv->description_label);
	_g_object_unref0 (self->priv->back_button);
	_g_object_unref0 (self->priv->close_button);
	G_OBJECT_CLASS (online_accounts_finalize_page_parent_class)->finalize (obj);
}

/**
 * FinalizePage is an {@link Adw.NavigationPage} subclass that shows
 * in-progress, success, and error states
 */
static GType
online_accounts_finalize_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (OnlineAccountsFinalizePageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) online_accounts_finalize_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OnlineAccountsFinalizePage), 0, (GInstanceInitFunc) online_accounts_finalize_page_instance_init, NULL };
	GType online_accounts_finalize_page_type_id;
	online_accounts_finalize_page_type_id = g_type_register_static (adw_navigation_page_get_type (), "OnlineAccountsFinalizePage", &g_define_type_info, 0);
	OnlineAccountsFinalizePage_private_offset = g_type_add_instance_private (online_accounts_finalize_page_type_id, sizeof (OnlineAccountsFinalizePagePrivate));
	return online_accounts_finalize_page_type_id;
}

GType
online_accounts_finalize_page_get_type (void)
{
	static volatile gsize online_accounts_finalize_page_type_id__once = 0;
	if (g_once_init_enter (&online_accounts_finalize_page_type_id__once)) {
		GType online_accounts_finalize_page_type_id;
		online_accounts_finalize_page_type_id = online_accounts_finalize_page_get_type_once ();
		g_once_init_leave (&online_accounts_finalize_page_type_id__once, online_accounts_finalize_page_type_id);
	}
	return online_accounts_finalize_page_type_id__once;
}

static void
_vala_online_accounts_finalize_page_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	OnlineAccountsFinalizePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ONLINE_ACCOUNTS_TYPE_FINALIZE_PAGE, OnlineAccountsFinalizePage);
	switch (property_id) {
		case ONLINE_ACCOUNTS_FINALIZE_PAGE_CANCELLABLE_PROPERTY:
		g_value_set_object (value, online_accounts_finalize_page_get_cancellable (self));
		break;
		case ONLINE_ACCOUNTS_FINALIZE_PAGE_ICON_PROPERTY:
		g_value_set_object (value, online_accounts_finalize_page_get_icon (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_online_accounts_finalize_page_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	OnlineAccountsFinalizePage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, ONLINE_ACCOUNTS_TYPE_FINALIZE_PAGE, OnlineAccountsFinalizePage);
	switch (property_id) {
		case ONLINE_ACCOUNTS_FINALIZE_PAGE_CANCELLABLE_PROPERTY:
		online_accounts_finalize_page_set_cancellable (self, g_value_get_object (value));
		break;
		case ONLINE_ACCOUNTS_FINALIZE_PAGE_ICON_PROPERTY:
		online_accounts_finalize_page_set_icon (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

