/* proxy-mode-row.c generated by valac 0.56.19, the Vala compiler
 * generated from proxy-mode-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 <pango/pango.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_PROXY_MODE_ROW_0_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_preferences_proxy_mode_row_properties[PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_NUM_PROPERTIES];

#define PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE (proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_type ())
#define PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE, ProtonPlusWidgetsPreferencesProxyModeRowProxyMode))
#define PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE, ProtonPlusWidgetsPreferencesProxyModeRowProxyModeClass))
#define PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_IS_PROXY_MODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE))
#define PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_IS_PROXY_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE))
#define PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE, ProtonPlusWidgetsPreferencesProxyModeRowProxyModeClass))

typedef struct _ProtonPlusWidgetsPreferencesProxyModeRowProxyMode ProtonPlusWidgetsPreferencesProxyModeRowProxyMode;
typedef struct _ProtonPlusWidgetsPreferencesProxyModeRowProxyModeClass ProtonPlusWidgetsPreferencesProxyModeRowProxyModeClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ProtonPlusWidgetsPreferencesProxyModeRowProxyModePrivate ProtonPlusWidgetsPreferencesProxyModeRowProxyModePrivate;
enum  {
	PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_0_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_TITLE_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_MODE_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_properties[PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_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 _ProtonPlusWidgetsPreferencesProxyModeRowProxyMode {
	GObject parent_instance;
	ProtonPlusWidgetsPreferencesProxyModeRowProxyModePrivate * priv;
};

struct _ProtonPlusWidgetsPreferencesProxyModeRowProxyModeClass {
	GObjectClass parent_class;
};

struct _ProtonPlusWidgetsPreferencesProxyModeRowProxyModePrivate {
	gchar* _title;
	gint _mode;
};

static gpointer proton_plus_widgets_preferences_proxy_mode_row_parent_class = NULL;
static gint ProtonPlusWidgetsPreferencesProxyModeRowProxyMode_private_offset;
static gpointer proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_parent_class = NULL;

static void proton_plus_widgets_preferences_proxy_mode_row_selected_item_changed (ProtonPlusWidgetsPreferencesProxyModeRow* self);
static GType proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static gint proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_mode (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* self);
static void proton_plus_widgets_preferences_proxy_mode_row_factory_bind (ProtonPlusWidgetsPreferencesProxyModeRow* self,
                                                                  GObject* object);
static const gchar* proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_title (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* self);
static void proton_plus_widgets_preferences_proxy_mode_row_factory_setup (ProtonPlusWidgetsPreferencesProxyModeRow* self,
                                                                   GObject* object);
static ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_new (const gchar* title,
                                                                                                                  gint mode);
static ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_construct (GType object_type,
                                                                                                                        const gchar* title,
                                                                                                                        gint mode);
static void proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_title (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* self,
                                                                          const gchar* value);
static void proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_mode (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* self,
                                                                         gint value);
static void proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_finalize (GObject * obj);
static GType proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_type_once (void);
static void _vala_proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_property (GObject * object,
                                                                                   guint property_id,
                                                                                   GValue * value,
                                                                                   GParamSpec * pspec);
static void _vala_proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_property (GObject * object,
                                                                                   guint property_id,
                                                                                   const GValue * value,
                                                                                   GParamSpec * pspec);
static GObject * proton_plus_widgets_preferences_proxy_mode_row_constructor (GType type,
                                                                      guint n_construct_properties,
                                                                      GObjectConstructParam * construct_properties);
static void _proton_plus_widgets_preferences_proxy_mode_row_factory_setup_gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                                                                       GObject* object,
                                                                                                       gpointer self);
static void _proton_plus_widgets_preferences_proxy_mode_row_factory_bind_gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                                                                     GObject* object,
                                                                                                     gpointer self);
static void _proton_plus_widgets_preferences_proxy_mode_row_selected_item_changed_g_object_notify (GObject* _sender,
                                                                                            GParamSpec* pspec,
                                                                                            gpointer self);
static GType proton_plus_widgets_preferences_proxy_mode_row_get_type_once (void);

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

static void
proton_plus_widgets_preferences_proxy_mode_row_selected_item_changed (ProtonPlusWidgetsPreferencesProxyModeRow* self)
{
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* proxy_mode = NULL;
	GObject* _tmp0_;
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* _tmp1_;
	GSettings* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = adw_combo_row_get_selected_item ((AdwComboRow*) self);
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_IS_PROXY_MODE (_tmp0_) ? ((ProtonPlusWidgetsPreferencesProxyModeRowProxyMode*) _tmp0_) : NULL);
	proxy_mode = _tmp1_;
	_tmp2_ = proton_plus_globals_SETTINGS;
	if (_tmp2_ != NULL) {
		GSettings* _tmp3_;
		ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		_tmp3_ = proton_plus_globals_SETTINGS;
		_tmp4_ = proxy_mode;
		_tmp5_ = proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_mode (_tmp4_);
		_tmp6_ = _tmp5_;
		g_settings_set_enum (_tmp3_, "proxy-mode", _tmp6_);
	}
	_g_object_unref0 (proxy_mode);
}

static void
proton_plus_widgets_preferences_proxy_mode_row_factory_bind (ProtonPlusWidgetsPreferencesProxyModeRow* self,
                                                             GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* proxy_mode = NULL;
	GObject* _tmp1_;
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* _tmp2_;
	gconstpointer _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (object, gtk_list_item_get_type ()) ? ((GtkListItem*) object) : NULL);
	list_item = _tmp0_;
	_tmp1_ = gtk_list_item_get_item (list_item);
	_tmp2_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_IS_PROXY_MODE (_tmp1_) ? ((ProtonPlusWidgetsPreferencesProxyModeRowProxyMode*) _tmp1_) : NULL);
	proxy_mode = _tmp2_;
	_tmp3_ = g_object_get_data (object, "title");
	_tmp4_ = proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_title (proxy_mode);
	_tmp5_ = _tmp4_;
	gtk_label_set_label ((GtkLabel*) _tmp3_, _tmp5_);
	_g_object_unref0 (proxy_mode);
	_g_object_unref0 (list_item);
}

static void
proton_plus_widgets_preferences_proxy_mode_row_factory_setup (ProtonPlusWidgetsPreferencesProxyModeRow* self,
                                                              GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	GtkLabel* title_label = NULL;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (object != NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (object, gtk_list_item_get_type ()) ? ((GtkListItem*) object) : NULL);
	list_item = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp1_);
	title_label = _tmp1_;
	gtk_label_set_xalign (title_label, 0.0f);
	gtk_label_set_max_width_chars (title_label, 30);
	gtk_label_set_ellipsize (title_label, PANGO_ELLIPSIZE_END);
	gtk_widget_set_hexpand ((GtkWidget*) title_label, TRUE);
	_tmp2_ = _g_object_ref0 (title_label);
	g_object_set_data_full (object, "title", _tmp2_, g_object_unref);
	gtk_list_item_set_child (list_item, (GtkWidget*) title_label);
	_g_object_unref0 (title_label);
	_g_object_unref0 (list_item);
}

ProtonPlusWidgetsPreferencesProxyModeRow*
proton_plus_widgets_preferences_proxy_mode_row_construct (GType object_type)
{
	ProtonPlusWidgetsPreferencesProxyModeRow * self = NULL;
	self = (ProtonPlusWidgetsPreferencesProxyModeRow*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusWidgetsPreferencesProxyModeRow*
proton_plus_widgets_preferences_proxy_mode_row_new (void)
{
	return proton_plus_widgets_preferences_proxy_mode_row_construct (PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_PROXY_MODE_ROW);
}

static inline gpointer
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_instance_private (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsPreferencesProxyModeRowProxyMode_private_offset);
}

static ProtonPlusWidgetsPreferencesProxyModeRowProxyMode*
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_construct (GType object_type,
                                                                     const gchar* title,
                                                                     gint mode)
{
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode * self = NULL;
	g_return_val_if_fail (title != NULL, NULL);
	self = (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode*) g_object_new (object_type, NULL);
	proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_title (self, title);
	proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_mode (self, mode);
	return self;
}

static ProtonPlusWidgetsPreferencesProxyModeRowProxyMode*
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_new (const gchar* title,
                                                               gint mode)
{
	return proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_construct (PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE, title, mode);
}

static const gchar*
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_title (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

static void
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_title (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* self,
                                                                     const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_properties[PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_TITLE_PROPERTY]);
	}
}

static gint
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_mode (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_mode;
	return result;
}

static void
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_mode (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* self,
                                                                    gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_mode (self);
	if (old_value != value) {
		self->priv->_mode = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_properties[PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_MODE_PROPERTY]);
	}
}

static void
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_class_init (ProtonPlusWidgetsPreferencesProxyModeRowProxyModeClass * klass,
                                                                      gpointer klass_data)
{
	proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsPreferencesProxyModeRowProxyMode_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_TITLE_PROPERTY, proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_properties[PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_MODE_PROPERTY, proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_properties[PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_MODE_PROPERTY] = g_param_spec_int ("mode", "mode", "mode", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_instance_init (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode * self,
                                                                         gpointer klass)
{
	self->priv = proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_instance_private (self);
}

static void
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_finalize (GObject * obj)
{
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE, ProtonPlusWidgetsPreferencesProxyModeRowProxyMode);
	_g_free0 (self->priv->_title);
	G_OBJECT_CLASS (proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsPreferencesProxyModeRowProxyModeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsPreferencesProxyModeRowProxyMode), 0, (GInstanceInitFunc) proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_instance_init, NULL };
	GType proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id;
	proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusWidgetsPreferencesProxyModeRowProxyMode", &g_define_type_info, 0);
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode_private_offset = g_type_add_instance_private (proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id, sizeof (ProtonPlusWidgetsPreferencesProxyModeRowProxyModePrivate));
	return proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id;
}

static GType
proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_type (void)
{
	static volatile gsize proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id__once)) {
		GType proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id;
		proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id = proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id__once, proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id);
	}
	return proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_type_id__once;
}

static void
_vala_proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_property (GObject * object,
                                                                              guint property_id,
                                                                              GValue * value,
                                                                              GParamSpec * pspec)
{
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE, ProtonPlusWidgetsPreferencesProxyModeRowProxyMode);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_TITLE_PROPERTY:
		g_value_set_string (value, proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_title (self));
		break;
		case PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_MODE_PROPERTY:
		g_value_set_int (value, proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_get_mode (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_property (GObject * object,
                                                                              guint property_id,
                                                                              const GValue * value,
                                                                              GParamSpec * pspec)
{
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE, ProtonPlusWidgetsPreferencesProxyModeRowProxyMode);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_TITLE_PROPERTY:
		proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_title (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_PROXY_MODE_MODE_PROPERTY:
		proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_set_mode (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_proton_plus_widgets_preferences_proxy_mode_row_factory_setup_gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                                                                  GObject* object,
                                                                                                  gpointer self)
{
	proton_plus_widgets_preferences_proxy_mode_row_factory_setup ((ProtonPlusWidgetsPreferencesProxyModeRow*) self, object);
}

static void
_proton_plus_widgets_preferences_proxy_mode_row_factory_bind_gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                                                                GObject* object,
                                                                                                gpointer self)
{
	proton_plus_widgets_preferences_proxy_mode_row_factory_bind ((ProtonPlusWidgetsPreferencesProxyModeRow*) self, object);
}

static void
_proton_plus_widgets_preferences_proxy_mode_row_selected_item_changed_g_object_notify (GObject* _sender,
                                                                                       GParamSpec* pspec,
                                                                                       gpointer self)
{
	proton_plus_widgets_preferences_proxy_mode_row_selected_item_changed ((ProtonPlusWidgetsPreferencesProxyModeRow*) self);
}

static GObject *
proton_plus_widgets_preferences_proxy_mode_row_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsPreferencesProxyModeRow * self;
	GListStore* model = NULL;
	GListStore* _tmp0_;
	GListStore* _tmp1_;
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* _tmp2_;
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* _tmp3_;
	GListStore* _tmp4_;
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* _tmp5_;
	ProtonPlusWidgetsPreferencesProxyModeRowProxyMode* _tmp6_;
	GtkPropertyExpression* expression = NULL;
	GtkPropertyExpression* _tmp7_;
	GtkSignalListItemFactory* factory = NULL;
	GtkSignalListItemFactory* _tmp8_;
	GtkSignalListItemFactory* _tmp9_;
	GtkSignalListItemFactory* _tmp10_;
	GListStore* _tmp11_;
	GtkPropertyExpression* _tmp12_;
	GtkSignalListItemFactory* _tmp13_;
	GSettings* _tmp14_;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_preferences_proxy_mode_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_PROXY_MODE_ROW, ProtonPlusWidgetsPreferencesProxyModeRow);
	_tmp0_ = g_list_store_new (PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE);
	model = _tmp0_;
	_tmp1_ = model;
	_tmp2_ = proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_new (_ ("System proxy"), 0);
	_tmp3_ = _tmp2_;
	g_list_store_append (_tmp1_, (GObject*) _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = model;
	_tmp5_ = proton_plus_widgets_preferences_proxy_mode_row_proxy_mode_new (_ ("Manual proxy"), 1);
	_tmp6_ = _tmp5_;
	g_list_store_append (_tmp4_, (GObject*) _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = (GtkPropertyExpression*) gtk_property_expression_new (PROTON_PLUS_WIDGETS_PREFERENCES_PROXY_MODE_ROW_TYPE_PROXY_MODE, NULL, "title");
	expression = _tmp7_;
	_tmp8_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	factory = _tmp8_;
	_tmp9_ = factory;
	g_signal_connect_object (_tmp9_, "setup", (GCallback) _proton_plus_widgets_preferences_proxy_mode_row_factory_setup_gtk_signal_list_item_factory_setup, self, 0);
	_tmp10_ = factory;
	g_signal_connect_object (_tmp10_, "bind", (GCallback) _proton_plus_widgets_preferences_proxy_mode_row_factory_bind_gtk_signal_list_item_factory_bind, self, 0);
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, _ ("Proxy mode"));
	_tmp11_ = model;
	adw_combo_row_set_model ((AdwComboRow*) self, (GListModel*) _tmp11_);
	_tmp12_ = expression;
	adw_combo_row_set_expression ((AdwComboRow*) self, (GtkExpression*) _tmp12_);
	_tmp13_ = factory;
	adw_combo_row_set_list_factory ((AdwComboRow*) self, (GtkListItemFactory*) _tmp13_);
	_tmp14_ = proton_plus_globals_SETTINGS;
	if (_tmp14_ != NULL) {
		gint proxy_mode = 0;
		GSettings* _tmp15_;
		_tmp15_ = proton_plus_globals_SETTINGS;
		proxy_mode = g_settings_get_enum (_tmp15_, "proxy-mode");
		switch (proxy_mode) {
			case 0:
			{
				adw_combo_row_set_selected ((AdwComboRow*) self, (guint) 0);
				break;
			}
			case 1:
			{
				adw_combo_row_set_selected ((AdwComboRow*) self, (guint) 1);
				break;
			}
			default:
			break;
		}
	}
	g_signal_connect_object ((GObject*) self, "notify::selected-item", (GCallback) _proton_plus_widgets_preferences_proxy_mode_row_selected_item_changed_g_object_notify, self, 0);
	_g_object_unref0 (factory);
	_gtk_expression_unref0 (expression);
	_g_object_unref0 (model);
	return obj;
}

static void
proton_plus_widgets_preferences_proxy_mode_row_class_init (ProtonPlusWidgetsPreferencesProxyModeRowClass * klass,
                                                           gpointer klass_data)
{
	proton_plus_widgets_preferences_proxy_mode_row_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_preferences_proxy_mode_row_constructor;
}

static void
proton_plus_widgets_preferences_proxy_mode_row_instance_init (ProtonPlusWidgetsPreferencesProxyModeRow * self,
                                                              gpointer klass)
{
}

static GType
proton_plus_widgets_preferences_proxy_mode_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsPreferencesProxyModeRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_preferences_proxy_mode_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsPreferencesProxyModeRow), 0, (GInstanceInitFunc) proton_plus_widgets_preferences_proxy_mode_row_instance_init, NULL };
	GType proton_plus_widgets_preferences_proxy_mode_row_type_id;
	proton_plus_widgets_preferences_proxy_mode_row_type_id = g_type_register_static (adw_combo_row_get_type (), "ProtonPlusWidgetsPreferencesProxyModeRow", &g_define_type_info, 0);
	return proton_plus_widgets_preferences_proxy_mode_row_type_id;
}

GType
proton_plus_widgets_preferences_proxy_mode_row_get_type (void)
{
	static volatile gsize proton_plus_widgets_preferences_proxy_mode_row_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_preferences_proxy_mode_row_type_id__once)) {
		GType proton_plus_widgets_preferences_proxy_mode_row_type_id;
		proton_plus_widgets_preferences_proxy_mode_row_type_id = proton_plus_widgets_preferences_proxy_mode_row_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_preferences_proxy_mode_row_type_id__once, proton_plus_widgets_preferences_proxy_mode_row_type_id);
	}
	return proton_plus_widgets_preferences_proxy_mode_row_type_id__once;
}

