/* FilterPaneChild.c generated by valac 0.56.19, the Vala compiler
 * generated from FilterPaneChild.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 <glib.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <pango/pango.h>
#include <adwaita.h>
#include <float.h>
#include <math.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#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 LAYOUTS_TYPE_FILTER_PANE_CHILD (layouts_filter_pane_child_get_type ())
#define LAYOUTS_FILTER_PANE_CHILD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LAYOUTS_TYPE_FILTER_PANE_CHILD, LayoutsFilterPaneChild))
#define LAYOUTS_FILTER_PANE_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LAYOUTS_TYPE_FILTER_PANE_CHILD, LayoutsFilterPaneChildClass))
#define LAYOUTS_IS_FILTER_PANE_CHILD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LAYOUTS_TYPE_FILTER_PANE_CHILD))
#define LAYOUTS_IS_FILTER_PANE_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LAYOUTS_TYPE_FILTER_PANE_CHILD))
#define LAYOUTS_FILTER_PANE_CHILD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LAYOUTS_TYPE_FILTER_PANE_CHILD, LayoutsFilterPaneChildClass))

typedef struct _LayoutsFilterPaneChild LayoutsFilterPaneChild;
typedef struct _LayoutsFilterPaneChildClass LayoutsFilterPaneChildClass;
typedef struct _LayoutsFilterPaneChildPrivate LayoutsFilterPaneChildPrivate;
enum  {
	LAYOUTS_FILTER_PANE_CHILD_0_PROPERTY,
	LAYOUTS_FILTER_PANE_CHILD_FILTER_TYPE_PROPERTY,
	LAYOUTS_FILTER_PANE_CHILD_NUM_PROPERTIES
};
static GParamSpec* layouts_filter_pane_child_properties[LAYOUTS_FILTER_PANE_CHILD_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))
typedef struct _Block17Data Block17Data;

struct _LayoutsFilterPaneChild {
	GtkFlowBoxChild parent_instance;
	LayoutsFilterPaneChildPrivate * priv;
};

struct _LayoutsFilterPaneChildClass {
	GtkFlowBoxChildClass parent_class;
};

struct _LayoutsFilterPaneChildPrivate {
	ObjectsBaseObject* _filter_type;
	GtkLabel* count_label;
	GtkRevealer* indicator_revealer;
	ObjectsProject* current_inbox_project;
	gulong inbox_count_signal_id;
	GeeHashMap* signals_map;
};

struct _Block17Data {
	int _ref_count_;
	LayoutsFilterPaneChild* self;
	ObjectsFiltersToday* today_filter;
};

static gint LayoutsFilterPaneChild_private_offset;
static gpointer layouts_filter_pane_child_parent_class = NULL;

VALA_EXTERN GType layouts_filter_pane_child_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LayoutsFilterPaneChild, g_object_unref)
VALA_EXTERN LayoutsFilterPaneChild* layouts_filter_pane_child_new (ObjectsBaseObject* filter_type);
VALA_EXTERN LayoutsFilterPaneChild* layouts_filter_pane_child_construct (GType object_type,
                                                             ObjectsBaseObject* filter_type);
static void layouts_filter_pane_child_update_count_label (LayoutsFilterPaneChild* self,
                                                   gint count);
VALA_EXTERN void layouts_filter_pane_child_init_badge_count (LayoutsFilterPaneChild* self);
VALA_EXTERN ObjectsBaseObject* layouts_filter_pane_child_get_filter_type (LayoutsFilterPaneChild* self);
static void layouts_filter_pane_child_init_inbox_count (LayoutsFilterPaneChild* self);
static void ___lambda486_ (LayoutsFilterPaneChild* self);
static void ____lambda486__g_settings_changed (GSettings* _sender,
                                        const gchar* key,
                                        gpointer self);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
static void ____lambda487_ (Block17Data* _data17_);
static void _____lambda487__objects_base_object_count_updated (ObjectsBaseObject* _sender,
                                                        gpointer self);
static void ____lambda488_ (LayoutsFilterPaneChild* self);
static void _____lambda488__objects_base_object_count_updated (ObjectsBaseObject* _sender,
                                                        gpointer self);
static void __lambda485_ (LayoutsFilterPaneChild* self);
static void ___lambda485__objects_base_object_count_updated (ObjectsBaseObject* _sender,
                                                      gpointer self);
VALA_EXTERN gint layouts_filter_pane_child_item_order (LayoutsFilterPaneChild* self);
static gint layouts_filter_pane_child_find_index (LayoutsFilterPaneChild* self,
                                           gchar** array,
                                           gint array_length1,
                                           const gchar* elemento);
VALA_EXTERN gboolean layouts_filter_pane_child_active (LayoutsFilterPaneChild* self);
VALA_EXTERN void layouts_filter_pane_child_clean_up (LayoutsFilterPaneChild* self);
static void layouts_filter_pane_child_set_filter_type (LayoutsFilterPaneChild* self,
                                                ObjectsBaseObject* value);
static GObject * layouts_filter_pane_child_constructor (GType type,
                                                 guint n_construct_properties,
                                                 GObjectConstructParam * construct_properties);
static void _layouts_filter_pane_child___lambda489_ (LayoutsFilterPaneChild* self);
static void __layouts_filter_pane_child___lambda489__services_event_bus_theme_changed (ServicesEventBus* _sender,
                                                                                gpointer self);
static void _layouts_filter_pane_child___lambda490_ (LayoutsFilterPaneChild* self);
static void __layouts_filter_pane_child___lambda490__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                         gint n_press,
                                                                         gdouble x,
                                                                         gdouble y,
                                                                         gpointer self);
static void _layouts_filter_pane_child___lambda491_ (LayoutsFilterPaneChild* self,
                                              PaneType pane_type,
                                              const gchar* id);
static gboolean ____lambda492_ (LayoutsFilterPaneChild* self);
static gboolean _____lambda492__gsource_func (gpointer self);
static void __layouts_filter_pane_child___lambda491__services_event_bus_pane_selected (ServicesEventBus* _sender,
                                                                                PaneType panel_type,
                                                                                const gchar* id,
                                                                                gpointer self);
static void _layouts_filter_pane_child___lambda493_ (LayoutsFilterPaneChild* self);
static void __layouts_filter_pane_child___lambda493__services_database_opened (ServicesDatabase* _sender,
                                                                        gpointer self);
static void layouts_filter_pane_child_finalize (GObject * obj);
static GType layouts_filter_pane_child_get_type_once (void);
static void _vala_layouts_filter_pane_child_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_layouts_filter_pane_child_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 gssize _vala_array_length (gpointer array);

static inline gpointer
layouts_filter_pane_child_get_instance_private (LayoutsFilterPaneChild* self)
{
	return G_STRUCT_MEMBER_P (self, LayoutsFilterPaneChild_private_offset);
}

LayoutsFilterPaneChild*
layouts_filter_pane_child_construct (GType object_type,
                                     ObjectsBaseObject* filter_type)
{
	LayoutsFilterPaneChild * self = NULL;
	g_return_val_if_fail (filter_type != NULL, NULL);
	self = (LayoutsFilterPaneChild*) g_object_new (object_type, "filter-type", filter_type, NULL);
	return self;
}

LayoutsFilterPaneChild*
layouts_filter_pane_child_new (ObjectsBaseObject* filter_type)
{
	return layouts_filter_pane_child_construct (LAYOUTS_TYPE_FILTER_PANE_CHILD, filter_type);
}

static void
layouts_filter_pane_child_update_count_label (LayoutsFilterPaneChild* self,
                                              gint count)
{
	gchar* _tmp0_ = NULL;
	GtkLabel* _tmp3_;
	g_return_if_fail (self != NULL);
	if (count <= 0) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("");
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp1_;
	} else {
		gchar* _tmp2_;
		_tmp2_ = g_strdup_printf ("%i", count);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp2_;
	}
	_tmp3_ = self->priv->count_label;
	gtk_label_set_label (_tmp3_, _tmp0_);
	_g_free0 (_tmp0_);
}

static void
___lambda486_ (LayoutsFilterPaneChild* self)
{
	layouts_filter_pane_child_init_inbox_count (self);
}

static void
____lambda486__g_settings_changed (GSettings* _sender,
                                   const gchar* key,
                                   gpointer self)
{
	___lambda486_ ((LayoutsFilterPaneChild*) self);
}

static Block17Data*
block17_data_ref (Block17Data* _data17_)
{
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}

static void
block17_data_unref (void * _userdata_)
{
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		LayoutsFilterPaneChild* self;
		self = _data17_->self;
		_g_object_unref0 (_data17_->today_filter);
		_g_object_unref0 (self);
		g_slice_free (Block17Data, _data17_);
	}
}

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

static void
____lambda487_ (Block17Data* _data17_)
{
	LayoutsFilterPaneChild* self;
	ObjectsFiltersToday* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	ObjectsFiltersToday* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	GtkRevealer* _tmp6_;
	ObjectsFiltersToday* _tmp7_;
	gint _tmp8_;
	gint _tmp9_;
	self = _data17_->self;
	_tmp0_ = _data17_->today_filter;
	_tmp1_ = objects_base_object_get_item_count ((ObjectsBaseObject*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _data17_->today_filter;
	_tmp4_ = objects_filters_today_get_overdeue_count (_tmp3_);
	_tmp5_ = _tmp4_;
	layouts_filter_pane_child_update_count_label (self, _tmp2_ + _tmp5_);
	_tmp6_ = self->priv->indicator_revealer;
	_tmp7_ = _data17_->today_filter;
	_tmp8_ = objects_filters_today_get_overdeue_count (_tmp7_);
	_tmp9_ = _tmp8_;
	gtk_revealer_set_reveal_child (_tmp6_, _tmp9_ > 0);
}

static void
_____lambda487__objects_base_object_count_updated (ObjectsBaseObject* _sender,
                                                   gpointer self)
{
	____lambda487_ (self);
}

static void
____lambda488_ (LayoutsFilterPaneChild* self)
{
	ObjectsBaseObject* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	_tmp0_ = self->priv->_filter_type;
	_tmp1_ = objects_base_object_get_item_count (_tmp0_);
	_tmp2_ = _tmp1_;
	layouts_filter_pane_child_update_count_label (self, _tmp2_);
}

static void
_____lambda488__objects_base_object_count_updated (ObjectsBaseObject* _sender,
                                                   gpointer self)
{
	____lambda488_ ((LayoutsFilterPaneChild*) self);
}

void
layouts_filter_pane_child_init_badge_count (LayoutsFilterPaneChild* self)
{
	ObjectsBaseObject* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_filter_type;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, OBJECTS_FILTERS_TYPE_INBOX)) {
		ServicesSettings* _tmp1_;
		ServicesSettings* _tmp2_;
		GSettings* _tmp3_;
		layouts_filter_pane_child_init_inbox_count (self);
		_tmp1_ = services_settings_get_default ();
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_->settings;
		g_signal_connect_object (_tmp3_, "changed::local-inbox-project-id", (GCallback) ____lambda486__g_settings_changed, self, 0);
		_g_object_unref0 (_tmp2_);
	} else {
		ObjectsBaseObject* _tmp4_;
		_tmp4_ = self->priv->_filter_type;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, OBJECTS_FILTERS_TYPE_TODAY)) {
			Block17Data* _data17_;
			ObjectsBaseObject* _tmp5_;
			ObjectsFiltersToday* _tmp6_;
			ObjectsFiltersToday* _tmp7_;
			gint _tmp8_;
			gint _tmp9_;
			ObjectsFiltersToday* _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			GtkRevealer* _tmp13_;
			ObjectsFiltersToday* _tmp14_;
			gint _tmp15_;
			gint _tmp16_;
			GeeHashMap* _tmp17_;
			ObjectsFiltersToday* _tmp18_;
			ObjectsFiltersToday* _tmp19_;
			gulong _tmp20_;
			ObjectsFiltersToday* _tmp21_;
			ObjectsFiltersToday* _tmp22_;
			_data17_ = g_slice_new0 (Block17Data);
			_data17_->_ref_count_ = 1;
			_data17_->self = g_object_ref (self);
			_tmp5_ = self->priv->_filter_type;
			_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, OBJECTS_FILTERS_TYPE_TODAY) ? ((ObjectsFiltersToday*) _tmp5_) : NULL);
			_data17_->today_filter = _tmp6_;
			_tmp7_ = _data17_->today_filter;
			_tmp8_ = objects_base_object_get_item_count ((ObjectsBaseObject*) _tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = _data17_->today_filter;
			_tmp11_ = objects_filters_today_get_overdeue_count (_tmp10_);
			_tmp12_ = _tmp11_;
			layouts_filter_pane_child_update_count_label (self, _tmp9_ + _tmp12_);
			_tmp13_ = self->priv->indicator_revealer;
			_tmp14_ = _data17_->today_filter;
			_tmp15_ = objects_filters_today_get_overdeue_count (_tmp14_);
			_tmp16_ = _tmp15_;
			gtk_revealer_set_reveal_child (_tmp13_, _tmp16_ > 0);
			_tmp17_ = self->priv->signals_map;
			_tmp18_ = objects_filters_today_get_default ();
			_tmp19_ = _tmp18_;
			_tmp20_ = g_signal_connect_data ((ObjectsBaseObject*) _tmp19_, "count-updated", (GCallback) _____lambda487__objects_base_object_count_updated, block17_data_ref (_data17_), (GClosureNotify) block17_data_unref, 0);
			_tmp21_ = objects_filters_today_get_default ();
			_tmp22_ = _tmp21_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp17_, (gpointer) ((guintptr) _tmp20_), (GObject*) _tmp22_);
			_g_object_unref0 (_tmp22_);
			_g_object_unref0 (_tmp19_);
			block17_data_unref (_data17_);
			_data17_ = NULL;
		} else {
			ObjectsBaseObject* _tmp23_;
			gint _tmp24_;
			gint _tmp25_;
			GeeHashMap* _tmp26_;
			ObjectsBaseObject* _tmp27_;
			gulong _tmp28_;
			ObjectsBaseObject* _tmp29_;
			_tmp23_ = self->priv->_filter_type;
			_tmp24_ = objects_base_object_get_item_count (_tmp23_);
			_tmp25_ = _tmp24_;
			layouts_filter_pane_child_update_count_label (self, _tmp25_);
			_tmp26_ = self->priv->signals_map;
			_tmp27_ = self->priv->_filter_type;
			_tmp28_ = g_signal_connect_object (_tmp27_, "count-updated", (GCallback) _____lambda488__objects_base_object_count_updated, self, 0);
			_tmp29_ = self->priv->_filter_type;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp26_, (gpointer) ((guintptr) _tmp28_), (GObject*) _tmp29_);
		}
	}
}

static void
__lambda485_ (LayoutsFilterPaneChild* self)
{
	ObjectsProject* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	_tmp0_ = self->priv->current_inbox_project;
	_tmp1_ = objects_base_object_get_item_count ((ObjectsBaseObject*) _tmp0_);
	_tmp2_ = _tmp1_;
	layouts_filter_pane_child_update_count_label (self, _tmp2_);
}

static void
___lambda485__objects_base_object_count_updated (ObjectsBaseObject* _sender,
                                                 gpointer self)
{
	__lambda485_ ((LayoutsFilterPaneChild*) self);
}

static void
layouts_filter_pane_child_init_inbox_count (LayoutsFilterPaneChild* self)
{
	gboolean _tmp0_ = FALSE;
	ObjectsProject* _tmp1_;
	ServicesStore* _tmp3_;
	ServicesSettings* _tmp4_;
	ServicesSettings* _tmp5_;
	GSettings* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	ObjectsProject* _tmp9_;
	ObjectsProject* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	ObjectsProject* _tmp13_;
	gulong _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->current_inbox_project;
	if (_tmp1_ != NULL) {
		_tmp0_ = self->priv->inbox_count_signal_id > ((gulong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		ObjectsProject* _tmp2_;
		_tmp2_ = self->priv->current_inbox_project;
		g_signal_handler_disconnect ((GObject*) _tmp2_, self->priv->inbox_count_signal_id);
	}
	_tmp3_ = services_store_instance ();
	_tmp4_ = services_settings_get_default ();
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_->settings;
	_tmp7_ = g_settings_get_string (_tmp6_, "local-inbox-project-id");
	_tmp8_ = _tmp7_;
	_tmp9_ = services_store_get_project (_tmp3_, _tmp8_);
	_g_object_unref0 (self->priv->current_inbox_project);
	self->priv->current_inbox_project = _tmp9_;
	_g_free0 (_tmp8_);
	_g_object_unref0 (_tmp5_);
	_tmp10_ = self->priv->current_inbox_project;
	_tmp11_ = objects_base_object_get_item_count ((ObjectsBaseObject*) _tmp10_);
	_tmp12_ = _tmp11_;
	layouts_filter_pane_child_update_count_label (self, _tmp12_);
	_tmp13_ = self->priv->current_inbox_project;
	_tmp14_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp13_, "count-updated", (GCallback) ___lambda485__objects_base_object_count_updated, self, 0);
	self->priv->inbox_count_signal_id = _tmp14_;
}

gint
layouts_filter_pane_child_item_order (LayoutsFilterPaneChild* self)
{
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gchar** _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	ObjectsBaseObject* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gint _tmp9_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp4_ = _tmp3_ = g_settings_get_strv (_tmp2_, "views-order-visible");
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _vala_array_length (_tmp3_);
	_tmp6_ = self->priv->_filter_type;
	_tmp7_ = objects_base_object_get_view_id (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = layouts_filter_pane_child_find_index (self, _tmp5_, (gint) _vala_array_length (_tmp3_), _tmp8_);
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (_tmp1_);
	result = _tmp9_;
	return result;
}

gboolean
layouts_filter_pane_child_active (LayoutsFilterPaneChild* self)
{
	gchar** views_order = NULL;
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gchar** _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gint views_order_length1;
	gint _views_order_size_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp4_ = _tmp3_ = g_settings_get_strv (_tmp2_, "views-order-visible");
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _vala_array_length (_tmp3_);
	_g_object_unref0 (_tmp1_);
	views_order = _tmp5_;
	views_order_length1 = _tmp5__length1;
	_views_order_size_ = views_order_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				gchar** _tmp8_;
				gint _tmp8__length1;
				gchar** _tmp9_;
				gint _tmp9__length1;
				const gchar* _tmp10_;
				ObjectsBaseObject* _tmp11_;
				const gchar* _tmp12_;
				const gchar* _tmp13_;
				if (!_tmp6_) {
					gint _tmp7_;
					_tmp7_ = i;
					i = _tmp7_ + 1;
				}
				_tmp6_ = FALSE;
				_tmp8_ = views_order;
				_tmp8__length1 = views_order_length1;
				if (!(i < _tmp8__length1)) {
					break;
				}
				_tmp9_ = views_order;
				_tmp9__length1 = views_order_length1;
				_tmp10_ = _tmp9_[i];
				_tmp11_ = self->priv->_filter_type;
				_tmp12_ = objects_base_object_get_view_id (_tmp11_);
				_tmp13_ = _tmp12_;
				if (g_strcmp0 (_tmp10_, _tmp13_) == 0) {
					result = TRUE;
					views_order = (_vala_array_free (views_order, views_order_length1, (GDestroyNotify) g_free), NULL);
					return result;
				}
			}
		}
	}
	result = FALSE;
	views_order = (_vala_array_free (views_order, views_order_length1, (GDestroyNotify) g_free), NULL);
	return result;
}

static gint
layouts_filter_pane_child_find_index (LayoutsFilterPaneChild* self,
                                      gchar** array,
                                      gint array_length1,
                                      const gchar* elemento)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (elemento != NULL, -1);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				const gchar* _tmp2_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < array_length1)) {
					break;
				}
				_tmp2_ = array[i];
				if (g_strcmp0 (_tmp2_, elemento) == 0) {
					result = i;
					return result;
				}
			}
		}
	}
	result = -1;
	return result;
}

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

ObjectsBaseObject*
layouts_filter_pane_child_get_filter_type (LayoutsFilterPaneChild* self)
{
	ObjectsBaseObject* result;
	ObjectsBaseObject* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_filter_type;
	result = _tmp0_;
	return result;
}

static void
layouts_filter_pane_child_set_filter_type (LayoutsFilterPaneChild* self,
                                           ObjectsBaseObject* value)
{
	ObjectsBaseObject* old_value;
	g_return_if_fail (self != NULL);
	old_value = layouts_filter_pane_child_get_filter_type (self);
	if (old_value != value) {
		ObjectsBaseObject* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_filter_type);
		self->priv->_filter_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, layouts_filter_pane_child_properties[LAYOUTS_FILTER_PANE_CHILD_FILTER_TYPE_PROPERTY]);
	}
}

static void
_layouts_filter_pane_child___lambda489_ (LayoutsFilterPaneChild* self)
{
	Util* _tmp0_;
	Util* _tmp1_;
	ObjectsBaseObject* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_filter_type;
	_tmp3_ = objects_base_object_theme_color (_tmp2_);
	_tmp4_ = _tmp3_;
	util_set_widget_color (_tmp1_, _tmp4_, (GtkWidget*) self);
	_g_free0 (_tmp4_);
	_g_object_unref0 (_tmp1_);
}

static void
__layouts_filter_pane_child___lambda489__services_event_bus_theme_changed (ServicesEventBus* _sender,
                                                                           gpointer self)
{
	_layouts_filter_pane_child___lambda489_ ((LayoutsFilterPaneChild*) self);
}

static void
_layouts_filter_pane_child___lambda490_ (LayoutsFilterPaneChild* self)
{
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	ObjectsBaseObject* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_filter_type;
	_tmp3_ = objects_base_object_get_view_id (_tmp2_);
	_tmp4_ = _tmp3_;
	g_signal_emit_by_name (_tmp1_, "pane-selected", PANE_TYPE_FILTER, _tmp4_);
	_g_object_unref0 (_tmp1_);
}

static void
__layouts_filter_pane_child___lambda490__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                    gint n_press,
                                                                    gdouble x,
                                                                    gdouble y,
                                                                    gpointer self)
{
	_layouts_filter_pane_child___lambda490_ ((LayoutsFilterPaneChild*) self);
}

static gboolean
____lambda492_ (LayoutsFilterPaneChild* self)
{
	gboolean result;
	gtk_widget_remove_css_class ((GtkWidget*) self, "animation");
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
_____lambda492__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda492_ ((LayoutsFilterPaneChild*) self);
	return result;
}

static void
_layouts_filter_pane_child___lambda491_ (LayoutsFilterPaneChild* self,
                                         PaneType pane_type,
                                         const gchar* id)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (id != NULL);
	if (pane_type == PANE_TYPE_FILTER) {
		ObjectsBaseObject* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp1_ = self->priv->_filter_type;
		_tmp2_ = objects_base_object_get_view_id (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = g_strcmp0 (_tmp3_, id) == 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gtk_widget_add_css_class ((GtkWidget*) self, "selected");
		if (!gtk_widget_has_css_class ((GtkWidget*) self, "animation")) {
			gtk_widget_add_css_class ((GtkWidget*) self, "animation");
			g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 700, _____lambda492__gsource_func, g_object_ref (self), g_object_unref);
		}
	} else {
		gtk_widget_remove_css_class ((GtkWidget*) self, "selected");
	}
}

static void
__layouts_filter_pane_child___lambda491__services_event_bus_pane_selected (ServicesEventBus* _sender,
                                                                           PaneType panel_type,
                                                                           const gchar* id,
                                                                           gpointer self)
{
	_layouts_filter_pane_child___lambda491_ ((LayoutsFilterPaneChild*) self, panel_type, id);
}

static void
_layouts_filter_pane_child___lambda493_ (LayoutsFilterPaneChild* self)
{
	layouts_filter_pane_child_init_badge_count (self);
}

static void
__layouts_filter_pane_child___lambda493__services_database_opened (ServicesDatabase* _sender,
                                                                   gpointer self)
{
	_layouts_filter_pane_child___lambda493_ ((LayoutsFilterPaneChild*) self);
}

static GObject *
layouts_filter_pane_child_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	LayoutsFilterPaneChild * self;
	GtkImage* title_image = NULL;
	ObjectsBaseObject* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkImage* _tmp3_ = NULL;
	GtkLabel* title_label = NULL;
	ObjectsBaseObject* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GtkLabel* _tmp7_ = NULL;
	AdwBin* indicator_widget = NULL;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar** _tmp10_;
	AdwBin* _tmp11_ = NULL;
	AdwBin* _tmp12_;
	GtkWidget* _tmp13_;
	GtkRevealer* _tmp14_ = NULL;
	GtkBox* title_box = NULL;
	GtkBox* _tmp15_;
	GtkBox* _tmp16_;
	GtkLabel* _tmp17_;
	GtkBox* _tmp18_;
	GtkRevealer* _tmp19_;
	gchar* _tmp20_;
	gchar** _tmp21_;
	GtkLabel* _tmp22_ = NULL;
	GtkRevealer* count_revealer = NULL;
	GtkLabel* _tmp23_;
	GtkWidget* _tmp24_;
	GtkRevealer* _tmp25_ = NULL;
	GtkGrid* main_grid = NULL;
	GtkGrid* _tmp26_ = NULL;
	GtkGrid* _tmp27_;
	GtkImage* _tmp28_;
	GtkGrid* _tmp29_;
	GtkRevealer* _tmp30_;
	GtkGrid* _tmp31_;
	GtkBox* _tmp32_;
	GtkGrid* _tmp33_;
	ServicesSettings* _tmp34_;
	ServicesSettings* _tmp35_;
	GSettings* _tmp36_;
	GtkRevealer* _tmp37_;
	Util* _tmp38_;
	Util* _tmp39_;
	ObjectsBaseObject* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	GeeHashMap* _tmp43_;
	ServicesEventBus* _tmp44_;
	ServicesEventBus* _tmp45_;
	gulong _tmp46_;
	ServicesEventBus* _tmp47_;
	ServicesEventBus* _tmp48_;
	GtkGestureClick* select_gesture = NULL;
	GtkGestureClick* _tmp49_;
	GtkGestureClick* _tmp50_;
	GtkEventController* _tmp51_;
	GeeHashMap* _tmp52_;
	GtkGestureClick* _tmp53_;
	gulong _tmp54_;
	GtkGestureClick* _tmp55_;
	GeeHashMap* _tmp56_;
	ServicesEventBus* _tmp57_;
	ServicesEventBus* _tmp58_;
	gulong _tmp59_;
	ServicesEventBus* _tmp60_;
	ServicesEventBus* _tmp61_;
	ServicesDatabase* _tmp62_;
	ServicesDatabase* _tmp63_;
	gboolean _tmp64_;
	gboolean _tmp65_;
	gboolean _tmp66_;
	GeeHashMap* _tmp67_;
	ServicesDatabase* _tmp68_;
	ServicesDatabase* _tmp69_;
	gulong _tmp70_;
	ServicesDatabase* _tmp71_;
	ServicesDatabase* _tmp72_;
	parent_class = G_OBJECT_CLASS (layouts_filter_pane_child_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LAYOUTS_TYPE_FILTER_PANE_CHILD, LayoutsFilterPaneChild);
	_tmp0_ = self->priv->_filter_type;
	_tmp1_ = objects_base_object_get_icon_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = (GtkImage*) gtk_image_new_from_icon_name (_tmp2_);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp3_, 3);
	g_object_ref_sink (_tmp3_);
	title_image = _tmp3_;
	_tmp4_ = self->priv->_filter_type;
	_tmp5_ = objects_base_object_get_name (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = (GtkLabel*) gtk_label_new (_tmp6_);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp7_, 3);
	gtk_label_set_ellipsize (_tmp7_, PANGO_ELLIPSIZE_END);
	g_object_ref_sink (_tmp7_);
	title_label = _tmp7_;
	_tmp8_ = g_strdup ("indicator");
	_tmp9_ = g_strdup ("bg-danger");
	_tmp10_ = g_new0 (gchar*, 2 + 1);
	_tmp10_[0] = _tmp8_;
	_tmp10_[1] = _tmp9_;
	_tmp11_ = (AdwBin*) adw_bin_new ();
	g_object_set ((GtkWidget*) _tmp11_, "width-request", 9, NULL);
	g_object_set ((GtkWidget*) _tmp11_, "height-request", 9, NULL);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp11_, 3);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp11_, 3);
	gtk_widget_set_valign ((GtkWidget*) _tmp11_, GTK_ALIGN_END);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp11_, _tmp10_);
	_tmp10_ = (_vala_array_free (_tmp10_, 2, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp11_);
	indicator_widget = _tmp11_;
	_tmp12_ = indicator_widget;
	_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_widget_set_hexpand ((GtkWidget*) _tmp14_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp14_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp14_);
	_g_object_unref0 (self->priv->indicator_revealer);
	self->priv->indicator_revealer = _tmp14_;
	_tmp15_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp15_);
	title_box = _tmp15_;
	_tmp16_ = title_box;
	_tmp17_ = title_label;
	gtk_box_append (_tmp16_, (GtkWidget*) _tmp17_);
	_tmp18_ = title_box;
	_tmp19_ = self->priv->indicator_revealer;
	gtk_box_append (_tmp18_, (GtkWidget*) _tmp19_);
	_tmp20_ = g_strdup ("font-bold");
	_tmp21_ = g_new0 (gchar*, 1 + 1);
	_tmp21_[0] = _tmp20_;
	_tmp22_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp22_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp22_, GTK_ALIGN_END);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp22_, 3);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp22_, _tmp21_);
	_tmp21_ = (_vala_array_free (_tmp21_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->count_label);
	self->priv->count_label = _tmp22_;
	_tmp23_ = self->priv->count_label;
	_tmp24_ = _g_object_ref0 ((GtkWidget*) _tmp23_);
	_tmp25_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp25_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_revealer_set_child (_tmp25_, _tmp24_);
	_g_object_unref0 (_tmp24_);
	g_object_ref_sink (_tmp25_);
	count_revealer = _tmp25_;
	_tmp26_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp26_, 6);
	gtk_grid_set_row_spacing (_tmp26_, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp26_, 3);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp26_, 3);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp26_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp26_, 3);
	g_object_ref_sink (_tmp26_);
	main_grid = _tmp26_;
	_tmp27_ = main_grid;
	_tmp28_ = title_image;
	gtk_grid_attach (_tmp27_, (GtkWidget*) _tmp28_, 0, 0, 1, 1);
	_tmp29_ = main_grid;
	_tmp30_ = count_revealer;
	gtk_grid_attach (_tmp29_, (GtkWidget*) _tmp30_, 1, 0, 1, 1);
	_tmp31_ = main_grid;
	_tmp32_ = title_box;
	gtk_grid_attach (_tmp31_, (GtkWidget*) _tmp32_, 0, 1, 2, 2);
	_tmp33_ = main_grid;
	gtk_flow_box_child_set_child ((GtkFlowBoxChild*) self, (GtkWidget*) _tmp33_);
	gtk_widget_add_css_class ((GtkWidget*) self, "filter-pane-child");
	_tmp34_ = services_settings_get_default ();
	_tmp35_ = _tmp34_;
	_tmp36_ = _tmp35_->settings;
	_tmp37_ = count_revealer;
	g_settings_bind (_tmp36_, "show-tasks-count", (GObject*) _tmp37_, "reveal_child", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (_tmp35_);
	_tmp38_ = util_get_default ();
	_tmp39_ = _tmp38_;
	_tmp40_ = self->priv->_filter_type;
	_tmp41_ = objects_base_object_theme_color (_tmp40_);
	_tmp42_ = _tmp41_;
	util_set_widget_color (_tmp39_, _tmp42_, (GtkWidget*) self);
	_g_free0 (_tmp42_);
	_g_object_unref0 (_tmp39_);
	_tmp43_ = self->priv->signals_map;
	_tmp44_ = services_event_bus_get_default ();
	_tmp45_ = _tmp44_;
	_tmp46_ = g_signal_connect_object (_tmp45_, "theme-changed", (GCallback) __layouts_filter_pane_child___lambda489__services_event_bus_theme_changed, self, 0);
	_tmp47_ = services_event_bus_get_default ();
	_tmp48_ = _tmp47_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp43_, (gpointer) ((guintptr) _tmp46_), (GObject*) _tmp48_);
	_g_object_unref0 (_tmp48_);
	_g_object_unref0 (_tmp45_);
	_tmp49_ = (GtkGestureClick*) gtk_gesture_click_new ();
	select_gesture = _tmp49_;
	_tmp50_ = select_gesture;
	_tmp51_ = _g_object_ref0 ((GtkEventController*) _tmp50_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp51_);
	_tmp52_ = self->priv->signals_map;
	_tmp53_ = select_gesture;
	_tmp54_ = g_signal_connect_object (_tmp53_, "pressed", (GCallback) __layouts_filter_pane_child___lambda490__gtk_gesture_click_pressed, self, 0);
	_tmp55_ = select_gesture;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp52_, (gpointer) ((guintptr) _tmp54_), (GObject*) _tmp55_);
	_tmp56_ = self->priv->signals_map;
	_tmp57_ = services_event_bus_get_default ();
	_tmp58_ = _tmp57_;
	_tmp59_ = g_signal_connect_object (_tmp58_, "pane-selected", (GCallback) __layouts_filter_pane_child___lambda491__services_event_bus_pane_selected, self, 0);
	_tmp60_ = services_event_bus_get_default ();
	_tmp61_ = _tmp60_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp56_, (gpointer) ((guintptr) _tmp59_), (GObject*) _tmp61_);
	_g_object_unref0 (_tmp61_);
	_g_object_unref0 (_tmp58_);
	_tmp62_ = services_database_get_default ();
	_tmp63_ = _tmp62_;
	_tmp64_ = services_database_get_is_opened (_tmp63_);
	_tmp65_ = _tmp64_;
	_tmp66_ = _tmp65_;
	_g_object_unref0 (_tmp63_);
	if (_tmp66_) {
		layouts_filter_pane_child_init_badge_count (self);
	}
	_tmp67_ = self->priv->signals_map;
	_tmp68_ = services_database_get_default ();
	_tmp69_ = _tmp68_;
	_tmp70_ = g_signal_connect_object (_tmp69_, "opened", (GCallback) __layouts_filter_pane_child___lambda493__services_database_opened, self, 0);
	_tmp71_ = services_database_get_default ();
	_tmp72_ = _tmp71_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp67_, (gpointer) ((guintptr) _tmp70_), (GObject*) _tmp72_);
	_g_object_unref0 (_tmp72_);
	_g_object_unref0 (_tmp69_);
	_g_object_unref0 (select_gesture);
	_g_object_unref0 (main_grid);
	_g_object_unref0 (count_revealer);
	_g_object_unref0 (title_box);
	_g_object_unref0 (indicator_widget);
	_g_object_unref0 (title_label);
	_g_object_unref0 (title_image);
	return obj;
}

static void
layouts_filter_pane_child_class_init (LayoutsFilterPaneChildClass * klass,
                                      gpointer klass_data)
{
	layouts_filter_pane_child_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LayoutsFilterPaneChild_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_layouts_filter_pane_child_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_layouts_filter_pane_child_set_property;
	G_OBJECT_CLASS (klass)->constructor = layouts_filter_pane_child_constructor;
	G_OBJECT_CLASS (klass)->finalize = layouts_filter_pane_child_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_FILTER_PANE_CHILD_FILTER_TYPE_PROPERTY, layouts_filter_pane_child_properties[LAYOUTS_FILTER_PANE_CHILD_FILTER_TYPE_PROPERTY] = g_param_spec_object ("filter-type", "filter-type", "filter-type", OBJECTS_TYPE_BASE_OBJECT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
layouts_filter_pane_child_instance_init (LayoutsFilterPaneChild * self,
                                         gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = layouts_filter_pane_child_get_instance_private (self);
	self->priv->current_inbox_project = NULL;
	self->priv->inbox_count_signal_id = (gulong) 0;
	_tmp0_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->signals_map = _tmp0_;
}

static void
layouts_filter_pane_child_finalize (GObject * obj)
{
	LayoutsFilterPaneChild * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LAYOUTS_TYPE_FILTER_PANE_CHILD, LayoutsFilterPaneChild);
	g_debug ("FilterPaneChild.vala:39: Destroying Layouts.FilterPaneChild\n");
	_g_object_unref0 (self->priv->_filter_type);
	_g_object_unref0 (self->priv->count_label);
	_g_object_unref0 (self->priv->indicator_revealer);
	_g_object_unref0 (self->priv->current_inbox_project);
	_g_object_unref0 (self->priv->signals_map);
	G_OBJECT_CLASS (layouts_filter_pane_child_parent_class)->finalize (obj);
}

static GType
layouts_filter_pane_child_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LayoutsFilterPaneChildClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) layouts_filter_pane_child_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LayoutsFilterPaneChild), 0, (GInstanceInitFunc) layouts_filter_pane_child_instance_init, NULL };
	GType layouts_filter_pane_child_type_id;
	layouts_filter_pane_child_type_id = g_type_register_static (gtk_flow_box_child_get_type (), "LayoutsFilterPaneChild", &g_define_type_info, 0);
	LayoutsFilterPaneChild_private_offset = g_type_add_instance_private (layouts_filter_pane_child_type_id, sizeof (LayoutsFilterPaneChildPrivate));
	return layouts_filter_pane_child_type_id;
}

GType
layouts_filter_pane_child_get_type (void)
{
	static volatile gsize layouts_filter_pane_child_type_id__once = 0;
	if (g_once_init_enter (&layouts_filter_pane_child_type_id__once)) {
		GType layouts_filter_pane_child_type_id;
		layouts_filter_pane_child_type_id = layouts_filter_pane_child_get_type_once ();
		g_once_init_leave (&layouts_filter_pane_child_type_id__once, layouts_filter_pane_child_type_id);
	}
	return layouts_filter_pane_child_type_id__once;
}

static void
_vala_layouts_filter_pane_child_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	LayoutsFilterPaneChild * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, LAYOUTS_TYPE_FILTER_PANE_CHILD, LayoutsFilterPaneChild);
	switch (property_id) {
		case LAYOUTS_FILTER_PANE_CHILD_FILTER_TYPE_PROPERTY:
		g_value_set_object (value, layouts_filter_pane_child_get_filter_type (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_layouts_filter_pane_child_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	LayoutsFilterPaneChild * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, LAYOUTS_TYPE_FILTER_PANE_CHILD, LayoutsFilterPaneChild);
	switch (property_id) {
		case LAYOUTS_FILTER_PANE_CHILD_FILTER_TYPE_PROPERTY:
		layouts_filter_pane_child_set_filter_type (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);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

