/* ItemDetailCompleted.c generated by valac 0.56.19, the Vala compiler
 * generated from ItemDetailCompleted.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 "planify.h"
#include <gtk/gtk.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>
#include <glib/gi18n-lib.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_ITEM_DETAIL_COMPLETED (widgets_item_detail_completed_get_type ())
#define WIDGETS_ITEM_DETAIL_COMPLETED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_ITEM_DETAIL_COMPLETED, WidgetsItemDetailCompleted))
#define WIDGETS_ITEM_DETAIL_COMPLETED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_ITEM_DETAIL_COMPLETED, WidgetsItemDetailCompletedClass))
#define WIDGETS_IS_ITEM_DETAIL_COMPLETED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_ITEM_DETAIL_COMPLETED))
#define WIDGETS_IS_ITEM_DETAIL_COMPLETED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_ITEM_DETAIL_COMPLETED))
#define WIDGETS_ITEM_DETAIL_COMPLETED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_ITEM_DETAIL_COMPLETED, WidgetsItemDetailCompletedClass))

typedef struct _WidgetsItemDetailCompleted WidgetsItemDetailCompleted;
typedef struct _WidgetsItemDetailCompletedClass WidgetsItemDetailCompletedClass;
typedef struct _WidgetsItemDetailCompletedPrivate WidgetsItemDetailCompletedPrivate;

#define WIDGETS_TYPE_COMPLETED_TASK_ROW (widgets_completed_task_row_get_type ())
#define WIDGETS_COMPLETED_TASK_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_COMPLETED_TASK_ROW, WidgetsCompletedTaskRow))
#define WIDGETS_COMPLETED_TASK_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_COMPLETED_TASK_ROW, WidgetsCompletedTaskRowClass))
#define WIDGETS_IS_COMPLETED_TASK_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_COMPLETED_TASK_ROW))
#define WIDGETS_IS_COMPLETED_TASK_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_COMPLETED_TASK_ROW))
#define WIDGETS_COMPLETED_TASK_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_COMPLETED_TASK_ROW, WidgetsCompletedTaskRowClass))

typedef struct _WidgetsCompletedTaskRow WidgetsCompletedTaskRow;
typedef struct _WidgetsCompletedTaskRowClass WidgetsCompletedTaskRowClass;
enum  {
	WIDGETS_ITEM_DETAIL_COMPLETED_0_PROPERTY,
	WIDGETS_ITEM_DETAIL_COMPLETED_ITEM_PROPERTY,
	WIDGETS_ITEM_DETAIL_COMPLETED_NUM_PROPERTIES
};
static GParamSpec* widgets_item_detail_completed_properties[WIDGETS_ITEM_DETAIL_COMPLETED_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

#define WIDGETS_TYPE_SCROLLED_WINDOW (widgets_scrolled_window_get_type ())
#define WIDGETS_SCROLLED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_SCROLLED_WINDOW, WidgetsScrolledWindow))
#define WIDGETS_SCROLLED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_SCROLLED_WINDOW, WidgetsScrolledWindowClass))
#define WIDGETS_IS_SCROLLED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_SCROLLED_WINDOW))
#define WIDGETS_IS_SCROLLED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_SCROLLED_WINDOW))
#define WIDGETS_SCROLLED_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_SCROLLED_WINDOW, WidgetsScrolledWindowClass))

typedef struct _WidgetsScrolledWindow WidgetsScrolledWindow;
typedef struct _WidgetsScrolledWindowClass WidgetsScrolledWindowClass;
enum  {
	WIDGETS_ITEM_DETAIL_COMPLETED_VIEW_ITEM_SIGNAL,
	WIDGETS_ITEM_DETAIL_COMPLETED_NUM_SIGNALS
};
static guint widgets_item_detail_completed_signals[WIDGETS_ITEM_DETAIL_COMPLETED_NUM_SIGNALS] = {0};

struct _WidgetsItemDetailCompleted {
	AdwNavigationPage parent_instance;
	WidgetsItemDetailCompletedPrivate * priv;
};

struct _WidgetsItemDetailCompletedClass {
	AdwNavigationPageClass parent_class;
};

struct _WidgetsItemDetailCompletedPrivate {
	ObjectsItem* _item;
	GtkListBox* listbox;
	WidgetsMarkdownEditor* markdown_editor;
	GeeHashMap* items_checked;
	GeeHashMap* signal_map;
};

static gint WidgetsItemDetailCompleted_private_offset;
static gpointer widgets_item_detail_completed_parent_class = NULL;

VALA_EXTERN GType widgets_item_detail_completed_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsItemDetailCompleted, g_object_unref)
VALA_EXTERN GType widgets_completed_task_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsCompletedTaskRow, g_object_unref)
VALA_EXTERN WidgetsItemDetailCompleted* widgets_item_detail_completed_new (ObjectsItem* item);
VALA_EXTERN WidgetsItemDetailCompleted* widgets_item_detail_completed_construct (GType object_type,
                                                                     ObjectsItem* item);
static void widgets_item_detail_completed_add_items (WidgetsItemDetailCompleted* self);
VALA_EXTERN ObjectsItem* widgets_item_detail_completed_get_item (WidgetsItemDetailCompleted* self);
VALA_EXTERN WidgetsCompletedTaskRow* widgets_completed_task_row_new (ObjectsItem* item);
VALA_EXTERN WidgetsCompletedTaskRow* widgets_completed_task_row_construct (GType object_type,
                                                               ObjectsItem* item);
static GtkWidget* widgets_item_detail_completed_add_property_card (WidgetsItemDetailCompleted* self,
                                                            const gchar* icon_name,
                                                            const gchar* title,
                                                            const gchar* value);
VALA_EXTERN void widgets_item_detail_completed_clean_up (WidgetsItemDetailCompleted* self);
static void widgets_item_detail_completed_set_item (WidgetsItemDetailCompleted* self,
                                             ObjectsItem* value);
static GObject * widgets_item_detail_completed_constructor (GType type,
                                                     guint n_construct_properties,
                                                     GObjectConstructParam * construct_properties);
VALA_EXTERN GType widgets_scrolled_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsScrolledWindow, g_object_unref)
VALA_EXTERN WidgetsScrolledWindow* widgets_scrolled_window_new (GtkWidget* widget,
                                                    GtkOrientation orientation);
VALA_EXTERN WidgetsScrolledWindow* widgets_scrolled_window_construct (GType object_type,
                                                          GtkWidget* widget,
                                                          GtkOrientation orientation);
static void _widgets_item_detail_completed___lambda612_ (WidgetsItemDetailCompleted* self,
                                                  ObjectsItem* _item,
                                                  gboolean old_checked);
VALA_EXTERN void widgets_completed_task_row_hide_destroy (WidgetsCompletedTaskRow* self);
static void __widgets_item_detail_completed___lambda612__services_event_bus_checked_toggled (ServicesEventBus* _sender,
                                                                                      ObjectsItem* item,
                                                                                      gboolean old_checked,
                                                                                      gpointer self);
static void _widgets_item_detail_completed___lambda613_ (WidgetsItemDetailCompleted* self,
                                                  GtkListBoxRow* row);
VALA_EXTERN ObjectsItem* widgets_completed_task_row_get_item (WidgetsCompletedTaskRow* self);
static void __widgets_item_detail_completed___lambda613__gtk_list_box_row_activated (GtkListBox* _sender,
                                                                              GtkListBoxRow* row,
                                                                              gpointer self);
static void _widgets_item_detail_completed___lambda614_ (WidgetsItemDetailCompleted* self);
static void __widgets_item_detail_completed___lambda614__gtk_widget_destroy (GtkWidget* _sender,
                                                                      gpointer self);
static void widgets_item_detail_completed_finalize (GObject * obj);
static GType widgets_item_detail_completed_get_type_once (void);
static void _vala_widgets_item_detail_completed_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_widgets_item_detail_completed_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_item_detail_completed_get_instance_private (WidgetsItemDetailCompleted* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsItemDetailCompleted_private_offset);
}

WidgetsItemDetailCompleted*
widgets_item_detail_completed_construct (GType object_type,
                                         ObjectsItem* item)
{
	WidgetsItemDetailCompleted * self = NULL;
	g_return_val_if_fail (item != NULL, NULL);
	self = (WidgetsItemDetailCompleted*) g_object_new (object_type, "item", item, NULL);
	return self;
}

WidgetsItemDetailCompleted*
widgets_item_detail_completed_new (ObjectsItem* item)
{
	return widgets_item_detail_completed_construct (WIDGETS_TYPE_ITEM_DETAIL_COMPLETED, item);
}

static void
widgets_item_detail_completed_add_items (WidgetsItemDetailCompleted* self)
{
	g_return_if_fail (self != NULL);
	{
		GeeArrayList* _subitem_list = NULL;
		ObjectsItem* _tmp0_;
		GeeArrayList* _tmp1_;
		GeeArrayList* _tmp2_;
		gint _subitem_size = 0;
		GeeArrayList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _subitem_index = 0;
		_tmp0_ = self->priv->_item;
		_tmp1_ = objects_item_get_items (_tmp0_);
		_tmp2_ = _tmp1_;
		_subitem_list = _tmp2_;
		_tmp3_ = _subitem_list;
		_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_subitem_size = _tmp5_;
		_subitem_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			ObjectsItem* subitem = NULL;
			GeeArrayList* _tmp8_;
			gpointer _tmp9_;
			ObjectsItem* _tmp10_;
			gboolean _tmp11_;
			gboolean _tmp12_;
			GeeHashMap* _tmp13_;
			ObjectsItem* _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			_subitem_index = _subitem_index + 1;
			_tmp6_ = _subitem_index;
			_tmp7_ = _subitem_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _subitem_list;
			_tmp9_ = gee_abstract_list_get ((GeeAbstractList*) _tmp8_, _subitem_index);
			subitem = (ObjectsItem*) _tmp9_;
			_tmp10_ = subitem;
			_tmp11_ = objects_item_get_checked (_tmp10_);
			_tmp12_ = _tmp11_;
			if (!_tmp12_) {
				_g_object_unref0 (subitem);
				continue;
			}
			_tmp13_ = self->priv->items_checked;
			_tmp14_ = subitem;
			_tmp15_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp14_);
			_tmp16_ = _tmp15_;
			if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp13_, _tmp16_)) {
				GeeHashMap* _tmp17_;
				ObjectsItem* _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				ObjectsItem* _tmp21_;
				WidgetsCompletedTaskRow* _tmp22_;
				WidgetsCompletedTaskRow* _tmp23_;
				GtkListBox* _tmp24_;
				GeeHashMap* _tmp25_;
				ObjectsItem* _tmp26_;
				const gchar* _tmp27_;
				const gchar* _tmp28_;
				gpointer _tmp29_;
				WidgetsCompletedTaskRow* _tmp30_;
				_tmp17_ = self->priv->items_checked;
				_tmp18_ = subitem;
				_tmp19_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = subitem;
				_tmp22_ = widgets_completed_task_row_new (_tmp21_);
				g_object_ref_sink (_tmp22_);
				_tmp23_ = _tmp22_;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp17_, _tmp20_, _tmp23_);
				_g_object_unref0 (_tmp23_);
				_tmp24_ = self->priv->listbox;
				_tmp25_ = self->priv->items_checked;
				_tmp26_ = subitem;
				_tmp27_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp25_, _tmp28_);
				_tmp30_ = (WidgetsCompletedTaskRow*) _tmp29_;
				gtk_list_box_append (_tmp24_, (GtkWidget*) _tmp30_);
				_g_object_unref0 (_tmp30_);
			}
			_g_object_unref0 (subitem);
		}
	}
}

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

static GtkWidget*
widgets_item_detail_completed_add_property_card (WidgetsItemDetailCompleted* self,
                                                 const gchar* icon_name,
                                                 const gchar* title,
                                                 const gchar* value)
{
	GtkGrid* card_grid = NULL;
	GtkGrid* _tmp0_ = NULL;
	GtkImage* _tmp1_;
	GtkImage* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	GtkLabel* _tmp6_ = NULL;
	GtkLabel* _tmp7_;
	gchar* _tmp8_;
	gchar** _tmp9_;
	GtkLabel* _tmp10_ = NULL;
	GtkLabel* _tmp11_;
	AdwBin* card = NULL;
	GtkWidget* _tmp12_;
	gchar* _tmp13_;
	gchar** _tmp14_;
	AdwBin* _tmp15_ = NULL;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (icon_name != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_spacing (_tmp0_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp0_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp0_, 6);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp0_, 6);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp0_, 6);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	g_object_ref_sink (_tmp0_);
	card_grid = _tmp0_;
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name (icon_name);
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	gtk_grid_attach (card_grid, (GtkWidget*) _tmp2_, 0, 0, 1, 2);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = g_strdup ("title-4");
	_tmp4_ = g_strdup ("caption");
	_tmp5_ = g_new0 (gchar*, 2 + 1);
	_tmp5_[0] = _tmp3_;
	_tmp5_[1] = _tmp4_;
	_tmp6_ = (GtkLabel*) gtk_label_new (title);
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 2, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	gtk_grid_attach (card_grid, (GtkWidget*) _tmp7_, 1, 0, 1, 1);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = g_strdup ("caption");
	_tmp9_ = g_new0 (gchar*, 1 + 1);
	_tmp9_[0] = _tmp8_;
	_tmp10_ = (GtkLabel*) gtk_label_new (value);
	gtk_label_set_xalign (_tmp10_, (gfloat) 0);
	gtk_label_set_use_markup (_tmp10_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp10_, GTK_ALIGN_START);
	gtk_label_set_ellipsize (_tmp10_, PANGO_ELLIPSIZE_END);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp10_, _tmp9_);
	_tmp9_ = (_vala_array_free (_tmp9_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	gtk_grid_attach (card_grid, (GtkWidget*) _tmp11_, 1, 1, 1, 1);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = _g_object_ref0 ((GtkWidget*) card_grid);
	_tmp13_ = g_strdup ("card");
	_tmp14_ = g_new0 (gchar*, 1 + 1);
	_tmp14_[0] = _tmp13_;
	_tmp15_ = (AdwBin*) adw_bin_new ();
	adw_bin_set_child (_tmp15_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp15_, _tmp14_);
	_tmp14_ = (_vala_array_free (_tmp14_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp15_);
	card = _tmp15_;
	result = (GtkWidget*) card;
	_g_object_unref0 (card_grid);
	return result;
}

void
widgets_item_detail_completed_clean_up (WidgetsItemDetailCompleted* self)
{
	GeeHashMap* _tmp15_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->signal_map;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeMapEntry* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = entry;
			_tmp10_ = gee_map_entry_get_value (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			g_signal_handler_disconnect ((GObject*) _tmp11_, (gulong) ((guintptr) _tmp14_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp15_ = self->priv->signal_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
}

ObjectsItem*
widgets_item_detail_completed_get_item (WidgetsItemDetailCompleted* self)
{
	ObjectsItem* result;
	ObjectsItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item;
	result = _tmp0_;
	return result;
}

static void
widgets_item_detail_completed_set_item (WidgetsItemDetailCompleted* self,
                                        ObjectsItem* value)
{
	ObjectsItem* old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_item_detail_completed_get_item (self);
	if (old_value != value) {
		ObjectsItem* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_item);
		self->priv->_item = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, widgets_item_detail_completed_properties[WIDGETS_ITEM_DETAIL_COMPLETED_ITEM_PROPERTY]);
	}
}

static void
_widgets_item_detail_completed___lambda612_ (WidgetsItemDetailCompleted* self,
                                             ObjectsItem* _item,
                                             gboolean old_checked)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	ObjectsItem* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (_item != NULL);
	_tmp0_ = objects_item_get_parent_id (_item);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_item;
	_tmp3_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp2_);
	_tmp4_ = _tmp3_;
	if (g_strcmp0 (_tmp1_, _tmp4_) != 0) {
		return;
	}
	if (!old_checked) {
		GeeHashMap* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp5_ = self->priv->items_checked;
		_tmp6_ = objects_base_object_get_id ((ObjectsBaseObject*) _item);
		_tmp7_ = _tmp6_;
		if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp5_, _tmp7_)) {
			GeeHashMap* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			WidgetsCompletedTaskRow* _tmp11_;
			WidgetsCompletedTaskRow* _tmp12_;
			GtkListBox* _tmp13_;
			GeeHashMap* _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			gpointer _tmp17_;
			WidgetsCompletedTaskRow* _tmp18_;
			_tmp8_ = self->priv->items_checked;
			_tmp9_ = objects_base_object_get_id ((ObjectsBaseObject*) _item);
			_tmp10_ = _tmp9_;
			_tmp11_ = widgets_completed_task_row_new (_item);
			g_object_ref_sink (_tmp11_);
			_tmp12_ = _tmp11_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp8_, _tmp10_, _tmp12_);
			_g_object_unref0 (_tmp12_);
			_tmp13_ = self->priv->listbox;
			_tmp14_ = self->priv->items_checked;
			_tmp15_ = objects_base_object_get_id ((ObjectsBaseObject*) _item);
			_tmp16_ = _tmp15_;
			_tmp17_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp14_, _tmp16_);
			_tmp18_ = (WidgetsCompletedTaskRow*) _tmp17_;
			gtk_list_box_append (_tmp13_, (GtkWidget*) _tmp18_);
			_g_object_unref0 (_tmp18_);
		}
	} else {
		GeeHashMap* _tmp19_;
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		_tmp19_ = self->priv->items_checked;
		_tmp20_ = objects_base_object_get_id ((ObjectsBaseObject*) _item);
		_tmp21_ = _tmp20_;
		if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp19_, _tmp21_)) {
			GeeHashMap* _tmp22_;
			const gchar* _tmp23_;
			const gchar* _tmp24_;
			gpointer _tmp25_;
			WidgetsCompletedTaskRow* _tmp26_;
			GeeHashMap* _tmp27_;
			const gchar* _tmp28_;
			const gchar* _tmp29_;
			_tmp22_ = self->priv->items_checked;
			_tmp23_ = objects_base_object_get_id ((ObjectsBaseObject*) _item);
			_tmp24_ = _tmp23_;
			_tmp25_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp22_, _tmp24_);
			_tmp26_ = (WidgetsCompletedTaskRow*) _tmp25_;
			widgets_completed_task_row_hide_destroy (_tmp26_);
			_g_object_unref0 (_tmp26_);
			_tmp27_ = self->priv->items_checked;
			_tmp28_ = objects_base_object_get_id ((ObjectsBaseObject*) _item);
			_tmp29_ = _tmp28_;
			gee_abstract_map_unset ((GeeAbstractMap*) _tmp27_, _tmp29_, NULL);
		}
	}
}

static void
__widgets_item_detail_completed___lambda612__services_event_bus_checked_toggled (ServicesEventBus* _sender,
                                                                                 ObjectsItem* item,
                                                                                 gboolean old_checked,
                                                                                 gpointer self)
{
	_widgets_item_detail_completed___lambda612_ ((WidgetsItemDetailCompleted*) self, item, old_checked);
}

static void
_widgets_item_detail_completed___lambda613_ (WidgetsItemDetailCompleted* self,
                                             GtkListBoxRow* row)
{
	ObjectsItem* item = NULL;
	ObjectsItem* _tmp0_;
	ObjectsItem* _tmp1_;
	ObjectsItem* _tmp2_;
	ObjectsItem* _tmp3_;
	g_return_if_fail (row != NULL);
	_tmp0_ = widgets_completed_task_row_get_item (G_TYPE_CHECK_INSTANCE_CAST (row, WIDGETS_TYPE_COMPLETED_TASK_ROW, WidgetsCompletedTaskRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	item = _tmp2_;
	_tmp3_ = item;
	g_signal_emit (self, widgets_item_detail_completed_signals[WIDGETS_ITEM_DETAIL_COMPLETED_VIEW_ITEM_SIGNAL], 0, _tmp3_);
	_g_object_unref0 (item);
}

static void
__widgets_item_detail_completed___lambda613__gtk_list_box_row_activated (GtkListBox* _sender,
                                                                         GtkListBoxRow* row,
                                                                         gpointer self)
{
	_widgets_item_detail_completed___lambda613_ ((WidgetsItemDetailCompleted*) self, row);
}

static void
_widgets_item_detail_completed___lambda614_ (WidgetsItemDetailCompleted* self)
{
	widgets_item_detail_completed_clean_up (self);
}

static void
__widgets_item_detail_completed___lambda614__gtk_widget_destroy (GtkWidget* _sender,
                                                                 gpointer self)
{
	_widgets_item_detail_completed___lambda614_ ((WidgetsItemDetailCompleted*) self);
}

static GObject *
widgets_item_detail_completed_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsItemDetailCompleted * self;
	WidgetsTextView* content_textview = NULL;
	gchar* _tmp0_;
	WidgetsTextView* _tmp1_ = NULL;
	WidgetsTextView* _tmp2_;
	WidgetsTextView* _tmp3_;
	WidgetsTextView* _tmp4_;
	ObjectsItem* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	WidgetsTextView* _tmp8_;
	AdwPreferencesGroup* content_group = NULL;
	AdwPreferencesGroup* _tmp9_ = NULL;
	AdwPreferencesGroup* _tmp10_;
	AdwPreferencesGroup* _tmp11_;
	WidgetsTextView* _tmp12_;
	GtkGrid* properties_grid = NULL;
	GtkGrid* _tmp13_ = NULL;
	GtkGrid* _tmp14_;
	ObjectsItem* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	GDateTime* _tmp18_;
	GDateTime* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	GtkWidget* _tmp22_;
	GtkWidget* _tmp23_;
	const gchar* _tmp24_ = NULL;
	ObjectsItem* _tmp25_;
	gboolean _tmp26_;
	gboolean _tmp27_;
	GtkGrid* _tmp33_;
	GtkWidget* _tmp34_;
	GtkWidget* _tmp35_;
	GtkGrid* _tmp36_;
	ObjectsItem* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	GtkWidget* _tmp40_;
	GtkWidget* _tmp41_;
	AdwPreferencesGroup* properties_group = NULL;
	AdwPreferencesGroup* _tmp42_ = NULL;
	AdwPreferencesGroup* _tmp43_;
	AdwPreferencesGroup* _tmp44_;
	GtkGrid* _tmp45_;
	ObjectsItem* _tmp46_;
	ObjectsProject* _tmp47_;
	ObjectsProject* _tmp48_;
	ObjectsProject* _tmp49_;
	WidgetsMarkdownEditor* _tmp50_ = NULL;
	WidgetsMarkdownEditor* _tmp51_;
	GtkTextView* _tmp52_;
	WidgetsMarkdownEditor* _tmp53_;
	WidgetsMarkdownEditor* _tmp54_;
	WidgetsMarkdownEditor* _tmp55_;
	WidgetsMarkdownEditor* _tmp56_;
	WidgetsMarkdownEditor* _tmp57_;
	WidgetsMarkdownEditor* _tmp58_;
	ObjectsItem* _tmp59_;
	const gchar* _tmp60_;
	const gchar* _tmp61_;
	AdwBin* markdown_editor_card = NULL;
	WidgetsMarkdownEditor* _tmp62_;
	GtkWidget* _tmp63_;
	AdwBin* _tmp64_ = NULL;
	AdwBin* _tmp65_;
	AdwPreferencesGroup* description_group = NULL;
	AdwPreferencesGroup* _tmp66_ = NULL;
	AdwPreferencesGroup* _tmp67_;
	AdwPreferencesGroup* _tmp68_;
	AdwBin* _tmp69_;
	gchar* _tmp70_;
	gchar* _tmp71_;
	gchar** _tmp72_;
	GtkListBox* _tmp73_ = NULL;
	AdwPreferencesGroup* subitems_group = NULL;
	AdwPreferencesGroup* _tmp74_ = NULL;
	AdwPreferencesGroup* _tmp75_;
	AdwPreferencesGroup* _tmp76_;
	GtkListBox* _tmp77_;
	GtkBox* content = NULL;
	GtkBox* _tmp78_ = NULL;
	GtkBox* _tmp79_;
	AdwPreferencesGroup* _tmp80_;
	GtkBox* _tmp81_;
	AdwPreferencesGroup* _tmp82_;
	GtkBox* _tmp83_;
	AdwPreferencesGroup* _tmp84_;
	ObjectsItem* _tmp85_;
	GeeArrayList* _tmp86_;
	GeeArrayList* _tmp87_;
	gint _tmp88_;
	gint _tmp89_;
	WidgetsScrolledWindow* scrolled_window = NULL;
	GtkBox* _tmp92_;
	WidgetsScrolledWindow* _tmp93_;
	AdwToolbarView* toolbar_view = NULL;
	AdwToolbarView* _tmp94_;
	AdwToolbarView* _tmp95_;
	AdwHeaderBar* _tmp96_;
	AdwHeaderBar* _tmp97_;
	AdwToolbarView* _tmp98_;
	WidgetsScrolledWindow* _tmp99_;
	AdwToolbarView* _tmp100_;
	GeeHashMap* _tmp101_;
	ServicesEventBus* _tmp102_;
	ServicesEventBus* _tmp103_;
	gulong _tmp104_;
	ServicesEventBus* _tmp105_;
	ServicesEventBus* _tmp106_;
	GeeHashMap* _tmp107_;
	GtkListBox* _tmp108_;
	gulong _tmp109_;
	GtkListBox* _tmp110_;
	parent_class = G_OBJECT_CLASS (widgets_item_detail_completed_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_ITEM_DETAIL_COMPLETED, WidgetsItemDetailCompleted);
	_tmp0_ = g_strdup (_ ("To-do name"));
	_tmp1_ = widgets_text_view_new ();
	gtk_text_view_set_left_margin ((GtkTextView*) _tmp1_, 12);
	gtk_text_view_set_right_margin ((GtkTextView*) _tmp1_, 12);
	gtk_text_view_set_top_margin ((GtkTextView*) _tmp1_, 12);
	gtk_text_view_set_bottom_margin ((GtkTextView*) _tmp1_, 12);
	g_object_set ((GtkWidget*) _tmp1_, "height-request", 64, NULL);
	gtk_text_view_set_wrap_mode ((GtkTextView*) _tmp1_, GTK_WRAP_WORD);
	widgets_text_view_set_event_focus (_tmp1_, FALSE);
	widgets_text_view_set_placeholder_text (_tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	g_object_ref_sink (_tmp1_);
	content_textview = _tmp1_;
	_tmp2_ = content_textview;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp2_, "view");
	_tmp3_ = content_textview;
	gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "card");
	_tmp4_ = content_textview;
	_tmp5_ = self->priv->_item;
	_tmp6_ = objects_item_get_content (_tmp5_);
	_tmp7_ = _tmp6_;
	widgets_text_view_set_text (_tmp4_, _tmp7_);
	_tmp8_ = content_textview;
	gtk_text_view_set_editable ((GtkTextView*) _tmp8_, FALSE);
	_tmp9_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	gtk_widget_set_margin_start ((GtkWidget*) _tmp9_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp9_, 12);
	g_object_ref_sink (_tmp9_);
	content_group = _tmp9_;
	_tmp10_ = content_group;
	adw_preferences_group_set_title (_tmp10_, _ ("Title"));
	_tmp11_ = content_group;
	_tmp12_ = content_textview;
	adw_preferences_group_add (_tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_homogeneous (_tmp13_, TRUE);
	gtk_grid_set_column_spacing (_tmp13_, 12);
	gtk_grid_set_row_homogeneous (_tmp13_, TRUE);
	gtk_grid_set_row_spacing (_tmp13_, 12);
	g_object_ref_sink (_tmp13_);
	properties_grid = _tmp13_;
	_tmp14_ = properties_grid;
	_tmp15_ = self->priv->_item;
	_tmp16_ = objects_item_get_completed_at (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = utils_datetime_get_date_from_string (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = utils_datetime_get_relative_date_from_date (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = widgets_item_detail_completed_add_property_card (self, "month-symbolic", _ ("Completed At"), _tmp21_);
	_tmp23_ = _tmp22_;
	gtk_grid_attach (_tmp14_, _tmp23_, 0, 0, 1, 1);
	_g_object_unref0 (_tmp23_);
	_g_free0 (_tmp21_);
	_g_date_time_unref0 (_tmp19_);
	_tmp25_ = self->priv->_item;
	_tmp26_ = objects_item_get_has_section (_tmp25_);
	_tmp27_ = _tmp26_;
	if (_tmp27_) {
		ObjectsItem* _tmp28_;
		ObjectsSection* _tmp29_;
		ObjectsSection* _tmp30_;
		const gchar* _tmp31_;
		const gchar* _tmp32_;
		_tmp28_ = self->priv->_item;
		_tmp29_ = objects_item_get_section (_tmp28_);
		_tmp30_ = _tmp29_;
		_tmp31_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp30_);
		_tmp32_ = _tmp31_;
		_tmp24_ = _tmp32_;
	} else {
		_tmp24_ = _ ("No Section");
	}
	_tmp33_ = properties_grid;
	_tmp34_ = widgets_item_detail_completed_add_property_card (self, "arrow3-right-symbolic", _ ("Section"), _tmp24_);
	_tmp35_ = _tmp34_;
	gtk_grid_attach (_tmp33_, _tmp35_, 1, 0, 1, 1);
	_g_object_unref0 (_tmp35_);
	_tmp36_ = properties_grid;
	_tmp37_ = self->priv->_item;
	_tmp38_ = objects_item_get_priority_text (_tmp37_);
	_tmp39_ = _tmp38_;
	_tmp40_ = widgets_item_detail_completed_add_property_card (self, "flag-outline-thick-symbolic", _ ("Priority"), _tmp39_);
	_tmp41_ = _tmp40_;
	gtk_grid_attach (_tmp36_, _tmp41_, 0, 1, 1, 1);
	_g_object_unref0 (_tmp41_);
	_tmp42_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	gtk_widget_set_margin_start ((GtkWidget*) _tmp42_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp42_, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp42_, 12);
	g_object_ref_sink (_tmp42_);
	properties_group = _tmp42_;
	_tmp43_ = properties_group;
	adw_preferences_group_set_title (_tmp43_, _ ("Properties"));
	_tmp44_ = properties_group;
	_tmp45_ = properties_grid;
	adw_preferences_group_add (_tmp44_, (GtkWidget*) _tmp45_);
	_tmp46_ = self->priv->_item;
	_tmp47_ = objects_item_get_project (_tmp46_);
	_tmp48_ = _tmp47_;
	_tmp49_ = _g_object_ref0 (_tmp48_);
	_tmp50_ = widgets_markdown_editor_new ();
	widgets_markdown_editor_set_project (_tmp50_, _tmp49_);
	_g_object_unref0 (_tmp49_);
	g_object_ref_sink (_tmp50_);
	_g_object_unref0 (self->priv->markdown_editor);
	self->priv->markdown_editor = _tmp50_;
	_tmp51_ = self->priv->markdown_editor;
	_tmp52_ = _tmp51_->text_view;
	g_object_set ((GtkWidget*) _tmp52_, "height-request", 64, NULL);
	_tmp53_ = self->priv->markdown_editor;
	widgets_markdown_editor_set_is_editable (_tmp53_, FALSE);
	_tmp54_ = self->priv->markdown_editor;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp54_, 12);
	_tmp55_ = self->priv->markdown_editor;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp55_, 12);
	_tmp56_ = self->priv->markdown_editor;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp56_, 12);
	_tmp57_ = self->priv->markdown_editor;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp57_, 12);
	_tmp58_ = self->priv->markdown_editor;
	_tmp59_ = self->priv->_item;
	_tmp60_ = objects_item_get_description (_tmp59_);
	_tmp61_ = _tmp60_;
	widgets_markdown_editor_set_text (_tmp58_, _tmp61_);
	_tmp62_ = self->priv->markdown_editor;
	_tmp63_ = _g_object_ref0 ((GtkWidget*) _tmp62_);
	_tmp64_ = (AdwBin*) adw_bin_new ();
	adw_bin_set_child (_tmp64_, _tmp63_);
	_g_object_unref0 (_tmp63_);
	gtk_widget_set_valign ((GtkWidget*) _tmp64_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp64_);
	markdown_editor_card = _tmp64_;
	_tmp65_ = markdown_editor_card;
	gtk_widget_add_css_class ((GtkWidget*) _tmp65_, "card");
	_tmp66_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	gtk_widget_set_margin_start ((GtkWidget*) _tmp66_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp66_, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp66_, 12);
	g_object_ref_sink (_tmp66_);
	description_group = _tmp66_;
	_tmp67_ = description_group;
	adw_preferences_group_set_title (_tmp67_, _ ("Description"));
	_tmp68_ = description_group;
	_tmp69_ = markdown_editor_card;
	adw_preferences_group_add (_tmp68_, (GtkWidget*) _tmp69_);
	_tmp70_ = g_strdup ("listbox-background");
	_tmp71_ = g_strdup ("listbox-separator-6");
	_tmp72_ = g_new0 (gchar*, 2 + 1);
	_tmp72_[0] = _tmp70_;
	_tmp72_[1] = _tmp71_;
	_tmp73_ = (GtkListBox*) gtk_list_box_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp73_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp73_, GTK_ALIGN_START);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp73_, _tmp72_);
	_tmp72_ = (_vala_array_free (_tmp72_, 2, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp73_);
	_g_object_unref0 (self->priv->listbox);
	self->priv->listbox = _tmp73_;
	_tmp74_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	gtk_widget_set_margin_start ((GtkWidget*) _tmp74_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp74_, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp74_, 12);
	g_object_ref_sink (_tmp74_);
	subitems_group = _tmp74_;
	_tmp75_ = subitems_group;
	adw_preferences_group_set_title (_tmp75_, _ ("Sub-tasks"));
	_tmp76_ = subitems_group;
	_tmp77_ = self->priv->listbox;
	adw_preferences_group_add (_tmp76_, (GtkWidget*) _tmp77_);
	_tmp78_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_valign ((GtkWidget*) _tmp78_, GTK_ALIGN_START);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp78_, 24);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp78_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp78_, 12);
	g_object_ref_sink (_tmp78_);
	content = _tmp78_;
	_tmp79_ = content;
	_tmp80_ = content_group;
	gtk_box_append (_tmp79_, (GtkWidget*) _tmp80_);
	_tmp81_ = content;
	_tmp82_ = properties_group;
	gtk_box_append (_tmp81_, (GtkWidget*) _tmp82_);
	_tmp83_ = content;
	_tmp84_ = description_group;
	gtk_box_append (_tmp83_, (GtkWidget*) _tmp84_);
	_tmp85_ = self->priv->_item;
	_tmp86_ = objects_item_get_items (_tmp85_);
	_tmp87_ = _tmp86_;
	_tmp88_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp87_);
	_tmp89_ = _tmp88_;
	if (_tmp89_ > 0) {
		GtkBox* _tmp90_;
		AdwPreferencesGroup* _tmp91_;
		_tmp90_ = content;
		_tmp91_ = subitems_group;
		gtk_box_append (_tmp90_, (GtkWidget*) _tmp91_);
	}
	_tmp92_ = content;
	_tmp93_ = widgets_scrolled_window_new ((GtkWidget*) _tmp92_, GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp93_);
	scrolled_window = _tmp93_;
	_tmp94_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp94_);
	toolbar_view = _tmp94_;
	_tmp95_ = toolbar_view;
	_tmp96_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp96_);
	_tmp97_ = _tmp96_;
	adw_toolbar_view_add_top_bar (_tmp95_, (GtkWidget*) _tmp97_);
	_g_object_unref0 (_tmp97_);
	_tmp98_ = toolbar_view;
	_tmp99_ = scrolled_window;
	adw_toolbar_view_set_content (_tmp98_, (GtkWidget*) _tmp99_);
	_tmp100_ = toolbar_view;
	adw_navigation_page_set_child ((AdwNavigationPage*) self, (GtkWidget*) _tmp100_);
	widgets_item_detail_completed_add_items (self);
	_tmp101_ = self->priv->signal_map;
	_tmp102_ = services_event_bus_get_default ();
	_tmp103_ = _tmp102_;
	_tmp104_ = g_signal_connect_object (_tmp103_, "checked-toggled", (GCallback) __widgets_item_detail_completed___lambda612__services_event_bus_checked_toggled, self, 0);
	_tmp105_ = services_event_bus_get_default ();
	_tmp106_ = _tmp105_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp101_, (gpointer) ((guintptr) _tmp104_), (GObject*) _tmp106_);
	_g_object_unref0 (_tmp106_);
	_g_object_unref0 (_tmp103_);
	_tmp107_ = self->priv->signal_map;
	_tmp108_ = self->priv->listbox;
	_tmp109_ = g_signal_connect_object (_tmp108_, "row-activated", (GCallback) __widgets_item_detail_completed___lambda613__gtk_list_box_row_activated, self, 0);
	_tmp110_ = self->priv->listbox;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp107_, (gpointer) ((guintptr) _tmp109_), (GObject*) _tmp110_);
	g_signal_connect_object ((GtkWidget*) self, "destroy", (GCallback) __widgets_item_detail_completed___lambda614__gtk_widget_destroy, self, 0);
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (scrolled_window);
	_g_object_unref0 (content);
	_g_object_unref0 (subitems_group);
	_g_object_unref0 (description_group);
	_g_object_unref0 (markdown_editor_card);
	_g_object_unref0 (properties_group);
	_g_object_unref0 (properties_grid);
	_g_object_unref0 (content_group);
	_g_object_unref0 (content_textview);
	return obj;
}

static void
widgets_item_detail_completed_class_init (WidgetsItemDetailCompletedClass * klass,
                                          gpointer klass_data)
{
	widgets_item_detail_completed_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsItemDetailCompleted_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_item_detail_completed_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_item_detail_completed_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_item_detail_completed_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_item_detail_completed_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_ITEM_DETAIL_COMPLETED_ITEM_PROPERTY, widgets_item_detail_completed_properties[WIDGETS_ITEM_DETAIL_COMPLETED_ITEM_PROPERTY] = g_param_spec_object ("item", "item", "item", OBJECTS_TYPE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	widgets_item_detail_completed_signals[WIDGETS_ITEM_DETAIL_COMPLETED_VIEW_ITEM_SIGNAL] = g_signal_new ("view-item", WIDGETS_TYPE_ITEM_DETAIL_COMPLETED, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, OBJECTS_TYPE_ITEM);
}

static void
widgets_item_detail_completed_instance_init (WidgetsItemDetailCompleted * self,
                                             gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = widgets_item_detail_completed_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, WIDGETS_TYPE_COMPLETED_TASK_ROW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->items_checked = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->signal_map = _tmp1_;
}

static void
widgets_item_detail_completed_finalize (GObject * obj)
{
	WidgetsItemDetailCompleted * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_ITEM_DETAIL_COMPLETED, WidgetsItemDetailCompleted);
	g_debug ("ItemDetailCompleted.vala:40: Destroying - Widgets.ItemDetailCompleted\n");
	_g_object_unref0 (self->priv->_item);
	_g_object_unref0 (self->priv->listbox);
	_g_object_unref0 (self->priv->markdown_editor);
	_g_object_unref0 (self->priv->items_checked);
	_g_object_unref0 (self->priv->signal_map);
	G_OBJECT_CLASS (widgets_item_detail_completed_parent_class)->finalize (obj);
}

static GType
widgets_item_detail_completed_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsItemDetailCompletedClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_item_detail_completed_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsItemDetailCompleted), 0, (GInstanceInitFunc) widgets_item_detail_completed_instance_init, NULL };
	GType widgets_item_detail_completed_type_id;
	widgets_item_detail_completed_type_id = g_type_register_static (adw_navigation_page_get_type (), "WidgetsItemDetailCompleted", &g_define_type_info, 0);
	WidgetsItemDetailCompleted_private_offset = g_type_add_instance_private (widgets_item_detail_completed_type_id, sizeof (WidgetsItemDetailCompletedPrivate));
	return widgets_item_detail_completed_type_id;
}

GType
widgets_item_detail_completed_get_type (void)
{
	static volatile gsize widgets_item_detail_completed_type_id__once = 0;
	if (g_once_init_enter (&widgets_item_detail_completed_type_id__once)) {
		GType widgets_item_detail_completed_type_id;
		widgets_item_detail_completed_type_id = widgets_item_detail_completed_get_type_once ();
		g_once_init_leave (&widgets_item_detail_completed_type_id__once, widgets_item_detail_completed_type_id);
	}
	return widgets_item_detail_completed_type_id__once;
}

static void
_vala_widgets_item_detail_completed_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	WidgetsItemDetailCompleted * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_ITEM_DETAIL_COMPLETED, WidgetsItemDetailCompleted);
	switch (property_id) {
		case WIDGETS_ITEM_DETAIL_COMPLETED_ITEM_PROPERTY:
		g_value_set_object (value, widgets_item_detail_completed_get_item (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_item_detail_completed_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	WidgetsItemDetailCompleted * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_ITEM_DETAIL_COMPLETED, WidgetsItemDetailCompleted);
	switch (property_id) {
		case WIDGETS_ITEM_DETAIL_COMPLETED_ITEM_PROPERTY:
		widgets_item_detail_completed_set_item (self, g_value_get_object (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);
}

