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

/*
Copyright (C) 2014 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 <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_PAIR_FORMAT1_0_PROPERTY,
	BIRD_FONT_PAIR_FORMAT1_NUM_PROPERTIES
};
static GParamSpec* bird_font_pair_format1_properties[BIRD_FONT_PAIR_FORMAT1_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer bird_font_pair_format1_parent_class = NULL;

static void bird_font_pair_format1_finalize (GObject * obj);
static GType bird_font_pair_format1_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

BirdFontPairFormat1*
bird_font_pair_format1_construct (GType object_type)
{
	BirdFontPairFormat1 * self = NULL;
	self = (BirdFontPairFormat1*) g_object_new (object_type, NULL);
	return self;
}

BirdFontPairFormat1*
bird_font_pair_format1_new (void)
{
	return bird_font_pair_format1_construct (BIRD_FONT_TYPE_PAIR_FORMAT1);
}

static void
bird_font_pair_format1_class_init (BirdFontPairFormat1Class * klass,
                                   gpointer klass_data)
{
	bird_font_pair_format1_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = bird_font_pair_format1_finalize;
}

static void
bird_font_pair_format1_instance_init (BirdFontPairFormat1 * self,
                                      gpointer klass)
{
	GeeArrayList* _tmp0_;
	self->left = (guint16) 0;
	_tmp0_ = gee_array_list_new (BIRD_FONT_TYPE_KERN, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->pairs = _tmp0_;
}

static void
bird_font_pair_format1_finalize (GObject * obj)
{
	BirdFontPairFormat1 * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIRD_FONT_TYPE_PAIR_FORMAT1, BirdFontPairFormat1);
	_g_object_unref0 (self->pairs);
	G_OBJECT_CLASS (bird_font_pair_format1_parent_class)->finalize (obj);
}

/** GSUB pairwise positioning format 1. 
 * A class that stores kerning information for one letter. 
 */
static GType
bird_font_pair_format1_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BirdFontPairFormat1Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bird_font_pair_format1_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BirdFontPairFormat1), 0, (GInstanceInitFunc) bird_font_pair_format1_instance_init, NULL };
	GType bird_font_pair_format1_type_id;
	bird_font_pair_format1_type_id = g_type_register_static (G_TYPE_OBJECT, "BirdFontPairFormat1", &g_define_type_info, 0);
	return bird_font_pair_format1_type_id;
}

GType
bird_font_pair_format1_get_type (void)
{
	static volatile gsize bird_font_pair_format1_type_id__once = 0;
	if (g_once_init_enter (&bird_font_pair_format1_type_id__once)) {
		GType bird_font_pair_format1_type_id;
		bird_font_pair_format1_type_id = bird_font_pair_format1_get_type_once ();
		g_once_init_leave (&bird_font_pair_format1_type_id__once, bird_font_pair_format1_type_id);
	}
	return bird_font_pair_format1_type_id__once;
}

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;
}

