/* DetailsList.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from DetailsList.vala, do not modify */

/* DetailsWindow.vala
 *
 * Copyright 2023 Diego Iván <diegoivan.mae@gmail.com>
 *
 * 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, see <http://www.gnu.org/licenses/>.
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.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 PAPER_CLIP_TYPE_DETAILS_LIST (paper_clip_details_list_get_type ())
#define PAPER_CLIP_DETAILS_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAPER_CLIP_TYPE_DETAILS_LIST, PaperClipDetailsList))
#define PAPER_CLIP_DETAILS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAPER_CLIP_TYPE_DETAILS_LIST, PaperClipDetailsListClass))
#define PAPER_CLIP_IS_DETAILS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAPER_CLIP_TYPE_DETAILS_LIST))
#define PAPER_CLIP_IS_DETAILS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAPER_CLIP_TYPE_DETAILS_LIST))
#define PAPER_CLIP_DETAILS_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAPER_CLIP_TYPE_DETAILS_LIST, PaperClipDetailsListClass))

typedef struct _PaperClipDetailsList PaperClipDetailsList;
typedef struct _PaperClipDetailsListClass PaperClipDetailsListClass;
typedef struct _PaperClipDetailsListPrivate PaperClipDetailsListPrivate;

#define PAPER_CLIP_TYPE_STRING_ARRAY_ROW (paper_clip_string_array_row_get_type ())
#define PAPER_CLIP_STRING_ARRAY_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAPER_CLIP_TYPE_STRING_ARRAY_ROW, PaperClipStringArrayRow))
#define PAPER_CLIP_STRING_ARRAY_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAPER_CLIP_TYPE_STRING_ARRAY_ROW, PaperClipStringArrayRowClass))
#define PAPER_CLIP_IS_STRING_ARRAY_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAPER_CLIP_TYPE_STRING_ARRAY_ROW))
#define PAPER_CLIP_IS_STRING_ARRAY_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAPER_CLIP_TYPE_STRING_ARRAY_ROW))
#define PAPER_CLIP_STRING_ARRAY_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAPER_CLIP_TYPE_STRING_ARRAY_ROW, PaperClipStringArrayRowClass))

typedef struct _PaperClipStringArrayRow PaperClipStringArrayRow;
typedef struct _PaperClipStringArrayRowClass PaperClipStringArrayRowClass;

#define PAPER_CLIP_TYPE_DOCUMENT (paper_clip_document_get_type ())
#define PAPER_CLIP_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAPER_CLIP_TYPE_DOCUMENT, PaperClipDocument))
#define PAPER_CLIP_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAPER_CLIP_TYPE_DOCUMENT, PaperClipDocumentClass))
#define PAPER_CLIP_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAPER_CLIP_TYPE_DOCUMENT))
#define PAPER_CLIP_IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAPER_CLIP_TYPE_DOCUMENT))
#define PAPER_CLIP_DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAPER_CLIP_TYPE_DOCUMENT, PaperClipDocumentClass))

typedef struct _PaperClipDocument PaperClipDocument;
typedef struct _PaperClipDocumentClass PaperClipDocumentClass;
enum  {
	PAPER_CLIP_DETAILS_LIST_0_PROPERTY,
	PAPER_CLIP_DETAILS_LIST_DOCUMENT_PROPERTY,
	PAPER_CLIP_DETAILS_LIST_NUM_PROPERTIES
};
static GParamSpec* paper_clip_details_list_properties[PAPER_CLIP_DETAILS_LIST_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

struct _PaperClipDetailsList {
	AdwBin parent_instance;
	PaperClipDetailsListPrivate * priv;
};

struct _PaperClipDetailsListClass {
	AdwBinClass parent_class;
};

struct _PaperClipDetailsListPrivate {
	AdwActionRow* format_row;
	AdwActionRow* layout_row;
	AdwActionRow* duplex_row;
	AdwActionRow* subtype_row;
	AdwActionRow* javascript_row;
	AdwActionRow* attachments_row;
	AdwActionRow* pages_row;
	PaperClipStringArrayRow* preferences_row;
	PaperClipStringArrayRow* permissions_row;
	PaperClipDocument* _document;
};

static gint PaperClipDetailsList_private_offset;
static gpointer paper_clip_details_list_parent_class = NULL;

VALA_EXTERN GType paper_clip_details_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PaperClipDetailsList, g_object_unref)
VALA_EXTERN GType paper_clip_string_array_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PaperClipStringArrayRow, g_object_unref)
VALA_EXTERN GType paper_clip_document_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PaperClipDocument, g_object_unref)
VALA_EXTERN PaperClipDetailsList* paper_clip_details_list_new (void);
VALA_EXTERN PaperClipDetailsList* paper_clip_details_list_construct (GType object_type);
VALA_EXTERN PaperClipDocument* paper_clip_details_list_get_document (PaperClipDetailsList* self);
VALA_EXTERN void paper_clip_details_list_set_document (PaperClipDetailsList* self,
                                           PaperClipDocument* value);
VALA_EXTERN gchar* paper_clip_document_get_format (PaperClipDocument* self);
VALA_EXTERN gchar* paper_clip_document_get_layout (PaperClipDocument* self);
VALA_EXTERN gchar* paper_clip_document_get_print_duplex (PaperClipDocument* self);
VALA_EXTERN gchar* paper_clip_document_get_subtype (PaperClipDocument* self);
VALA_EXTERN gchar** paper_clip_document_get_viewer_preferences (PaperClipDocument* self,
                                                    gint* result_length1);
VALA_EXTERN void paper_clip_string_array_row_set_string_array (PaperClipStringArrayRow* self,
                                                   gchar** value,
                                                   gint value_length1);
VALA_EXTERN gchar** paper_clip_document_get_permissions (PaperClipDocument* self,
                                             gint* result_length1);
VALA_EXTERN gboolean paper_clip_document_get_contains_attachments (PaperClipDocument* self);
VALA_EXTERN gboolean paper_clip_document_get_contains_javascript (PaperClipDocument* self);
VALA_EXTERN gint paper_clip_document_get_n_pages (PaperClipDocument* self);
static void paper_clip_details_list_finalize (GObject * obj);
static GType paper_clip_details_list_get_type_once (void);
static void _vala_paper_clip_details_list_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_paper_clip_details_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
paper_clip_details_list_get_instance_private (PaperClipDetailsList* self)
{
	return G_STRUCT_MEMBER_P (self, PaperClipDetailsList_private_offset);
}

PaperClipDetailsList*
paper_clip_details_list_construct (GType object_type)
{
	PaperClipDetailsList * self = NULL;
	self = (PaperClipDetailsList*) g_object_new (object_type, NULL);
	return self;
}

PaperClipDetailsList*
paper_clip_details_list_new (void)
{
	return paper_clip_details_list_construct (PAPER_CLIP_TYPE_DETAILS_LIST);
}

PaperClipDocument*
paper_clip_details_list_get_document (PaperClipDetailsList* self)
{
	PaperClipDocument* result;
	PaperClipDocument* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_document;
	result = _tmp0_;
	return result;
}

void
paper_clip_details_list_set_document (PaperClipDetailsList* self,
                                      PaperClipDocument* value)
{
	AdwActionRow* _tmp0_;
	PaperClipDocument* _tmp1_;
	PaperClipDocument* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	AdwActionRow* _tmp6_;
	PaperClipDocument* _tmp7_;
	PaperClipDocument* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	AdwActionRow* _tmp12_;
	PaperClipDocument* _tmp13_;
	PaperClipDocument* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	AdwActionRow* _tmp18_;
	PaperClipDocument* _tmp19_;
	PaperClipDocument* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	PaperClipStringArrayRow* _tmp24_;
	PaperClipDocument* _tmp25_;
	PaperClipDocument* _tmp26_;
	gchar** _tmp27_;
	gint _tmp27__length1;
	gint _tmp28_ = 0;
	gchar** _tmp29_;
	gint _tmp29__length1;
	gchar** _tmp30_;
	gint _tmp30__length1;
	PaperClipStringArrayRow* _tmp31_;
	PaperClipDocument* _tmp32_;
	PaperClipDocument* _tmp33_;
	gchar** _tmp34_;
	gint _tmp34__length1;
	gint _tmp35_ = 0;
	gchar** _tmp36_;
	gint _tmp36__length1;
	gchar** _tmp37_;
	gint _tmp37__length1;
	const gchar* _tmp38_ = NULL;
	PaperClipDocument* _tmp39_;
	PaperClipDocument* _tmp40_;
	gboolean _tmp41_;
	gboolean _tmp42_;
	AdwActionRow* _tmp43_;
	const gchar* _tmp44_ = NULL;
	PaperClipDocument* _tmp45_;
	PaperClipDocument* _tmp46_;
	gboolean _tmp47_;
	gboolean _tmp48_;
	AdwActionRow* _tmp49_;
	PaperClipDocument* _tmp50_;
	PaperClipDocument* _tmp51_;
	gint _tmp52_;
	gint _tmp53_;
	g_return_if_fail (self != NULL);
	self->priv->_document = value;
	_tmp0_ = self->priv->format_row;
	_tmp1_ = paper_clip_details_list_get_document (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = paper_clip_document_get_format (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	adw_action_row_set_subtitle (_tmp0_, _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = self->priv->layout_row;
	_tmp7_ = paper_clip_details_list_get_document (self);
	_tmp8_ = _tmp7_;
	_tmp9_ = paper_clip_document_get_layout (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = _tmp10_;
	adw_action_row_set_subtitle (_tmp6_, _tmp11_);
	_g_free0 (_tmp11_);
	_tmp12_ = self->priv->duplex_row;
	_tmp13_ = paper_clip_details_list_get_document (self);
	_tmp14_ = _tmp13_;
	_tmp15_ = paper_clip_document_get_print_duplex (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = _tmp16_;
	adw_action_row_set_subtitle (_tmp12_, _tmp17_);
	_g_free0 (_tmp17_);
	_tmp18_ = self->priv->subtype_row;
	_tmp19_ = paper_clip_details_list_get_document (self);
	_tmp20_ = _tmp19_;
	_tmp21_ = paper_clip_document_get_subtype (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = _tmp22_;
	adw_action_row_set_subtitle (_tmp18_, _tmp23_);
	_g_free0 (_tmp23_);
	_tmp24_ = self->priv->preferences_row;
	_tmp25_ = paper_clip_details_list_get_document (self);
	_tmp26_ = _tmp25_;
	_tmp27_ = paper_clip_document_get_viewer_preferences (_tmp26_, &_tmp28_);
	_tmp27__length1 = _tmp28_;
	_tmp29_ = _tmp27_;
	_tmp29__length1 = _tmp27__length1;
	_tmp30_ = _tmp29_;
	_tmp30__length1 = _tmp29__length1;
	paper_clip_string_array_row_set_string_array (_tmp24_, _tmp30_, _tmp29__length1);
	_tmp30_ = (_vala_array_free (_tmp30_, _tmp30__length1, (GDestroyNotify) g_free), NULL);
	_tmp31_ = self->priv->permissions_row;
	_tmp32_ = paper_clip_details_list_get_document (self);
	_tmp33_ = _tmp32_;
	_tmp34_ = paper_clip_document_get_permissions (_tmp33_, &_tmp35_);
	_tmp34__length1 = _tmp35_;
	_tmp36_ = _tmp34_;
	_tmp36__length1 = _tmp34__length1;
	_tmp37_ = _tmp36_;
	_tmp37__length1 = _tmp36__length1;
	paper_clip_string_array_row_set_string_array (_tmp31_, _tmp37_, _tmp36__length1);
	_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) g_free), NULL);
	_tmp39_ = paper_clip_details_list_get_document (self);
	_tmp40_ = _tmp39_;
	_tmp41_ = paper_clip_document_get_contains_attachments (_tmp40_);
	_tmp42_ = _tmp41_;
	if (_tmp42_) {
		_tmp38_ = _ ("Yes");
	} else {
		_tmp38_ = _ ("No");
	}
	_tmp43_ = self->priv->attachments_row;
	adw_action_row_set_subtitle (_tmp43_, _tmp38_);
	_tmp45_ = paper_clip_details_list_get_document (self);
	_tmp46_ = _tmp45_;
	_tmp47_ = paper_clip_document_get_contains_javascript (_tmp46_);
	_tmp48_ = _tmp47_;
	if (_tmp48_) {
		_tmp44_ = _ ("Yes");
	} else {
		_tmp44_ = _ ("No");
	}
	_tmp49_ = self->priv->javascript_row;
	adw_action_row_set_subtitle (_tmp49_, _tmp44_);
	_tmp50_ = paper_clip_details_list_get_document (self);
	_tmp51_ = _tmp50_;
	_tmp52_ = paper_clip_document_get_n_pages (_tmp51_);
	_tmp53_ = _tmp52_;
	if (_tmp53_ > 0) {
		AdwActionRow* _tmp54_;
		AdwActionRow* _tmp55_;
		PaperClipDocument* _tmp56_;
		PaperClipDocument* _tmp57_;
		gint _tmp58_;
		gint _tmp59_;
		gchar* _tmp60_;
		gchar* _tmp61_;
		_tmp54_ = self->priv->pages_row;
		gtk_widget_set_visible ((GtkWidget*) _tmp54_, TRUE);
		_tmp55_ = self->priv->pages_row;
		_tmp56_ = paper_clip_details_list_get_document (self);
		_tmp57_ = _tmp56_;
		_tmp58_ = paper_clip_document_get_n_pages (_tmp57_);
		_tmp59_ = _tmp58_;
		_tmp60_ = g_strdup_printf ("%i", _tmp59_);
		_tmp61_ = _tmp60_;
		adw_action_row_set_subtitle (_tmp55_, _tmp61_);
		_g_free0 (_tmp61_);
	} else {
		AdwActionRow* _tmp62_;
		_tmp62_ = self->priv->pages_row;
		gtk_widget_set_visible ((GtkWidget*) _tmp62_, FALSE);
	}
	g_object_notify_by_pspec ((GObject *) self, paper_clip_details_list_properties[PAPER_CLIP_DETAILS_LIST_DOCUMENT_PROPERTY]);
}

static void
paper_clip_details_list_class_init (PaperClipDetailsListClass * klass,
                                    gpointer klass_data)
{
	paper_clip_details_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PaperClipDetailsList_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_paper_clip_details_list_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_paper_clip_details_list_set_property;
	G_OBJECT_CLASS (klass)->finalize = paper_clip_details_list_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAPER_CLIP_DETAILS_LIST_DOCUMENT_PROPERTY, paper_clip_details_list_properties[PAPER_CLIP_DETAILS_LIST_DOCUMENT_PROPERTY] = g_param_spec_object ("document", "document", "document", PAPER_CLIP_TYPE_DOCUMENT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/io/github/diegoivan/pdf_metadata_editor/gtk/details-list.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "format_row", FALSE, PaperClipDetailsList_private_offset + G_STRUCT_OFFSET (PaperClipDetailsListPrivate, format_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "layout_row", FALSE, PaperClipDetailsList_private_offset + G_STRUCT_OFFSET (PaperClipDetailsListPrivate, layout_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "duplex_row", FALSE, PaperClipDetailsList_private_offset + G_STRUCT_OFFSET (PaperClipDetailsListPrivate, duplex_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "subtype_row", FALSE, PaperClipDetailsList_private_offset + G_STRUCT_OFFSET (PaperClipDetailsListPrivate, subtype_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "javascript_row", FALSE, PaperClipDetailsList_private_offset + G_STRUCT_OFFSET (PaperClipDetailsListPrivate, javascript_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "attachments_row", FALSE, PaperClipDetailsList_private_offset + G_STRUCT_OFFSET (PaperClipDetailsListPrivate, attachments_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "pages_row", FALSE, PaperClipDetailsList_private_offset + G_STRUCT_OFFSET (PaperClipDetailsListPrivate, pages_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "preferences_row", FALSE, PaperClipDetailsList_private_offset + G_STRUCT_OFFSET (PaperClipDetailsListPrivate, preferences_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "permissions_row", FALSE, PaperClipDetailsList_private_offset + G_STRUCT_OFFSET (PaperClipDetailsListPrivate, permissions_row));
}

static void
paper_clip_details_list_instance_init (PaperClipDetailsList * self,
                                       gpointer klass)
{
	self->priv = paper_clip_details_list_get_instance_private (self);
	g_type_ensure (PAPER_CLIP_TYPE_STRING_ARRAY_ROW);
	g_type_ensure (PAPER_CLIP_TYPE_STRING_ARRAY_ROW);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
paper_clip_details_list_finalize (GObject * obj)
{
	PaperClipDetailsList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PAPER_CLIP_TYPE_DETAILS_LIST, PaperClipDetailsList);
	G_OBJECT_CLASS (paper_clip_details_list_parent_class)->finalize (obj);
}

static GType
paper_clip_details_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PaperClipDetailsListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) paper_clip_details_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PaperClipDetailsList), 0, (GInstanceInitFunc) paper_clip_details_list_instance_init, NULL };
	GType paper_clip_details_list_type_id;
	paper_clip_details_list_type_id = g_type_register_static (adw_bin_get_type (), "PaperClipDetailsList", &g_define_type_info, 0);
	PaperClipDetailsList_private_offset = g_type_add_instance_private (paper_clip_details_list_type_id, sizeof (PaperClipDetailsListPrivate));
	return paper_clip_details_list_type_id;
}

GType
paper_clip_details_list_get_type (void)
{
	static volatile gsize paper_clip_details_list_type_id__once = 0;
	if (g_once_init_enter (&paper_clip_details_list_type_id__once)) {
		GType paper_clip_details_list_type_id;
		paper_clip_details_list_type_id = paper_clip_details_list_get_type_once ();
		g_once_init_leave (&paper_clip_details_list_type_id__once, paper_clip_details_list_type_id);
	}
	return paper_clip_details_list_type_id__once;
}

static void
_vala_paper_clip_details_list_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	PaperClipDetailsList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PAPER_CLIP_TYPE_DETAILS_LIST, PaperClipDetailsList);
	switch (property_id) {
		case PAPER_CLIP_DETAILS_LIST_DOCUMENT_PROPERTY:
		g_value_set_object (value, paper_clip_details_list_get_document (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_paper_clip_details_list_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	PaperClipDetailsList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PAPER_CLIP_TYPE_DETAILS_LIST, PaperClipDetailsList);
	switch (property_id) {
		case PAPER_CLIP_DETAILS_LIST_DOCUMENT_PROPERTY:
		paper_clip_details_list_set_document (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);
}

