/* preferences-background-updates-frequency-row.c generated by valac 0.56.19, the Vala compiler
 * generated from preferences-background-updates-frequency-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_BACKGROUND_UPDATES_FREQUENCY_ROW_0_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_preferences_background_updates_frequency_row_properties[PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_NUM_PROPERTIES];

#define PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY (proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_type ())
#define PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY, ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency))
#define PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY, ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyClass))
#define PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_IS_FREQUENCY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY))
#define PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_IS_FREQUENCY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY))
#define PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY, ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyClass))

typedef struct _ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency;
typedef struct _ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyClass ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyPrivate ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyPrivate;
enum  {
	PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_0_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_TITLE_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_VALUE_PROPERTY,
	PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_preferences_background_updates_frequency_row_frequency_properties[PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_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 _ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency {
	GObject parent_instance;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyPrivate * priv;
};

struct _ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyClass {
	GObjectClass parent_class;
};

struct _ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyPrivate {
	gchar* _title;
	gint _value;
};

static gpointer proton_plus_widgets_preferences_background_updates_frequency_row_parent_class = NULL;
static gint ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency_private_offset;
static gpointer proton_plus_widgets_preferences_background_updates_frequency_row_frequency_parent_class = NULL;

static void proton_plus_widgets_preferences_background_updates_frequency_row_selected_item_changed (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* self);
static GType proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static gint proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_value (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* self);
static void proton_plus_widgets_preferences_background_updates_frequency_row_factory_bind (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* self,
                                                                                    GObject* object);
static const gchar* proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_title (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* self);
static void proton_plus_widgets_preferences_background_updates_frequency_row_factory_setup (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* self,
                                                                                     GObject* object);
static ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* proton_plus_widgets_preferences_background_updates_frequency_row_frequency_new (const gchar* title,
                                                                                                                                                    gint value);
static ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* proton_plus_widgets_preferences_background_updates_frequency_row_frequency_construct (GType object_type,
                                                                                                                                                          const gchar* title,
                                                                                                                                                          gint value);
static void proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_title (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* self,
                                                                                           const gchar* value);
static void proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_value (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* self,
                                                                                           gint value);
static void proton_plus_widgets_preferences_background_updates_frequency_row_frequency_finalize (GObject * obj);
static GType proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_type_once (void);
static void _vala_proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_property (GObject * object,
                                                                                                    guint property_id,
                                                                                                    GValue * value,
                                                                                                    GParamSpec * pspec);
static void _vala_proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_property (GObject * object,
                                                                                                    guint property_id,
                                                                                                    const GValue * value,
                                                                                                    GParamSpec * pspec);
static GObject * proton_plus_widgets_preferences_background_updates_frequency_row_constructor (GType type,
                                                                                        guint n_construct_properties,
                                                                                        GObjectConstructParam * construct_properties);
static void _proton_plus_widgets_preferences_background_updates_frequency_row_factory_setup_gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                                                                                         GObject* object,
                                                                                                                         gpointer self);
static void _proton_plus_widgets_preferences_background_updates_frequency_row_factory_bind_gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                                                                                       GObject* object,
                                                                                                                       gpointer self);
static void _proton_plus_widgets_preferences_background_updates_frequency_row_selected_item_changed_g_object_notify (GObject* _sender,
                                                                                                              GParamSpec* pspec,
                                                                                                              gpointer self);
static GType proton_plus_widgets_preferences_background_updates_frequency_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_background_updates_frequency_row_selected_item_changed (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* self)
{
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* frequency = NULL;
	GObject* _tmp0_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GSettings* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = adw_combo_row_get_selected_item ((AdwComboRow*) self);
	_tmp1_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_IS_FREQUENCY (_tmp0_) ? ((ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency*) _tmp0_) : NULL);
	frequency = _tmp1_;
	_tmp3_ = proton_plus_globals_SETTINGS;
	if (_tmp3_ != NULL) {
		ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp4_;
		_tmp4_ = frequency;
		_tmp2_ = _tmp4_ != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GSettings* _tmp5_;
		ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		_tmp5_ = proton_plus_globals_SETTINGS;
		_tmp6_ = frequency;
		_tmp7_ = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_value (_tmp6_);
		_tmp8_ = _tmp7_;
		g_settings_set_enum (_tmp5_, "background-updates-frequency", _tmp8_);
	}
	_g_object_unref0 (frequency);
}

static void
proton_plus_widgets_preferences_background_updates_frequency_row_factory_bind (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* self,
                                                                               GObject* object)
{
	GtkListItem* list_item = NULL;
	GtkListItem* _tmp0_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* frequency = NULL;
	GtkListItem* _tmp1_;
	GObject* _tmp2_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp3_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp4_;
	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_ = list_item;
	_tmp2_ = gtk_list_item_get_item (_tmp1_);
	_tmp3_ = _g_object_ref0 (PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_IS_FREQUENCY (_tmp2_) ? ((ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency*) _tmp2_) : NULL);
	frequency = _tmp3_;
	_tmp4_ = frequency;
	if (_tmp4_ != NULL) {
		gconstpointer _tmp5_;
		ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp5_ = g_object_get_data (object, "title");
		_tmp6_ = frequency;
		_tmp7_ = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_title (_tmp6_);
		_tmp8_ = _tmp7_;
		gtk_label_set_label ((GtkLabel*) _tmp5_, _tmp8_);
	}
	_g_object_unref0 (frequency);
	_g_object_unref0 (list_item);
}

static void
proton_plus_widgets_preferences_background_updates_frequency_row_factory_setup (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow* 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);
}

ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow*
proton_plus_widgets_preferences_background_updates_frequency_row_construct (GType object_type)
{
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow * self = NULL;
	self = (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow*
proton_plus_widgets_preferences_background_updates_frequency_row_new (void)
{
	return proton_plus_widgets_preferences_background_updates_frequency_row_construct (PROTON_PLUS_WIDGETS_PREFERENCES_TYPE_BACKGROUND_UPDATES_FREQUENCY_ROW);
}

static inline gpointer
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_instance_private (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency_private_offset);
}

static ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency*
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_construct (GType object_type,
                                                                                      const gchar* title,
                                                                                      gint value)
{
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency * self = NULL;
	g_return_val_if_fail (title != NULL, NULL);
	self = (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency*) g_object_new (object_type, NULL);
	proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_title (self, title);
	proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_value (self, value);
	return self;
}

static ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency*
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_new (const gchar* title,
                                                                                gint value)
{
	return proton_plus_widgets_preferences_background_updates_frequency_row_frequency_construct (PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY, title, value);
}

static const gchar*
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_title (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* 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_background_updates_frequency_row_frequency_set_title (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* self,
                                                                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_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_background_updates_frequency_row_frequency_properties[PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_TITLE_PROPERTY]);
	}
}

static gint
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_value (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_value;
	return result;
}

static void
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_value (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* self,
                                                                                      gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_value (self);
	if (old_value != value) {
		self->priv->_value = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_widgets_preferences_background_updates_frequency_row_frequency_properties[PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_VALUE_PROPERTY]);
	}
}

static void
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_class_init (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyClass * klass,
                                                                                       gpointer klass_data)
{
	proton_plus_widgets_preferences_background_updates_frequency_row_frequency_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_TITLE_PROPERTY, proton_plus_widgets_preferences_background_updates_frequency_row_frequency_properties[PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_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_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_VALUE_PROPERTY, proton_plus_widgets_preferences_background_updates_frequency_row_frequency_properties[PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_VALUE_PROPERTY] = g_param_spec_int ("value", "value", "value", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_instance_init (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency * self,
                                                                                          gpointer klass)
{
	self->priv = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_instance_private (self);
}

static void
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_finalize (GObject * obj)
{
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY, ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency);
	_g_free0 (self->priv->_title);
	G_OBJECT_CLASS (proton_plus_widgets_preferences_background_updates_frequency_row_frequency_parent_class)->finalize (obj);
}

static GType
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_preferences_background_updates_frequency_row_frequency_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency), 0, (GInstanceInitFunc) proton_plus_widgets_preferences_background_updates_frequency_row_frequency_instance_init, NULL };
	GType proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id;
	proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency", &g_define_type_info, 0);
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency_private_offset = g_type_add_instance_private (proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id, sizeof (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequencyPrivate));
	return proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id;
}

static GType
proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_type (void)
{
	static volatile gsize proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id__once)) {
		GType proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id;
		proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id__once, proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id);
	}
	return proton_plus_widgets_preferences_background_updates_frequency_row_frequency_type_id__once;
}

static void
_vala_proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_property (GObject * object,
                                                                                               guint property_id,
                                                                                               GValue * value,
                                                                                               GParamSpec * pspec)
{
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY, ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_TITLE_PROPERTY:
		g_value_set_string (value, proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_title (self));
		break;
		case PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_VALUE_PROPERTY:
		g_value_set_int (value, proton_plus_widgets_preferences_background_updates_frequency_row_frequency_get_value (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_property (GObject * object,
                                                                                               guint property_id,
                                                                                               const GValue * value,
                                                                                               GParamSpec * pspec)
{
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY, ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency);
	switch (property_id) {
		case PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_TITLE_PROPERTY:
		proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_title (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_FREQUENCY_VALUE_PROPERTY:
		proton_plus_widgets_preferences_background_updates_frequency_row_frequency_set_value (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_background_updates_frequency_row_factory_setup_gtk_signal_list_item_factory_setup (GtkSignalListItemFactory* _sender,
                                                                                                                    GObject* object,
                                                                                                                    gpointer self)
{
	proton_plus_widgets_preferences_background_updates_frequency_row_factory_setup ((ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow*) self, object);
}

static void
_proton_plus_widgets_preferences_background_updates_frequency_row_factory_bind_gtk_signal_list_item_factory_bind (GtkSignalListItemFactory* _sender,
                                                                                                                  GObject* object,
                                                                                                                  gpointer self)
{
	proton_plus_widgets_preferences_background_updates_frequency_row_factory_bind ((ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow*) self, object);
}

static void
_proton_plus_widgets_preferences_background_updates_frequency_row_selected_item_changed_g_object_notify (GObject* _sender,
                                                                                                         GParamSpec* pspec,
                                                                                                         gpointer self)
{
	proton_plus_widgets_preferences_background_updates_frequency_row_selected_item_changed ((ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow*) self);
}

static GObject *
proton_plus_widgets_preferences_background_updates_frequency_row_constructor (GType type,
                                                                              guint n_construct_properties,
                                                                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow * self;
	GListStore* model = NULL;
	GListStore* _tmp0_;
	GListStore* _tmp1_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp2_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp3_;
	GListStore* _tmp4_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp5_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp6_;
	GListStore* _tmp7_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp8_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp9_;
	GListStore* _tmp10_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp11_;
	ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowFrequency* _tmp12_;
	GtkPropertyExpression* expression = NULL;
	GtkPropertyExpression* _tmp13_;
	GtkSignalListItemFactory* factory = NULL;
	GtkSignalListItemFactory* _tmp14_;
	GtkSignalListItemFactory* _tmp15_;
	GtkSignalListItemFactory* _tmp16_;
	GListStore* _tmp17_;
	GtkPropertyExpression* _tmp18_;
	GtkSignalListItemFactory* _tmp19_;
	gint frequency = 0;
	GSettings* _tmp20_;
	parent_class = G_OBJECT_CLASS (proton_plus_widgets_preferences_background_updates_frequency_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_BACKGROUND_UPDATES_FREQUENCY_ROW, ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow);
	_tmp0_ = g_list_store_new (PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY);
	model = _tmp0_;
	_tmp1_ = model;
	_tmp2_ = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_new (_ ("1h"), 0);
	_tmp3_ = _tmp2_;
	g_list_store_append (_tmp1_, (GObject*) _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = model;
	_tmp5_ = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_new (_ ("3h"), 1);
	_tmp6_ = _tmp5_;
	g_list_store_append (_tmp4_, (GObject*) _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = model;
	_tmp8_ = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_new (_ ("6h"), 2);
	_tmp9_ = _tmp8_;
	g_list_store_append (_tmp7_, (GObject*) _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = model;
	_tmp11_ = proton_plus_widgets_preferences_background_updates_frequency_row_frequency_new (_ ("12h"), 3);
	_tmp12_ = _tmp11_;
	g_list_store_append (_tmp10_, (GObject*) _tmp12_);
	_g_object_unref0 (_tmp12_);
	_tmp13_ = (GtkPropertyExpression*) gtk_property_expression_new (PROTON_PLUS_WIDGETS_PREFERENCES_BACKGROUND_UPDATES_FREQUENCY_ROW_TYPE_FREQUENCY, NULL, "title");
	expression = _tmp13_;
	_tmp14_ = (GtkSignalListItemFactory*) gtk_signal_list_item_factory_new ();
	factory = _tmp14_;
	_tmp15_ = factory;
	g_signal_connect_object (_tmp15_, "setup", (GCallback) _proton_plus_widgets_preferences_background_updates_frequency_row_factory_setup_gtk_signal_list_item_factory_setup, self, 0);
	_tmp16_ = factory;
	g_signal_connect_object (_tmp16_, "bind", (GCallback) _proton_plus_widgets_preferences_background_updates_frequency_row_factory_bind_gtk_signal_list_item_factory_bind, self, 0);
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, _ ("Update frequency"));
	_tmp17_ = model;
	adw_combo_row_set_model ((AdwComboRow*) self, (GListModel*) _tmp17_);
	_tmp18_ = expression;
	adw_combo_row_set_expression ((AdwComboRow*) self, (GtkExpression*) _tmp18_);
	_tmp19_ = factory;
	adw_combo_row_set_list_factory ((AdwComboRow*) self, (GtkListItemFactory*) _tmp19_);
	_tmp20_ = proton_plus_globals_SETTINGS;
	frequency = g_settings_get_enum (_tmp20_, "background-updates-frequency");
	adw_combo_row_set_selected ((AdwComboRow*) self, (guint) frequency);
	g_signal_connect_object ((GObject*) self, "notify::selected-item", (GCallback) _proton_plus_widgets_preferences_background_updates_frequency_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_background_updates_frequency_row_class_init (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowClass * klass,
                                                                             gpointer klass_data)
{
	proton_plus_widgets_preferences_background_updates_frequency_row_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = proton_plus_widgets_preferences_background_updates_frequency_row_constructor;
}

static void
proton_plus_widgets_preferences_background_updates_frequency_row_instance_init (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow * self,
                                                                                gpointer klass)
{
}

static GType
proton_plus_widgets_preferences_background_updates_frequency_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_preferences_background_updates_frequency_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow), 0, (GInstanceInitFunc) proton_plus_widgets_preferences_background_updates_frequency_row_instance_init, NULL };
	GType proton_plus_widgets_preferences_background_updates_frequency_row_type_id;
	proton_plus_widgets_preferences_background_updates_frequency_row_type_id = g_type_register_static (adw_combo_row_get_type (), "ProtonPlusWidgetsPreferencesBackgroundUpdatesFrequencyRow", &g_define_type_info, 0);
	return proton_plus_widgets_preferences_background_updates_frequency_row_type_id;
}

GType
proton_plus_widgets_preferences_background_updates_frequency_row_get_type (void)
{
	static volatile gsize proton_plus_widgets_preferences_background_updates_frequency_row_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_preferences_background_updates_frequency_row_type_id__once)) {
		GType proton_plus_widgets_preferences_background_updates_frequency_row_type_id;
		proton_plus_widgets_preferences_background_updates_frequency_row_type_id = proton_plus_widgets_preferences_background_updates_frequency_row_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_preferences_background_updates_frequency_row_type_id__once, proton_plus_widgets_preferences_background_updates_frequency_row_type_id);
	}
	return proton_plus_widgets_preferences_background_updates_frequency_row_type_id__once;
}

