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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <adwaita.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.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 PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX (proton_plus_widgets_status_box_get_type ())
#define PROTON_PLUS_WIDGETS_STATUS_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX, ProtonPlusWidgetsStatusBox))
#define PROTON_PLUS_WIDGETS_STATUS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX, ProtonPlusWidgetsStatusBoxClass))
#define PROTON_PLUS_WIDGETS_IS_STATUS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX))
#define PROTON_PLUS_WIDGETS_IS_STATUS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX))
#define PROTON_PLUS_WIDGETS_STATUS_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX, ProtonPlusWidgetsStatusBoxClass))

typedef struct _ProtonPlusWidgetsStatusBox ProtonPlusWidgetsStatusBox;
typedef struct _ProtonPlusWidgetsStatusBoxClass ProtonPlusWidgetsStatusBoxClass;
typedef struct _ProtonPlusWidgetsStatusBoxPrivate ProtonPlusWidgetsStatusBoxPrivate;
enum  {
	PROTON_PLUS_WIDGETS_STATUS_BOX_0_PROPERTY,
	PROTON_PLUS_WIDGETS_STATUS_BOX_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_status_box_properties[PROTON_PLUS_WIDGETS_STATUS_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusWidgetsStatusBox {
	GtkBox parent_instance;
	ProtonPlusWidgetsStatusBoxPrivate * priv;
};

struct _ProtonPlusWidgetsStatusBoxClass {
	GtkBoxClass parent_class;
};

struct _ProtonPlusWidgetsStatusBoxPrivate {
	AdwToolbarView* _toolbar_view;
	AdwHeaderBar* _header_bar;
	GtkButton* _report_button;
	AdwStatusPage* _status_page;
};

static gint ProtonPlusWidgetsStatusBox_private_offset;
static gpointer proton_plus_widgets_status_box_parent_class = NULL;

VALA_EXTERN GType proton_plus_widgets_status_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusWidgetsStatusBox, g_object_unref)
VALA_EXTERN ProtonPlusWidgetsStatusBox* proton_plus_widgets_status_box_new (void);
VALA_EXTERN ProtonPlusWidgetsStatusBox* proton_plus_widgets_status_box_construct (GType object_type);
static void proton_plus_widgets_status_box_set_header_bar (ProtonPlusWidgetsStatusBox* self,
                                                    AdwHeaderBar* value);
static AdwHeaderBar* proton_plus_widgets_status_box_get_header_bar (ProtonPlusWidgetsStatusBox* self);
static void proton_plus_widgets_status_box_set_report_button (ProtonPlusWidgetsStatusBox* self,
                                                       GtkButton* value);
static GtkButton* proton_plus_widgets_status_box_get_report_button (ProtonPlusWidgetsStatusBox* self);
static void proton_plus_widgets_status_box_report_button_clicked (ProtonPlusWidgetsStatusBox* self);
static void _proton_plus_widgets_status_box_report_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                               gpointer self);
static void proton_plus_widgets_status_box_set_status_page (ProtonPlusWidgetsStatusBox* self,
                                                     AdwStatusPage* value);
static AdwStatusPage* proton_plus_widgets_status_box_get_status_page (ProtonPlusWidgetsStatusBox* self);
static void proton_plus_widgets_status_box_set_toolbar_view (ProtonPlusWidgetsStatusBox* self,
                                                      AdwToolbarView* value);
static AdwToolbarView* proton_plus_widgets_status_box_get_toolbar_view (ProtonPlusWidgetsStatusBox* self);
VALA_EXTERN void proton_plus_widgets_status_box_initialize (ProtonPlusWidgetsStatusBox* self,
                                                const gchar* icon_name,
                                                const gchar* title,
                                                const gchar* description,
                                                gboolean _error_);
static void proton_plus_widgets_status_box_finalize (GObject * obj);
static GType proton_plus_widgets_status_box_get_type_once (void);
static void _vala_proton_plus_widgets_status_box_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_proton_plus_widgets_status_box_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);

static inline gpointer
proton_plus_widgets_status_box_get_instance_private (ProtonPlusWidgetsStatusBox* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsStatusBox_private_offset);
}

static void
_proton_plus_widgets_status_box_report_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self)
{
	proton_plus_widgets_status_box_report_button_clicked ((ProtonPlusWidgetsStatusBox*) self);
}

ProtonPlusWidgetsStatusBox*
proton_plus_widgets_status_box_construct (GType object_type)
{
	ProtonPlusWidgetsStatusBox * self = NULL;
	AdwHeaderBar* _tmp0_;
	AdwHeaderBar* _tmp1_;
	AdwHeaderBar* _tmp2_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	GtkButton* _tmp7_;
	GtkButton* _tmp8_;
	AdwStatusPage* _tmp9_;
	AdwStatusPage* _tmp10_;
	AdwStatusPage* _tmp11_;
	AdwStatusPage* _tmp12_;
	AdwStatusPage* _tmp13_;
	GtkButton* _tmp14_;
	AdwToolbarView* _tmp15_;
	AdwToolbarView* _tmp16_;
	AdwToolbarView* _tmp17_;
	AdwHeaderBar* _tmp18_;
	AdwToolbarView* _tmp19_;
	AdwStatusPage* _tmp20_;
	AdwToolbarView* _tmp21_;
	self = (ProtonPlusWidgetsStatusBox*) g_object_new (object_type, NULL);
	_tmp0_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	proton_plus_widgets_status_box_set_header_bar (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_header_bar;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "flat");
	_tmp3_ = (GtkButton*) gtk_button_new_with_label (_ ("Report"));
	g_object_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	proton_plus_widgets_status_box_set_report_button (self, _tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = self->priv->_report_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp5_, "suggested-action");
	_tmp6_ = self->priv->_report_button;
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_CENTER);
	_tmp7_ = self->priv->_report_button;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp7_, FALSE);
	_tmp8_ = self->priv->_report_button;
	g_signal_connect_object (_tmp8_, "clicked", (GCallback) _proton_plus_widgets_status_box_report_button_clicked_gtk_button_clicked, self, 0);
	_tmp9_ = (AdwStatusPage*) adw_status_page_new ();
	g_object_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	proton_plus_widgets_status_box_set_status_page (self, _tmp10_);
	_g_object_unref0 (_tmp10_);
	_tmp11_ = self->priv->_status_page;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp11_, TRUE);
	_tmp12_ = self->priv->_status_page;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	_tmp13_ = self->priv->_status_page;
	_tmp14_ = self->priv->_report_button;
	adw_status_page_set_child (_tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp15_);
	_tmp16_ = _tmp15_;
	proton_plus_widgets_status_box_set_toolbar_view (self, _tmp16_);
	_g_object_unref0 (_tmp16_);
	_tmp17_ = self->priv->_toolbar_view;
	_tmp18_ = self->priv->_header_bar;
	adw_toolbar_view_add_top_bar (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = self->priv->_toolbar_view;
	_tmp20_ = self->priv->_status_page;
	adw_toolbar_view_set_content (_tmp19_, (GtkWidget*) _tmp20_);
	_tmp21_ = self->priv->_toolbar_view;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp21_);
	return self;
}

ProtonPlusWidgetsStatusBox*
proton_plus_widgets_status_box_new (void)
{
	return proton_plus_widgets_status_box_construct (PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX);
}

void
proton_plus_widgets_status_box_initialize (ProtonPlusWidgetsStatusBox* self,
                                           const gchar* icon_name,
                                           const gchar* title,
                                           const gchar* description,
                                           gboolean _error_)
{
	AdwStatusPage* _tmp0_;
	AdwStatusPage* _tmp1_;
	AdwStatusPage* _tmp2_;
	GtkButton* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (description != NULL);
	_tmp0_ = self->priv->_status_page;
	adw_status_page_set_icon_name (_tmp0_, icon_name);
	_tmp1_ = self->priv->_status_page;
	adw_status_page_set_title (_tmp1_, title);
	_tmp2_ = self->priv->_status_page;
	adw_status_page_set_description (_tmp2_, description);
	_tmp3_ = self->priv->_report_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp3_, _error_);
}

static void
proton_plus_widgets_status_box_report_button_clicked (ProtonPlusWidgetsStatusBox* self)
{
	g_return_if_fail (self != NULL);
	gtk_widget_activate_action ((GtkWidget*) self, "app.report", NULL, NULL);
}

static AdwToolbarView*
proton_plus_widgets_status_box_get_toolbar_view (ProtonPlusWidgetsStatusBox* self)
{
	AdwToolbarView* result;
	AdwToolbarView* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_toolbar_view;
	result = _tmp0_;
	return result;
}

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

static void
proton_plus_widgets_status_box_set_toolbar_view (ProtonPlusWidgetsStatusBox* self,
                                                 AdwToolbarView* value)
{
	AdwToolbarView* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_toolbar_view);
	self->priv->_toolbar_view = _tmp0_;
}

static AdwHeaderBar*
proton_plus_widgets_status_box_get_header_bar (ProtonPlusWidgetsStatusBox* self)
{
	AdwHeaderBar* result;
	AdwHeaderBar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_header_bar;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_status_box_set_header_bar (ProtonPlusWidgetsStatusBox* self,
                                               AdwHeaderBar* value)
{
	AdwHeaderBar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_header_bar);
	self->priv->_header_bar = _tmp0_;
}

static GtkButton*
proton_plus_widgets_status_box_get_report_button (ProtonPlusWidgetsStatusBox* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_report_button;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_status_box_set_report_button (ProtonPlusWidgetsStatusBox* self,
                                                  GtkButton* value)
{
	GtkButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_report_button);
	self->priv->_report_button = _tmp0_;
}

static AdwStatusPage*
proton_plus_widgets_status_box_get_status_page (ProtonPlusWidgetsStatusBox* self)
{
	AdwStatusPage* result;
	AdwStatusPage* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_status_page;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_status_box_set_status_page (ProtonPlusWidgetsStatusBox* self,
                                                AdwStatusPage* value)
{
	AdwStatusPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_status_page);
	self->priv->_status_page = _tmp0_;
}

static void
proton_plus_widgets_status_box_class_init (ProtonPlusWidgetsStatusBoxClass * klass,
                                           gpointer klass_data)
{
	proton_plus_widgets_status_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsStatusBox_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_status_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_status_box_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_status_box_finalize;
}

static void
proton_plus_widgets_status_box_instance_init (ProtonPlusWidgetsStatusBox * self,
                                              gpointer klass)
{
	self->priv = proton_plus_widgets_status_box_get_instance_private (self);
}

static void
proton_plus_widgets_status_box_finalize (GObject * obj)
{
	ProtonPlusWidgetsStatusBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX, ProtonPlusWidgetsStatusBox);
	_g_object_unref0 (self->priv->_toolbar_view);
	_g_object_unref0 (self->priv->_header_bar);
	_g_object_unref0 (self->priv->_report_button);
	_g_object_unref0 (self->priv->_status_page);
	G_OBJECT_CLASS (proton_plus_widgets_status_box_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_status_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsStatusBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_status_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsStatusBox), 0, (GInstanceInitFunc) proton_plus_widgets_status_box_instance_init, NULL };
	GType proton_plus_widgets_status_box_type_id;
	proton_plus_widgets_status_box_type_id = g_type_register_static (gtk_box_get_type (), "ProtonPlusWidgetsStatusBox", &g_define_type_info, 0);
	ProtonPlusWidgetsStatusBox_private_offset = g_type_add_instance_private (proton_plus_widgets_status_box_type_id, sizeof (ProtonPlusWidgetsStatusBoxPrivate));
	return proton_plus_widgets_status_box_type_id;
}

GType
proton_plus_widgets_status_box_get_type (void)
{
	static volatile gsize proton_plus_widgets_status_box_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_status_box_type_id__once)) {
		GType proton_plus_widgets_status_box_type_id;
		proton_plus_widgets_status_box_type_id = proton_plus_widgets_status_box_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_status_box_type_id__once, proton_plus_widgets_status_box_type_id);
	}
	return proton_plus_widgets_status_box_type_id__once;
}

static void
_vala_proton_plus_widgets_status_box_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	ProtonPlusWidgetsStatusBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX, ProtonPlusWidgetsStatusBox);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_status_box_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	ProtonPlusWidgetsStatusBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_TYPE_STATUS_BOX, ProtonPlusWidgetsStatusBox);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

