/* ProjectPickerRow.c generated by valac 0.56.19, the Vala compiler
 * generated from ProjectPickerRow.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 <glib.h>
#include <gtk/gtk.h>
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <pango/pango.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_PROJECT_PICKER_PROJECT_PICKER_ROW_0_PROPERTY,
	WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_PROJECT_PROPERTY,
	WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_IS_SELECTED_PROPERTY,
	WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_NUM_PROPERTIES
};
static GParamSpec* widgets_project_picker_project_picker_row_properties[WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_SELECTED_SIGNAL,
	WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_NUM_SIGNALS
};
static guint widgets_project_picker_project_picker_row_signals[WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_NUM_SIGNALS] = {0};

struct _WidgetsProjectPickerProjectPickerRowPrivate {
	ObjectsProject* _project;
	gboolean _is_selected;
	GtkLabel* name_label;
	GtkRevealer* main_revealer;
	GtkRevealer* selected_revealer;
	WidgetsIconColorProject* icon_project;
	GeeHashMap* signal_map;
};

static gint WidgetsProjectPickerProjectPickerRow_private_offset;
static gpointer widgets_project_picker_project_picker_row_parent_class = NULL;

static GObject * widgets_project_picker_project_picker_row_constructor (GType type,
                                                                 guint n_construct_properties,
                                                                 GObjectConstructParam * construct_properties);
static gboolean _widgets_project_picker_project_picker_row___lambda108_ (WidgetsProjectPickerProjectPickerRow* self);
static gboolean __widgets_project_picker_project_picker_row___lambda108__gsource_func (gpointer self);
static void _widgets_project_picker_project_picker_row___lambda109_ (WidgetsProjectPickerProjectPickerRow* self);
static void __widgets_project_picker_project_picker_row___lambda109__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                                         gint n_press,
                                                                                         gdouble x,
                                                                                         gdouble y,
                                                                                         gpointer self);
static void _widgets_project_picker_project_picker_row___lambda110_ (WidgetsProjectPickerProjectPickerRow* self);
static void __widgets_project_picker_project_picker_row___lambda110__gtk_list_box_row_activate (GtkListBoxRow* _sender,
                                                                                         gpointer self);
static void _widgets_project_picker_project_picker_row___lambda111_ (WidgetsProjectPickerProjectPickerRow* self);
static void __widgets_project_picker_project_picker_row___lambda111__g_object_notify (GObject* _sender,
                                                                               GParamSpec* pspec,
                                                                               gpointer self);
static void widgets_project_picker_project_picker_row_finalize (GObject * obj);
static GType widgets_project_picker_project_picker_row_get_type_once (void);
static void _vala_widgets_project_picker_project_picker_row_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec);
static void _vala_widgets_project_picker_project_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 _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
widgets_project_picker_project_picker_row_get_instance_private (WidgetsProjectPickerProjectPickerRow* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsProjectPickerProjectPickerRow_private_offset);
}

WidgetsProjectPickerProjectPickerRow*
widgets_project_picker_project_picker_row_construct (GType object_type,
                                                     ObjectsProject* project)
{
	WidgetsProjectPickerProjectPickerRow * self = NULL;
	g_return_val_if_fail (project != NULL, NULL);
	self = (WidgetsProjectPickerProjectPickerRow*) g_object_new (object_type, "project", project, NULL);
	return self;
}

WidgetsProjectPickerProjectPickerRow*
widgets_project_picker_project_picker_row_new (ObjectsProject* project)
{
	return widgets_project_picker_project_picker_row_construct (WIDGETS_PROJECT_PICKER_TYPE_PROJECT_PICKER_ROW, project);
}

void
widgets_project_picker_project_picker_row_update_request (WidgetsProjectPickerProjectPickerRow* self)
{
	const gchar* _tmp0_ = NULL;
	ObjectsProject* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkLabel* _tmp7_;
	WidgetsIconColorProject* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_project;
	_tmp2_ = objects_project_get_inbox_project (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_tmp0_ = _ ("Inbox");
	} else {
		ObjectsProject* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp4_ = self->priv->_project;
		_tmp5_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_;
	}
	_tmp7_ = self->priv->name_label;
	gtk_label_set_label (_tmp7_, _tmp0_);
	_tmp8_ = self->priv->icon_project;
	widgets_icon_color_project_update_request (_tmp8_);
}

void
widgets_project_picker_project_picker_row_clean_up (WidgetsProjectPickerProjectPickerRow* self)
{
	GeeHashMap* _tmp15_;
	WidgetsIconColorProject* _tmp16_;
	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_);
	_tmp16_ = self->priv->icon_project;
	if (_tmp16_ != NULL) {
		WidgetsIconColorProject* _tmp17_;
		_tmp17_ = self->priv->icon_project;
		widgets_icon_color_project_clean_up (_tmp17_);
	}
}

ObjectsProject*
widgets_project_picker_project_picker_row_get_project (WidgetsProjectPickerProjectPickerRow* self)
{
	ObjectsProject* result;
	ObjectsProject* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_project;
	result = _tmp0_;
	return result;
}

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

static void
widgets_project_picker_project_picker_row_set_project (WidgetsProjectPickerProjectPickerRow* self,
                                                       ObjectsProject* value)
{
	ObjectsProject* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_project_picker_project_picker_row_get_project (self);
	if (old_value != value) {
		ObjectsProject* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_project);
		self->priv->_project = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_project_picker_project_picker_row_properties[WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_PROJECT_PROPERTY]);
	}
}

gboolean
widgets_project_picker_project_picker_row_get_is_selected (WidgetsProjectPickerProjectPickerRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_selected;
	return result;
}

void
widgets_project_picker_project_picker_row_set_is_selected (WidgetsProjectPickerProjectPickerRow* self,
                                                           gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_project_picker_project_picker_row_get_is_selected (self);
	if (old_value != value) {
		self->priv->_is_selected = value;
		g_object_notify_by_pspec ((GObject *) self, widgets_project_picker_project_picker_row_properties[WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_IS_SELECTED_PROPERTY]);
	}
}

static gboolean
_widgets_project_picker_project_picker_row___lambda108_ (WidgetsProjectPickerProjectPickerRow* self)
{
	GtkRevealer* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->main_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, TRUE);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
__widgets_project_picker_project_picker_row___lambda108__gsource_func (gpointer self)
{
	gboolean result;
	result = _widgets_project_picker_project_picker_row___lambda108_ ((WidgetsProjectPickerProjectPickerRow*) self);
	return result;
}

static void
_widgets_project_picker_project_picker_row___lambda109_ (WidgetsProjectPickerProjectPickerRow* self)
{
	g_signal_emit (self, widgets_project_picker_project_picker_row_signals[WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_SELECTED_SIGNAL], 0);
}

static void
__widgets_project_picker_project_picker_row___lambda109__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                                    gint n_press,
                                                                                    gdouble x,
                                                                                    gdouble y,
                                                                                    gpointer self)
{
	_widgets_project_picker_project_picker_row___lambda109_ ((WidgetsProjectPickerProjectPickerRow*) self);
}

static void
_widgets_project_picker_project_picker_row___lambda110_ (WidgetsProjectPickerProjectPickerRow* self)
{
	g_signal_emit (self, widgets_project_picker_project_picker_row_signals[WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_SELECTED_SIGNAL], 0);
}

static void
__widgets_project_picker_project_picker_row___lambda110__gtk_list_box_row_activate (GtkListBoxRow* _sender,
                                                                                    gpointer self)
{
	_widgets_project_picker_project_picker_row___lambda110_ ((WidgetsProjectPickerProjectPickerRow*) self);
}

static void
_widgets_project_picker_project_picker_row___lambda111_ (WidgetsProjectPickerProjectPickerRow* self)
{
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	_tmp0_ = self->priv->selected_revealer;
	_tmp1_ = self->priv->_is_selected;
	gtk_revealer_set_reveal_child (_tmp0_, _tmp1_);
}

static void
__widgets_project_picker_project_picker_row___lambda111__g_object_notify (GObject* _sender,
                                                                          GParamSpec* pspec,
                                                                          gpointer self)
{
	_widgets_project_picker_project_picker_row___lambda111_ ((WidgetsProjectPickerProjectPickerRow*) self);
}

static GObject *
widgets_project_picker_project_picker_row_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsProjectPickerProjectPickerRow * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	WidgetsIconColorProject* _tmp4_;
	WidgetsIconColorProject* _tmp5_;
	ObjectsProject* _tmp6_;
	GtkLabel* _tmp7_;
	GtkLabel* _tmp8_;
	GtkLabel* _tmp9_;
	GtkImage* selected_icon = NULL;
	GtkImage* _tmp10_ = NULL;
	GtkImage* _tmp11_;
	GtkImage* _tmp12_;
	GtkWidget* _tmp13_;
	GtkRevealer* _tmp14_ = NULL;
	GtkBox* content_box = NULL;
	GtkBox* _tmp15_ = NULL;
	GtkBox* _tmp16_;
	WidgetsIconColorProject* _tmp17_;
	GtkBox* _tmp18_;
	GtkLabel* _tmp19_;
	GtkBox* _tmp20_;
	GtkRevealer* _tmp21_;
	GtkBox* _tmp22_;
	GtkWidget* _tmp23_;
	GtkRevealer* _tmp24_ = NULL;
	GtkRevealer* _tmp25_;
	GtkRevealer* _tmp26_;
	guint _tmp27_;
	guint _tmp28_;
	GtkGestureClick* select_gesture = NULL;
	GtkGestureClick* _tmp29_;
	GtkGestureClick* _tmp30_;
	GtkEventController* _tmp31_;
	GeeHashMap* _tmp32_;
	GtkGestureClick* _tmp33_;
	gulong _tmp34_;
	GtkGestureClick* _tmp35_;
	GeeHashMap* _tmp36_;
	gulong _tmp37_;
	parent_class = G_OBJECT_CLASS (widgets_project_picker_project_picker_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_PROJECT_PICKER_TYPE_PROJECT_PICKER_ROW, WidgetsProjectPickerProjectPickerRow);
	_tmp0_ = g_strdup ("row");
	_tmp1_ = g_strdup ("no-padding");
	_tmp2_ = g_new0 (gchar*, 2 + 1);
	_tmp2_[0] = _tmp0_;
	_tmp2_[1] = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp3__length1 = 2;
	gtk_widget_set_css_classes ((GtkWidget*) self, _tmp3_);
	_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
	_tmp4_ = widgets_icon_color_project_new (20);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->icon_project);
	self->priv->icon_project = _tmp4_;
	_tmp5_ = self->priv->icon_project;
	_tmp6_ = self->priv->_project;
	widgets_icon_color_project_set_project (_tmp5_, _tmp6_);
	_tmp7_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->name_label);
	self->priv->name_label = _tmp7_;
	_tmp8_ = self->priv->name_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp8_, GTK_ALIGN_CENTER);
	_tmp9_ = self->priv->name_label;
	gtk_label_set_ellipsize (_tmp9_, PANGO_ELLIPSIZE_END);
	_tmp10_ = (GtkImage*) gtk_image_new_from_icon_name ("checkmark-small-symbolic");
	gtk_image_set_pixel_size (_tmp10_, 16);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp10_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp10_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp10_, GTK_ALIGN_END);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp10_, 3);
	g_object_ref_sink (_tmp10_);
	selected_icon = _tmp10_;
	_tmp11_ = selected_icon;
	gtk_widget_add_css_class ((GtkWidget*) _tmp11_, "color-primary");
	_tmp12_ = selected_icon;
	_tmp13_ = _g_object_ref0 ((GtkWidget*) _tmp12_);
	_tmp14_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp14_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_revealer_set_child (_tmp14_, _tmp13_);
	_g_object_unref0 (_tmp13_);
	gtk_revealer_set_reveal_child (_tmp14_, FALSE);
	g_object_ref_sink (_tmp14_);
	_g_object_unref0 (self->priv->selected_revealer);
	self->priv->selected_revealer = _tmp14_;
	_tmp15_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp15_, 3);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp15_, 3);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp15_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp15_, 6);
	g_object_ref_sink (_tmp15_);
	content_box = _tmp15_;
	_tmp16_ = content_box;
	_tmp17_ = self->priv->icon_project;
	gtk_box_append (_tmp16_, (GtkWidget*) _tmp17_);
	_tmp18_ = content_box;
	_tmp19_ = self->priv->name_label;
	gtk_box_append (_tmp18_, (GtkWidget*) _tmp19_);
	_tmp20_ = content_box;
	_tmp21_ = self->priv->selected_revealer;
	gtk_box_append (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = content_box;
	_tmp23_ = _g_object_ref0 ((GtkWidget*) _tmp22_);
	_tmp24_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp24_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_child (_tmp24_, _tmp23_);
	_g_object_unref0 (_tmp23_);
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->main_revealer);
	self->priv->main_revealer = _tmp24_;
	_tmp25_ = self->priv->main_revealer;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp25_);
	widgets_project_picker_project_picker_row_update_request (self);
	_tmp26_ = self->priv->main_revealer;
	_tmp27_ = gtk_revealer_get_transition_duration (_tmp26_);
	_tmp28_ = _tmp27_;
	g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp28_, __widgets_project_picker_project_picker_row___lambda108__gsource_func, g_object_ref (self), g_object_unref);
	_tmp29_ = (GtkGestureClick*) gtk_gesture_click_new ();
	select_gesture = _tmp29_;
	_tmp30_ = select_gesture;
	_tmp31_ = _g_object_ref0 ((GtkEventController*) _tmp30_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp31_);
	_tmp32_ = self->priv->signal_map;
	_tmp33_ = select_gesture;
	_tmp34_ = g_signal_connect_object (_tmp33_, "pressed", (GCallback) __widgets_project_picker_project_picker_row___lambda109__gtk_gesture_click_pressed, self, 0);
	_tmp35_ = select_gesture;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp32_, (gpointer) ((guintptr) _tmp34_), (GObject*) _tmp35_);
	_tmp36_ = self->priv->signal_map;
	_tmp37_ = g_signal_connect_object ((GtkListBoxRow*) self, "activate", (GCallback) __widgets_project_picker_project_picker_row___lambda110__gtk_list_box_row_activate, self, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp36_, (gpointer) ((guintptr) _tmp37_), (GObject*) self);
	g_signal_connect_object ((GObject*) self, "notify::is-selected", (GCallback) __widgets_project_picker_project_picker_row___lambda111__g_object_notify, self, 0);
	_g_object_unref0 (select_gesture);
	_g_object_unref0 (content_box);
	_g_object_unref0 (selected_icon);
	return obj;
}

static void
widgets_project_picker_project_picker_row_class_init (WidgetsProjectPickerProjectPickerRowClass * klass,
                                                      gpointer klass_data)
{
	widgets_project_picker_project_picker_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsProjectPickerProjectPickerRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_project_picker_project_picker_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_project_picker_project_picker_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_project_picker_project_picker_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_project_picker_project_picker_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_PROJECT_PROPERTY, widgets_project_picker_project_picker_row_properties[WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_PROJECT_PROPERTY] = g_param_spec_object ("project", "project", "project", OBJECTS_TYPE_PROJECT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_IS_SELECTED_PROPERTY, widgets_project_picker_project_picker_row_properties[WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_IS_SELECTED_PROPERTY] = g_param_spec_boolean ("is-selected", "is-selected", "is-selected", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	widgets_project_picker_project_picker_row_signals[WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_SELECTED_SIGNAL] = g_signal_new ("selected", WIDGETS_PROJECT_PICKER_TYPE_PROJECT_PICKER_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
widgets_project_picker_project_picker_row_instance_init (WidgetsProjectPickerProjectPickerRow * self,
                                                         gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = widgets_project_picker_project_picker_row_get_instance_private (self);
	self->priv->_is_selected = 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->signal_map = _tmp0_;
}

static void
widgets_project_picker_project_picker_row_finalize (GObject * obj)
{
	WidgetsProjectPickerProjectPickerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_PROJECT_PICKER_TYPE_PROJECT_PICKER_ROW, WidgetsProjectPickerProjectPickerRow);
	g_debug ("ProjectPickerRow.vala:42: Destroying - Widgets.ProjectPicker.ProjectPi" \
"ckerRow\n");
	_g_object_unref0 (self->priv->_project);
	_g_object_unref0 (self->priv->name_label);
	_g_object_unref0 (self->priv->main_revealer);
	_g_object_unref0 (self->priv->selected_revealer);
	_g_object_unref0 (self->priv->icon_project);
	_g_object_unref0 (self->priv->signal_map);
	G_OBJECT_CLASS (widgets_project_picker_project_picker_row_parent_class)->finalize (obj);
}

static GType
widgets_project_picker_project_picker_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsProjectPickerProjectPickerRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_project_picker_project_picker_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsProjectPickerProjectPickerRow), 0, (GInstanceInitFunc) widgets_project_picker_project_picker_row_instance_init, NULL };
	GType widgets_project_picker_project_picker_row_type_id;
	widgets_project_picker_project_picker_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "WidgetsProjectPickerProjectPickerRow", &g_define_type_info, 0);
	WidgetsProjectPickerProjectPickerRow_private_offset = g_type_add_instance_private (widgets_project_picker_project_picker_row_type_id, sizeof (WidgetsProjectPickerProjectPickerRowPrivate));
	return widgets_project_picker_project_picker_row_type_id;
}

GType
widgets_project_picker_project_picker_row_get_type (void)
{
	static volatile gsize widgets_project_picker_project_picker_row_type_id__once = 0;
	if (g_once_init_enter (&widgets_project_picker_project_picker_row_type_id__once)) {
		GType widgets_project_picker_project_picker_row_type_id;
		widgets_project_picker_project_picker_row_type_id = widgets_project_picker_project_picker_row_get_type_once ();
		g_once_init_leave (&widgets_project_picker_project_picker_row_type_id__once, widgets_project_picker_project_picker_row_type_id);
	}
	return widgets_project_picker_project_picker_row_type_id__once;
}

static void
_vala_widgets_project_picker_project_picker_row_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec)
{
	WidgetsProjectPickerProjectPickerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_PROJECT_PICKER_TYPE_PROJECT_PICKER_ROW, WidgetsProjectPickerProjectPickerRow);
	switch (property_id) {
		case WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_PROJECT_PROPERTY:
		g_value_set_object (value, widgets_project_picker_project_picker_row_get_project (self));
		break;
		case WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_IS_SELECTED_PROPERTY:
		g_value_set_boolean (value, widgets_project_picker_project_picker_row_get_is_selected (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_project_picker_project_picker_row_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec)
{
	WidgetsProjectPickerProjectPickerRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_PROJECT_PICKER_TYPE_PROJECT_PICKER_ROW, WidgetsProjectPickerProjectPickerRow);
	switch (property_id) {
		case WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_PROJECT_PROPERTY:
		widgets_project_picker_project_picker_row_set_project (self, g_value_get_object (value));
		break;
		case WIDGETS_PROJECT_PICKER_PROJECT_PICKER_ROW_IS_SELECTED_PROPERTY:
		widgets_project_picker_project_picker_row_set_is_selected (self, g_value_get_boolean (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;
}

