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

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
/*
 * ArrayList.vala
 *
 * Copyright (C) 2016  Daniel Espinosa <esodan@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *      Daniel Espinosa <esodan@gmail.com>
 */

#include "gxml/gxml.h"
#include <glib.h>
#include <glib-object.h>
#include "gxml.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  {
	GXML_ARRAY_LIST_0_PROPERTY,
	GXML_ARRAY_LIST_NUM_PROPERTIES
};
static GParamSpec* gxml_array_list_properties[GXML_ARRAY_LIST_NUM_PROPERTIES];

static gpointer gxml_array_list_parent_class = NULL;
static GXmlListIface * gxml_array_list_gxml_list_parent_iface = NULL;

static gboolean gxml_array_list_real_validate_append (GXmlBaseCollection* base,
                                               gint index,
                                               GXmlDomElement* element,
                                               GError** error);
static GType gxml_array_list_get_type_once (void);

static gboolean
gxml_array_list_real_validate_append (GXmlBaseCollection* base,
                                      gint index,
                                      GXmlDomElement* element,
                                      GError** error)
{
	GXmlArrayList * self;
	gboolean result;
	self = (GXmlArrayList*) base;
	g_return_val_if_fail (element != NULL, FALSE);
	result = TRUE;
	return result;
}

GXmlArrayList*
gxml_array_list_construct (GType object_type)
{
	GXmlArrayList * self = NULL;
	self = (GXmlArrayList*) gxml_base_collection_construct (object_type);
	return self;
}

GXmlArrayList*
gxml_array_list_new (void)
{
	return gxml_array_list_construct (GXML_TYPE_ARRAY_LIST);
}

static void
gxml_array_list_class_init (GXmlArrayListClass * klass,
                            gpointer klass_data)
{
	gxml_array_list_parent_class = g_type_class_peek_parent (klass);
	((GXmlBaseCollectionClass *) klass)->validate_append = (gboolean (*) (GXmlBaseCollection*, gint, GXmlDomElement*, GError**)) gxml_array_list_real_validate_append;
}

static void
gxml_array_list_gxml_list_interface_init (GXmlListIface * iface,
                                          gpointer iface_data)
{
	gxml_array_list_gxml_list_parent_iface = g_type_interface_peek_parent (iface);
}

static void
gxml_array_list_instance_init (GXmlArrayList * self,
                               gpointer klass)
{
}

/**
 * A class implementing {@link Collection} to store references to
 * child {@link DomElement} of {@link Collection.element}, using an index.
 *
 * {{{
 *   public class YourObject : GXml.Element {
 *    [Description (nick="::Name")]
 *    public string name { get; set; }
 *   }
 *   public class YourList : GXml.ArrayList {
 *    construct {
 *      try { initialize (typeof (YourObject)); }
 *      catch (GLib.Error e) {
 *        warning ("Initialization error for collection type: %s : %s"
 *             .printf (get_type ().name(), e.message));
 *      }
 *    }
 *   }
 * }}}
 */
static GType
gxml_array_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlArrayListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_array_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlArrayList), 0, (GInstanceInitFunc) gxml_array_list_instance_init, NULL };
	static const GInterfaceInfo gxml_list_info = { (GInterfaceInitFunc) gxml_array_list_gxml_list_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_array_list_type_id;
	gxml_array_list_type_id = g_type_register_static (GXML_TYPE_BASE_COLLECTION, "GXmlArrayList", &g_define_type_info, 0);
	g_type_add_interface_static (gxml_array_list_type_id, GXML_TYPE_LIST, &gxml_list_info);
	return gxml_array_list_type_id;
}

GType
gxml_array_list_get_type (void)
{
	static volatile gsize gxml_array_list_type_id__once = 0;
	if (g_once_init_enter (&gxml_array_list_type_id__once)) {
		GType gxml_array_list_type_id;
		gxml_array_list_type_id = gxml_array_list_get_type_once ();
		g_once_init_leave (&gxml_array_list_type_id__once, gxml_array_list_type_id);
	}
	return gxml_array_list_type_id__once;
}

