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

#include <gtk/gtk.h>
#include <glib-object.h>
#include "libdino.h"
#include <gee.h>
#include <glib.h>
#include "dino_i18n.h"
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.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_TYPE_VIDEO_SETTINGS_POPOVER (dino_ui_video_settings_popover_get_type ())
#define DINO_UI_VIDEO_SETTINGS_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER, DinoUiVideoSettingsPopover))
#define DINO_UI_VIDEO_SETTINGS_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER, DinoUiVideoSettingsPopoverClass))
#define DINO_UI_IS_VIDEO_SETTINGS_POPOVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER))
#define DINO_UI_IS_VIDEO_SETTINGS_POPOVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER))
#define DINO_UI_VIDEO_SETTINGS_POPOVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER, DinoUiVideoSettingsPopoverClass))

typedef struct _DinoUiVideoSettingsPopover DinoUiVideoSettingsPopover;
typedef struct _DinoUiVideoSettingsPopoverClass DinoUiVideoSettingsPopoverClass;
typedef struct _DinoUiVideoSettingsPopoverPrivate DinoUiVideoSettingsPopoverPrivate;
enum  {
	DINO_UI_VIDEO_SETTINGS_POPOVER_0_PROPERTY,
	DINO_UI_VIDEO_SETTINGS_POPOVER_CURRENT_DEVICE_PROPERTY,
	DINO_UI_VIDEO_SETTINGS_POPOVER_NUM_PROPERTIES
};
static GParamSpec* dino_ui_video_settings_popover_properties[DINO_UI_VIDEO_SETTINGS_POPOVER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block20Data Block20Data;
typedef struct _Block21Data Block21Data;
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))
enum  {
	DINO_UI_VIDEO_SETTINGS_POPOVER_CAMERA_SELECTED_SIGNAL,
	DINO_UI_VIDEO_SETTINGS_POPOVER_NUM_SIGNALS
};
static guint dino_ui_video_settings_popover_signals[DINO_UI_VIDEO_SETTINGS_POPOVER_NUM_SIGNALS] = {0};

struct _DinoUiVideoSettingsPopover {
	GtkPopover parent_instance;
	DinoUiVideoSettingsPopoverPrivate * priv;
};

struct _DinoUiVideoSettingsPopoverClass {
	GtkPopoverClass parent_class;
};

struct _DinoUiVideoSettingsPopoverPrivate {
	DinoPluginsMediaDevice* _current_device;
	GeeHashMap* row_device;
};

struct _Block20Data {
	int _ref_count_;
	DinoUiVideoSettingsPopover* self;
	GtkListBox* list_box;
};

struct _Block21Data {
	int _ref_count_;
	Block20Data * _data20_;
	DinoPluginsMediaDevice* device;
	GtkImage* image;
};

static gint DinoUiVideoSettingsPopover_private_offset;
static gpointer dino_ui_video_settings_popover_parent_class = NULL;

VALA_EXTERN GType dino_ui_video_settings_popover_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiVideoSettingsPopover, g_object_unref)
VALA_EXTERN DinoUiVideoSettingsPopover* dino_ui_video_settings_popover_new (void);
VALA_EXTERN DinoUiVideoSettingsPopover* dino_ui_video_settings_popover_construct (GType object_type);
static GtkWidget* dino_ui_video_settings_popover_create_camera_box (DinoUiVideoSettingsPopover* self);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
static void dino_ui_video_settings_popover_listbox_header_func (DinoUiVideoSettingsPopover* self,
                                                         GtkListBoxRow* row,
                                                         GtkListBoxRow* before_row);
static void _dino_ui_video_settings_popover_listbox_header_func_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                                          GtkListBoxRow* before,
                                                                                          gpointer self);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
VALA_EXTERN DinoPluginsMediaDevice* dino_ui_video_settings_popover_get_current_device (DinoUiVideoSettingsPopover* self);
static void _____lambda56_ (Block21Data* _data21_);
static void ______lambda56__g_object_notify (GObject* _sender,
                                      GParamSpec* pspec,
                                      gpointer self);
static void ___lambda57_ (Block20Data* _data20_,
                   GtkListBoxRow* row);
static void ____lambda57__gtk_list_box_row_activated (GtkListBox* _sender,
                                               GtkListBoxRow* row,
                                               gpointer self);
VALA_EXTERN void dino_ui_video_settings_popover_set_current_device (DinoUiVideoSettingsPopover* self,
                                                        DinoPluginsMediaDevice* value);
static void dino_ui_video_settings_popover_finalize (GObject * obj);
static GType dino_ui_video_settings_popover_get_type_once (void);
static void _vala_dino_ui_video_settings_popover_get_property (GObject * object,
                                                        guint property_id,
                                                        GValue * value,
                                                        GParamSpec * pspec);
static void _vala_dino_ui_video_settings_popover_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_video_settings_popover_get_instance_private (DinoUiVideoSettingsPopover* self)
{
	return G_STRUCT_MEMBER_P (self, DinoUiVideoSettingsPopover_private_offset);
}

DinoUiVideoSettingsPopover*
dino_ui_video_settings_popover_construct (GType object_type)
{
	DinoUiVideoSettingsPopover * self = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	self = (DinoUiVideoSettingsPopover*) g_object_new (object_type, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 15);
	g_object_ref_sink (_tmp0_);
	box = _tmp0_;
	_tmp1_ = dino_ui_video_settings_popover_create_camera_box (self);
	_tmp2_ = _tmp1_;
	gtk_box_append (box, _tmp2_);
	_g_object_unref0 (_tmp2_);
	gtk_popover_set_child ((GtkPopover*) self, (GtkWidget*) box);
	_g_object_unref0 (box);
	return self;
}

DinoUiVideoSettingsPopover*
dino_ui_video_settings_popover_new (void)
{
	return dino_ui_video_settings_popover_construct (DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER);
}

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

static Block20Data*
block20_data_ref (Block20Data* _data20_)
{
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}

static void
block20_data_unref (void * _userdata_)
{
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		DinoUiVideoSettingsPopover* self;
		self = _data20_->self;
		_g_object_unref0 (_data20_->list_box);
		_g_object_unref0 (self);
		g_slice_free (Block20Data, _data20_);
	}
}

static void
_dino_ui_video_settings_popover_listbox_header_func_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                                     GtkListBoxRow* before,
                                                                                     gpointer self)
{
	dino_ui_video_settings_popover_listbox_header_func ((DinoUiVideoSettingsPopover*) self, row, before);
}

static Block21Data*
block21_data_ref (Block21Data* _data21_)
{
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}

static void
block21_data_unref (void * _userdata_)
{
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		DinoUiVideoSettingsPopover* self;
		self = _data21_->_data20_->self;
		_g_object_unref0 (_data21_->image);
		_g_object_unref0 (_data21_->device);
		block20_data_unref (_data21_->_data20_);
		_data21_->_data20_ = NULL;
		g_slice_free (Block21Data, _data21_);
	}
}

static void
_____lambda56_ (Block21Data* _data21_)
{
	Block20Data* _data20_;
	DinoUiVideoSettingsPopover* self;
	gboolean _tmp0_ = FALSE;
	DinoPluginsMediaDevice* _tmp1_;
	_data20_ = _data21_->_data20_;
	self = _data20_->self;
	_tmp1_ = self->priv->_current_device;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		DinoPluginsMediaDevice* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		DinoPluginsMediaDevice* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp2_ = self->priv->_current_device;
		_tmp3_ = dino_plugins_media_device_get_id (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = _data21_->device;
		_tmp7_ = dino_plugins_media_device_get_id (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp0_ = g_strcmp0 (_tmp5_, _tmp9_) != 0;
		_g_free0 (_tmp9_);
		_g_free0 (_tmp5_);
	}
	if (_tmp0_) {
		GtkImage* _tmp10_;
		_tmp10_ = _data21_->image;
		gtk_widget_set_opacity ((GtkWidget*) _tmp10_, (gdouble) 0);
	} else {
		GtkImage* _tmp11_;
		_tmp11_ = _data21_->image;
		gtk_widget_set_opacity ((GtkWidget*) _tmp11_, (gdouble) 1);
	}
}

static void
______lambda56__g_object_notify (GObject* _sender,
                                 GParamSpec* pspec,
                                 gpointer self)
{
	_____lambda56_ (self);
}

static void
___lambda57_ (Block20Data* _data20_,
              GtkListBoxRow* row)
{
	DinoUiVideoSettingsPopover* self;
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	DinoPluginsMediaDevice* _tmp3_;
	GtkListBox* _tmp4_;
	self = _data20_->self;
	g_return_if_fail (row != NULL);
	_tmp0_ = self->priv->row_device;
	if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, row)) {
		return;
	}
	_tmp1_ = self->priv->row_device;
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, row);
	_tmp3_ = (DinoPluginsMediaDevice*) _tmp2_;
	g_signal_emit (self, dino_ui_video_settings_popover_signals[DINO_UI_VIDEO_SETTINGS_POPOVER_CAMERA_SELECTED_SIGNAL], 0, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = _data20_->list_box;
	gtk_list_box_unselect_row (_tmp4_, row);
}

static void
____lambda57__gtk_list_box_row_activated (GtkListBox* _sender,
                                          GtkListBoxRow* row,
                                          gpointer self)
{
	___lambda57_ (self, row);
}

static GtkWidget*
dino_ui_video_settings_popover_create_camera_box (DinoUiVideoSettingsPopover* self)
{
	DinoPluginsVideoCallPlugin* call_plugin = NULL;
	DinoApplication* _tmp0_;
	DinoPluginsRegistry* _tmp1_;
	DinoPluginsRegistry* _tmp2_;
	DinoPluginsVideoCallPlugin* _tmp3_;
	DinoPluginsVideoCallPlugin* _tmp4_;
	GeeList* devices = NULL;
	DinoPluginsVideoCallPlugin* _tmp5_;
	GeeList* _tmp6_;
	GtkBox* camera_box = NULL;
	GtkBox* _tmp7_;
	GtkBox* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	GtkLabel* _tmp14_ = NULL;
	GtkLabel* _tmp15_;
	GeeList* _tmp16_;
	gint _tmp17_;
	gint _tmp18_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = dino_application_get_default ();
	_tmp1_ = dino_application_get_plugin_registry (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->video_call_plugin;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	call_plugin = _tmp4_;
	_tmp5_ = call_plugin;
	_tmp6_ = dino_plugins_video_call_plugin_get_devices (_tmp5_, "video", FALSE);
	devices = _tmp6_;
	_tmp7_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
	g_object_ref_sink (_tmp7_);
	camera_box = _tmp7_;
	_tmp8_ = camera_box;
	_tmp9_ = dino_gettext ("Cameras");
	_tmp10_ = g_strconcat ("<b>", _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	_tmp12_ = g_strconcat (_tmp11_, "</b>", NULL);
	_tmp13_ = _tmp12_;
	_tmp14_ = (GtkLabel*) gtk_label_new (_tmp13_);
	gtk_label_set_use_markup (_tmp14_, TRUE);
	gtk_label_set_xalign (_tmp14_, (gfloat) 0);
	gtk_widget_set_can_focus ((GtkWidget*) _tmp14_, TRUE);
	g_object_ref_sink (_tmp14_);
	_tmp15_ = _tmp14_;
	gtk_box_append (_tmp8_, (GtkWidget*) _tmp15_);
	_g_object_unref0 (_tmp15_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp11_);
	_tmp16_ = devices;
	_tmp17_ = gee_collection_get_size ((GeeCollection*) _tmp16_);
	_tmp18_ = _tmp17_;
	if (_tmp18_ == 0) {
		GtkBox* _tmp19_;
		const gchar* _tmp20_;
		GtkLabel* _tmp21_;
		GtkLabel* _tmp22_;
		_tmp19_ = camera_box;
		_tmp20_ = dino_gettext ("No camera found.");
		_tmp21_ = (GtkLabel*) gtk_label_new (_tmp20_);
		g_object_ref_sink (_tmp21_);
		_tmp22_ = _tmp21_;
		gtk_box_append (_tmp19_, (GtkWidget*) _tmp22_);
		_g_object_unref0 (_tmp22_);
	} else {
		Block20Data* _data20_;
		GtkListBox* _tmp23_ = NULL;
		GtkListBox* _tmp24_;
		GtkFrame* frame = NULL;
		GtkFrame* _tmp25_;
		GtkFrame* _tmp26_;
		GtkListBox* _tmp27_;
		GtkListBox* _tmp91_;
		GtkBox* _tmp92_;
		GtkFrame* _tmp93_;
		_data20_ = g_slice_new0 (Block20Data);
		_data20_->_ref_count_ = 1;
		_data20_->self = g_object_ref (self);
		_tmp23_ = (GtkListBox*) gtk_list_box_new ();
		gtk_list_box_set_activate_on_single_click (_tmp23_, TRUE);
		gtk_list_box_set_selection_mode (_tmp23_, GTK_SELECTION_SINGLE);
		g_object_ref_sink (_tmp23_);
		_data20_->list_box = _tmp23_;
		_tmp24_ = _data20_->list_box;
		gtk_list_box_set_header_func (_tmp24_, _dino_ui_video_settings_popover_listbox_header_func_gtk_list_box_update_header_func, g_object_ref (self), g_object_unref);
		_tmp25_ = (GtkFrame*) gtk_frame_new (NULL);
		g_object_ref_sink (_tmp25_);
		frame = _tmp25_;
		_tmp26_ = frame;
		_tmp27_ = _data20_->list_box;
		gtk_frame_set_child (_tmp26_, (GtkWidget*) _tmp27_);
		{
			GeeList* _device_list = NULL;
			GeeList* _tmp28_;
			gint _device_size = 0;
			GeeList* _tmp29_;
			gint _tmp30_;
			gint _tmp31_;
			gint _device_index = 0;
			_tmp28_ = devices;
			_device_list = _tmp28_;
			_tmp29_ = _device_list;
			_tmp30_ = gee_collection_get_size ((GeeCollection*) _tmp29_);
			_tmp31_ = _tmp30_;
			_device_size = _tmp31_;
			_device_index = -1;
			while (TRUE) {
				Block21Data* _data21_;
				gint _tmp32_;
				gint _tmp33_;
				GeeList* _tmp34_;
				gpointer _tmp35_;
				GtkLabel* display_name_label = NULL;
				DinoPluginsMediaDevice* _tmp36_;
				gchar* _tmp37_;
				gchar* _tmp38_;
				gchar* _tmp39_;
				GtkLabel* _tmp40_ = NULL;
				GtkLabel* _tmp41_;
				GtkImage* _tmp42_;
				gboolean _tmp43_ = FALSE;
				DinoPluginsMediaDevice* _tmp44_;
				GtkBox* device_box = NULL;
				GtkBox* _tmp54_ = NULL;
				GtkBox* _tmp55_;
				GtkImage* _tmp56_;
				GtkBox* label_box = NULL;
				GtkBox* _tmp57_ = NULL;
				GtkBox* _tmp58_;
				GtkLabel* _tmp59_;
				DinoPluginsMediaDevice* _tmp60_;
				gchar* _tmp61_;
				gchar* _tmp62_;
				gchar* _tmp63_;
				gboolean _tmp64_;
				GtkBox* _tmp81_;
				GtkBox* _tmp82_;
				GtkListBoxRow* list_box_row = NULL;
				GtkListBoxRow* _tmp83_;
				GtkListBoxRow* _tmp84_;
				GtkBox* _tmp85_;
				GtkListBox* _tmp86_;
				GtkListBoxRow* _tmp87_;
				GeeHashMap* _tmp88_;
				GtkListBoxRow* _tmp89_;
				DinoPluginsMediaDevice* _tmp90_;
				_data21_ = g_slice_new0 (Block21Data);
				_data21_->_ref_count_ = 1;
				_data21_->_data20_ = block20_data_ref (_data20_);
				_device_index = _device_index + 1;
				_tmp32_ = _device_index;
				_tmp33_ = _device_size;
				if (!(_tmp32_ < _tmp33_)) {
					block21_data_unref (_data21_);
					_data21_ = NULL;
					break;
				}
				_tmp34_ = _device_list;
				_tmp35_ = gee_list_get (_tmp34_, _device_index);
				_data21_->device = (DinoPluginsMediaDevice*) _tmp35_;
				_tmp36_ = _data21_->device;
				_tmp37_ = dino_plugins_media_device_get_display_name (_tmp36_);
				_tmp38_ = _tmp37_;
				_tmp39_ = _tmp38_;
				_tmp40_ = (GtkLabel*) gtk_label_new (_tmp39_);
				gtk_label_set_xalign (_tmp40_, (gfloat) 0);
				g_object_ref_sink (_tmp40_);
				_tmp41_ = _tmp40_;
				_g_free0 (_tmp39_);
				display_name_label = _tmp41_;
				_tmp42_ = (GtkImage*) gtk_image_new_from_icon_name ("object-select-symbolic");
				g_object_ref_sink (_tmp42_);
				_data21_->image = _tmp42_;
				_tmp44_ = self->priv->_current_device;
				if (_tmp44_ == NULL) {
					_tmp43_ = TRUE;
				} else {
					DinoPluginsMediaDevice* _tmp45_;
					gchar* _tmp46_;
					gchar* _tmp47_;
					gchar* _tmp48_;
					DinoPluginsMediaDevice* _tmp49_;
					gchar* _tmp50_;
					gchar* _tmp51_;
					gchar* _tmp52_;
					_tmp45_ = self->priv->_current_device;
					_tmp46_ = dino_plugins_media_device_get_id (_tmp45_);
					_tmp47_ = _tmp46_;
					_tmp48_ = _tmp47_;
					_tmp49_ = _data21_->device;
					_tmp50_ = dino_plugins_media_device_get_id (_tmp49_);
					_tmp51_ = _tmp50_;
					_tmp52_ = _tmp51_;
					_tmp43_ = g_strcmp0 (_tmp48_, _tmp52_) != 0;
					_g_free0 (_tmp52_);
					_g_free0 (_tmp48_);
				}
				if (_tmp43_) {
					GtkImage* _tmp53_;
					_tmp53_ = _data21_->image;
					gtk_widget_set_opacity ((GtkWidget*) _tmp53_, (gdouble) 0);
				}
				g_signal_connect_data ((GObject*) self, "notify::current-device", (GCallback) ______lambda56__g_object_notify, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
				_tmp54_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
				gtk_box_set_spacing (_tmp54_, 7);
				g_object_ref_sink (_tmp54_);
				device_box = _tmp54_;
				_tmp55_ = device_box;
				_tmp56_ = _data21_->image;
				gtk_box_append (_tmp55_, (GtkWidget*) _tmp56_);
				_tmp57_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
				gtk_widget_set_visible ((GtkWidget*) _tmp57_, TRUE);
				g_object_ref_sink (_tmp57_);
				label_box = _tmp57_;
				_tmp58_ = label_box;
				_tmp59_ = display_name_label;
				gtk_box_append (_tmp58_, (GtkWidget*) _tmp59_);
				_tmp60_ = _data21_->device;
				_tmp61_ = dino_plugins_media_device_get_detail_name (_tmp60_);
				_tmp62_ = _tmp61_;
				_tmp63_ = _tmp62_;
				_tmp64_ = _tmp63_ != NULL;
				_g_free0 (_tmp63_);
				if (_tmp64_) {
					GtkLabel* detail_name_label = NULL;
					DinoPluginsMediaDevice* _tmp65_;
					gchar* _tmp66_;
					gchar* _tmp67_;
					gchar* _tmp68_;
					GtkLabel* _tmp69_ = NULL;
					GtkLabel* _tmp70_;
					GtkLabel* _tmp71_;
					GtkLabel* _tmp72_;
					PangoAttrList* _tmp73_;
					PangoAttrList* _tmp74_;
					GtkLabel* _tmp75_;
					PangoAttrList* _tmp76_;
					PangoAttrList* _tmp77_;
					PangoAttribute* _tmp78_;
					GtkBox* _tmp79_;
					GtkLabel* _tmp80_;
					_tmp65_ = _data21_->device;
					_tmp66_ = dino_plugins_media_device_get_detail_name (_tmp65_);
					_tmp67_ = _tmp66_;
					_tmp68_ = _tmp67_;
					_tmp69_ = (GtkLabel*) gtk_label_new (_tmp68_);
					gtk_label_set_xalign (_tmp69_, (gfloat) 0);
					g_object_ref_sink (_tmp69_);
					_tmp70_ = _tmp69_;
					_g_free0 (_tmp68_);
					detail_name_label = _tmp70_;
					_tmp71_ = detail_name_label;
					gtk_widget_add_css_class ((GtkWidget*) _tmp71_, "dim-label");
					_tmp72_ = detail_name_label;
					_tmp73_ = pango_attr_list_new ();
					_tmp74_ = _tmp73_;
					gtk_label_set_attributes (_tmp72_, _tmp74_);
					_pango_attr_list_unref0 (_tmp74_);
					_tmp75_ = detail_name_label;
					_tmp76_ = gtk_label_get_attributes (_tmp75_);
					_tmp77_ = _tmp76_;
					_tmp78_ = pango_attr_scale_new (0.8);
					pango_attr_list_insert (_tmp77_, _tmp78_);
					_tmp79_ = label_box;
					_tmp80_ = detail_name_label;
					gtk_box_append (_tmp79_, (GtkWidget*) _tmp80_);
					_g_object_unref0 (detail_name_label);
				}
				_tmp81_ = device_box;
				_tmp82_ = label_box;
				gtk_box_append (_tmp81_, (GtkWidget*) _tmp82_);
				_tmp83_ = (GtkListBoxRow*) gtk_list_box_row_new ();
				g_object_ref_sink (_tmp83_);
				list_box_row = _tmp83_;
				_tmp84_ = list_box_row;
				_tmp85_ = device_box;
				gtk_list_box_row_set_child (_tmp84_, (GtkWidget*) _tmp85_);
				_tmp86_ = _data20_->list_box;
				_tmp87_ = list_box_row;
				gtk_list_box_append (_tmp86_, (GtkWidget*) _tmp87_);
				_tmp88_ = self->priv->row_device;
				_tmp89_ = list_box_row;
				_tmp90_ = _data21_->device;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp88_, _tmp89_, _tmp90_);
				_g_object_unref0 (list_box_row);
				_g_object_unref0 (label_box);
				_g_object_unref0 (device_box);
				_g_object_unref0 (display_name_label);
				block21_data_unref (_data21_);
				_data21_ = NULL;
			}
		}
		_tmp91_ = _data20_->list_box;
		g_signal_connect_data (_tmp91_, "row-activated", (GCallback) ____lambda57__gtk_list_box_row_activated, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
		_tmp92_ = camera_box;
		_tmp93_ = frame;
		gtk_box_append (_tmp92_, (GtkWidget*) _tmp93_);
		_g_object_unref0 (frame);
		block20_data_unref (_data20_);
		_data20_ = NULL;
	}
	result = (GtkWidget*) camera_box;
	_g_object_unref0 (devices);
	_g_object_unref0 (call_plugin);
	return result;
}

static void
dino_ui_video_settings_popover_listbox_header_func (DinoUiVideoSettingsPopover* self,
                                                    GtkListBoxRow* row,
                                                    GtkListBoxRow* before_row)
{
	gboolean _tmp0_ = FALSE;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (row != NULL);
	_tmp1_ = gtk_list_box_row_get_header (row);
	if (_tmp1_ == NULL) {
		_tmp0_ = before_row != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkSeparator* _tmp2_;
		GtkSeparator* _tmp3_;
		_tmp2_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
		g_object_ref_sink (_tmp2_);
		_tmp3_ = _tmp2_;
		gtk_list_box_row_set_header (row, (GtkWidget*) _tmp3_);
		_g_object_unref0 (_tmp3_);
	}
}

DinoPluginsMediaDevice*
dino_ui_video_settings_popover_get_current_device (DinoUiVideoSettingsPopover* self)
{
	DinoPluginsMediaDevice* result;
	DinoPluginsMediaDevice* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_current_device;
	result = _tmp0_;
	return result;
}

void
dino_ui_video_settings_popover_set_current_device (DinoUiVideoSettingsPopover* self,
                                                   DinoPluginsMediaDevice* value)
{
	DinoPluginsMediaDevice* old_value;
	g_return_if_fail (self != NULL);
	old_value = dino_ui_video_settings_popover_get_current_device (self);
	if (old_value != value) {
		DinoPluginsMediaDevice* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_current_device);
		self->priv->_current_device = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dino_ui_video_settings_popover_properties[DINO_UI_VIDEO_SETTINGS_POPOVER_CURRENT_DEVICE_PROPERTY]);
	}
}

static void
dino_ui_video_settings_popover_class_init (DinoUiVideoSettingsPopoverClass * klass,
                                           gpointer klass_data)
{
	dino_ui_video_settings_popover_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DinoUiVideoSettingsPopover_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dino_ui_video_settings_popover_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dino_ui_video_settings_popover_set_property;
	G_OBJECT_CLASS (klass)->finalize = dino_ui_video_settings_popover_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DINO_UI_VIDEO_SETTINGS_POPOVER_CURRENT_DEVICE_PROPERTY, dino_ui_video_settings_popover_properties[DINO_UI_VIDEO_SETTINGS_POPOVER_CURRENT_DEVICE_PROPERTY] = g_param_spec_object ("current-device", "current-device", "current-device", DINO_PLUGINS_TYPE_MEDIA_DEVICE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	dino_ui_video_settings_popover_signals[DINO_UI_VIDEO_SETTINGS_POPOVER_CAMERA_SELECTED_SIGNAL] = g_signal_new ("camera-selected", DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, DINO_PLUGINS_TYPE_MEDIA_DEVICE);
}

static void
dino_ui_video_settings_popover_instance_init (DinoUiVideoSettingsPopover * self,
                                              gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = dino_ui_video_settings_popover_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (gtk_list_box_row_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, DINO_PLUGINS_TYPE_MEDIA_DEVICE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->row_device = _tmp0_;
}

static void
dino_ui_video_settings_popover_finalize (GObject * obj)
{
	DinoUiVideoSettingsPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER, DinoUiVideoSettingsPopover);
	_g_object_unref0 (self->priv->_current_device);
	_g_object_unref0 (self->priv->row_device);
	G_OBJECT_CLASS (dino_ui_video_settings_popover_parent_class)->finalize (obj);
}

static GType
dino_ui_video_settings_popover_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DinoUiVideoSettingsPopoverClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dino_ui_video_settings_popover_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DinoUiVideoSettingsPopover), 0, (GInstanceInitFunc) dino_ui_video_settings_popover_instance_init, NULL };
	GType dino_ui_video_settings_popover_type_id;
	dino_ui_video_settings_popover_type_id = g_type_register_static (gtk_popover_get_type (), "DinoUiVideoSettingsPopover", &g_define_type_info, 0);
	DinoUiVideoSettingsPopover_private_offset = g_type_add_instance_private (dino_ui_video_settings_popover_type_id, sizeof (DinoUiVideoSettingsPopoverPrivate));
	return dino_ui_video_settings_popover_type_id;
}

GType
dino_ui_video_settings_popover_get_type (void)
{
	static volatile gsize dino_ui_video_settings_popover_type_id__once = 0;
	if (g_once_init_enter (&dino_ui_video_settings_popover_type_id__once)) {
		GType dino_ui_video_settings_popover_type_id;
		dino_ui_video_settings_popover_type_id = dino_ui_video_settings_popover_get_type_once ();
		g_once_init_leave (&dino_ui_video_settings_popover_type_id__once, dino_ui_video_settings_popover_type_id);
	}
	return dino_ui_video_settings_popover_type_id__once;
}

static void
_vala_dino_ui_video_settings_popover_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec)
{
	DinoUiVideoSettingsPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER, DinoUiVideoSettingsPopover);
	switch (property_id) {
		case DINO_UI_VIDEO_SETTINGS_POPOVER_CURRENT_DEVICE_PROPERTY:
		g_value_set_object (value, dino_ui_video_settings_popover_get_current_device (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dino_ui_video_settings_popover_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec)
{
	DinoUiVideoSettingsPopover * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DINO_UI_TYPE_VIDEO_SETTINGS_POPOVER, DinoUiVideoSettingsPopover);
	switch (property_id) {
		case DINO_UI_VIDEO_SETTINGS_POPOVER_CURRENT_DEVICE_PROPERTY:
		dino_ui_video_settings_popover_set_current_device (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;
}

