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

#include <glib-object.h>
#include <gtksourceview/gtksource.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <libsoup/soup.h>
#include <json-glib/json-glib.h>
#include <adwaita.h>
#include <gdk/gdk.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_COMPLETION_PROVIDER (tuba_completion_provider_get_type ())
#define TUBA_COMPLETION_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_COMPLETION_PROVIDER, TubaCompletionProvider))
#define TUBA_COMPLETION_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_COMPLETION_PROVIDER, TubaCompletionProviderClass))
#define TUBA_IS_COMPLETION_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_COMPLETION_PROVIDER))
#define TUBA_IS_COMPLETION_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_COMPLETION_PROVIDER))
#define TUBA_COMPLETION_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_COMPLETION_PROVIDER, TubaCompletionProviderClass))

typedef struct _TubaCompletionProvider TubaCompletionProvider;
typedef struct _TubaCompletionProviderClass TubaCompletionProviderClass;
typedef struct _TubaCompletionProviderPrivate TubaCompletionProviderPrivate;

#define TUBA_TYPE_HANDLE_PROVIDER (tuba_handle_provider_get_type ())
#define TUBA_HANDLE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_HANDLE_PROVIDER, TubaHandleProvider))
#define TUBA_HANDLE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_HANDLE_PROVIDER, TubaHandleProviderClass))
#define TUBA_IS_HANDLE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_HANDLE_PROVIDER))
#define TUBA_IS_HANDLE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_HANDLE_PROVIDER))
#define TUBA_HANDLE_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_HANDLE_PROVIDER, TubaHandleProviderClass))

typedef struct _TubaHandleProvider TubaHandleProvider;
typedef struct _TubaHandleProviderClass TubaHandleProviderClass;
typedef struct _TubaHandleProviderPrivate TubaHandleProviderPrivate;
enum  {
	TUBA_HANDLE_PROVIDER_0_PROPERTY,
	TUBA_HANDLE_PROVIDER_NUM_PROPERTIES
};
static GParamSpec* tuba_handle_provider_properties[TUBA_HANDLE_PROVIDER_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)))
typedef struct _Block45Data Block45Data;

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;

#define TUBA_TYPE_OOPSIE (tuba_oopsie_get_type ())
typedef void (*TubaNetworkNodeCallback) (JsonNode* node, gpointer user_data, GError** error);

#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_HANDLE_PROVIDER_TYPE_PROPOSAL (tuba_handle_provider_proposal_get_type ())
#define TUBA_HANDLE_PROVIDER_PROPOSAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_HANDLE_PROVIDER_TYPE_PROPOSAL, TubaHandleProviderProposal))
#define TUBA_HANDLE_PROVIDER_PROPOSAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_HANDLE_PROVIDER_TYPE_PROPOSAL, TubaHandleProviderProposalClass))
#define TUBA_HANDLE_PROVIDER_IS_PROPOSAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_HANDLE_PROVIDER_TYPE_PROPOSAL))
#define TUBA_HANDLE_PROVIDER_IS_PROPOSAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_HANDLE_PROVIDER_TYPE_PROPOSAL))
#define TUBA_HANDLE_PROVIDER_PROPOSAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_HANDLE_PROVIDER_TYPE_PROPOSAL, TubaHandleProviderProposalClass))

typedef struct _TubaHandleProviderProposal TubaHandleProviderProposal;
typedef struct _TubaHandleProviderProposalClass TubaHandleProviderProposalClass;
typedef struct _TubaHandleProviderSuggestData TubaHandleProviderSuggestData;
typedef struct _Block46Data Block46Data;
typedef void (*TubaHelperImageOnItemChangedFn) (GdkPaintable* data, gpointer user_data);
typedef struct _TubaHandleProviderProposalPrivate TubaHandleProviderProposalPrivate;
enum  {
	TUBA_HANDLE_PROVIDER_PROPOSAL_0_PROPERTY,
	TUBA_HANDLE_PROVIDER_PROPOSAL_ACCOUNT_PROPERTY,
	TUBA_HANDLE_PROVIDER_PROPOSAL_NUM_PROPERTIES
};
static GParamSpec* tuba_handle_provider_proposal_properties[TUBA_HANDLE_PROVIDER_PROPOSAL_NUM_PROPERTIES];

struct _TubaCompletionProvider {
	GObject parent_instance;
	TubaCompletionProviderPrivate * priv;
};

struct _TubaCompletionProviderClass {
	GObjectClass parent_class;
	gboolean (*is_trigger) (TubaCompletionProvider* self, GtkTextIter* iter, gunichar ch);
	void (*refilter) (TubaCompletionProvider* self, GtkSourceCompletionContext* context, GListModel* model);
	void (*activate) (TubaCompletionProvider* self, GtkSourceCompletionContext* context, GtkSourceCompletionProposal* proposal);
	void (*display) (TubaCompletionProvider* self, GtkSourceCompletionContext* context, GtkSourceCompletionProposal* proposal, GtkSourceCompletionCell* cell);
	void (*suggest) (TubaCompletionProvider* self, const gchar* word, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GListModel* (*suggest_finish) (TubaCompletionProvider* self, GAsyncResult* _res_, GError** error);
	gboolean (*word_stop) (TubaCompletionProvider* self, gunichar ch);
	gchar* (*get_formatted_text) (TubaCompletionProvider* self, GtkSourceCompletionProposal* proposal);
};

struct _TubaHandleProvider {
	TubaCompletionProvider parent_instance;
	TubaHandleProviderPrivate * priv;
};

struct _TubaHandleProviderClass {
	TubaCompletionProviderClass parent_class;
};

struct _Block45Data {
	int _ref_count_;
	TubaHandleProvider* self;
	GListStore* results;
	gpointer _async_data_;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaHandleProviderSuggestData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaHandleProvider* self;
	gchar* word;
	GCancellable* cancellable;
	GListModel* result;
	Block45Data* _data45_;
	gchar* handle;
	gchar* _tmp0_;
	GListStore* _tmp1_;
	const gchar* _tmp2_;
	GListStore* _tmp3_;
	GListModel* _tmp4_;
	TubaRequestV2* req;
	const gchar* _tmp5_;
	TubaRequestV2* _tmp6_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp7_;
	GInputStream* _tmp8_;
	JsonParser* parser;
	GInputStream* _tmp9_;
	JsonParser* _tmp10_;
	JsonParser* _tmp11_;
	GListStore* _tmp12_;
	GListModel* _tmp13_;
	GError* _inner_error0_;
};

struct _Block46Data {
	int _ref_count_;
	TubaHandleProvider* self;
	AdwAvatar* avatar;
};

struct _TubaHandleProviderProposal {
	GObject parent_instance;
	TubaHandleProviderProposalPrivate * priv;
};

struct _TubaHandleProviderProposalClass {
	GObjectClass parent_class;
};

struct _TubaHandleProviderProposalPrivate {
	TubaAPIAccount* _account;
};

static gpointer tuba_handle_provider_parent_class = NULL;
static gint TubaHandleProviderProposal_private_offset;
static gpointer tuba_handle_provider_proposal_parent_class = NULL;
static GtkSourceCompletionProposalInterface * tuba_handle_provider_proposal_gtk_source_completion_proposal_parent_iface = NULL;

VALA_EXTERN GType tuba_completion_provider_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaCompletionProvider, g_object_unref)
VALA_EXTERN GType tuba_handle_provider_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaHandleProvider, g_object_unref)
VALA_EXTERN void tuba_completion_provider_suggest (TubaCompletionProvider* self,
                                       const gchar* word,
                                       GCancellable* cancellable,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN GListModel* tuba_completion_provider_suggest_finish (TubaCompletionProvider* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
VALA_EXTERN void tuba_completion_provider_display (TubaCompletionProvider* self,
                                       GtkSourceCompletionContext* context,
                                       GtkSourceCompletionProposal* proposal,
                                       GtkSourceCompletionCell* cell);
VALA_EXTERN gboolean tuba_completion_provider_word_stop (TubaCompletionProvider* self,
                                             gunichar ch);
VALA_EXTERN TubaHandleProvider* tuba_handle_provider_new (void);
VALA_EXTERN TubaHandleProvider* tuba_handle_provider_construct (GType object_type);
static void tuba_handle_provider_real_suggest_data_free (gpointer _data);
static void tuba_handle_provider_real_suggest (TubaCompletionProvider* base,
                                        const gchar* word,
                                        GCancellable* cancellable,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
static gboolean tuba_handle_provider_real_suggest_co (TubaHandleProviderSuggestData* _data_);
static Block45Data* block45_data_ref (Block45Data* _data45_);
static void block45_data_unref (void * _userdata_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN TubaRequestV2* tuba_api_account_search (const gchar* query,
                                        GError** error);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_handle_provider_suggest_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
VALA_EXTERN void tuba_network_get_parser_from_inputstream_async (GInputStream* in_stream,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream_finish (GAsyncResult* _res_,
                                                             GError** error);
VALA_EXTERN void tuba_network_parse_array (JsonParser* parser,
                               TubaNetworkNodeCallback cb,
                               gpointer cb_target,
                               GDestroyNotify cb_target_destroy_notify,
                               GError** error);
static void __lambda67_ (Block45Data* _data45_,
                  JsonNode* node,
                  GError** error);
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN TubaEntity* tuba_helper_entity_from_json (JsonNode* node,
                                          GType type,
                                          gboolean force);
static JsonNode* _vala_JsonNode_copy (JsonNode* self);
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_handle_provider_proposal_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaHandleProviderProposal, g_object_unref)
VALA_EXTERN TubaHandleProviderProposal* tuba_handle_provider_proposal_new (TubaAPIAccount* entity);
VALA_EXTERN TubaHandleProviderProposal* tuba_handle_provider_proposal_construct (GType object_type,
                                                                     TubaAPIAccount* entity);
static void ___lambda67__tuba_network_node_callback (JsonNode* node,
                                              gpointer self,
                                              GError** error);
static void tuba_handle_provider_real_display (TubaCompletionProvider* base,
                                        GtkSourceCompletionContext* context,
                                        GtkSourceCompletionProposal* proposal,
                                        GtkSourceCompletionCell* cell);
VALA_EXTERN TubaAPIAccount* tuba_handle_provider_proposal_get_account (TubaHandleProviderProposal* self);
static Block46Data* block46_data_ref (Block46Data* _data46_);
static void block46_data_unref (void * _userdata_);
VALA_EXTERN const gchar* tuba_api_account_get_display_name (TubaAPIAccount* self);
VALA_EXTERN void tuba_helper_image_request_paintable (const gchar* url,
                                          const gchar* blurhash,
                                          gboolean disable_cache,
                                          TubaHelperImageOnItemChangedFn cb,
                                          gpointer cb_target,
                                          GDestroyNotify cb_target_destroy_notify,
                                          GCancellable* cancellable);
VALA_EXTERN const gchar* tuba_api_account_get_avatar (TubaAPIAccount* self);
static void ___lambda68_ (Block46Data* _data46_,
                   GdkPaintable* paintable);
static void ____lambda68__tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                         gpointer self);
VALA_EXTERN gchar* tuba_api_account_get_handle (TubaAPIAccount* self);
static gboolean tuba_handle_provider_real_word_stop (TubaCompletionProvider* base,
                                              gunichar ch);
VALA_EXTERN gunichar tuba_completion_provider_get_trigger_char (TubaCompletionProvider* self);
static gchar* tuba_handle_provider_proposal_real_get_typed_text (GtkSourceCompletionProposal* base);
static void tuba_handle_provider_proposal_set_account (TubaHandleProviderProposal* self,
                                                TubaAPIAccount* value);
static void tuba_handle_provider_proposal_finalize (GObject * obj);
static GType tuba_handle_provider_proposal_get_type_once (void);
static void _vala_tuba_handle_provider_proposal_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_tuba_handle_provider_proposal_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec);
static GType tuba_handle_provider_get_type_once (void);

TubaHandleProvider*
tuba_handle_provider_construct (GType object_type)
{
	TubaHandleProvider * self = NULL;
	self = (TubaHandleProvider*) g_object_new (object_type, "trigger-char", '@', NULL);
	return self;
}

TubaHandleProvider*
tuba_handle_provider_new (void)
{
	return tuba_handle_provider_construct (TUBA_TYPE_HANDLE_PROVIDER);
}

static void
tuba_handle_provider_real_suggest_data_free (gpointer _data)
{
	TubaHandleProviderSuggestData* _data_;
	_data_ = _data;
	_g_free0 (_data_->word);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaHandleProviderSuggestData, _data_);
}

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

static void
tuba_handle_provider_real_suggest (TubaCompletionProvider* base,
                                   const gchar* word,
                                   GCancellable* cancellable,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	TubaHandleProvider * self;
	TubaHandleProviderSuggestData* _data_;
	TubaHandleProvider* _tmp0_;
	gchar* _tmp1_;
	GCancellable* _tmp2_;
	g_return_if_fail (word != NULL);
	self = (TubaHandleProvider*) base;
	_data_ = g_slice_new0 (TubaHandleProviderSuggestData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_handle_provider_real_suggest_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (word);
	_g_free0 (_data_->word);
	_data_->word = _tmp1_;
	_tmp2_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp2_;
	tuba_handle_provider_real_suggest_co (_data_);
}

static GListModel*
tuba_handle_provider_suggest_finish (TubaCompletionProvider* base,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	GListModel* result;
	TubaHandleProviderSuggestData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block45Data*
block45_data_ref (Block45Data* _data45_)
{
	g_atomic_int_inc (&_data45_->_ref_count_);
	return _data45_;
}

static void
block45_data_unref (void * _userdata_)
{
	Block45Data* _data45_;
	_data45_ = (Block45Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data45_->_ref_count_)) {
		TubaHandleProvider* self;
		self = _data45_->self;
		_g_object_unref0 (_data45_->results);
		_g_object_unref0 (self);
		g_slice_free (Block45Data, _data45_);
	}
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static void
tuba_handle_provider_suggest_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	TubaHandleProviderSuggestData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_handle_provider_real_suggest_co (_data_);
}

static JsonNode*
_vala_JsonNode_copy (JsonNode* self)
{
	return g_boxed_copy (json_node_get_type (), self);
}

static gpointer
__vala_JsonNode_copy0 (gpointer self)
{
	return self ? _vala_JsonNode_copy (self) : NULL;
}

static void
__lambda67_ (Block45Data* _data45_,
             JsonNode* node,
             GError** error)
{
	TubaHandleProvider* self;
	TubaEntity* entity = NULL;
	JsonNode* _tmp0_;
	TubaEntity* _tmp1_;
	TubaEntity* _tmp2_;
	self = _data45_->self;
	g_return_if_fail (node != NULL);
	_tmp0_ = __vala_JsonNode_copy0 (node);
	_tmp1_ = tuba_helper_entity_from_json (_tmp0_, TUBA_API_TYPE_ACCOUNT, FALSE);
	entity = _tmp1_;
	_tmp2_ = entity;
	if (TUBA_API_IS_ACCOUNT (_tmp2_)) {
		TubaHandleProviderProposal* proposal = NULL;
		TubaEntity* _tmp3_;
		TubaHandleProviderProposal* _tmp4_;
		GListStore* _tmp5_;
		TubaHandleProviderProposal* _tmp6_;
		_tmp3_ = entity;
		_tmp4_ = tuba_handle_provider_proposal_new (TUBA_API_IS_ACCOUNT (_tmp3_) ? ((TubaAPIAccount*) _tmp3_) : NULL);
		proposal = _tmp4_;
		_tmp5_ = _data45_->results;
		_tmp6_ = proposal;
		g_list_store_append (_tmp5_, (GObject*) _tmp6_);
		_g_object_unref0 (proposal);
	}
	_g_object_unref0 (entity);
}

static void
___lambda67__tuba_network_node_callback (JsonNode* node,
                                         gpointer self,
                                         GError** error)
{
	__lambda67_ (self, node, error);
}

static gboolean
tuba_handle_provider_real_suggest_co (TubaHandleProviderSuggestData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data45_ = g_slice_new0 (Block45Data);
	_data_->_data45_->_ref_count_ = 1;
	_data_->_data45_->self = g_object_ref (_data_->self);
	_data_->_data45_->_async_data_ = _data_;
	_data_->_tmp0_ = string_substring (_data_->word, (glong) 1, (glong) -1);
	_data_->handle = _data_->_tmp0_;
	_data_->_tmp1_ = g_list_store_new (G_TYPE_OBJECT);
	_data_->_data45_->results = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->handle;
	if (g_strcmp0 (_data_->_tmp2_, "") == 0) {
		_data_->_tmp3_ = _data_->_data45_->results;
		_data_->_tmp4_ = _g_object_ref0 ((GListModel*) _data_->_tmp3_);
		_data_->result = _data_->_tmp4_;
		_g_free0 (_data_->handle);
		block45_data_unref (_data_->_data45_);
		_data_->_data45_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _data_->handle;
	_data_->_tmp6_ = tuba_api_account_search (_data_->_tmp5_, &_data_->_inner_error0_);
	_data_->req = _data_->_tmp6_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_free0 (_data_->handle);
		block45_data_unref (_data_->_data45_);
		_data_->_data45_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->req;
	_data_->_state_ = 1;
	tuba_request_v2_exec (_data_->_tmp7_, tuba_handle_provider_suggest_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = tuba_request_v2_exec_finish (_data_->_tmp7_, _data_->_res_, NULL, &_data_->_inner_error0_);
	_data_->in_stream = _data_->_tmp8_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->req);
		_g_free0 (_data_->handle);
		block45_data_unref (_data_->_data45_);
		_data_->_data45_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = _data_->in_stream;
	_data_->_state_ = 2;
	tuba_network_get_parser_from_inputstream_async (_data_->_tmp9_, NULL, tuba_handle_provider_suggest_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp10_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
	_data_->parser = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->req);
		_g_free0 (_data_->handle);
		block45_data_unref (_data_->_data45_);
		_data_->_data45_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->parser;
	tuba_network_parse_array (_data_->_tmp11_, ___lambda67__tuba_network_node_callback, block45_data_ref (_data_->_data45_), block45_data_unref, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
		_g_object_unref0 (_data_->req);
		_g_free0 (_data_->handle);
		block45_data_unref (_data_->_data45_);
		_data_->_data45_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp12_ = _data_->_data45_->results;
	_data_->_tmp13_ = _g_object_ref0 ((GListModel*) _data_->_tmp12_);
	_data_->result = _data_->_tmp13_;
	_g_object_unref0 (_data_->parser);
	_g_object_unref0 (_data_->in_stream);
	_g_object_unref0 (_data_->req);
	_g_free0 (_data_->handle);
	block45_data_unref (_data_->_data45_);
	_data_->_data45_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block46Data*
block46_data_ref (Block46Data* _data46_)
{
	g_atomic_int_inc (&_data46_->_ref_count_);
	return _data46_;
}

static void
block46_data_unref (void * _userdata_)
{
	Block46Data* _data46_;
	_data46_ = (Block46Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data46_->_ref_count_)) {
		TubaHandleProvider* self;
		self = _data46_->self;
		_g_object_unref0 (_data46_->avatar);
		_g_object_unref0 (self);
		g_slice_free (Block46Data, _data46_);
	}
}

static void
___lambda68_ (Block46Data* _data46_,
              GdkPaintable* paintable)
{
	TubaHandleProvider* self;
	AdwAvatar* _tmp0_;
	self = _data46_->self;
	_tmp0_ = _data46_->avatar;
	adw_avatar_set_custom_image (_tmp0_, paintable);
}

static void
____lambda68__tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                    gpointer self)
{
	___lambda68_ (self, data);
}

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
tuba_handle_provider_real_display (TubaCompletionProvider* base,
                                   GtkSourceCompletionContext* context,
                                   GtkSourceCompletionProposal* proposal,
                                   GtkSourceCompletionCell* cell)
{
	TubaHandleProvider * self;
	TubaHandleProviderProposal* real_proposal = NULL;
	TubaHandleProviderProposal* _tmp0_;
	TubaHandleProviderProposal* _tmp1_;
	TubaAPIAccount* account = NULL;
	TubaHandleProviderProposal* _tmp2_;
	TubaAPIAccount* _tmp3_;
	TubaAPIAccount* _tmp4_;
	TubaAPIAccount* _tmp5_;
	TubaAPIAccount* _tmp6_;
	self = (TubaHandleProvider*) base;
	g_return_if_fail (context != NULL);
	g_return_if_fail (proposal != NULL);
	g_return_if_fail (cell != NULL);
	_tmp0_ = _g_object_ref0 (TUBA_HANDLE_PROVIDER_IS_PROPOSAL (proposal) ? ((TubaHandleProviderProposal*) proposal) : NULL);
	real_proposal = _tmp0_;
	_tmp1_ = real_proposal;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (real_proposal);
		return;
	}
	_tmp2_ = real_proposal;
	_tmp3_ = tuba_handle_provider_proposal_get_account (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	account = _tmp5_;
	_tmp6_ = account;
	g_return_if_fail (_tmp6_ != NULL);
	switch (gtk_source_completion_cell_get_column (cell)) {
		case GTK_SOURCE_COMPLETION_COLUMN_ICON:
		{
			Block46Data* _data46_;
			AdwAvatar* _tmp7_;
			AdwAvatar* _tmp8_;
			TubaAPIAccount* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			TubaAPIAccount* _tmp12_;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
			AdwAvatar* _tmp15_;
			_data46_ = g_slice_new0 (Block46Data);
			_data46_->_ref_count_ = 1;
			_data46_->self = g_object_ref (self);
			_tmp7_ = (AdwAvatar*) adw_avatar_new (36, NULL, TRUE);
			g_object_ref_sink (_tmp7_);
			_data46_->avatar = _tmp7_;
			_tmp8_ = _data46_->avatar;
			_tmp9_ = account;
			_tmp10_ = tuba_api_account_get_display_name (_tmp9_);
			_tmp11_ = _tmp10_;
			gtk_widget_set_name ((GtkWidget*) _tmp8_, _tmp11_);
			_tmp12_ = account;
			_tmp13_ = tuba_api_account_get_avatar (_tmp12_);
			_tmp14_ = _tmp13_;
			tuba_helper_image_request_paintable (_tmp14_, NULL, FALSE, ____lambda68__tuba_helper_image_on_item_changed_fn, block46_data_ref (_data46_), block46_data_unref, NULL);
			_tmp15_ = _data46_->avatar;
			gtk_source_completion_cell_set_widget (cell, (GtkWidget*) _tmp15_);
			block46_data_unref (_data46_);
			_data46_ = NULL;
			break;
		}
		case GTK_SOURCE_COMPLETION_COLUMN_TYPED_TEXT:
		{
			TubaAPIAccount* _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			const gchar* _tmp19_;
			TubaAPIAccount* _tmp20_;
			gchar* _tmp21_;
			gchar* _tmp22_;
			gchar* _tmp23_;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			_tmp16_ = account;
			_tmp17_ = tuba_api_account_get_display_name (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = string_to_string (_tmp18_);
			_tmp20_ = account;
			_tmp21_ = tuba_api_account_get_handle (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = _tmp22_;
			_tmp24_ = string_to_string (_tmp23_);
			_tmp25_ = g_strconcat ("<b>", _tmp19_, "</b>\n<span alpha='50%'>", _tmp24_, "</span>", NULL);
			_tmp26_ = _tmp25_;
			gtk_source_completion_cell_set_markup (cell, _tmp26_);
			_g_free0 (_tmp26_);
			_g_free0 (_tmp23_);
			break;
		}
		default:
		{
			g_object_set (cell, "text", NULL, NULL);
			break;
		}
	}
	_g_object_unref0 (account);
	_g_object_unref0 (real_proposal);
}

static gboolean
tuba_handle_provider_real_word_stop (TubaCompletionProvider* base,
                                     gunichar ch)
{
	TubaHandleProvider * self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = (TubaHandleProvider*) base;
	if (TUBA_COMPLETION_PROVIDER_CLASS (tuba_handle_provider_parent_class)->word_stop (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_TYPE_COMPLETION_PROVIDER, TubaCompletionProvider), ch)) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp1_ = FALSE;
		gboolean _tmp2_ = FALSE;
		if (!g_unichar_isalnum (ch)) {
			gunichar _tmp3_;
			gunichar _tmp4_;
			_tmp3_ = tuba_completion_provider_get_trigger_char ((TubaCompletionProvider*) self);
			_tmp4_ = _tmp3_;
			_tmp2_ = ch != _tmp4_;
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			_tmp1_ = ch != ((gunichar) '.');
		} else {
			_tmp1_ = FALSE;
		}
		_tmp0_ = _tmp1_;
	}
	result = _tmp0_;
	return result;
}

static inline gpointer
tuba_handle_provider_proposal_get_instance_private (TubaHandleProviderProposal* self)
{
	return G_STRUCT_MEMBER_P (self, TubaHandleProviderProposal_private_offset);
}

TubaHandleProviderProposal*
tuba_handle_provider_proposal_construct (GType object_type,
                                         TubaAPIAccount* entity)
{
	TubaHandleProviderProposal * self = NULL;
	g_return_val_if_fail (entity != NULL, NULL);
	self = (TubaHandleProviderProposal*) g_object_new (object_type, "account", entity, NULL);
	return self;
}

TubaHandleProviderProposal*
tuba_handle_provider_proposal_new (TubaAPIAccount* entity)
{
	return tuba_handle_provider_proposal_construct (TUBA_HANDLE_PROVIDER_TYPE_PROPOSAL, entity);
}

static const gchar*
string_offset (const gchar* self,
               glong offset)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = (const gchar*) (((gchar*) self) + offset);
	return result;
}

static gchar*
tuba_handle_provider_proposal_real_get_typed_text (GtkSourceCompletionProposal* base)
{
	TubaHandleProviderProposal * self;
	TubaAPIAccount* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* result;
	self = (TubaHandleProviderProposal*) base;
	_tmp0_ = self->priv->_account;
	_tmp1_ = tuba_api_account_get_handle (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = string_offset (_tmp3_, (glong) 1);
	_tmp5_ = g_strdup (_tmp4_);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp3_);
	result = _tmp6_;
	return result;
}

TubaAPIAccount*
tuba_handle_provider_proposal_get_account (TubaHandleProviderProposal* self)
{
	TubaAPIAccount* result;
	TubaAPIAccount* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_account;
	result = _tmp0_;
	return result;
}

static void
tuba_handle_provider_proposal_set_account (TubaHandleProviderProposal* self,
                                           TubaAPIAccount* value)
{
	TubaAPIAccount* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_handle_provider_proposal_get_account (self);
	if (old_value != value) {
		TubaAPIAccount* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_account);
		self->priv->_account = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_handle_provider_proposal_properties[TUBA_HANDLE_PROVIDER_PROPOSAL_ACCOUNT_PROPERTY]);
	}
}

static void
tuba_handle_provider_proposal_class_init (TubaHandleProviderProposalClass * klass,
                                          gpointer klass_data)
{
	tuba_handle_provider_proposal_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaHandleProviderProposal_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_handle_provider_proposal_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_handle_provider_proposal_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_handle_provider_proposal_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_HANDLE_PROVIDER_PROPOSAL_ACCOUNT_PROPERTY, tuba_handle_provider_proposal_properties[TUBA_HANDLE_PROVIDER_PROPOSAL_ACCOUNT_PROPERTY] = g_param_spec_object ("account", "account", "account", TUBA_API_TYPE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}

static void
tuba_handle_provider_proposal_gtk_source_completion_proposal_interface_init (GtkSourceCompletionProposalInterface * iface,
                                                                             gpointer iface_data)
{
	tuba_handle_provider_proposal_gtk_source_completion_proposal_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_typed_text = (gchar* (*) (GtkSourceCompletionProposal*)) tuba_handle_provider_proposal_real_get_typed_text;
}

static void
tuba_handle_provider_proposal_instance_init (TubaHandleProviderProposal * self,
                                             gpointer klass)
{
	self->priv = tuba_handle_provider_proposal_get_instance_private (self);
}

static void
tuba_handle_provider_proposal_finalize (GObject * obj)
{
	TubaHandleProviderProposal * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_HANDLE_PROVIDER_TYPE_PROPOSAL, TubaHandleProviderProposal);
	_g_object_unref0 (self->priv->_account);
	G_OBJECT_CLASS (tuba_handle_provider_proposal_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_handle_provider_proposal_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaHandleProviderProposalClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_handle_provider_proposal_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaHandleProviderProposal), 0, (GInstanceInitFunc) tuba_handle_provider_proposal_instance_init, NULL };
	static const GInterfaceInfo gtk_source_completion_proposal_info = { (GInterfaceInitFunc) tuba_handle_provider_proposal_gtk_source_completion_proposal_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_handle_provider_proposal_type_id;
	tuba_handle_provider_proposal_type_id = g_type_register_static (G_TYPE_OBJECT, "TubaHandleProviderProposal", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_handle_provider_proposal_type_id, gtk_source_completion_proposal_get_type (), &gtk_source_completion_proposal_info);
	TubaHandleProviderProposal_private_offset = g_type_add_instance_private (tuba_handle_provider_proposal_type_id, sizeof (TubaHandleProviderProposalPrivate));
	return tuba_handle_provider_proposal_type_id;
}

GType
tuba_handle_provider_proposal_get_type (void)
{
	static GType tuba_handle_provider_proposal_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_handle_provider_proposal_type_id__once)) {
		GType tuba_handle_provider_proposal_type_id;
		tuba_handle_provider_proposal_type_id = tuba_handle_provider_proposal_get_type_once ();
		g_once_init_leave_pointer (&tuba_handle_provider_proposal_type_id__once, tuba_handle_provider_proposal_type_id);
	}
	return tuba_handle_provider_proposal_type_id__once;
}

static void
_vala_tuba_handle_provider_proposal_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	TubaHandleProviderProposal * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_HANDLE_PROVIDER_TYPE_PROPOSAL, TubaHandleProviderProposal);
	switch (property_id) {
		case TUBA_HANDLE_PROVIDER_PROPOSAL_ACCOUNT_PROPERTY:
		g_value_set_object (value, tuba_handle_provider_proposal_get_account (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_handle_provider_proposal_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	TubaHandleProviderProposal * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_HANDLE_PROVIDER_TYPE_PROPOSAL, TubaHandleProviderProposal);
	switch (property_id) {
		case TUBA_HANDLE_PROVIDER_PROPOSAL_ACCOUNT_PROPERTY:
		tuba_handle_provider_proposal_set_account (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
tuba_handle_provider_class_init (TubaHandleProviderClass * klass,
                                 gpointer klass_data)
{
	tuba_handle_provider_parent_class = g_type_class_peek_parent (klass);
	((TubaCompletionProviderClass *) klass)->suggest = (void (*) (TubaCompletionProvider*, const gchar*, GCancellable*, GAsyncReadyCallback, gpointer)) tuba_handle_provider_real_suggest;
	((TubaCompletionProviderClass *) klass)->suggest_finish = (GListModel* (*) (TubaCompletionProvider*, GAsyncResult*, GError**)) tuba_handle_provider_suggest_finish;
	((TubaCompletionProviderClass *) klass)->display = (void (*) (TubaCompletionProvider*, GtkSourceCompletionContext*, GtkSourceCompletionProposal*, GtkSourceCompletionCell*)) tuba_handle_provider_real_display;
	((TubaCompletionProviderClass *) klass)->word_stop = (gboolean (*) (TubaCompletionProvider*, gunichar)) tuba_handle_provider_real_word_stop;
}

static void
tuba_handle_provider_instance_init (TubaHandleProvider * self,
                                    gpointer klass)
{
}

 G_GNUC_NO_INLINE static GType
tuba_handle_provider_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaHandleProviderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_handle_provider_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaHandleProvider), 0, (GInstanceInitFunc) tuba_handle_provider_instance_init, NULL };
	GType tuba_handle_provider_type_id;
	tuba_handle_provider_type_id = g_type_register_static (TUBA_TYPE_COMPLETION_PROVIDER, "TubaHandleProvider", &g_define_type_info, G_TYPE_FLAG_NONE);
	return tuba_handle_provider_type_id;
}

GType
tuba_handle_provider_get_type (void)
{
	static GType tuba_handle_provider_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_handle_provider_type_id__once)) {
		GType tuba_handle_provider_type_id;
		tuba_handle_provider_type_id = tuba_handle_provider_get_type_once ();
		g_once_init_leave_pointer (&tuba_handle_provider_type_id__once, tuba_handle_provider_type_id);
	}
	return tuba_handle_provider_type_id__once;
}

