/* HeaderItem.c generated by valac 0.56.19, the Vala compiler
 * generated from HeaderItem.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 "planify.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <adwaita.h>
#include <pango/pango.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

enum  {
	LAYOUTS_HEADER_ITEM_0_PROPERTY,
	LAYOUTS_HEADER_ITEM_HEADER_TITLE_PROPERTY,
	LAYOUTS_HEADER_ITEM_SUBHEADER_TITLE_PROPERTY,
	LAYOUTS_HEADER_ITEM_PLACEHOLDER_MESSAGE_PROPERTY,
	LAYOUTS_HEADER_ITEM_REVEAL_PROPERTY,
	LAYOUTS_HEADER_ITEM_ITEMS_PROPERTY,
	LAYOUTS_HEADER_ITEM_SHOW_SEPARATOR_PROPERTY,
	LAYOUTS_HEADER_ITEM_REVEAL_CHILD_PROPERTY,
	LAYOUTS_HEADER_ITEM_SEPARATOR_SPACE_PROPERTY,
	LAYOUTS_HEADER_ITEM_SEPARATOR_LINES_PROPERTY,
	LAYOUTS_HEADER_ITEM_LISTBOX_NO_MARGIN_PROPERTY,
	LAYOUTS_HEADER_ITEM_CARD_PROPERTY,
	LAYOUTS_HEADER_ITEM_LISTBOX_MARGIN_TOP_PROPERTY,
	LAYOUTS_HEADER_ITEM_NUM_PROPERTIES
};
static GParamSpec* layouts_header_item_properties[LAYOUTS_HEADER_ITEM_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	LAYOUTS_HEADER_ITEM_ADD_ACTIVATED_SIGNAL,
	LAYOUTS_HEADER_ITEM_ROW_ACTIVATED_SIGNAL,
	LAYOUTS_HEADER_ITEM_NUM_SIGNALS
};
static guint layouts_header_item_signals[LAYOUTS_HEADER_ITEM_NUM_SIGNALS] = {0};

struct _LayoutsHeaderItemPrivate {
	GtkLabel* header_label;
	GtkLabel* subheader_label;
	GtkRevealer* subheader_revealer;
	GtkLabel* placeholder_label;
	GtkBox* action_box;
	GtkRevealer* content_revealer;
	GtkRevealer* separator_revealer;
};

static gint LayoutsHeaderItem_private_offset;
static gpointer layouts_header_item_parent_class = NULL;

static GtkWidget* layouts_header_item_get_placeholder (LayoutsHeaderItem* self);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static gboolean layouts_header_item_get_has_children (LayoutsHeaderItem* self);
static GObject * layouts_header_item_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties);
static void _layouts_header_item___lambda234_ (LayoutsHeaderItem* self,
                                        GtkListBoxRow* row);
static void __layouts_header_item___lambda234__gtk_list_box_row_activated (GtkListBox* _sender,
                                                                    GtkListBoxRow* row,
                                                                    gpointer self);
static void _layouts_header_item___lambda235_ (LayoutsHeaderItem* self);
static void __layouts_header_item___lambda235__gtk_widget_destroy (GtkWidget* _sender,
                                                            gpointer self);
static void layouts_header_item_finalize (GObject * obj);
static GType layouts_header_item_get_type_once (void);
static void _vala_layouts_header_item_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_layouts_header_item_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 _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
layouts_header_item_get_instance_private (LayoutsHeaderItem* self)
{
	return G_STRUCT_MEMBER_P (self, LayoutsHeaderItem_private_offset);
}

LayoutsHeaderItem*
layouts_header_item_construct (GType object_type,
                               const gchar* header_title)
{
	LayoutsHeaderItem * self = NULL;
	self = (LayoutsHeaderItem*) g_object_new (object_type, "header-title", header_title, NULL);
	return self;
}

LayoutsHeaderItem*
layouts_header_item_new (const gchar* header_title)
{
	return layouts_header_item_construct (LAYOUTS_TYPE_HEADER_ITEM, header_title);
}

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

static GtkWidget*
layouts_header_item_get_placeholder (LayoutsHeaderItem* self)
{
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	AdwBin* content_box = NULL;
	GtkLabel* _tmp3_;
	GtkWidget* _tmp4_;
	AdwBin* _tmp5_ = NULL;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_label_set_wrap (_tmp0_, TRUE);
	gtk_label_set_justify (_tmp0_, GTK_JUSTIFY_CENTER);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->placeholder_label);
	self->priv->placeholder_label = _tmp0_;
	_tmp1_ = self->priv->placeholder_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "dimmed");
	_tmp2_ = self->priv->placeholder_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "caption");
	_tmp3_ = self->priv->placeholder_label;
	_tmp4_ = _g_object_ref0 ((GtkWidget*) _tmp3_);
	_tmp5_ = (AdwBin*) adw_bin_new ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp5_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp5_, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp5_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp5_, 12);
	adw_bin_set_child (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	content_box = _tmp5_;
	result = (GtkWidget*) content_box;
	return result;
}

void
layouts_header_item_add_child (LayoutsHeaderItem* self,
                               GtkWidget* widget)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = self->listbox;
	gtk_list_box_append (_tmp0_, widget);
}

void
layouts_header_item_insert_child (LayoutsHeaderItem* self,
                                  GtkWidget* widget,
                                  gint position)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = self->listbox;
	gtk_list_box_insert (_tmp0_, widget, position);
}

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
layouts_header_item_clear (LayoutsHeaderItem* self)
{
	Util* _tmp0_;
	Util* _tmp1_;
	GtkListBox* _tmp2_;
	GList* _tmp3_;
	GList* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->listbox;
	_tmp3_ = util_get_children (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp4_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) ((GtkListBoxRow*) child_it->data);
			{
				GtkListBox* _tmp5_;
				GtkWidget* _tmp6_;
				_tmp5_ = self->listbox;
				_tmp6_ = child;
				gtk_list_box_remove (_tmp5_, _tmp6_);
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (_g_list_free__g_object_unref0_ (child_collection), NULL));
	}
}

GList*
layouts_header_item_get_children (LayoutsHeaderItem* self)
{
	Util* _tmp0_;
	Util* _tmp1_;
	GtkListBox* _tmp2_;
	GList* _tmp3_;
	GList* _tmp4_;
	GList* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->listbox;
	_tmp3_ = util_get_children (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	result = _tmp4_;
	return result;
}

void
layouts_header_item_add_widget_end (LayoutsHeaderItem* self,
                                    GtkWidget* widget)
{
	GtkBox* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = self->priv->action_box;
	gtk_box_append (_tmp0_, widget);
}

void
layouts_header_item_remove_child (LayoutsHeaderItem* self,
                                  GtkWidget* widget)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (widget != NULL);
	_tmp0_ = self->listbox;
	gtk_list_box_remove (_tmp0_, widget);
}

void
layouts_header_item_check_visibility (LayoutsHeaderItem* self,
                                      gint size)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->content_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, size > 0);
}

void
layouts_header_item_set_sort_func (LayoutsHeaderItem* self,
                                   GtkListBoxSortFunc sort_func,
                                   gpointer sort_func_target,
                                   GDestroyNotify sort_func_target_destroy_notify)
{
	GtkListBox* _tmp0_;
	GtkListBoxSortFunc _tmp1_;
	gpointer _tmp1__target;
	GDestroyNotify _tmp1__target_destroy_notify;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->listbox;
	_tmp1_ = sort_func;
	_tmp1__target = sort_func_target;
	_tmp1__target_destroy_notify = sort_func_target_destroy_notify;
	sort_func = NULL;
	sort_func_target = NULL;
	sort_func_target_destroy_notify = NULL;
	gtk_list_box_set_sort_func (_tmp0_, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify);
	(sort_func_target_destroy_notify == NULL) ? NULL : (sort_func_target_destroy_notify (sort_func_target), NULL);
	sort_func = NULL;
	sort_func_target = NULL;
	sort_func_target_destroy_notify = NULL;
}

void
layouts_header_item_set_filter_func (LayoutsHeaderItem* self,
                                     GtkListBoxFilterFunc filter_func,
                                     gpointer filter_func_target,
                                     GDestroyNotify filter_func_target_destroy_notify)
{
	GtkListBox* _tmp0_;
	GtkListBoxFilterFunc _tmp1_;
	gpointer _tmp1__target;
	GDestroyNotify _tmp1__target_destroy_notify;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->listbox;
	_tmp1_ = filter_func;
	_tmp1__target = filter_func_target;
	_tmp1__target_destroy_notify = filter_func_target_destroy_notify;
	filter_func = NULL;
	filter_func_target = NULL;
	filter_func_target_destroy_notify = NULL;
	gtk_list_box_set_filter_func (_tmp0_, _tmp1_, _tmp1__target, _tmp1__target_destroy_notify);
	(filter_func_target_destroy_notify == NULL) ? NULL : (filter_func_target_destroy_notify (filter_func_target), NULL);
	filter_func = NULL;
	filter_func_target = NULL;
	filter_func_target_destroy_notify = NULL;
}

void
layouts_header_item_invalidate_filter (LayoutsHeaderItem* self)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->listbox;
	gtk_list_box_invalidate_filter (_tmp0_);
}

void
layouts_header_item_clean_up (LayoutsHeaderItem* self)
{
	GtkListBox* _tmp0_;
	GtkListBox* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->listbox;
	gtk_list_box_set_filter_func (_tmp0_, NULL, NULL, NULL);
	_tmp1_ = self->listbox;
	gtk_list_box_set_sort_func (_tmp1_, NULL, NULL, NULL);
	layouts_header_item_clear (self);
}

const gchar*
layouts_header_item_get_header_title (LayoutsHeaderItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_header_title;
	result = _tmp0_;
	return result;
}

void
layouts_header_item_set_header_title (LayoutsHeaderItem* self,
                                      const gchar* value)
{
	gchar* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	GtkLabel* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->_header_title);
	self->_header_title = _tmp0_;
	_tmp1_ = self->priv->header_label;
	_tmp2_ = self->_header_title;
	gtk_label_set_label (_tmp1_, _tmp2_);
	_tmp3_ = self->priv->header_label;
	gtk_widget_set_visible ((GtkWidget*) _tmp3_, value != NULL);
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_HEADER_TITLE_PROPERTY]);
}

const gchar*
layouts_header_item_get_subheader_title (LayoutsHeaderItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_subheader_title;
	result = _tmp0_;
	return result;
}

void
layouts_header_item_set_subheader_title (LayoutsHeaderItem* self,
                                         const gchar* value)
{
	gchar* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	GtkRevealer* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->_subheader_title);
	self->_subheader_title = _tmp0_;
	_tmp1_ = self->priv->subheader_label;
	_tmp2_ = self->_subheader_title;
	gtk_label_set_label (_tmp1_, _tmp2_);
	_tmp3_ = self->priv->subheader_revealer;
	gtk_revealer_set_reveal_child (_tmp3_, g_strcmp0 (value, "") != 0);
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_SUBHEADER_TITLE_PROPERTY]);
}

const gchar*
layouts_header_item_get_placeholder_message (LayoutsHeaderItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_placeholder_message;
	result = _tmp0_;
	return result;
}

void
layouts_header_item_set_placeholder_message (LayoutsHeaderItem* self,
                                             const gchar* value)
{
	gchar* _tmp0_;
	GtkLabel* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->_placeholder_message);
	self->_placeholder_message = _tmp0_;
	_tmp1_ = self->priv->placeholder_label;
	_tmp2_ = self->_placeholder_message;
	gtk_label_set_label (_tmp1_, _tmp2_);
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_PLACEHOLDER_MESSAGE_PROPERTY]);
}

gboolean
layouts_header_item_get_reveal (LayoutsHeaderItem* self)
{
	gboolean result;
	GtkRevealer* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->content_revealer;
	_tmp1_ = gtk_revealer_get_reveal_child (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
layouts_header_item_set_reveal (LayoutsHeaderItem* self,
                                gboolean value)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->content_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_REVEAL_PROPERTY]);
}

GtkListBox*
layouts_header_item_get_items (LayoutsHeaderItem* self)
{
	GtkListBox* result;
	GtkListBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->listbox;
	result = _tmp0_;
	return result;
}

static gboolean
layouts_header_item_get_has_children (LayoutsHeaderItem* self)
{
	gboolean result;
	Util* _tmp0_;
	Util* _tmp1_;
	GtkListBox* _tmp2_;
	GList* _tmp3_;
	GList* _tmp4_;
	gboolean _tmp5_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->listbox;
	_tmp3_ = util_get_children (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_list_length (_tmp4_) > ((guint) 0);
	(_tmp4_ == NULL) ? NULL : (_tmp4_ = (_g_list_free__g_object_unref0_ (_tmp4_), NULL));
	_g_object_unref0 (_tmp1_);
	result = _tmp5_;
	return result;
}

void
layouts_header_item_set_show_separator (LayoutsHeaderItem* self,
                                        gboolean value)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->separator_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_SHOW_SEPARATOR_PROPERTY]);
}

void
layouts_header_item_set_reveal_child (LayoutsHeaderItem* self,
                                      gboolean value)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->content_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_REVEAL_CHILD_PROPERTY]);
}

void
layouts_header_item_set_separator_space (LayoutsHeaderItem* self,
                                         gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		GtkListBox* _tmp0_;
		_tmp0_ = self->listbox;
		gtk_widget_add_css_class ((GtkWidget*) _tmp0_, "listbox-separator-3");
	}
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_SEPARATOR_SPACE_PROPERTY]);
}

void
layouts_header_item_set_separator_lines (LayoutsHeaderItem* self,
                                         gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		GtkListBox* _tmp0_;
		_tmp0_ = self->listbox;
		gtk_widget_add_css_class ((GtkWidget*) _tmp0_, "separator-lines");
	}
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_SEPARATOR_LINES_PROPERTY]);
}

void
layouts_header_item_set_listbox_no_margin (LayoutsHeaderItem* self,
                                           gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		GtkListBox* _tmp0_;
		GtkListBox* _tmp1_;
		GtkListBox* _tmp2_;
		GtkListBox* _tmp3_;
		_tmp0_ = self->listbox;
		gtk_widget_set_margin_top ((GtkWidget*) _tmp0_, 0);
		_tmp1_ = self->listbox;
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp1_, 0);
		_tmp2_ = self->listbox;
		gtk_widget_set_margin_start ((GtkWidget*) _tmp2_, 0);
		_tmp3_ = self->listbox;
		gtk_widget_set_margin_end ((GtkWidget*) _tmp3_, 0);
	}
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_LISTBOX_NO_MARGIN_PROPERTY]);
}

void
layouts_header_item_set_card (LayoutsHeaderItem* self,
                              gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		GtkListBox* _tmp0_;
		gchar* _tmp1_;
		gchar** _tmp2_;
		gchar** _tmp3_;
		gint _tmp3__length1;
		GtkListBox* _tmp4_;
		GtkListBox* _tmp5_;
		GtkListBox* _tmp6_;
		GtkListBox* _tmp7_;
		_tmp0_ = self->listbox;
		_tmp1_ = g_strdup ("boxed-list");
		_tmp2_ = g_new0 (gchar*, 1 + 1);
		_tmp2_[0] = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp3__length1 = 1;
		gtk_widget_set_css_classes ((GtkWidget*) _tmp0_, _tmp3_);
		_tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_free), NULL);
		_tmp4_ = self->listbox;
		gtk_widget_set_margin_top ((GtkWidget*) _tmp4_, 12);
		_tmp5_ = self->listbox;
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp5_, 3);
		_tmp6_ = self->listbox;
		gtk_widget_set_margin_start ((GtkWidget*) _tmp6_, 3);
		_tmp7_ = self->listbox;
		gtk_widget_set_margin_end ((GtkWidget*) _tmp7_, 3);
	} else {
		GtkListBox* _tmp8_;
		gchar** _tmp9_;
		gchar** _tmp10_;
		gint _tmp10__length1;
		GtkListBox* _tmp11_;
		GtkListBox* _tmp12_;
		GtkListBox* _tmp13_;
		GtkListBox* _tmp14_;
		_tmp8_ = self->listbox;
		_tmp9_ = g_new0 (gchar*, 0 + 1);
		_tmp10_ = _tmp9_;
		_tmp10__length1 = 0;
		gtk_widget_set_css_classes ((GtkWidget*) _tmp8_, _tmp10_);
		_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_free), NULL);
		_tmp11_ = self->listbox;
		gtk_widget_set_margin_top ((GtkWidget*) _tmp11_, 0);
		_tmp12_ = self->listbox;
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp12_, 0);
		_tmp13_ = self->listbox;
		gtk_widget_set_margin_start ((GtkWidget*) _tmp13_, 0);
		_tmp14_ = self->listbox;
		gtk_widget_set_margin_end ((GtkWidget*) _tmp14_, 0);
	}
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_CARD_PROPERTY]);
}

void
layouts_header_item_set_listbox_margin_top (LayoutsHeaderItem* self,
                                            gint value)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->listbox;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_LISTBOX_MARGIN_TOP_PROPERTY]);
}

static void
_layouts_header_item___lambda234_ (LayoutsHeaderItem* self,
                                   GtkListBoxRow* row)
{
	g_return_if_fail (row != NULL);
	g_signal_emit (self, layouts_header_item_signals[LAYOUTS_HEADER_ITEM_ROW_ACTIVATED_SIGNAL], 0, (GtkWidget*) row);
}

static void
__layouts_header_item___lambda234__gtk_list_box_row_activated (GtkListBox* _sender,
                                                               GtkListBoxRow* row,
                                                               gpointer self)
{
	_layouts_header_item___lambda234_ ((LayoutsHeaderItem*) self, row);
}

static void
_layouts_header_item___lambda235_ (LayoutsHeaderItem* self)
{
	layouts_header_item_clean_up (self);
}

static void
__layouts_header_item___lambda235__gtk_widget_destroy (GtkWidget* _sender,
                                                       gpointer self)
{
	_layouts_header_item___lambda235_ ((LayoutsHeaderItem*) self);
}

static GObject *
layouts_header_item_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	LayoutsHeaderItem * self;
	GtkLabel* _tmp0_ = NULL;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	GtkLabel* _tmp6_ = NULL;
	GtkLabel* _tmp7_;
	GtkWidget* _tmp8_;
	GtkRevealer* _tmp9_ = NULL;
	GtkBox* header_label_box = NULL;
	GtkBox* _tmp10_ = NULL;
	GtkBox* _tmp11_;
	GtkLabel* _tmp12_;
	GtkBox* _tmp13_;
	GtkRevealer* _tmp14_;
	GtkListBox* _tmp15_ = NULL;
	GtkListBox* _tmp16_;
	GtkWidget* _tmp17_;
	GtkWidget* _tmp18_;
	GtkListBox* _tmp19_;
	GtkBox* _tmp20_ = NULL;
	GtkBox* header_box = NULL;
	GtkBox* _tmp21_ = NULL;
	GtkBox* _tmp22_;
	GtkBox* _tmp23_;
	GtkBox* _tmp24_;
	GtkBox* _tmp25_;
	GtkSeparator* separator = NULL;
	GtkSeparator* _tmp26_ = NULL;
	GtkSeparator* _tmp27_;
	GtkWidget* _tmp28_;
	GtkRevealer* _tmp29_ = NULL;
	gchar* _tmp30_;
	gchar** _tmp31_;
	GtkGrid* _tmp32_ = NULL;
	GtkGrid* _tmp33_;
	GtkWidget* _tmp34_;
	GtkRevealer* _tmp35_ = NULL;
	GtkBox* content_box = NULL;
	GtkBox* _tmp36_ = NULL;
	GtkBox* _tmp37_;
	GtkBox* _tmp38_;
	GtkBox* _tmp39_;
	GtkRevealer* _tmp40_;
	GtkBox* _tmp41_;
	GtkListBox* _tmp42_;
	GtkBox* _tmp43_;
	GtkRevealer* _tmp44_;
	GtkBox* _tmp45_;
	GtkWidget* _tmp46_;
	GtkRevealer* _tmp47_ = NULL;
	GtkRevealer* _tmp48_;
	GtkListBox* _tmp49_;
	parent_class = G_OBJECT_CLASS (layouts_header_item_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LAYOUTS_TYPE_HEADER_ITEM, LayoutsHeaderItem);
	_tmp0_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_label_set_ellipsize (_tmp0_, PANGO_ELLIPSIZE_END);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->header_label);
	self->priv->header_label = _tmp0_;
	_tmp1_ = self->priv->header_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "h4");
	_tmp2_ = self->priv->header_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "heading");
	_tmp3_ = g_strdup ("caption");
	_tmp4_ = g_strdup ("dimmed");
	_tmp5_ = g_new0 (gchar*, 2 + 1);
	_tmp5_[0] = _tmp3_;
	_tmp5_[1] = _tmp4_;
	_tmp6_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	gtk_label_set_ellipsize (_tmp6_, PANGO_ELLIPSIZE_END);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 2, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->subheader_label);
	self->priv->subheader_label = _tmp6_;
	_tmp7_ = self->priv->subheader_label;
	_tmp8_ = _g_object_ref0 ((GtkWidget*) _tmp7_);
	_tmp9_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp9_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_child (_tmp9_, _tmp8_);
	_g_object_unref0 (_tmp8_);
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->subheader_revealer);
	self->priv->subheader_revealer = _tmp9_;
	_tmp10_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_valign ((GtkWidget*) _tmp10_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp10_);
	header_label_box = _tmp10_;
	_tmp11_ = header_label_box;
	_tmp12_ = self->priv->header_label;
	gtk_box_append (_tmp11_, (GtkWidget*) _tmp12_);
	_tmp13_ = header_label_box;
	_tmp14_ = self->priv->subheader_revealer;
	gtk_box_append (_tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = (GtkListBox*) gtk_list_box_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp15_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp15_, 6);
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (self->listbox);
	self->listbox = _tmp15_;
	_tmp16_ = self->listbox;
	_tmp17_ = layouts_header_item_get_placeholder (self);
	_tmp18_ = _tmp17_;
	gtk_list_box_set_placeholder (_tmp16_, _tmp18_);
	_g_object_unref0 (_tmp18_);
	_tmp19_ = self->listbox;
	gtk_widget_add_css_class ((GtkWidget*) _tmp19_, "bg-transparent");
	_tmp20_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp20_, TRUE);
	gtk_widget_set_halign ((GtkWidget*) _tmp20_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp20_);
	_g_object_unref0 (self->priv->action_box);
	self->priv->action_box = _tmp20_;
	_tmp21_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp21_, TRUE);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp21_, 6);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp21_, 6);
	g_object_ref_sink (_tmp21_);
	header_box = _tmp21_;
	_tmp22_ = header_box;
	_tmp23_ = header_label_box;
	gtk_box_append (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = header_box;
	_tmp25_ = self->priv->action_box;
	gtk_box_append (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp26_, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp26_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp26_, 3);
	g_object_ref_sink (_tmp26_);
	separator = _tmp26_;
	_tmp27_ = separator;
	_tmp28_ = _g_object_ref0 ((GtkWidget*) _tmp27_);
	_tmp29_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp29_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_child (_tmp29_, _tmp28_);
	_g_object_unref0 (_tmp28_);
	g_object_ref_sink (_tmp29_);
	_g_object_unref0 (self->priv->separator_revealer);
	self->priv->separator_revealer = _tmp29_;
	_tmp30_ = g_strdup ("drop-target");
	_tmp31_ = g_new0 (gchar*, 1 + 1);
	_tmp31_[0] = _tmp30_;
	_tmp32_ = (GtkGrid*) gtk_grid_new ();
	g_object_set ((GtkWidget*) _tmp32_, "height-request", 27, NULL);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp32_, _tmp31_);
	_tmp31_ = (_vala_array_free (_tmp31_, 1, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp32_, 3);
	g_object_ref_sink (_tmp32_);
	_g_object_unref0 (self->drop_target_end);
	self->drop_target_end = _tmp32_;
	_tmp33_ = self->drop_target_end;
	_tmp34_ = _g_object_ref0 ((GtkWidget*) _tmp33_);
	_tmp35_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp35_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP);
	gtk_revealer_set_transition_duration (_tmp35_, (guint) 150);
	gtk_revealer_set_child (_tmp35_, _tmp34_);
	_g_object_unref0 (_tmp34_);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->drop_target_end_revealer);
	self->drop_target_end_revealer = _tmp35_;
	_tmp36_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp36_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp36_, 3);
	g_object_ref_sink (_tmp36_);
	content_box = _tmp36_;
	_tmp37_ = content_box;
	_tmp38_ = header_box;
	gtk_box_append (_tmp37_, (GtkWidget*) _tmp38_);
	_tmp39_ = content_box;
	_tmp40_ = self->priv->separator_revealer;
	gtk_box_append (_tmp39_, (GtkWidget*) _tmp40_);
	_tmp41_ = content_box;
	_tmp42_ = self->listbox;
	gtk_box_append (_tmp41_, (GtkWidget*) _tmp42_);
	_tmp43_ = content_box;
	_tmp44_ = self->drop_target_end_revealer;
	gtk_box_append (_tmp43_, (GtkWidget*) _tmp44_);
	_tmp45_ = content_box;
	_tmp46_ = _g_object_ref0 ((GtkWidget*) _tmp45_);
	_tmp47_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp47_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
	gtk_revealer_set_child (_tmp47_, _tmp46_);
	_g_object_unref0 (_tmp46_);
	g_object_ref_sink (_tmp47_);
	_g_object_unref0 (self->priv->content_revealer);
	self->priv->content_revealer = _tmp47_;
	_tmp48_ = self->priv->content_revealer;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp48_);
	_tmp49_ = self->listbox;
	g_signal_connect_object (_tmp49_, "row-activated", (GCallback) __layouts_header_item___lambda234__gtk_list_box_row_activated, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "destroy", (GCallback) __layouts_header_item___lambda235__gtk_widget_destroy, self, 0);
	_g_object_unref0 (content_box);
	_g_object_unref0 (separator);
	_g_object_unref0 (header_box);
	_g_object_unref0 (header_label_box);
	return obj;
}

static void
layouts_header_item_class_init (LayoutsHeaderItemClass * klass,
                                gpointer klass_data)
{
	layouts_header_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LayoutsHeaderItem_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_layouts_header_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_layouts_header_item_set_property;
	G_OBJECT_CLASS (klass)->constructor = layouts_header_item_constructor;
	G_OBJECT_CLASS (klass)->finalize = layouts_header_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_HEADER_TITLE_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_HEADER_TITLE_PROPERTY] = g_param_spec_string ("header-title", "header-title", "header-title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_SUBHEADER_TITLE_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_SUBHEADER_TITLE_PROPERTY] = g_param_spec_string ("subheader-title", "subheader-title", "subheader-title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_PLACEHOLDER_MESSAGE_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_PLACEHOLDER_MESSAGE_PROPERTY] = g_param_spec_string ("placeholder-message", "placeholder-message", "placeholder-message", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_REVEAL_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_REVEAL_PROPERTY] = g_param_spec_boolean ("reveal", "reveal", "reveal", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_ITEMS_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_ITEMS_PROPERTY] = g_param_spec_object ("items", "items", "items", gtk_list_box_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_SHOW_SEPARATOR_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_SHOW_SEPARATOR_PROPERTY] = g_param_spec_boolean ("show-separator", "show-separator", "show-separator", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_REVEAL_CHILD_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_REVEAL_CHILD_PROPERTY] = g_param_spec_boolean ("reveal-child", "reveal-child", "reveal-child", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_SEPARATOR_SPACE_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_SEPARATOR_SPACE_PROPERTY] = g_param_spec_boolean ("separator-space", "separator-space", "separator-space", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_SEPARATOR_LINES_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_SEPARATOR_LINES_PROPERTY] = g_param_spec_boolean ("separator-lines", "separator-lines", "separator-lines", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_LISTBOX_NO_MARGIN_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_LISTBOX_NO_MARGIN_PROPERTY] = g_param_spec_boolean ("listbox-no-margin", "listbox-no-margin", "listbox-no-margin", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_CARD_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_CARD_PROPERTY] = g_param_spec_boolean ("card", "card", "card", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_HEADER_ITEM_LISTBOX_MARGIN_TOP_PROPERTY, layouts_header_item_properties[LAYOUTS_HEADER_ITEM_LISTBOX_MARGIN_TOP_PROPERTY] = g_param_spec_int ("listbox-margin-top", "listbox-margin-top", "listbox-margin-top", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	layouts_header_item_signals[LAYOUTS_HEADER_ITEM_ADD_ACTIVATED_SIGNAL] = g_signal_new ("add-activated", LAYOUTS_TYPE_HEADER_ITEM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	layouts_header_item_signals[LAYOUTS_HEADER_ITEM_ROW_ACTIVATED_SIGNAL] = g_signal_new ("row-activated", LAYOUTS_TYPE_HEADER_ITEM, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, gtk_widget_get_type ());
}

static void
layouts_header_item_instance_init (LayoutsHeaderItem * self,
                                   gpointer klass)
{
	self->priv = layouts_header_item_get_instance_private (self);
}

static void
layouts_header_item_finalize (GObject * obj)
{
	LayoutsHeaderItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LAYOUTS_TYPE_HEADER_ITEM, LayoutsHeaderItem);
	g_debug ("HeaderItem.vala:169: Destroying - Layouts.HeaderItem\n");
	_g_free0 (self->_header_title);
	_g_free0 (self->_subheader_title);
	_g_free0 (self->_placeholder_message);
	_g_object_unref0 (self->priv->header_label);
	_g_object_unref0 (self->priv->subheader_label);
	_g_object_unref0 (self->priv->subheader_revealer);
	_g_object_unref0 (self->priv->placeholder_label);
	_g_object_unref0 (self->listbox);
	_g_object_unref0 (self->priv->action_box);
	_g_object_unref0 (self->priv->content_revealer);
	_g_object_unref0 (self->priv->separator_revealer);
	_g_object_unref0 (self->drop_target_end);
	_g_object_unref0 (self->drop_target_end_revealer);
	G_OBJECT_CLASS (layouts_header_item_parent_class)->finalize (obj);
}

static GType
layouts_header_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LayoutsHeaderItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) layouts_header_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LayoutsHeaderItem), 0, (GInstanceInitFunc) layouts_header_item_instance_init, NULL };
	GType layouts_header_item_type_id;
	layouts_header_item_type_id = g_type_register_static (adw_bin_get_type (), "LayoutsHeaderItem", &g_define_type_info, 0);
	LayoutsHeaderItem_private_offset = g_type_add_instance_private (layouts_header_item_type_id, sizeof (LayoutsHeaderItemPrivate));
	return layouts_header_item_type_id;
}

GType
layouts_header_item_get_type (void)
{
	static volatile gsize layouts_header_item_type_id__once = 0;
	if (g_once_init_enter (&layouts_header_item_type_id__once)) {
		GType layouts_header_item_type_id;
		layouts_header_item_type_id = layouts_header_item_get_type_once ();
		g_once_init_leave (&layouts_header_item_type_id__once, layouts_header_item_type_id);
	}
	return layouts_header_item_type_id__once;
}

static void
_vala_layouts_header_item_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	LayoutsHeaderItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, LAYOUTS_TYPE_HEADER_ITEM, LayoutsHeaderItem);
	switch (property_id) {
		case LAYOUTS_HEADER_ITEM_HEADER_TITLE_PROPERTY:
		g_value_set_string (value, layouts_header_item_get_header_title (self));
		break;
		case LAYOUTS_HEADER_ITEM_SUBHEADER_TITLE_PROPERTY:
		g_value_set_string (value, layouts_header_item_get_subheader_title (self));
		break;
		case LAYOUTS_HEADER_ITEM_PLACEHOLDER_MESSAGE_PROPERTY:
		g_value_set_string (value, layouts_header_item_get_placeholder_message (self));
		break;
		case LAYOUTS_HEADER_ITEM_REVEAL_PROPERTY:
		g_value_set_boolean (value, layouts_header_item_get_reveal (self));
		break;
		case LAYOUTS_HEADER_ITEM_ITEMS_PROPERTY:
		g_value_set_object (value, layouts_header_item_get_items (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_layouts_header_item_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	LayoutsHeaderItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, LAYOUTS_TYPE_HEADER_ITEM, LayoutsHeaderItem);
	switch (property_id) {
		case LAYOUTS_HEADER_ITEM_HEADER_TITLE_PROPERTY:
		layouts_header_item_set_header_title (self, g_value_get_string (value));
		break;
		case LAYOUTS_HEADER_ITEM_SUBHEADER_TITLE_PROPERTY:
		layouts_header_item_set_subheader_title (self, g_value_get_string (value));
		break;
		case LAYOUTS_HEADER_ITEM_PLACEHOLDER_MESSAGE_PROPERTY:
		layouts_header_item_set_placeholder_message (self, g_value_get_string (value));
		break;
		case LAYOUTS_HEADER_ITEM_REVEAL_PROPERTY:
		layouts_header_item_set_reveal (self, g_value_get_boolean (value));
		break;
		case LAYOUTS_HEADER_ITEM_SHOW_SEPARATOR_PROPERTY:
		layouts_header_item_set_show_separator (self, g_value_get_boolean (value));
		break;
		case LAYOUTS_HEADER_ITEM_REVEAL_CHILD_PROPERTY:
		layouts_header_item_set_reveal_child (self, g_value_get_boolean (value));
		break;
		case LAYOUTS_HEADER_ITEM_SEPARATOR_SPACE_PROPERTY:
		layouts_header_item_set_separator_space (self, g_value_get_boolean (value));
		break;
		case LAYOUTS_HEADER_ITEM_SEPARATOR_LINES_PROPERTY:
		layouts_header_item_set_separator_lines (self, g_value_get_boolean (value));
		break;
		case LAYOUTS_HEADER_ITEM_LISTBOX_NO_MARGIN_PROPERTY:
		layouts_header_item_set_listbox_no_margin (self, g_value_get_boolean (value));
		break;
		case LAYOUTS_HEADER_ITEM_CARD_PROPERTY:
		layouts_header_item_set_card (self, g_value_get_boolean (value));
		break;
		case LAYOUTS_HEADER_ITEM_LISTBOX_MARGIN_TOP_PROPERTY:
		layouts_header_item_set_listbox_margin_top (self, g_value_get_int (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);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

