/* FilterFlowBox.c generated by valac 0.56.19, the Vala compiler
 * generated from FilterFlowBox.vala, do not modify */

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include "planify.h"
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.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_FILTER_FLOW_BOX (widgets_filter_flow_box_get_type ())
#define WIDGETS_FILTER_FLOW_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_FILTER_FLOW_BOX, WidgetsFilterFlowBox))
#define WIDGETS_FILTER_FLOW_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_FILTER_FLOW_BOX, WidgetsFilterFlowBoxClass))
#define WIDGETS_IS_FILTER_FLOW_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_FILTER_FLOW_BOX))
#define WIDGETS_IS_FILTER_FLOW_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_FILTER_FLOW_BOX))
#define WIDGETS_FILTER_FLOW_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_FILTER_FLOW_BOX, WidgetsFilterFlowBoxClass))

typedef struct _WidgetsFilterFlowBox WidgetsFilterFlowBox;
typedef struct _WidgetsFilterFlowBoxClass WidgetsFilterFlowBoxClass;
typedef struct _WidgetsFilterFlowBoxPrivate WidgetsFilterFlowBoxPrivate;

#define WIDGETS_TYPE_FILTER_FLOW_BOX_CHILD (widgets_filter_flow_box_child_get_type ())
#define WIDGETS_FILTER_FLOW_BOX_CHILD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_FILTER_FLOW_BOX_CHILD, WidgetsFilterFlowBoxChild))
#define WIDGETS_FILTER_FLOW_BOX_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_FILTER_FLOW_BOX_CHILD, WidgetsFilterFlowBoxChildClass))
#define WIDGETS_IS_FILTER_FLOW_BOX_CHILD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_FILTER_FLOW_BOX_CHILD))
#define WIDGETS_IS_FILTER_FLOW_BOX_CHILD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_FILTER_FLOW_BOX_CHILD))
#define WIDGETS_FILTER_FLOW_BOX_CHILD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_FILTER_FLOW_BOX_CHILD, WidgetsFilterFlowBoxChildClass))

typedef struct _WidgetsFilterFlowBoxChild WidgetsFilterFlowBoxChild;
typedef struct _WidgetsFilterFlowBoxChildClass WidgetsFilterFlowBoxChildClass;
enum  {
	WIDGETS_FILTER_FLOW_BOX_0_PROPERTY,
	WIDGETS_FILTER_FLOW_BOX_BASE_OBJECT_PROPERTY,
	WIDGETS_FILTER_FLOW_BOX_NUM_PROPERTIES
};
static GParamSpec* widgets_filter_flow_box_properties[WIDGETS_FILTER_FLOW_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	WIDGETS_FILTER_FLOW_BOX_FILTER_REMOVED_SIGNAL,
	WIDGETS_FILTER_FLOW_BOX_NUM_SIGNALS
};
static guint widgets_filter_flow_box_signals[WIDGETS_FILTER_FLOW_BOX_NUM_SIGNALS] = {0};

struct _WidgetsFilterFlowBox {
	AdwBin parent_instance;
	WidgetsFilterFlowBoxPrivate * priv;
	GtkFlowBox* flowbox;
};

struct _WidgetsFilterFlowBoxClass {
	AdwBinClass parent_class;
};

struct _WidgetsFilterFlowBoxPrivate {
	ObjectsBaseObject* _base_object;
	GtkRevealer* main_revealer;
	GeeHashMap* filters_map;
	GeeHashMap* signals_map;
};

static gint WidgetsFilterFlowBox_private_offset;
static gpointer widgets_filter_flow_box_parent_class = NULL;

VALA_EXTERN GType widgets_filter_flow_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsFilterFlowBox, g_object_unref)
VALA_EXTERN GType widgets_filter_flow_box_child_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsFilterFlowBoxChild, g_object_unref)
static void widgets_filter_flow_box_add_filters (WidgetsFilterFlowBox* self);
VALA_EXTERN void widgets_filter_flow_box_add_filter (WidgetsFilterFlowBox* self,
                                         ObjectsFiltersFilterItem* filter);
VALA_EXTERN WidgetsFilterFlowBoxChild* widgets_filter_flow_box_child_new (ObjectsFiltersFilterItem* filter);
VALA_EXTERN WidgetsFilterFlowBoxChild* widgets_filter_flow_box_child_construct (GType object_type,
                                                                    ObjectsFiltersFilterItem* filter);
static void ___lambda603_ (WidgetsFilterFlowBox* self,
                    ObjectsFiltersFilterItem* _filter);
VALA_EXTERN void widgets_filter_flow_box_remove_filter (WidgetsFilterFlowBox* self,
                                            ObjectsFiltersFilterItem* filter);
static void ____lambda603__widgets_filter_flow_box_child_remove_filter (WidgetsFilterFlowBoxChild* _sender,
                                                                 ObjectsFiltersFilterItem* filter,
                                                                 gpointer self);
VALA_EXTERN void widgets_filter_flow_box_child_hide_destroy (WidgetsFilterFlowBoxChild* self);
VALA_EXTERN void widgets_filter_flow_box_update_filter (WidgetsFilterFlowBox* self,
                                            ObjectsFiltersFilterItem* filter);
VALA_EXTERN void widgets_filter_flow_box_child_update_request (WidgetsFilterFlowBoxChild* self);
VALA_EXTERN ObjectsFiltersFilterItem* widgets_filter_flow_box_get_filter (WidgetsFilterFlowBox* self,
                                                              const gchar* id);
VALA_EXTERN ObjectsFiltersFilterItem* widgets_filter_flow_box_child_get_filter (WidgetsFilterFlowBoxChild* self);
VALA_EXTERN WidgetsFilterFlowBox* widgets_filter_flow_box_new (void);
VALA_EXTERN WidgetsFilterFlowBox* widgets_filter_flow_box_construct (GType object_type);
VALA_EXTERN ObjectsBaseObject* widgets_filter_flow_box_get_base_object (WidgetsFilterFlowBox* self);
VALA_EXTERN void widgets_filter_flow_box_set_base_object (WidgetsFilterFlowBox* self,
                                              ObjectsBaseObject* value);
static void _widgets_filter_flow_box_base_object___lambda604_ (WidgetsFilterFlowBox* self,
                                                        ObjectsFiltersFilterItem* filter);
static void __widgets_filter_flow_box_base_object___lambda604__objects_base_object_filter_added (ObjectsBaseObject* _sender,
                                                                                          ObjectsFiltersFilterItem* filters,
                                                                                          gpointer self);
static void _widgets_filter_flow_box_base_object___lambda605_ (WidgetsFilterFlowBox* self,
                                                        ObjectsFiltersFilterItem* filter);
static void __widgets_filter_flow_box_base_object___lambda605__objects_base_object_filter_removed (ObjectsBaseObject* _sender,
                                                                                            ObjectsFiltersFilterItem* filters,
                                                                                            gpointer self);
static void _widgets_filter_flow_box_base_object___lambda606_ (WidgetsFilterFlowBox* self,
                                                        ObjectsFiltersFilterItem* filter);
static void __widgets_filter_flow_box_base_object___lambda606__objects_base_object_filter_updated (ObjectsBaseObject* _sender,
                                                                                            ObjectsFiltersFilterItem* filters,
                                                                                            gpointer self);
static GObject * widgets_filter_flow_box_constructor (GType type,
                                               guint n_construct_properties,
                                               GObjectConstructParam * construct_properties);
static void _widgets_filter_flow_box___lambda607_ (WidgetsFilterFlowBox* self);
static void __widgets_filter_flow_box___lambda607__gtk_widget_destroy (GtkWidget* _sender,
                                                                gpointer self);
static void widgets_filter_flow_box_finalize (GObject * obj);
static GType widgets_filter_flow_box_get_type_once (void);
static void _vala_widgets_filter_flow_box_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_widgets_filter_flow_box_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);

static inline gpointer
widgets_filter_flow_box_get_instance_private (WidgetsFilterFlowBox* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsFilterFlowBox_private_offset);
}

static void
widgets_filter_flow_box_add_filters (WidgetsFilterFlowBox* self)
{
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _filter_it = NULL;
		ObjectsBaseObject* _tmp0_;
		GeeHashMap* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeCollection* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp0_ = self->priv->_base_object;
		_tmp1_ = _tmp0_->filters;
		_tmp2_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_filter_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			ObjectsFiltersFilterItem* filter = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			ObjectsFiltersFilterItem* _tmp10_;
			_tmp7_ = _filter_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _filter_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			filter = (ObjectsFiltersFilterItem*) _tmp9_;
			_tmp10_ = filter;
			widgets_filter_flow_box_add_filter (self, _tmp10_);
			_g_object_unref0 (filter);
		}
		_g_object_unref0 (_filter_it);
	}
}

static void
___lambda603_ (WidgetsFilterFlowBox* self,
               ObjectsFiltersFilterItem* _filter)
{
	ObjectsBaseObject* _tmp0_;
	g_return_if_fail (_filter != NULL);
	_tmp0_ = self->priv->_base_object;
	if (_tmp0_ != NULL) {
		ObjectsBaseObject* _tmp1_;
		_tmp1_ = self->priv->_base_object;
		objects_base_object_remove_filter (_tmp1_, _filter);
	} else {
		widgets_filter_flow_box_remove_filter (self, _filter);
	}
}

static void
____lambda603__widgets_filter_flow_box_child_remove_filter (WidgetsFilterFlowBoxChild* _sender,
                                                            ObjectsFiltersFilterItem* filter,
                                                            gpointer self)
{
	___lambda603_ ((WidgetsFilterFlowBox*) self, filter);
}

void
widgets_filter_flow_box_add_filter (WidgetsFilterFlowBox* self,
                                    ObjectsFiltersFilterItem* filter)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkRevealer* _tmp26_;
	GeeHashMap* _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filter != NULL);
	_tmp0_ = self->priv->filters_map;
	_tmp1_ = objects_filters_filter_item_get_id (filter);
	_tmp2_ = _tmp1_;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
		GeeHashMap* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		WidgetsFilterFlowBoxChild* _tmp6_;
		WidgetsFilterFlowBoxChild* _tmp7_;
		GeeHashMap* _tmp8_;
		GeeHashMap* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		gpointer _tmp12_;
		WidgetsFilterFlowBoxChild* _tmp13_;
		gulong _tmp14_;
		GeeHashMap* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		gpointer _tmp18_;
		WidgetsFilterFlowBoxChild* _tmp19_;
		GtkFlowBox* _tmp20_;
		GeeHashMap* _tmp21_;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		gpointer _tmp24_;
		WidgetsFilterFlowBoxChild* _tmp25_;
		_tmp3_ = self->priv->filters_map;
		_tmp4_ = objects_filters_filter_item_get_id (filter);
		_tmp5_ = _tmp4_;
		_tmp6_ = widgets_filter_flow_box_child_new (filter);
		g_object_ref_sink (_tmp6_);
		_tmp7_ = _tmp6_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, _tmp5_, _tmp7_);
		_g_object_unref0 (_tmp7_);
		_tmp8_ = self->priv->signals_map;
		_tmp9_ = self->priv->filters_map;
		_tmp10_ = objects_filters_filter_item_get_id (filter);
		_tmp11_ = _tmp10_;
		_tmp12_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp9_, _tmp11_);
		_tmp13_ = (WidgetsFilterFlowBoxChild*) _tmp12_;
		_tmp14_ = g_signal_connect_object (_tmp13_, "remove-filter", (GCallback) ____lambda603__widgets_filter_flow_box_child_remove_filter, self, 0);
		_tmp15_ = self->priv->filters_map;
		_tmp16_ = objects_filters_filter_item_get_id (filter);
		_tmp17_ = _tmp16_;
		_tmp18_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp15_, _tmp17_);
		_tmp19_ = (WidgetsFilterFlowBoxChild*) _tmp18_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp8_, (gpointer) ((guintptr) _tmp14_), (GObject*) _tmp19_);
		_g_object_unref0 (_tmp19_);
		_g_object_unref0 (_tmp13_);
		_tmp20_ = self->flowbox;
		_tmp21_ = self->priv->filters_map;
		_tmp22_ = objects_filters_filter_item_get_id (filter);
		_tmp23_ = _tmp22_;
		_tmp24_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp21_, _tmp23_);
		_tmp25_ = (WidgetsFilterFlowBoxChild*) _tmp24_;
		gtk_flow_box_append (_tmp20_, (GtkWidget*) _tmp25_);
		_g_object_unref0 (_tmp25_);
	}
	_tmp26_ = self->priv->main_revealer;
	_tmp27_ = self->priv->filters_map;
	_tmp28_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp27_);
	_tmp29_ = _tmp28_;
	gtk_revealer_set_reveal_child (_tmp26_, _tmp29_ > 0);
}

void
widgets_filter_flow_box_remove_filter (WidgetsFilterFlowBox* self,
                                       ObjectsFiltersFilterItem* filter)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkRevealer* _tmp11_;
	GeeHashMap* _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filter != NULL);
	_tmp0_ = self->priv->filters_map;
	_tmp1_ = objects_filters_filter_item_get_id (filter);
	_tmp2_ = _tmp1_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
		GeeHashMap* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gpointer _tmp6_;
		WidgetsFilterFlowBoxChild* _tmp7_;
		GeeHashMap* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp3_ = self->priv->filters_map;
		_tmp4_ = objects_filters_filter_item_get_id (filter);
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, _tmp5_);
		_tmp7_ = (WidgetsFilterFlowBoxChild*) _tmp6_;
		widgets_filter_flow_box_child_hide_destroy (_tmp7_);
		_g_object_unref0 (_tmp7_);
		_tmp8_ = self->priv->filters_map;
		_tmp9_ = objects_filters_filter_item_get_id (filter);
		_tmp10_ = _tmp9_;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp8_, _tmp10_, NULL);
		g_signal_emit (self, widgets_filter_flow_box_signals[WIDGETS_FILTER_FLOW_BOX_FILTER_REMOVED_SIGNAL], 0, filter);
	}
	_tmp11_ = self->priv->main_revealer;
	_tmp12_ = self->priv->filters_map;
	_tmp13_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp12_);
	_tmp14_ = _tmp13_;
	gtk_revealer_set_reveal_child (_tmp11_, _tmp14_ > 0);
}

void
widgets_filter_flow_box_update_filter (WidgetsFilterFlowBox* self,
                                       ObjectsFiltersFilterItem* filter)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkRevealer* _tmp8_;
	GeeHashMap* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filter != NULL);
	_tmp0_ = self->priv->filters_map;
	_tmp1_ = objects_filters_filter_item_get_id (filter);
	_tmp2_ = _tmp1_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
		GeeHashMap* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gpointer _tmp6_;
		WidgetsFilterFlowBoxChild* _tmp7_;
		_tmp3_ = self->priv->filters_map;
		_tmp4_ = objects_filters_filter_item_get_id (filter);
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, _tmp5_);
		_tmp7_ = (WidgetsFilterFlowBoxChild*) _tmp6_;
		widgets_filter_flow_box_child_update_request (_tmp7_);
		_g_object_unref0 (_tmp7_);
	}
	_tmp8_ = self->priv->main_revealer;
	_tmp9_ = self->priv->filters_map;
	_tmp10_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp9_);
	_tmp11_ = _tmp10_;
	gtk_revealer_set_reveal_child (_tmp8_, _tmp11_ > 0);
}

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

ObjectsFiltersFilterItem*
widgets_filter_flow_box_get_filter (WidgetsFilterFlowBox* self,
                                    const gchar* id)
{
	GeeHashMap* _tmp0_;
	ObjectsFiltersFilterItem* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = self->priv->filters_map;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, id)) {
		GeeHashMap* _tmp1_;
		gpointer _tmp2_;
		WidgetsFilterFlowBoxChild* _tmp3_;
		ObjectsFiltersFilterItem* _tmp4_;
		ObjectsFiltersFilterItem* _tmp5_;
		ObjectsFiltersFilterItem* _tmp6_;
		ObjectsFiltersFilterItem* _tmp7_;
		_tmp1_ = self->priv->filters_map;
		_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, id);
		_tmp3_ = (WidgetsFilterFlowBoxChild*) _tmp2_;
		_tmp4_ = widgets_filter_flow_box_child_get_filter (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _g_object_ref0 (_tmp5_);
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp3_);
		result = _tmp7_;
		return result;
	}
	result = NULL;
	return result;
}

WidgetsFilterFlowBox*
widgets_filter_flow_box_construct (GType object_type)
{
	WidgetsFilterFlowBox * self = NULL;
	self = (WidgetsFilterFlowBox*) g_object_new (object_type, NULL);
	return self;
}

WidgetsFilterFlowBox*
widgets_filter_flow_box_new (void)
{
	return widgets_filter_flow_box_construct (WIDGETS_TYPE_FILTER_FLOW_BOX);
}

ObjectsBaseObject*
widgets_filter_flow_box_get_base_object (WidgetsFilterFlowBox* self)
{
	ObjectsBaseObject* result;
	ObjectsBaseObject* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_base_object;
	result = _tmp0_;
	return result;
}

static void
_widgets_filter_flow_box_base_object___lambda604_ (WidgetsFilterFlowBox* self,
                                                   ObjectsFiltersFilterItem* filter)
{
	g_return_if_fail (filter != NULL);
	widgets_filter_flow_box_add_filter (self, filter);
}

static void
__widgets_filter_flow_box_base_object___lambda604__objects_base_object_filter_added (ObjectsBaseObject* _sender,
                                                                                     ObjectsFiltersFilterItem* filters,
                                                                                     gpointer self)
{
	_widgets_filter_flow_box_base_object___lambda604_ ((WidgetsFilterFlowBox*) self, filters);
}

static void
_widgets_filter_flow_box_base_object___lambda605_ (WidgetsFilterFlowBox* self,
                                                   ObjectsFiltersFilterItem* filter)
{
	g_return_if_fail (filter != NULL);
	widgets_filter_flow_box_remove_filter (self, filter);
}

static void
__widgets_filter_flow_box_base_object___lambda605__objects_base_object_filter_removed (ObjectsBaseObject* _sender,
                                                                                       ObjectsFiltersFilterItem* filters,
                                                                                       gpointer self)
{
	_widgets_filter_flow_box_base_object___lambda605_ ((WidgetsFilterFlowBox*) self, filters);
}

static void
_widgets_filter_flow_box_base_object___lambda606_ (WidgetsFilterFlowBox* self,
                                                   ObjectsFiltersFilterItem* filter)
{
	g_return_if_fail (filter != NULL);
	widgets_filter_flow_box_update_filter (self, filter);
}

static void
__widgets_filter_flow_box_base_object___lambda606__objects_base_object_filter_updated (ObjectsBaseObject* _sender,
                                                                                       ObjectsFiltersFilterItem* filters,
                                                                                       gpointer self)
{
	_widgets_filter_flow_box_base_object___lambda606_ ((WidgetsFilterFlowBox*) self, filters);
}

void
widgets_filter_flow_box_set_base_object (WidgetsFilterFlowBox* self,
                                         ObjectsBaseObject* value)
{
	ObjectsBaseObject* _tmp0_;
	GeeHashMap* _tmp1_;
	ObjectsBaseObject* _tmp2_;
	gulong _tmp3_;
	ObjectsBaseObject* _tmp4_;
	GeeHashMap* _tmp5_;
	ObjectsBaseObject* _tmp6_;
	gulong _tmp7_;
	ObjectsBaseObject* _tmp8_;
	GeeHashMap* _tmp9_;
	ObjectsBaseObject* _tmp10_;
	gulong _tmp11_;
	ObjectsBaseObject* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_base_object);
	self->priv->_base_object = _tmp0_;
	_tmp1_ = self->priv->signals_map;
	_tmp2_ = self->priv->_base_object;
	_tmp3_ = g_signal_connect_object (_tmp2_, "filter-added", (GCallback) __widgets_filter_flow_box_base_object___lambda604__objects_base_object_filter_added, self, 0);
	_tmp4_ = self->priv->_base_object;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp1_, (gpointer) ((guintptr) _tmp3_), (GObject*) _tmp4_);
	_tmp5_ = self->priv->signals_map;
	_tmp6_ = self->priv->_base_object;
	_tmp7_ = g_signal_connect_object (_tmp6_, "filter-removed", (GCallback) __widgets_filter_flow_box_base_object___lambda605__objects_base_object_filter_removed, self, 0);
	_tmp8_ = self->priv->_base_object;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp5_, (gpointer) ((guintptr) _tmp7_), (GObject*) _tmp8_);
	_tmp9_ = self->priv->signals_map;
	_tmp10_ = self->priv->_base_object;
	_tmp11_ = g_signal_connect_object (_tmp10_, "filter-updated", (GCallback) __widgets_filter_flow_box_base_object___lambda606__objects_base_object_filter_updated, self, 0);
	_tmp12_ = self->priv->_base_object;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, (gpointer) ((guintptr) _tmp11_), (GObject*) _tmp12_);
	widgets_filter_flow_box_add_filters (self);
	g_object_notify_by_pspec ((GObject *) self, widgets_filter_flow_box_properties[WIDGETS_FILTER_FLOW_BOX_BASE_OBJECT_PROPERTY]);
}

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

static void
__widgets_filter_flow_box___lambda607__gtk_widget_destroy (GtkWidget* _sender,
                                                           gpointer self)
{
	_widgets_filter_flow_box___lambda607_ ((WidgetsFilterFlowBox*) self);
}

static GObject *
widgets_filter_flow_box_constructor (GType type,
                                     guint n_construct_properties,
                                     GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsFilterFlowBox * self;
	GtkFlowBox* _tmp0_ = NULL;
	GtkFlowBox* _tmp1_;
	GtkWidget* _tmp2_;
	GtkRevealer* _tmp3_ = NULL;
	GtkRevealer* _tmp4_;
	parent_class = G_OBJECT_CLASS (widgets_filter_flow_box_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_FILTER_FLOW_BOX, WidgetsFilterFlowBox);
	_tmp0_ = (GtkFlowBox*) gtk_flow_box_new ();
	gtk_flow_box_set_column_spacing (_tmp0_, (guint) 12);
	gtk_flow_box_set_row_spacing (_tmp0_, (guint) 12);
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_orientable_set_orientation ((GtkOrientable*) _tmp0_, GTK_ORIENTATION_VERTICAL);
	gtk_flow_box_set_homogeneous (_tmp0_, FALSE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->flowbox);
	self->flowbox = _tmp0_;
	_tmp1_ = self->flowbox;
	_tmp2_ = _g_object_ref0 ((GtkWidget*) _tmp1_);
	_tmp3_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp3_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_child (_tmp3_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->main_revealer);
	self->priv->main_revealer = _tmp3_;
	_tmp4_ = self->priv->main_revealer;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp4_);
	g_signal_connect_object ((GtkWidget*) self, "destroy", (GCallback) __widgets_filter_flow_box___lambda607__gtk_widget_destroy, self, 0);
	return obj;
}

static void
widgets_filter_flow_box_class_init (WidgetsFilterFlowBoxClass * klass,
                                    gpointer klass_data)
{
	widgets_filter_flow_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsFilterFlowBox_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_filter_flow_box_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_filter_flow_box_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_filter_flow_box_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_filter_flow_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_FILTER_FLOW_BOX_BASE_OBJECT_PROPERTY, widgets_filter_flow_box_properties[WIDGETS_FILTER_FLOW_BOX_BASE_OBJECT_PROPERTY] = g_param_spec_object ("base-object", "base-object", "base-object", OBJECTS_TYPE_BASE_OBJECT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	widgets_filter_flow_box_signals[WIDGETS_FILTER_FLOW_BOX_FILTER_REMOVED_SIGNAL] = g_signal_new ("filter-removed", WIDGETS_TYPE_FILTER_FLOW_BOX, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_FILTERS_TYPE_FILTER_ITEM);
}

static void
widgets_filter_flow_box_instance_init (WidgetsFilterFlowBox * self,
                                       gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = widgets_filter_flow_box_get_instance_private (self);
	self->priv->_base_object = NULL;
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, WIDGETS_TYPE_FILTER_FLOW_BOX_CHILD, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->filters_map = _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->signals_map = _tmp1_;
}

static void
widgets_filter_flow_box_finalize (GObject * obj)
{
	WidgetsFilterFlowBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_FILTER_FLOW_BOX, WidgetsFilterFlowBox);
	g_debug ("FilterFlowBox.vala:56: Destroying - Widgets.FilterFlowBox\n");
	_g_object_unref0 (self->priv->_base_object);
	_g_object_unref0 (self->flowbox);
	_g_object_unref0 (self->priv->main_revealer);
	_g_object_unref0 (self->priv->filters_map);
	_g_object_unref0 (self->priv->signals_map);
	G_OBJECT_CLASS (widgets_filter_flow_box_parent_class)->finalize (obj);
}

static GType
widgets_filter_flow_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsFilterFlowBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_filter_flow_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsFilterFlowBox), 0, (GInstanceInitFunc) widgets_filter_flow_box_instance_init, NULL };
	GType widgets_filter_flow_box_type_id;
	widgets_filter_flow_box_type_id = g_type_register_static (adw_bin_get_type (), "WidgetsFilterFlowBox", &g_define_type_info, 0);
	WidgetsFilterFlowBox_private_offset = g_type_add_instance_private (widgets_filter_flow_box_type_id, sizeof (WidgetsFilterFlowBoxPrivate));
	return widgets_filter_flow_box_type_id;
}

GType
widgets_filter_flow_box_get_type (void)
{
	static volatile gsize widgets_filter_flow_box_type_id__once = 0;
	if (g_once_init_enter (&widgets_filter_flow_box_type_id__once)) {
		GType widgets_filter_flow_box_type_id;
		widgets_filter_flow_box_type_id = widgets_filter_flow_box_get_type_once ();
		g_once_init_leave (&widgets_filter_flow_box_type_id__once, widgets_filter_flow_box_type_id);
	}
	return widgets_filter_flow_box_type_id__once;
}

static void
_vala_widgets_filter_flow_box_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	WidgetsFilterFlowBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_FILTER_FLOW_BOX, WidgetsFilterFlowBox);
	switch (property_id) {
		case WIDGETS_FILTER_FLOW_BOX_BASE_OBJECT_PROPERTY:
		g_value_set_object (value, widgets_filter_flow_box_get_base_object (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_filter_flow_box_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	WidgetsFilterFlowBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_FILTER_FLOW_BOX, WidgetsFilterFlowBox);
	switch (property_id) {
		case WIDGETS_FILTER_FLOW_BOX_BASE_OBJECT_PROPERTY:
		widgets_filter_flow_box_set_base_object (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

