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

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

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include "planify.h"
#include <libedataserver/libedataserver.h>
#include <libecal/libecal.h>
#include <libical-glib/libical-glib.h>
#include <float.h>
#include <math.h>
#include <gio/gio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define 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;
typedef struct _WidgetsEventsListPrivate WidgetsEventsListPrivate;

#define WIDGETS_TYPE_EVENT_ROW (widgets_event_row_get_type ())
#define WIDGETS_EVENT_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_EVENT_ROW, WidgetsEventRow))
#define WIDGETS_EVENT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_EVENT_ROW, WidgetsEventRowClass))
#define WIDGETS_IS_EVENT_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_EVENT_ROW))
#define WIDGETS_IS_EVENT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_EVENT_ROW))
#define WIDGETS_EVENT_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_EVENT_ROW, WidgetsEventRowClass))

typedef struct _WidgetsEventRow WidgetsEventRow;
typedef struct _WidgetsEventRowClass WidgetsEventRowClass;
enum  {
	WIDGETS_EVENTS_LIST_0_PROPERTY,
	WIDGETS_EVENTS_LIST_START_DATE_PROPERTY,
	WIDGETS_EVENTS_LIST_END_DATE_PROPERTY,
	WIDGETS_EVENTS_LIST_IS_DAY_PROPERTY,
	WIDGETS_EVENTS_LIST_IS_MONTH_PROPERTY,
	WIDGETS_EVENTS_LIST_IS_RANGE_PROPERTY,
	WIDGETS_EVENTS_LIST_HAS_ITEMS_PROPERTY,
	WIDGETS_EVENTS_LIST_NUM_PROPERTIES
};
static GParamSpec* widgets_events_list_properties[WIDGETS_EVENTS_LIST_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))
enum  {
	WIDGETS_EVENTS_LIST_CHANGE_SIGNAL,
	WIDGETS_EVENTS_LIST_NUM_SIGNALS
};
static guint widgets_events_list_signals[WIDGETS_EVENTS_LIST_NUM_SIGNALS] = {0};

struct _WidgetsEventsList {
	AdwBin parent_instance;
	WidgetsEventsListPrivate * priv;
};

struct _WidgetsEventsListClass {
	AdwBinClass parent_class;
};

struct _WidgetsEventsListPrivate {
	GDateTime* _start_date;
	GDateTime* _end_date;
	gboolean _is_day;
	gboolean _is_month;
	gboolean _is_range;
	GtkListBox* listbox;
	GtkRevealer* main_revealer;
	GeeHashMap* event_hashmap;
	ServicesCalendarEvents* event_model;
	GDateTime* current_start_date;
	GDateTime* current_end_date;
	GeeHashMap* signal_map;
};

static gint WidgetsEventsList_private_offset;
static gpointer widgets_events_list_parent_class = NULL;

VALA_EXTERN GType widgets_events_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsEventsList, g_object_unref)
VALA_EXTERN GType widgets_event_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsEventRow, g_object_unref)
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);
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);
VALA_EXTERN WidgetsEventsList* widgets_events_list_new_for_month (GDateTime* start_date);
VALA_EXTERN WidgetsEventsList* widgets_events_list_construct_for_month (GType object_type,
                                                            GDateTime* start_date);
static void widgets_events_list_add_events (WidgetsEventsList* self);
static void widgets_events_list_add_event_model (WidgetsEventsList* self,
                                          ESource* source,
                                          GeeCollection* components);
static void _widgets_events_list_add_event_model_services_calendar_events_components_added (ServicesCalendarEvents* _sender,
                                                                                     ESource* source,
                                                                                     GeeCollection* components,
                                                                                     gpointer self);
static void widgets_events_list_remove_event_model (WidgetsEventsList* self,
                                             ESource* source,
                                             GeeCollection* events);
static void _widgets_events_list_remove_event_model_services_calendar_events_components_removed (ServicesCalendarEvents* _sender,
                                                                                          ESource* source,
                                                                                          GeeCollection* components,
                                                                                          gpointer self);
static void widgets_events_list_update_event_model (WidgetsEventsList* self,
                                             ESource* source,
                                             GeeCollection* components);
static void _widgets_events_list_update_event_model_services_calendar_events_components_updated (ServicesCalendarEvents* _sender,
                                                                                          ESource* source,
                                                                                          GeeCollection* components,
                                                                                          gpointer self);
VALA_EXTERN gboolean widgets_events_list_get_is_day (WidgetsEventsList* self);
static void widgets_events_list_add_row_event (WidgetsEventsList* self,
                                        ECalComponent* component,
                                        ESource* source);
VALA_EXTERN gboolean widgets_events_list_get_is_month (WidgetsEventsList* self);
VALA_EXTERN gboolean widgets_events_list_get_is_range (WidgetsEventsList* self);
static gboolean widgets_events_list_event_overlaps_range (WidgetsEventsList* self,
                                                   ECalComponent* component);
VALA_EXTERN WidgetsEventRow* widgets_event_row_new (ICalComponent* component,
                                        ESource* source,
                                        gboolean show_date,
                                        GDateTime* display_date);
VALA_EXTERN WidgetsEventRow* widgets_event_row_construct (GType object_type,
                                              ICalComponent* component,
                                              ESource* source,
                                              gboolean show_date,
                                              GDateTime* display_date);
VALA_EXTERN void widgets_event_row_update (WidgetsEventRow* self,
                               ICalComponent* new_component);
static gint widgets_events_list_sort_event_function (WidgetsEventsList* self,
                                              GtkListBoxRow* child1,
                                              GtkListBoxRow* child2);
VALA_EXTERN GDateTime* widgets_event_row_get_start_time (WidgetsEventRow* self);
VALA_EXTERN gboolean widgets_event_row_get_is_allday (WidgetsEventRow* self);
VALA_EXTERN void widgets_events_list_refresh (WidgetsEventsList* self,
                                  GDateTime* new_start_date,
                                  GDateTime* new_end_date);
VALA_EXTERN void widgets_event_row_clean_up (WidgetsEventRow* self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN void widgets_events_list_clean_up (WidgetsEventsList* self);
VALA_EXTERN WidgetsEventsList* widgets_events_list_new (void);
VALA_EXTERN WidgetsEventsList* widgets_events_list_construct (GType object_type);
VALA_EXTERN GDateTime* widgets_events_list_get_start_date (WidgetsEventsList* self);
static void widgets_events_list_set_start_date (WidgetsEventsList* self,
                                         GDateTime* value);
VALA_EXTERN GDateTime* widgets_events_list_get_end_date (WidgetsEventsList* self);
static void widgets_events_list_set_end_date (WidgetsEventsList* self,
                                       GDateTime* value);
static void widgets_events_list_set_is_day (WidgetsEventsList* self,
                                     gboolean value);
static void widgets_events_list_set_is_month (WidgetsEventsList* self,
                                       gboolean value);
static void widgets_events_list_set_is_range (WidgetsEventsList* self,
                                       gboolean value);
VALA_EXTERN gboolean widgets_events_list_get_has_items (WidgetsEventsList* self);
static GObject * widgets_events_list_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties);
static gint _widgets_events_list_sort_event_function_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                      GtkListBoxRow* row2,
                                                                      gpointer self);
static void _widgets_events_list___lambda789_ (WidgetsEventsList* self);
static void __widgets_events_list___lambda789__g_settings_changed (GSettings* _sender,
                                                            const gchar* key,
                                                            gpointer self);
static void widgets_events_list_finalize (GObject * obj);
static GType widgets_events_list_get_type_once (void);
static void _vala_widgets_events_list_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_widgets_events_list_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
widgets_events_list_get_instance_private (WidgetsEventsList* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsEventsList_private_offset);
}

WidgetsEventsList*
widgets_events_list_construct_for_day (GType object_type,
                                       GDateTime* start_date)
{
	WidgetsEventsList * self = NULL;
	g_return_val_if_fail (start_date != NULL, NULL);
	self = (WidgetsEventsList*) g_object_new (object_type, "start-date", start_date, "end-date", start_date, "is-day", TRUE, "is-range", FALSE, "is-month", FALSE, NULL);
	return self;
}

WidgetsEventsList*
widgets_events_list_new_for_day (GDateTime* start_date)
{
	return widgets_events_list_construct_for_day (WIDGETS_TYPE_EVENTS_LIST, start_date);
}

WidgetsEventsList*
widgets_events_list_construct_for_range (GType object_type,
                                         GDateTime* start_date,
                                         GDateTime* end_date)
{
	WidgetsEventsList * self = NULL;
	g_return_val_if_fail (start_date != NULL, NULL);
	g_return_val_if_fail (end_date != NULL, NULL);
	self = (WidgetsEventsList*) g_object_new (object_type, "start-date", start_date, "end-date", end_date, "is-day", FALSE, "is-range", TRUE, "is-month", FALSE, NULL);
	return self;
}

WidgetsEventsList*
widgets_events_list_new_for_range (GDateTime* start_date,
                                   GDateTime* end_date)
{
	return widgets_events_list_construct_for_range (WIDGETS_TYPE_EVENTS_LIST, start_date, end_date);
}

WidgetsEventsList*
widgets_events_list_construct_for_month (GType object_type,
                                         GDateTime* start_date)
{
	WidgetsEventsList * self = NULL;
	g_return_val_if_fail (start_date != NULL, NULL);
	self = (WidgetsEventsList*) g_object_new (object_type, "start-date", start_date, "end-date", start_date, "is-day", FALSE, "is-range", FALSE, "is-month", TRUE, NULL);
	return self;
}

WidgetsEventsList*
widgets_events_list_new_for_month (GDateTime* start_date)
{
	return widgets_events_list_construct_for_month (WIDGETS_TYPE_EVENTS_LIST, start_date);
}

static void
_widgets_events_list_add_event_model_services_calendar_events_components_added (ServicesCalendarEvents* _sender,
                                                                                ESource* source,
                                                                                GeeCollection* components,
                                                                                gpointer self)
{
	widgets_events_list_add_event_model ((WidgetsEventsList*) self, source, components);
}

static void
_widgets_events_list_remove_event_model_services_calendar_events_components_removed (ServicesCalendarEvents* _sender,
                                                                                     ESource* source,
                                                                                     GeeCollection* components,
                                                                                     gpointer self)
{
	widgets_events_list_remove_event_model ((WidgetsEventsList*) self, source, components);
}

static void
_widgets_events_list_update_event_model_services_calendar_events_components_updated (ServicesCalendarEvents* _sender,
                                                                                     ESource* source,
                                                                                     GeeCollection* components,
                                                                                     gpointer self)
{
	widgets_events_list_update_event_model ((WidgetsEventsList*) self, source, components);
}

static void
widgets_events_list_add_events (WidgetsEventsList* self)
{
	GeeHashMap* _tmp0_;
	ServicesCalendarEvents* _tmp1_;
	gulong _tmp2_;
	ServicesCalendarEvents* _tmp3_;
	GeeHashMap* _tmp4_;
	ServicesCalendarEvents* _tmp5_;
	gulong _tmp6_;
	ServicesCalendarEvents* _tmp7_;
	GeeHashMap* _tmp8_;
	ServicesCalendarEvents* _tmp9_;
	gulong _tmp10_;
	ServicesCalendarEvents* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->signal_map;
	_tmp1_ = self->priv->event_model;
	_tmp2_ = g_signal_connect_object (_tmp1_, "components-added", (GCallback) _widgets_events_list_add_event_model_services_calendar_events_components_added, self, 0);
	_tmp3_ = self->priv->event_model;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, (gpointer) ((guintptr) _tmp2_), (GObject*) _tmp3_);
	_tmp4_ = self->priv->signal_map;
	_tmp5_ = self->priv->event_model;
	_tmp6_ = g_signal_connect_object (_tmp5_, "components-removed", (GCallback) _widgets_events_list_remove_event_model_services_calendar_events_components_removed, self, 0);
	_tmp7_ = self->priv->event_model;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp4_, (gpointer) ((guintptr) _tmp6_), (GObject*) _tmp7_);
	_tmp8_ = self->priv->signal_map;
	_tmp9_ = self->priv->event_model;
	_tmp10_ = g_signal_connect_object (_tmp9_, "components-updated", (GCallback) _widgets_events_list_update_event_model_services_calendar_events_components_updated, self, 0);
	_tmp11_ = self->priv->event_model;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp8_, (gpointer) ((guintptr) _tmp10_), (GObject*) _tmp11_);
}

static void
widgets_events_list_add_event_model (WidgetsEventsList* self,
                                     ESource* source,
                                     GeeCollection* components)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (components != NULL);
	{
		GeeIterator* _component_it = NULL;
		GeeIterator* _tmp0_;
		_tmp0_ = gee_iterable_iterator ((GeeIterable*) components);
		_component_it = _tmp0_;
		while (TRUE) {
			GeeIterator* _tmp1_;
			ECalComponent* component = NULL;
			GeeIterator* _tmp2_;
			gpointer _tmp3_;
			gboolean _tmp4_;
			_tmp1_ = _component_it;
			if (!gee_iterator_next (_tmp1_)) {
				break;
			}
			_tmp2_ = _component_it;
			_tmp3_ = gee_iterator_get (_tmp2_);
			component = (ECalComponent*) _tmp3_;
			_tmp4_ = self->priv->_is_day;
			if (_tmp4_) {
				ECalComponent* _tmp5_;
				GDateTime* _tmp6_;
				_tmp5_ = component;
				_tmp6_ = self->priv->current_start_date;
				if (calendar_events_util_calcomp_is_on_day (_tmp5_, _tmp6_)) {
					ECalComponent* _tmp7_;
					_tmp7_ = component;
					widgets_events_list_add_row_event (self, _tmp7_, source);
				}
			} else {
				gboolean _tmp8_;
				_tmp8_ = self->priv->_is_month;
				if (_tmp8_) {
					ECalComponent* _tmp9_;
					GDateTime* _tmp10_;
					_tmp9_ = component;
					_tmp10_ = self->priv->current_start_date;
					if (calendar_events_util_calcomp_is_on_month (_tmp9_, _tmp10_)) {
						ECalComponent* _tmp11_;
						_tmp11_ = component;
						widgets_events_list_add_row_event (self, _tmp11_, source);
					}
				} else {
					gboolean _tmp12_;
					_tmp12_ = self->priv->_is_range;
					if (_tmp12_) {
						ECalComponent* _tmp13_;
						_tmp13_ = component;
						if (widgets_events_list_event_overlaps_range (self, _tmp13_)) {
							ECalComponent* _tmp14_;
							_tmp14_ = component;
							widgets_events_list_add_row_event (self, _tmp14_, source);
						}
					}
				}
			}
			_g_object_unref0 (component);
		}
		_g_object_unref0 (_component_it);
	}
}

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

static void
widgets_events_list_add_row_event (WidgetsEventsList* self,
                                   ECalComponent* component,
                                   ESource* source)
{
	ICalComponent* ical = NULL;
	ICalComponent* _tmp0_;
	gchar* event_uid = NULL;
	ICalComponent* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GeeHashMap* _tmp4_;
	const gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (component != NULL);
	g_return_if_fail (source != NULL);
	_tmp0_ = e_cal_component_get_icalcomponent (component);
	ical = _tmp0_;
	_tmp1_ = ical;
	_tmp2_ = i_cal_component_get_uid (_tmp1_);
	_tmp3_ = g_strdup (_tmp2_);
	event_uid = _tmp3_;
	_tmp4_ = self->priv->event_hashmap;
	_tmp5_ = event_uid;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp4_, _tmp5_)) {
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_;
		gboolean show_date = FALSE;
		GDateTime* display_date = NULL;
		GDateTime* _tmp9_;
		GDateTime* _tmp10_;
		GeeHashMap* _tmp11_;
		const gchar* _tmp12_;
		ICalComponent* _tmp13_;
		GDateTime* _tmp14_;
		WidgetsEventRow* _tmp15_;
		WidgetsEventRow* _tmp16_;
		GtkListBox* _tmp17_;
		GeeHashMap* _tmp18_;
		const gchar* _tmp19_;
		gpointer _tmp20_;
		WidgetsEventRow* _tmp21_;
		_tmp7_ = self->priv->_is_month;
		if (_tmp7_) {
			_tmp6_ = TRUE;
		} else {
			gboolean _tmp8_;
			_tmp8_ = self->priv->_is_range;
			_tmp6_ = _tmp8_;
		}
		show_date = _tmp6_;
		_tmp9_ = self->priv->current_start_date;
		_tmp10_ = _g_date_time_ref0 (_tmp9_);
		display_date = _tmp10_;
		_tmp11_ = self->priv->event_hashmap;
		_tmp12_ = event_uid;
		_tmp13_ = ical;
		_tmp14_ = display_date;
		_tmp15_ = widgets_event_row_new (_tmp13_, source, show_date, _tmp14_);
		g_object_ref_sink (_tmp15_);
		_tmp16_ = _tmp15_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp11_, _tmp12_, _tmp16_);
		_g_object_unref0 (_tmp16_);
		_tmp17_ = self->priv->listbox;
		_tmp18_ = self->priv->event_hashmap;
		_tmp19_ = event_uid;
		_tmp20_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp18_, _tmp19_);
		_tmp21_ = (WidgetsEventRow*) _tmp20_;
		gtk_list_box_append (_tmp17_, (GtkWidget*) _tmp21_);
		_g_object_unref0 (_tmp21_);
		_g_date_time_unref0 (display_date);
	}
	g_signal_emit (self, widgets_events_list_signals[WIDGETS_EVENTS_LIST_CHANGE_SIGNAL], 0);
	_g_free0 (event_uid);
}

static void
widgets_events_list_update_event_model (WidgetsEventsList* self,
                                        ESource* source,
                                        GeeCollection* components)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (components != NULL);
	{
		GeeIterator* _component_it = NULL;
		GeeIterator* _tmp0_;
		_tmp0_ = gee_iterable_iterator ((GeeIterable*) components);
		_component_it = _tmp0_;
		while (TRUE) {
			GeeIterator* _tmp1_;
			ECalComponent* component = NULL;
			GeeIterator* _tmp2_;
			gpointer _tmp3_;
			ICalComponent* ical = NULL;
			ECalComponent* _tmp4_;
			ICalComponent* _tmp5_;
			gchar* event_uid = NULL;
			ICalComponent* _tmp6_;
			const gchar* _tmp7_;
			gchar* _tmp8_;
			gboolean in_range = FALSE;
			gboolean _tmp9_;
			GeeHashMap* _tmp17_;
			const gchar* _tmp18_;
			_tmp1_ = _component_it;
			if (!gee_iterator_next (_tmp1_)) {
				break;
			}
			_tmp2_ = _component_it;
			_tmp3_ = gee_iterator_get (_tmp2_);
			component = (ECalComponent*) _tmp3_;
			_tmp4_ = component;
			_tmp5_ = e_cal_component_get_icalcomponent (_tmp4_);
			ical = _tmp5_;
			_tmp6_ = ical;
			_tmp7_ = i_cal_component_get_uid (_tmp6_);
			_tmp8_ = g_strdup (_tmp7_);
			event_uid = _tmp8_;
			in_range = FALSE;
			_tmp9_ = self->priv->_is_day;
			if (_tmp9_) {
				ECalComponent* _tmp10_;
				GDateTime* _tmp11_;
				_tmp10_ = component;
				_tmp11_ = self->priv->current_start_date;
				in_range = calendar_events_util_calcomp_is_on_day (_tmp10_, _tmp11_);
			} else {
				gboolean _tmp12_;
				_tmp12_ = self->priv->_is_month;
				if (_tmp12_) {
					ECalComponent* _tmp13_;
					GDateTime* _tmp14_;
					_tmp13_ = component;
					_tmp14_ = self->priv->current_start_date;
					in_range = calendar_events_util_calcomp_is_on_month (_tmp13_, _tmp14_);
				} else {
					gboolean _tmp15_;
					_tmp15_ = self->priv->_is_range;
					if (_tmp15_) {
						ECalComponent* _tmp16_;
						_tmp16_ = component;
						in_range = widgets_events_list_event_overlaps_range (self, _tmp16_);
					}
				}
			}
			_tmp17_ = self->priv->event_hashmap;
			_tmp18_ = event_uid;
			if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp17_, _tmp18_)) {
				if (in_range) {
					GeeHashMap* _tmp19_;
					const gchar* _tmp20_;
					gpointer _tmp21_;
					WidgetsEventRow* _tmp22_;
					ICalComponent* _tmp23_;
					_tmp19_ = self->priv->event_hashmap;
					_tmp20_ = event_uid;
					_tmp21_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp19_, _tmp20_);
					_tmp22_ = (WidgetsEventRow*) _tmp21_;
					_tmp23_ = ical;
					widgets_event_row_update (_tmp22_, _tmp23_);
					_g_object_unref0 (_tmp22_);
				} else {
					GeeHashMap* _tmp24_;
					const gchar* _tmp25_;
					gpointer _tmp26_;
					WidgetsEventRow* _tmp27_;
					GtkListBox* _tmp28_;
					GeeHashMap* _tmp29_;
					const gchar* _tmp30_;
					gpointer _tmp31_;
					WidgetsEventRow* _tmp32_;
					GeeHashMap* _tmp33_;
					const gchar* _tmp34_;
					_tmp24_ = self->priv->event_hashmap;
					_tmp25_ = event_uid;
					_tmp26_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp24_, _tmp25_);
					_tmp27_ = (WidgetsEventRow*) _tmp26_;
					g_signal_emit_by_name ((GtkWidget*) _tmp27_, "destroy");
					_g_object_unref0 (_tmp27_);
					_tmp28_ = self->priv->listbox;
					_tmp29_ = self->priv->event_hashmap;
					_tmp30_ = event_uid;
					_tmp31_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp29_, _tmp30_);
					_tmp32_ = (WidgetsEventRow*) _tmp31_;
					gtk_list_box_remove (_tmp28_, (GtkWidget*) _tmp32_);
					_g_object_unref0 (_tmp32_);
					_tmp33_ = self->priv->event_hashmap;
					_tmp34_ = event_uid;
					gee_abstract_map_unset ((GeeAbstractMap*) _tmp33_, _tmp34_, NULL);
				}
			} else {
				if (in_range) {
					ECalComponent* _tmp35_;
					_tmp35_ = component;
					widgets_events_list_add_row_event (self, _tmp35_, source);
				}
			}
			_g_free0 (event_uid);
			_g_object_unref0 (component);
		}
		_g_object_unref0 (_component_it);
	}
	g_signal_emit (self, widgets_events_list_signals[WIDGETS_EVENTS_LIST_CHANGE_SIGNAL], 0);
}

static void
widgets_events_list_remove_event_model (WidgetsEventsList* self,
                                        ESource* source,
                                        GeeCollection* events)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (events != NULL);
	{
		GeeIterator* _component_it = NULL;
		GeeIterator* _tmp0_;
		_tmp0_ = gee_iterable_iterator ((GeeIterable*) events);
		_component_it = _tmp0_;
		while (TRUE) {
			GeeIterator* _tmp1_;
			ECalComponent* component = NULL;
			GeeIterator* _tmp2_;
			gpointer _tmp3_;
			ICalComponent* ical = NULL;
			ECalComponent* _tmp4_;
			ICalComponent* _tmp5_;
			gchar* event_uid = NULL;
			ICalComponent* _tmp6_;
			const gchar* _tmp7_;
			gchar* _tmp8_;
			WidgetsEventRow* event_row = NULL;
			GeeHashMap* _tmp9_;
			const gchar* _tmp10_;
			gpointer _tmp11_;
			WidgetsEventRow* _tmp12_;
			_tmp1_ = _component_it;
			if (!gee_iterator_next (_tmp1_)) {
				break;
			}
			_tmp2_ = _component_it;
			_tmp3_ = gee_iterator_get (_tmp2_);
			component = (ECalComponent*) _tmp3_;
			_tmp4_ = component;
			_tmp5_ = e_cal_component_get_icalcomponent (_tmp4_);
			ical = _tmp5_;
			_tmp6_ = ical;
			_tmp7_ = i_cal_component_get_uid (_tmp6_);
			_tmp8_ = g_strdup (_tmp7_);
			event_uid = _tmp8_;
			_tmp9_ = self->priv->event_hashmap;
			_tmp10_ = event_uid;
			_tmp11_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp9_, _tmp10_);
			event_row = (WidgetsEventRow*) _tmp11_;
			_tmp12_ = event_row;
			if (_tmp12_ != NULL) {
				WidgetsEventRow* _tmp13_;
				GeeHashMap* _tmp14_;
				const gchar* _tmp15_;
				GtkListBox* _tmp16_;
				WidgetsEventRow* _tmp17_;
				_tmp13_ = event_row;
				g_signal_emit_by_name ((GtkWidget*) _tmp13_, "destroy");
				_tmp14_ = self->priv->event_hashmap;
				_tmp15_ = event_uid;
				gee_abstract_map_unset ((GeeAbstractMap*) _tmp14_, _tmp15_, NULL);
				_tmp16_ = self->priv->listbox;
				_tmp17_ = event_row;
				gtk_list_box_remove (_tmp16_, (GtkWidget*) _tmp17_);
			}
			_g_object_unref0 (event_row);
			_g_free0 (event_uid);
			_g_object_unref0 (component);
		}
		_g_object_unref0 (_component_it);
	}
	g_signal_emit (self, widgets_events_list_signals[WIDGETS_EVENTS_LIST_CHANGE_SIGNAL], 0);
}

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

static gint
widgets_events_list_sort_event_function (WidgetsEventsList* self,
                                         GtkListBoxRow* child1,
                                         GtkListBoxRow* child2)
{
	WidgetsEventRow* e1 = NULL;
	WidgetsEventRow* _tmp0_;
	WidgetsEventRow* e2 = NULL;
	WidgetsEventRow* _tmp1_;
	WidgetsEventRow* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	WidgetsEventRow* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	WidgetsEventRow* _tmp14_;
	gboolean _tmp15_;
	gboolean _tmp16_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	g_return_val_if_fail (child1 != NULL, -1);
	g_return_val_if_fail (child2 != NULL, -1);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (child1, WIDGETS_TYPE_EVENT_ROW, WidgetsEventRow));
	e1 = _tmp0_;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (child2, WIDGETS_TYPE_EVENT_ROW, WidgetsEventRow));
	e2 = _tmp1_;
	_tmp2_ = e1;
	_tmp3_ = widgets_event_row_get_start_time (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = e2;
	_tmp6_ = widgets_event_row_get_start_time (_tmp5_);
	_tmp7_ = _tmp6_;
	if (g_date_time_compare (_tmp4_, _tmp7_) != 0) {
		WidgetsEventRow* _tmp8_;
		GDateTime* _tmp9_;
		GDateTime* _tmp10_;
		WidgetsEventRow* _tmp11_;
		GDateTime* _tmp12_;
		GDateTime* _tmp13_;
		_tmp8_ = e1;
		_tmp9_ = widgets_event_row_get_start_time (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = e2;
		_tmp12_ = widgets_event_row_get_start_time (_tmp11_);
		_tmp13_ = _tmp12_;
		result = g_date_time_compare (_tmp10_, _tmp13_);
		_g_object_unref0 (e2);
		_g_object_unref0 (e1);
		return result;
	}
	_tmp14_ = e1;
	_tmp15_ = widgets_event_row_get_is_allday (_tmp14_);
	_tmp16_ = _tmp15_;
	if (_tmp16_) {
		result = -1;
		_g_object_unref0 (e2);
		_g_object_unref0 (e1);
		return result;
	} else {
		WidgetsEventRow* _tmp17_;
		gboolean _tmp18_;
		gboolean _tmp19_;
		_tmp17_ = e2;
		_tmp18_ = widgets_event_row_get_is_allday (_tmp17_);
		_tmp19_ = _tmp18_;
		if (_tmp19_) {
			result = 1;
			_g_object_unref0 (e2);
			_g_object_unref0 (e1);
			return result;
		}
	}
	result = 0;
	_g_object_unref0 (e2);
	_g_object_unref0 (e1);
	return result;
}

static gboolean
widgets_events_list_event_overlaps_range (WidgetsEventsList* self,
                                          ECalComponent* component)
{
	ICalComponent* ical = NULL;
	ICalComponent* _tmp0_;
	ICalTime* start_time = NULL;
	ICalComponent* _tmp1_;
	ICalTime* _tmp2_;
	ICalTime* end_time = NULL;
	ICalComponent* _tmp3_;
	ICalTime* _tmp4_;
	ICalTime* due_time = NULL;
	ICalComponent* _tmp5_;
	ICalTime* _tmp6_;
	gboolean _tmp7_ = FALSE;
	ICalTime* _tmp8_;
	gboolean _tmp17_ = FALSE;
	ICalTime* _tmp18_;
	GDateTime* event_start = NULL;
	ICalTime* _tmp20_;
	GDateTime* _tmp21_;
	GDateTime* event_end = NULL;
	ICalTime* _tmp22_;
	GDateTime* _tmp23_;
	GDateTime* range_start = NULL;
	GDateTime* _tmp24_;
	GDateTime* _tmp25_;
	GDateTime* _tmp26_;
	GDateTime* _tmp27_;
	GDateTime* range_end = NULL;
	GDateTime* _tmp28_;
	GDateTime* _tmp29_;
	GDateTime* _tmp30_;
	GDateTime* _tmp31_;
	GDateTime* event_start_day = NULL;
	GDateTime* _tmp32_;
	GDateTime* _tmp33_;
	GDateTime* _tmp34_;
	GDateTime* _tmp35_;
	GDateTime* event_end_day = NULL;
	GDateTime* _tmp36_;
	GDateTime* _tmp37_;
	GDateTime* _tmp38_;
	GDateTime* _tmp39_;
	gboolean _tmp40_ = FALSE;
	GDateTime* _tmp41_;
	GDateTime* _tmp42_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (component != NULL, FALSE);
	_tmp0_ = e_cal_component_get_icalcomponent (component);
	ical = _tmp0_;
	_tmp1_ = ical;
	_tmp2_ = i_cal_component_get_dtstart (_tmp1_);
	start_time = _tmp2_;
	_tmp3_ = ical;
	_tmp4_ = i_cal_component_get_dtend (_tmp3_);
	end_time = _tmp4_;
	_tmp5_ = ical;
	_tmp6_ = i_cal_component_get_due (_tmp5_);
	due_time = _tmp6_;
	_tmp8_ = due_time;
	if (_tmp8_ != NULL) {
		ICalTime* _tmp9_;
		_tmp9_ = due_time;
		_tmp7_ = !i_cal_time_is_null_time (_tmp9_);
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		ICalTime* _tmp10_;
		ICalTime* _tmp11_;
		gboolean _tmp12_ = FALSE;
		ICalTime* _tmp13_;
		_tmp10_ = due_time;
		_tmp11_ = _g_object_ref0 (_tmp10_);
		_g_object_unref0 (end_time);
		end_time = _tmp11_;
		_tmp13_ = start_time;
		if (_tmp13_ == NULL) {
			_tmp12_ = TRUE;
		} else {
			ICalTime* _tmp14_;
			_tmp14_ = start_time;
			_tmp12_ = i_cal_time_is_null_time (_tmp14_);
		}
		if (_tmp12_) {
			ICalTime* _tmp15_;
			ICalTime* _tmp16_;
			_tmp15_ = due_time;
			_tmp16_ = _g_object_ref0 (_tmp15_);
			_g_object_unref0 (start_time);
			start_time = _tmp16_;
		}
	}
	_tmp18_ = start_time;
	if (_tmp18_ == NULL) {
		_tmp17_ = TRUE;
	} else {
		ICalTime* _tmp19_;
		_tmp19_ = end_time;
		_tmp17_ = _tmp19_ == NULL;
	}
	if (_tmp17_) {
		result = FALSE;
		_g_object_unref0 (due_time);
		_g_object_unref0 (end_time);
		_g_object_unref0 (start_time);
		return result;
	}
	_tmp20_ = start_time;
	_tmp21_ = calendar_events_util_ical_to_date_time (_tmp20_);
	event_start = _tmp21_;
	_tmp22_ = end_time;
	_tmp23_ = calendar_events_util_ical_to_date_time (_tmp22_);
	event_end = _tmp23_;
	_tmp24_ = self->priv->current_start_date;
	_tmp25_ = self->priv->current_start_date;
	_tmp26_ = self->priv->current_start_date;
	_tmp27_ = g_date_time_new_local (g_date_time_get_year (_tmp24_), g_date_time_get_month (_tmp25_), g_date_time_get_day_of_month (_tmp26_), 0, 0, (gdouble) 0);
	range_start = _tmp27_;
	_tmp28_ = self->priv->current_end_date;
	_tmp29_ = self->priv->current_end_date;
	_tmp30_ = self->priv->current_end_date;
	_tmp31_ = g_date_time_new_local (g_date_time_get_year (_tmp28_), g_date_time_get_month (_tmp29_), g_date_time_get_day_of_month (_tmp30_), 23, 59, (gdouble) 59);
	range_end = _tmp31_;
	_tmp32_ = event_start;
	_tmp33_ = event_start;
	_tmp34_ = event_start;
	_tmp35_ = g_date_time_new_local (g_date_time_get_year (_tmp32_), g_date_time_get_month (_tmp33_), g_date_time_get_day_of_month (_tmp34_), 0, 0, (gdouble) 0);
	event_start_day = _tmp35_;
	_tmp36_ = event_end;
	_tmp37_ = event_end;
	_tmp38_ = event_end;
	_tmp39_ = g_date_time_new_local (g_date_time_get_year (_tmp36_), g_date_time_get_month (_tmp37_), g_date_time_get_day_of_month (_tmp38_), 23, 59, (gdouble) 59);
	event_end_day = _tmp39_;
	_tmp41_ = event_start_day;
	_tmp42_ = range_end;
	if (g_date_time_compare (_tmp41_, _tmp42_) <= 0) {
		GDateTime* _tmp43_;
		GDateTime* _tmp44_;
		_tmp43_ = event_end_day;
		_tmp44_ = range_start;
		_tmp40_ = g_date_time_compare (_tmp43_, _tmp44_) >= 0;
	} else {
		_tmp40_ = FALSE;
	}
	result = _tmp40_;
	_g_date_time_unref0 (event_end_day);
	_g_date_time_unref0 (event_start_day);
	_g_date_time_unref0 (range_end);
	_g_date_time_unref0 (range_start);
	_g_date_time_unref0 (event_end);
	_g_date_time_unref0 (event_start);
	_g_object_unref0 (due_time);
	_g_object_unref0 (end_time);
	_g_object_unref0 (start_time);
	return result;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

void
widgets_events_list_refresh (WidgetsEventsList* self,
                             GDateTime* new_start_date,
                             GDateTime* new_end_date)
{
	GDateTime* _tmp0_;
	GDateTime* _tmp1_ = NULL;
	GDateTime* _tmp2_;
	Util* _tmp3_;
	Util* _tmp4_;
	GtkListBox* _tmp5_;
	GList* _tmp6_;
	GList* _tmp7_;
	GeeHashMap* _tmp12_;
	GeeHashMap* _tmp13_;
	GeeSet* _tmp14_;
	GeeSet* _tmp15_;
	GeeSet* _tmp16_;
	gint _tmp17_ = 0;
	gpointer* _tmp18_;
	GeeMapEntry** _tmp19_;
	gint _tmp19__length1;
	GDateTime* _tmp33_;
	ServicesCalendarEvents* _tmp34_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_start_date != NULL);
	_tmp0_ = _g_date_time_ref0 (new_start_date);
	_g_date_time_unref0 (self->priv->current_start_date);
	self->priv->current_start_date = _tmp0_;
	_tmp1_ = new_end_date;
	if (_tmp1_ == NULL) {
		_tmp1_ = new_start_date;
	}
	_tmp2_ = _g_date_time_ref0 (_tmp1_);
	_g_date_time_unref0 (self->priv->current_end_date);
	self->priv->current_end_date = _tmp2_;
	_tmp3_ = util_get_default ();
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->listbox;
	_tmp6_ = util_get_children (_tmp4_, _tmp5_);
	_tmp7_ = _tmp6_;
	_g_object_unref0 (_tmp4_);
	{
		GList* row_collection = NULL;
		GList* row_it = NULL;
		row_collection = _tmp7_;
		for (row_it = row_collection; row_it != NULL; row_it = row_it->next) {
			GtkListBoxRow* _tmp8_;
			GtkListBoxRow* row = NULL;
			_tmp8_ = _g_object_ref0 ((GtkListBoxRow*) row_it->data);
			row = _tmp8_;
			{
				GtkListBoxRow* _tmp9_;
				GtkListBox* _tmp10_;
				GtkListBoxRow* _tmp11_;
				_tmp9_ = row;
				widgets_event_row_clean_up (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, WIDGETS_TYPE_EVENT_ROW, WidgetsEventRow));
				_tmp10_ = self->priv->listbox;
				_tmp11_ = row;
				gtk_list_box_remove (_tmp10_, (GtkWidget*) _tmp11_);
				_g_object_unref0 (row);
			}
		}
		(row_collection == NULL) ? NULL : (row_collection = (_g_list_free__g_object_unref0_ (row_collection), NULL));
	}
	_tmp12_ = self->priv->event_hashmap;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp12_);
	_tmp13_ = self->priv->signal_map;
	_tmp14_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_;
	_tmp18_ = gee_collection_to_array ((GeeCollection*) _tmp16_, &_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp19__length1 = _tmp17_;
	_g_object_unref0 (_tmp16_);
	{
		GeeMapEntry** entry_collection = NULL;
		gint entry_collection_length1 = 0;
		gint _entry_collection_size_ = 0;
		gint entry_it = 0;
		entry_collection = _tmp19_;
		entry_collection_length1 = _tmp19__length1;
		for (entry_it = 0; entry_it < entry_collection_length1; entry_it = entry_it + 1) {
			GeeMapEntry* _tmp20_;
			GeeMapEntry* entry = NULL;
			_tmp20_ = _g_object_ref0 (entry_collection[entry_it]);
			entry = _tmp20_;
			{
				GeeMapEntry* _tmp21_;
				gconstpointer _tmp22_;
				gconstpointer _tmp23_;
				ServicesCalendarEvents* _tmp24_;
				_tmp21_ = entry;
				_tmp22_ = gee_map_entry_get_value (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = self->priv->event_model;
				if (((GObject*) _tmp23_) == G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, G_TYPE_OBJECT, GObject)) {
					ServicesCalendarEvents* _tmp25_;
					GeeMapEntry* _tmp26_;
					gconstpointer _tmp27_;
					gconstpointer _tmp28_;
					GeeHashMap* _tmp29_;
					GeeMapEntry* _tmp30_;
					gconstpointer _tmp31_;
					gconstpointer _tmp32_;
					_tmp25_ = self->priv->event_model;
					_tmp26_ = entry;
					_tmp27_ = gee_map_entry_get_key (_tmp26_);
					_tmp28_ = _tmp27_;
					g_signal_handler_disconnect ((GObject*) _tmp25_, (gulong) ((guintptr) _tmp28_));
					_tmp29_ = self->priv->signal_map;
					_tmp30_ = entry;
					_tmp31_ = gee_map_entry_get_key (_tmp30_);
					_tmp32_ = _tmp31_;
					gee_abstract_map_unset ((GeeAbstractMap*) _tmp29_, (gpointer) ((guintptr) _tmp32_), NULL);
				}
				_g_object_unref0 (entry);
			}
		}
		entry_collection = (_vala_array_free (entry_collection, entry_collection_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	_tmp33_ = self->priv->current_start_date;
	_tmp34_ = services_calendar_events_new (_tmp33_);
	_g_object_unref0 (self->priv->event_model);
	self->priv->event_model = _tmp34_;
	widgets_events_list_add_events (self);
	g_signal_emit (self, widgets_events_list_signals[WIDGETS_EVENTS_LIST_CHANGE_SIGNAL], 0);
}

void
widgets_events_list_clean_up (WidgetsEventsList* self)
{
	Util* _tmp0_;
	Util* _tmp1_;
	GtkListBox* _tmp2_;
	GList* _tmp3_;
	GList* _tmp4_;
	GeeHashMap* _tmp22_;
	g_return_if_fail (self != NULL);
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->listbox;
	_tmp3_ = util_get_children (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	{
		GList* row_collection = NULL;
		GList* row_it = NULL;
		row_collection = _tmp4_;
		for (row_it = row_collection; row_it != NULL; row_it = row_it->next) {
			GtkListBoxRow* _tmp5_;
			GtkListBoxRow* row = NULL;
			_tmp5_ = _g_object_ref0 ((GtkListBoxRow*) row_it->data);
			row = _tmp5_;
			{
				GtkListBoxRow* _tmp6_;
				_tmp6_ = row;
				widgets_event_row_clean_up (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, WIDGETS_TYPE_EVENT_ROW, WidgetsEventRow));
				_g_object_unref0 (row);
			}
		}
		(row_collection == NULL) ? NULL : (row_collection = (_g_list_free__g_object_unref0_ (row_collection), NULL));
	}
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp7_;
		GeeSet* _tmp8_;
		GeeSet* _tmp9_;
		GeeSet* _tmp10_;
		GeeIterator* _tmp11_;
		GeeIterator* _tmp12_;
		_tmp7_ = self->priv->signal_map;
		_tmp8_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _tmp9_;
		_tmp11_ = gee_iterable_iterator ((GeeIterable*) _tmp10_);
		_tmp12_ = _tmp11_;
		_g_object_unref0 (_tmp10_);
		_entry_it = _tmp12_;
		while (TRUE) {
			GeeIterator* _tmp13_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp14_;
			gpointer _tmp15_;
			GeeMapEntry* _tmp16_;
			gconstpointer _tmp17_;
			gconstpointer _tmp18_;
			GeeMapEntry* _tmp19_;
			gconstpointer _tmp20_;
			gconstpointer _tmp21_;
			_tmp13_ = _entry_it;
			if (!gee_iterator_next (_tmp13_)) {
				break;
			}
			_tmp14_ = _entry_it;
			_tmp15_ = gee_iterator_get (_tmp14_);
			entry = (GeeMapEntry*) _tmp15_;
			_tmp16_ = entry;
			_tmp17_ = gee_map_entry_get_value (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = entry;
			_tmp20_ = gee_map_entry_get_key (_tmp19_);
			_tmp21_ = _tmp20_;
			g_signal_handler_disconnect ((GObject*) _tmp18_, (gulong) ((guintptr) _tmp21_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp22_ = self->priv->signal_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp22_);
}

WidgetsEventsList*
widgets_events_list_construct (GType object_type)
{
	WidgetsEventsList * self = NULL;
	self = (WidgetsEventsList*) g_object_new (object_type, NULL);
	return self;
}

WidgetsEventsList*
widgets_events_list_new (void)
{
	return widgets_events_list_construct (WIDGETS_TYPE_EVENTS_LIST);
}

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

static void
widgets_events_list_set_start_date (WidgetsEventsList* self,
                                    GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_events_list_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, widgets_events_list_properties[WIDGETS_EVENTS_LIST_START_DATE_PROPERTY]);
	}
}

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

static void
widgets_events_list_set_end_date (WidgetsEventsList* self,
                                  GDateTime* value)
{
	GDateTime* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_events_list_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, widgets_events_list_properties[WIDGETS_EVENTS_LIST_END_DATE_PROPERTY]);
	}
}

gboolean
widgets_events_list_get_is_day (WidgetsEventsList* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_day;
	return result;
}

static void
widgets_events_list_set_is_day (WidgetsEventsList* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_events_list_get_is_day (self);
	if (old_value != value) {
		self->priv->_is_day = value;
		g_object_notify_by_pspec ((GObject *) self, widgets_events_list_properties[WIDGETS_EVENTS_LIST_IS_DAY_PROPERTY]);
	}
}

gboolean
widgets_events_list_get_is_month (WidgetsEventsList* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_month;
	return result;
}

static void
widgets_events_list_set_is_month (WidgetsEventsList* self,
                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_events_list_get_is_month (self);
	if (old_value != value) {
		self->priv->_is_month = value;
		g_object_notify_by_pspec ((GObject *) self, widgets_events_list_properties[WIDGETS_EVENTS_LIST_IS_MONTH_PROPERTY]);
	}
}

gboolean
widgets_events_list_get_is_range (WidgetsEventsList* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_range;
	return result;
}

static void
widgets_events_list_set_is_range (WidgetsEventsList* self,
                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_events_list_get_is_range (self);
	if (old_value != value) {
		self->priv->_is_range = value;
		g_object_notify_by_pspec ((GObject *) self, widgets_events_list_properties[WIDGETS_EVENTS_LIST_IS_RANGE_PROPERTY]);
	}
}

gboolean
widgets_events_list_get_has_items (WidgetsEventsList* self)
{
	gboolean result;
	GeeHashMap* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->event_hashmap;
	_tmp1_ = gee_abstract_map_get_size ((GeeAbstractMap*) _tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_ > 0;
	return result;
}

static gint
_widgets_events_list_sort_event_function_gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                 GtkListBoxRow* row2,
                                                                 gpointer self)
{
	gint result;
	result = widgets_events_list_sort_event_function ((WidgetsEventsList*) self, row1, row2);
	return result;
}

static void
_widgets_events_list___lambda789_ (WidgetsEventsList* self)
{
	GtkRevealer* _tmp0_;
	ServicesSettings* _tmp1_;
	ServicesSettings* _tmp2_;
	GSettings* _tmp3_;
	_tmp0_ = self->priv->main_revealer;
	_tmp1_ = services_settings_get_default ();
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->settings;
	gtk_revealer_set_reveal_child (_tmp0_, g_settings_get_boolean (_tmp3_, "calendar-enabled"));
	_g_object_unref0 (_tmp2_);
}

static void
__widgets_events_list___lambda789__g_settings_changed (GSettings* _sender,
                                                       const gchar* key,
                                                       gpointer self)
{
	_widgets_events_list___lambda789_ ((WidgetsEventsList*) self);
}

static GObject *
widgets_events_list_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsEventsList * self;
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	ServicesCalendarEvents* _tmp5_;
	GeeHashMap* _tmp6_;
	GtkListBox* _tmp7_ = NULL;
	GtkListBox* _tmp8_;
	GtkListBox* _tmp9_;
	GtkGrid* listbox_grid = NULL;
	GtkGrid* _tmp10_ = NULL;
	GtkGrid* _tmp11_;
	GtkListBox* _tmp12_;
	GtkGrid* main_grid = NULL;
	GtkGrid* _tmp13_ = NULL;
	GtkGrid* _tmp14_;
	GtkGrid* _tmp15_;
	GtkGrid* _tmp16_;
	ServicesSettings* _tmp17_;
	ServicesSettings* _tmp18_;
	GSettings* _tmp19_;
	GtkGrid* _tmp20_;
	GtkWidget* _tmp21_;
	GtkRevealer* _tmp22_ = NULL;
	GtkRevealer* _tmp23_;
	GeeHashMap* _tmp24_;
	ServicesSettings* _tmp25_;
	ServicesSettings* _tmp26_;
	GSettings* _tmp27_;
	gulong _tmp28_;
	ServicesSettings* _tmp29_;
	ServicesSettings* _tmp30_;
	parent_class = G_OBJECT_CLASS (widgets_events_list_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_EVENTS_LIST, WidgetsEventsList);
	_tmp0_ = self->priv->_start_date;
	_tmp1_ = _g_date_time_ref0 (_tmp0_);
	_g_date_time_unref0 (self->priv->current_start_date);
	self->priv->current_start_date = _tmp1_;
	_tmp2_ = self->priv->_end_date;
	_tmp3_ = _g_date_time_ref0 (_tmp2_);
	_g_date_time_unref0 (self->priv->current_end_date);
	self->priv->current_end_date = _tmp3_;
	_tmp4_ = self->priv->current_start_date;
	_tmp5_ = services_calendar_events_new (_tmp4_);
	_g_object_unref0 (self->priv->event_model);
	self->priv->event_model = _tmp5_;
	_tmp6_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, WIDGETS_TYPE_EVENT_ROW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->event_hashmap);
	self->priv->event_hashmap = _tmp6_;
	_tmp7_ = (GtkListBox*) gtk_list_box_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_START);
	gtk_list_box_set_selection_mode (_tmp7_, GTK_SELECTION_NONE);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->listbox);
	self->priv->listbox = _tmp7_;
	_tmp8_ = self->priv->listbox;
	gtk_list_box_set_sort_func (_tmp8_, _widgets_events_list_sort_event_function_gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	_tmp9_ = self->priv->listbox;
	gtk_widget_add_css_class ((GtkWidget*) _tmp9_, "listbox-background");
	_tmp10_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp10_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp10_);
	listbox_grid = _tmp10_;
	_tmp11_ = listbox_grid;
	_tmp12_ = self->priv->listbox;
	gtk_grid_attach (_tmp11_, (GtkWidget*) _tmp12_, 0, 0, 1, 1);
	_tmp13_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp13_, TRUE);
	g_object_ref_sink (_tmp13_);
	main_grid = _tmp13_;
	_tmp14_ = main_grid;
	gtk_widget_add_css_class ((GtkWidget*) _tmp14_, "description-box");
	_tmp15_ = main_grid;
	_tmp16_ = listbox_grid;
	gtk_grid_attach (_tmp15_, (GtkWidget*) _tmp16_, 0, 0, 1, 1);
	_tmp17_ = services_settings_get_default ();
	_tmp18_ = _tmp17_;
	_tmp19_ = _tmp18_->settings;
	_tmp20_ = main_grid;
	_tmp21_ = _g_object_ref0 ((GtkWidget*) _tmp20_);
	_tmp22_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp22_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_reveal_child (_tmp22_, g_settings_get_boolean (_tmp19_, "calendar-enabled"));
	gtk_revealer_set_child (_tmp22_, _tmp21_);
	_g_object_unref0 (_tmp21_);
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->main_revealer);
	self->priv->main_revealer = _tmp22_;
	_g_object_unref0 (_tmp18_);
	_tmp23_ = self->priv->main_revealer;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp23_);
	widgets_events_list_add_events (self);
	_tmp24_ = self->priv->signal_map;
	_tmp25_ = services_settings_get_default ();
	_tmp26_ = _tmp25_;
	_tmp27_ = _tmp26_->settings;
	_tmp28_ = g_signal_connect_object (_tmp27_, "changed::calendar-enabled", (GCallback) __widgets_events_list___lambda789__g_settings_changed, self, 0);
	_tmp29_ = services_settings_get_default ();
	_tmp30_ = _tmp29_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp24_, (gpointer) ((guintptr) _tmp28_), (GObject*) _tmp30_);
	_g_object_unref0 (_tmp30_);
	_g_object_unref0 (_tmp26_);
	_g_object_unref0 (main_grid);
	_g_object_unref0 (listbox_grid);
	return obj;
}

static void
widgets_events_list_class_init (WidgetsEventsListClass * klass,
                                gpointer klass_data)
{
	widgets_events_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsEventsList_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_events_list_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_events_list_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_events_list_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_events_list_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_EVENTS_LIST_START_DATE_PROPERTY, widgets_events_list_properties[WIDGETS_EVENTS_LIST_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), WIDGETS_EVENTS_LIST_END_DATE_PROPERTY, widgets_events_list_properties[WIDGETS_EVENTS_LIST_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));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_EVENTS_LIST_IS_DAY_PROPERTY, widgets_events_list_properties[WIDGETS_EVENTS_LIST_IS_DAY_PROPERTY] = g_param_spec_boolean ("is-day", "is-day", "is-day", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_EVENTS_LIST_IS_MONTH_PROPERTY, widgets_events_list_properties[WIDGETS_EVENTS_LIST_IS_MONTH_PROPERTY] = g_param_spec_boolean ("is-month", "is-month", "is-month", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_EVENTS_LIST_IS_RANGE_PROPERTY, widgets_events_list_properties[WIDGETS_EVENTS_LIST_IS_RANGE_PROPERTY] = g_param_spec_boolean ("is-range", "is-range", "is-range", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_EVENTS_LIST_HAS_ITEMS_PROPERTY, widgets_events_list_properties[WIDGETS_EVENTS_LIST_HAS_ITEMS_PROPERTY] = g_param_spec_boolean ("has-items", "has-items", "has-items", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	widgets_events_list_signals[WIDGETS_EVENTS_LIST_CHANGE_SIGNAL] = g_signal_new ("change", WIDGETS_TYPE_EVENTS_LIST, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
widgets_events_list_instance_init (WidgetsEventsList * self,
                                   gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = widgets_events_list_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->signal_map = _tmp0_;
}

static void
widgets_events_list_finalize (GObject * obj)
{
	WidgetsEventsList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_EVENTS_LIST, WidgetsEventsList);
	g_debug ("EventsList.vala:80: Destroying Widgets.EventsList\n");
	_g_date_time_unref0 (self->priv->_start_date);
	_g_date_time_unref0 (self->priv->_end_date);
	_g_object_unref0 (self->priv->listbox);
	_g_object_unref0 (self->priv->main_revealer);
	_g_object_unref0 (self->priv->event_hashmap);
	_g_object_unref0 (self->priv->event_model);
	_g_date_time_unref0 (self->priv->current_start_date);
	_g_date_time_unref0 (self->priv->current_end_date);
	_g_object_unref0 (self->priv->signal_map);
	G_OBJECT_CLASS (widgets_events_list_parent_class)->finalize (obj);
}

static GType
widgets_events_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsEventsListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_events_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsEventsList), 0, (GInstanceInitFunc) widgets_events_list_instance_init, NULL };
	GType widgets_events_list_type_id;
	widgets_events_list_type_id = g_type_register_static (adw_bin_get_type (), "WidgetsEventsList", &g_define_type_info, 0);
	WidgetsEventsList_private_offset = g_type_add_instance_private (widgets_events_list_type_id, sizeof (WidgetsEventsListPrivate));
	return widgets_events_list_type_id;
}

GType
widgets_events_list_get_type (void)
{
	static volatile gsize widgets_events_list_type_id__once = 0;
	if (g_once_init_enter (&widgets_events_list_type_id__once)) {
		GType widgets_events_list_type_id;
		widgets_events_list_type_id = widgets_events_list_get_type_once ();
		g_once_init_leave (&widgets_events_list_type_id__once, widgets_events_list_type_id);
	}
	return widgets_events_list_type_id__once;
}

static void
_vala_widgets_events_list_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	WidgetsEventsList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_EVENTS_LIST, WidgetsEventsList);
	switch (property_id) {
		case WIDGETS_EVENTS_LIST_START_DATE_PROPERTY:
		g_value_set_boxed (value, widgets_events_list_get_start_date (self));
		break;
		case WIDGETS_EVENTS_LIST_END_DATE_PROPERTY:
		g_value_set_boxed (value, widgets_events_list_get_end_date (self));
		break;
		case WIDGETS_EVENTS_LIST_IS_DAY_PROPERTY:
		g_value_set_boolean (value, widgets_events_list_get_is_day (self));
		break;
		case WIDGETS_EVENTS_LIST_IS_MONTH_PROPERTY:
		g_value_set_boolean (value, widgets_events_list_get_is_month (self));
		break;
		case WIDGETS_EVENTS_LIST_IS_RANGE_PROPERTY:
		g_value_set_boolean (value, widgets_events_list_get_is_range (self));
		break;
		case WIDGETS_EVENTS_LIST_HAS_ITEMS_PROPERTY:
		g_value_set_boolean (value, widgets_events_list_get_has_items (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_events_list_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	WidgetsEventsList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_EVENTS_LIST, WidgetsEventsList);
	switch (property_id) {
		case WIDGETS_EVENTS_LIST_START_DATE_PROPERTY:
		widgets_events_list_set_start_date (self, g_value_get_boxed (value));
		break;
		case WIDGETS_EVENTS_LIST_END_DATE_PROPERTY:
		widgets_events_list_set_end_date (self, g_value_get_boxed (value));
		break;
		case WIDGETS_EVENTS_LIST_IS_DAY_PROPERTY:
		widgets_events_list_set_is_day (self, g_value_get_boolean (value));
		break;
		case WIDGETS_EVENTS_LIST_IS_MONTH_PROPERTY:
		widgets_events_list_set_is_month (self, g_value_get_boolean (value));
		break;
		case WIDGETS_EVENTS_LIST_IS_RANGE_PROPERTY:
		widgets_events_list_set_is_range (self, g_value_get_boolean (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);
}

