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

#include "xmpp-vala.h"
#include <gio/gio.h>
#include <glib.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include "dino_i18n.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ANY (dino_ui_view_model_preferences_row_any_get_type ())
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_ANY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ANY, DinoUiViewModelPreferencesRowAny))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_ANY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ANY, DinoUiViewModelPreferencesRowAnyClass))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_ANY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ANY))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_ANY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ANY))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_ANY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ANY, DinoUiViewModelPreferencesRowAnyClass))

typedef struct _DinoUiViewModelPreferencesRowAny DinoUiViewModelPreferencesRowAny;
typedef struct _DinoUiViewModelPreferencesRowAnyClass DinoUiViewModelPreferencesRowAnyClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TEXT (dino_ui_view_model_preferences_row_text_get_type ())
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TEXT, DinoUiViewModelPreferencesRowText))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TEXT, DinoUiViewModelPreferencesRowTextClass))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TEXT))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TEXT))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TEXT, DinoUiViewModelPreferencesRowTextClass))

typedef struct _DinoUiViewModelPreferencesRowText DinoUiViewModelPreferencesRowText;
typedef struct _DinoUiViewModelPreferencesRowTextClass DinoUiViewModelPreferencesRowTextClass;

#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TOGGLE (dino_ui_view_model_preferences_row_toggle_get_type ())
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TOGGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TOGGLE, DinoUiViewModelPreferencesRowToggle))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TOGGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TOGGLE, DinoUiViewModelPreferencesRowToggleClass))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_TOGGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TOGGLE))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_TOGGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TOGGLE))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TOGGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_TOGGLE, DinoUiViewModelPreferencesRowToggleClass))

typedef struct _DinoUiViewModelPreferencesRowToggle DinoUiViewModelPreferencesRowToggle;
typedef struct _DinoUiViewModelPreferencesRowToggleClass DinoUiViewModelPreferencesRowToggleClass;
typedef struct _Block69Data Block69Data;

#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_COMBO_BOX (dino_ui_view_model_preferences_row_combo_box_get_type ())
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_COMBO_BOX, DinoUiViewModelPreferencesRowComboBox))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_COMBO_BOX, DinoUiViewModelPreferencesRowComboBoxClass))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_COMBO_BOX))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_COMBO_BOX))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_COMBO_BOX, DinoUiViewModelPreferencesRowComboBoxClass))

typedef struct _DinoUiViewModelPreferencesRowComboBox DinoUiViewModelPreferencesRowComboBox;
typedef struct _DinoUiViewModelPreferencesRowComboBoxClass DinoUiViewModelPreferencesRowComboBoxClass;
typedef struct _DinoUiViewModelPreferencesRowAnyPrivate DinoUiViewModelPreferencesRowAnyPrivate;
typedef struct _DinoUiViewModelPreferencesRowComboBoxPrivate DinoUiViewModelPreferencesRowComboBoxPrivate;
#define _xmpp_xep_data_forms_data_form_option_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_xep_data_forms_data_form_option_unref (var), NULL)))

#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_PRIVATE_TEXT (dino_ui_view_model_preferences_row_private_text_get_type ())
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_PRIVATE_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_PRIVATE_TEXT, DinoUiViewModelPreferencesRowPrivateText))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_PRIVATE_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_PRIVATE_TEXT, DinoUiViewModelPreferencesRowPrivateTextClass))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_PRIVATE_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_PRIVATE_TEXT))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_PRIVATE_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_PRIVATE_TEXT))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_PRIVATE_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_PRIVATE_TEXT, DinoUiViewModelPreferencesRowPrivateTextClass))

typedef struct _DinoUiViewModelPreferencesRowPrivateText DinoUiViewModelPreferencesRowPrivateText;
typedef struct _DinoUiViewModelPreferencesRowPrivateTextClass DinoUiViewModelPreferencesRowPrivateTextClass;

#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ENTRY (dino_ui_view_model_preferences_row_entry_get_type ())
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ENTRY, DinoUiViewModelPreferencesRowEntry))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ENTRY, DinoUiViewModelPreferencesRowEntryClass))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ENTRY))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_IS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ENTRY))
#define DINO_UI_VIEW_MODEL_PREFERENCES_ROW_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ENTRY, DinoUiViewModelPreferencesRowEntryClass))

typedef struct _DinoUiViewModelPreferencesRowEntry DinoUiViewModelPreferencesRowEntry;
typedef struct _DinoUiViewModelPreferencesRowEntryClass DinoUiViewModelPreferencesRowEntryClass;

struct _Block69Data {
	int _ref_count_;
	XmppXepDataFormsDataFormListSingleField* list_single_field;
};

struct _DinoUiViewModelPreferencesRowAny {
	GObject parent_instance;
	DinoUiViewModelPreferencesRowAnyPrivate * priv;
};

struct _DinoUiViewModelPreferencesRowAnyClass {
	GObjectClass parent_class;
};

struct _DinoUiViewModelPreferencesRowComboBox {
	DinoUiViewModelPreferencesRowAny parent_instance;
	DinoUiViewModelPreferencesRowComboBoxPrivate * priv;
	GeeList* items;
};

struct _DinoUiViewModelPreferencesRowComboBoxClass {
	DinoUiViewModelPreferencesRowAnyClass parent_class;
};

VALA_EXTERN GListStore* dino_ui_util_get_data_form_view_model (XmppXepDataFormsDataForm* data_form);
VALA_EXTERN GType dino_ui_view_model_preferences_row_any_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelPreferencesRowAny, g_object_unref)
VALA_EXTERN DinoUiViewModelPreferencesRowAny* dino_ui_util_get_data_form_field_view_model (XmppXepDataFormsDataFormField* field);
VALA_EXTERN GType dino_ui_view_model_preferences_row_text_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelPreferencesRowText, g_object_unref)
VALA_EXTERN DinoUiViewModelPreferencesRowText* dino_ui_view_model_preferences_row_text_new (void);
VALA_EXTERN DinoUiViewModelPreferencesRowText* dino_ui_view_model_preferences_row_text_construct (GType object_type);
VALA_EXTERN void dino_ui_view_model_preferences_row_text_set_text (DinoUiViewModelPreferencesRowText* self,
                                                       const gchar* value);
VALA_EXTERN GType dino_ui_view_model_preferences_row_toggle_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelPreferencesRowToggle, g_object_unref)
VALA_EXTERN DinoUiViewModelPreferencesRowToggle* dino_ui_view_model_preferences_row_toggle_new (void);
VALA_EXTERN DinoUiViewModelPreferencesRowToggle* dino_ui_view_model_preferences_row_toggle_construct (GType object_type);
VALA_EXTERN void dino_ui_view_model_preferences_row_toggle_set_subtitle (DinoUiViewModelPreferencesRowToggle* self,
                                                             const gchar* value);
VALA_EXTERN void dino_ui_view_model_preferences_row_toggle_set_state (DinoUiViewModelPreferencesRowToggle* self,
                                                          gboolean value);
static Block69Data* block69_data_ref (Block69Data* _data69_);
static void block69_data_unref (void * _userdata_);
VALA_EXTERN GType dino_ui_view_model_preferences_row_combo_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelPreferencesRowComboBox, g_object_unref)
VALA_EXTERN DinoUiViewModelPreferencesRowComboBox* dino_ui_view_model_preferences_row_combo_box_new (void);
VALA_EXTERN DinoUiViewModelPreferencesRowComboBox* dino_ui_view_model_preferences_row_combo_box_construct (GType object_type);
VALA_EXTERN void dino_ui_view_model_preferences_row_combo_box_set_active_item (DinoUiViewModelPreferencesRowComboBox* self,
                                                                   gint value);
static gboolean ___lambda184_ (Block69Data* _data69_,
                        GBinding* binding,
                        GValue* from,
                        GValue* to);
static gboolean ____lambda184__gbinding_transform_func (GBinding* binding,
                                                 GValue* from_value,
                                                 GValue* to_value,
                                                 gpointer self);
VALA_EXTERN GType dino_ui_view_model_preferences_row_private_text_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelPreferencesRowPrivateText, g_object_unref)
VALA_EXTERN DinoUiViewModelPreferencesRowPrivateText* dino_ui_view_model_preferences_row_private_text_new (void);
VALA_EXTERN DinoUiViewModelPreferencesRowPrivateText* dino_ui_view_model_preferences_row_private_text_construct (GType object_type);
VALA_EXTERN void dino_ui_view_model_preferences_row_private_text_set_text (DinoUiViewModelPreferencesRowPrivateText* self,
                                                               const gchar* value);
VALA_EXTERN GType dino_ui_view_model_preferences_row_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DinoUiViewModelPreferencesRowEntry, g_object_unref)
VALA_EXTERN DinoUiViewModelPreferencesRowEntry* dino_ui_view_model_preferences_row_entry_new (void);
VALA_EXTERN DinoUiViewModelPreferencesRowEntry* dino_ui_view_model_preferences_row_entry_construct (GType object_type);
VALA_EXTERN void dino_ui_view_model_preferences_row_entry_set_text (DinoUiViewModelPreferencesRowEntry* self,
                                                        const gchar* value);
VALA_EXTERN void dino_ui_view_model_preferences_row_any_set_title (DinoUiViewModelPreferencesRowAny* self,
                                                       const gchar* value);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

GListStore*
dino_ui_util_get_data_form_view_model (XmppXepDataFormsDataForm* data_form)
{
	GListStore* list_store = NULL;
	GListStore* _tmp0_;
	GListStore* result;
	g_return_val_if_fail (data_form != NULL, NULL);
	_tmp0_ = g_list_store_new (DINO_UI_VIEW_MODEL_PREFERENCES_ROW_TYPE_ANY);
	list_store = _tmp0_;
	{
		GeeList* _field_list = NULL;
		GeeList* _tmp1_;
		gint _field_size = 0;
		GeeList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _field_index = 0;
		_tmp1_ = data_form->fields;
		_field_list = _tmp1_;
		_tmp2_ = _field_list;
		_tmp3_ = gee_collection_get_size ((GeeCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_field_size = _tmp4_;
		_field_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			XmppXepDataFormsDataFormField* field = NULL;
			GeeList* _tmp7_;
			gpointer _tmp8_;
			DinoUiViewModelPreferencesRowAny* field_view_model = NULL;
			XmppXepDataFormsDataFormField* _tmp9_;
			DinoUiViewModelPreferencesRowAny* _tmp10_;
			DinoUiViewModelPreferencesRowAny* _tmp11_;
			_field_index = _field_index + 1;
			_tmp5_ = _field_index;
			_tmp6_ = _field_size;
			if (!(_tmp5_ < _tmp6_)) {
				break;
			}
			_tmp7_ = _field_list;
			_tmp8_ = gee_list_get (_tmp7_, _field_index);
			field = (XmppXepDataFormsDataFormField*) _tmp8_;
			_tmp9_ = field;
			_tmp10_ = dino_ui_util_get_data_form_field_view_model (_tmp9_);
			field_view_model = _tmp10_;
			_tmp11_ = field_view_model;
			if (_tmp11_ != NULL) {
				GListStore* _tmp12_;
				DinoUiViewModelPreferencesRowAny* _tmp13_;
				_tmp12_ = list_store;
				_tmp13_ = field_view_model;
				g_list_store_append (_tmp12_, (GObject*) _tmp13_);
			}
			_g_object_unref0 (field_view_model);
			_g_object_unref0 (field);
		}
	}
	result = list_store;
	return result;
}

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

static Block69Data*
block69_data_ref (Block69Data* _data69_)
{
	g_atomic_int_inc (&_data69_->_ref_count_);
	return _data69_;
}

static void
block69_data_unref (void * _userdata_)
{
	Block69Data* _data69_;
	_data69_ = (Block69Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data69_->_ref_count_)) {
		_g_object_unref0 (_data69_->list_single_field);
		g_slice_free (Block69Data, _data69_);
	}
}

static gboolean
___lambda184_ (Block69Data* _data69_,
               GBinding* binding,
               GValue* from,
               GValue* to)
{
	gint active_item = 0;
	GValue _tmp0_;
	XmppXepDataFormsDataFormListSingleField* _tmp1_;
	GeeList* _tmp2_;
	GeeList* _tmp3_;
	GeeList* _tmp4_;
	gpointer _tmp5_;
	XmppXepDataFormsDataFormOption* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	GValue _tmp9_ = {0};
	gboolean result;
	g_return_val_if_fail (binding != NULL, FALSE);
	g_return_val_if_fail (from != NULL, FALSE);
	g_return_val_if_fail (to != NULL, FALSE);
	_tmp0_ = *from;
	active_item = g_value_get_int (&_tmp0_);
	_tmp1_ = _data69_->list_single_field;
	_tmp2_ = xmpp_xep_data_forms_data_form_list_single_field_get_options (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_;
	_tmp5_ = gee_list_get (_tmp4_, active_item);
	_tmp6_ = (XmppXepDataFormsDataFormOption*) _tmp5_;
	_tmp7_ = xmpp_xep_data_forms_data_form_option_get_value (_tmp6_);
	_tmp8_ = _tmp7_;
	g_value_init (&_tmp9_, G_TYPE_STRING);
	g_value_set_string (&_tmp9_, _tmp8_);
	G_IS_VALUE (to) ? (g_value_unset (to), NULL) : NULL;
	*to = _tmp9_;
	_xmpp_xep_data_forms_data_form_option_unref0 (_tmp6_);
	_g_object_unref0 (_tmp4_);
	result = TRUE;
	return result;
}

static gboolean
____lambda184__gbinding_transform_func (GBinding* binding,
                                        GValue* from_value,
                                        GValue* to_value,
                                        gpointer self)
{
	gboolean result;
	result = ___lambda184_ (self, binding, from_value, to_value);
	return result;
}

DinoUiViewModelPreferencesRowAny*
dino_ui_util_get_data_form_field_view_model (XmppXepDataFormsDataFormField* field)
{
	XmppXepDataFormsDataFormType* _tmp0_;
	XmppXepDataFormsDataFormType* _tmp1_;
	DinoUiViewModelPreferencesRowAny* view_model = NULL;
	gchar* label = NULL;
	gchar* desc = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp35_;
	XmppXepDataFormsDataFormType* _tmp39_;
	XmppXepDataFormsDataFormType* _tmp40_;
	DinoUiViewModelPreferencesRowAny* _tmp112_;
	const gchar* _tmp113_;
	DinoUiViewModelPreferencesRowAny* result;
	g_return_val_if_fail (field != NULL, NULL);
	_tmp0_ = xmpp_xep_data_forms_data_form_field_get_type_ (field);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		result = NULL;
		return result;
	}
	view_model = NULL;
	label = NULL;
	desc = NULL;
	_tmp2_ = xmpp_xep_data_forms_data_form_field_get_var (field);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != NULL) {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		GQuark _tmp8_ = 0U;
		static GQuark _tmp7_label0 = 0;
		static GQuark _tmp7_label1 = 0;
		static GQuark _tmp7_label2 = 0;
		static GQuark _tmp7_label3 = 0;
		static GQuark _tmp7_label4 = 0;
		static GQuark _tmp7_label5 = 0;
		static GQuark _tmp7_label6 = 0;
		static GQuark _tmp7_label7 = 0;
		static GQuark _tmp7_label8 = 0;
		_tmp4_ = xmpp_xep_data_forms_data_form_field_get_var (field);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp8_ = (NULL == _tmp6_) ? 0 : g_quark_from_string (_tmp6_);
		if (_tmp8_ == ((0 != _tmp7_label0) ? _tmp7_label0 : (_tmp7_label0 = g_quark_from_static_string ("muc#roomconfig_roomname")))) {
			switch (0) {
				default:
				{
					const gchar* _tmp9_;
					gchar* _tmp10_;
					_tmp9_ = dino_gettext ("Name of the room");
					_tmp10_ = g_strdup (_tmp9_);
					_g_free0 (label);
					label = _tmp10_;
					break;
				}
			}
		} else if (_tmp8_ == ((0 != _tmp7_label1) ? _tmp7_label1 : (_tmp7_label1 = g_quark_from_static_string ("muc#roomconfig_roomdesc")))) {
			switch (0) {
				default:
				{
					const gchar* _tmp11_;
					gchar* _tmp12_;
					_tmp11_ = dino_gettext ("Description of the room");
					_tmp12_ = g_strdup (_tmp11_);
					_g_free0 (label);
					label = _tmp12_;
					break;
				}
			}
		} else if (_tmp8_ == ((0 != _tmp7_label2) ? _tmp7_label2 : (_tmp7_label2 = g_quark_from_static_string ("muc#roomconfig_persistentroom")))) {
			switch (0) {
				default:
				{
					const gchar* _tmp13_;
					gchar* _tmp14_;
					const gchar* _tmp15_;
					gchar* _tmp16_;
					_tmp13_ = dino_gettext ("Persistent");
					_tmp14_ = g_strdup (_tmp13_);
					_g_free0 (label);
					label = _tmp14_;
					_tmp15_ = dino_gettext ("The room will persist after the last occupant leaves");
					_tmp16_ = g_strdup (_tmp15_);
					_g_free0 (desc);
					desc = _tmp16_;
					break;
				}
			}
		} else if (_tmp8_ == ((0 != _tmp7_label3) ? _tmp7_label3 : (_tmp7_label3 = g_quark_from_static_string ("muc#roomconfig_publicroom")))) {
			switch (0) {
				default:
				{
					const gchar* _tmp17_;
					gchar* _tmp18_;
					_tmp17_ = dino_gettext ("Publicly searchable");
					_tmp18_ = g_strdup (_tmp17_);
					_g_free0 (label);
					label = _tmp18_;
					break;
				}
			}
		} else if (_tmp8_ == ((0 != _tmp7_label4) ? _tmp7_label4 : (_tmp7_label4 = g_quark_from_static_string ("muc#roomconfig_changesubject")))) {
			switch (0) {
				default:
				{
					const gchar* _tmp19_;
					gchar* _tmp20_;
					_tmp19_ = dino_gettext ("Occupants may change the subject");
					_tmp20_ = g_strdup (_tmp19_);
					_g_free0 (label);
					label = _tmp20_;
					break;
				}
			}
		} else if (_tmp8_ == ((0 != _tmp7_label5) ? _tmp7_label5 : (_tmp7_label5 = g_quark_from_static_string ("muc#roomconfig_whois")))) {
			switch (0) {
				default:
				{
					const gchar* _tmp21_;
					gchar* _tmp22_;
					const gchar* _tmp23_;
					gchar* _tmp24_;
					_tmp21_ = dino_gettext ("Permission to view JIDs");
					_tmp22_ = g_strdup (_tmp21_);
					_g_free0 (label);
					label = _tmp22_;
					_tmp23_ = dino_gettext ("Who is allowed to view the occupants' JIDs?");
					_tmp24_ = g_strdup (_tmp23_);
					_g_free0 (desc);
					desc = _tmp24_;
					break;
				}
			}
		} else if (_tmp8_ == ((0 != _tmp7_label6) ? _tmp7_label6 : (_tmp7_label6 = g_quark_from_static_string ("muc#roomconfig_roomsecret")))) {
			switch (0) {
				default:
				{
					const gchar* _tmp25_;
					gchar* _tmp26_;
					_tmp25_ = dino_gettext ("Password");
					_tmp26_ = g_strdup (_tmp25_);
					_g_free0 (label);
					label = _tmp26_;
					break;
				}
			}
		} else if (_tmp8_ == ((0 != _tmp7_label7) ? _tmp7_label7 : (_tmp7_label7 = g_quark_from_static_string ("muc#roomconfig_moderatedroom")))) {
			switch (0) {
				default:
				{
					const gchar* _tmp27_;
					gchar* _tmp28_;
					const gchar* _tmp29_;
					gchar* _tmp30_;
					_tmp27_ = dino_gettext ("Moderated");
					_tmp28_ = g_strdup (_tmp27_);
					_g_free0 (label);
					label = _tmp28_;
					_tmp29_ = dino_gettext ("Only occupants with voice may send messages");
					_tmp30_ = g_strdup (_tmp29_);
					_g_free0 (desc);
					desc = _tmp30_;
					break;
				}
			}
		} else if (_tmp8_ == ((0 != _tmp7_label8) ? _tmp7_label8 : (_tmp7_label8 = g_quark_from_static_string ("muc#roomconfig_membersonly")))) {
			switch (0) {
				default:
				{
					const gchar* _tmp31_;
					gchar* _tmp32_;
					const gchar* _tmp33_;
					gchar* _tmp34_;
					_tmp31_ = dino_gettext ("Members only");
					_tmp32_ = g_strdup (_tmp31_);
					_g_free0 (label);
					label = _tmp32_;
					_tmp33_ = dino_gettext ("Only members may enter the room");
					_tmp34_ = g_strdup (_tmp33_);
					_g_free0 (desc);
					desc = _tmp34_;
					break;
				}
			}
		}
	}
	_tmp35_ = label;
	if (_tmp35_ == NULL) {
		const gchar* _tmp36_;
		const gchar* _tmp37_;
		gchar* _tmp38_;
		_tmp36_ = xmpp_xep_data_forms_data_form_field_get_label (field);
		_tmp37_ = _tmp36_;
		_tmp38_ = g_strdup (_tmp37_);
		_g_free0 (label);
		label = _tmp38_;
	}
	_tmp39_ = xmpp_xep_data_forms_data_form_field_get_type_ (field);
	_tmp40_ = _tmp39_;
	switch (*_tmp40_) {
		case XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_FIXED:
		{
			XmppXepDataFormsDataFormFixedField* fixed_field = NULL;
			XmppXepDataFormsDataFormFixedField* _tmp41_;
			DinoUiViewModelPreferencesRowText* fixed_model = NULL;
			XmppXepDataFormsDataFormFixedField* _tmp42_;
			gchar* _tmp43_;
			gchar* _tmp44_;
			DinoUiViewModelPreferencesRowText* _tmp45_ = NULL;
			DinoUiViewModelPreferencesRowText* _tmp46_;
			DinoUiViewModelPreferencesRowAny* _tmp47_;
			_tmp41_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (field, XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_FIXED_FIELD) ? ((XmppXepDataFormsDataFormFixedField*) field) : NULL);
			fixed_field = _tmp41_;
			_tmp42_ = fixed_field;
			_tmp43_ = xmpp_xep_data_forms_data_form_fixed_field_get_value (_tmp42_);
			_tmp44_ = _tmp43_;
			_tmp45_ = dino_ui_view_model_preferences_row_text_new ();
			dino_ui_view_model_preferences_row_text_set_text (_tmp45_, _tmp44_);
			_g_free0 (_tmp44_);
			fixed_model = _tmp45_;
			_tmp46_ = fixed_model;
			_tmp47_ = _g_object_ref0 ((DinoUiViewModelPreferencesRowAny*) _tmp46_);
			_g_object_unref0 (view_model);
			view_model = _tmp47_;
			_g_object_unref0 (fixed_model);
			_g_object_unref0 (fixed_field);
			break;
		}
		case XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_BOOLEAN:
		{
			XmppXepDataFormsDataFormBooleanField* boolean_field = NULL;
			XmppXepDataFormsDataFormBooleanField* _tmp48_;
			DinoUiViewModelPreferencesRowToggle* toggle_model = NULL;
			const gchar* _tmp49_;
			gchar* _tmp50_;
			XmppXepDataFormsDataFormBooleanField* _tmp51_;
			gboolean _tmp52_;
			gboolean _tmp53_;
			DinoUiViewModelPreferencesRowToggle* _tmp54_ = NULL;
			XmppXepDataFormsDataFormBooleanField* _tmp55_;
			DinoUiViewModelPreferencesRowToggle* _tmp56_;
			DinoUiViewModelPreferencesRowToggle* _tmp57_;
			DinoUiViewModelPreferencesRowAny* _tmp58_;
			_tmp48_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (field, XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_BOOLEAN_FIELD) ? ((XmppXepDataFormsDataFormBooleanField*) field) : NULL);
			boolean_field = _tmp48_;
			_tmp49_ = desc;
			_tmp50_ = g_strdup (_tmp49_);
			_tmp51_ = boolean_field;
			_tmp52_ = xmpp_xep_data_forms_data_form_boolean_field_get_value (_tmp51_);
			_tmp53_ = _tmp52_;
			_tmp54_ = dino_ui_view_model_preferences_row_toggle_new ();
			dino_ui_view_model_preferences_row_toggle_set_subtitle (_tmp54_, _tmp50_);
			_g_free0 (_tmp50_);
			dino_ui_view_model_preferences_row_toggle_set_state (_tmp54_, _tmp53_);
			toggle_model = _tmp54_;
			_tmp55_ = boolean_field;
			_tmp56_ = toggle_model;
			g_object_bind_property_with_closures ((GObject*) _tmp55_, "value", (GObject*) _tmp56_, "state", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
			_tmp57_ = toggle_model;
			_tmp58_ = _g_object_ref0 ((DinoUiViewModelPreferencesRowAny*) _tmp57_);
			_g_object_unref0 (view_model);
			view_model = _tmp58_;
			_g_object_unref0 (toggle_model);
			_g_object_unref0 (boolean_field);
			break;
		}
		case XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_JID_MULTI:
		{
			result = NULL;
			_g_free0 (desc);
			_g_free0 (label);
			_g_object_unref0 (view_model);
			return result;
		}
		case XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_LIST_SINGLE:
		{
			Block69Data* _data69_;
			XmppXepDataFormsDataFormListSingleField* _tmp59_;
			DinoUiViewModelPreferencesRowComboBox* combobox_model = NULL;
			DinoUiViewModelPreferencesRowComboBox* _tmp60_;
			DinoUiViewModelPreferencesRowComboBox* _tmp90_;
			XmppXepDataFormsDataFormListSingleField* _tmp91_;
			DinoUiViewModelPreferencesRowComboBox* _tmp92_;
			DinoUiViewModelPreferencesRowAny* _tmp93_;
			_data69_ = g_slice_new0 (Block69Data);
			_data69_->_ref_count_ = 1;
			_tmp59_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (field, XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_LIST_SINGLE_FIELD) ? ((XmppXepDataFormsDataFormListSingleField*) field) : NULL);
			_data69_->list_single_field = _tmp59_;
			_tmp60_ = dino_ui_view_model_preferences_row_combo_box_new ();
			combobox_model = _tmp60_;
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp61_ = FALSE;
					_tmp61_ = TRUE;
					while (TRUE) {
						XmppXepDataFormsDataFormListSingleField* _tmp63_;
						GeeList* _tmp64_;
						GeeList* _tmp65_;
						GeeList* _tmp66_;
						gint _tmp67_;
						gint _tmp68_;
						gboolean _tmp69_;
						XmppXepDataFormsDataFormOption* option = NULL;
						XmppXepDataFormsDataFormListSingleField* _tmp70_;
						GeeList* _tmp71_;
						GeeList* _tmp72_;
						GeeList* _tmp73_;
						gpointer _tmp74_;
						XmppXepDataFormsDataFormOption* _tmp75_;
						DinoUiViewModelPreferencesRowComboBox* _tmp76_;
						GeeList* _tmp77_;
						XmppXepDataFormsDataFormOption* _tmp78_;
						const gchar* _tmp79_;
						const gchar* _tmp80_;
						XmppXepDataFormsDataFormOption* _tmp81_;
						const gchar* _tmp82_;
						const gchar* _tmp83_;
						XmppXepDataFormsDataFormListSingleField* _tmp84_;
						gchar* _tmp85_;
						gchar* _tmp86_;
						gchar* _tmp87_;
						gboolean _tmp88_;
						if (!_tmp61_) {
							gint _tmp62_;
							_tmp62_ = i;
							i = _tmp62_ + 1;
						}
						_tmp61_ = FALSE;
						_tmp63_ = _data69_->list_single_field;
						_tmp64_ = xmpp_xep_data_forms_data_form_list_single_field_get_options (_tmp63_);
						_tmp65_ = _tmp64_;
						_tmp66_ = _tmp65_;
						_tmp67_ = gee_collection_get_size ((GeeCollection*) _tmp66_);
						_tmp68_ = _tmp67_;
						_tmp69_ = !(i < _tmp68_);
						_g_object_unref0 (_tmp66_);
						if (_tmp69_) {
							break;
						}
						_tmp70_ = _data69_->list_single_field;
						_tmp71_ = xmpp_xep_data_forms_data_form_list_single_field_get_options (_tmp70_);
						_tmp72_ = _tmp71_;
						_tmp73_ = _tmp72_;
						_tmp74_ = gee_list_get (_tmp73_, i);
						_tmp75_ = (XmppXepDataFormsDataFormOption*) _tmp74_;
						_g_object_unref0 (_tmp73_);
						option = _tmp75_;
						_tmp76_ = combobox_model;
						_tmp77_ = _tmp76_->items;
						_tmp78_ = option;
						_tmp79_ = xmpp_xep_data_forms_data_form_option_get_label (_tmp78_);
						_tmp80_ = _tmp79_;
						gee_collection_add ((GeeCollection*) _tmp77_, _tmp80_);
						_tmp81_ = option;
						_tmp82_ = xmpp_xep_data_forms_data_form_option_get_value (_tmp81_);
						_tmp83_ = _tmp82_;
						_tmp84_ = _data69_->list_single_field;
						_tmp85_ = xmpp_xep_data_forms_data_form_list_single_field_get_value (_tmp84_);
						_tmp86_ = _tmp85_;
						_tmp87_ = _tmp86_;
						_tmp88_ = g_strcmp0 (_tmp83_, _tmp87_) == 0;
						_g_free0 (_tmp87_);
						if (_tmp88_) {
							DinoUiViewModelPreferencesRowComboBox* _tmp89_;
							_tmp89_ = combobox_model;
							dino_ui_view_model_preferences_row_combo_box_set_active_item (_tmp89_, i);
						}
						_xmpp_xep_data_forms_data_form_option_unref0 (option);
					}
				}
			}
			_tmp90_ = combobox_model;
			_tmp91_ = _data69_->list_single_field;
			g_object_bind_property_with_closures ((GObject*) _tmp90_, "active-item", (GObject*) _tmp91_, "value", G_BINDING_DEFAULT, (GClosure*) ((____lambda184__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) ____lambda184__gbinding_transform_func, block69_data_ref (_data69_), (GClosureNotify) block69_data_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
			_tmp92_ = combobox_model;
			_tmp93_ = _g_object_ref0 ((DinoUiViewModelPreferencesRowAny*) _tmp92_);
			_g_object_unref0 (view_model);
			view_model = _tmp93_;
			_g_object_unref0 (combobox_model);
			block69_data_unref (_data69_);
			_data69_ = NULL;
			break;
		}
		case XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_LIST_MULTI:
		{
			result = NULL;
			_g_free0 (desc);
			_g_free0 (label);
			_g_object_unref0 (view_model);
			return result;
		}
		case XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_TEXT_PRIVATE:
		{
			XmppXepDataFormsDataFormTextPrivateField* text_private_field = NULL;
			XmppXepDataFormsDataFormTextPrivateField* _tmp94_;
			DinoUiViewModelPreferencesRowPrivateText* private_entry_model = NULL;
			XmppXepDataFormsDataFormTextPrivateField* _tmp95_;
			gchar* _tmp96_;
			gchar* _tmp97_;
			DinoUiViewModelPreferencesRowPrivateText* _tmp98_ = NULL;
			XmppXepDataFormsDataFormTextPrivateField* _tmp99_;
			DinoUiViewModelPreferencesRowPrivateText* _tmp100_;
			DinoUiViewModelPreferencesRowPrivateText* _tmp101_;
			DinoUiViewModelPreferencesRowAny* _tmp102_;
			_tmp94_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (field, XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_TEXT_PRIVATE_FIELD) ? ((XmppXepDataFormsDataFormTextPrivateField*) field) : NULL);
			text_private_field = _tmp94_;
			_tmp95_ = text_private_field;
			_tmp96_ = xmpp_xep_data_forms_data_form_text_private_field_get_value (_tmp95_);
			_tmp97_ = _tmp96_;
			_tmp98_ = dino_ui_view_model_preferences_row_private_text_new ();
			dino_ui_view_model_preferences_row_private_text_set_text (_tmp98_, _tmp97_);
			_g_free0 (_tmp97_);
			private_entry_model = _tmp98_;
			_tmp99_ = text_private_field;
			_tmp100_ = private_entry_model;
			g_object_bind_property_with_closures ((GObject*) _tmp99_, "value", (GObject*) _tmp100_, "text", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
			_tmp101_ = private_entry_model;
			_tmp102_ = _g_object_ref0 ((DinoUiViewModelPreferencesRowAny*) _tmp101_);
			_g_object_unref0 (view_model);
			view_model = _tmp102_;
			_g_object_unref0 (private_entry_model);
			_g_object_unref0 (text_private_field);
			break;
		}
		case XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_TEXT_SINGLE:
		{
			XmppXepDataFormsDataFormTextSingleField* text_single_field = NULL;
			XmppXepDataFormsDataFormTextSingleField* _tmp103_;
			DinoUiViewModelPreferencesRowEntry* entry_model = NULL;
			XmppXepDataFormsDataFormTextSingleField* _tmp104_;
			gchar* _tmp105_;
			gchar* _tmp106_;
			DinoUiViewModelPreferencesRowEntry* _tmp107_ = NULL;
			XmppXepDataFormsDataFormTextSingleField* _tmp108_;
			DinoUiViewModelPreferencesRowEntry* _tmp109_;
			DinoUiViewModelPreferencesRowEntry* _tmp110_;
			DinoUiViewModelPreferencesRowAny* _tmp111_;
			_tmp103_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (field, XMPP_XEP_DATA_FORMS_DATA_FORM_TYPE_TEXT_SINGLE_FIELD) ? ((XmppXepDataFormsDataFormTextSingleField*) field) : NULL);
			text_single_field = _tmp103_;
			_tmp104_ = text_single_field;
			_tmp105_ = xmpp_xep_data_forms_data_form_text_single_field_get_value (_tmp104_);
			_tmp106_ = _tmp105_;
			_tmp107_ = dino_ui_view_model_preferences_row_entry_new ();
			dino_ui_view_model_preferences_row_entry_set_text (_tmp107_, _tmp106_);
			_g_free0 (_tmp106_);
			entry_model = _tmp107_;
			_tmp108_ = text_single_field;
			_tmp109_ = entry_model;
			g_object_bind_property_with_closures ((GObject*) _tmp108_, "value", (GObject*) _tmp109_, "text", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
			_tmp110_ = entry_model;
			_tmp111_ = _g_object_ref0 ((DinoUiViewModelPreferencesRowAny*) _tmp110_);
			_g_object_unref0 (view_model);
			view_model = _tmp111_;
			_g_object_unref0 (entry_model);
			_g_object_unref0 (text_single_field);
			break;
		}
		default:
		{
			result = NULL;
			_g_free0 (desc);
			_g_free0 (label);
			_g_object_unref0 (view_model);
			return result;
		}
	}
	_tmp112_ = view_model;
	_tmp113_ = label;
	dino_ui_view_model_preferences_row_any_set_title (_tmp112_, _tmp113_);
	result = view_model;
	_g_free0 (desc);
	_g_free0 (label);
	return result;
}

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

