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

/*
* Copyright (c) 2018 elementary LLC. (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include "useraccounts.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 SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER (switchboard_plug_user_accounts_error_revealer_get_type ())
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealer))
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealerClass))
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_IS_ERROR_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER))
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_IS_ERROR_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER))
#define SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealerClass))

typedef struct _SwitchboardPlugUserAccountsErrorRevealer SwitchboardPlugUserAccountsErrorRevealer;
typedef struct _SwitchboardPlugUserAccountsErrorRevealerClass SwitchboardPlugUserAccountsErrorRevealerClass;
typedef struct _SwitchboardPlugUserAccountsErrorRevealerPrivate SwitchboardPlugUserAccountsErrorRevealerPrivate;
enum  {
	SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_0_PROPERTY,
	SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY,
	SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_PROPERTY,
	SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY,
	SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_NUM_PROPERTIES
};
static GParamSpec* switchboard_plug_user_accounts_error_revealer_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_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 _SwitchboardPlugUserAccountsErrorRevealer {
	GtkBox parent_instance;
	SwitchboardPlugUserAccountsErrorRevealerPrivate * priv;
};

struct _SwitchboardPlugUserAccountsErrorRevealerClass {
	GtkBoxClass parent_class;
};

struct _SwitchboardPlugUserAccountsErrorRevealerPrivate {
	GtkLabel* _label_widget;
	gboolean _reveal_child;
};

static gint SwitchboardPlugUserAccountsErrorRevealer_private_offset;
static gpointer switchboard_plug_user_accounts_error_revealer_parent_class = NULL;

VALA_EXTERN GType switchboard_plug_user_accounts_error_revealer_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SwitchboardPlugUserAccountsErrorRevealer* switchboard_plug_user_accounts_error_revealer_new (const gchar* label);
VALA_EXTERN SwitchboardPlugUserAccountsErrorRevealer* switchboard_plug_user_accounts_error_revealer_construct (GType object_type,
                                                                                                   const gchar* label);
VALA_EXTERN void switchboard_plug_user_accounts_error_revealer_set_label (SwitchboardPlugUserAccountsErrorRevealer* self,
                                                              const gchar* value);
VALA_EXTERN GtkLabel* switchboard_plug_user_accounts_error_revealer_get_label_widget (SwitchboardPlugUserAccountsErrorRevealer* self);
static void switchboard_plug_user_accounts_error_revealer_set_label_widget (SwitchboardPlugUserAccountsErrorRevealer* self,
                                                                     GtkLabel* value);
VALA_EXTERN gboolean switchboard_plug_user_accounts_error_revealer_get_reveal_child (SwitchboardPlugUserAccountsErrorRevealer* self);
VALA_EXTERN void switchboard_plug_user_accounts_error_revealer_set_reveal_child (SwitchboardPlugUserAccountsErrorRevealer* self,
                                                                     gboolean value);
static GObject * switchboard_plug_user_accounts_error_revealer_constructor (GType type,
                                                                     guint n_construct_properties,
                                                                     GObjectConstructParam * construct_properties);
static void switchboard_plug_user_accounts_error_revealer_finalize (GObject * obj);
static GType switchboard_plug_user_accounts_error_revealer_get_type_once (void);
static void _vala_switchboard_plug_user_accounts_error_revealer_get_property (GObject * object,
                                                                       guint property_id,
                                                                       GValue * value,
                                                                       GParamSpec * pspec);
static void _vala_switchboard_plug_user_accounts_error_revealer_set_property (GObject * object,
                                                                       guint property_id,
                                                                       const GValue * value,
                                                                       GParamSpec * pspec);

static inline gpointer
switchboard_plug_user_accounts_error_revealer_get_instance_private (SwitchboardPlugUserAccountsErrorRevealer* self)
{
	return G_STRUCT_MEMBER_P (self, SwitchboardPlugUserAccountsErrorRevealer_private_offset);
}

SwitchboardPlugUserAccountsErrorRevealer*
switchboard_plug_user_accounts_error_revealer_construct (GType object_type,
                                                         const gchar* label)
{
	SwitchboardPlugUserAccountsErrorRevealer * self = NULL;
	g_return_val_if_fail (label != NULL, NULL);
	self = (SwitchboardPlugUserAccountsErrorRevealer*) g_object_new (object_type, NULL);
	switchboard_plug_user_accounts_error_revealer_set_label (self, label);
	return self;
}

SwitchboardPlugUserAccountsErrorRevealer*
switchboard_plug_user_accounts_error_revealer_new (const gchar* label)
{
	return switchboard_plug_user_accounts_error_revealer_construct (SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, label);
}

GtkLabel*
switchboard_plug_user_accounts_error_revealer_get_label_widget (SwitchboardPlugUserAccountsErrorRevealer* 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
switchboard_plug_user_accounts_error_revealer_set_label_widget (SwitchboardPlugUserAccountsErrorRevealer* self,
                                                                GtkLabel* value)
{
	GtkLabel* old_value;
	g_return_if_fail (self != NULL);
	old_value = switchboard_plug_user_accounts_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, switchboard_plug_user_accounts_error_revealer_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY]);
	}
}

void
switchboard_plug_user_accounts_error_revealer_set_label (SwitchboardPlugUserAccountsErrorRevealer* self,
                                                         const gchar* value)
{
	GtkLabel* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_label_widget;
	_tmp1_ = g_strdup_printf ("<span font_size=\"small\">%s</span>", value);
	_tmp2_ = _tmp1_;
	gtk_label_set_label (_tmp0_, _tmp2_);
	_g_free0 (_tmp2_);
	g_object_notify_by_pspec ((GObject *) self, switchboard_plug_user_accounts_error_revealer_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_PROPERTY]);
}

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

void
switchboard_plug_user_accounts_error_revealer_set_reveal_child (SwitchboardPlugUserAccountsErrorRevealer* self,
                                                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = switchboard_plug_user_accounts_error_revealer_get_reveal_child (self);
	if (old_value != value) {
		self->priv->_reveal_child = value;
		g_object_notify_by_pspec ((GObject *) self, switchboard_plug_user_accounts_error_revealer_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY]);
	}
}

static GObject *
switchboard_plug_user_accounts_error_revealer_constructor (GType type,
                                                           guint n_construct_properties,
                                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SwitchboardPlugUserAccountsErrorRevealer * self;
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* _tmp1_;
	GtkRevealer* revealer = NULL;
	GtkLabel* _tmp2_;
	GtkWidget* _tmp3_;
	GtkRevealer* _tmp4_ = NULL;
	GtkRevealer* _tmp5_;
	GtkRevealer* _tmp6_;
	parent_class = G_OBJECT_CLASS (switchboard_plug_user_accounts_error_revealer_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealer);
	_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_;
	switchboard_plug_user_accounts_error_revealer_set_label_widget (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_label_widget;
	_tmp3_ = _g_object_ref0 ((GtkWidget*) _tmp2_);
	_tmp4_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp4_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	gtk_revealer_set_transition_type (_tmp4_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_widget_set_halign ((GtkWidget*) _tmp4_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp4_);
	revealer = _tmp4_;
	_tmp5_ = revealer;
	g_object_bind_property_with_closures ((GObject*) self, "reveal-child", (GObject*) _tmp5_, "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)));
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp6_ = revealer;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp6_);
	_g_object_unref0 (revealer);
	return obj;
}

static void
switchboard_plug_user_accounts_error_revealer_class_init (SwitchboardPlugUserAccountsErrorRevealerClass * klass,
                                                          gpointer klass_data)
{
	switchboard_plug_user_accounts_error_revealer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SwitchboardPlugUserAccountsErrorRevealer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_switchboard_plug_user_accounts_error_revealer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_switchboard_plug_user_accounts_error_revealer_set_property;
	G_OBJECT_CLASS (klass)->constructor = switchboard_plug_user_accounts_error_revealer_constructor;
	G_OBJECT_CLASS (klass)->finalize = switchboard_plug_user_accounts_error_revealer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY, switchboard_plug_user_accounts_error_revealer_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_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), SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_PROPERTY, switchboard_plug_user_accounts_error_revealer_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_PROPERTY] = g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY, switchboard_plug_user_accounts_error_revealer_properties[SWITCHBOARD_PLUG_USER_ACCOUNTS_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
switchboard_plug_user_accounts_error_revealer_instance_init (SwitchboardPlugUserAccountsErrorRevealer * self,
                                                             gpointer klass)
{
	self->priv = switchboard_plug_user_accounts_error_revealer_get_instance_private (self);
	self->priv->_reveal_child = FALSE;
}

static void
switchboard_plug_user_accounts_error_revealer_finalize (GObject * obj)
{
	SwitchboardPlugUserAccountsErrorRevealer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealer);
	_g_object_unref0 (self->priv->_label_widget);
	G_OBJECT_CLASS (switchboard_plug_user_accounts_error_revealer_parent_class)->finalize (obj);
}

static GType
switchboard_plug_user_accounts_error_revealer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SwitchboardPlugUserAccountsErrorRevealerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) switchboard_plug_user_accounts_error_revealer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SwitchboardPlugUserAccountsErrorRevealer), 0, (GInstanceInitFunc) switchboard_plug_user_accounts_error_revealer_instance_init, NULL };
	GType switchboard_plug_user_accounts_error_revealer_type_id;
	switchboard_plug_user_accounts_error_revealer_type_id = g_type_register_static (gtk_box_get_type (), "SwitchboardPlugUserAccountsErrorRevealer", &g_define_type_info, 0);
	SwitchboardPlugUserAccountsErrorRevealer_private_offset = g_type_add_instance_private (switchboard_plug_user_accounts_error_revealer_type_id, sizeof (SwitchboardPlugUserAccountsErrorRevealerPrivate));
	return switchboard_plug_user_accounts_error_revealer_type_id;
}

GType
switchboard_plug_user_accounts_error_revealer_get_type (void)
{
	static volatile gsize switchboard_plug_user_accounts_error_revealer_type_id__once = 0;
	if (g_once_init_enter (&switchboard_plug_user_accounts_error_revealer_type_id__once)) {
		GType switchboard_plug_user_accounts_error_revealer_type_id;
		switchboard_plug_user_accounts_error_revealer_type_id = switchboard_plug_user_accounts_error_revealer_get_type_once ();
		g_once_init_leave (&switchboard_plug_user_accounts_error_revealer_type_id__once, switchboard_plug_user_accounts_error_revealer_type_id);
	}
	return switchboard_plug_user_accounts_error_revealer_type_id__once;
}

static void
_vala_switchboard_plug_user_accounts_error_revealer_get_property (GObject * object,
                                                                  guint property_id,
                                                                  GValue * value,
                                                                  GParamSpec * pspec)
{
	SwitchboardPlugUserAccountsErrorRevealer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealer);
	switch (property_id) {
		case SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY:
		g_value_set_object (value, switchboard_plug_user_accounts_error_revealer_get_label_widget (self));
		break;
		case SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY:
		g_value_set_boolean (value, switchboard_plug_user_accounts_error_revealer_get_reveal_child (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_switchboard_plug_user_accounts_error_revealer_set_property (GObject * object,
                                                                  guint property_id,
                                                                  const GValue * value,
                                                                  GParamSpec * pspec)
{
	SwitchboardPlugUserAccountsErrorRevealer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SWITCHBOARD_PLUG_USER_ACCOUNTS_TYPE_ERROR_REVEALER, SwitchboardPlugUserAccountsErrorRevealer);
	switch (property_id) {
		case SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_WIDGET_PROPERTY:
		switchboard_plug_user_accounts_error_revealer_set_label_widget (self, g_value_get_object (value));
		break;
		case SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_LABEL_PROPERTY:
		switchboard_plug_user_accounts_error_revealer_set_label (self, g_value_get_string (value));
		break;
		case SWITCHBOARD_PLUG_USER_ACCOUNTS_ERROR_REVEALER_REVEAL_CHILD_PROPERTY:
		switchboard_plug_user_accounts_error_revealer_set_reveal_child (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

