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

#include "protonplus_core.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.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  {
	PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_0_PROPERTY,
	PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_TITLE_WIDGET_PROPERTY,
	PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_CAN_NAVIGATE_BACK_PROPERTY,
	PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_END_ACTIONS_PROPERTY,
	PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_WIDGET_PROPERTY,
	PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_header_presentation_properties[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_REQUESTED_SIGNAL,
	PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_WIDGET_CHANGED_SIGNAL,
	PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_NUM_SIGNALS
};
static guint proton_plus_widgets_header_presentation_signals[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_NUM_SIGNALS] = {0};

struct _ProtonPlusWidgetsHeaderPresentationPrivate {
	GtkWidget* _title_widget;
	gboolean _can_navigate_back;
	GeeArrayList* _end_actions;
	GtkWidget* _back_widget;
};

static gint ProtonPlusWidgetsHeaderPresentation_private_offset;
static gpointer proton_plus_widgets_header_presentation_parent_class = NULL;

static void proton_plus_widgets_header_presentation_set_title_widget (ProtonPlusWidgetsHeaderPresentation* self,
                                                               GtkWidget* value);
static void proton_plus_widgets_header_presentation_set_can_navigate_back (ProtonPlusWidgetsHeaderPresentation* self,
                                                                    gboolean value);
static void proton_plus_widgets_header_presentation_set_end_actions (ProtonPlusWidgetsHeaderPresentation* self,
                                                              GeeArrayList* value);
static void proton_plus_widgets_header_presentation_set_back_widget (ProtonPlusWidgetsHeaderPresentation* self,
                                                              GtkWidget* value);
static void proton_plus_widgets_header_presentation_finalize (GObject * obj);
static GType proton_plus_widgets_header_presentation_get_type_once (void);
static void _vala_proton_plus_widgets_header_presentation_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec);
static void _vala_proton_plus_widgets_header_presentation_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_header_presentation_get_instance_private (ProtonPlusWidgetsHeaderPresentation* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsHeaderPresentation_private_offset);
}

ProtonPlusWidgetsHeaderPresentation*
proton_plus_widgets_header_presentation_construct (GType object_type,
                                                   GtkWidget* title_widget,
                                                   gboolean can_navigate_back)
{
	ProtonPlusWidgetsHeaderPresentation * self = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	g_return_val_if_fail (title_widget != NULL, NULL);
	self = (ProtonPlusWidgetsHeaderPresentation*) g_object_new (object_type, NULL);
	proton_plus_widgets_header_presentation_set_title_widget (self, title_widget);
	proton_plus_widgets_header_presentation_set_can_navigate_back (self, can_navigate_back);
	_tmp0_ = gee_array_list_new (gtk_widget_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_tmp1_ = _tmp0_;
	proton_plus_widgets_header_presentation_set_end_actions (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	return self;
}

ProtonPlusWidgetsHeaderPresentation*
proton_plus_widgets_header_presentation_new (GtkWidget* title_widget,
                                             gboolean can_navigate_back)
{
	return proton_plus_widgets_header_presentation_construct (PROTON_PLUS_WIDGETS_HEADER_TYPE_PRESENTATION, title_widget, can_navigate_back);
}

void
proton_plus_widgets_header_presentation_add_end_action (ProtonPlusWidgetsHeaderPresentation* self,
                                                        GtkWidget* action)
{
	GeeArrayList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = self->priv->_end_actions;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, action);
}

void
proton_plus_widgets_header_presentation_request_back (ProtonPlusWidgetsHeaderPresentation* self)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_can_navigate_back;
	if (_tmp0_) {
		g_signal_emit (self, proton_plus_widgets_header_presentation_signals[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_REQUESTED_SIGNAL], 0);
	}
}

void
proton_plus_widgets_header_presentation_attach_back_widget (ProtonPlusWidgetsHeaderPresentation* self,
                                                            GtkWidget* widget)
{
	GtkWidget* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_back_widget;
	if (_tmp0_ == widget) {
		return;
	}
	proton_plus_widgets_header_presentation_set_back_widget (self, widget);
	g_signal_emit (self, proton_plus_widgets_header_presentation_signals[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_WIDGET_CHANGED_SIGNAL], 0, widget);
}

GtkWidget*
proton_plus_widgets_header_presentation_get_title_widget (ProtonPlusWidgetsHeaderPresentation* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title_widget;
	result = _tmp0_;
	return result;
}

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

static void
proton_plus_widgets_header_presentation_set_title_widget (ProtonPlusWidgetsHeaderPresentation* self,
                                                          GtkWidget* value)
{
	GtkWidget* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_header_presentation_get_title_widget (self);
	if (old_value != value) {
		GtkWidget* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_title_widget);
		self->priv->_title_widget = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_header_presentation_properties[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_TITLE_WIDGET_PROPERTY]);
	}
}

gboolean
proton_plus_widgets_header_presentation_get_can_navigate_back (ProtonPlusWidgetsHeaderPresentation* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_can_navigate_back;
	return result;
}

static void
proton_plus_widgets_header_presentation_set_can_navigate_back (ProtonPlusWidgetsHeaderPresentation* self,
                                                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_header_presentation_get_can_navigate_back (self);
	if (old_value != value) {
		self->priv->_can_navigate_back = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_header_presentation_properties[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_CAN_NAVIGATE_BACK_PROPERTY]);
	}
}

GeeArrayList*
proton_plus_widgets_header_presentation_get_end_actions (ProtonPlusWidgetsHeaderPresentation* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_end_actions;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_header_presentation_set_end_actions (ProtonPlusWidgetsHeaderPresentation* self,
                                                         GeeArrayList* value)
{
	GeeArrayList* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_header_presentation_get_end_actions (self);
	if (old_value != value) {
		GeeArrayList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_end_actions);
		self->priv->_end_actions = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_header_presentation_properties[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_END_ACTIONS_PROPERTY]);
	}
}

GtkWidget*
proton_plus_widgets_header_presentation_get_back_widget (ProtonPlusWidgetsHeaderPresentation* self)
{
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_back_widget;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_header_presentation_set_back_widget (ProtonPlusWidgetsHeaderPresentation* self,
                                                         GtkWidget* value)
{
	GtkWidget* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_header_presentation_get_back_widget (self);
	if (old_value != value) {
		self->priv->_back_widget = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_header_presentation_properties[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_WIDGET_PROPERTY]);
	}
}

static void
proton_plus_widgets_header_presentation_class_init (ProtonPlusWidgetsHeaderPresentationClass * klass,
                                                    gpointer klass_data)
{
	proton_plus_widgets_header_presentation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsHeaderPresentation_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_header_presentation_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_header_presentation_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_header_presentation_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_TITLE_WIDGET_PROPERTY, proton_plus_widgets_header_presentation_properties[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_TITLE_WIDGET_PROPERTY] = g_param_spec_object ("title-widget", "title-widget", "title-widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_CAN_NAVIGATE_BACK_PROPERTY, proton_plus_widgets_header_presentation_properties[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_CAN_NAVIGATE_BACK_PROPERTY] = g_param_spec_boolean ("can-navigate-back", "can-navigate-back", "can-navigate-back", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_END_ACTIONS_PROPERTY, proton_plus_widgets_header_presentation_properties[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_END_ACTIONS_PROPERTY] = g_param_spec_object ("end-actions", "end-actions", "end-actions", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_WIDGET_PROPERTY, proton_plus_widgets_header_presentation_properties[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_WIDGET_PROPERTY] = g_param_spec_object ("back-widget", "back-widget", "back-widget", gtk_widget_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	proton_plus_widgets_header_presentation_signals[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_REQUESTED_SIGNAL] = g_signal_new ("back-requested", PROTON_PLUS_WIDGETS_HEADER_TYPE_PRESENTATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	proton_plus_widgets_header_presentation_signals[PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_WIDGET_CHANGED_SIGNAL] = g_signal_new ("back-widget-changed", PROTON_PLUS_WIDGETS_HEADER_TYPE_PRESENTATION, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, gtk_widget_get_type ());
}

static void
proton_plus_widgets_header_presentation_instance_init (ProtonPlusWidgetsHeaderPresentation * self,
                                                       gpointer klass)
{
	self->priv = proton_plus_widgets_header_presentation_get_instance_private (self);
}

static void
proton_plus_widgets_header_presentation_finalize (GObject * obj)
{
	ProtonPlusWidgetsHeaderPresentation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_HEADER_TYPE_PRESENTATION, ProtonPlusWidgetsHeaderPresentation);
	_g_object_unref0 (self->priv->_title_widget);
	_g_object_unref0 (self->priv->_end_actions);
	G_OBJECT_CLASS (proton_plus_widgets_header_presentation_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_header_presentation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsHeaderPresentationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_header_presentation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsHeaderPresentation), 0, (GInstanceInitFunc) proton_plus_widgets_header_presentation_instance_init, NULL };
	GType proton_plus_widgets_header_presentation_type_id;
	proton_plus_widgets_header_presentation_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusWidgetsHeaderPresentation", &g_define_type_info, 0);
	ProtonPlusWidgetsHeaderPresentation_private_offset = g_type_add_instance_private (proton_plus_widgets_header_presentation_type_id, sizeof (ProtonPlusWidgetsHeaderPresentationPrivate));
	return proton_plus_widgets_header_presentation_type_id;
}

GType
proton_plus_widgets_header_presentation_get_type (void)
{
	static volatile gsize proton_plus_widgets_header_presentation_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_header_presentation_type_id__once)) {
		GType proton_plus_widgets_header_presentation_type_id;
		proton_plus_widgets_header_presentation_type_id = proton_plus_widgets_header_presentation_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_header_presentation_type_id__once, proton_plus_widgets_header_presentation_type_id);
	}
	return proton_plus_widgets_header_presentation_type_id__once;
}

static void
_vala_proton_plus_widgets_header_presentation_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec)
{
	ProtonPlusWidgetsHeaderPresentation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_HEADER_TYPE_PRESENTATION, ProtonPlusWidgetsHeaderPresentation);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_TITLE_WIDGET_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_header_presentation_get_title_widget (self));
		break;
		case PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_CAN_NAVIGATE_BACK_PROPERTY:
		g_value_set_boolean (value, proton_plus_widgets_header_presentation_get_can_navigate_back (self));
		break;
		case PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_END_ACTIONS_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_header_presentation_get_end_actions (self));
		break;
		case PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_WIDGET_PROPERTY:
		g_value_set_object (value, proton_plus_widgets_header_presentation_get_back_widget (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_header_presentation_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec)
{
	ProtonPlusWidgetsHeaderPresentation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_HEADER_TYPE_PRESENTATION, ProtonPlusWidgetsHeaderPresentation);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_TITLE_WIDGET_PROPERTY:
		proton_plus_widgets_header_presentation_set_title_widget (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_CAN_NAVIGATE_BACK_PROPERTY:
		proton_plus_widgets_header_presentation_set_can_navigate_back (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_END_ACTIONS_PROPERTY:
		proton_plus_widgets_header_presentation_set_end_actions (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_WIDGETS_HEADER_PRESENTATION_BACK_WIDGET_PROPERTY:
		proton_plus_widgets_header_presentation_set_back_widget (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

