/* Mention.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from Mention.vala, do not modify */

#include <glib-object.h>
#include <gtk/gtk.h>
#include <json-glib/json-glib.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <libsoup/soup.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 TUBA_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;
typedef struct _TubaEntityPrivate TubaEntityPrivate;

#define TUBA_API_TYPE_MENTION (tuba_api_mention_get_type ())
#define TUBA_API_MENTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_MENTION, TubaAPIMention))
#define TUBA_API_MENTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_MENTION, TubaAPIMentionClass))
#define TUBA_API_IS_MENTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_MENTION))
#define TUBA_API_IS_MENTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_MENTION))
#define TUBA_API_MENTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_MENTION, TubaAPIMentionClass))

typedef struct _TubaAPIMention TubaAPIMention;
typedef struct _TubaAPIMentionClass TubaAPIMentionClass;
typedef struct _TubaAPIMentionPrivate TubaAPIMentionPrivate;
enum  {
	TUBA_API_MENTION_0_PROPERTY,
	TUBA_API_MENTION_ID_PROPERTY,
	TUBA_API_MENTION_USERNAME_PROPERTY,
	TUBA_API_MENTION_ACCT_PROPERTY,
	TUBA_API_MENTION_URL_PROPERTY,
	TUBA_API_MENTION_HANDLE_PROPERTY,
	TUBA_API_MENTION_NUM_PROPERTIES
};
static GParamSpec* tuba_api_mention_properties[TUBA_API_MENTION_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_TYPE_REQUEST (tuba_request_get_type ())
#define TUBA_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST, TubaRequest))
#define TUBA_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST, TubaRequestClass))
#define TUBA_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST))
#define TUBA_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST))
#define TUBA_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST, TubaRequestClass))

typedef struct _TubaRequest TubaRequest;
typedef struct _TubaRequestClass TubaRequestClass;

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;
typedef void (*TubaNetworkSuccessCallback) (GInputStream* in_stream, SoupMessageHeaders* response_headers, gpointer user_data, GError** error);

#define TUBA_TYPE_NETWORK (tuba_network_get_type ())
#define TUBA_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_NETWORK, TubaNetwork))
#define TUBA_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_NETWORK, TubaNetworkClass))
#define TUBA_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_NETWORK))
#define TUBA_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_NETWORK))
#define TUBA_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_NETWORK, TubaNetworkClass))

typedef struct _TubaNetwork TubaNetwork;
typedef struct _TubaNetworkClass TubaNetworkClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _TubaWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TubaWidgetizable* self);
	void (*open) (TubaWidgetizable* self);
	void (*resolve_open) (TubaWidgetizable* self, TubaInstanceAccount* account);
};

struct _TubaEntity {
	GObject parent_instance;
	TubaEntityPrivate * priv;
};

struct _TubaEntityClass {
	GObjectClass parent_class;
	gboolean (*is_local) (TubaEntity* self, TubaInstanceAccount* account);
	GType (*deserialize_array_type) (TubaEntity* self, const gchar* prop);
};

struct _TubaAPIMention {
	TubaEntity parent_instance;
	TubaAPIMentionPrivate * priv;
};

struct _TubaAPIMentionClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIMentionPrivate {
	gchar* _id;
	gchar* _username;
	gchar* _acct;
	gchar* _url;
};

static gint TubaAPIMention_private_offset;
static gpointer tuba_api_mention_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaNetwork* tuba_network;
static TubaWidgetizableIface * tuba_api_mention_tuba_widgetizable_parent_iface = NULL;

VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN GType tuba_api_mention_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIMention, g_object_unref)
VALA_EXTERN TubaAPIMention* tuba_api_mention_new_from_account (TubaAPIAccount* account);
VALA_EXTERN TubaAPIMention* tuba_api_mention_construct_from_account (GType object_type,
                                                         TubaAPIAccount* account);
VALA_EXTERN const gchar* tuba_api_account_get_id (TubaAPIAccount* self);
VALA_EXTERN const gchar* tuba_api_account_get_username (TubaAPIAccount* self);
VALA_EXTERN const gchar* tuba_api_account_get_acct (TubaAPIAccount* self);
VALA_EXTERN const gchar* tuba_api_account_get_url (TubaAPIAccount* self);
static void tuba_api_mention_real_open (TubaWidgetizable* base);
VALA_EXTERN const gchar* tuba_api_mention_get_id (TubaAPIMention* self);
VALA_EXTERN TubaRequest* tuba_request_new_GET (const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_construct_GET (GType object_type,
                                         const gchar* url);
VALA_EXTERN GType tuba_request_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequest, g_object_unref)
VALA_EXTERN TubaRequest* tuba_request_with_account (TubaRequest* self,
                                        TubaInstanceAccount* account);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN TubaRequest* tuba_request_then (TubaRequest* self,
                                TubaNetworkSuccessCallback cb,
                                gpointer cb_target,
                                GDestroyNotify cb_target_destroy_notify);
static void __lambda31_ (TubaAPIMention* self,
                  GInputStream* in_stream,
                  GError** error);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream (GInputStream* in_stream,
                                                      GError** error);
VALA_EXTERN GType tuba_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaNetwork, g_object_unref)
VALA_EXTERN JsonNode* tuba_network_parse_node (TubaNetwork* self,
                                   JsonParser* parser);
VALA_EXTERN TubaAPIAccount* tuba_api_account_from (JsonNode* node,
                                       GError** error);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN void tuba_widgetizable_open (TubaWidgetizable* self);
static void ___lambda31__tuba_network_success_callback (GInputStream* in_stream,
                                                 SoupMessageHeaders* response_headers,
                                                 gpointer self,
                                                 GError** error);
VALA_EXTERN TubaRequest* tuba_request_exec (TubaRequest* self);
VALA_EXTERN TubaAPIMention* tuba_api_mention_new (void);
VALA_EXTERN TubaAPIMention* tuba_api_mention_construct (GType object_type);
VALA_EXTERN TubaEntity* tuba_entity_new (void);
VALA_EXTERN TubaEntity* tuba_entity_construct (GType object_type);
VALA_EXTERN void tuba_api_mention_set_id (TubaAPIMention* self,
                              const gchar* value);
VALA_EXTERN const gchar* tuba_api_mention_get_username (TubaAPIMention* self);
VALA_EXTERN void tuba_api_mention_set_username (TubaAPIMention* self,
                                    const gchar* value);
VALA_EXTERN const gchar* tuba_api_mention_get_acct (TubaAPIMention* self);
VALA_EXTERN void tuba_api_mention_set_acct (TubaAPIMention* self,
                                const gchar* value);
VALA_EXTERN const gchar* tuba_api_mention_get_url (TubaAPIMention* self);
VALA_EXTERN void tuba_api_mention_set_url (TubaAPIMention* self,
                               const gchar* value);
VALA_EXTERN gchar* tuba_api_mention_get_handle (TubaAPIMention* self);
static void tuba_api_mention_finalize (GObject * obj);
static GType tuba_api_mention_get_type_once (void);
static void _vala_tuba_api_mention_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec);
static void _vala_tuba_api_mention_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec);

static inline gpointer
tuba_api_mention_get_instance_private (TubaAPIMention* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIMention_private_offset);
}

TubaAPIMention*
tuba_api_mention_construct_from_account (GType object_type,
                                         TubaAPIAccount* account)
{
	TubaAPIMention * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	g_return_val_if_fail (account != NULL, NULL);
	_tmp0_ = tuba_api_account_get_id (account);
	_tmp1_ = _tmp0_;
	_tmp2_ = tuba_api_account_get_username (account);
	_tmp3_ = _tmp2_;
	_tmp4_ = tuba_api_account_get_acct (account);
	_tmp5_ = _tmp4_;
	_tmp6_ = tuba_api_account_get_url (account);
	_tmp7_ = _tmp6_;
	self = (TubaAPIMention*) g_object_new (object_type, "id", _tmp1_, "username", _tmp3_, "acct", _tmp5_, "url", _tmp7_, NULL);
	return self;
}

TubaAPIMention*
tuba_api_mention_new_from_account (TubaAPIAccount* account)
{
	return tuba_api_mention_construct_from_account (TUBA_API_TYPE_MENTION, account);
}

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

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static void
__lambda31_ (TubaAPIMention* self,
             GInputStream* in_stream,
             GError** error)
{
	JsonParser* parser = NULL;
	JsonParser* _tmp0_;
	JsonNode* node = NULL;
	TubaNetwork* _tmp1_;
	JsonParser* _tmp2_;
	JsonNode* _tmp3_;
	TubaAPIAccount* _tmp4_ = NULL;
	JsonNode* _tmp5_;
	TubaAPIAccount* _tmp6_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (in_stream != NULL);
	_tmp0_ = tuba_network_get_parser_from_inputstream (in_stream, &_inner_error0_);
	parser = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp1_ = tuba_network;
	_tmp2_ = parser;
	_tmp3_ = tuba_network_parse_node (_tmp1_, _tmp2_);
	node = _tmp3_;
	_tmp5_ = node;
	_tmp6_ = tuba_api_account_from (_tmp5_, &_inner_error0_);
	_tmp4_ = _tmp6_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		__vala_JsonNode_free0 (node);
		_g_object_unref0 (parser);
		return;
	}
	tuba_widgetizable_open ((TubaWidgetizable*) _tmp4_);
	_g_object_unref0 (_tmp4_);
	__vala_JsonNode_free0 (node);
	_g_object_unref0 (parser);
}

static void
___lambda31__tuba_network_success_callback (GInputStream* in_stream,
                                            SoupMessageHeaders* response_headers,
                                            gpointer self,
                                            GError** error)
{
	__lambda31_ ((TubaAPIMention*) self, in_stream, error);
}

static void
tuba_api_mention_real_open (TubaWidgetizable* base)
{
	TubaAPIMention * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	TubaRequest* _tmp4_;
	TubaRequest* _tmp5_;
	TubaAccountStore* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	TubaRequest* _tmp9_;
	TubaRequest* _tmp10_;
	TubaRequest* _tmp11_;
	TubaRequest* _tmp12_;
	TubaRequest* _tmp13_;
	TubaRequest* _tmp14_;
	self = (TubaAPIMention*) base;
	_tmp0_ = self->priv->_id;
	_tmp1_ = string_to_string (_tmp0_);
	_tmp2_ = g_strconcat ("/api/v1/accounts/", _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = tuba_request_new_GET (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = tuba_accounts;
	_tmp7_ = tuba_account_store_get_active (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = tuba_request_with_account (_tmp5_, _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = tuba_request_then (_tmp10_, ___lambda31__tuba_network_success_callback, g_object_ref (self), g_object_unref);
	_tmp12_ = _tmp11_;
	_tmp13_ = tuba_request_exec (_tmp12_);
	_tmp14_ = _tmp13_;
	_g_object_unref0 (_tmp14_);
	_g_object_unref0 (_tmp12_);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (_tmp5_);
	_g_free0 (_tmp3_);
}

TubaAPIMention*
tuba_api_mention_construct (GType object_type)
{
	TubaAPIMention * self = NULL;
	self = (TubaAPIMention*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIMention*
tuba_api_mention_new (void)
{
	return tuba_api_mention_construct (TUBA_API_TYPE_MENTION);
}

const gchar*
tuba_api_mention_get_id (TubaAPIMention* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}

void
tuba_api_mention_set_id (TubaAPIMention* self,
                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_mention_get_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_id);
		self->priv->_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_mention_properties[TUBA_API_MENTION_ID_PROPERTY]);
	}
}

const gchar*
tuba_api_mention_get_username (TubaAPIMention* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_username;
	result = _tmp0_;
	return result;
}

void
tuba_api_mention_set_username (TubaAPIMention* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_mention_get_username (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_username);
		self->priv->_username = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_mention_properties[TUBA_API_MENTION_USERNAME_PROPERTY]);
	}
}

const gchar*
tuba_api_mention_get_acct (TubaAPIMention* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_acct;
	result = _tmp0_;
	return result;
}

void
tuba_api_mention_set_acct (TubaAPIMention* self,
                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_mention_get_acct (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_acct);
		self->priv->_acct = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_mention_properties[TUBA_API_MENTION_ACCT_PROPERTY]);
	}
}

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

void
tuba_api_mention_set_url (TubaAPIMention* self,
                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_mention_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, tuba_api_mention_properties[TUBA_API_MENTION_URL_PROPERTY]);
	}
}

gchar*
tuba_api_mention_get_handle (TubaAPIMention* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_acct;
	_tmp1_ = g_strconcat ("@", _tmp0_, NULL);
	result = _tmp1_;
	return result;
}

static void
tuba_api_mention_class_init (TubaAPIMentionClass * klass,
                             gpointer klass_data)
{
	tuba_api_mention_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIMention_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_mention_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_mention_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_mention_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_MENTION_ID_PROPERTY, tuba_api_mention_properties[TUBA_API_MENTION_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_MENTION_USERNAME_PROPERTY, tuba_api_mention_properties[TUBA_API_MENTION_USERNAME_PROPERTY] = g_param_spec_string ("username", "username", "username", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_MENTION_ACCT_PROPERTY, tuba_api_mention_properties[TUBA_API_MENTION_ACCT_PROPERTY] = g_param_spec_string ("acct", "acct", "acct", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_MENTION_URL_PROPERTY, tuba_api_mention_properties[TUBA_API_MENTION_URL_PROPERTY] = g_param_spec_string ("url", "url", "url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_MENTION_HANDLE_PROPERTY, tuba_api_mention_properties[TUBA_API_MENTION_HANDLE_PROPERTY] = g_param_spec_string ("handle", "handle", "handle", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tuba_api_mention_tuba_widgetizable_interface_init (TubaWidgetizableIface * iface,
                                                   gpointer iface_data)
{
	tuba_api_mention_tuba_widgetizable_parent_iface = g_type_interface_peek_parent (iface);
	iface->open = (void (*) (TubaWidgetizable*)) tuba_api_mention_real_open;
}

static void
tuba_api_mention_instance_init (TubaAPIMention * self,
                                gpointer klass)
{
	self->priv = tuba_api_mention_get_instance_private (self);
}

static void
tuba_api_mention_finalize (GObject * obj)
{
	TubaAPIMention * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_TYPE_MENTION, TubaAPIMention);
	_g_free0 (self->priv->_id);
	_g_free0 (self->priv->_username);
	_g_free0 (self->priv->_acct);
	_g_free0 (self->priv->_url);
	G_OBJECT_CLASS (tuba_api_mention_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_mention_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIMentionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_mention_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIMention), 0, (GInstanceInitFunc) tuba_api_mention_instance_init, NULL };
	static const GInterfaceInfo tuba_widgetizable_info = { (GInterfaceInitFunc) tuba_api_mention_tuba_widgetizable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_api_mention_type_id;
	tuba_api_mention_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIMention", &g_define_type_info, 0);
	g_type_add_interface_static (tuba_api_mention_type_id, TUBA_TYPE_WIDGETIZABLE, &tuba_widgetizable_info);
	TubaAPIMention_private_offset = g_type_add_instance_private (tuba_api_mention_type_id, sizeof (TubaAPIMentionPrivate));
	return tuba_api_mention_type_id;
}

GType
tuba_api_mention_get_type (void)
{
	static gsize tuba_api_mention_type_id__once = 0;
	if (g_once_init_enter (&tuba_api_mention_type_id__once)) {
		GType tuba_api_mention_type_id;
		tuba_api_mention_type_id = tuba_api_mention_get_type_once ();
		g_once_init_leave (&tuba_api_mention_type_id__once, tuba_api_mention_type_id);
	}
	return tuba_api_mention_type_id__once;
}

static void
_vala_tuba_api_mention_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec)
{
	TubaAPIMention * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_MENTION, TubaAPIMention);
	switch (property_id) {
		case TUBA_API_MENTION_ID_PROPERTY:
		g_value_set_string (value, tuba_api_mention_get_id (self));
		break;
		case TUBA_API_MENTION_USERNAME_PROPERTY:
		g_value_set_string (value, tuba_api_mention_get_username (self));
		break;
		case TUBA_API_MENTION_ACCT_PROPERTY:
		g_value_set_string (value, tuba_api_mention_get_acct (self));
		break;
		case TUBA_API_MENTION_URL_PROPERTY:
		g_value_set_string (value, tuba_api_mention_get_url (self));
		break;
		case TUBA_API_MENTION_HANDLE_PROPERTY:
		g_value_take_string (value, tuba_api_mention_get_handle (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_mention_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec)
{
	TubaAPIMention * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_MENTION, TubaAPIMention);
	switch (property_id) {
		case TUBA_API_MENTION_ID_PROPERTY:
		tuba_api_mention_set_id (self, g_value_get_string (value));
		break;
		case TUBA_API_MENTION_USERNAME_PROPERTY:
		tuba_api_mention_set_username (self, g_value_get_string (value));
		break;
		case TUBA_API_MENTION_ACCT_PROPERTY:
		tuba_api_mention_set_acct (self, g_value_get_string (value));
		break;
		case TUBA_API_MENTION_URL_PROPERTY:
		tuba_api_mention_set_url (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

