/* LabelSourceRow.c generated by valac 0.56.19, the Vala compiler
 * generated from LabelSourceRow.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 "planify.h"
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <adwaita.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 VIEWS_TYPE_LABEL_SOURCE_ROW (views_label_source_row_get_type ())
#define VIEWS_LABEL_SOURCE_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIEWS_TYPE_LABEL_SOURCE_ROW, ViewsLabelSourceRow))
#define VIEWS_LABEL_SOURCE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIEWS_TYPE_LABEL_SOURCE_ROW, ViewsLabelSourceRowClass))
#define VIEWS_IS_LABEL_SOURCE_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIEWS_TYPE_LABEL_SOURCE_ROW))
#define VIEWS_IS_LABEL_SOURCE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIEWS_TYPE_LABEL_SOURCE_ROW))
#define VIEWS_LABEL_SOURCE_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIEWS_TYPE_LABEL_SOURCE_ROW, ViewsLabelSourceRowClass))

typedef struct _ViewsLabelSourceRow ViewsLabelSourceRow;
typedef struct _ViewsLabelSourceRowClass ViewsLabelSourceRowClass;
typedef struct _ViewsLabelSourceRowPrivate ViewsLabelSourceRowPrivate;

#define LAYOUTS_TYPE_LABEL_ROW (layouts_label_row_get_type ())
#define LAYOUTS_LABEL_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LAYOUTS_TYPE_LABEL_ROW, LayoutsLabelRow))
#define LAYOUTS_LABEL_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LAYOUTS_TYPE_LABEL_ROW, LayoutsLabelRowClass))
#define LAYOUTS_IS_LABEL_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LAYOUTS_TYPE_LABEL_ROW))
#define LAYOUTS_IS_LABEL_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LAYOUTS_TYPE_LABEL_ROW))
#define LAYOUTS_LABEL_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LAYOUTS_TYPE_LABEL_ROW, LayoutsLabelRowClass))

typedef struct _LayoutsLabelRow LayoutsLabelRow;
typedef struct _LayoutsLabelRowClass LayoutsLabelRowClass;
enum  {
	VIEWS_LABEL_SOURCE_ROW_0_PROPERTY,
	VIEWS_LABEL_SOURCE_ROW_SOURCE_PROPERTY,
	VIEWS_LABEL_SOURCE_ROW_NUM_PROPERTIES
};
static GParamSpec* views_label_source_row_properties[VIEWS_LABEL_SOURCE_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define DIALOGS_TYPE_LABEL (dialogs_label_get_type ())
#define DIALOGS_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_TYPE_LABEL, DialogsLabel))
#define DIALOGS_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_TYPE_LABEL, DialogsLabelClass))
#define DIALOGS_IS_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_TYPE_LABEL))
#define DIALOGS_IS_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_TYPE_LABEL))
#define DIALOGS_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_TYPE_LABEL, DialogsLabelClass))

typedef struct _DialogsLabel DialogsLabel;
typedef struct _DialogsLabelClass DialogsLabelClass;

#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;

struct _ViewsLabelSourceRow {
	GtkListBoxRow parent_instance;
	ViewsLabelSourceRowPrivate * priv;
};

struct _ViewsLabelSourceRowClass {
	GtkListBoxRowClass parent_class;
};

struct _ViewsLabelSourceRowPrivate {
	ObjectsSource* _source;
	LayoutsHeaderItem* group;
	GtkRevealer* main_revealer;
	GeeHashMap* labels_hashmap;
	GeeHashMap* signal_map;
};

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

struct _PlanifyClass {
	AdwApplicationClass parent_class;
};

static gint ViewsLabelSourceRow_private_offset;
static gpointer views_label_source_row_parent_class = NULL;
VALA_EXTERN Planify* planify__instance;

VALA_EXTERN GType views_label_source_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewsLabelSourceRow, g_object_unref)
VALA_EXTERN GType layouts_label_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LayoutsLabelRow, g_object_unref)
VALA_EXTERN ViewsLabelSourceRow* views_label_source_row_new (ObjectsSource* source);
VALA_EXTERN ViewsLabelSourceRow* views_label_source_row_construct (GType object_type,
                                                       ObjectsSource* source);
static void views_label_source_row_update_filter (ViewsLabelSourceRow* self);
static gboolean ___lambda853_ (ViewsLabelSourceRow* self,
                        GtkListBoxRow* row);
VALA_EXTERN ObjectsLabel* layouts_label_row_get_label (LayoutsLabelRow* self);
static gboolean ____lambda853__gtk_list_box_filter_func (GtkListBoxRow* row,
                                                  gpointer self);
static void views_label_source_row_add_labels (ViewsLabelSourceRow* self);
VALA_EXTERN ObjectsSource* views_label_source_row_get_source (ViewsLabelSourceRow* self);
static void views_label_source_row_add_label (ViewsLabelSourceRow* self,
                                       ObjectsLabel* label);
VALA_EXTERN LayoutsLabelRow* layouts_label_row_new (ObjectsLabel* label);
VALA_EXTERN LayoutsLabelRow* layouts_label_row_construct (GType object_type,
                                              ObjectsLabel* label);
static gint views_label_source_row_sort_func (ViewsLabelSourceRow* self,
                                       GtkListBoxRow* lbrow,
                                       GtkListBoxRow* lbbefore);
VALA_EXTERN void views_label_source_row_hide_destroy (ViewsLabelSourceRow* self);
VALA_EXTERN void views_label_source_row_clean_up (ViewsLabelSourceRow* self);
static gboolean __lambda854_ (ViewsLabelSourceRow* self);
static gboolean ___lambda854__gsource_func (gpointer self);
VALA_EXTERN void layouts_label_row_clean_up (LayoutsLabelRow* self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void views_label_source_row_set_source (ViewsLabelSourceRow* self,
                                        ObjectsSource* value);
static GObject * views_label_source_row_constructor (GType type,
                                              guint n_construct_properties,
                                              GObjectConstructParam * construct_properties);
static gint _views_label_source_row_sort_func_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                               GtkListBoxRow* row2,
                                                               gpointer self);
static gboolean _views_label_source_row___lambda855_ (ViewsLabelSourceRow* self);
static gboolean __views_label_source_row___lambda855__gsource_func (gpointer self);
static void _views_label_source_row___lambda856_ (ViewsLabelSourceRow* self);
static void __views_label_source_row___lambda856__objects_base_object_updated (ObjectsBaseObject* _sender,
                                                                        const gchar* update_id,
                                                                        gpointer self);
static void _views_label_source_row___lambda857_ (ViewsLabelSourceRow* self);
VALA_EXTERN GType dialogs_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsLabel, g_object_unref)
VALA_EXTERN DialogsLabel* dialogs_label_new_new (ObjectsSource* source);
VALA_EXTERN DialogsLabel* dialogs_label_construct_new (GType object_type,
                                           ObjectsSource* source);
VALA_EXTERN GType planify_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Planify, g_object_unref)
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
static void __views_label_source_row___lambda857__gtk_button_clicked (GtkButton* _sender,
                                                               gpointer self);
static void _views_label_source_row___lambda858_ (ViewsLabelSourceRow* self,
                                           GtkWidget* row);
static void __views_label_source_row___lambda858__layouts_header_item_row_activated (LayoutsHeaderItem* _sender,
                                                                              GtkWidget* widget,
                                                                              gpointer self);
static void _views_label_source_row___lambda859_ (ViewsLabelSourceRow* self,
                                           ObjectsLabel* label);
static void __views_label_source_row___lambda859__services_store_label_added (ServicesStore* _sender,
                                                                       ObjectsLabel* label,
                                                                       gpointer self);
static void _views_label_source_row___lambda860_ (ViewsLabelSourceRow* self,
                                           ObjectsLabel* label);
VALA_EXTERN void layouts_label_row_hide_destroy (LayoutsLabelRow* self);
static void __views_label_source_row___lambda860__services_store_label_deleted (ServicesStore* _sender,
                                                                         ObjectsLabel* label,
                                                                         gpointer self);
static void _views_label_source_row___lambda861_ (ViewsLabelSourceRow* self);
static void __views_label_source_row___lambda861__g_settings_changed (GSettings* _sender,
                                                               const gchar* key,
                                                               gpointer self);
static void _views_label_source_row___lambda862_ (ViewsLabelSourceRow* self);
static void __views_label_source_row___lambda862__services_store_project_archived (ServicesStore* _sender,
                                                                            ObjectsProject* project,
                                                                            gpointer self);
static void _views_label_source_row___lambda863_ (ViewsLabelSourceRow* self);
static void __views_label_source_row___lambda863__services_store_project_unarchived (ServicesStore* _sender,
                                                                              ObjectsProject* project,
                                                                              gpointer self);
static void _views_label_source_row___lambda864_ (ViewsLabelSourceRow* self);
static void __views_label_source_row___lambda864__objects_base_object_updated (ObjectsBaseObject* _sender,
                                                                        const gchar* update_id,
                                                                        gpointer self);
static void views_label_source_row_finalize (GObject * obj);
static GType views_label_source_row_get_type_once (void);
static void _vala_views_label_source_row_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_views_label_source_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
views_label_source_row_get_instance_private (ViewsLabelSourceRow* self)
{
	return G_STRUCT_MEMBER_P (self, ViewsLabelSourceRow_private_offset);
}

ViewsLabelSourceRow*
views_label_source_row_construct (GType object_type,
                                  ObjectsSource* source)
{
	ViewsLabelSourceRow * self = NULL;
	g_return_val_if_fail (source != NULL, NULL);
	self = (ViewsLabelSourceRow*) g_object_new (object_type, "source", source, NULL);
	return self;
}

ViewsLabelSourceRow*
views_label_source_row_new (ObjectsSource* source)
{
	return views_label_source_row_construct (VIEWS_TYPE_LABEL_SOURCE_ROW, source);
}

static gboolean
___lambda853_ (ViewsLabelSourceRow* self,
               GtkListBoxRow* row)
{
	ObjectsLabel* _tmp0_;
	ObjectsLabel* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gboolean result;
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = layouts_label_row_get_label (G_TYPE_CHECK_INSTANCE_CAST (row, LAYOUTS_TYPE_LABEL_ROW, LayoutsLabelRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_label_get_label_count (_tmp1_);
	_tmp3_ = _tmp2_;
	result = _tmp3_ > 0;
	return result;
}

static gboolean
____lambda853__gtk_list_box_filter_func (GtkListBoxRow* row,
                                         gpointer self)
{
	gboolean result;
	result = ___lambda853_ ((ViewsLabelSourceRow*) self, row);
	return result;
}

static void
views_label_source_row_update_filter (ViewsLabelSourceRow* self)
{
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = g_settings_get_boolean (_tmp2_, "labels-show-active-only");
	_g_object_unref0 (_tmp1_);
	if (_tmp3_) {
		LayoutsHeaderItem* _tmp4_;
		LayoutsHeaderItem* _tmp5_;
		_tmp4_ = self->priv->group;
		layouts_header_item_set_filter_func (_tmp4_, ____lambda853__gtk_list_box_filter_func, g_object_ref (self), g_object_unref);
		_tmp5_ = self->priv->group;
		layouts_header_item_set_placeholder_message (_tmp5_, _ ("All labels are hidden by the filter"));
	} else {
		LayoutsHeaderItem* _tmp6_;
		LayoutsHeaderItem* _tmp7_;
		_tmp6_ = self->priv->group;
		layouts_header_item_set_filter_func (_tmp6_, NULL, NULL, NULL);
		_tmp7_ = self->priv->group;
		layouts_header_item_set_placeholder_message (_tmp7_, _ ("No labels available. Create one by clicking on the '+' button"));
	}
}

static void
views_label_source_row_add_labels (ViewsLabelSourceRow* self)
{
	g_return_if_fail (self != NULL);
	{
		GeeArrayList* _label_list = NULL;
		ServicesStore* _tmp0_;
		ObjectsSource* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		GeeArrayList* _tmp4_;
		gint _label_size = 0;
		GeeArrayList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _label_index = 0;
		_tmp0_ = services_store_instance ();
		_tmp1_ = self->priv->_source;
		_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = services_store_get_labels_by_source (_tmp0_, _tmp3_);
		_label_list = _tmp4_;
		_tmp5_ = _label_list;
		_tmp6_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		_label_size = _tmp7_;
		_label_index = -1;
		while (TRUE) {
			gint _tmp8_;
			gint _tmp9_;
			ObjectsLabel* label = NULL;
			GeeArrayList* _tmp10_;
			gpointer _tmp11_;
			ObjectsLabel* _tmp12_;
			_label_index = _label_index + 1;
			_tmp8_ = _label_index;
			_tmp9_ = _label_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _label_list;
			_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp10_, _label_index);
			label = (ObjectsLabel*) _tmp11_;
			_tmp12_ = label;
			views_label_source_row_add_label (self, _tmp12_);
			_g_object_unref0 (label);
		}
		_g_object_unref0 (_label_list);
	}
}

static void
views_label_source_row_add_label (ViewsLabelSourceRow* self,
                                  ObjectsLabel* label)
{
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	ObjectsSource* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label != NULL);
	_tmp1_ = objects_label_get_source_id (label);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->_source;
	_tmp4_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp3_);
	_tmp5_ = _tmp4_;
	if (g_strcmp0 (_tmp2_, _tmp5_) == 0) {
		GeeHashMap* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp6_ = self->priv->labels_hashmap;
		_tmp7_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
		_tmp8_ = _tmp7_;
		_tmp0_ = !gee_abstract_map_has_key ((GeeAbstractMap*) _tmp6_, _tmp8_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GeeHashMap* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		LayoutsLabelRow* _tmp12_;
		LayoutsLabelRow* _tmp13_;
		LayoutsHeaderItem* _tmp14_;
		GeeHashMap* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		gpointer _tmp18_;
		LayoutsLabelRow* _tmp19_;
		_tmp9_ = self->priv->labels_hashmap;
		_tmp10_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
		_tmp11_ = _tmp10_;
		_tmp12_ = layouts_label_row_new (label);
		g_object_ref_sink (_tmp12_);
		_tmp13_ = _tmp12_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, _tmp11_, _tmp13_);
		_g_object_unref0 (_tmp13_);
		_tmp14_ = self->priv->group;
		_tmp15_ = self->priv->labels_hashmap;
		_tmp16_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
		_tmp17_ = _tmp16_;
		_tmp18_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp15_, _tmp17_);
		_tmp19_ = (LayoutsLabelRow*) _tmp18_;
		layouts_header_item_add_child (_tmp14_, (GtkWidget*) _tmp19_);
		_g_object_unref0 (_tmp19_);
	}
}

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

static gint
views_label_source_row_sort_func (ViewsLabelSourceRow* self,
                                  GtkListBoxRow* lbrow,
                                  GtkListBoxRow* lbbefore)
{
	ObjectsLabel* label1 = NULL;
	ObjectsLabel* _tmp0_;
	ObjectsLabel* _tmp1_;
	ObjectsLabel* _tmp2_;
	ObjectsLabel* label2 = NULL;
	ObjectsLabel* _tmp3_;
	ObjectsLabel* _tmp4_;
	ObjectsLabel* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (lbrow != NULL, -1);
	g_return_val_if_fail (lbbefore != NULL, -1);
	_tmp0_ = layouts_label_row_get_label (G_TYPE_CHECK_INSTANCE_CAST (lbrow, LAYOUTS_TYPE_LABEL_ROW, LayoutsLabelRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	label1 = _tmp2_;
	_tmp3_ = layouts_label_row_get_label (G_TYPE_CHECK_INSTANCE_CAST (lbbefore, LAYOUTS_TYPE_LABEL_ROW, LayoutsLabelRow));
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	label2 = _tmp5_;
	_tmp6_ = objects_label_get_item_order (label1);
	_tmp7_ = _tmp6_;
	_tmp8_ = objects_label_get_item_order (label2);
	_tmp9_ = _tmp8_;
	result = _tmp7_ - _tmp9_;
	_g_object_unref0 (label2);
	_g_object_unref0 (label1);
	return result;
}

static gboolean
__lambda854_ (ViewsLabelSourceRow* 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
___lambda854__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda854_ ((ViewsLabelSourceRow*) self);
	return result;
}

void
views_label_source_row_hide_destroy (ViewsLabelSourceRow* 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);
	views_label_source_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_, ___lambda854__gsource_func, g_object_ref (self), g_object_unref);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

void
views_label_source_row_clean_up (ViewsLabelSourceRow* self)
{
	LayoutsHeaderItem* _tmp0_;
	GList* _tmp1_;
	LayoutsHeaderItem* _tmp4_;
	GeeHashMap* _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->group;
	_tmp1_ = layouts_header_item_get_children (_tmp0_);
	{
		GList* row_collection = NULL;
		GList* row_it = NULL;
		row_collection = _tmp1_;
		for (row_it = row_collection; row_it != NULL; row_it = row_it->next) {
			GtkListBoxRow* _tmp2_;
			GtkListBoxRow* row = NULL;
			_tmp2_ = _g_object_ref0 ((GtkListBoxRow*) row_it->data);
			row = _tmp2_;
			{
				GtkListBoxRow* _tmp3_;
				_tmp3_ = row;
				layouts_label_row_clean_up (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, LAYOUTS_TYPE_LABEL_ROW, LayoutsLabelRow));
				_g_object_unref0 (row);
			}
		}
		(row_collection == NULL) ? NULL : (row_collection = (_g_list_free__g_object_unref0_ (row_collection), NULL));
	}
	_tmp4_ = self->priv->group;
	layouts_header_item_clean_up (_tmp4_);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp5_;
		GeeSet* _tmp6_;
		GeeSet* _tmp7_;
		GeeSet* _tmp8_;
		GeeIterator* _tmp9_;
		GeeIterator* _tmp10_;
		_tmp5_ = self->priv->signal_map;
		_tmp6_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = gee_iterable_iterator ((GeeIterable*) _tmp8_);
		_tmp10_ = _tmp9_;
		_g_object_unref0 (_tmp8_);
		_entry_it = _tmp10_;
		while (TRUE) {
			GeeIterator* _tmp11_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp12_;
			gpointer _tmp13_;
			GeeMapEntry* _tmp14_;
			gconstpointer _tmp15_;
			gconstpointer _tmp16_;
			GeeMapEntry* _tmp17_;
			gconstpointer _tmp18_;
			gconstpointer _tmp19_;
			_tmp11_ = _entry_it;
			if (!gee_iterator_next (_tmp11_)) {
				break;
			}
			_tmp12_ = _entry_it;
			_tmp13_ = gee_iterator_get (_tmp12_);
			entry = (GeeMapEntry*) _tmp13_;
			_tmp14_ = entry;
			_tmp15_ = gee_map_entry_get_value (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = entry;
			_tmp18_ = gee_map_entry_get_key (_tmp17_);
			_tmp19_ = _tmp18_;
			g_signal_handler_disconnect ((GObject*) _tmp16_, (gulong) ((guintptr) _tmp19_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp20_ = self->priv->signal_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp20_);
}

ObjectsSource*
views_label_source_row_get_source (ViewsLabelSourceRow* self)
{
	ObjectsSource* result;
	ObjectsSource* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source;
	result = _tmp0_;
	return result;
}

static void
views_label_source_row_set_source (ViewsLabelSourceRow* self,
                                   ObjectsSource* value)
{
	ObjectsSource* old_value;
	g_return_if_fail (self != NULL);
	old_value = views_label_source_row_get_source (self);
	if (old_value != value) {
		ObjectsSource* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_source);
		self->priv->_source = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, views_label_source_row_properties[VIEWS_LABEL_SOURCE_ROW_SOURCE_PROPERTY]);
	}
}

static gint
_views_label_source_row_sort_func_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                          GtkListBoxRow* row2,
                                                          gpointer self)
{
	gint result;
	result = views_label_source_row_sort_func ((ViewsLabelSourceRow*) self, row1, row2);
	return result;
}

static gboolean
_views_label_source_row___lambda855_ (ViewsLabelSourceRow* self)
{
	GtkRevealer* _tmp0_;
	ObjectsSource* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	LayoutsHeaderItem* _tmp4_;
	gboolean result;
	_tmp0_ = self->priv->main_revealer;
	_tmp1_ = self->priv->_source;
	_tmp2_ = objects_source_get_is_visible (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, _tmp3_);
	_tmp4_ = self->priv->group;
	layouts_header_item_set_sort_func (_tmp4_, NULL, NULL, NULL);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
__views_label_source_row___lambda855__gsource_func (gpointer self)
{
	gboolean result;
	result = _views_label_source_row___lambda855_ ((ViewsLabelSourceRow*) self);
	return result;
}

static void
_views_label_source_row___lambda856_ (ViewsLabelSourceRow* self)
{
	LayoutsHeaderItem* _tmp0_;
	ObjectsSource* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	_tmp0_ = self->priv->group;
	_tmp1_ = self->priv->_source;
	_tmp2_ = objects_source_get_display_name (_tmp1_);
	_tmp3_ = _tmp2_;
	layouts_header_item_set_header_title (_tmp0_, _tmp3_);
}

static void
__views_label_source_row___lambda856__objects_base_object_updated (ObjectsBaseObject* _sender,
                                                                   const gchar* update_id,
                                                                   gpointer self)
{
	_views_label_source_row___lambda856_ ((ViewsLabelSourceRow*) self);
}

static void
_views_label_source_row___lambda857_ (ViewsLabelSourceRow* self)
{
	DialogsLabel* dialog = NULL;
	ObjectsSource* _tmp0_;
	DialogsLabel* _tmp1_;
	DialogsLabel* _tmp2_;
	Planify* _tmp3_;
	MainWindow* _tmp4_;
	_tmp0_ = self->priv->_source;
	_tmp1_ = dialogs_label_new_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	dialog = _tmp1_;
	_tmp2_ = dialog;
	_tmp3_ = planify__instance;
	_tmp4_ = _tmp3_->main_window;
	adw_dialog_present ((AdwDialog*) _tmp2_, (GtkWidget*) _tmp4_);
	_g_object_unref0 (dialog);
}

static void
__views_label_source_row___lambda857__gtk_button_clicked (GtkButton* _sender,
                                                          gpointer self)
{
	_views_label_source_row___lambda857_ ((ViewsLabelSourceRow*) self);
}

static void
_views_label_source_row___lambda858_ (ViewsLabelSourceRow* self,
                                      GtkWidget* row)
{
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	ObjectsLabel* _tmp2_;
	ObjectsLabel* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	g_return_if_fail (row != NULL);
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = layouts_label_row_get_label (G_TYPE_CHECK_INSTANCE_CAST (row, LAYOUTS_TYPE_LABEL_ROW, LayoutsLabelRow));
	_tmp3_ = _tmp2_;
	_tmp4_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp3_);
	_tmp5_ = _tmp4_;
	g_signal_emit_by_name (_tmp1_, "pane-selected", PANE_TYPE_LABEL, _tmp5_);
	_g_object_unref0 (_tmp1_);
}

static void
__views_label_source_row___lambda858__layouts_header_item_row_activated (LayoutsHeaderItem* _sender,
                                                                         GtkWidget* widget,
                                                                         gpointer self)
{
	_views_label_source_row___lambda858_ ((ViewsLabelSourceRow*) self, widget);
}

static void
_views_label_source_row___lambda859_ (ViewsLabelSourceRow* self,
                                      ObjectsLabel* label)
{
	g_return_if_fail (label != NULL);
	views_label_source_row_add_label (self, label);
}

static void
__views_label_source_row___lambda859__services_store_label_added (ServicesStore* _sender,
                                                                  ObjectsLabel* label,
                                                                  gpointer self)
{
	_views_label_source_row___lambda859_ ((ViewsLabelSourceRow*) self, label);
}

static void
_views_label_source_row___lambda860_ (ViewsLabelSourceRow* self,
                                      ObjectsLabel* label)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (label != NULL);
	_tmp0_ = self->priv->labels_hashmap;
	_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
	_tmp2_ = _tmp1_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
		GeeHashMap* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gpointer _tmp6_;
		LayoutsLabelRow* _tmp7_;
		GeeHashMap* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp3_ = self->priv->labels_hashmap;
		_tmp4_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, _tmp5_);
		_tmp7_ = (LayoutsLabelRow*) _tmp6_;
		layouts_label_row_hide_destroy (_tmp7_);
		_g_object_unref0 (_tmp7_);
		_tmp8_ = self->priv->labels_hashmap;
		_tmp9_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
		_tmp10_ = _tmp9_;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp8_, _tmp10_, NULL);
	}
}

static void
__views_label_source_row___lambda860__services_store_label_deleted (ServicesStore* _sender,
                                                                    ObjectsLabel* label,
                                                                    gpointer self)
{
	_views_label_source_row___lambda860_ ((ViewsLabelSourceRow*) self, label);
}

static void
_views_label_source_row___lambda861_ (ViewsLabelSourceRow* self)
{
	views_label_source_row_update_filter (self);
}

static void
__views_label_source_row___lambda861__g_settings_changed (GSettings* _sender,
                                                          const gchar* key,
                                                          gpointer self)
{
	_views_label_source_row___lambda861_ ((ViewsLabelSourceRow*) self);
}

static void
_views_label_source_row___lambda862_ (ViewsLabelSourceRow* self)
{
	LayoutsHeaderItem* _tmp0_;
	_tmp0_ = self->priv->group;
	layouts_header_item_invalidate_filter (_tmp0_);
}

static void
__views_label_source_row___lambda862__services_store_project_archived (ServicesStore* _sender,
                                                                       ObjectsProject* project,
                                                                       gpointer self)
{
	_views_label_source_row___lambda862_ ((ViewsLabelSourceRow*) self);
}

static void
_views_label_source_row___lambda863_ (ViewsLabelSourceRow* self)
{
	LayoutsHeaderItem* _tmp0_;
	_tmp0_ = self->priv->group;
	layouts_header_item_invalidate_filter (_tmp0_);
}

static void
__views_label_source_row___lambda863__services_store_project_unarchived (ServicesStore* _sender,
                                                                         ObjectsProject* project,
                                                                         gpointer self)
{
	_views_label_source_row___lambda863_ ((ViewsLabelSourceRow*) self);
}

static void
_views_label_source_row___lambda864_ (ViewsLabelSourceRow* self)
{
	GtkRevealer* _tmp0_;
	ObjectsSource* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	_tmp0_ = self->priv->main_revealer;
	_tmp1_ = self->priv->_source;
	_tmp2_ = objects_source_get_is_visible (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, _tmp3_);
}

static void
__views_label_source_row___lambda864__objects_base_object_updated (ObjectsBaseObject* _sender,
                                                                   const gchar* update_id,
                                                                   gpointer self)
{
	_views_label_source_row___lambda864_ ((ViewsLabelSourceRow*) self);
}

static GObject *
views_label_source_row_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ViewsLabelSourceRow * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	ObjectsSource* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	ObjectsSource* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	LayoutsHeaderItem* _tmp11_ = NULL;
	LayoutsHeaderItem* _tmp12_;
	LayoutsHeaderItem* _tmp13_;
	LayoutsHeaderItem* _tmp14_;
	GtkButton* add_button = NULL;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar** _tmp18_;
	Util* _tmp19_;
	Util* _tmp20_;
	gchar* _tmp21_;
	GtkButton* _tmp22_ = NULL;
	GtkButton* _tmp23_;
	LayoutsHeaderItem* _tmp24_;
	GtkButton* _tmp25_;
	LayoutsHeaderItem* _tmp26_;
	GtkWidget* _tmp27_;
	GtkRevealer* _tmp28_ = NULL;
	GtkRevealer* _tmp29_;
	GtkRevealer* _tmp30_;
	guint _tmp31_;
	guint _tmp32_;
	GeeHashMap* _tmp33_;
	ObjectsSource* _tmp34_;
	gulong _tmp35_;
	ObjectsSource* _tmp36_;
	GeeHashMap* _tmp37_;
	GtkButton* _tmp38_;
	gulong _tmp39_;
	GtkButton* _tmp40_;
	GeeHashMap* _tmp41_;
	LayoutsHeaderItem* _tmp42_;
	gulong _tmp43_;
	LayoutsHeaderItem* _tmp44_;
	GeeHashMap* _tmp45_;
	ServicesStore* _tmp46_;
	gulong _tmp47_;
	ServicesStore* _tmp48_;
	GeeHashMap* _tmp49_;
	ServicesStore* _tmp50_;
	gulong _tmp51_;
	ServicesStore* _tmp52_;
	GeeHashMap* _tmp53_;
	ServicesSettings* _tmp54_;
	ServicesSettings* _tmp55_;
	GSettings* _tmp56_;
	gulong _tmp57_;
	ServicesSettings* _tmp58_;
	ServicesSettings* _tmp59_;
	GSettings* _tmp60_;
	GeeHashMap* _tmp61_;
	ServicesStore* _tmp62_;
	gulong _tmp63_;
	ServicesStore* _tmp64_;
	GeeHashMap* _tmp65_;
	ServicesStore* _tmp66_;
	gulong _tmp67_;
	ServicesStore* _tmp68_;
	ObjectsSource* _tmp69_;
	parent_class = G_OBJECT_CLASS (views_label_source_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VIEWS_TYPE_LABEL_SOURCE_ROW, ViewsLabelSourceRow);
	_tmp0_ = g_strdup ("no-selectable");
	_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_ = self->priv->_source;
	_tmp5_ = objects_source_get_display_name (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->_source;
	_tmp8_ = objects_source_get_subheader_text (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strdup (_tmp9_);
	_tmp11_ = layouts_header_item_new (_tmp6_);
	layouts_header_item_set_reveal (_tmp11_, TRUE);
	layouts_header_item_set_subheader_title (_tmp11_, _tmp10_);
	_g_free0 (_tmp10_);
	layouts_header_item_set_show_separator (_tmp11_, TRUE);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->group);
	self->priv->group = _tmp11_;
	_tmp12_ = self->priv->group;
	layouts_header_item_set_placeholder_message (_tmp12_, _ ("No labels available. Create one by clicking on the '+' button"));
	_tmp13_ = self->priv->group;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp13_, 12);
	_tmp14_ = self->priv->group;
	layouts_header_item_set_sort_func (_tmp14_, _views_label_source_row_sort_func_gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	_tmp15_ = g_strdup ("flat");
	_tmp16_ = g_strdup ("header-item-button");
	_tmp17_ = g_strdup ("dimmed");
	_tmp18_ = g_new0 (gchar*, 3 + 1);
	_tmp18_[0] = _tmp15_;
	_tmp18_[1] = _tmp16_;
	_tmp18_[2] = _tmp17_;
	_tmp19_ = util_get_default ();
	_tmp20_ = _tmp19_;
	_tmp21_ = util_markup_accel_tooltip (_tmp20_, _ ("Add Project"), "P");
	_tmp22_ = (GtkButton*) gtk_button_new_from_icon_name ("plus-large-symbolic");
	gtk_widget_set_valign ((GtkWidget*) _tmp22_, GTK_ALIGN_CENTER);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp22_, _tmp18_);
	_tmp18_ = (_vala_array_free (_tmp18_, 3, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp22_, _tmp21_);
	_g_free0 (_tmp21_);
	g_object_ref_sink (_tmp22_);
	_tmp23_ = _tmp22_;
	_g_object_unref0 (_tmp20_);
	add_button = _tmp23_;
	_tmp24_ = self->priv->group;
	_tmp25_ = add_button;
	layouts_header_item_add_widget_end (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = self->priv->group;
	_tmp27_ = _g_object_ref0 ((GtkWidget*) _tmp26_);
	_tmp28_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp28_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_child (_tmp28_, _tmp27_);
	_g_object_unref0 (_tmp27_);
	g_object_ref_sink (_tmp28_);
	_g_object_unref0 (self->priv->main_revealer);
	self->priv->main_revealer = _tmp28_;
	_tmp29_ = self->priv->main_revealer;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp29_);
	views_label_source_row_add_labels (self);
	views_label_source_row_update_filter (self);
	_tmp30_ = self->priv->main_revealer;
	_tmp31_ = gtk_revealer_get_transition_duration (_tmp30_);
	_tmp32_ = _tmp31_;
	g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp32_, __views_label_source_row___lambda855__gsource_func, g_object_ref (self), g_object_unref);
	_tmp33_ = self->priv->signal_map;
	_tmp34_ = self->priv->_source;
	_tmp35_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp34_, "updated", (GCallback) __views_label_source_row___lambda856__objects_base_object_updated, self, 0);
	_tmp36_ = self->priv->_source;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp33_, (gpointer) ((guintptr) _tmp35_), (GObject*) _tmp36_);
	_tmp37_ = self->priv->signal_map;
	_tmp38_ = add_button;
	_tmp39_ = g_signal_connect_object (_tmp38_, "clicked", (GCallback) __views_label_source_row___lambda857__gtk_button_clicked, self, 0);
	_tmp40_ = add_button;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp37_, (gpointer) ((guintptr) _tmp39_), (GObject*) _tmp40_);
	_tmp41_ = self->priv->signal_map;
	_tmp42_ = self->priv->group;
	_tmp43_ = g_signal_connect_object (_tmp42_, "row-activated", (GCallback) __views_label_source_row___lambda858__layouts_header_item_row_activated, self, 0);
	_tmp44_ = self->priv->group;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp41_, (gpointer) ((guintptr) _tmp43_), (GObject*) _tmp44_);
	_tmp45_ = self->priv->signal_map;
	_tmp46_ = services_store_instance ();
	_tmp47_ = g_signal_connect_object (_tmp46_, "label-added", (GCallback) __views_label_source_row___lambda859__services_store_label_added, self, 0);
	_tmp48_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp45_, (gpointer) ((guintptr) _tmp47_), (GObject*) _tmp48_);
	_tmp49_ = self->priv->signal_map;
	_tmp50_ = services_store_instance ();
	_tmp51_ = g_signal_connect_object (_tmp50_, "label-deleted", (GCallback) __views_label_source_row___lambda860__services_store_label_deleted, self, 0);
	_tmp52_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp49_, (gpointer) ((guintptr) _tmp51_), (GObject*) _tmp52_);
	_tmp53_ = self->priv->signal_map;
	_tmp54_ = services_settings_get_default ();
	_tmp55_ = _tmp54_;
	_tmp56_ = _tmp55_->settings;
	_tmp57_ = g_signal_connect_object (_tmp56_, "changed::labels-show-active-only", (GCallback) __views_label_source_row___lambda861__g_settings_changed, self, 0);
	_tmp58_ = services_settings_get_default ();
	_tmp59_ = _tmp58_;
	_tmp60_ = _tmp59_->settings;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp53_, (gpointer) ((guintptr) _tmp57_), (GObject*) _tmp60_);
	_g_object_unref0 (_tmp59_);
	_g_object_unref0 (_tmp55_);
	_tmp61_ = self->priv->signal_map;
	_tmp62_ = services_store_instance ();
	_tmp63_ = g_signal_connect_object (_tmp62_, "project-archived", (GCallback) __views_label_source_row___lambda862__services_store_project_archived, self, 0);
	_tmp64_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp61_, (gpointer) ((guintptr) _tmp63_), (GObject*) _tmp64_);
	_tmp65_ = self->priv->signal_map;
	_tmp66_ = services_store_instance ();
	_tmp67_ = g_signal_connect_object (_tmp66_, "project-unarchived", (GCallback) __views_label_source_row___lambda863__services_store_project_unarchived, self, 0);
	_tmp68_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp65_, (gpointer) ((guintptr) _tmp67_), (GObject*) _tmp68_);
	_tmp69_ = self->priv->_source;
	g_signal_connect_object ((ObjectsBaseObject*) _tmp69_, "updated", (GCallback) __views_label_source_row___lambda864__objects_base_object_updated, self, 0);
	_g_object_unref0 (add_button);
	return obj;
}

static void
views_label_source_row_class_init (ViewsLabelSourceRowClass * klass,
                                   gpointer klass_data)
{
	views_label_source_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ViewsLabelSourceRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_views_label_source_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_views_label_source_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = views_label_source_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = views_label_source_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VIEWS_LABEL_SOURCE_ROW_SOURCE_PROPERTY, views_label_source_row_properties[VIEWS_LABEL_SOURCE_ROW_SOURCE_PROPERTY] = g_param_spec_object ("source", "source", "source", OBJECTS_TYPE_SOURCE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
views_label_source_row_instance_init (ViewsLabelSourceRow * self,
                                      gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = views_label_source_row_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, LAYOUTS_TYPE_LABEL_ROW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->labels_hashmap = _tmp0_;
	_tmp1_ = 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 = _tmp1_;
}

static void
views_label_source_row_finalize (GObject * obj)
{
	ViewsLabelSourceRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VIEWS_TYPE_LABEL_SOURCE_ROW, ViewsLabelSourceRow);
	g_debug ("LabelSourceRow.vala:38: Destroying - Views.LabelSourceRow\n");
	_g_object_unref0 (self->priv->_source);
	_g_object_unref0 (self->priv->group);
	_g_object_unref0 (self->priv->main_revealer);
	_g_object_unref0 (self->priv->labels_hashmap);
	_g_object_unref0 (self->priv->signal_map);
	G_OBJECT_CLASS (views_label_source_row_parent_class)->finalize (obj);
}

static GType
views_label_source_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ViewsLabelSourceRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) views_label_source_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ViewsLabelSourceRow), 0, (GInstanceInitFunc) views_label_source_row_instance_init, NULL };
	GType views_label_source_row_type_id;
	views_label_source_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "ViewsLabelSourceRow", &g_define_type_info, 0);
	ViewsLabelSourceRow_private_offset = g_type_add_instance_private (views_label_source_row_type_id, sizeof (ViewsLabelSourceRowPrivate));
	return views_label_source_row_type_id;
}

GType
views_label_source_row_get_type (void)
{
	static volatile gsize views_label_source_row_type_id__once = 0;
	if (g_once_init_enter (&views_label_source_row_type_id__once)) {
		GType views_label_source_row_type_id;
		views_label_source_row_type_id = views_label_source_row_get_type_once ();
		g_once_init_leave (&views_label_source_row_type_id__once, views_label_source_row_type_id);
	}
	return views_label_source_row_type_id__once;
}

static void
_vala_views_label_source_row_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	ViewsLabelSourceRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VIEWS_TYPE_LABEL_SOURCE_ROW, ViewsLabelSourceRow);
	switch (property_id) {
		case VIEWS_LABEL_SOURCE_ROW_SOURCE_PROPERTY:
		g_value_set_object (value, views_label_source_row_get_source (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_views_label_source_row_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec)
{
	ViewsLabelSourceRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VIEWS_TYPE_LABEL_SOURCE_ROW, ViewsLabelSourceRow);
	switch (property_id) {
		case VIEWS_LABEL_SOURCE_ROW_SOURCE_PROPERTY:
		views_label_source_row_set_source (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);
}

