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

#include "libdino.h"
#include <glib-object.h>
#include <gee.h>
#include <glib.h>
#include <gtk/gtk.h>
#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>
#include "dino_i18n.h"
#include <math.h>
#include <float.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_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM (dino_ui_conversation_summary_content_meta_item_get_type ())
#define DINO_UI_CONVERSATION_SUMMARY_CONTENT_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, DinoUiConversationSummaryContentMetaItem))
#define DINO_UI_CONVERSATION_SUMMARY_CONTENT_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, DinoUiConversationSummaryContentMetaItemClass))
#define DINO_UI_CONVERSATION_SUMMARY_IS_CONTENT_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM))
#define DINO_UI_CONVERSATION_SUMMARY_IS_CONTENT_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM))
#define DINO_UI_CONVERSATION_SUMMARY_CONTENT_META_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, DinoUiConversationSummaryContentMetaItemClass))

typedef struct _DinoUiConversationSummaryContentMetaItem DinoUiConversationSummaryContentMetaItem;
typedef struct _DinoUiConversationSummaryContentMetaItemClass DinoUiConversationSummaryContentMetaItemClass;
typedef struct _DinoUiConversationSummaryContentMetaItemPrivate DinoUiConversationSummaryContentMetaItemPrivate;

#define DINO_UI_TYPE_CALL_META_ITEM (dino_ui_call_meta_item_get_type ())
#define DINO_UI_CALL_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CALL_META_ITEM, DinoUiCallMetaItem))
#define DINO_UI_CALL_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CALL_META_ITEM, DinoUiCallMetaItemClass))
#define DINO_UI_IS_CALL_META_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CALL_META_ITEM))
#define DINO_UI_IS_CALL_META_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CALL_META_ITEM))
#define DINO_UI_CALL_META_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CALL_META_ITEM, DinoUiCallMetaItemClass))

typedef struct _DinoUiCallMetaItem DinoUiCallMetaItem;
typedef struct _DinoUiCallMetaItemClass DinoUiCallMetaItemClass;
typedef struct _DinoUiCallMetaItemPrivate DinoUiCallMetaItemPrivate;
enum  {
	DINO_UI_CALL_META_ITEM_0_PROPERTY,
	DINO_UI_CALL_META_ITEM_NUM_PROPERTIES
};
static GParamSpec* dino_ui_call_meta_item_properties[DINO_UI_CALL_META_ITEM_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define DINO_UI_TYPE_SIZE_REQUEST_BOX (dino_ui_size_request_box_get_type ())
#define DINO_UI_SIZE_REQUEST_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_SIZE_REQUEST_BOX, DinoUiSizeRequestBox))
#define DINO_UI_SIZE_REQUEST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_SIZE_REQUEST_BOX, DinoUiSizeRequestBoxClass))
#define DINO_UI_IS_SIZE_REQUEST_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_SIZE_REQUEST_BOX))
#define DINO_UI_IS_SIZE_REQUEST_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_SIZE_REQUEST_BOX))
#define DINO_UI_SIZE_REQUEST_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_SIZE_REQUEST_BOX, DinoUiSizeRequestBoxClass))

typedef struct _DinoUiSizeRequestBox DinoUiSizeRequestBox;
typedef struct _DinoUiSizeRequestBoxClass DinoUiSizeRequestBoxClass;

#define DINO_UI_TYPE_CALL_WIDGET (dino_ui_call_widget_get_type ())
#define DINO_UI_CALL_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CALL_WIDGET, DinoUiCallWidget))
#define DINO_UI_CALL_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CALL_WIDGET, DinoUiCallWidgetClass))
#define DINO_UI_IS_CALL_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CALL_WIDGET))
#define DINO_UI_IS_CALL_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CALL_WIDGET))
#define DINO_UI_CALL_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CALL_WIDGET, DinoUiCallWidgetClass))

typedef struct _DinoUiCallWidget DinoUiCallWidget;
typedef struct _DinoUiCallWidgetClass DinoUiCallWidgetClass;
typedef struct _DinoUiSizeRequestBoxPrivate DinoUiSizeRequestBoxPrivate;
typedef struct _DinoUiCallWidgetPrivate DinoUiCallWidgetPrivate;
enum  {
	DINO_UI_CALL_WIDGET_0_PROPERTY,
	DINO_UI_CALL_WIDGET_CALL_STATE_PROPERTY,
	DINO_UI_CALL_WIDGET_NUM_PROPERTIES
};
static GParamSpec* dino_ui_call_widget_properties[DINO_UI_CALL_WIDGET_NUM_PROPERTIES];
typedef struct _Block27Data Block27Data;

#define DINO_UI_TYPE_CALL_WINDOW (dino_ui_call_window_get_type ())
#define DINO_UI_CALL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CALL_WINDOW, DinoUiCallWindow))
#define DINO_UI_CALL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CALL_WINDOW, DinoUiCallWindowClass))
#define DINO_UI_IS_CALL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CALL_WINDOW))
#define DINO_UI_IS_CALL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CALL_WINDOW))
#define DINO_UI_CALL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CALL_WINDOW, DinoUiCallWindowClass))

typedef struct _DinoUiCallWindow DinoUiCallWindow;
typedef struct _DinoUiCallWindowClass DinoUiCallWindowClass;

#define DINO_UI_TYPE_CALL_WINDOW_CONTROLLER (dino_ui_call_window_controller_get_type ())
#define DINO_UI_CALL_WINDOW_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CALL_WINDOW_CONTROLLER, DinoUiCallWindowController))
#define DINO_UI_CALL_WINDOW_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CALL_WINDOW_CONTROLLER, DinoUiCallWindowControllerClass))
#define DINO_UI_IS_CALL_WINDOW_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CALL_WINDOW_CONTROLLER))
#define DINO_UI_IS_CALL_WINDOW_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CALL_WINDOW_CONTROLLER))
#define DINO_UI_CALL_WINDOW_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CALL_WINDOW_CONTROLLER, DinoUiCallWindowControllerClass))

typedef struct _DinoUiCallWindowController DinoUiCallWindowController;
typedef struct _DinoUiCallWindowControllerClass DinoUiCallWindowControllerClass;
typedef struct _DinoUiCallWindowPrivate DinoUiCallWindowPrivate;

#define DINO_UI_TYPE_CALL_BOTTOM_BAR (dino_ui_call_bottom_bar_get_type ())
#define DINO_UI_CALL_BOTTOM_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_CALL_BOTTOM_BAR, DinoUiCallBottomBar))
#define DINO_UI_CALL_BOTTOM_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_CALL_BOTTOM_BAR, DinoUiCallBottomBarClass))
#define DINO_UI_IS_CALL_BOTTOM_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_CALL_BOTTOM_BAR))
#define DINO_UI_IS_CALL_BOTTOM_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_CALL_BOTTOM_BAR))
#define DINO_UI_CALL_BOTTOM_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_CALL_BOTTOM_BAR, DinoUiCallBottomBarClass))

typedef struct _DinoUiCallBottomBar DinoUiCallBottomBar;
typedef struct _DinoUiCallBottomBarClass DinoUiCallBottomBarClass;

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

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

typedef struct _DinoUiViewModelAvatarPictureModel DinoUiViewModelAvatarPictureModel;
typedef struct _DinoUiViewModelAvatarPictureModelClass DinoUiViewModelAvatarPictureModelClass;

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

typedef struct _DinoUiViewModelCompatAvatarPictureModel DinoUiViewModelCompatAvatarPictureModel;
typedef struct _DinoUiViewModelCompatAvatarPictureModelClass DinoUiViewModelCompatAvatarPictureModelClass;
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DinoUiConversationSummaryContentMetaItem {
	DinoPluginsMetaConversationItem parent_instance;
	DinoUiConversationSummaryContentMetaItemPrivate * priv;
	DinoContentItem* content_item;
};

struct _DinoUiConversationSummaryContentMetaItemClass {
	DinoPluginsMetaConversationItemClass parent_class;
};

struct _DinoUiCallMetaItem {
	DinoUiConversationSummaryContentMetaItem parent_instance;
	DinoUiCallMetaItemPrivate * priv;
};

struct _DinoUiCallMetaItemClass {
	DinoUiConversationSummaryContentMetaItemClass parent_class;
};

struct _DinoUiCallMetaItemPrivate {
	DinoStreamInteractor* stream_interactor;
};

struct _DinoUiSizeRequestBox {
	GtkBox parent_instance;
	DinoUiSizeRequestBoxPrivate * priv;
};

struct _DinoUiSizeRequestBoxClass {
	GtkBoxClass parent_class;
};

struct _DinoUiCallWidget {
	DinoUiSizeRequestBox parent_instance;
	DinoUiCallWidgetPrivate * priv;
	GtkImage* image;
	GtkLabel* title_label;
	GtkLabel* subtitle_label;
	GtkRevealer* incoming_call_revealer;
	GtkBox* outer_additional_box;
	GtkBox* incoming_call_box;
	GtkBox* multiparty_peer_box;
	GtkButton* accept_call_button;
	GtkButton* reject_call_button;
};

struct _DinoUiCallWidgetClass {
	DinoUiSizeRequestBoxClass parent_class;
};

struct _DinoUiCallWidgetPrivate {
	DinoStreamInteractor* stream_interactor;
	DinoCallState* call_manager;
	DinoEntitiesCall* call;
	DinoEntitiesConversation* conversation;
	DinoEntitiesCallState _call_state;
	guint time_update_handler_id;
	GeeArrayList* multiparty_peer_widgets;
};

struct _Block27Data {
	int _ref_count_;
	DinoUiCallWidget* self;
	DinoStreamInteractor* stream_interactor;
	DinoCallState* call_state;
};

struct _DinoUiCallWindow {
	GtkWindow parent_instance;
	DinoUiCallWindowPrivate * priv;
	DinoUiCallWindowController* controller;
	GtkOverlay* overlay;
	GtkGrid* grid;
	DinoUiCallBottomBar* bottom_bar;
	GtkRevealer* bottom_bar_revealer;
	GtkHeaderBar* header_bar;
	GtkRevealer* header_bar_revealer;
	GtkBox* own_video_box;
};

struct _DinoUiCallWindowClass {
	GtkWindowClass parent_class;
};

static gint DinoUiCallMetaItem_private_offset;
static gpointer dino_ui_call_meta_item_parent_class = NULL;
static gint DinoUiCallWidget_private_offset;
static gpointer dino_ui_call_widget_parent_class = NULL;

VALA_EXTERN GType dino_ui_conversation_summary_content_meta_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiConversationSummaryContentMetaItem, g_object_unref)
VALA_EXTERN GType dino_ui_call_meta_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiCallMetaItem, g_object_unref)
VALA_EXTERN DinoUiCallMetaItem* dino_ui_call_meta_item_new (DinoContentItem* content_item,
                                                DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiCallMetaItem* dino_ui_call_meta_item_construct (GType object_type,
                                                      DinoContentItem* content_item,
                                                      DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiConversationSummaryContentMetaItem* dino_ui_conversation_summary_content_meta_item_construct (GType object_type,
                                                                                                    DinoContentItem* content_item);
static GObject* dino_ui_call_meta_item_real_get_widget (DinoPluginsMetaConversationItem* base,
                                                 DinoPluginsConversationItemWidgetInterface* outer,
                                                 DinoPluginsWidgetType type);
VALA_EXTERN DinoUiCallWidget* dino_ui_call_widget_new (DinoStreamInteractor* stream_interactor,
                                           DinoEntitiesCall* call,
                                           DinoCallState* call_state,
                                           DinoEntitiesConversation* conversation);
VALA_EXTERN DinoUiCallWidget* dino_ui_call_widget_construct (GType object_type,
                                                 DinoStreamInteractor* stream_interactor,
                                                 DinoEntitiesCall* call,
                                                 DinoCallState* call_state,
                                                 DinoEntitiesConversation* conversation);
VALA_EXTERN GType dino_ui_size_request_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiSizeRequestBox, g_object_unref)
VALA_EXTERN GType dino_ui_call_widget_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiCallWidget, g_object_unref)
static GeeList* dino_ui_call_meta_item_real_get_item_actions (DinoPluginsMetaConversationItem* base,
                                                       DinoPluginsWidgetType type);
static void dino_ui_call_meta_item_finalize (GObject * obj);
static GType dino_ui_call_meta_item_get_type_once (void);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
VALA_EXTERN DinoUiSizeRequestBox* dino_ui_size_request_box_new (void);
VALA_EXTERN DinoUiSizeRequestBox* dino_ui_size_request_box_construct (GType object_type);
static void dino_ui_call_widget_update_call_state (DinoUiCallWidget* self);
static void _dino_ui_call_widget_update_call_state_g_object_notify (GObject* _sender,
                                                             GParamSpec* pspec,
                                                             gpointer self);
static void dino_ui_call_widget_update_counterparts (DinoUiCallWidget* self);
static void _dino_ui_call_widget_update_counterparts_dino_call_state_peer_joined (DinoCallState* _sender,
                                                                           XmppJid* jid,
                                                                           DinoPeerState* peer_state,
                                                                           gpointer self);
static void __lambda48_ (Block27Data* _data27_);
VALA_EXTERN GType dino_ui_call_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiCallWindow, g_object_unref)
VALA_EXTERN DinoUiCallWindow* dino_ui_call_window_new (void);
VALA_EXTERN DinoUiCallWindow* dino_ui_call_window_construct (GType object_type);
VALA_EXTERN DinoUiCallWindowController* dino_ui_call_window_controller_new (DinoUiCallWindow* call_window,
                                                                DinoCallState* call_state,
                                                                DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiCallWindowController* dino_ui_call_window_controller_construct (GType object_type,
                                                                      DinoUiCallWindow* call_window,
                                                                      DinoCallState* call_state,
                                                                      DinoStreamInteractor* stream_interactor);
VALA_EXTERN GType dino_ui_call_window_controller_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiCallWindowController, g_object_unref)
VALA_EXTERN GType dino_ui_call_bottom_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiCallBottomBar, g_object_unref)
static void ___lambda48__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void _dino_call_state_reject_gtk_button_clicked (GtkButton* _sender,
                                                 gpointer self);
VALA_EXTERN GType dino_ui_avatar_picture_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiAvatarPicture, g_object_unref)
VALA_EXTERN DinoUiAvatarPicture* dino_ui_avatar_picture_new (void);
VALA_EXTERN DinoUiAvatarPicture* dino_ui_avatar_picture_construct (GType object_type);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_new (DinoStreamInteractor* stream_interactor);
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_construct (GType object_type,
                                                                                                   DinoStreamInteractor* stream_interactor);
VALA_EXTERN GType dino_ui_view_model_avatar_picture_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelAvatarPictureModel, g_object_unref)
VALA_EXTERN GType dino_ui_view_model_compat_avatar_picture_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelCompatAvatarPictureModel, g_object_unref)
VALA_EXTERN DinoUiViewModelCompatAvatarPictureModel* dino_ui_view_model_compat_avatar_picture_model_add_participant (DinoUiViewModelCompatAvatarPictureModel* self,
                                                                                                         DinoEntitiesConversation* conversation,
                                                                                                         XmppJid* jid);
VALA_EXTERN void dino_ui_avatar_picture_set_model (DinoUiAvatarPicture* self,
                                       DinoUiViewModelAvatarPictureModel* value);
static void dino_ui_call_widget_on_time_update_timeout (DinoUiCallWidget* self);
static gchar* dino_ui_call_widget_get_duration_string (DinoUiCallWidget* self,
                                                GTimeSpan duration);
static gint dino_ui_call_widget_get_next_time_change (DinoUiCallWidget* self);
static void _dino_ui_call_widget_on_time_update_timeout_dino_weak_timeout_source_once_func (gconstpointer object);
VALA_EXTERN gchar* dino_ui_util_format_time (GDateTime* datetime,
                                 const gchar* format_24h,
                                 const gchar* format_12h);
VALA_EXTERN gchar* dino_ui_util_get_conversation_display_name (DinoStreamInteractor* stream_interactor,
                                                   DinoEntitiesConversation* conversation);
static void dino_ui_call_widget_real_dispose (GObject* base);
VALA_EXTERN DinoEntitiesCallState dino_ui_call_widget_get_call_state (DinoUiCallWidget* self);
VALA_EXTERN void dino_ui_call_widget_set_call_state (DinoUiCallWidget* self,
                                         DinoEntitiesCallState value);
static GObject * dino_ui_call_widget_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties);
VALA_EXTERN void dino_ui_size_request_box_set_size_request_mode (DinoUiSizeRequestBox* self,
                                                     GtkSizeRequestMode value);
static void dino_ui_call_widget_finalize (GObject * obj);
static GType dino_ui_call_widget_get_type_once (void);
static void _vala_dino_ui_call_widget_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_dino_ui_call_widget_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_call_meta_item_get_instance_private (DinoUiCallMetaItem* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiCallMetaItem_private_offset);
}

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

DinoUiCallMetaItem*
dino_ui_call_meta_item_construct (GType object_type,
                                  DinoContentItem* content_item,
                                  DinoStreamInteractor* stream_interactor)
{
	DinoUiCallMetaItem * self = NULL;
	DinoStreamInteractor* _tmp0_;
	g_return_val_if_fail (content_item != NULL, NULL);
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	self = (DinoUiCallMetaItem*) dino_ui_conversation_summary_content_meta_item_construct (object_type, content_item);
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp0_;
	return self;
}

DinoUiCallMetaItem*
dino_ui_call_meta_item_new (DinoContentItem* content_item,
                            DinoStreamInteractor* stream_interactor)
{
	return dino_ui_call_meta_item_construct (DINO_UI_TYPE_CALL_META_ITEM, content_item, stream_interactor);
}

static GObject*
dino_ui_call_meta_item_real_get_widget (DinoPluginsMetaConversationItem* base,
                                        DinoPluginsConversationItemWidgetInterface* outer,
                                        DinoPluginsWidgetType type)
{
	DinoUiCallMetaItem * self;
	DinoCallItem* call_item = NULL;
	DinoContentItem* _tmp0_;
	DinoCallItem* _tmp1_;
	DinoCallState* call_state = NULL;
	DinoStreamInteractor* _tmp2_;
	DinoModuleIdentity* _tmp3_;
	gpointer _tmp4_;
	DinoCalls* _tmp5_;
	GeeHashMap* _tmp6_;
	DinoEntitiesCall* _tmp7_;
	gpointer _tmp8_;
	DinoCallState* _tmp9_;
	DinoStreamInteractor* _tmp10_;
	DinoEntitiesCall* _tmp11_;
	DinoEntitiesConversation* _tmp12_;
	DinoUiCallWidget* _tmp13_;
	GObject* result;
	self = (DinoUiCallMetaItem*) base;
	g_return_val_if_fail (outer != NULL, NULL);
	_tmp0_ = ((DinoUiConversationSummaryContentMetaItem*) self)->content_item;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, DINO_TYPE_CALL_ITEM) ? ((DinoCallItem*) _tmp0_) : NULL);
	call_item = _tmp1_;
	_tmp2_ = self->priv->stream_interactor;
	_tmp3_ = dino_calls_IDENTITY;
	_tmp4_ = dino_stream_interactor_get_module (_tmp2_, DINO_TYPE_CALLS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_);
	_tmp5_ = (DinoCalls*) _tmp4_;
	_tmp6_ = _tmp5_->call_states;
	_tmp7_ = call_item->call;
	_tmp8_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp6_, _tmp7_);
	_tmp9_ = (DinoCallState*) _tmp8_;
	_g_object_unref0 (_tmp5_);
	call_state = _tmp9_;
	_tmp10_ = self->priv->stream_interactor;
	_tmp11_ = call_item->call;
	_tmp12_ = call_item->conversation;
	_tmp13_ = dino_ui_call_widget_new (_tmp10_, _tmp11_, call_state, _tmp12_);
	g_object_ref_sink (_tmp13_);
	result = (GObject*) _tmp13_;
	_g_object_unref0 (call_state);
	_g_object_unref0 (call_item);
	return result;
}

static GeeList*
dino_ui_call_meta_item_real_get_item_actions (DinoPluginsMetaConversationItem* base,
                                              DinoPluginsWidgetType type)
{
	DinoUiCallMetaItem * self;
	GeeList* result;
	self = (DinoUiCallMetaItem*) base;
	result = NULL;
	return result;
}

static void
dino_ui_call_meta_item_class_init (DinoUiCallMetaItemClass * klass,
                                   gpointer klass_data)
{
	dino_ui_call_meta_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiCallMetaItem_private_offset);
	((DinoPluginsMetaConversationItemClass *) klass)->get_widget = (GObject* (*) (DinoPluginsMetaConversationItem*, DinoPluginsConversationItemWidgetInterface*, DinoPluginsWidgetType)) dino_ui_call_meta_item_real_get_widget;
	((DinoPluginsMetaConversationItemClass *) klass)->get_item_actions = (GeeList* (*) (DinoPluginsMetaConversationItem*, DinoPluginsWidgetType)) dino_ui_call_meta_item_real_get_item_actions;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_call_meta_item_finalize;
}

static void
dino_ui_call_meta_item_instance_init (DinoUiCallMetaItem * self,
                                      gpointer klass)
{
	self->priv = dino_ui_call_meta_item_get_instance_private (self);
}

static void
dino_ui_call_meta_item_finalize (GObject * obj)
{
	DinoUiCallMetaItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_CALL_META_ITEM, DinoUiCallMetaItem);
	_g_object_unref0 (self->priv->stream_interactor);
	G_OBJECT_CLASS (dino_ui_call_meta_item_parent_class)->finalize (obj);
}

static GType
dino_ui_call_meta_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiCallMetaItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_call_meta_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiCallMetaItem), 0, (GInstanceInitFunc) dino_ui_call_meta_item_instance_init, NULL };
	GType dino_ui_call_meta_item_type_id;
	dino_ui_call_meta_item_type_id = g_type_register_static (DINO_UI_CONVERSATION_SUMMARY_TYPE_CONTENT_META_ITEM, "DinoUiCallMetaItem", &g_define_type_info, 0);
	DinoUiCallMetaItem_private_offset = g_type_add_instance_private (dino_ui_call_meta_item_type_id, sizeof (DinoUiCallMetaItemPrivate));
	return dino_ui_call_meta_item_type_id;
}

GType
dino_ui_call_meta_item_get_type (void)
{
	static volatile gsize dino_ui_call_meta_item_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_call_meta_item_type_id__once)) {
		GType dino_ui_call_meta_item_type_id;
		dino_ui_call_meta_item_type_id = dino_ui_call_meta_item_get_type_once ();
		g_once_init_leave (&dino_ui_call_meta_item_type_id__once, dino_ui_call_meta_item_type_id);
	}
	return dino_ui_call_meta_item_type_id__once;
}

static inline gpointer
dino_ui_call_widget_get_instance_private (DinoUiCallWidget* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiCallWidget_private_offset);
}

/** @param call_state Null if it's an old call and we can't interact with it anymore */
static Block27Data*
block27_data_ref (Block27Data* _data27_)
{
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}

static void
block27_data_unref (void * _userdata_)
{
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		DinoUiCallWidget* self;
		self = _data27_->self;
		_g_object_unref0 (_data27_->stream_interactor);
		_g_object_unref0 (_data27_->call_state);
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}

static void
_dino_ui_call_widget_update_call_state_g_object_notify (GObject* _sender,
                                                        GParamSpec* pspec,
                                                        gpointer self)
{
	dino_ui_call_widget_update_call_state ((DinoUiCallWidget*) self);
}

static void
_dino_ui_call_widget_update_counterparts_dino_call_state_peer_joined (DinoCallState* _sender,
                                                                      XmppJid* jid,
                                                                      DinoPeerState* peer_state,
                                                                      gpointer self)
{
	dino_ui_call_widget_update_counterparts ((DinoUiCallWidget*) self);
}

static void
__lambda48_ (Block27Data* _data27_)
{
	DinoUiCallWidget* self;
	DinoCallState* _tmp0_;
	DinoUiCallWindow* call_window = NULL;
	DinoUiCallWindow* _tmp1_;
	DinoUiCallWindowController* _tmp2_;
	self = _data27_->self;
	_tmp0_ = self->priv->call_manager;
	dino_call_state_accept (_tmp0_);
	_tmp1_ = dino_ui_call_window_new ();
	g_object_ref_sink (_tmp1_);
	call_window = _tmp1_;
	_tmp2_ = dino_ui_call_window_controller_new (call_window, _data27_->call_state, _data27_->stream_interactor);
	_g_object_unref0 (call_window->controller);
	call_window->controller = _tmp2_;
	gtk_window_present ((GtkWindow*) call_window);
	_g_object_unref0 (call_window);
}

static void
___lambda48__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda48_ (self);
}

static void
_dino_call_state_reject_gtk_button_clicked (GtkButton* _sender,
                                            gpointer self)
{
	dino_call_state_reject ((DinoCallState*) self);
}

DinoUiCallWidget*
dino_ui_call_widget_construct (GType object_type,
                               DinoStreamInteractor* stream_interactor,
                               DinoEntitiesCall* call,
                               DinoCallState* call_state,
                               DinoEntitiesConversation* conversation)
{
	DinoUiCallWidget * self = NULL;
	Block27Data* _data27_;
	DinoStreamInteractor* _tmp0_;
	DinoCallState* _tmp1_;
	DinoStreamInteractor* _tmp2_;
	DinoCallState* _tmp3_;
	DinoEntitiesCall* _tmp4_;
	DinoEntitiesConversation* _tmp5_;
	gboolean _tmp6_ = FALSE;
	DinoCallState* _tmp7_;
	GtkButton* _tmp14_;
	GtkButton* _tmp15_;
	DinoCallState* _tmp16_;
	g_return_val_if_fail (stream_interactor != NULL, NULL);
	g_return_val_if_fail (call != NULL, NULL);
	g_return_val_if_fail (conversation != NULL, NULL);
	_data27_ = g_slice_new0 (Block27Data);
	_data27_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (stream_interactor);
	_g_object_unref0 (_data27_->stream_interactor);
	_data27_->stream_interactor = _tmp0_;
	_tmp1_ = _g_object_ref0 (call_state);
	_g_object_unref0 (_data27_->call_state);
	_data27_->call_state = _tmp1_;
	self = (DinoUiCallWidget*) dino_ui_size_request_box_construct (object_type);
	_data27_->self = g_object_ref (self);
	_tmp2_ = _g_object_ref0 (_data27_->stream_interactor);
	_g_object_unref0 (self->priv->stream_interactor);
	self->priv->stream_interactor = _tmp2_;
	_tmp3_ = _g_object_ref0 (_data27_->call_state);
	_g_object_unref0 (self->priv->call_manager);
	self->priv->call_manager = _tmp3_;
	_tmp4_ = _g_object_ref0 (call);
	_g_object_unref0 (self->priv->call);
	self->priv->call = _tmp4_;
	_tmp5_ = _g_object_ref0 (conversation);
	_g_object_unref0 (self->priv->conversation);
	self->priv->conversation = _tmp5_;
	g_object_bind_property_with_closures ((GObject*) call, "state", (GObject*) self, "call-state", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_signal_connect_object ((GObject*) self, "notify::call-state", (GCallback) _dino_ui_call_widget_update_call_state_g_object_notify, self, 0);
	_tmp7_ = self->priv->call_manager;
	if (_tmp7_ != NULL) {
		gboolean _tmp8_ = FALSE;
		DinoEntitiesCallState _tmp9_;
		DinoEntitiesCallState _tmp10_;
		_tmp9_ = dino_entities_call_get_state (call);
		_tmp10_ = _tmp9_;
		if (_tmp10_ == DINO_ENTITIES_CALL_STATE_ESTABLISHING) {
			_tmp8_ = TRUE;
		} else {
			DinoEntitiesCallState _tmp11_;
			DinoEntitiesCallState _tmp12_;
			_tmp11_ = dino_entities_call_get_state (call);
			_tmp12_ = _tmp11_;
			_tmp8_ = _tmp12_ == DINO_ENTITIES_CALL_STATE_IN_PROGRESS;
		}
		_tmp6_ = _tmp8_;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		DinoCallState* _tmp13_;
		_tmp13_ = self->priv->call_manager;
		g_signal_connect_object (_tmp13_, "peer-joined", (GCallback) _dino_ui_call_widget_update_counterparts_dino_call_state_peer_joined, self, 0);
	}
	_tmp14_ = self->accept_call_button;
	g_signal_connect_data (_tmp14_, "clicked", (GCallback) ___lambda48__gtk_button_clicked, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
	_tmp15_ = self->reject_call_button;
	_tmp16_ = self->priv->call_manager;
	g_signal_connect_object (_tmp15_, "clicked", (GCallback) _dino_call_state_reject_gtk_button_clicked, _tmp16_, 0);
	dino_ui_call_widget_update_call_state (self);
	block27_data_unref (_data27_);
	_data27_ = NULL;
	return self;
}

DinoUiCallWidget*
dino_ui_call_widget_new (DinoStreamInteractor* stream_interactor,
                         DinoEntitiesCall* call,
                         DinoCallState* call_state,
                         DinoEntitiesConversation* conversation)
{
	return dino_ui_call_widget_construct (DINO_UI_TYPE_CALL_WIDGET, stream_interactor, call, call_state, conversation);
}

static void
dino_ui_call_widget_update_counterparts (DinoUiCallWidget* self)
{
	gboolean _tmp0_ = FALSE;
	DinoEntitiesCall* _tmp1_;
	DinoEntitiesCallState _tmp2_;
	DinoEntitiesCallState _tmp3_;
	gboolean _tmp7_ = FALSE;
	DinoEntitiesCall* _tmp8_;
	GeeList* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	DinoUiAvatarPicture* picture2 = NULL;
	DinoUiAvatarPicture* _tmp50_ = NULL;
	DinoUiAvatarPicture* _tmp51_;
	DinoStreamInteractor* _tmp52_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp53_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp54_;
	DinoEntitiesConversation* _tmp55_;
	DinoEntitiesCall* _tmp56_;
	DinoEntitiesAccount* _tmp57_;
	DinoEntitiesAccount* _tmp58_;
	XmppJid* _tmp59_;
	XmppJid* _tmp60_;
	XmppJid* _tmp61_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp62_;
	DinoUiViewModelCompatAvatarPictureModel* _tmp63_;
	GtkBox* _tmp64_;
	DinoUiAvatarPicture* _tmp65_;
	GeeArrayList* _tmp66_;
	DinoUiAvatarPicture* _tmp67_;
	GtkBox* _tmp68_;
	GtkBox* _tmp69_;
	GtkBox* _tmp70_;
	GtkRevealer* _tmp71_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->call;
	_tmp2_ = dino_entities_call_get_state (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != DINO_ENTITIES_CALL_STATE_IN_PROGRESS) {
		DinoEntitiesCall* _tmp4_;
		DinoEntitiesCallState _tmp5_;
		DinoEntitiesCallState _tmp6_;
		_tmp4_ = self->priv->call;
		_tmp5_ = dino_entities_call_get_state (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_ != DINO_ENTITIES_CALL_STATE_ENDED;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	_tmp8_ = self->priv->call;
	_tmp9_ = _tmp8_->counterparts;
	_tmp10_ = gee_collection_get_size ((GeeCollection*) _tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_ <= 1) {
		DinoEntitiesConversation* _tmp12_;
		DinoEntitiesConversationType _tmp13_;
		DinoEntitiesConversationType _tmp14_;
		_tmp12_ = self->priv->conversation;
		_tmp13_ = dino_entities_conversation_get_type_ (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp7_ = _tmp14_ == DINO_ENTITIES_CONVERSATION_TYPE_CHAT;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		return;
	}
	{
		GeeArrayList* _peer_widget_list = NULL;
		GeeArrayList* _tmp15_;
		gint _peer_widget_size = 0;
		GeeArrayList* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		gint _peer_widget_index = 0;
		_tmp15_ = self->priv->multiparty_peer_widgets;
		_peer_widget_list = _tmp15_;
		_tmp16_ = _peer_widget_list;
		_tmp17_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp16_);
		_tmp18_ = _tmp17_;
		_peer_widget_size = _tmp18_;
		_peer_widget_index = -1;
		while (TRUE) {
			gint _tmp19_;
			gint _tmp20_;
			GtkWidget* peer_widget = NULL;
			GeeArrayList* _tmp21_;
			gpointer _tmp22_;
			GtkBox* _tmp23_;
			GtkWidget* _tmp24_;
			_peer_widget_index = _peer_widget_index + 1;
			_tmp19_ = _peer_widget_index;
			_tmp20_ = _peer_widget_size;
			if (!(_tmp19_ < _tmp20_)) {
				break;
			}
			_tmp21_ = _peer_widget_list;
			_tmp22_ = gee_abstract_list_get ((GeeAbstractList*) _tmp21_, _peer_widget_index);
			peer_widget = (GtkWidget*) _tmp22_;
			_tmp23_ = self->multiparty_peer_box;
			_tmp24_ = peer_widget;
			gtk_box_remove (_tmp23_, _tmp24_);
			_g_object_unref0 (peer_widget);
		}
	}
	{
		GeeList* _counterpart_list = NULL;
		DinoEntitiesCall* _tmp25_;
		GeeList* _tmp26_;
		gint _counterpart_size = 0;
		GeeList* _tmp27_;
		gint _tmp28_;
		gint _tmp29_;
		gint _counterpart_index = 0;
		_tmp25_ = self->priv->call;
		_tmp26_ = _tmp25_->counterparts;
		_counterpart_list = _tmp26_;
		_tmp27_ = _counterpart_list;
		_tmp28_ = gee_collection_get_size ((GeeCollection*) _tmp27_);
		_tmp29_ = _tmp28_;
		_counterpart_size = _tmp29_;
		_counterpart_index = -1;
		while (TRUE) {
			gint _tmp30_;
			gint _tmp31_;
			XmppJid* counterpart = NULL;
			GeeList* _tmp32_;
			gpointer _tmp33_;
			DinoUiAvatarPicture* picture = NULL;
			DinoUiAvatarPicture* _tmp34_ = NULL;
			DinoUiAvatarPicture* _tmp35_;
			DinoStreamInteractor* _tmp36_;
			DinoUiViewModelCompatAvatarPictureModel* _tmp37_;
			DinoUiViewModelCompatAvatarPictureModel* _tmp38_;
			DinoEntitiesConversation* _tmp39_;
			XmppJid* _tmp40_;
			XmppJid* _tmp41_;
			XmppJid* _tmp42_;
			XmppJid* _tmp43_;
			DinoUiViewModelCompatAvatarPictureModel* _tmp44_;
			DinoUiViewModelCompatAvatarPictureModel* _tmp45_;
			GtkBox* _tmp46_;
			DinoUiAvatarPicture* _tmp47_;
			GeeArrayList* _tmp48_;
			DinoUiAvatarPicture* _tmp49_;
			_counterpart_index = _counterpart_index + 1;
			_tmp30_ = _counterpart_index;
			_tmp31_ = _counterpart_size;
			if (!(_tmp30_ < _tmp31_)) {
				break;
			}
			_tmp32_ = _counterpart_list;
			_tmp33_ = gee_list_get (_tmp32_, _counterpart_index);
			counterpart = (XmppJid*) _tmp33_;
			_tmp34_ = dino_ui_avatar_picture_new ();
			gtk_widget_set_margin_top ((GtkWidget*) _tmp34_, 2);
			g_object_ref_sink (_tmp34_);
			picture = _tmp34_;
			_tmp35_ = picture;
			_tmp36_ = self->priv->stream_interactor;
			_tmp37_ = dino_ui_view_model_compat_avatar_picture_model_new (_tmp36_);
			_tmp38_ = _tmp37_;
			_tmp39_ = self->priv->conversation;
			_tmp40_ = counterpart;
			_tmp41_ = xmpp_jid_get_bare_jid (_tmp40_);
			_tmp42_ = _tmp41_;
			_tmp43_ = _tmp42_;
			_tmp44_ = dino_ui_view_model_compat_avatar_picture_model_add_participant (_tmp38_, _tmp39_, _tmp43_);
			_tmp45_ = _tmp44_;
			dino_ui_avatar_picture_set_model (_tmp35_, (DinoUiViewModelAvatarPictureModel*) _tmp45_);
			_g_object_unref0 (_tmp45_);
			_xmpp_jid_unref0 (_tmp43_);
			_g_object_unref0 (_tmp38_);
			_tmp46_ = self->multiparty_peer_box;
			_tmp47_ = picture;
			gtk_box_append (_tmp46_, (GtkWidget*) _tmp47_);
			_tmp48_ = self->priv->multiparty_peer_widgets;
			_tmp49_ = picture;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp48_, (GtkWidget*) _tmp49_);
			_g_object_unref0 (picture);
			_xmpp_jid_unref0 (counterpart);
		}
	}
	_tmp50_ = dino_ui_avatar_picture_new ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp50_, 2);
	g_object_ref_sink (_tmp50_);
	picture2 = _tmp50_;
	_tmp51_ = picture2;
	_tmp52_ = self->priv->stream_interactor;
	_tmp53_ = dino_ui_view_model_compat_avatar_picture_model_new (_tmp52_);
	_tmp54_ = _tmp53_;
	_tmp55_ = self->priv->conversation;
	_tmp56_ = self->priv->call;
	_tmp57_ = dino_entities_call_get_account (_tmp56_);
	_tmp58_ = _tmp57_;
	_tmp59_ = dino_entities_account_get_bare_jid (_tmp58_);
	_tmp60_ = _tmp59_;
	_tmp61_ = _tmp60_;
	_tmp62_ = dino_ui_view_model_compat_avatar_picture_model_add_participant (_tmp54_, _tmp55_, _tmp61_);
	_tmp63_ = _tmp62_;
	dino_ui_avatar_picture_set_model (_tmp51_, (DinoUiViewModelAvatarPictureModel*) _tmp63_);
	_g_object_unref0 (_tmp63_);
	_xmpp_jid_unref0 (_tmp61_);
	_g_object_unref0 (_tmp54_);
	_tmp64_ = self->multiparty_peer_box;
	_tmp65_ = picture2;
	gtk_box_append (_tmp64_, (GtkWidget*) _tmp65_);
	_tmp66_ = self->priv->multiparty_peer_widgets;
	_tmp67_ = picture2;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp66_, (GtkWidget*) _tmp67_);
	_tmp68_ = self->outer_additional_box;
	gtk_widget_add_css_class ((GtkWidget*) _tmp68_, "multiparty-participants");
	_tmp69_ = self->multiparty_peer_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp69_, TRUE);
	_tmp70_ = self->incoming_call_box;
	gtk_widget_set_visible ((GtkWidget*) _tmp70_, FALSE);
	_tmp71_ = self->incoming_call_revealer;
	gtk_revealer_set_reveal_child (_tmp71_, TRUE);
	_g_object_unref0 (picture2);
}

static void
dino_ui_call_widget_on_time_update_timeout (DinoUiCallWidget* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->time_update_handler_id != ((guint) 0)) {
		dino_ui_call_widget_update_call_state (self);
	}
}

static void
_dino_ui_call_widget_on_time_update_timeout_dino_weak_timeout_source_once_func (gconstpointer object)
{
	dino_ui_call_widget_on_time_update_timeout (object);
}

static void
dino_ui_call_widget_update_call_state (DinoUiCallWidget* self)
{
	GtkRevealer* _tmp0_;
	GtkRevealer* _tmp1_;
	GtkBox* _tmp2_;
	DinoEntitiesCallState relevant_state = 0;
	DinoEntitiesCall* _tmp3_;
	DinoEntitiesCallState _tmp4_;
	DinoEntitiesCallState _tmp5_;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	DinoEntitiesConversation* _tmp8_;
	DinoEntitiesConversationType _tmp9_;
	DinoEntitiesConversationType _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->incoming_call_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, FALSE);
	_tmp1_ = self->incoming_call_revealer;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp1_, "incoming");
	_tmp2_ = self->outer_additional_box;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp2_, "incoming-call-box");
	_tmp3_ = self->priv->call;
	_tmp4_ = dino_entities_call_get_state (_tmp3_);
	_tmp5_ = _tmp4_;
	relevant_state = _tmp5_;
	_tmp8_ = self->priv->conversation;
	_tmp9_ = dino_entities_conversation_get_type_ (_tmp8_);
	_tmp10_ = _tmp9_;
	if (_tmp10_ == DINO_ENTITIES_CONVERSATION_TYPE_GROUPCHAT) {
		DinoEntitiesCall* _tmp11_;
		gboolean _tmp12_;
		gboolean _tmp13_;
		_tmp11_ = self->priv->call;
		_tmp12_ = dino_entities_call_get_direction (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp7_ = _tmp13_ == DINO_ENTITIES_CALL_DIRECTION_OUTGOING;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		gboolean _tmp14_ = FALSE;
		if (relevant_state == DINO_ENTITIES_CALL_STATE_MISSED) {
			_tmp14_ = TRUE;
		} else {
			_tmp14_ = relevant_state == DINO_ENTITIES_CALL_STATE_DECLINED;
		}
		_tmp6_ = _tmp14_;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		relevant_state = DINO_ENTITIES_CALL_STATE_ENDED;
	}
	switch (relevant_state) {
		case DINO_ENTITIES_CALL_STATE_RINGING:
		{
			GtkImage* _tmp15_;
			DinoEntitiesCall* _tmp16_;
			gboolean _tmp17_;
			gboolean _tmp18_;
			_tmp15_ = self->image;
			gtk_image_set_from_icon_name (_tmp15_, "dino-phone-ring-symbolic");
			_tmp16_ = self->priv->call;
			_tmp17_ = dino_entities_call_get_direction (_tmp16_);
			_tmp18_ = _tmp17_;
			if (_tmp18_ == DINO_ENTITIES_CALL_DIRECTION_INCOMING) {
				gboolean video = FALSE;
				DinoCallState* _tmp19_;
				const gchar* _tmp20_ = NULL;
				GtkLabel* _tmp23_;
				DinoCallState* _tmp24_;
				XmppJid* _tmp25_;
				DinoStreamInteractor* _tmp30_;
				DinoModuleIdentity* _tmp31_;
				gpointer _tmp32_;
				DinoCalls* _tmp33_;
				DinoEntitiesCall* _tmp34_;
				DinoEntitiesAccount* _tmp35_;
				DinoEntitiesAccount* _tmp36_;
				gboolean _tmp37_;
				_tmp19_ = self->priv->call_manager;
				video = dino_call_state_should_we_send_video (_tmp19_);
				if (video) {
					const gchar* _tmp21_;
					_tmp21_ = dino_gettext ("Incoming video call");
					_tmp20_ = _tmp21_;
				} else {
					const gchar* _tmp22_;
					_tmp22_ = dino_gettext ("Incoming call");
					_tmp20_ = _tmp22_;
				}
				_tmp23_ = self->title_label;
				gtk_label_set_label (_tmp23_, _tmp20_);
				_tmp24_ = self->priv->call_manager;
				_tmp25_ = _tmp24_->invited_to_group_call;
				if (_tmp25_ != NULL) {
					const gchar* _tmp26_ = NULL;
					GtkLabel* _tmp29_;
					if (video) {
						const gchar* _tmp27_;
						_tmp27_ = dino_gettext ("Incoming video group call");
						_tmp26_ = _tmp27_;
					} else {
						const gchar* _tmp28_;
						_tmp28_ = dino_gettext ("Incoming group call");
						_tmp26_ = _tmp28_;
					}
					_tmp29_ = self->title_label;
					gtk_label_set_label (_tmp29_, _tmp26_);
				}
				_tmp30_ = self->priv->stream_interactor;
				_tmp31_ = dino_calls_IDENTITY;
				_tmp32_ = dino_stream_interactor_get_module (_tmp30_, DINO_TYPE_CALLS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp31_);
				_tmp33_ = (DinoCalls*) _tmp32_;
				_tmp34_ = self->priv->call;
				_tmp35_ = dino_entities_call_get_account (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = dino_calls_can_we_do_calls (_tmp33_, _tmp36_);
				_g_object_unref0 (_tmp33_);
				if (_tmp37_) {
					GtkLabel* _tmp38_;
					GtkBox* _tmp39_;
					GtkRevealer* _tmp40_;
					GtkRevealer* _tmp41_;
					GtkBox* _tmp42_;
					_tmp38_ = self->subtitle_label;
					gtk_label_set_label (_tmp38_, "Ring ring…!");
					_tmp39_ = self->incoming_call_box;
					gtk_widget_set_visible ((GtkWidget*) _tmp39_, TRUE);
					_tmp40_ = self->incoming_call_revealer;
					gtk_revealer_set_reveal_child (_tmp40_, TRUE);
					_tmp41_ = self->incoming_call_revealer;
					gtk_widget_add_css_class ((GtkWidget*) _tmp41_, "incoming");
					_tmp42_ = self->outer_additional_box;
					gtk_widget_add_css_class ((GtkWidget*) _tmp42_, "incoming-call-box");
				} else {
					GtkLabel* _tmp43_;
					_tmp43_ = self->subtitle_label;
					gtk_label_set_label (_tmp43_, "Dependencies for call support not met");
				}
			} else {
				GtkLabel* _tmp44_;
				const gchar* _tmp45_;
				GtkLabel* _tmp46_;
				_tmp44_ = self->title_label;
				_tmp45_ = dino_gettext ("Calling…");
				gtk_label_set_label (_tmp44_, _tmp45_);
				_tmp46_ = self->subtitle_label;
				gtk_label_set_label (_tmp46_, "Ring ring…?");
			}
			break;
		}
		case DINO_ENTITIES_CALL_STATE_ESTABLISHING:
		case DINO_ENTITIES_CALL_STATE_IN_PROGRESS:
		{
			GtkImage* _tmp47_;
			GtkLabel* _tmp48_;
			const gchar* _tmp49_;
			gchar* duration = NULL;
			GDateTime* _tmp50_;
			GDateTime* _tmp51_;
			DinoEntitiesCall* _tmp52_;
			GDateTime* _tmp53_;
			GDateTime* _tmp54_;
			gchar* _tmp55_;
			gchar* _tmp56_;
			GtkLabel* _tmp57_;
			const gchar* _tmp58_;
			const gchar* _tmp59_;
			gchar* _tmp60_;
			gchar* _tmp61_;
			_tmp47_ = self->image;
			gtk_image_set_from_icon_name (_tmp47_, "dino-phone-in-talk-symbolic");
			_tmp48_ = self->title_label;
			_tmp49_ = dino_gettext ("Call started");
			gtk_label_set_label (_tmp48_, _tmp49_);
			_tmp50_ = g_date_time_new_now_utc ();
			_tmp51_ = _tmp50_;
			_tmp52_ = self->priv->call;
			_tmp53_ = dino_entities_call_get_local_time (_tmp52_);
			_tmp54_ = _tmp53_;
			_tmp55_ = dino_ui_call_widget_get_duration_string (self, g_date_time_difference (_tmp51_, _tmp54_));
			_tmp56_ = _tmp55_;
			_g_date_time_unref0 (_tmp51_);
			duration = _tmp56_;
			_tmp57_ = self->subtitle_label;
			_tmp58_ = dino_gettext ("Started %s ago");
			_tmp59_ = duration;
			_tmp60_ = g_strdup_printf (_tmp58_, _tmp59_);
			_tmp61_ = _tmp60_;
			gtk_label_set_label (_tmp57_, _tmp61_);
			_g_free0 (_tmp61_);
			self->priv->time_update_handler_id = dino_weak_timeout_add_seconds_once (DINO_UI_TYPE_CALL_WIDGET, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, (guint) (dino_ui_call_widget_get_next_time_change (self) + 1), self, _dino_ui_call_widget_on_time_update_timeout_dino_weak_timeout_source_once_func, G_PRIORITY_DEFAULT);
			_g_free0 (duration);
			break;
		}
		case DINO_ENTITIES_CALL_STATE_OTHER_DEVICE:
		{
			GtkImage* _tmp62_;
			const gchar* _tmp63_ = NULL;
			DinoEntitiesCall* _tmp64_;
			gboolean _tmp65_;
			gboolean _tmp66_;
			GtkLabel* _tmp69_;
			GtkLabel* _tmp70_;
			const gchar* _tmp71_;
			_tmp62_ = self->image;
			gtk_image_set_from_icon_name (_tmp62_, "dino-phone-hangup-symbolic");
			_tmp64_ = self->priv->call;
			_tmp65_ = dino_entities_call_get_direction (_tmp64_);
			_tmp66_ = _tmp65_;
			if (_tmp66_ == DINO_ENTITIES_CALL_DIRECTION_INCOMING) {
				const gchar* _tmp67_;
				_tmp67_ = dino_gettext ("Incoming call");
				_tmp63_ = _tmp67_;
			} else {
				const gchar* _tmp68_;
				_tmp68_ = dino_gettext ("Outgoing call");
				_tmp63_ = _tmp68_;
			}
			_tmp69_ = self->title_label;
			gtk_label_set_label (_tmp69_, _tmp63_);
			_tmp70_ = self->subtitle_label;
			_tmp71_ = dino_gettext ("You handled this call on another device");
			gtk_label_set_label (_tmp70_, _tmp71_);
			break;
		}
		case DINO_ENTITIES_CALL_STATE_ENDED:
		{
			GtkImage* _tmp72_;
			GtkLabel* _tmp73_;
			const gchar* _tmp74_;
			gchar* formated_end = NULL;
			DinoEntitiesCall* _tmp75_;
			GDateTime* _tmp76_;
			GDateTime* _tmp77_;
			GDateTime* _tmp78_;
			GDateTime* _tmp79_;
			const gchar* _tmp80_;
			const gchar* _tmp81_;
			gchar* _tmp82_;
			gchar* _tmp83_;
			gchar* duration = NULL;
			DinoEntitiesCall* _tmp84_;
			GDateTime* _tmp85_;
			GDateTime* _tmp86_;
			DinoEntitiesCall* _tmp87_;
			GDateTime* _tmp88_;
			GDateTime* _tmp89_;
			gchar* _tmp90_;
			GtkLabel* _tmp91_;
			const gchar* _tmp92_;
			const gchar* _tmp93_;
			gchar* _tmp94_;
			gchar* _tmp95_;
			gchar* _tmp96_;
			gchar* _tmp97_;
			const gchar* _tmp98_;
			const gchar* _tmp99_;
			gchar* _tmp100_;
			gchar* _tmp101_;
			gchar* _tmp102_;
			gchar* _tmp103_;
			_tmp72_ = self->image;
			gtk_image_set_from_icon_name (_tmp72_, "dino-phone-hangup-symbolic");
			_tmp73_ = self->title_label;
			_tmp74_ = dino_gettext ("Call ended");
			gtk_label_set_label (_tmp73_, _tmp74_);
			_tmp75_ = self->priv->call;
			_tmp76_ = dino_entities_call_get_end_time (_tmp75_);
			_tmp77_ = _tmp76_;
			_tmp78_ = g_date_time_to_local (_tmp77_);
			_tmp79_ = _tmp78_;
			_tmp80_ = dino_gettext ("%H∶%M");
			_tmp81_ = dino_gettext ("%l∶%M %p");
			_tmp82_ = dino_ui_util_format_time (_tmp79_, _tmp80_, _tmp81_);
			_tmp83_ = _tmp82_;
			_g_date_time_unref0 (_tmp79_);
			formated_end = _tmp83_;
			_tmp84_ = self->priv->call;
			_tmp85_ = dino_entities_call_get_end_time (_tmp84_);
			_tmp86_ = _tmp85_;
			_tmp87_ = self->priv->call;
			_tmp88_ = dino_entities_call_get_local_time (_tmp87_);
			_tmp89_ = _tmp88_;
			_tmp90_ = dino_ui_call_widget_get_duration_string (self, g_date_time_difference (_tmp86_, _tmp89_));
			duration = _tmp90_;
			_tmp91_ = self->subtitle_label;
			_tmp92_ = dino_gettext ("Ended at %s");
			_tmp93_ = formated_end;
			_tmp94_ = g_strdup_printf (_tmp92_, _tmp93_);
			_tmp95_ = _tmp94_;
			_tmp96_ = g_strconcat (_tmp95_, " · ", NULL);
			_tmp97_ = _tmp96_;
			_tmp98_ = dino_gettext ("Lasted %s");
			_tmp99_ = duration;
			_tmp100_ = g_strdup_printf (_tmp98_, _tmp99_);
			_tmp101_ = _tmp100_;
			_tmp102_ = g_strconcat (_tmp97_, _tmp101_, NULL);
			_tmp103_ = _tmp102_;
			gtk_label_set_label (_tmp91_, _tmp103_);
			_g_free0 (_tmp103_);
			_g_free0 (_tmp101_);
			_g_free0 (_tmp97_);
			_g_free0 (_tmp95_);
			_g_free0 (duration);
			_g_free0 (formated_end);
			break;
		}
		case DINO_ENTITIES_CALL_STATE_MISSED:
		{
			GtkImage* _tmp104_;
			GtkLabel* _tmp105_;
			const gchar* _tmp106_;
			DinoEntitiesCall* _tmp107_;
			gboolean _tmp108_;
			gboolean _tmp109_;
			_tmp104_ = self->image;
			gtk_image_set_from_icon_name (_tmp104_, "dino-phone-missed-symbolic");
			_tmp105_ = self->title_label;
			_tmp106_ = dino_gettext ("Call missed");
			gtk_label_set_label (_tmp105_, _tmp106_);
			_tmp107_ = self->priv->call;
			_tmp108_ = dino_entities_call_get_direction (_tmp107_);
			_tmp109_ = _tmp108_;
			if (_tmp109_ == DINO_ENTITIES_CALL_DIRECTION_INCOMING) {
				GtkLabel* _tmp110_;
				const gchar* _tmp111_;
				_tmp110_ = self->subtitle_label;
				_tmp111_ = dino_gettext ("You missed this call");
				gtk_label_set_label (_tmp110_, _tmp111_);
			} else {
				gchar* who = NULL;
				DinoStreamInteractor* _tmp112_;
				DinoEntitiesConversation* _tmp113_;
				gchar* _tmp114_;
				GtkLabel* _tmp115_;
				const gchar* _tmp116_;
				const gchar* _tmp117_;
				gchar* _tmp118_;
				gchar* _tmp119_;
				_tmp112_ = self->priv->stream_interactor;
				_tmp113_ = self->priv->conversation;
				_tmp114_ = dino_ui_util_get_conversation_display_name (_tmp112_, _tmp113_);
				who = _tmp114_;
				_tmp115_ = self->subtitle_label;
				_tmp116_ = dino_gettext ("%s missed this call");
				_tmp117_ = who;
				_tmp118_ = g_strdup_printf (_tmp116_, _tmp117_);
				_tmp119_ = _tmp118_;
				gtk_label_set_label (_tmp115_, _tmp119_);
				_g_free0 (_tmp119_);
				_g_free0 (who);
			}
			break;
		}
		case DINO_ENTITIES_CALL_STATE_DECLINED:
		{
			GtkImage* _tmp120_;
			GtkLabel* _tmp121_;
			const gchar* _tmp122_;
			DinoEntitiesCall* _tmp123_;
			gboolean _tmp124_;
			gboolean _tmp125_;
			_tmp120_ = self->image;
			gtk_image_set_from_icon_name (_tmp120_, "dino-phone-hangup-symbolic");
			_tmp121_ = self->title_label;
			_tmp122_ = dino_gettext ("Call declined");
			gtk_label_set_label (_tmp121_, _tmp122_);
			_tmp123_ = self->priv->call;
			_tmp124_ = dino_entities_call_get_direction (_tmp123_);
			_tmp125_ = _tmp124_;
			if (_tmp125_ == DINO_ENTITIES_CALL_DIRECTION_INCOMING) {
				GtkLabel* _tmp126_;
				const gchar* _tmp127_;
				_tmp126_ = self->subtitle_label;
				_tmp127_ = dino_gettext ("You declined this call");
				gtk_label_set_label (_tmp126_, _tmp127_);
			} else {
				gchar* who = NULL;
				DinoStreamInteractor* _tmp128_;
				DinoEntitiesConversation* _tmp129_;
				gchar* _tmp130_;
				GtkLabel* _tmp131_;
				const gchar* _tmp132_;
				const gchar* _tmp133_;
				gchar* _tmp134_;
				gchar* _tmp135_;
				_tmp128_ = self->priv->stream_interactor;
				_tmp129_ = self->priv->conversation;
				_tmp130_ = dino_ui_util_get_conversation_display_name (_tmp128_, _tmp129_);
				who = _tmp130_;
				_tmp131_ = self->subtitle_label;
				_tmp132_ = dino_gettext ("%s declined this call");
				_tmp133_ = who;
				_tmp134_ = g_strdup_printf (_tmp132_, _tmp133_);
				_tmp135_ = _tmp134_;
				gtk_label_set_label (_tmp131_, _tmp135_);
				_g_free0 (_tmp135_);
				_g_free0 (who);
			}
			break;
		}
		case DINO_ENTITIES_CALL_STATE_FAILED:
		{
			GtkImage* _tmp136_;
			GtkLabel* _tmp137_;
			const gchar* _tmp138_;
			GtkLabel* _tmp139_;
			_tmp136_ = self->image;
			gtk_image_set_from_icon_name (_tmp136_, "dino-phone-hangup-symbolic");
			_tmp137_ = self->title_label;
			_tmp138_ = dino_gettext ("Call failed");
			gtk_label_set_label (_tmp137_, _tmp138_);
			_tmp139_ = self->subtitle_label;
			gtk_label_set_label (_tmp139_, "Call failed to establish");
			break;
		}
		default:
		break;
	}
	dino_ui_call_widget_update_counterparts (self);
}

static gchar*
dino_ui_call_widget_get_duration_string (DinoUiCallWidget* self,
                                         GTimeSpan duration)
{
	GDateTime* a = NULL;
	GDateTime* _tmp0_;
	GDateTime* b = NULL;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GTimeSpan remainder_duration = 0LL;
	gint hours = 0;
	gint minutes = 0;
	gchar* ret = NULL;
	gchar* _tmp4_;
	const gchar* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_date_time_new_now_utc ();
	a = _tmp0_;
	_tmp1_ = g_date_time_new_now_utc ();
	b = _tmp1_;
	_tmp2_ = a;
	_tmp3_ = b;
	g_date_time_difference (_tmp2_, _tmp3_);
	remainder_duration = duration;
	hours = (gint) floor ((gdouble) (remainder_duration / G_TIME_SPAN_HOUR));
	remainder_duration -= hours * G_TIME_SPAN_HOUR;
	minutes = (gint) floor ((gdouble) (remainder_duration / G_TIME_SPAN_MINUTE));
	remainder_duration -= minutes * G_TIME_SPAN_MINUTE;
	_tmp4_ = g_strdup ("");
	ret = _tmp4_;
	if (hours > 0) {
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp5_ = ret;
		_tmp6_ = dino_ngettext ("%i hour", "%i hours", (gulong) hours);
		_tmp7_ = g_strdup_printf (_tmp6_, hours);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strconcat (_tmp5_, _tmp8_, NULL);
		_g_free0 (ret);
		ret = _tmp9_;
		_g_free0 (_tmp8_);
	}
	if (minutes > 0) {
		const gchar* _tmp10_;
		gint _tmp11_;
		gint _tmp12_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		_tmp10_ = ret;
		_tmp11_ = strlen (_tmp10_);
		_tmp12_ = _tmp11_;
		if (_tmp12_ > 0) {
			const gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp13_ = ret;
			_tmp14_ = g_strconcat (_tmp13_, " ", NULL);
			_g_free0 (ret);
			ret = _tmp14_;
		}
		_tmp15_ = ret;
		_tmp16_ = dino_ngettext ("%i minute", "%i minutes", (gulong) minutes);
		_tmp17_ = g_strdup_printf (_tmp16_, minutes);
		_tmp18_ = _tmp17_;
		_tmp19_ = g_strconcat (_tmp15_, _tmp18_, NULL);
		_g_free0 (ret);
		ret = _tmp19_;
		_g_free0 (_tmp18_);
	}
	_tmp20_ = ret;
	_tmp21_ = strlen (_tmp20_);
	_tmp22_ = _tmp21_;
	if (_tmp22_ > 0) {
		result = ret;
		_g_date_time_unref0 (b);
		_g_date_time_unref0 (a);
		return result;
	}
	_tmp23_ = dino_gettext ("a few seconds");
	_tmp24_ = g_strdup (_tmp23_);
	result = _tmp24_;
	_g_free0 (ret);
	_g_date_time_unref0 (b);
	_g_date_time_unref0 (a);
	return result;
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

static gint
dino_ui_call_widget_get_next_time_change (DinoUiCallWidget* self)
{
	GDateTime* now = NULL;
	GDateTime* _tmp0_;
	GDateTime* item_time = NULL;
	DinoEntitiesCall* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GDateTime* _tmp4_;
	GDateTime* _tmp5_;
	GDateTime* _tmp6_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = g_date_time_new_now_local ();
	now = _tmp0_;
	_tmp1_ = self->priv->call;
	_tmp2_ = dino_entities_call_get_local_time (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_date_time_ref0 (_tmp3_);
	item_time = _tmp4_;
	_tmp5_ = now;
	_tmp6_ = item_time;
	if (g_date_time_get_second (_tmp5_) < g_date_time_get_second (_tmp6_)) {
		GDateTime* _tmp7_;
		GDateTime* _tmp8_;
		_tmp7_ = item_time;
		_tmp8_ = now;
		result = g_date_time_get_second (_tmp7_) - g_date_time_get_second (_tmp8_);
		_g_date_time_unref0 (item_time);
		_g_date_time_unref0 (now);
		return result;
	} else {
		GDateTime* _tmp9_;
		GDateTime* _tmp10_;
		_tmp9_ = now;
		_tmp10_ = item_time;
		result = 60 - (g_date_time_get_second (_tmp9_) - g_date_time_get_second (_tmp10_));
		_g_date_time_unref0 (item_time);
		_g_date_time_unref0 (now);
		return result;
	}
}

static void
dino_ui_call_widget_real_dispose (GObject* base)
{
	DinoUiCallWidget * self;
	DinoCallState* _tmp0_;
	self = (DinoUiCallWidget*) base;
	G_OBJECT_CLASS (dino_ui_call_widget_parent_class)->dispose ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, DINO_UI_TYPE_SIZE_REQUEST_BOX, DinoUiSizeRequestBox));
	if (self->priv->time_update_handler_id != ((guint) 0)) {
		g_source_remove (self->priv->time_update_handler_id);
		self->priv->time_update_handler_id = (guint) 0;
	}
	_tmp0_ = self->priv->call_manager;
	if (_tmp0_ != NULL) {
		DinoCallState* _tmp1_;
		guint _tmp2_;
		_tmp1_ = self->priv->call_manager;
		g_signal_parse_name ("peer-joined", DINO_TYPE_CALL_STATE, &_tmp2_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _dino_ui_call_widget_update_counterparts_dino_call_state_peer_joined, self);
	}
}

DinoEntitiesCallState
dino_ui_call_widget_get_call_state (DinoUiCallWidget* self)
{
	DinoEntitiesCallState result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_call_state;
	return result;
}

void
dino_ui_call_widget_set_call_state (DinoUiCallWidget* self,
                                    DinoEntitiesCallState value)
{
	DinoEntitiesCallState old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_call_widget_get_call_state (self);
	if (old_value != value) {
		self->priv->_call_state = value;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_call_widget_properties[DINO_UI_CALL_WIDGET_CALL_STATE_PROPERTY]);
	}
}

static GObject *
dino_ui_call_widget_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DinoUiCallWidget * self;
	parent_class = G_OBJECT_CLASS (dino_ui_call_widget_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_CALL_WIDGET, DinoUiCallWidget);
	gtk_widget_set_margin_top ((GtkWidget*) self, 4);
	dino_ui_size_request_box_set_size_request_mode ((DinoUiSizeRequestBox*) self, GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH);
	return obj;
}

static void
dino_ui_call_widget_class_init (DinoUiCallWidgetClass * klass,
                                gpointer klass_data)
{
	dino_ui_call_widget_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiCallWidget_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) dino_ui_call_widget_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_call_widget_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_call_widget_set_property;
	G_OBJECT_CLASS (klass)->constructor = dino_ui_call_widget_constructor;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_call_widget_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_CALL_WIDGET_CALL_STATE_PROPERTY, dino_ui_call_widget_properties[DINO_UI_CALL_WIDGET_CALL_STATE_PROPERTY] = g_param_spec_enum ("call-state", "call-state", "call-state", DINO_ENTITIES_CALL_TYPE_STATE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/im/dino/Dino/call_widget.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "image", FALSE, G_STRUCT_OFFSET (DinoUiCallWidget, image));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title_label", FALSE, G_STRUCT_OFFSET (DinoUiCallWidget, title_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "subtitle_label", FALSE, G_STRUCT_OFFSET (DinoUiCallWidget, subtitle_label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "incoming_call_revealer", FALSE, G_STRUCT_OFFSET (DinoUiCallWidget, incoming_call_revealer));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "outer_additional_box", FALSE, G_STRUCT_OFFSET (DinoUiCallWidget, outer_additional_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "incoming_call_box", FALSE, G_STRUCT_OFFSET (DinoUiCallWidget, incoming_call_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "multiparty_peer_box", FALSE, G_STRUCT_OFFSET (DinoUiCallWidget, multiparty_peer_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "accept_call_button", FALSE, G_STRUCT_OFFSET (DinoUiCallWidget, accept_call_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "reject_call_button", FALSE, G_STRUCT_OFFSET (DinoUiCallWidget, reject_call_button));
}

static void
dino_ui_call_widget_instance_init (DinoUiCallWidget * self,
                                   gpointer klass)
{
	GeeArrayList* _tmp0_;
	self->priv = dino_ui_call_widget_get_instance_private (self);
	self->priv->time_update_handler_id = (guint) 0;
	_tmp0_ = gee_array_list_new (gtk_widget_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->multiparty_peer_widgets = _tmp0_;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
dino_ui_call_widget_finalize (GObject * obj)
{
	DinoUiCallWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_CALL_WIDGET, DinoUiCallWidget);
	_g_object_unref0 (self->priv->stream_interactor);
	_g_object_unref0 (self->priv->call_manager);
	_g_object_unref0 (self->priv->call);
	_g_object_unref0 (self->priv->conversation);
	_g_object_unref0 (self->priv->multiparty_peer_widgets);
	G_OBJECT_CLASS (dino_ui_call_widget_parent_class)->finalize (obj);
}

static GType
dino_ui_call_widget_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiCallWidgetClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_call_widget_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiCallWidget), 0, (GInstanceInitFunc) dino_ui_call_widget_instance_init, NULL };
	GType dino_ui_call_widget_type_id;
	dino_ui_call_widget_type_id = g_type_register_static (DINO_UI_TYPE_SIZE_REQUEST_BOX, "DinoUiCallWidget", &g_define_type_info, 0);
	DinoUiCallWidget_private_offset = g_type_add_instance_private (dino_ui_call_widget_type_id, sizeof (DinoUiCallWidgetPrivate));
	return dino_ui_call_widget_type_id;
}

GType
dino_ui_call_widget_get_type (void)
{
	static volatile gsize dino_ui_call_widget_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_call_widget_type_id__once)) {
		GType dino_ui_call_widget_type_id;
		dino_ui_call_widget_type_id = dino_ui_call_widget_get_type_once ();
		g_once_init_leave (&dino_ui_call_widget_type_id__once, dino_ui_call_widget_type_id);
	}
	return dino_ui_call_widget_type_id__once;
}

static void
_vala_dino_ui_call_widget_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	DinoUiCallWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_CALL_WIDGET, DinoUiCallWidget);
	switch (property_id) {
		case DINO_UI_CALL_WIDGET_CALL_STATE_PROPERTY:
		g_value_set_enum (value, dino_ui_call_widget_get_call_state (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_call_widget_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	DinoUiCallWidget * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_CALL_WIDGET, DinoUiCallWidget);
	switch (property_id) {
		case DINO_UI_CALL_WIDGET_CALL_STATE_PROPERTY:
		dino_ui_call_widget_set_call_state (self, g_value_get_enum (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;
}

