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

#include <glib-object.h>
#include <gtk/gtk.h>
#include "libdino.h"
#include "xmpp-vala.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.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 DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW (dino_ui_occupant_menu_list_row_get_type ())
#define DINO_UI_OCCUPANT_MENU_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, DinoUiOccupantMenuListRow))
#define DINO_UI_OCCUPANT_MENU_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, DinoUiOccupantMenuListRowClass))
#define DINO_UI_OCCUPANT_MENU_IS_LIST_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW))
#define DINO_UI_OCCUPANT_MENU_IS_LIST_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW))
#define DINO_UI_OCCUPANT_MENU_LIST_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, DinoUiOccupantMenuListRowClass))

typedef struct _DinoUiOccupantMenuListRow DinoUiOccupantMenuListRow;
typedef struct _DinoUiOccupantMenuListRowClass DinoUiOccupantMenuListRowClass;
typedef struct _DinoUiOccupantMenuListRowPrivate DinoUiOccupantMenuListRowPrivate;

#define DINO_UI_TYPE_AVATAR_PICTURE (dino_ui_avatar_picture_get_type ())
#define DINO_UI_AVATAR_PICTURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPicture))
#define DINO_UI_AVATAR_PICTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPictureClass))
#define DINO_UI_IS_AVATAR_PICTURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_AVATAR_PICTURE))
#define DINO_UI_IS_AVATAR_PICTURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_AVATAR_PICTURE))
#define DINO_UI_AVATAR_PICTURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPictureClass))

typedef struct _DinoUiAvatarPicture DinoUiAvatarPicture;
typedef struct _DinoUiAvatarPictureClass DinoUiAvatarPictureClass;
enum  {
	DINO_UI_OCCUPANT_MENU_LIST_ROW_0_PROPERTY,
	DINO_UI_OCCUPANT_MENU_LIST_ROW_NUM_PROPERTIES
};
static GParamSpec* dino_ui_occupant_menu_list_row_properties[DINO_UI_OCCUPANT_MENU_LIST_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL (dino_ui_view_model_avatar_picture_model_get_type ())
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModel))
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModelClass))
#define DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModelClass))

typedef struct _DinoUiViewModelAvatarPictureModel DinoUiViewModelAvatarPictureModel;
typedef struct _DinoUiViewModelAvatarPictureModelClass DinoUiViewModelAvatarPictureModelClass;

#define DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL (dino_ui_view_model_compat_avatar_picture_model_get_type ())
#define DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel))
#define DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModelClass))
#define DINO_UI_VIEW_MODEL_IS_COMPAT_AVATAR_PICTURE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_IS_COMPAT_AVATAR_PICTURE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL))
#define DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModelClass))

typedef struct _DinoUiViewModelCompatAvatarPictureModel DinoUiViewModelCompatAvatarPictureModel;
typedef struct _DinoUiViewModelCompatAvatarPictureModelClass DinoUiViewModelCompatAvatarPictureModelClass;

struct _DinoUiOccupantMenuListRow {
	GObject parent_instance;
	DinoUiOccupantMenuListRowPrivate * priv;
	GtkLabel* name_label;
	DinoEntitiesConversation* conversation;
	XmppJid* jid;
};

struct _DinoUiOccupantMenuListRowClass {
	GObjectClass parent_class;
};

struct _DinoUiOccupantMenuListRowPrivate {
	GtkGrid* main_grid;
	DinoUiAvatarPicture* picture;
};

static gint DinoUiOccupantMenuListRow_private_offset;
static gpointer dino_ui_occupant_menu_list_row_parent_class = NULL;

VALA_EXTERN GType dino_ui_occupant_menu_list_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiOccupantMenuListRow, g_object_unref)
VALA_EXTERN GType dino_ui_avatar_picture_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiAvatarPicture, g_object_unref)
VALA_EXTERN DinoUiOccupantMenuListRow* dino_ui_occupant_menu_list_row_new (DinoStreamInteractor* stream_interactor,
                                                               DinoEntitiesConversation* conversation,
                                                               XmppJid* jid);
VALA_EXTERN DinoUiOccupantMenuListRow* dino_ui_occupant_menu_list_row_construct (GType object_type,
                                                                     DinoStreamInteractor* stream_interactor,
                                                                     DinoEntitiesConversation* conversation,
                                                                     XmppJid* jid);
VALA_EXTERN gchar* dino_ui_util_get_participant_display_name (DinoStreamInteractor* stream_interactor,
                                                  DinoEntitiesConversation* conversation,
                                                  XmppJid* participant,
                                                  gboolean me_is_me);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_new (DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_construct (GType object_type,
                                                                                                   DinoStreamInteractor* stream_interactor);
VALA_EXTERN GType dino_ui_view_model_avatar_picture_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelAvatarPictureModel, g_object_unref)
VALA_EXTERN GType dino_ui_view_model_compat_avatar_picture_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelCompatAvatarPictureModel, g_object_unref)
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_add_participant (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                                                         DinoEntitiesConversation* conversation,
                                                                                                         XmppJid* jid);
VALA_EXTERN void dino_ui_avatar_picture_set_model (DinoUiAvatarPicture* self,
                                       DinoUiViewModelAvatarPictureModel* value);
VALA_EXTERN DinoUiOccupantMenuListRow* dino_ui_occupant_menu_list_row_new_label (const gchar* c,
                                                                     const gchar* text);
VALA_EXTERN DinoUiOccupantMenuListRow* dino_ui_occupant_menu_list_row_construct_label (GType object_type,
                                                                           const gchar* c,
                                                                           const gchar* text);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_add (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                                             const gchar* display,
                                                                                             const gchar* color_id,
                                                                                             GFile* image_file);
VALA_EXTERN GtkWidget* dino_ui_occupant_menu_list_row_get_widget (DinoUiOccupantMenuListRow* self);
static GObject * dino_ui_occupant_menu_list_row_constructor (GType type,
                                                      guint n_construct_properties,
                                                      GObjectConstructParam * construct_properties);
static void dino_ui_occupant_menu_list_row_finalize (GObject * obj);
static GType dino_ui_occupant_menu_list_row_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_occupant_menu_list_row_get_instance_private (DinoUiOccupantMenuListRow* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiOccupantMenuListRow_private_offset);
}

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

static gpointer
_xmpp_jid_ref0 (gpointer self)
{
	return self ? xmpp_jid_ref (self) : NULL;
}

DinoUiOccupantMenuListRow*
dino_ui_occupant_menu_list_row_construct (GType object_type,
                                          DinoStreamInteractor* stream_interactor,
                                          DinoEntitiesConversation* conversation,
                                          XmppJid* jid)
{
	DinoUiOccupantMenuListRow * self = NULL;
	DinoEntitiesConversation* _tmp0_;
	XmppJid* _tmp1_;
	GtkLabel* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	DinoUiAvatarPicture* _tmp5_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp6_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp7_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp8_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp9_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	self = (DinoUiOccupantMenuListRow*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->conversation);
	self->conversation = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (self->jid);
	self->jid = _tmp1_;
	_tmp2_ = self->name_label;
	_tmp3_ = dino_ui_util_get_participant_display_name (stream_interactor, conversation, jid, FALSE);
	_tmp4_ = _tmp3_;
	gtk_label_set_label (_tmp2_, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = self->priv->picture;
	_tmp6_ = dino_ui_view_model_compat_avatar_picture_model_new (stream_interactor);
	_tmp7_ = _tmp6_;
	_tmp8_ = dino_ui_view_model_compat_avatar_picture_model_add_participant (_tmp7_, conversation, jid);
	_tmp9_ = _tmp8_;
	dino_ui_avatar_picture_set_model (_tmp5_, (DinoUiViewModelAvatarPictureModel*) _tmp9_);
	_g_object_unref0 (_tmp9_);
	_g_object_unref0 (_tmp7_);
	return self;
}

DinoUiOccupantMenuListRow*
dino_ui_occupant_menu_list_row_new (DinoStreamInteractor* stream_interactor,
                                    DinoEntitiesConversation* conversation,
                                    XmppJid* jid)
{
	return dino_ui_occupant_menu_list_row_construct (DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, stream_interactor, conversation, jid);
}

DinoUiOccupantMenuListRow*
dino_ui_occupant_menu_list_row_construct_label (GType object_type,
                                                const gchar* c,
                                                const gchar* text)
{
	DinoUiOccupantMenuListRow * self = NULL;
	GtkLabel* _tmp0_;
	DinoUiAvatarPicture* _tmp1_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp2_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp3_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp4_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp5_;
	g_return_val_if_fail (c != NULL, NULL);
	g_return_val_if_fail (text != NULL, NULL);
	self = (DinoUiOccupantMenuListRow*) g_object_new (object_type, NULL);
	_tmp0_ = self->name_label;
	gtk_label_set_label (_tmp0_, text);
	_tmp1_ = self->priv->picture;
	_tmp2_ = dino_ui_view_model_compat_avatar_picture_model_new (NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = dino_ui_view_model_compat_avatar_picture_model_add (_tmp3_, c, NULL, NULL);
	_tmp5_ = _tmp4_;
	dino_ui_avatar_picture_set_model (_tmp1_, (DinoUiViewModelAvatarPictureModel*) _tmp5_);
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	return self;
}

DinoUiOccupantMenuListRow*
dino_ui_occupant_menu_list_row_new_label (const gchar* c,
                                          const gchar* text)
{
	return dino_ui_occupant_menu_list_row_construct_label (DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, c, text);
}

GtkWidget*
dino_ui_occupant_menu_list_row_get_widget (DinoUiOccupantMenuListRow* self)
{
	GtkGrid* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->main_grid;
	_tmp1_ = _g_object_ref0 ((GtkWidget*) _tmp0_);
	result = _tmp1_;
	return result;
}

static GObject *
dino_ui_occupant_menu_list_row_constructor (GType type,
                                            guint n_construct_properties,
                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DinoUiOccupantMenuListRow * self;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp0_;
	GtkBuilder* _tmp1_;
	GObject* _tmp2_;
	GtkGrid* _tmp3_;
	GtkBuilder* _tmp4_;
	GObject* _tmp5_;
	DinoUiAvatarPicture* _tmp6_;
	GtkBuilder* _tmp7_;
	GObject* _tmp8_;
	GtkLabel* _tmp9_;
	parent_class = G_OBJECT_CLASS (dino_ui_occupant_menu_list_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, DinoUiOccupantMenuListRow);
	_tmp0_ = gtk_builder_new_from_resource ("/im/dino/Dino/occupant_list_item.ui");
	builder = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "main_grid");
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_grid_get_type (), GtkGrid));
	_g_object_unref0 (self->priv->main_grid);
	self->priv->main_grid = _tmp3_;
	_tmp4_ = builder;
	_tmp5_ = gtk_builder_get_object (_tmp4_, "picture");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPicture));
	_g_object_unref0 (self->priv->picture);
	self->priv->picture = _tmp6_;
	_tmp7_ = builder;
	_tmp8_ = gtk_builder_get_object (_tmp7_, "name_label");
	_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_label_get_type (), GtkLabel));
	_g_object_unref0 (self->name_label);
	self->name_label = _tmp9_;
	_g_object_unref0 (builder);
	return obj;
}

static void
dino_ui_occupant_menu_list_row_class_init (DinoUiOccupantMenuListRowClass * klass,
                                           gpointer klass_data)
{
	dino_ui_occupant_menu_list_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiOccupantMenuListRow_private_offset);
	G_OBJECT_CLASS (klass)->constructor = dino_ui_occupant_menu_list_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_occupant_menu_list_row_finalize;
}

static void
dino_ui_occupant_menu_list_row_instance_init (DinoUiOccupantMenuListRow * self,
                                              gpointer klass)
{
	self->priv = dino_ui_occupant_menu_list_row_get_instance_private (self);
}

static void
dino_ui_occupant_menu_list_row_finalize (GObject * obj)
{
	DinoUiOccupantMenuListRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_OCCUPANT_MENU_TYPE_LIST_ROW, DinoUiOccupantMenuListRow);
	_g_object_unref0 (self->priv->main_grid);
	_g_object_unref0 (self->priv->picture);
	_g_object_unref0 (self->name_label);
	_g_object_unref0 (self->conversation);
	_xmpp_jid_unref0 (self->jid);
	G_OBJECT_CLASS (dino_ui_occupant_menu_list_row_parent_class)->finalize (obj);
}

static GType
dino_ui_occupant_menu_list_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiOccupantMenuListRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_occupant_menu_list_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiOccupantMenuListRow), 0, (GInstanceInitFunc) dino_ui_occupant_menu_list_row_instance_init, NULL };
	GType dino_ui_occupant_menu_list_row_type_id;
	dino_ui_occupant_menu_list_row_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoUiOccupantMenuListRow", &g_define_type_info, 0);
	DinoUiOccupantMenuListRow_private_offset = g_type_add_instance_private (dino_ui_occupant_menu_list_row_type_id, sizeof (DinoUiOccupantMenuListRowPrivate));
	return dino_ui_occupant_menu_list_row_type_id;
}

GType
dino_ui_occupant_menu_list_row_get_type (void)
{
	static volatile gsize dino_ui_occupant_menu_list_row_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_occupant_menu_list_row_type_id__once)) {
		GType dino_ui_occupant_menu_list_row_type_id;
		dino_ui_occupant_menu_list_row_type_id = dino_ui_occupant_menu_list_row_get_type_once ();
		g_once_init_leave (&dino_ui_occupant_menu_list_row_type_id__once, dino_ui_occupant_menu_list_row_type_id);
	}
	return dino_ui_occupant_menu_list_row_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

