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

/*
Copyright (C) 2015 Johan Mattsson

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 3 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.
*/

#include "birdfont.h"
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.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  {
	BIRD_FONT_OTF_TAGS_0_PROPERTY,
	BIRD_FONT_OTF_TAGS_NUM_PROPERTIES
};
static GParamSpec* bird_font_otf_tags_properties[BIRD_FONT_OTF_TAGS_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))

static gpointer bird_font_otf_tags_parent_class = NULL;

static void bird_font_otf_tags_finalize (GObject * obj);
static GType bird_font_otf_tags_get_type_once (void);

void
bird_font_otf_tags_add (BirdFontOtfTags* self,
                        const gchar* tag)
{
	GeeArrayList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tag != NULL);
	_tmp0_ = self->elements;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp0_, tag);
}

void
bird_font_otf_tags_remove (BirdFontOtfTags* self,
                           const gchar* tag)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (tag != NULL);
	while (TRUE) {
		GeeArrayList* _tmp0_;
		GeeArrayList* _tmp1_;
		_tmp0_ = self->elements;
		if (!(gee_abstract_list_index_of ((GeeAbstractList*) _tmp0_, tag) > -1)) {
			break;
		}
		_tmp1_ = self->elements;
		gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp1_, tag);
	}
}

BirdFontOtfTags*
bird_font_otf_tags_copy (BirdFontOtfTags* self)
{
	BirdFontOtfTags* tags = NULL;
	BirdFontOtfTags* _tmp0_;
	BirdFontOtfTags* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = bird_font_otf_tags_new ();
	tags = _tmp0_;
	{
		GeeArrayList* _e_list = NULL;
		GeeArrayList* _tmp1_;
		gint _e_size = 0;
		GeeArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _e_index = 0;
		_tmp1_ = self->elements;
		_e_list = _tmp1_;
		_tmp2_ = _e_list;
		_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_e_size = _tmp4_;
		_e_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gchar* e = NULL;
			GeeArrayList* _tmp7_;
			gpointer _tmp8_;
			BirdFontOtfTags* _tmp9_;
			const gchar* _tmp10_;
			_e_index = _e_index + 1;
			_tmp5_ = _e_index;
			_tmp6_ = _e_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _e_list;
			_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, _e_index);
			e = (gchar*) _tmp8_;
			_tmp9_ = tags;
			_tmp10_ = e;
			bird_font_otf_tags_add (_tmp9_, _tmp10_);
			_g_free0 (e);
		}
	}
	result = tags;
	return result;
}

BirdFontOtfTags*
bird_font_otf_tags_construct (GType object_type)
{
	BirdFontOtfTags * self = NULL;
	self = (BirdFontOtfTags*) g_object_new (object_type, NULL);
	return self;
}

BirdFontOtfTags*
bird_font_otf_tags_new (void)
{
	return bird_font_otf_tags_construct (BIRD_FONT_TYPE_OTF_TAGS);
}

static void
bird_font_otf_tags_class_init (BirdFontOtfTagsClass * klass,
                               gpointer klass_data)
{
	bird_font_otf_tags_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = bird_font_otf_tags_finalize;
}

static void
bird_font_otf_tags_instance_init (BirdFontOtfTags * self,
                                  gpointer klass)
{
	GeeArrayList* _tmp0_;
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	self->elements = _tmp0_;
}

static void
bird_font_otf_tags_finalize (GObject * obj)
{
	BirdFontOtfTags * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIRD_FONT_TYPE_OTF_TAGS, BirdFontOtfTags);
	_g_object_unref0 (self->elements);
	G_OBJECT_CLASS (bird_font_otf_tags_parent_class)->finalize (obj);
}

static GType
bird_font_otf_tags_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BirdFontOtfTagsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bird_font_otf_tags_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BirdFontOtfTags), 0, (GInstanceInitFunc) bird_font_otf_tags_instance_init, NULL };
	GType bird_font_otf_tags_type_id;
	bird_font_otf_tags_type_id = g_type_register_static (G_TYPE_OBJECT, "BirdFontOtfTags", &g_define_type_info, 0);
	return bird_font_otf_tags_type_id;
}

GType
bird_font_otf_tags_get_type (void)
{
	static volatile gsize bird_font_otf_tags_type_id__once = 0;
	if (g_once_init_enter (&bird_font_otf_tags_type_id__once)) {
		GType bird_font_otf_tags_type_id;
		bird_font_otf_tags_type_id = bird_font_otf_tags_get_type_once ();
		g_once_init_leave (&bird_font_otf_tags_type_id__once, bird_font_otf_tags_type_id);
	}
	return bird_font_otf_tags_type_id__once;
}

