/* CmapSubtable.c generated by valac 0.56.17, the Vala compiler
 * generated from CmapSubtable.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 <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_CMAP_SUBTABLE_0_PROPERTY,
	BIRD_FONT_CMAP_SUBTABLE_NUM_PROPERTIES
};
static GParamSpec* bird_font_cmap_subtable_properties[BIRD_FONT_CMAP_SUBTABLE_NUM_PROPERTIES];

static gpointer bird_font_cmap_subtable_parent_class = NULL;

static gushort bird_font_cmap_subtable_real_get_platform (BirdFontCmapSubtable* self);
static gushort bird_font_cmap_subtable_real_get_encoding (BirdFontCmapSubtable* self);
static void bird_font_cmap_subtable_real_generate_cmap_data (BirdFontCmapSubtable* self,
                                                      BirdFontGlyfTable* glyf_table,
                                                      GError** error);
static BirdFontFontData* bird_font_cmap_subtable_real_get_cmap_data (BirdFontCmapSubtable* self);
static GType bird_font_cmap_subtable_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static gushort
bird_font_cmap_subtable_real_get_platform (BirdFontCmapSubtable* self)
{
	gushort _tmp0_ = 0U;
	g_critical ("Type `%s' does not implement abstract method `bird_font_cmap_subtable_get_platform'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gushort
bird_font_cmap_subtable_get_platform (BirdFontCmapSubtable* self)
{
	BirdFontCmapSubtableClass* _klass_;
	g_return_val_if_fail (self != NULL, 0U);
	_klass_ = BIRD_FONT_CMAP_SUBTABLE_GET_CLASS (self);
	if (_klass_->get_platform) {
		return _klass_->get_platform (self);
	}
	return 0U;
}

static gushort
bird_font_cmap_subtable_real_get_encoding (BirdFontCmapSubtable* self)
{
	gushort _tmp0_ = 0U;
	g_critical ("Type `%s' does not implement abstract method `bird_font_cmap_subtable_get_encoding'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gushort
bird_font_cmap_subtable_get_encoding (BirdFontCmapSubtable* self)
{
	BirdFontCmapSubtableClass* _klass_;
	g_return_val_if_fail (self != NULL, 0U);
	_klass_ = BIRD_FONT_CMAP_SUBTABLE_GET_CLASS (self);
	if (_klass_->get_encoding) {
		return _klass_->get_encoding (self);
	}
	return 0U;
}

static void
bird_font_cmap_subtable_real_generate_cmap_data (BirdFontCmapSubtable* self,
                                                 BirdFontGlyfTable* glyf_table,
                                                 GError** error)
{
	g_critical ("Type `%s' does not implement abstract method `bird_font_cmap_subtable_generate_cmap_data'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
bird_font_cmap_subtable_generate_cmap_data (BirdFontCmapSubtable* self,
                                            BirdFontGlyfTable* glyf_table,
                                            GError** error)
{
	BirdFontCmapSubtableClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = BIRD_FONT_CMAP_SUBTABLE_GET_CLASS (self);
	if (_klass_->generate_cmap_data) {
		_klass_->generate_cmap_data (self, glyf_table, error);
	}
}

static BirdFontFontData*
bird_font_cmap_subtable_real_get_cmap_data (BirdFontCmapSubtable* self)
{
	g_critical ("Type `%s' does not implement abstract method `bird_font_cmap_subtable_get_cmap_data'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

BirdFontFontData*
bird_font_cmap_subtable_get_cmap_data (BirdFontCmapSubtable* self)
{
	BirdFontCmapSubtableClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = BIRD_FONT_CMAP_SUBTABLE_GET_CLASS (self);
	if (_klass_->get_cmap_data) {
		return _klass_->get_cmap_data (self);
	}
	return NULL;
}

BirdFontCmapSubtable*
bird_font_cmap_subtable_construct (GType object_type)
{
	BirdFontCmapSubtable * self = NULL;
	self = (BirdFontCmapSubtable*) g_object_new (object_type, NULL);
	return self;
}

static void
bird_font_cmap_subtable_class_init (BirdFontCmapSubtableClass * klass,
                                    gpointer klass_data)
{
	bird_font_cmap_subtable_parent_class = g_type_class_peek_parent (klass);
	((BirdFontCmapSubtableClass *) klass)->get_platform = (gushort (*) (BirdFontCmapSubtable*)) bird_font_cmap_subtable_real_get_platform;
	((BirdFontCmapSubtableClass *) klass)->get_encoding = (gushort (*) (BirdFontCmapSubtable*)) bird_font_cmap_subtable_real_get_encoding;
	((BirdFontCmapSubtableClass *) klass)->generate_cmap_data = (void (*) (BirdFontCmapSubtable*, BirdFontGlyfTable*, GError**)) bird_font_cmap_subtable_real_generate_cmap_data;
	((BirdFontCmapSubtableClass *) klass)->get_cmap_data = (BirdFontFontData* (*) (BirdFontCmapSubtable*)) bird_font_cmap_subtable_real_get_cmap_data;
}

static void
bird_font_cmap_subtable_instance_init (BirdFontCmapSubtable * self,
                                       gpointer klass)
{
}

static GType
bird_font_cmap_subtable_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BirdFontCmapSubtableClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bird_font_cmap_subtable_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BirdFontCmapSubtable), 0, (GInstanceInitFunc) bird_font_cmap_subtable_instance_init, NULL };
	GType bird_font_cmap_subtable_type_id;
	bird_font_cmap_subtable_type_id = g_type_register_static (G_TYPE_OBJECT, "BirdFontCmapSubtable", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return bird_font_cmap_subtable_type_id;
}

GType
bird_font_cmap_subtable_get_type (void)
{
	static volatile gsize bird_font_cmap_subtable_type_id__once = 0;
	if (g_once_init_enter (&bird_font_cmap_subtable_type_id__once)) {
		GType bird_font_cmap_subtable_type_id;
		bird_font_cmap_subtable_type_id = bird_font_cmap_subtable_get_type_once ();
		g_once_init_leave (&bird_font_cmap_subtable_type_id__once, bird_font_cmap_subtable_type_id);
	}
	return bird_font_cmap_subtable_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;
}

