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

/* 
 * Copyright (C) 2011-2017 Daiki Ueno <ueno@gnu.org>
 * Copyright (C) 2011-2017 Red Hat, Inc.
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */

#include <glib-object.h>
#include <gtk/gtk.h>
#include <libutil.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <config.h>
#include <float.h>
#include <math.h>
#include <libskk/libskk.h>
#include <gee.h>
#include <ibus.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#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_SETUP (setup_get_type ())
#define SETUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SETUP, Setup))
#define SETUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SETUP, SetupClass))
#define IS_SETUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SETUP))
#define IS_SETUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SETUP))
#define SETUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SETUP, SetupClass))

typedef struct _Setup Setup;
typedef struct _SetupClass SetupClass;
typedef struct _SetupPrivate SetupPrivate;
enum  {
	SETUP_0_PROPERTY,
	SETUP_NUM_PROPERTIES
};
static GParamSpec* setup_properties[SETUP_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define SETUP_TYPE_TYPECELL_RENDERER (setup_typecell_renderer_get_type ())
#define SETUP_TYPECELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETUP_TYPE_TYPECELL_RENDERER, SetupTypeCellRenderer))
#define SETUP_TYPECELL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SETUP_TYPE_TYPECELL_RENDERER, SetupTypeCellRendererClass))
#define SETUP_IS_TYPECELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SETUP_TYPE_TYPECELL_RENDERER))
#define SETUP_IS_TYPECELL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SETUP_TYPE_TYPECELL_RENDERER))
#define SETUP_TYPECELL_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SETUP_TYPE_TYPECELL_RENDERER, SetupTypeCellRendererClass))

typedef struct _SetupTypeCellRenderer SetupTypeCellRenderer;
typedef struct _SetupTypeCellRendererClass SetupTypeCellRendererClass;

#define SETUP_TYPE_DESC_CELL_RENDERER (setup_desc_cell_renderer_get_type ())
#define SETUP_DESC_CELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SETUP_TYPE_DESC_CELL_RENDERER, SetupDescCellRenderer))
#define SETUP_DESC_CELL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SETUP_TYPE_DESC_CELL_RENDERER, SetupDescCellRendererClass))
#define SETUP_IS_DESC_CELL_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SETUP_TYPE_DESC_CELL_RENDERER))
#define SETUP_IS_DESC_CELL_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SETUP_TYPE_DESC_CELL_RENDERER))
#define SETUP_DESC_CELL_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SETUP_TYPE_DESC_CELL_RENDERER, SetupDescCellRendererClass))

typedef struct _SetupDescCellRenderer SetupDescCellRenderer;
typedef struct _SetupDescCellRendererClass SetupDescCellRendererClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define __vala_GtkTreePath_free0(var) ((var == NULL) ? NULL : (var = (_vala_GtkTreePath_free (var), NULL)))
typedef struct _SetupTypeCellRendererPrivate SetupTypeCellRendererPrivate;
enum  {
	SETUP_TYPECELL_RENDERER_0_PROPERTY,
	SETUP_TYPECELL_RENDERER_PLIST_PROPERTY,
	SETUP_TYPECELL_RENDERER_NUM_PROPERTIES
};
static GParamSpec* setup_typecell_renderer_properties[SETUP_TYPECELL_RENDERER_NUM_PROPERTIES];
typedef struct _SetupDescCellRendererPrivate SetupDescCellRendererPrivate;
enum  {
	SETUP_DESC_CELL_RENDERER_0_PROPERTY,
	SETUP_DESC_CELL_RENDERER_PLIST_PROPERTY,
	SETUP_DESC_CELL_RENDERER_NUM_PROPERTIES
};
static GParamSpec* setup_desc_cell_renderer_properties[SETUP_DESC_CELL_RENDERER_NUM_PROPERTIES];
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _Setup {
	GObject parent_instance;
	SetupPrivate * priv;
};

struct _SetupClass {
	GObjectClass parent_class;
};

struct _SetupPrivate {
	GtkDialog* dialog;
	GtkTreeView* dictionaries_treeview;
	GtkEntry* auto_start_henkan_keywords_entry;
	GtkComboBox* period_style_combobox;
	GtkSpinButton* page_size_spinbutton;
	GtkSpinButton* pagination_start_spinbutton;
	GtkCheckButton* show_annotation_checkbutton;
	GtkComboBox* initial_input_mode_combobox;
	GtkCheckButton* egg_like_newline_checkbutton;
	GtkComboBox* typing_rule_combobox;
	GtkDialog* dict_dialog;
	GtkComboBox* dict_type_combobox;
	GtkHBox* dict_data_hbox;
	GtkWidget* dict_data_widget;
	GtkFileChooserButton* dict_filechooserbutton;
	GtkEntry* dict_entry;
	GtkSpinButton* dict_spinbutton;
	Preferences* preferences;
};

struct _Block1Data {
	int _ref_count_;
	Setup* self;
	GtkButton* remove_dict_button;
	GtkButton* up_dict_button;
	GtkButton* down_dict_button;
	GtkTreeSelection* selection;
};

struct _SetupTypeCellRenderer {
	GtkCellRendererText parent_instance;
	SetupTypeCellRendererPrivate * priv;
};

struct _SetupTypeCellRendererClass {
	GtkCellRendererTextClass parent_class;
};

struct _SetupTypeCellRendererPrivate {
	PList* _plist;
};

struct _SetupDescCellRenderer {
	GtkCellRendererText parent_instance;
	SetupDescCellRendererPrivate * priv;
};

struct _SetupDescCellRendererClass {
	GtkCellRendererTextClass parent_class;
};

struct _SetupDescCellRendererPrivate {
	PList* _plist;
};

static gint Setup_private_offset;
static gpointer setup_parent_class = NULL;
static gint SetupTypeCellRenderer_private_offset;
static gpointer setup_typecell_renderer_parent_class = NULL;
static gint SetupDescCellRenderer_private_offset;
static gpointer setup_desc_cell_renderer_parent_class = NULL;

VALA_EXTERN GType setup_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Setup, g_object_unref)
VALA_EXTERN Setup* setup_new (Preferences* preferences);
VALA_EXTERN Setup* setup_construct (GType object_type,
                        Preferences* preferences);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static SetupTypeCellRenderer* setup_typecell_renderer_new (void);
static SetupTypeCellRenderer* setup_typecell_renderer_construct (GType object_type);
static GType setup_typecell_renderer_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SetupTypeCellRenderer, g_object_unref)
static SetupDescCellRenderer* setup_desc_cell_renderer_new (void);
static SetupDescCellRenderer* setup_desc_cell_renderer_construct (GType object_type);
static GType setup_desc_cell_renderer_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SetupDescCellRenderer, g_object_unref)
static void setup_load (Setup* self);
static void setup_add_dict (Setup* self);
static void _setup_add_dict_gtk_button_clicked (GtkButton* _sender,
                                         gpointer self);
static void setup_remove_dict (Setup* self);
static void _setup_remove_dict_gtk_button_clicked (GtkButton* _sender,
                                            gpointer self);
static void setup_up_dict (Setup* self);
static void _setup_up_dict_gtk_button_clicked (GtkButton* _sender,
                                        gpointer self);
static void setup_down_dict (Setup* self);
static void _setup_down_dict_gtk_button_clicked (GtkButton* _sender,
                                          gpointer self);
static void __lambda4_ (Block1Data* _data1_);
static void ___lambda4__gtk_tree_selection_changed (GtkTreeSelection* _sender,
                                             gpointer self);
static void __lambda5_ (Setup* self);
static gchar* setup_get_active_dict_type (Setup* self);
static void ___lambda5__gtk_combo_box_changed (GtkComboBox* _sender,
                                        gpointer self);
static void _vala_SkkRuleMetadata_array_free (SkkRuleMetadata * array,
                                       gssize array_length);
static void setup_populate_dictionaries_treeview (Setup* self);
static GtkTreePath* _vala_GtkTreePath_copy (GtkTreePath* self);
static void _vala_GtkTreePath_free (GtkTreePath* self);
static void __vala_GtkTreePath_free0_ (gpointer var);
static inline void _g_list_free___vala_GtkTreePath_free0_ (GList* self);
static void setup_load_combobox (Setup* self,
                          const gchar* name,
                          GtkComboBox* combo,
                          gint column);
static void setup_save_dictionaries (Setup* self,
                              const gchar* name);
static GVariant* _variant_new1 (gchar** value,
                         gint value_length1);
static void setup_save_combobox (Setup* self,
                          const gchar* name,
                          GtkComboBox* combo,
                          gint column);
static GVariant* _variant_new2 (gint value);
static void setup_save (Setup* self);
static GVariant* _variant_new3 (gchar** value,
                         gint value_length1);
static GVariant* _variant_new4 (gboolean value);
static GVariant* _variant_new5 (gint value);
static GVariant* _variant_new6 (gint value);
static GVariant* _variant_new7 (gboolean value);
static GVariant* _variant_new8 (const gchar* value);
VALA_EXTERN void setup_run (Setup* self);
static gint setup_main (gchar** args,
                 gint args_length1);
static PList* setup_typecell_renderer_get_plist (SetupTypeCellRenderer* self);
static void setup_typecell_renderer_set_plist (SetupTypeCellRenderer* self,
                                        PList* value);
static void setup_typecell_renderer_finalize (GObject * obj);
static GType setup_typecell_renderer_get_type_once (void);
static void _vala_setup_typecell_renderer_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec);
static void _vala_setup_typecell_renderer_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec);
static PList* setup_desc_cell_renderer_get_plist (SetupDescCellRenderer* self);
static void setup_desc_cell_renderer_set_plist (SetupDescCellRenderer* self,
                                         PList* value);
static void setup_desc_cell_renderer_finalize (GObject * obj);
static GType setup_desc_cell_renderer_get_type_once (void);
static void _vala_setup_desc_cell_renderer_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec);
static void _vala_setup_desc_cell_renderer_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec);
static void setup_finalize (GObject * obj);
static GType setup_get_type_once (void);
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
setup_get_instance_private (Setup* self)
{
	return G_STRUCT_MEMBER_P (self, Setup_private_offset);
}

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_)) {
		Setup* self;
		self = _data1_->self;
		_g_object_unref0 (_data1_->selection);
		_g_object_unref0 (_data1_->down_dict_button);
		_g_object_unref0 (_data1_->up_dict_button);
		_g_object_unref0 (_data1_->remove_dict_button);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

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

static void
_setup_add_dict_gtk_button_clicked (GtkButton* _sender,
                                    gpointer self)
{
	setup_add_dict ((Setup*) self);
}

static void
_setup_remove_dict_gtk_button_clicked (GtkButton* _sender,
                                       gpointer self)
{
	setup_remove_dict ((Setup*) self);
}

static void
_setup_up_dict_gtk_button_clicked (GtkButton* _sender,
                                   gpointer self)
{
	setup_up_dict ((Setup*) self);
}

static void
_setup_down_dict_gtk_button_clicked (GtkButton* _sender,
                                     gpointer self)
{
	setup_down_dict ((Setup*) self);
}

static void
__lambda4_ (Block1Data* _data1_)
{
	Setup* self;
	gint count = 0;
	self = _data1_->self;
	count = gtk_tree_selection_count_selected_rows (_data1_->selection);
	if (count > 0) {
		GtkButton* _tmp0_;
		GtkButton* _tmp1_;
		GtkButton* _tmp2_;
		_tmp0_ = _data1_->remove_dict_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, TRUE);
		_tmp1_ = _data1_->up_dict_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp1_, TRUE);
		_tmp2_ = _data1_->down_dict_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp2_, TRUE);
	} else {
		if (count == 0) {
			GtkButton* _tmp3_;
			GtkButton* _tmp4_;
			GtkButton* _tmp5_;
			_tmp3_ = _data1_->remove_dict_button;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, FALSE);
			_tmp4_ = _data1_->up_dict_button;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, FALSE);
			_tmp5_ = _data1_->down_dict_button;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, FALSE);
		}
	}
}

static void
___lambda4__gtk_tree_selection_changed (GtkTreeSelection* _sender,
                                        gpointer self)
{
	__lambda4_ (self);
}

static void
__lambda5_ (Setup* self)
{
	GtkWidget* _tmp0_;
	gchar* text = NULL;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	GtkHBox* _tmp31_;
	GtkWidget* _tmp32_;
	GtkHBox* _tmp33_;
	GtkHBox* _tmp34_;
	_tmp0_ = self->priv->dict_data_widget;
	if (_tmp0_ != NULL) {
		GtkHBox* _tmp1_;
		GtkWidget* _tmp2_;
		_tmp1_ = self->priv->dict_data_hbox;
		_tmp2_ = self->priv->dict_data_widget;
		gtk_container_remove ((GtkContainer*) _tmp1_, _tmp2_);
	}
	_tmp3_ = setup_get_active_dict_type (self);
	text = _tmp3_;
	_tmp4_ = text;
	if (g_strcmp0 (_tmp4_, "System") == 0) {
		GtkFileChooserButton* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		GtkFileChooserButton* _tmp8_;
		GtkWidget* _tmp9_;
		_tmp5_ = self->priv->dict_filechooserbutton;
		_tmp6_ = g_build_filename (DATADIR, "skk", NULL);
		_tmp7_ = _tmp6_;
		gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp5_, _tmp7_);
		_g_free0 (_tmp7_);
		_tmp8_ = self->priv->dict_filechooserbutton;
		_tmp9_ = _g_object_ref0 ((GtkWidget*) _tmp8_);
		_g_object_unref0 (self->priv->dict_data_widget);
		self->priv->dict_data_widget = _tmp9_;
	} else {
		const gchar* _tmp10_;
		_tmp10_ = text;
		if (g_strcmp0 (_tmp10_, "User") == 0) {
			GtkFileChooserButton* _tmp11_;
			const gchar* _tmp12_;
			GtkFileChooserButton* _tmp13_;
			GtkWidget* _tmp14_;
			_tmp11_ = self->priv->dict_filechooserbutton;
			_tmp12_ = g_get_home_dir ();
			gtk_file_chooser_set_current_folder ((GtkFileChooser*) _tmp11_, _tmp12_);
			_tmp13_ = self->priv->dict_filechooserbutton;
			_tmp14_ = _g_object_ref0 ((GtkWidget*) _tmp13_);
			_g_object_unref0 (self->priv->dict_data_widget);
			self->priv->dict_data_widget = _tmp14_;
		} else {
			const gchar* _tmp15_;
			_tmp15_ = text;
			if (g_strcmp0 (_tmp15_, "SKK Server") == 0) {
				GtkHBox* hbox = NULL;
				GtkHBox* _tmp16_;
				GtkHBox* _tmp17_;
				GtkLabel* _tmp18_;
				GtkLabel* _tmp19_;
				GtkHBox* _tmp20_;
				GtkEntry* _tmp21_;
				GtkEntry* _tmp22_;
				GtkHBox* _tmp23_;
				GtkLabel* _tmp24_;
				GtkLabel* _tmp25_;
				GtkHBox* _tmp26_;
				GtkSpinButton* _tmp27_;
				GtkSpinButton* _tmp28_;
				GtkHBox* _tmp29_;
				GtkWidget* _tmp30_;
				_tmp16_ = (GtkHBox*) gtk_hbox_new (FALSE, 2);
				g_object_ref_sink (_tmp16_);
				hbox = _tmp16_;
				_tmp17_ = hbox;
				_tmp18_ = (GtkLabel*) gtk_label_new ("Host:");
				g_object_ref_sink (_tmp18_);
				_tmp19_ = _tmp18_;
				gtk_box_pack_start ((GtkBox*) _tmp17_, (GtkWidget*) _tmp19_, FALSE, FALSE, (guint) 0);
				_g_object_unref0 (_tmp19_);
				_tmp20_ = hbox;
				_tmp21_ = self->priv->dict_entry;
				gtk_box_pack_start ((GtkBox*) _tmp20_, (GtkWidget*) _tmp21_, FALSE, FALSE, (guint) 0);
				_tmp22_ = self->priv->dict_entry;
				gtk_entry_set_text (_tmp22_, "localhost");
				_tmp23_ = hbox;
				_tmp24_ = (GtkLabel*) gtk_label_new ("Port:");
				g_object_ref_sink (_tmp24_);
				_tmp25_ = _tmp24_;
				gtk_box_pack_start ((GtkBox*) _tmp23_, (GtkWidget*) _tmp25_, FALSE, FALSE, (guint) 0);
				_g_object_unref0 (_tmp25_);
				_tmp26_ = hbox;
				_tmp27_ = self->priv->dict_spinbutton;
				gtk_box_pack_start ((GtkBox*) _tmp26_, (GtkWidget*) _tmp27_, FALSE, FALSE, (guint) 0);
				_tmp28_ = self->priv->dict_spinbutton;
				gtk_spin_button_set_value (_tmp28_, (gdouble) 1178);
				_tmp29_ = hbox;
				_tmp30_ = _g_object_ref0 ((GtkWidget*) _tmp29_);
				_g_object_unref0 (self->priv->dict_data_widget);
				self->priv->dict_data_widget = _tmp30_;
				_g_object_unref0 (hbox);
			} else {
				g_assert_not_reached ();
			}
		}
	}
	_tmp31_ = self->priv->dict_data_hbox;
	_tmp32_ = self->priv->dict_data_widget;
	gtk_container_add ((GtkContainer*) _tmp31_, _tmp32_);
	_tmp33_ = self->priv->dict_data_hbox;
	gtk_widget_show_all ((GtkWidget*) _tmp33_);
	_tmp34_ = self->priv->dict_data_hbox;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp34_, TRUE);
	_g_free0 (text);
}

static void
___lambda5__gtk_combo_box_changed (GtkComboBox* _sender,
                                   gpointer self)
{
	__lambda5_ ((Setup*) self);
}

static void
_vala_SkkRuleMetadata_array_free (SkkRuleMetadata * array,
                                  gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			skk_rule_metadata_destroy (&array[i]);
		}
	}
	g_free (array);
}

Setup*
setup_construct (GType object_type,
                 Preferences* preferences)
{
	Setup * self = NULL;
	Block1Data* _data1_;
	Preferences* _tmp0_;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp1_;
	gchar* ui_filename = NULL;
	gchar* _tmp2_;
	GObject* object = NULL;
	GObject* _tmp4_;
	GObject* _tmp5_;
	GObject* _tmp6_;
	GObject* _tmp7_;
	GtkDialog* _tmp8_;
	GObject* _tmp9_;
	GObject* _tmp10_;
	GObject* _tmp11_;
	GObject* _tmp12_;
	GtkTreeView* _tmp13_;
	GObject* _tmp14_;
	GObject* _tmp15_;
	GObject* _tmp16_;
	GObject* _tmp17_;
	GtkEntry* _tmp18_;
	GObject* _tmp19_;
	GObject* _tmp20_;
	GObject* _tmp21_;
	GObject* _tmp22_;
	GtkCheckButton* _tmp23_;
	GObject* _tmp24_;
	GObject* _tmp25_;
	GObject* _tmp26_;
	GObject* _tmp27_;
	GtkComboBox* _tmp28_;
	GObject* _tmp29_;
	GObject* _tmp30_;
	GObject* _tmp31_;
	GObject* _tmp32_;
	GtkSpinButton* _tmp33_;
	GObject* _tmp34_;
	GObject* _tmp35_;
	GObject* _tmp36_;
	GObject* _tmp37_;
	GtkSpinButton* _tmp38_;
	GObject* _tmp39_;
	GObject* _tmp40_;
	GObject* _tmp41_;
	GObject* _tmp42_;
	GtkCheckButton* _tmp43_;
	GObject* _tmp44_;
	GObject* _tmp45_;
	GObject* _tmp46_;
	GObject* _tmp47_;
	GtkComboBox* _tmp48_;
	GObject* _tmp49_;
	GObject* _tmp50_;
	GObject* _tmp51_;
	GObject* _tmp52_;
	GtkCheckButton* _tmp53_;
	GObject* _tmp54_;
	GObject* _tmp55_;
	GObject* _tmp56_;
	GObject* _tmp57_;
	GtkComboBox* _tmp58_;
	GObject* _tmp59_;
	GObject* _tmp60_;
	GObject* _tmp61_;
	GtkButton* add_dict_button = NULL;
	GObject* _tmp62_;
	GtkButton* _tmp63_;
	GObject* _tmp64_;
	GObject* _tmp65_;
	GObject* _tmp66_;
	GObject* _tmp67_;
	GtkButton* _tmp68_;
	GObject* _tmp69_;
	GObject* _tmp70_;
	GObject* _tmp71_;
	GObject* _tmp72_;
	GtkButton* _tmp73_;
	GObject* _tmp74_;
	GObject* _tmp75_;
	GObject* _tmp76_;
	GObject* _tmp77_;
	GtkButton* _tmp78_;
	GObject* _tmp79_;
	GObject* _tmp80_;
	GObject* _tmp81_;
	GObject* _tmp82_;
	GtkDialog* _tmp83_;
	GObject* _tmp84_;
	GObject* _tmp85_;
	GObject* _tmp86_;
	GObject* _tmp87_;
	GtkComboBox* _tmp88_;
	GObject* _tmp89_;
	GObject* _tmp90_;
	GObject* _tmp91_;
	GObject* _tmp92_;
	GtkHBox* _tmp93_;
	GtkFileChooserButton* _tmp94_;
	GtkEntry* _tmp95_;
	GtkSpinButton* _tmp96_;
	GtkListStore* model = NULL;
	GtkCellRenderer* renderer = NULL;
	GtkTreeViewColumn* column = NULL;
	GtkListStore* _tmp97_;
	GtkTreeView* _tmp98_;
	GtkListStore* _tmp99_;
	SetupTypeCellRenderer* _tmp100_;
	GtkCellRenderer* _tmp101_;
	GtkTreeViewColumn* _tmp102_;
	GtkTreeView* _tmp103_;
	GtkTreeViewColumn* _tmp104_;
	SetupDescCellRenderer* _tmp105_;
	GtkCellRenderer* _tmp106_;
	GtkTreeViewColumn* _tmp107_;
	GtkTreeView* _tmp108_;
	GtkTreeViewColumn* _tmp109_;
	GtkCellRendererText* _tmp110_;
	GtkComboBox* _tmp111_;
	GtkCellRenderer* _tmp112_;
	GtkComboBox* _tmp113_;
	GtkCellRenderer* _tmp114_;
	GtkCellRendererText* _tmp115_;
	GtkComboBox* _tmp116_;
	GtkCellRenderer* _tmp117_;
	GtkComboBox* _tmp118_;
	GtkCellRenderer* _tmp119_;
	GtkCellRendererText* _tmp120_;
	GtkComboBox* _tmp121_;
	GtkCellRenderer* _tmp122_;
	GtkComboBox* _tmp123_;
	GtkCellRenderer* _tmp124_;
	GtkListStore* _tmp125_;
	GtkListStore* _tmp126_;
	GtkComboBox* _tmp127_;
	GtkListStore* _tmp128_;
	SkkRuleMetadata* rules = NULL;
	gint _tmp129_ = 0;
	SkkRuleMetadata* _tmp130_;
	gint rules_length1;
	gint _rules_size_;
	SkkRuleMetadata* _tmp131_;
	gint _tmp131__length1;
	GtkCellRendererText* _tmp144_;
	GtkComboBox* _tmp145_;
	GtkCellRenderer* _tmp146_;
	GtkComboBox* _tmp147_;
	GtkCellRenderer* _tmp148_;
	GtkButton* _tmp149_;
	GtkButton* _tmp150_;
	GtkButton* _tmp151_;
	GtkButton* _tmp152_;
	GtkTreeView* _tmp153_;
	GtkTreeSelection* _tmp154_;
	GtkTreeSelection* _tmp155_;
	GtkComboBox* _tmp156_;
	GtkComboBox* _tmp157_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (preferences != NULL, NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	self = (Setup*) g_object_new (object_type, NULL);
	_data1_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (preferences);
	_g_object_unref0 (self->priv->preferences);
	self->priv->preferences = _tmp0_;
	_tmp1_ = gtk_builder_new ();
	builder = _tmp1_;
	gtk_builder_set_translation_domain (builder, "ibus-skk");
	_tmp2_ = g_build_filename (SETUPDIR, "ibus-skk-preferences.ui", NULL);
	ui_filename = _tmp2_;
	{
		gtk_builder_add_from_file (builder, ui_filename, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		const gchar* _tmp3_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e->message;
		g_error ("setup.vala:56: can't load %s: %s", ui_filename, _tmp3_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (ui_filename);
		_g_object_unref0 (builder);
		block1_data_unref (_data1_);
		_data1_ = NULL;
		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;
	}
	_tmp4_ = gtk_builder_get_object (builder, "dialog");
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_g_object_unref0 (object);
	object = _tmp5_;
	_tmp6_ = object;
	_vala_assert (_tmp6_ != NULL, "object != null");
	_tmp7_ = object;
	_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_dialog_get_type (), GtkDialog));
	_g_object_unref0 (self->priv->dialog);
	self->priv->dialog = _tmp8_;
	_tmp9_ = gtk_builder_get_object (builder, "dictionaries_treeview");
	_tmp10_ = _g_object_ref0 (_tmp9_);
	_g_object_unref0 (object);
	object = _tmp10_;
	_tmp11_ = object;
	_vala_assert (_tmp11_ != NULL, "object != null");
	_tmp12_ = object;
	_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_tree_view_get_type (), GtkTreeView));
	_g_object_unref0 (self->priv->dictionaries_treeview);
	self->priv->dictionaries_treeview = _tmp13_;
	_tmp14_ = gtk_builder_get_object (builder, "auto_start_henkan_keywords_entry");
	_tmp15_ = _g_object_ref0 (_tmp14_);
	_g_object_unref0 (object);
	object = _tmp15_;
	_tmp16_ = object;
	_vala_assert (_tmp16_ != NULL, "object != null");
	_tmp17_ = object;
	_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_entry_get_type (), GtkEntry));
	_g_object_unref0 (self->priv->auto_start_henkan_keywords_entry);
	self->priv->auto_start_henkan_keywords_entry = _tmp18_;
	_tmp19_ = gtk_builder_get_object (builder, "egg_like_newline_checkbutton");
	_tmp20_ = _g_object_ref0 (_tmp19_);
	_g_object_unref0 (object);
	object = _tmp20_;
	_tmp21_ = object;
	_vala_assert (_tmp21_ != NULL, "object != null");
	_tmp22_ = object;
	_tmp23_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_check_button_get_type (), GtkCheckButton));
	_g_object_unref0 (self->priv->egg_like_newline_checkbutton);
	self->priv->egg_like_newline_checkbutton = _tmp23_;
	_tmp24_ = gtk_builder_get_object (builder, "period_style_combobox");
	_tmp25_ = _g_object_ref0 (_tmp24_);
	_g_object_unref0 (object);
	object = _tmp25_;
	_tmp26_ = object;
	_vala_assert (_tmp26_ != NULL, "object != null");
	_tmp27_ = object;
	_tmp28_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, gtk_combo_box_get_type (), GtkComboBox));
	_g_object_unref0 (self->priv->period_style_combobox);
	self->priv->period_style_combobox = _tmp28_;
	_tmp29_ = gtk_builder_get_object (builder, "page_size_spinbutton");
	_tmp30_ = _g_object_ref0 (_tmp29_);
	_g_object_unref0 (object);
	object = _tmp30_;
	_tmp31_ = object;
	_vala_assert (_tmp31_ != NULL, "object != null");
	_tmp32_ = object;
	_tmp33_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, gtk_spin_button_get_type (), GtkSpinButton));
	_g_object_unref0 (self->priv->page_size_spinbutton);
	self->priv->page_size_spinbutton = _tmp33_;
	_tmp34_ = gtk_builder_get_object (builder, "pagination_start_spinbutton");
	_tmp35_ = _g_object_ref0 (_tmp34_);
	_g_object_unref0 (object);
	object = _tmp35_;
	_tmp36_ = object;
	_vala_assert (_tmp36_ != NULL, "object != null");
	_tmp37_ = object;
	_tmp38_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, gtk_spin_button_get_type (), GtkSpinButton));
	_g_object_unref0 (self->priv->pagination_start_spinbutton);
	self->priv->pagination_start_spinbutton = _tmp38_;
	_tmp39_ = gtk_builder_get_object (builder, "show_annotation_checkbutton");
	_tmp40_ = _g_object_ref0 (_tmp39_);
	_g_object_unref0 (object);
	object = _tmp40_;
	_tmp41_ = object;
	_vala_assert (_tmp41_ != NULL, "object != null");
	_tmp42_ = object;
	_tmp43_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, gtk_check_button_get_type (), GtkCheckButton));
	_g_object_unref0 (self->priv->show_annotation_checkbutton);
	self->priv->show_annotation_checkbutton = _tmp43_;
	_tmp44_ = gtk_builder_get_object (builder, "initial_input_mode_combobox");
	_tmp45_ = _g_object_ref0 (_tmp44_);
	_g_object_unref0 (object);
	object = _tmp45_;
	_tmp46_ = object;
	_vala_assert (_tmp46_ != NULL, "object != null");
	_tmp47_ = object;
	_tmp48_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, gtk_combo_box_get_type (), GtkComboBox));
	_g_object_unref0 (self->priv->initial_input_mode_combobox);
	self->priv->initial_input_mode_combobox = _tmp48_;
	_tmp49_ = gtk_builder_get_object (builder, "egg_like_newline_checkbutton");
	_tmp50_ = _g_object_ref0 (_tmp49_);
	_g_object_unref0 (object);
	object = _tmp50_;
	_tmp51_ = object;
	_vala_assert (_tmp51_ != NULL, "object != null");
	_tmp52_ = object;
	_tmp53_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, gtk_check_button_get_type (), GtkCheckButton));
	_g_object_unref0 (self->priv->egg_like_newline_checkbutton);
	self->priv->egg_like_newline_checkbutton = _tmp53_;
	_tmp54_ = gtk_builder_get_object (builder, "typing_rule_combobox");
	_tmp55_ = _g_object_ref0 (_tmp54_);
	_g_object_unref0 (object);
	object = _tmp55_;
	_tmp56_ = object;
	_vala_assert (_tmp56_ != NULL, "object != null");
	_tmp57_ = object;
	_tmp58_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp57_, gtk_combo_box_get_type (), GtkComboBox));
	_g_object_unref0 (self->priv->typing_rule_combobox);
	self->priv->typing_rule_combobox = _tmp58_;
	_tmp59_ = gtk_builder_get_object (builder, "add_dict_button");
	_tmp60_ = _g_object_ref0 (_tmp59_);
	_g_object_unref0 (object);
	object = _tmp60_;
	_tmp61_ = object;
	_vala_assert (_tmp61_ != NULL, "object != null");
	_tmp62_ = object;
	_tmp63_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_button_get_type (), GtkButton));
	add_dict_button = _tmp63_;
	_tmp64_ = gtk_builder_get_object (builder, "remove_dict_button");
	_tmp65_ = _g_object_ref0 (_tmp64_);
	_g_object_unref0 (object);
	object = _tmp65_;
	_tmp66_ = object;
	_vala_assert (_tmp66_ != NULL, "object != null");
	_tmp67_ = object;
	_tmp68_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, gtk_button_get_type (), GtkButton));
	_data1_->remove_dict_button = _tmp68_;
	_tmp69_ = gtk_builder_get_object (builder, "up_dict_button");
	_tmp70_ = _g_object_ref0 (_tmp69_);
	_g_object_unref0 (object);
	object = _tmp70_;
	_tmp71_ = object;
	_vala_assert (_tmp71_ != NULL, "object != null");
	_tmp72_ = object;
	_tmp73_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp72_, gtk_button_get_type (), GtkButton));
	_data1_->up_dict_button = _tmp73_;
	_tmp74_ = gtk_builder_get_object (builder, "down_dict_button");
	_tmp75_ = _g_object_ref0 (_tmp74_);
	_g_object_unref0 (object);
	object = _tmp75_;
	_tmp76_ = object;
	_vala_assert (_tmp76_ != NULL, "object != null");
	_tmp77_ = object;
	_tmp78_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp77_, gtk_button_get_type (), GtkButton));
	_data1_->down_dict_button = _tmp78_;
	_tmp79_ = gtk_builder_get_object (builder, "dict_dialog");
	_tmp80_ = _g_object_ref0 (_tmp79_);
	_g_object_unref0 (object);
	object = _tmp80_;
	_tmp81_ = object;
	_vala_assert (_tmp81_ != NULL, "object != null");
	_tmp82_ = object;
	_tmp83_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp82_, gtk_dialog_get_type (), GtkDialog));
	_g_object_unref0 (self->priv->dict_dialog);
	self->priv->dict_dialog = _tmp83_;
	_tmp84_ = gtk_builder_get_object (builder, "dict_type_combobox");
	_tmp85_ = _g_object_ref0 (_tmp84_);
	_g_object_unref0 (object);
	object = _tmp85_;
	_tmp86_ = object;
	_vala_assert (_tmp86_ != NULL, "object != null");
	_tmp87_ = object;
	_tmp88_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp87_, gtk_combo_box_get_type (), GtkComboBox));
	_g_object_unref0 (self->priv->dict_type_combobox);
	self->priv->dict_type_combobox = _tmp88_;
	_tmp89_ = gtk_builder_get_object (builder, "dict_data_hbox");
	_tmp90_ = _g_object_ref0 (_tmp89_);
	_g_object_unref0 (object);
	object = _tmp90_;
	_tmp91_ = object;
	_vala_assert (_tmp91_ != NULL, "object != null");
	_tmp92_ = object;
	_tmp93_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp92_, gtk_hbox_get_type (), GtkHBox));
	_g_object_unref0 (self->priv->dict_data_hbox);
	self->priv->dict_data_hbox = _tmp93_;
	_tmp94_ = (GtkFileChooserButton*) gtk_file_chooser_button_new ("dictionary file", GTK_FILE_CHOOSER_ACTION_OPEN);
	g_object_ref_sink (_tmp94_);
	_g_object_unref0 (self->priv->dict_filechooserbutton);
	self->priv->dict_filechooserbutton = _tmp94_;
	_tmp95_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp95_);
	_g_object_unref0 (self->priv->dict_entry);
	self->priv->dict_entry = _tmp95_;
	_tmp96_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 65535, (gdouble) 1);
	g_object_ref_sink (_tmp96_);
	_g_object_unref0 (self->priv->dict_spinbutton);
	self->priv->dict_spinbutton = _tmp96_;
	_tmp97_ = gtk_list_store_new (1, TYPE_PLIST, -1);
	_g_object_unref0 (model);
	model = _tmp97_;
	_tmp98_ = self->priv->dictionaries_treeview;
	_tmp99_ = model;
	gtk_tree_view_set_model (_tmp98_, (GtkTreeModel*) _tmp99_);
	_tmp100_ = setup_typecell_renderer_new ();
	g_object_ref_sink (_tmp100_);
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) _tmp100_;
	_tmp101_ = renderer;
	_tmp102_ = gtk_tree_view_column_new_with_attributes ("type", _tmp101_, "plist", 0, NULL);
	g_object_ref_sink (_tmp102_);
	_g_object_unref0 (column);
	column = _tmp102_;
	_tmp103_ = self->priv->dictionaries_treeview;
	_tmp104_ = column;
	gtk_tree_view_append_column (_tmp103_, _tmp104_);
	_tmp105_ = setup_desc_cell_renderer_new ();
	g_object_ref_sink (_tmp105_);
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) _tmp105_;
	_tmp106_ = renderer;
	_tmp107_ = gtk_tree_view_column_new_with_attributes ("desc", _tmp106_, "plist", 0, NULL);
	g_object_ref_sink (_tmp107_);
	_g_object_unref0 (column);
	column = _tmp107_;
	_tmp108_ = self->priv->dictionaries_treeview;
	_tmp109_ = column;
	gtk_tree_view_append_column (_tmp108_, _tmp109_);
	_tmp110_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp110_);
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) _tmp110_;
	_tmp111_ = self->priv->period_style_combobox;
	_tmp112_ = renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp111_, _tmp112_, FALSE);
	_tmp113_ = self->priv->period_style_combobox;
	_tmp114_ = renderer;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp113_, _tmp114_, "text", 0, NULL);
	_tmp115_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp115_);
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) _tmp115_;
	_tmp116_ = self->priv->initial_input_mode_combobox;
	_tmp117_ = renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp116_, _tmp117_, FALSE);
	_tmp118_ = self->priv->initial_input_mode_combobox;
	_tmp119_ = renderer;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp118_, _tmp119_, "text", 0, NULL);
	_tmp120_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp120_);
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) _tmp120_;
	_tmp121_ = self->priv->dict_type_combobox;
	_tmp122_ = renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp121_, _tmp122_, FALSE);
	_tmp123_ = self->priv->dict_type_combobox;
	_tmp124_ = renderer;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp123_, _tmp124_, "text", 0, NULL);
	_tmp125_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING, -1);
	_g_object_unref0 (model);
	model = _tmp125_;
	_tmp126_ = model;
	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _tmp126_, 1, GTK_SORT_ASCENDING);
	_tmp127_ = self->priv->typing_rule_combobox;
	_tmp128_ = model;
	gtk_combo_box_set_model (_tmp127_, (GtkTreeModel*) _tmp128_);
	_tmp130_ = skk_rule_list (&_tmp129_);
	rules = _tmp130_;
	rules_length1 = _tmp129_;
	_rules_size_ = rules_length1;
	_tmp131_ = rules;
	_tmp131__length1 = rules_length1;
	{
		SkkRuleMetadata* rule_collection = NULL;
		gint rule_collection_length1 = 0;
		gint _rule_collection_size_ = 0;
		gint rule_it = 0;
		rule_collection = _tmp131_;
		rule_collection_length1 = _tmp131__length1;
		for (rule_it = 0; rule_it < rule_collection_length1; rule_it = rule_it + 1) {
			SkkRuleMetadata _tmp132_;
			SkkRuleMetadata _tmp133_ = {0};
			SkkRuleMetadata rule = {0};
			_tmp132_ = rule_collection[rule_it];
			skk_rule_metadata_copy (&_tmp132_, &_tmp133_);
			rule = _tmp133_;
			{
				GtkTreeIter iter = {0};
				GtkListStore* _tmp134_;
				GtkTreeIter _tmp135_ = {0};
				GtkListStore* _tmp136_;
				GtkTreeIter _tmp137_;
				SkkRuleMetadata _tmp138_;
				const gchar* _tmp139_;
				GtkListStore* _tmp140_;
				GtkTreeIter _tmp141_;
				SkkRuleMetadata _tmp142_;
				const gchar* _tmp143_;
				_tmp134_ = model;
				gtk_list_store_append (_tmp134_, &_tmp135_);
				iter = _tmp135_;
				_tmp136_ = model;
				_tmp137_ = iter;
				_tmp138_ = rule;
				_tmp139_ = _tmp138_.name;
				gtk_list_store_set (_tmp136_, &_tmp137_, 0, _tmp139_, -1);
				_tmp140_ = model;
				_tmp141_ = iter;
				_tmp142_ = rule;
				_tmp143_ = _tmp142_.label;
				gtk_list_store_set (_tmp140_, &_tmp141_, 1, _tmp143_, -1);
				skk_rule_metadata_destroy (&rule);
			}
		}
	}
	_tmp144_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp144_);
	_g_object_unref0 (renderer);
	renderer = (GtkCellRenderer*) _tmp144_;
	_tmp145_ = self->priv->typing_rule_combobox;
	_tmp146_ = renderer;
	gtk_cell_layout_pack_start ((GtkCellLayout*) _tmp145_, _tmp146_, FALSE);
	_tmp147_ = self->priv->typing_rule_combobox;
	_tmp148_ = renderer;
	gtk_cell_layout_set_attributes ((GtkCellLayout*) _tmp147_, _tmp148_, "text", 1, NULL);
	setup_load (self);
	_tmp149_ = add_dict_button;
	g_signal_connect_object (_tmp149_, "clicked", (GCallback) _setup_add_dict_gtk_button_clicked, self, 0);
	_tmp150_ = _data1_->remove_dict_button;
	g_signal_connect_object (_tmp150_, "clicked", (GCallback) _setup_remove_dict_gtk_button_clicked, self, 0);
	_tmp151_ = _data1_->up_dict_button;
	g_signal_connect_object (_tmp151_, "clicked", (GCallback) _setup_up_dict_gtk_button_clicked, self, 0);
	_tmp152_ = _data1_->down_dict_button;
	g_signal_connect_object (_tmp152_, "clicked", (GCallback) _setup_down_dict_gtk_button_clicked, self, 0);
	_tmp153_ = self->priv->dictionaries_treeview;
	_tmp154_ = gtk_tree_view_get_selection (_tmp153_);
	_tmp155_ = _g_object_ref0 (_tmp154_);
	_data1_->selection = _tmp155_;
	g_signal_connect_data (_data1_->selection, "changed", (GCallback) ___lambda4__gtk_tree_selection_changed, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
	_tmp156_ = self->priv->dict_type_combobox;
	g_signal_connect_object (_tmp156_, "changed", (GCallback) ___lambda5__gtk_combo_box_changed, self, 0);
	_tmp157_ = self->priv->dict_type_combobox;
	gtk_combo_box_set_active (_tmp157_, 0);
	rules = (_vala_SkkRuleMetadata_array_free (rules, rules_length1), NULL);
	_g_object_unref0 (column);
	_g_object_unref0 (renderer);
	_g_object_unref0 (model);
	_g_object_unref0 (add_dict_button);
	_g_object_unref0 (object);
	_g_free0 (ui_filename);
	_g_object_unref0 (builder);
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return self;
}

Setup*
setup_new (Preferences* preferences)
{
	return setup_construct (TYPE_SETUP, preferences);
}

static void
setup_populate_dictionaries_treeview (Setup* self)
{
	GVariant* variant = NULL;
	Preferences* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	gchar** strv = NULL;
	GVariant* _tmp3_;
	gsize _tmp4_ = 0;
	gchar** _tmp5_;
	gint strv_length1;
	gint _strv_size_;
	GtkListStore* model = NULL;
	GtkTreeView* _tmp6_;
	GtkTreeModel* _tmp7_;
	GtkListStore* _tmp8_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->preferences;
	_tmp1_ = preferences_get (_tmp0_, "dictionaries");
	variant = _tmp1_;
	_tmp2_ = variant;
	_vala_assert (_tmp2_ != NULL, "variant != null");
	_tmp3_ = variant;
	_tmp5_ = g_variant_dup_strv (_tmp3_, &_tmp4_);
	strv = _tmp5_;
	strv_length1 = _tmp4_;
	_strv_size_ = strv_length1;
	_tmp6_ = self->priv->dictionaries_treeview;
	_tmp7_ = gtk_tree_view_get_model (_tmp6_);
	_tmp8_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_list_store_get_type (), GtkListStore));
	model = _tmp8_;
	_tmp9_ = strv;
	_tmp9__length1 = strv_length1;
	{
		gchar** str_collection = NULL;
		gint str_collection_length1 = 0;
		gint _str_collection_size_ = 0;
		gint str_it = 0;
		str_collection = _tmp9_;
		str_collection_length1 = _tmp9__length1;
		for (str_it = 0; str_it < str_collection_length1; str_it = str_it + 1) {
			gchar* _tmp10_;
			gchar* str = NULL;
			_tmp10_ = g_strdup (str_collection[str_it]);
			str = _tmp10_;
			{
				PList* plist = NULL;
				GtkTreeIter iter = {0};
				GtkListStore* _tmp18_;
				GtkTreeIter _tmp19_ = {0};
				GtkListStore* _tmp20_;
				GtkTreeIter _tmp21_;
				PList* _tmp22_;
				{
					PList* _tmp11_ = NULL;
					const gchar* _tmp12_;
					PList* _tmp13_;
					PList* _tmp14_;
					_tmp12_ = str;
					_tmp13_ = plist_new (_tmp12_, &_inner_error0_);
					_tmp11_ = _tmp13_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						if (_inner_error0_->domain == PLIST_PARSE_ERROR) {
							goto __catch0_plist_parse_error;
						}
						_g_object_unref0 (plist);
						_g_free0 (str);
						_g_object_unref0 (model);
						strv = (_vala_array_free (strv, strv_length1, (GDestroyNotify) g_free), NULL);
						_g_variant_unref0 (variant);
						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;
					}
					_tmp14_ = _tmp11_;
					_tmp11_ = NULL;
					_g_object_unref0 (plist);
					plist = _tmp14_;
					_g_object_unref0 (_tmp11_);
				}
				goto __finally0;
				__catch0_plist_parse_error:
				{
					GError* e = NULL;
					const gchar* _tmp15_;
					GError* _tmp16_;
					const gchar* _tmp17_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp15_ = str;
					_tmp16_ = e;
					_tmp17_ = _tmp16_->message;
					g_warning ("setup.vala:247: can't parse plist %s: %s", _tmp15_, _tmp17_);
					_g_error_free0 (e);
					_g_object_unref0 (plist);
					_g_free0 (str);
					continue;
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (plist);
					_g_free0 (str);
					_g_object_unref0 (model);
					strv = (_vala_array_free (strv, strv_length1, (GDestroyNotify) g_free), NULL);
					_g_variant_unref0 (variant);
					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;
				}
				_tmp18_ = model;
				gtk_list_store_append (_tmp18_, &_tmp19_);
				iter = _tmp19_;
				_tmp20_ = model;
				_tmp21_ = iter;
				_tmp22_ = plist;
				gtk_list_store_set (_tmp20_, &_tmp21_, 0, _tmp22_, -1);
				_g_object_unref0 (plist);
				_g_free0 (str);
			}
		}
	}
	_g_object_unref0 (model);
	strv = (_vala_array_free (strv, strv_length1, (GDestroyNotify) g_free), NULL);
	_g_variant_unref0 (variant);
}

static gchar*
setup_get_active_dict_type (Setup* self)
{
	gchar* text = NULL;
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp0_;
	GtkTreeIter _tmp1_ = {0};
	gboolean _tmp2_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->dict_type_combobox;
	_tmp2_ = gtk_combo_box_get_active_iter (_tmp0_, &_tmp1_);
	iter = _tmp1_;
	if (_tmp2_) {
		GtkListStore* model = NULL;
		GtkComboBox* _tmp3_;
		GtkTreeModel* _tmp4_;
		GtkListStore* _tmp5_;
		GtkTreeIter _tmp6_;
		gchar* _tmp7_ = NULL;
		_tmp3_ = self->priv->dict_type_combobox;
		_tmp4_ = gtk_combo_box_get_model (_tmp3_);
		_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_list_store_get_type (), GtkListStore));
		model = _tmp5_;
		_tmp6_ = iter;
		gtk_tree_model_get ((GtkTreeModel*) model, &_tmp6_, 1, &_tmp7_, -1, -1);
		_g_free0 (text);
		text = _tmp7_;
		_g_object_unref0 (model);
	} else {
		g_assert_not_reached ();
	}
	result = text;
	return result;
}

static void
setup_add_dict (Setup* self)
{
	GtkDialog* _tmp0_;
	GtkDialog* _tmp73_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->dict_dialog;
	if (gtk_dialog_run (_tmp0_) == ((gint) GTK_RESPONSE_OK)) {
		PList* plist = NULL;
		gchar* text = NULL;
		gchar* _tmp1_;
		const gchar* _tmp2_;
		PList* _tmp49_;
		plist = NULL;
		_tmp1_ = setup_get_active_dict_type (self);
		text = _tmp1_;
		_tmp2_ = text;
		if (g_strcmp0 (_tmp2_, "System") == 0) {
			gchar* file = NULL;
			GtkFileChooserButton* _tmp3_;
			gchar* _tmp4_;
			const gchar* _tmp5_;
			_tmp3_ = self->priv->dict_filechooserbutton;
			_tmp4_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp3_);
			file = _tmp4_;
			_tmp5_ = file;
			if (_tmp5_ != NULL) {
				{
					PList* _tmp6_ = NULL;
					const gchar* _tmp7_;
					gchar* _tmp8_;
					gchar* _tmp9_;
					gchar* _tmp10_;
					gchar* _tmp11_;
					PList* _tmp12_;
					PList* _tmp13_;
					PList* _tmp14_;
					_tmp7_ = file;
					_tmp8_ = plist_escape (_tmp7_);
					_tmp9_ = _tmp8_;
					_tmp10_ = g_strdup_printf ("type=file,file=%s,mode=readonly", _tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = plist_new (_tmp11_, &_inner_error0_);
					_tmp13_ = _tmp12_;
					_g_free0 (_tmp11_);
					_g_free0 (_tmp9_);
					_tmp6_ = _tmp13_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						if (_inner_error0_->domain == PLIST_PARSE_ERROR) {
							goto __catch0_plist_parse_error;
						}
						_g_free0 (file);
						_g_free0 (text);
						_g_object_unref0 (plist);
						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;
					}
					_tmp14_ = _tmp6_;
					_tmp6_ = NULL;
					_g_object_unref0 (plist);
					plist = _tmp14_;
					_g_object_unref0 (_tmp6_);
				}
				goto __finally0;
				__catch0_plist_parse_error:
				{
					g_clear_error (&_inner_error0_);
					g_assert_not_reached ();
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_free0 (file);
					_g_free0 (text);
					_g_object_unref0 (plist);
					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;
				}
			}
			_g_free0 (file);
		} else {
			const gchar* _tmp15_;
			_tmp15_ = text;
			if (g_strcmp0 (_tmp15_, "User") == 0) {
				gchar* file = NULL;
				GtkFileChooserButton* _tmp16_;
				gchar* _tmp17_;
				const gchar* _tmp18_;
				_tmp16_ = self->priv->dict_filechooserbutton;
				_tmp17_ = gtk_file_chooser_get_filename ((GtkFileChooser*) _tmp16_);
				file = _tmp17_;
				_tmp18_ = file;
				if (_tmp18_ != NULL) {
					{
						PList* _tmp19_ = NULL;
						const gchar* _tmp20_;
						gchar* _tmp21_;
						gchar* _tmp22_;
						gchar* _tmp23_;
						gchar* _tmp24_;
						PList* _tmp25_;
						PList* _tmp26_;
						PList* _tmp27_;
						_tmp20_ = file;
						_tmp21_ = plist_escape (_tmp20_);
						_tmp22_ = _tmp21_;
						_tmp23_ = g_strdup_printf ("type=file,file=%s,mode=readwrite", _tmp22_);
						_tmp24_ = _tmp23_;
						_tmp25_ = plist_new (_tmp24_, &_inner_error0_);
						_tmp26_ = _tmp25_;
						_g_free0 (_tmp24_);
						_g_free0 (_tmp22_);
						_tmp19_ = _tmp26_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							if (_inner_error0_->domain == PLIST_PARSE_ERROR) {
								goto __catch1_plist_parse_error;
							}
							_g_free0 (file);
							_g_free0 (text);
							_g_object_unref0 (plist);
							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;
						}
						_tmp27_ = _tmp19_;
						_tmp19_ = NULL;
						_g_object_unref0 (plist);
						plist = _tmp27_;
						_g_object_unref0 (_tmp19_);
					}
					goto __finally1;
					__catch1_plist_parse_error:
					{
						g_clear_error (&_inner_error0_);
						g_assert_not_reached ();
					}
					__finally1:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_free0 (file);
						_g_free0 (text);
						_g_object_unref0 (plist);
						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;
					}
				}
				_g_free0 (file);
			} else {
				const gchar* _tmp28_;
				_tmp28_ = text;
				if (g_strcmp0 (_tmp28_, "SKK Server") == 0) {
					gchar* host = NULL;
					GtkEntry* _tmp29_;
					const gchar* _tmp30_;
					const gchar* _tmp31_;
					gchar* _tmp32_;
					guint16 port = 0U;
					GtkSpinButton* _tmp33_;
					gdouble _tmp34_;
					gdouble _tmp35_;
					gboolean _tmp36_ = FALSE;
					const gchar* _tmp37_;
					gint _tmp38_;
					gint _tmp39_;
					_tmp29_ = self->priv->dict_entry;
					_tmp30_ = gtk_entry_get_text (_tmp29_);
					_tmp31_ = _tmp30_;
					_tmp32_ = g_strdup (_tmp31_);
					host = _tmp32_;
					_tmp33_ = self->priv->dict_spinbutton;
					_tmp34_ = gtk_spin_button_get_value (_tmp33_);
					_tmp35_ = _tmp34_;
					port = (guint16) _tmp35_;
					_tmp37_ = host;
					_tmp38_ = strlen (_tmp37_);
					_tmp39_ = _tmp38_;
					if (_tmp39_ > 0) {
						_tmp36_ = ((gint) port) > 0;
					} else {
						_tmp36_ = FALSE;
					}
					if (_tmp36_) {
						{
							PList* _tmp40_ = NULL;
							const gchar* _tmp41_;
							gchar* _tmp42_;
							gchar* _tmp43_;
							gchar* _tmp44_;
							gchar* _tmp45_;
							PList* _tmp46_;
							PList* _tmp47_;
							PList* _tmp48_;
							_tmp41_ = host;
							_tmp42_ = plist_escape (_tmp41_);
							_tmp43_ = _tmp42_;
							_tmp44_ = g_strdup_printf ("type=server,host=%s,port=%d", _tmp43_, (gint) port);
							_tmp45_ = _tmp44_;
							_tmp46_ = plist_new (_tmp45_, &_inner_error0_);
							_tmp47_ = _tmp46_;
							_g_free0 (_tmp45_);
							_g_free0 (_tmp43_);
							_tmp40_ = _tmp47_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								if (_inner_error0_->domain == PLIST_PARSE_ERROR) {
									goto __catch2_plist_parse_error;
								}
								_g_free0 (host);
								_g_free0 (text);
								_g_object_unref0 (plist);
								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;
							}
							_tmp48_ = _tmp40_;
							_tmp40_ = NULL;
							_g_object_unref0 (plist);
							plist = _tmp48_;
							_g_object_unref0 (_tmp40_);
						}
						goto __finally2;
						__catch2_plist_parse_error:
						{
							g_clear_error (&_inner_error0_);
							g_assert_not_reached ();
						}
						__finally2:
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							_g_free0 (host);
							_g_free0 (text);
							_g_object_unref0 (plist);
							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;
						}
					}
					_g_free0 (host);
				} else {
					g_assert_not_reached ();
				}
			}
		}
		_tmp49_ = plist;
		if (_tmp49_ != NULL) {
			GtkListStore* model = NULL;
			GtkTreeView* _tmp50_;
			GtkTreeModel* _tmp51_;
			GtkListStore* _tmp52_;
			GtkTreeIter iter = {0};
			gboolean found = FALSE;
			GtkListStore* _tmp53_;
			GtkTreeIter _tmp54_ = {0};
			gboolean _tmp55_;
			_tmp50_ = self->priv->dictionaries_treeview;
			_tmp51_ = gtk_tree_view_get_model (_tmp50_);
			_tmp52_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, gtk_list_store_get_type (), GtkListStore));
			model = _tmp52_;
			found = FALSE;
			_tmp53_ = model;
			_tmp55_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp53_, &_tmp54_);
			iter = _tmp54_;
			if (_tmp55_) {
				{
					gboolean _tmp56_ = FALSE;
					_tmp56_ = TRUE;
					while (TRUE) {
						PList* _plist = NULL;
						GtkListStore* _tmp60_;
						GtkTreeIter _tmp61_;
						PList* _tmp62_ = NULL;
						PList* _tmp63_;
						gchar* _tmp64_;
						gchar* _tmp65_;
						PList* _tmp66_;
						gchar* _tmp67_;
						gchar* _tmp68_;
						gboolean _tmp69_;
						if (!_tmp56_) {
							gboolean _tmp57_ = FALSE;
							if (!found) {
								GtkListStore* _tmp58_;
								gboolean _tmp59_;
								_tmp58_ = model;
								_tmp59_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp58_, &iter);
								_tmp57_ = _tmp59_;
							} else {
								_tmp57_ = FALSE;
							}
							if (!_tmp57_) {
								break;
							}
						}
						_tmp56_ = FALSE;
						_tmp60_ = model;
						_tmp61_ = iter;
						gtk_tree_model_get ((GtkTreeModel*) _tmp60_, &_tmp61_, 0, &_tmp62_, -1, -1);
						_g_object_unref0 (_plist);
						_plist = _tmp62_;
						_tmp63_ = _plist;
						_tmp64_ = plist_to_string (_tmp63_);
						_tmp65_ = _tmp64_;
						_tmp66_ = plist;
						_tmp67_ = plist_to_string (_tmp66_);
						_tmp68_ = _tmp67_;
						_tmp69_ = g_strcmp0 (_tmp65_, _tmp68_) == 0;
						_g_free0 (_tmp68_);
						_g_free0 (_tmp65_);
						if (_tmp69_) {
							found = TRUE;
						}
						_g_object_unref0 (_plist);
					}
				}
			}
			if (!found) {
				GtkListStore* _tmp70_;
				PList* _tmp71_;
				GtkTreeIter _tmp72_ = {0};
				_tmp70_ = model;
				_tmp71_ = plist;
				gtk_list_store_insert_with_values (_tmp70_, &_tmp72_, G_MAXINT, 0, _tmp71_, -1, -1);
				iter = _tmp72_;
			}
			_g_object_unref0 (model);
		}
		_g_free0 (text);
		_g_object_unref0 (plist);
	}
	_tmp73_ = self->priv->dict_dialog;
	gtk_widget_hide ((GtkWidget*) _tmp73_);
}

static GtkTreePath*
_vala_GtkTreePath_copy (GtkTreePath* self)
{
	return g_boxed_copy (gtk_tree_path_get_type (), self);
}

static gpointer
__vala_GtkTreePath_copy0 (gpointer self)
{
	return self ? _vala_GtkTreePath_copy (self) : NULL;
}

static void
_vala_GtkTreePath_free (GtkTreePath* self)
{
	g_boxed_free (gtk_tree_path_get_type (), self);
}

static void
__vala_GtkTreePath_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (_vala_GtkTreePath_free (var), NULL));
}

static inline void
_g_list_free___vala_GtkTreePath_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) __vala_GtkTreePath_free0_);
}

static void
setup_remove_dict (Setup* self)
{
	GtkTreeSelection* selection = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeSelection* _tmp1_;
	GtkTreeSelection* _tmp2_;
	GtkTreeModel* model = NULL;
	GList* rows = NULL;
	GtkTreeSelection* _tmp3_;
	GtkTreeModel* _tmp4_ = NULL;
	GList* _tmp5_;
	GtkTreeModel* _tmp6_;
	GList* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->dictionaries_treeview;
	_tmp1_ = gtk_tree_view_get_selection (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	selection = _tmp2_;
	_tmp3_ = selection;
	_tmp5_ = gtk_tree_selection_get_selected_rows (_tmp3_, &_tmp4_);
	_g_object_unref0 (model);
	_tmp6_ = _g_object_ref0 (_tmp4_);
	model = _tmp6_;
	rows = _tmp5_;
	_tmp7_ = rows;
	{
		GList* row_collection = NULL;
		GList* row_it = NULL;
		row_collection = _tmp7_;
		for (row_it = row_collection; row_it != NULL; row_it = row_it->next) {
			GtkTreePath* _tmp8_;
			GtkTreePath* row = NULL;
			_tmp8_ = __vala_GtkTreePath_copy0 ((GtkTreePath*) row_it->data);
			row = _tmp8_;
			{
				GtkTreeIter iter = {0};
				GtkTreeModel* _tmp9_;
				GtkTreePath* _tmp10_;
				GtkTreeIter _tmp11_ = {0};
				gboolean _tmp12_;
				_tmp9_ = model;
				_tmp10_ = row;
				_tmp12_ = gtk_tree_model_get_iter (_tmp9_, &_tmp11_, _tmp10_);
				iter = _tmp11_;
				if (_tmp12_) {
					GtkTreeModel* _tmp13_;
					_tmp13_ = model;
					gtk_list_store_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_list_store_get_type (), GtkListStore), &iter);
				}
				__vala_GtkTreePath_free0 (row);
			}
		}
	}
	(rows == NULL) ? NULL : (rows = (_g_list_free___vala_GtkTreePath_free0_ (rows), NULL));
	_g_object_unref0 (model);
	_g_object_unref0 (selection);
}

static void
setup_up_dict (Setup* self)
{
	GtkTreeSelection* selection = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeSelection* _tmp1_;
	GtkTreeSelection* _tmp2_;
	GtkTreeModel* model = NULL;
	GtkTreeIter iter = {0};
	GtkTreeSelection* _tmp3_;
	GtkTreeModel* _tmp4_ = NULL;
	GtkTreeIter _tmp5_ = {0};
	gboolean _tmp6_;
	GtkTreeModel* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->dictionaries_treeview;
	_tmp1_ = gtk_tree_view_get_selection (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	selection = _tmp2_;
	_tmp3_ = selection;
	_tmp6_ = gtk_tree_selection_get_selected (_tmp3_, &_tmp4_, &_tmp5_);
	_g_object_unref0 (model);
	_tmp7_ = _g_object_ref0 (_tmp4_);
	model = _tmp7_;
	iter = _tmp5_;
	if (_tmp6_) {
		GtkTreeIter prev = {0};
		GtkTreeIter _tmp8_;
		GtkTreeModel* _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = iter;
		prev = _tmp8_;
		_tmp9_ = model;
		_tmp10_ = gtk_tree_model_iter_previous (_tmp9_, &prev);
		if (_tmp10_) {
			GtkTreeModel* _tmp11_;
			GtkTreeIter _tmp12_;
			GtkTreeIter _tmp13_;
			_tmp11_ = model;
			_tmp12_ = iter;
			_tmp13_ = prev;
			gtk_list_store_swap (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_list_store_get_type (), GtkListStore), &_tmp12_, &_tmp13_);
		}
	}
	_g_object_unref0 (model);
	_g_object_unref0 (selection);
}

static void
setup_down_dict (Setup* self)
{
	GtkTreeSelection* selection = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeSelection* _tmp1_;
	GtkTreeSelection* _tmp2_;
	GtkTreeModel* model = NULL;
	GtkTreeIter iter = {0};
	GtkTreeSelection* _tmp3_;
	GtkTreeModel* _tmp4_ = NULL;
	GtkTreeIter _tmp5_ = {0};
	gboolean _tmp6_;
	GtkTreeModel* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->dictionaries_treeview;
	_tmp1_ = gtk_tree_view_get_selection (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	selection = _tmp2_;
	_tmp3_ = selection;
	_tmp6_ = gtk_tree_selection_get_selected (_tmp3_, &_tmp4_, &_tmp5_);
	_g_object_unref0 (model);
	_tmp7_ = _g_object_ref0 (_tmp4_);
	model = _tmp7_;
	iter = _tmp5_;
	if (_tmp6_) {
		GtkTreeIter next = {0};
		GtkTreeIter _tmp8_;
		GtkTreeModel* _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = iter;
		next = _tmp8_;
		_tmp9_ = model;
		_tmp10_ = gtk_tree_model_iter_next (_tmp9_, &next);
		if (_tmp10_) {
			GtkTreeModel* _tmp11_;
			GtkTreeIter _tmp12_;
			GtkTreeIter _tmp13_;
			_tmp11_ = model;
			_tmp12_ = iter;
			_tmp13_ = next;
			gtk_list_store_swap (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_list_store_get_type (), GtkListStore), &_tmp12_, &_tmp13_);
		}
	}
	_g_object_unref0 (model);
	_g_object_unref0 (selection);
}

static void
setup_load_combobox (Setup* self,
                     const gchar* name,
                     GtkComboBox* combo,
                     gint column)
{
	GVariant* variant = NULL;
	Preferences* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	GtkTreeIter iter = {0};
	GtkTreeModel* model = NULL;
	GtkTreeModel* _tmp3_;
	GtkTreeModel* _tmp4_;
	GtkTreeModel* _tmp5_;
	GtkTreeIter _tmp6_ = {0};
	gboolean _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (combo != NULL);
	_tmp0_ = self->priv->preferences;
	_tmp1_ = preferences_get (_tmp0_, name);
	variant = _tmp1_;
	_tmp2_ = variant;
	_vala_assert (_tmp2_ != NULL, "variant != null");
	_tmp3_ = gtk_combo_box_get_model (combo);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	model = _tmp4_;
	_tmp5_ = model;
	_tmp7_ = gtk_tree_model_get_iter_first (_tmp5_, &_tmp6_);
	iter = _tmp6_;
	if (_tmp7_) {
		gint32 index = 0;
		GVariant* _tmp8_;
		gint _index = 0;
		_tmp8_ = variant;
		index = g_variant_get_int32 (_tmp8_);
		{
			gboolean _tmp9_ = FALSE;
			_tmp9_ = TRUE;
			while (TRUE) {
				GtkTreeModel* _tmp12_;
				GtkTreeIter _tmp13_;
				gint _tmp14_ = 0;
				if (!_tmp9_) {
					GtkTreeModel* _tmp10_;
					gboolean _tmp11_;
					_tmp10_ = model;
					_tmp11_ = gtk_tree_model_iter_next (_tmp10_, &iter);
					if (!_tmp11_) {
						break;
					}
				}
				_tmp9_ = FALSE;
				_tmp12_ = model;
				_tmp13_ = iter;
				gtk_tree_model_get (_tmp12_, &_tmp13_, column, &_tmp14_, -1, -1);
				_index = _tmp14_;
				if (index == ((gint32) _index)) {
					GtkTreeIter _tmp15_;
					_tmp15_ = iter;
					gtk_combo_box_set_active_iter (combo, &_tmp15_);
					break;
				}
			}
		}
	}
	_g_object_unref0 (model);
	_g_variant_unref0 (variant);
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

static void
setup_load (Setup* self)
{
	GVariant* variant = NULL;
	Preferences* _tmp0_;
	GVariant* _tmp1_;
	GVariant* _tmp2_;
	GtkEntry* _tmp3_;
	GVariant* _tmp4_;
	gsize _tmp5_ = 0;
	gchar** _tmp6_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gchar* _tmp8_;
	gchar* _tmp9_;
	Preferences* _tmp10_;
	GVariant* _tmp11_;
	GVariant* _tmp12_;
	GtkCheckButton* _tmp13_;
	GVariant* _tmp14_;
	Preferences* _tmp15_;
	GVariant* _tmp16_;
	GVariant* _tmp17_;
	GtkSpinButton* _tmp18_;
	GtkSpinButton* _tmp19_;
	GtkSpinButton* _tmp20_;
	GVariant* _tmp21_;
	Preferences* _tmp22_;
	GVariant* _tmp23_;
	GVariant* _tmp24_;
	GtkSpinButton* _tmp25_;
	GtkSpinButton* _tmp26_;
	GtkSpinButton* _tmp27_;
	GVariant* _tmp28_;
	Preferences* _tmp29_;
	GVariant* _tmp30_;
	GVariant* _tmp31_;
	GtkCheckButton* _tmp32_;
	GVariant* _tmp33_;
	GtkComboBox* _tmp34_;
	GtkComboBox* _tmp35_;
	Preferences* _tmp36_;
	GVariant* _tmp37_;
	GVariant* _tmp38_;
	GtkListStore* model = NULL;
	GtkComboBox* _tmp39_;
	GtkTreeModel* _tmp40_;
	GtkListStore* _tmp41_;
	GtkTreeIter iter = {0};
	GtkListStore* _tmp42_;
	GtkTreeIter _tmp43_ = {0};
	gboolean _tmp44_;
	g_return_if_fail (self != NULL);
	setup_populate_dictionaries_treeview (self);
	_tmp0_ = self->priv->preferences;
	_tmp1_ = preferences_get (_tmp0_, "auto_start_henkan_keywords");
	_g_variant_unref0 (variant);
	variant = _tmp1_;
	_tmp2_ = variant;
	_vala_assert (_tmp2_ != NULL, "variant != null");
	_tmp3_ = self->priv->auto_start_henkan_keywords_entry;
	_tmp4_ = variant;
	_tmp6_ = g_variant_dup_strv (_tmp4_, &_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp7__length1 = _tmp5_;
	_tmp8_ = _vala_g_strjoinv ("", _tmp7_, (gint) _tmp5_);
	_tmp9_ = _tmp8_;
	gtk_entry_set_text (_tmp3_, _tmp9_);
	_g_free0 (_tmp9_);
	_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
	_tmp10_ = self->priv->preferences;
	_tmp11_ = preferences_get (_tmp10_, "egg_like_newline");
	_g_variant_unref0 (variant);
	variant = _tmp11_;
	_tmp12_ = variant;
	_vala_assert (_tmp12_ != NULL, "variant != null");
	_tmp13_ = self->priv->egg_like_newline_checkbutton;
	_tmp14_ = variant;
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp13_, g_variant_get_boolean (_tmp14_));
	_tmp15_ = self->priv->preferences;
	_tmp16_ = preferences_get (_tmp15_, "page_size");
	_g_variant_unref0 (variant);
	variant = _tmp16_;
	_tmp17_ = variant;
	_vala_assert (_tmp17_ != NULL, "variant != null");
	_tmp18_ = self->priv->page_size_spinbutton;
	gtk_spin_button_set_range (_tmp18_, 7.0, 16.0);
	_tmp19_ = self->priv->page_size_spinbutton;
	gtk_spin_button_set_increments (_tmp19_, 1.0, 1.0);
	_tmp20_ = self->priv->page_size_spinbutton;
	_tmp21_ = variant;
	gtk_spin_button_set_value (_tmp20_, (gdouble) g_variant_get_int32 (_tmp21_));
	_tmp22_ = self->priv->preferences;
	_tmp23_ = preferences_get (_tmp22_, "pagination_start");
	_g_variant_unref0 (variant);
	variant = _tmp23_;
	_tmp24_ = variant;
	_vala_assert (_tmp24_ != NULL, "variant != null");
	_tmp25_ = self->priv->pagination_start_spinbutton;
	gtk_spin_button_set_range (_tmp25_, 0.0, 7.0);
	_tmp26_ = self->priv->pagination_start_spinbutton;
	gtk_spin_button_set_increments (_tmp26_, 1.0, 1.0);
	_tmp27_ = self->priv->pagination_start_spinbutton;
	_tmp28_ = variant;
	gtk_spin_button_set_value (_tmp27_, (gdouble) g_variant_get_int32 (_tmp28_));
	_tmp29_ = self->priv->preferences;
	_tmp30_ = preferences_get (_tmp29_, "show_annotation");
	_g_variant_unref0 (variant);
	variant = _tmp30_;
	_tmp31_ = variant;
	_vala_assert (_tmp31_ != NULL, "variant != null");
	_tmp32_ = self->priv->show_annotation_checkbutton;
	_tmp33_ = variant;
	gtk_toggle_button_set_active ((GtkToggleButton*) _tmp32_, g_variant_get_boolean (_tmp33_));
	_tmp34_ = self->priv->period_style_combobox;
	setup_load_combobox (self, "period_style", _tmp34_, 1);
	_tmp35_ = self->priv->initial_input_mode_combobox;
	setup_load_combobox (self, "initial_input_mode", _tmp35_, 1);
	_tmp36_ = self->priv->preferences;
	_tmp37_ = preferences_get (_tmp36_, "typing_rule");
	_g_variant_unref0 (variant);
	variant = _tmp37_;
	_tmp38_ = variant;
	_vala_assert (_tmp38_ != NULL, "variant != null");
	_tmp39_ = self->priv->typing_rule_combobox;
	_tmp40_ = gtk_combo_box_get_model (_tmp39_);
	_tmp41_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, gtk_list_store_get_type (), GtkListStore));
	model = _tmp41_;
	_tmp42_ = model;
	_tmp44_ = gtk_tree_model_get_iter_first ((GtkTreeModel*) _tmp42_, &_tmp43_);
	iter = _tmp43_;
	if (_tmp44_) {
		gchar* rule = NULL;
		GVariant* _tmp45_;
		const gchar* _tmp46_;
		gchar* _tmp47_;
		_tmp45_ = variant;
		_tmp46_ = g_variant_get_string (_tmp45_, NULL);
		_tmp47_ = g_strdup (_tmp46_);
		rule = _tmp47_;
		{
			gboolean _tmp48_ = FALSE;
			_tmp48_ = TRUE;
			while (TRUE) {
				gchar* _rule = NULL;
				GtkListStore* _tmp51_;
				GtkTreeIter _tmp52_;
				gchar* _tmp53_ = NULL;
				const gchar* _tmp54_;
				const gchar* _tmp55_;
				if (!_tmp48_) {
					GtkListStore* _tmp49_;
					gboolean _tmp50_;
					_tmp49_ = model;
					_tmp50_ = gtk_tree_model_iter_next ((GtkTreeModel*) _tmp49_, &iter);
					if (!_tmp50_) {
						break;
					}
				}
				_tmp48_ = FALSE;
				_tmp51_ = model;
				_tmp52_ = iter;
				gtk_tree_model_get ((GtkTreeModel*) _tmp51_, &_tmp52_, 0, &_tmp53_, -1, -1);
				_g_free0 (_rule);
				_rule = _tmp53_;
				_tmp54_ = rule;
				_tmp55_ = _rule;
				if (g_strcmp0 (_tmp54_, _tmp55_) == 0) {
					GtkComboBox* _tmp56_;
					GtkTreeIter _tmp57_;
					_tmp56_ = self->priv->typing_rule_combobox;
					_tmp57_ = iter;
					gtk_combo_box_set_active_iter (_tmp56_, &_tmp57_);
					_g_free0 (_rule);
					break;
				}
				_g_free0 (_rule);
			}
		}
		_g_free0 (rule);
	}
	_g_object_unref0 (model);
	_g_variant_unref0 (variant);
}

static GVariant*
_variant_new1 (gchar** value,
               gint value_length1)
{
	gchar** _tmp22_;
	GVariantBuilder _tmp23_;
	gint _tmp24_;
	_tmp22_ = value;
	g_variant_builder_init (&_tmp23_, G_VARIANT_TYPE ("as"));
	for (_tmp24_ = 0; _tmp24_ < value_length1; _tmp24_++) {
		g_variant_builder_add_value (&_tmp23_, g_variant_new_string (*_tmp22_));
		_tmp22_++;
	}
	return g_variant_ref_sink (g_variant_builder_end (&_tmp23_));
}

static void
setup_save_dictionaries (Setup* self,
                         const gchar* name)
{
	GtkTreeModel* model = NULL;
	GtkTreeView* _tmp0_;
	GtkTreeModel* _tmp1_;
	GtkTreeModel* _tmp2_;
	GtkTreeIter iter = {0};
	GtkTreeModel* _tmp3_;
	GtkTreeIter _tmp4_ = {0};
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->dictionaries_treeview;
	_tmp1_ = gtk_tree_view_get_model (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	model = _tmp2_;
	_tmp3_ = model;
	_tmp5_ = gtk_tree_model_get_iter_first (_tmp3_, &_tmp4_);
	iter = _tmp4_;
	if (_tmp5_) {
		GeeArrayList* dictionaries = NULL;
		GeeArrayList* _tmp6_;
		Preferences* _tmp17_;
		GeeArrayList* _tmp18_;
		gint _tmp19_ = 0;
		gpointer* _tmp20_;
		gchar** _tmp21_;
		gint _tmp21__length1;
		GVariant* _tmp25_;
		_tmp6_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
		dictionaries = _tmp6_;
		{
			gboolean _tmp7_ = FALSE;
			_tmp7_ = TRUE;
			while (TRUE) {
				PList* plist = NULL;
				GtkTreeModel* _tmp10_;
				GtkTreeIter _tmp11_;
				PList* _tmp12_ = NULL;
				GeeArrayList* _tmp13_;
				PList* _tmp14_;
				gchar* _tmp15_;
				gchar* _tmp16_;
				if (!_tmp7_) {
					GtkTreeModel* _tmp8_;
					gboolean _tmp9_;
					_tmp8_ = model;
					_tmp9_ = gtk_tree_model_iter_next (_tmp8_, &iter);
					if (!_tmp9_) {
						break;
					}
				}
				_tmp7_ = FALSE;
				_tmp10_ = model;
				_tmp11_ = iter;
				gtk_tree_model_get (_tmp10_, &_tmp11_, 0, &_tmp12_, -1, -1);
				_g_object_unref0 (plist);
				plist = _tmp12_;
				_tmp13_ = dictionaries;
				_tmp14_ = plist;
				_tmp15_ = plist_to_string (_tmp14_);
				_tmp16_ = _tmp15_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp13_, _tmp16_);
				_g_free0 (_tmp16_);
				_g_object_unref0 (plist);
			}
		}
		_tmp17_ = self->priv->preferences;
		_tmp18_ = dictionaries;
		_tmp20_ = gee_collection_to_array ((GeeCollection*) _tmp18_, &_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp21__length1 = _tmp19_;
		_tmp25_ = _variant_new1 (_tmp21_, _tmp19_);
		preferences_set (_tmp17_, name, _tmp25_);
		_g_variant_unref0 (_tmp25_);
		_tmp21_ = (_vala_array_free (_tmp21_, _tmp21__length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (dictionaries);
	}
	_g_object_unref0 (model);
}

static GVariant*
_variant_new2 (gint value)
{
	return g_variant_ref_sink (g_variant_new_int32 (value));
}

static void
setup_save_combobox (Setup* self,
                     const gchar* name,
                     GtkComboBox* combo,
                     gint column)
{
	GtkTreeIter iter = {0};
	GtkTreeIter _tmp0_ = {0};
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (combo != NULL);
	_tmp1_ = gtk_combo_box_get_active_iter (combo, &_tmp0_);
	iter = _tmp0_;
	if (_tmp1_) {
		gint index = 0;
		GtkTreeModel* model = NULL;
		GtkTreeModel* _tmp2_;
		GtkTreeModel* _tmp3_;
		GtkTreeModel* _tmp4_;
		GtkTreeIter _tmp5_;
		gint _tmp6_ = 0;
		Preferences* _tmp7_;
		GVariant* _tmp8_;
		_tmp2_ = gtk_combo_box_get_model (combo);
		_tmp3_ = _g_object_ref0 (_tmp2_);
		model = _tmp3_;
		_tmp4_ = model;
		_tmp5_ = iter;
		gtk_tree_model_get (_tmp4_, &_tmp5_, column, &_tmp6_, -1, -1);
		index = _tmp6_;
		_tmp7_ = self->priv->preferences;
		_tmp8_ = _variant_new2 (index);
		preferences_set (_tmp7_, name, _tmp8_);
		_g_variant_unref0 (_tmp8_);
		_g_object_unref0 (model);
	}
}

static gboolean
string_get_next_char (const gchar* self,
                      gint* index,
                      gunichar* c)
{
	gunichar _vala_c = 0U;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_vala_c = g_utf8_get_char (((gchar*) self) + (*index));
	if (_vala_c != ((gunichar) 0)) {
		gchar* _tmp0_;
		_tmp0_ = g_utf8_next_char (((gchar*) self) + (*index));
		*index = (gint) (_tmp0_ - ((gchar*) self));
		result = TRUE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	} else {
		result = FALSE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	}
}

static gchar*
g_unichar_to_string (gunichar self)
{
	gchar* str = NULL;
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_new0 (gchar, 7);
	str = (gchar*) _tmp0_;
	g_unichar_to_utf8 (self, str);
	result = str;
	return result;
}

static GVariant*
_variant_new3 (gchar** value,
               gint value_length1)
{
	gchar** _tmp14_;
	GVariantBuilder _tmp15_;
	gint _tmp16_;
	_tmp14_ = value;
	g_variant_builder_init (&_tmp15_, G_VARIANT_TYPE ("as"));
	for (_tmp16_ = 0; _tmp16_ < value_length1; _tmp16_++) {
		g_variant_builder_add_value (&_tmp15_, g_variant_new_string (*_tmp14_));
		_tmp14_++;
	}
	return g_variant_ref_sink (g_variant_builder_end (&_tmp15_));
}

static GVariant*
_variant_new4 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static GVariant*
_variant_new5 (gint value)
{
	return g_variant_ref_sink (g_variant_new_int32 (value));
}

static GVariant*
_variant_new6 (gint value)
{
	return g_variant_ref_sink (g_variant_new_int32 (value));
}

static GVariant*
_variant_new7 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static GVariant*
_variant_new8 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static void
setup_save (Setup* self)
{
	GeeArrayList* keywords = NULL;
	GeeArrayList* _tmp0_;
	gint index = 0;
	gunichar uc = 0U;
	Preferences* _tmp9_;
	GeeArrayList* _tmp10_;
	gint _tmp11_ = 0;
	gpointer* _tmp12_;
	gchar** _tmp13_;
	gint _tmp13__length1;
	GVariant* _tmp17_;
	Preferences* _tmp18_;
	GtkCheckButton* _tmp19_;
	gboolean _tmp20_;
	gboolean _tmp21_;
	GVariant* _tmp22_;
	Preferences* _tmp23_;
	GtkSpinButton* _tmp24_;
	gdouble _tmp25_;
	gdouble _tmp26_;
	GVariant* _tmp27_;
	Preferences* _tmp28_;
	GtkSpinButton* _tmp29_;
	gdouble _tmp30_;
	gdouble _tmp31_;
	GVariant* _tmp32_;
	Preferences* _tmp33_;
	GtkCheckButton* _tmp34_;
	gboolean _tmp35_;
	gboolean _tmp36_;
	GVariant* _tmp37_;
	GtkComboBox* _tmp38_;
	GtkComboBox* _tmp39_;
	GtkTreeIter iter = {0};
	GtkComboBox* _tmp40_;
	GtkTreeIter _tmp41_ = {0};
	gboolean _tmp42_;
	Preferences* _tmp52_;
	g_return_if_fail (self != NULL);
	setup_save_dictionaries (self, "dictionaries");
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	keywords = _tmp0_;
	index = 0;
	while (TRUE) {
		GtkEntry* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gunichar _tmp4_ = 0U;
		gboolean _tmp5_;
		GeeArrayList* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp1_ = self->priv->auto_start_henkan_keywords_entry;
		_tmp2_ = gtk_entry_get_text (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp5_ = string_get_next_char (_tmp3_, &index, &_tmp4_);
		uc = _tmp4_;
		if (!_tmp5_) {
			break;
		}
		_tmp6_ = keywords;
		_tmp7_ = g_unichar_to_string (uc);
		_tmp8_ = _tmp7_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _tmp8_);
		_g_free0 (_tmp8_);
	}
	_tmp9_ = self->priv->preferences;
	_tmp10_ = keywords;
	_tmp12_ = gee_collection_to_array ((GeeCollection*) _tmp10_, &_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp13__length1 = _tmp11_;
	_tmp17_ = _variant_new3 (_tmp13_, _tmp11_);
	preferences_set (_tmp9_, "auto_start_henkan_keywords", _tmp17_);
	_g_variant_unref0 (_tmp17_);
	_tmp13_ = (_vala_array_free (_tmp13_, _tmp13__length1, (GDestroyNotify) g_free), NULL);
	_tmp18_ = self->priv->preferences;
	_tmp19_ = self->priv->egg_like_newline_checkbutton;
	_tmp20_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = _variant_new4 (_tmp21_);
	preferences_set (_tmp18_, "egg_like_newline", _tmp22_);
	_g_variant_unref0 (_tmp22_);
	_tmp23_ = self->priv->preferences;
	_tmp24_ = self->priv->page_size_spinbutton;
	_tmp25_ = gtk_spin_button_get_value (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = _variant_new5 ((gint) _tmp26_);
	preferences_set (_tmp23_, "page_size", _tmp27_);
	_g_variant_unref0 (_tmp27_);
	_tmp28_ = self->priv->preferences;
	_tmp29_ = self->priv->pagination_start_spinbutton;
	_tmp30_ = gtk_spin_button_get_value (_tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = _variant_new6 ((gint) _tmp31_);
	preferences_set (_tmp28_, "pagination_start", _tmp32_);
	_g_variant_unref0 (_tmp32_);
	_tmp33_ = self->priv->preferences;
	_tmp34_ = self->priv->show_annotation_checkbutton;
	_tmp35_ = gtk_toggle_button_get_active ((GtkToggleButton*) _tmp34_);
	_tmp36_ = _tmp35_;
	_tmp37_ = _variant_new7 (_tmp36_);
	preferences_set (_tmp33_, "show_annotation", _tmp37_);
	_g_variant_unref0 (_tmp37_);
	_tmp38_ = self->priv->period_style_combobox;
	setup_save_combobox (self, "period_style", _tmp38_, 1);
	_tmp39_ = self->priv->initial_input_mode_combobox;
	setup_save_combobox (self, "initial_input_mode", _tmp39_, 1);
	_tmp40_ = self->priv->typing_rule_combobox;
	_tmp42_ = gtk_combo_box_get_active_iter (_tmp40_, &_tmp41_);
	iter = _tmp41_;
	if (_tmp42_) {
		GtkListStore* model = NULL;
		GtkComboBox* _tmp43_;
		GtkTreeModel* _tmp44_;
		GtkListStore* _tmp45_;
		gchar* rule = NULL;
		GtkListStore* _tmp46_;
		GtkTreeIter _tmp47_;
		gchar* _tmp48_ = NULL;
		Preferences* _tmp49_;
		const gchar* _tmp50_;
		GVariant* _tmp51_;
		_tmp43_ = self->priv->typing_rule_combobox;
		_tmp44_ = gtk_combo_box_get_model (_tmp43_);
		_tmp45_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, gtk_list_store_get_type (), GtkListStore));
		model = _tmp45_;
		_tmp46_ = model;
		_tmp47_ = iter;
		gtk_tree_model_get ((GtkTreeModel*) _tmp46_, &_tmp47_, 0, &_tmp48_, -1, -1);
		_g_free0 (rule);
		rule = _tmp48_;
		_tmp49_ = self->priv->preferences;
		_tmp50_ = rule;
		_tmp51_ = _variant_new8 (_tmp50_);
		preferences_set (_tmp49_, "typing_rule", _tmp51_);
		_g_variant_unref0 (_tmp51_);
		_g_free0 (rule);
		_g_object_unref0 (model);
	}
	_tmp52_ = self->priv->preferences;
	preferences_save (_tmp52_);
	_g_object_unref0 (keywords);
}

void
setup_run (Setup* self)
{
	GtkDialog* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->dialog;
	gtk_dialog_run (_tmp0_);
	setup_save (self);
}

static gint
setup_main (gchar** args,
            gint args_length1)
{
	IBusBus* bus = NULL;
	IBusBus* _tmp0_;
	IBusConfig* config = NULL;
	IBusConfig* _tmp1_;
	IBusConfig* _tmp2_;
	Setup* setup = NULL;
	Preferences* _tmp3_;
	Preferences* _tmp4_;
	Setup* _tmp5_;
	Setup* _tmp6_;
	gint result;
	gtk_init ((gint*) (&args_length1), &args);
	ibus_init ();
	skk_init ();
	_tmp0_ = ibus_bus_new ();
	g_object_ref_sink (_tmp0_);
	bus = _tmp0_;
	_tmp1_ = ibus_bus_get_config (bus);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	config = _tmp2_;
	_tmp3_ = preferences_new (config);
	_tmp4_ = _tmp3_;
	_tmp5_ = setup_new (_tmp4_);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp4_);
	setup = _tmp6_;
	setup_run (setup);
	result = 0;
	_g_object_unref0 (setup);
	_g_object_unref0 (config);
	_g_object_unref0 (bus);
	return result;
}

int
main (int argc,
      char ** argv)
{
	return setup_main (argv, argc);
}

static inline gpointer
setup_typecell_renderer_get_instance_private (SetupTypeCellRenderer* self)
{
	return G_STRUCT_MEMBER_P (self, SetupTypeCellRenderer_private_offset);
}

static SetupTypeCellRenderer*
setup_typecell_renderer_construct (GType object_type)
{
	SetupTypeCellRenderer * self = NULL;
	self = (SetupTypeCellRenderer*) g_object_new (object_type, NULL);
	return self;
}

static SetupTypeCellRenderer*
setup_typecell_renderer_new (void)
{
	return setup_typecell_renderer_construct (SETUP_TYPE_TYPECELL_RENDERER);
}

static PList*
setup_typecell_renderer_get_plist (SetupTypeCellRenderer* self)
{
	PList* result;
	PList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_plist;
	result = _tmp0_;
	return result;
}

static void
setup_typecell_renderer_set_plist (SetupTypeCellRenderer* self,
                                   PList* value)
{
	PList* _tmp0_;
	gchar* type = NULL;
	PList* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_plist);
	self->priv->_plist = _tmp0_;
	_tmp1_ = self->priv->_plist;
	_tmp2_ = plist_get (_tmp1_, "type");
	type = _tmp2_;
	_tmp3_ = type;
	if (g_strcmp0 (_tmp3_, "file") == 0) {
		gchar* _tmp4_ = NULL;
		PList* _tmp5_;
		gchar* _tmp6_;
		gchar* mode = NULL;
		gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp5_ = self->priv->_plist;
		_tmp6_ = plist_get (_tmp5_, "mode");
		_tmp4_ = _tmp6_;
		if (_tmp4_ == NULL) {
			gchar* _tmp7_;
			_tmp7_ = g_strdup ("readonly");
			_g_free0 (_tmp4_);
			_tmp4_ = _tmp7_;
		}
		_tmp8_ = _tmp4_;
		_tmp4_ = NULL;
		mode = _tmp8_;
		_tmp9_ = mode;
		if (g_strcmp0 (_tmp9_, "readonly") == 0) {
			g_object_set ((GtkCellRendererText*) self, "text", _ ("system"), NULL);
		} else {
			g_object_set ((GtkCellRendererText*) self, "text", _ ("user"), NULL);
		}
		_g_free0 (mode);
		_g_free0 (_tmp4_);
	} else {
		g_object_set ((GtkCellRendererText*) self, "text", _ ("server"), NULL);
	}
	_g_free0 (type);
	g_object_notify_by_pspec ((GObject *) self, setup_typecell_renderer_properties[SETUP_TYPECELL_RENDERER_PLIST_PROPERTY]);
}

static void
setup_typecell_renderer_class_init (SetupTypeCellRendererClass * klass,
                                    gpointer klass_data)
{
	setup_typecell_renderer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SetupTypeCellRenderer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_setup_typecell_renderer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_setup_typecell_renderer_set_property;
	G_OBJECT_CLASS (klass)->finalize = setup_typecell_renderer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SETUP_TYPECELL_RENDERER_PLIST_PROPERTY, setup_typecell_renderer_properties[SETUP_TYPECELL_RENDERER_PLIST_PROPERTY] = g_param_spec_object ("plist", "plist", "plist", TYPE_PLIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
setup_typecell_renderer_instance_init (SetupTypeCellRenderer * self,
                                       gpointer klass)
{
	self->priv = setup_typecell_renderer_get_instance_private (self);
}

static void
setup_typecell_renderer_finalize (GObject * obj)
{
	SetupTypeCellRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SETUP_TYPE_TYPECELL_RENDERER, SetupTypeCellRenderer);
	_g_object_unref0 (self->priv->_plist);
	G_OBJECT_CLASS (setup_typecell_renderer_parent_class)->finalize (obj);
}

static GType
setup_typecell_renderer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SetupTypeCellRendererClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) setup_typecell_renderer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SetupTypeCellRenderer), 0, (GInstanceInitFunc) setup_typecell_renderer_instance_init, NULL };
	GType setup_typecell_renderer_type_id;
	setup_typecell_renderer_type_id = g_type_register_static (gtk_cell_renderer_text_get_type (), "SetupTypeCellRenderer", &g_define_type_info, 0);
	SetupTypeCellRenderer_private_offset = g_type_add_instance_private (setup_typecell_renderer_type_id, sizeof (SetupTypeCellRendererPrivate));
	return setup_typecell_renderer_type_id;
}

static GType
setup_typecell_renderer_get_type (void)
{
	static volatile gsize setup_typecell_renderer_type_id__once = 0;
	if (g_once_init_enter (&setup_typecell_renderer_type_id__once)) {
		GType setup_typecell_renderer_type_id;
		setup_typecell_renderer_type_id = setup_typecell_renderer_get_type_once ();
		g_once_init_leave (&setup_typecell_renderer_type_id__once, setup_typecell_renderer_type_id);
	}
	return setup_typecell_renderer_type_id__once;
}

static void
_vala_setup_typecell_renderer_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec)
{
	SetupTypeCellRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SETUP_TYPE_TYPECELL_RENDERER, SetupTypeCellRenderer);
	switch (property_id) {
		case SETUP_TYPECELL_RENDERER_PLIST_PROPERTY:
		g_value_set_object (value, setup_typecell_renderer_get_plist (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_setup_typecell_renderer_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec)
{
	SetupTypeCellRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SETUP_TYPE_TYPECELL_RENDERER, SetupTypeCellRenderer);
	switch (property_id) {
		case SETUP_TYPECELL_RENDERER_PLIST_PROPERTY:
		setup_typecell_renderer_set_plist (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
setup_desc_cell_renderer_get_instance_private (SetupDescCellRenderer* self)
{
	return G_STRUCT_MEMBER_P (self, SetupDescCellRenderer_private_offset);
}

static SetupDescCellRenderer*
setup_desc_cell_renderer_construct (GType object_type)
{
	SetupDescCellRenderer * self = NULL;
	self = (SetupDescCellRenderer*) g_object_new (object_type, NULL);
	return self;
}

static SetupDescCellRenderer*
setup_desc_cell_renderer_new (void)
{
	return setup_desc_cell_renderer_construct (SETUP_TYPE_DESC_CELL_RENDERER);
}

static PList*
setup_desc_cell_renderer_get_plist (SetupDescCellRenderer* self)
{
	PList* result;
	PList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_plist;
	result = _tmp0_;
	return result;
}

static void
setup_desc_cell_renderer_set_plist (SetupDescCellRenderer* self,
                                    PList* value)
{
	PList* _tmp0_;
	gchar* type = NULL;
	PList* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_plist);
	self->priv->_plist = _tmp0_;
	_tmp1_ = self->priv->_plist;
	_tmp2_ = plist_get (_tmp1_, "type");
	type = _tmp2_;
	_tmp3_ = type;
	if (g_strcmp0 (_tmp3_, "file") == 0) {
		PList* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp4_ = self->priv->_plist;
		_tmp5_ = plist_get (_tmp4_, "file");
		_tmp6_ = _tmp5_;
		g_object_set ((GtkCellRendererText*) self, "text", _tmp6_, NULL);
		_g_free0 (_tmp6_);
	} else {
		gchar* _tmp7_ = NULL;
		PList* _tmp8_;
		gchar* _tmp9_;
		gchar* host = NULL;
		gchar* _tmp11_;
		gchar* _tmp12_ = NULL;
		PList* _tmp13_;
		gchar* _tmp14_;
		gchar* port = NULL;
		gchar* _tmp16_;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		_tmp8_ = self->priv->_plist;
		_tmp9_ = plist_get (_tmp8_, "host");
		_tmp7_ = _tmp9_;
		if (_tmp7_ == NULL) {
			gchar* _tmp10_;
			_tmp10_ = g_strdup ("localhost");
			_g_free0 (_tmp7_);
			_tmp7_ = _tmp10_;
		}
		_tmp11_ = _tmp7_;
		_tmp7_ = NULL;
		host = _tmp11_;
		_tmp13_ = self->priv->_plist;
		_tmp14_ = plist_get (_tmp13_, "port");
		_tmp12_ = _tmp14_;
		if (_tmp12_ == NULL) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("1178");
			_g_free0 (_tmp12_);
			_tmp12_ = _tmp15_;
		}
		_tmp16_ = _tmp12_;
		_tmp12_ = NULL;
		port = _tmp16_;
		_tmp17_ = host;
		_tmp18_ = port;
		_tmp19_ = g_strdup_printf ("%s:%s", _tmp17_, _tmp18_);
		_tmp20_ = _tmp19_;
		g_object_set ((GtkCellRendererText*) self, "text", _tmp20_, NULL);
		_g_free0 (_tmp20_);
		_g_free0 (port);
		_g_free0 (_tmp12_);
		_g_free0 (host);
		_g_free0 (_tmp7_);
	}
	_g_free0 (type);
	g_object_notify_by_pspec ((GObject *) self, setup_desc_cell_renderer_properties[SETUP_DESC_CELL_RENDERER_PLIST_PROPERTY]);
}

static void
setup_desc_cell_renderer_class_init (SetupDescCellRendererClass * klass,
                                     gpointer klass_data)
{
	setup_desc_cell_renderer_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SetupDescCellRenderer_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_setup_desc_cell_renderer_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_setup_desc_cell_renderer_set_property;
	G_OBJECT_CLASS (klass)->finalize = setup_desc_cell_renderer_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SETUP_DESC_CELL_RENDERER_PLIST_PROPERTY, setup_desc_cell_renderer_properties[SETUP_DESC_CELL_RENDERER_PLIST_PROPERTY] = g_param_spec_object ("plist", "plist", "plist", TYPE_PLIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
setup_desc_cell_renderer_instance_init (SetupDescCellRenderer * self,
                                        gpointer klass)
{
	self->priv = setup_desc_cell_renderer_get_instance_private (self);
}

static void
setup_desc_cell_renderer_finalize (GObject * obj)
{
	SetupDescCellRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SETUP_TYPE_DESC_CELL_RENDERER, SetupDescCellRenderer);
	_g_object_unref0 (self->priv->_plist);
	G_OBJECT_CLASS (setup_desc_cell_renderer_parent_class)->finalize (obj);
}

static GType
setup_desc_cell_renderer_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SetupDescCellRendererClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) setup_desc_cell_renderer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SetupDescCellRenderer), 0, (GInstanceInitFunc) setup_desc_cell_renderer_instance_init, NULL };
	GType setup_desc_cell_renderer_type_id;
	setup_desc_cell_renderer_type_id = g_type_register_static (gtk_cell_renderer_text_get_type (), "SetupDescCellRenderer", &g_define_type_info, 0);
	SetupDescCellRenderer_private_offset = g_type_add_instance_private (setup_desc_cell_renderer_type_id, sizeof (SetupDescCellRendererPrivate));
	return setup_desc_cell_renderer_type_id;
}

static GType
setup_desc_cell_renderer_get_type (void)
{
	static volatile gsize setup_desc_cell_renderer_type_id__once = 0;
	if (g_once_init_enter (&setup_desc_cell_renderer_type_id__once)) {
		GType setup_desc_cell_renderer_type_id;
		setup_desc_cell_renderer_type_id = setup_desc_cell_renderer_get_type_once ();
		g_once_init_leave (&setup_desc_cell_renderer_type_id__once, setup_desc_cell_renderer_type_id);
	}
	return setup_desc_cell_renderer_type_id__once;
}

static void
_vala_setup_desc_cell_renderer_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec)
{
	SetupDescCellRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SETUP_TYPE_DESC_CELL_RENDERER, SetupDescCellRenderer);
	switch (property_id) {
		case SETUP_DESC_CELL_RENDERER_PLIST_PROPERTY:
		g_value_set_object (value, setup_desc_cell_renderer_get_plist (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_setup_desc_cell_renderer_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec)
{
	SetupDescCellRenderer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SETUP_TYPE_DESC_CELL_RENDERER, SetupDescCellRenderer);
	switch (property_id) {
		case SETUP_DESC_CELL_RENDERER_PLIST_PROPERTY:
		setup_desc_cell_renderer_set_plist (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
setup_class_init (SetupClass * klass,
                  gpointer klass_data)
{
	setup_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &Setup_private_offset);
	G_OBJECT_CLASS (klass)->finalize = setup_finalize;
}

static void
setup_instance_init (Setup * self,
                     gpointer klass)
{
	self->priv = setup_get_instance_private (self);
}

static void
setup_finalize (GObject * obj)
{
	Setup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SETUP, Setup);
	_g_object_unref0 (self->priv->dialog);
	_g_object_unref0 (self->priv->dictionaries_treeview);
	_g_object_unref0 (self->priv->auto_start_henkan_keywords_entry);
	_g_object_unref0 (self->priv->period_style_combobox);
	_g_object_unref0 (self->priv->page_size_spinbutton);
	_g_object_unref0 (self->priv->pagination_start_spinbutton);
	_g_object_unref0 (self->priv->show_annotation_checkbutton);
	_g_object_unref0 (self->priv->initial_input_mode_combobox);
	_g_object_unref0 (self->priv->egg_like_newline_checkbutton);
	_g_object_unref0 (self->priv->typing_rule_combobox);
	_g_object_unref0 (self->priv->dict_dialog);
	_g_object_unref0 (self->priv->dict_type_combobox);
	_g_object_unref0 (self->priv->dict_data_hbox);
	_g_object_unref0 (self->priv->dict_data_widget);
	_g_object_unref0 (self->priv->dict_filechooserbutton);
	_g_object_unref0 (self->priv->dict_entry);
	_g_object_unref0 (self->priv->dict_spinbutton);
	_g_object_unref0 (self->priv->preferences);
	G_OBJECT_CLASS (setup_parent_class)->finalize (obj);
}

static GType
setup_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SetupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) setup_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Setup), 0, (GInstanceInitFunc) setup_instance_init, NULL };
	GType setup_type_id;
	setup_type_id = g_type_register_static (G_TYPE_OBJECT, "Setup", &g_define_type_info, 0);
	Setup_private_offset = g_type_add_instance_private (setup_type_id, sizeof (SetupPrivate));
	return setup_type_id;
}

GType
setup_get_type (void)
{
	static volatile gsize setup_type_id__once = 0;
	if (g_once_init_enter (&setup_type_id__once)) {
		GType setup_type_id;
		setup_type_id = setup_get_type_once ();
		g_once_init_leave (&setup_type_id__once, setup_type_id);
	}
	return setup_type_id__once;
}

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);
}

