/* ErrorRevealer.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from ErrorRevealer.vala, do not modify */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <granite-7.h>
#include "io.elementary.settings.printers.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

#define PRINTERS_TYPE_ERROR_REVEALER (printers_error_revealer_get_type ())
#define PRINTERS_ERROR_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PRINTERS_TYPE_ERROR_REVEALER, PrintersErrorRevealer))
#define PRINTERS_ERROR_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PRINTERS_TYPE_ERROR_REVEALER, PrintersErrorRevealerClass))
#define PRINTERS_IS_ERROR_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PRINTERS_TYPE_ERROR_REVEALER))
#define PRINTERS_IS_ERROR_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PRINTERS_TYPE_ERROR_REVEALER))
#define PRINTERS_ERROR_REVEALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PRINTERS_TYPE_ERROR_REVEALER, PrintersErrorRevealerClass))

typedef struct _PrintersErrorRevealer PrintersErrorRevealer;
typedef struct _PrintersErrorRevealerClass PrintersErrorRevealerClass;
typedef struct _PrintersErrorRevealerPrivate PrintersErrorRevealerPrivate;
enum  {
	PRINTERS_ERROR_REVEALER_0_PROPERTY,
	PRINTERS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY,
	PRINTERS_ERROR_REVEALER_LABEL_PROPERTY,
	PRINTERS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY,
	PRINTERS_ERROR_REVEALER_NUM_PROPERTIES
};
static GParamSpec* printers_error_revealer_properties[PRINTERS_ERROR_REVEALER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _PrintersErrorRevealer {
	GtkBox parent_instance;
	PrintersErrorRevealerPrivate * priv;
};

struct _PrintersErrorRevealerClass {
	GtkBoxClass parent_class;
};

struct _PrintersErrorRevealerPrivate {
	GtkLabel* _label_widget;
	gchar* _label;
	gboolean _reveal_child;
};

static gint PrintersErrorRevealer_private_offset;
static gpointer printers_error_revealer_parent_class = NULL;

VALA_EXTERN GType printers_error_revealer_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PrintersErrorRevealer* printers_error_revealer_new (const gchar* label);
VALA_EXTERN PrintersErrorRevealer* printers_error_revealer_construct (GType object_type,
                                                          const gchar* label);
VALA_EXTERN GtkLabel* printers_error_revealer_get_label_widget (PrintersErrorRevealer* self);
static void printers_error_revealer_set_label_widget (PrintersErrorRevealer* self,
                                               GtkLabel* value);
VALA_EXTERN const gchar* printers_error_revealer_get_label (PrintersErrorRevealer* self);
VALA_EXTERN void printers_error_revealer_set_label (PrintersErrorRevealer* self,
                                        const gchar* value);
VALA_EXTERN gboolean printers_error_revealer_get_reveal_child (PrintersErrorRevealer* self);
VALA_EXTERN void printers_error_revealer_set_reveal_child (PrintersErrorRevealer* self,
                                               gboolean value);
static GObject * printers_error_revealer_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void printers_error_revealer_finalize (GObject * obj);
static GType printers_error_revealer_get_type_once (void);
static void _vala_printers_error_revealer_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_printers_error_revealer_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);

static inline gpointer
printers_error_revealer_get_instance_private (PrintersErrorRevealer* self)
{
	return G_STRUCT_MEMBER_P (self, PrintersErrorRevealer_private_offset);
}

PrintersErrorRevealer*
printers_error_revealer_construct (GType object_type,
                                   const gchar* label)
{
	PrintersErrorRevealer * self = NULL;
	g_return_val_if_fail (label != NULL, NULL);
	self = (PrintersErrorRevealer*) g_object_new (object_type, "label", label, NULL);
	return self;
}

PrintersErrorRevealer*
printers_error_revealer_new (const gchar* label)
{
	return printers_error_revealer_construct (PRINTERS_TYPE_ERROR_REVEALER, label);
}

GtkLabel*
printers_error_revealer_get_label_widget (PrintersErrorRevealer* self)
{
	GtkLabel* result;
	GtkLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_label_widget;
	result = _tmp0_;
	return result;
}

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

static void
printers_error_revealer_set_label_widget (PrintersErrorRevealer* self,
                                          GtkLabel* value)
{
	GtkLabel* old_value;
	g_return_if_fail (self != NULL);
	old_value = printers_error_revealer_get_label_widget (self);
	if (old_value != value) {
		GtkLabel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_label_widget);
		self->priv->_label_widget = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, printers_error_revealer_properties[PRINTERS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY]);
	}
}

const gchar*
printers_error_revealer_get_label (PrintersErrorRevealer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_label;
	result = _tmp0_;
	return result;
}

void
printers_error_revealer_set_label (PrintersErrorRevealer* self,
                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = printers_error_revealer_get_label (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_label);
		self->priv->_label = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, printers_error_revealer_properties[PRINTERS_ERROR_REVEALER_LABEL_PROPERTY]);
	}
}

gboolean
printers_error_revealer_get_reveal_child (PrintersErrorRevealer* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_reveal_child;
	return result;
}

void
printers_error_revealer_set_reveal_child (PrintersErrorRevealer* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = printers_error_revealer_get_reveal_child (self);
	if (old_value != value) {
		self->priv->_reveal_child = value;
		g_object_notify_by_pspec ((GObject *) self, printers_error_revealer_properties[PRINTERS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY]);
	}
}

static GObject *
printers_error_revealer_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PrintersErrorRevealer * self;
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkStyleContext* _tmp3_;
	GtkRevealer* revealer = NULL;
	GtkLabel* _tmp4_;
	GtkWidget* _tmp5_;
	GtkRevealer* _tmp6_ = NULL;
	GtkRevealer* _tmp7_;
	GtkLabel* _tmp8_;
	GtkRevealer* _tmp9_;
	parent_class = G_OBJECT_CLASS (printers_error_revealer_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PRINTERS_TYPE_ERROR_REVEALER, PrintersErrorRevealer);
	_tmp0_ = (GtkLabel*) gtk_label_new ("");
	gtk_label_set_justify (_tmp0_, GTK_JUSTIFY_RIGHT);
	gtk_label_set_max_width_chars (_tmp0_, 55);
	gtk_label_set_use_markup (_tmp0_, TRUE);
	gtk_label_set_wrap (_tmp0_, TRUE);
	gtk_label_set_xalign (_tmp0_, (gfloat) 1);
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	printers_error_revealer_set_label_widget (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_label_widget;
	_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) _tmp2_);
	gtk_style_context_add_class (_tmp3_, GRANITE_STYLE_CLASS_SMALL_LABEL);
	_tmp4_ = self->priv->_label_widget;
	_tmp5_ = _g_object_ref0 ((GtkWidget*) _tmp4_);
	_tmp6_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp6_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	gtk_revealer_set_transition_type (_tmp6_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_END);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp6_, TRUE);
	g_object_ref_sink (_tmp6_);
	revealer = _tmp6_;
	_tmp7_ = revealer;
	g_object_bind_property_with_closures ((GObject*) self, "reveal-child", (GObject*) _tmp7_, "reveal-child", 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)));
	_tmp8_ = self->priv->_label_widget;
	g_object_bind_property_with_closures ((GObject*) self, "label", (GObject*) _tmp8_, "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)));
	_tmp9_ = revealer;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp9_);
	_g_object_unref0 (revealer);
	return obj;
}

static void
printers_error_revealer_class_init (PrintersErrorRevealerClass * klass,
                                    gpointer klass_data)
{
	printers_error_revealer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PrintersErrorRevealer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_printers_error_revealer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_printers_error_revealer_set_property;
	G_OBJECT_CLASS (klass)->constructor = printers_error_revealer_constructor;
	G_OBJECT_CLASS (klass)->finalize = printers_error_revealer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PRINTERS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY, printers_error_revealer_properties[PRINTERS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY] = g_param_spec_object ("label-widget", "label-widget", "label-widget", gtk_label_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), PRINTERS_ERROR_REVEALER_LABEL_PROPERTY, printers_error_revealer_properties[PRINTERS_ERROR_REVEALER_LABEL_PROPERTY] = g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PRINTERS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY, printers_error_revealer_properties[PRINTERS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY] = g_param_spec_boolean ("reveal-child", "reveal-child", "reveal-child", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
printers_error_revealer_instance_init (PrintersErrorRevealer * self,
                                       gpointer klass)
{
	self->priv = printers_error_revealer_get_instance_private (self);
	self->priv->_reveal_child = FALSE;
}

static void
printers_error_revealer_finalize (GObject * obj)
{
	PrintersErrorRevealer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PRINTERS_TYPE_ERROR_REVEALER, PrintersErrorRevealer);
	_g_object_unref0 (self->priv->_label_widget);
	_g_free0 (self->priv->_label);
	G_OBJECT_CLASS (printers_error_revealer_parent_class)->finalize (obj);
}

static GType
printers_error_revealer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PrintersErrorRevealerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) printers_error_revealer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PrintersErrorRevealer), 0, (GInstanceInitFunc) printers_error_revealer_instance_init, NULL };
	GType printers_error_revealer_type_id;
	printers_error_revealer_type_id = g_type_register_static (gtk_box_get_type (), "PrintersErrorRevealer", &g_define_type_info, 0);
	PrintersErrorRevealer_private_offset = g_type_add_instance_private (printers_error_revealer_type_id, sizeof (PrintersErrorRevealerPrivate));
	return printers_error_revealer_type_id;
}

GType
printers_error_revealer_get_type (void)
{
	static volatile gsize printers_error_revealer_type_id__once = 0;
	if (g_once_init_enter (&printers_error_revealer_type_id__once)) {
		GType printers_error_revealer_type_id;
		printers_error_revealer_type_id = printers_error_revealer_get_type_once ();
		g_once_init_leave (&printers_error_revealer_type_id__once, printers_error_revealer_type_id);
	}
	return printers_error_revealer_type_id__once;
}

static void
_vala_printers_error_revealer_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	PrintersErrorRevealer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PRINTERS_TYPE_ERROR_REVEALER, PrintersErrorRevealer);
	switch (property_id) {
		case PRINTERS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY:
		g_value_set_object (value, printers_error_revealer_get_label_widget (self));
		break;
		case PRINTERS_ERROR_REVEALER_LABEL_PROPERTY:
		g_value_set_string (value, printers_error_revealer_get_label (self));
		break;
		case PRINTERS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY:
		g_value_set_boolean (value, printers_error_revealer_get_reveal_child (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_printers_error_revealer_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	PrintersErrorRevealer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PRINTERS_TYPE_ERROR_REVEALER, PrintersErrorRevealer);
	switch (property_id) {
		case PRINTERS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY:
		printers_error_revealer_set_label_widget (self, g_value_get_object (value));
		break;
		case PRINTERS_ERROR_REVEALER_LABEL_PROPERTY:
		printers_error_revealer_set_label (self, g_value_get_string (value));
		break;
		case PRINTERS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY:
		printers_error_revealer_set_reveal_child (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

