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

/*
Copyright (C) 2012 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-object.h>
#include <glib.h>
#include <float.h>
#include <math.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_KERNING_0_PROPERTY,
	BIRD_FONT_KERNING_NUM_PROPERTIES
};
static GParamSpec* bird_font_kerning_properties[BIRD_FONT_KERNING_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

static gpointer bird_font_kerning_parent_class = NULL;

static void bird_font_kerning_finalize (GObject * obj);
static GType bird_font_kerning_get_type_once (void);

BirdFontKerning*
bird_font_kerning_construct (GType object_type,
                             gdouble v)
{
	BirdFontKerning * self = NULL;
	self = (BirdFontKerning*) g_object_new (object_type, NULL);
	self->val = v;
	_g_object_unref0 (self->glyph);
	self->glyph = NULL;
	return self;
}

BirdFontKerning*
bird_font_kerning_new (gdouble v)
{
	return bird_font_kerning_construct (BIRD_FONT_TYPE_KERNING, v);
}

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

BirdFontKerning*
bird_font_kerning_construct_for_glyph (GType object_type,
                                       BirdFontGlyph* g,
                                       gdouble v)
{
	BirdFontKerning * self = NULL;
	BirdFontGlyph* _tmp0_;
	self = (BirdFontKerning*) g_object_new (object_type, NULL);
	self->val = v;
	_tmp0_ = _g_object_ref0 (g);
	_g_object_unref0 (self->glyph);
	self->glyph = _tmp0_;
	return self;
}

BirdFontKerning*
bird_font_kerning_new_for_glyph (BirdFontGlyph* g,
                                 gdouble v)
{
	return bird_font_kerning_construct_for_glyph (BIRD_FONT_TYPE_KERNING, g, v);
}

BirdFontGlyph*
bird_font_kerning_get_glyph (BirdFontKerning* self)
{
	BirdFontGlyph* _tmp0_;
	BirdFontGlyph* _tmp2_;
	BirdFontGlyph* _tmp3_;
	BirdFontGlyph* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->glyph;
	if (G_UNLIKELY (_tmp0_ == NULL)) {
		BirdFontGlyph* _tmp1_;
		g_warning ("Kerning.vala:36: No glyph");
		_tmp1_ = bird_font_glyph_new ("", (gunichar) 0);
		result = _tmp1_;
		return result;
	}
	_tmp2_ = self->glyph;
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, BIRD_FONT_TYPE_GLYPH, BirdFontGlyph));
	result = _tmp3_;
	return result;
}

static void
bird_font_kerning_class_init (BirdFontKerningClass * klass,
                              gpointer klass_data)
{
	bird_font_kerning_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = bird_font_kerning_finalize;
}

static void
bird_font_kerning_instance_init (BirdFontKerning * self,
                                 gpointer klass)
{
}

static void
bird_font_kerning_finalize (GObject * obj)
{
	BirdFontKerning * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIRD_FONT_TYPE_KERNING, BirdFontKerning);
	_g_object_unref0 (self->glyph);
	G_OBJECT_CLASS (bird_font_kerning_parent_class)->finalize (obj);
}

static GType
bird_font_kerning_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BirdFontKerningClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bird_font_kerning_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BirdFontKerning), 0, (GInstanceInitFunc) bird_font_kerning_instance_init, NULL };
	GType bird_font_kerning_type_id;
	bird_font_kerning_type_id = g_type_register_static (G_TYPE_OBJECT, "BirdFontKerning", &g_define_type_info, 0);
	return bird_font_kerning_type_id;
}

GType
bird_font_kerning_get_type (void)
{
	static volatile gsize bird_font_kerning_type_id__once = 0;
	if (g_once_init_enter (&bird_font_kerning_type_id__once)) {
		GType bird_font_kerning_type_id;
		bird_font_kerning_type_id = bird_font_kerning_get_type_once ();
		g_once_init_leave (&bird_font_kerning_type_id__once, bird_font_kerning_type_id);
	}
	return bird_font_kerning_type_id__once;
}

