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

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

#include "onlineaccounts.h"
#include <adwaita.h>
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.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_PAGED_DIALOG_0_PROPERTY,
	ONLINE_ACCOUNTS_PAGED_DIALOG_NUM_PROPERTIES
};
static GParamSpec* online_accounts_paged_dialog_properties[ONLINE_ACCOUNTS_PAGED_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _OnlineAccountsPagedDialogPrivate {
	AdwNavigationView* navigation_view;
};

static gint OnlineAccountsPagedDialog_private_offset;
static gpointer online_accounts_paged_dialog_parent_class = NULL;

static GObject * online_accounts_paged_dialog_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties);
static void online_accounts_paged_dialog_finalize (GObject * obj);
static GType online_accounts_paged_dialog_get_type_once (void);

static inline gpointer
online_accounts_paged_dialog_get_instance_private (OnlineAccountsPagedDialog* self)
{
	return G_STRUCT_MEMBER_P (self, OnlineAccountsPagedDialog_private_offset);
}

/**
     * Pushes an {@link Adw.NavigationPage} onto the navigation stack
     */
void
online_accounts_paged_dialog_push_page (OnlineAccountsPagedDialog* self,
                                        AdwNavigationPage* page)
{
	AdwNavigationView* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (page != NULL);
	_tmp0_ = self->priv->navigation_view;
	adw_navigation_view_push (_tmp0_, page);
}

/**
     * Pops the visible {@link Adw.NavigationPage} from the navigation stack
     */
void
online_accounts_paged_dialog_pop_page (OnlineAccountsPagedDialog* self)
{
	AdwNavigationView* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->navigation_view;
	adw_navigation_view_pop (_tmp0_);
}

OnlineAccountsPagedDialog*
online_accounts_paged_dialog_construct (GType object_type)
{
	OnlineAccountsPagedDialog * self = NULL;
	self = (OnlineAccountsPagedDialog*) g_object_new (object_type, NULL);
	return self;
}

OnlineAccountsPagedDialog*
online_accounts_paged_dialog_new (void)
{
	return online_accounts_paged_dialog_construct (ONLINE_ACCOUNTS_TYPE_PAGED_DIALOG);
}

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

static GObject *
online_accounts_paged_dialog_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	OnlineAccountsPagedDialog * self;
	AdwNavigationView* _tmp0_ = NULL;
	GtkWindowHandle* window_handle = NULL;
	AdwNavigationView* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWindowHandle* _tmp3_ = NULL;
	GtkWindowHandle* _tmp4_;
	GtkGrid* _tmp5_ = NULL;
	GtkGrid* _tmp6_;
	parent_class = G_OBJECT_CLASS (online_accounts_paged_dialog_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONLINE_ACCOUNTS_TYPE_PAGED_DIALOG, OnlineAccountsPagedDialog);
	_tmp0_ = (AdwNavigationView*) adw_navigation_view_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->navigation_view);
	self->priv->navigation_view = _tmp0_;
	_tmp1_ = self->priv->navigation_view;
	_tmp2_ = _g_object_ref0 ((GtkWidget*) _tmp1_);
	_tmp3_ = (GtkWindowHandle*) gtk_window_handle_new ();
	gtk_window_handle_set_child (_tmp3_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	window_handle = _tmp3_;
	_tmp4_ = window_handle;
	gtk_window_set_child ((GtkWindow*) self, (GtkWidget*) _tmp4_);
	g_object_set ((GtkWindow*) self, "default-height", 475, NULL);
	g_object_set ((GtkWindow*) self, "default-width", 350, NULL);
	gtk_window_set_modal ((GtkWindow*) self, TRUE);
	_tmp5_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_visible ((GtkWidget*) _tmp5_, FALSE);
	g_object_ref_sink (_tmp5_);
	_tmp6_ = _tmp5_;
	gtk_window_set_titlebar ((GtkWindow*) self, (GtkWidget*) _tmp6_);
	_g_object_unref0 (_tmp6_);
	gtk_widget_add_css_class ((GtkWidget*) self, "dialog");
	gtk_widget_add_css_class ((GtkWidget*) self, "paged");
	_g_object_unref0 (window_handle);
	return obj;
}

static void
online_accounts_paged_dialog_class_init (OnlineAccountsPagedDialogClass * klass,
                                         gpointer klass_data)
{
	online_accounts_paged_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &OnlineAccountsPagedDialog_private_offset);
	G_OBJECT_CLASS (klass)->constructor = online_accounts_paged_dialog_constructor;
	G_OBJECT_CLASS (klass)->finalize = online_accounts_paged_dialog_finalize;
}

static void
online_accounts_paged_dialog_instance_init (OnlineAccountsPagedDialog * self,
                                            gpointer klass)
{
	self->priv = online_accounts_paged_dialog_get_instance_private (self);
}

static void
online_accounts_paged_dialog_finalize (GObject * obj)
{
	OnlineAccountsPagedDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ONLINE_ACCOUNTS_TYPE_PAGED_DIALOG, OnlineAccountsPagedDialog);
	_g_object_unref0 (self->priv->navigation_view);
	G_OBJECT_CLASS (online_accounts_paged_dialog_parent_class)->finalize (obj);
}

/**
 * PagedDialog is a modal {@link Gtk.Window} subclass containing an {@link Adw.NavigationView}.
 */
static GType
online_accounts_paged_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (OnlineAccountsPagedDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) online_accounts_paged_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OnlineAccountsPagedDialog), 0, (GInstanceInitFunc) online_accounts_paged_dialog_instance_init, NULL };
	GType online_accounts_paged_dialog_type_id;
	online_accounts_paged_dialog_type_id = g_type_register_static (gtk_window_get_type (), "OnlineAccountsPagedDialog", &g_define_type_info, 0);
	OnlineAccountsPagedDialog_private_offset = g_type_add_instance_private (online_accounts_paged_dialog_type_id, sizeof (OnlineAccountsPagedDialogPrivate));
	return online_accounts_paged_dialog_type_id;
}

GType
online_accounts_paged_dialog_get_type (void)
{
	static volatile gsize online_accounts_paged_dialog_type_id__once = 0;
	if (g_once_init_enter (&online_accounts_paged_dialog_type_id__once)) {
		GType online_accounts_paged_dialog_type_id;
		online_accounts_paged_dialog_type_id = online_accounts_paged_dialog_get_type_once ();
		g_once_init_leave (&online_accounts_paged_dialog_type_id__once, online_accounts_paged_dialog_type_id);
	}
	return online_accounts_paged_dialog_type_id__once;
}

