/* i-properties-provider.c generated by valac 0.17.7, the Vala compiler
 * generated from i-properties-provider.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <libcommon.h>
#include <float.h>
#include <math.h>
#include <osinfo/osinfo.h>


#define BOXES_TYPE_PROPERTY (boxes_property_get_type ())
#define BOXES_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PROPERTY, BoxesProperty))
#define BOXES_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PROPERTY, BoxesPropertyClass))
#define BOXES_IS_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PROPERTY))
#define BOXES_IS_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PROPERTY))
#define BOXES_PROPERTY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PROPERTY, BoxesPropertyClass))

typedef struct _BoxesProperty BoxesProperty;
typedef struct _BoxesPropertyClass BoxesPropertyClass;
typedef struct _BoxesPropertyPrivate BoxesPropertyPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_IPROPERTIES_PROVIDER (boxes_iproperties_provider_get_type ())
#define BOXES_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProvider))
#define BOXES_IS_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER))
#define BOXES_IPROPERTIES_PROVIDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProviderIface))

typedef struct _BoxesIPropertiesProvider BoxesIPropertiesProvider;
typedef struct _BoxesIPropertiesProviderIface BoxesIPropertiesProviderIface;

#define BOXES_TYPE_PROPERTIES_PAGE (boxes_properties_page_get_type ())

#define BOXES_TYPE_EDITABLE_ENTRY (boxes_editable_entry_get_type ())
#define BOXES_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_EDITABLE_ENTRY, BoxesEditableEntry))
#define BOXES_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_EDITABLE_ENTRY, BoxesEditableEntryClass))
#define BOXES_IS_EDITABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_EDITABLE_ENTRY))
#define BOXES_IS_EDITABLE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_EDITABLE_ENTRY))
#define BOXES_EDITABLE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_EDITABLE_ENTRY, BoxesEditableEntryClass))

typedef struct _BoxesEditableEntry BoxesEditableEntry;
typedef struct _BoxesEditableEntryClass BoxesEditableEntryClass;
typedef struct _Block11Data Block11Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block12Data Block12Data;

struct _BoxesProperty {
	GObject parent_instance;
	BoxesPropertyPrivate * priv;
};

struct _BoxesPropertyClass {
	GObjectClass parent_class;
};

struct _BoxesPropertyPrivate {
	gchar* _description;
	GtkWidget* _widget;
	gboolean _reboot_required;
	guint _defer_interval;
	guint deferred_change_id;
	GSourceFunc _deferred_change;
	gpointer _deferred_change_target;
	GDestroyNotify _deferred_change_target_destroy_notify;
};

typedef void (*PropertyStringChanged) (BoxesProperty* property, const gchar* value, void* user_data, GError** error);
typedef void (*PropertySizeChanged) (BoxesProperty* property, guint64 value, void* user_data, GError** error);
typedef enum  {
	BOXES_PROPERTIES_PAGE_LOGIN,
	BOXES_PROPERTIES_PAGE_SYSTEM,
	BOXES_PROPERTIES_PAGE_DISPLAY,
	BOXES_PROPERTIES_PAGE_DEVICES,
	BOXES_PROPERTIES_PAGE_LAST
} BoxesPropertiesPage;

struct _BoxesIPropertiesProviderIface {
	GTypeInterface parent_iface;
	GList* (*get_properties) (BoxesIPropertiesProvider* self, BoxesPropertiesPage page);
};

struct _Block11Data {
	int _ref_count_;
	BoxesIPropertiesProvider * self;
	BoxesEditableEntry* entry;
	BoxesProperty* property;
	PropertyStringChanged changed;
	gpointer changed_target;
};

struct _Block12Data {
	int _ref_count_;
	BoxesIPropertiesProvider * self;
	GtkHScale* scale;
	BoxesProperty* property;
	PropertySizeChanged changed;
	gpointer changed_target;
};


static gpointer boxes_property_parent_class = NULL;

GType boxes_property_get_type (void) G_GNUC_CONST;
#define BOXES_PROPERTY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_PROPERTY, BoxesPropertyPrivate))
enum  {
	BOXES_PROPERTY_DUMMY_PROPERTY,
	BOXES_PROPERTY_DESCRIPTION,
	BOXES_PROPERTY_WIDGET,
	BOXES_PROPERTY_REBOOT_REQUIRED,
	BOXES_PROPERTY_DEFER_INTERVAL
};
BoxesProperty* boxes_property_new (const gchar* description, GtkWidget* widget);
BoxesProperty* boxes_property_construct (GType object_type, const gchar* description, GtkWidget* widget);
void boxes_property_flush (BoxesProperty* self);
GSourceFunc boxes_property_get_deferred_change (BoxesProperty* self, gpointer* result_target);
void boxes_property_set_deferred_change (BoxesProperty* self, GSourceFunc value, gpointer value_target, GDestroyNotify value_target_destroy_notify);
const gchar* boxes_property_get_description (BoxesProperty* self);
void boxes_property_set_description (BoxesProperty* self, const gchar* value);
GtkWidget* boxes_property_get_widget (BoxesProperty* self);
void boxes_property_set_widget (BoxesProperty* self, GtkWidget* value);
gboolean boxes_property_get_reboot_required (BoxesProperty* self);
void boxes_property_set_reboot_required (BoxesProperty* self, gboolean value);
guint boxes_property_get_defer_interval (BoxesProperty* self);
void boxes_property_set_defer_interval (BoxesProperty* self, guint value);
static gboolean _boxes_property_deferred_change___lambda12_ (BoxesProperty* self);
static gboolean __boxes_property_deferred_change___lambda12__gsource_func (gpointer self);
static void boxes_property_finalize (GObject* obj);
static void _vala_boxes_property_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_property_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
GType boxes_properties_page_get_type (void) G_GNUC_CONST;
GType boxes_iproperties_provider_get_type (void) G_GNUC_CONST;
GList* boxes_iproperties_provider_get_properties (BoxesIPropertiesProvider* self, BoxesPropertiesPage page);
BoxesProperty* boxes_iproperties_provider_add_property (BoxesIPropertiesProvider* self, GList** list, const gchar* name, GtkWidget* widget);
BoxesProperty* boxes_iproperties_provider_add_string_property (BoxesIPropertiesProvider* self, GList** list, const gchar* name, const gchar* value, PropertyStringChanged changed, void* changed_target);
GType boxes_editable_entry_get_type (void) G_GNUC_CONST;
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
BoxesEditableEntry* boxes_editable_entry_new (void);
BoxesEditableEntry* boxes_editable_entry_construct (GType object_type);
void boxes_editable_entry_set_text (BoxesEditableEntry* self, const gchar* value);
void boxes_editable_entry_set_selectable (BoxesEditableEntry* self, gboolean value);
void boxes_editable_entry_set_editable (BoxesEditableEntry* self, gboolean value);
static void __lambda19_ (Block11Data* _data11_);
const gchar* boxes_editable_entry_get_text (BoxesEditableEntry* self);
void boxes_editable_entry_start_editing (BoxesEditableEntry* self);
static void ___lambda19__boxes_editable_entry_editing_done (BoxesEditableEntry* _sender, gpointer self);
BoxesProperty* boxes_iproperties_provider_add_size_property (BoxesIPropertiesProvider* self, GList** list, const gchar* name, guint64 size, guint64 min, guint64 max, guint64 step, PropertySizeChanged changed, void* changed_target);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
static gchar* __lambda20_ (BoxesIPropertiesProvider* self, GtkScale* scale, gdouble value);
static gchar* ___lambda20__gtk_scale_format_value (GtkScale* _sender, gdouble value, gpointer self);
static void ___lambda21_ (Block12Data* _data12_);
static void ____lambda21__gtk_range_value_changed (GtkRange* _sender, gpointer self);


BoxesProperty* boxes_property_construct (GType object_type, const gchar* description, GtkWidget* widget) {
	BoxesProperty * self = NULL;
	const gchar* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_val_if_fail (description != NULL, NULL);
	g_return_val_if_fail (widget != NULL, NULL);
	_tmp0_ = description;
	_tmp1_ = widget;
	self = (BoxesProperty*) g_object_new (object_type, "description", _tmp0_, "widget", _tmp1_, NULL);
	return self;
}


BoxesProperty* boxes_property_new (const gchar* description, GtkWidget* widget) {
	return boxes_property_construct (BOXES_TYPE_PROPERTY, description, widget);
}


void boxes_property_flush (BoxesProperty* self) {
	GSourceFunc _tmp0_;
	void* _tmp0__target;
	GSourceFunc _tmp1_;
	void* _tmp1__target;
	GSourceFunc _tmp2_;
	void* _tmp2__target;
	GSourceFunc _tmp3_;
	void* _tmp3__target;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_property_get_deferred_change (self, &_tmp0__target);
	_tmp1_ = _tmp0_;
	_tmp1__target = _tmp0__target;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = boxes_property_get_deferred_change (self, &_tmp2__target);
	_tmp3_ = _tmp2_;
	_tmp3__target = _tmp2__target;
	_tmp3_ (_tmp3__target);
	boxes_property_set_deferred_change (self, NULL, NULL, NULL);
}


const gchar* boxes_property_get_description (BoxesProperty* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_description;
	result = _tmp0_;
	return result;
}


void boxes_property_set_description (BoxesProperty* self, const gchar* value) {
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_description);
	self->priv->_description = _tmp1_;
	g_object_notify ((GObject *) self, "description");
}


GtkWidget* boxes_property_get_widget (BoxesProperty* self) {
	GtkWidget* result;
	GtkWidget* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_widget;
	result = _tmp0_;
	return result;
}


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


void boxes_property_set_widget (BoxesProperty* self, GtkWidget* value) {
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_widget);
	self->priv->_widget = _tmp1_;
	g_object_notify ((GObject *) self, "widget");
}


gboolean boxes_property_get_reboot_required (BoxesProperty* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_reboot_required;
	result = _tmp0_;
	return result;
}


void boxes_property_set_reboot_required (BoxesProperty* self, gboolean value) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_reboot_required = _tmp0_;
	g_object_notify ((GObject *) self, "reboot-required");
}


guint boxes_property_get_defer_interval (BoxesProperty* self) {
	guint result;
	guint _tmp0_;
	g_return_val_if_fail (self != NULL, 0U);
	_tmp0_ = self->priv->_defer_interval;
	result = _tmp0_;
	return result;
}


void boxes_property_set_defer_interval (BoxesProperty* self, guint value) {
	guint _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_defer_interval = _tmp0_;
	g_object_notify ((GObject *) self, "defer-interval");
}


GSourceFunc boxes_property_get_deferred_change (BoxesProperty* self, gpointer* result_target) {
	GSourceFunc result;
	GSourceFunc _tmp0_;
	void* _tmp0__target;
	GSourceFunc _tmp1_;
	void* _tmp1__target;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_deferred_change;
	_tmp0__target = self->priv->_deferred_change_target;
	_tmp1_ = _tmp0_;
	_tmp1__target = _tmp0__target;
	*result_target = _tmp1__target;
	result = _tmp1_;
	return result;
}


static gboolean _boxes_property_deferred_change___lambda12_ (BoxesProperty* self) {
	gboolean result = FALSE;
	boxes_property_flush (self);
	result = FALSE;
	return result;
}


static gboolean __boxes_property_deferred_change___lambda12__gsource_func (gpointer self) {
	gboolean result;
	result = _boxes_property_deferred_change___lambda12_ (self);
	return result;
}


void boxes_property_set_deferred_change (BoxesProperty* self, GSourceFunc value, gpointer value_target, GDestroyNotify value_target_destroy_notify) {
	guint _tmp0_;
	GSourceFunc _tmp2_;
	void* _tmp2__target;
	GDestroyNotify _tmp2__target_destroy_notify;
	GSourceFunc _tmp3_;
	void* _tmp3__target;
	guint _tmp4_;
	guint _tmp5_ = 0U;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->deferred_change_id;
	if (_tmp0_ != ((guint) 0)) {
		guint _tmp1_;
		_tmp1_ = self->priv->deferred_change_id;
		g_source_remove (_tmp1_);
		self->priv->deferred_change_id = (guint) 0;
	}
	_tmp2_ = value;
	_tmp2__target = value_target;
	_tmp2__target_destroy_notify = value_target_destroy_notify;
	value_target_destroy_notify = NULL;
	(self->priv->_deferred_change_target_destroy_notify == NULL) ? NULL : (self->priv->_deferred_change_target_destroy_notify (self->priv->_deferred_change_target), NULL);
	self->priv->_deferred_change = NULL;
	self->priv->_deferred_change_target = NULL;
	self->priv->_deferred_change_target_destroy_notify = NULL;
	self->priv->_deferred_change = _tmp2_;
	self->priv->_deferred_change_target = _tmp2__target;
	self->priv->_deferred_change_target_destroy_notify = _tmp2__target_destroy_notify;
	_tmp3_ = self->priv->_deferred_change;
	_tmp3__target = self->priv->_deferred_change_target;
	if (_tmp3_ == NULL) {
		(value_target_destroy_notify == NULL) ? NULL : (value_target_destroy_notify (value_target), NULL);
		value = NULL;
		value_target = NULL;
		value_target_destroy_notify = NULL;
		return;
	}
	_tmp4_ = self->priv->_defer_interval;
	_tmp5_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, _tmp4_, __boxes_property_deferred_change___lambda12__gsource_func, g_object_ref (self), g_object_unref);
	self->priv->deferred_change_id = _tmp5_;
	(value_target_destroy_notify == NULL) ? NULL : (value_target_destroy_notify (value_target), NULL);
	value = NULL;
	value_target = NULL;
	value_target_destroy_notify = NULL;
}


static void boxes_property_class_init (BoxesPropertyClass * klass) {
	boxes_property_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesPropertyPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_property_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_property_set_property;
	G_OBJECT_CLASS (klass)->finalize = boxes_property_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_PROPERTY_DESCRIPTION, g_param_spec_string ("description", "description", "description", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_PROPERTY_WIDGET, g_param_spec_object ("widget", "widget", "widget", GTK_TYPE_WIDGET, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_PROPERTY_REBOOT_REQUIRED, g_param_spec_boolean ("reboot-required", "reboot-required", "reboot-required", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_PROPERTY_DEFER_INTERVAL, g_param_spec_uint ("defer-interval", "defer-interval", "defer-interval", 0, G_MAXUINT, (guint) 1, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
}


static void boxes_property_instance_init (BoxesProperty * self) {
	self->priv = BOXES_PROPERTY_GET_PRIVATE (self);
	self->priv->_defer_interval = (guint) 1;
}


static void boxes_property_finalize (GObject* obj) {
	BoxesProperty * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_PROPERTY, BoxesProperty);
	_g_free0 (self->priv->_description);
	_g_object_unref0 (self->priv->_widget);
	(self->priv->_deferred_change_target_destroy_notify == NULL) ? NULL : (self->priv->_deferred_change_target_destroy_notify (self->priv->_deferred_change_target), NULL);
	self->priv->_deferred_change = NULL;
	self->priv->_deferred_change_target = NULL;
	self->priv->_deferred_change_target_destroy_notify = NULL;
	G_OBJECT_CLASS (boxes_property_parent_class)->finalize (obj);
}


GType boxes_property_get_type (void) {
	static volatile gsize boxes_property_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_property_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesPropertyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_property_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesProperty), 0, (GInstanceInitFunc) boxes_property_instance_init, NULL };
		GType boxes_property_type_id;
		boxes_property_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesProperty", &g_define_type_info, 0);
		g_once_init_leave (&boxes_property_type_id__volatile, boxes_property_type_id);
	}
	return boxes_property_type_id__volatile;
}


static void _vala_boxes_property_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesProperty * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_PROPERTY, BoxesProperty);
	switch (property_id) {
		case BOXES_PROPERTY_DESCRIPTION:
		g_value_set_string (value, boxes_property_get_description (self));
		break;
		case BOXES_PROPERTY_WIDGET:
		g_value_set_object (value, boxes_property_get_widget (self));
		break;
		case BOXES_PROPERTY_REBOOT_REQUIRED:
		g_value_set_boolean (value, boxes_property_get_reboot_required (self));
		break;
		case BOXES_PROPERTY_DEFER_INTERVAL:
		g_value_set_uint (value, boxes_property_get_defer_interval (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_boxes_property_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesProperty * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_PROPERTY, BoxesProperty);
	switch (property_id) {
		case BOXES_PROPERTY_DESCRIPTION:
		boxes_property_set_description (self, g_value_get_string (value));
		break;
		case BOXES_PROPERTY_WIDGET:
		boxes_property_set_widget (self, g_value_get_object (value));
		break;
		case BOXES_PROPERTY_REBOOT_REQUIRED:
		boxes_property_set_reboot_required (self, g_value_get_boolean (value));
		break;
		case BOXES_PROPERTY_DEFER_INTERVAL:
		boxes_property_set_defer_interval (self, g_value_get_uint (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


GList* boxes_iproperties_provider_get_properties (BoxesIPropertiesProvider* self, BoxesPropertiesPage page) {
	g_return_val_if_fail (self != NULL, NULL);
	return BOXES_IPROPERTIES_PROVIDER_GET_INTERFACE (self)->get_properties (self, page);
}


BoxesProperty* boxes_iproperties_provider_add_property (BoxesIPropertiesProvider* self, GList** list, const gchar* name, GtkWidget* widget) {
	BoxesProperty* result = NULL;
	const gchar* _tmp0_;
	GtkWidget* _tmp1_;
	BoxesProperty* _tmp2_;
	BoxesProperty* property;
	BoxesProperty* _tmp3_;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (widget != NULL, NULL);
	_tmp0_ = name;
	_tmp1_ = widget;
	_tmp2_ = boxes_property_new (_tmp0_, _tmp1_);
	property = _tmp2_;
	_tmp3_ = _g_object_ref0 (property);
	*list = g_list_append (*list, _tmp3_);
	result = property;
	return result;
}


static Block11Data* block11_data_ref (Block11Data* _data11_) {
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}


static void block11_data_unref (void * _userdata_) {
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		BoxesIPropertiesProvider * self;
		self = _data11_->self;
		_g_object_unref0 (_data11_->property);
		_g_object_unref0 (_data11_->entry);
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}


static void __lambda19_ (Block11Data* _data11_) {
	BoxesIPropertiesProvider * self;
	GError * _inner_error_ = NULL;
	self = _data11_->self;
	{
		PropertyStringChanged _tmp0_;
		void* _tmp0__target;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		_tmp0_ = _data11_->changed;
		_tmp0__target = _data11_->changed_target;
		_tmp1_ = boxes_editable_entry_get_text (_data11_->entry);
		_tmp2_ = _tmp1_;
		_tmp0_ (_data11_->property, _tmp2_, _tmp0__target, &_inner_error_);
		if (_inner_error_ != NULL) {
			if (g_error_matches (_inner_error_, BOXES_ERROR, BOXES_ERROR_INVALID)) {
				goto __catch10_boxes_error_invalid;
			}
			if (_inner_error_->domain == BOXES_ERROR) {
				goto __catch10_boxes_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	goto __finally10;
	__catch10_boxes_error_invalid:
	{
		GError* _error_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		boxes_editable_entry_start_editing (_data11_->entry);
		_g_error_free0 (_error_);
	}
	goto __finally10;
	__catch10_boxes_error:
	{
		GError* _error_ = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = _error_;
		_tmp4_ = _tmp3_->message;
		g_warning ("i-properties-provider.vala:79: %s", _tmp4_);
		_g_error_free0 (_error_);
	}
	__finally10:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ___lambda19__boxes_editable_entry_editing_done (BoxesEditableEntry* _sender, gpointer self) {
	__lambda19_ (self);
}


BoxesProperty* boxes_iproperties_provider_add_string_property (BoxesIPropertiesProvider* self, GList** list, const gchar* name, const gchar* value, PropertyStringChanged changed, void* changed_target) {
	BoxesProperty* result = NULL;
	Block11Data* _data11_;
	PropertyStringChanged _tmp0_;
	void* _tmp0__target;
	BoxesEditableEntry* _tmp1_;
	const gchar* _tmp2_;
	PropertyStringChanged _tmp3_;
	void* _tmp3__target;
	const gchar* _tmp4_;
	BoxesProperty* _tmp5_ = NULL;
	BoxesProperty* _tmp6_;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_data11_->self = g_object_ref (self);
	_tmp0_ = changed;
	_tmp0__target = changed_target;
	_data11_->changed = _tmp0_;
	_data11_->changed_target = _tmp0__target;
	_tmp1_ = boxes_editable_entry_new ();
	g_object_ref_sink (_tmp1_);
	_data11_->entry = _tmp1_;
	_tmp2_ = value;
	boxes_editable_entry_set_text (_data11_->entry, _tmp2_);
	boxes_editable_entry_set_selectable (_data11_->entry, TRUE);
	_tmp3_ = _data11_->changed;
	_tmp3__target = _data11_->changed_target;
	boxes_editable_entry_set_editable (_data11_->entry, _tmp3_ != NULL);
	_tmp4_ = name;
	_tmp5_ = boxes_iproperties_provider_add_property (self, list, _tmp4_, (GtkWidget*) _data11_->entry);
	_data11_->property = _tmp5_;
	g_signal_connect_data (_data11_->entry, "editing-done", (GCallback) ___lambda19__boxes_editable_entry_editing_done, block11_data_ref (_data11_), (GClosureNotify) block11_data_unref, 0);
	_tmp6_ = _g_object_ref0 (_data11_->property);
	result = _tmp6_;
	block11_data_unref (_data11_);
	_data11_ = NULL;
	return result;
}


static Block12Data* block12_data_ref (Block12Data* _data12_) {
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}


static void block12_data_unref (void * _userdata_) {
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		BoxesIPropertiesProvider * self;
		self = _data12_->self;
		_g_object_unref0 (_data12_->property);
		_g_object_unref0 (_data12_->scale);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}


static gchar* __lambda20_ (BoxesIPropertiesProvider* self, GtkScale* scale, gdouble value) {
	gchar* result = NULL;
	gdouble _tmp0_;
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (scale != NULL, NULL);
	_tmp0_ = value;
	_tmp1_ = g_format_size_full (((guint64) _tmp0_) * OSINFO_KIBIBYTES, G_FORMAT_SIZE_IEC_UNITS);
	result = _tmp1_;
	return result;
}


static gchar* ___lambda20__gtk_scale_format_value (GtkScale* _sender, gdouble value, gpointer self) {
	gchar* result;
	result = __lambda20_ (self, _sender, value);
	return result;
}


static void ___lambda21_ (Block12Data* _data12_) {
	BoxesIPropertiesProvider * self;
	GError * _inner_error_ = NULL;
	self = _data12_->self;
	{
		PropertySizeChanged _tmp0_;
		void* _tmp0__target;
		BoxesProperty* _tmp1_;
		GtkHScale* _tmp2_;
		gdouble _tmp3_ = 0.0;
		_tmp0_ = _data12_->changed;
		_tmp0__target = _data12_->changed_target;
		_tmp1_ = _data12_->property;
		_tmp2_ = _data12_->scale;
		_tmp3_ = gtk_range_get_value ((GtkRange*) _tmp2_);
		_tmp0_ (_tmp1_, (guint64) _tmp3_, _tmp0__target, &_inner_error_);
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == BOXES_ERROR) {
				goto __catch11_boxes_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	goto __finally11;
	__catch11_boxes_error:
	{
		GError* _error_ = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = _error_;
		_tmp5_ = _tmp4_->message;
		g_warning ("i-properties-provider.vala:109: %s", _tmp5_);
		_g_error_free0 (_error_);
	}
	__finally11:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ____lambda21__gtk_range_value_changed (GtkRange* _sender, gpointer self) {
	___lambda21_ (self);
}


BoxesProperty* boxes_iproperties_provider_add_size_property (BoxesIPropertiesProvider* self, GList** list, const gchar* name, guint64 size, guint64 min, guint64 max, guint64 step, PropertySizeChanged changed, void* changed_target) {
	BoxesProperty* result = NULL;
	Block12Data* _data12_;
	PropertySizeChanged _tmp0_;
	void* _tmp0__target;
	guint64 _tmp1_;
	guint64 _tmp2_;
	guint64 _tmp3_;
	GtkHScale* _tmp4_;
	GtkHScale* _tmp5_;
	GtkHScale* _tmp6_;
	guint64 _tmp7_;
	GtkHScale* _tmp8_;
	GtkHScale* _tmp9_;
	const gchar* _tmp10_;
	GtkHScale* _tmp11_;
	BoxesProperty* _tmp12_ = NULL;
	PropertySizeChanged _tmp13_;
	void* _tmp13__target;
	BoxesProperty* _tmp15_;
	BoxesProperty* _tmp16_;
	g_return_val_if_fail (name != NULL, NULL);
	_data12_ = g_slice_new0 (Block12Data);
	_data12_->_ref_count_ = 1;
	_data12_->self = g_object_ref (self);
	_tmp0_ = changed;
	_tmp0__target = changed_target;
	_data12_->changed = _tmp0_;
	_data12_->changed_target = _tmp0__target;
	_tmp1_ = min;
	_tmp2_ = max;
	_tmp3_ = step;
	_tmp4_ = (GtkHScale*) gtk_hscale_new_with_range ((gdouble) _tmp1_, (gdouble) _tmp2_, (gdouble) _tmp3_);
	g_object_ref_sink (_tmp4_);
	_data12_->scale = _tmp4_;
	_tmp5_ = _data12_->scale;
	g_signal_connect_object ((GtkScale*) _tmp5_, "format-value", (GCallback) ___lambda20__gtk_scale_format_value, self, 0);
	_tmp6_ = _data12_->scale;
	_tmp7_ = size;
	gtk_range_set_value ((GtkRange*) _tmp6_, (gdouble) _tmp7_);
	_tmp8_ = _data12_->scale;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp8_, TRUE);
	_tmp9_ = _data12_->scale;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp9_, 20);
	_tmp10_ = name;
	_tmp11_ = _data12_->scale;
	_tmp12_ = boxes_iproperties_provider_add_property (self, list, _tmp10_, (GtkWidget*) _tmp11_);
	_data12_->property = _tmp12_;
	_tmp13_ = _data12_->changed;
	_tmp13__target = _data12_->changed_target;
	if (_tmp13_ != NULL) {
		GtkHScale* _tmp14_;
		_tmp14_ = _data12_->scale;
		g_signal_connect_data ((GtkRange*) _tmp14_, "value-changed", (GCallback) ____lambda21__gtk_range_value_changed, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
	}
	_tmp15_ = _data12_->property;
	_tmp16_ = _g_object_ref0 (_tmp15_);
	result = _tmp16_;
	block12_data_unref (_data12_);
	_data12_ = NULL;
	return result;
}


static void boxes_iproperties_provider_base_init (BoxesIPropertiesProviderIface * iface) {
	static gboolean initialized = FALSE;
	if (!initialized) {
		initialized = TRUE;
	}
}


GType boxes_iproperties_provider_get_type (void) {
	static volatile gsize boxes_iproperties_provider_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_iproperties_provider_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesIPropertiesProviderIface), (GBaseInitFunc) boxes_iproperties_provider_base_init, (GBaseFinalizeFunc) NULL, (GClassInitFunc) NULL, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
		GType boxes_iproperties_provider_type_id;
		boxes_iproperties_provider_type_id = g_type_register_static (G_TYPE_INTERFACE, "BoxesIPropertiesProvider", &g_define_type_info, 0);
		g_type_interface_add_prerequisite (boxes_iproperties_provider_type_id, G_TYPE_OBJECT);
		g_once_init_leave (&boxes_iproperties_provider_type_id__volatile, boxes_iproperties_provider_type_id);
	}
	return boxes_iproperties_provider_type_id__volatile;
}



