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

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include "libdino.h"
#include "xmpp-vala.h"
#include <float.h>
#include <math.h>
#include <gee.h>
#include <cairo-gobject.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gobject/gvaluecollector.h>
#include <gtk/gtk.h>
#include <graphene-gobject.h>
#include <gsk/gsk.h>
#include <pango/pango.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_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL (dino_ui_view_model_avatar_picture_tile_model_get_type ())
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelAvatarPictureTileModel))
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelAvatarPictureTileModelClass))
#define DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_TILE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL))
#define DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_TILE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL))
#define DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelAvatarPictureTileModelClass))

typedef struct _DinoUiViewModelAvatarPictureTileModel DinoUiViewModelAvatarPictureTileModel;
typedef struct _DinoUiViewModelAvatarPictureTileModelClass DinoUiViewModelAvatarPictureTileModelClass;
typedef struct _DinoUiViewModelAvatarPictureTileModelPrivate DinoUiViewModelAvatarPictureTileModelPrivate;
enum  {
	DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_0_PROPERTY,
	DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_DISPLAY_TEXT_PROPERTY,
	DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_BACKGROUND_COLOR_PROPERTY,
	DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_IMAGE_FILE_PROPERTY,
	DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_NUM_PROPERTIES
};
static GParamSpec* dino_ui_view_model_avatar_picture_tile_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_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)))

#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;
typedef struct _DinoUiViewModelAvatarPictureModelPrivate DinoUiViewModelAvatarPictureModelPrivate;
enum  {
	DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_0_PROPERTY,
	DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_TILES_PROPERTY,
	DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_NUM_PROPERTIES
};
static GParamSpec* dino_ui_view_model_avatar_picture_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_NUM_PROPERTIES];

#define DINO_UI_VIEW_MODEL_TYPE_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL (dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_type ())
#define DINO_UI_VIEW_MODEL_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_TYPE_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelConversationParticipantAvatarPictureTileModel))
#define DINO_UI_VIEW_MODEL_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_TYPE_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelConversationParticipantAvatarPictureTileModelClass))
#define DINO_UI_VIEW_MODEL_IS_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_TYPE_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL))
#define DINO_UI_VIEW_MODEL_IS_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_TYPE_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL))
#define DINO_UI_VIEW_MODEL_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_TYPE_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelConversationParticipantAvatarPictureTileModelClass))

typedef struct _DinoUiViewModelConversationParticipantAvatarPictureTileModel DinoUiViewModelConversationParticipantAvatarPictureTileModel;
typedef struct _DinoUiViewModelConversationParticipantAvatarPictureTileModelClass DinoUiViewModelConversationParticipantAvatarPictureTileModelClass;
typedef struct _DinoUiViewModelConversationParticipantAvatarPictureTileModelPrivate DinoUiViewModelConversationParticipantAvatarPictureTileModelPrivate;
enum  {
	DINO_UI_VIEW_MODEL_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL_0_PROPERTY,
	DINO_UI_VIEW_MODEL_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL_NUM_PROPERTIES
};
static GParamSpec* dino_ui_view_model_conversation_participant_avatar_picture_tile_model_properties[DINO_UI_VIEW_MODEL_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL_NUM_PROPERTIES];
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))

#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;
typedef struct _DinoUiViewModelCompatAvatarPictureModelPrivate DinoUiViewModelCompatAvatarPictureModelPrivate;
enum  {
	DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL_0_PROPERTY,
	DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL_NUM_PROPERTIES
};
static GParamSpec* dino_ui_view_model_compat_avatar_picture_model_properties[DINO_UI_VIEW_MODEL_COMPAT_AVATAR_PICTURE_MODEL_NUM_PROPERTIES];
typedef struct _Block74Data Block74Data;

#define DINO_UI_TYPE_COMPAT_AVATAR_DRAWER (dino_ui_compat_avatar_drawer_get_type ())
#define DINO_UI_COMPAT_AVATAR_DRAWER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_COMPAT_AVATAR_DRAWER, DinoUiCompatAvatarDrawer))
#define DINO_UI_COMPAT_AVATAR_DRAWER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_COMPAT_AVATAR_DRAWER, DinoUiCompatAvatarDrawerClass))
#define DINO_UI_IS_COMPAT_AVATAR_DRAWER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_COMPAT_AVATAR_DRAWER))
#define DINO_UI_IS_COMPAT_AVATAR_DRAWER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_COMPAT_AVATAR_DRAWER))
#define DINO_UI_COMPAT_AVATAR_DRAWER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_COMPAT_AVATAR_DRAWER, DinoUiCompatAvatarDrawerClass))

typedef struct _DinoUiCompatAvatarDrawer DinoUiCompatAvatarDrawer;
typedef struct _DinoUiCompatAvatarDrawerClass DinoUiCompatAvatarDrawerClass;
typedef struct _DinoUiCompatAvatarDrawerPrivate DinoUiCompatAvatarDrawerPrivate;
#define _cairo_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_destroy (var), NULL)))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
typedef struct _DinoUiParamSpecCompatAvatarDrawer DinoUiParamSpecCompatAvatarDrawer;

#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;
typedef struct _DinoUiAvatarPicturePrivate DinoUiAvatarPicturePrivate;

#define DINO_UI_AVATAR_PICTURE_TYPE_TILE (dino_ui_avatar_picture_tile_get_type ())
#define DINO_UI_AVATAR_PICTURE_TILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_AVATAR_PICTURE_TYPE_TILE, DinoUiAvatarPictureTile))
#define DINO_UI_AVATAR_PICTURE_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_AVATAR_PICTURE_TYPE_TILE, DinoUiAvatarPictureTileClass))
#define DINO_UI_AVATAR_PICTURE_IS_TILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_AVATAR_PICTURE_TYPE_TILE))
#define DINO_UI_AVATAR_PICTURE_IS_TILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_AVATAR_PICTURE_TYPE_TILE))
#define DINO_UI_AVATAR_PICTURE_TILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_AVATAR_PICTURE_TYPE_TILE, DinoUiAvatarPictureTileClass))

typedef struct _DinoUiAvatarPictureTile DinoUiAvatarPictureTile;
typedef struct _DinoUiAvatarPictureTileClass DinoUiAvatarPictureTileClass;
enum  {
	DINO_UI_AVATAR_PICTURE_0_PROPERTY,
	DINO_UI_AVATAR_PICTURE_RADIUS_PERCENT_PROPERTY,
	DINO_UI_AVATAR_PICTURE_MODEL_PROPERTY,
	DINO_UI_AVATAR_PICTURE_NUM_PROPERTIES
};
static GParamSpec* dino_ui_avatar_picture_properties[DINO_UI_AVATAR_PICTURE_NUM_PROPERTIES];
typedef struct _DinoUiAvatarPictureTilePrivate DinoUiAvatarPictureTilePrivate;
enum  {
	DINO_UI_AVATAR_PICTURE_TILE_0_PROPERTY,
	DINO_UI_AVATAR_PICTURE_TILE_MODEL_PROPERTY,
	DINO_UI_AVATAR_PICTURE_TILE_BACKGROUND_COLOR_PROPERTY,
	DINO_UI_AVATAR_PICTURE_TILE_DISPLAY_TEXT_PROPERTY,
	DINO_UI_AVATAR_PICTURE_TILE_IMAGE_FILE_PROPERTY,
	DINO_UI_AVATAR_PICTURE_TILE_NUM_PROPERTIES
};
static GParamSpec* dino_ui_avatar_picture_tile_properties[DINO_UI_AVATAR_PICTURE_TILE_NUM_PROPERTIES];
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))
#define _gsk_render_node_unref0(var) ((var == NULL) ? NULL : (var = (gsk_render_node_unref (var), NULL)))

struct _DinoUiViewModelAvatarPictureTileModel {
	GObject parent_instance;
	DinoUiViewModelAvatarPictureTileModelPrivate * priv;
};

struct _DinoUiViewModelAvatarPictureTileModelClass {
	GObjectClass parent_class;
};

struct _DinoUiViewModelAvatarPictureTileModelPrivate {
	gchar* _display_text;
	GdkRGBA _background_color;
	GFile* _image_file;
};

struct _DinoUiViewModelAvatarPictureModel {
	GObject parent_instance;
	DinoUiViewModelAvatarPictureModelPrivate * priv;
};

struct _DinoUiViewModelAvatarPictureModelClass {
	GObjectClass parent_class;
};

struct _DinoUiViewModelAvatarPictureModelPrivate {
	GListModel* _tiles;
};

struct _DinoUiViewModelConversationParticipantAvatarPictureTileModel {
	DinoUiViewModelAvatarPictureTileModel parent_instance;
	DinoUiViewModelConversationParticipantAvatarPictureTileModelPrivate * priv;
};

struct _DinoUiViewModelConversationParticipantAvatarPictureTileModelClass {
	DinoUiViewModelAvatarPictureTileModelClass parent_class;
};

struct _DinoUiViewModelConversationParticipantAvatarPictureTileModelPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoEntitiesConversation* conversation;
	XmppJid* primary_avatar_jid;
	XmppJid* secondary_avatar_jid;
	XmppJid* display_name_jid;
};

struct _DinoUiViewModelCompatAvatarPictureModel {
	DinoUiViewModelAvatarPictureModel parent_instance;
	DinoUiViewModelCompatAvatarPictureModelPrivate * priv;
};

struct _DinoUiViewModelCompatAvatarPictureModelClass {
	DinoUiViewModelAvatarPictureModelClass parent_class;
};

struct _DinoUiViewModelCompatAvatarPictureModelPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoEntitiesConversation* conversation;
};

struct _Block74Data {
	int _ref_count_;
	GWeakRef model_weak;
	gulong muc_manager_private_room_occupant_updated_handler_id;
	gulong muc_manager_proom_info_updated_handler_id;
	gulong avatar_manager_received_avatar_handler_id;
	gulong avatar_manager_fetched_avatar_handler_id;
};

struct _DinoUiCompatAvatarDrawer {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DinoUiCompatAvatarDrawerPrivate * priv;
};

struct _DinoUiCompatAvatarDrawerClass {
	GTypeClass parent_class;
	void (*finalize) (DinoUiCompatAvatarDrawer *self);
};

struct _DinoUiCompatAvatarDrawerPrivate {
	gfloat _radius_percent;
	DinoUiViewModelAvatarPictureModel* _model;
	gint _height_request;
	gint _width_request;
	gchar* _font_family;
};

struct _DinoUiParamSpecCompatAvatarDrawer {
	GParamSpec parent_instance;
};

struct _DinoUiAvatarPicture {
	GtkWidget parent_instance;
	DinoUiAvatarPicturePrivate * priv;
};

struct _DinoUiAvatarPictureClass {
	GtkWidgetClass parent_class;
};

struct _DinoUiAvatarPicturePrivate {
	gfloat _radius_percent;
	DinoUiViewModelAvatarPictureModel* _model;
	GeeList* tiles;
	DinoUiViewModelAvatarPictureModel* old_model;
	gulong model_tiles_items_changed_handler;
};

struct _DinoUiAvatarPictureTile {
	GtkWidget parent_instance;
	DinoUiAvatarPictureTilePrivate * priv;
};

struct _DinoUiAvatarPictureTileClass {
	GtkWidgetClass parent_class;
};

struct _DinoUiAvatarPictureTilePrivate {
	DinoUiViewModelAvatarPictureTileModel* _model;
	GdkRGBA _background_color;
	GBinding* background_color_binding;
	GBinding* display_text_binding;
	GBinding* image_file_binding;
	GtkLabel* label;
	GtkPicture* picture;
};

static gint DinoUiViewModelAvatarPictureTileModel_private_offset;
static gpointer dino_ui_view_model_avatar_picture_tile_model_parent_class = NULL;
static gint DinoUiViewModelAvatarPictureModel_private_offset;
static gpointer dino_ui_view_model_avatar_picture_model_parent_class = NULL;
static gint DinoUiViewModelConversationParticipantAvatarPictureTileModel_private_offset;
static gpointer dino_ui_view_model_conversation_participant_avatar_picture_tile_model_parent_class = NULL;
static gint DinoUiViewModelCompatAvatarPictureModel_private_offset;
static gpointer dino_ui_view_model_compat_avatar_picture_model_parent_class = NULL;
static gint DinoUiCompatAvatarDrawer_private_offset;
static gpointer dino_ui_compat_avatar_drawer_parent_class = NULL;
static gint DinoUiAvatarPicture_private_offset;
static gpointer dino_ui_avatar_picture_parent_class = NULL;
static gint DinoUiAvatarPictureTile_private_offset;
static gpointer dino_ui_avatar_picture_tile_parent_class = NULL;

VALA_EXTERN GType dino_ui_view_model_avatar_picture_tile_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelAvatarPictureTileModel, g_object_unref)
VALA_EXTERN DinoUiViewModelAvatarPictureTileModel* dino_ui_view_model_avatar_picture_tile_model_new (void);
VALA_EXTERN DinoUiViewModelAvatarPictureTileModel* dino_ui_view_model_avatar_picture_tile_model_construct (GType object_type);
VALA_EXTERN const gchar* dino_ui_view_model_avatar_picture_tile_model_get_display_text (DinoUiViewModelAvatarPictureTileModel* self);
VALA_EXTERN void dino_ui_view_model_avatar_picture_tile_model_set_display_text (DinoUiViewModelAvatarPictureTileModel* self,
                                                                    const gchar* value);
VALA_EXTERN void dino_ui_view_model_avatar_picture_tile_model_get_background_color (DinoUiViewModelAvatarPictureTileModel* self,
                                                                        GdkRGBA * result);
VALA_EXTERN void dino_ui_view_model_avatar_picture_tile_model_set_background_color (DinoUiViewModelAvatarPictureTileModel* self,
                                                                        GdkRGBA * value);
static gboolean _gdk_rgba_equal (const GdkRGBA * s1,
                          const GdkRGBA * s2);
VALA_EXTERN GFile* dino_ui_view_model_avatar_picture_tile_model_get_image_file (DinoUiViewModelAvatarPictureTileModel* self);
VALA_EXTERN void dino_ui_view_model_avatar_picture_tile_model_set_image_file (DinoUiViewModelAvatarPictureTileModel* self,
                                                                  GFile* value);
static void dino_ui_view_model_avatar_picture_tile_model_finalize (GObject * obj);
static GType dino_ui_view_model_avatar_picture_tile_model_get_type_once (void);
static void _vala_dino_ui_view_model_avatar_picture_tile_model_get_property (GObject * object,
                                                                      guint property_id,
                                                                      GValue * value,
                                                                      GParamSpec * pspec);
static void _vala_dino_ui_view_model_avatar_picture_tile_model_set_property (GObject * object,
                                                                      guint property_id,
                                                                      const GValue * value,
                                                                      GParamSpec * pspec);
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 DinoUiViewModelAvatarPictureModel* dino_ui_view_model_avatar_picture_model_new (void);
VALA_EXTERN DinoUiViewModelAvatarPictureModel* dino_ui_view_model_avatar_picture_model_construct (GType object_type);
VALA_EXTERN GListModel* dino_ui_view_model_avatar_picture_model_get_tiles (DinoUiViewModelAvatarPictureModel* self);
VALA_EXTERN void dino_ui_view_model_avatar_picture_model_set_tiles (DinoUiViewModelAvatarPictureModel* self,
                                                        GListModel* value);
static void dino_ui_view_model_avatar_picture_model_finalize (GObject * obj);
static GType dino_ui_view_model_avatar_picture_model_get_type_once (void);
static void _vala_dino_ui_view_model_avatar_picture_model_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec);
static void _vala_dino_ui_view_model_avatar_picture_model_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec);
VALA_EXTERN GType dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelConversationParticipantAvatarPictureTileModel, g_object_unref)
VALA_EXTERN DinoUiViewModelConversationParticipantAvatarPictureTileModel* dino_ui_view_model_conversation_participant_avatar_picture_tile_model_new (DinoStreamInteractor* stream_interactor,
                                                                                                                                         DinoEntitiesConversation* conversation,
                                                                                                                                         XmppJid* jid);
VALA_EXTERN DinoUiViewModelConversationParticipantAvatarPictureTileModel* dino_ui_view_model_conversation_participant_avatar_picture_tile_model_construct (GType object_type,
                                                                                                                                               DinoStreamInteractor* stream_interactor,
                                                                                                                                               DinoEntitiesConversation* conversation,
                                                                                                                                               XmppJid* jid);
static DinoMucManager* dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_muc_manager (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self);
VALA_EXTERN gchar* dino_ui_util_get_participant_display_name (DinoStreamInteractor* stream_interactor,
                                                  DinoEntitiesConversation* conversation,
                                                  XmppJid* participant,
                                                  gboolean me_is_me);
static void dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_roster_updated (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self,
                                                                                              DinoEntitiesAccount* account,
                                                                                              XmppJid* jid);
static void _dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_roster_updated_dino_roster_manager_updated_roster_item (DinoRosterManager* _sender,
                                                                                                                                       DinoEntitiesAccount* account,
                                                                                                                                       XmppJid* jid,
                                                                                                                                       XmppRosterItem* roster_item,
                                                                                                                                       gpointer self);
static void dino_ui_view_model_conversation_participant_avatar_picture_tile_model_update_image_file (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self);
static DinoAvatarManager* dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_avatar_manager (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self);
static void dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self,
                                                                                               XmppJid* jid,
                                                                                               DinoEntitiesAccount* account);
static void _dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar_dino_avatar_manager_received_avatar (DinoAvatarManager* _sender,
                                                                                                                                    XmppJid* jid,
                                                                                                                                    DinoEntitiesAccount* account,
                                                                                                                                    gpointer self);
static void _dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar_dino_avatar_manager_fetched_avatar (DinoAvatarManager* _sender,
                                                                                                                                   XmppJid* jid,
                                                                                                                                   DinoEntitiesAccount* account,
                                                                                                                                   gpointer self);
static void dino_ui_view_model_conversation_participant_avatar_picture_tile_model_finalize (GObject * obj);
static GType dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_type_once (void);
static void _vala_dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_property (GObject * object,
                                                                                               guint property_id,
                                                                                               GValue * value,
                                                                                               GParamSpec * pspec);
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_new (DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_construct (GType object_type,
                                                                                                   DinoStreamInteractor* stream_interactor);
static void dino_ui_view_model_compat_avatar_picture_model_connect_signals_weak (DinoUiViewModelCompatAvatarPictureModel* model_);
static Block74Data* block74_data_ref (Block74Data* _data74_);
static void block74_data_unref (void * _userdata_);
static DinoMucManager* dino_ui_view_model_compat_avatar_picture_model_get_muc_manager (DinoUiViewModelCompatAvatarPictureModel* self);
static void __lambda17_ (Block74Data* _data74_,
                  DinoMucManager* muc_manager,
                  DinoEntitiesAccount* account,
                  XmppJid* room,
                  XmppJid* jid);
static void dino_ui_view_model_compat_avatar_picture_model_on_room_updated (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                     DinoEntitiesAccount* account,
                                                                     XmppJid* room);
static void ___lambda17__dino_muc_manager_private_room_occupant_updated (DinoMucManager* _sender,
                                                                  DinoEntitiesAccount* account,
                                                                  XmppJid* room,
                                                                  XmppJid* occupant,
                                                                  gpointer self);
static void __lambda18_ (Block74Data* _data74_,
                  DinoMucManager* muc_manager,
                  DinoEntitiesAccount* account,
                  XmppJid* room);
static void ___lambda18__dino_muc_manager_room_info_updated (DinoMucManager* _sender,
                                                      DinoEntitiesAccount* account,
                                                      XmppJid* muc_jid,
                                                      gpointer self);
static DinoAvatarManager* dino_ui_view_model_compat_avatar_picture_model_get_avatar_manager (DinoUiViewModelCompatAvatarPictureModel* self);
static void __lambda19_ (Block74Data* _data74_,
                  DinoAvatarManager* avatar_manager,
                  XmppJid* jid,
                  DinoEntitiesAccount* account);
static void dino_ui_view_model_compat_avatar_picture_model_on_received_avatar (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                        XmppJid* jid,
                                                                        DinoEntitiesAccount* account);
static void ___lambda19__dino_avatar_manager_received_avatar (DinoAvatarManager* _sender,
                                                       XmppJid* jid,
                                                       DinoEntitiesAccount* account,
                                                       gpointer self);
static void __lambda20_ (Block74Data* _data74_,
                  DinoAvatarManager* avatar_manager,
                  XmppJid* jid,
                  DinoEntitiesAccount* account);
static void ___lambda20__dino_avatar_manager_fetched_avatar (DinoAvatarManager* _sender,
                                                      XmppJid* jid,
                                                      DinoEntitiesAccount* account,
                                                      gpointer self);
VALA_EXTERN void dino_ui_view_model_compat_avatar_picture_model_reset (DinoUiViewModelCompatAvatarPictureModel* self);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_set_conversation (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                                                          DinoEntitiesConversation* conversation);
static DinoUiViewModelAvatarPictureTileModel* dino_ui_view_model_compat_avatar_picture_model_add_internal (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                                                    const gchar* display,
                                                                                                    const gchar* color_id,
                                                                                                    GFile* image_file);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_add_participant (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                                                         DinoEntitiesConversation* conversation,
                                                                                                         XmppJid* jid);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_add (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                                             const gchar* display,
                                                                                             const gchar* color_id,
                                                                                             GFile* image_file);
static DinoPresenceManager* dino_ui_view_model_compat_avatar_picture_model_get_presence_manager (DinoUiViewModelCompatAvatarPictureModel* self);
static DinoConnectionManager* dino_ui_view_model_compat_avatar_picture_model_get_connection_manager (DinoUiViewModelCompatAvatarPictureModel* self);
static GObject * dino_ui_view_model_compat_avatar_picture_model_constructor (GType type,
                                                                      guint n_construct_properties,
                                                                      GObjectConstructParam * construct_properties);
static void dino_ui_view_model_compat_avatar_picture_model_finalize (GObject * obj);
static GType dino_ui_view_model_compat_avatar_picture_model_get_type_once (void);
static void _vala_dino_ui_view_model_compat_avatar_picture_model_get_property (GObject * object,
                                                                        guint property_id,
                                                                        GValue * value,
                                                                        GParamSpec * pspec);
VALA_EXTERN gpointer dino_ui_compat_avatar_drawer_ref (gpointer instance);
VALA_EXTERN void dino_ui_compat_avatar_drawer_unref (gpointer instance);
VALA_EXTERN GParamSpec* dino_ui_param_spec_compat_avatar_drawer (const gchar* name,
                                                     const gchar* nick,
                                                     const gchar* blurb,
                                                     GType object_type,
                                                     GParamFlags flags);
VALA_EXTERN void dino_ui_value_set_compat_avatar_drawer (GValue* value,
                                             gpointer v_object);
VALA_EXTERN void dino_ui_value_take_compat_avatar_drawer (GValue* value,
                                              gpointer v_object);
VALA_EXTERN gpointer dino_ui_value_get_compat_avatar_drawer (const GValue* value);
VALA_EXTERN GType dino_ui_compat_avatar_drawer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiCompatAvatarDrawer, dino_ui_compat_avatar_drawer_unref)
VALA_EXTERN cairo_surface_t* dino_ui_compat_avatar_drawer_draw_image_surface (DinoUiCompatAvatarDrawer* self);
VALA_EXTERN gint dino_ui_compat_avatar_drawer_get_width_request (DinoUiCompatAvatarDrawer* self);
VALA_EXTERN gint dino_ui_compat_avatar_drawer_get_height_request (DinoUiCompatAvatarDrawer* self);
VALA_EXTERN void dino_ui_compat_avatar_drawer_draw_on_context (DinoUiCompatAvatarDrawer* self,
                                                   cairo_t* ctx);
VALA_EXTERN gfloat dino_ui_compat_avatar_drawer_get_radius_percent (DinoUiCompatAvatarDrawer* self);
VALA_EXTERN DinoUiViewModelAvatarPictureModel* dino_ui_compat_avatar_drawer_get_model (DinoUiCompatAvatarDrawer* self);
static cairo_surface_t* dino_ui_compat_avatar_drawer_sub_surface_idx (DinoUiCompatAvatarDrawer* self,
                                                               cairo_t* ctx,
                                                               gint idx,
                                                               gint width,
                                                               gint height,
                                                               gint font_factor);
static cairo_surface_t* dino_ui_compat_avatar_drawer_sub_surface (cairo_t* ctx,
                                                           const gchar* font_family,
                                                           GdkPixbuf* avatar,
                                                           const gchar* name,
                                                           GdkRGBA* background_color,
                                                           gint width,
                                                           gint height,
                                                           gint font_factor);
VALA_EXTERN const gchar* dino_ui_compat_avatar_drawer_get_font_family (DinoUiCompatAvatarDrawer* self);
VALA_EXTERN DinoUiCompatAvatarDrawer* dino_ui_compat_avatar_drawer_new (void);
VALA_EXTERN DinoUiCompatAvatarDrawer* dino_ui_compat_avatar_drawer_construct (GType object_type);
VALA_EXTERN void dino_ui_compat_avatar_drawer_set_radius_percent (DinoUiCompatAvatarDrawer* self,
                                                      gfloat value);
VALA_EXTERN void dino_ui_compat_avatar_drawer_set_model (DinoUiCompatAvatarDrawer* self,
                                             DinoUiViewModelAvatarPictureModel* value);
VALA_EXTERN void dino_ui_compat_avatar_drawer_set_height_request (DinoUiCompatAvatarDrawer* self,
                                                      gint value);
VALA_EXTERN void dino_ui_compat_avatar_drawer_set_width_request (DinoUiCompatAvatarDrawer* self,
                                                     gint value);
VALA_EXTERN void dino_ui_compat_avatar_drawer_set_font_family (DinoUiCompatAvatarDrawer* self,
                                                   const gchar* value);
static void dino_ui_compat_avatar_drawer_finalize (DinoUiCompatAvatarDrawer * obj);
static GType dino_ui_compat_avatar_drawer_get_type_once (void);
VALA_EXTERN GType dino_ui_avatar_picture_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiAvatarPicture, g_object_unref)
static GType dino_ui_avatar_picture_tile_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiAvatarPictureTile, g_object_unref)
static void dino_ui_avatar_picture_on_model_changed (DinoUiAvatarPicture* self);
VALA_EXTERN DinoUiViewModelAvatarPictureModel* dino_ui_avatar_picture_get_model (DinoUiAvatarPicture* self);
static void dino_ui_avatar_picture_on_model_items_changed (DinoUiAvatarPicture* self,
                                                    guint position,
                                                    guint removed,
                                                    guint added);
static void _dino_ui_avatar_picture_on_model_items_changed_g_list_model_items_changed (GListModel* _sender,
                                                                                guint position,
                                                                                guint removed,
                                                                                guint added,
                                                                                gpointer self);
static DinoUiAvatarPictureTile* dino_ui_avatar_picture_tile_new (void);
static DinoUiAvatarPictureTile* dino_ui_avatar_picture_tile_construct (GType object_type);
static void dino_ui_avatar_picture_tile_set_model (DinoUiAvatarPictureTile* self,
                                            DinoUiViewModelAvatarPictureTileModel* value);
static void dino_ui_avatar_picture_real_measure (GtkWidget* base,
                                          GtkOrientation orientation,
                                          gint for_size,
                                          gint* minimum,
                                          gint* natural,
                                          gint* minimum_baseline,
                                          gint* natural_baseline);
static void dino_ui_avatar_picture_real_size_allocate (GtkWidget* base,
                                                gint width,
                                                gint height,
                                                gint baseline);
static GtkSizeRequestMode dino_ui_avatar_picture_real_get_request_mode (GtkWidget* base);
static void dino_ui_avatar_picture_real_snapshot (GtkWidget* base,
                                           GtkSnapshot* snapshot);
VALA_EXTERN gfloat dino_ui_avatar_picture_get_radius_percent (DinoUiAvatarPicture* self);
static void dino_ui_avatar_picture_real_dispose (GObject* base);
VALA_EXTERN void dino_ui_avatar_picture_set_model (DinoUiAvatarPicture* self,
                                       DinoUiViewModelAvatarPictureModel* value);
VALA_EXTERN DinoUiAvatarPicture* dino_ui_avatar_picture_new (void);
VALA_EXTERN DinoUiAvatarPicture* dino_ui_avatar_picture_construct (GType object_type);
VALA_EXTERN void dino_ui_avatar_picture_set_radius_percent (DinoUiAvatarPicture* self,
                                                gfloat value);
static void dino_ui_avatar_picture_tile_on_model_changed (DinoUiAvatarPictureTile* self);
static DinoUiViewModelAvatarPictureTileModel* dino_ui_avatar_picture_tile_get_model (DinoUiAvatarPictureTile* self);
static void dino_ui_avatar_picture_tile_real_dispose (GObject* base);
static void dino_ui_avatar_picture_tile_real_size_allocate (GtkWidget* base,
                                                     gint width,
                                                     gint height,
                                                     gint baseline);
static void dino_ui_avatar_picture_tile_real_snapshot (GtkWidget* base,
                                                GtkSnapshot* snapshot);
static void dino_ui_avatar_picture_tile_get_background_color (DinoUiAvatarPictureTile* self,
                                                       GdkRGBA * result);
static void dino_ui_avatar_picture_tile_set_background_color (DinoUiAvatarPictureTile* self,
                                                       GdkRGBA * value);
static const gchar* dino_ui_avatar_picture_tile_get_display_text (DinoUiAvatarPictureTile* self);
static void dino_ui_avatar_picture_tile_set_display_text (DinoUiAvatarPictureTile* self,
                                                   const gchar* value);
static GFile* dino_ui_avatar_picture_tile_get_image_file (DinoUiAvatarPictureTile* self);
static void dino_ui_avatar_picture_tile_set_image_file (DinoUiAvatarPictureTile* self,
                                                 GFile* value);
static GObject * dino_ui_avatar_picture_tile_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static void _dino_ui_avatar_picture_tile_on_model_changed_g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self);
static void dino_ui_avatar_picture_tile_finalize (GObject * obj);
static GType dino_ui_avatar_picture_tile_get_type_once (void);
static void _vala_dino_ui_avatar_picture_tile_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_dino_ui_avatar_picture_tile_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static GObject * dino_ui_avatar_picture_constructor (GType type,
                                              guint n_construct_properties,
                                              GObjectConstructParam * construct_properties);
static void _gtk_widget_queue_draw_g_object_notify (GObject* _sender,
                                             GParamSpec* pspec,
                                             gpointer self);
static void _dino_ui_avatar_picture_on_model_changed_g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self);
static void dino_ui_avatar_picture_finalize (GObject * obj);
static GType dino_ui_avatar_picture_get_type_once (void);
static void _vala_dino_ui_avatar_picture_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_dino_ui_avatar_picture_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
dino_ui_view_model_avatar_picture_tile_model_get_instance_private (DinoUiViewModelAvatarPictureTileModel* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiViewModelAvatarPictureTileModel_private_offset);
}

DinoUiViewModelAvatarPictureTileModel*
dino_ui_view_model_avatar_picture_tile_model_construct (GType object_type)
{
	DinoUiViewModelAvatarPictureTileModel * self = NULL;
	self = (DinoUiViewModelAvatarPictureTileModel*) g_object_new (object_type, NULL);
	return self;
}

DinoUiViewModelAvatarPictureTileModel*
dino_ui_view_model_avatar_picture_tile_model_new (void)
{
	return dino_ui_view_model_avatar_picture_tile_model_construct (DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL);
}

const gchar*
dino_ui_view_model_avatar_picture_tile_model_get_display_text (DinoUiViewModelAvatarPictureTileModel* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_text;
	result = _tmp0_;
	return result;
}

void
dino_ui_view_model_avatar_picture_tile_model_set_display_text (DinoUiViewModelAvatarPictureTileModel* self,
                                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_avatar_picture_tile_model_get_display_text (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_display_text);
		self->priv->_display_text = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_avatar_picture_tile_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_DISPLAY_TEXT_PROPERTY]);
	}
}

void
dino_ui_view_model_avatar_picture_tile_model_get_background_color (DinoUiViewModelAvatarPictureTileModel* self,
                                                                   GdkRGBA * result)
{
	GdkRGBA _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_background_color;
	*result = _tmp0_;
	return;
}

static gboolean
_gdk_rgba_equal (const GdkRGBA * s1,
                 const GdkRGBA * s2)
{
	if (s1 == s2) {
		return TRUE;
	}
	if (s1 == NULL) {
		return FALSE;
	}
	if (s2 == NULL) {
		return FALSE;
	}
	if (s1->red != s2->red) {
		return FALSE;
	}
	if (s1->green != s2->green) {
		return FALSE;
	}
	if (s1->blue != s2->blue) {
		return FALSE;
	}
	if (s1->alpha != s2->alpha) {
		return FALSE;
	}
	return TRUE;
}

void
dino_ui_view_model_avatar_picture_tile_model_set_background_color (DinoUiViewModelAvatarPictureTileModel* self,
                                                                   GdkRGBA * value)
{
	GdkRGBA old_value;
	g_return_if_fail (self != NULL);
	dino_ui_view_model_avatar_picture_tile_model_get_background_color (self, &old_value);
	if (_gdk_rgba_equal (value, &old_value) != TRUE) {
		GdkRGBA _tmp0_;
		_tmp0_ = *value;
		self->priv->_background_color = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_avatar_picture_tile_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_BACKGROUND_COLOR_PROPERTY]);
	}
}

GFile*
dino_ui_view_model_avatar_picture_tile_model_get_image_file (DinoUiViewModelAvatarPictureTileModel* self)
{
	GFile* result;
	GFile* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_image_file;
	result = _tmp0_;
	return result;
}

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

void
dino_ui_view_model_avatar_picture_tile_model_set_image_file (DinoUiViewModelAvatarPictureTileModel* self,
                                                             GFile* value)
{
	GFile* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_avatar_picture_tile_model_get_image_file (self);
	if (old_value != value) {
		GFile* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_image_file);
		self->priv->_image_file = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_avatar_picture_tile_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_IMAGE_FILE_PROPERTY]);
	}
}

static void
dino_ui_view_model_avatar_picture_tile_model_class_init (DinoUiViewModelAvatarPictureTileModelClass * klass,
                                                         gpointer klass_data)
{
	dino_ui_view_model_avatar_picture_tile_model_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiViewModelAvatarPictureTileModel_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_view_model_avatar_picture_tile_model_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_view_model_avatar_picture_tile_model_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_view_model_avatar_picture_tile_model_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_DISPLAY_TEXT_PROPERTY, dino_ui_view_model_avatar_picture_tile_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_DISPLAY_TEXT_PROPERTY] = g_param_spec_string ("display-text", "display-text", "display-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_BACKGROUND_COLOR_PROPERTY, dino_ui_view_model_avatar_picture_tile_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_BACKGROUND_COLOR_PROPERTY] = g_param_spec_boxed ("background-color", "background-color", "background-color", gdk_rgba_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_IMAGE_FILE_PROPERTY, dino_ui_view_model_avatar_picture_tile_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_IMAGE_FILE_PROPERTY] = g_param_spec_object ("image-file", "image-file", "image-file", g_file_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_ui_view_model_avatar_picture_tile_model_instance_init (DinoUiViewModelAvatarPictureTileModel * self,
                                                            gpointer klass)
{
	self->priv = dino_ui_view_model_avatar_picture_tile_model_get_instance_private (self);
}

static void
dino_ui_view_model_avatar_picture_tile_model_finalize (GObject * obj)
{
	DinoUiViewModelAvatarPictureTileModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelAvatarPictureTileModel);
	_g_free0 (self->priv->_display_text);
	_g_object_unref0 (self->priv->_image_file);
	G_OBJECT_CLASS (dino_ui_view_model_avatar_picture_tile_model_parent_class)->finalize (obj);
}

static GType
dino_ui_view_model_avatar_picture_tile_model_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiViewModelAvatarPictureTileModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_view_model_avatar_picture_tile_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiViewModelAvatarPictureTileModel), 0, (GInstanceInitFunc) dino_ui_view_model_avatar_picture_tile_model_instance_init, NULL };
	GType dino_ui_view_model_avatar_picture_tile_model_type_id;
	dino_ui_view_model_avatar_picture_tile_model_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoUiViewModelAvatarPictureTileModel", &g_define_type_info, 0);
	DinoUiViewModelAvatarPictureTileModel_private_offset = g_type_add_instance_private (dino_ui_view_model_avatar_picture_tile_model_type_id, sizeof (DinoUiViewModelAvatarPictureTileModelPrivate));
	return dino_ui_view_model_avatar_picture_tile_model_type_id;
}

GType
dino_ui_view_model_avatar_picture_tile_model_get_type (void)
{
	static volatile gsize dino_ui_view_model_avatar_picture_tile_model_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_view_model_avatar_picture_tile_model_type_id__once)) {
		GType dino_ui_view_model_avatar_picture_tile_model_type_id;
		dino_ui_view_model_avatar_picture_tile_model_type_id = dino_ui_view_model_avatar_picture_tile_model_get_type_once ();
		g_once_init_leave (&dino_ui_view_model_avatar_picture_tile_model_type_id__once, dino_ui_view_model_avatar_picture_tile_model_type_id);
	}
	return dino_ui_view_model_avatar_picture_tile_model_type_id__once;
}

static void
_vala_dino_ui_view_model_avatar_picture_tile_model_get_property (GObject * object,
                                                                 guint property_id,
                                                                 GValue * value,
                                                                 GParamSpec * pspec)
{
	DinoUiViewModelAvatarPictureTileModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelAvatarPictureTileModel);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_DISPLAY_TEXT_PROPERTY:
		g_value_set_string (value, dino_ui_view_model_avatar_picture_tile_model_get_display_text (self));
		break;
		case DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_BACKGROUND_COLOR_PROPERTY:
		{
			GdkRGBA boxed;
			dino_ui_view_model_avatar_picture_tile_model_get_background_color (self, &boxed);
			g_value_set_boxed (value, &boxed);
		}
		break;
		case DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_IMAGE_FILE_PROPERTY:
		g_value_set_object (value, dino_ui_view_model_avatar_picture_tile_model_get_image_file (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_view_model_avatar_picture_tile_model_set_property (GObject * object,
                                                                 guint property_id,
                                                                 const GValue * value,
                                                                 GParamSpec * pspec)
{
	DinoUiViewModelAvatarPictureTileModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelAvatarPictureTileModel);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_DISPLAY_TEXT_PROPERTY:
		dino_ui_view_model_avatar_picture_tile_model_set_display_text (self, g_value_get_string (value));
		break;
		case DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_BACKGROUND_COLOR_PROPERTY:
		dino_ui_view_model_avatar_picture_tile_model_set_background_color (self, g_value_get_boxed (value));
		break;
		case DINO_UI_VIEW_MODEL_AVATAR_PICTURE_TILE_MODEL_IMAGE_FILE_PROPERTY:
		dino_ui_view_model_avatar_picture_tile_model_set_image_file (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_ui_view_model_avatar_picture_model_get_instance_private (DinoUiViewModelAvatarPictureModel* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiViewModelAvatarPictureModel_private_offset);
}

DinoUiViewModelAvatarPictureModel*
dino_ui_view_model_avatar_picture_model_construct (GType object_type)
{
	DinoUiViewModelAvatarPictureModel * self = NULL;
	self = (DinoUiViewModelAvatarPictureModel*) g_object_new (object_type, NULL);
	return self;
}

DinoUiViewModelAvatarPictureModel*
dino_ui_view_model_avatar_picture_model_new (void)
{
	return dino_ui_view_model_avatar_picture_model_construct (DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL);
}

GListModel*
dino_ui_view_model_avatar_picture_model_get_tiles (DinoUiViewModelAvatarPictureModel* self)
{
	GListModel* result;
	GListModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tiles;
	result = _tmp0_;
	return result;
}

void
dino_ui_view_model_avatar_picture_model_set_tiles (DinoUiViewModelAvatarPictureModel* self,
                                                   GListModel* value)
{
	GListModel* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_view_model_avatar_picture_model_get_tiles (self);
	if (old_value != value) {
		GListModel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_tiles);
		self->priv->_tiles = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_view_model_avatar_picture_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_TILES_PROPERTY]);
	}
}

static void
dino_ui_view_model_avatar_picture_model_class_init (DinoUiViewModelAvatarPictureModelClass * klass,
                                                    gpointer klass_data)
{
	dino_ui_view_model_avatar_picture_model_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiViewModelAvatarPictureModel_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_view_model_avatar_picture_model_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_view_model_avatar_picture_model_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_view_model_avatar_picture_model_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_TILES_PROPERTY, dino_ui_view_model_avatar_picture_model_properties[DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_TILES_PROPERTY] = g_param_spec_object ("tiles", "tiles", "tiles", g_list_model_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_ui_view_model_avatar_picture_model_instance_init (DinoUiViewModelAvatarPictureModel * self,
                                                       gpointer klass)
{
	self->priv = dino_ui_view_model_avatar_picture_model_get_instance_private (self);
}

static void
dino_ui_view_model_avatar_picture_model_finalize (GObject * obj)
{
	DinoUiViewModelAvatarPictureModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModel);
	_g_object_unref0 (self->priv->_tiles);
	G_OBJECT_CLASS (dino_ui_view_model_avatar_picture_model_parent_class)->finalize (obj);
}

static GType
dino_ui_view_model_avatar_picture_model_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiViewModelAvatarPictureModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_view_model_avatar_picture_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiViewModelAvatarPictureModel), 0, (GInstanceInitFunc) dino_ui_view_model_avatar_picture_model_instance_init, NULL };
	GType dino_ui_view_model_avatar_picture_model_type_id;
	dino_ui_view_model_avatar_picture_model_type_id = g_type_register_static (G_TYPE_OBJECT, "DinoUiViewModelAvatarPictureModel", &g_define_type_info, 0);
	DinoUiViewModelAvatarPictureModel_private_offset = g_type_add_instance_private (dino_ui_view_model_avatar_picture_model_type_id, sizeof (DinoUiViewModelAvatarPictureModelPrivate));
	return dino_ui_view_model_avatar_picture_model_type_id;
}

GType
dino_ui_view_model_avatar_picture_model_get_type (void)
{
	static volatile gsize dino_ui_view_model_avatar_picture_model_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_view_model_avatar_picture_model_type_id__once)) {
		GType dino_ui_view_model_avatar_picture_model_type_id;
		dino_ui_view_model_avatar_picture_model_type_id = dino_ui_view_model_avatar_picture_model_get_type_once ();
		g_once_init_leave (&dino_ui_view_model_avatar_picture_model_type_id__once, dino_ui_view_model_avatar_picture_model_type_id);
	}
	return dino_ui_view_model_avatar_picture_model_type_id__once;
}

static void
_vala_dino_ui_view_model_avatar_picture_model_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec)
{
	DinoUiViewModelAvatarPictureModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModel);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_TILES_PROPERTY:
		g_value_set_object (value, dino_ui_view_model_avatar_picture_model_get_tiles (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_view_model_avatar_picture_model_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec)
{
	DinoUiViewModelAvatarPictureModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, DinoUiViewModelAvatarPictureModel);
	switch (property_id) {
		case DINO_UI_VIEW_MODEL_AVATAR_PICTURE_MODEL_TILES_PROPERTY:
		dino_ui_view_model_avatar_picture_model_set_tiles (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_instance_private (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiViewModelConversationParticipantAvatarPictureTileModel_private_offset);
}

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

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 gunichar
string_get_char (const gchar* self,
                 glong index)
{
	gunichar result;
	g_return_val_if_fail (self != NULL, 0U);
	result = g_utf8_get_char (((gchar*) self) + index);
	return result;
}

static gchar*
g_unichar_to_string (gunichar self)
{
	gchar* str = NULL;
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_new0 (gchar, 7);
	str = (gchar*) _tmp0_;
	g_unichar_to_utf8 (self, str);
	result = str;
	return result;
}

static void
_dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_roster_updated_dino_roster_manager_updated_roster_item (DinoRosterManager* _sender,
                                                                                                                                  DinoEntitiesAccount* account,
                                                                                                                                  XmppJid* jid,
                                                                                                                                  XmppRosterItem* roster_item,
                                                                                                                                  gpointer self)
{
	dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_roster_updated ((DinoUiViewModelConversationParticipantAvatarPictureTileModel*) self, account, jid);
}

static void
_dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar_dino_avatar_manager_received_avatar (DinoAvatarManager* _sender,
                                                                                                                               XmppJid* jid,
                                                                                                                               DinoEntitiesAccount* account,
                                                                                                                               gpointer self)
{
	dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar ((DinoUiViewModelConversationParticipantAvatarPictureTileModel*) self, jid, account);
}

static void
_dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar_dino_avatar_manager_fetched_avatar (DinoAvatarManager* _sender,
                                                                                                                              XmppJid* jid,
                                                                                                                              DinoEntitiesAccount* account,
                                                                                                                              gpointer self)
{
	dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar ((DinoUiViewModelConversationParticipantAvatarPictureTileModel*) self, jid, account);
}

DinoUiViewModelConversationParticipantAvatarPictureTileModel*
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_construct (GType object_type,
                                                                                 DinoStreamInteractor* stream_interactor,
                                                                                 DinoEntitiesConversation* conversation,
                                                                                 XmppJid* jid)
{
	DinoUiViewModelConversationParticipantAvatarPictureTileModel * self = NULL;
	DinoStreamInteractor* _tmp0_;
	DinoEntitiesConversation* _tmp1_;
	XmppJid* _tmp2_;
	XmppJid* _tmp3_;
	gchar* color_id = NULL;
	gchar* _tmp4_;
	gboolean _tmp5_ = FALSE;
	DinoEntitiesConversationType _tmp6_;
	DinoEntitiesConversationType _tmp7_;
	gchar* display = NULL;
	XmppJid* _tmp47_;
	gchar* _tmp48_;
	const gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	DinoModuleIdentity* _tmp52_;
	gpointer _tmp53_;
	DinoRosterManager* _tmp54_;
	gfloat* _tmp55_ = NULL;
	gint _tmp55__length1 = 0;
	gint __tmp55__size_ = 0;
	const gchar* _tmp56_;
	gfloat* rgbf = NULL;
	gfloat* _tmp61_;
	gint _tmp61__length1;
	gint rgbf_length1;
	gint _rgbf_size_;
	gfloat _tmp62_;
	gfloat _tmp63_;
	gfloat _tmp64_;
	GdkRGBA _tmp65_ = {0};
	DinoAvatarManager* _tmp66_;
	DinoAvatarManager* _tmp67_;
	DinoAvatarManager* _tmp68_;
	DinoAvatarManager* _tmp69_;
	DinoAvatarManager* _tmp70_;
	DinoAvatarManager* _tmp71_;
	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 = (DinoUiViewModelConversationParticipantAvatarPictureTileModel*) dino_ui_view_model_avatar_picture_tile_model_construct (object_type);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	_tmp1_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->priv->conversation);
	self->priv->conversation = _tmp1_;
	_tmp2_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (self->priv->primary_avatar_jid);
	self->priv->primary_avatar_jid = _tmp2_;
	_tmp3_ = _xmpp_jid_ref0 (jid);
	_xmpp_jid_unref0 (self->priv->display_name_jid);
	self->priv->display_name_jid = _tmp3_;
	_tmp4_ = xmpp_jid_to_string (jid);
	color_id = _tmp4_;
	_tmp6_ = dino_entities_conversation_get_type_ (conversation);
	_tmp7_ = _tmp6_;
	if (_tmp7_ != DINO_ENTITIES_CONVERSATION_TYPE_CHAT) {
		XmppJid* _tmp8_;
		XmppJid* _tmp9_;
		XmppJid* _tmp10_;
		_tmp8_ = self->priv->primary_avatar_jid;
		_tmp9_ = dino_entities_conversation_get_counterpart (conversation);
		_tmp10_ = _tmp9_;
		_tmp5_ = xmpp_jid_equals_bare (_tmp8_, _tmp10_);
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		XmppJid* real_jid = NULL;
		DinoMucManager* _tmp11_;
		DinoMucManager* _tmp12_;
		DinoMucManager* _tmp13_;
		XmppJid* _tmp14_;
		DinoEntitiesAccount* _tmp15_;
		DinoEntitiesAccount* _tmp16_;
		XmppJid* _tmp17_;
		XmppJid* _tmp18_;
		gboolean _tmp19_ = FALSE;
		XmppJid* _tmp20_;
		_tmp11_ = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_muc_manager (self);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		_tmp14_ = self->priv->primary_avatar_jid;
		_tmp15_ = dino_entities_conversation_get_account (conversation);
		_tmp16_ = _tmp15_;
		_tmp17_ = dino_muc_manager_get_real_jid (_tmp13_, _tmp14_, _tmp16_);
		_tmp18_ = _tmp17_;
		_g_object_unref0 (_tmp13_);
		real_jid = _tmp18_;
		_tmp20_ = real_jid;
		if (_tmp20_ != NULL) {
			DinoMucManager* _tmp21_;
			DinoMucManager* _tmp22_;
			DinoMucManager* _tmp23_;
			DinoEntitiesAccount* _tmp24_;
			DinoEntitiesAccount* _tmp25_;
			XmppJid* _tmp26_;
			XmppJid* _tmp27_;
			XmppJid* _tmp28_;
			XmppJid* _tmp29_;
			XmppJid* _tmp30_;
			_tmp21_ = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_muc_manager (self);
			_tmp22_ = _tmp21_;
			_tmp23_ = _tmp22_;
			_tmp24_ = dino_entities_conversation_get_account (conversation);
			_tmp25_ = _tmp24_;
			_tmp26_ = dino_entities_conversation_get_counterpart (conversation);
			_tmp27_ = _tmp26_;
			_tmp28_ = xmpp_jid_get_bare_jid (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp30_ = _tmp29_;
			_tmp19_ = dino_muc_manager_is_private_room (_tmp23_, _tmp25_, _tmp30_);
			_xmpp_jid_unref0 (_tmp30_);
			_g_object_unref0 (_tmp23_);
		} else {
			_tmp19_ = FALSE;
		}
		if (_tmp19_) {
			XmppJid* _tmp31_;
			XmppJid* _tmp32_;
			XmppJid* _tmp33_;
			XmppJid* _tmp34_;
			XmppJid* _tmp35_;
			XmppJid* _tmp36_;
			gchar* _tmp37_;
			_tmp31_ = self->priv->primary_avatar_jid;
			_tmp32_ = _xmpp_jid_ref0 (_tmp31_);
			_xmpp_jid_unref0 (self->priv->secondary_avatar_jid);
			self->priv->secondary_avatar_jid = _tmp32_;
			_tmp33_ = real_jid;
			_tmp34_ = xmpp_jid_get_bare_jid (_tmp33_);
			_tmp35_ = _tmp34_;
			_xmpp_jid_unref0 (self->priv->primary_avatar_jid);
			self->priv->primary_avatar_jid = _tmp35_;
			_tmp36_ = self->priv->primary_avatar_jid;
			_tmp37_ = xmpp_jid_to_string (_tmp36_);
			_g_free0 (color_id);
			color_id = _tmp37_;
		} else {
			const gchar* _tmp38_;
			const gchar* _tmp39_;
			gchar* _tmp40_;
			_tmp38_ = jid->resourcepart;
			_tmp39_ = string_to_string (_tmp38_);
			_tmp40_ = g_strdup (_tmp39_);
			_g_free0 (color_id);
			color_id = _tmp40_;
		}
		_xmpp_jid_unref0 (real_jid);
	} else {
		DinoEntitiesConversationType _tmp41_;
		DinoEntitiesConversationType _tmp42_;
		_tmp41_ = dino_entities_conversation_get_type_ (conversation);
		_tmp42_ = _tmp41_;
		if (_tmp42_ == DINO_ENTITIES_CONVERSATION_TYPE_CHAT) {
			XmppJid* _tmp43_;
			XmppJid* _tmp44_;
			XmppJid* _tmp45_;
			gchar* _tmp46_;
			_tmp43_ = xmpp_jid_get_bare_jid (jid);
			_tmp44_ = _tmp43_;
			_xmpp_jid_unref0 (self->priv->primary_avatar_jid);
			self->priv->primary_avatar_jid = _tmp44_;
			_tmp45_ = self->priv->primary_avatar_jid;
			_tmp46_ = xmpp_jid_to_string (_tmp45_);
			_g_free0 (color_id);
			color_id = _tmp46_;
		}
	}
	_tmp47_ = self->priv->display_name_jid;
	_tmp48_ = dino_ui_util_get_participant_display_name (stream_interactor, conversation, _tmp47_, FALSE);
	display = _tmp48_;
	_tmp49_ = display;
	_tmp50_ = g_unichar_to_string (g_unichar_toupper (string_get_char (_tmp49_, (glong) 0)));
	_tmp51_ = _tmp50_;
	dino_ui_view_model_avatar_picture_tile_model_set_display_text ((DinoUiViewModelAvatarPictureTileModel*) self, _tmp51_);
	_g_free0 (_tmp51_);
	_tmp52_ = dino_roster_manager_IDENTITY;
	_tmp53_ = dino_stream_interactor_get_module (stream_interactor, DINO_TYPE_ROSTER_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp52_);
	_tmp54_ = (DinoRosterManager*) _tmp53_;
	g_signal_connect_object (_tmp54_, "updated-roster-item", (GCallback) _dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_roster_updated_dino_roster_manager_updated_roster_item, self, 0);
	_g_object_unref0 (_tmp54_);
	_tmp56_ = color_id;
	if (_tmp56_ != NULL) {
		const gchar* _tmp57_;
		gint _tmp58_ = 0;
		gfloat* _tmp59_;
		_tmp57_ = color_id;
		_tmp59_ = xmpp_xep_consistent_color_string_to_rgbf (_tmp57_, &_tmp58_);
		_tmp55_ = (g_free (_tmp55_), NULL);
		_tmp55_ = _tmp59_;
		_tmp55__length1 = _tmp58_;
		__tmp55__size_ = _tmp55__length1;
	} else {
		gfloat* _tmp60_;
		_tmp60_ = g_new0 (gfloat, 3);
		_tmp60_[0] = 0.5f;
		_tmp60_[1] = 0.5f;
		_tmp60_[2] = 0.5f;
		_tmp55_ = (g_free (_tmp55_), NULL);
		_tmp55_ = _tmp60_;
		_tmp55__length1 = 3;
		__tmp55__size_ = _tmp55__length1;
	}
	_tmp61_ = _tmp55_;
	_tmp61__length1 = _tmp55__length1;
	_tmp55_ = NULL;
	_tmp55__length1 = 0;
	rgbf = _tmp61_;
	rgbf_length1 = _tmp61__length1;
	_rgbf_size_ = rgbf_length1;
	_tmp62_ = rgbf[0];
	_tmp63_ = rgbf[1];
	_tmp64_ = rgbf[2];
	memset (&_tmp65_, 0, sizeof (GdkRGBA));
	_tmp65_.red = _tmp62_;
	_tmp65_.green = _tmp63_;
	_tmp65_.blue = _tmp64_;
	_tmp65_.alpha = 1.0f;
	dino_ui_view_model_avatar_picture_tile_model_set_background_color ((DinoUiViewModelAvatarPictureTileModel*) self, &_tmp65_);
	dino_ui_view_model_conversation_participant_avatar_picture_tile_model_update_image_file (self);
	_tmp66_ = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_avatar_manager (self);
	_tmp67_ = _tmp66_;
	_tmp68_ = _tmp67_;
	g_signal_connect_object (_tmp68_, "received-avatar", (GCallback) _dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar_dino_avatar_manager_received_avatar, self, 0);
	_g_object_unref0 (_tmp68_);
	_tmp69_ = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_avatar_manager (self);
	_tmp70_ = _tmp69_;
	_tmp71_ = _tmp70_;
	g_signal_connect_object (_tmp71_, "fetched-avatar", (GCallback) _dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar_dino_avatar_manager_fetched_avatar, self, 0);
	_g_object_unref0 (_tmp71_);
	rgbf = (g_free (rgbf), NULL);
	_tmp55_ = (g_free (_tmp55_), NULL);
	_g_free0 (display);
	_g_free0 (color_id);
	return self;
}

DinoUiViewModelConversationParticipantAvatarPictureTileModel*
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_new (DinoStreamInteractor* stream_interactor,
                                                                           DinoEntitiesConversation* conversation,
                                                                           XmppJid* jid)
{
	return dino_ui_view_model_conversation_participant_avatar_picture_tile_model_construct (DINO_UI_VIEW_MODEL_TYPE_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL, stream_interactor, conversation, jid);
}

static void
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_update_image_file (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self)
{
	GFile* image_file = NULL;
	DinoAvatarManager* _tmp0_;
	DinoAvatarManager* _tmp1_;
	DinoAvatarManager* _tmp2_;
	DinoEntitiesConversation* _tmp3_;
	DinoEntitiesAccount* _tmp4_;
	DinoEntitiesAccount* _tmp5_;
	XmppJid* _tmp6_;
	GFile* _tmp7_;
	GFile* _tmp8_;
	gboolean _tmp9_ = FALSE;
	GFile* _tmp10_;
	GFile* _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp0_ = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_avatar_manager (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->conversation;
	_tmp4_ = dino_entities_conversation_get_account (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->primary_avatar_jid;
	_tmp7_ = dino_avatar_manager_get_avatar_file (_tmp2_, _tmp5_, _tmp6_);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp2_);
	image_file = _tmp8_;
	_tmp10_ = image_file;
	if (_tmp10_ == NULL) {
		XmppJid* _tmp11_;
		_tmp11_ = self->priv->secondary_avatar_jid;
		_tmp9_ = _tmp11_ != NULL;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		DinoAvatarManager* _tmp12_;
		DinoAvatarManager* _tmp13_;
		DinoAvatarManager* _tmp14_;
		DinoEntitiesConversation* _tmp15_;
		DinoEntitiesAccount* _tmp16_;
		DinoEntitiesAccount* _tmp17_;
		XmppJid* _tmp18_;
		GFile* _tmp19_;
		_tmp12_ = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_avatar_manager (self);
		_tmp13_ = _tmp12_;
		_tmp14_ = _tmp13_;
		_tmp15_ = self->priv->conversation;
		_tmp16_ = dino_entities_conversation_get_account (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = self->priv->secondary_avatar_jid;
		_tmp19_ = dino_avatar_manager_get_avatar_file (_tmp14_, _tmp17_, _tmp18_);
		_g_object_unref0 (image_file);
		image_file = _tmp19_;
		_g_object_unref0 (_tmp14_);
	}
	_tmp20_ = image_file;
	dino_ui_view_model_avatar_picture_tile_model_set_image_file ((DinoUiViewModelAvatarPictureTileModel*) self, _tmp20_);
	_g_object_unref0 (image_file);
}

static void
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_received_avatar (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self,
                                                                                          XmppJid* jid,
                                                                                          DinoEntitiesAccount* account)
{
	gboolean _tmp0_ = FALSE;
	DinoEntitiesConversation* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (account != NULL);
	_tmp1_ = self->priv->conversation;
	_tmp2_ = dino_entities_conversation_get_account (_tmp1_);
	_tmp3_ = _tmp2_;
	if (dino_entities_account_equals (account, _tmp3_)) {
		gboolean _tmp4_ = FALSE;
		XmppJid* _tmp5_;
		_tmp5_ = self->priv->primary_avatar_jid;
		if (xmpp_jid_equals (jid, _tmp5_)) {
			_tmp4_ = TRUE;
		} else {
			XmppJid* _tmp6_;
			_tmp6_ = self->priv->secondary_avatar_jid;
			_tmp4_ = xmpp_jid_equals (jid, _tmp6_);
		}
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		dino_ui_view_model_conversation_participant_avatar_picture_tile_model_update_image_file (self);
	}
}

static void
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_on_roster_updated (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self,
                                                                                         DinoEntitiesAccount* account,
                                                                                         XmppJid* jid)
{
	gboolean _tmp0_ = FALSE;
	DinoEntitiesConversation* _tmp1_;
	DinoEntitiesAccount* _tmp2_;
	DinoEntitiesAccount* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (jid != NULL);
	_tmp1_ = self->priv->conversation;
	_tmp2_ = dino_entities_conversation_get_account (_tmp1_);
	_tmp3_ = _tmp2_;
	if (dino_entities_account_equals (account, _tmp3_)) {
		XmppJid* _tmp4_;
		_tmp4_ = self->priv->display_name_jid;
		_tmp0_ = xmpp_jid_equals (jid, _tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gchar* display = NULL;
		DinoStreamInteractor* _tmp5_;
		DinoEntitiesConversation* _tmp6_;
		XmppJid* _tmp7_;
		gchar* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		_tmp5_ = self->priv->stream_interactor;
		_tmp6_ = self->priv->conversation;
		_tmp7_ = self->priv->display_name_jid;
		_tmp8_ = dino_ui_util_get_participant_display_name (_tmp5_, _tmp6_, _tmp7_, FALSE);
		display = _tmp8_;
		_tmp9_ = display;
		_tmp10_ = g_unichar_to_string (g_unichar_toupper (string_get_char (_tmp9_, (glong) 0)));
		_tmp11_ = _tmp10_;
		dino_ui_view_model_avatar_picture_tile_model_set_display_text ((DinoUiViewModelAvatarPictureTileModel*) self, _tmp11_);
		_g_free0 (_tmp11_);
		_g_free0 (display);
	}
}

static DinoAvatarManager*
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_avatar_manager (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self)
{
	DinoAvatarManager* result;
	DinoAvatarManager* _tmp0_ = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoAvatarManager* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->stream_interactor;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
		_tmp0_ = NULL;
	} else {
		DinoStreamInteractor* _tmp2_;
		DinoModuleIdentity* _tmp3_;
		gpointer _tmp4_;
		_tmp2_ = self->priv->stream_interactor;
		_tmp3_ = dino_avatar_manager_IDENTITY;
		_tmp4_ = dino_stream_interactor_get_module (_tmp2_, DINO_TYPE_AVATAR_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = (DinoAvatarManager*) _tmp4_;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp5_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static DinoMucManager*
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_muc_manager (DinoUiViewModelConversationParticipantAvatarPictureTileModel* self)
{
	DinoMucManager* result;
	DinoMucManager* _tmp0_ = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoMucManager* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->stream_interactor;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
		_tmp0_ = NULL;
	} else {
		DinoStreamInteractor* _tmp2_;
		DinoModuleIdentity* _tmp3_;
		gpointer _tmp4_;
		_tmp2_ = self->priv->stream_interactor;
		_tmp3_ = dino_muc_manager_IDENTITY;
		_tmp4_ = dino_stream_interactor_get_module (_tmp2_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = (DinoMucManager*) _tmp4_;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp5_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static void
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_class_init (DinoUiViewModelConversationParticipantAvatarPictureTileModelClass * klass,
                                                                                  gpointer klass_data)
{
	dino_ui_view_model_conversation_participant_avatar_picture_tile_model_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiViewModelConversationParticipantAvatarPictureTileModel_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_finalize;
}

static void
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_instance_init (DinoUiViewModelConversationParticipantAvatarPictureTileModel * self,
                                                                                     gpointer klass)
{
	self->priv = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_instance_private (self);
}

static void
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_finalize (GObject * obj)
{
	DinoUiViewModelConversationParticipantAvatarPictureTileModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_VIEW_MODEL_TYPE_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelConversationParticipantAvatarPictureTileModel);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->conversation);
	_xmpp_jid_unref0 (self->priv->primary_avatar_jid);
	_xmpp_jid_unref0 (self->priv->secondary_avatar_jid);
	_xmpp_jid_unref0 (self->priv->display_name_jid);
	G_OBJECT_CLASS (dino_ui_view_model_conversation_participant_avatar_picture_tile_model_parent_class)->finalize (obj);
}

static GType
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiViewModelConversationParticipantAvatarPictureTileModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_view_model_conversation_participant_avatar_picture_tile_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiViewModelConversationParticipantAvatarPictureTileModel), 0, (GInstanceInitFunc) dino_ui_view_model_conversation_participant_avatar_picture_tile_model_instance_init, NULL };
	GType dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id;
	dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id = g_type_register_static (DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL, "DinoUiViewModelConversationParticipantAvatarPictureTileModel", &g_define_type_info, 0);
	DinoUiViewModelConversationParticipantAvatarPictureTileModel_private_offset = g_type_add_instance_private (dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id, sizeof (DinoUiViewModelConversationParticipantAvatarPictureTileModelPrivate));
	return dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id;
}

GType
dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_type (void)
{
	static volatile gsize dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id__once)) {
		GType dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id;
		dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_type_once ();
		g_once_init_leave (&dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id__once, dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id);
	}
	return dino_ui_view_model_conversation_participant_avatar_picture_tile_model_type_id__once;
}

static void
_vala_dino_ui_view_model_conversation_participant_avatar_picture_tile_model_get_property (GObject * object,
                                                                                          guint property_id,
                                                                                          GValue * value,
                                                                                          GParamSpec * pspec)
{
	DinoUiViewModelConversationParticipantAvatarPictureTileModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_CONVERSATION_PARTICIPANT_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelConversationParticipantAvatarPictureTileModel);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_ui_view_model_compat_avatar_picture_model_get_instance_private (DinoUiViewModelCompatAvatarPictureModel* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiViewModelCompatAvatarPictureModel_private_offset);
}

DinoUiViewModelCompatAvatarPictureModel*
dino_ui_view_model_compat_avatar_picture_model_construct (GType object_type,
                                                          DinoStreamInteractor* stream_interactor)
{
	DinoUiViewModelCompatAvatarPictureModel * self = NULL;
	DinoStreamInteractor* _tmp0_;
	self = (DinoUiViewModelCompatAvatarPictureModel*) dino_ui_view_model_avatar_picture_model_construct (object_type);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	if (stream_interactor != NULL) {
		dino_ui_view_model_compat_avatar_picture_model_connect_signals_weak (self);
	}
	return self;
}

DinoUiViewModelCompatAvatarPictureModel*
dino_ui_view_model_compat_avatar_picture_model_new (DinoStreamInteractor* stream_interactor)
{
	return dino_ui_view_model_compat_avatar_picture_model_construct (DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, stream_interactor);
}

static Block74Data*
block74_data_ref (Block74Data* _data74_)
{
	g_atomic_int_inc (&_data74_->_ref_count_);
	return _data74_;
}

static void
block74_data_unref (void * _userdata_)
{
	Block74Data* _data74_;
	_data74_ = (Block74Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data74_->_ref_count_)) {
		g_weak_ref_clear (&_data74_->model_weak);
		g_slice_free (Block74Data, _data74_);
	}
}

static void
__lambda17_ (Block74Data* _data74_,
             DinoMucManager* muc_manager,
             DinoEntitiesAccount* account,
             XmppJid* room,
             XmppJid* jid)
{
	DinoUiViewModelCompatAvatarPictureModel* model = NULL;
	GObject* _tmp0_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp1_;
	g_return_if_fail (muc_manager != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (room != NULL);
	g_return_if_fail (jid != NULL);
	_tmp0_ = g_weak_ref_get (&_data74_->model_weak);
	model = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel);
	_tmp1_ = model;
	if (_tmp1_ != NULL) {
		DinoUiViewModelCompatAvatarPictureModel* _tmp2_;
		_tmp2_ = model;
		dino_ui_view_model_compat_avatar_picture_model_on_room_updated (_tmp2_, account, room);
	} else {
		if (_data74_->muc_manager_private_room_occupant_updated_handler_id != ((gulong) 0)) {
			g_signal_handler_disconnect ((GObject*) muc_manager, _data74_->muc_manager_private_room_occupant_updated_handler_id);
			_data74_->muc_manager_private_room_occupant_updated_handler_id = (gulong) 0;
		}
	}
	_g_object_unref0 (model);
}

static void
___lambda17__dino_muc_manager_private_room_occupant_updated (DinoMucManager* _sender,
                                                             DinoEntitiesAccount* account,
                                                             XmppJid* room,
                                                             XmppJid* occupant,
                                                             gpointer self)
{
	__lambda17_ (self, _sender, account, room, occupant);
}

static void
__lambda18_ (Block74Data* _data74_,
             DinoMucManager* muc_manager,
             DinoEntitiesAccount* account,
             XmppJid* room)
{
	DinoUiViewModelCompatAvatarPictureModel* model = NULL;
	GObject* _tmp0_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp1_;
	g_return_if_fail (muc_manager != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (room != NULL);
	_tmp0_ = g_weak_ref_get (&_data74_->model_weak);
	model = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel);
	_tmp1_ = model;
	if (_tmp1_ != NULL) {
		DinoUiViewModelCompatAvatarPictureModel* _tmp2_;
		_tmp2_ = model;
		dino_ui_view_model_compat_avatar_picture_model_on_room_updated (_tmp2_, account, room);
	} else {
		if (_data74_->muc_manager_proom_info_updated_handler_id != ((gulong) 0)) {
			g_signal_handler_disconnect ((GObject*) muc_manager, _data74_->muc_manager_proom_info_updated_handler_id);
			_data74_->muc_manager_proom_info_updated_handler_id = (gulong) 0;
		}
	}
	_g_object_unref0 (model);
}

static void
___lambda18__dino_muc_manager_room_info_updated (DinoMucManager* _sender,
                                                 DinoEntitiesAccount* account,
                                                 XmppJid* muc_jid,
                                                 gpointer self)
{
	__lambda18_ (self, _sender, account, muc_jid);
}

static void
__lambda19_ (Block74Data* _data74_,
             DinoAvatarManager* avatar_manager,
             XmppJid* jid,
             DinoEntitiesAccount* account)
{
	DinoUiViewModelCompatAvatarPictureModel* model = NULL;
	GObject* _tmp0_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp1_;
	g_return_if_fail (avatar_manager != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (account != NULL);
	_tmp0_ = g_weak_ref_get (&_data74_->model_weak);
	model = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel);
	_tmp1_ = model;
	if (_tmp1_ != NULL) {
		DinoUiViewModelCompatAvatarPictureModel* _tmp2_;
		_tmp2_ = model;
		dino_ui_view_model_compat_avatar_picture_model_on_received_avatar (_tmp2_, jid, account);
	} else {
		if (_data74_->avatar_manager_received_avatar_handler_id != ((gulong) 0)) {
			g_signal_handler_disconnect ((GObject*) avatar_manager, _data74_->avatar_manager_received_avatar_handler_id);
			_data74_->avatar_manager_received_avatar_handler_id = (gulong) 0;
		}
	}
	_g_object_unref0 (model);
}

static void
___lambda19__dino_avatar_manager_received_avatar (DinoAvatarManager* _sender,
                                                  XmppJid* jid,
                                                  DinoEntitiesAccount* account,
                                                  gpointer self)
{
	__lambda19_ (self, _sender, jid, account);
}

static void
__lambda20_ (Block74Data* _data74_,
             DinoAvatarManager* avatar_manager,
             XmppJid* jid,
             DinoEntitiesAccount* account)
{
	DinoUiViewModelCompatAvatarPictureModel* model = NULL;
	GObject* _tmp0_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp1_;
	g_return_if_fail (avatar_manager != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (account != NULL);
	_tmp0_ = g_weak_ref_get (&_data74_->model_weak);
	model = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel);
	_tmp1_ = model;
	if (_tmp1_ != NULL) {
		DinoUiViewModelCompatAvatarPictureModel* _tmp2_;
		_tmp2_ = model;
		dino_ui_view_model_compat_avatar_picture_model_on_received_avatar (_tmp2_, jid, account);
	} else {
		if (_data74_->avatar_manager_fetched_avatar_handler_id != ((gulong) 0)) {
			g_signal_handler_disconnect ((GObject*) avatar_manager, _data74_->avatar_manager_fetched_avatar_handler_id);
			_data74_->avatar_manager_fetched_avatar_handler_id = (gulong) 0;
		}
	}
	_g_object_unref0 (model);
}

static void
___lambda20__dino_avatar_manager_fetched_avatar (DinoAvatarManager* _sender,
                                                 XmppJid* jid,
                                                 DinoEntitiesAccount* account,
                                                 gpointer self)
{
	__lambda20_ (self, _sender, jid, account);
}

static void
dino_ui_view_model_compat_avatar_picture_model_connect_signals_weak (DinoUiViewModelCompatAvatarPictureModel* model_)
{
	Block74Data* _data74_;
	DinoMucManager* _tmp0_;
	DinoMucManager* _tmp1_;
	DinoMucManager* _tmp2_;
	gulong _tmp3_;
	DinoMucManager* _tmp4_;
	DinoMucManager* _tmp5_;
	DinoMucManager* _tmp6_;
	gulong _tmp7_;
	DinoAvatarManager* _tmp8_;
	DinoAvatarManager* _tmp9_;
	DinoAvatarManager* _tmp10_;
	gulong _tmp11_;
	DinoAvatarManager* _tmp12_;
	DinoAvatarManager* _tmp13_;
	DinoAvatarManager* _tmp14_;
	gulong _tmp15_;
	g_return_if_fail (model_ != NULL);
	_data74_ = g_slice_new0 (Block74Data);
	_data74_->_ref_count_ = 1;
	g_weak_ref_init (&_data74_->model_weak, (GObject*) model_);
	_data74_->muc_manager_private_room_occupant_updated_handler_id = (gulong) 0;
	_data74_->muc_manager_proom_info_updated_handler_id = (gulong) 0;
	_data74_->avatar_manager_received_avatar_handler_id = (gulong) 0;
	_data74_->avatar_manager_fetched_avatar_handler_id = (gulong) 0;
	_tmp0_ = dino_ui_view_model_compat_avatar_picture_model_get_muc_manager (model_);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = g_signal_connect_data (_tmp2_, "private-room-occupant-updated", (GCallback) ___lambda17__dino_muc_manager_private_room_occupant_updated, block74_data_ref (_data74_), (GClosureNotify) block74_data_unref, 0);
	_data74_->muc_manager_private_room_occupant_updated_handler_id = _tmp3_;
	_g_object_unref0 (_tmp2_);
	_tmp4_ = dino_ui_view_model_compat_avatar_picture_model_get_muc_manager (model_);
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp7_ = g_signal_connect_data (_tmp6_, "room-info-updated", (GCallback) ___lambda18__dino_muc_manager_room_info_updated, block74_data_ref (_data74_), (GClosureNotify) block74_data_unref, 0);
	_data74_->muc_manager_proom_info_updated_handler_id = _tmp7_;
	_g_object_unref0 (_tmp6_);
	_tmp8_ = dino_ui_view_model_compat_avatar_picture_model_get_avatar_manager (model_);
	_tmp9_ = _tmp8_;
	_tmp10_ = _tmp9_;
	_tmp11_ = g_signal_connect_data (_tmp10_, "received-avatar", (GCallback) ___lambda19__dino_avatar_manager_received_avatar, block74_data_ref (_data74_), (GClosureNotify) block74_data_unref, 0);
	_data74_->avatar_manager_received_avatar_handler_id = _tmp11_;
	_g_object_unref0 (_tmp10_);
	_tmp12_ = dino_ui_view_model_compat_avatar_picture_model_get_avatar_manager (model_);
	_tmp13_ = _tmp12_;
	_tmp14_ = _tmp13_;
	_tmp15_ = g_signal_connect_data (_tmp14_, "fetched-avatar", (GCallback) ___lambda20__dino_avatar_manager_fetched_avatar, block74_data_ref (_data74_), (GClosureNotify) block74_data_unref, 0);
	_data74_->avatar_manager_fetched_avatar_handler_id = _tmp15_;
	_g_object_unref0 (_tmp14_);
	block74_data_unref (_data74_);
	_data74_ = NULL;
}

static void
dino_ui_view_model_compat_avatar_picture_model_on_room_updated (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                DinoEntitiesAccount* account,
                                                                XmppJid* room)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	DinoEntitiesConversation* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (account != NULL);
	g_return_if_fail (room != NULL);
	_tmp2_ = self->priv->conversation;
	if (_tmp2_ != NULL) {
		DinoEntitiesConversation* _tmp3_;
		DinoEntitiesAccount* _tmp4_;
		DinoEntitiesAccount* _tmp5_;
		_tmp3_ = self->priv->conversation;
		_tmp4_ = dino_entities_conversation_get_account (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = dino_entities_account_equals (account, _tmp5_);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		DinoEntitiesConversation* _tmp6_;
		XmppJid* _tmp7_;
		XmppJid* _tmp8_;
		_tmp6_ = self->priv->conversation;
		_tmp7_ = dino_entities_conversation_get_counterpart (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp0_ = xmpp_jid_equals_bare (_tmp8_, room);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		DinoEntitiesConversation* _tmp9_;
		DinoUiViewModelCompatAvatarPictureModel* _tmp10_;
		DinoUiViewModelCompatAvatarPictureModel* _tmp11_;
		dino_ui_view_model_compat_avatar_picture_model_reset (self);
		_tmp9_ = self->priv->conversation;
		_tmp10_ = dino_ui_view_model_compat_avatar_picture_model_set_conversation (self, _tmp9_);
		_tmp11_ = _tmp10_;
		_g_object_unref0 (_tmp11_);
	}
}

static void
dino_ui_view_model_compat_avatar_picture_model_on_received_avatar (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                   XmppJid* jid,
                                                                   DinoEntitiesAccount* account)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (jid != NULL);
	g_return_if_fail (account != NULL);
	dino_ui_view_model_compat_avatar_picture_model_on_room_updated (self, account, jid);
}

void
dino_ui_view_model_compat_avatar_picture_model_reset (DinoUiViewModelCompatAvatarPictureModel* self)
{
	GListModel* _tmp0_;
	GListModel* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = dino_ui_view_model_avatar_picture_model_get_tiles ((DinoUiViewModelAvatarPictureModel*) self);
	_tmp1_ = _tmp0_;
	g_list_store_remove_all (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, g_list_store_get_type ()) ? ((GListStore*) _tmp1_) : NULL);
}

DinoUiViewModelCompatAvatarPictureModel*
dino_ui_view_model_compat_avatar_picture_model_set_conversation (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                 DinoEntitiesConversation* conversation)
{
	DinoStreamInteractor* _tmp0_;
	DinoEntitiesConversation* _tmp2_;
	DinoEntitiesConversationType _tmp3_;
	DinoEntitiesConversationType _tmp4_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp79_;
	DinoUiViewModelCompatAvatarPictureModel* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	_tmp0_ = self->priv->stream_interactor;
	if (_tmp0_ == NULL) {
		DinoUiViewModelCompatAvatarPictureModel* _tmp1_;
		g_critical ("avatar_picture.vala:158: set_conversation() used on CompatAvatarPictur" \
"eModel without stream_interactor");
		_tmp1_ = _g_object_ref0 (self);
		result = _tmp1_;
		return result;
	}
	_tmp2_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->priv->conversation);
	self->priv->conversation = _tmp2_;
	_tmp3_ = dino_entities_conversation_get_type_ (conversation);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		DinoAvatarManager* _tmp5_;
		DinoAvatarManager* _tmp6_;
		DinoAvatarManager* _tmp7_;
		DinoEntitiesAccount* _tmp8_;
		DinoEntitiesAccount* _tmp9_;
		XmppJid* _tmp10_;
		XmppJid* _tmp11_;
		gboolean _tmp12_;
		_tmp5_ = dino_ui_view_model_compat_avatar_picture_model_get_avatar_manager (self);
		_tmp6_ = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp8_ = dino_entities_conversation_get_account (conversation);
		_tmp9_ = _tmp8_;
		_tmp10_ = dino_entities_conversation_get_counterpart (conversation);
		_tmp11_ = _tmp10_;
		_tmp12_ = dino_avatar_manager_has_avatar (_tmp7_, _tmp9_, _tmp11_);
		_g_object_unref0 (_tmp7_);
		if (_tmp12_) {
			XmppJid* _tmp13_;
			XmppJid* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			DinoAvatarManager* _tmp17_;
			DinoAvatarManager* _tmp18_;
			DinoAvatarManager* _tmp19_;
			DinoEntitiesAccount* _tmp20_;
			DinoEntitiesAccount* _tmp21_;
			XmppJid* _tmp22_;
			XmppJid* _tmp23_;
			GFile* _tmp24_;
			GFile* _tmp25_;
			DinoUiViewModelAvatarPictureTileModel* _tmp26_;
			DinoUiViewModelAvatarPictureTileModel* _tmp27_;
			_tmp13_ = dino_entities_conversation_get_counterpart (conversation);
			_tmp14_ = _tmp13_;
			_tmp15_ = xmpp_jid_to_string (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = dino_ui_view_model_compat_avatar_picture_model_get_avatar_manager (self);
			_tmp18_ = _tmp17_;
			_tmp19_ = _tmp18_;
			_tmp20_ = dino_entities_conversation_get_account (conversation);
			_tmp21_ = _tmp20_;
			_tmp22_ = dino_entities_conversation_get_counterpart (conversation);
			_tmp23_ = _tmp22_;
			_tmp24_ = dino_avatar_manager_get_avatar_file (_tmp19_, _tmp21_, _tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = dino_ui_view_model_compat_avatar_picture_model_add_internal (self, "#", _tmp16_, _tmp25_);
			_tmp27_ = _tmp26_;
			_g_object_unref0 (_tmp27_);
			_g_object_unref0 (_tmp25_);
			_g_object_unref0 (_tmp19_);
			_g_free0 (_tmp16_);
		} else {
			GeeList* occupants = NULL;
			DinoMucManager* _tmp28_;
			DinoMucManager* _tmp29_;
			DinoMucManager* _tmp30_;
			XmppJid* _tmp31_;
			XmppJid* _tmp32_;
			DinoEntitiesAccount* _tmp33_;
			DinoEntitiesAccount* _tmp34_;
			GeeList* _tmp35_;
			GeeList* _tmp36_;
			gboolean _tmp37_ = FALSE;
			gboolean _tmp38_ = FALSE;
			GeeList* _tmp39_;
			_tmp28_ = dino_ui_view_model_compat_avatar_picture_model_get_muc_manager (self);
			_tmp29_ = _tmp28_;
			_tmp30_ = _tmp29_;
			_tmp31_ = dino_entities_conversation_get_counterpart (conversation);
			_tmp32_ = _tmp31_;
			_tmp33_ = dino_entities_conversation_get_account (conversation);
			_tmp34_ = _tmp33_;
			_tmp35_ = dino_muc_manager_get_other_offline_members (_tmp30_, _tmp32_, _tmp34_);
			_tmp36_ = _tmp35_;
			_g_object_unref0 (_tmp30_);
			occupants = _tmp36_;
			_tmp39_ = occupants;
			if (_tmp39_ != NULL) {
				GeeList* _tmp40_;
				gboolean _tmp41_;
				gboolean _tmp42_;
				_tmp40_ = occupants;
				_tmp41_ = gee_collection_get_is_empty ((GeeCollection*) _tmp40_);
				_tmp42_ = _tmp41_;
				_tmp38_ = !_tmp42_;
			} else {
				_tmp38_ = FALSE;
			}
			if (_tmp38_) {
				DinoMucManager* _tmp43_;
				DinoMucManager* _tmp44_;
				DinoMucManager* _tmp45_;
				DinoEntitiesAccount* _tmp46_;
				DinoEntitiesAccount* _tmp47_;
				XmppJid* _tmp48_;
				XmppJid* _tmp49_;
				_tmp43_ = dino_ui_view_model_compat_avatar_picture_model_get_muc_manager (self);
				_tmp44_ = _tmp43_;
				_tmp45_ = _tmp44_;
				_tmp46_ = dino_entities_conversation_get_account (conversation);
				_tmp47_ = _tmp46_;
				_tmp48_ = dino_entities_conversation_get_counterpart (conversation);
				_tmp49_ = _tmp48_;
				_tmp37_ = dino_muc_manager_is_private_room (_tmp45_, _tmp47_, _tmp49_);
				_g_object_unref0 (_tmp45_);
			} else {
				_tmp37_ = FALSE;
			}
			if (_tmp37_) {
				gint _tmp50_ = 0;
				GeeList* _tmp51_;
				gint _tmp52_;
				gint _tmp53_;
				gint count = 0;
				GeeList* _tmp64_;
				gint _tmp65_;
				gint _tmp66_;
				_tmp51_ = occupants;
				_tmp52_ = gee_collection_get_size ((GeeCollection*) _tmp51_);
				_tmp53_ = _tmp52_;
				if (_tmp53_ > 4) {
					_tmp50_ = 3;
				} else {
					GeeList* _tmp54_;
					gint _tmp55_;
					gint _tmp56_;
					_tmp54_ = occupants;
					_tmp55_ = gee_collection_get_size ((GeeCollection*) _tmp54_);
					_tmp56_ = _tmp55_;
					_tmp50_ = _tmp56_;
				}
				count = _tmp50_;
				{
					gint i = 0;
					i = 0;
					{
						gboolean _tmp57_ = FALSE;
						_tmp57_ = TRUE;
						while (TRUE) {
							GeeList* _tmp59_;
							gpointer _tmp60_;
							XmppJid* _tmp61_;
							DinoUiViewModelCompatAvatarPictureModel* _tmp62_;
							DinoUiViewModelCompatAvatarPictureModel* _tmp63_;
							if (!_tmp57_) {
								gint _tmp58_;
								_tmp58_ = i;
								i = _tmp58_ + 1;
							}
							_tmp57_ = FALSE;
							if (!(i < count)) {
								break;
							}
							_tmp59_ = occupants;
							_tmp60_ = gee_list_get (_tmp59_, i);
							_tmp61_ = (XmppJid*) _tmp60_;
							_tmp62_ = dino_ui_view_model_compat_avatar_picture_model_add_participant (self, conversation, _tmp61_);
							_tmp63_ = _tmp62_;
							_g_object_unref0 (_tmp63_);
							_xmpp_jid_unref0 (_tmp61_);
						}
					}
				}
				_tmp64_ = occupants;
				_tmp65_ = gee_collection_get_size ((GeeCollection*) _tmp64_);
				_tmp66_ = _tmp65_;
				if (_tmp66_ > 4) {
					DinoUiViewModelAvatarPictureTileModel* _tmp67_;
					DinoUiViewModelAvatarPictureTileModel* _tmp68_;
					_tmp67_ = dino_ui_view_model_compat_avatar_picture_model_add_internal (self, "+", NULL, NULL);
					_tmp68_ = _tmp67_;
					_g_object_unref0 (_tmp68_);
				}
			} else {
				XmppJid* _tmp69_;
				XmppJid* _tmp70_;
				gchar* _tmp71_;
				gchar* _tmp72_;
				DinoUiViewModelAvatarPictureTileModel* _tmp73_;
				DinoUiViewModelAvatarPictureTileModel* _tmp74_;
				_tmp69_ = dino_entities_conversation_get_counterpart (conversation);
				_tmp70_ = _tmp69_;
				_tmp71_ = xmpp_jid_to_string (_tmp70_);
				_tmp72_ = _tmp71_;
				_tmp73_ = dino_ui_view_model_compat_avatar_picture_model_add_internal (self, "#", _tmp72_, NULL);
				_tmp74_ = _tmp73_;
				_g_object_unref0 (_tmp74_);
				_g_free0 (_tmp72_);
			}
			_g_object_unref0 (occupants);
		}
	} else {
		XmppJid* _tmp75_;
		XmppJid* _tmp76_;
		DinoUiViewModelCompatAvatarPictureModel* _tmp77_;
		DinoUiViewModelCompatAvatarPictureModel* _tmp78_;
		_tmp75_ = dino_entities_conversation_get_counterpart (conversation);
		_tmp76_ = _tmp75_;
		_tmp77_ = dino_ui_view_model_compat_avatar_picture_model_add_participant (self, conversation, _tmp76_);
		_tmp78_ = _tmp77_;
		_g_object_unref0 (_tmp78_);
	}
	_tmp79_ = _g_object_ref0 (self);
	result = _tmp79_;
	return result;
}

DinoUiViewModelCompatAvatarPictureModel*
dino_ui_view_model_compat_avatar_picture_model_add_participant (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                DinoEntitiesConversation* conversation,
                                                                XmppJid* jid)
{
	DinoStreamInteractor* _tmp0_;
	GListModel* _tmp2_;
	GListModel* _tmp3_;
	DinoStreamInteractor* _tmp4_;
	DinoUiViewModelConversationParticipantAvatarPictureTileModel* _tmp5_;
	DinoUiViewModelConversationParticipantAvatarPictureTileModel* _tmp6_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp7_;
	DinoUiViewModelCompatAvatarPictureModel* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	g_return_val_if_fail (jid != NULL, NULL);
	_tmp0_ = self->priv->stream_interactor;
	if (_tmp0_ == NULL) {
		DinoUiViewModelCompatAvatarPictureModel* _tmp1_;
		g_critical ("avatar_picture.vala:187: add_participant() used on CompatAvatarPicture" \
"Model without stream_interactor");
		_tmp1_ = _g_object_ref0 (self);
		result = _tmp1_;
		return result;
	}
	_tmp2_ = dino_ui_view_model_avatar_picture_model_get_tiles ((DinoUiViewModelAvatarPictureModel*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->stream_interactor;
	_tmp5_ = dino_ui_view_model_conversation_participant_avatar_picture_tile_model_new (_tmp4_, conversation, jid);
	_tmp6_ = _tmp5_;
	g_list_store_append (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, g_list_store_get_type ()) ? ((GListStore*) _tmp3_) : NULL, (GObject*) _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = _g_object_ref0 (self);
	result = _tmp7_;
	return result;
}

DinoUiViewModelCompatAvatarPictureModel*
dino_ui_view_model_compat_avatar_picture_model_add (DinoUiViewModelCompatAvatarPictureModel* self,
                                                    const gchar* display,
                                                    const gchar* color_id,
                                                    GFile* image_file)
{
	DinoUiViewModelAvatarPictureTileModel* _tmp0_;
	DinoUiViewModelAvatarPictureTileModel* _tmp1_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp2_;
	DinoUiViewModelCompatAvatarPictureModel* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (display != NULL, NULL);
	_tmp0_ = dino_ui_view_model_compat_avatar_picture_model_add_internal (self, display, color_id, image_file);
	_tmp1_ = _tmp0_;
	_g_object_unref0 (_tmp1_);
	_tmp2_ = _g_object_ref0 (self);
	result = _tmp2_;
	return result;
}

static DinoUiViewModelAvatarPictureTileModel*
dino_ui_view_model_compat_avatar_picture_model_add_internal (DinoUiViewModelCompatAvatarPictureModel* self,
                                                             const gchar* display,
                                                             const gchar* color_id,
                                                             GFile* image_file)
{
	GListStore* store = NULL;
	GListModel* _tmp0_;
	GListModel* _tmp1_;
	GListStore* _tmp2_;
	gfloat* _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	gint __tmp3__size_ = 0;
	gfloat* rgbf = NULL;
	gfloat* _tmp7_;
	gint _tmp7__length1;
	gint rgbf_length1;
	gint _rgbf_size_;
	DinoUiViewModelAvatarPictureTileModel* model = NULL;
	gchar* _tmp8_;
	gfloat _tmp9_;
	gfloat _tmp10_;
	gfloat _tmp11_;
	GdkRGBA _tmp12_ = {0};
	GFile* _tmp13_;
	DinoUiViewModelAvatarPictureTileModel* _tmp14_ = NULL;
	GListStore* _tmp15_;
	DinoUiViewModelAvatarPictureTileModel* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (display != NULL, NULL);
	_tmp0_ = dino_ui_view_model_avatar_picture_model_get_tiles ((DinoUiViewModelAvatarPictureModel*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, g_list_store_get_type ()) ? ((GListStore*) _tmp1_) : NULL);
	store = _tmp2_;
	if (color_id != NULL) {
		gint _tmp4_ = 0;
		gfloat* _tmp5_;
		_tmp5_ = xmpp_xep_consistent_color_string_to_rgbf (color_id, &_tmp4_);
		_tmp3_ = (g_free (_tmp3_), NULL);
		_tmp3_ = _tmp5_;
		_tmp3__length1 = _tmp4_;
		__tmp3__size_ = _tmp3__length1;
	} else {
		gfloat* _tmp6_;
		_tmp6_ = g_new0 (gfloat, 3);
		_tmp6_[0] = 0.5f;
		_tmp6_[1] = 0.5f;
		_tmp6_[2] = 0.5f;
		_tmp3_ = (g_free (_tmp3_), NULL);
		_tmp3_ = _tmp6_;
		_tmp3__length1 = 3;
		__tmp3__size_ = _tmp3__length1;
	}
	_tmp7_ = _tmp3_;
	_tmp7__length1 = _tmp3__length1;
	_tmp3_ = NULL;
	_tmp3__length1 = 0;
	rgbf = _tmp7_;
	rgbf_length1 = _tmp7__length1;
	_rgbf_size_ = rgbf_length1;
	_tmp8_ = g_unichar_to_string (g_unichar_toupper (string_get_char (display, (glong) 0)));
	_tmp9_ = rgbf[0];
	_tmp10_ = rgbf[1];
	_tmp11_ = rgbf[2];
	memset (&_tmp12_, 0, sizeof (GdkRGBA));
	_tmp12_.red = _tmp9_;
	_tmp12_.green = _tmp10_;
	_tmp12_.blue = _tmp11_;
	_tmp12_.alpha = 1.0f;
	_tmp13_ = _g_object_ref0 (image_file);
	_tmp14_ = dino_ui_view_model_avatar_picture_tile_model_new ();
	dino_ui_view_model_avatar_picture_tile_model_set_display_text (_tmp14_, _tmp8_);
	_g_free0 (_tmp8_);
	dino_ui_view_model_avatar_picture_tile_model_set_background_color (_tmp14_, &_tmp12_);
	dino_ui_view_model_avatar_picture_tile_model_set_image_file (_tmp14_, _tmp13_);
	_g_object_unref0 (_tmp13_);
	model = _tmp14_;
	_tmp15_ = store;
	g_list_store_append (_tmp15_, (GObject*) model);
	result = model;
	rgbf = (g_free (rgbf), NULL);
	_tmp3_ = (g_free (_tmp3_), NULL);
	_g_object_unref0 (store);
	return result;
}

static DinoAvatarManager*
dino_ui_view_model_compat_avatar_picture_model_get_avatar_manager (DinoUiViewModelCompatAvatarPictureModel* self)
{
	DinoAvatarManager* result;
	DinoAvatarManager* _tmp0_ = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoAvatarManager* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->stream_interactor;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
		_tmp0_ = NULL;
	} else {
		DinoStreamInteractor* _tmp2_;
		DinoModuleIdentity* _tmp3_;
		gpointer _tmp4_;
		_tmp2_ = self->priv->stream_interactor;
		_tmp3_ = dino_avatar_manager_IDENTITY;
		_tmp4_ = dino_stream_interactor_get_module (_tmp2_, DINO_TYPE_AVATAR_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = (DinoAvatarManager*) _tmp4_;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp5_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static DinoMucManager*
dino_ui_view_model_compat_avatar_picture_model_get_muc_manager (DinoUiViewModelCompatAvatarPictureModel* self)
{
	DinoMucManager* result;
	DinoMucManager* _tmp0_ = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoMucManager* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->stream_interactor;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
		_tmp0_ = NULL;
	} else {
		DinoStreamInteractor* _tmp2_;
		DinoModuleIdentity* _tmp3_;
		gpointer _tmp4_;
		_tmp2_ = self->priv->stream_interactor;
		_tmp3_ = dino_muc_manager_IDENTITY;
		_tmp4_ = dino_stream_interactor_get_module (_tmp2_, DINO_TYPE_MUC_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = (DinoMucManager*) _tmp4_;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp5_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static DinoPresenceManager*
dino_ui_view_model_compat_avatar_picture_model_get_presence_manager (DinoUiViewModelCompatAvatarPictureModel* self)
{
	DinoPresenceManager* result;
	DinoPresenceManager* _tmp0_ = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoPresenceManager* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->stream_interactor;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
		_tmp0_ = NULL;
	} else {
		DinoStreamInteractor* _tmp2_;
		DinoModuleIdentity* _tmp3_;
		gpointer _tmp4_;
		_tmp2_ = self->priv->stream_interactor;
		_tmp3_ = dino_presence_manager_IDENTITY;
		_tmp4_ = dino_stream_interactor_get_module (_tmp2_, DINO_TYPE_PRESENCE_MANAGER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = (DinoPresenceManager*) _tmp4_;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp5_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static DinoConnectionManager*
dino_ui_view_model_compat_avatar_picture_model_get_connection_manager (DinoUiViewModelCompatAvatarPictureModel* self)
{
	DinoConnectionManager* result;
	DinoConnectionManager* _tmp0_ = NULL;
	DinoStreamInteractor* _tmp1_;
	DinoConnectionManager* _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->stream_interactor;
	if (_tmp1_ == NULL) {
		_tmp0_ = NULL;
	} else {
		DinoStreamInteractor* _tmp2_;
		DinoConnectionManager* _tmp3_;
		_tmp2_ = self->priv->stream_interactor;
		_tmp3_ = _tmp2_->connection_manager;
		_tmp0_ = _tmp3_;
	}
	_tmp4_ = _g_object_ref0 (_tmp0_);
	result = _tmp4_;
	return result;
}

static GObject *
dino_ui_view_model_compat_avatar_picture_model_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DinoUiViewModelCompatAvatarPictureModel * self;
	GListStore* _tmp0_;
	GListStore* _tmp1_;
	parent_class = G_OBJECT_CLASS (dino_ui_view_model_compat_avatar_picture_model_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel);
	_tmp0_ = g_list_store_new (DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL);
	_tmp1_ = _tmp0_;
	dino_ui_view_model_avatar_picture_model_set_tiles ((DinoUiViewModelAvatarPictureModel*) self, (GListModel*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	return obj;
}

static void
dino_ui_view_model_compat_avatar_picture_model_class_init (DinoUiViewModelCompatAvatarPictureModelClass * klass,
                                                           gpointer klass_data)
{
	dino_ui_view_model_compat_avatar_picture_model_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiViewModelCompatAvatarPictureModel_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_view_model_compat_avatar_picture_model_get_property;
	G_OBJECT_CLASS (klass)->constructor = dino_ui_view_model_compat_avatar_picture_model_constructor;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_view_model_compat_avatar_picture_model_finalize;
}

static void
dino_ui_view_model_compat_avatar_picture_model_instance_init (DinoUiViewModelCompatAvatarPictureModel * self,
                                                              gpointer klass)
{
	self->priv = dino_ui_view_model_compat_avatar_picture_model_get_instance_private (self);
}

static void
dino_ui_view_model_compat_avatar_picture_model_finalize (GObject * obj)
{
	DinoUiViewModelCompatAvatarPictureModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->conversation);
	G_OBJECT_CLASS (dino_ui_view_model_compat_avatar_picture_model_parent_class)->finalize (obj);
}

static GType
dino_ui_view_model_compat_avatar_picture_model_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiViewModelCompatAvatarPictureModelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_view_model_compat_avatar_picture_model_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiViewModelCompatAvatarPictureModel), 0, (GInstanceInitFunc) dino_ui_view_model_compat_avatar_picture_model_instance_init, NULL };
	GType dino_ui_view_model_compat_avatar_picture_model_type_id;
	dino_ui_view_model_compat_avatar_picture_model_type_id = g_type_register_static (DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, "DinoUiViewModelCompatAvatarPictureModel", &g_define_type_info, 0);
	DinoUiViewModelCompatAvatarPictureModel_private_offset = g_type_add_instance_private (dino_ui_view_model_compat_avatar_picture_model_type_id, sizeof (DinoUiViewModelCompatAvatarPictureModelPrivate));
	return dino_ui_view_model_compat_avatar_picture_model_type_id;
}

GType
dino_ui_view_model_compat_avatar_picture_model_get_type (void)
{
	static volatile gsize dino_ui_view_model_compat_avatar_picture_model_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_view_model_compat_avatar_picture_model_type_id__once)) {
		GType dino_ui_view_model_compat_avatar_picture_model_type_id;
		dino_ui_view_model_compat_avatar_picture_model_type_id = dino_ui_view_model_compat_avatar_picture_model_get_type_once ();
		g_once_init_leave (&dino_ui_view_model_compat_avatar_picture_model_type_id__once, dino_ui_view_model_compat_avatar_picture_model_type_id);
	}
	return dino_ui_view_model_compat_avatar_picture_model_type_id__once;
}

static void
_vala_dino_ui_view_model_compat_avatar_picture_model_get_property (GObject * object,
                                                                   guint property_id,
                                                                   GValue * value,
                                                                   GParamSpec * pspec)
{
	DinoUiViewModelCompatAvatarPictureModel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_VIEW_MODEL_TYPE_COMPAT_AVATAR_PICTURE_MODEL, DinoUiViewModelCompatAvatarPictureModel);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
dino_ui_compat_avatar_drawer_get_instance_private (DinoUiCompatAvatarDrawer* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiCompatAvatarDrawer_private_offset);
}

cairo_surface_t*
dino_ui_compat_avatar_drawer_draw_image_surface (DinoUiCompatAvatarDrawer* self)
{
	cairo_surface_t* surface = NULL;
	gint _tmp0_;
	gint _tmp1_;
	cairo_surface_t* _tmp2_;
	cairo_t* _tmp3_;
	cairo_t* _tmp4_;
	cairo_surface_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_width_request;
	_tmp1_ = self->priv->_height_request;
	_tmp2_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, _tmp0_, _tmp1_);
	surface = _tmp2_;
	_tmp3_ = cairo_create (surface);
	_tmp4_ = _tmp3_;
	dino_ui_compat_avatar_drawer_draw_on_context (self, _tmp4_);
	_cairo_destroy0 (_tmp4_);
	result = surface;
	return result;
}

void
dino_ui_compat_avatar_drawer_draw_on_context (DinoUiCompatAvatarDrawer* self,
                                              cairo_t* ctx)
{
	gdouble radius = 0.0;
	gint _tmp0_;
	gint _tmp1_;
	gfloat _tmp2_;
	gdouble degrees = 0.0;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	DinoUiViewModelAvatarPictureModel* _tmp7_;
	GListModel* _tmp8_;
	GListModel* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ctx != NULL);
	_tmp0_ = self->priv->_width_request;
	_tmp1_ = self->priv->_height_request;
	_tmp2_ = self->priv->_radius_percent;
	radius = (gdouble) (((_tmp0_ + _tmp1_) * 0.25f) * _tmp2_);
	degrees = G_PI / 180.0;
	cairo_new_sub_path (ctx);
	_tmp3_ = self->priv->_width_request;
	cairo_arc (ctx, _tmp3_ - radius, radius, radius, -90 * degrees, 0 * degrees);
	_tmp4_ = self->priv->_width_request;
	_tmp5_ = self->priv->_height_request;
	cairo_arc (ctx, _tmp4_ - radius, _tmp5_ - radius, radius, 0 * degrees, 90 * degrees);
	_tmp6_ = self->priv->_height_request;
	cairo_arc (ctx, radius, _tmp6_ - radius, radius, 90 * degrees, 180 * degrees);
	cairo_arc (ctx, radius, radius, radius, 180 * degrees, 270 * degrees);
	cairo_close_path (ctx);
	cairo_clip (ctx);
	_tmp7_ = self->priv->_model;
	_tmp8_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp7_);
	_tmp9_ = _tmp8_;
	if (g_list_model_get_n_items (_tmp9_) == ((guint) 4)) {
		cairo_surface_t* buffer = NULL;
		cairo_surface_t* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		cairo_surface_t* _tmp13_;
		cairo_t* bufctx = NULL;
		cairo_surface_t* _tmp14_;
		cairo_t* _tmp15_;
		cairo_t* _tmp16_;
		cairo_t* _tmp17_;
		gint _tmp18_;
		gint _tmp19_;
		cairo_surface_t* _tmp20_;
		cairo_surface_t* _tmp21_;
		cairo_t* _tmp22_;
		cairo_t* _tmp23_;
		gint _tmp24_;
		gint _tmp25_;
		cairo_surface_t* _tmp26_;
		cairo_surface_t* _tmp27_;
		gint _tmp28_;
		cairo_t* _tmp29_;
		cairo_t* _tmp30_;
		gint _tmp31_;
		gint _tmp32_;
		cairo_surface_t* _tmp33_;
		cairo_surface_t* _tmp34_;
		gint _tmp35_;
		cairo_t* _tmp36_;
		cairo_t* _tmp37_;
		gint _tmp38_;
		gint _tmp39_;
		cairo_surface_t* _tmp40_;
		cairo_surface_t* _tmp41_;
		gint _tmp42_;
		gint _tmp43_;
		cairo_t* _tmp44_;
		cairo_surface_t* _tmp45_;
		_tmp10_ = cairo_get_target (ctx);
		_tmp11_ = self->priv->_width_request;
		_tmp12_ = self->priv->_height_request;
		_tmp13_ = cairo_surface_create_similar (_tmp10_, CAIRO_CONTENT_COLOR_ALPHA, _tmp11_, _tmp12_);
		buffer = _tmp13_;
		_tmp14_ = buffer;
		_tmp15_ = cairo_create (_tmp14_);
		bufctx = _tmp15_;
		_tmp16_ = bufctx;
		cairo_scale (_tmp16_, 0.5, 0.5);
		_tmp17_ = bufctx;
		_tmp18_ = self->priv->_width_request;
		_tmp19_ = self->priv->_height_request;
		_tmp20_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 0, _tmp18_ - 1, _tmp19_ - 1, 2);
		_tmp21_ = _tmp20_;
		cairo_set_source_surface (_tmp17_, _tmp21_, (gdouble) 0, (gdouble) 0);
		_cairo_surface_destroy0 (_tmp21_);
		_tmp22_ = bufctx;
		cairo_paint (_tmp22_);
		_tmp23_ = bufctx;
		_tmp24_ = self->priv->_width_request;
		_tmp25_ = self->priv->_height_request;
		_tmp26_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 1, _tmp24_ - 1, _tmp25_ - 1, 2);
		_tmp27_ = _tmp26_;
		_tmp28_ = self->priv->_width_request;
		cairo_set_source_surface (_tmp23_, _tmp27_, (gdouble) (_tmp28_ + 1), (gdouble) 0);
		_cairo_surface_destroy0 (_tmp27_);
		_tmp29_ = bufctx;
		cairo_paint (_tmp29_);
		_tmp30_ = bufctx;
		_tmp31_ = self->priv->_width_request;
		_tmp32_ = self->priv->_height_request;
		_tmp33_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 2, _tmp31_ - 1, _tmp32_ - 1, 2);
		_tmp34_ = _tmp33_;
		_tmp35_ = self->priv->_height_request;
		cairo_set_source_surface (_tmp30_, _tmp34_, (gdouble) 0, (gdouble) (_tmp35_ + 1));
		_cairo_surface_destroy0 (_tmp34_);
		_tmp36_ = bufctx;
		cairo_paint (_tmp36_);
		_tmp37_ = bufctx;
		_tmp38_ = self->priv->_width_request;
		_tmp39_ = self->priv->_height_request;
		_tmp40_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 3, _tmp38_ - 1, _tmp39_ - 1, 2);
		_tmp41_ = _tmp40_;
		_tmp42_ = self->priv->_width_request;
		_tmp43_ = self->priv->_height_request;
		cairo_set_source_surface (_tmp37_, _tmp41_, (gdouble) (_tmp42_ + 1), (gdouble) (_tmp43_ + 1));
		_cairo_surface_destroy0 (_tmp41_);
		_tmp44_ = bufctx;
		cairo_paint (_tmp44_);
		_tmp45_ = buffer;
		cairo_set_source_surface (ctx, _tmp45_, (gdouble) 0, (gdouble) 0);
		cairo_paint (ctx);
		_cairo_destroy0 (bufctx);
		_cairo_surface_destroy0 (buffer);
	} else {
		DinoUiViewModelAvatarPictureModel* _tmp46_;
		GListModel* _tmp47_;
		GListModel* _tmp48_;
		_tmp46_ = self->priv->_model;
		_tmp47_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp46_);
		_tmp48_ = _tmp47_;
		if (g_list_model_get_n_items (_tmp48_) == ((guint) 3)) {
			cairo_surface_t* buffer = NULL;
			cairo_surface_t* _tmp49_;
			gint _tmp50_;
			gint _tmp51_;
			cairo_surface_t* _tmp52_;
			cairo_t* bufctx = NULL;
			cairo_surface_t* _tmp53_;
			cairo_t* _tmp54_;
			cairo_t* _tmp55_;
			cairo_t* _tmp56_;
			gint _tmp57_;
			gint _tmp58_;
			cairo_surface_t* _tmp59_;
			cairo_surface_t* _tmp60_;
			cairo_t* _tmp61_;
			cairo_t* _tmp62_;
			gint _tmp63_;
			gint _tmp64_;
			cairo_surface_t* _tmp65_;
			cairo_surface_t* _tmp66_;
			gint _tmp67_;
			cairo_t* _tmp68_;
			cairo_t* _tmp69_;
			gint _tmp70_;
			gint _tmp71_;
			cairo_surface_t* _tmp72_;
			cairo_surface_t* _tmp73_;
			gint _tmp74_;
			cairo_t* _tmp75_;
			cairo_surface_t* _tmp76_;
			_tmp49_ = cairo_get_target (ctx);
			_tmp50_ = self->priv->_width_request;
			_tmp51_ = self->priv->_height_request;
			_tmp52_ = cairo_surface_create_similar (_tmp49_, CAIRO_CONTENT_COLOR_ALPHA, _tmp50_, _tmp51_);
			buffer = _tmp52_;
			_tmp53_ = buffer;
			_tmp54_ = cairo_create (_tmp53_);
			bufctx = _tmp54_;
			_tmp55_ = bufctx;
			cairo_scale (_tmp55_, 0.5, 0.5);
			_tmp56_ = bufctx;
			_tmp57_ = self->priv->_width_request;
			_tmp58_ = self->priv->_height_request;
			_tmp59_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 0, _tmp57_ - 1, _tmp58_ - 1, 2);
			_tmp60_ = _tmp59_;
			cairo_set_source_surface (_tmp56_, _tmp60_, (gdouble) 0, (gdouble) 0);
			_cairo_surface_destroy0 (_tmp60_);
			_tmp61_ = bufctx;
			cairo_paint (_tmp61_);
			_tmp62_ = bufctx;
			_tmp63_ = self->priv->_width_request;
			_tmp64_ = self->priv->_height_request;
			_tmp65_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 1, _tmp63_ - 1, _tmp64_ * 2, 2);
			_tmp66_ = _tmp65_;
			_tmp67_ = self->priv->_width_request;
			cairo_set_source_surface (_tmp62_, _tmp66_, (gdouble) (_tmp67_ + 1), (gdouble) 0);
			_cairo_surface_destroy0 (_tmp66_);
			_tmp68_ = bufctx;
			cairo_paint (_tmp68_);
			_tmp69_ = bufctx;
			_tmp70_ = self->priv->_width_request;
			_tmp71_ = self->priv->_height_request;
			_tmp72_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 2, _tmp70_ - 1, _tmp71_ - 1, 2);
			_tmp73_ = _tmp72_;
			_tmp74_ = self->priv->_width_request;
			cairo_set_source_surface (_tmp69_, _tmp73_, (gdouble) 0, (gdouble) (_tmp74_ + 1));
			_cairo_surface_destroy0 (_tmp73_);
			_tmp75_ = bufctx;
			cairo_paint (_tmp75_);
			_tmp76_ = buffer;
			cairo_set_source_surface (ctx, _tmp76_, (gdouble) 0, (gdouble) 0);
			cairo_paint (ctx);
			_cairo_destroy0 (bufctx);
			_cairo_surface_destroy0 (buffer);
		} else {
			DinoUiViewModelAvatarPictureModel* _tmp77_;
			GListModel* _tmp78_;
			GListModel* _tmp79_;
			_tmp77_ = self->priv->_model;
			_tmp78_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp77_);
			_tmp79_ = _tmp78_;
			if (g_list_model_get_n_items (_tmp79_) == ((guint) 2)) {
				cairo_surface_t* buffer = NULL;
				cairo_surface_t* _tmp80_;
				gint _tmp81_;
				gint _tmp82_;
				cairo_surface_t* _tmp83_;
				cairo_t* bufctx = NULL;
				cairo_surface_t* _tmp84_;
				cairo_t* _tmp85_;
				cairo_t* _tmp86_;
				cairo_t* _tmp87_;
				gint _tmp88_;
				gint _tmp89_;
				cairo_surface_t* _tmp90_;
				cairo_surface_t* _tmp91_;
				cairo_t* _tmp92_;
				cairo_t* _tmp93_;
				gint _tmp94_;
				gint _tmp95_;
				cairo_surface_t* _tmp96_;
				cairo_surface_t* _tmp97_;
				gint _tmp98_;
				cairo_t* _tmp99_;
				cairo_surface_t* _tmp100_;
				_tmp80_ = cairo_get_target (ctx);
				_tmp81_ = self->priv->_width_request;
				_tmp82_ = self->priv->_height_request;
				_tmp83_ = cairo_surface_create_similar (_tmp80_, CAIRO_CONTENT_COLOR_ALPHA, _tmp81_, _tmp82_);
				buffer = _tmp83_;
				_tmp84_ = buffer;
				_tmp85_ = cairo_create (_tmp84_);
				bufctx = _tmp85_;
				_tmp86_ = bufctx;
				cairo_scale (_tmp86_, 0.5, 0.5);
				_tmp87_ = bufctx;
				_tmp88_ = self->priv->_width_request;
				_tmp89_ = self->priv->_height_request;
				_tmp90_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 0, _tmp88_ - 1, _tmp89_ * 2, 2);
				_tmp91_ = _tmp90_;
				cairo_set_source_surface (_tmp87_, _tmp91_, (gdouble) 0, (gdouble) 0);
				_cairo_surface_destroy0 (_tmp91_);
				_tmp92_ = bufctx;
				cairo_paint (_tmp92_);
				_tmp93_ = bufctx;
				_tmp94_ = self->priv->_width_request;
				_tmp95_ = self->priv->_height_request;
				_tmp96_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 1, _tmp94_ - 1, _tmp95_ * 2, 2);
				_tmp97_ = _tmp96_;
				_tmp98_ = self->priv->_width_request;
				cairo_set_source_surface (_tmp93_, _tmp97_, (gdouble) (_tmp98_ + 1), (gdouble) 0);
				_cairo_surface_destroy0 (_tmp97_);
				_tmp99_ = bufctx;
				cairo_paint (_tmp99_);
				_tmp100_ = buffer;
				cairo_set_source_surface (ctx, _tmp100_, (gdouble) 0, (gdouble) 0);
				cairo_paint (ctx);
				_cairo_destroy0 (bufctx);
				_cairo_surface_destroy0 (buffer);
			} else {
				DinoUiViewModelAvatarPictureModel* _tmp101_;
				GListModel* _tmp102_;
				GListModel* _tmp103_;
				_tmp101_ = self->priv->_model;
				_tmp102_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp101_);
				_tmp103_ = _tmp102_;
				if (g_list_model_get_n_items (_tmp103_) == ((guint) 1)) {
					gint _tmp104_;
					gint _tmp105_;
					cairo_surface_t* _tmp106_;
					cairo_surface_t* _tmp107_;
					_tmp104_ = self->priv->_width_request;
					_tmp105_ = self->priv->_height_request;
					_tmp106_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, 0, _tmp104_, _tmp105_, 1);
					_tmp107_ = _tmp106_;
					cairo_set_source_surface (ctx, _tmp107_, (gdouble) 0, (gdouble) 0);
					_cairo_surface_destroy0 (_tmp107_);
					cairo_paint (ctx);
				} else {
					DinoUiViewModelAvatarPictureModel* _tmp108_;
					GListModel* _tmp109_;
					GListModel* _tmp110_;
					_tmp108_ = self->priv->_model;
					_tmp109_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp108_);
					_tmp110_ = _tmp109_;
					if (g_list_model_get_n_items (_tmp110_) == ((guint) 0)) {
						gint _tmp111_;
						gint _tmp112_;
						cairo_surface_t* _tmp113_;
						cairo_surface_t* _tmp114_;
						_tmp111_ = self->priv->_width_request;
						_tmp112_ = self->priv->_height_request;
						_tmp113_ = dino_ui_compat_avatar_drawer_sub_surface_idx (self, ctx, -1, _tmp111_, _tmp112_, 1);
						_tmp114_ = _tmp113_;
						cairo_set_source_surface (ctx, _tmp114_, (gdouble) 0, (gdouble) 0);
						_cairo_surface_destroy0 (_tmp114_);
						cairo_paint (ctx);
					}
				}
			}
		}
	}
	cairo_set_source_rgb (ctx, (gdouble) 0, (gdouble) 0, (gdouble) 0);
}

static cairo_surface_t*
dino_ui_compat_avatar_drawer_sub_surface_idx (DinoUiCompatAvatarDrawer* self,
                                              cairo_t* ctx,
                                              gint idx,
                                              gint width,
                                              gint height,
                                              gint font_factor)
{
	DinoUiViewModelAvatarPictureTileModel* tile = NULL;
	DinoUiViewModelAvatarPictureModel* _tmp0_;
	GListModel* _tmp1_;
	GListModel* _tmp2_;
	GObject* _tmp3_;
	GdkPixbuf* _tmp4_ = NULL;
	DinoUiViewModelAvatarPictureTileModel* _tmp5_;
	GFile* _tmp6_;
	GFile* _tmp7_;
	GdkPixbuf* avatar = NULL;
	GdkPixbuf* _tmp14_;
	const gchar* _tmp15_ = NULL;
	gchar* name = NULL;
	gchar* _tmp19_;
	GdkRGBA hex_color = {0};
	DinoUiViewModelAvatarPictureTileModel* _tmp20_;
	GdkRGBA _tmp21_ = {0};
	GdkRGBA _tmp22_;
	const gchar* _tmp23_;
	GdkPixbuf* _tmp24_;
	const gchar* _tmp25_;
	GdkRGBA _tmp26_;
	cairo_surface_t* _tmp27_;
	GError* _inner_error0_ = NULL;
	cairo_surface_t* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (ctx != NULL, NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_list_model_get_item (_tmp2_, (guint) idx);
	tile = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL, DinoUiViewModelAvatarPictureTileModel);
	_tmp5_ = tile;
	_tmp6_ = dino_ui_view_model_avatar_picture_tile_model_get_image_file (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_ != NULL) {
		DinoUiViewModelAvatarPictureTileModel* _tmp8_;
		GFile* _tmp9_;
		GFile* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		GdkPixbuf* _tmp13_;
		_tmp8_ = tile;
		_tmp9_ = dino_ui_view_model_avatar_picture_tile_model_get_image_file (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_file_get_path (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = gdk_pixbuf_new_from_file (_tmp12_, &_inner_error0_);
		_g_object_unref0 (_tmp4_);
		_tmp4_ = _tmp13_;
		_g_free0 (_tmp12_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (_tmp4_);
			_g_object_unref0 (tile);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	} else {
		_g_object_unref0 (_tmp4_);
		_tmp4_ = NULL;
	}
	_tmp14_ = _tmp4_;
	_tmp4_ = NULL;
	avatar = _tmp14_;
	if (idx >= 0) {
		DinoUiViewModelAvatarPictureTileModel* _tmp16_;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
		_tmp16_ = tile;
		_tmp17_ = dino_ui_view_model_avatar_picture_tile_model_get_display_text (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp15_ = _tmp18_;
	} else {
		_tmp15_ = "";
	}
	_tmp19_ = g_strdup (_tmp15_);
	name = _tmp19_;
	_tmp20_ = tile;
	dino_ui_view_model_avatar_picture_tile_model_get_background_color (_tmp20_, &_tmp21_);
	_tmp22_ = _tmp21_;
	hex_color = _tmp22_;
	_tmp23_ = self->priv->_font_family;
	_tmp24_ = avatar;
	_tmp25_ = name;
	_tmp26_ = hex_color;
	_tmp27_ = dino_ui_compat_avatar_drawer_sub_surface (ctx, _tmp23_, _tmp24_, _tmp25_, &_tmp26_, width, height, font_factor);
	result = _tmp27_;
	_g_free0 (name);
	_g_object_unref0 (avatar);
	_g_object_unref0 (_tmp4_);
	_g_object_unref0 (tile);
	return result;
}

static cairo_surface_t*
dino_ui_compat_avatar_drawer_sub_surface (cairo_t* ctx,
                                          const gchar* font_family,
                                          GdkPixbuf* avatar,
                                          const gchar* name,
                                          GdkRGBA* background_color,
                                          gint width,
                                          gint height,
                                          gint font_factor)
{
	cairo_surface_t* buffer = NULL;
	cairo_surface_t* _tmp0_;
	cairo_surface_t* _tmp1_;
	cairo_t* bufctx = NULL;
	cairo_surface_t* _tmp2_;
	cairo_t* _tmp3_;
	cairo_surface_t* result;
	g_return_val_if_fail (ctx != NULL, NULL);
	g_return_val_if_fail (font_family != NULL, NULL);
	g_return_val_if_fail (background_color != NULL, NULL);
	_tmp0_ = cairo_get_target (ctx);
	_tmp1_ = cairo_surface_create_similar (_tmp0_, CAIRO_CONTENT_COLOR_ALPHA, width, height);
	buffer = _tmp1_;
	_tmp2_ = buffer;
	_tmp3_ = cairo_create (_tmp2_);
	bufctx = _tmp3_;
	if (avatar == NULL) {
		cairo_t* _tmp4_;
		GdkRGBA _tmp5_;
		cairo_t* _tmp6_;
		cairo_t* _tmp7_;
		gchar* _tmp8_ = NULL;
		gchar* text = NULL;
		gchar* _tmp11_;
		cairo_t* _tmp12_;
		gint _tmp13_ = 0;
		cairo_t* _tmp14_;
		cairo_text_extents_t extents = {0};
		cairo_t* _tmp15_;
		const gchar* _tmp16_;
		cairo_text_extents_t _tmp17_ = {0};
		gdouble x_pos = 0.0;
		cairo_text_extents_t _tmp18_;
		cairo_text_extents_t _tmp19_;
		gdouble y_pos = 0.0;
		cairo_text_extents_t _tmp20_;
		cairo_text_extents_t _tmp21_;
		cairo_t* _tmp22_;
		cairo_t* _tmp23_;
		cairo_t* _tmp24_;
		const gchar* _tmp25_;
		_tmp4_ = bufctx;
		_tmp5_ = *background_color;
		gdk_cairo_set_source_rgba (_tmp4_, &_tmp5_);
		_tmp6_ = bufctx;
		cairo_rectangle (_tmp6_, (gdouble) 0, (gdouble) 0, (gdouble) width, (gdouble) height);
		_tmp7_ = bufctx;
		cairo_fill (_tmp7_);
		if (name == NULL) {
			gchar* _tmp9_;
			_tmp9_ = g_strdup ("…");
			_g_free0 (_tmp8_);
			_tmp8_ = _tmp9_;
		} else {
			gchar* _tmp10_;
			_tmp10_ = g_unichar_to_string (g_unichar_toupper (string_get_char (name, (glong) 0)));
			_g_free0 (_tmp8_);
			_tmp8_ = _tmp10_;
		}
		_tmp11_ = _tmp8_;
		_tmp8_ = NULL;
		text = _tmp11_;
		_tmp12_ = bufctx;
		cairo_select_font_face (_tmp12_, font_family, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
		if ((width / font_factor) < 40) {
			_tmp13_ = font_factor * 17;
		} else {
			_tmp13_ = font_factor * 25;
		}
		_tmp14_ = bufctx;
		cairo_set_font_size (_tmp14_, (gdouble) _tmp13_);
		_tmp15_ = bufctx;
		_tmp16_ = text;
		cairo_text_extents (_tmp15_, _tmp16_, &_tmp17_);
		extents = _tmp17_;
		_tmp18_ = extents;
		_tmp19_ = extents;
		x_pos = (width / 2) - ((_tmp18_.width / 2) + _tmp19_.x_bearing);
		_tmp20_ = extents;
		_tmp21_ = extents;
		y_pos = (height / 2) - ((_tmp20_.height / 2) + _tmp21_.y_bearing);
		_tmp22_ = bufctx;
		cairo_move_to (_tmp22_, x_pos, y_pos);
		_tmp23_ = bufctx;
		cairo_set_source_rgba (_tmp23_, (gdouble) 1, (gdouble) 1, (gdouble) 1, (gdouble) 1);
		_tmp24_ = bufctx;
		_tmp25_ = text;
		cairo_show_text (_tmp24_, _tmp25_);
		_g_free0 (text);
		_g_free0 (_tmp8_);
	} else {
		gdouble w_scale = 0.0;
		gint _tmp26_;
		gint _tmp27_;
		gdouble h_scale = 0.0;
		gint _tmp28_;
		gint _tmp29_;
		gdouble scale = 0.0;
		cairo_t* _tmp30_;
		gdouble x_off = 0.0;
		gdouble y_off = 0.0;
		cairo_t* _tmp35_;
		cairo_t* _tmp36_;
		cairo_pattern_t* _tmp37_;
		cairo_t* _tmp38_;
		_tmp26_ = gdk_pixbuf_get_width (avatar);
		_tmp27_ = _tmp26_;
		w_scale = ((gdouble) width) / _tmp27_;
		_tmp28_ = gdk_pixbuf_get_height (avatar);
		_tmp29_ = _tmp28_;
		h_scale = ((gdouble) height) / _tmp29_;
		scale = MAX (w_scale, h_scale);
		_tmp30_ = bufctx;
		cairo_scale (_tmp30_, scale, scale);
		x_off = (gdouble) 0;
		y_off = (gdouble) 0;
		if (scale == h_scale) {
			gint _tmp31_;
			gint _tmp32_;
			_tmp31_ = gdk_pixbuf_get_width (avatar);
			_tmp32_ = _tmp31_;
			x_off = ((width / scale) - _tmp32_) / 2.0;
		} else {
			gint _tmp33_;
			gint _tmp34_;
			_tmp33_ = gdk_pixbuf_get_height (avatar);
			_tmp34_ = _tmp33_;
			y_off = ((height / scale) - _tmp34_) / 2.0;
		}
		_tmp35_ = bufctx;
		gdk_cairo_set_source_pixbuf (_tmp35_, avatar, x_off, y_off);
		_tmp36_ = bufctx;
		_tmp37_ = cairo_get_source (_tmp36_);
		cairo_pattern_set_filter (_tmp37_, CAIRO_FILTER_BEST);
		_tmp38_ = bufctx;
		cairo_paint (_tmp38_);
	}
	result = buffer;
	_cairo_destroy0 (bufctx);
	return result;
}

DinoUiCompatAvatarDrawer*
dino_ui_compat_avatar_drawer_construct (GType object_type)
{
	DinoUiCompatAvatarDrawer* self = NULL;
	self = (DinoUiCompatAvatarDrawer*) g_type_create_instance (object_type);
	return self;
}

DinoUiCompatAvatarDrawer*
dino_ui_compat_avatar_drawer_new (void)
{
	return dino_ui_compat_avatar_drawer_construct (DINO_UI_TYPE_COMPAT_AVATAR_DRAWER);
}

gfloat
dino_ui_compat_avatar_drawer_get_radius_percent (DinoUiCompatAvatarDrawer* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_radius_percent;
	return result;
}

void
dino_ui_compat_avatar_drawer_set_radius_percent (DinoUiCompatAvatarDrawer* self,
                                                 gfloat value)
{
	g_return_if_fail (self != NULL);
	self->priv->_radius_percent = value;
}

DinoUiViewModelAvatarPictureModel*
dino_ui_compat_avatar_drawer_get_model (DinoUiCompatAvatarDrawer* self)
{
	DinoUiViewModelAvatarPictureModel* result;
	DinoUiViewModelAvatarPictureModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	result = _tmp0_;
	return result;
}

void
dino_ui_compat_avatar_drawer_set_model (DinoUiCompatAvatarDrawer* self,
                                        DinoUiViewModelAvatarPictureModel* value)
{
	DinoUiViewModelAvatarPictureModel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_model);
	self->priv->_model = _tmp0_;
}

gint
dino_ui_compat_avatar_drawer_get_height_request (DinoUiCompatAvatarDrawer* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_height_request;
	return result;
}

void
dino_ui_compat_avatar_drawer_set_height_request (DinoUiCompatAvatarDrawer* self,
                                                 gint value)
{
	g_return_if_fail (self != NULL);
	self->priv->_height_request = value;
}

gint
dino_ui_compat_avatar_drawer_get_width_request (DinoUiCompatAvatarDrawer* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_width_request;
	return result;
}

void
dino_ui_compat_avatar_drawer_set_width_request (DinoUiCompatAvatarDrawer* self,
                                                gint value)
{
	g_return_if_fail (self != NULL);
	self->priv->_width_request = value;
}

const gchar*
dino_ui_compat_avatar_drawer_get_font_family (DinoUiCompatAvatarDrawer* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_font_family;
	result = _tmp0_;
	return result;
}

void
dino_ui_compat_avatar_drawer_set_font_family (DinoUiCompatAvatarDrawer* self,
                                              const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_font_family);
	self->priv->_font_family = _tmp0_;
}

static void
dino_ui_value_compat_avatar_drawer_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
dino_ui_value_compat_avatar_drawer_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		dino_ui_compat_avatar_drawer_unref (value->data[0].v_pointer);
	}
}

static void
dino_ui_value_compat_avatar_drawer_copy_value (const GValue* src_value,
                                               GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = dino_ui_compat_avatar_drawer_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
dino_ui_value_compat_avatar_drawer_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
dino_ui_value_compat_avatar_drawer_collect_value (GValue* value,
                                                  guint n_collect_values,
                                                  GTypeCValue* collect_values,
                                                  guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		DinoUiCompatAvatarDrawer * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = dino_ui_compat_avatar_drawer_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
dino_ui_value_compat_avatar_drawer_lcopy_value (const GValue* value,
                                                guint n_collect_values,
                                                GTypeCValue* collect_values,
                                                guint collect_flags)
{
	DinoUiCompatAvatarDrawer ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = dino_ui_compat_avatar_drawer_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
dino_ui_param_spec_compat_avatar_drawer (const gchar* name,
                                         const gchar* nick,
                                         const gchar* blurb,
                                         GType object_type,
                                         GParamFlags flags)
{
	DinoUiParamSpecCompatAvatarDrawer* spec;
	g_return_val_if_fail (g_type_is_a (object_type, DINO_UI_TYPE_COMPAT_AVATAR_DRAWER), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
dino_ui_value_get_compat_avatar_drawer (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_UI_TYPE_COMPAT_AVATAR_DRAWER), NULL);
	return value->data[0].v_pointer;
}

void
dino_ui_value_set_compat_avatar_drawer (GValue* value,
                                        gpointer v_object)
{
	DinoUiCompatAvatarDrawer * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_UI_TYPE_COMPAT_AVATAR_DRAWER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_UI_TYPE_COMPAT_AVATAR_DRAWER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		dino_ui_compat_avatar_drawer_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_ui_compat_avatar_drawer_unref (old);
	}
}

void
dino_ui_value_take_compat_avatar_drawer (GValue* value,
                                         gpointer v_object)
{
	DinoUiCompatAvatarDrawer * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DINO_UI_TYPE_COMPAT_AVATAR_DRAWER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DINO_UI_TYPE_COMPAT_AVATAR_DRAWER));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dino_ui_compat_avatar_drawer_unref (old);
	}
}

static void
dino_ui_compat_avatar_drawer_class_init (DinoUiCompatAvatarDrawerClass * klass,
                                         gpointer klass_data)
{
	dino_ui_compat_avatar_drawer_parent_class = g_type_class_peek_parent (klass);
	((DinoUiCompatAvatarDrawerClass *) klass)->finalize = dino_ui_compat_avatar_drawer_finalize;
	g_type_class_adjust_private_offset (klass, &DinoUiCompatAvatarDrawer_private_offset);
}

static void
dino_ui_compat_avatar_drawer_instance_init (DinoUiCompatAvatarDrawer * self,
                                            gpointer klass)
{
	gchar* _tmp0_;
	self->priv = dino_ui_compat_avatar_drawer_get_instance_private (self);
	self->priv->_radius_percent = 0.2f;
	self->priv->_height_request = 35;
	self->priv->_width_request = 35;
	_tmp0_ = g_strdup ("Sans");
	self->priv->_font_family = _tmp0_;
	self->ref_count = 1;
}

static void
dino_ui_compat_avatar_drawer_finalize (DinoUiCompatAvatarDrawer * obj)
{
	DinoUiCompatAvatarDrawer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_COMPAT_AVATAR_DRAWER, DinoUiCompatAvatarDrawer);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->_model);
	_g_free0 (self->priv->_font_family);
}

static GType
dino_ui_compat_avatar_drawer_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { dino_ui_value_compat_avatar_drawer_init, dino_ui_value_compat_avatar_drawer_free_value, dino_ui_value_compat_avatar_drawer_copy_value, dino_ui_value_compat_avatar_drawer_peek_pointer, "p", dino_ui_value_compat_avatar_drawer_collect_value, "p", dino_ui_value_compat_avatar_drawer_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiCompatAvatarDrawerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_compat_avatar_drawer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiCompatAvatarDrawer), 0, (GInstanceInitFunc) dino_ui_compat_avatar_drawer_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType dino_ui_compat_avatar_drawer_type_id;
	dino_ui_compat_avatar_drawer_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DinoUiCompatAvatarDrawer", &g_define_type_info, &g_define_type_fundamental_info, 0);
	DinoUiCompatAvatarDrawer_private_offset = g_type_add_instance_private (dino_ui_compat_avatar_drawer_type_id, sizeof (DinoUiCompatAvatarDrawerPrivate));
	return dino_ui_compat_avatar_drawer_type_id;
}

GType
dino_ui_compat_avatar_drawer_get_type (void)
{
	static volatile gsize dino_ui_compat_avatar_drawer_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_compat_avatar_drawer_type_id__once)) {
		GType dino_ui_compat_avatar_drawer_type_id;
		dino_ui_compat_avatar_drawer_type_id = dino_ui_compat_avatar_drawer_get_type_once ();
		g_once_init_leave (&dino_ui_compat_avatar_drawer_type_id__once, dino_ui_compat_avatar_drawer_type_id);
	}
	return dino_ui_compat_avatar_drawer_type_id__once;
}

gpointer
dino_ui_compat_avatar_drawer_ref (gpointer instance)
{
	DinoUiCompatAvatarDrawer * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
dino_ui_compat_avatar_drawer_unref (gpointer instance)
{
	DinoUiCompatAvatarDrawer * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DINO_UI_COMPAT_AVATAR_DRAWER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
dino_ui_avatar_picture_get_instance_private (DinoUiAvatarPicture* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiAvatarPicture_private_offset);
}

static void
_dino_ui_avatar_picture_on_model_items_changed_g_list_model_items_changed (GListModel* _sender,
                                                                           guint position,
                                                                           guint removed,
                                                                           guint added,
                                                                           gpointer self)
{
	dino_ui_avatar_picture_on_model_items_changed ((DinoUiAvatarPicture*) self, position, removed, added);
}

static void
dino_ui_avatar_picture_on_model_changed (DinoUiAvatarPicture* self)
{
	DinoUiViewModelAvatarPictureModel* _tmp0_;
	GeeList* _tmp14_;
	DinoUiViewModelAvatarPictureModel* _tmp15_;
	DinoUiViewModelAvatarPictureModel* _tmp16_;
	DinoUiViewModelAvatarPictureModel* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->old_model;
	if (_tmp0_ != NULL) {
		DinoUiViewModelAvatarPictureModel* _tmp1_;
		GListModel* _tmp2_;
		GListModel* _tmp3_;
		_tmp1_ = self->priv->old_model;
		_tmp2_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp1_);
		_tmp3_ = _tmp2_;
		g_signal_handler_disconnect ((GObject*) _tmp3_, self->priv->model_tiles_items_changed_handler);
	}
	{
		GeeList* _tile_list = NULL;
		GeeList* _tmp4_;
		gint _tile_size = 0;
		GeeList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _tile_index = 0;
		_tmp4_ = self->priv->tiles;
		_tile_list = _tmp4_;
		_tmp5_ = _tile_list;
		_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tile_size = _tmp7_;
		_tile_index = -1;
		while (TRUE) {
			gint _tmp8_;
			gint _tmp9_;
			DinoUiAvatarPictureTile* tile = NULL;
			GeeList* _tmp10_;
			gpointer _tmp11_;
			DinoUiAvatarPictureTile* _tmp12_;
			DinoUiAvatarPictureTile* _tmp13_;
			_tile_index = _tile_index + 1;
			_tmp8_ = _tile_index;
			_tmp9_ = _tile_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _tile_list;
			_tmp11_ = gee_list_get (_tmp10_, _tile_index);
			tile = (DinoUiAvatarPictureTile*) _tmp11_;
			_tmp12_ = tile;
			gtk_widget_unparent ((GtkWidget*) _tmp12_);
			_tmp13_ = tile;
			g_object_run_dispose ((GObject*) _tmp13_);
			_g_object_unref0 (tile);
		}
	}
	_tmp14_ = self->priv->tiles;
	gee_collection_clear ((GeeCollection*) _tmp14_);
	_tmp15_ = self->priv->_model;
	_tmp16_ = _g_object_ref0 (_tmp15_);
	_g_object_unref0 (self->priv->old_model);
	self->priv->old_model = _tmp16_;
	_tmp17_ = self->priv->_model;
	if (_tmp17_ != NULL) {
		DinoUiViewModelAvatarPictureModel* _tmp18_;
		GListModel* _tmp19_;
		GListModel* _tmp20_;
		gulong _tmp21_;
		_tmp18_ = self->priv->_model;
		_tmp19_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = g_signal_connect_object (_tmp20_, "items-changed", (GCallback) _dino_ui_avatar_picture_on_model_items_changed_g_list_model_items_changed, self, 0);
		self->priv->model_tiles_items_changed_handler = _tmp21_;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp22_ = FALSE;
				_tmp22_ = TRUE;
				while (TRUE) {
					DinoUiViewModelAvatarPictureModel* _tmp24_;
					GListModel* _tmp25_;
					GListModel* _tmp26_;
					DinoUiAvatarPictureTile* tile = NULL;
					DinoUiAvatarPictureTile* _tmp27_;
					DinoUiAvatarPictureTile* _tmp28_;
					DinoUiViewModelAvatarPictureModel* _tmp29_;
					GListModel* _tmp30_;
					GListModel* _tmp31_;
					GObject* _tmp32_;
					DinoUiViewModelAvatarPictureTileModel* _tmp33_;
					DinoUiViewModelAvatarPictureTileModel* _tmp34_;
					DinoUiAvatarPictureTile* _tmp35_ = NULL;
					GeeList* _tmp36_;
					gboolean _tmp37_;
					gboolean _tmp38_;
					DinoUiAvatarPictureTile* _tmp41_;
					GeeList* _tmp42_;
					DinoUiAvatarPictureTile* _tmp43_;
					if (!_tmp22_) {
						gint _tmp23_;
						_tmp23_ = i;
						i = _tmp23_ + 1;
					}
					_tmp22_ = FALSE;
					_tmp24_ = self->priv->_model;
					_tmp25_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp24_);
					_tmp26_ = _tmp25_;
					if (!(((guint) i) < g_list_model_get_n_items (_tmp26_))) {
						break;
					}
					_tmp27_ = dino_ui_avatar_picture_tile_new ();
					g_object_ref_sink (_tmp27_);
					tile = _tmp27_;
					_tmp28_ = tile;
					_tmp29_ = self->priv->_model;
					_tmp30_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp29_);
					_tmp31_ = _tmp30_;
					_tmp32_ = g_list_model_get_item (_tmp31_, (guint) i);
					_tmp33_ = DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_TILE_MODEL (_tmp32_) ? ((DinoUiViewModelAvatarPictureTileModel*) _tmp32_) : NULL;
					if (_tmp33_ == NULL) {
						_g_object_unref0 (_tmp32_);
					}
					_tmp34_ = _tmp33_;
					dino_ui_avatar_picture_tile_set_model (_tmp28_, _tmp34_);
					_g_object_unref0 (_tmp34_);
					_tmp36_ = self->priv->tiles;
					_tmp37_ = gee_collection_get_is_empty ((GeeCollection*) _tmp36_);
					_tmp38_ = _tmp37_;
					if (_tmp38_) {
						_g_object_unref0 (_tmp35_);
						_tmp35_ = NULL;
					} else {
						GeeList* _tmp39_;
						gpointer _tmp40_;
						_tmp39_ = self->priv->tiles;
						_tmp40_ = gee_list_last (_tmp39_);
						_g_object_unref0 (_tmp35_);
						_tmp35_ = (DinoUiAvatarPictureTile*) _tmp40_;
					}
					_tmp41_ = tile;
					gtk_widget_insert_after ((GtkWidget*) _tmp41_, (GtkWidget*) self, (GtkWidget*) _tmp35_);
					_tmp42_ = self->priv->tiles;
					_tmp43_ = tile;
					gee_collection_add ((GeeCollection*) _tmp42_, _tmp43_);
					_g_object_unref0 (_tmp35_);
					_g_object_unref0 (tile);
				}
			}
		}
	}
}

static void
dino_ui_avatar_picture_on_model_items_changed (DinoUiAvatarPicture* self,
                                               guint position,
                                               guint removed,
                                               guint added)
{
	g_return_if_fail (self != NULL);
	while (TRUE) {
		DinoUiAvatarPictureTile* old = NULL;
		GeeList* _tmp0_;
		gpointer _tmp1_;
		DinoUiAvatarPictureTile* _tmp2_;
		DinoUiAvatarPictureTile* _tmp3_;
		guint _tmp4_;
		if (!(removed > ((guint) 0))) {
			break;
		}
		_tmp0_ = self->priv->tiles;
		_tmp1_ = gee_list_remove_at (_tmp0_, (gint) position);
		old = (DinoUiAvatarPictureTile*) _tmp1_;
		_tmp2_ = old;
		gtk_widget_unparent ((GtkWidget*) _tmp2_);
		_tmp3_ = old;
		g_object_run_dispose ((GObject*) _tmp3_);
		_tmp4_ = removed;
		removed = _tmp4_ - 1;
		_g_object_unref0 (old);
	}
	while (TRUE) {
		DinoUiAvatarPictureTile* tile = NULL;
		DinoUiAvatarPictureTile* _tmp5_;
		DinoUiAvatarPictureTile* _tmp6_;
		DinoUiViewModelAvatarPictureModel* _tmp7_;
		GListModel* _tmp8_;
		GListModel* _tmp9_;
		GObject* _tmp10_;
		DinoUiViewModelAvatarPictureTileModel* _tmp11_;
		DinoUiViewModelAvatarPictureTileModel* _tmp12_;
		DinoUiAvatarPictureTile* _tmp13_ = NULL;
		DinoUiAvatarPictureTile* _tmp16_;
		GeeList* _tmp17_;
		DinoUiAvatarPictureTile* _tmp18_;
		guint _tmp19_;
		guint _tmp20_;
		if (!(added > ((guint) 0))) {
			break;
		}
		_tmp5_ = dino_ui_avatar_picture_tile_new ();
		g_object_ref_sink (_tmp5_);
		tile = _tmp5_;
		_tmp6_ = tile;
		_tmp7_ = self->priv->_model;
		_tmp8_ = dino_ui_view_model_avatar_picture_model_get_tiles (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = g_list_model_get_item (_tmp9_, position);
		_tmp11_ = DINO_UI_VIEW_MODEL_IS_AVATAR_PICTURE_TILE_MODEL (_tmp10_) ? ((DinoUiViewModelAvatarPictureTileModel*) _tmp10_) : NULL;
		if (_tmp11_ == NULL) {
			_g_object_unref0 (_tmp10_);
		}
		_tmp12_ = _tmp11_;
		dino_ui_avatar_picture_tile_set_model (_tmp6_, _tmp12_);
		_g_object_unref0 (_tmp12_);
		if (position == ((guint) 0)) {
			_g_object_unref0 (_tmp13_);
			_tmp13_ = NULL;
		} else {
			GeeList* _tmp14_;
			gpointer _tmp15_;
			_tmp14_ = self->priv->tiles;
			_tmp15_ = gee_list_get (_tmp14_, ((gint) position) - 1);
			_g_object_unref0 (_tmp13_);
			_tmp13_ = (DinoUiAvatarPictureTile*) _tmp15_;
		}
		_tmp16_ = tile;
		gtk_widget_insert_after ((GtkWidget*) _tmp16_, (GtkWidget*) self, (GtkWidget*) _tmp13_);
		_tmp17_ = self->priv->tiles;
		_tmp18_ = tile;
		gee_list_insert (_tmp17_, (gint) position, _tmp18_);
		_tmp19_ = position;
		position = _tmp19_ + 1;
		_tmp20_ = added;
		added = _tmp20_ - 1;
		_g_object_unref0 (_tmp13_);
		_g_object_unref0 (tile);
	}
	gtk_widget_queue_allocate ((GtkWidget*) self);
}

static void
dino_ui_avatar_picture_real_measure (GtkWidget* base,
                                     GtkOrientation orientation,
                                     gint for_size,
                                     gint* minimum,
                                     gint* natural,
                                     gint* minimum_baseline,
                                     gint* natural_baseline)
{
	DinoUiAvatarPicture * self;
	gint _vala_minimum = 0;
	gint _vala_natural = 0;
	gint _vala_minimum_baseline = 0;
	gint _vala_natural_baseline = 0;
	self = (DinoUiAvatarPicture*) base;
	_vala_natural_baseline = -1;
	_vala_minimum_baseline = _vala_natural_baseline;
	if (orientation == GTK_ORIENTATION_HORIZONTAL) {
		gint _tmp0_;
		gint _tmp1_;
		g_object_get ((GtkWidget*) self, "width-request", &_tmp0_, NULL);
		_tmp1_ = _tmp0_;
		_vala_natural = _tmp1_;
		_vala_minimum = _vala_natural;
	} else {
		gint _tmp2_;
		gint _tmp3_;
		g_object_get ((GtkWidget*) self, "height-request", &_tmp2_, NULL);
		_tmp3_ = _tmp2_;
		_vala_natural = _tmp3_;
		_vala_minimum = _vala_natural;
	}
	if (minimum) {
		*minimum = _vala_minimum;
	}
	if (natural) {
		*natural = _vala_natural;
	}
	if (minimum_baseline) {
		*minimum_baseline = _vala_minimum_baseline;
	}
	if (natural_baseline) {
		*natural_baseline = _vala_natural_baseline;
	}
}

static void
dino_ui_avatar_picture_real_size_allocate (GtkWidget* base,
                                           gint width,
                                           gint height,
                                           gint baseline)
{
	DinoUiAvatarPicture * self;
	gint half_width_size = 0;
	gint half_height_size = 0;
	gint _tmp0_ = 0;
	gint half_width_offset = 0;
	gint _tmp1_ = 0;
	gint half_height_offset = 0;
	GeeList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	self = (DinoUiAvatarPicture*) base;
	half_width_size = width / 2;
	half_height_size = height / 2;
	if ((width % 2) == 0) {
		_tmp0_ = half_width_size;
	} else {
		_tmp0_ = half_width_size + 1;
	}
	half_width_offset = _tmp0_;
	if ((height % 2) == 0) {
		_tmp1_ = half_height_size;
	} else {
		_tmp1_ = half_height_size + 1;
	}
	half_height_offset = _tmp1_;
	_tmp2_ = self->priv->tiles;
	_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == 1) {
		GeeList* _tmp5_;
		gpointer _tmp6_;
		DinoUiAvatarPictureTile* _tmp7_;
		_tmp5_ = self->priv->tiles;
		_tmp6_ = gee_list_get (_tmp5_, 0);
		_tmp7_ = (DinoUiAvatarPictureTile*) _tmp6_;
		gtk_widget_allocate ((GtkWidget*) _tmp7_, width, height, baseline, NULL);
		_g_object_unref0 (_tmp7_);
	} else {
		GeeList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		_tmp8_ = self->priv->tiles;
		_tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_);
		_tmp10_ = _tmp9_;
		if (_tmp10_ == 2) {
			GeeList* _tmp11_;
			gpointer _tmp12_;
			DinoUiAvatarPictureTile* _tmp13_;
			GtkAllocation _tmp14_ = {0};
			GeeList* _tmp15_;
			gpointer _tmp16_;
			DinoUiAvatarPictureTile* _tmp17_;
			GtkAllocation _tmp18_ = {0};
			_tmp11_ = self->priv->tiles;
			_tmp12_ = gee_list_get (_tmp11_, 0);
			_tmp13_ = (DinoUiAvatarPictureTile*) _tmp12_;
			memset (&_tmp14_, 0, sizeof (GtkAllocation));
			_tmp14_.x = 0;
			_tmp14_.y = 0;
			_tmp14_.width = half_width_size;
			_tmp14_.height = height;
			gtk_widget_size_allocate ((GtkWidget*) _tmp13_, &_tmp14_, baseline);
			_g_object_unref0 (_tmp13_);
			_tmp15_ = self->priv->tiles;
			_tmp16_ = gee_list_get (_tmp15_, 1);
			_tmp17_ = (DinoUiAvatarPictureTile*) _tmp16_;
			memset (&_tmp18_, 0, sizeof (GtkAllocation));
			_tmp18_.x = half_width_offset;
			_tmp18_.y = 0;
			_tmp18_.width = half_width_size;
			_tmp18_.height = height;
			gtk_widget_size_allocate ((GtkWidget*) _tmp17_, &_tmp18_, baseline);
			_g_object_unref0 (_tmp17_);
		} else {
			GeeList* _tmp19_;
			gint _tmp20_;
			gint _tmp21_;
			_tmp19_ = self->priv->tiles;
			_tmp20_ = gee_collection_get_size ((GeeCollection*) _tmp19_);
			_tmp21_ = _tmp20_;
			if (_tmp21_ == 3) {
				GeeList* _tmp22_;
				gpointer _tmp23_;
				DinoUiAvatarPictureTile* _tmp24_;
				GtkAllocation _tmp25_ = {0};
				GeeList* _tmp26_;
				gpointer _tmp27_;
				DinoUiAvatarPictureTile* _tmp28_;
				GtkAllocation _tmp29_ = {0};
				GeeList* _tmp30_;
				gpointer _tmp31_;
				DinoUiAvatarPictureTile* _tmp32_;
				GtkAllocation _tmp33_ = {0};
				_tmp22_ = self->priv->tiles;
				_tmp23_ = gee_list_get (_tmp22_, 0);
				_tmp24_ = (DinoUiAvatarPictureTile*) _tmp23_;
				memset (&_tmp25_, 0, sizeof (GtkAllocation));
				_tmp25_.x = 0;
				_tmp25_.y = 0;
				_tmp25_.width = half_width_size;
				_tmp25_.height = height;
				gtk_widget_size_allocate ((GtkWidget*) _tmp24_, &_tmp25_, baseline);
				_g_object_unref0 (_tmp24_);
				_tmp26_ = self->priv->tiles;
				_tmp27_ = gee_list_get (_tmp26_, 1);
				_tmp28_ = (DinoUiAvatarPictureTile*) _tmp27_;
				memset (&_tmp29_, 0, sizeof (GtkAllocation));
				_tmp29_.x = half_width_offset;
				_tmp29_.y = 0;
				_tmp29_.width = half_width_size;
				_tmp29_.height = half_height_size;
				gtk_widget_size_allocate ((GtkWidget*) _tmp28_, &_tmp29_, baseline);
				_g_object_unref0 (_tmp28_);
				_tmp30_ = self->priv->tiles;
				_tmp31_ = gee_list_get (_tmp30_, 2);
				_tmp32_ = (DinoUiAvatarPictureTile*) _tmp31_;
				memset (&_tmp33_, 0, sizeof (GtkAllocation));
				_tmp33_.x = half_width_offset;
				_tmp33_.y = half_height_offset;
				_tmp33_.width = half_width_size;
				_tmp33_.height = half_height_size;
				gtk_widget_size_allocate ((GtkWidget*) _tmp32_, &_tmp33_, baseline);
				_g_object_unref0 (_tmp32_);
			} else {
				GeeList* _tmp34_;
				gint _tmp35_;
				gint _tmp36_;
				_tmp34_ = self->priv->tiles;
				_tmp35_ = gee_collection_get_size ((GeeCollection*) _tmp34_);
				_tmp36_ = _tmp35_;
				if (_tmp36_ == 4) {
					GeeList* _tmp37_;
					gpointer _tmp38_;
					DinoUiAvatarPictureTile* _tmp39_;
					GtkAllocation _tmp40_ = {0};
					GeeList* _tmp41_;
					gpointer _tmp42_;
					DinoUiAvatarPictureTile* _tmp43_;
					GtkAllocation _tmp44_ = {0};
					GeeList* _tmp45_;
					gpointer _tmp46_;
					DinoUiAvatarPictureTile* _tmp47_;
					GtkAllocation _tmp48_ = {0};
					GeeList* _tmp49_;
					gpointer _tmp50_;
					DinoUiAvatarPictureTile* _tmp51_;
					GtkAllocation _tmp52_ = {0};
					_tmp37_ = self->priv->tiles;
					_tmp38_ = gee_list_get (_tmp37_, 0);
					_tmp39_ = (DinoUiAvatarPictureTile*) _tmp38_;
					memset (&_tmp40_, 0, sizeof (GtkAllocation));
					_tmp40_.x = 0;
					_tmp40_.y = 0;
					_tmp40_.width = half_width_size;
					_tmp40_.height = half_height_size;
					gtk_widget_size_allocate ((GtkWidget*) _tmp39_, &_tmp40_, baseline);
					_g_object_unref0 (_tmp39_);
					_tmp41_ = self->priv->tiles;
					_tmp42_ = gee_list_get (_tmp41_, 1);
					_tmp43_ = (DinoUiAvatarPictureTile*) _tmp42_;
					memset (&_tmp44_, 0, sizeof (GtkAllocation));
					_tmp44_.x = half_width_offset;
					_tmp44_.y = 0;
					_tmp44_.width = half_width_size;
					_tmp44_.height = half_height_size;
					gtk_widget_size_allocate ((GtkWidget*) _tmp43_, &_tmp44_, baseline);
					_g_object_unref0 (_tmp43_);
					_tmp45_ = self->priv->tiles;
					_tmp46_ = gee_list_get (_tmp45_, 2);
					_tmp47_ = (DinoUiAvatarPictureTile*) _tmp46_;
					memset (&_tmp48_, 0, sizeof (GtkAllocation));
					_tmp48_.x = 0;
					_tmp48_.y = half_height_offset;
					_tmp48_.width = half_width_size;
					_tmp48_.height = half_height_size;
					gtk_widget_size_allocate ((GtkWidget*) _tmp47_, &_tmp48_, baseline);
					_g_object_unref0 (_tmp47_);
					_tmp49_ = self->priv->tiles;
					_tmp50_ = gee_list_get (_tmp49_, 3);
					_tmp51_ = (DinoUiAvatarPictureTile*) _tmp50_;
					memset (&_tmp52_, 0, sizeof (GtkAllocation));
					_tmp52_.x = half_width_offset;
					_tmp52_.y = half_height_offset;
					_tmp52_.width = half_width_size;
					_tmp52_.height = half_height_size;
					gtk_widget_size_allocate ((GtkWidget*) _tmp51_, &_tmp52_, baseline);
					_g_object_unref0 (_tmp51_);
				}
			}
		}
	}
}

static GtkSizeRequestMode
dino_ui_avatar_picture_real_get_request_mode (GtkWidget* base)
{
	DinoUiAvatarPicture * self;
	GtkSizeRequestMode result;
	self = (DinoUiAvatarPicture*) base;
	result = GTK_SIZE_REQUEST_CONSTANT_SIZE;
	return result;
}

static void
dino_ui_avatar_picture_real_snapshot (GtkWidget* base,
                                      GtkSnapshot* snapshot)
{
	DinoUiAvatarPicture * self;
	graphene_rect_t bounds = {0};
	GskRoundedRect rounded_rect = {0};
	graphene_rect_t _tmp0_;
	gfloat _tmp1_;
	GskRoundedRect _tmp2_;
	self = (DinoUiAvatarPicture*) base;
	g_return_if_fail (snapshot != NULL);
	memset (&bounds, 0, sizeof (graphene_rect_t));
	graphene_rect_init (&bounds, (gfloat) 0, (gfloat) 0, (gfloat) gtk_widget_get_width ((GtkWidget*) self), (gfloat) gtk_widget_get_height ((GtkWidget*) self));
	memset (&rounded_rect, 0, sizeof (GskRoundedRect));
	_tmp0_ = bounds;
	_tmp1_ = self->priv->_radius_percent;
	gsk_rounded_rect_init_from_rect (&rounded_rect, &_tmp0_, ((gtk_widget_get_width ((GtkWidget*) self) + gtk_widget_get_height ((GtkWidget*) self)) * 0.25f) * _tmp1_);
	_tmp2_ = rounded_rect;
	gtk_snapshot_push_rounded_clip (snapshot, &_tmp2_);
	GTK_WIDGET_CLASS (dino_ui_avatar_picture_parent_class)->snapshot (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), snapshot);
	gtk_snapshot_pop (snapshot);
}

static void
dino_ui_avatar_picture_real_dispose (GObject* base)
{
	DinoUiAvatarPicture * self;
	self = (DinoUiAvatarPicture*) base;
	dino_ui_avatar_picture_set_model (self, NULL);
	dino_ui_avatar_picture_on_model_changed (self);
	G_OBJECT_CLASS (dino_ui_avatar_picture_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

DinoUiAvatarPicture*
dino_ui_avatar_picture_construct (GType object_type)
{
	DinoUiAvatarPicture * self = NULL;
	self = (DinoUiAvatarPicture*) g_object_new (object_type, NULL);
	return self;
}

DinoUiAvatarPicture*
dino_ui_avatar_picture_new (void)
{
	return dino_ui_avatar_picture_construct (DINO_UI_TYPE_AVATAR_PICTURE);
}

gfloat
dino_ui_avatar_picture_get_radius_percent (DinoUiAvatarPicture* self)
{
	gfloat result;
	g_return_val_if_fail (self != NULL, -1.0F);
	result = self->priv->_radius_percent;
	return result;
}

void
dino_ui_avatar_picture_set_radius_percent (DinoUiAvatarPicture* self,
                                           gfloat value)
{
	gfloat old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_avatar_picture_get_radius_percent (self);
	if (old_value != value) {
		self->priv->_radius_percent = value;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_avatar_picture_properties[DINO_UI_AVATAR_PICTURE_RADIUS_PERCENT_PROPERTY]);
	}
}

DinoUiViewModelAvatarPictureModel*
dino_ui_avatar_picture_get_model (DinoUiAvatarPicture* self)
{
	DinoUiViewModelAvatarPictureModel* result;
	DinoUiViewModelAvatarPictureModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	result = _tmp0_;
	return result;
}

void
dino_ui_avatar_picture_set_model (DinoUiAvatarPicture* self,
                                  DinoUiViewModelAvatarPictureModel* value)
{
	DinoUiViewModelAvatarPictureModel* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_avatar_picture_get_model (self);
	if (old_value != value) {
		DinoUiViewModelAvatarPictureModel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_model);
		self->priv->_model = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_avatar_picture_properties[DINO_UI_AVATAR_PICTURE_MODEL_PROPERTY]);
	}
}

static inline gpointer
dino_ui_avatar_picture_tile_get_instance_private (DinoUiAvatarPictureTile* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiAvatarPictureTile_private_offset);
}

static void
dino_ui_avatar_picture_tile_on_model_changed (DinoUiAvatarPictureTile* self)
{
	GBinding* _tmp0_;
	GBinding* _tmp3_;
	GBinding* _tmp6_;
	DinoUiViewModelAvatarPictureTileModel* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->background_color_binding;
	if (_tmp0_ != NULL) {
		GBinding* _tmp1_;
		GBinding* _tmp2_;
		_tmp1_ = self->priv->background_color_binding;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		g_binding_unbind (_tmp2_);
	}
	_tmp3_ = self->priv->display_text_binding;
	if (_tmp3_ != NULL) {
		GBinding* _tmp4_;
		GBinding* _tmp5_;
		_tmp4_ = self->priv->display_text_binding;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		g_binding_unbind (_tmp5_);
	}
	_tmp6_ = self->priv->image_file_binding;
	if (_tmp6_ != NULL) {
		GBinding* _tmp7_;
		GBinding* _tmp8_;
		_tmp7_ = self->priv->image_file_binding;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		g_binding_unbind (_tmp8_);
	}
	_tmp9_ = self->priv->_model;
	if (_tmp9_ != NULL) {
		DinoUiViewModelAvatarPictureTileModel* _tmp10_;
		GBinding* _tmp11_;
		GBinding* _tmp12_;
		DinoUiViewModelAvatarPictureTileModel* _tmp13_;
		GBinding* _tmp14_;
		GBinding* _tmp15_;
		DinoUiViewModelAvatarPictureTileModel* _tmp16_;
		GBinding* _tmp17_;
		GBinding* _tmp18_;
		_tmp10_ = self->priv->_model;
		_tmp11_ = g_object_bind_property_with_closures ((GObject*) _tmp10_, "background-color", (GObject*) self, "background-color", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp12_ = _g_object_ref0 (_tmp11_);
		_g_object_unref0 (self->priv->background_color_binding);
		self->priv->background_color_binding = _tmp12_;
		_tmp13_ = self->priv->_model;
		_tmp14_ = g_object_bind_property_with_closures ((GObject*) _tmp13_, "display-text", (GObject*) self, "display-text", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp15_ = _g_object_ref0 (_tmp14_);
		_g_object_unref0 (self->priv->display_text_binding);
		self->priv->display_text_binding = _tmp15_;
		_tmp16_ = self->priv->_model;
		_tmp17_ = g_object_bind_property_with_closures ((GObject*) _tmp16_, "image-file", (GObject*) self, "image-file", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp18_ = _g_object_ref0 (_tmp17_);
		_g_object_unref0 (self->priv->image_file_binding);
		self->priv->image_file_binding = _tmp18_;
	} else {
		_g_object_unref0 (self->priv->background_color_binding);
		self->priv->background_color_binding = NULL;
		_g_object_unref0 (self->priv->display_text_binding);
		self->priv->display_text_binding = NULL;
		_g_object_unref0 (self->priv->image_file_binding);
		self->priv->image_file_binding = NULL;
	}
}

static void
dino_ui_avatar_picture_tile_real_dispose (GObject* base)
{
	DinoUiAvatarPictureTile * self;
	GBinding* _tmp0_;
	GBinding* _tmp3_;
	GBinding* _tmp6_;
	GtkLabel* _tmp9_;
	GtkPicture* _tmp10_;
	self = (DinoUiAvatarPictureTile*) base;
	_tmp0_ = self->priv->background_color_binding;
	if (_tmp0_ != NULL) {
		GBinding* _tmp1_;
		GBinding* _tmp2_;
		_tmp1_ = self->priv->background_color_binding;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		g_binding_unbind (_tmp2_);
	}
	_tmp3_ = self->priv->display_text_binding;
	if (_tmp3_ != NULL) {
		GBinding* _tmp4_;
		GBinding* _tmp5_;
		_tmp4_ = self->priv->display_text_binding;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		g_binding_unbind (_tmp5_);
	}
	_tmp6_ = self->priv->image_file_binding;
	if (_tmp6_ != NULL) {
		GBinding* _tmp7_;
		GBinding* _tmp8_;
		_tmp7_ = self->priv->image_file_binding;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		g_binding_unbind (_tmp8_);
	}
	_g_object_unref0 (self->priv->background_color_binding);
	self->priv->background_color_binding = NULL;
	_g_object_unref0 (self->priv->display_text_binding);
	self->priv->display_text_binding = NULL;
	_g_object_unref0 (self->priv->image_file_binding);
	self->priv->image_file_binding = NULL;
	_tmp9_ = self->priv->label;
	gtk_widget_unparent ((GtkWidget*) _tmp9_);
	_tmp10_ = self->priv->picture;
	gtk_widget_unparent ((GtkWidget*) _tmp10_);
	G_OBJECT_CLASS (dino_ui_avatar_picture_tile_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
}

static void
dino_ui_avatar_picture_tile_real_size_allocate (GtkWidget* base,
                                                gint width,
                                                gint height,
                                                gint baseline)
{
	DinoUiAvatarPictureTile * self;
	gint min = 0;
	gint nat = 0;
	gint bl_min = 0;
	gint bl_nat = 0;
	GtkPicture* _tmp0_;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	self = (DinoUiAvatarPictureTile*) base;
	_tmp0_ = self->priv->picture;
	gtk_widget_measure ((GtkWidget*) _tmp0_, GTK_ORIENTATION_HORIZONTAL, -1, &_tmp1_, &_tmp2_, &_tmp3_, &_tmp4_);
	min = _tmp1_;
	nat = _tmp2_;
	bl_min = _tmp3_;
	bl_nat = _tmp4_;
	if (nat > 0) {
		GtkPicture* _tmp5_;
		GtkLabel* _tmp6_;
		_tmp5_ = self->priv->picture;
		gtk_widget_allocate ((GtkWidget*) _tmp5_, width, height, baseline, NULL);
		_tmp6_ = self->priv->label;
		gtk_widget_set_visible ((GtkWidget*) _tmp6_, FALSE);
	} else {
		GtkPicture* _tmp7_;
		GtkLabel* _tmp8_;
		PangoAttrList* _tmp9_;
		PangoAttrList* _tmp10_;
		GtkLabel* _tmp11_;
		PangoAttrList* _tmp12_;
		PangoAttrList* _tmp13_;
		PangoAttribute* _tmp14_;
		GtkLabel* _tmp15_;
		PangoAttrList* _tmp16_;
		PangoAttrList* _tmp17_;
		PangoAttribute* _tmp18_;
		GtkLabel* _tmp19_;
		GtkLabel* _tmp20_;
		GtkLabel* _tmp21_;
		_tmp7_ = self->priv->picture;
		gtk_widget_allocate ((GtkWidget*) _tmp7_, 0, 0, 0, NULL);
		_tmp8_ = self->priv->label;
		_tmp9_ = pango_attr_list_new ();
		_tmp10_ = _tmp9_;
		gtk_label_set_attributes (_tmp8_, _tmp10_);
		_pango_attr_list_unref0 (_tmp10_);
		_tmp11_ = self->priv->label;
		_tmp12_ = gtk_label_get_attributes (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = pango_attr_foreground_new (G_MAXUINT16, G_MAXUINT16, G_MAXUINT16);
		pango_attr_list_insert (_tmp13_, _tmp14_);
		_tmp15_ = self->priv->label;
		_tmp16_ = gtk_label_get_attributes (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = pango_attr_scale_new (MIN ((gdouble) width, (gdouble) height) * 0.05);
		pango_attr_list_insert (_tmp17_, _tmp18_);
		_tmp19_ = self->priv->label;
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp19_, height / 40);
		_tmp20_ = self->priv->label;
		gtk_widget_set_visible ((GtkWidget*) _tmp20_, TRUE);
		_tmp21_ = self->priv->label;
		gtk_widget_allocate ((GtkWidget*) _tmp21_, width, height, baseline, NULL);
	}
}

static void
dino_ui_avatar_picture_tile_real_snapshot (GtkWidget* base,
                                           GtkSnapshot* snapshot)
{
	DinoUiAvatarPictureTile * self;
	GtkLabel* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = (DinoUiAvatarPictureTile*) base;
	g_return_if_fail (snapshot != NULL);
	_tmp0_ = self->priv->label;
	_tmp1_ = gtk_widget_get_visible ((GtkWidget*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		graphene_rect_t bounds = {0};
		GdkRGBA _tmp3_;
		graphene_rect_t _tmp4_;
		GskRenderNode* _tmp5_;
		GskRenderNode* _tmp6_;
		memset (&bounds, 0, sizeof (graphene_rect_t));
		graphene_rect_init (&bounds, (gfloat) 0, (gfloat) 0, (gfloat) gtk_widget_get_width ((GtkWidget*) self), (gfloat) gtk_widget_get_height ((GtkWidget*) self));
		_tmp3_ = self->priv->_background_color;
		_tmp4_ = bounds;
		_tmp5_ = gsk_color_node_new (&_tmp3_, &_tmp4_);
		_tmp6_ = _tmp5_;
		gtk_snapshot_append_node (snapshot, _tmp6_);
		_gsk_render_node_unref0 (_tmp6_);
	}
	GTK_WIDGET_CLASS (dino_ui_avatar_picture_tile_parent_class)->snapshot (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), snapshot);
}

static DinoUiAvatarPictureTile*
dino_ui_avatar_picture_tile_construct (GType object_type)
{
	DinoUiAvatarPictureTile * self = NULL;
	self = (DinoUiAvatarPictureTile*) g_object_new (object_type, NULL);
	return self;
}

static DinoUiAvatarPictureTile*
dino_ui_avatar_picture_tile_new (void)
{
	return dino_ui_avatar_picture_tile_construct (DINO_UI_AVATAR_PICTURE_TYPE_TILE);
}

static DinoUiViewModelAvatarPictureTileModel*
dino_ui_avatar_picture_tile_get_model (DinoUiAvatarPictureTile* self)
{
	DinoUiViewModelAvatarPictureTileModel* result;
	DinoUiViewModelAvatarPictureTileModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	result = _tmp0_;
	return result;
}

static void
dino_ui_avatar_picture_tile_set_model (DinoUiAvatarPictureTile* self,
                                       DinoUiViewModelAvatarPictureTileModel* value)
{
	DinoUiViewModelAvatarPictureTileModel* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_avatar_picture_tile_get_model (self);
	if (old_value != value) {
		DinoUiViewModelAvatarPictureTileModel* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_model);
		self->priv->_model = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_avatar_picture_tile_properties[DINO_UI_AVATAR_PICTURE_TILE_MODEL_PROPERTY]);
	}
}

static void
dino_ui_avatar_picture_tile_get_background_color (DinoUiAvatarPictureTile* self,
                                                  GdkRGBA * result)
{
	GdkRGBA _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_background_color;
	*result = _tmp0_;
	return;
}

static void
dino_ui_avatar_picture_tile_set_background_color (DinoUiAvatarPictureTile* self,
                                                  GdkRGBA * value)
{
	GdkRGBA old_value;
	g_return_if_fail (self != NULL);
	dino_ui_avatar_picture_tile_get_background_color (self, &old_value);
	if (_gdk_rgba_equal (value, &old_value) != TRUE) {
		GdkRGBA _tmp0_;
		_tmp0_ = *value;
		self->priv->_background_color = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_avatar_picture_tile_properties[DINO_UI_AVATAR_PICTURE_TILE_BACKGROUND_COLOR_PROPERTY]);
	}
}

static const gchar*
dino_ui_avatar_picture_tile_get_display_text (DinoUiAvatarPictureTile* self)
{
	const gchar* result;
	GtkLabel* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->label;
	_tmp1_ = gtk_label_get_text (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
dino_ui_avatar_picture_tile_set_display_text (DinoUiAvatarPictureTile* self,
                                              const gchar* value)
{
	GtkLabel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->label;
	gtk_label_set_text (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, dino_ui_avatar_picture_tile_properties[DINO_UI_AVATAR_PICTURE_TILE_DISPLAY_TEXT_PROPERTY]);
}

static GFile*
dino_ui_avatar_picture_tile_get_image_file (DinoUiAvatarPictureTile* self)
{
	GFile* result;
	GtkPicture* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->picture;
	_tmp1_ = gtk_picture_get_file (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
dino_ui_avatar_picture_tile_set_image_file (DinoUiAvatarPictureTile* self,
                                            GFile* value)
{
	GtkPicture* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->picture;
	gtk_picture_set_file (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, dino_ui_avatar_picture_tile_properties[DINO_UI_AVATAR_PICTURE_TILE_IMAGE_FILE_PROPERTY]);
}

static void
_dino_ui_avatar_picture_tile_on_model_changed_g_object_notify (GObject* _sender,
                                                               GParamSpec* pspec,
                                                               gpointer self)
{
	dino_ui_avatar_picture_tile_on_model_changed ((DinoUiAvatarPictureTile*) self);
}

static GObject *
dino_ui_avatar_picture_tile_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DinoUiAvatarPictureTile * self;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	PangoAttrList* _tmp2_;
	PangoAttrList* _tmp3_;
	GtkLabel* _tmp4_;
	PangoAttrList* _tmp5_;
	PangoAttrList* _tmp6_;
	PangoAttribute* _tmp7_;
	GtkPicture* _tmp8_;
	GtkPicture* _tmp9_;
	GtkLabel* _tmp10_;
	parent_class = G_OBJECT_CLASS (dino_ui_avatar_picture_tile_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_AVATAR_PICTURE_TYPE_TILE, DinoUiAvatarPictureTile);
	_tmp0_ = self->priv->label;
	gtk_widget_insert_after ((GtkWidget*) _tmp0_, (GtkWidget*) self, NULL);
	_tmp1_ = self->priv->label;
	_tmp2_ = pango_attr_list_new ();
	_tmp3_ = _tmp2_;
	gtk_label_set_attributes (_tmp1_, _tmp3_);
	_pango_attr_list_unref0 (_tmp3_);
	_tmp4_ = self->priv->label;
	_tmp5_ = gtk_label_get_attributes (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = pango_attr_foreground_new (G_MAXUINT16, G_MAXUINT16, G_MAXUINT16);
	pango_attr_list_insert (_tmp6_, _tmp7_);
	_tmp8_ = self->priv->picture;
	gtk_picture_set_content_fit (_tmp8_, GTK_CONTENT_FIT_COVER);
	_tmp9_ = self->priv->picture;
	_tmp10_ = self->priv->label;
	gtk_widget_insert_after ((GtkWidget*) _tmp9_, (GtkWidget*) self, (GtkWidget*) _tmp10_);
	g_signal_connect_object ((GObject*) self, "notify::model", (GCallback) _dino_ui_avatar_picture_tile_on_model_changed_g_object_notify, self, 0);
	return obj;
}

static void
dino_ui_avatar_picture_tile_class_init (DinoUiAvatarPictureTileClass * klass,
                                        gpointer klass_data)
{
	dino_ui_avatar_picture_tile_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiAvatarPictureTile_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) dino_ui_avatar_picture_tile_real_dispose;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) dino_ui_avatar_picture_tile_real_size_allocate;
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) dino_ui_avatar_picture_tile_real_snapshot;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_avatar_picture_tile_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_avatar_picture_tile_set_property;
	G_OBJECT_CLASS (klass)->constructor = dino_ui_avatar_picture_tile_constructor;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_avatar_picture_tile_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_AVATAR_PICTURE_TILE_MODEL_PROPERTY, dino_ui_avatar_picture_tile_properties[DINO_UI_AVATAR_PICTURE_TILE_MODEL_PROPERTY] = g_param_spec_object ("model", "model", "model", DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_TILE_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_AVATAR_PICTURE_TILE_BACKGROUND_COLOR_PROPERTY, dino_ui_avatar_picture_tile_properties[DINO_UI_AVATAR_PICTURE_TILE_BACKGROUND_COLOR_PROPERTY] = g_param_spec_boxed ("background-color", "background-color", "background-color", gdk_rgba_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_AVATAR_PICTURE_TILE_DISPLAY_TEXT_PROPERTY, dino_ui_avatar_picture_tile_properties[DINO_UI_AVATAR_PICTURE_TILE_DISPLAY_TEXT_PROPERTY] = g_param_spec_string ("display-text", "display-text", "display-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_AVATAR_PICTURE_TILE_IMAGE_FILE_PROPERTY, dino_ui_avatar_picture_tile_properties[DINO_UI_AVATAR_PICTURE_TILE_IMAGE_FILE_PROPERTY] = g_param_spec_object ("image-file", "image-file", "image-file", g_file_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_ui_avatar_picture_tile_instance_init (DinoUiAvatarPictureTile * self,
                                           gpointer klass)
{
	GdkRGBA _tmp0_ = {0};
	GtkLabel* _tmp1_;
	GtkPicture* _tmp2_;
	self->priv = dino_ui_avatar_picture_tile_get_instance_private (self);
	memset (&_tmp0_, 0, sizeof (GdkRGBA));
	_tmp0_.red = 1.0f;
	_tmp0_.green = 1.0f;
	_tmp0_.blue = 1.0f;
	_tmp0_.alpha = 0.0f;
	self->priv->_background_color = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp1_);
	self->priv->label = _tmp1_;
	_tmp2_ = (GtkPicture*) gtk_picture_new ();
	g_object_ref_sink (_tmp2_);
	self->priv->picture = _tmp2_;
}

static void
dino_ui_avatar_picture_tile_finalize (GObject * obj)
{
	DinoUiAvatarPictureTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_AVATAR_PICTURE_TYPE_TILE, DinoUiAvatarPictureTile);
	_g_object_unref0 (self->priv->_model);
	_g_object_unref0 (self->priv->background_color_binding);
	_g_object_unref0 (self->priv->display_text_binding);
	_g_object_unref0 (self->priv->image_file_binding);
	_g_object_unref0 (self->priv->label);
	_g_object_unref0 (self->priv->picture);
	G_OBJECT_CLASS (dino_ui_avatar_picture_tile_parent_class)->finalize (obj);
}

static GType
dino_ui_avatar_picture_tile_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiAvatarPictureTileClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_avatar_picture_tile_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiAvatarPictureTile), 0, (GInstanceInitFunc) dino_ui_avatar_picture_tile_instance_init, NULL };
	GType dino_ui_avatar_picture_tile_type_id;
	dino_ui_avatar_picture_tile_type_id = g_type_register_static (gtk_widget_get_type (), "DinoUiAvatarPictureTile", &g_define_type_info, 0);
	DinoUiAvatarPictureTile_private_offset = g_type_add_instance_private (dino_ui_avatar_picture_tile_type_id, sizeof (DinoUiAvatarPictureTilePrivate));
	return dino_ui_avatar_picture_tile_type_id;
}

static GType
dino_ui_avatar_picture_tile_get_type (void)
{
	static volatile gsize dino_ui_avatar_picture_tile_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_avatar_picture_tile_type_id__once)) {
		GType dino_ui_avatar_picture_tile_type_id;
		dino_ui_avatar_picture_tile_type_id = dino_ui_avatar_picture_tile_get_type_once ();
		g_once_init_leave (&dino_ui_avatar_picture_tile_type_id__once, dino_ui_avatar_picture_tile_type_id);
	}
	return dino_ui_avatar_picture_tile_type_id__once;
}

static void
_vala_dino_ui_avatar_picture_tile_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	DinoUiAvatarPictureTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_AVATAR_PICTURE_TYPE_TILE, DinoUiAvatarPictureTile);
	switch (property_id) {
		case DINO_UI_AVATAR_PICTURE_TILE_MODEL_PROPERTY:
		g_value_set_object (value, dino_ui_avatar_picture_tile_get_model (self));
		break;
		case DINO_UI_AVATAR_PICTURE_TILE_BACKGROUND_COLOR_PROPERTY:
		{
			GdkRGBA boxed;
			dino_ui_avatar_picture_tile_get_background_color (self, &boxed);
			g_value_set_boxed (value, &boxed);
		}
		break;
		case DINO_UI_AVATAR_PICTURE_TILE_DISPLAY_TEXT_PROPERTY:
		g_value_set_string (value, dino_ui_avatar_picture_tile_get_display_text (self));
		break;
		case DINO_UI_AVATAR_PICTURE_TILE_IMAGE_FILE_PROPERTY:
		g_value_set_object (value, dino_ui_avatar_picture_tile_get_image_file (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_avatar_picture_tile_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	DinoUiAvatarPictureTile * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_AVATAR_PICTURE_TYPE_TILE, DinoUiAvatarPictureTile);
	switch (property_id) {
		case DINO_UI_AVATAR_PICTURE_TILE_MODEL_PROPERTY:
		dino_ui_avatar_picture_tile_set_model (self, g_value_get_object (value));
		break;
		case DINO_UI_AVATAR_PICTURE_TILE_BACKGROUND_COLOR_PROPERTY:
		dino_ui_avatar_picture_tile_set_background_color (self, g_value_get_boxed (value));
		break;
		case DINO_UI_AVATAR_PICTURE_TILE_DISPLAY_TEXT_PROPERTY:
		dino_ui_avatar_picture_tile_set_display_text (self, g_value_get_string (value));
		break;
		case DINO_UI_AVATAR_PICTURE_TILE_IMAGE_FILE_PROPERTY:
		dino_ui_avatar_picture_tile_set_image_file (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_gtk_widget_queue_draw_g_object_notify (GObject* _sender,
                                        GParamSpec* pspec,
                                        gpointer self)
{
	gtk_widget_queue_draw ((GtkWidget*) self);
}

static void
_dino_ui_avatar_picture_on_model_changed_g_object_notify (GObject* _sender,
                                                          GParamSpec* pspec,
                                                          gpointer self)
{
	dino_ui_avatar_picture_on_model_changed ((DinoUiAvatarPicture*) self);
}

static GObject *
dino_ui_avatar_picture_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DinoUiAvatarPicture * self;
	parent_class = G_OBJECT_CLASS (dino_ui_avatar_picture_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPicture);
	g_object_set ((GtkWidget*) self, "height-request", 35, NULL);
	g_object_set ((GtkWidget*) self, "width-request", 35, NULL);
	gtk_widget_class_set_css_name (G_TYPE_INSTANCE_GET_CLASS (self, gtk_widget_get_type (), GtkWidgetClass), "picture");
	gtk_widget_add_css_class ((GtkWidget*) self, "avatar");
	g_signal_connect_object ((GObject*) self, "notify::radius-percent", (GCallback) _gtk_widget_queue_draw_g_object_notify, (GtkWidget*) self, 0);
	g_signal_connect_object ((GObject*) self, "notify::model", (GCallback) _dino_ui_avatar_picture_on_model_changed_g_object_notify, self, 0);
	return obj;
}

static void
dino_ui_avatar_picture_class_init (DinoUiAvatarPictureClass * klass,
                                   gpointer klass_data)
{
	dino_ui_avatar_picture_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiAvatarPicture_private_offset);
	((GtkWidgetClass *) klass)->measure = (void (*) (GtkWidget*, GtkOrientation, gint, gint*, gint*, gint*, gint*)) dino_ui_avatar_picture_real_measure;
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) dino_ui_avatar_picture_real_size_allocate;
	((GtkWidgetClass *) klass)->get_request_mode = (GtkSizeRequestMode (*) (GtkWidget*)) dino_ui_avatar_picture_real_get_request_mode;
	((GtkWidgetClass *) klass)->snapshot = (void (*) (GtkWidget*, GtkSnapshot*)) dino_ui_avatar_picture_real_snapshot;
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) dino_ui_avatar_picture_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_avatar_picture_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_avatar_picture_set_property;
	G_OBJECT_CLASS (klass)->constructor = dino_ui_avatar_picture_constructor;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_avatar_picture_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_AVATAR_PICTURE_RADIUS_PERCENT_PROPERTY, dino_ui_avatar_picture_properties[DINO_UI_AVATAR_PICTURE_RADIUS_PERCENT_PROPERTY] = g_param_spec_float ("radius-percent", "radius-percent", "radius-percent", -G_MAXFLOAT, G_MAXFLOAT, 0.2f, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_AVATAR_PICTURE_MODEL_PROPERTY, dino_ui_avatar_picture_properties[DINO_UI_AVATAR_PICTURE_MODEL_PROPERTY] = g_param_spec_object ("model", "model", "model", DINO_UI_VIEW_MODEL_TYPE_AVATAR_PICTURE_MODEL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
dino_ui_avatar_picture_instance_init (DinoUiAvatarPicture * self,
                                      gpointer klass)
{
	GeeArrayList* _tmp0_;
	self->priv = dino_ui_avatar_picture_get_instance_private (self);
	self->priv->_radius_percent = 0.2f;
	_tmp0_ = gee_array_list_new (DINO_UI_AVATAR_PICTURE_TYPE_TILE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->tiles = (GeeList*) _tmp0_;
}

static void
dino_ui_avatar_picture_finalize (GObject * obj)
{
	DinoUiAvatarPicture * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPicture);
	_g_object_unref0 (self->priv->_model);
	_g_object_unref0 (self->priv->tiles);
	_g_object_unref0 (self->priv->old_model);
	G_OBJECT_CLASS (dino_ui_avatar_picture_parent_class)->finalize (obj);
}

static GType
dino_ui_avatar_picture_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiAvatarPictureClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_avatar_picture_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiAvatarPicture), 0, (GInstanceInitFunc) dino_ui_avatar_picture_instance_init, NULL };
	GType dino_ui_avatar_picture_type_id;
	dino_ui_avatar_picture_type_id = g_type_register_static (gtk_widget_get_type (), "DinoUiAvatarPicture", &g_define_type_info, 0);
	DinoUiAvatarPicture_private_offset = g_type_add_instance_private (dino_ui_avatar_picture_type_id, sizeof (DinoUiAvatarPicturePrivate));
	return dino_ui_avatar_picture_type_id;
}

GType
dino_ui_avatar_picture_get_type (void)
{
	static volatile gsize dino_ui_avatar_picture_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_avatar_picture_type_id__once)) {
		GType dino_ui_avatar_picture_type_id;
		dino_ui_avatar_picture_type_id = dino_ui_avatar_picture_get_type_once ();
		g_once_init_leave (&dino_ui_avatar_picture_type_id__once, dino_ui_avatar_picture_type_id);
	}
	return dino_ui_avatar_picture_type_id__once;
}

static void
_vala_dino_ui_avatar_picture_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	DinoUiAvatarPicture * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPicture);
	switch (property_id) {
		case DINO_UI_AVATAR_PICTURE_RADIUS_PERCENT_PROPERTY:
		g_value_set_float (value, dino_ui_avatar_picture_get_radius_percent (self));
		break;
		case DINO_UI_AVATAR_PICTURE_MODEL_PROPERTY:
		g_value_set_object (value, dino_ui_avatar_picture_get_model (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_avatar_picture_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec)
{
	DinoUiAvatarPicture * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_AVATAR_PICTURE, DinoUiAvatarPicture);
	switch (property_id) {
		case DINO_UI_AVATAR_PICTURE_RADIUS_PERCENT_PROPERTY:
		dino_ui_avatar_picture_set_radius_percent (self, g_value_get_float (value));
		break;
		case DINO_UI_AVATAR_PICTURE_MODEL_PROPERTY:
		dino_ui_avatar_picture_set_model (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

