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

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.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
#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 TUBA_DIALOGS_ADMIN_TYPE_BASE (tuba_dialogs_admin_base_get_type ())
#define TUBA_DIALOGS_ADMIN_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBase))
#define TUBA_DIALOGS_ADMIN_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBaseClass))
#define TUBA_DIALOGS_ADMIN_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_ADMIN_TYPE_BASE))
#define TUBA_DIALOGS_ADMIN_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_ADMIN_TYPE_BASE))
#define TUBA_DIALOGS_ADMIN_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBaseClass))

typedef struct _TubaDialogsAdminBase TubaDialogsAdminBase;
typedef struct _TubaDialogsAdminBaseClass TubaDialogsAdminBaseClass;
typedef struct _TubaDialogsAdminBasePrivate TubaDialogsAdminBasePrivate;
enum  {
	TUBA_DIALOGS_ADMIN_BASE_0_PROPERTY,
	TUBA_DIALOGS_ADMIN_BASE_PAGE_PROPERTY,
	TUBA_DIALOGS_ADMIN_BASE_HEADERBAR_PROPERTY,
	TUBA_DIALOGS_ADMIN_BASE_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_admin_base_properties[TUBA_DIALOGS_ADMIN_BASE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _TubaDialogsAdminBase {
	AdwDialog parent_instance;
	TubaDialogsAdminBasePrivate * priv;
};

struct _TubaDialogsAdminBaseClass {
	AdwDialogClass parent_class;
};

struct _TubaDialogsAdminBasePrivate {
	AdwToastOverlay* toast_overlay;
	AdwPreferencesPage* _page;
	AdwHeaderBar* _headerbar;
};

static gint TubaDialogsAdminBase_private_offset;
static gpointer tuba_dialogs_admin_base_parent_class = NULL;

VALA_EXTERN GType tuba_dialogs_admin_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsAdminBase, g_object_unref)
VALA_EXTERN void tuba_dialogs_admin_base_add_toast (TubaDialogsAdminBase* self,
                                        const gchar* content);
VALA_EXTERN TubaDialogsAdminBase* tuba_dialogs_admin_base_new (void);
VALA_EXTERN TubaDialogsAdminBase* tuba_dialogs_admin_base_construct (GType object_type);
VALA_EXTERN AdwPreferencesPage* tuba_dialogs_admin_base_get_page (TubaDialogsAdminBase* self);
VALA_EXTERN void tuba_dialogs_admin_base_set_page (TubaDialogsAdminBase* self,
                                       AdwPreferencesPage* value);
VALA_EXTERN AdwHeaderBar* tuba_dialogs_admin_base_get_headerbar (TubaDialogsAdminBase* self);
VALA_EXTERN void tuba_dialogs_admin_base_set_headerbar (TubaDialogsAdminBase* self,
                                            AdwHeaderBar* value);
static GObject * tuba_dialogs_admin_base_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void tuba_dialogs_admin_base_finalize (GObject * obj);
static GType tuba_dialogs_admin_base_get_type_once (void);
static void _vala_tuba_dialogs_admin_base_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_tuba_dialogs_admin_base_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);

static inline gpointer
tuba_dialogs_admin_base_get_instance_private (TubaDialogsAdminBase* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsAdminBase_private_offset);
}

void
tuba_dialogs_admin_base_add_toast (TubaDialogsAdminBase* self,
                                   const gchar* content)
{
	AdwToastOverlay* _tmp0_;
	AdwToast* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	_tmp0_ = self->priv->toast_overlay;
	_tmp1_ = adw_toast_new (content);
	adw_toast_set_timeout (_tmp1_, (guint) 5);
	adw_toast_overlay_add_toast (_tmp0_, _tmp1_);
}

TubaDialogsAdminBase*
tuba_dialogs_admin_base_construct (GType object_type)
{
	TubaDialogsAdminBase * self = NULL;
	self = (TubaDialogsAdminBase*) g_object_new (object_type, NULL);
	return self;
}

TubaDialogsAdminBase*
tuba_dialogs_admin_base_new (void)
{
	return tuba_dialogs_admin_base_construct (TUBA_DIALOGS_ADMIN_TYPE_BASE);
}

AdwPreferencesPage*
tuba_dialogs_admin_base_get_page (TubaDialogsAdminBase* self)
{
	AdwPreferencesPage* result;
	AdwPreferencesPage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_page;
	result = _tmp0_;
	return result;
}

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

void
tuba_dialogs_admin_base_set_page (TubaDialogsAdminBase* self,
                                  AdwPreferencesPage* value)
{
	AdwPreferencesPage* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_admin_base_get_page (self);
	if (old_value != value) {
		AdwPreferencesPage* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_page);
		self->priv->_page = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_admin_base_properties[TUBA_DIALOGS_ADMIN_BASE_PAGE_PROPERTY]);
	}
}

AdwHeaderBar*
tuba_dialogs_admin_base_get_headerbar (TubaDialogsAdminBase* self)
{
	AdwHeaderBar* result;
	AdwHeaderBar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_headerbar;
	result = _tmp0_;
	return result;
}

void
tuba_dialogs_admin_base_set_headerbar (TubaDialogsAdminBase* self,
                                       AdwHeaderBar* value)
{
	AdwHeaderBar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_admin_base_get_headerbar (self);
	if (old_value != value) {
		AdwHeaderBar* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_headerbar);
		self->priv->_headerbar = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_admin_base_properties[TUBA_DIALOGS_ADMIN_BASE_HEADERBAR_PROPERTY]);
	}
}

static GObject *
tuba_dialogs_admin_base_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaDialogsAdminBase * self;
	AdwPreferencesPage* _tmp0_;
	AdwPreferencesPage* _tmp1_;
	AdwPreferencesPage* _tmp2_;
	GtkWidget* _tmp3_;
	AdwToastOverlay* _tmp4_ = NULL;
	AdwToolbarView* toolbarview = NULL;
	AdwToastOverlay* _tmp5_;
	GtkWidget* _tmp6_;
	AdwToolbarView* _tmp7_ = NULL;
	AdwHeaderBar* _tmp8_;
	AdwHeaderBar* _tmp9_;
	AdwToolbarView* _tmp10_;
	AdwHeaderBar* _tmp11_;
	AdwToolbarView* _tmp12_;
	parent_class = G_OBJECT_CLASS (tuba_dialogs_admin_base_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBase);
	_tmp0_ = (AdwPreferencesPage*) adw_preferences_page_new ();
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	tuba_dialogs_admin_base_set_page (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_page;
	_tmp3_ = _g_object_ref0 ((GtkWidget*) _tmp2_);
	_tmp4_ = (AdwToastOverlay*) adw_toast_overlay_new ();
	gtk_widget_set_vexpand ((GtkWidget*) _tmp4_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp4_, TRUE);
	adw_toast_overlay_set_child (_tmp4_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->toast_overlay);
	self->priv->toast_overlay = _tmp4_;
	_tmp5_ = self->priv->toast_overlay;
	_tmp6_ = _g_object_ref0 ((GtkWidget*) _tmp5_);
	_tmp7_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_content (_tmp7_, _tmp6_);
	_g_object_unref0 (_tmp6_);
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp7_);
	toolbarview = _tmp7_;
	_tmp8_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp8_);
	_tmp9_ = _tmp8_;
	tuba_dialogs_admin_base_set_headerbar (self, _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = toolbarview;
	_tmp11_ = self->priv->_headerbar;
	adw_toolbar_view_add_top_bar (_tmp10_, (GtkWidget*) _tmp11_);
	_tmp12_ = toolbarview;
	adw_dialog_set_child ((AdwDialog*) self, (GtkWidget*) _tmp12_);
	_g_object_unref0 (toolbarview);
	return obj;
}

static void
tuba_dialogs_admin_base_class_init (TubaDialogsAdminBaseClass * klass,
                                    gpointer klass_data)
{
	tuba_dialogs_admin_base_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsAdminBase_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_dialogs_admin_base_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_dialogs_admin_base_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_dialogs_admin_base_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_admin_base_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_ADMIN_BASE_PAGE_PROPERTY, tuba_dialogs_admin_base_properties[TUBA_DIALOGS_ADMIN_BASE_PAGE_PROPERTY] = g_param_spec_object ("page", "page", "page", adw_preferences_page_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_ADMIN_BASE_HEADERBAR_PROPERTY, tuba_dialogs_admin_base_properties[TUBA_DIALOGS_ADMIN_BASE_HEADERBAR_PROPERTY] = g_param_spec_object ("headerbar", "headerbar", "headerbar", adw_header_bar_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_dialogs_admin_base_instance_init (TubaDialogsAdminBase * self,
                                       gpointer klass)
{
	self->priv = tuba_dialogs_admin_base_get_instance_private (self);
}

static void
tuba_dialogs_admin_base_finalize (GObject * obj)
{
	TubaDialogsAdminBase * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBase);
	g_debug ("Base.vala:3: Destroying Dialog Admin Base");
	_g_object_unref0 (self->priv->toast_overlay);
	_g_object_unref0 (self->priv->_page);
	_g_object_unref0 (self->priv->_headerbar);
	G_OBJECT_CLASS (tuba_dialogs_admin_base_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_admin_base_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsAdminBaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_admin_base_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsAdminBase), 0, (GInstanceInitFunc) tuba_dialogs_admin_base_instance_init, NULL };
	GType tuba_dialogs_admin_base_type_id;
	tuba_dialogs_admin_base_type_id = g_type_register_static (adw_dialog_get_type (), "TubaDialogsAdminBase", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaDialogsAdminBase_private_offset = g_type_add_instance_private (tuba_dialogs_admin_base_type_id, sizeof (TubaDialogsAdminBasePrivate));
	return tuba_dialogs_admin_base_type_id;
}

GType
tuba_dialogs_admin_base_get_type (void)
{
	static GType tuba_dialogs_admin_base_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_admin_base_type_id__once)) {
		GType tuba_dialogs_admin_base_type_id;
		tuba_dialogs_admin_base_type_id = tuba_dialogs_admin_base_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_admin_base_type_id__once, tuba_dialogs_admin_base_type_id);
	}
	return tuba_dialogs_admin_base_type_id__once;
}

static void
_vala_tuba_dialogs_admin_base_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	TubaDialogsAdminBase * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBase);
	switch (property_id) {
		case TUBA_DIALOGS_ADMIN_BASE_PAGE_PROPERTY:
		g_value_set_object (value, tuba_dialogs_admin_base_get_page (self));
		break;
		case TUBA_DIALOGS_ADMIN_BASE_HEADERBAR_PROPERTY:
		g_value_set_object (value, tuba_dialogs_admin_base_get_headerbar (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_dialogs_admin_base_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	TubaDialogsAdminBase * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_ADMIN_TYPE_BASE, TubaDialogsAdminBase);
	switch (property_id) {
		case TUBA_DIALOGS_ADMIN_BASE_PAGE_PROPERTY:
		tuba_dialogs_admin_base_set_page (self, g_value_get_object (value));
		break;
		case TUBA_DIALOGS_ADMIN_BASE_HEADERBAR_PROPERTY:
		tuba_dialogs_admin_base_set_headerbar (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

