/* ScheduledRange.c generated by valac 0.56.19, the Vala compiler
 * generated from ScheduledRange.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>

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

#define VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE (views_scheduled_scheduled_range_get_type ())
#define VIEWS_SCHEDULED_SCHEDULED_RANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE, ViewsScheduledScheduledRange))
#define VIEWS_SCHEDULED_SCHEDULED_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE, ViewsScheduledScheduledRangeClass))
#define VIEWS_SCHEDULED_IS_SCHEDULED_RANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE))
#define VIEWS_SCHEDULED_IS_SCHEDULED_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE))
#define VIEWS_SCHEDULED_SCHEDULED_RANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE, ViewsScheduledScheduledRangeClass))

typedef struct _ViewsScheduledScheduledRange ViewsScheduledScheduledRange;
typedef struct _ViewsScheduledScheduledRangeClass ViewsScheduledScheduledRangeClass;
typedef struct _ViewsScheduledScheduledRangePrivate ViewsScheduledScheduledRangePrivate;
enum  {
	VIEWS_SCHEDULED_SCHEDULED_RANGE_0_PROPERTY,
	VIEWS_SCHEDULED_SCHEDULED_RANGE_START_DATE_PROPERTY,
	VIEWS_SCHEDULED_SCHEDULED_RANGE_END_DATE_PROPERTY,
	VIEWS_SCHEDULED_SCHEDULED_RANGE_NUM_PROPERTIES
};
static GParamSpec* views_scheduled_scheduled_range_properties[VIEWS_SCHEDULED_SCHEDULED_RANGE_NUM_PROPERTIES];
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#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);
};

struct _ViewsScheduledScheduledRange {
	ViewsScheduledScheduledSection parent_instance;
	ViewsScheduledScheduledRangePrivate * priv;
};

struct _ViewsScheduledScheduledRangeClass {
	ViewsScheduledScheduledSectionClass parent_class;
};

struct _ViewsScheduledScheduledRangePrivate {
	GDateTime* _start_date;
	GDateTime* _end_date;
	GtkBox* header_content;
};

static gint ViewsScheduledScheduledRange_private_offset;
static gpointer views_scheduled_scheduled_range_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 GType views_scheduled_scheduled_range_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewsScheduledScheduledRange, 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 void views_scheduled_scheduled_section_valid_update_item (ViewsScheduledScheduledSection* self,
                                                          ObjectsItem* item,
                                                          const gchar* update_id);
VALA_EXTERN WidgetsEventsList* views_scheduled_scheduled_section_create_events_list (ViewsScheduledScheduledSection* self);
VALA_EXTERN ViewsScheduledScheduledRange* views_scheduled_scheduled_range_new (GDateTime* start_date,
                                                                   GDateTime* end_date);
VALA_EXTERN ViewsScheduledScheduledRange* views_scheduled_scheduled_range_construct (GType object_type,
                                                                         GDateTime* start_date,
                                                                         GDateTime* end_date);
static void views_scheduled_scheduled_range_real_add_items (ViewsScheduledScheduledSection* base);
VALA_EXTERN GDateTime* views_scheduled_scheduled_range_get_start_date (ViewsScheduledScheduledRange* self);
VALA_EXTERN GDateTime* views_scheduled_scheduled_range_get_end_date (ViewsScheduledScheduledRange* self);
VALA_EXTERN void views_scheduled_scheduled_section_add_item (ViewsScheduledScheduledSection* self,
                                                 ObjectsItem* item);
static gboolean views_scheduled_scheduled_range_real_valid_item_predicate (ViewsScheduledScheduledSection* base,
                                                                    ObjectsItem* item);
static void views_scheduled_scheduled_range_real_valid_update_item (ViewsScheduledScheduledSection* base,
                                                             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 layouts_item_base_hide_destroy (LayoutsItemBase* self);
VALA_EXTERN void views_scheduled_scheduled_section_valid_add_item (ViewsScheduledScheduledSection* self,
                                                       ObjectsItem* item);
VALA_EXTERN gboolean views_scheduled_scheduled_section_get_has_items (ViewsScheduledScheduledSection* self);
static WidgetsEventsList* views_scheduled_scheduled_range_real_create_events_list (ViewsScheduledScheduledSection* base);
VALA_EXTERN WidgetsEventsList* widgets_events_list_new_for_range (GDateTime* start_date,
                                                      GDateTime* end_date);
VALA_EXTERN WidgetsEventsList* widgets_events_list_construct_for_range (GType object_type,
                                                            GDateTime* start_date,
                                                            GDateTime* end_date);
static void views_scheduled_scheduled_range_set_start_date (ViewsScheduledScheduledRange* self,
                                                     GDateTime* value);
static void views_scheduled_scheduled_range_set_end_date (ViewsScheduledScheduledRange* self,
                                                   GDateTime* value);
static GObject * views_scheduled_scheduled_range_constructor (GType type,
                                                       guint n_construct_properties,
                                                       GObjectConstructParam * construct_properties);
VALA_EXTERN GtkBox* views_scheduled_scheduled_section_create_header (ViewsScheduledScheduledSection* self,
                                                         GtkWidget* title_widget);
VALA_EXTERN void views_scheduled_scheduled_section_setup_events (ViewsScheduledScheduledSection* self,
                                                     GtkBox* header_content);
static gboolean _views_scheduled_scheduled_range___lambda823_ (ViewsScheduledScheduledRange* self);
static gboolean __views_scheduled_scheduled_range___lambda823__gsource_func (gpointer self);
VALA_EXTERN void views_scheduled_scheduled_section_setup_listbox (ViewsScheduledScheduledSection* self);
VALA_EXTERN void views_scheduled_scheduled_section_setup_item_signals (ViewsScheduledScheduledSection* self);
static void _views_scheduled_scheduled_range___lambda824_ (ViewsScheduledScheduledRange* self,
                                                    ObjectsItem* item);
static void __views_scheduled_scheduled_range___lambda824__services_event_bus_item_moved (ServicesEventBus* _sender,
                                                                                   ObjectsItem* item,
                                                                                   const gchar* old_project_id,
                                                                                   const gchar* old_section_id,
                                                                                   const gchar* old_parent_id,
                                                                                   gpointer self);
static void _views_scheduled_scheduled_range___lambda825_ (ViewsScheduledScheduledRange* self,
                                                    gboolean active,
                                                    const gchar* focused_item_id);
static void __views_scheduled_scheduled_range___lambda825__services_event_bus_dim_content (ServicesEventBus* _sender,
                                                                                    gboolean active,
                                                                                    const gchar* focused_item_id,
                                                                                    gpointer self);
static void views_scheduled_scheduled_range_finalize (GObject * obj);
static GType views_scheduled_scheduled_range_get_type_once (void);
static void _vala_views_scheduled_scheduled_range_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static void _vala_views_scheduled_scheduled_range_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
views_scheduled_scheduled_range_get_instance_private (ViewsScheduledScheduledRange* self)
{
	return G_STRUCT_MEMBER_P (self, ViewsScheduledScheduledRange_private_offset);
}

ViewsScheduledScheduledRange*
views_scheduled_scheduled_range_construct (GType object_type,
                                           GDateTime* start_date,
                                           GDateTime* end_date)
{
	ViewsScheduledScheduledRange * self = NULL;
	g_return_val_if_fail (start_date != NULL, NULL);
	g_return_val_if_fail (end_date != NULL, NULL);
	self = (ViewsScheduledScheduledRange*) g_object_new (object_type, "start-date", start_date, "end-date", end_date, NULL);
	return self;
}

ViewsScheduledScheduledRange*
views_scheduled_scheduled_range_new (GDateTime* start_date,
                                     GDateTime* end_date)
{
	return views_scheduled_scheduled_range_construct (VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE, start_date, end_date);
}

static void
views_scheduled_scheduled_range_real_add_items (ViewsScheduledScheduledSection* base)
{
	ViewsScheduledScheduledRange * self;
	self = (ViewsScheduledScheduledRange*) base;
	{
		GeeArrayList* _item_list = NULL;
		ServicesStore* _tmp0_;
		GDateTime* _tmp1_;
		GDateTime* _tmp2_;
		GeeArrayList* _tmp3_;
		gint _item_size = 0;
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _item_index = 0;
		_tmp0_ = services_store_instance ();
		_tmp1_ = self->priv->_start_date;
		_tmp2_ = self->priv->_end_date;
		_tmp3_ = services_store_get_items_by_date_range (_tmp0_, _tmp1_, _tmp2_, FALSE);
		_item_list = _tmp3_;
		_tmp4_ = _item_list;
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_item_size = _tmp6_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp9_;
			gpointer _tmp10_;
			ObjectsItem* _tmp11_;
			_item_index = _item_index + 1;
			_tmp7_ = _item_index;
			_tmp8_ = _item_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _item_list;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _item_index);
			item = (ObjectsItem*) _tmp10_;
			_tmp11_ = item;
			views_scheduled_scheduled_section_add_item ((ViewsScheduledScheduledSection*) self, _tmp11_);
			_g_object_unref0 (item);
		}
		_g_object_unref0 (_item_list);
	}
}

static gboolean
views_scheduled_scheduled_range_real_valid_item_predicate (ViewsScheduledScheduledSection* base,
                                                           ObjectsItem* item)
{
	ViewsScheduledScheduledRange * self;
	ServicesStore* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	gboolean result;
	self = (ViewsScheduledScheduledRange*) base;
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = services_store_instance ();
	_tmp1_ = self->priv->_start_date;
	_tmp2_ = self->priv->_end_date;
	result = services_store_valid_item_by_date_range (_tmp0_, item, _tmp1_, _tmp2_, FALSE);
	return result;
}

static void
views_scheduled_scheduled_range_real_valid_update_item (ViewsScheduledScheduledSection* base,
                                                        ObjectsItem* item,
                                                        const gchar* update_id)
{
	ViewsScheduledScheduledRange * self;
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gboolean _tmp16_ = FALSE;
	GeeHashMap* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gboolean _tmp32_ = FALSE;
	GeeHashMap* _tmp33_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	gboolean _tmp51_;
	gboolean _tmp52_;
	GtkRevealer* _tmp53_;
	gboolean _tmp54_;
	gboolean _tmp55_;
	self = (ViewsScheduledScheduledRange*) base;
	g_return_if_fail (item != NULL);
	_tmp1_ = ((ViewsScheduledScheduledSection*) 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_ = ((ViewsScheduledScheduledSection*) 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_ = ((ViewsScheduledScheduledSection*) 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_);
	}
	_tmp17_ = ((ViewsScheduledScheduledSection*) self)->items;
	_tmp18_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
	_tmp19_ = _tmp18_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp17_, _tmp19_)) {
		gboolean _tmp20_;
		gboolean _tmp21_;
		_tmp20_ = objects_item_get_has_due (item);
		_tmp21_ = _tmp20_;
		_tmp16_ = !_tmp21_;
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		GeeHashMap* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		gpointer _tmp25_;
		LayoutsItemRow* _tmp26_;
		GeeHashMap* _tmp27_;
		const gchar* _tmp28_;
		const gchar* _tmp29_;
		ServicesEventBus* _tmp30_;
		ServicesEventBus* _tmp31_;
		_tmp22_ = ((ViewsScheduledScheduledSection*) self)->items;
		_tmp23_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp24_ = _tmp23_;
		_tmp25_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp22_, _tmp24_);
		_tmp26_ = (LayoutsItemRow*) _tmp25_;
		layouts_item_base_hide_destroy ((LayoutsItemBase*) _tmp26_);
		_g_object_unref0 (_tmp26_);
		_tmp27_ = ((ViewsScheduledScheduledSection*) self)->items;
		_tmp28_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp29_ = _tmp28_;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp27_, _tmp29_, NULL);
		_tmp30_ = services_event_bus_get_default ();
		_tmp31_ = _tmp30_;
		services_event_bus_unfocus_item (_tmp31_);
		_g_object_unref0 (_tmp31_);
	}
	_tmp33_ = ((ViewsScheduledScheduledSection*) self)->items;
	_tmp34_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
	_tmp35_ = _tmp34_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp33_, _tmp35_)) {
		gboolean _tmp36_;
		gboolean _tmp37_;
		_tmp36_ = objects_item_get_has_due (item);
		_tmp37_ = _tmp36_;
		_tmp32_ = _tmp37_;
	} else {
		_tmp32_ = FALSE;
	}
	if (_tmp32_) {
		ServicesStore* _tmp38_;
		GDateTime* _tmp39_;
		GDateTime* _tmp40_;
		_tmp38_ = services_store_instance ();
		_tmp39_ = self->priv->_start_date;
		_tmp40_ = self->priv->_end_date;
		if (!services_store_valid_item_by_date_range (_tmp38_, item, _tmp39_, _tmp40_, FALSE)) {
			GeeHashMap* _tmp41_;
			const gchar* _tmp42_;
			const gchar* _tmp43_;
			gpointer _tmp44_;
			LayoutsItemRow* _tmp45_;
			GeeHashMap* _tmp46_;
			const gchar* _tmp47_;
			const gchar* _tmp48_;
			ServicesEventBus* _tmp49_;
			ServicesEventBus* _tmp50_;
			_tmp41_ = ((ViewsScheduledScheduledSection*) self)->items;
			_tmp42_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
			_tmp43_ = _tmp42_;
			_tmp44_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp41_, _tmp43_);
			_tmp45_ = (LayoutsItemRow*) _tmp44_;
			layouts_item_base_hide_destroy ((LayoutsItemBase*) _tmp45_);
			_g_object_unref0 (_tmp45_);
			_tmp46_ = ((ViewsScheduledScheduledSection*) self)->items;
			_tmp47_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
			_tmp48_ = _tmp47_;
			gee_abstract_map_unset ((GeeAbstractMap*) _tmp46_, _tmp48_, NULL);
			_tmp49_ = services_event_bus_get_default ();
			_tmp50_ = _tmp49_;
			services_event_bus_unfocus_item (_tmp50_);
			_g_object_unref0 (_tmp50_);
		}
	}
	_tmp51_ = objects_item_get_has_due (item);
	_tmp52_ = _tmp51_;
	if (_tmp52_) {
		views_scheduled_scheduled_section_valid_add_item ((ViewsScheduledScheduledSection*) self, item);
	}
	_tmp53_ = ((ViewsScheduledScheduledSection*) self)->listbox_revealer;
	_tmp54_ = views_scheduled_scheduled_section_get_has_items ((ViewsScheduledScheduledSection*) self);
	_tmp55_ = _tmp54_;
	gtk_revealer_set_reveal_child (_tmp53_, _tmp55_);
}

static WidgetsEventsList*
views_scheduled_scheduled_range_real_create_events_list (ViewsScheduledScheduledSection* base)
{
	ViewsScheduledScheduledRange * self;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	WidgetsEventsList* _tmp2_ = NULL;
	WidgetsEventsList* result;
	self = (ViewsScheduledScheduledRange*) base;
	_tmp0_ = self->priv->_start_date;
	_tmp1_ = self->priv->_end_date;
	_tmp2_ = widgets_events_list_new_for_range (_tmp0_, _tmp1_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp2_, 6);
	g_object_ref_sink (_tmp2_);
	result = _tmp2_;
	return result;
}

GDateTime*
views_scheduled_scheduled_range_get_start_date (ViewsScheduledScheduledRange* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_start_date;
	result = _tmp0_;
	return result;
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

static void
views_scheduled_scheduled_range_set_start_date (ViewsScheduledScheduledRange* self,
                                                GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = views_scheduled_scheduled_range_get_start_date (self);
	if (old_value != value) {
		GDateTime* _tmp0_;
		_tmp0_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_start_date);
		self->priv->_start_date = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, views_scheduled_scheduled_range_properties[VIEWS_SCHEDULED_SCHEDULED_RANGE_START_DATE_PROPERTY]);
	}
}

GDateTime*
views_scheduled_scheduled_range_get_end_date (ViewsScheduledScheduledRange* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_end_date;
	result = _tmp0_;
	return result;
}

static void
views_scheduled_scheduled_range_set_end_date (ViewsScheduledScheduledRange* self,
                                              GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = views_scheduled_scheduled_range_get_end_date (self);
	if (old_value != value) {
		GDateTime* _tmp0_;
		_tmp0_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_end_date);
		self->priv->_end_date = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, views_scheduled_scheduled_range_properties[VIEWS_SCHEDULED_SCHEDULED_RANGE_END_DATE_PROPERTY]);
	}
}

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

static gboolean
_views_scheduled_scheduled_range___lambda823_ (ViewsScheduledScheduledRange* self)
{
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	_tmp0_ = ((ViewsScheduledScheduledSection*) self)->listbox_revealer;
	_tmp1_ = views_scheduled_scheduled_section_get_has_items ((ViewsScheduledScheduledSection*) self);
	_tmp2_ = _tmp1_;
	gtk_revealer_set_reveal_child (_tmp0_, _tmp2_);
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
__views_scheduled_scheduled_range___lambda823__gsource_func (gpointer self)
{
	gboolean result;
	result = _views_scheduled_scheduled_range___lambda823_ ((ViewsScheduledScheduledRange*) self);
	return result;
}

static void
_views_scheduled_scheduled_range___lambda824_ (ViewsScheduledScheduledRange* self,
                                               ObjectsItem* item)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (item != NULL);
	_tmp0_ = ((ViewsScheduledScheduledSection*) 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_;
		_tmp3_ = ((ViewsScheduledScheduledSection*) 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_update_request ((LayoutsItemBase*) _tmp7_);
		_g_object_unref0 (_tmp7_);
	}
}

static void
__views_scheduled_scheduled_range___lambda824__services_event_bus_item_moved (ServicesEventBus* _sender,
                                                                              ObjectsItem* item,
                                                                              const gchar* old_project_id,
                                                                              const gchar* old_section_id,
                                                                              const gchar* old_parent_id,
                                                                              gpointer self)
{
	_views_scheduled_scheduled_range___lambda824_ ((ViewsScheduledScheduledRange*) self, item);
}

static void
_views_scheduled_scheduled_range___lambda825_ (ViewsScheduledScheduledRange* self,
                                               gboolean active,
                                               const gchar* focused_item_id)
{
	GtkBox* _tmp0_;
	g_return_if_fail (focused_item_id != NULL);
	_tmp0_ = self->priv->header_content;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, !active);
}

static void
__views_scheduled_scheduled_range___lambda825__services_event_bus_dim_content (ServicesEventBus* _sender,
                                                                               gboolean active,
                                                                               const gchar* focused_item_id,
                                                                               gpointer self)
{
	_views_scheduled_scheduled_range___lambda825_ ((ViewsScheduledScheduledRange*) self, active, focused_item_id);
}

static GObject *
views_scheduled_scheduled_range_constructor (GType type,
                                             guint n_construct_properties,
                                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ViewsScheduledScheduledRange * self;
	GtkLabel* month_label = NULL;
	GDateTime* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* date_range_label = NULL;
	GDateTime* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GDateTime* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	GtkLabel* _tmp14_ = NULL;
	GtkLabel* _tmp15_;
	GtkLabel* _tmp16_;
	GtkBox* title_box = NULL;
	GtkBox* _tmp17_ = NULL;
	GtkBox* _tmp18_;
	GtkLabel* _tmp19_;
	GtkBox* _tmp20_;
	GtkLabel* _tmp21_;
	GtkBox* _tmp22_;
	GtkBox* _tmp23_;
	GtkBox* _tmp24_;
	gchar* _tmp25_;
	gchar** _tmp26_;
	GtkListBox* _tmp27_ = NULL;
	GtkGrid* listbox_grid = NULL;
	GtkGrid* _tmp28_ = NULL;
	GtkGrid* _tmp29_;
	GtkListBox* _tmp30_;
	gboolean _tmp31_;
	gboolean _tmp32_;
	GtkGrid* _tmp33_;
	GtkWidget* _tmp34_;
	GtkRevealer* _tmp35_ = NULL;
	GtkBox* content = NULL;
	GtkBox* _tmp36_ = NULL;
	GtkBox* _tmp37_;
	GtkBox* _tmp38_;
	GtkBox* _tmp39_;
	GtkRevealer* _tmp40_;
	GtkBox* _tmp41_;
	GtkRevealer* _tmp42_;
	guint _tmp43_;
	guint _tmp44_;
	GeeHashMap* _tmp45_;
	ServicesEventBus* _tmp46_;
	ServicesEventBus* _tmp47_;
	gulong _tmp48_;
	ServicesEventBus* _tmp49_;
	ServicesEventBus* _tmp50_;
	GeeHashMap* _tmp51_;
	ServicesEventBus* _tmp52_;
	ServicesEventBus* _tmp53_;
	gulong _tmp54_;
	ServicesEventBus* _tmp55_;
	ServicesEventBus* _tmp56_;
	parent_class = G_OBJECT_CLASS (views_scheduled_scheduled_range_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE, ViewsScheduledScheduledRange);
	gtk_widget_add_css_class ((GtkWidget*) self, "no-selectable");
	gtk_widget_add_css_class ((GtkWidget*) self, "transition");
	gtk_widget_add_css_class ((GtkWidget*) self, "no-padding");
	_tmp0_ = self->priv->_start_date;
	_tmp1_ = g_date_time_format (_tmp0_, "%B");
	_tmp2_ = _tmp1_;
	_tmp3_ = (GtkLabel*) gtk_label_new (_tmp2_);
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	month_label = _tmp4_;
	_tmp5_ = month_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp5_, "font-bold");
	_tmp6_ = self->priv->_start_date;
	_tmp7_ = g_date_time_format (_tmp6_, "%d");
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->_end_date;
	_tmp10_ = g_date_time_format (_tmp9_, "%d");
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strdup_printf ("%s - %s", _tmp8_, _tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = (GtkLabel*) gtk_label_new (_tmp13_);
	gtk_widget_set_halign ((GtkWidget*) _tmp14_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp14_);
	_tmp15_ = _tmp14_;
	_g_free0 (_tmp13_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp8_);
	date_range_label = _tmp15_;
	_tmp16_ = date_range_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp16_, "dimmed");
	_tmp17_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp17_, TRUE);
	g_object_ref_sink (_tmp17_);
	title_box = _tmp17_;
	_tmp18_ = title_box;
	_tmp19_ = month_label;
	gtk_box_append (_tmp18_, (GtkWidget*) _tmp19_);
	_tmp20_ = title_box;
	_tmp21_ = date_range_label;
	gtk_box_append (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = title_box;
	_tmp23_ = views_scheduled_scheduled_section_create_header ((ViewsScheduledScheduledSection*) self, (GtkWidget*) _tmp22_);
	_g_object_unref0 (self->priv->header_content);
	self->priv->header_content = _tmp23_;
	_tmp24_ = self->priv->header_content;
	views_scheduled_scheduled_section_setup_events ((ViewsScheduledScheduledSection*) self, _tmp24_);
	_tmp25_ = g_strdup ("listbox-background");
	_tmp26_ = g_new0 (gchar*, 1 + 1);
	_tmp26_[0] = _tmp25_;
	_tmp27_ = (GtkListBox*) gtk_list_box_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp27_, GTK_ALIGN_START);
	gtk_list_box_set_activate_on_single_click (_tmp27_, TRUE);
	gtk_list_box_set_selection_mode (_tmp27_, GTK_SELECTION_SINGLE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp27_, TRUE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp27_, _tmp26_);
	_tmp26_ = (_vala_array_free (_tmp26_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (((ViewsScheduledScheduledSection*) self)->listbox);
	((ViewsScheduledScheduledSection*) self)->listbox = _tmp27_;
	_tmp28_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp28_, 6);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp28_, 24);
	g_object_ref_sink (_tmp28_);
	listbox_grid = _tmp28_;
	_tmp29_ = listbox_grid;
	_tmp30_ = ((ViewsScheduledScheduledSection*) self)->listbox;
	gtk_grid_attach (_tmp29_, (GtkWidget*) _tmp30_, 0, 0, 1, 1);
	_tmp31_ = views_scheduled_scheduled_section_get_has_items ((ViewsScheduledScheduledSection*) self);
	_tmp32_ = _tmp31_;
	_tmp33_ = listbox_grid;
	_tmp34_ = _g_object_ref0 ((GtkWidget*) _tmp33_);
	_tmp35_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp35_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_reveal_child (_tmp35_, _tmp32_);
	gtk_revealer_set_child (_tmp35_, _tmp34_);
	_g_object_unref0 (_tmp34_);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (((ViewsScheduledScheduledSection*) self)->listbox_revealer);
	((ViewsScheduledScheduledSection*) self)->listbox_revealer = _tmp35_;
	_tmp36_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp36_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp36_, GTK_ALIGN_START);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp36_, 32);
	g_object_ref_sink (_tmp36_);
	content = _tmp36_;
	_tmp37_ = content;
	_tmp38_ = self->priv->header_content;
	gtk_box_append (_tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = content;
	_tmp40_ = ((ViewsScheduledScheduledSection*) self)->listbox_revealer;
	gtk_box_append (_tmp39_, (GtkWidget*) _tmp40_);
	_tmp41_ = content;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp41_);
	_tmp42_ = ((ViewsScheduledScheduledSection*) self)->listbox_revealer;
	_tmp43_ = gtk_revealer_get_transition_duration (_tmp42_);
	_tmp44_ = _tmp43_;
	g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp44_, __views_scheduled_scheduled_range___lambda823__gsource_func, g_object_ref (self), g_object_unref);
	views_scheduled_scheduled_section_setup_listbox ((ViewsScheduledScheduledSection*) self);
	views_scheduled_scheduled_section_setup_item_signals ((ViewsScheduledScheduledSection*) self);
	views_scheduled_scheduled_section_add_items ((ViewsScheduledScheduledSection*) self);
	_tmp45_ = ((ViewsScheduledScheduledSection*) self)->signal_map;
	_tmp46_ = services_event_bus_get_default ();
	_tmp47_ = _tmp46_;
	_tmp48_ = g_signal_connect_object (_tmp47_, "item-moved", (GCallback) __views_scheduled_scheduled_range___lambda824__services_event_bus_item_moved, self, 0);
	_tmp49_ = services_event_bus_get_default ();
	_tmp50_ = _tmp49_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp45_, (gpointer) ((guintptr) _tmp48_), (GObject*) _tmp50_);
	_g_object_unref0 (_tmp50_);
	_g_object_unref0 (_tmp47_);
	_tmp51_ = ((ViewsScheduledScheduledSection*) self)->signal_map;
	_tmp52_ = services_event_bus_get_default ();
	_tmp53_ = _tmp52_;
	_tmp54_ = g_signal_connect_object (_tmp53_, "dim-content", (GCallback) __views_scheduled_scheduled_range___lambda825__services_event_bus_dim_content, self, 0);
	_tmp55_ = services_event_bus_get_default ();
	_tmp56_ = _tmp55_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp51_, (gpointer) ((guintptr) _tmp54_), (GObject*) _tmp56_);
	_g_object_unref0 (_tmp56_);
	_g_object_unref0 (_tmp53_);
	_g_object_unref0 (content);
	_g_object_unref0 (listbox_grid);
	_g_object_unref0 (title_box);
	_g_object_unref0 (date_range_label);
	_g_object_unref0 (month_label);
	return obj;
}

static void
views_scheduled_scheduled_range_class_init (ViewsScheduledScheduledRangeClass * klass,
                                            gpointer klass_data)
{
	views_scheduled_scheduled_range_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ViewsScheduledScheduledRange_private_offset);
	((ViewsScheduledScheduledSectionClass *) klass)->add_items = (void (*) (ViewsScheduledScheduledSection*)) views_scheduled_scheduled_range_real_add_items;
	((ViewsScheduledScheduledSectionClass *) klass)->valid_item_predicate = (gboolean (*) (ViewsScheduledScheduledSection*, ObjectsItem*)) views_scheduled_scheduled_range_real_valid_item_predicate;
	((ViewsScheduledScheduledSectionClass *) klass)->valid_update_item = (void (*) (ViewsScheduledScheduledSection*, ObjectsItem*, const gchar*)) views_scheduled_scheduled_range_real_valid_update_item;
	((ViewsScheduledScheduledSectionClass *) klass)->create_events_list = (WidgetsEventsList* (*) (ViewsScheduledScheduledSection*)) views_scheduled_scheduled_range_real_create_events_list;
	G_OBJECT_CLASS (klass)->get_property = _vala_views_scheduled_scheduled_range_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_views_scheduled_scheduled_range_set_property;
	G_OBJECT_CLASS (klass)->constructor = views_scheduled_scheduled_range_constructor;
	G_OBJECT_CLASS (klass)->finalize = views_scheduled_scheduled_range_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VIEWS_SCHEDULED_SCHEDULED_RANGE_START_DATE_PROPERTY, views_scheduled_scheduled_range_properties[VIEWS_SCHEDULED_SCHEDULED_RANGE_START_DATE_PROPERTY] = g_param_spec_boxed ("start-date", "start-date", "start-date", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), VIEWS_SCHEDULED_SCHEDULED_RANGE_END_DATE_PROPERTY, views_scheduled_scheduled_range_properties[VIEWS_SCHEDULED_SCHEDULED_RANGE_END_DATE_PROPERTY] = g_param_spec_boxed ("end-date", "end-date", "end-date", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
views_scheduled_scheduled_range_instance_init (ViewsScheduledScheduledRange * self,
                                               gpointer klass)
{
	self->priv = views_scheduled_scheduled_range_get_instance_private (self);
}

static void
views_scheduled_scheduled_range_finalize (GObject * obj)
{
	ViewsScheduledScheduledRange * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE, ViewsScheduledScheduledRange);
	g_debug ("ScheduledRange.vala:36: Destroying - Views.Scheduled.ScheduledRange\n");
	_g_date_time_unref0 (self->priv->_start_date);
	_g_date_time_unref0 (self->priv->_end_date);
	_g_object_unref0 (self->priv->header_content);
	G_OBJECT_CLASS (views_scheduled_scheduled_range_parent_class)->finalize (obj);
}

static GType
views_scheduled_scheduled_range_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ViewsScheduledScheduledRangeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) views_scheduled_scheduled_range_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ViewsScheduledScheduledRange), 0, (GInstanceInitFunc) views_scheduled_scheduled_range_instance_init, NULL };
	GType views_scheduled_scheduled_range_type_id;
	views_scheduled_scheduled_range_type_id = g_type_register_static (VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION, "ViewsScheduledScheduledRange", &g_define_type_info, 0);
	ViewsScheduledScheduledRange_private_offset = g_type_add_instance_private (views_scheduled_scheduled_range_type_id, sizeof (ViewsScheduledScheduledRangePrivate));
	return views_scheduled_scheduled_range_type_id;
}

GType
views_scheduled_scheduled_range_get_type (void)
{
	static volatile gsize views_scheduled_scheduled_range_type_id__once = 0;
	if (g_once_init_enter (&views_scheduled_scheduled_range_type_id__once)) {
		GType views_scheduled_scheduled_range_type_id;
		views_scheduled_scheduled_range_type_id = views_scheduled_scheduled_range_get_type_once ();
		g_once_init_leave (&views_scheduled_scheduled_range_type_id__once, views_scheduled_scheduled_range_type_id);
	}
	return views_scheduled_scheduled_range_type_id__once;
}

static void
_vala_views_scheduled_scheduled_range_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	ViewsScheduledScheduledRange * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE, ViewsScheduledScheduledRange);
	switch (property_id) {
		case VIEWS_SCHEDULED_SCHEDULED_RANGE_START_DATE_PROPERTY:
		g_value_set_boxed (value, views_scheduled_scheduled_range_get_start_date (self));
		break;
		case VIEWS_SCHEDULED_SCHEDULED_RANGE_END_DATE_PROPERTY:
		g_value_set_boxed (value, views_scheduled_scheduled_range_get_end_date (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_views_scheduled_scheduled_range_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec)
{
	ViewsScheduledScheduledRange * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VIEWS_SCHEDULED_TYPE_SCHEDULED_RANGE, ViewsScheduledScheduledRange);
	switch (property_id) {
		case VIEWS_SCHEDULED_SCHEDULED_RANGE_START_DATE_PROPERTY:
		views_scheduled_scheduled_range_set_start_date (self, g_value_get_boxed (value));
		break;
		case VIEWS_SCHEDULED_SCHEDULED_RANGE_END_DATE_PROPERTY:
		views_scheduled_scheduled_range_set_end_date (self, g_value_get_boxed (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);
}

