/* ConfigComboRow.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from ConfigComboRow.vala, do not modify */

/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*-
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: Michael Terry
 */

#include <adwaita.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include "deja.h"

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

#define TYPE_CONFIG_COMBO_ROW (config_combo_row_get_type ())
#define CONFIG_COMBO_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIG_COMBO_ROW, ConfigComboRow))
#define CONFIG_COMBO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIG_COMBO_ROW, ConfigComboRowClass))
#define IS_CONFIG_COMBO_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIG_COMBO_ROW))
#define IS_CONFIG_COMBO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIG_COMBO_ROW))
#define CONFIG_COMBO_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIG_COMBO_ROW, ConfigComboRowClass))

typedef struct _ConfigComboRow ConfigComboRow;
typedef struct _ConfigComboRowClass ConfigComboRowClass;
typedef struct _ConfigComboRowPrivate ConfigComboRowPrivate;
enum  {
	CONFIG_COMBO_ROW_0_PROPERTY,
	CONFIG_COMBO_ROW_NUM_PROPERTIES
};
static GParamSpec* config_combo_row_properties[CONFIG_COMBO_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define CONFIG_COMBO_ROW_TYPE_ITEM (config_combo_row_item_get_type ())
#define CONFIG_COMBO_ROW_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItem))
#define CONFIG_COMBO_ROW_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItemClass))
#define CONFIG_COMBO_ROW_IS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONFIG_COMBO_ROW_TYPE_ITEM))
#define CONFIG_COMBO_ROW_IS_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONFIG_COMBO_ROW_TYPE_ITEM))
#define CONFIG_COMBO_ROW_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItemClass))

typedef struct _ConfigComboRowItem ConfigComboRowItem;
typedef struct _ConfigComboRowItemClass ConfigComboRowItemClass;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ConfigComboRowItemPrivate ConfigComboRowItemPrivate;
enum  {
	CONFIG_COMBO_ROW_ITEM_0_PROPERTY,
	CONFIG_COMBO_ROW_ITEM_VAL_PROPERTY,
	CONFIG_COMBO_ROW_ITEM_LABEL_PROPERTY,
	CONFIG_COMBO_ROW_ITEM_NUM_PROPERTIES
};
static GParamSpec* config_combo_row_item_properties[CONFIG_COMBO_ROW_ITEM_NUM_PROPERTIES];
#define _gtk_expression_unref0(var) ((var == NULL) ? NULL : (var = (gtk_expression_unref (var), NULL)))

struct _ConfigComboRow {
	AdwComboRow parent_instance;
	ConfigComboRowPrivate * priv;
};

struct _ConfigComboRowClass {
	AdwComboRowClass parent_class;
	void (*fill_store) (ConfigComboRow* self);
	gchar* (*setting_name) (ConfigComboRow* self);
	gchar* (*label_for_value) (ConfigComboRow* self, gint val);
	gint (*clamp_value) (ConfigComboRow* self, gint val);
	gint (*compare_value) (ConfigComboRow* self, gint val);
};

struct _ConfigComboRowPrivate {
	GListStore* store;
};

struct _ConfigComboRowItem {
	GObject parent_instance;
	ConfigComboRowItemPrivate * priv;
};

struct _ConfigComboRowItemClass {
	GObjectClass parent_class;
};

struct _ConfigComboRowItemPrivate {
	gint _val;
	gchar* _label;
};

static gint ConfigComboRow_private_offset;
static gpointer config_combo_row_parent_class = NULL;
static gint ConfigComboRowItem_private_offset;
static gpointer config_combo_row_item_parent_class = NULL;

VALA_EXTERN GType config_combo_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigComboRow, g_object_unref)
VALA_EXTERN void config_combo_row_fill_store (ConfigComboRow* self);
VALA_EXTERN gchar* config_combo_row_setting_name (ConfigComboRow* self);
VALA_EXTERN gchar* config_combo_row_label_for_value (ConfigComboRow* self,
                                         gint val);
VALA_EXTERN gint config_combo_row_clamp_value (ConfigComboRow* self,
                                   gint val);
VALA_EXTERN gint config_combo_row_compare_value (ConfigComboRow* self,
                                     gint val);
static void config_combo_row_real_fill_store (ConfigComboRow* self);
static gchar* config_combo_row_real_setting_name (ConfigComboRow* self);
static gchar* config_combo_row_real_label_for_value (ConfigComboRow* self,
                                              gint val);
static gint config_combo_row_real_clamp_value (ConfigComboRow* self,
                                        gint val);
static gint config_combo_row_real_compare_value (ConfigComboRow* self,
                                          gint val);
VALA_EXTERN guint config_combo_row_add_item (ConfigComboRow* self,
                                 gint val,
                                 const gchar* label);
static ConfigComboRowItem* config_combo_row_item_new (gint val,
                                               const gchar* label);
static ConfigComboRowItem* config_combo_row_item_construct (GType object_type,
                                                     gint val,
                                                     const gchar* label);
static GType config_combo_row_item_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigComboRowItem, g_object_unref)
static gint __lambda22_ (ConfigComboRow* self,
                  GObject* a,
                  GObject* b);
static gint config_combo_row_item_cmp (gint a,
                                gint b);
static gint config_combo_row_item_get_val (ConfigComboRowItem* self);
static gint ___lambda22__gcompare_data_func (gconstpointer a,
                                      gconstpointer b,
                                      gpointer self);
static gboolean config_combo_row_get_mapping (GValue* val,
                                       GVariant* variant,
                                       void* data);
static gboolean config_combo_row_item_equal (GObject* a,
                                      GObject* b);
static GVariant* config_combo_row_set_mapping (GValue* val,
                                        const GVariantType* expected_type,
                                        void* data);
VALA_EXTERN ConfigComboRow* config_combo_row_construct (GType object_type);
static void config_combo_row_item_set_val (ConfigComboRowItem* self,
                                    gint value);
static const gchar* config_combo_row_item_get_label (ConfigComboRowItem* self);
static void config_combo_row_item_set_label (ConfigComboRowItem* self,
                                      const gchar* value);
static void config_combo_row_item_finalize (GObject * obj);
static GType config_combo_row_item_get_type_once (void);
static void _vala_config_combo_row_item_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_config_combo_row_item_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);
static GObject * config_combo_row_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties);
static gboolean _config_combo_row_get_mapping_gsettings_bind_get_mapping (GValue* value,
                                                                   GVariant* variant,
                                                                   void* user_data);
static GVariant* _config_combo_row_set_mapping_gsettings_bind_set_mapping (GValue* value,
                                                                    const GVariantType* expected_type,
                                                                    void* user_data);
static void _g_object_unref_gdestroy_notify (void* data);
static void config_combo_row_finalize (GObject * obj);
static GType config_combo_row_get_type_once (void);

static inline gpointer
config_combo_row_get_instance_private (ConfigComboRow* self)
{
	return G_STRUCT_MEMBER_P (self, ConfigComboRow_private_offset);
}

static void
config_combo_row_real_fill_store (ConfigComboRow* self)
{
}

void
config_combo_row_fill_store (ConfigComboRow* self)
{
	ConfigComboRowClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = CONFIG_COMBO_ROW_GET_CLASS (self);
	if (_klass_->fill_store) {
		_klass_->fill_store (self);
	}
}

static gchar*
config_combo_row_real_setting_name (ConfigComboRow* self)
{
	g_critical ("Type `%s' does not implement abstract method `config_combo_row_setting_name'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
config_combo_row_setting_name (ConfigComboRow* self)
{
	ConfigComboRowClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = CONFIG_COMBO_ROW_GET_CLASS (self);
	if (_klass_->setting_name) {
		return _klass_->setting_name (self);
	}
	return NULL;
}

static gchar*
config_combo_row_real_label_for_value (ConfigComboRow* self,
                                       gint val)
{
	g_critical ("Type `%s' does not implement abstract method `config_combo_row_label_for_value'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
config_combo_row_label_for_value (ConfigComboRow* self,
                                  gint val)
{
	ConfigComboRowClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = CONFIG_COMBO_ROW_GET_CLASS (self);
	if (_klass_->label_for_value) {
		return _klass_->label_for_value (self, val);
	}
	return NULL;
}

static gint
config_combo_row_real_clamp_value (ConfigComboRow* self,
                                   gint val)
{
	gint result;
	result = val;
	return result;
}

gint
config_combo_row_clamp_value (ConfigComboRow* self,
                              gint val)
{
	ConfigComboRowClass* _klass_;
	g_return_val_if_fail (self != NULL, 0);
	_klass_ = CONFIG_COMBO_ROW_GET_CLASS (self);
	if (_klass_->clamp_value) {
		return _klass_->clamp_value (self, val);
	}
	return -1;
}

static gint
config_combo_row_real_compare_value (ConfigComboRow* self,
                                     gint val)
{
	gint result;
	result = val;
	return result;
}

gint
config_combo_row_compare_value (ConfigComboRow* self,
                                gint val)
{
	ConfigComboRowClass* _klass_;
	g_return_val_if_fail (self != NULL, 0);
	_klass_ = CONFIG_COMBO_ROW_GET_CLASS (self);
	if (_klass_->compare_value) {
		return _klass_->compare_value (self, val);
	}
	return -1;
}

static gint
__lambda22_ (ConfigComboRow* self,
             GObject* a,
             GObject* b)
{
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint result;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = config_combo_row_item_get_val (G_TYPE_CHECK_INSTANCE_CAST (a, CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItem));
	_tmp1_ = _tmp0_;
	_tmp2_ = config_combo_row_item_get_val (G_TYPE_CHECK_INSTANCE_CAST (b, CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItem));
	_tmp3_ = _tmp2_;
	result = config_combo_row_item_cmp (config_combo_row_compare_value (self, _tmp1_), config_combo_row_compare_value (self, _tmp3_));
	return result;
}

static gint
___lambda22__gcompare_data_func (gconstpointer a,
                                 gconstpointer b,
                                 gpointer self)
{
	gint result;
	result = __lambda22_ ((ConfigComboRow*) self, (GObject*) a, (GObject*) b);
	return result;
}

guint
config_combo_row_add_item (ConfigComboRow* self,
                           gint val,
                           const gchar* label)
{
	GListStore* _tmp0_;
	ConfigComboRowItem* _tmp1_;
	ConfigComboRowItem* _tmp2_;
	guint _tmp3_;
	guint result;
	g_return_val_if_fail (self != NULL, 0U);
	g_return_val_if_fail (label != NULL, 0U);
	_tmp0_ = self->priv->store;
	_tmp1_ = config_combo_row_item_new (val, label);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_list_store_insert_sorted (_tmp0_, (GObject*) _tmp2_, ___lambda22__gcompare_data_func, self);
	_g_object_unref0 (_tmp2_);
	result = _tmp3_;
	return result;
}

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

static gboolean
config_combo_row_get_mapping (GValue* val,
                              GVariant* variant,
                              void* data)
{
	ConfigComboRow* choice = NULL;
	ConfigComboRow* _tmp0_;
	GListStore* store = NULL;
	ConfigComboRow* _tmp1_;
	GListStore* _tmp2_;
	GListStore* _tmp3_;
	gint clamped = 0;
	ConfigComboRow* _tmp4_;
	ConfigComboRowItem* needle = NULL;
	ConfigComboRowItem* _tmp5_;
	guint position = 0U;
	gboolean found = FALSE;
	GListStore* _tmp6_;
	ConfigComboRowItem* _tmp7_;
	guint _tmp8_ = 0U;
	gboolean _tmp9_;
	gboolean result;
	g_return_val_if_fail (val != NULL, FALSE);
	g_return_val_if_fail (variant != NULL, FALSE);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (data, TYPE_CONFIG_COMBO_ROW, ConfigComboRow));
	choice = _tmp0_;
	_tmp1_ = choice;
	_tmp2_ = _tmp1_->priv->store;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	store = _tmp3_;
	_tmp4_ = choice;
	clamped = config_combo_row_clamp_value (_tmp4_, (gint) g_variant_get_int32 (variant));
	_tmp5_ = config_combo_row_item_new (clamped, "");
	needle = _tmp5_;
	_tmp6_ = store;
	_tmp7_ = needle;
	_tmp9_ = g_list_store_find_with_equal_func (_tmp6_, (GObject*) _tmp7_, (GEqualFunc) config_combo_row_item_equal, &_tmp8_);
	position = _tmp8_;
	found = _tmp9_;
	if (!found) {
		ConfigComboRow* _tmp10_;
		ConfigComboRow* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		_tmp10_ = choice;
		_tmp11_ = choice;
		_tmp12_ = config_combo_row_label_for_value (_tmp11_, clamped);
		_tmp13_ = _tmp12_;
		position = config_combo_row_add_item (_tmp10_, clamped, _tmp13_);
		_g_free0 (_tmp13_);
	}
	g_value_set_uint (val, position);
	result = TRUE;
	_g_object_unref0 (needle);
	_g_object_unref0 (store);
	_g_object_unref0 (choice);
	return result;
}

static GVariant*
config_combo_row_set_mapping (GValue* val,
                              const GVariantType* expected_type,
                              void* data)
{
	GListStore* store = NULL;
	GListStore* _tmp0_;
	GListStore* _tmp1_;
	ConfigComboRowItem* item = NULL;
	GObject* _tmp2_;
	ConfigComboRowItem* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	GVariant* _tmp6_;
	GVariant* result;
	g_return_val_if_fail (val != NULL, NULL);
	g_return_val_if_fail (expected_type != NULL, NULL);
	_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (data, TYPE_CONFIG_COMBO_ROW, ConfigComboRow)->priv->store;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	store = _tmp1_;
	_tmp2_ = g_list_model_get_item ((GListModel*) store, g_value_get_uint (val));
	_tmp3_ = CONFIG_COMBO_ROW_IS_ITEM (_tmp2_) ? ((ConfigComboRowItem*) _tmp2_) : NULL;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (_tmp2_);
	}
	item = _tmp3_;
	_tmp4_ = config_combo_row_item_get_val (item);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_variant_new_int32 ((gint32) _tmp5_);
	g_variant_ref_sink (_tmp6_);
	result = _tmp6_;
	_g_object_unref0 (item);
	_g_object_unref0 (store);
	return result;
}

ConfigComboRow*
config_combo_row_construct (GType object_type)
{
	ConfigComboRow * self = NULL;
	self = (ConfigComboRow*) g_object_new (object_type, NULL);
	return self;
}

static inline gpointer
config_combo_row_item_get_instance_private (ConfigComboRowItem* self)
{
	return G_STRUCT_MEMBER_P (self, ConfigComboRowItem_private_offset);
}

static ConfigComboRowItem*
config_combo_row_item_construct (GType object_type,
                                 gint val,
                                 const gchar* label)
{
	ConfigComboRowItem * self = NULL;
	g_return_val_if_fail (label != NULL, NULL);
	self = (ConfigComboRowItem*) g_object_new (object_type, "val", val, "label", label, NULL);
	return self;
}

static ConfigComboRowItem*
config_combo_row_item_new (gint val,
                           const gchar* label)
{
	return config_combo_row_item_construct (CONFIG_COMBO_ROW_TYPE_ITEM, val, label);
}

static gboolean
config_combo_row_item_equal (GObject* a,
                             GObject* b)
{
	gint _tmp0_;
	gint _tmp1_;
	gboolean result;
	g_return_val_if_fail (a != NULL, FALSE);
	g_return_val_if_fail (b != NULL, FALSE);
	_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (a, CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItem)->priv->_val;
	_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST (b, CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItem)->priv->_val;
	result = _tmp0_ == _tmp1_;
	return result;
}

static gint
config_combo_row_item_cmp (gint a,
                           gint b)
{
	gint result;
	if (a > b) {
		result = 1;
		return result;
	}
	if (a < b) {
		result = -1;
		return result;
	}
	result = 0;
	return result;
}

static gint
config_combo_row_item_get_val (ConfigComboRowItem* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_val;
	return result;
}

static void
config_combo_row_item_set_val (ConfigComboRowItem* self,
                               gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = config_combo_row_item_get_val (self);
	if (old_value != value) {
		self->priv->_val = value;
		g_object_notify_by_pspec ((GObject *) self, config_combo_row_item_properties[CONFIG_COMBO_ROW_ITEM_VAL_PROPERTY]);
	}
}

static const gchar*
config_combo_row_item_get_label (ConfigComboRowItem* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_label;
	result = _tmp0_;
	return result;
}

static void
config_combo_row_item_set_label (ConfigComboRowItem* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = config_combo_row_item_get_label (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_label);
		self->priv->_label = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, config_combo_row_item_properties[CONFIG_COMBO_ROW_ITEM_LABEL_PROPERTY]);
	}
}

static void
config_combo_row_item_class_init (ConfigComboRowItemClass * klass,
                                  gpointer klass_data)
{
	config_combo_row_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConfigComboRowItem_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_config_combo_row_item_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_config_combo_row_item_set_property;
	G_OBJECT_CLASS (klass)->finalize = config_combo_row_item_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONFIG_COMBO_ROW_ITEM_VAL_PROPERTY, config_combo_row_item_properties[CONFIG_COMBO_ROW_ITEM_VAL_PROPERTY] = g_param_spec_int ("val", "val", "val", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONFIG_COMBO_ROW_ITEM_LABEL_PROPERTY, config_combo_row_item_properties[CONFIG_COMBO_ROW_ITEM_LABEL_PROPERTY] = g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
config_combo_row_item_instance_init (ConfigComboRowItem * self,
                                     gpointer klass)
{
	self->priv = config_combo_row_item_get_instance_private (self);
}

static void
config_combo_row_item_finalize (GObject * obj)
{
	ConfigComboRowItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItem);
	_g_free0 (self->priv->_label);
	G_OBJECT_CLASS (config_combo_row_item_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
config_combo_row_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConfigComboRowItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) config_combo_row_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConfigComboRowItem), 0, (GInstanceInitFunc) config_combo_row_item_instance_init, NULL };
	GType config_combo_row_item_type_id;
	config_combo_row_item_type_id = g_type_register_static (G_TYPE_OBJECT, "ConfigComboRowItem", &g_define_type_info, 0);
	ConfigComboRowItem_private_offset = g_type_add_instance_private (config_combo_row_item_type_id, sizeof (ConfigComboRowItemPrivate));
	return config_combo_row_item_type_id;
}

static GType
config_combo_row_item_get_type (void)
{
	static gsize config_combo_row_item_type_id__once = 0;
	if (g_once_init_enter (&config_combo_row_item_type_id__once)) {
		GType config_combo_row_item_type_id;
		config_combo_row_item_type_id = config_combo_row_item_get_type_once ();
		g_once_init_leave (&config_combo_row_item_type_id__once, config_combo_row_item_type_id);
	}
	return config_combo_row_item_type_id__once;
}

static void
_vala_config_combo_row_item_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	ConfigComboRowItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItem);
	switch (property_id) {
		case CONFIG_COMBO_ROW_ITEM_VAL_PROPERTY:
		g_value_set_int (value, config_combo_row_item_get_val (self));
		break;
		case CONFIG_COMBO_ROW_ITEM_LABEL_PROPERTY:
		g_value_set_string (value, config_combo_row_item_get_label (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_config_combo_row_item_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	ConfigComboRowItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONFIG_COMBO_ROW_TYPE_ITEM, ConfigComboRowItem);
	switch (property_id) {
		case CONFIG_COMBO_ROW_ITEM_VAL_PROPERTY:
		config_combo_row_item_set_val (self, g_value_get_int (value));
		break;
		case CONFIG_COMBO_ROW_ITEM_LABEL_PROPERTY:
		config_combo_row_item_set_label (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static gboolean
_config_combo_row_get_mapping_gsettings_bind_get_mapping (GValue* value,
                                                          GVariant* variant,
                                                          void* user_data)
{
	gboolean result;
	result = config_combo_row_get_mapping (value, variant, user_data);
	return result;
}

static GVariant*
_config_combo_row_set_mapping_gsettings_bind_set_mapping (GValue* value,
                                                          const GVariantType* expected_type,
                                                          void* user_data)
{
	GVariant* result;
	result = config_combo_row_set_mapping (value, expected_type, user_data);
	return result;
}

static void
_g_object_unref_gdestroy_notify (void* data)
{
	g_object_unref (data);
}

static GObject *
config_combo_row_constructor (GType type,
                              guint n_construct_properties,
                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ConfigComboRow * self;
	GListStore* _tmp0_;
	GtkPropertyExpression* _tmp1_;
	GtkPropertyExpression* _tmp2_;
	GListStore* _tmp3_;
	DejaDupFilteredSettings* settings = NULL;
	DejaDupFilteredSettings* _tmp4_;
	DejaDupFilteredSettings* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GObject* _tmp8_;
	parent_class = G_OBJECT_CLASS (config_combo_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CONFIG_COMBO_ROW, ConfigComboRow);
	_tmp0_ = g_list_store_new (CONFIG_COMBO_ROW_TYPE_ITEM);
	_g_object_unref0 (self->priv->store);
	self->priv->store = _tmp0_;
	config_combo_row_fill_store (self);
	_tmp1_ = (GtkPropertyExpression*) gtk_property_expression_new (CONFIG_COMBO_ROW_TYPE_ITEM, NULL, "label");
	_tmp2_ = _tmp1_;
	adw_combo_row_set_expression ((AdwComboRow*) self, (GtkExpression*) _tmp2_);
	_gtk_expression_unref0 (_tmp2_);
	_tmp3_ = self->priv->store;
	adw_combo_row_set_model ((AdwComboRow*) self, (GListModel*) _tmp3_);
	_tmp4_ = deja_dup_get_settings (NULL);
	settings = _tmp4_;
	_tmp5_ = settings;
	_tmp6_ = config_combo_row_setting_name (self);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_object_ref ((GObject*) self);
	g_settings_bind_with_mapping ((GSettings*) _tmp5_, _tmp7_, (GObject*) self, "selected", G_SETTINGS_BIND_DEFAULT, _config_combo_row_get_mapping_gsettings_bind_get_mapping, _config_combo_row_set_mapping_gsettings_bind_set_mapping, _tmp8_, _g_object_unref_gdestroy_notify);
	_g_free0 (_tmp7_);
	_g_object_unref0 (settings);
	return obj;
}

static void
config_combo_row_class_init (ConfigComboRowClass * klass,
                             gpointer klass_data)
{
	config_combo_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ConfigComboRow_private_offset);
	((ConfigComboRowClass *) klass)->fill_store = (void (*) (ConfigComboRow*)) config_combo_row_real_fill_store;
	((ConfigComboRowClass *) klass)->setting_name = (gchar* (*) (ConfigComboRow*)) config_combo_row_real_setting_name;
	((ConfigComboRowClass *) klass)->label_for_value = (gchar* (*) (ConfigComboRow*, gint)) config_combo_row_real_label_for_value;
	((ConfigComboRowClass *) klass)->clamp_value = (gint (*) (ConfigComboRow*, gint)) config_combo_row_real_clamp_value;
	((ConfigComboRowClass *) klass)->compare_value = (gint (*) (ConfigComboRow*, gint)) config_combo_row_real_compare_value;
	G_OBJECT_CLASS (klass)->constructor = config_combo_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = config_combo_row_finalize;
}

static void
config_combo_row_instance_init (ConfigComboRow * self,
                                gpointer klass)
{
	self->priv = config_combo_row_get_instance_private (self);
}

static void
config_combo_row_finalize (GObject * obj)
{
	ConfigComboRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CONFIG_COMBO_ROW, ConfigComboRow);
	_g_object_unref0 (self->priv->store);
	G_OBJECT_CLASS (config_combo_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
config_combo_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ConfigComboRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) config_combo_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ConfigComboRow), 0, (GInstanceInitFunc) config_combo_row_instance_init, NULL };
	GType config_combo_row_type_id;
	config_combo_row_type_id = g_type_register_static (adw_combo_row_get_type (), "ConfigComboRow", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	ConfigComboRow_private_offset = g_type_add_instance_private (config_combo_row_type_id, sizeof (ConfigComboRowPrivate));
	return config_combo_row_type_id;
}

GType
config_combo_row_get_type (void)
{
	static gsize config_combo_row_type_id__once = 0;
	if (g_once_init_enter (&config_combo_row_type_id__once)) {
		GType config_combo_row_type_id;
		config_combo_row_type_id = config_combo_row_get_type_once ();
		g_once_init_leave (&config_combo_row_type_id__once, config_combo_row_type_id);
	}
	return config_combo_row_type_id__once;
}

