/* ScheduledSection.c generated by valac 0.56.19, the Vala compiler
 * generated from ScheduledSection.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 <adwaita.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <gio/gio.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_SCHEDULED_TYPE_SCHEDULED_SECTION (views_scheduled_scheduled_section_get_type ())
#define VIEWS_SCHEDULED_SCHEDULED_SECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION, ViewsScheduledScheduledSection))
#define VIEWS_SCHEDULED_SCHEDULED_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION, ViewsScheduledScheduledSectionClass))
#define VIEWS_SCHEDULED_IS_SCHEDULED_SECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION))
#define VIEWS_SCHEDULED_IS_SCHEDULED_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION))
#define VIEWS_SCHEDULED_SCHEDULED_SECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION, ViewsScheduledScheduledSectionClass))

typedef struct _ViewsScheduledScheduledSection ViewsScheduledScheduledSection;
typedef struct _ViewsScheduledScheduledSectionClass ViewsScheduledScheduledSectionClass;
typedef struct _ViewsScheduledScheduledSectionPrivate ViewsScheduledScheduledSectionPrivate;

#define WIDGETS_TYPE_EVENTS_LIST (widgets_events_list_get_type ())
#define WIDGETS_EVENTS_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_EVENTS_LIST, WidgetsEventsList))
#define WIDGETS_EVENTS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_EVENTS_LIST, WidgetsEventsListClass))
#define WIDGETS_IS_EVENTS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_EVENTS_LIST))
#define WIDGETS_IS_EVENTS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_EVENTS_LIST))
#define WIDGETS_EVENTS_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_EVENTS_LIST, WidgetsEventsListClass))

typedef struct _WidgetsEventsList WidgetsEventsList;
typedef struct _WidgetsEventsListClass WidgetsEventsListClass;

#define LAYOUTS_TYPE_ITEM_BASE (layouts_item_base_get_type ())
#define LAYOUTS_ITEM_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBase))
#define LAYOUTS_ITEM_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBaseClass))
#define LAYOUTS_IS_ITEM_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LAYOUTS_TYPE_ITEM_BASE))
#define LAYOUTS_IS_ITEM_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LAYOUTS_TYPE_ITEM_BASE))
#define LAYOUTS_ITEM_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBaseClass))

typedef struct _LayoutsItemBase LayoutsItemBase;
typedef struct _LayoutsItemBaseClass LayoutsItemBaseClass;

#define LAYOUTS_TYPE_ITEM_ROW (layouts_item_row_get_type ())
#define LAYOUTS_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LAYOUTS_TYPE_ITEM_ROW, LayoutsItemRow))
#define LAYOUTS_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LAYOUTS_TYPE_ITEM_ROW, LayoutsItemRowClass))
#define LAYOUTS_IS_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LAYOUTS_TYPE_ITEM_ROW))
#define LAYOUTS_IS_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LAYOUTS_TYPE_ITEM_ROW))
#define LAYOUTS_ITEM_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LAYOUTS_TYPE_ITEM_ROW, LayoutsItemRowClass))

typedef struct _LayoutsItemRow LayoutsItemRow;
typedef struct _LayoutsItemRowClass LayoutsItemRowClass;
enum  {
	VIEWS_SCHEDULED_SCHEDULED_SECTION_0_PROPERTY,
	VIEWS_SCHEDULED_SCHEDULED_SECTION_HAS_ITEMS_PROPERTY,
	VIEWS_SCHEDULED_SCHEDULED_SECTION_NUM_PROPERTIES
};
static GParamSpec* views_scheduled_scheduled_section_properties[VIEWS_SCHEDULED_SCHEDULED_SECTION_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))

struct _ViewsScheduledScheduledSection {
	GtkListBoxRow parent_instance;
	ViewsScheduledScheduledSectionPrivate * priv;
	GtkListBox* listbox;
	GtkRevealer* listbox_revealer;
	GeeHashMap* items;
	GeeHashMap* signal_map;
	WidgetsEventsList* event_list;
	GtkRevealer* event_list_revealer;
};

struct _ViewsScheduledScheduledSectionClass {
	GtkListBoxRowClass parent_class;
	void (*add_items) (ViewsScheduledScheduledSection* self);
	gboolean (*valid_item_predicate) (ViewsScheduledScheduledSection* self, ObjectsItem* item);
	WidgetsEventsList* (*create_events_list) (ViewsScheduledScheduledSection* self);
	void (*valid_add_item) (ViewsScheduledScheduledSection* self, ObjectsItem* item);
	void (*valid_delete_item) (ViewsScheduledScheduledSection* self, ObjectsItem* item);
	void (*valid_update_item) (ViewsScheduledScheduledSection* self, ObjectsItem* item, const gchar* update_id);
	void (*cleanup_signals) (ViewsScheduledScheduledSection* self);
	void (*clean_up) (ViewsScheduledScheduledSection* self);
};

static gpointer views_scheduled_scheduled_section_parent_class = NULL;

VALA_EXTERN GType views_scheduled_scheduled_section_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewsScheduledScheduledSection, g_object_unref)
VALA_EXTERN GType widgets_events_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsEventsList, g_object_unref)
VALA_EXTERN GType layouts_item_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LayoutsItemBase, g_object_unref)
VALA_EXTERN GType layouts_item_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LayoutsItemRow, g_object_unref)
VALA_EXTERN void views_scheduled_scheduled_section_add_items (ViewsScheduledScheduledSection* self);
VALA_EXTERN gboolean views_scheduled_scheduled_section_valid_item_predicate (ViewsScheduledScheduledSection* self,
                                                                 ObjectsItem* item);
VALA_EXTERN WidgetsEventsList* views_scheduled_scheduled_section_create_events_list (ViewsScheduledScheduledSection* self);
VALA_EXTERN void views_scheduled_scheduled_section_valid_add_item (ViewsScheduledScheduledSection* self,
                                                       ObjectsItem* item);
VALA_EXTERN void views_scheduled_scheduled_section_valid_delete_item (ViewsScheduledScheduledSection* self,
                                                          ObjectsItem* item);
VALA_EXTERN void views_scheduled_scheduled_section_valid_update_item (ViewsScheduledScheduledSection* self,
                                                          ObjectsItem* item,
                                                          const gchar* update_id);
VALA_EXTERN void views_scheduled_scheduled_section_cleanup_signals (ViewsScheduledScheduledSection* self);
VALA_EXTERN void views_scheduled_scheduled_section_clean_up (ViewsScheduledScheduledSection* self);
static void views_scheduled_scheduled_section_real_add_items (ViewsScheduledScheduledSection* self);
static gboolean views_scheduled_scheduled_section_real_valid_item_predicate (ViewsScheduledScheduledSection* self,
                                                                      ObjectsItem* item);
VALA_EXTERN void views_scheduled_scheduled_section_setup_listbox (ViewsScheduledScheduledSection* self);
static gint __lambda809_ (ViewsScheduledScheduledSection* self,
                   GtkListBoxRow* lbrow,
                   GtkListBoxRow* lbbefore);
VALA_EXTERN ObjectsItem* layouts_item_base_get_item (LayoutsItemBase* self);
static gint ___lambda809__gtk_list_box_sort_func (GtkListBoxRow* row1,
                                           GtkListBoxRow* row2,
                                           gpointer self);
static gboolean __lambda810_ (ViewsScheduledScheduledSection* self,
                       GtkListBoxRow* row);
static gboolean ___lambda810__gtk_list_box_filter_func (GtkListBoxRow* row,
                                                 gpointer self);
static void __lambda811_ (ViewsScheduledScheduledSection* self);
static void ___lambda811__objects_base_object_filter_added (ObjectsBaseObject* _sender,
                                                     ObjectsFiltersFilterItem* filters,
                                                     gpointer self);
static void __lambda812_ (ViewsScheduledScheduledSection* self);
static void ___lambda812__objects_base_object_filter_removed (ObjectsBaseObject* _sender,
                                                       ObjectsFiltersFilterItem* filters,
                                                       gpointer self);
static void __lambda813_ (ViewsScheduledScheduledSection* self);
static void ___lambda813__objects_base_object_filter_updated (ObjectsBaseObject* _sender,
                                                       ObjectsFiltersFilterItem* filters,
                                                       gpointer self);
static void __lambda814_ (ViewsScheduledScheduledSection* self);
static void ___lambda814__g_settings_changed (GSettings* _sender,
                                       const gchar* key,
                                       gpointer self);
static WidgetsEventsList* views_scheduled_scheduled_section_real_create_events_list (ViewsScheduledScheduledSection* self);
VALA_EXTERN void views_scheduled_scheduled_section_setup_events (ViewsScheduledScheduledSection* self,
                                                     GtkBox* header_content);
VALA_EXTERN gboolean widgets_events_list_get_has_items (WidgetsEventsList* self);
static void __lambda815_ (ViewsScheduledScheduledSection* self);
static void ___lambda815__widgets_events_list_change (WidgetsEventsList* _sender,
                                               gpointer self);
VALA_EXTERN GtkBox* views_scheduled_scheduled_section_create_header (ViewsScheduledScheduledSection* self,
                                                         GtkWidget* title_widget);
VALA_EXTERN void views_scheduled_scheduled_section_add_item (ViewsScheduledScheduledSection* self,
                                                 ObjectsItem* item);
VALA_EXTERN LayoutsItemRow* layouts_item_row_new (ObjectsItem* item,
                                      gboolean is_project_view);
VALA_EXTERN LayoutsItemRow* layouts_item_row_construct (GType object_type,
                                            ObjectsItem* item,
                                            gboolean is_project_view);
VALA_EXTERN void layouts_item_row_disable_drag_and_drop (LayoutsItemRow* self);
static void views_scheduled_scheduled_section_real_valid_add_item (ViewsScheduledScheduledSection* self,
                                                            ObjectsItem* item);
VALA_EXTERN gboolean views_scheduled_scheduled_section_get_has_items (ViewsScheduledScheduledSection* self);
static void views_scheduled_scheduled_section_real_valid_delete_item (ViewsScheduledScheduledSection* self,
                                                               ObjectsItem* item);
VALA_EXTERN void layouts_item_base_hide_destroy (LayoutsItemBase* self);
static void views_scheduled_scheduled_section_real_valid_update_item (ViewsScheduledScheduledSection* self,
                                                               ObjectsItem* item,
                                                               const gchar* update_id);
VALA_EXTERN const gchar* layouts_item_base_get_update_id (LayoutsItemBase* self);
VALA_EXTERN void layouts_item_base_update_request (LayoutsItemBase* self);
VALA_EXTERN void views_scheduled_scheduled_section_setup_item_signals (ViewsScheduledScheduledSection* self);
static void _views_scheduled_scheduled_section_valid_add_item_services_store_item_added (ServicesStore* _sender,
                                                                                  ObjectsItem* item,
                                                                                  gboolean insert,
                                                                                  gpointer self);
static void _views_scheduled_scheduled_section_valid_delete_item_services_store_item_deleted (ServicesStore* _sender,
                                                                                       ObjectsItem* item,
                                                                                       gpointer self);
static void _views_scheduled_scheduled_section_valid_update_item_services_store_item_updated (ServicesStore* _sender,
                                                                                       ObjectsItem* item,
                                                                                       const gchar* update_id,
                                                                                       gpointer self);
static void _views_scheduled_scheduled_section_valid_delete_item_services_store_item_archived (ServicesStore* _sender,
                                                                                        ObjectsItem* item,
                                                                                        gpointer self);
static void _views_scheduled_scheduled_section_valid_add_item_services_store_item_unarchived (ServicesStore* _sender,
                                                                                       ObjectsItem* item,
                                                                                       gpointer self);
static void views_scheduled_scheduled_section_real_cleanup_signals (ViewsScheduledScheduledSection* self);
static void views_scheduled_scheduled_section_real_clean_up (ViewsScheduledScheduledSection* self);
VALA_EXTERN void layouts_item_base_clean_up (LayoutsItemBase* self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN void widgets_events_list_clean_up (WidgetsEventsList* self);
VALA_EXTERN ViewsScheduledScheduledSection* views_scheduled_scheduled_section_construct (GType object_type);
static void views_scheduled_scheduled_section_finalize (GObject * obj);
static GType views_scheduled_scheduled_section_get_type_once (void);
static void _vala_views_scheduled_scheduled_section_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec);

static void
views_scheduled_scheduled_section_real_add_items (ViewsScheduledScheduledSection* self)
{
	g_critical ("Type `%s' does not implement abstract method `views_scheduled_scheduled_section_add_items'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
views_scheduled_scheduled_section_add_items (ViewsScheduledScheduledSection* self)
{
	ViewsScheduledScheduledSectionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = VIEWS_SCHEDULED_SCHEDULED_SECTION_GET_CLASS (self);
	if (_klass_->add_items) {
		_klass_->add_items (self);
	}
}

static gboolean
views_scheduled_scheduled_section_real_valid_item_predicate (ViewsScheduledScheduledSection* self,
                                                             ObjectsItem* item)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `views_scheduled_scheduled_section_valid_item_predicate'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
views_scheduled_scheduled_section_valid_item_predicate (ViewsScheduledScheduledSection* self,
                                                        ObjectsItem* item)
{
	ViewsScheduledScheduledSectionClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = VIEWS_SCHEDULED_SCHEDULED_SECTION_GET_CLASS (self);
	if (_klass_->valid_item_predicate) {
		return _klass_->valid_item_predicate (self, item);
	}
	return FALSE;
}

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

static gint
__lambda809_ (ViewsScheduledScheduledSection* self,
              GtkListBoxRow* lbrow,
              GtkListBoxRow* lbbefore)
{
	ObjectsItem* item1 = NULL;
	ObjectsItem* _tmp0_;
	ObjectsItem* _tmp1_;
	ObjectsItem* _tmp2_;
	ObjectsItem* item2 = NULL;
	ObjectsItem* _tmp3_;
	ObjectsItem* _tmp4_;
	ObjectsItem* _tmp5_;
	SortedByType sorted_by = 0;
	ServicesSettings* _tmp6_;
	ServicesSettings* _tmp7_;
	GSettings* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	SortedByType _tmp11_;
	Util* _tmp12_;
	Util* _tmp13_;
	gint _tmp14_;
	gint result;
	g_return_val_if_fail (lbrow != NULL, -1);
	g_return_val_if_fail (lbbefore != NULL, -1);
	_tmp0_ = layouts_item_base_get_item ((LayoutsItemBase*) G_TYPE_CHECK_INSTANCE_CAST (lbrow, LAYOUTS_TYPE_ITEM_ROW, LayoutsItemRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	item1 = _tmp2_;
	_tmp3_ = layouts_item_base_get_item ((LayoutsItemBase*) G_TYPE_CHECK_INSTANCE_CAST (lbbefore, LAYOUTS_TYPE_ITEM_ROW, LayoutsItemRow));
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	item2 = _tmp5_;
	_tmp6_ = services_settings_get_default ();
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->settings;
	_tmp9_ = g_settings_get_string (_tmp8_, "scheduled-sort-order");
	_tmp10_ = _tmp9_;
	_tmp11_ = sorted_by_type_parse (_tmp10_);
	_g_free0 (_tmp10_);
	_g_object_unref0 (_tmp7_);
	sorted_by = _tmp11_;
	_tmp12_ = util_get_default ();
	_tmp13_ = _tmp12_;
	_tmp14_ = util_set_item_sort_func (_tmp13_, item1, item2, sorted_by, SORT_ORDER_TYPE_ASC);
	_g_object_unref0 (_tmp13_);
	result = _tmp14_;
	_g_object_unref0 (item2);
	_g_object_unref0 (item1);
	return result;
}

static gint
___lambda809__gtk_list_box_sort_func (GtkListBoxRow* row1,
                                      GtkListBoxRow* row2,
                                      gpointer self)
{
	gint result;
	result = __lambda809_ ((ViewsScheduledScheduledSection*) self, row1, row2);
	return result;
}

static gboolean
__lambda810_ (ViewsScheduledScheduledSection* self,
              GtkListBoxRow* row)
{
	ObjectsItem* item = NULL;
	ObjectsItem* _tmp0_;
	ObjectsItem* _tmp1_;
	ObjectsItem* _tmp2_;
	gboolean return_value = FALSE;
	ObjectsFiltersScheduled* _tmp3_;
	ObjectsFiltersScheduled* _tmp4_;
	GeeHashMap* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gboolean _tmp8_;
	gboolean result;
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = layouts_item_base_get_item ((LayoutsItemBase*) G_TYPE_CHECK_INSTANCE_CAST (row, LAYOUTS_TYPE_ITEM_ROW, LayoutsItemRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	item = _tmp2_;
	return_value = TRUE;
	_tmp3_ = objects_filters_scheduled_get_default ();
	_tmp4_ = _tmp3_;
	_tmp5_ = ((ObjectsBaseObject*) _tmp4_)->filters;
	_tmp6_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_ <= 0;
	_g_object_unref0 (_tmp4_);
	if (_tmp8_) {
		result = TRUE;
		_g_object_unref0 (item);
		return result;
	}
	return_value = FALSE;
	{
		GeeIterator* _filter_it = NULL;
		ObjectsFiltersScheduled* _tmp9_;
		ObjectsFiltersScheduled* _tmp10_;
		GeeHashMap* _tmp11_;
		GeeCollection* _tmp12_;
		GeeCollection* _tmp13_;
		GeeCollection* _tmp14_;
		GeeIterator* _tmp15_;
		GeeIterator* _tmp16_;
		_tmp9_ = objects_filters_scheduled_get_default ();
		_tmp10_ = _tmp9_;
		_tmp11_ = ((ObjectsBaseObject*) _tmp10_)->filters;
		_tmp12_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = _tmp13_;
		_tmp15_ = gee_iterable_iterator ((GeeIterable*) _tmp14_);
		_tmp16_ = _tmp15_;
		_g_object_unref0 (_tmp14_);
		_g_object_unref0 (_tmp10_);
		_filter_it = _tmp16_;
		while (TRUE) {
			GeeIterator* _tmp17_;
			ObjectsFiltersFilterItem* filter = NULL;
			GeeIterator* _tmp18_;
			gpointer _tmp19_;
			ObjectsFiltersFilterItem* _tmp20_;
			FilterItemType _tmp21_;
			FilterItemType _tmp22_;
			_tmp17_ = _filter_it;
			if (!gee_iterator_next (_tmp17_)) {
				break;
			}
			_tmp18_ = _filter_it;
			_tmp19_ = gee_iterator_get (_tmp18_);
			filter = (ObjectsFiltersFilterItem*) _tmp19_;
			_tmp20_ = filter;
			_tmp21_ = objects_filters_filter_item_get_filter_type (_tmp20_);
			_tmp22_ = _tmp21_;
			if (_tmp22_ == FILTER_ITEM_TYPE_PRIORITY) {
				gboolean _tmp23_ = FALSE;
				if (return_value) {
					_tmp23_ = TRUE;
				} else {
					ObjectsItem* _tmp24_;
					gint _tmp25_;
					gint _tmp26_;
					ObjectsFiltersFilterItem* _tmp27_;
					const gchar* _tmp28_;
					const gchar* _tmp29_;
					_tmp24_ = item;
					_tmp25_ = objects_item_get_priority (_tmp24_);
					_tmp26_ = _tmp25_;
					_tmp27_ = filter;
					_tmp28_ = objects_filters_filter_item_get_value (_tmp27_);
					_tmp29_ = _tmp28_;
					_tmp23_ = _tmp26_ == atoi (_tmp29_);
				}
				return_value = _tmp23_;
			} else {
				ObjectsFiltersFilterItem* _tmp30_;
				FilterItemType _tmp31_;
				FilterItemType _tmp32_;
				_tmp30_ = filter;
				_tmp31_ = objects_filters_filter_item_get_filter_type (_tmp30_);
				_tmp32_ = _tmp31_;
				if (_tmp32_ == FILTER_ITEM_TYPE_LABEL) {
					gboolean _tmp33_ = FALSE;
					if (return_value) {
						_tmp33_ = TRUE;
					} else {
						ObjectsItem* _tmp34_;
						ObjectsFiltersFilterItem* _tmp35_;
						const gchar* _tmp36_;
						const gchar* _tmp37_;
						_tmp34_ = item;
						_tmp35_ = filter;
						_tmp36_ = objects_filters_filter_item_get_value (_tmp35_);
						_tmp37_ = _tmp36_;
						_tmp33_ = objects_item_has_label (_tmp34_, _tmp37_);
					}
					return_value = _tmp33_;
				}
			}
			_g_object_unref0 (filter);
		}
		_g_object_unref0 (_filter_it);
	}
	result = return_value;
	_g_object_unref0 (item);
	return result;
}

static gboolean
___lambda810__gtk_list_box_filter_func (GtkListBoxRow* row,
                                        gpointer self)
{
	gboolean result;
	result = __lambda810_ ((ViewsScheduledScheduledSection*) self, row);
	return result;
}

static void
__lambda811_ (ViewsScheduledScheduledSection* self)
{
	GtkListBox* _tmp0_;
	_tmp0_ = self->listbox;
	gtk_list_box_invalidate_filter (_tmp0_);
}

static void
___lambda811__objects_base_object_filter_added (ObjectsBaseObject* _sender,
                                                ObjectsFiltersFilterItem* filters,
                                                gpointer self)
{
	__lambda811_ ((ViewsScheduledScheduledSection*) self);
}

static void
__lambda812_ (ViewsScheduledScheduledSection* self)
{
	GtkListBox* _tmp0_;
	_tmp0_ = self->listbox;
	gtk_list_box_invalidate_filter (_tmp0_);
}

static void
___lambda812__objects_base_object_filter_removed (ObjectsBaseObject* _sender,
                                                  ObjectsFiltersFilterItem* filters,
                                                  gpointer self)
{
	__lambda812_ ((ViewsScheduledScheduledSection*) self);
}

static void
__lambda813_ (ViewsScheduledScheduledSection* self)
{
	GtkListBox* _tmp0_;
	_tmp0_ = self->listbox;
	gtk_list_box_invalidate_filter (_tmp0_);
}

static void
___lambda813__objects_base_object_filter_updated (ObjectsBaseObject* _sender,
                                                  ObjectsFiltersFilterItem* filters,
                                                  gpointer self)
{
	__lambda813_ ((ViewsScheduledScheduledSection*) self);
}

static void
__lambda814_ (ViewsScheduledScheduledSection* self)
{
	GtkListBox* _tmp0_;
	_tmp0_ = self->listbox;
	gtk_list_box_invalidate_sort (_tmp0_);
}

static void
___lambda814__g_settings_changed (GSettings* _sender,
                                  const gchar* key,
                                  gpointer self)
{
	__lambda814_ ((ViewsScheduledScheduledSection*) self);
}

void
views_scheduled_scheduled_section_setup_listbox (ViewsScheduledScheduledSection* self)
{
	GtkListBox* _tmp0_;
	GtkListBox* _tmp1_;
	GeeHashMap* _tmp2_;
	ObjectsFiltersScheduled* _tmp3_;
	ObjectsFiltersScheduled* _tmp4_;
	gulong _tmp5_;
	ObjectsFiltersScheduled* _tmp6_;
	ObjectsFiltersScheduled* _tmp7_;
	GeeHashMap* _tmp8_;
	ObjectsFiltersScheduled* _tmp9_;
	ObjectsFiltersScheduled* _tmp10_;
	gulong _tmp11_;
	ObjectsFiltersScheduled* _tmp12_;
	ObjectsFiltersScheduled* _tmp13_;
	GeeHashMap* _tmp14_;
	ObjectsFiltersScheduled* _tmp15_;
	ObjectsFiltersScheduled* _tmp16_;
	gulong _tmp17_;
	ObjectsFiltersScheduled* _tmp18_;
	ObjectsFiltersScheduled* _tmp19_;
	GeeHashMap* _tmp20_;
	ServicesSettings* _tmp21_;
	ServicesSettings* _tmp22_;
	GSettings* _tmp23_;
	gulong _tmp24_;
	ServicesSettings* _tmp25_;
	ServicesSettings* _tmp26_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->listbox;
	gtk_list_box_set_sort_func (_tmp0_, ___lambda809__gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	_tmp1_ = self->listbox;
	gtk_list_box_set_filter_func (_tmp1_, ___lambda810__gtk_list_box_filter_func, g_object_ref (self), g_object_unref);
	_tmp2_ = self->signal_map;
	_tmp3_ = objects_filters_scheduled_get_default ();
	_tmp4_ = _tmp3_;
	_tmp5_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp4_, "filter-added", (GCallback) ___lambda811__objects_base_object_filter_added, self, 0);
	_tmp6_ = objects_filters_scheduled_get_default ();
	_tmp7_ = _tmp6_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp2_, (gpointer) ((guintptr) _tmp5_), (GObject*) _tmp7_);
	_g_object_unref0 (_tmp7_);
	_g_object_unref0 (_tmp4_);
	_tmp8_ = self->signal_map;
	_tmp9_ = objects_filters_scheduled_get_default ();
	_tmp10_ = _tmp9_;
	_tmp11_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp10_, "filter-removed", (GCallback) ___lambda812__objects_base_object_filter_removed, self, 0);
	_tmp12_ = objects_filters_scheduled_get_default ();
	_tmp13_ = _tmp12_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp8_, (gpointer) ((guintptr) _tmp11_), (GObject*) _tmp13_);
	_g_object_unref0 (_tmp13_);
	_g_object_unref0 (_tmp10_);
	_tmp14_ = self->signal_map;
	_tmp15_ = objects_filters_scheduled_get_default ();
	_tmp16_ = _tmp15_;
	_tmp17_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp16_, "filter-updated", (GCallback) ___lambda813__objects_base_object_filter_updated, self, 0);
	_tmp18_ = objects_filters_scheduled_get_default ();
	_tmp19_ = _tmp18_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp14_, (gpointer) ((guintptr) _tmp17_), (GObject*) _tmp19_);
	_g_object_unref0 (_tmp19_);
	_g_object_unref0 (_tmp16_);
	_tmp20_ = self->signal_map;
	_tmp21_ = services_settings_get_default ();
	_tmp22_ = _tmp21_;
	_tmp23_ = _tmp22_->settings;
	_tmp24_ = g_signal_connect_object (_tmp23_, "changed::scheduled-sort-order", (GCallback) ___lambda814__g_settings_changed, self, 0);
	_tmp25_ = services_settings_get_default ();
	_tmp26_ = _tmp25_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp20_, (gpointer) ((guintptr) _tmp24_), (GObject*) _tmp26_);
	_g_object_unref0 (_tmp26_);
	_g_object_unref0 (_tmp22_);
}

static WidgetsEventsList*
views_scheduled_scheduled_section_real_create_events_list (ViewsScheduledScheduledSection* self)
{
	WidgetsEventsList* result;
	result = NULL;
	return result;
}

WidgetsEventsList*
views_scheduled_scheduled_section_create_events_list (ViewsScheduledScheduledSection* self)
{
	ViewsScheduledScheduledSectionClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = VIEWS_SCHEDULED_SCHEDULED_SECTION_GET_CLASS (self);
	if (_klass_->create_events_list) {
		return _klass_->create_events_list (self);
	}
	return NULL;
}

static void
__lambda815_ (ViewsScheduledScheduledSection* self)
{
	GtkRevealer* _tmp0_;
	WidgetsEventsList* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	_tmp0_ = self->event_list_revealer;
	_tmp1_ = self->event_list;
	_tmp2_ = widgets_events_list_get_has_items (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, _tmp3_);
}

static void
___lambda815__widgets_events_list_change (WidgetsEventsList* _sender,
                                          gpointer self)
{
	__lambda815_ ((ViewsScheduledScheduledSection*) self);
}

void
views_scheduled_scheduled_section_setup_events (ViewsScheduledScheduledSection* self,
                                                GtkBox* header_content)
{
	WidgetsEventsList* _tmp0_;
	WidgetsEventsList* _tmp1_;
	WidgetsEventsList* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	WidgetsEventsList* _tmp5_;
	GtkWidget* _tmp6_;
	GtkRevealer* _tmp7_ = NULL;
	GtkRevealer* _tmp8_;
	GeeHashMap* _tmp9_;
	WidgetsEventsList* _tmp10_;
	gulong _tmp11_;
	WidgetsEventsList* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (header_content != NULL);
	_tmp0_ = views_scheduled_scheduled_section_create_events_list (self);
	_g_object_unref0 (self->event_list);
	self->event_list = _tmp0_;
	_tmp1_ = self->event_list;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = self->event_list;
	_tmp3_ = widgets_events_list_get_has_items (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->event_list;
	_tmp6_ = _g_object_ref0 ((GtkWidget*) _tmp5_);
	_tmp7_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp7_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_reveal_child (_tmp7_, _tmp4_);
	gtk_revealer_set_child (_tmp7_, _tmp6_);
	_g_object_unref0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->event_list_revealer);
	self->event_list_revealer = _tmp7_;
	_tmp8_ = self->event_list_revealer;
	gtk_box_append (header_content, (GtkWidget*) _tmp8_);
	_tmp9_ = self->signal_map;
	_tmp10_ = self->event_list;
	_tmp11_ = g_signal_connect_object (_tmp10_, "change", (GCallback) ___lambda815__widgets_events_list_change, self, 0);
	_tmp12_ = self->event_list;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp9_, (gpointer) ((guintptr) _tmp11_), (GObject*) _tmp12_);
}

GtkBox*
views_scheduled_scheduled_section_create_header (ViewsScheduledScheduledSection* self,
                                                 GtkWidget* title_widget)
{
	GtkBox* header = NULL;
	GtkBox* _tmp0_ = NULL;
	GtkSeparator* _tmp1_ = NULL;
	GtkSeparator* _tmp2_;
	GtkBox* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (title_widget != NULL, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp0_, 30);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp0_, 24);
	g_object_ref_sink (_tmp0_);
	header = _tmp0_;
	gtk_box_append (header, title_widget);
	_tmp1_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp1_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp1_, 3);
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	gtk_box_append (header, (GtkWidget*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	result = header;
	return result;
}

void
views_scheduled_scheduled_section_add_item (ViewsScheduledScheduledSection* self,
                                            ObjectsItem* item)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = self->items;
	_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
	_tmp2_ = _tmp1_;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
		GeeHashMap* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		LayoutsItemRow* _tmp6_;
		LayoutsItemRow* _tmp7_;
		GeeHashMap* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		gpointer _tmp11_;
		LayoutsItemRow* _tmp12_;
		GtkListBox* _tmp13_;
		GeeHashMap* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		gpointer _tmp17_;
		LayoutsItemRow* _tmp18_;
		_tmp3_ = self->items;
		_tmp4_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp5_ = _tmp4_;
		_tmp6_ = layouts_item_row_new (item, FALSE);
		g_object_ref_sink (_tmp6_);
		_tmp7_ = _tmp6_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, _tmp5_, _tmp7_);
		_g_object_unref0 (_tmp7_);
		_tmp8_ = self->items;
		_tmp9_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp10_ = _tmp9_;
		_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp8_, _tmp10_);
		_tmp12_ = (LayoutsItemRow*) _tmp11_;
		layouts_item_row_disable_drag_and_drop (_tmp12_);
		_g_object_unref0 (_tmp12_);
		_tmp13_ = self->listbox;
		_tmp14_ = self->items;
		_tmp15_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp16_ = _tmp15_;
		_tmp17_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp14_, _tmp16_);
		_tmp18_ = (LayoutsItemRow*) _tmp17_;
		gtk_list_box_append (_tmp13_, (GtkWidget*) _tmp18_);
		_g_object_unref0 (_tmp18_);
	}
}

static void
views_scheduled_scheduled_section_real_valid_add_item (ViewsScheduledScheduledSection* self,
                                                       ObjectsItem* item)
{
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GtkRevealer* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	g_return_if_fail (item != NULL);
	_tmp1_ = self->items;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
	_tmp3_ = _tmp2_;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, _tmp3_)) {
		_tmp0_ = views_scheduled_scheduled_section_valid_item_predicate (self, item);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		views_scheduled_scheduled_section_add_item (self, item);
	}
	_tmp4_ = self->listbox_revealer;
	_tmp5_ = views_scheduled_scheduled_section_get_has_items (self);
	_tmp6_ = _tmp5_;
	gtk_revealer_set_reveal_child (_tmp4_, _tmp6_);
}

void
views_scheduled_scheduled_section_valid_add_item (ViewsScheduledScheduledSection* self,
                                                  ObjectsItem* item)
{
	ViewsScheduledScheduledSectionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = VIEWS_SCHEDULED_SCHEDULED_SECTION_GET_CLASS (self);
	if (_klass_->valid_add_item) {
		_klass_->valid_add_item (self, item);
	}
}

static void
views_scheduled_scheduled_section_real_valid_delete_item (ViewsScheduledScheduledSection* self,
                                                          ObjectsItem* item)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkRevealer* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	g_return_if_fail (item != NULL);
	_tmp0_ = self->items;
	_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
	_tmp2_ = _tmp1_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
		GeeHashMap* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gpointer _tmp6_;
		LayoutsItemRow* _tmp7_;
		GeeHashMap* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp3_ = self->items;
		_tmp4_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp3_, _tmp5_);
		_tmp7_ = (LayoutsItemRow*) _tmp6_;
		layouts_item_base_hide_destroy ((LayoutsItemBase*) _tmp7_);
		_g_object_unref0 (_tmp7_);
		_tmp8_ = self->items;
		_tmp9_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp10_ = _tmp9_;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp8_, _tmp10_, NULL);
	}
	_tmp11_ = self->listbox_revealer;
	_tmp12_ = views_scheduled_scheduled_section_get_has_items (self);
	_tmp13_ = _tmp12_;
	gtk_revealer_set_reveal_child (_tmp11_, _tmp13_);
}

void
views_scheduled_scheduled_section_valid_delete_item (ViewsScheduledScheduledSection* self,
                                                     ObjectsItem* item)
{
	ViewsScheduledScheduledSectionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = VIEWS_SCHEDULED_SCHEDULED_SECTION_GET_CLASS (self);
	if (_klass_->valid_delete_item) {
		_klass_->valid_delete_item (self, item);
	}
}

static void
views_scheduled_scheduled_section_real_valid_update_item (ViewsScheduledScheduledSection* self,
                                                          ObjectsItem* item,
                                                          const gchar* update_id)
{
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GtkRevealer* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	g_return_if_fail (item != NULL);
	_tmp1_ = self->items;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
	_tmp3_ = _tmp2_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, _tmp3_)) {
		GeeHashMap* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		gpointer _tmp7_;
		LayoutsItemRow* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp4_ = self->items;
		_tmp5_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp6_ = _tmp5_;
		_tmp7_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp4_, _tmp6_);
		_tmp8_ = (LayoutsItemRow*) _tmp7_;
		_tmp9_ = layouts_item_base_get_update_id ((LayoutsItemBase*) _tmp8_);
		_tmp10_ = _tmp9_;
		_tmp0_ = g_strcmp0 (_tmp10_, update_id) != 0;
		_g_object_unref0 (_tmp8_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GeeHashMap* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		gpointer _tmp14_;
		LayoutsItemRow* _tmp15_;
		_tmp11_ = self->items;
		_tmp12_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp13_ = _tmp12_;
		_tmp14_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp11_, _tmp13_);
		_tmp15_ = (LayoutsItemRow*) _tmp14_;
		layouts_item_base_update_request ((LayoutsItemBase*) _tmp15_);
		_g_object_unref0 (_tmp15_);
	}
	_tmp16_ = self->listbox_revealer;
	_tmp17_ = views_scheduled_scheduled_section_get_has_items (self);
	_tmp18_ = _tmp17_;
	gtk_revealer_set_reveal_child (_tmp16_, _tmp18_);
}

void
views_scheduled_scheduled_section_valid_update_item (ViewsScheduledScheduledSection* self,
                                                     ObjectsItem* item,
                                                     const gchar* update_id)
{
	ViewsScheduledScheduledSectionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = VIEWS_SCHEDULED_SCHEDULED_SECTION_GET_CLASS (self);
	if (_klass_->valid_update_item) {
		_klass_->valid_update_item (self, item, update_id);
	}
}

static void
_views_scheduled_scheduled_section_valid_add_item_services_store_item_added (ServicesStore* _sender,
                                                                             ObjectsItem* item,
                                                                             gboolean insert,
                                                                             gpointer self)
{
	views_scheduled_scheduled_section_valid_add_item ((ViewsScheduledScheduledSection*) self, item);
}

static void
_views_scheduled_scheduled_section_valid_delete_item_services_store_item_deleted (ServicesStore* _sender,
                                                                                  ObjectsItem* item,
                                                                                  gpointer self)
{
	views_scheduled_scheduled_section_valid_delete_item ((ViewsScheduledScheduledSection*) self, item);
}

static void
_views_scheduled_scheduled_section_valid_update_item_services_store_item_updated (ServicesStore* _sender,
                                                                                  ObjectsItem* item,
                                                                                  const gchar* update_id,
                                                                                  gpointer self)
{
	views_scheduled_scheduled_section_valid_update_item ((ViewsScheduledScheduledSection*) self, item, update_id);
}

static void
_views_scheduled_scheduled_section_valid_delete_item_services_store_item_archived (ServicesStore* _sender,
                                                                                   ObjectsItem* item,
                                                                                   gpointer self)
{
	views_scheduled_scheduled_section_valid_delete_item ((ViewsScheduledScheduledSection*) self, item);
}

static void
_views_scheduled_scheduled_section_valid_add_item_services_store_item_unarchived (ServicesStore* _sender,
                                                                                  ObjectsItem* item,
                                                                                  gpointer self)
{
	views_scheduled_scheduled_section_valid_add_item ((ViewsScheduledScheduledSection*) self, item);
}

void
views_scheduled_scheduled_section_setup_item_signals (ViewsScheduledScheduledSection* self)
{
	GeeHashMap* _tmp0_;
	ServicesStore* _tmp1_;
	gulong _tmp2_;
	ServicesStore* _tmp3_;
	GeeHashMap* _tmp4_;
	ServicesStore* _tmp5_;
	gulong _tmp6_;
	ServicesStore* _tmp7_;
	GeeHashMap* _tmp8_;
	ServicesStore* _tmp9_;
	gulong _tmp10_;
	ServicesStore* _tmp11_;
	GeeHashMap* _tmp12_;
	ServicesStore* _tmp13_;
	gulong _tmp14_;
	ServicesStore* _tmp15_;
	GeeHashMap* _tmp16_;
	ServicesStore* _tmp17_;
	gulong _tmp18_;
	ServicesStore* _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->signal_map;
	_tmp1_ = services_store_instance ();
	_tmp2_ = g_signal_connect_object (_tmp1_, "item-added", (GCallback) _views_scheduled_scheduled_section_valid_add_item_services_store_item_added, self, 0);
	_tmp3_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, (gpointer) ((guintptr) _tmp2_), (GObject*) _tmp3_);
	_tmp4_ = self->signal_map;
	_tmp5_ = services_store_instance ();
	_tmp6_ = g_signal_connect_object (_tmp5_, "item-deleted", (GCallback) _views_scheduled_scheduled_section_valid_delete_item_services_store_item_deleted, self, 0);
	_tmp7_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp4_, (gpointer) ((guintptr) _tmp6_), (GObject*) _tmp7_);
	_tmp8_ = self->signal_map;
	_tmp9_ = services_store_instance ();
	_tmp10_ = g_signal_connect_object (_tmp9_, "item-updated", (GCallback) _views_scheduled_scheduled_section_valid_update_item_services_store_item_updated, self, 0);
	_tmp11_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp8_, (gpointer) ((guintptr) _tmp10_), (GObject*) _tmp11_);
	_tmp12_ = self->signal_map;
	_tmp13_ = services_store_instance ();
	_tmp14_ = g_signal_connect_object (_tmp13_, "item-archived", (GCallback) _views_scheduled_scheduled_section_valid_delete_item_services_store_item_archived, self, 0);
	_tmp15_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp12_, (gpointer) ((guintptr) _tmp14_), (GObject*) _tmp15_);
	_tmp16_ = self->signal_map;
	_tmp17_ = services_store_instance ();
	_tmp18_ = g_signal_connect_object (_tmp17_, "item-unarchived", (GCallback) _views_scheduled_scheduled_section_valid_add_item_services_store_item_unarchived, self, 0);
	_tmp19_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp16_, (gpointer) ((guintptr) _tmp18_), (GObject*) _tmp19_);
}

static void
views_scheduled_scheduled_section_real_cleanup_signals (ViewsScheduledScheduledSection* self)
{
	GeeHashMap* _tmp25_;
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->signal_map;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			gboolean _tmp9_ = FALSE;
			GeeMapEntry* _tmp10_;
			gconstpointer _tmp11_;
			gconstpointer _tmp12_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp10_ = entry;
			_tmp11_ = gee_map_entry_get_value (_tmp10_);
			_tmp12_ = _tmp11_;
			if (((GObject*) _tmp12_) != NULL) {
				GeeMapEntry* _tmp13_;
				gconstpointer _tmp14_;
				gconstpointer _tmp15_;
				GeeMapEntry* _tmp16_;
				gconstpointer _tmp17_;
				gconstpointer _tmp18_;
				_tmp13_ = entry;
				_tmp14_ = gee_map_entry_get_value (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = entry;
				_tmp17_ = gee_map_entry_get_key (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp9_ = g_signal_handler_is_connected ((GObject*) _tmp15_, (gulong) ((guintptr) _tmp18_));
			} else {
				_tmp9_ = FALSE;
			}
			if (_tmp9_) {
				GeeMapEntry* _tmp19_;
				gconstpointer _tmp20_;
				gconstpointer _tmp21_;
				GeeMapEntry* _tmp22_;
				gconstpointer _tmp23_;
				gconstpointer _tmp24_;
				_tmp19_ = entry;
				_tmp20_ = gee_map_entry_get_value (_tmp19_);
				_tmp21_ = _tmp20_;
				_tmp22_ = entry;
				_tmp23_ = gee_map_entry_get_key (_tmp22_);
				_tmp24_ = _tmp23_;
				g_signal_handler_disconnect ((GObject*) _tmp21_, (gulong) ((guintptr) _tmp24_));
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp25_ = self->signal_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp25_);
}

void
views_scheduled_scheduled_section_cleanup_signals (ViewsScheduledScheduledSection* self)
{
	ViewsScheduledScheduledSectionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = VIEWS_SCHEDULED_SCHEDULED_SECTION_GET_CLASS (self);
	if (_klass_->cleanup_signals) {
		_klass_->cleanup_signals (self);
	}
}

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_);
}

static void
views_scheduled_scheduled_section_real_clean_up (ViewsScheduledScheduledSection* self)
{
	GtkListBox* _tmp0_;
	GtkListBox* _tmp1_;
	Util* _tmp2_;
	Util* _tmp3_;
	GtkListBox* _tmp4_;
	GList* _tmp5_;
	GList* _tmp6_;
	WidgetsEventsList* _tmp9_;
	_tmp0_ = self->listbox;
	gtk_list_box_set_filter_func (_tmp0_, NULL, NULL, NULL);
	_tmp1_ = self->listbox;
	gtk_list_box_set_sort_func (_tmp1_, NULL, NULL, NULL);
	_tmp2_ = util_get_default ();
	_tmp3_ = _tmp2_;
	_tmp4_ = self->listbox;
	_tmp5_ = util_get_children (_tmp3_, _tmp4_);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp3_);
	{
		GList* row_collection = NULL;
		GList* row_it = NULL;
		row_collection = _tmp6_;
		for (row_it = row_collection; row_it != NULL; row_it = row_it->next) {
			GtkListBoxRow* _tmp7_;
			GtkListBoxRow* row = NULL;
			_tmp7_ = _g_object_ref0 ((GtkListBoxRow*) row_it->data);
			row = _tmp7_;
			{
				GtkListBoxRow* _tmp8_;
				_tmp8_ = row;
				layouts_item_base_clean_up ((LayoutsItemBase*) G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, LAYOUTS_TYPE_ITEM_ROW, LayoutsItemRow));
				_g_object_unref0 (row);
			}
		}
		(row_collection == NULL) ? NULL : (row_collection = (_g_list_free__g_object_unref0_ (row_collection), NULL));
	}
	views_scheduled_scheduled_section_cleanup_signals (self);
	_tmp9_ = self->event_list;
	if (_tmp9_ != NULL) {
		WidgetsEventsList* _tmp10_;
		_tmp10_ = self->event_list;
		widgets_events_list_clean_up (_tmp10_);
	}
}

void
views_scheduled_scheduled_section_clean_up (ViewsScheduledScheduledSection* self)
{
	ViewsScheduledScheduledSectionClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = VIEWS_SCHEDULED_SCHEDULED_SECTION_GET_CLASS (self);
	if (_klass_->clean_up) {
		_klass_->clean_up (self);
	}
}

ViewsScheduledScheduledSection*
views_scheduled_scheduled_section_construct (GType object_type)
{
	ViewsScheduledScheduledSection * self = NULL;
	self = (ViewsScheduledScheduledSection*) g_object_new (object_type, NULL);
	return self;
}

gboolean
views_scheduled_scheduled_section_get_has_items (ViewsScheduledScheduledSection* self)
{
	gboolean result;
	GeeHashMap* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->items;
	_tmp1_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_ > 0;
	return result;
}

static void
views_scheduled_scheduled_section_class_init (ViewsScheduledScheduledSectionClass * klass,
                                              gpointer klass_data)
{
	views_scheduled_scheduled_section_parent_class = g_type_class_peek_parent (klass);
	((ViewsScheduledScheduledSectionClass *) klass)->add_items = (void (*) (ViewsScheduledScheduledSection*)) views_scheduled_scheduled_section_real_add_items;
	((ViewsScheduledScheduledSectionClass *) klass)->valid_item_predicate = (gboolean (*) (ViewsScheduledScheduledSection*, ObjectsItem*)) views_scheduled_scheduled_section_real_valid_item_predicate;
	((ViewsScheduledScheduledSectionClass *) klass)->create_events_list = (WidgetsEventsList* (*) (ViewsScheduledScheduledSection*)) views_scheduled_scheduled_section_real_create_events_list;
	((ViewsScheduledScheduledSectionClass *) klass)->valid_add_item = (void (*) (ViewsScheduledScheduledSection*, ObjectsItem*)) views_scheduled_scheduled_section_real_valid_add_item;
	((ViewsScheduledScheduledSectionClass *) klass)->valid_delete_item = (void (*) (ViewsScheduledScheduledSection*, ObjectsItem*)) views_scheduled_scheduled_section_real_valid_delete_item;
	((ViewsScheduledScheduledSectionClass *) klass)->valid_update_item = (void (*) (ViewsScheduledScheduledSection*, ObjectsItem*, const gchar*)) views_scheduled_scheduled_section_real_valid_update_item;
	((ViewsScheduledScheduledSectionClass *) klass)->cleanup_signals = (void (*) (ViewsScheduledScheduledSection*)) views_scheduled_scheduled_section_real_cleanup_signals;
	((ViewsScheduledScheduledSectionClass *) klass)->clean_up = (void (*) (ViewsScheduledScheduledSection*)) views_scheduled_scheduled_section_real_clean_up;
	G_OBJECT_CLASS (klass)->get_property = _vala_views_scheduled_scheduled_section_get_property;
	G_OBJECT_CLASS (klass)->finalize = views_scheduled_scheduled_section_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VIEWS_SCHEDULED_SCHEDULED_SECTION_HAS_ITEMS_PROPERTY, views_scheduled_scheduled_section_properties[VIEWS_SCHEDULED_SCHEDULED_SECTION_HAS_ITEMS_PROPERTY] = g_param_spec_boolean ("has-items", "has-items", "has-items", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
views_scheduled_scheduled_section_instance_init (ViewsScheduledScheduledSection * self,
                                                 gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, LAYOUTS_TYPE_ITEM_ROW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->items = _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->signal_map = _tmp1_;
}

static void
views_scheduled_scheduled_section_finalize (GObject * obj)
{
	ViewsScheduledScheduledSection * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION, ViewsScheduledScheduledSection);
	_g_object_unref0 (self->listbox);
	_g_object_unref0 (self->listbox_revealer);
	_g_object_unref0 (self->items);
	_g_object_unref0 (self->signal_map);
	_g_object_unref0 (self->event_list);
	_g_object_unref0 (self->event_list_revealer);
	G_OBJECT_CLASS (views_scheduled_scheduled_section_parent_class)->finalize (obj);
}

static GType
views_scheduled_scheduled_section_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ViewsScheduledScheduledSectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) views_scheduled_scheduled_section_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ViewsScheduledScheduledSection), 0, (GInstanceInitFunc) views_scheduled_scheduled_section_instance_init, NULL };
	GType views_scheduled_scheduled_section_type_id;
	views_scheduled_scheduled_section_type_id = g_type_register_static (gtk_list_box_row_get_type (), "ViewsScheduledScheduledSection", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return views_scheduled_scheduled_section_type_id;
}

GType
views_scheduled_scheduled_section_get_type (void)
{
	static volatile gsize views_scheduled_scheduled_section_type_id__once = 0;
	if (g_once_init_enter (&views_scheduled_scheduled_section_type_id__once)) {
		GType views_scheduled_scheduled_section_type_id;
		views_scheduled_scheduled_section_type_id = views_scheduled_scheduled_section_get_type_once ();
		g_once_init_leave (&views_scheduled_scheduled_section_type_id__once, views_scheduled_scheduled_section_type_id);
	}
	return views_scheduled_scheduled_section_type_id__once;
}

static void
_vala_views_scheduled_scheduled_section_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec)
{
	ViewsScheduledScheduledSection * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION, ViewsScheduledScheduledSection);
	switch (property_id) {
		case VIEWS_SCHEDULED_SCHEDULED_SECTION_HAS_ITEMS_PROPERTY:
		g_value_set_boolean (value, views_scheduled_scheduled_section_get_has_items (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

