/* ProjectItemRow.c generated by valac 0.56.19, the Vala compiler
 * generated from ProjectItemRow.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 <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "planify.h"
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <adwaita.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
#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_PROJECT_ITEM_ROW (widgets_project_item_row_get_type ())
#define WIDGETS_PROJECT_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_PROJECT_ITEM_ROW, WidgetsProjectItemRow))
#define WIDGETS_PROJECT_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_PROJECT_ITEM_ROW, WidgetsProjectItemRowClass))
#define WIDGETS_IS_PROJECT_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_PROJECT_ITEM_ROW))
#define WIDGETS_IS_PROJECT_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_PROJECT_ITEM_ROW))
#define WIDGETS_PROJECT_ITEM_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_PROJECT_ITEM_ROW, WidgetsProjectItemRowClass))

typedef struct _WidgetsProjectItemRow WidgetsProjectItemRow;
typedef struct _WidgetsProjectItemRowClass WidgetsProjectItemRowClass;
typedef struct _WidgetsProjectItemRowPrivate WidgetsProjectItemRowPrivate;
enum  {
	WIDGETS_PROJECT_ITEM_ROW_0_PROPERTY,
	WIDGETS_PROJECT_ITEM_ROW_WIDGET_TYPE_PROPERTY,
	WIDGETS_PROJECT_ITEM_ROW_PROJECT_PROPERTY,
	WIDGETS_PROJECT_ITEM_ROW_NUM_PROPERTIES
};
static GParamSpec* widgets_project_item_row_properties[WIDGETS_PROJECT_ITEM_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 _Block57Data Block57Data;

#define TYPE_PLANIFY (planify_get_type ())
#define PLANIFY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLANIFY, Planify))
#define PLANIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLANIFY, PlanifyClass))
#define IS_PLANIFY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLANIFY))
#define IS_PLANIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLANIFY))
#define PLANIFY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLANIFY, PlanifyClass))

typedef struct _Planify Planify;
typedef struct _PlanifyClass PlanifyClass;
typedef struct _PlanifyPrivate PlanifyPrivate;

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;
typedef struct _Block58Data Block58Data;

struct _WidgetsProjectItemRow {
	GtkListBoxRow parent_instance;
	WidgetsProjectItemRowPrivate * priv;
};

struct _WidgetsProjectItemRowClass {
	GtkListBoxRowClass parent_class;
};

struct _WidgetsProjectItemRowPrivate {
	gchar* _widget_type;
	ObjectsProject* _project;
	GtkLabel* name_label;
	GtkRevealer* main_revealer;
	WidgetsIconColorProject* icon_project;
	GeeHashMap* signal_map;
};

struct _Block57Data {
	int _ref_count_;
	WidgetsProjectItemRow* self;
	GtkPopover* menu_popover;
};

struct _Planify {
	AdwApplication parent_instance;
	PlanifyPrivate * priv;
	MainWindow* main_window;
};

struct _PlanifyClass {
	AdwApplicationClass parent_class;
};

struct _Block58Data {
	int _ref_count_;
	WidgetsProjectItemRow* self;
	GtkRevealer* selected_revealer;
};

static gint WidgetsProjectItemRow_private_offset;
static gpointer widgets_project_item_row_parent_class = NULL;

VALA_EXTERN GType widgets_project_item_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsProjectItemRow, g_object_unref)
VALA_EXTERN WidgetsProjectItemRow* widgets_project_item_row_new (ObjectsProject* project,
                                                     const gchar* widget_type);
VALA_EXTERN WidgetsProjectItemRow* widgets_project_item_row_construct (GType object_type,
                                                           ObjectsProject* project,
                                                           const gchar* widget_type);
VALA_EXTERN void widgets_project_item_row_update_request (WidgetsProjectItemRow* self);
VALA_EXTERN ObjectsProject* widgets_project_item_row_get_project (WidgetsProjectItemRow* self);
VALA_EXTERN void widgets_project_item_row_hide_destroy (WidgetsProjectItemRow* self);
VALA_EXTERN void widgets_project_item_row_clean_up (WidgetsProjectItemRow* self);
static gboolean __lambda935_ (WidgetsProjectItemRow* self);
static gboolean ___lambda935__gsource_func (gpointer self);
static GtkPopover* widgets_project_item_row_build_context_menu (WidgetsProjectItemRow* self);
static Block57Data* block57_data_ref (Block57Data* _data57_);
static void block57_data_unref (void * _userdata_);
static void __lambda936_ (Block57Data* _data57_);
VALA_EXTERN GType planify_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Planify, g_object_unref)
VALA_EXTERN Planify* planify_get_instance (void);
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
static void ___lambda936__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda937_ (Block57Data* _data57_);
static void ___lambda937__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
VALA_EXTERN const gchar* widgets_project_item_row_get_widget_type (WidgetsProjectItemRow* self);
static void widgets_project_item_row_set_widget_type (WidgetsProjectItemRow* self,
                                               const gchar* value);
static void widgets_project_item_row_set_project (WidgetsProjectItemRow* self,
                                           ObjectsProject* value);
static GObject * widgets_project_item_row_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties);
static Block58Data* block58_data_ref (Block58Data* _data58_);
static void block58_data_unref (void * _userdata_);
static gboolean _widgets_project_item_row___lambda938_ (WidgetsProjectItemRow* self);
static gboolean __widgets_project_item_row___lambda938__gsource_func (gpointer self);
static void _widgets_project_item_row___lambda939_ (WidgetsProjectItemRow* self);
static void __widgets_project_item_row___lambda939__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                        gint n_press,
                                                                        gdouble x,
                                                                        gdouble y,
                                                                        gpointer self);
static void _widgets_project_item_row___lambda940_ (Block58Data* _data58_,
                                             const gchar* id);
static void __widgets_project_item_row___lambda940__services_event_bus_project_picker_changed (ServicesEventBus* _sender,
                                                                                        const gchar* id,
                                                                                        gpointer self);
static void _widgets_project_item_row___lambda941_ (WidgetsProjectItemRow* self);
static void __widgets_project_item_row___lambda941__objects_base_object_deleted (ObjectsBaseObject* _sender,
                                                                          gpointer self);
static void _widgets_project_item_row___lambda942_ (WidgetsProjectItemRow* self);
static void __widgets_project_item_row___lambda942__objects_base_object_unarchived (ObjectsBaseObject* _sender,
                                                                             gpointer self);
static void _widgets_project_item_row___lambda943_ (WidgetsProjectItemRow* self);
static void __widgets_project_item_row___lambda943__gtk_widget_destroy (GtkWidget* _sender,
                                                                 gpointer self);
static void widgets_project_item_row_finalize (GObject * obj);
static GType widgets_project_item_row_get_type_once (void);
static void _vala_widgets_project_item_row_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_widgets_project_item_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_project_item_row_get_instance_private (WidgetsProjectItemRow* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsProjectItemRow_private_offset);
}

WidgetsProjectItemRow*
widgets_project_item_row_construct (GType object_type,
                                    ObjectsProject* project,
                                    const gchar* widget_type)
{
	WidgetsProjectItemRow * self = NULL;
	g_return_val_if_fail (project != NULL, NULL);
	g_return_val_if_fail (widget_type != NULL, NULL);
	self = (WidgetsProjectItemRow*) g_object_new (object_type, "project", project, "widget-type", widget_type, NULL);
	return self;
}

WidgetsProjectItemRow*
widgets_project_item_row_new (ObjectsProject* project,
                              const gchar* widget_type)
{
	return widgets_project_item_row_construct (WIDGETS_TYPE_PROJECT_ITEM_ROW, project, widget_type);
}

void
widgets_project_item_row_update_request (WidgetsProjectItemRow* 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_);
}

static gboolean
__lambda935_ (WidgetsProjectItemRow* self)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	gboolean result;
	_tmp0_ = gtk_widget_get_parent ((GtkWidget*) self);
	_tmp1_ = _tmp0_;
	gtk_list_box_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_list_box_get_type (), GtkListBox), (GtkWidget*) self);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda935__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda935_ ((WidgetsProjectItemRow*) self);
	return result;
}

void
widgets_project_item_row_hide_destroy (WidgetsProjectItemRow* self)
{
	GtkRevealer* _tmp0_;
	GtkRevealer* _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->main_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, FALSE);
	widgets_project_item_row_clean_up (self);
	_tmp1_ = self->priv->main_revealer;
	_tmp2_ = gtk_revealer_get_transition_duration (_tmp1_);
	_tmp3_ = _tmp2_;
	g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp3_, ___lambda935__gsource_func, g_object_ref (self), g_object_unref);
}

static Block57Data*
block57_data_ref (Block57Data* _data57_)
{
	g_atomic_int_inc (&_data57_->_ref_count_);
	return _data57_;
}

static void
block57_data_unref (void * _userdata_)
{
	Block57Data* _data57_;
	_data57_ = (Block57Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data57_->_ref_count_)) {
		WidgetsProjectItemRow* self;
		self = _data57_->self;
		_g_object_unref0 (_data57_->menu_popover);
		_g_object_unref0 (self);
		g_slice_free (Block57Data, _data57_);
	}
}

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

static void
__lambda936_ (Block57Data* _data57_)
{
	WidgetsProjectItemRow* self;
	ObjectsProject* _tmp0_;
	Planify* _tmp1_;
	Planify* _tmp2_;
	MainWindow* _tmp3_;
	self = _data57_->self;
	gtk_popover_popdown (_data57_->menu_popover);
	_tmp0_ = self->priv->_project;
	_tmp1_ = planify_get_instance ();
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->main_window;
	objects_project_delete_project (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_window_get_type (), GtkWindow));
}

static void
___lambda936__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda936_ (self);
}

static void
__lambda937_ (Block57Data* _data57_)
{
	WidgetsProjectItemRow* self;
	ObjectsProject* _tmp0_;
	self = _data57_->self;
	gtk_popover_popdown (_data57_->menu_popover);
	_tmp0_ = self->priv->_project;
	objects_project_unarchive_project (_tmp0_);
}

static void
___lambda937__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda937_ (self);
}

static GtkPopover*
widgets_project_item_row_build_context_menu (WidgetsProjectItemRow* self)
{
	Block57Data* _data57_;
	WidgetsContextMenuMenuItem* unarchive_item = NULL;
	WidgetsContextMenuMenuItem* _tmp0_;
	WidgetsContextMenuMenuItem* delete_item = NULL;
	WidgetsContextMenuMenuItem* _tmp1_;
	GtkBox* menu_box = NULL;
	GtkBox* _tmp2_;
	GtkWidget* _tmp3_;
	GtkPopover* _tmp4_ = NULL;
	GeeHashMap* _tmp5_;
	gulong _tmp6_;
	GeeHashMap* _tmp7_;
	gulong _tmp8_;
	GtkPopover* _tmp9_;
	GtkPopover* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data57_ = g_slice_new0 (Block57Data);
	_data57_->_ref_count_ = 1;
	_data57_->self = g_object_ref (self);
	_tmp0_ = widgets_context_menu_menu_item_new (_ ("Unarchive"), "shoe-box-symbolic");
	g_object_ref_sink (_tmp0_);
	unarchive_item = _tmp0_;
	_tmp1_ = widgets_context_menu_menu_item_new (_ ("Delete Project"), "user-trash-symbolic");
	g_object_ref_sink (_tmp1_);
	delete_item = _tmp1_;
	gtk_widget_add_css_class ((GtkWidget*) delete_item, "menu-item-danger");
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp2_);
	menu_box = _tmp2_;
	gtk_widget_set_margin_bottom ((GtkWidget*) menu_box, 3);
	gtk_widget_set_margin_top ((GtkWidget*) menu_box, 3);
	gtk_box_append (menu_box, (GtkWidget*) unarchive_item);
	gtk_box_append (menu_box, (GtkWidget*) delete_item);
	_tmp3_ = _g_object_ref0 ((GtkWidget*) menu_box);
	_tmp4_ = (GtkPopover*) gtk_popover_new ();
	gtk_popover_set_has_arrow (_tmp4_, FALSE);
	gtk_popover_set_child (_tmp4_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	gtk_popover_set_position (_tmp4_, GTK_POS_BOTTOM);
	g_object_set ((GtkWidget*) _tmp4_, "width-request", 250, NULL);
	g_object_ref_sink (_tmp4_);
	_data57_->menu_popover = _tmp4_;
	_tmp5_ = self->priv->signal_map;
	_tmp6_ = g_signal_connect_data ((GtkButton*) delete_item, "clicked", (GCallback) ___lambda936__gtk_button_clicked, block57_data_ref (_data57_), (GClosureNotify) block57_data_unref, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp5_, (gpointer) ((guintptr) _tmp6_), (GObject*) delete_item);
	_tmp7_ = self->priv->signal_map;
	_tmp8_ = g_signal_connect_data ((GtkButton*) unarchive_item, "clicked", (GCallback) ___lambda937__gtk_button_clicked, block57_data_ref (_data57_), (GClosureNotify) block57_data_unref, 0);
	gee_abstract_map_set ((GeeAbstractMap*) _tmp7_, (gpointer) ((guintptr) _tmp8_), (GObject*) unarchive_item);
	_tmp9_ = _g_object_ref0 (_data57_->menu_popover);
	result = _tmp9_;
	_g_object_unref0 (menu_box);
	_g_object_unref0 (delete_item);
	_g_object_unref0 (unarchive_item);
	block57_data_unref (_data57_);
	_data57_ = NULL;
	return result;
}

void
widgets_project_item_row_clean_up (WidgetsProjectItemRow* 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_project_item_row_get_widget_type (WidgetsProjectItemRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_widget_type;
	result = _tmp0_;
	return result;
}

static void
widgets_project_item_row_set_widget_type (WidgetsProjectItemRow* self,
                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_project_item_row_get_widget_type (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_widget_type);
		self->priv->_widget_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_project_item_row_properties[WIDGETS_PROJECT_ITEM_ROW_WIDGET_TYPE_PROPERTY]);
	}
}

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

static void
widgets_project_item_row_set_project (WidgetsProjectItemRow* self,
                                      ObjectsProject* value)
{
	ObjectsProject* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_project_item_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_item_row_properties[WIDGETS_PROJECT_ITEM_ROW_PROJECT_PROPERTY]);
	}
}

static Block58Data*
block58_data_ref (Block58Data* _data58_)
{
	g_atomic_int_inc (&_data58_->_ref_count_);
	return _data58_;
}

static void
block58_data_unref (void * _userdata_)
{
	Block58Data* _data58_;
	_data58_ = (Block58Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data58_->_ref_count_)) {
		WidgetsProjectItemRow* self;
		self = _data58_->self;
		_g_object_unref0 (_data58_->selected_revealer);
		_g_object_unref0 (self);
		g_slice_free (Block58Data, _data58_);
	}
}

static gboolean
_widgets_project_item_row___lambda938_ (WidgetsProjectItemRow* 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_item_row___lambda938__gsource_func (gpointer self)
{
	gboolean result;
	result = _widgets_project_item_row___lambda938_ ((WidgetsProjectItemRow*) self);
	return result;
}

static void
_widgets_project_item_row___lambda939_ (WidgetsProjectItemRow* self)
{
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	ObjectsProject* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_project;
	_tmp3_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp2_);
	_tmp4_ = _tmp3_;
	g_signal_emit_by_name (_tmp1_, "project-picker-changed", _tmp4_);
	_g_object_unref0 (_tmp1_);
}

static void
__widgets_project_item_row___lambda939__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                   gint n_press,
                                                                   gdouble x,
                                                                   gdouble y,
                                                                   gpointer self)
{
	_widgets_project_item_row___lambda939_ ((WidgetsProjectItemRow*) self);
}

static void
_widgets_project_item_row___lambda940_ (Block58Data* _data58_,
                                        const gchar* id)
{
	WidgetsProjectItemRow* self;
	GtkRevealer* _tmp0_;
	ObjectsProject* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	self = _data58_->self;
	g_return_if_fail (id != NULL);
	_tmp0_ = _data58_->selected_revealer;
	_tmp1_ = self->priv->_project;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp1_);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, g_strcmp0 (_tmp3_, id) == 0);
}

static void
__widgets_project_item_row___lambda940__services_event_bus_project_picker_changed (ServicesEventBus* _sender,
                                                                                   const gchar* id,
                                                                                   gpointer self)
{
	_widgets_project_item_row___lambda940_ (self, id);
}

static void
_widgets_project_item_row___lambda941_ (WidgetsProjectItemRow* self)
{
	widgets_project_item_row_hide_destroy (self);
}

static void
__widgets_project_item_row___lambda941__objects_base_object_deleted (ObjectsBaseObject* _sender,
                                                                     gpointer self)
{
	_widgets_project_item_row___lambda941_ ((WidgetsProjectItemRow*) self);
}

static void
_widgets_project_item_row___lambda942_ (WidgetsProjectItemRow* self)
{
	widgets_project_item_row_hide_destroy (self);
}

static void
__widgets_project_item_row___lambda942__objects_base_object_unarchived (ObjectsBaseObject* _sender,
                                                                        gpointer self)
{
	_widgets_project_item_row___lambda942_ ((WidgetsProjectItemRow*) self);
}

static void
_widgets_project_item_row___lambda943_ (WidgetsProjectItemRow* self)
{
	GeeHashMap* _tmp15_;
	{
		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_);
}

static void
__widgets_project_item_row___lambda943__gtk_widget_destroy (GtkWidget* _sender,
                                                            gpointer self)
{
	_widgets_project_item_row___lambda943_ ((WidgetsProjectItemRow*) self);
}

static GObject *
widgets_project_item_row_constructor (GType type,
                                      guint n_construct_properties,
                                      GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsProjectItemRow * self;
	Block58Data* _data58_;
	WidgetsIconColorProject* _tmp0_;
	WidgetsIconColorProject* _tmp1_;
	ObjectsProject* _tmp2_;
	WidgetsIconColorProject* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	GtkImage* selected_icon = NULL;
	GtkImage* _tmp7_ = NULL;
	GtkImage* _tmp8_;
	GtkImage* _tmp9_;
	GtkWidget* _tmp10_;
	GtkRevealer* _tmp11_ = NULL;
	GtkMenuButton* menu_button = NULL;
	GtkPopover* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar** _tmp15_;
	GtkMenuButton* _tmp16_ = NULL;
	GtkBox* content_box = NULL;
	GtkBox* _tmp17_ = NULL;
	GtkBox* _tmp18_;
	WidgetsIconColorProject* _tmp19_;
	GtkBox* _tmp20_;
	GtkLabel* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp25_;
	GtkBox* _tmp31_;
	GtkWidget* _tmp32_;
	GtkRevealer* _tmp33_ = NULL;
	GtkRevealer* _tmp34_;
	GtkRevealer* _tmp35_;
	guint _tmp36_;
	guint _tmp37_;
	GtkGestureClick* select_gesture = NULL;
	GtkGestureClick* _tmp38_;
	GtkGestureClick* _tmp39_;
	GtkEventController* _tmp40_;
	GeeHashMap* _tmp41_;
	GtkGestureClick* _tmp42_;
	gulong _tmp43_;
	GtkGestureClick* _tmp44_;
	GeeHashMap* _tmp45_;
	ServicesEventBus* _tmp46_;
	ServicesEventBus* _tmp47_;
	gulong _tmp48_;
	ServicesEventBus* _tmp49_;
	ServicesEventBus* _tmp50_;
	GeeHashMap* _tmp51_;
	ObjectsProject* _tmp52_;
	gulong _tmp53_;
	ObjectsProject* _tmp54_;
	GeeHashMap* _tmp55_;
	ObjectsProject* _tmp56_;
	gulong _tmp57_;
	ObjectsProject* _tmp58_;
	parent_class = G_OBJECT_CLASS (widgets_project_item_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_PROJECT_ITEM_ROW, WidgetsProjectItemRow);
	_data58_ = g_slice_new0 (Block58Data);
	_data58_->_ref_count_ = 1;
	_data58_->self = g_object_ref (self);
	gtk_widget_add_css_class ((GtkWidget*) self, "no-selectable");
	gtk_widget_add_css_class ((GtkWidget*) self, "transition");
	_tmp0_ = widgets_icon_color_project_new (18);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->icon_project);
	self->priv->icon_project = _tmp0_;
	_tmp1_ = self->priv->icon_project;
	_tmp2_ = self->priv->_project;
	widgets_icon_color_project_set_project (_tmp1_, _tmp2_);
	_tmp3_ = self->priv->icon_project;
	widgets_icon_color_project_update_request (_tmp3_);
	_tmp4_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->name_label);
	self->priv->name_label = _tmp4_;
	_tmp5_ = self->priv->name_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp5_, GTK_ALIGN_CENTER);
	_tmp6_ = self->priv->name_label;
	gtk_label_set_ellipsize (_tmp6_, PANGO_ELLIPSIZE_END);
	_tmp7_ = (GtkImage*) gtk_image_new_from_icon_name ("checkmark-small-symbolic");
	gtk_image_set_pixel_size (_tmp7_, 16);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp7_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp7_, GTK_ALIGN_END);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp7_, 3);
	g_object_ref_sink (_tmp7_);
	selected_icon = _tmp7_;
	_tmp8_ = selected_icon;
	gtk_widget_add_css_class ((GtkWidget*) _tmp8_, "color-primary");
	_tmp9_ = selected_icon;
	_tmp10_ = _g_object_ref0 ((GtkWidget*) _tmp9_);
	_tmp11_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp11_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_revealer_set_child (_tmp11_, _tmp10_);
	_g_object_unref0 (_tmp10_);
	g_object_ref_sink (_tmp11_);
	_data58_->selected_revealer = _tmp11_;
	_tmp12_ = widgets_project_item_row_build_context_menu (self);
	_tmp13_ = g_strdup ("view-more-symbolic");
	_tmp14_ = g_strdup ("flat");
	_tmp15_ = g_new0 (gchar*, 1 + 1);
	_tmp15_[0] = _tmp14_;
	_tmp16_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp16_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp16_, GTK_ALIGN_END);
	gtk_menu_button_set_popover (_tmp16_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	gtk_menu_button_set_icon_name (_tmp16_, _tmp13_);
	_g_free0 (_tmp13_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp16_, _tmp15_);
	_tmp15_ = (_vala_array_free (_tmp15_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp16_);
	menu_button = _tmp16_;
	_tmp17_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp17_, 9);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp17_, 9);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp17_, 9);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp17_, 9);
	g_object_ref_sink (_tmp17_);
	content_box = _tmp17_;
	_tmp18_ = content_box;
	_tmp19_ = self->priv->icon_project;
	gtk_box_append (_tmp18_, (GtkWidget*) _tmp19_);
	_tmp20_ = content_box;
	_tmp21_ = self->priv->name_label;
	gtk_box_append (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->_widget_type;
	if (g_strcmp0 (_tmp22_, "picker") == 0) {
		GtkBox* _tmp23_;
		GtkRevealer* _tmp24_;
		_tmp23_ = content_box;
		_tmp24_ = _data58_->selected_revealer;
		gtk_box_append (_tmp23_, (GtkWidget*) _tmp24_);
	}
	_tmp25_ = self->priv->_widget_type;
	if (g_strcmp0 (_tmp25_, "menu") == 0) {
		GtkBox* _tmp26_;
		GtkBox* _tmp27_;
		GtkBox* _tmp28_;
		GtkBox* _tmp29_;
		GtkMenuButton* _tmp30_;
		_tmp26_ = content_box;
		gtk_widget_set_margin_top ((GtkWidget*) _tmp26_, 3);
		_tmp27_ = content_box;
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp27_, 3);
		_tmp28_ = content_box;
		gtk_widget_set_margin_end ((GtkWidget*) _tmp28_, 3);
		_tmp29_ = content_box;
		_tmp30_ = menu_button;
		gtk_box_append (_tmp29_, (GtkWidget*) _tmp30_);
	}
	_tmp31_ = content_box;
	_tmp32_ = _g_object_ref0 ((GtkWidget*) _tmp31_);
	_tmp33_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp33_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_child (_tmp33_, _tmp32_);
	_g_object_unref0 (_tmp32_);
	g_object_ref_sink (_tmp33_);
	_g_object_unref0 (self->priv->main_revealer);
	self->priv->main_revealer = _tmp33_;
	_tmp34_ = self->priv->main_revealer;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp34_);
	widgets_project_item_row_update_request (self);
	_tmp35_ = self->priv->main_revealer;
	_tmp36_ = gtk_revealer_get_transition_duration (_tmp35_);
	_tmp37_ = _tmp36_;
	g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp37_, __widgets_project_item_row___lambda938__gsource_func, g_object_ref (self), g_object_unref);
	_tmp38_ = (GtkGestureClick*) gtk_gesture_click_new ();
	select_gesture = _tmp38_;
	_tmp39_ = select_gesture;
	_tmp40_ = _g_object_ref0 ((GtkEventController*) _tmp39_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp40_);
	_tmp41_ = self->priv->signal_map;
	_tmp42_ = select_gesture;
	_tmp43_ = g_signal_connect_object (_tmp42_, "pressed", (GCallback) __widgets_project_item_row___lambda939__gtk_gesture_click_pressed, self, 0);
	_tmp44_ = select_gesture;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp41_, (gpointer) ((guintptr) _tmp43_), (GObject*) _tmp44_);
	_tmp45_ = self->priv->signal_map;
	_tmp46_ = services_event_bus_get_default ();
	_tmp47_ = _tmp46_;
	_tmp48_ = g_signal_connect_data (_tmp47_, "project-picker-changed", (GCallback) __widgets_project_item_row___lambda940__services_event_bus_project_picker_changed, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp49_ = services_event_bus_get_default ();
	_tmp50_ = _tmp49_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp45_, (gpointer) ((guintptr) _tmp48_), (GObject*) _tmp50_);
	_g_object_unref0 (_tmp50_);
	_g_object_unref0 (_tmp47_);
	_tmp51_ = self->priv->signal_map;
	_tmp52_ = self->priv->_project;
	_tmp53_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp52_, "deleted", (GCallback) __widgets_project_item_row___lambda941__objects_base_object_deleted, self, 0);
	_tmp54_ = self->priv->_project;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp51_, (gpointer) ((guintptr) _tmp53_), (GObject*) _tmp54_);
	_tmp55_ = self->priv->signal_map;
	_tmp56_ = self->priv->_project;
	_tmp57_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp56_, "unarchived", (GCallback) __widgets_project_item_row___lambda942__objects_base_object_unarchived, self, 0);
	_tmp58_ = self->priv->_project;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp55_, (gpointer) ((guintptr) _tmp57_), (GObject*) _tmp58_);
	g_signal_connect_object ((GtkWidget*) self, "destroy", (GCallback) __widgets_project_item_row___lambda943__gtk_widget_destroy, self, 0);
	_g_object_unref0 (select_gesture);
	_g_object_unref0 (content_box);
	_g_object_unref0 (menu_button);
	_g_object_unref0 (selected_icon);
	block58_data_unref (_data58_);
	_data58_ = NULL;
	return obj;
}

static void
widgets_project_item_row_class_init (WidgetsProjectItemRowClass * klass,
                                     gpointer klass_data)
{
	widgets_project_item_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsProjectItemRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_project_item_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_project_item_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_project_item_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_project_item_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_PROJECT_ITEM_ROW_WIDGET_TYPE_PROPERTY, widgets_project_item_row_properties[WIDGETS_PROJECT_ITEM_ROW_WIDGET_TYPE_PROPERTY] = g_param_spec_string ("widget-type", "widget-type", "widget-type", NULL, 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_ITEM_ROW_PROJECT_PROPERTY, widgets_project_item_row_properties[WIDGETS_PROJECT_ITEM_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));
}

static void
widgets_project_item_row_instance_init (WidgetsProjectItemRow * self,
                                        gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = widgets_project_item_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_project_item_row_finalize (GObject * obj)
{
	WidgetsProjectItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_PROJECT_ITEM_ROW, WidgetsProjectItemRow);
	g_debug ("ProjectItemRow.vala:40: Destroying - Widgets.ProjectItemRow\n");
	_g_free0 (self->priv->_widget_type);
	_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->icon_project);
	_g_object_unref0 (self->priv->signal_map);
	G_OBJECT_CLASS (widgets_project_item_row_parent_class)->finalize (obj);
}

static GType
widgets_project_item_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsProjectItemRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_project_item_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsProjectItemRow), 0, (GInstanceInitFunc) widgets_project_item_row_instance_init, NULL };
	GType widgets_project_item_row_type_id;
	widgets_project_item_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "WidgetsProjectItemRow", &g_define_type_info, 0);
	WidgetsProjectItemRow_private_offset = g_type_add_instance_private (widgets_project_item_row_type_id, sizeof (WidgetsProjectItemRowPrivate));
	return widgets_project_item_row_type_id;
}

GType
widgets_project_item_row_get_type (void)
{
	static volatile gsize widgets_project_item_row_type_id__once = 0;
	if (g_once_init_enter (&widgets_project_item_row_type_id__once)) {
		GType widgets_project_item_row_type_id;
		widgets_project_item_row_type_id = widgets_project_item_row_get_type_once ();
		g_once_init_leave (&widgets_project_item_row_type_id__once, widgets_project_item_row_type_id);
	}
	return widgets_project_item_row_type_id__once;
}

static void
_vala_widgets_project_item_row_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	WidgetsProjectItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_PROJECT_ITEM_ROW, WidgetsProjectItemRow);
	switch (property_id) {
		case WIDGETS_PROJECT_ITEM_ROW_WIDGET_TYPE_PROPERTY:
		g_value_set_string (value, widgets_project_item_row_get_widget_type (self));
		break;
		case WIDGETS_PROJECT_ITEM_ROW_PROJECT_PROPERTY:
		g_value_set_object (value, widgets_project_item_row_get_project (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_project_item_row_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	WidgetsProjectItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_PROJECT_ITEM_ROW, WidgetsProjectItemRow);
	switch (property_id) {
		case WIDGETS_PROJECT_ITEM_ROW_WIDGET_TYPE_PROPERTY:
		widgets_project_item_row_set_widget_type (self, g_value_get_string (value));
		break;
		case WIDGETS_PROJECT_ITEM_ROW_PROJECT_PROPERTY:
		widgets_project_item_row_set_project (self, g_value_get_object (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);
}

