/* MergeTask.c generated by valac 0.56.17, the Vala compiler
 * generated from MergeTask.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-object.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

#define BIRD_FONT_TYPE_MERGE_TASK (bird_font_merge_task_get_type ())
#define BIRD_FONT_MERGE_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BIRD_FONT_TYPE_MERGE_TASK, BirdFontMergeTask))
#define BIRD_FONT_MERGE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BIRD_FONT_TYPE_MERGE_TASK, BirdFontMergeTaskClass))
#define BIRD_FONT_IS_MERGE_TASK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BIRD_FONT_TYPE_MERGE_TASK))
#define BIRD_FONT_IS_MERGE_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BIRD_FONT_TYPE_MERGE_TASK))
#define BIRD_FONT_MERGE_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BIRD_FONT_TYPE_MERGE_TASK, BirdFontMergeTaskClass))

typedef struct _BirdFontMergeTask BirdFontMergeTask;
typedef struct _BirdFontMergeTaskClass BirdFontMergeTaskClass;
typedef struct _BirdFontMergeTaskPrivate BirdFontMergeTaskPrivate;
enum  {
	BIRD_FONT_MERGE_TASK_0_PROPERTY,
	BIRD_FONT_MERGE_TASK_NUM_PROPERTIES
};
static GParamSpec* bird_font_merge_task_properties[BIRD_FONT_MERGE_TASK_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BirdFontMergeTask {
	BirdFontStrokeTask parent_instance;
	BirdFontMergeTaskPrivate * priv;
};

struct _BirdFontMergeTaskClass {
	BirdFontStrokeTaskClass parent_class;
};

struct _BirdFontMergeTaskPrivate {
	BirdFontStrokeTool* stroke_tool;
};

static gint BirdFontMergeTask_private_offset;
static gpointer bird_font_merge_task_parent_class = NULL;

VALA_EXTERN GType bird_font_merge_task_get_type (void) G_GNUC_CONST ;
VALA_EXTERN BirdFontMergeTask* bird_font_merge_task_new (void);
VALA_EXTERN BirdFontMergeTask* bird_font_merge_task_construct (GType object_type);
static void bird_font_merge_task_real_run (BirdFontTask* base);
static void bird_font_merge_task_finalize (GObject * obj);
static GType bird_font_merge_task_get_type_once (void);

static inline gpointer
bird_font_merge_task_get_instance_private (BirdFontMergeTask* self)
{
	return G_STRUCT_MEMBER_P (self, BirdFontMergeTask_private_offset);
}

BirdFontMergeTask*
bird_font_merge_task_construct (GType object_type)
{
	BirdFontMergeTask * self = NULL;
	BirdFontStrokeTool* _tmp0_;
	self = (BirdFontMergeTask*) bird_font_stroke_task_construct_none (object_type);
	_tmp0_ = bird_font_stroke_tool_new_with_task ((BirdFontStrokeTask*) self);
	_g_object_unref0 (self->priv->stroke_tool);
	self->priv->stroke_tool = _tmp0_;
	return self;
}

BirdFontMergeTask*
bird_font_merge_task_new (void)
{
	return bird_font_merge_task_construct (BIRD_FONT_TYPE_MERGE_TASK);
}

static void
bird_font_merge_task_real_run (BirdFontTask* base)
{
	BirdFontMergeTask * self;
	BirdFontStrokeTool* _tmp0_;
	self = (BirdFontMergeTask*) base;
	_tmp0_ = self->priv->stroke_tool;
	bird_font_stroke_tool_merge_selected_paths (_tmp0_);
}

static void
bird_font_merge_task_class_init (BirdFontMergeTaskClass * klass,
                                 gpointer klass_data)
{
	bird_font_merge_task_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BirdFontMergeTask_private_offset);
	((BirdFontTaskClass *) klass)->run = (void (*) (BirdFontTask*)) bird_font_merge_task_real_run;
	G_OBJECT_CLASS (klass)->finalize = bird_font_merge_task_finalize;
}

static void
bird_font_merge_task_instance_init (BirdFontMergeTask * self,
                                    gpointer klass)
{
	self->priv = bird_font_merge_task_get_instance_private (self);
}

static void
bird_font_merge_task_finalize (GObject * obj)
{
	BirdFontMergeTask * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIRD_FONT_TYPE_MERGE_TASK, BirdFontMergeTask);
	_g_object_unref0 (self->priv->stroke_tool);
	G_OBJECT_CLASS (bird_font_merge_task_parent_class)->finalize (obj);
}

static GType
bird_font_merge_task_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BirdFontMergeTaskClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bird_font_merge_task_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BirdFontMergeTask), 0, (GInstanceInitFunc) bird_font_merge_task_instance_init, NULL };
	GType bird_font_merge_task_type_id;
	bird_font_merge_task_type_id = g_type_register_static (BIRD_FONT_TYPE_STROKE_TASK, "BirdFontMergeTask", &g_define_type_info, 0);
	BirdFontMergeTask_private_offset = g_type_add_instance_private (bird_font_merge_task_type_id, sizeof (BirdFontMergeTaskPrivate));
	return bird_font_merge_task_type_id;
}

GType
bird_font_merge_task_get_type (void)
{
	static volatile gsize bird_font_merge_task_type_id__once = 0;
	if (g_once_init_enter (&bird_font_merge_task_type_id__once)) {
		GType bird_font_merge_task_type_id;
		bird_font_merge_task_type_id = bird_font_merge_task_get_type_once ();
		g_once_init_leave (&bird_font_merge_task_type_id__once, bird_font_merge_task_type_id);
	}
	return bird_font_merge_task_type_id__once;
}

