/* preferences-language-row.c generated by valac 0.56.19, the Vala compiler
 * generated from preferences-language-row.vala, do not modify */

#include "protonplus_core.h"
#include <glib.h>
#include <glib-object.h>
#include <adwaita.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.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

enum  {
	PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_0_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_preferences_language_row_properties[PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_NUM_PROPERTIES];

#define PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE (proton_plus_widgets_preferences_language_row_language_get_type ())
#define PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE, ProtonPlusWidgetsPreferencesLanguageRowLanguage))
#define PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE, ProtonPlusWidgetsPreferencesLanguageRowLanguageClass))
#define PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_IS_LANGUAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE))
#define PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_IS_LANGUAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE))
#define PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE, ProtonPlusWidgetsPreferencesLanguageRowLanguageClass))

typedef struct _ProtonPlusWidgetsPreferencesLanguageRowLanguage ProtonPlusWidgetsPreferencesLanguageRowLanguage;
typedef struct _ProtonPlusWidgetsPreferencesLanguageRowLanguageClass ProtonPlusWidgetsPreferencesLanguageRowLanguageClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ProtonPlusWidgetsPreferencesLanguageRowLanguagePrivate ProtonPlusWidgetsPreferencesLanguageRowLanguagePrivate;
enum  {
	PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_0_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_NAME_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_INDEX_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_CODE_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_preferences_language_row_language_properties[PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gtk_expression_unref0(var) ((var == NULL) ? NULL : (var = (gtk_expression_unref (var), NULL)))

struct _ProtonPlusWidgetsPreferencesLanguageRowPrivate {
	gboolean is_initializing;
};

struct _ProtonPlusWidgetsPreferencesLanguageRowLanguage {
	GObject parent_instance;
	ProtonPlusWidgetsPreferencesLanguageRowLanguagePrivate * priv;
};

struct _ProtonPlusWidgetsPreferencesLanguageRowLanguageClass {
	GObjectClass parent_class;
};

struct _ProtonPlusWidgetsPreferencesLanguageRowLanguagePrivate {
	gchar* _name;
	gint _index;
	gchar* _code;
};

static gint ProtonPlusWidgetsPreferencesLanguageRow_private_offset;
static gpointer proton_plus_widgets_preferences_language_row_parent_class = NULL;
static gint ProtonPlusWidgetsPreferencesLanguageRowLanguage_private_offset;
static gpointer proton_plus_widgets_preferences_language_row_language_parent_class = NULL;

static void proton_plus_widgets_preferences_language_row_selected_item_changed (ProtonPlusWidgetsPreferencesLanguageRow* self);
static GType proton_plus_widgets_preferences_language_row_language_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static gint proton_plus_widgets_preferences_language_row_language_get_index (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self);
static ProtonPlusWidgetsPreferencesLanguageRowLanguage* proton_plus_widgets_preferences_language_row_language_new (const gchar* name,
                                                                                                            gint index,
                                                                                                            const gchar* code);
static ProtonPlusWidgetsPreferencesLanguageRowLanguage* proton_plus_widgets_preferences_language_row_language_construct (GType object_type,
                                                                                                                  const gchar* name,
                                                                                                                  gint index,
                                                                                                                  const gchar* code);
static void proton_plus_widgets_preferences_language_row_language_set_name (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self,
                                                                     const gchar* value);
static void proton_plus_widgets_preferences_language_row_language_set_index (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self,
                                                                      gint value);
static void proton_plus_widgets_preferences_language_row_language_set_code (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self,
                                                                     const gchar* value);
static const gchar* proton_plus_widgets_preferences_language_row_language_get_name (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self);
static const gchar* proton_plus_widgets_preferences_language_row_language_get_code (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self);
static void proton_plus_widgets_preferences_language_row_language_finalize (GObject * obj);
static GType proton_plus_widgets_preferences_language_row_language_get_type_once (void);
static void _vala_proton_plus_widgets_preferences_language_row_language_get_property (GObject * object,
                                                                               guint property_id,
                                                                               GValue * value,
                                                                               GParamSpec * pspec);
static void _vala_proton_plus_widgets_preferences_language_row_language_set_property (GObject * object,
                                                                               guint property_id,
                                                                               const GValue * value,
                                                                               GParamSpec * pspec);
static GObject * proton_plus_widgets_preferences_language_row_constructor (GType type,
                                                                    guint n_construct_properties,
                                                                    GObjectConstructParam * construct_properties);
static void _vala_ProtonPlusGlobalsLanguageItem_array_free (ProtonPlusGlobalsLanguageItem * array,
                                                     gssize array_length);
static void _proton_plus_widgets_preferences_language_row_selected_item_changed_g_object_notify (GObject* _sender,
                                                                                          GParamSpec* pspec,
                                                                                          gpointer self);
static void proton_plus_widgets_preferences_language_row_finalize (GObject * obj);
static GType proton_plus_widgets_preferences_language_row_get_type_once (void);

static inline gpointer
proton_plus_widgets_preferences_language_row_get_instance_private (ProtonPlusWidgetsPreferencesLanguageRow* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsPreferencesLanguageRow_private_offset);
}

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

static void
proton_plus_widgets_preferences_language_row_selected_item_changed (ProtonPlusWidgetsPreferencesLanguageRow* self)
{
	ProtonPlusWidgetsPreferencesLanguageRowLanguage* language = NULL;
	GObject* _tmp0_;
	ProtonPlusWidgetsPreferencesLanguageRowLanguage* _tmp1_;
	gboolean _tmp2_ = FALSE;
	ProtonPlusWidgetsPreferencesLanguageRowLanguage* _tmp3_;
	GSettings* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = adw_combo_row_get_selected_item ((AdwComboRow*) self);
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_IS_LANGUAGE (_tmp0_) ? ((ProtonPlusWidgetsPreferencesLanguageRowLanguage*) _tmp0_) : NULL);
	language = _tmp1_;
	_tmp3_ = language;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		_tmp2_ = self->priv->is_initializing;
	}
	if (_tmp2_) {
		_g_object_unref0 (language);
		return;
	}
	_tmp4_ = proton_plus_globals_SETTINGS;
	if (_tmp4_ != NULL) {
		GSettings* _tmp5_;
		ProtonPlusWidgetsPreferencesLanguageRowLanguage* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp5_ = proton_plus_globals_SETTINGS;
		_tmp6_ = language;
		_tmp7_ = proton_plus_widgets_preferences_language_row_language_get_index (_tmp6_);
		_tmp8_ = _tmp7_;
		g_settings_set_enum (_tmp5_, "language", _tmp8_);
	}
	proton_plus_globals_setupLanguage ();
	gtk_widget_activate_action ((GtkWidget*) self, "app.on_language_change", NULL, NULL);
	_g_object_unref0 (language);
}

ProtonPlusWidgetsPreferencesLanguageRow*
proton_plus_widgets_preferences_language_row_construct (GType object_type)
{
	ProtonPlusWidgetsPreferencesLanguageRow * self = NULL;
	self = (ProtonPlusWidgetsPreferencesLanguageRow*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusWidgetsPreferencesLanguageRow*
proton_plus_widgets_preferences_language_row_new (void)
{
	return proton_plus_widgets_preferences_language_row_construct (PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_LANGUAGE_ROW);
}

static inline gpointer
proton_plus_widgets_preferences_language_row_language_get_instance_private (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsPreferencesLanguageRowLanguage_private_offset);
}

static ProtonPlusWidgetsPreferencesLanguageRowLanguage*
proton_plus_widgets_preferences_language_row_language_construct (GType object_type,
                                                                 const gchar* name,
                                                                 gint index,
                                                                 const gchar* code)
{
	ProtonPlusWidgetsPreferencesLanguageRowLanguage * self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (code != NULL, NULL);
	self = (ProtonPlusWidgetsPreferencesLanguageRowLanguage*) g_object_new (object_type, NULL);
	proton_plus_widgets_preferences_language_row_language_set_name (self, name);
	proton_plus_widgets_preferences_language_row_language_set_index (self, index);
	proton_plus_widgets_preferences_language_row_language_set_code (self, code);
	return self;
}

static ProtonPlusWidgetsPreferencesLanguageRowLanguage*
proton_plus_widgets_preferences_language_row_language_new (const gchar* name,
                                                           gint index,
                                                           const gchar* code)
{
	return proton_plus_widgets_preferences_language_row_language_construct (PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE, name, index, code);
}

static const gchar*
proton_plus_widgets_preferences_language_row_language_get_name (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_preferences_language_row_language_set_name (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self,
                                                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_preferences_language_row_language_get_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_name);
		self->priv->_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_preferences_language_row_language_properties[PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_NAME_PROPERTY]);
	}
}

static gint
proton_plus_widgets_preferences_language_row_language_get_index (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_index;
	return result;
}

static void
proton_plus_widgets_preferences_language_row_language_set_index (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self,
                                                                 gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_preferences_language_row_language_get_index (self);
	if (old_value != value) {
		self->priv->_index = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_preferences_language_row_language_properties[PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_INDEX_PROPERTY]);
	}
}

static const gchar*
proton_plus_widgets_preferences_language_row_language_get_code (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_code;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_preferences_language_row_language_set_code (ProtonPlusWidgetsPreferencesLanguageRowLanguage* self,
                                                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_preferences_language_row_language_get_code (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_code);
		self->priv->_code = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_preferences_language_row_language_properties[PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_CODE_PROPERTY]);
	}
}

static void
proton_plus_widgets_preferences_language_row_language_class_init (ProtonPlusWidgetsPreferencesLanguageRowLanguageClass * klass,
                                                                  gpointer klass_data)
{
	proton_plus_widgets_preferences_language_row_language_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsPreferencesLanguageRowLanguage_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_preferences_language_row_language_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_preferences_language_row_language_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_preferences_language_row_language_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_NAME_PROPERTY, proton_plus_widgets_preferences_language_row_language_properties[PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_INDEX_PROPERTY, proton_plus_widgets_preferences_language_row_language_properties[PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_INDEX_PROPERTY] = g_param_spec_int ("index", "index", "index", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_CODE_PROPERTY, proton_plus_widgets_preferences_language_row_language_properties[PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_CODE_PROPERTY] = g_param_spec_string ("code", "code", "code", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_widgets_preferences_language_row_language_instance_init (ProtonPlusWidgetsPreferencesLanguageRowLanguage * self,
                                                                     gpointer klass)
{
	self->priv = proton_plus_widgets_preferences_language_row_language_get_instance_private (self);
}

static void
proton_plus_widgets_preferences_language_row_language_finalize (GObject * obj)
{
	ProtonPlusWidgetsPreferencesLanguageRowLanguage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE, ProtonPlusWidgetsPreferencesLanguageRowLanguage);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_code);
	G_OBJECT_CLASS (proton_plus_widgets_preferences_language_row_language_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_preferences_language_row_language_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsPreferencesLanguageRowLanguageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_preferences_language_row_language_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsPreferencesLanguageRowLanguage), 0, (GInstanceInitFunc) proton_plus_widgets_preferences_language_row_language_instance_init, NULL };
	GType proton_plus_widgets_preferences_language_row_language_type_id;
	proton_plus_widgets_preferences_language_row_language_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusWidgetsPreferencesLanguageRowLanguage", &g_define_type_info, 0);
	ProtonPlusWidgetsPreferencesLanguageRowLanguage_private_offset = g_type_add_instance_private (proton_plus_widgets_preferences_language_row_language_type_id, sizeof (ProtonPlusWidgetsPreferencesLanguageRowLanguagePrivate));
	return proton_plus_widgets_preferences_language_row_language_type_id;
}

static GType
proton_plus_widgets_preferences_language_row_language_get_type (void)
{
	static volatile gsize proton_plus_widgets_preferences_language_row_language_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_preferences_language_row_language_type_id__once)) {
		GType proton_plus_widgets_preferences_language_row_language_type_id;
		proton_plus_widgets_preferences_language_row_language_type_id = proton_plus_widgets_preferences_language_row_language_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_preferences_language_row_language_type_id__once, proton_plus_widgets_preferences_language_row_language_type_id);
	}
	return proton_plus_widgets_preferences_language_row_language_type_id__once;
}

static void
_vala_proton_plus_widgets_preferences_language_row_language_get_property (GObject * object,
                                                                          guint property_id,
                                                                          GValue * value,
                                                                          GParamSpec * pspec)
{
	ProtonPlusWidgetsPreferencesLanguageRowLanguage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE, ProtonPlusWidgetsPreferencesLanguageRowLanguage);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_NAME_PROPERTY:
		g_value_set_string (value, proton_plus_widgets_preferences_language_row_language_get_name (self));
		break;
		case PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_INDEX_PROPERTY:
		g_value_set_int (value, proton_plus_widgets_preferences_language_row_language_get_index (self));
		break;
		case PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_CODE_PROPERTY:
		g_value_set_string (value, proton_plus_widgets_preferences_language_row_language_get_code (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_preferences_language_row_language_set_property (GObject * object,
                                                                          guint property_id,
                                                                          const GValue * value,
                                                                          GParamSpec * pspec)
{
	ProtonPlusWidgetsPreferencesLanguageRowLanguage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE, ProtonPlusWidgetsPreferencesLanguageRowLanguage);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_NAME_PROPERTY:
		proton_plus_widgets_preferences_language_row_language_set_name (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_INDEX_PROPERTY:
		proton_plus_widgets_preferences_language_row_language_set_index (self, g_value_get_int (value));
		break;
		case PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_LANGUAGE_CODE_PROPERTY:
		proton_plus_widgets_preferences_language_row_language_set_code (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ProtonPlusGlobalsLanguageItem_array_free (ProtonPlusGlobalsLanguageItem * array,
                                                gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			proton_plus_globals_language_item_destroy (&array[i]);
		}
	}
	g_free (array);
}

static void
_proton_plus_widgets_preferences_language_row_selected_item_changed_g_object_notify (GObject* _sender,
                                                                                     GParamSpec* pspec,
                                                                                     gpointer self)
{
	proton_plus_widgets_preferences_language_row_selected_item_changed ((ProtonPlusWidgetsPreferencesLanguageRow*) self);
}

static GObject *
proton_plus_widgets_preferences_language_row_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsPreferencesLanguageRow * self;
	GListStore* model = NULL;
	GListStore* _tmp0_;
	gint _tmp1_ = 0;
	ProtonPlusGlobalsLanguageItem* _tmp2_;
	GtkPropertyExpression* expression = NULL;
	GtkPropertyExpression* _tmp13_;
	GListStore* _tmp14_;
	GtkPropertyExpression* _tmp15_;
	GSettings* _tmp16_;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_preferences_language_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_LANGUAGE_ROW, ProtonPlusWidgetsPreferencesLanguageRow);
	_tmp0_ = g_list_store_new (PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE);
	model = _tmp0_;
	_tmp2_ = proton_plus_globals_LANGUAGES (&_tmp1_);
	{
		ProtonPlusGlobalsLanguageItem* lang_collection = NULL;
		gint lang_collection_length1 = 0;
		gint _lang_collection_size_ = 0;
		gint lang_it = 0;
		lang_collection = _tmp2_;
		lang_collection_length1 = _tmp1_;
		for (lang_it = 0; lang_it < lang_collection_length1; lang_it = lang_it + 1) {
			ProtonPlusGlobalsLanguageItem _tmp3_;
			ProtonPlusGlobalsLanguageItem _tmp4_ = {0};
			ProtonPlusGlobalsLanguageItem lang = {0};
			_tmp3_ = lang_collection[lang_it];
			proton_plus_globals_language_item_copy (&_tmp3_, &_tmp4_);
			lang = _tmp4_;
			{
				GListStore* _tmp5_;
				ProtonPlusGlobalsLanguageItem _tmp6_;
				const gchar* _tmp7_;
				ProtonPlusGlobalsLanguageItem _tmp8_;
				ProtonPlusGlobalsLanguageItem _tmp9_;
				const gchar* _tmp10_;
				ProtonPlusWidgetsPreferencesLanguageRowLanguage* _tmp11_;
				ProtonPlusWidgetsPreferencesLanguageRowLanguage* _tmp12_;
				_tmp5_ = model;
				_tmp6_ = lang;
				_tmp7_ = _tmp6_.name;
				_tmp8_ = lang;
				_tmp9_ = lang;
				_tmp10_ = _tmp9_.code;
				_tmp11_ = proton_plus_widgets_preferences_language_row_language_new (_ (_tmp7_), _tmp8_.index, _tmp10_);
				_tmp12_ = _tmp11_;
				g_list_store_append (_tmp5_, (GObject*) _tmp12_);
				_g_object_unref0 (_tmp12_);
				proton_plus_globals_language_item_destroy (&lang);
			}
		}
		lang_collection = (_vala_ProtonPlusGlobalsLanguageItem_array_free (lang_collection, lang_collection_length1), NULL);
	}
	_tmp13_ = (GtkPropertyExpression*) gtk_property_expression_new (PROTON_PLUS_WIDGETS_PREFERENCES_LANGUAGE_ROW_TYPE_LANGUAGE, NULL, "name");
	expression = _tmp13_;
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, _ ("Language"));
	_tmp14_ = model;
	adw_combo_row_set_model ((AdwComboRow*) self, (GListModel*) _tmp14_);
	_tmp15_ = expression;
	adw_combo_row_set_expression ((AdwComboRow*) self, (GtkExpression*) _tmp15_);
	_tmp16_ = proton_plus_globals_SETTINGS;
	if (_tmp16_ != NULL) {
		gint saved_enum_value = 0;
		GSettings* _tmp17_;
		_tmp17_ = proton_plus_globals_SETTINGS;
		saved_enum_value = g_settings_get_enum (_tmp17_, "language");
		{
			guint i = 0U;
			i = (guint) 0;
			{
				gboolean _tmp18_ = FALSE;
				_tmp18_ = TRUE;
				while (TRUE) {
					gint _tmp20_ = 0;
					ProtonPlusGlobalsLanguageItem* _tmp21_;
					ProtonPlusGlobalsLanguageItem* _tmp22_;
					gint _tmp22__length1;
					gboolean _tmp23_;
					gint _tmp24_ = 0;
					ProtonPlusGlobalsLanguageItem* _tmp25_;
					ProtonPlusGlobalsLanguageItem* _tmp26_;
					gint _tmp26__length1;
					ProtonPlusGlobalsLanguageItem _tmp27_;
					gboolean _tmp28_;
					if (!_tmp18_) {
						guint _tmp19_;
						_tmp19_ = i;
						i = _tmp19_ + 1;
					}
					_tmp18_ = FALSE;
					_tmp21_ = proton_plus_globals_LANGUAGES (&_tmp20_);
					_tmp22_ = _tmp21_;
					_tmp22__length1 = _tmp20_;
					_tmp23_ = !(i < ((guint) _tmp20_));
					_tmp22_ = (_vala_ProtonPlusGlobalsLanguageItem_array_free (_tmp22_, _tmp22__length1), NULL);
					if (_tmp23_) {
						break;
					}
					_tmp25_ = proton_plus_globals_LANGUAGES (&_tmp24_);
					_tmp26_ = _tmp25_;
					_tmp26__length1 = _tmp24_;
					_tmp27_ = _tmp26_[i];
					_tmp28_ = _tmp27_.index == saved_enum_value;
					_tmp26_ = (_vala_ProtonPlusGlobalsLanguageItem_array_free (_tmp26_, _tmp26__length1), NULL);
					if (_tmp28_) {
						adw_combo_row_set_selected ((AdwComboRow*) self, i);
						break;
					}
				}
			}
		}
	}
	g_signal_connect_object ((GObject*) self, "notify::selected-item", (GCallback) _proton_plus_widgets_preferences_language_row_selected_item_changed_g_object_notify, self, 0);
	self->priv->is_initializing = FALSE;
	_gtk_expression_unref0 (expression);
	_g_object_unref0 (model);
	return obj;
}

static void
proton_plus_widgets_preferences_language_row_class_init (ProtonPlusWidgetsPreferencesLanguageRowClass * klass,
                                                         gpointer klass_data)
{
	proton_plus_widgets_preferences_language_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsPreferencesLanguageRow_private_offset);
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_preferences_language_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_preferences_language_row_finalize;
}

static void
proton_plus_widgets_preferences_language_row_instance_init (ProtonPlusWidgetsPreferencesLanguageRow * self,
                                                            gpointer klass)
{
	self->priv = proton_plus_widgets_preferences_language_row_get_instance_private (self);
	self->priv->is_initializing = TRUE;
}

static void
proton_plus_widgets_preferences_language_row_finalize (GObject * obj)
{
	ProtonPlusWidgetsPreferencesLanguageRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_LANGUAGE_ROW, ProtonPlusWidgetsPreferencesLanguageRow);
	G_OBJECT_CLASS (proton_plus_widgets_preferences_language_row_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_preferences_language_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsPreferencesLanguageRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_preferences_language_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsPreferencesLanguageRow), 0, (GInstanceInitFunc) proton_plus_widgets_preferences_language_row_instance_init, NULL };
	GType proton_plus_widgets_preferences_language_row_type_id;
	proton_plus_widgets_preferences_language_row_type_id = g_type_register_static (adw_combo_row_get_type (), "ProtonPlusWidgetsPreferencesLanguageRow", &g_define_type_info, 0);
	ProtonPlusWidgetsPreferencesLanguageRow_private_offset = g_type_add_instance_private (proton_plus_widgets_preferences_language_row_type_id, sizeof (ProtonPlusWidgetsPreferencesLanguageRowPrivate));
	return proton_plus_widgets_preferences_language_row_type_id;
}

GType
proton_plus_widgets_preferences_language_row_get_type (void)
{
	static volatile gsize proton_plus_widgets_preferences_language_row_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_preferences_language_row_type_id__once)) {
		GType proton_plus_widgets_preferences_language_row_type_id;
		proton_plus_widgets_preferences_language_row_type_id = proton_plus_widgets_preferences_language_row_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_preferences_language_row_type_id__once, proton_plus_widgets_preferences_language_row_type_id);
	}
	return proton_plus_widgets_preferences_language_row_type_id__once;
}

