/* ui.c generated by valac 0.56.19, the Vala compiler
 * generated from ui.vala, do not modify */

/* SPDX-License-Identifier: GPL-3.0-or-later*/

#include "graphs.h"
#include <gtk/gtk.h>
#include <gee.h>
#include <glib-object.h>
#include <glib.h>
#include <string.h>
#include <adwaita.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <float.h>
#include <math.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  {
	GRAPHS_COLUMNS_BOX_0_PROPERTY,
	GRAPHS_COLUMNS_BOX_ITEMS_BOX_PROPERTY,
	GRAPHS_COLUMNS_BOX_NUM_PROPERTIES
};
static GParamSpec* graphs_columns_box_properties[GRAPHS_COLUMNS_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _graphs_columns_item_settings_free0(var) ((var == NULL) ? NULL : (var = (graphs_columns_item_settings_free (var), NULL)))
#define _g_variant_iter_free0(var) ((var == NULL) ? NULL : (var = (g_variant_iter_free (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
#define _g_variant_builder_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_builder_unref (var), NULL)))
enum  {
	GRAPHS_COLUMNS_GROUP_0_PROPERTY,
	GRAPHS_COLUMNS_GROUP_DELIMITER_PROPERTY,
	GRAPHS_COLUMNS_GROUP_CUSTOM_DELIMITER_PROPERTY,
	GRAPHS_COLUMNS_GROUP_SEPARATOR_PROPERTY,
	GRAPHS_COLUMNS_GROUP_SKIP_ROWS_PROPERTY,
	GRAPHS_COLUMNS_GROUP_NUM_PROPERTIES
};
static GParamSpec* graphs_columns_group_properties[GRAPHS_COLUMNS_GROUP_NUM_PROPERTIES];
typedef struct _Block2Data Block2Data;
typedef enum  {
	GRAPHS_COLUMNS_DELIMITER_WHITESPACE,
	GRAPHS_COLUMNS_DELIMITER_TAB,
	GRAPHS_COLUMNS_DELIMITER_COLON,
	GRAPHS_COLUMNS_DELIMITER_SEMICOLON,
	GRAPHS_COLUMNS_DELIMITER_COMMA,
	GRAPHS_COLUMNS_DELIMITER_PERIOD,
	GRAPHS_COLUMNS_DELIMITER_CUSTOM
} GraphsColumnsDelimiter;

#define GRAPHS_TYPE_COLUMNS_DELIMITER (graphs_columns_delimiter_get_type ())
typedef enum  {
	GRAPHS_COLUMNS_SEPARATOR_COMMA,
	GRAPHS_COLUMNS_SEPARATOR_PERIOD
} GraphsColumnsSeparator;

#define GRAPHS_TYPE_COLUMNS_SEPARATOR (graphs_columns_separator_get_type ())
enum  {
	GRAPHS_COLUMNS_ITEM_GROUP_0_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_X_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_Y_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_SINGLE_COLUMN_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_EQUATION_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_USE_XERR_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_USE_YERR_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_XERR_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_YERR_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_REMOVE_BUTTON_PROPERTY,
	GRAPHS_COLUMNS_ITEM_GROUP_NUM_PROPERTIES
};
static GParamSpec* graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_NUM_PROPERTIES];
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
enum  {
	GRAPHS_COLUMNS_ITEM_GROUP_SETTINGS_CHANGED_SIGNAL,
	GRAPHS_COLUMNS_ITEM_GROUP_REMOVE_REQUEST_SIGNAL,
	GRAPHS_COLUMNS_ITEM_GROUP_NUM_SIGNALS
};
static guint graphs_columns_item_group_signals[GRAPHS_COLUMNS_ITEM_GROUP_NUM_SIGNALS] = {0};

struct _GraphsColumnsBoxPrivate {
	GtkBox* _items_box;
	GraphsImportSettings* settings;
	GeeList* items;
};

struct _Block1Data {
	int _ref_count_;
	GraphsColumnsBox* self;
	gint index;
};

struct _GraphsColumnsGroupPrivate {
	AdwComboRow* _delimiter;
	AdwEntryRow* _custom_delimiter;
	AdwComboRow* _separator;
	AdwSpinRow* _skip_rows;
};

struct _Block2Data {
	int _ref_count_;
	GraphsColumnsGroup* self;
	GraphsImportSettings* settings;
};

struct _GraphsColumnsItemGroupPrivate {
	AdwSpinRow* _column_x;
	AdwSpinRow* _column_y;
	AdwSwitchRow* _single_column;
	AdwEntryRow* _equation;
	AdwSwitchRow* _use_xerr;
	AdwSwitchRow* _use_yerr;
	AdwSpinRow* _column_xerr;
	AdwSpinRow* _column_yerr;
	GtkButton* _remove_button;
};

static gint GraphsColumnsBox_private_offset;
static gpointer graphs_columns_box_parent_class = NULL;
static gint GraphsColumnsGroup_private_offset;
static gpointer graphs_columns_group_parent_class = NULL;
static gint GraphsColumnsItemGroup_private_offset;
static gpointer graphs_columns_item_group_parent_class = NULL;

static GraphsColumnsItemSettings** _vala_array_dup2 (GraphsColumnsItemSettings** self,
                                              gssize length);
static void graphs_columns_box_reload_item_groups (GraphsColumnsBox* self);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void _____lambda97_ (Block1Data* _data1_,
                     GraphsColumnsItemSettings* new_settings);
static void graphs_columns_box_update_settings (GraphsColumnsBox* self);
static void ______lambda97__graphs_columns_item_group_settings_changed (GraphsColumnsItemGroup* _sender,
                                                                 GraphsColumnsItemSettings* new_settings,
                                                                 gpointer self);
static void _____lambda98_ (Block1Data* _data1_);
static void ______lambda98__graphs_columns_item_group_remove_request (GraphsColumnsItemGroup* _sender,
                                                               gpointer self);
static void graphs_columns_box_add (GraphsColumnsBox* self);
static void _graphs_columns_box_add_adw_button_row_activated (AdwButtonRow* _sender,
                                                       gpointer self);
static void graphs_columns_box_finalize (GObject * obj);
static GType graphs_columns_box_get_type_once (void);
static void _vala_graphs_columns_box_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
VALA_EXTERN GType graphs_columns_delimiter_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GraphsColumnsDelimiter graphs_columns_delimiter_parse (const gchar* delimiter);
static void __lambda93_ (Block2Data* _data2_);
VALA_EXTERN gchar* graphs_columns_delimiter_friendly_string (GraphsColumnsDelimiter self);
static void ___lambda93__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda94_ (Block2Data* _data2_);
static void ___lambda94__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
VALA_EXTERN GType graphs_columns_separator_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GraphsColumnsSeparator graphs_columns_separator_parse (const gchar* separator);
static void __lambda95_ (Block2Data* _data2_);
VALA_EXTERN gchar* graphs_columns_separator_friendly_string (GraphsColumnsSeparator self);
static void ___lambda95__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void __lambda96_ (Block2Data* _data2_);
static void ___lambda96__g_object_notify (GObject* _sender,
                                   GParamSpec* pspec,
                                   gpointer self);
static void graphs_columns_group_finalize (GObject * obj);
static GType graphs_columns_group_get_type_once (void);
static void _vala_graphs_columns_group_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void graphs_columns_item_group_load_item_settings (GraphsColumnsItemGroup* self,
                                                   GraphsColumnsItemSettings* item_settings);
static void graphs_columns_item_group_on_settings_changed (GraphsColumnsItemGroup* self);
static void _graphs_columns_item_group_on_settings_changed_g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self);
static void graphs_columns_item_group_get_item_settings (GraphsColumnsItemGroup* self,
                                                  GraphsColumnsItemSettings* result);
static void graphs_columns_item_group_on_remove (GraphsColumnsItemGroup* self);
static void _graphs_columns_item_group_on_remove_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self);
static void graphs_columns_item_group_finalize (GObject * obj);
static GType graphs_columns_item_group_get_type_once (void);
static void _vala_graphs_columns_item_group_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
graphs_columns_box_get_instance_private (GraphsColumnsBox* self)
{
	return G_STRUCT_MEMBER_P (self, GraphsColumnsBox_private_offset);
}

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

static gpointer
_graphs_columns_item_settings_dup0 (gpointer self)
{
	return self ? graphs_columns_item_settings_dup (self) : NULL;
}

static GraphsColumnsItemSettings**
_vala_array_dup2 (GraphsColumnsItemSettings** self,
                  gssize length)
{
	if (length > 0) {
		GraphsColumnsItemSettings** result;
		gssize i;
		result = g_new0 (GraphsColumnsItemSettings*, length);
		for (i = 0; i < length; i++) {
			GraphsColumnsItemSettings* _tmp0_;
			_tmp0_ = _graphs_columns_item_settings_dup0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

GraphsColumnsBox*
graphs_columns_box_construct (GType object_type,
                              GraphsImportSettings* settings)
{
	GraphsColumnsBox * self = NULL;
	GraphsImportSettings* _tmp0_;
	GraphsColumnsGroup* _tmp1_;
	GraphsColumnsGroup* _tmp2_;
	GVariantIter* iter = NULL;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	GVariantIter* _tmp5_;
	GVariantIter* _tmp6_;
	gsize n_items = 0UL;
	GVariantIter* _tmp7_;
	GraphsColumnsItemSettings** item_settings_list = NULL;
	GraphsColumnsItemSettings** _tmp8_;
	gint item_settings_list_length1;
	gint _item_settings_list_size_;
	GraphsColumnsItemSettings** _tmp20_;
	gint _tmp20__length1;
	GraphsColumnsItemSettings** _tmp21_;
	gint _tmp21__length1;
	GeeArrayList* _tmp22_;
	g_return_val_if_fail (settings != NULL, NULL);
	self = (GraphsColumnsBox*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (settings);
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp0_;
	_tmp1_ = graphs_columns_group_new (settings);
	g_object_ref_sink (_tmp1_);
	_tmp2_ = _tmp1_;
	gtk_box_prepend ((GtkBox*) self, (GtkWidget*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = graphs_import_settings_get_value (settings, "items");
	_tmp4_ = _tmp3_;
	_tmp5_ = g_variant_iter_new (_tmp4_);
	_tmp6_ = _tmp5_;
	_g_variant_unref0 (_tmp4_);
	iter = _tmp6_;
	_tmp7_ = iter;
	n_items = g_variant_iter_n_children (_tmp7_);
	_tmp8_ = g_new0 (GraphsColumnsItemSettings*, n_items);
	item_settings_list = _tmp8_;
	item_settings_list_length1 = n_items;
	_item_settings_list_size_ = item_settings_list_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp9_ = FALSE;
			_tmp9_ = TRUE;
			while (TRUE) {
				GraphsColumnsItemSettings** _tmp11_;
				gint _tmp11__length1;
				GraphsColumnsItemSettings _tmp12_ = {0};
				GraphsColumnsItemSettings _tmp13_;
				GraphsColumnsItemSettings* _tmp14_;
				GraphsColumnsItemSettings** _tmp15_;
				gint _tmp15__length1;
				GraphsColumnsItemSettings* _tmp16_;
				GVariantIter* _tmp17_;
				GVariant* _tmp18_;
				GVariant* _tmp19_;
				if (!_tmp9_) {
					gint _tmp10_;
					_tmp10_ = i;
					i = _tmp10_ + 1;
				}
				_tmp9_ = FALSE;
				if (!(((gsize) i) < n_items)) {
					break;
				}
				_tmp11_ = item_settings_list;
				_tmp11__length1 = item_settings_list_length1;
				memset (&_tmp12_, 0, sizeof (GraphsColumnsItemSettings));
				_tmp13_ = _tmp12_;
				_tmp14_ = _graphs_columns_item_settings_dup0 (&_tmp13_);
				_graphs_columns_item_settings_free0 (_tmp11_[i]);
				_tmp11_[i] = _tmp14_;
				graphs_columns_item_settings_destroy (&_tmp13_);
				_tmp15_ = item_settings_list;
				_tmp15__length1 = item_settings_list_length1;
				_tmp16_ = _tmp15_[i];
				_tmp17_ = iter;
				_tmp18_ = g_variant_iter_next_value (_tmp17_);
				_tmp19_ = _tmp18_;
				graphs_columns_item_settings_load_from_variant (_tmp16_, _tmp19_);
				_g_variant_unref0 (_tmp19_);
			}
		}
	}
	_tmp20_ = item_settings_list;
	_tmp20__length1 = item_settings_list_length1;
	_tmp21_ = (_tmp20_ != NULL) ? _vala_array_dup2 (_tmp20_, _tmp20__length1) : _tmp20_;
	_tmp21__length1 = _tmp20__length1;
	_tmp22_ = gee_array_list_new_wrap (GRAPHS_TYPE_COLUMNS_ITEM_SETTINGS, (GBoxedCopyFunc) graphs_columns_item_settings_dup, (GDestroyNotify) graphs_columns_item_settings_free, _tmp21_, _tmp21__length1, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->items);
	self->priv->items = (GeeList*) _tmp22_;
	graphs_columns_box_reload_item_groups (self);
	item_settings_list = (_vala_array_free (item_settings_list, item_settings_list_length1, (GDestroyNotify) graphs_columns_item_settings_free), NULL);
	_g_variant_iter_free0 (iter);
	return self;
}

GraphsColumnsBox*
graphs_columns_box_new (GraphsImportSettings* settings)
{
	return graphs_columns_box_construct (GRAPHS_TYPE_COLUMNS_BOX, settings);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		GraphsColumnsBox* self;
		self = _data1_->self;
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
_____lambda97_ (Block1Data* _data1_,
                GraphsColumnsItemSettings* new_settings)
{
	GraphsColumnsBox* self;
	GeeList* _tmp0_;
	GraphsColumnsItemSettings _tmp1_;
	self = _data1_->self;
	g_return_if_fail (new_settings != NULL);
	_tmp0_ = self->priv->items;
	_tmp1_ = *new_settings;
	gee_list_set (_tmp0_, _data1_->index, &_tmp1_);
	graphs_columns_box_update_settings (self);
}

static void
______lambda97__graphs_columns_item_group_settings_changed (GraphsColumnsItemGroup* _sender,
                                                            GraphsColumnsItemSettings* new_settings,
                                                            gpointer self)
{
	_____lambda97_ (self, new_settings);
}

static void
_____lambda98_ (Block1Data* _data1_)
{
	GraphsColumnsBox* self;
	GeeList* _tmp0_;
	gpointer _tmp1_;
	GraphsColumnsItemSettings* _tmp2_;
	self = _data1_->self;
	_tmp0_ = self->priv->items;
	_tmp1_ = gee_list_remove_at (_tmp0_, _data1_->index);
	_tmp2_ = (GraphsColumnsItemSettings*) _tmp1_;
	_graphs_columns_item_settings_free0 (_tmp2_);
	graphs_columns_box_update_settings (self);
	graphs_columns_box_reload_item_groups (self);
}

static void
______lambda98__graphs_columns_item_group_remove_request (GraphsColumnsItemGroup* _sender,
                                                          gpointer self)
{
	_____lambda98_ (self);
}

static void
graphs_columns_box_reload_item_groups (GraphsColumnsBox* self)
{
	GtkWidget* widget = NULL;
	g_return_if_fail (self != NULL);
	while (TRUE) {
		GtkBox* _tmp0_;
		GtkWidget* _tmp1_;
		GtkWidget* _tmp2_;
		GtkWidget* _tmp3_;
		GtkBox* _tmp4_;
		GtkWidget* _tmp5_;
		_tmp0_ = self->priv->_items_box;
		_tmp1_ = gtk_widget_get_last_child ((GtkWidget*) _tmp0_);
		_tmp2_ = _g_object_ref0 (_tmp1_);
		_g_object_unref0 (widget);
		widget = _tmp2_;
		_tmp3_ = widget;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = self->priv->_items_box;
		_tmp5_ = widget;
		gtk_box_remove (_tmp4_, _tmp5_);
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				Block1Data* _data1_;
				GeeList* _tmp8_;
				gint _tmp9_;
				gint _tmp10_;
				GraphsColumnsItemGroup* item_group = NULL;
				GeeList* _tmp11_;
				gpointer _tmp12_;
				GraphsColumnsItemSettings* _tmp13_;
				GraphsColumnsItemSettings _tmp14_;
				GraphsColumnsItemGroup* _tmp15_;
				GraphsColumnsItemGroup* _tmp16_;
				GraphsColumnsItemGroup* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
				GraphsColumnsItemGroup* _tmp20_;
				GraphsColumnsItemGroup* _tmp21_;
				GtkBox* _tmp22_;
				GraphsColumnsItemGroup* _tmp23_;
				_data1_ = g_slice_new0 (Block1Data);
				_data1_->_ref_count_ = 1;
				_data1_->self = g_object_ref (self);
				if (!_tmp6_) {
					gint _tmp7_;
					_tmp7_ = i;
					i = _tmp7_ + 1;
				}
				_tmp6_ = FALSE;
				_tmp8_ = self->priv->items;
				_tmp9_ = gee_collection_get_size ((GeeCollection*) _tmp8_);
				_tmp10_ = _tmp9_;
				if (!(i < _tmp10_)) {
					block1_data_unref (_data1_);
					_data1_ = NULL;
					break;
				}
				_data1_->index = i;
				_tmp11_ = self->priv->items;
				_tmp12_ = gee_list_get (_tmp11_, i);
				_tmp13_ = (GraphsColumnsItemSettings*) _tmp12_;
				_tmp14_ = *_tmp13_;
				_tmp15_ = graphs_columns_item_group_new (&_tmp14_, i > 0);
				g_object_ref_sink (_tmp15_);
				_tmp16_ = _tmp15_;
				_graphs_columns_item_settings_free0 (_tmp13_);
				item_group = _tmp16_;
				_tmp17_ = item_group;
				_tmp18_ = g_strdup_printf (_ ("Item %d"), i + 1);
				_tmp19_ = _tmp18_;
				adw_preferences_group_set_title ((AdwPreferencesGroup*) _tmp17_, _tmp19_);
				_g_free0 (_tmp19_);
				_tmp20_ = item_group;
				g_signal_connect_data (_tmp20_, "settings-changed", (GCallback) ______lambda97__graphs_columns_item_group_settings_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
				_tmp21_ = item_group;
				g_signal_connect_data (_tmp21_, "remove-request", (GCallback) ______lambda98__graphs_columns_item_group_remove_request, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
				_tmp22_ = self->priv->_items_box;
				_tmp23_ = item_group;
				gtk_box_append (_tmp22_, (GtkWidget*) _tmp23_);
				_g_object_unref0 (item_group);
				block1_data_unref (_data1_);
				_data1_ = NULL;
			}
		}
	}
	_g_object_unref0 (widget);
}

static void
graphs_columns_box_add (GraphsColumnsBox* self)
{
	GraphsColumnsItemSettings new_settings = {0};
	GeeList* _tmp0_;
	gpointer _tmp1_;
	GraphsColumnsItemSettings* _tmp2_;
	GraphsColumnsItemSettings _tmp3_;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	GeeList* _tmp6_;
	GraphsColumnsItemSettings _tmp7_;
	g_return_if_fail (self != NULL);
	memset (&new_settings, 0, sizeof (GraphsColumnsItemSettings));
	_tmp0_ = self->priv->items;
	_tmp1_ = gee_list_get (_tmp0_, 0);
	_tmp2_ = (GraphsColumnsItemSettings*) _tmp1_;
	_tmp3_ = *_tmp2_;
	_tmp4_ = graphs_columns_item_settings_to_variant (&_tmp3_);
	_tmp5_ = _tmp4_;
	graphs_columns_item_settings_load_from_variant (&new_settings, _tmp5_);
	_g_variant_unref0 (_tmp5_);
	_graphs_columns_item_settings_free0 (_tmp2_);
	_tmp6_ = self->priv->items;
	_tmp7_ = new_settings;
	gee_collection_add ((GeeCollection*) _tmp6_, &_tmp7_);
	graphs_columns_box_update_settings (self);
	graphs_columns_box_reload_item_groups (self);
	graphs_columns_item_settings_destroy (&new_settings);
}

static void
_graphs_columns_box_add_adw_button_row_activated (AdwButtonRow* _sender,
                                                  gpointer self)
{
	graphs_columns_box_add ((GraphsColumnsBox*) self);
}

static void
graphs_columns_box_update_settings (GraphsColumnsBox* self)
{
	GVariantBuilder* builder = NULL;
	GVariantType* _tmp0_;
	GVariantType* _tmp1_;
	GVariantBuilder* _tmp2_;
	GVariantBuilder* _tmp3_;
	GraphsImportSettings* _tmp16_;
	GVariantBuilder* _tmp17_;
	GVariant* _tmp18_;
	GVariant* _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_variant_type_new ("a(iiiibbbs)");
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_builder_new (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_variant_type_free0 (_tmp1_);
	builder = _tmp3_;
	{
		GeeList* _item_settings_list = NULL;
		GeeList* _tmp4_;
		gint _item_settings_size = 0;
		GeeList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _item_settings_index = 0;
		_tmp4_ = self->priv->items;
		_item_settings_list = _tmp4_;
		_tmp5_ = _item_settings_list;
		_tmp6_ = gee_collection_get_size ((GeeCollection*) _tmp5_);
		_tmp7_ = _tmp6_;
		_item_settings_size = _tmp7_;
		_item_settings_index = -1;
		while (TRUE) {
			gint _tmp8_;
			gint _tmp9_;
			GraphsColumnsItemSettings* item_settings = NULL;
			GeeList* _tmp10_;
			gpointer _tmp11_;
			GVariantBuilder* _tmp12_;
			GraphsColumnsItemSettings* _tmp13_;
			GVariant* _tmp14_;
			GVariant* _tmp15_;
			_item_settings_index = _item_settings_index + 1;
			_tmp8_ = _item_settings_index;
			_tmp9_ = _item_settings_size;
			if (!(_tmp8_ < _tmp9_)) {
				break;
			}
			_tmp10_ = _item_settings_list;
			_tmp11_ = gee_list_get (_tmp10_, _item_settings_index);
			item_settings = (GraphsColumnsItemSettings*) _tmp11_;
			_tmp12_ = builder;
			_tmp13_ = item_settings;
			_tmp14_ = graphs_columns_item_settings_to_variant (_tmp13_);
			_tmp15_ = _tmp14_;
			g_variant_builder_add_value (_tmp12_, _tmp15_);
			_g_variant_unref0 (_tmp15_);
			_graphs_columns_item_settings_free0 (item_settings);
		}
	}
	_tmp16_ = self->priv->settings;
	_tmp17_ = builder;
	_tmp18_ = g_variant_builder_end (_tmp17_);
	g_variant_ref_sink (_tmp18_);
	_tmp19_ = _tmp18_;
	graphs_import_settings_set_value (_tmp16_, "items", _tmp19_);
	_g_variant_unref0 (_tmp19_);
	_g_variant_builder_unref0 (builder);
}

GtkBox*
graphs_columns_box_get_items_box (GraphsColumnsBox* self)
{
	GtkBox* result;
	GtkBox* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_items_box;
	result = _tmp0_;
	return result;
}

static void
graphs_columns_box_class_init (GraphsColumnsBoxClass * klass,
                               gpointer klass_data)
{
	graphs_columns_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GraphsColumnsBox_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_graphs_columns_box_get_property;
	G_OBJECT_CLASS (klass)->finalize = graphs_columns_box_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_BOX_ITEMS_BOX_PROPERTY, graphs_columns_box_properties[GRAPHS_COLUMNS_BOX_ITEMS_BOX_PROPERTY] = g_param_spec_object ("items-box", "items-box", "items-box", gtk_box_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/se/sjoerd/Graphs/ui/import/columns/box.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "items_box", FALSE, GraphsColumnsBox_private_offset + G_STRUCT_OFFSET (GraphsColumnsBoxPrivate, _items_box));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "add", G_CALLBACK(_graphs_columns_box_add_adw_button_row_activated));
}

static void
graphs_columns_box_instance_init (GraphsColumnsBox * self,
                                  gpointer klass)
{
	self->priv = graphs_columns_box_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
graphs_columns_box_finalize (GObject * obj)
{
	GraphsColumnsBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRAPHS_TYPE_COLUMNS_BOX, GraphsColumnsBox);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->items);
	G_OBJECT_CLASS (graphs_columns_box_parent_class)->finalize (obj);
}

static GType
graphs_columns_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GraphsColumnsBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) graphs_columns_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GraphsColumnsBox), 0, (GInstanceInitFunc) graphs_columns_box_instance_init, NULL };
	GType graphs_columns_box_type_id;
	graphs_columns_box_type_id = g_type_register_static (gtk_box_get_type (), "GraphsColumnsBox", &g_define_type_info, 0);
	GraphsColumnsBox_private_offset = g_type_add_instance_private (graphs_columns_box_type_id, sizeof (GraphsColumnsBoxPrivate));
	return graphs_columns_box_type_id;
}

GType
graphs_columns_box_get_type (void)
{
	static volatile gsize graphs_columns_box_type_id__once = 0;
	if (g_once_init_enter (&graphs_columns_box_type_id__once)) {
		GType graphs_columns_box_type_id;
		graphs_columns_box_type_id = graphs_columns_box_get_type_once ();
		g_once_init_leave (&graphs_columns_box_type_id__once, graphs_columns_box_type_id);
	}
	return graphs_columns_box_type_id__once;
}

static void
_vala_graphs_columns_box_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	GraphsColumnsBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GRAPHS_TYPE_COLUMNS_BOX, GraphsColumnsBox);
	switch (property_id) {
		case GRAPHS_COLUMNS_BOX_ITEMS_BOX_PROPERTY:
		g_value_set_object (value, graphs_columns_box_get_items_box (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
graphs_columns_group_get_instance_private (GraphsColumnsGroup* self)
{
	return G_STRUCT_MEMBER_P (self, GraphsColumnsGroup_private_offset);
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		GraphsColumnsGroup* self;
		self = _data2_->self;
		_g_object_unref0 (_data2_->settings);
		_g_object_unref0 (self);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
__lambda93_ (Block2Data* _data2_)
{
	GraphsColumnsGroup* self;
	GraphsColumnsDelimiter selected = 0;
	AdwComboRow* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	AdwEntryRow* _tmp3_;
	self = _data2_->self;
	_tmp0_ = self->priv->_delimiter;
	selected = (GraphsColumnsDelimiter) adw_combo_row_get_selected (_tmp0_);
	_tmp1_ = graphs_columns_delimiter_friendly_string (selected);
	_tmp2_ = _tmp1_;
	graphs_import_settings_set_string (_data2_->settings, "delimiter", _tmp2_);
	_g_free0 (_tmp2_);
	_tmp3_ = self->priv->_custom_delimiter;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, selected == GRAPHS_COLUMNS_DELIMITER_CUSTOM);
}

static void
___lambda93__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda93_ (self);
}

static void
__lambda94_ (Block2Data* _data2_)
{
	GraphsColumnsGroup* self;
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	self = _data2_->self;
	_tmp0_ = self->priv->_custom_delimiter;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	graphs_import_settings_set_string (_data2_->settings, "custom-delimiter", _tmp1_);
}

static void
___lambda94__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda94_ (self);
}

static void
__lambda95_ (Block2Data* _data2_)
{
	GraphsColumnsGroup* self;
	AdwComboRow* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	self = _data2_->self;
	_tmp0_ = self->priv->_separator;
	_tmp1_ = graphs_columns_separator_friendly_string ((GraphsColumnsSeparator) adw_combo_row_get_selected (_tmp0_));
	_tmp2_ = _tmp1_;
	graphs_import_settings_set_string (_data2_->settings, "separator", _tmp2_);
	_g_free0 (_tmp2_);
}

static void
___lambda95__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda95_ (self);
}

static void
__lambda96_ (Block2Data* _data2_)
{
	GraphsColumnsGroup* self;
	AdwSpinRow* _tmp0_;
	self = _data2_->self;
	_tmp0_ = self->priv->_skip_rows;
	graphs_import_settings_set_int (_data2_->settings, "skip-rows", (gint) adw_spin_row_get_value (_tmp0_));
}

static void
___lambda96__g_object_notify (GObject* _sender,
                              GParamSpec* pspec,
                              gpointer self)
{
	__lambda96_ (self);
}

GraphsColumnsGroup*
graphs_columns_group_construct (GType object_type,
                                GraphsImportSettings* settings)
{
	GraphsColumnsGroup * self = NULL;
	Block2Data* _data2_;
	GraphsImportSettings* _tmp0_;
	AdwComboRow* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	AdwComboRow* _tmp4_;
	AdwEntryRow* _tmp5_;
	AdwComboRow* _tmp6_;
	AdwEntryRow* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	AdwEntryRow* _tmp10_;
	AdwComboRow* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	AdwComboRow* _tmp14_;
	AdwSpinRow* _tmp15_;
	AdwSpinRow* _tmp16_;
	g_return_val_if_fail (settings != NULL, NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (settings);
	_g_object_unref0 (_data2_->settings);
	_data2_->settings = _tmp0_;
	self = (GraphsColumnsGroup*) g_object_new (object_type, NULL);
	_data2_->self = g_object_ref (self);
	_tmp1_ = self->priv->_delimiter;
	_tmp2_ = graphs_import_settings_get_string (_data2_->settings, "delimiter");
	_tmp3_ = _tmp2_;
	adw_combo_row_set_selected (_tmp1_, (guint) graphs_columns_delimiter_parse (_tmp3_));
	_g_free0 (_tmp3_);
	_tmp4_ = self->priv->_delimiter;
	g_signal_connect_data ((GObject*) _tmp4_, "notify::selected", (GCallback) ___lambda93__g_object_notify, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp5_ = self->priv->_custom_delimiter;
	_tmp6_ = self->priv->_delimiter;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, adw_combo_row_get_selected (_tmp6_) == ((guint) GRAPHS_COLUMNS_DELIMITER_CUSTOM));
	_tmp7_ = self->priv->_custom_delimiter;
	_tmp8_ = graphs_import_settings_get_string (_data2_->settings, "custom-delimiter");
	_tmp9_ = _tmp8_;
	gtk_editable_set_text ((GtkEditable*) _tmp7_, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp10_ = self->priv->_custom_delimiter;
	g_signal_connect_data ((GObject*) _tmp10_, "notify::text", (GCallback) ___lambda94__g_object_notify, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp11_ = self->priv->_separator;
	_tmp12_ = graphs_import_settings_get_string (_data2_->settings, "separator");
	_tmp13_ = _tmp12_;
	adw_combo_row_set_selected (_tmp11_, (guint) graphs_columns_separator_parse (_tmp13_));
	_g_free0 (_tmp13_);
	_tmp14_ = self->priv->_separator;
	g_signal_connect_data ((GObject*) _tmp14_, "notify::selected", (GCallback) ___lambda95__g_object_notify, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	_tmp15_ = self->priv->_skip_rows;
	adw_spin_row_set_value (_tmp15_, (gdouble) graphs_import_settings_get_int (_data2_->settings, "skip-rows"));
	_tmp16_ = self->priv->_skip_rows;
	g_signal_connect_data ((GObject*) _tmp16_, "notify::value", (GCallback) ___lambda96__g_object_notify, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0);
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return self;
}

GraphsColumnsGroup*
graphs_columns_group_new (GraphsImportSettings* settings)
{
	return graphs_columns_group_construct (GRAPHS_TYPE_COLUMNS_GROUP, settings);
}

AdwComboRow*
graphs_columns_group_get_delimiter (GraphsColumnsGroup* self)
{
	AdwComboRow* result;
	AdwComboRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_delimiter;
	result = _tmp0_;
	return result;
}

AdwEntryRow*
graphs_columns_group_get_custom_delimiter (GraphsColumnsGroup* self)
{
	AdwEntryRow* result;
	AdwEntryRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_custom_delimiter;
	result = _tmp0_;
	return result;
}

AdwComboRow*
graphs_columns_group_get_separator (GraphsColumnsGroup* self)
{
	AdwComboRow* result;
	AdwComboRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_separator;
	result = _tmp0_;
	return result;
}

AdwSpinRow*
graphs_columns_group_get_skip_rows (GraphsColumnsGroup* self)
{
	AdwSpinRow* result;
	AdwSpinRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_skip_rows;
	result = _tmp0_;
	return result;
}

static void
graphs_columns_group_class_init (GraphsColumnsGroupClass * klass,
                                 gpointer klass_data)
{
	graphs_columns_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GraphsColumnsGroup_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_graphs_columns_group_get_property;
	G_OBJECT_CLASS (klass)->finalize = graphs_columns_group_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_GROUP_DELIMITER_PROPERTY, graphs_columns_group_properties[GRAPHS_COLUMNS_GROUP_DELIMITER_PROPERTY] = g_param_spec_object ("delimiter", "delimiter", "delimiter", adw_combo_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_GROUP_CUSTOM_DELIMITER_PROPERTY, graphs_columns_group_properties[GRAPHS_COLUMNS_GROUP_CUSTOM_DELIMITER_PROPERTY] = g_param_spec_object ("custom-delimiter", "custom-delimiter", "custom-delimiter", adw_entry_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_GROUP_SEPARATOR_PROPERTY, graphs_columns_group_properties[GRAPHS_COLUMNS_GROUP_SEPARATOR_PROPERTY] = g_param_spec_object ("separator", "separator", "separator", adw_combo_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_GROUP_SKIP_ROWS_PROPERTY, graphs_columns_group_properties[GRAPHS_COLUMNS_GROUP_SKIP_ROWS_PROPERTY] = g_param_spec_object ("skip-rows", "skip-rows", "skip-rows", adw_spin_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/se/sjoerd/Graphs/ui/import/columns/main-group.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delimiter", FALSE, GraphsColumnsGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsGroupPrivate, _delimiter));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "custom_delimiter", FALSE, GraphsColumnsGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsGroupPrivate, _custom_delimiter));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "separator", FALSE, GraphsColumnsGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsGroupPrivate, _separator));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "skip_rows", FALSE, GraphsColumnsGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsGroupPrivate, _skip_rows));
}

static void
graphs_columns_group_instance_init (GraphsColumnsGroup * self,
                                    gpointer klass)
{
	self->priv = graphs_columns_group_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
graphs_columns_group_finalize (GObject * obj)
{
	GraphsColumnsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRAPHS_TYPE_COLUMNS_GROUP, GraphsColumnsGroup);
	G_OBJECT_CLASS (graphs_columns_group_parent_class)->finalize (obj);
}

static GType
graphs_columns_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GraphsColumnsGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) graphs_columns_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GraphsColumnsGroup), 0, (GInstanceInitFunc) graphs_columns_group_instance_init, NULL };
	GType graphs_columns_group_type_id;
	graphs_columns_group_type_id = g_type_register_static (adw_preferences_group_get_type (), "GraphsColumnsGroup", &g_define_type_info, 0);
	GraphsColumnsGroup_private_offset = g_type_add_instance_private (graphs_columns_group_type_id, sizeof (GraphsColumnsGroupPrivate));
	return graphs_columns_group_type_id;
}

GType
graphs_columns_group_get_type (void)
{
	static volatile gsize graphs_columns_group_type_id__once = 0;
	if (g_once_init_enter (&graphs_columns_group_type_id__once)) {
		GType graphs_columns_group_type_id;
		graphs_columns_group_type_id = graphs_columns_group_get_type_once ();
		g_once_init_leave (&graphs_columns_group_type_id__once, graphs_columns_group_type_id);
	}
	return graphs_columns_group_type_id__once;
}

static void
_vala_graphs_columns_group_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	GraphsColumnsGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GRAPHS_TYPE_COLUMNS_GROUP, GraphsColumnsGroup);
	switch (property_id) {
		case GRAPHS_COLUMNS_GROUP_DELIMITER_PROPERTY:
		g_value_set_object (value, graphs_columns_group_get_delimiter (self));
		break;
		case GRAPHS_COLUMNS_GROUP_CUSTOM_DELIMITER_PROPERTY:
		g_value_set_object (value, graphs_columns_group_get_custom_delimiter (self));
		break;
		case GRAPHS_COLUMNS_GROUP_SEPARATOR_PROPERTY:
		g_value_set_object (value, graphs_columns_group_get_separator (self));
		break;
		case GRAPHS_COLUMNS_GROUP_SKIP_ROWS_PROPERTY:
		g_value_set_object (value, graphs_columns_group_get_skip_rows (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
graphs_columns_item_group_get_instance_private (GraphsColumnsItemGroup* self)
{
	return G_STRUCT_MEMBER_P (self, GraphsColumnsItemGroup_private_offset);
}

static void
_graphs_columns_item_group_on_settings_changed_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self)
{
	graphs_columns_item_group_on_settings_changed ((GraphsColumnsItemGroup*) self);
}

GraphsColumnsItemGroup*
graphs_columns_item_group_construct (GType object_type,
                                     GraphsColumnsItemSettings* item_settings,
                                     gboolean removable)
{
	GraphsColumnsItemGroup * self = NULL;
	GtkButton* _tmp0_;
	GraphsColumnsItemSettings _tmp1_;
	AdwSwitchRow* _tmp2_;
	AdwSpinRow* _tmp3_;
	AdwSpinRow* _tmp4_;
	AdwEntryRow* _tmp5_;
	AdwSwitchRow* _tmp6_;
	AdwSwitchRow* _tmp7_;
	AdwSpinRow* _tmp8_;
	AdwSpinRow* _tmp9_;
	g_return_val_if_fail (item_settings != NULL, NULL);
	self = (GraphsColumnsItemGroup*) g_object_new (object_type, NULL);
	_tmp0_ = self->priv->_remove_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, removable);
	_tmp1_ = *item_settings;
	graphs_columns_item_group_load_item_settings (self, &_tmp1_);
	_tmp2_ = self->priv->_single_column;
	g_signal_connect_object ((GObject*) _tmp2_, "notify::active", (GCallback) _graphs_columns_item_group_on_settings_changed_g_object_notify, self, 0);
	_tmp3_ = self->priv->_column_x;
	g_signal_connect_object ((GObject*) _tmp3_, "notify::value", (GCallback) _graphs_columns_item_group_on_settings_changed_g_object_notify, self, 0);
	_tmp4_ = self->priv->_column_y;
	g_signal_connect_object ((GObject*) _tmp4_, "notify::value", (GCallback) _graphs_columns_item_group_on_settings_changed_g_object_notify, self, 0);
	_tmp5_ = self->priv->_equation;
	g_signal_connect_object ((GObject*) _tmp5_, "notify::text", (GCallback) _graphs_columns_item_group_on_settings_changed_g_object_notify, self, 0);
	_tmp6_ = self->priv->_use_xerr;
	g_signal_connect_object ((GObject*) _tmp6_, "notify::active", (GCallback) _graphs_columns_item_group_on_settings_changed_g_object_notify, self, 0);
	_tmp7_ = self->priv->_use_yerr;
	g_signal_connect_object ((GObject*) _tmp7_, "notify::active", (GCallback) _graphs_columns_item_group_on_settings_changed_g_object_notify, self, 0);
	_tmp8_ = self->priv->_column_xerr;
	g_signal_connect_object ((GObject*) _tmp8_, "notify::value", (GCallback) _graphs_columns_item_group_on_settings_changed_g_object_notify, self, 0);
	_tmp9_ = self->priv->_column_yerr;
	g_signal_connect_object ((GObject*) _tmp9_, "notify::value", (GCallback) _graphs_columns_item_group_on_settings_changed_g_object_notify, self, 0);
	return self;
}

GraphsColumnsItemGroup*
graphs_columns_item_group_new (GraphsColumnsItemSettings* item_settings,
                               gboolean removable)
{
	return graphs_columns_item_group_construct (GRAPHS_TYPE_COLUMNS_ITEM_GROUP, item_settings, removable);
}

static void
graphs_columns_item_group_load_item_settings (GraphsColumnsItemGroup* self,
                                              GraphsColumnsItemSettings* item_settings)
{
	AdwSpinRow* _tmp0_;
	GraphsColumnsItemSettings _tmp1_;
	AdwSpinRow* _tmp2_;
	GraphsColumnsItemSettings _tmp3_;
	AdwSwitchRow* _tmp4_;
	GraphsColumnsItemSettings _tmp5_;
	AdwEntryRow* _tmp6_;
	GraphsColumnsItemSettings _tmp7_;
	const gchar* _tmp8_;
	AdwSwitchRow* _tmp9_;
	GraphsColumnsItemSettings _tmp10_;
	AdwSwitchRow* _tmp11_;
	GraphsColumnsItemSettings _tmp12_;
	AdwSpinRow* _tmp13_;
	GraphsColumnsItemSettings _tmp14_;
	AdwSpinRow* _tmp15_;
	GraphsColumnsItemSettings _tmp16_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item_settings != NULL);
	_tmp0_ = self->priv->_column_x;
	_tmp1_ = *item_settings;
	adw_spin_row_set_value (_tmp0_, (gdouble) _tmp1_.column_x);
	_tmp2_ = self->priv->_column_y;
	_tmp3_ = *item_settings;
	adw_spin_row_set_value (_tmp2_, (gdouble) _tmp3_.column_y);
	_tmp4_ = self->priv->_single_column;
	_tmp5_ = *item_settings;
	adw_switch_row_set_active (_tmp4_, _tmp5_.single_column);
	_tmp6_ = self->priv->_equation;
	_tmp7_ = *item_settings;
	_tmp8_ = _tmp7_.equation;
	gtk_editable_set_text ((GtkEditable*) _tmp6_, _tmp8_);
	_tmp9_ = self->priv->_use_xerr;
	_tmp10_ = *item_settings;
	adw_switch_row_set_active (_tmp9_, _tmp10_.use_xerr);
	_tmp11_ = self->priv->_use_yerr;
	_tmp12_ = *item_settings;
	adw_switch_row_set_active (_tmp11_, _tmp12_.use_yerr);
	_tmp13_ = self->priv->_column_xerr;
	_tmp14_ = *item_settings;
	adw_spin_row_set_value (_tmp13_, (gdouble) _tmp14_.xerr_index);
	_tmp15_ = self->priv->_column_yerr;
	_tmp16_ = *item_settings;
	adw_spin_row_set_value (_tmp15_, (gdouble) _tmp16_.yerr_index);
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static void
graphs_columns_item_group_get_item_settings (GraphsColumnsItemGroup* self,
                                             GraphsColumnsItemSettings* result)
{
	GraphsColumnsItemSettings item_settings = {0};
	AdwSpinRow* _tmp0_;
	AdwSpinRow* _tmp1_;
	AdwSwitchRow* _tmp2_;
	AdwEntryRow* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	AdwSwitchRow* _tmp6_;
	AdwSwitchRow* _tmp7_;
	AdwSpinRow* _tmp8_;
	AdwSpinRow* _tmp9_;
	g_return_if_fail (self != NULL);
	memset (&item_settings, 0, sizeof (GraphsColumnsItemSettings));
	_tmp0_ = self->priv->_column_x;
	item_settings.column_x = (gint) adw_spin_row_get_value (_tmp0_);
	_tmp1_ = self->priv->_column_y;
	item_settings.column_y = (gint) adw_spin_row_get_value (_tmp1_);
	_tmp2_ = self->priv->_single_column;
	item_settings.single_column = adw_switch_row_get_active (_tmp2_);
	_tmp3_ = self->priv->_equation;
	_tmp4_ = gtk_editable_get_text ((GtkEditable*) _tmp3_);
	_tmp5_ = string_replace (_tmp4_, ";", "");
	_g_free0 (item_settings.equation);
	item_settings.equation = _tmp5_;
	_tmp6_ = self->priv->_use_xerr;
	item_settings.use_xerr = adw_switch_row_get_active (_tmp6_);
	_tmp7_ = self->priv->_use_yerr;
	item_settings.use_yerr = adw_switch_row_get_active (_tmp7_);
	_tmp8_ = self->priv->_column_xerr;
	item_settings.xerr_index = (gint) adw_spin_row_get_value (_tmp8_);
	_tmp9_ = self->priv->_column_yerr;
	item_settings.yerr_index = (gint) adw_spin_row_get_value (_tmp9_);
	*result = item_settings;
	return;
}

static void
graphs_columns_item_group_on_settings_changed (GraphsColumnsItemGroup* self)
{
	GraphsColumnsItemSettings _tmp0_ = {0};
	GraphsColumnsItemSettings _tmp1_;
	g_return_if_fail (self != NULL);
	graphs_columns_item_group_get_item_settings (self, &_tmp0_);
	_tmp1_ = _tmp0_;
	g_signal_emit (self, graphs_columns_item_group_signals[GRAPHS_COLUMNS_ITEM_GROUP_SETTINGS_CHANGED_SIGNAL], 0, &_tmp1_);
	graphs_columns_item_settings_destroy (&_tmp1_);
}

static void
graphs_columns_item_group_on_remove (GraphsColumnsItemGroup* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, graphs_columns_item_group_signals[GRAPHS_COLUMNS_ITEM_GROUP_REMOVE_REQUEST_SIGNAL], 0);
}

static void
_graphs_columns_item_group_on_remove_gtk_button_clicked (GtkButton* _sender,
                                                         gpointer self)
{
	graphs_columns_item_group_on_remove ((GraphsColumnsItemGroup*) self);
}

AdwSpinRow*
graphs_columns_item_group_get_column_x (GraphsColumnsItemGroup* self)
{
	AdwSpinRow* result;
	AdwSpinRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_column_x;
	result = _tmp0_;
	return result;
}

AdwSpinRow*
graphs_columns_item_group_get_column_y (GraphsColumnsItemGroup* self)
{
	AdwSpinRow* result;
	AdwSpinRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_column_y;
	result = _tmp0_;
	return result;
}

AdwSwitchRow*
graphs_columns_item_group_get_single_column (GraphsColumnsItemGroup* self)
{
	AdwSwitchRow* result;
	AdwSwitchRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_single_column;
	result = _tmp0_;
	return result;
}

AdwEntryRow*
graphs_columns_item_group_get_equation (GraphsColumnsItemGroup* self)
{
	AdwEntryRow* result;
	AdwEntryRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_equation;
	result = _tmp0_;
	return result;
}

AdwSwitchRow*
graphs_columns_item_group_get_use_xerr (GraphsColumnsItemGroup* self)
{
	AdwSwitchRow* result;
	AdwSwitchRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_use_xerr;
	result = _tmp0_;
	return result;
}

AdwSwitchRow*
graphs_columns_item_group_get_use_yerr (GraphsColumnsItemGroup* self)
{
	AdwSwitchRow* result;
	AdwSwitchRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_use_yerr;
	result = _tmp0_;
	return result;
}

AdwSpinRow*
graphs_columns_item_group_get_column_xerr (GraphsColumnsItemGroup* self)
{
	AdwSpinRow* result;
	AdwSpinRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_column_xerr;
	result = _tmp0_;
	return result;
}

AdwSpinRow*
graphs_columns_item_group_get_column_yerr (GraphsColumnsItemGroup* self)
{
	AdwSpinRow* result;
	AdwSpinRow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_column_yerr;
	result = _tmp0_;
	return result;
}

GtkButton*
graphs_columns_item_group_get_remove_button (GraphsColumnsItemGroup* self)
{
	GtkButton* result;
	GtkButton* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_remove_button;
	result = _tmp0_;
	return result;
}

static void
graphs_columns_item_group_class_init (GraphsColumnsItemGroupClass * klass,
                                      gpointer klass_data)
{
	graphs_columns_item_group_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GraphsColumnsItemGroup_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_graphs_columns_item_group_get_property;
	G_OBJECT_CLASS (klass)->finalize = graphs_columns_item_group_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_X_PROPERTY, graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_X_PROPERTY] = g_param_spec_object ("column-x", "column-x", "column-x", adw_spin_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_Y_PROPERTY, graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_Y_PROPERTY] = g_param_spec_object ("column-y", "column-y", "column-y", adw_spin_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_ITEM_GROUP_SINGLE_COLUMN_PROPERTY, graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_SINGLE_COLUMN_PROPERTY] = g_param_spec_object ("single-column", "single-column", "single-column", adw_switch_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_ITEM_GROUP_EQUATION_PROPERTY, graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_EQUATION_PROPERTY] = g_param_spec_object ("equation", "equation", "equation", adw_entry_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_ITEM_GROUP_USE_XERR_PROPERTY, graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_USE_XERR_PROPERTY] = g_param_spec_object ("use-xerr", "use-xerr", "use-xerr", adw_switch_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_ITEM_GROUP_USE_YERR_PROPERTY, graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_USE_YERR_PROPERTY] = g_param_spec_object ("use-yerr", "use-yerr", "use-yerr", adw_switch_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_XERR_PROPERTY, graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_XERR_PROPERTY] = g_param_spec_object ("column-xerr", "column-xerr", "column-xerr", adw_spin_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_YERR_PROPERTY, graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_YERR_PROPERTY] = g_param_spec_object ("column-yerr", "column-yerr", "column-yerr", adw_spin_row_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GRAPHS_COLUMNS_ITEM_GROUP_REMOVE_BUTTON_PROPERTY, graphs_columns_item_group_properties[GRAPHS_COLUMNS_ITEM_GROUP_REMOVE_BUTTON_PROPERTY] = g_param_spec_object ("remove-button", "remove-button", "remove-button", gtk_button_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/se/sjoerd/Graphs/ui/import/columns/item-group.ui");
	graphs_columns_item_group_signals[GRAPHS_COLUMNS_ITEM_GROUP_SETTINGS_CHANGED_SIGNAL] = g_signal_new ("settings-changed", GRAPHS_TYPE_COLUMNS_ITEM_GROUP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, GRAPHS_TYPE_COLUMNS_ITEM_SETTINGS);
	graphs_columns_item_group_signals[GRAPHS_COLUMNS_ITEM_GROUP_REMOVE_REQUEST_SIGNAL] = g_signal_new ("remove-request", GRAPHS_TYPE_COLUMNS_ITEM_GROUP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "column_x", FALSE, GraphsColumnsItemGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsItemGroupPrivate, _column_x));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "column_y", FALSE, GraphsColumnsItemGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsItemGroupPrivate, _column_y));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "single_column", FALSE, GraphsColumnsItemGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsItemGroupPrivate, _single_column));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "equation", FALSE, GraphsColumnsItemGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsItemGroupPrivate, _equation));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "use_xerr", FALSE, GraphsColumnsItemGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsItemGroupPrivate, _use_xerr));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "use_yerr", FALSE, GraphsColumnsItemGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsItemGroupPrivate, _use_yerr));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "column_xerr", FALSE, GraphsColumnsItemGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsItemGroupPrivate, _column_xerr));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "column_yerr", FALSE, GraphsColumnsItemGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsItemGroupPrivate, _column_yerr));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "remove_button", FALSE, GraphsColumnsItemGroup_private_offset + G_STRUCT_OFFSET (GraphsColumnsItemGroupPrivate, _remove_button));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_remove", G_CALLBACK(_graphs_columns_item_group_on_remove_gtk_button_clicked));
}

static void
graphs_columns_item_group_instance_init (GraphsColumnsItemGroup * self,
                                         gpointer klass)
{
	self->priv = graphs_columns_item_group_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
graphs_columns_item_group_finalize (GObject * obj)
{
	GraphsColumnsItemGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GRAPHS_TYPE_COLUMNS_ITEM_GROUP, GraphsColumnsItemGroup);
	G_OBJECT_CLASS (graphs_columns_item_group_parent_class)->finalize (obj);
}

static GType
graphs_columns_item_group_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GraphsColumnsItemGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) graphs_columns_item_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GraphsColumnsItemGroup), 0, (GInstanceInitFunc) graphs_columns_item_group_instance_init, NULL };
	GType graphs_columns_item_group_type_id;
	graphs_columns_item_group_type_id = g_type_register_static (adw_preferences_group_get_type (), "GraphsColumnsItemGroup", &g_define_type_info, 0);
	GraphsColumnsItemGroup_private_offset = g_type_add_instance_private (graphs_columns_item_group_type_id, sizeof (GraphsColumnsItemGroupPrivate));
	return graphs_columns_item_group_type_id;
}

GType
graphs_columns_item_group_get_type (void)
{
	static volatile gsize graphs_columns_item_group_type_id__once = 0;
	if (g_once_init_enter (&graphs_columns_item_group_type_id__once)) {
		GType graphs_columns_item_group_type_id;
		graphs_columns_item_group_type_id = graphs_columns_item_group_get_type_once ();
		g_once_init_leave (&graphs_columns_item_group_type_id__once, graphs_columns_item_group_type_id);
	}
	return graphs_columns_item_group_type_id__once;
}

static void
_vala_graphs_columns_item_group_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	GraphsColumnsItemGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GRAPHS_TYPE_COLUMNS_ITEM_GROUP, GraphsColumnsItemGroup);
	switch (property_id) {
		case GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_X_PROPERTY:
		g_value_set_object (value, graphs_columns_item_group_get_column_x (self));
		break;
		case GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_Y_PROPERTY:
		g_value_set_object (value, graphs_columns_item_group_get_column_y (self));
		break;
		case GRAPHS_COLUMNS_ITEM_GROUP_SINGLE_COLUMN_PROPERTY:
		g_value_set_object (value, graphs_columns_item_group_get_single_column (self));
		break;
		case GRAPHS_COLUMNS_ITEM_GROUP_EQUATION_PROPERTY:
		g_value_set_object (value, graphs_columns_item_group_get_equation (self));
		break;
		case GRAPHS_COLUMNS_ITEM_GROUP_USE_XERR_PROPERTY:
		g_value_set_object (value, graphs_columns_item_group_get_use_xerr (self));
		break;
		case GRAPHS_COLUMNS_ITEM_GROUP_USE_YERR_PROPERTY:
		g_value_set_object (value, graphs_columns_item_group_get_use_yerr (self));
		break;
		case GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_XERR_PROPERTY:
		g_value_set_object (value, graphs_columns_item_group_get_column_xerr (self));
		break;
		case GRAPHS_COLUMNS_ITEM_GROUP_COLUMN_YERR_PROPERTY:
		g_value_set_object (value, graphs_columns_item_group_get_column_yerr (self));
		break;
		case GRAPHS_COLUMNS_ITEM_GROUP_REMOVE_BUTTON_PROPERTY:
		g_value_set_object (value, graphs_columns_item_group_get_remove_button (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

