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

/*
* Copyright (c) 2016 Felipe Escoto (https://github.com/Philip-Scott/Notes-up)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authored by: Felipe Escoto <felescoto95@hotmail.com>
*/

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gee.h>
#include <gobject/gvaluecollector.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define ENOTES_TYPE_PLUGIN (enotes_plugin_get_type ())
#define ENOTES_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ENOTES_TYPE_PLUGIN, ENotesPlugin))
#define ENOTES_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ENOTES_TYPE_PLUGIN, ENotesPluginClass))
#define ENOTES_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ENOTES_TYPE_PLUGIN))
#define ENOTES_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ENOTES_TYPE_PLUGIN))
#define ENOTES_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ENOTES_TYPE_PLUGIN, ENotesPluginClass))

typedef struct _ENotesPlugin ENotesPlugin;
typedef struct _ENotesPluginClass ENotesPluginClass;
typedef struct _ENotesPluginPrivate ENotesPluginPrivate;

#define TYPE_BL_MEMBER (bl_member_get_type ())
#define BL_MEMBER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BL_MEMBER, BLMember))
#define BL_MEMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BL_MEMBER, BLMemberClass))
#define IS_BL_MEMBER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BL_MEMBER))
#define IS_BL_MEMBER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BL_MEMBER))
#define BL_MEMBER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BL_MEMBER, BLMemberClass))

typedef struct _BLMember BLMember;
typedef struct _BLMemberClass BLMemberClass;
enum  {
	ENOTES_PLUGIN_0_PROPERTY,
	ENOTES_PLUGIN_NUM_PROPERTIES
};
static GParamSpec* enotes_plugin_properties[ENOTES_PLUGIN_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	ENOTES_PLUGIN_STRING_COOKED_SIGNAL,
	ENOTES_PLUGIN_NUM_SIGNALS
};
static guint enotes_plugin_signals[ENOTES_PLUGIN_NUM_SIGNALS] = {0};
typedef struct _BLMemberPrivate BLMemberPrivate;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _ParamSpecBLMember ParamSpecBLMember;

struct _ENotesPlugin {
	GObject parent_instance;
	ENotesPluginPrivate * priv;
	gboolean state;
	gchar* code_name;
};

struct _ENotesPluginClass {
	GObjectClass parent_class;
	gchar* (*get_desctiption) (ENotesPlugin* self);
	gchar* (*get_name) (ENotesPlugin* self);
	gboolean (*has_match) (ENotesPlugin* self, const gchar* text);
	gchar* (*convert) (ENotesPlugin* self, const gchar* line);
	GtkWidget* (*editor_button) (ENotesPlugin* self);
	gchar* (*get_button_desctiption) (ENotesPlugin* self);
	gchar* (*request_string) (ENotesPlugin* self, const gchar* selection);
	GeeList* (*get_blacklist_members) (ENotesPlugin* self);
};

struct _BLMember {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BLMemberPrivate * priv;
	GRegex* reg;
	gchar* replace;
};

struct _BLMemberClass {
	GTypeClass parent_class;
	void (*finalize) (BLMember *self);
};

struct _ParamSpecBLMember {
	GParamSpec parent_instance;
};

static gpointer enotes_plugin_parent_class = NULL;
static gpointer bl_member_parent_class = NULL;

VALA_EXTERN GType enotes_plugin_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ENotesPlugin, g_object_unref)
VALA_EXTERN gpointer bl_member_ref (gpointer instance);
VALA_EXTERN void bl_member_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_bl_member (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_bl_member (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_bl_member (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_bl_member (const GValue* value);
VALA_EXTERN GType bl_member_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BLMember, bl_member_unref)
VALA_EXTERN gchar* enotes_plugin_get_desctiption (ENotesPlugin* self);
VALA_EXTERN gchar* enotes_plugin_get_name (ENotesPlugin* self);
VALA_EXTERN gboolean enotes_plugin_has_match (ENotesPlugin* self,
                                  const gchar* text);
VALA_EXTERN gchar* enotes_plugin_convert (ENotesPlugin* self,
                              const gchar* line);
VALA_EXTERN GtkWidget* enotes_plugin_editor_button (ENotesPlugin* self);
VALA_EXTERN gchar* enotes_plugin_get_button_desctiption (ENotesPlugin* self);
VALA_EXTERN gchar* enotes_plugin_request_string (ENotesPlugin* self,
                                     const gchar* selection);
VALA_EXTERN GeeList* enotes_plugin_get_blacklist_members (ENotesPlugin* self);
static gchar* enotes_plugin_real_get_desctiption (ENotesPlugin* self);
static gchar* enotes_plugin_real_get_name (ENotesPlugin* self);
static gboolean enotes_plugin_real_has_match (ENotesPlugin* self,
                                       const gchar* text);
static gchar* enotes_plugin_real_convert (ENotesPlugin* self,
                                   const gchar* line);
static GtkWidget* enotes_plugin_real_editor_button (ENotesPlugin* self);
static gchar* enotes_plugin_real_get_button_desctiption (ENotesPlugin* self);
static gchar* enotes_plugin_real_request_string (ENotesPlugin* self,
                                          const gchar* selection);
static GeeList* enotes_plugin_real_get_blacklist_members (ENotesPlugin* self);
VALA_EXTERN ENotesPlugin* enotes_plugin_construct (GType object_type);
static void enotes_plugin_finalize (GObject * obj);
static GType enotes_plugin_get_type_once (void);
VALA_EXTERN BLMember* bl_member_new (GRegex* reg,
                         const gchar* replace);
VALA_EXTERN BLMember* bl_member_construct (GType object_type,
                               GRegex* reg,
                               const gchar* replace);
static void bl_member_finalize (BLMember * obj);
static GType bl_member_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static gchar*
enotes_plugin_real_get_desctiption (ENotesPlugin* self)
{
	g_critical ("Type `%s' does not implement abstract method `enotes_plugin_get_desctiption'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
enotes_plugin_get_desctiption (ENotesPlugin* self)
{
	ENotesPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = ENOTES_PLUGIN_GET_CLASS (self);
	if (_klass_->get_desctiption) {
		return _klass_->get_desctiption (self);
	}
	return NULL;
}

static gchar*
enotes_plugin_real_get_name (ENotesPlugin* self)
{
	g_critical ("Type `%s' does not implement abstract method `enotes_plugin_get_name'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
enotes_plugin_get_name (ENotesPlugin* self)
{
	ENotesPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = ENOTES_PLUGIN_GET_CLASS (self);
	if (_klass_->get_name) {
		return _klass_->get_name (self);
	}
	return NULL;
}

static gboolean
enotes_plugin_real_has_match (ENotesPlugin* self,
                              const gchar* text)
{
	gboolean _tmp0_ = FALSE;
	g_critical ("Type `%s' does not implement abstract method `enotes_plugin_has_match'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return _tmp0_;
}

gboolean
enotes_plugin_has_match (ENotesPlugin* self,
                         const gchar* text)
{
	ENotesPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, FALSE);
	_klass_ = ENOTES_PLUGIN_GET_CLASS (self);
	if (_klass_->has_match) {
		return _klass_->has_match (self, text);
	}
	return FALSE;
}

static gchar*
enotes_plugin_real_convert (ENotesPlugin* self,
                            const gchar* line)
{
	g_critical ("Type `%s' does not implement abstract method `enotes_plugin_convert'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
enotes_plugin_convert (ENotesPlugin* self,
                       const gchar* line)
{
	ENotesPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = ENOTES_PLUGIN_GET_CLASS (self);
	if (_klass_->convert) {
		return _klass_->convert (self, line);
	}
	return NULL;
}

static GtkWidget*
enotes_plugin_real_editor_button (ENotesPlugin* self)
{
	g_critical ("Type `%s' does not implement abstract method `enotes_plugin_editor_button'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

GtkWidget*
enotes_plugin_editor_button (ENotesPlugin* self)
{
	ENotesPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = ENOTES_PLUGIN_GET_CLASS (self);
	if (_klass_->editor_button) {
		return _klass_->editor_button (self);
	}
	return NULL;
}

static gchar*
enotes_plugin_real_get_button_desctiption (ENotesPlugin* self)
{
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = enotes_plugin_get_desctiption (self);
	result = _tmp0_;
	return result;
}

gchar*
enotes_plugin_get_button_desctiption (ENotesPlugin* self)
{
	ENotesPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = ENOTES_PLUGIN_GET_CLASS (self);
	if (_klass_->get_button_desctiption) {
		return _klass_->get_button_desctiption (self);
	}
	return NULL;
}

static gchar*
enotes_plugin_real_request_string (ENotesPlugin* self,
                                   const gchar* selection)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (selection != NULL, NULL);
	_tmp0_ = g_strdup (selection);
	result = _tmp0_;
	return result;
}

gchar*
enotes_plugin_request_string (ENotesPlugin* self,
                              const gchar* selection)
{
	ENotesPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = ENOTES_PLUGIN_GET_CLASS (self);
	if (_klass_->request_string) {
		return _klass_->request_string (self, selection);
	}
	return NULL;
}

static GeeList*
enotes_plugin_real_get_blacklist_members (ENotesPlugin* self)
{
	GeeList* result;
	result = NULL;
	return result;
}

GeeList*
enotes_plugin_get_blacklist_members (ENotesPlugin* self)
{
	ENotesPluginClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = ENOTES_PLUGIN_GET_CLASS (self);
	if (_klass_->get_blacklist_members) {
		return _klass_->get_blacklist_members (self);
	}
	return NULL;
}

ENotesPlugin*
enotes_plugin_construct (GType object_type)
{
	ENotesPlugin * self = NULL;
	self = (ENotesPlugin*) g_object_new (object_type, NULL);
	return self;
}

static void
enotes_plugin_class_init (ENotesPluginClass * klass,
                          gpointer klass_data)
{
	enotes_plugin_parent_class = g_type_class_peek_parent (klass);
	((ENotesPluginClass *) klass)->get_desctiption = (gchar* (*) (ENotesPlugin*)) enotes_plugin_real_get_desctiption;
	((ENotesPluginClass *) klass)->get_name = (gchar* (*) (ENotesPlugin*)) enotes_plugin_real_get_name;
	((ENotesPluginClass *) klass)->has_match = (gboolean (*) (ENotesPlugin*, const gchar*)) enotes_plugin_real_has_match;
	((ENotesPluginClass *) klass)->convert = (gchar* (*) (ENotesPlugin*, const gchar*)) enotes_plugin_real_convert;
	((ENotesPluginClass *) klass)->editor_button = (GtkWidget* (*) (ENotesPlugin*)) enotes_plugin_real_editor_button;
	((ENotesPluginClass *) klass)->get_button_desctiption = (gchar* (*) (ENotesPlugin*)) enotes_plugin_real_get_button_desctiption;
	((ENotesPluginClass *) klass)->request_string = (gchar* (*) (ENotesPlugin*, const gchar*)) enotes_plugin_real_request_string;
	((ENotesPluginClass *) klass)->get_blacklist_members = (GeeList* (*) (ENotesPlugin*)) enotes_plugin_real_get_blacklist_members;
	G_OBJECT_CLASS (klass)->finalize = enotes_plugin_finalize;
	enotes_plugin_signals[ENOTES_PLUGIN_STRING_COOKED_SIGNAL] = g_signal_new ("string-cooked", ENOTES_TYPE_PLUGIN, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
enotes_plugin_instance_init (ENotesPlugin * self,
                             gpointer klass)
{
	gchar* _tmp0_;
	self->state = TRUE;
	_tmp0_ = g_strdup ("");
	self->code_name = _tmp0_;
}

static void
enotes_plugin_finalize (GObject * obj)
{
	ENotesPlugin * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ENOTES_TYPE_PLUGIN, ENotesPlugin);
	_g_free0 (self->code_name);
	G_OBJECT_CLASS (enotes_plugin_parent_class)->finalize (obj);
}

static GType
enotes_plugin_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ENotesPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) enotes_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ENotesPlugin), 0, (GInstanceInitFunc) enotes_plugin_instance_init, NULL };
	GType enotes_plugin_type_id;
	enotes_plugin_type_id = g_type_register_static (G_TYPE_OBJECT, "ENotesPlugin", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return enotes_plugin_type_id;
}

GType
enotes_plugin_get_type (void)
{
	static volatile gsize enotes_plugin_type_id__once = 0;
	if (g_once_init_enter (&enotes_plugin_type_id__once)) {
		GType enotes_plugin_type_id;
		enotes_plugin_type_id = enotes_plugin_get_type_once ();
		g_once_init_leave (&enotes_plugin_type_id__once, enotes_plugin_type_id);
	}
	return enotes_plugin_type_id__once;
}

static gpointer
_g_regex_ref0 (gpointer self)
{
	return self ? g_regex_ref (self) : NULL;
}

BLMember*
bl_member_construct (GType object_type,
                     GRegex* reg,
                     const gchar* replace)
{
	BLMember* self = NULL;
	GRegex* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (reg != NULL, NULL);
	g_return_val_if_fail (replace != NULL, NULL);
	self = (BLMember*) g_type_create_instance (object_type);
	_tmp0_ = _g_regex_ref0 (reg);
	_g_regex_unref0 (self->reg);
	self->reg = _tmp0_;
	_tmp1_ = g_strdup (replace);
	_g_free0 (self->replace);
	self->replace = _tmp1_;
	return self;
}

BLMember*
bl_member_new (GRegex* reg,
               const gchar* replace)
{
	return bl_member_construct (TYPE_BL_MEMBER, reg, replace);
}

static void
value_bl_member_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
value_bl_member_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		bl_member_unref (value->data[0].v_pointer);
	}
}

static void
value_bl_member_copy_value (const GValue* src_value,
                            GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = bl_member_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
value_bl_member_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
value_bl_member_collect_value (GValue* value,
                               guint n_collect_values,
                               GTypeCValue* collect_values,
                               guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		BLMember * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = bl_member_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
value_bl_member_lcopy_value (const GValue* value,
                             guint n_collect_values,
                             GTypeCValue* collect_values,
                             guint collect_flags)
{
	BLMember ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = bl_member_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
param_spec_bl_member (const gchar* name,
                      const gchar* nick,
                      const gchar* blurb,
                      GType object_type,
                      GParamFlags flags)
{
	ParamSpecBLMember* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_BL_MEMBER), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
value_get_bl_member (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BL_MEMBER), NULL);
	return value->data[0].v_pointer;
}

void
value_set_bl_member (GValue* value,
                     gpointer v_object)
{
	BLMember * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BL_MEMBER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_BL_MEMBER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		bl_member_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		bl_member_unref (old);
	}
}

void
value_take_bl_member (GValue* value,
                      gpointer v_object)
{
	BLMember * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_BL_MEMBER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_BL_MEMBER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		bl_member_unref (old);
	}
}

static void
bl_member_class_init (BLMemberClass * klass,
                      gpointer klass_data)
{
	bl_member_parent_class = g_type_class_peek_parent (klass);
	((BLMemberClass *) klass)->finalize = bl_member_finalize;
}

static void
bl_member_instance_init (BLMember * self,
                         gpointer klass)
{
	self->ref_count = 1;
}

static void
bl_member_finalize (BLMember * obj)
{
	BLMember * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_BL_MEMBER, BLMember);
	g_signal_handlers_destroy (self);
	_g_regex_unref0 (self->reg);
	_g_free0 (self->replace);
}

static GType
bl_member_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { value_bl_member_init, value_bl_member_free_value, value_bl_member_copy_value, value_bl_member_peek_pointer, "p", value_bl_member_collect_value, "p", value_bl_member_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (BLMemberClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bl_member_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BLMember), 0, (GInstanceInitFunc) bl_member_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType bl_member_type_id;
	bl_member_type_id = g_type_register_fundamental (g_type_fundamental_next (), "BLMember", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return bl_member_type_id;
}

GType
bl_member_get_type (void)
{
	static volatile gsize bl_member_type_id__once = 0;
	if (g_once_init_enter (&bl_member_type_id__once)) {
		GType bl_member_type_id;
		bl_member_type_id = bl_member_get_type_once ();
		g_once_init_leave (&bl_member_type_id__once, bl_member_type_id);
	}
	return bl_member_type_id__once;
}

gpointer
bl_member_ref (gpointer instance)
{
	BLMember * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
bl_member_unref (gpointer instance)
{
	BLMember * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		BL_MEMBER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

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

