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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <json-glib/json-glib.h>
#include <stdlib.h>
#include <string.h>
#include <libsoup/soup.h>

#define TOOTLE_TYPE_WIDGETIZABLE (tootle_widgetizable_get_type ())
#define TOOTLE_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_WIDGETIZABLE, TootleWidgetizable))
#define TOOTLE_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_WIDGETIZABLE))
#define TOOTLE_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TOOTLE_TYPE_WIDGETIZABLE, TootleWidgetizableIface))

typedef struct _TootleWidgetizable TootleWidgetizable;
typedef struct _TootleWidgetizableIface TootleWidgetizableIface;

#define TOOTLE_TYPE_ENTITY (tootle_entity_get_type ())
#define TOOTLE_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ENTITY, TootleEntity))
#define TOOTLE_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_ENTITY, TootleEntityClass))
#define TOOTLE_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ENTITY))
#define TOOTLE_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_ENTITY))
#define TOOTLE_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_ENTITY, TootleEntityClass))

typedef struct _TootleEntity TootleEntity;
typedef struct _TootleEntityClass TootleEntityClass;

#define TOOTLE_API_TYPE_ACCOUNT (tootle_api_account_get_type ())
#define TOOTLE_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccount))
#define TOOTLE_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))
#define TOOTLE_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))

typedef struct _TootleAPIAccount TootleAPIAccount;
typedef struct _TootleAPIAccountClass TootleAPIAccountClass;

#define TOOTLE_TYPE_INSTANCE_ACCOUNT (tootle_instance_account_get_type ())
#define TOOTLE_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccount))
#define TOOTLE_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))
#define TOOTLE_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))

typedef struct _TootleInstanceAccount TootleInstanceAccount;
typedef struct _TootleInstanceAccountClass TootleInstanceAccountClass;
typedef struct _TootleEntityPrivate TootleEntityPrivate;

#define TOOTLE_API_TYPE_TAG (tootle_api_tag_get_type ())
#define TOOTLE_API_TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_TAG, TootleAPITag))
#define TOOTLE_API_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_TAG, TootleAPITagClass))
#define TOOTLE_API_IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_TAG))
#define TOOTLE_API_IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_TAG))
#define TOOTLE_API_TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_TAG, TootleAPITagClass))

typedef struct _TootleAPITag TootleAPITag;
typedef struct _TootleAPITagClass TootleAPITagClass;
typedef struct _TootleAPITagPrivate TootleAPITagPrivate;
enum  {
	TOOTLE_API_TAG_0_PROPERTY,
	TOOTLE_API_TAG_NAME_PROPERTY,
	TOOTLE_API_TAG_URL_PROPERTY,
	TOOTLE_API_TAG_NUM_PROPERTIES
};
static GParamSpec* tootle_api_tag_properties[TOOTLE_API_TAG_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TOOTLE_WIDGETS_TYPE_RICH_LABEL (tootle_widgets_rich_label_get_type ())
#define TOOTLE_WIDGETS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_RICH_LABEL, TootleWidgetsRichLabel))
#define TOOTLE_WIDGETS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_RICH_LABEL, TootleWidgetsRichLabelClass))
#define TOOTLE_WIDGETS_IS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_RICH_LABEL))
#define TOOTLE_WIDGETS_IS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_RICH_LABEL))
#define TOOTLE_WIDGETS_RICH_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_RICH_LABEL, TootleWidgetsRichLabelClass))

typedef struct _TootleWidgetsRichLabel TootleWidgetsRichLabel;
typedef struct _TootleWidgetsRichLabelClass TootleWidgetsRichLabelClass;

#define TOOTLE_TYPE_ACCOUNTS (tootle_accounts_get_type ())
#define TOOTLE_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ACCOUNTS, TootleAccounts))
#define TOOTLE_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_ACCOUNTS, TootleAccountsClass))
#define TOOTLE_IS_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ACCOUNTS))
#define TOOTLE_IS_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_ACCOUNTS))
#define TOOTLE_ACCOUNTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_ACCOUNTS, TootleAccountsClass))

typedef struct _TootleAccounts TootleAccounts;
typedef struct _TootleAccountsClass TootleAccountsClass;

typedef enum  {
	TOOTLE_OOPSIE_USER,
	TOOTLE_OOPSIE_PARSING,
	TOOTLE_OOPSIE_INSTANCE,
	TOOTLE_OOPSIE_INTERNAL
} TootleOopsie;
#define TOOTLE_OOPSIE tootle_oopsie_quark ()
struct _TootleWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TootleWidgetizable* self, GError** error);
	void (*open) (TootleWidgetizable* self);
	void (*resolve_open) (TootleWidgetizable* self, TootleInstanceAccount* account);
};

struct _TootleEntity {
	GObject parent_instance;
	TootleEntityPrivate * priv;
};

struct _TootleEntityClass {
	GObjectClass parent_class;
	gboolean (*is_local) (TootleEntity* self, TootleInstanceAccount* account);
};

struct _TootleAPITag {
	TootleEntity parent_instance;
	TootleAPITagPrivate * priv;
};

struct _TootleAPITagClass {
	TootleEntityClass parent_class;
};

struct _TootleAPITagPrivate {
	gchar* _name;
	gchar* _url;
};

static gint TootleAPITag_private_offset;
static gpointer tootle_api_tag_parent_class = NULL;
extern TootleAccounts* tootle_accounts;
static TootleWidgetizableIface * tootle_api_tag_tootle_widgetizable_parent_iface = NULL;

GQuark tootle_oopsie_quark (void);
GType tootle_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleEntity, g_object_unref)
GType tootle_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIAccount, g_object_unref)
GType tootle_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleInstanceAccount, g_object_unref)
GType tootle_widgetizable_get_type (void) G_GNUC_CONST ;
GType tootle_api_tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPITag, g_object_unref)
TootleAPITag* tootle_api_tag_from (JsonNode* node,
                                   GError** error);
TootleEntity* tootle_entity_from_json (GType type,
                                       JsonNode* node,
                                       GError** error);
static GtkWidget* tootle_api_tag_real_to_widget (TootleWidgetizable* base,
                                          GError** error);
const gchar* tootle_api_tag_get_name (TootleAPITag* self);
GType tootle_widgets_rich_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsRichLabel, g_object_unref)
GType tootle_accounts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAccounts, g_object_unref)
TootleInstanceAccount* tootle_accounts_get_active (TootleAccounts* self);
const gchar* tootle_instance_account_get_instance (TootleInstanceAccount* self);
TootleWidgetsRichLabel* tootle_widgets_rich_label_new (const gchar* text);
TootleWidgetsRichLabel* tootle_widgets_rich_label_construct (GType object_type,
                                                             const gchar* text);
TootleAPITag* tootle_api_tag_new (void);
TootleAPITag* tootle_api_tag_construct (GType object_type);
TootleEntity* tootle_entity_new (void);
TootleEntity* tootle_entity_construct (GType object_type);
void tootle_api_tag_set_name (TootleAPITag* self,
                              const gchar* value);
const gchar* tootle_api_tag_get_url (TootleAPITag* self);
void tootle_api_tag_set_url (TootleAPITag* self,
                             const gchar* value);
GtkWidget* tootle_widgetizable_to_widget (TootleWidgetizable* self,
                                          GError** error);
static void tootle_api_tag_finalize (GObject * obj);
static GType tootle_api_tag_get_type_once (void);
static void _vala_tootle_api_tag_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_tootle_api_tag_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
tootle_api_tag_get_instance_private (TootleAPITag* self)
{
	return G_STRUCT_MEMBER_P (self, TootleAPITag_private_offset);
}

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

TootleAPITag*
tootle_api_tag_from (JsonNode* node,
                     GError** error)
{
	TootleEntity* _tmp0_ = NULL;
	TootleEntity* _tmp1_;
	TootleAPITag* _tmp2_;
	GError* _inner_error0_ = NULL;
	TootleAPITag* result = NULL;
	g_return_val_if_fail (node != NULL, NULL);
	_tmp1_ = tootle_entity_from_json (TOOTLE_API_TYPE_TAG, node, &_inner_error0_);
	_tmp0_ = _tmp1_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	}
	_tmp2_ = _g_object_ref0 (TOOTLE_API_IS_TAG (_tmp0_) ? ((TootleAPITag*) _tmp0_) : NULL);
	result = _tmp2_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static GtkWidget*
tootle_api_tag_real_to_widget (TootleWidgetizable* base,
                               GError** error)
{
	TootleAPITag * self;
	gchar* encoded = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	TootleWidgetsRichLabel* w = NULL;
	TootleAccounts* _tmp2_;
	TootleInstanceAccount* _tmp3_;
	TootleInstanceAccount* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	TootleWidgetsRichLabel* _tmp13_;
	TootleWidgetsRichLabel* _tmp14_;
	GtkWidget* result = NULL;
	self = (TootleAPITag*) base;
	_tmp0_ = self->priv->_name;
	_tmp1_ = soup_uri_encode (_tmp0_, NULL);
	encoded = _tmp1_;
	_tmp2_ = tootle_accounts;
	_tmp3_ = tootle_accounts_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = tootle_instance_account_get_instance (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = string_to_string (_tmp6_);
	_tmp8_ = string_to_string (encoded);
	_tmp9_ = self->priv->_name;
	_tmp10_ = string_to_string (_tmp9_);
	_tmp11_ = g_strconcat ("<a href=\"", _tmp7_, "/tags/", _tmp8_, "\">#", _tmp10_, "</a>", NULL);
	_tmp12_ = _tmp11_;
	_tmp13_ = tootle_widgets_rich_label_new (_tmp12_);
	g_object_ref_sink (_tmp13_);
	_tmp14_ = _tmp13_;
	_g_free0 (_tmp12_);
	w = _tmp14_;
	gtk_label_set_use_markup ((GtkLabel*) w, TRUE);
	gtk_widget_set_halign ((GtkWidget*) w, GTK_ALIGN_START);
	g_object_set ((GtkWidget*) w, "margin", 8, NULL);
	gtk_widget_show ((GtkWidget*) w);
	result = (GtkWidget*) w;
	_g_free0 (encoded);
	return result;
}

TootleAPITag*
tootle_api_tag_construct (GType object_type)
{
	TootleAPITag * self = NULL;
	self = (TootleAPITag*) tootle_entity_construct (object_type);
	return self;
}

TootleAPITag*
tootle_api_tag_new (void)
{
	return tootle_api_tag_construct (TOOTLE_API_TYPE_TAG);
}

const gchar*
tootle_api_tag_get_name (TootleAPITag* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

void
tootle_api_tag_set_name (TootleAPITag* self,
                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_tag_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_tag_properties[TOOTLE_API_TAG_NAME_PROPERTY]);
	}
}

const gchar*
tootle_api_tag_get_url (TootleAPITag* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url;
	result = _tmp0_;
	return result;
}

void
tootle_api_tag_set_url (TootleAPITag* self,
                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_tag_get_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_url);
		self->priv->_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_tag_properties[TOOTLE_API_TAG_URL_PROPERTY]);
	}
}

static void
tootle_api_tag_class_init (TootleAPITagClass * klass,
                           gpointer klass_data)
{
	tootle_api_tag_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TootleAPITag_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tootle_api_tag_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tootle_api_tag_set_property;
	G_OBJECT_CLASS (klass)->finalize = tootle_api_tag_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_TAG_NAME_PROPERTY, tootle_api_tag_properties[TOOTLE_API_TAG_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_TAG_URL_PROPERTY, tootle_api_tag_properties[TOOTLE_API_TAG_URL_PROPERTY] = g_param_spec_string ("url", "url", "url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tootle_api_tag_tootle_widgetizable_interface_init (TootleWidgetizableIface * iface,
                                                   gpointer iface_data)
{
	tootle_api_tag_tootle_widgetizable_parent_iface = g_type_interface_peek_parent (iface);
	iface->to_widget = (GtkWidget* (*) (TootleWidgetizable*, GError**)) tootle_api_tag_real_to_widget;
}

static void
tootle_api_tag_instance_init (TootleAPITag * self,
                              gpointer klass)
{
	self->priv = tootle_api_tag_get_instance_private (self);
}

static void
tootle_api_tag_finalize (GObject * obj)
{
	TootleAPITag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_API_TYPE_TAG, TootleAPITag);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_url);
	G_OBJECT_CLASS (tootle_api_tag_parent_class)->finalize (obj);
}

static GType
tootle_api_tag_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TootleAPITagClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tootle_api_tag_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TootleAPITag), 0, (GInstanceInitFunc) tootle_api_tag_instance_init, NULL };
	static const GInterfaceInfo tootle_widgetizable_info = { (GInterfaceInitFunc) tootle_api_tag_tootle_widgetizable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tootle_api_tag_type_id;
	tootle_api_tag_type_id = g_type_register_static (TOOTLE_TYPE_ENTITY, "TootleAPITag", &g_define_type_info, 0);
	g_type_add_interface_static (tootle_api_tag_type_id, TOOTLE_TYPE_WIDGETIZABLE, &tootle_widgetizable_info);
	TootleAPITag_private_offset = g_type_add_instance_private (tootle_api_tag_type_id, sizeof (TootleAPITagPrivate));
	return tootle_api_tag_type_id;
}

GType
tootle_api_tag_get_type (void)
{
	static volatile gsize tootle_api_tag_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_api_tag_type_id__volatile)) {
		GType tootle_api_tag_type_id;
		tootle_api_tag_type_id = tootle_api_tag_get_type_once ();
		g_once_init_leave (&tootle_api_tag_type_id__volatile, tootle_api_tag_type_id);
	}
	return tootle_api_tag_type_id__volatile;
}

static void
_vala_tootle_api_tag_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	TootleAPITag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_API_TYPE_TAG, TootleAPITag);
	switch (property_id) {
		case TOOTLE_API_TAG_NAME_PROPERTY:
		g_value_set_string (value, tootle_api_tag_get_name (self));
		break;
		case TOOTLE_API_TAG_URL_PROPERTY:
		g_value_set_string (value, tootle_api_tag_get_url (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tootle_api_tag_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	TootleAPITag * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_API_TYPE_TAG, TootleAPITag);
	switch (property_id) {
		case TOOTLE_API_TAG_NAME_PROPERTY:
		tootle_api_tag_set_name (self, g_value_get_string (value));
		break;
		case TOOTLE_API_TAG_URL_PROPERTY:
		tootle_api_tag_set_url (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

