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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <adwaita.h>
#include <stdlib.h>
#include <string.h>
#include <gee.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_WIDGETS_TYPE_STATUS (tuba_widgets_status_get_type ())
#define TUBA_WIDGETS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_STATUS, TubaWidgetsStatus))
#define TUBA_WIDGETS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_STATUS, TubaWidgetsStatusClass))
#define TUBA_WIDGETS_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_STATUS))
#define TUBA_WIDGETS_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_STATUS))
#define TUBA_WIDGETS_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_STATUS, TubaWidgetsStatusClass))

typedef struct _TubaWidgetsStatus TubaWidgetsStatus;
typedef struct _TubaWidgetsStatusClass TubaWidgetsStatusClass;
typedef struct _TubaWidgetsStatusPrivate TubaWidgetsStatusPrivate;

#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_STATUS (tuba_api_status_get_type ())
#define TUBA_API_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatus))
#define TUBA_API_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))
#define TUBA_API_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_STATUS))
#define TUBA_API_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_STATUS))
#define TUBA_API_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))

typedef struct _TubaAPIStatus TubaAPIStatus;
typedef struct _TubaAPIStatusClass TubaAPIStatusClass;
typedef void (*TubaDialogsComposerDialogSuccessCallback) (TubaAPIStatus* cb_status, gpointer user_data);

#define TUBA_WIDGETS_TYPE_RICH_LABEL (tuba_widgets_rich_label_get_type ())
#define TUBA_WIDGETS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabel))
#define TUBA_WIDGETS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))
#define TUBA_WIDGETS_IS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_IS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_RICH_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))

typedef struct _TubaWidgetsRichLabel TubaWidgetsRichLabel;
typedef struct _TubaWidgetsRichLabelClass TubaWidgetsRichLabelClass;

#define TUBA_WIDGETS_TYPE_AVATAR (tuba_widgets_avatar_get_type ())
#define TUBA_WIDGETS_AVATAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_AVATAR, TubaWidgetsAvatar))
#define TUBA_WIDGETS_AVATAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_AVATAR, TubaWidgetsAvatarClass))
#define TUBA_WIDGETS_IS_AVATAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_AVATAR))
#define TUBA_WIDGETS_IS_AVATAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_AVATAR))
#define TUBA_WIDGETS_AVATAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_AVATAR, TubaWidgetsAvatarClass))

typedef struct _TubaWidgetsAvatar TubaWidgetsAvatar;
typedef struct _TubaWidgetsAvatarClass TubaWidgetsAvatarClass;

#define TUBA_WIDGETS_TYPE_MARKUP_VIEW (tuba_widgets_markup_view_get_type ())
#define TUBA_WIDGETS_MARKUP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_MARKUP_VIEW, TubaWidgetsMarkupView))
#define TUBA_WIDGETS_MARKUP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_MARKUP_VIEW, TubaWidgetsMarkupViewClass))
#define TUBA_WIDGETS_IS_MARKUP_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_MARKUP_VIEW))
#define TUBA_WIDGETS_IS_MARKUP_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_MARKUP_VIEW))
#define TUBA_WIDGETS_MARKUP_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_MARKUP_VIEW, TubaWidgetsMarkupViewClass))

typedef struct _TubaWidgetsMarkupView TubaWidgetsMarkupView;
typedef struct _TubaWidgetsMarkupViewClass TubaWidgetsMarkupViewClass;

#define TUBA_WIDGETS_TYPE_FADE_BIN (tuba_widgets_fade_bin_get_type ())
#define TUBA_WIDGETS_FADE_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_FADE_BIN, TubaWidgetsFadeBin))
#define TUBA_WIDGETS_FADE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_FADE_BIN, TubaWidgetsFadeBinClass))
#define TUBA_WIDGETS_IS_FADE_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_FADE_BIN))
#define TUBA_WIDGETS_IS_FADE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_FADE_BIN))
#define TUBA_WIDGETS_FADE_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_FADE_BIN, TubaWidgetsFadeBinClass))

typedef struct _TubaWidgetsFadeBin TubaWidgetsFadeBin;
typedef struct _TubaWidgetsFadeBinClass TubaWidgetsFadeBinClass;

#define TUBA_WIDGETS_TYPE_PREVIEW_CARD (tuba_widgets_preview_card_get_type ())
#define TUBA_WIDGETS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCard))
#define TUBA_WIDGETS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCardClass))
#define TUBA_WIDGETS_IS_PREVIEW_CARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD))
#define TUBA_WIDGETS_IS_PREVIEW_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_PREVIEW_CARD))
#define TUBA_WIDGETS_PREVIEW_CARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_PREVIEW_CARD, TubaWidgetsPreviewCardClass))

typedef struct _TubaWidgetsPreviewCard TubaWidgetsPreviewCard;
typedef struct _TubaWidgetsPreviewCardClass TubaWidgetsPreviewCardClass;

#define TUBA_WIDGETS_TYPE_VOTE_BOX (tuba_widgets_vote_box_get_type ())
#define TUBA_WIDGETS_VOTE_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBox))
#define TUBA_WIDGETS_VOTE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBoxClass))
#define TUBA_WIDGETS_IS_VOTE_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_VOTE_BOX))
#define TUBA_WIDGETS_IS_VOTE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_VOTE_BOX))
#define TUBA_WIDGETS_VOTE_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_VOTE_BOX, TubaWidgetsVoteBoxClass))

typedef struct _TubaWidgetsVoteBox TubaWidgetsVoteBox;
typedef struct _TubaWidgetsVoteBoxClass TubaWidgetsVoteBoxClass;

#define TUBA_WIDGETS_TYPE_CONVERSATION (tuba_widgets_conversation_get_type ())
#define TUBA_WIDGETS_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_CONVERSATION, TubaWidgetsConversation))
#define TUBA_WIDGETS_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_CONVERSATION, TubaWidgetsConversationClass))
#define TUBA_WIDGETS_IS_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_CONVERSATION))
#define TUBA_WIDGETS_IS_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_CONVERSATION))
#define TUBA_WIDGETS_CONVERSATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_CONVERSATION, TubaWidgetsConversationClass))

typedef struct _TubaWidgetsConversation TubaWidgetsConversation;
typedef struct _TubaWidgetsConversationClass TubaWidgetsConversationClass;
typedef struct _TubaWidgetsConversationPrivate TubaWidgetsConversationPrivate;

#define TUBA_API_TYPE_CONVERSATION (tuba_api_conversation_get_type ())
#define TUBA_API_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_CONVERSATION, TubaAPIConversation))
#define TUBA_API_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_CONVERSATION, TubaAPIConversationClass))
#define TUBA_API_IS_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_CONVERSATION))
#define TUBA_API_IS_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_CONVERSATION))
#define TUBA_API_CONVERSATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_CONVERSATION, TubaAPIConversationClass))

typedef struct _TubaAPIConversation TubaAPIConversation;
typedef struct _TubaAPIConversationClass TubaAPIConversationClass;
enum  {
	TUBA_WIDGETS_CONVERSATION_0_PROPERTY,
	TUBA_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY,
	TUBA_WIDGETS_CONVERSATION_TITLE_TEXT_PROPERTY,
	TUBA_WIDGETS_CONVERSATION_SUBTITLE_TEXT_PROPERTY,
	TUBA_WIDGETS_CONVERSATION_AVATAR_URL_PROPERTY,
	TUBA_WIDGETS_CONVERSATION_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_conversation_properties[TUBA_WIDGETS_CONVERSATION_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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_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 _g_free0(var) (var = (g_free (var), NULL))

struct _TubaWidgetsStatus {
	GtkListBoxRow parent_instance;
	TubaWidgetsStatusPrivate * priv;
	TubaDialogsComposerDialogSuccessCallback reply_cb;
	gpointer reply_cb_target;
	GDestroyNotify reply_cb_target_destroy_notify;
	GtkBox* status_box;
	GtkBox* avatar_side;
	GtkBox* title_box;
	GtkBox* content_side;
	AdwWrapBox* name_wrapbox;
	GtkMenuButton* menu_button;
	GtkImage* header_icon;
	TubaWidgetsRichLabel* header_label;
	GtkButton* header_button;
	TubaWidgetsAvatar* avatar;
	GtkOverlay* avatar_overlay;
	GtkButton* name_button;
	TubaWidgetsRichLabel* name_label;
	GtkLabel* handle_label;
	GtkBox* indicators;
	GtkLabel* date_label;
	GtkImage* pin_indicator;
	GtkImage* edited_indicator;
	GtkImage* visibility_indicator;
	GtkBox* content_column;
	GtkStack* spoiler_stack;
	GtkBox* content_box;
	TubaWidgetsMarkupView* content;
	GtkButton* spoiler_button;
	GtkLabel* spoiler_label;
	GtkLabel* spoiler_label_rev;
	GtkBox* spoiler_status_con;
	TubaWidgetsFadeBin* fade_bin;
	GtkStack* filter_stack;
	GtkLabel* filter_label;
	GtkLabel* filter_author_label;
	TubaWidgetsPreviewCard* prev_card;
	TubaWidgetsVoteBox* poll;
};

struct _TubaWidgetsStatusClass {
	GtkListBoxRowClass parent_class;
	void (*on_open) (TubaWidgetsStatus* self);
	void (*change_kind) (TubaWidgetsStatus* self);
	void (*bind) (TubaWidgetsStatus* self);
};

struct _TubaWidgetsConversation {
	TubaWidgetsStatus parent_instance;
	TubaWidgetsConversationPrivate * priv;
};

struct _TubaWidgetsConversationClass {
	TubaWidgetsStatusClass parent_class;
};

struct _TubaWidgetsConversationPrivate {
	TubaAPIConversation* _conversation;
};

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

static gint TubaWidgetsConversation_private_offset;
static gpointer tuba_widgets_conversation_parent_class = NULL;

VALA_EXTERN GType tuba_widgets_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsStatus, g_object_unref)
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_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIStatus, g_object_unref)
VALA_EXTERN GType tuba_widgets_rich_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsRichLabel, g_object_unref)
VALA_EXTERN GType tuba_widgets_avatar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAvatar, g_object_unref)
VALA_EXTERN GType tuba_widgets_markup_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsMarkupView, g_object_unref)
VALA_EXTERN GType tuba_widgets_fade_bin_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsFadeBin, g_object_unref)
VALA_EXTERN GType tuba_widgets_preview_card_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsPreviewCard, g_object_unref)
VALA_EXTERN GType tuba_widgets_vote_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsVoteBox, g_object_unref)
VALA_EXTERN GType tuba_widgets_conversation_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsConversation, g_object_unref)
VALA_EXTERN GType tuba_api_conversation_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIConversation, g_object_unref)
VALA_EXTERN void tuba_widgets_status_on_open (TubaWidgetsStatus* self);
VALA_EXTERN TubaWidgetsConversation* tuba_widgets_conversation_new (TubaAPIConversation* entity);
VALA_EXTERN TubaWidgetsConversation* tuba_widgets_conversation_construct (GType object_type,
                                                              TubaAPIConversation* entity);
VALA_EXTERN TubaAPIStatus* tuba_api_conversation_get_last_status (TubaAPIConversation* self);
VALA_EXTERN void tuba_widgets_status_init_menu_button (TubaWidgetsStatus* self);
VALA_EXTERN TubaAPIConversation* tuba_widgets_conversation_get_conversation (TubaWidgetsConversation* self);
static gboolean __lambda102_ (TubaWidgetsConversation* self,
                       GBinding* b,
                       GValue* src,
                       GValue* target);
static gboolean ___lambda102__gbinding_transform_func (GBinding* binding,
                                                GValue* from_value,
                                                GValue* to_value,
                                                gpointer self);
VALA_EXTERN void tuba_widgets_status_toggle_actions_visibility (TubaWidgetsStatus* self,
                                                    gboolean visible);
static void tuba_widgets_conversation_real_on_open (TubaWidgetsStatus* base);
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 void tuba_widgetizable_open (TubaWidgetizable* self);
VALA_EXTERN void tuba_widgets_conversation_set_conversation (TubaWidgetsConversation* self,
                                                 TubaAPIConversation* value);
VALA_EXTERN gchar* tuba_widgets_conversation_get_title_text (TubaWidgetsConversation* self);
VALA_EXTERN GeeArrayList* tuba_api_conversation_get_accounts (TubaAPIConversation* self);
VALA_EXTERN const gchar* tuba_api_account_get_display_name (TubaAPIAccount* self);
VALA_EXTERN gchar* tuba_widgets_conversation_get_subtitle_text (TubaWidgetsConversation* self);
VALA_EXTERN gchar* tuba_api_account_get_handle (TubaAPIAccount* self);
VALA_EXTERN gchar* tuba_widgets_conversation_get_avatar_url (TubaWidgetsConversation* self);
VALA_EXTERN const gchar* tuba_api_account_get_avatar (TubaAPIAccount* self);
static void tuba_widgets_conversation_finalize (GObject * obj);
static GType tuba_widgets_conversation_get_type_once (void);
static void _vala_tuba_widgets_conversation_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_tuba_widgets_conversation_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);

static inline gpointer
tuba_widgets_conversation_get_instance_private (TubaWidgetsConversation* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsConversation_private_offset);
}

static gboolean
__lambda102_ (TubaWidgetsConversation* self,
              GBinding* b,
              GValue* src,
              GValue* target)
{
	gboolean result;
	g_return_val_if_fail (b != NULL, FALSE);
	g_return_val_if_fail (src != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	if (g_value_get_boolean (src)) {
		GtkImage* _tmp0_;
		g_value_set_string (target, "tuba-mail-small-symbolic");
		_tmp0_ = ((TubaWidgetsStatus*) self)->visibility_indicator;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp0_, "dim-label");
	} else {
		GtkImage* _tmp1_;
		g_value_set_string (target, "tuba-mail-open-small-symbolic");
		_tmp1_ = ((TubaWidgetsStatus*) self)->visibility_indicator;
		gtk_widget_add_css_class ((GtkWidget*) _tmp1_, "dim-label");
	}
	result = TRUE;
	return result;
}

static gboolean
___lambda102__gbinding_transform_func (GBinding* binding,
                                       GValue* from_value,
                                       GValue* to_value,
                                       gpointer self)
{
	gboolean result;
	result = __lambda102_ ((TubaWidgetsConversation*) self, binding, from_value, to_value);
	return result;
}

TubaWidgetsConversation*
tuba_widgets_conversation_construct (GType object_type,
                                     TubaAPIConversation* entity)
{
	TubaWidgetsConversation * self = NULL;
	TubaAPIStatus* _tmp0_;
	TubaAPIStatus* _tmp1_;
	TubaAPIConversation* _tmp2_;
	GtkImage* _tmp3_;
	g_return_val_if_fail (entity != NULL, NULL);
	_tmp0_ = tuba_api_conversation_get_last_status (entity);
	_tmp1_ = _tmp0_;
	self = (TubaWidgetsConversation*) g_object_new (object_type, "conversation", entity, "status", _tmp1_, "change-background-on-direct", FALSE, NULL);
	tuba_widgets_status_init_menu_button ((TubaWidgetsStatus*) self);
	_tmp2_ = self->priv->_conversation;
	_tmp3_ = ((TubaWidgetsStatus*) self)->visibility_indicator;
	g_object_bind_property_with_closures ((GObject*) _tmp2_, "unread", (GObject*) _tmp3_, "icon_name", G_BINDING_SYNC_CREATE, (GClosure*) ((___lambda102__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda102__gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	tuba_widgets_status_toggle_actions_visibility ((TubaWidgetsStatus*) self, FALSE);
	return self;
}

TubaWidgetsConversation*
tuba_widgets_conversation_new (TubaAPIConversation* entity)
{
	return tuba_widgets_conversation_construct (TUBA_WIDGETS_TYPE_CONVERSATION, entity);
}

static void
tuba_widgets_conversation_real_on_open (TubaWidgetsStatus* base)
{
	TubaWidgetsConversation * self;
	TubaAPIConversation* _tmp0_;
	self = (TubaWidgetsConversation*) base;
	_tmp0_ = self->priv->_conversation;
	tuba_widgetizable_open ((TubaWidgetizable*) _tmp0_);
}

TubaAPIConversation*
tuba_widgets_conversation_get_conversation (TubaWidgetsConversation* self)
{
	TubaAPIConversation* result;
	TubaAPIConversation* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_conversation;
	result = _tmp0_;
	return result;
}

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

void
tuba_widgets_conversation_set_conversation (TubaWidgetsConversation* self,
                                            TubaAPIConversation* value)
{
	TubaAPIConversation* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_widgets_conversation_get_conversation (self);
	if (old_value != value) {
		TubaAPIConversation* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_conversation);
		self->priv->_conversation = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_widgets_conversation_properties[TUBA_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY]);
	}
}

gchar*
tuba_widgets_conversation_get_title_text (TubaWidgetsConversation* self)
{
	gchar* result;
	gchar* label = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("");
	label = _tmp0_;
	{
		GeeArrayList* _account_list = NULL;
		TubaAPIConversation* _tmp1_;
		GeeArrayList* _tmp2_;
		GeeArrayList* _tmp3_;
		gint _account_size = 0;
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _account_index = 0;
		_tmp1_ = self->priv->_conversation;
		_tmp2_ = tuba_api_conversation_get_accounts (_tmp1_);
		_tmp3_ = _tmp2_;
		_account_list = _tmp3_;
		_tmp4_ = _account_list;
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_account_size = _tmp6_;
		_account_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			TubaAPIAccount* account = NULL;
			GeeArrayList* _tmp9_;
			gpointer _tmp10_;
			const gchar* _tmp11_;
			TubaAPIAccount* _tmp12_;
			const gchar* _tmp13_;
			const gchar* _tmp14_;
			gchar* _tmp15_;
			TubaAPIConversation* _tmp16_;
			GeeArrayList* _tmp17_;
			GeeArrayList* _tmp18_;
			gpointer _tmp19_;
			TubaAPIAccount* _tmp20_;
			TubaAPIAccount* _tmp21_;
			gboolean _tmp22_;
			_account_index = _account_index + 1;
			_tmp7_ = _account_index;
			_tmp8_ = _account_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _account_list;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _account_index);
			account = (TubaAPIAccount*) _tmp10_;
			_tmp11_ = label;
			_tmp12_ = account;
			_tmp13_ = tuba_api_account_get_display_name (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = g_strconcat (_tmp11_, _tmp14_, NULL);
			_g_free0 (label);
			label = _tmp15_;
			_tmp16_ = self->priv->_conversation;
			_tmp17_ = tuba_api_conversation_get_accounts (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = gee_list_last ((GeeList*) _tmp18_);
			_tmp20_ = (TubaAPIAccount*) _tmp19_;
			_tmp21_ = account;
			_tmp22_ = _tmp20_ != _tmp21_;
			_g_object_unref0 (_tmp20_);
			if (_tmp22_) {
				const gchar* _tmp23_;
				gchar* _tmp24_;
				_tmp23_ = label;
				_tmp24_ = g_strconcat (_tmp23_, ", ", NULL);
				_g_free0 (label);
				label = _tmp24_;
			}
			_g_object_unref0 (account);
		}
	}
	result = label;
	return result;
}

gchar*
tuba_widgets_conversation_get_subtitle_text (TubaWidgetsConversation* self)
{
	gchar* result;
	gchar* label = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("");
	label = _tmp0_;
	{
		GeeArrayList* _account_list = NULL;
		TubaAPIConversation* _tmp1_;
		GeeArrayList* _tmp2_;
		GeeArrayList* _tmp3_;
		gint _account_size = 0;
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _account_index = 0;
		_tmp1_ = self->priv->_conversation;
		_tmp2_ = tuba_api_conversation_get_accounts (_tmp1_);
		_tmp3_ = _tmp2_;
		_account_list = _tmp3_;
		_tmp4_ = _account_list;
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_account_size = _tmp6_;
		_account_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			TubaAPIAccount* account = NULL;
			GeeArrayList* _tmp9_;
			gpointer _tmp10_;
			const gchar* _tmp11_;
			TubaAPIAccount* _tmp12_;
			gchar* _tmp13_;
			gchar* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			_account_index = _account_index + 1;
			_tmp7_ = _account_index;
			_tmp8_ = _account_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _account_list;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _account_index);
			account = (TubaAPIAccount*) _tmp10_;
			_tmp11_ = label;
			_tmp12_ = account;
			_tmp13_ = tuba_api_account_get_handle (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = _tmp14_;
			_tmp16_ = g_strconcat (_tmp15_, " ", NULL);
			_tmp17_ = _tmp16_;
			_tmp18_ = g_strconcat (_tmp11_, _tmp17_, NULL);
			_g_free0 (label);
			label = _tmp18_;
			_g_free0 (_tmp17_);
			_g_free0 (_tmp15_);
			_g_object_unref0 (account);
		}
	}
	result = label;
	return result;
}

gchar*
tuba_widgets_conversation_get_avatar_url (TubaWidgetsConversation* self)
{
	gchar* result;
	TubaAPIConversation* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_conversation;
	_tmp1_ = tuba_api_conversation_get_accounts (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ > 1) {
		result = NULL;
		return result;
	} else {
		TubaAPIConversation* _tmp5_;
		GeeArrayList* _tmp6_;
		GeeArrayList* _tmp7_;
		gpointer _tmp8_;
		TubaAPIAccount* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp5_ = self->priv->_conversation;
		_tmp6_ = tuba_api_conversation_get_accounts (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = gee_abstract_list_get ((GeeAbstractList*) _tmp7_, 0);
		_tmp9_ = (TubaAPIAccount*) _tmp8_;
		_tmp10_ = tuba_api_account_get_avatar (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = g_strdup (_tmp11_);
		_tmp13_ = _tmp12_;
		_g_object_unref0 (_tmp9_);
		result = _tmp13_;
		return result;
	}
}

static void
tuba_widgets_conversation_class_init (TubaWidgetsConversationClass * klass,
                                      gpointer klass_data)
{
	tuba_widgets_conversation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsConversation_private_offset);
	((TubaWidgetsStatusClass *) klass)->on_open = (void (*) (TubaWidgetsStatus*)) tuba_widgets_conversation_real_on_open;
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_conversation_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_conversation_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_conversation_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY, tuba_widgets_conversation_properties[TUBA_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY] = g_param_spec_object ("conversation", "conversation", "conversation", TUBA_API_TYPE_CONVERSATION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_CONVERSATION_TITLE_TEXT_PROPERTY, tuba_widgets_conversation_properties[TUBA_WIDGETS_CONVERSATION_TITLE_TEXT_PROPERTY] = g_param_spec_string ("title-text", "title-text", "title-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_CONVERSATION_SUBTITLE_TEXT_PROPERTY, tuba_widgets_conversation_properties[TUBA_WIDGETS_CONVERSATION_SUBTITLE_TEXT_PROPERTY] = g_param_spec_string ("subtitle-text", "subtitle-text", "subtitle-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_CONVERSATION_AVATAR_URL_PROPERTY, tuba_widgets_conversation_properties[TUBA_WIDGETS_CONVERSATION_AVATAR_URL_PROPERTY] = g_param_spec_string ("avatar-url", "avatar-url", "avatar-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tuba_widgets_conversation_instance_init (TubaWidgetsConversation * self,
                                         gpointer klass)
{
	self->priv = tuba_widgets_conversation_get_instance_private (self);
}

static void
tuba_widgets_conversation_finalize (GObject * obj)
{
	TubaWidgetsConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_CONVERSATION, TubaWidgetsConversation);
	_g_object_unref0 (self->priv->_conversation);
	G_OBJECT_CLASS (tuba_widgets_conversation_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_conversation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsConversationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_conversation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsConversation), 0, (GInstanceInitFunc) tuba_widgets_conversation_instance_init, NULL };
	GType tuba_widgets_conversation_type_id;
	tuba_widgets_conversation_type_id = g_type_register_static (TUBA_WIDGETS_TYPE_STATUS, "TubaWidgetsConversation", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaWidgetsConversation_private_offset = g_type_add_instance_private (tuba_widgets_conversation_type_id, sizeof (TubaWidgetsConversationPrivate));
	return tuba_widgets_conversation_type_id;
}

GType
tuba_widgets_conversation_get_type (void)
{
	static GType tuba_widgets_conversation_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_widgets_conversation_type_id__once)) {
		GType tuba_widgets_conversation_type_id;
		tuba_widgets_conversation_type_id = tuba_widgets_conversation_get_type_once ();
		g_once_init_leave_pointer (&tuba_widgets_conversation_type_id__once, tuba_widgets_conversation_type_id);
	}
	return tuba_widgets_conversation_type_id__once;
}

static void
_vala_tuba_widgets_conversation_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	TubaWidgetsConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_CONVERSATION, TubaWidgetsConversation);
	switch (property_id) {
		case TUBA_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY:
		g_value_set_object (value, tuba_widgets_conversation_get_conversation (self));
		break;
		case TUBA_WIDGETS_CONVERSATION_TITLE_TEXT_PROPERTY:
		g_value_take_string (value, tuba_widgets_conversation_get_title_text (self));
		break;
		case TUBA_WIDGETS_CONVERSATION_SUBTITLE_TEXT_PROPERTY:
		g_value_take_string (value, tuba_widgets_conversation_get_subtitle_text (self));
		break;
		case TUBA_WIDGETS_CONVERSATION_AVATAR_URL_PROPERTY:
		g_value_take_string (value, tuba_widgets_conversation_get_avatar_url (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_conversation_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	TubaWidgetsConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_CONVERSATION, TubaWidgetsConversation);
	switch (property_id) {
		case TUBA_WIDGETS_CONVERSATION_CONVERSATION_PROPERTY:
		tuba_widgets_conversation_set_conversation (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

