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

#include <glib-object.h>
#include <gee.h>
#include <glib.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_ACCOUNT_HOLDER (tuba_account_holder_get_type ())
#define TUBA_ACCOUNT_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_HOLDER, TubaAccountHolder))
#define TUBA_IS_ACCOUNT_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_HOLDER))
#define TUBA_ACCOUNT_HOLDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_ACCOUNT_HOLDER, TubaAccountHolderIface))

typedef struct _TubaAccountHolder TubaAccountHolder;
typedef struct _TubaAccountHolderIface TubaAccountHolderIface;

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

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

struct _TubaAccountHolderIface {
	GTypeInterface parent_iface;
	void (*on_account_changed) (TubaAccountHolder* self, TubaInstanceAccount* acc);
	void (*on_accounts_changed) (TubaAccountHolder* self, GeeArrayList* accounts);
	TubaInstanceAccount* (*get_account) (TubaAccountHolder* self);
	void (*set_account) (TubaAccountHolder* self, TubaInstanceAccount* value);
};

VALA_EXTERN TubaAccountStore* tuba_accounts;

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_account_holder_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountHolder, g_object_unref)
VALA_EXTERN void tuba_account_holder_construct_account_holder (TubaAccountHolder* self);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN void tuba_account_holder_on_account_changed (TubaAccountHolder* self,
                                             TubaInstanceAccount* acc);
static void _tuba_account_holder_on_account_changed_tuba_account_store_switched (TubaAccountStore* _sender,
                                                                          TubaInstanceAccount* account,
                                                                          gpointer self);
VALA_EXTERN void tuba_account_holder_on_accounts_changed (TubaAccountHolder* self,
                                              GeeArrayList* accounts);
static void _tuba_account_holder_on_accounts_changed_tuba_account_store_changed (TubaAccountStore* _sender,
                                                                          GeeArrayList* accounts,
                                                                          gpointer self);
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN GeeArrayList* tuba_account_store_get_saved (TubaAccountStore* self);
VALA_EXTERN void tuba_account_holder_destruct_account_holder (TubaAccountHolder* self);
static void tuba_account_holder_real_on_account_changed (TubaAccountHolder* self,
                                                  TubaInstanceAccount* acc);
VALA_EXTERN void tuba_account_holder_set_account (TubaAccountHolder* self,
                                      TubaInstanceAccount* value);
static void tuba_account_holder_real_on_accounts_changed (TubaAccountHolder* self,
                                                   GeeArrayList* accounts);
VALA_EXTERN TubaInstanceAccount* tuba_account_holder_get_account (TubaAccountHolder* self);
static GType tuba_account_holder_get_type_once (void);

static void
_tuba_account_holder_on_account_changed_tuba_account_store_switched (TubaAccountStore* _sender,
                                                                     TubaInstanceAccount* account,
                                                                     gpointer self)
{
	tuba_account_holder_on_account_changed ((TubaAccountHolder*) self, account);
}

static void
_tuba_account_holder_on_accounts_changed_tuba_account_store_changed (TubaAccountStore* _sender,
                                                                     GeeArrayList* accounts,
                                                                     gpointer self)
{
	tuba_account_holder_on_accounts_changed ((TubaAccountHolder*) self, accounts);
}

void
tuba_account_holder_construct_account_holder (TubaAccountHolder* self)
{
	TubaAccountStore* _tmp0_;
	TubaAccountStore* _tmp1_;
	TubaAccountStore* _tmp2_;
	TubaInstanceAccount* _tmp3_;
	TubaInstanceAccount* _tmp4_;
	TubaAccountStore* _tmp5_;
	GeeArrayList* _tmp6_;
	GeeArrayList* _tmp7_;
	_tmp0_ = tuba_accounts;
	g_signal_connect_object (_tmp0_, "switched", (GCallback) _tuba_account_holder_on_account_changed_tuba_account_store_switched, self, 0);
	_tmp1_ = tuba_accounts;
	g_signal_connect_object (_tmp1_, "changed", (GCallback) _tuba_account_holder_on_accounts_changed_tuba_account_store_changed, self, 0);
	_tmp2_ = tuba_accounts;
	_tmp3_ = tuba_account_store_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	tuba_account_holder_on_account_changed (self, _tmp4_);
	_tmp5_ = tuba_accounts;
	_tmp6_ = tuba_account_store_get_saved (_tmp5_);
	_tmp7_ = _tmp6_;
	tuba_account_holder_on_accounts_changed (self, _tmp7_);
}

void
tuba_account_holder_destruct_account_holder (TubaAccountHolder* self)
{
	TubaAccountStore* _tmp0_;
	guint _tmp1_;
	TubaAccountStore* _tmp2_;
	guint _tmp3_;
	_tmp0_ = tuba_accounts;
	g_signal_parse_name ("switched", TUBA_TYPE_ACCOUNT_STORE, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _tuba_account_holder_on_account_changed_tuba_account_store_switched, self);
	_tmp2_ = tuba_accounts;
	g_signal_parse_name ("changed", TUBA_TYPE_ACCOUNT_STORE, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _tuba_account_holder_on_accounts_changed_tuba_account_store_changed, self);
}

static void
tuba_account_holder_real_on_account_changed (TubaAccountHolder* self,
                                             TubaInstanceAccount* acc)
{
	tuba_account_holder_set_account (self, acc);
}

void
tuba_account_holder_on_account_changed (TubaAccountHolder* self,
                                        TubaInstanceAccount* acc)
{
	TubaAccountHolderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = TUBA_ACCOUNT_HOLDER_GET_INTERFACE (self);
	if (_iface_->on_account_changed) {
		_iface_->on_account_changed (self, acc);
	}
}

static void
tuba_account_holder_real_on_accounts_changed (TubaAccountHolder* self,
                                              GeeArrayList* accounts)
{
	g_return_if_fail (accounts != NULL);
}

void
tuba_account_holder_on_accounts_changed (TubaAccountHolder* self,
                                         GeeArrayList* accounts)
{
	TubaAccountHolderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = TUBA_ACCOUNT_HOLDER_GET_INTERFACE (self);
	if (_iface_->on_accounts_changed) {
		_iface_->on_accounts_changed (self, accounts);
	}
}

TubaInstanceAccount*
tuba_account_holder_get_account (TubaAccountHolder* self)
{
	TubaAccountHolderIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = TUBA_ACCOUNT_HOLDER_GET_INTERFACE (self);
	if (_iface_->get_account) {
		return _iface_->get_account (self);
	}
	return NULL;
}

void
tuba_account_holder_set_account (TubaAccountHolder* self,
                                 TubaInstanceAccount* value)
{
	TubaAccountHolderIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = TUBA_ACCOUNT_HOLDER_GET_INTERFACE (self);
	if (_iface_->set_account) {
		_iface_->set_account (self, value);
	}
}

static void
tuba_account_holder_default_init (TubaAccountHolderIface * iface,
                                  gpointer iface_data)
{
	g_object_interface_install_property (iface, g_param_spec_object ("account", "account", "account", TUBA_TYPE_INSTANCE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	iface->on_account_changed = tuba_account_holder_real_on_account_changed;
	iface->on_accounts_changed = tuba_account_holder_real_on_accounts_changed;
}

 G_GNUC_NO_INLINE static GType
tuba_account_holder_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAccountHolderIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_account_holder_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType tuba_account_holder_type_id;
	tuba_account_holder_type_id = g_type_register_static (G_TYPE_INTERFACE, "TubaAccountHolder", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_interface_add_prerequisite (tuba_account_holder_type_id, G_TYPE_OBJECT);
	return tuba_account_holder_type_id;
}

GType
tuba_account_holder_get_type (void)
{
	static GType tuba_account_holder_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_account_holder_type_id__once)) {
		GType tuba_account_holder_type_id;
		tuba_account_holder_type_id = tuba_account_holder_get_type_once ();
		g_once_init_leave_pointer (&tuba_account_holder_type_id__once, tuba_account_holder_type_id);
	}
	return tuba_account_holder_type_id__once;
}

