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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * 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
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include "planify.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <adwaita.h>
#include <float.h>
#include <math.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  {
	WIDGETS_LABEL_PICKER_LABEL_ROW_0_PROPERTY,
	WIDGETS_LABEL_PICKER_LABEL_ROW_LABEL_PROPERTY,
	WIDGETS_LABEL_PICKER_LABEL_ROW_HIDE_CHECK_BUTTON_PROPERTY,
	WIDGETS_LABEL_PICKER_LABEL_ROW_ACTIVE_PROPERTY,
	WIDGETS_LABEL_PICKER_LABEL_ROW_MARGIN_PROPERTY,
	WIDGETS_LABEL_PICKER_LABEL_ROW_NUM_PROPERTIES
};
static GParamSpec* widgets_label_picker_label_row_properties[WIDGETS_LABEL_PICKER_LABEL_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block32Data Block32Data;
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	WIDGETS_LABEL_PICKER_LABEL_ROW_CHECKED_TOGGLED_SIGNAL,
	WIDGETS_LABEL_PICKER_LABEL_ROW_NUM_SIGNALS
};
static guint widgets_label_picker_label_row_signals[WIDGETS_LABEL_PICKER_LABEL_ROW_NUM_SIGNALS] = {0};

struct _WidgetsLabelPickerLabelRowPrivate {
	ObjectsLabel* _label;
	GtkBox* content_box;
	gboolean _hide_check_button;
	GtkCheckButton* checked_button;
	GtkRevealer* loading_revealer;
	GeeHashMap* signals_map;
};

struct _Block32Data {
	int _ref_count_;
	WidgetsLabelPickerLabelRow* self;
	GtkGrid* color_grid;
	GtkLabel* name_label;
	GtkGestureClick* checked_button_gesture;
};

static gint WidgetsLabelPickerLabelRow_private_offset;
static gpointer widgets_label_picker_label_row_parent_class = NULL;

static void g_cclosure_user_marshal_VOID__OBJECT_BOOLEAN (GClosure * closure,
                                                   GValue * return_value,
                                                   guint n_param_values,
                                                   const GValue * param_values,
                                                   gpointer invocation_hint,
                                                   gpointer marshal_data);
static GObject * widgets_label_picker_label_row_constructor (GType type,
                                                      guint n_construct_properties,
                                                      GObjectConstructParam * construct_properties);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
static void _widgets_label_picker_label_row___lambda257_ (Block32Data* _data32_);
static void __widgets_label_picker_label_row___lambda257__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                              gint n_press,
                                                                              gdouble x,
                                                                              gdouble y,
                                                                              gpointer self);
static void _widgets_label_picker_label_row___lambda258_ (WidgetsLabelPickerLabelRow* self);
static void __widgets_label_picker_label_row___lambda258__gtk_list_box_row_activate (GtkListBoxRow* _sender,
                                                                              gpointer self);
static void _widgets_label_picker_label_row___lambda259_ (Block32Data* _data32_);
static void __widgets_label_picker_label_row___lambda259__objects_base_object_updated (ObjectsBaseObject* _sender,
                                                                                const gchar* update_id,
                                                                                gpointer self);
static void widgets_label_picker_label_row_finalize (GObject * obj);
static GType widgets_label_picker_label_row_get_type_once (void);
static void _vala_widgets_label_picker_label_row_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_widgets_label_picker_label_row_set_property (GObject * object,
                                                        guint property_id,
                                                        const GValue * value,
                                                        GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
widgets_label_picker_label_row_get_instance_private (WidgetsLabelPickerLabelRow* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsLabelPickerLabelRow_private_offset);
}

WidgetsLabelPickerLabelRow*
widgets_label_picker_label_row_construct (GType object_type,
                                          ObjectsLabel* label)
{
	WidgetsLabelPickerLabelRow * self = NULL;
	g_return_val_if_fail (label != NULL, NULL);
	self = (WidgetsLabelPickerLabelRow*) g_object_new (object_type, "label", label, NULL);
	return self;
}

WidgetsLabelPickerLabelRow*
widgets_label_picker_label_row_new (ObjectsLabel* label)
{
	return widgets_label_picker_label_row_construct (WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, label);
}

void
widgets_label_picker_label_row_update_checked_toggled (WidgetsLabelPickerLabelRow* self)
{
	GtkCheckButton* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	ObjectsLabel* _tmp4_;
	GtkCheckButton* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->checked_button;
	_tmp1_ = self->priv->checked_button;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_check_button_set_active (_tmp0_, !_tmp3_);
	_tmp4_ = self->priv->_label;
	_tmp5_ = self->priv->checked_button;
	_tmp6_ = gtk_check_button_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	g_signal_emit (self, widgets_label_picker_label_row_signals[WIDGETS_LABEL_PICKER_LABEL_ROW_CHECKED_TOGGLED_SIGNAL], 0, _tmp4_, _tmp7_);
}

void
widgets_label_picker_label_row_show_loading (WidgetsLabelPickerLabelRow* self,
                                             gboolean show)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->loading_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, show);
}

void
widgets_label_picker_label_row_clean_up (WidgetsLabelPickerLabelRow* self)
{
	GeeHashMap* _tmp15_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->signals_map;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeMapEntry* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = entry;
			_tmp10_ = gee_map_entry_get_value (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			g_signal_handler_disconnect ((GObject*) _tmp11_, (gulong) ((guintptr) _tmp14_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp15_ = self->priv->signals_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
}

ObjectsLabel*
widgets_label_picker_label_row_get_label (WidgetsLabelPickerLabelRow* self)
{
	ObjectsLabel* result;
	ObjectsLabel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_label;
	result = _tmp0_;
	return result;
}

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

static void
widgets_label_picker_label_row_set_label (WidgetsLabelPickerLabelRow* self,
                                          ObjectsLabel* value)
{
	ObjectsLabel* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_label_picker_label_row_get_label (self);
	if (old_value != value) {
		ObjectsLabel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_label);
		self->priv->_label = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_label_picker_label_row_properties[WIDGETS_LABEL_PICKER_LABEL_ROW_LABEL_PROPERTY]);
	}
}

gboolean
widgets_label_picker_label_row_get_hide_check_button (WidgetsLabelPickerLabelRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_hide_check_button;
	return result;
}

void
widgets_label_picker_label_row_set_hide_check_button (WidgetsLabelPickerLabelRow* self,
                                                      gboolean value)
{
	GtkCheckButton* _tmp0_;
	g_return_if_fail (self != NULL);
	self->priv->_hide_check_button = value;
	_tmp0_ = self->priv->checked_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, !value);
	g_object_notify_by_pspec ((GObject *) self, widgets_label_picker_label_row_properties[WIDGETS_LABEL_PICKER_LABEL_ROW_HIDE_CHECK_BUTTON_PROPERTY]);
}

void
widgets_label_picker_label_row_set_active (WidgetsLabelPickerLabelRow* self,
                                           gboolean value)
{
	GtkCheckButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->checked_button;
	gtk_check_button_set_active (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, widgets_label_picker_label_row_properties[WIDGETS_LABEL_PICKER_LABEL_ROW_ACTIVE_PROPERTY]);
}

void
widgets_label_picker_label_row_set_margin (WidgetsLabelPickerLabelRow* self,
                                           gint value)
{
	GtkBox* _tmp0_;
	GtkBox* _tmp1_;
	GtkBox* _tmp2_;
	GtkBox* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->content_box;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp0_, value);
	_tmp1_ = self->priv->content_box;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp1_, value);
	_tmp2_ = self->priv->content_box;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp2_, value);
	_tmp3_ = self->priv->content_box;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp3_, value);
	g_object_notify_by_pspec ((GObject *) self, widgets_label_picker_label_row_properties[WIDGETS_LABEL_PICKER_LABEL_ROW_MARGIN_PROPERTY]);
}

static void
g_cclosure_user_marshal_VOID__OBJECT_BOOLEAN (GClosure * closure,
                                              GValue * return_value,
                                              guint n_param_values,
                                              const GValue * param_values,
                                              gpointer invocation_hint,
                                              gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__OBJECT_BOOLEAN) (gpointer data1, gpointer arg_1, gboolean arg_2, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_BOOLEAN callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__OBJECT_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_object (param_values + 1), g_value_get_boolean (param_values + 2), data2);
}

static Block32Data*
block32_data_ref (Block32Data* _data32_)
{
	g_atomic_int_inc (&_data32_->_ref_count_);
	return _data32_;
}

static void
block32_data_unref (void * _userdata_)
{
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
		WidgetsLabelPickerLabelRow* self;
		self = _data32_->self;
		_g_object_unref0 (_data32_->checked_button_gesture);
		_g_object_unref0 (_data32_->name_label);
		_g_object_unref0 (_data32_->color_grid);
		_g_object_unref0 (self);
		g_slice_free (Block32Data, _data32_);
	}
}

static void
_widgets_label_picker_label_row___lambda257_ (Block32Data* _data32_)
{
	WidgetsLabelPickerLabelRow* self;
	GtkGestureClick* _tmp0_;
	self = _data32_->self;
	_tmp0_ = _data32_->checked_button_gesture;
	gtk_gesture_set_state ((GtkGesture*) _tmp0_, GTK_EVENT_SEQUENCE_CLAIMED);
	widgets_label_picker_label_row_update_checked_toggled (self);
}

static void
__widgets_label_picker_label_row___lambda257__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                         gint n_press,
                                                                         gdouble x,
                                                                         gdouble y,
                                                                         gpointer self)
{
	_widgets_label_picker_label_row___lambda257_ (self);
}

static void
_widgets_label_picker_label_row___lambda258_ (WidgetsLabelPickerLabelRow* self)
{
	widgets_label_picker_label_row_update_checked_toggled (self);
}

static void
__widgets_label_picker_label_row___lambda258__gtk_list_box_row_activate (GtkListBoxRow* _sender,
                                                                         gpointer self)
{
	_widgets_label_picker_label_row___lambda258_ ((WidgetsLabelPickerLabelRow*) self);
}

static void
_widgets_label_picker_label_row___lambda259_ (Block32Data* _data32_)
{
	WidgetsLabelPickerLabelRow* self;
	Util* _tmp0_;
	Util* _tmp1_;
	Util* _tmp2_;
	Util* _tmp3_;
	ObjectsLabel* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GtkGrid* _tmp9_;
	GtkLabel* _tmp10_;
	ObjectsLabel* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	self = _data32_->self;
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = util_get_default ();
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->_label;
	_tmp5_ = objects_base_object_get_color ((ObjectsBaseObject*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = util_get_color (_tmp3_, _tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = _data32_->color_grid;
	util_set_widget_color (_tmp1_, _tmp8_, (GtkWidget*) _tmp9_);
	_g_free0 (_tmp8_);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	_tmp10_ = _data32_->name_label;
	_tmp11_ = self->priv->_label;
	_tmp12_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp11_);
	_tmp13_ = _tmp12_;
	gtk_label_set_label (_tmp10_, _tmp13_);
}

static void
__widgets_label_picker_label_row___lambda259__objects_base_object_updated (ObjectsBaseObject* _sender,
                                                                           const gchar* update_id,
                                                                           gpointer self)
{
	_widgets_label_picker_label_row___lambda259_ (self);
}

static GObject *
widgets_label_picker_label_row_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsLabelPickerLabelRow * self;
	Block32Data* _data32_;
	gchar* _tmp0_;
	gchar** _tmp1_;
	GtkCheckButton* _tmp2_ = NULL;
	gchar* _tmp3_;
	gchar** _tmp4_;
	GtkGrid* _tmp5_ = NULL;
	Util* _tmp6_;
	Util* _tmp7_;
	Util* _tmp8_;
	Util* _tmp9_;
	ObjectsLabel* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GtkGrid* _tmp15_;
	ObjectsLabel* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	GtkLabel* _tmp19_ = NULL;
	AdwSpinner* _tmp20_;
	GtkRevealer* _tmp21_ = NULL;
	GtkBox* _tmp22_;
	GtkBox* _tmp23_;
	GtkCheckButton* _tmp24_;
	GtkBox* _tmp25_;
	GtkGrid* _tmp26_;
	GtkBox* _tmp27_;
	GtkLabel* _tmp28_;
	GtkBox* _tmp29_;
	GtkRevealer* _tmp30_;
	GtkBox* _tmp31_;
	GtkGestureClick* _tmp32_;
	GtkBox* _tmp33_;
	GtkGestureClick* _tmp34_;
	GtkEventController* _tmp35_;
	GeeHashMap* _tmp36_;
	GtkGestureClick* _tmp37_;
	gulong _tmp38_;
	GtkGestureClick* _tmp39_;
	GeeHashMap* _tmp40_;
	gulong _tmp41_;
	GeeHashMap* _tmp42_;
	ObjectsLabel* _tmp43_;
	gulong _tmp44_;
	ObjectsLabel* _tmp45_;
	parent_class = G_OBJECT_CLASS (widgets_label_picker_label_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, WidgetsLabelPickerLabelRow);
	_data32_ = g_slice_new0 (Block32Data);
	_data32_->_ref_count_ = 1;
	_data32_->self = g_object_ref (self);
	gtk_widget_add_css_class ((GtkWidget*) self, "border-radius-6");
	gtk_widget_add_css_class ((GtkWidget*) self, "no-padding");
	_tmp0_ = g_strdup ("checkbutton-label");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = (GtkCheckButton*) gtk_check_button_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_CENTER);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp2_, _tmp1_);
	_tmp1_ = (_vala_array_free (_tmp1_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->checked_button);
	self->priv->checked_button = _tmp2_;
	_tmp3_ = g_strdup ("event-bar");
	_tmp4_ = g_new0 (gchar*, 1 + 1);
	_tmp4_[0] = _tmp3_;
	_tmp5_ = (GtkGrid*) gtk_grid_new ();
	g_object_set ((GtkWidget*) _tmp5_, "width-request", 3, NULL);
	g_object_set ((GtkWidget*) _tmp5_, "height-request", 16, NULL);
	gtk_widget_set_valign ((GtkWidget*) _tmp5_, GTK_ALIGN_CENTER);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp5_, _tmp4_);
	_tmp4_ = (_vala_array_free (_tmp4_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp5_);
	_data32_->color_grid = _tmp5_;
	_tmp6_ = util_get_default ();
	_tmp7_ = _tmp6_;
	_tmp8_ = util_get_default ();
	_tmp9_ = _tmp8_;
	_tmp10_ = self->priv->_label;
	_tmp11_ = objects_base_object_get_color ((ObjectsBaseObject*) _tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = util_get_color (_tmp9_, _tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = _data32_->color_grid;
	util_set_widget_color (_tmp7_, _tmp14_, (GtkWidget*) _tmp15_);
	_g_free0 (_tmp14_);
	_g_object_unref0 (_tmp9_);
	_g_object_unref0 (_tmp7_);
	_tmp16_ = self->priv->_label;
	_tmp17_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = (GtkLabel*) gtk_label_new (_tmp18_);
	gtk_widget_set_valign ((GtkWidget*) _tmp19_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp19_);
	_data32_->name_label = _tmp19_;
	_tmp20_ = (AdwSpinner*) adw_spinner_new ();
	g_object_ref_sink (_tmp20_);
	_tmp21_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp21_, (GtkWidget*) _tmp20_);
	_g_object_unref0 (_tmp20_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp21_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp21_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->loading_revealer);
	self->priv->loading_revealer = _tmp21_;
	_tmp22_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->content_box);
	self->priv->content_box = _tmp22_;
	_tmp23_ = self->priv->content_box;
	_tmp24_ = self->priv->checked_button;
	gtk_box_append (_tmp23_, (GtkWidget*) _tmp24_);
	_tmp25_ = self->priv->content_box;
	_tmp26_ = _data32_->color_grid;
	gtk_box_append (_tmp25_, (GtkWidget*) _tmp26_);
	_tmp27_ = self->priv->content_box;
	_tmp28_ = _data32_->name_label;
	gtk_box_append (_tmp27_, (GtkWidget*) _tmp28_);
	_tmp29_ = self->priv->content_box;
	_tmp30_ = self->priv->loading_revealer;
	gtk_box_append (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = self->priv->content_box;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp31_);
	_tmp32_ = (GtkGestureClick*) gtk_gesture_click_new ();
	_data32_->checked_button_gesture = _tmp32_;
	_tmp33_ = self->priv->content_box;
	_tmp34_ = _data32_->checked_button_gesture;
	_tmp35_ = _g_object_ref0 ((GtkEventController*) _tmp34_);
	gtk_widget_add_controller ((GtkWidget*) _tmp33_, _tmp35_);
	_tmp36_ = self->priv->signals_map;
	_tmp37_ = _data32_->checked_button_gesture;
	_tmp38_ = g_signal_connect_data (_tmp37_, "pressed", (GCallback) __widgets_label_picker_label_row___lambda257__gtk_gesture_click_pressed, block32_data_ref (_data32_), (GClosureNotify) block32_data_unref, 0);
	_tmp39_ = _data32_->checked_button_gesture;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp36_, (gpointer) ((guintptr) _tmp38_), (GObject*) _tmp39_);
	_tmp40_ = self->priv->signals_map;
	_tmp41_ = g_signal_connect_object ((GtkListBoxRow*) self, "activate", (GCallback) __widgets_label_picker_label_row___lambda258__gtk_list_box_row_activate, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp40_, (gpointer) ((guintptr) _tmp41_), (GObject*) self);
	_tmp42_ = self->priv->signals_map;
	_tmp43_ = self->priv->_label;
	_tmp44_ = g_signal_connect_data ((ObjectsBaseObject*) _tmp43_, "updated", (GCallback) __widgets_label_picker_label_row___lambda259__objects_base_object_updated, block32_data_ref (_data32_), (GClosureNotify) block32_data_unref, 0);
	_tmp45_ = self->priv->_label;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp42_, (gpointer) ((guintptr) _tmp44_), (GObject*) _tmp45_);
	block32_data_unref (_data32_);
	_data32_ = NULL;
	return obj;
}

static void
widgets_label_picker_label_row_class_init (WidgetsLabelPickerLabelRowClass * klass,
                                           gpointer klass_data)
{
	widgets_label_picker_label_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsLabelPickerLabelRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_label_picker_label_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_label_picker_label_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_label_picker_label_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_label_picker_label_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_LABEL_PICKER_LABEL_ROW_LABEL_PROPERTY, widgets_label_picker_label_row_properties[WIDGETS_LABEL_PICKER_LABEL_ROW_LABEL_PROPERTY] = g_param_spec_object ("label", "label", "label", OBJECTS_TYPE_LABEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_LABEL_PICKER_LABEL_ROW_HIDE_CHECK_BUTTON_PROPERTY, widgets_label_picker_label_row_properties[WIDGETS_LABEL_PICKER_LABEL_ROW_HIDE_CHECK_BUTTON_PROPERTY] = g_param_spec_boolean ("hide-check-button", "hide-check-button", "hide-check-button", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_LABEL_PICKER_LABEL_ROW_ACTIVE_PROPERTY, widgets_label_picker_label_row_properties[WIDGETS_LABEL_PICKER_LABEL_ROW_ACTIVE_PROPERTY] = g_param_spec_boolean ("active", "active", "active", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_LABEL_PICKER_LABEL_ROW_MARGIN_PROPERTY, widgets_label_picker_label_row_properties[WIDGETS_LABEL_PICKER_LABEL_ROW_MARGIN_PROPERTY] = g_param_spec_int ("margin", "margin", "margin", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	widgets_label_picker_label_row_signals[WIDGETS_LABEL_PICKER_LABEL_ROW_CHECKED_TOGGLED_SIGNAL] = g_signal_new ("checked-toggled", WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, OBJECTS_TYPE_LABEL, G_TYPE_BOOLEAN);
}

static void
widgets_label_picker_label_row_instance_init (WidgetsLabelPickerLabelRow * self,
                                              gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = widgets_label_picker_label_row_get_instance_private (self);
	self->priv->_hide_check_button = FALSE;
	_tmp0_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->signals_map = _tmp0_;
}

static void
widgets_label_picker_label_row_finalize (GObject * obj)
{
	WidgetsLabelPickerLabelRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, WidgetsLabelPickerLabelRow);
	g_debug ("LabelRow.vala:63: Destroying - Widgets.LabelPicker.LabelRow\n");
	_g_object_unref0 (self->priv->_label);
	_g_object_unref0 (self->priv->content_box);
	_g_object_unref0 (self->priv->checked_button);
	_g_object_unref0 (self->priv->loading_revealer);
	_g_object_unref0 (self->priv->signals_map);
	G_OBJECT_CLASS (widgets_label_picker_label_row_parent_class)->finalize (obj);
}

static GType
widgets_label_picker_label_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsLabelPickerLabelRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_label_picker_label_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsLabelPickerLabelRow), 0, (GInstanceInitFunc) widgets_label_picker_label_row_instance_init, NULL };
	GType widgets_label_picker_label_row_type_id;
	widgets_label_picker_label_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "WidgetsLabelPickerLabelRow", &g_define_type_info, 0);
	WidgetsLabelPickerLabelRow_private_offset = g_type_add_instance_private (widgets_label_picker_label_row_type_id, sizeof (WidgetsLabelPickerLabelRowPrivate));
	return widgets_label_picker_label_row_type_id;
}

GType
widgets_label_picker_label_row_get_type (void)
{
	static volatile gsize widgets_label_picker_label_row_type_id__once = 0;
	if (g_once_init_enter (&widgets_label_picker_label_row_type_id__once)) {
		GType widgets_label_picker_label_row_type_id;
		widgets_label_picker_label_row_type_id = widgets_label_picker_label_row_get_type_once ();
		g_once_init_leave (&widgets_label_picker_label_row_type_id__once, widgets_label_picker_label_row_type_id);
	}
	return widgets_label_picker_label_row_type_id__once;
}

static void
_vala_widgets_label_picker_label_row_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	WidgetsLabelPickerLabelRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, WidgetsLabelPickerLabelRow);
	switch (property_id) {
		case WIDGETS_LABEL_PICKER_LABEL_ROW_LABEL_PROPERTY:
		g_value_set_object (value, widgets_label_picker_label_row_get_label (self));
		break;
		case WIDGETS_LABEL_PICKER_LABEL_ROW_HIDE_CHECK_BUTTON_PROPERTY:
		g_value_set_boolean (value, widgets_label_picker_label_row_get_hide_check_button (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_label_picker_label_row_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	WidgetsLabelPickerLabelRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, WidgetsLabelPickerLabelRow);
	switch (property_id) {
		case WIDGETS_LABEL_PICKER_LABEL_ROW_LABEL_PROPERTY:
		widgets_label_picker_label_row_set_label (self, g_value_get_object (value));
		break;
		case WIDGETS_LABEL_PICKER_LABEL_ROW_HIDE_CHECK_BUTTON_PROPERTY:
		widgets_label_picker_label_row_set_hide_check_button (self, g_value_get_boolean (value));
		break;
		case WIDGETS_LABEL_PICKER_LABEL_ROW_ACTIVE_PROPERTY:
		widgets_label_picker_label_row_set_active (self, g_value_get_boolean (value));
		break;
		case WIDGETS_LABEL_PICKER_LABEL_ROW_MARGIN_PROPERTY:
		widgets_label_picker_label_row_set_margin (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

