/* ColorPickerRow.c generated by valac 0.56.19, the Vala compiler
 * generated from ColorPickerRow.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 <adwaita.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <gtk/gtk.h>
#include "planify.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 WIDGETS_TYPE_COLOR_PICKER_ROW (widgets_color_picker_row_get_type ())
#define WIDGETS_COLOR_PICKER_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_COLOR_PICKER_ROW, WidgetsColorPickerRow))
#define WIDGETS_COLOR_PICKER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_COLOR_PICKER_ROW, WidgetsColorPickerRowClass))
#define WIDGETS_IS_COLOR_PICKER_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_COLOR_PICKER_ROW))
#define WIDGETS_IS_COLOR_PICKER_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_COLOR_PICKER_ROW))
#define WIDGETS_COLOR_PICKER_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_COLOR_PICKER_ROW, WidgetsColorPickerRowClass))

typedef struct _WidgetsColorPickerRow WidgetsColorPickerRow;
typedef struct _WidgetsColorPickerRowClass WidgetsColorPickerRowClass;
typedef struct _WidgetsColorPickerRowPrivate WidgetsColorPickerRowPrivate;
enum  {
	WIDGETS_COLOR_PICKER_ROW_0_PROPERTY,
	WIDGETS_COLOR_PICKER_ROW_COLOR_PROPERTY,
	WIDGETS_COLOR_PICKER_ROW_NUM_PROPERTIES
};
static GParamSpec* widgets_color_picker_row_properties[WIDGETS_COLOR_PICKER_ROW_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block50Data Block50Data;
enum  {
	WIDGETS_COLOR_PICKER_ROW_COLOR_CHANGED_SIGNAL,
	WIDGETS_COLOR_PICKER_ROW_NUM_SIGNALS
};
static guint widgets_color_picker_row_signals[WIDGETS_COLOR_PICKER_ROW_NUM_SIGNALS] = {0};

struct _WidgetsColorPickerRow {
	AdwBin parent_instance;
	WidgetsColorPickerRowPrivate * priv;
};

struct _WidgetsColorPickerRowClass {
	AdwBinClass parent_class;
};

struct _WidgetsColorPickerRowPrivate {
	gchar* _color;
	GeeHashMap* colors_hashmap;
	GeeHashMap* signal_map;
};

struct _Block50Data {
	int _ref_count_;
	WidgetsColorPickerRow* self;
	ObjectsColor* color_obj;
};

static gint WidgetsColorPickerRow_private_offset;
static gpointer widgets_color_picker_row_parent_class = NULL;

VALA_EXTERN GType widgets_color_picker_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsColorPickerRow, g_object_unref)
VALA_EXTERN WidgetsColorPickerRow* widgets_color_picker_row_new (void);
VALA_EXTERN WidgetsColorPickerRow* widgets_color_picker_row_construct (GType object_type);
VALA_EXTERN void widgets_color_picker_row_clean_up (WidgetsColorPickerRow* self);
VALA_EXTERN const gchar* widgets_color_picker_row_get_color (WidgetsColorPickerRow* self);
VALA_EXTERN void widgets_color_picker_row_set_color (WidgetsColorPickerRow* self,
                                         const gchar* value);
static GObject * widgets_color_picker_row_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties);
static gint _widgets_color_picker_row___lambda20_ (WidgetsColorPickerRow* self,
                                            ObjectsColor* a,
                                            ObjectsColor* b);
static gint __widgets_color_picker_row___lambda20__gcompare_data_func (gconstpointer a,
                                                                gconstpointer b,
                                                                gpointer self);
static Block50Data* block50_data_ref (Block50Data* _data50_);
static void block50_data_unref (void * _userdata_);
static void _widgets_color_picker_row_____lambda21_ (Block50Data* _data50_);
static void __widgets_color_picker_row_____lambda21__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                        gpointer self);
static void _widgets_color_picker_row___lambda22_ (WidgetsColorPickerRow* self);
static void __widgets_color_picker_row___lambda22__g_object_notify (GObject* _sender,
                                                             GParamSpec* pspec,
                                                             gpointer self);
static void _widgets_color_picker_row___lambda23_ (WidgetsColorPickerRow* self,
                                            GtkFlowBoxChild* child);
static void __widgets_color_picker_row___lambda23__gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                                                          GtkFlowBoxChild* child,
                                                                          gpointer self);
static void widgets_color_picker_row_finalize (GObject * obj);
static GType widgets_color_picker_row_get_type_once (void);
static void _vala_widgets_color_picker_row_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_widgets_color_picker_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
widgets_color_picker_row_get_instance_private (WidgetsColorPickerRow* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsColorPickerRow_private_offset);
}

WidgetsColorPickerRow*
widgets_color_picker_row_construct (GType object_type)
{
	WidgetsColorPickerRow * self = NULL;
	self = (WidgetsColorPickerRow*) g_object_new (object_type, NULL);
	return self;
}

WidgetsColorPickerRow*
widgets_color_picker_row_new (void)
{
	return widgets_color_picker_row_construct (WIDGETS_TYPE_COLOR_PICKER_ROW);
}

void
widgets_color_picker_row_clean_up (WidgetsColorPickerRow* 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->signal_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->signal_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
}

const gchar*
widgets_color_picker_row_get_color (WidgetsColorPickerRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_color;
	result = _tmp0_;
	return result;
}

void
widgets_color_picker_row_set_color (WidgetsColorPickerRow* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_color_picker_row_get_color (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_color);
		self->priv->_color = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_color_picker_row_properties[WIDGETS_COLOR_PICKER_ROW_COLOR_PROPERTY]);
	}
}

static gint
_widgets_color_picker_row___lambda20_ (WidgetsColorPickerRow* self,
                                       ObjectsColor* a,
                                       ObjectsColor* b)
{
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	_tmp0_ = objects_color_get_id (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_color_get_id (b);
	_tmp3_ = _tmp2_;
	result = _tmp1_ - _tmp3_;
	return result;
}

static gint
__widgets_color_picker_row___lambda20__gcompare_data_func (gconstpointer a,
                                                           gconstpointer b,
                                                           gpointer self)
{
	gint result;
	result = _widgets_color_picker_row___lambda20_ ((WidgetsColorPickerRow*) self, (ObjectsColor*) a, (ObjectsColor*) b);
	return result;
}

static Block50Data*
block50_data_ref (Block50Data* _data50_)
{
	g_atomic_int_inc (&_data50_->_ref_count_);
	return _data50_;
}

static void
block50_data_unref (void * _userdata_)
{
	Block50Data* _data50_;
	_data50_ = (Block50Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data50_->_ref_count_)) {
		WidgetsColorPickerRow* self;
		self = _data50_->self;
		_g_object_unref0 (_data50_->color_obj);
		_g_object_unref0 (self);
		g_slice_free (Block50Data, _data50_);
	}
}

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

static void
_widgets_color_picker_row_____lambda21_ (Block50Data* _data50_)
{
	WidgetsColorPickerRow* self;
	ObjectsColor* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	self = _data50_->self;
	_tmp0_ = _data50_->color_obj;
	_tmp1_ = objects_color_get_name_code (_tmp0_);
	_tmp2_ = _tmp1_;
	widgets_color_picker_row_set_color (self, _tmp2_);
	g_signal_emit (self, widgets_color_picker_row_signals[WIDGETS_COLOR_PICKER_ROW_COLOR_CHANGED_SIGNAL], 0);
}

static void
__widgets_color_picker_row_____lambda21__gtk_check_button_toggled (GtkCheckButton* _sender,
                                                                   gpointer self)
{
	_widgets_color_picker_row_____lambda21_ (self);
}

static void
_widgets_color_picker_row___lambda22_ (WidgetsColorPickerRow* self)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	_tmp0_ = self->priv->colors_hashmap;
	_tmp1_ = self->priv->_color;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp1_)) {
		GeeHashMap* _tmp2_;
		const gchar* _tmp3_;
		gpointer _tmp4_;
		GtkCheckButton* _tmp5_;
		_tmp2_ = self->priv->colors_hashmap;
		_tmp3_ = self->priv->_color;
		_tmp4_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp2_, _tmp3_);
		_tmp5_ = (GtkCheckButton*) _tmp4_;
		gtk_check_button_set_active (_tmp5_, TRUE);
		_g_object_unref0 (_tmp5_);
	}
}

static void
__widgets_color_picker_row___lambda22__g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self)
{
	_widgets_color_picker_row___lambda22_ ((WidgetsColorPickerRow*) self);
}

static void
_widgets_color_picker_row___lambda23_ (WidgetsColorPickerRow* self,
                                       GtkFlowBoxChild* child)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (child != NULL);
	_tmp0_ = gtk_flow_box_child_get_child (child);
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_widget_get_name (_tmp1_);
	_tmp3_ = _tmp2_;
	widgets_color_picker_row_set_color (self, _tmp3_);
	g_signal_emit (self, widgets_color_picker_row_signals[WIDGETS_COLOR_PICKER_ROW_COLOR_CHANGED_SIGNAL], 0);
}

static void
__widgets_color_picker_row___lambda23__gtk_flow_box_child_activated (GtkFlowBox* _sender,
                                                                     GtkFlowBoxChild* child,
                                                                     gpointer self)
{
	_widgets_color_picker_row___lambda23_ ((WidgetsColorPickerRow*) self, child);
}

static GObject *
widgets_color_picker_row_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsColorPickerRow * self;
	GeeHashMap* _tmp0_;
	GtkFlowBox* colors_flowbox = NULL;
	GtkFlowBox* _tmp1_ = NULL;
	GeeArrayList* colors_list = NULL;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp22_;
	GtkCheckButton* radio = NULL;
	GtkCheckButton* _tmp23_;
	GtkFlowBox* _tmp67_;
	GeeHashMap* _tmp68_;
	gulong _tmp69_;
	GeeHashMap* _tmp70_;
	GtkFlowBox* _tmp71_;
	gulong _tmp72_;
	GtkFlowBox* _tmp73_;
	parent_class = G_OBJECT_CLASS (widgets_color_picker_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_COLOR_PICKER_ROW, WidgetsColorPickerRow);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, gtk_check_button_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->colors_hashmap);
	self->priv->colors_hashmap = _tmp0_;
	_tmp1_ = (GtkFlowBox*) gtk_flow_box_new ();
	gtk_flow_box_set_column_spacing (_tmp1_, (guint) 6);
	gtk_flow_box_set_row_spacing (_tmp1_, (guint) 6);
	gtk_flow_box_set_max_children_per_line (_tmp1_, (guint) 10);
	gtk_flow_box_set_homogeneous (_tmp1_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp1_, 9);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp1_, 9);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp1_, 9);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp1_, 9);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp1_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	gtk_flow_box_set_selection_mode (_tmp1_, GTK_SELECTION_NONE);
	g_object_ref_sink (_tmp1_);
	colors_flowbox = _tmp1_;
	_tmp2_ = gee_array_list_new (OBJECTS_TYPE_COLOR, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	colors_list = _tmp2_;
	{
		GeeIterator* _entry_it = NULL;
		Util* _tmp3_;
		Util* _tmp4_;
		GeeHashMap* _tmp5_;
		GeeHashMap* _tmp6_;
		GeeSet* _tmp7_;
		GeeSet* _tmp8_;
		GeeSet* _tmp9_;
		GeeIterator* _tmp10_;
		GeeIterator* _tmp11_;
		_tmp3_ = util_get_default ();
		_tmp4_ = _tmp3_;
		_tmp5_ = util_get_colors (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = gee_iterable_iterator ((GeeIterable*) _tmp9_);
		_tmp11_ = _tmp10_;
		_g_object_unref0 (_tmp9_);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (_tmp4_);
		_entry_it = _tmp11_;
		while (TRUE) {
			GeeIterator* _tmp12_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp13_;
			gpointer _tmp14_;
			GeeMapEntry* _tmp15_;
			gconstpointer _tmp16_;
			gconstpointer _tmp17_;
			_tmp12_ = _entry_it;
			if (!gee_iterator_next (_tmp12_)) {
				break;
			}
			_tmp13_ = _entry_it;
			_tmp14_ = gee_iterator_get (_tmp13_);
			entry = (GeeMapEntry*) _tmp14_;
			_tmp15_ = entry;
			_tmp16_ = gee_map_entry_get_key (_tmp15_);
			_tmp17_ = _tmp16_;
			if (!g_str_has_prefix ((const gchar*) _tmp17_, "#")) {
				GeeArrayList* _tmp18_;
				GeeMapEntry* _tmp19_;
				gconstpointer _tmp20_;
				gconstpointer _tmp21_;
				_tmp18_ = colors_list;
				_tmp19_ = entry;
				_tmp20_ = gee_map_entry_get_value (_tmp19_);
				_tmp21_ = _tmp20_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp18_, (ObjectsColor*) _tmp21_);
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp22_ = colors_list;
	gee_list_sort ((GeeList*) _tmp22_, __widgets_color_picker_row___lambda20__gcompare_data_func, g_object_ref (self), g_object_unref);
	_tmp23_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp23_);
	radio = _tmp23_;
	{
		GeeArrayList* _color_obj_list = NULL;
		GeeArrayList* _tmp24_;
		gint _color_obj_size = 0;
		GeeArrayList* _tmp25_;
		gint _tmp26_;
		gint _tmp27_;
		gint _color_obj_index = 0;
		_tmp24_ = colors_list;
		_color_obj_list = _tmp24_;
		_tmp25_ = _color_obj_list;
		_tmp26_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp25_);
		_tmp27_ = _tmp26_;
		_color_obj_size = _tmp27_;
		_color_obj_index = -1;
		while (TRUE) {
			Block50Data* _data50_;
			gint _tmp28_;
			gint _tmp29_;
			GeeArrayList* _tmp30_;
			gpointer _tmp31_;
			GtkCheckButton* color_radio = NULL;
			ObjectsColor* _tmp32_;
			const gchar* _tmp33_;
			const gchar* _tmp34_;
			gchar* _tmp35_;
			ObjectsColor* _tmp36_;
			const gchar* _tmp37_;
			const gchar* _tmp38_;
			gchar* _tmp39_;
			gchar* _tmp40_;
			gchar** _tmp41_;
			GtkCheckButton* _tmp42_;
			GtkCheckButton* _tmp43_;
			GtkCheckButton* _tmp44_ = NULL;
			Util* _tmp45_;
			Util* _tmp46_;
			ObjectsColor* _tmp47_;
			const gchar* _tmp48_;
			const gchar* _tmp49_;
			GtkCheckButton* _tmp50_;
			GeeHashMap* _tmp51_;
			ObjectsColor* _tmp52_;
			const gchar* _tmp53_;
			const gchar* _tmp54_;
			GtkCheckButton* _tmp55_;
			GtkFlowBox* _tmp56_;
			GeeHashMap* _tmp57_;
			ObjectsColor* _tmp58_;
			const gchar* _tmp59_;
			const gchar* _tmp60_;
			gpointer _tmp61_;
			GtkCheckButton* _tmp62_;
			GeeHashMap* _tmp63_;
			GtkCheckButton* _tmp64_;
			gulong _tmp65_;
			GtkCheckButton* _tmp66_;
			_data50_ = g_slice_new0 (Block50Data);
			_data50_->_ref_count_ = 1;
			_data50_->self = g_object_ref (self);
			_color_obj_index = _color_obj_index + 1;
			_tmp28_ = _color_obj_index;
			_tmp29_ = _color_obj_size;
			if (!(_tmp28_ < _tmp29_)) {
				block50_data_unref (_data50_);
				_data50_ = NULL;
				break;
			}
			_tmp30_ = _color_obj_list;
			_tmp31_ = gee_abstract_list_get ((GeeAbstractList*) _tmp30_, _color_obj_index);
			_data50_->color_obj = (ObjectsColor*) _tmp31_;
			_tmp32_ = _data50_->color_obj;
			_tmp33_ = objects_color_get_name (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = g_strdup (_tmp34_);
			_tmp36_ = _data50_->color_obj;
			_tmp37_ = objects_color_get_name_code (_tmp36_);
			_tmp38_ = _tmp37_;
			_tmp39_ = g_strdup (_tmp38_);
			_tmp40_ = g_strdup ("color-radio");
			_tmp41_ = g_new0 (gchar*, 1 + 1);
			_tmp41_[0] = _tmp40_;
			_tmp42_ = radio;
			_tmp43_ = _g_object_ref0 (_tmp42_);
			_tmp44_ = (GtkCheckButton*) gtk_check_button_new ();
			gtk_widget_set_valign ((GtkWidget*) _tmp44_, GTK_ALIGN_CENTER);
			gtk_widget_set_halign ((GtkWidget*) _tmp44_, GTK_ALIGN_CENTER);
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp44_, _tmp35_);
			_g_free0 (_tmp35_);
			gtk_widget_set_name ((GtkWidget*) _tmp44_, _tmp39_);
			_g_free0 (_tmp39_);
			gtk_widget_set_css_classes ((GtkWidget*) _tmp44_, _tmp41_);
			_tmp41_ = (_vala_array_free (_tmp41_, 1, (GDestroyNotify) g_free), NULL);
			gtk_check_button_set_group (_tmp44_, _tmp43_);
			_g_object_unref0 (_tmp43_);
			g_object_ref_sink (_tmp44_);
			color_radio = _tmp44_;
			_tmp45_ = util_get_default ();
			_tmp46_ = _tmp45_;
			_tmp47_ = _data50_->color_obj;
			_tmp48_ = objects_color_get_hexadecimal (_tmp47_);
			_tmp49_ = _tmp48_;
			_tmp50_ = color_radio;
			util_set_widget_color (_tmp46_, _tmp49_, (GtkWidget*) _tmp50_);
			_g_object_unref0 (_tmp46_);
			_tmp51_ = self->priv->colors_hashmap;
			_tmp52_ = _data50_->color_obj;
			_tmp53_ = objects_color_get_name_code (_tmp52_);
			_tmp54_ = _tmp53_;
			_tmp55_ = color_radio;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp51_, _tmp54_, _tmp55_);
			_tmp56_ = colors_flowbox;
			_tmp57_ = self->priv->colors_hashmap;
			_tmp58_ = _data50_->color_obj;
			_tmp59_ = objects_color_get_name_code (_tmp58_);
			_tmp60_ = _tmp59_;
			_tmp61_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp57_, _tmp60_);
			_tmp62_ = (GtkCheckButton*) _tmp61_;
			gtk_flow_box_append (_tmp56_, (GtkWidget*) _tmp62_);
			_g_object_unref0 (_tmp62_);
			_tmp63_ = self->priv->signal_map;
			_tmp64_ = color_radio;
			_tmp65_ = g_signal_connect_data (_tmp64_, "toggled", (GCallback) __widgets_color_picker_row_____lambda21__gtk_check_button_toggled, block50_data_ref (_data50_), (GClosureNotify) block50_data_unref, 0);
			_tmp66_ = color_radio;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp63_, (gpointer) ((guintptr) _tmp65_), (GObject*) _tmp66_);
			_g_object_unref0 (color_radio);
			block50_data_unref (_data50_);
			_data50_ = NULL;
		}
	}
	_tmp67_ = colors_flowbox;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp67_);
	_tmp68_ = self->priv->signal_map;
	_tmp69_ = g_signal_connect_object ((GObject*) self, "notify::color", (GCallback) __widgets_color_picker_row___lambda22__g_object_notify, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp68_, (gpointer) ((guintptr) _tmp69_), (GObject*) self);
	_tmp70_ = self->priv->signal_map;
	_tmp71_ = colors_flowbox;
	_tmp72_ = g_signal_connect_object (_tmp71_, "child-activated", (GCallback) __widgets_color_picker_row___lambda23__gtk_flow_box_child_activated, self, 0);
	_tmp73_ = colors_flowbox;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp70_, (gpointer) ((guintptr) _tmp72_), (GObject*) _tmp73_);
	_g_object_unref0 (radio);
	_g_object_unref0 (colors_list);
	_g_object_unref0 (colors_flowbox);
	return obj;
}

static void
widgets_color_picker_row_class_init (WidgetsColorPickerRowClass * klass,
                                     gpointer klass_data)
{
	widgets_color_picker_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsColorPickerRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_color_picker_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_color_picker_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_color_picker_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_color_picker_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_COLOR_PICKER_ROW_COLOR_PROPERTY, widgets_color_picker_row_properties[WIDGETS_COLOR_PICKER_ROW_COLOR_PROPERTY] = g_param_spec_string ("color", "color", "color", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	widgets_color_picker_row_signals[WIDGETS_COLOR_PICKER_ROW_COLOR_CHANGED_SIGNAL] = g_signal_new ("color-changed", WIDGETS_TYPE_COLOR_PICKER_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
widgets_color_picker_row_instance_init (WidgetsColorPickerRow * self,
                                        gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = widgets_color_picker_row_get_instance_private (self);
	_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->signal_map = _tmp0_;
}

static void
widgets_color_picker_row_finalize (GObject * obj)
{
	WidgetsColorPickerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_COLOR_PICKER_ROW, WidgetsColorPickerRow);
	g_debug ("ColorPickerRow.vala:37: Destroying - Widgets.ColorPickerRow\n");
	_g_free0 (self->priv->_color);
	_g_object_unref0 (self->priv->colors_hashmap);
	_g_object_unref0 (self->priv->signal_map);
	G_OBJECT_CLASS (widgets_color_picker_row_parent_class)->finalize (obj);
}

static GType
widgets_color_picker_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsColorPickerRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_color_picker_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsColorPickerRow), 0, (GInstanceInitFunc) widgets_color_picker_row_instance_init, NULL };
	GType widgets_color_picker_row_type_id;
	widgets_color_picker_row_type_id = g_type_register_static (adw_bin_get_type (), "WidgetsColorPickerRow", &g_define_type_info, 0);
	WidgetsColorPickerRow_private_offset = g_type_add_instance_private (widgets_color_picker_row_type_id, sizeof (WidgetsColorPickerRowPrivate));
	return widgets_color_picker_row_type_id;
}

GType
widgets_color_picker_row_get_type (void)
{
	static volatile gsize widgets_color_picker_row_type_id__once = 0;
	if (g_once_init_enter (&widgets_color_picker_row_type_id__once)) {
		GType widgets_color_picker_row_type_id;
		widgets_color_picker_row_type_id = widgets_color_picker_row_get_type_once ();
		g_once_init_leave (&widgets_color_picker_row_type_id__once, widgets_color_picker_row_type_id);
	}
	return widgets_color_picker_row_type_id__once;
}

static void
_vala_widgets_color_picker_row_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	WidgetsColorPickerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_COLOR_PICKER_ROW, WidgetsColorPickerRow);
	switch (property_id) {
		case WIDGETS_COLOR_PICKER_ROW_COLOR_PROPERTY:
		g_value_set_string (value, widgets_color_picker_row_get_color (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_color_picker_row_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	WidgetsColorPickerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_COLOR_PICKER_ROW, WidgetsColorPickerRow);
	switch (property_id) {
		case WIDGETS_COLOR_PICKER_ROW_COLOR_PROPERTY:
		widgets_color_picker_row_set_color (self, g_value_get_string (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);
}

