/* ScheduledDay.c generated by valac 0.56.19, the Vala compiler
 * generated from ScheduledDay.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_DAY (views_scheduled_scheduled_day_get_type ())
#define VIEWS_SCHEDULED_SCHEDULED_DAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY, ViewsScheduledScheduledDay))
#define VIEWS_SCHEDULED_SCHEDULED_DAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY, ViewsScheduledScheduledDayClass))
#define VIEWS_SCHEDULED_IS_SCHEDULED_DAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY))
#define VIEWS_SCHEDULED_IS_SCHEDULED_DAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY))
#define VIEWS_SCHEDULED_SCHEDULED_DAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY, ViewsScheduledScheduledDayClass))

typedef struct _ViewsScheduledScheduledDay ViewsScheduledScheduledDay;
typedef struct _ViewsScheduledScheduledDayClass ViewsScheduledScheduledDayClass;
typedef struct _ViewsScheduledScheduledDayPrivate ViewsScheduledScheduledDayPrivate;
enum  {
	VIEWS_SCHEDULED_SCHEDULED_DAY_0_PROPERTY,
	VIEWS_SCHEDULED_SCHEDULED_DAY_DATE_PROPERTY,
	VIEWS_SCHEDULED_SCHEDULED_DAY_NUM_PROPERTIES
};
static GParamSpec* views_scheduled_scheduled_day_properties[VIEWS_SCHEDULED_SCHEDULED_DAY_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 _ViewsScheduledScheduledDay {
	ViewsScheduledScheduledSection parent_instance;
	ViewsScheduledScheduledDayPrivate * priv;
};

struct _ViewsScheduledScheduledDayClass {
	ViewsScheduledScheduledSectionClass parent_class;
};

struct _ViewsScheduledScheduledDayPrivate {
	GDateTime* _date;
	GtkBox* header_content;
};

static gint ViewsScheduledScheduledDay_private_offset;
static gpointer views_scheduled_scheduled_day_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_day_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewsScheduledScheduledDay, 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_update_item (ViewsScheduledScheduledSection* self,
                                                          ObjectsItem* item,
                                                          const gchar* update_id);
VALA_EXTERN ViewsScheduledScheduledDay* views_scheduled_scheduled_day_new (GDateTime* date);
VALA_EXTERN ViewsScheduledScheduledDay* views_scheduled_scheduled_day_construct (GType object_type,
                                                                     GDateTime* date);
static void views_scheduled_scheduled_day_real_add_items (ViewsScheduledScheduledSection* base);
VALA_EXTERN GDateTime* views_scheduled_scheduled_day_get_date (ViewsScheduledScheduledDay* self);
VALA_EXTERN void views_scheduled_scheduled_section_add_item (ViewsScheduledScheduledSection* self,
                                                 ObjectsItem* item);
static gboolean views_scheduled_scheduled_day_real_valid_item_predicate (ViewsScheduledScheduledSection* base,
                                                                  ObjectsItem* item);
static WidgetsEventsList* views_scheduled_scheduled_day_real_create_events_list (ViewsScheduledScheduledSection* base);
VALA_EXTERN WidgetsEventsList* widgets_events_list_new_for_day (GDateTime* start_date);
VALA_EXTERN WidgetsEventsList* widgets_events_list_construct_for_day (GType object_type,
                                                          GDateTime* start_date);
static void views_scheduled_scheduled_day_real_valid_add_item (ViewsScheduledScheduledSection* base,
                                                        ObjectsItem* item);
static void views_scheduled_scheduled_day_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 gboolean views_scheduled_scheduled_section_get_has_items (ViewsScheduledScheduledSection* self);
static void views_scheduled_scheduled_day_set_date (ViewsScheduledScheduledDay* self,
                                             GDateTime* value);
static GObject * views_scheduled_scheduled_day_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);
VALA_EXTERN void views_scheduled_scheduled_section_setup_listbox (ViewsScheduledScheduledSection* self);
VALA_EXTERN void views_scheduled_scheduled_section_setup_item_signals (ViewsScheduledScheduledSection* self);
static gboolean _views_scheduled_scheduled_day___lambda820_ (ViewsScheduledScheduledDay* self);
static gboolean __views_scheduled_scheduled_day___lambda820__gsource_func (gpointer self);
static void _views_scheduled_scheduled_day___lambda821_ (ViewsScheduledScheduledDay* self,
                                                  ObjectsItem* item);
static void __views_scheduled_scheduled_day___lambda821__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_day___lambda822_ (ViewsScheduledScheduledDay* self,
                                                  gboolean active,
                                                  const gchar* focused_item_id);
static void __views_scheduled_scheduled_day___lambda822__services_event_bus_dim_content (ServicesEventBus* _sender,
                                                                                  gboolean active,
                                                                                  const gchar* focused_item_id,
                                                                                  gpointer self);
static void views_scheduled_scheduled_day_finalize (GObject * obj);
static GType views_scheduled_scheduled_day_get_type_once (void);
static void _vala_views_scheduled_scheduled_day_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_views_scheduled_scheduled_day_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_day_get_instance_private (ViewsScheduledScheduledDay* self)
{
	return G_STRUCT_MEMBER_P (self, ViewsScheduledScheduledDay_private_offset);
}

ViewsScheduledScheduledDay*
views_scheduled_scheduled_day_construct (GType object_type,
                                         GDateTime* date)
{
	ViewsScheduledScheduledDay * self = NULL;
	g_return_val_if_fail (date != NULL, NULL);
	self = (ViewsScheduledScheduledDay*) g_object_new (object_type, "date", date, NULL);
	return self;
}

ViewsScheduledScheduledDay*
views_scheduled_scheduled_day_new (GDateTime* date)
{
	return views_scheduled_scheduled_day_construct (VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY, date);
}

static void
views_scheduled_scheduled_day_real_add_items (ViewsScheduledScheduledSection* base)
{
	ViewsScheduledScheduledDay * self;
	GDateTime* _tmp11_;
	self = (ViewsScheduledScheduledDay*) base;
	{
		GeeArrayList* _item_list = NULL;
		ServicesStore* _tmp0_;
		GDateTime* _tmp1_;
		GeeArrayList* _tmp2_;
		gint _item_size = 0;
		GeeArrayList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _item_index = 0;
		_tmp0_ = services_store_instance ();
		_tmp1_ = self->priv->_date;
		_tmp2_ = services_store_get_items_by_date (_tmp0_, _tmp1_, FALSE);
		_item_list = _tmp2_;
		_tmp3_ = _item_list;
		_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_item_size = _tmp5_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp8_;
			gpointer _tmp9_;
			ObjectsItem* _tmp10_;
			_item_index = _item_index + 1;
			_tmp6_ = _item_index;
			_tmp7_ = _item_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _item_list;
			_tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _item_index);
			item = (ObjectsItem*) _tmp9_;
			_tmp10_ = item;
			views_scheduled_scheduled_section_add_item ((ViewsScheduledScheduledSection*) self, _tmp10_);
			_g_object_unref0 (item);
		}
		_g_object_unref0 (_item_list);
	}
	_tmp11_ = self->priv->_date;
	if (utils_datetime_is_today (_tmp11_)) {
		{
			GeeArrayList* _item_list = NULL;
			ServicesStore* _tmp12_;
			GeeArrayList* _tmp13_;
			GeeArrayList* _tmp14_;
			gint _item_size = 0;
			GeeArrayList* _tmp15_;
			gint _tmp16_;
			gint _tmp17_;
			gint _item_index = 0;
			_tmp12_ = services_store_instance ();
			_tmp13_ = services_store_get_items (_tmp12_);
			_tmp14_ = _tmp13_;
			_item_list = _tmp14_;
			_tmp15_ = _item_list;
			_tmp16_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp15_);
			_tmp17_ = _tmp16_;
			_item_size = _tmp17_;
			_item_index = -1;
			while (TRUE) {
				gint _tmp18_;
				gint _tmp19_;
				ObjectsItem* item = NULL;
				GeeArrayList* _tmp20_;
				gpointer _tmp21_;
				gboolean _tmp22_ = FALSE;
				gboolean _tmp23_ = FALSE;
				ObjectsItem* _tmp24_;
				gboolean _tmp25_;
				gboolean _tmp26_;
				_item_index = _item_index + 1;
				_tmp18_ = _item_index;
				_tmp19_ = _item_size;
				if (!(_tmp18_ < _tmp19_)) {
					break;
				}
				_tmp20_ = _item_list;
				_tmp21_ = gee_abstract_list_get ((GeeAbstractList*) _tmp20_, _item_index);
				item = (ObjectsItem*) _tmp21_;
				_tmp24_ = item;
				_tmp25_ = objects_item_get_checked (_tmp24_);
				_tmp26_ = _tmp25_;
				if (!_tmp26_) {
					ObjectsItem* _tmp27_;
					_tmp27_ = item;
					_tmp23_ = !objects_item_was_archived (_tmp27_);
				} else {
					_tmp23_ = FALSE;
				}
				if (_tmp23_) {
					ObjectsItem* _tmp28_;
					gboolean _tmp29_;
					gboolean _tmp30_;
					_tmp28_ = item;
					_tmp29_ = objects_item_get_has_deadline (_tmp28_);
					_tmp30_ = _tmp29_;
					_tmp22_ = _tmp30_;
				} else {
					_tmp22_ = FALSE;
				}
				if (_tmp22_) {
					GDateTime* deadline_date = NULL;
					ObjectsItem* _tmp31_;
					GDateTime* _tmp32_;
					GDateTime* _tmp33_;
					GDateTime* _tmp34_;
					gboolean _tmp35_ = FALSE;
					GDateTime* _tmp36_;
					_tmp31_ = item;
					_tmp32_ = objects_item_get_deadline_datetime (_tmp31_);
					_tmp33_ = _tmp32_;
					_tmp34_ = utils_datetime_get_date_only (_tmp33_);
					deadline_date = _tmp34_;
					_tmp36_ = deadline_date;
					if (utils_datetime_is_today (_tmp36_)) {
						GeeHashMap* _tmp37_;
						ObjectsItem* _tmp38_;
						const gchar* _tmp39_;
						const gchar* _tmp40_;
						_tmp37_ = ((ViewsScheduledScheduledSection*) self)->items;
						_tmp38_ = item;
						_tmp39_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp38_);
						_tmp40_ = _tmp39_;
						_tmp35_ = !gee_abstract_map_has_key ((GeeAbstractMap*) _tmp37_, _tmp40_);
					} else {
						_tmp35_ = FALSE;
					}
					if (_tmp35_) {
						ObjectsItem* _tmp41_;
						_tmp41_ = item;
						views_scheduled_scheduled_section_add_item ((ViewsScheduledScheduledSection*) self, _tmp41_);
					}
					_g_date_time_unref0 (deadline_date);
				}
				_g_object_unref0 (item);
			}
		}
	}
}

static gboolean
views_scheduled_scheduled_day_real_valid_item_predicate (ViewsScheduledScheduledSection* base,
                                                         ObjectsItem* item)
{
	ViewsScheduledScheduledDay * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean valid_due = FALSE;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	GDateTime* _tmp7_;
	gboolean valid_deadline = FALSE;
	gboolean _tmp14_ = FALSE;
	gboolean result;
	self = (ViewsScheduledScheduledDay*) base;
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp1_ = objects_item_get_has_due (item);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ServicesStore* _tmp3_;
		GDateTime* _tmp4_;
		_tmp3_ = services_store_instance ();
		_tmp4_ = self->priv->_date;
		_tmp0_ = services_store_valid_item_by_date (_tmp3_, item, _tmp4_, FALSE);
	} else {
		_tmp0_ = FALSE;
	}
	valid_due = _tmp0_;
	_tmp7_ = self->priv->_date;
	if (utils_datetime_is_today (_tmp7_)) {
		gboolean _tmp8_;
		gboolean _tmp9_;
		_tmp8_ = objects_item_get_has_deadline (item);
		_tmp9_ = _tmp8_;
		_tmp6_ = _tmp9_;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		GDateTime* _tmp10_;
		GDateTime* _tmp11_;
		GDateTime* _tmp12_;
		GDateTime* _tmp13_;
		_tmp10_ = objects_item_get_deadline_datetime (item);
		_tmp11_ = _tmp10_;
		_tmp12_ = utils_datetime_get_date_only (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp5_ = utils_datetime_is_today (_tmp13_);
		_g_date_time_unref0 (_tmp13_);
	} else {
		_tmp5_ = FALSE;
	}
	valid_deadline = _tmp5_;
	if (valid_due) {
		_tmp14_ = TRUE;
	} else {
		_tmp14_ = valid_deadline;
	}
	result = _tmp14_;
	return result;
}

static WidgetsEventsList*
views_scheduled_scheduled_day_real_create_events_list (ViewsScheduledScheduledSection* base)
{
	ViewsScheduledScheduledDay * self;
	GDateTime* _tmp0_;
	WidgetsEventsList* _tmp1_ = NULL;
	WidgetsEventsList* result;
	self = (ViewsScheduledScheduledDay*) base;
	_tmp0_ = self->priv->_date;
	_tmp1_ = widgets_events_list_new_for_day (_tmp0_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp1_, GTK_ALIGN_START);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp1_, 6);
	g_object_ref_sink (_tmp1_);
	result = _tmp1_;
	return result;
}

static void
views_scheduled_scheduled_day_real_valid_add_item (ViewsScheduledScheduledSection* base,
                                                   ObjectsItem* item)
{
	ViewsScheduledScheduledDay * self;
	GtkListBox* _tmp0_;
	self = (ViewsScheduledScheduledDay*) base;
	g_return_if_fail (item != NULL);
	VIEWS_SCHEDULED_SCHEDULED_SECTION_CLASS (views_scheduled_scheduled_day_parent_class)->valid_add_item (G_TYPE_CHECK_INSTANCE_CAST (self, VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION, ViewsScheduledScheduledSection), item);
	_tmp0_ = ((ViewsScheduledScheduledSection*) self)->listbox;
	gtk_list_box_invalidate_filter (_tmp0_);
}

static void
views_scheduled_scheduled_day_real_valid_update_item (ViewsScheduledScheduledSection* base,
                                                      ObjectsItem* item,
                                                      const gchar* update_id)
{
	ViewsScheduledScheduledDay * self;
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	GeeHashMap* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gboolean _tmp35_ = FALSE;
	GeeHashMap* _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	gboolean _tmp69_ = FALSE;
	gboolean _tmp70_;
	gboolean _tmp71_;
	GtkRevealer* _tmp76_;
	gboolean _tmp77_;
	gboolean _tmp78_;
	GtkListBox* _tmp79_;
	self = (ViewsScheduledScheduledDay*) 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_);
	}
	_tmp18_ = ((ViewsScheduledScheduledSection*) self)->items;
	_tmp19_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
	_tmp20_ = _tmp19_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp18_, _tmp20_)) {
		gboolean _tmp21_;
		gboolean _tmp22_;
		_tmp21_ = objects_item_get_has_due (item);
		_tmp22_ = _tmp21_;
		_tmp17_ = !_tmp22_;
	} else {
		_tmp17_ = FALSE;
	}
	if (_tmp17_) {
		gboolean _tmp23_;
		gboolean _tmp24_;
		_tmp23_ = objects_item_get_has_deadline (item);
		_tmp24_ = _tmp23_;
		_tmp16_ = !_tmp24_;
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		GeeHashMap* _tmp25_;
		const gchar* _tmp26_;
		const gchar* _tmp27_;
		gpointer _tmp28_;
		LayoutsItemRow* _tmp29_;
		GeeHashMap* _tmp30_;
		const gchar* _tmp31_;
		const gchar* _tmp32_;
		ServicesEventBus* _tmp33_;
		ServicesEventBus* _tmp34_;
		_tmp25_ = ((ViewsScheduledScheduledSection*) self)->items;
		_tmp26_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp27_ = _tmp26_;
		_tmp28_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp25_, _tmp27_);
		_tmp29_ = (LayoutsItemRow*) _tmp28_;
		layouts_item_base_hide_destroy ((LayoutsItemBase*) _tmp29_);
		_g_object_unref0 (_tmp29_);
		_tmp30_ = ((ViewsScheduledScheduledSection*) self)->items;
		_tmp31_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
		_tmp32_ = _tmp31_;
		gee_abstract_map_unset ((GeeAbstractMap*) _tmp30_, _tmp32_, NULL);
		_tmp33_ = services_event_bus_get_default ();
		_tmp34_ = _tmp33_;
		services_event_bus_unfocus_item (_tmp34_);
		_g_object_unref0 (_tmp34_);
	}
	_tmp36_ = ((ViewsScheduledScheduledSection*) self)->items;
	_tmp37_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
	_tmp38_ = _tmp37_;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp36_, _tmp38_)) {
		gboolean _tmp39_ = FALSE;
		gboolean _tmp40_;
		gboolean _tmp41_;
		_tmp40_ = objects_item_get_has_due (item);
		_tmp41_ = _tmp40_;
		if (_tmp41_) {
			_tmp39_ = TRUE;
		} else {
			gboolean _tmp42_;
			gboolean _tmp43_;
			_tmp42_ = objects_item_get_has_deadline (item);
			_tmp43_ = _tmp42_;
			_tmp39_ = _tmp43_;
		}
		_tmp35_ = _tmp39_;
	} else {
		_tmp35_ = FALSE;
	}
	if (_tmp35_) {
		gboolean _tmp44_ = FALSE;
		gboolean _tmp45_;
		gboolean _tmp46_;
		gboolean valid_due = FALSE;
		gboolean _tmp49_ = FALSE;
		gboolean _tmp50_ = FALSE;
		GDateTime* _tmp51_;
		gboolean valid_deadline = FALSE;
		gboolean _tmp58_ = FALSE;
		_tmp45_ = objects_item_get_has_due (item);
		_tmp46_ = _tmp45_;
		if (_tmp46_) {
			ServicesStore* _tmp47_;
			GDateTime* _tmp48_;
			_tmp47_ = services_store_instance ();
			_tmp48_ = self->priv->_date;
			_tmp44_ = services_store_valid_item_by_date (_tmp47_, item, _tmp48_, FALSE);
		} else {
			_tmp44_ = FALSE;
		}
		valid_due = _tmp44_;
		_tmp51_ = self->priv->_date;
		if (utils_datetime_is_today (_tmp51_)) {
			gboolean _tmp52_;
			gboolean _tmp53_;
			_tmp52_ = objects_item_get_has_deadline (item);
			_tmp53_ = _tmp52_;
			_tmp50_ = _tmp53_;
		} else {
			_tmp50_ = FALSE;
		}
		if (_tmp50_) {
			GDateTime* _tmp54_;
			GDateTime* _tmp55_;
			GDateTime* _tmp56_;
			GDateTime* _tmp57_;
			_tmp54_ = objects_item_get_deadline_datetime (item);
			_tmp55_ = _tmp54_;
			_tmp56_ = utils_datetime_get_date_only (_tmp55_);
			_tmp57_ = _tmp56_;
			_tmp49_ = utils_datetime_is_today (_tmp57_);
			_g_date_time_unref0 (_tmp57_);
		} else {
			_tmp49_ = FALSE;
		}
		valid_deadline = _tmp49_;
		if (!valid_due) {
			_tmp58_ = !valid_deadline;
		} else {
			_tmp58_ = FALSE;
		}
		if (_tmp58_) {
			GeeHashMap* _tmp59_;
			const gchar* _tmp60_;
			const gchar* _tmp61_;
			gpointer _tmp62_;
			LayoutsItemRow* _tmp63_;
			GeeHashMap* _tmp64_;
			const gchar* _tmp65_;
			const gchar* _tmp66_;
			ServicesEventBus* _tmp67_;
			ServicesEventBus* _tmp68_;
			_tmp59_ = ((ViewsScheduledScheduledSection*) self)->items;
			_tmp60_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
			_tmp61_ = _tmp60_;
			_tmp62_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp59_, _tmp61_);
			_tmp63_ = (LayoutsItemRow*) _tmp62_;
			layouts_item_base_hide_destroy ((LayoutsItemBase*) _tmp63_);
			_g_object_unref0 (_tmp63_);
			_tmp64_ = ((ViewsScheduledScheduledSection*) self)->items;
			_tmp65_ = objects_base_object_get_id ((ObjectsBaseObject*) item);
			_tmp66_ = _tmp65_;
			gee_abstract_map_unset ((GeeAbstractMap*) _tmp64_, _tmp66_, NULL);
			_tmp67_ = services_event_bus_get_default ();
			_tmp68_ = _tmp67_;
			services_event_bus_unfocus_item (_tmp68_);
			_g_object_unref0 (_tmp68_);
		}
	}
	_tmp70_ = objects_item_get_has_due (item);
	_tmp71_ = _tmp70_;
	if (_tmp71_) {
		_tmp69_ = TRUE;
	} else {
		gboolean _tmp72_ = FALSE;
		GDateTime* _tmp73_;
		_tmp73_ = self->priv->_date;
		if (utils_datetime_is_today (_tmp73_)) {
			gboolean _tmp74_;
			gboolean _tmp75_;
			_tmp74_ = objects_item_get_has_deadline (item);
			_tmp75_ = _tmp74_;
			_tmp72_ = _tmp75_;
		} else {
			_tmp72_ = FALSE;
		}
		_tmp69_ = _tmp72_;
	}
	if (_tmp69_) {
		views_scheduled_scheduled_section_valid_add_item ((ViewsScheduledScheduledSection*) self, item);
	}
	_tmp76_ = ((ViewsScheduledScheduledSection*) self)->listbox_revealer;
	_tmp77_ = views_scheduled_scheduled_section_get_has_items ((ViewsScheduledScheduledSection*) self);
	_tmp78_ = _tmp77_;
	gtk_revealer_set_reveal_child (_tmp76_, _tmp78_);
	_tmp79_ = ((ViewsScheduledScheduledSection*) self)->listbox;
	gtk_list_box_invalidate_filter (_tmp79_);
}

GDateTime*
views_scheduled_scheduled_day_get_date (ViewsScheduledScheduledDay* self)
{
	GDateTime* result;
	GDateTime* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_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_day_set_date (ViewsScheduledScheduledDay* self,
                                        GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = views_scheduled_scheduled_day_get_date (self);
	if (old_value != value) {
		GDateTime* _tmp0_;
		_tmp0_ = _g_date_time_ref0 (value);
		_g_date_time_unref0 (self->priv->_date);
		self->priv->_date = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, views_scheduled_scheduled_day_properties[VIEWS_SCHEDULED_SCHEDULED_DAY_DATE_PROPERTY]);
	}
}

static gboolean
_views_scheduled_scheduled_day___lambda820_ (ViewsScheduledScheduledDay* 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_day___lambda820__gsource_func (gpointer self)
{
	gboolean result;
	result = _views_scheduled_scheduled_day___lambda820_ ((ViewsScheduledScheduledDay*) self);
	return result;
}

static void
_views_scheduled_scheduled_day___lambda821_ (ViewsScheduledScheduledDay* self,
                                             ObjectsItem* item)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GtkListBox* _tmp8_;
	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_);
	}
	_tmp8_ = ((ViewsScheduledScheduledSection*) self)->listbox;
	gtk_list_box_invalidate_filter (_tmp8_);
}

static void
__views_scheduled_scheduled_day___lambda821__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_day___lambda821_ ((ViewsScheduledScheduledDay*) self, item);
}

static void
_views_scheduled_scheduled_day___lambda822_ (ViewsScheduledScheduledDay* 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_day___lambda822__services_event_bus_dim_content (ServicesEventBus* _sender,
                                                                             gboolean active,
                                                                             const gchar* focused_item_id,
                                                                             gpointer self)
{
	_views_scheduled_scheduled_day___lambda822_ ((ViewsScheduledScheduledDay*) self, active, focused_item_id);
}

static GObject *
views_scheduled_scheduled_day_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ViewsScheduledScheduledDay * self;
	GtkLabel* day_label = NULL;
	GDateTime* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* date_format_label = NULL;
	GDateTime* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GtkLabel* _tmp9_ = NULL;
	GtkLabel* _tmp10_;
	GtkLabel* _tmp11_;
	GtkBox* title_box = NULL;
	GtkBox* _tmp12_ = NULL;
	GtkBox* _tmp13_;
	GtkLabel* _tmp14_;
	GtkBox* _tmp15_;
	GtkLabel* _tmp16_;
	GtkBox* _tmp17_;
	GtkBox* _tmp18_;
	GtkBox* _tmp19_;
	gchar* _tmp20_;
	gchar** _tmp21_;
	GtkListBox* _tmp22_ = NULL;
	GtkGrid* listbox_grid = NULL;
	GtkGrid* _tmp23_ = NULL;
	GtkGrid* _tmp24_;
	GtkListBox* _tmp25_;
	gboolean _tmp26_;
	gboolean _tmp27_;
	GtkRevealer* _tmp28_ = NULL;
	GtkRevealer* _tmp29_;
	GtkGrid* _tmp30_;
	GtkBox* content = NULL;
	GtkBox* _tmp31_ = NULL;
	GtkBox* _tmp32_;
	GtkBox* _tmp33_;
	GtkBox* _tmp34_;
	GtkRevealer* _tmp35_;
	GtkBox* _tmp36_;
	GtkRevealer* _tmp37_;
	guint _tmp38_;
	guint _tmp39_;
	GeeHashMap* _tmp40_;
	ServicesEventBus* _tmp41_;
	ServicesEventBus* _tmp42_;
	gulong _tmp43_;
	ServicesEventBus* _tmp44_;
	ServicesEventBus* _tmp45_;
	GeeHashMap* _tmp46_;
	ServicesEventBus* _tmp47_;
	ServicesEventBus* _tmp48_;
	gulong _tmp49_;
	ServicesEventBus* _tmp50_;
	ServicesEventBus* _tmp51_;
	parent_class = G_OBJECT_CLASS (views_scheduled_scheduled_day_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY, ViewsScheduledScheduledDay);
	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->_date;
	_tmp1_ = g_strdup_printf ("%i", g_date_time_get_day_of_month (_tmp0_));
	_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_);
	day_label = _tmp4_;
	_tmp5_ = day_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp5_, "font-bold");
	_tmp6_ = self->priv->_date;
	_tmp7_ = g_date_time_format (_tmp6_, "%a");
	_tmp8_ = _tmp7_;
	_tmp9_ = (GtkLabel*) gtk_label_new (_tmp8_);
	gtk_widget_set_halign ((GtkWidget*) _tmp9_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp9_);
	_tmp10_ = _tmp9_;
	_g_free0 (_tmp8_);
	date_format_label = _tmp10_;
	_tmp11_ = date_format_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp11_, "dimmed");
	_tmp12_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	g_object_ref_sink (_tmp12_);
	title_box = _tmp12_;
	_tmp13_ = title_box;
	_tmp14_ = day_label;
	gtk_box_append (_tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = title_box;
	_tmp16_ = date_format_label;
	gtk_box_append (_tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = title_box;
	_tmp18_ = views_scheduled_scheduled_section_create_header ((ViewsScheduledScheduledSection*) self, (GtkWidget*) _tmp17_);
	_g_object_unref0 (self->priv->header_content);
	self->priv->header_content = _tmp18_;
	_tmp19_ = self->priv->header_content;
	views_scheduled_scheduled_section_setup_events ((ViewsScheduledScheduledSection*) self, _tmp19_);
	_tmp20_ = g_strdup ("listbox-background");
	_tmp21_ = g_new0 (gchar*, 1 + 1);
	_tmp21_[0] = _tmp20_;
	_tmp22_ = (GtkListBox*) gtk_list_box_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp22_, GTK_ALIGN_START);
	gtk_list_box_set_activate_on_single_click (_tmp22_, TRUE);
	gtk_list_box_set_selection_mode (_tmp22_, GTK_SELECTION_SINGLE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp22_, TRUE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp22_, _tmp21_);
	_tmp21_ = (_vala_array_free (_tmp21_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (((ViewsScheduledScheduledSection*) self)->listbox);
	((ViewsScheduledScheduledSection*) self)->listbox = _tmp22_;
	_tmp23_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp23_, 6);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp23_, 24);
	g_object_ref_sink (_tmp23_);
	listbox_grid = _tmp23_;
	_tmp24_ = listbox_grid;
	_tmp25_ = ((ViewsScheduledScheduledSection*) self)->listbox;
	gtk_grid_attach (_tmp24_, (GtkWidget*) _tmp25_, 0, 0, 1, 1);
	_tmp26_ = views_scheduled_scheduled_section_get_has_items ((ViewsScheduledScheduledSection*) self);
	_tmp27_ = _tmp26_;
	_tmp28_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp28_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_reveal_child (_tmp28_, _tmp27_);
	g_object_ref_sink (_tmp28_);
	_g_object_unref0 (((ViewsScheduledScheduledSection*) self)->listbox_revealer);
	((ViewsScheduledScheduledSection*) self)->listbox_revealer = _tmp28_;
	_tmp29_ = ((ViewsScheduledScheduledSection*) self)->listbox_revealer;
	_tmp30_ = listbox_grid;
	gtk_revealer_set_child (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp31_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp31_, GTK_ALIGN_START);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp31_, 32);
	g_object_ref_sink (_tmp31_);
	content = _tmp31_;
	_tmp32_ = content;
	_tmp33_ = self->priv->header_content;
	gtk_box_append (_tmp32_, (GtkWidget*) _tmp33_);
	_tmp34_ = content;
	_tmp35_ = ((ViewsScheduledScheduledSection*) self)->listbox_revealer;
	gtk_box_append (_tmp34_, (GtkWidget*) _tmp35_);
	_tmp36_ = content;
	gtk_list_box_row_set_child ((GtkListBoxRow*) self, (GtkWidget*) _tmp36_);
	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);
	_tmp37_ = ((ViewsScheduledScheduledSection*) self)->listbox_revealer;
	_tmp38_ = gtk_revealer_get_transition_duration (_tmp37_);
	_tmp39_ = _tmp38_;
	g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp39_, __views_scheduled_scheduled_day___lambda820__gsource_func, g_object_ref (self), g_object_unref);
	_tmp40_ = ((ViewsScheduledScheduledSection*) self)->signal_map;
	_tmp41_ = services_event_bus_get_default ();
	_tmp42_ = _tmp41_;
	_tmp43_ = g_signal_connect_object (_tmp42_, "item-moved", (GCallback) __views_scheduled_scheduled_day___lambda821__services_event_bus_item_moved, self, 0);
	_tmp44_ = services_event_bus_get_default ();
	_tmp45_ = _tmp44_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp40_, (gpointer) ((guintptr) _tmp43_), (GObject*) _tmp45_);
	_g_object_unref0 (_tmp45_);
	_g_object_unref0 (_tmp42_);
	_tmp46_ = ((ViewsScheduledScheduledSection*) self)->signal_map;
	_tmp47_ = services_event_bus_get_default ();
	_tmp48_ = _tmp47_;
	_tmp49_ = g_signal_connect_object (_tmp48_, "dim-content", (GCallback) __views_scheduled_scheduled_day___lambda822__services_event_bus_dim_content, self, 0);
	_tmp50_ = services_event_bus_get_default ();
	_tmp51_ = _tmp50_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp46_, (gpointer) ((guintptr) _tmp49_), (GObject*) _tmp51_);
	_g_object_unref0 (_tmp51_);
	_g_object_unref0 (_tmp48_);
	_g_object_unref0 (content);
	_g_object_unref0 (listbox_grid);
	_g_object_unref0 (title_box);
	_g_object_unref0 (date_format_label);
	_g_object_unref0 (day_label);
	return obj;
}

static void
views_scheduled_scheduled_day_class_init (ViewsScheduledScheduledDayClass * klass,
                                          gpointer klass_data)
{
	views_scheduled_scheduled_day_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ViewsScheduledScheduledDay_private_offset);
	((ViewsScheduledScheduledSectionClass *) klass)->add_items = (void (*) (ViewsScheduledScheduledSection*)) views_scheduled_scheduled_day_real_add_items;
	((ViewsScheduledScheduledSectionClass *) klass)->valid_item_predicate = (gboolean (*) (ViewsScheduledScheduledSection*, ObjectsItem*)) views_scheduled_scheduled_day_real_valid_item_predicate;
	((ViewsScheduledScheduledSectionClass *) klass)->create_events_list = (WidgetsEventsList* (*) (ViewsScheduledScheduledSection*)) views_scheduled_scheduled_day_real_create_events_list;
	((ViewsScheduledScheduledSectionClass *) klass)->valid_add_item = (void (*) (ViewsScheduledScheduledSection*, ObjectsItem*)) views_scheduled_scheduled_day_real_valid_add_item;
	((ViewsScheduledScheduledSectionClass *) klass)->valid_update_item = (void (*) (ViewsScheduledScheduledSection*, ObjectsItem*, const gchar*)) views_scheduled_scheduled_day_real_valid_update_item;
	G_OBJECT_CLASS (klass)->get_property = _vala_views_scheduled_scheduled_day_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_views_scheduled_scheduled_day_set_property;
	G_OBJECT_CLASS (klass)->constructor = views_scheduled_scheduled_day_constructor;
	G_OBJECT_CLASS (klass)->finalize = views_scheduled_scheduled_day_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VIEWS_SCHEDULED_SCHEDULED_DAY_DATE_PROPERTY, views_scheduled_scheduled_day_properties[VIEWS_SCHEDULED_SCHEDULED_DAY_DATE_PROPERTY] = g_param_spec_boxed ("date", "date", "date", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
views_scheduled_scheduled_day_instance_init (ViewsScheduledScheduledDay * self,
                                             gpointer klass)
{
	self->priv = views_scheduled_scheduled_day_get_instance_private (self);
}

static void
views_scheduled_scheduled_day_finalize (GObject * obj)
{
	ViewsScheduledScheduledDay * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY, ViewsScheduledScheduledDay);
	g_debug ("ScheduledDay.vala:34: Destroying - Views.Scheduled.ScheduledDay\n");
	_g_date_time_unref0 (self->priv->_date);
	_g_object_unref0 (self->priv->header_content);
	G_OBJECT_CLASS (views_scheduled_scheduled_day_parent_class)->finalize (obj);
}

static GType
views_scheduled_scheduled_day_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ViewsScheduledScheduledDayClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) views_scheduled_scheduled_day_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ViewsScheduledScheduledDay), 0, (GInstanceInitFunc) views_scheduled_scheduled_day_instance_init, NULL };
	GType views_scheduled_scheduled_day_type_id;
	views_scheduled_scheduled_day_type_id = g_type_register_static (VIEWS_SCHEDULED_TYPE_SCHEDULED_SECTION, "ViewsScheduledScheduledDay", &g_define_type_info, 0);
	ViewsScheduledScheduledDay_private_offset = g_type_add_instance_private (views_scheduled_scheduled_day_type_id, sizeof (ViewsScheduledScheduledDayPrivate));
	return views_scheduled_scheduled_day_type_id;
}

GType
views_scheduled_scheduled_day_get_type (void)
{
	static volatile gsize views_scheduled_scheduled_day_type_id__once = 0;
	if (g_once_init_enter (&views_scheduled_scheduled_day_type_id__once)) {
		GType views_scheduled_scheduled_day_type_id;
		views_scheduled_scheduled_day_type_id = views_scheduled_scheduled_day_get_type_once ();
		g_once_init_leave (&views_scheduled_scheduled_day_type_id__once, views_scheduled_scheduled_day_type_id);
	}
	return views_scheduled_scheduled_day_type_id__once;
}

static void
_vala_views_scheduled_scheduled_day_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	ViewsScheduledScheduledDay * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY, ViewsScheduledScheduledDay);
	switch (property_id) {
		case VIEWS_SCHEDULED_SCHEDULED_DAY_DATE_PROPERTY:
		g_value_set_boxed (value, views_scheduled_scheduled_day_get_date (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_views_scheduled_scheduled_day_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	ViewsScheduledScheduledDay * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VIEWS_SCHEDULED_TYPE_SCHEDULED_DAY, ViewsScheduledScheduledDay);
	switch (property_id) {
		case VIEWS_SCHEDULED_SCHEDULED_DAY_DATE_PROPERTY:
		views_scheduled_scheduled_day_set_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);
}

