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

/*
 * This file is part of LaTeXila.
 *
 * Copyright © 2010-2012 Sébastien Wilmet
 *
 * LaTeXila 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 3 of the License, or
 * (at your option) any later version.
 *
 * LaTeXila 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 LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <gspell/gspell.h>
#include <float.h>
#include <math.h>
#include <gtksourceview/gtksource.h>


#define TYPE_PREFERENCES_DIALOG (preferences_dialog_get_type ())
#define PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREFERENCES_DIALOG, PreferencesDialog))
#define PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREFERENCES_DIALOG, PreferencesDialogClass))
#define IS_PREFERENCES_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREFERENCES_DIALOG))
#define IS_PREFERENCES_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREFERENCES_DIALOG))
#define PREFERENCES_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREFERENCES_DIALOG, PreferencesDialogClass))

typedef struct _PreferencesDialog PreferencesDialog;
typedef struct _PreferencesDialogClass PreferencesDialogClass;
typedef struct _PreferencesDialogPrivate PreferencesDialogPrivate;

#define PREFERENCES_DIALOG_TYPE_STYLE_SCHEMES (preferences_dialog_style_schemes_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block25Data Block25Data;

#define TYPE_APP_SETTINGS (app_settings_get_type ())
#define APP_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_SETTINGS, AppSettings))
#define APP_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_SETTINGS, AppSettingsClass))
#define IS_APP_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_SETTINGS))
#define IS_APP_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_SETTINGS))
#define APP_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_SETTINGS, AppSettingsClass))

typedef struct _AppSettings AppSettings;
typedef struct _AppSettingsClass AppSettingsClass;
#define __g_list_free__gtk_tree_path_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__gtk_tree_path_free0_ (var), NULL)))
#define _gtk_tree_path_free0(var) ((var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL)))
typedef struct _Block26Data Block26Data;
typedef struct _Block27Data Block27Data;
#define _g_settings_schema_key_unref0(var) ((var == NULL) ? NULL : (var = (g_settings_schema_key_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _g_settings_schema_unref0(var) ((var == NULL) ? NULL : (var = (g_settings_schema_unref (var), NULL)))

struct _PreferencesDialog {
	GtkDialog parent_instance;
	PreferencesDialogPrivate * priv;
};

struct _PreferencesDialogClass {
	GtkDialogClass parent_class;
};

typedef enum  {
	PREFERENCES_DIALOG_STYLE_SCHEMES_ID,
	PREFERENCES_DIALOG_STYLE_SCHEMES_DESC,
	PREFERENCES_DIALOG_STYLE_SCHEMES_N_COLUMNS
} PreferencesDialogStyleSchemes;

typedef const gchar* (*PreferencesDialogPlural) (gulong n, void* user_data);
struct _Block25Data {
	int _ref_count_;
	PreferencesDialog* self;
	GSettings* settings;
	GtkButton* default_font_checkbutton;
	GtkTreeView* schemes_treeview;
	GtkTreeSelection* schemes_select;
};

struct _Block26Data {
	int _ref_count_;
	PreferencesDialog* self;
	GtkWidget* widget;
	gboolean must_be_enabled;
};

struct _Block27Data {
	int _ref_count_;
	PreferencesDialog* self;
	GtkLabel* label;
	PreferencesDialogPlural plural;
	gpointer plural_target;
};


static gpointer preferences_dialog_parent_class = NULL;
static PreferencesDialog* preferences_dialog__instance;
static PreferencesDialog* preferences_dialog__instance = NULL;

GType preferences_dialog_get_type (void) G_GNUC_CONST;
enum  {
	PREFERENCES_DIALOG_DUMMY_PROPERTY
};
static GType preferences_dialog_style_schemes_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static PreferencesDialog* preferences_dialog_new (void);
static PreferencesDialog* preferences_dialog_construct (GType object_type);
static void __lambda91_ (PreferencesDialog* self);
static void preferences_dialog_reset_all (PreferencesDialog* self);
static void ___lambda91__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void preferences_dialog_init_editor_tab (PreferencesDialog* self, GtkBuilder* builder);
static void preferences_dialog_init_font_and_colors_tab (PreferencesDialog* self, GtkBuilder* builder);
static void preferences_dialog_init_interactive_completion_setting (PreferencesDialog* self, GtkBuilder* builder);
static void preferences_dialog_init_spell_checking_settings (PreferencesDialog* self, GtkBuilder* builder);
static void preferences_dialog_init_other_tab (PreferencesDialog* self, GtkBuilder* builder);
void preferences_dialog_show_me (GtkWindow* parent);
static gboolean ___lambda99_ (void);
static gboolean ____lambda99__gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self);
static void ___lambda100_ (void);
static void ____lambda100__gtk_widget_destroy (GtkWidget* _sender, gpointer self);
static void preferences_dialog_set_spin_button_range (PreferencesDialog* self, GtkSpinButton* spin_button, GSettings* settings, const gchar* key);
static void preferences_dialog_set_sensitivity (PreferencesDialog* self, GSettings* settings, const gchar* key, GtkWidget* widget, gboolean must_be_enabled);
static void preferences_dialog_set_plural (PreferencesDialog* self, GtkLabel* label, GSettings* settings, const gchar* key, PreferencesDialogPlural plural, void* plural_target);
static const gchar* __lambda94_ (PreferencesDialog* self, gulong n);
static const gchar* ___lambda94__preferences_dialog_plural (gulong n, gpointer self);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
static void preferences_dialog_set_system_font_label (PreferencesDialog* self, GtkButton* button);
GType app_settings_get_type (void) G_GNUC_CONST;
AppSettings* app_settings_get_default (void);
static void __lambda95_ (Block25Data* _data25_);
static void ___lambda95__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void preferences_dialog_init_schemes_treeview (PreferencesDialog* self, GtkTreeView* treeview, const gchar* current_id);
static void __lambda96_ (Block25Data* _data25_);
static void _gtk_tree_path_free0_ (gpointer var);
static void _g_list_free__gtk_tree_path_free0_ (GList* self);
static void ___lambda96__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self);
static void __lambda97_ (Block25Data* _data25_, GSettings* setting, const gchar* key);
static void ___lambda97__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
static const gchar* __lambda98_ (PreferencesDialog* self, gulong n);
static const gchar* ___lambda98__preferences_dialog_plural (gulong n, gpointer self);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
static void __lambda92_ (Block26Data* _data26_, GSettings* setting, const gchar* k);
static void ___lambda92__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
const gchar* app_settings_get_system_font (AppSettings* self);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
static void __lambda93_ (Block27Data* _data27_, GSettings* setting, const gchar* k);
static void ___lambda93__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self);
static void preferences_dialog_finalize (GObject * obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


static GType preferences_dialog_style_schemes_get_type (void) {
	static volatile gsize preferences_dialog_style_schemes_type_id__volatile = 0;
	if (g_once_init_enter (&preferences_dialog_style_schemes_type_id__volatile)) {
		static const GEnumValue values[] = {{PREFERENCES_DIALOG_STYLE_SCHEMES_ID, "PREFERENCES_DIALOG_STYLE_SCHEMES_ID", "id"}, {PREFERENCES_DIALOG_STYLE_SCHEMES_DESC, "PREFERENCES_DIALOG_STYLE_SCHEMES_DESC", "desc"}, {PREFERENCES_DIALOG_STYLE_SCHEMES_N_COLUMNS, "PREFERENCES_DIALOG_STYLE_SCHEMES_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
		GType preferences_dialog_style_schemes_type_id;
		preferences_dialog_style_schemes_type_id = g_enum_register_static ("PreferencesDialogStyleSchemes", values);
		g_once_init_leave (&preferences_dialog_style_schemes_type_id__volatile, preferences_dialog_style_schemes_type_id);
	}
	return preferences_dialog_style_schemes_type_id__volatile;
}


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


static void __lambda91_ (PreferencesDialog* self) {
	preferences_dialog_reset_all (self);
}


static void ___lambda91__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda91_ ((PreferencesDialog*) self);
}


static PreferencesDialog* preferences_dialog_construct (GType object_type) {
	PreferencesDialog * self = NULL;
	GtkHeaderBar* headerbar = NULL;
	GtkWidget* _tmp0_;
	GtkHeaderBar* _tmp1_;
	GtkHeaderBar* _tmp2_;
	GtkButton* reset_button = NULL;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	GtkHeaderBar* _tmp7_;
	GtkButton* _tmp8_;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp9_;
	GtkBuilder* _tmp25_;
	GtkBuilder* _tmp26_;
	GtkBuilder* _tmp27_;
	GtkBuilder* _tmp28_;
	GtkBuilder* _tmp29_;
	GtkNotebook* notebook = NULL;
	GtkBuilder* _tmp30_;
	GObject* _tmp31_;
	GtkNotebook* _tmp32_;
	GtkNotebook* _tmp33_;
	GtkBox* content_area = NULL;
	GtkBox* _tmp34_;
	GtkBox* _tmp35_;
	GtkBox* _tmp36_;
	GtkNotebook* _tmp37_;
	GError * _inner_error_ = NULL;
	self = (PreferencesDialog*) g_object_new (object_type, "use-header-bar", 1, NULL);
	gtk_window_set_title ((GtkWindow*) self, _ ("Preferences"));
	gtk_window_set_destroy_with_parent ((GtkWindow*) self, TRUE);
	gtk_container_set_border_width ((GtkContainer*) self, (guint) 5);
	_tmp0_ = gtk_dialog_get_header_bar ((GtkDialog*) self);
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gtk_header_bar_get_type ()) ? ((GtkHeaderBar*) _tmp0_) : NULL);
	headerbar = _tmp1_;
	_tmp2_ = headerbar;
	gtk_header_bar_set_show_close_button (_tmp2_, TRUE);
	_tmp3_ = (GtkButton*) gtk_button_new_with_mnemonic (_ ("_Reset All"));
	g_object_ref_sink (_tmp3_);
	reset_button = _tmp3_;
	_tmp4_ = reset_button;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp4_, _ ("Reset all preferences"));
	_tmp5_ = reset_button;
	gtk_widget_show_all ((GtkWidget*) _tmp5_);
	_tmp6_ = reset_button;
	g_signal_connect_object (_tmp6_, "clicked", (GCallback) ___lambda91__gtk_button_clicked, self, 0);
	_tmp7_ = headerbar;
	_tmp8_ = reset_button;
	gtk_header_bar_pack_start (_tmp7_, (GtkWidget*) _tmp8_);
	_tmp9_ = gtk_builder_new ();
	builder = _tmp9_;
	{
		gchar* ui_path = NULL;
		gchar* _tmp10_;
		GtkBuilder* _tmp11_;
		const gchar* _tmp12_;
		_tmp10_ = g_build_filename (DATA_DIR, "ui", "preferences_dialog.ui", NULL);
		ui_path = _tmp10_;
		_tmp11_ = builder;
		_tmp12_ = ui_path;
		gtk_builder_add_from_file (_tmp11_, _tmp12_, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_free0 (ui_path);
			goto __catch38_g_error;
		}
		_g_free0 (ui_path);
	}
	goto __finally38;
	__catch38_g_error:
	{
		GError* e = NULL;
		gchar* message = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		const gchar* _tmp16_;
		GtkLabel* label_error = NULL;
		const gchar* _tmp17_;
		GtkLabel* _tmp18_;
		GtkLabel* _tmp19_;
		GtkBox* content_area = NULL;
		GtkBox* _tmp20_;
		GtkBox* _tmp21_;
		GtkBox* _tmp22_;
		GtkLabel* _tmp23_;
		GtkBox* _tmp24_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp13_ = e;
		_tmp14_ = _tmp13_->message;
		_tmp15_ = g_strdup_printf ("Error: %s", _tmp14_);
		message = _tmp15_;
		_tmp16_ = message;
		g_warning ("preferences_dialog.vala:61: %s", _tmp16_);
		_tmp17_ = message;
		_tmp18_ = (GtkLabel*) gtk_label_new (_tmp17_);
		g_object_ref_sink (_tmp18_);
		label_error = _tmp18_;
		_tmp19_ = label_error;
		gtk_label_set_line_wrap (_tmp19_, TRUE);
		_tmp20_ = (GtkBox*) gtk_dialog_get_content_area ((GtkDialog*) self);
		_tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_box_get_type (), GtkBox));
		content_area = _tmp21_;
		_tmp22_ = content_area;
		_tmp23_ = label_error;
		gtk_box_pack_start (_tmp22_, (GtkWidget*) _tmp23_, TRUE, TRUE, (guint) 0);
		_tmp24_ = content_area;
		gtk_widget_show_all ((GtkWidget*) _tmp24_);
		_g_object_unref0 (content_area);
		_g_object_unref0 (label_error);
		_g_free0 (message);
		_g_error_free0 (e);
		_g_object_unref0 (builder);
		_g_object_unref0 (reset_button);
		_g_object_unref0 (headerbar);
		return self;
	}
	__finally38:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (builder);
		_g_object_unref0 (reset_button);
		_g_object_unref0 (headerbar);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	_tmp25_ = builder;
	preferences_dialog_init_editor_tab (self, _tmp25_);
	_tmp26_ = builder;
	preferences_dialog_init_font_and_colors_tab (self, _tmp26_);
	_tmp27_ = builder;
	preferences_dialog_init_interactive_completion_setting (self, _tmp27_);
	_tmp28_ = builder;
	preferences_dialog_init_spell_checking_settings (self, _tmp28_);
	_tmp29_ = builder;
	preferences_dialog_init_other_tab (self, _tmp29_);
	_tmp30_ = builder;
	_tmp31_ = gtk_builder_get_object (_tmp30_, "notebook");
	_tmp32_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp31_, gtk_notebook_get_type ()) ? ((GtkNotebook*) _tmp31_) : NULL);
	notebook = _tmp32_;
	_tmp33_ = notebook;
	gtk_widget_unparent ((GtkWidget*) _tmp33_);
	_tmp34_ = (GtkBox*) gtk_dialog_get_content_area ((GtkDialog*) self);
	_tmp35_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, gtk_box_get_type (), GtkBox));
	content_area = _tmp35_;
	_tmp36_ = content_area;
	_tmp37_ = notebook;
	gtk_box_pack_start (_tmp36_, (GtkWidget*) _tmp37_, TRUE, TRUE, (guint) 0);
	_g_object_unref0 (content_area);
	_g_object_unref0 (notebook);
	_g_object_unref0 (builder);
	_g_object_unref0 (reset_button);
	_g_object_unref0 (headerbar);
	return self;
}


static PreferencesDialog* preferences_dialog_new (void) {
	return preferences_dialog_construct (TYPE_PREFERENCES_DIALOG);
}


static gboolean ___lambda99_ (void) {
	gboolean result = FALSE;
	PreferencesDialog* _tmp0_;
	_tmp0_ = preferences_dialog__instance;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
	result = TRUE;
	return result;
}


static gboolean ____lambda99__gtk_widget_delete_event (GtkWidget* _sender, GdkEventAny* event, gpointer self) {
	gboolean result;
	result = ___lambda99_ ();
	return result;
}


static void ___lambda100_ (void) {
	_g_object_unref0 (preferences_dialog__instance);
	preferences_dialog__instance = NULL;
}


static void ____lambda100__gtk_widget_destroy (GtkWidget* _sender, gpointer self) {
	___lambda100_ ();
}


void preferences_dialog_show_me (GtkWindow* parent) {
	PreferencesDialog* _tmp0_;
	GtkWindow* _tmp4_;
	PreferencesDialog* _tmp5_;
	GtkWindow* _tmp6_;
	PreferencesDialog* _tmp9_;
	g_return_if_fail (parent != NULL);
	_tmp0_ = preferences_dialog__instance;
	if (_tmp0_ == NULL) {
		PreferencesDialog* _tmp1_;
		PreferencesDialog* _tmp2_;
		PreferencesDialog* _tmp3_;
		_tmp1_ = preferences_dialog_new ();
		g_object_ref_sink (_tmp1_);
		_g_object_unref0 (preferences_dialog__instance);
		preferences_dialog__instance = _tmp1_;
		_tmp2_ = preferences_dialog__instance;
		g_signal_connect ((GtkWidget*) _tmp2_, "delete-event", (GCallback) ____lambda99__gtk_widget_delete_event, NULL);
		_tmp3_ = preferences_dialog__instance;
		g_signal_connect ((GtkWidget*) _tmp3_, "destroy", (GCallback) ____lambda100__gtk_widget_destroy, NULL);
	}
	_tmp4_ = parent;
	_tmp5_ = preferences_dialog__instance;
	_tmp6_ = gtk_window_get_transient_for ((GtkWindow*) _tmp5_);
	if (_tmp4_ != _tmp6_) {
		PreferencesDialog* _tmp7_;
		GtkWindow* _tmp8_;
		_tmp7_ = preferences_dialog__instance;
		_tmp8_ = parent;
		gtk_window_set_transient_for ((GtkWindow*) _tmp7_, _tmp8_);
	}
	_tmp9_ = preferences_dialog__instance;
	gtk_window_present ((GtkWindow*) _tmp9_);
}


static void preferences_dialog_reset_all (PreferencesDialog* self) {
	GtkDialog* dialog = NULL;
	GtkMessageDialog* _tmp0_;
	GtkDialog* _tmp1_;
	GtkDialog* _tmp2_;
	gint resp = 0;
	GtkDialog* _tmp3_;
	gint _tmp4_;
	GtkDialog* _tmp5_;
	gint _tmp6_;
	gchar** settings_str = NULL;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar** _tmp9_;
	gint settings_str_length1;
	gint _settings_str_size_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) self, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", _ ("Do you really want to reset all preferences?"));
	g_object_ref_sink (_tmp0_);
	dialog = (GtkDialog*) _tmp0_;
	_tmp1_ = dialog;
	gtk_dialog_add_button (_tmp1_, _ ("_Cancel"), (gint) GTK_RESPONSE_CANCEL);
	_tmp2_ = dialog;
	gtk_dialog_add_button (_tmp2_, _ ("_Reset All"), (gint) GTK_RESPONSE_YES);
	_tmp3_ = dialog;
	_tmp4_ = gtk_dialog_run (_tmp3_);
	resp = _tmp4_;
	_tmp5_ = dialog;
	gtk_widget_destroy ((GtkWidget*) _tmp5_);
	_tmp6_ = resp;
	if (_tmp6_ != ((gint) GTK_RESPONSE_YES)) {
		_g_object_unref0 (dialog);
		return;
	}
	_tmp7_ = g_strdup ("org.gnome.latexila.preferences.editor");
	_tmp8_ = g_strdup ("org.gnome.latexila.preferences.latex");
	_tmp9_ = g_new0 (gchar*, 2 + 1);
	_tmp9_[0] = _tmp7_;
	_tmp9_[1] = _tmp8_;
	settings_str = _tmp9_;
	settings_str_length1 = 2;
	_settings_str_size_ = settings_str_length1;
	_tmp10_ = settings_str;
	_tmp10__length1 = settings_str_length1;
	{
		gchar** setting_str_collection = NULL;
		gint setting_str_collection_length1 = 0;
		gint _setting_str_collection_size_ = 0;
		gint setting_str_it = 0;
		setting_str_collection = _tmp10_;
		setting_str_collection_length1 = _tmp10__length1;
		for (setting_str_it = 0; setting_str_it < _tmp10__length1; setting_str_it = setting_str_it + 1) {
			gchar* _tmp11_;
			gchar* setting_str = NULL;
			_tmp11_ = g_strdup (setting_str_collection[setting_str_it]);
			setting_str = _tmp11_;
			{
				GSettings* settings = NULL;
				const gchar* _tmp12_;
				GSettings* _tmp13_;
				gchar** keys = NULL;
				GSettings* _tmp14_;
				gchar** _tmp15_;
				gchar** _tmp16_;
				gint keys_length1;
				gint _keys_size_;
				gchar** _tmp17_;
				gint _tmp17__length1;
				_tmp12_ = setting_str;
				_tmp13_ = g_settings_new (_tmp12_);
				settings = _tmp13_;
				_tmp14_ = settings;
				_tmp16_ = _tmp15_ = g_settings_list_keys (_tmp14_);
				keys = _tmp16_;
				keys_length1 = _vala_array_length (_tmp15_);
				_keys_size_ = keys_length1;
				_tmp17_ = keys;
				_tmp17__length1 = keys_length1;
				{
					gchar** key_collection = NULL;
					gint key_collection_length1 = 0;
					gint _key_collection_size_ = 0;
					gint key_it = 0;
					key_collection = _tmp17_;
					key_collection_length1 = _tmp17__length1;
					for (key_it = 0; key_it < _tmp17__length1; key_it = key_it + 1) {
						gchar* _tmp18_;
						gchar* key = NULL;
						_tmp18_ = g_strdup (key_collection[key_it]);
						key = _tmp18_;
						{
							GSettings* _tmp19_;
							const gchar* _tmp20_;
							_tmp19_ = settings;
							_tmp20_ = key;
							g_settings_reset (_tmp19_, _tmp20_);
							_g_free0 (key);
						}
					}
				}
				keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (settings);
				_g_free0 (setting_str);
			}
		}
	}
	settings_str = (_vala_array_free (settings_str, settings_str_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (dialog);
}


static const gchar* __lambda94_ (PreferencesDialog* self, gulong n) {
	const gchar* result = NULL;
	gulong _tmp0_;
	_tmp0_ = n;
	result = ngettext ("minute", "minutes", _tmp0_);
	return result;
}


static const gchar* ___lambda94__preferences_dialog_plural (gulong n, gpointer self) {
	const gchar* result;
	result = __lambda94_ ((PreferencesDialog*) self, n);
	return result;
}


static void preferences_dialog_init_editor_tab (PreferencesDialog* self, GtkBuilder* builder) {
	GSettings* settings = NULL;
	GSettings* _tmp0_;
	GObject* display_line_nb_checkbutton = NULL;
	GtkBuilder* _tmp1_;
	GObject* _tmp2_;
	GObject* _tmp3_;
	GtkSpinButton* tab_width_spinbutton = NULL;
	GtkBuilder* _tmp4_;
	GObject* _tmp5_;
	GtkSpinButton* _tmp6_;
	GObject* insert_spaces_checkbutton = NULL;
	GtkBuilder* _tmp7_;
	GObject* _tmp8_;
	GObject* _tmp9_;
	GtkWidget* forget_no_tabs = NULL;
	GtkBuilder* _tmp10_;
	GObject* _tmp11_;
	GtkWidget* _tmp12_;
	GObject* hl_current_line_checkbutton = NULL;
	GtkBuilder* _tmp13_;
	GObject* _tmp14_;
	GObject* _tmp15_;
	GObject* bracket_matching_checkbutton = NULL;
	GtkBuilder* _tmp16_;
	GObject* _tmp17_;
	GObject* _tmp18_;
	GObject* backup_checkbutton = NULL;
	GtkBuilder* _tmp19_;
	GObject* _tmp20_;
	GObject* _tmp21_;
	GObject* autosave_checkbutton = NULL;
	GtkBuilder* _tmp22_;
	GObject* _tmp23_;
	GObject* _tmp24_;
	GtkSpinButton* autosave_spinbutton = NULL;
	GtkBuilder* _tmp25_;
	GObject* _tmp26_;
	GtkSpinButton* _tmp27_;
	GtkLabel* autosave_label = NULL;
	GtkBuilder* _tmp28_;
	GObject* _tmp29_;
	GtkLabel* _tmp30_;
	GObject* reopen_checkbutton = NULL;
	GtkBuilder* _tmp31_;
	GObject* _tmp32_;
	GObject* _tmp33_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.editor");
	settings = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "display_line_nb_checkbutton");
	_tmp3_ = _g_object_ref0 (_tmp2_);
	display_line_nb_checkbutton = _tmp3_;
	g_settings_bind (settings, "display-line-numbers", display_line_nb_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp4_ = builder;
	_tmp5_ = gtk_builder_get_object (_tmp4_, "tab_width_spinbutton");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp5_) : NULL);
	tab_width_spinbutton = _tmp6_;
	preferences_dialog_set_spin_button_range (self, tab_width_spinbutton, settings, "tabs-size");
	g_settings_bind (settings, "tabs-size", (GObject*) tab_width_spinbutton, "value", G_SETTINGS_BIND_DEFAULT);
	_tmp7_ = builder;
	_tmp8_ = gtk_builder_get_object (_tmp7_, "insert_spaces_checkbutton");
	_tmp9_ = _g_object_ref0 (_tmp8_);
	insert_spaces_checkbutton = _tmp9_;
	g_settings_bind (settings, "insert-spaces", insert_spaces_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp10_ = builder;
	_tmp11_ = gtk_builder_get_object (_tmp10_, "forget_no_tabs");
	_tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, gtk_widget_get_type ()) ? ((GtkWidget*) _tmp11_) : NULL);
	forget_no_tabs = _tmp12_;
	g_settings_bind (settings, "forget-no-tabs", (GObject*) forget_no_tabs, "active", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_sensitivity (self, settings, "insert-spaces", forget_no_tabs, TRUE);
	_tmp13_ = builder;
	_tmp14_ = gtk_builder_get_object (_tmp13_, "hl_current_line_checkbutton");
	_tmp15_ = _g_object_ref0 (_tmp14_);
	hl_current_line_checkbutton = _tmp15_;
	g_settings_bind (settings, "highlight-current-line", hl_current_line_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp16_ = builder;
	_tmp17_ = gtk_builder_get_object (_tmp16_, "bracket_matching_checkbutton");
	_tmp18_ = _g_object_ref0 (_tmp17_);
	bracket_matching_checkbutton = _tmp18_;
	g_settings_bind (settings, "bracket-matching", bracket_matching_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp19_ = builder;
	_tmp20_ = gtk_builder_get_object (_tmp19_, "backup_checkbutton");
	_tmp21_ = _g_object_ref0 (_tmp20_);
	backup_checkbutton = _tmp21_;
	g_settings_bind (settings, "create-backup-copy", backup_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp22_ = builder;
	_tmp23_ = gtk_builder_get_object (_tmp22_, "autosave_checkbutton");
	_tmp24_ = _g_object_ref0 (_tmp23_);
	autosave_checkbutton = _tmp24_;
	g_settings_bind (settings, "auto-save", autosave_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp25_ = builder;
	_tmp26_ = gtk_builder_get_object (_tmp25_, "autosave_spinbutton");
	_tmp27_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp26_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp26_) : NULL);
	autosave_spinbutton = _tmp27_;
	preferences_dialog_set_spin_button_range (self, autosave_spinbutton, settings, "auto-save-interval");
	g_settings_bind (settings, "auto-save-interval", (GObject*) autosave_spinbutton, "value", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_sensitivity (self, settings, "auto-save", (GtkWidget*) autosave_spinbutton, TRUE);
	_tmp28_ = builder;
	_tmp29_ = gtk_builder_get_object (_tmp28_, "autosave_label");
	_tmp30_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp29_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp29_) : NULL);
	autosave_label = _tmp30_;
	preferences_dialog_set_plural (self, autosave_label, settings, "auto-save-interval", ___lambda94__preferences_dialog_plural, self);
	_tmp31_ = builder;
	_tmp32_ = gtk_builder_get_object (_tmp31_, "reopen_checkbutton");
	_tmp33_ = _g_object_ref0 (_tmp32_);
	reopen_checkbutton = _tmp33_;
	g_settings_bind (settings, "reopen-files", reopen_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (reopen_checkbutton);
	_g_object_unref0 (autosave_label);
	_g_object_unref0 (autosave_spinbutton);
	_g_object_unref0 (autosave_checkbutton);
	_g_object_unref0 (backup_checkbutton);
	_g_object_unref0 (bracket_matching_checkbutton);
	_g_object_unref0 (hl_current_line_checkbutton);
	_g_object_unref0 (forget_no_tabs);
	_g_object_unref0 (insert_spaces_checkbutton);
	_g_object_unref0 (tab_width_spinbutton);
	_g_object_unref0 (display_line_nb_checkbutton);
	_g_object_unref0 (settings);
}


static Block25Data* block25_data_ref (Block25Data* _data25_) {
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}


static void block25_data_unref (void * _userdata_) {
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		PreferencesDialog* self;
		self = _data25_->self;
		_g_object_unref0 (_data25_->schemes_select);
		_g_object_unref0 (_data25_->schemes_treeview);
		_g_object_unref0 (_data25_->default_font_checkbutton);
		_g_object_unref0 (_data25_->settings);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}


static void __lambda95_ (Block25Data* _data25_) {
	PreferencesDialog* self;
	self = _data25_->self;
	preferences_dialog_set_system_font_label (self, _data25_->default_font_checkbutton);
}


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


static void _gtk_tree_path_free0_ (gpointer var) {
	(var == NULL) ? NULL : (var = (gtk_tree_path_free (var), NULL));
}


static void _g_list_free__gtk_tree_path_free0_ (GList* self) {
	g_list_foreach (self, (GFunc) _gtk_tree_path_free0_, NULL);
	g_list_free (self);
}


static gpointer _gtk_tree_path_copy0 (gpointer self) {
	return self ? gtk_tree_path_copy (self) : NULL;
}


static void __lambda96_ (Block25Data* _data25_) {
	PreferencesDialog* self;
	GtkTreeModel* model = NULL;
	GList* rows = NULL;
	GtkTreeModel* _tmp0_ = NULL;
	GList* _tmp1_;
	GList* _tmp2_;
	guint _tmp3_;
	GtkTreePath* path = NULL;
	GList* _tmp4_;
	gconstpointer _tmp5_;
	GtkTreePath* _tmp6_;
	GtkTreeIter iter = {0};
	GtkTreeModel* _tmp7_;
	GtkTreePath* _tmp8_;
	GtkTreeIter _tmp9_ = {0};
	gchar* id = NULL;
	GtkTreeModel* _tmp10_;
	GtkTreeIter _tmp11_;
	const gchar* _tmp12_;
	self = _data25_->self;
	_tmp1_ = gtk_tree_selection_get_selected_rows (_data25_->schemes_select, &_tmp0_);
	model = _tmp0_;
	rows = _tmp1_;
	_tmp2_ = rows;
	_tmp3_ = g_list_length (_tmp2_);
	if (_tmp3_ != ((guint) 1)) {
		__g_list_free__gtk_tree_path_free0_0 (rows);
		return;
	}
	_tmp4_ = rows;
	_tmp5_ = g_list_nth_data (_tmp4_, (guint) 0);
	_tmp6_ = _gtk_tree_path_copy0 ((GtkTreePath*) _tmp5_);
	path = _tmp6_;
	_tmp7_ = model;
	_tmp8_ = path;
	gtk_tree_model_get_iter (_tmp7_, &_tmp9_, _tmp8_);
	iter = _tmp9_;
	_tmp10_ = model;
	_tmp11_ = iter;
	gtk_tree_model_get (_tmp10_, &_tmp11_, PREFERENCES_DIALOG_STYLE_SCHEMES_ID, &id, -1);
	_tmp12_ = id;
	g_settings_set_string (_data25_->settings, "scheme", _tmp12_);
	_g_free0 (id);
	_gtk_tree_path_free0 (path);
	__g_list_free__gtk_tree_path_free0_0 (rows);
}


static void ___lambda96__gtk_tree_selection_changed (GtkTreeSelection* _sender, gpointer self) {
	__lambda96_ (self);
}


static void __lambda97_ (Block25Data* _data25_, GSettings* setting, const gchar* key) {
	PreferencesDialog* self;
	gchar* val = NULL;
	GSettings* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	GtkTreeModel* model = NULL;
	GtkTreeModel* _tmp3_;
	GtkTreeModel* _tmp4_;
	GtkTreeModel* _tmp5_;
	GtkTreeIter iter = {0};
	gboolean valid = FALSE;
	GtkTreeModel* _tmp6_;
	GtkTreeIter _tmp7_ = {0};
	gboolean _tmp8_;
	self = _data25_->self;
	g_return_if_fail (setting != NULL);
	g_return_if_fail (key != NULL);
	_tmp0_ = setting;
	_tmp1_ = key;
	_tmp2_ = g_settings_get_string (_tmp0_, _tmp1_);
	val = _tmp2_;
	_tmp3_ = gtk_tree_view_get_model (_data25_->schemes_treeview);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	model = _tmp5_;
	_tmp6_ = model;
	_tmp8_ = gtk_tree_model_get_iter_first (_tmp6_, &_tmp7_);
	iter = _tmp7_;
	valid = _tmp8_;
	while (TRUE) {
		gboolean _tmp9_;
		gchar* scheme = NULL;
		GtkTreeModel* _tmp10_;
		GtkTreeIter _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		GtkTreeModel* _tmp18_;
		gboolean _tmp19_;
		_tmp9_ = valid;
		if (!_tmp9_) {
			break;
		}
		_tmp10_ = model;
		_tmp11_ = iter;
		gtk_tree_model_get (_tmp10_, &_tmp11_, PREFERENCES_DIALOG_STYLE_SCHEMES_ID, &scheme, -1, -1);
		_tmp12_ = scheme;
		_tmp13_ = val;
		if (g_strcmp0 (_tmp12_, _tmp13_) == 0) {
			GtkTreeSelection* select = NULL;
			GtkTreeSelection* _tmp14_;
			GtkTreeSelection* _tmp15_;
			GtkTreeSelection* _tmp16_;
			GtkTreeIter _tmp17_;
			_tmp14_ = gtk_tree_view_get_selection (_data25_->schemes_treeview);
			_tmp15_ = _g_object_ref0 (_tmp14_);
			select = _tmp15_;
			_tmp16_ = select;
			_tmp17_ = iter;
			gtk_tree_selection_select_iter (_tmp16_, &_tmp17_);
			_g_object_unref0 (select);
			_g_free0 (scheme);
			_g_object_unref0 (model);
			_g_free0 (val);
			return;
		}
		_tmp18_ = model;
		_tmp19_ = gtk_tree_model_iter_next (_tmp18_, &iter);
		valid = _tmp19_;
		_g_free0 (scheme);
	}
	_g_object_unref0 (model);
	_g_free0 (val);
}


static void ___lambda97__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	__lambda97_ (self, _sender, key);
}


static void preferences_dialog_init_font_and_colors_tab (PreferencesDialog* self, GtkBuilder* builder) {
	Block25Data* _data25_;
	GSettings* _tmp0_;
	GtkBuilder* _tmp1_;
	GObject* _tmp2_;
	GtkButton* _tmp3_;
	AppSettings* app_settings = NULL;
	AppSettings* _tmp4_;
	GObject* font_button = NULL;
	GtkBuilder* _tmp5_;
	GObject* _tmp6_;
	GObject* _tmp7_;
	GtkWidget* font_hbox = NULL;
	GtkBuilder* _tmp8_;
	GObject* _tmp9_;
	GtkWidget* _tmp10_;
	GtkBuilder* _tmp11_;
	GObject* _tmp12_;
	GtkTreeView* _tmp13_;
	gchar* current_scheme_id = NULL;
	gchar* _tmp14_;
	GtkTreeSelection* _tmp15_;
	GtkTreeSelection* _tmp16_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_data25_ = g_slice_new0 (Block25Data);
	_data25_->_ref_count_ = 1;
	_data25_->self = g_object_ref (self);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.editor");
	_data25_->settings = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "default_font_checkbutton");
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_button_get_type ()) ? ((GtkButton*) _tmp2_) : NULL);
	_data25_->default_font_checkbutton = _tmp3_;
	g_settings_bind (_data25_->settings, "use-default-font", (GObject*) _data25_->default_font_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_system_font_label (self, _data25_->default_font_checkbutton);
	_tmp4_ = app_settings_get_default ();
	app_settings = _tmp4_;
	g_signal_connect_data ((GObject*) app_settings, "notify::system-font", (GCallback) ___lambda95__g_object_notify, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	_tmp5_ = builder;
	_tmp6_ = gtk_builder_get_object (_tmp5_, "font_button");
	_tmp7_ = _g_object_ref0 (_tmp6_);
	font_button = _tmp7_;
	g_settings_bind (_data25_->settings, "editor-font", font_button, "font-name", G_SETTINGS_BIND_DEFAULT);
	_tmp8_ = builder;
	_tmp9_ = gtk_builder_get_object (_tmp8_, "font_hbox");
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, gtk_widget_get_type ()) ? ((GtkWidget*) _tmp9_) : NULL);
	font_hbox = _tmp10_;
	preferences_dialog_set_sensitivity (self, _data25_->settings, "use-default-font", font_hbox, FALSE);
	_tmp11_ = builder;
	_tmp12_ = gtk_builder_get_object (_tmp11_, "schemes_treeview");
	_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, gtk_tree_view_get_type ()) ? ((GtkTreeView*) _tmp12_) : NULL);
	_data25_->schemes_treeview = _tmp13_;
	_tmp14_ = g_settings_get_string (_data25_->settings, "scheme");
	current_scheme_id = _tmp14_;
	preferences_dialog_init_schemes_treeview (self, _data25_->schemes_treeview, current_scheme_id);
	_tmp15_ = gtk_tree_view_get_selection (_data25_->schemes_treeview);
	_tmp16_ = _g_object_ref0 (_tmp15_);
	_data25_->schemes_select = _tmp16_;
	g_signal_connect_data (_data25_->schemes_select, "changed", (GCallback) ___lambda96__gtk_tree_selection_changed, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	g_signal_connect_data (_data25_->settings, "changed::scheme", (GCallback) ___lambda97__g_settings_changed, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	_g_free0 (current_scheme_id);
	_g_object_unref0 (font_hbox);
	_g_object_unref0 (font_button);
	_g_object_unref0 (app_settings);
	block25_data_unref (_data25_);
	_data25_ = NULL;
}


static const gchar* __lambda98_ (PreferencesDialog* self, gulong n) {
	const gchar* result = NULL;
	gulong _tmp0_;
	_tmp0_ = n;
	result = ngettext ("character", "characters", _tmp0_);
	return result;
}


static const gchar* ___lambda98__preferences_dialog_plural (gulong n, gpointer self) {
	const gchar* result;
	result = __lambda98_ ((PreferencesDialog*) self, n);
	return result;
}


static void preferences_dialog_init_interactive_completion_setting (PreferencesDialog* self, GtkBuilder* builder) {
	GSettings* settings = NULL;
	GSettings* _tmp0_;
	GObject* interactive_comp_checkbutton = NULL;
	GtkBuilder* _tmp1_;
	GObject* _tmp2_;
	GObject* _tmp3_;
	GtkSpinButton* interactive_comp_spinbutton = NULL;
	GtkBuilder* _tmp4_;
	GObject* _tmp5_;
	GtkSpinButton* _tmp6_;
	GtkLabel* interactive_comp_label = NULL;
	GtkBuilder* _tmp7_;
	GObject* _tmp8_;
	GtkLabel* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.latex");
	settings = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "interactive_comp_checkbutton");
	_tmp3_ = _g_object_ref0 (_tmp2_);
	interactive_comp_checkbutton = _tmp3_;
	g_settings_bind (settings, "interactive-completion", interactive_comp_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp4_ = builder;
	_tmp5_ = gtk_builder_get_object (_tmp4_, "interactive_comp_spinbutton");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp5_) : NULL);
	interactive_comp_spinbutton = _tmp6_;
	preferences_dialog_set_spin_button_range (self, interactive_comp_spinbutton, settings, "interactive-completion-num");
	g_settings_bind (settings, "interactive-completion-num", (GObject*) interactive_comp_spinbutton, "value", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_sensitivity (self, settings, "interactive-completion", (GtkWidget*) interactive_comp_spinbutton, TRUE);
	_tmp7_ = builder;
	_tmp8_ = gtk_builder_get_object (_tmp7_, "interactive_comp_label");
	_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp8_) : NULL);
	interactive_comp_label = _tmp9_;
	preferences_dialog_set_plural (self, interactive_comp_label, settings, "interactive-completion-num", ___lambda98__preferences_dialog_plural, self);
	_g_object_unref0 (interactive_comp_label);
	_g_object_unref0 (interactive_comp_spinbutton);
	_g_object_unref0 (interactive_comp_checkbutton);
	_g_object_unref0 (settings);
}


static void preferences_dialog_init_spell_checking_settings (PreferencesDialog* self, GtkBuilder* builder) {
	GSettings* editor_settings = NULL;
	GSettings* _tmp0_;
	GspellLanguageChooserButton* spell_language_button = NULL;
	GtkBuilder* _tmp1_;
	GObject* _tmp2_;
	GspellLanguageChooserButton* _tmp3_;
	GObject* inline_spell_checkbutton = NULL;
	GtkBuilder* _tmp4_;
	GObject* _tmp5_;
	GObject* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.editor");
	editor_settings = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "spell_language_button");
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gspell_language_chooser_button_get_type ()) ? ((GspellLanguageChooserButton*) _tmp2_) : NULL);
	spell_language_button = _tmp3_;
	g_settings_bind (editor_settings, "spell-checking-language", (GObject*) spell_language_button, "language-code", G_SETTINGS_BIND_DEFAULT);
	_tmp4_ = builder;
	_tmp5_ = gtk_builder_get_object (_tmp4_, "inline_spell_checkbutton");
	_tmp6_ = _g_object_ref0 (_tmp5_);
	inline_spell_checkbutton = _tmp6_;
	g_settings_bind (editor_settings, "highlight-misspelled-words", inline_spell_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (inline_spell_checkbutton);
	_g_object_unref0 (spell_language_button);
	_g_object_unref0 (editor_settings);
}


static void preferences_dialog_init_other_tab (PreferencesDialog* self, GtkBuilder* builder) {
	GSettings* latex_settings = NULL;
	GSettings* _tmp0_;
	GObject* confirm_clean_up_checkbutton = NULL;
	GtkBuilder* _tmp1_;
	GObject* _tmp2_;
	GObject* _tmp3_;
	GtkWidget* auto_clean_up_checkbutton = NULL;
	GtkBuilder* _tmp4_;
	GObject* _tmp5_;
	GtkWidget* _tmp6_;
	GObject* clean_up_entry = NULL;
	GtkBuilder* _tmp7_;
	GObject* _tmp8_;
	GObject* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (builder != NULL);
	_tmp0_ = g_settings_new ("org.gnome.latexila.preferences.latex");
	latex_settings = _tmp0_;
	_tmp1_ = builder;
	_tmp2_ = gtk_builder_get_object (_tmp1_, "confirm_clean_up_checkbutton");
	_tmp3_ = _g_object_ref0 (_tmp2_);
	confirm_clean_up_checkbutton = _tmp3_;
	g_settings_bind (latex_settings, "no-confirm-clean", confirm_clean_up_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	_tmp4_ = builder;
	_tmp5_ = gtk_builder_get_object (_tmp4_, "auto_clean_up_checkbutton");
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gtk_widget_get_type ()) ? ((GtkWidget*) _tmp5_) : NULL);
	auto_clean_up_checkbutton = _tmp6_;
	g_settings_bind (latex_settings, "automatic-clean", (GObject*) auto_clean_up_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
	preferences_dialog_set_sensitivity (self, latex_settings, "no-confirm-clean", auto_clean_up_checkbutton, TRUE);
	_tmp7_ = builder;
	_tmp8_ = gtk_builder_get_object (_tmp7_, "clean_up_entry");
	_tmp9_ = _g_object_ref0 (_tmp8_);
	clean_up_entry = _tmp9_;
	g_settings_bind (latex_settings, "clean-extensions", clean_up_entry, "text", G_SETTINGS_BIND_DEFAULT);
	_g_object_unref0 (clean_up_entry);
	_g_object_unref0 (auto_clean_up_checkbutton);
	_g_object_unref0 (confirm_clean_up_checkbutton);
	_g_object_unref0 (latex_settings);
}


static Block26Data* block26_data_ref (Block26Data* _data26_) {
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}


static void block26_data_unref (void * _userdata_) {
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		PreferencesDialog* self;
		self = _data26_->self;
		_g_object_unref0 (_data26_->widget);
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}


static void __lambda92_ (Block26Data* _data26_, GSettings* setting, const gchar* k) {
	PreferencesDialog* self;
	gboolean v = FALSE;
	GSettings* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_;
	GtkWidget* _tmp7_;
	self = _data26_->self;
	g_return_if_fail (setting != NULL);
	g_return_if_fail (k != NULL);
	_tmp0_ = setting;
	_tmp1_ = k;
	_tmp2_ = g_settings_get_boolean (_tmp0_, _tmp1_);
	v = _tmp2_;
	_tmp4_ = _data26_->must_be_enabled;
	if (_tmp4_) {
		gboolean _tmp5_;
		_tmp5_ = v;
		_tmp3_ = _tmp5_;
	} else {
		gboolean _tmp6_;
		_tmp6_ = v;
		_tmp3_ = !_tmp6_;
	}
	_tmp7_ = _data26_->widget;
	gtk_widget_set_sensitive (_tmp7_, _tmp3_);
}


static void ___lambda92__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	__lambda92_ (self, _sender, key);
}


static void preferences_dialog_set_sensitivity (PreferencesDialog* self, GSettings* settings, const gchar* key, GtkWidget* widget, gboolean must_be_enabled) {
	Block26Data* _data26_;
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	gboolean _tmp2_;
	gboolean val = FALSE;
	GSettings* _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_;
	GtkWidget* _tmp10_;
	GSettings* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (widget != NULL);
	_data26_ = g_slice_new0 (Block26Data);
	_data26_->_ref_count_ = 1;
	_data26_->self = g_object_ref (self);
	_tmp0_ = widget;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data26_->widget);
	_data26_->widget = _tmp1_;
	_tmp2_ = must_be_enabled;
	_data26_->must_be_enabled = _tmp2_;
	_tmp3_ = settings;
	_tmp4_ = key;
	_tmp5_ = g_settings_get_boolean (_tmp3_, _tmp4_);
	val = _tmp5_;
	_tmp7_ = _data26_->must_be_enabled;
	if (_tmp7_) {
		gboolean _tmp8_;
		_tmp8_ = val;
		_tmp6_ = _tmp8_;
	} else {
		gboolean _tmp9_;
		_tmp9_ = val;
		_tmp6_ = !_tmp9_;
	}
	_tmp10_ = _data26_->widget;
	gtk_widget_set_sensitive (_tmp10_, _tmp6_);
	_tmp11_ = settings;
	_tmp12_ = key;
	_tmp13_ = g_strconcat ("changed::", _tmp12_, NULL);
	g_signal_connect_data (_tmp11_, _tmp13_, (GCallback) ___lambda92__g_settings_changed, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_g_free0 (_tmp13_);
	block26_data_unref (_data26_);
	_data26_ = NULL;
}


static void preferences_dialog_set_system_font_label (PreferencesDialog* self, GtkButton* button) {
	AppSettings* app_settings = NULL;
	AppSettings* _tmp0_;
	gchar* label = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GtkButton* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (button != NULL);
	_tmp0_ = app_settings_get_default ();
	app_settings = _tmp0_;
	_tmp1_ = app_settings_get_system_font (app_settings);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup_printf (_ ("Use the system fixed width font (%s)"), _tmp2_);
	label = _tmp3_;
	_tmp4_ = button;
	gtk_button_set_label (_tmp4_, label);
	_g_free0 (label);
	_g_object_unref0 (app_settings);
}


static Block27Data* block27_data_ref (Block27Data* _data27_) {
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}


static void block27_data_unref (void * _userdata_) {
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		PreferencesDialog* self;
		self = _data27_->self;
		_g_object_unref0 (_data27_->label);
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}


static void __lambda93_ (Block27Data* _data27_, GSettings* setting, const gchar* k) {
	PreferencesDialog* self;
	guint v = 0U;
	GSettings* _tmp0_;
	const gchar* _tmp1_;
	GtkLabel* _tmp2_;
	PreferencesDialogPlural _tmp3_;
	void* _tmp3__target;
	const gchar* _tmp4_;
	self = _data27_->self;
	g_return_if_fail (setting != NULL);
	g_return_if_fail (k != NULL);
	_tmp0_ = setting;
	_tmp1_ = k;
	g_settings_get (_tmp0_, _tmp1_, "u", &v);
	_tmp2_ = _data27_->label;
	_tmp3_ = _data27_->plural;
	_tmp3__target = _data27_->plural_target;
	_tmp4_ = _tmp3_ ((gulong) v, _tmp3__target);
	gtk_label_set_label (_tmp2_, _tmp4_);
}


static void ___lambda93__g_settings_changed (GSettings* _sender, const gchar* key, gpointer self) {
	__lambda93_ (self, _sender, key);
}


static void preferences_dialog_set_plural (PreferencesDialog* self, GtkLabel* label, GSettings* settings, const gchar* key, PreferencesDialogPlural plural, void* plural_target) {
	Block27Data* _data27_;
	GtkLabel* _tmp0_;
	GtkLabel* _tmp1_;
	PreferencesDialogPlural _tmp2_;
	void* _tmp2__target;
	guint val = 0U;
	GSettings* _tmp3_;
	const gchar* _tmp4_;
	GtkLabel* _tmp5_;
	PreferencesDialogPlural _tmp6_;
	void* _tmp6__target;
	const gchar* _tmp7_;
	GSettings* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	_data27_ = g_slice_new0 (Block27Data);
	_data27_->_ref_count_ = 1;
	_data27_->self = g_object_ref (self);
	_tmp0_ = label;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data27_->label);
	_data27_->label = _tmp1_;
	_tmp2_ = plural;
	_tmp2__target = plural_target;
	_data27_->plural = _tmp2_;
	_data27_->plural_target = _tmp2__target;
	_tmp3_ = settings;
	_tmp4_ = key;
	g_settings_get (_tmp3_, _tmp4_, "u", &val);
	_tmp5_ = _data27_->label;
	_tmp6_ = _data27_->plural;
	_tmp6__target = _data27_->plural_target;
	_tmp7_ = _tmp6_ ((gulong) val, _tmp6__target);
	gtk_label_set_label (_tmp5_, _tmp7_);
	_tmp8_ = settings;
	_tmp9_ = key;
	_tmp10_ = g_strconcat ("changed::", _tmp9_, NULL);
	g_signal_connect_data (_tmp8_, _tmp10_, (GCallback) ___lambda93__g_settings_changed, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
	_g_free0 (_tmp10_);
	block27_data_unref (_data27_);
	_data27_ = NULL;
}


static void preferences_dialog_set_spin_button_range (PreferencesDialog* self, GtkSpinButton* spin_button, GSettings* settings, const gchar* key) {
	GSettingsSchema* schema = NULL;
	GSettings* _tmp0_;
	GSettingsSchema* _tmp1_;
	GSettingsSchema* _tmp2_;
	GVariant* range = NULL;
	const gchar* _tmp3_;
	GSettingsSchemaKey* _tmp4_;
	GSettingsSchemaKey* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	gchar* range_type = NULL;
	GVariant* range_contents = NULL;
	guint min = 0U;
	guint max = 0U;
	guint cur_value = 0U;
	GSettings* _tmp8_;
	const gchar* _tmp9_;
	GtkAdjustment* adjustment = NULL;
	GtkAdjustment* _tmp10_;
	GtkSpinButton* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (spin_button != NULL);
	g_return_if_fail (settings != NULL);
	g_return_if_fail (key != NULL);
	_tmp0_ = settings;
	g_object_get (_tmp0_, "settings-schema", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	schema = _tmp2_;
	_tmp3_ = key;
	_tmp4_ = g_settings_schema_get_key (schema, _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_settings_schema_key_get_range (_tmp5_);
	_tmp7_ = _tmp6_;
	_g_settings_schema_key_unref0 (_tmp5_);
	range = _tmp7_;
	g_variant_get (range, "(sv)", &range_type, &range_contents, NULL);
	g_return_if_fail (g_strcmp0 (range_type, "range") == 0);
	g_variant_get (range_contents, "(uu)", &min, &max, NULL);
	_tmp8_ = settings;
	_tmp9_ = key;
	g_settings_get (_tmp8_, _tmp9_, "u", &cur_value);
	_tmp10_ = gtk_adjustment_new ((gdouble) cur_value, (gdouble) min, (gdouble) max, 1.0, (gdouble) 0, (gdouble) 0);
	g_object_ref_sink (_tmp10_);
	adjustment = _tmp10_;
	_tmp11_ = spin_button;
	gtk_spin_button_set_adjustment (_tmp11_, adjustment);
	_g_object_unref0 (adjustment);
	_g_variant_unref0 (range_contents);
	_g_free0 (range_type);
	_g_variant_unref0 (range);
	_g_settings_schema_unref0 (schema);
}


static void preferences_dialog_init_schemes_treeview (PreferencesDialog* self, GtkTreeView* treeview, const gchar* current_id) {
	GtkListStore* list_store = NULL;
	GtkListStore* _tmp0_;
	GtkListStore* _tmp1_;
	GtkTreeView* _tmp2_;
	GtkListStore* _tmp3_;
	GtkCellRendererText* renderer = NULL;
	GtkCellRendererText* _tmp4_;
	GtkTreeViewColumn* column = NULL;
	GtkCellRendererText* _tmp5_;
	GtkTreeViewColumn* _tmp6_;
	GtkTreeView* _tmp7_;
	GtkTreeViewColumn* _tmp8_;
	GtkTreeSelection* select = NULL;
	GtkTreeView* _tmp9_;
	GtkTreeSelection* _tmp10_;
	GtkTreeSelection* _tmp11_;
	GtkTreeSelection* _tmp12_;
	GtkSourceStyleSchemeManager* manager = NULL;
	GtkSourceStyleSchemeManager* _tmp13_;
	GtkSourceStyleSchemeManager* _tmp14_;
	GtkSourceStyleSchemeManager* _tmp15_;
	gchar** _tmp16_;
	gchar** _tmp17_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (treeview != NULL);
	g_return_if_fail (current_id != NULL);
	_tmp0_ = gtk_list_store_new ((gint) PREFERENCES_DIALOG_STYLE_SCHEMES_N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, -1);
	list_store = _tmp0_;
	_tmp1_ = list_store;
	gtk_tree_sortable_set_sort_column_id ((GtkTreeSortable*) _tmp1_, (gint) PREFERENCES_DIALOG_STYLE_SCHEMES_ID, GTK_SORT_ASCENDING);
	_tmp2_ = treeview;
	_tmp3_ = list_store;
	gtk_tree_view_set_model (_tmp2_, (GtkTreeModel*) _tmp3_);
	_tmp4_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp4_);
	renderer = _tmp4_;
	_tmp5_ = renderer;
	_tmp6_ = gtk_tree_view_column_new_with_attributes ("Name and description", (GtkCellRenderer*) _tmp5_, "markup", PREFERENCES_DIALOG_STYLE_SCHEMES_DESC, NULL, NULL);
	g_object_ref_sink (_tmp6_);
	column = _tmp6_;
	_tmp7_ = treeview;
	_tmp8_ = column;
	gtk_tree_view_append_column (_tmp7_, _tmp8_);
	_tmp9_ = treeview;
	_tmp10_ = gtk_tree_view_get_selection (_tmp9_);
	_tmp11_ = _g_object_ref0 (_tmp10_);
	select = _tmp11_;
	_tmp12_ = select;
	gtk_tree_selection_set_mode (_tmp12_, GTK_SELECTION_SINGLE);
	_tmp13_ = gtk_source_style_scheme_manager_get_default ();
	_tmp14_ = _g_object_ref0 (_tmp13_);
	manager = _tmp14_;
	_tmp15_ = manager;
	_tmp17_ = _tmp16_ = gtk_source_style_scheme_manager_get_scheme_ids (_tmp15_);
	{
		gchar** id_collection = NULL;
		gint id_collection_length1 = 0;
		gint _id_collection_size_ = 0;
		gint id_it = 0;
		id_collection = _tmp17_;
		id_collection_length1 = _vala_array_length (_tmp16_);
		for (id_it = 0; id_it < _vala_array_length (_tmp16_); id_it = id_it + 1) {
			gchar* _tmp18_;
			gchar* id = NULL;
			_tmp18_ = g_strdup (id_collection[id_it]);
			id = _tmp18_;
			{
				GtkSourceStyleScheme* scheme = NULL;
				GtkSourceStyleSchemeManager* _tmp19_;
				const gchar* _tmp20_;
				GtkSourceStyleScheme* _tmp21_;
				GtkSourceStyleScheme* _tmp22_;
				gchar* desc = NULL;
				GtkSourceStyleScheme* _tmp23_;
				const gchar* _tmp24_;
				const gchar* _tmp25_;
				GtkSourceStyleScheme* _tmp26_;
				const gchar* _tmp27_;
				const gchar* _tmp28_;
				gchar* _tmp29_;
				GtkTreeIter iter = {0};
				GtkListStore* _tmp30_;
				GtkTreeIter _tmp31_ = {0};
				GtkListStore* _tmp32_;
				GtkTreeIter _tmp33_;
				GtkSourceStyleScheme* _tmp34_;
				const gchar* _tmp35_;
				const gchar* _tmp36_;
				const gchar* _tmp37_;
				const gchar* _tmp38_;
				const gchar* _tmp39_;
				_tmp19_ = manager;
				_tmp20_ = id;
				_tmp21_ = gtk_source_style_scheme_manager_get_scheme (_tmp19_, _tmp20_);
				_tmp22_ = _g_object_ref0 (_tmp21_);
				scheme = _tmp22_;
				_tmp23_ = scheme;
				_tmp24_ = gtk_source_style_scheme_get_name (_tmp23_);
				_tmp25_ = _tmp24_;
				_tmp26_ = scheme;
				_tmp27_ = gtk_source_style_scheme_get_description (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = g_strdup_printf ("<b>%s</b> - %s", _tmp25_, _tmp28_);
				desc = _tmp29_;
				_tmp30_ = list_store;
				gtk_list_store_append (_tmp30_, &_tmp31_);
				iter = _tmp31_;
				_tmp32_ = list_store;
				_tmp33_ = iter;
				_tmp34_ = scheme;
				_tmp35_ = gtk_source_style_scheme_get_id (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = desc;
				gtk_list_store_set (_tmp32_, &_tmp33_, PREFERENCES_DIALOG_STYLE_SCHEMES_ID, _tmp36_, PREFERENCES_DIALOG_STYLE_SCHEMES_DESC, _tmp37_, -1, -1);
				_tmp38_ = id;
				_tmp39_ = current_id;
				if (g_strcmp0 (_tmp38_, _tmp39_) == 0) {
					GtkTreeSelection* _tmp40_;
					GtkTreeIter _tmp41_;
					_tmp40_ = select;
					_tmp41_ = iter;
					gtk_tree_selection_select_iter (_tmp40_, &_tmp41_);
				}
				_g_free0 (desc);
				_g_object_unref0 (scheme);
				_g_free0 (id);
			}
		}
	}
	_g_object_unref0 (manager);
	_g_object_unref0 (select);
	_g_object_unref0 (column);
	_g_object_unref0 (renderer);
	_g_object_unref0 (list_store);
}


static void preferences_dialog_class_init (PreferencesDialogClass * klass) {
	preferences_dialog_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = preferences_dialog_finalize;
}


static void preferences_dialog_instance_init (PreferencesDialog * self) {
}


static void preferences_dialog_finalize (GObject * obj) {
	PreferencesDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PREFERENCES_DIALOG, PreferencesDialog);
	G_OBJECT_CLASS (preferences_dialog_parent_class)->finalize (obj);
}


GType preferences_dialog_get_type (void) {
	static volatile gsize preferences_dialog_type_id__volatile = 0;
	if (g_once_init_enter (&preferences_dialog_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PreferencesDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) preferences_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PreferencesDialog), 0, (GInstanceInitFunc) preferences_dialog_instance_init, NULL };
		GType preferences_dialog_type_id;
		preferences_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "PreferencesDialog", &g_define_type_info, 0);
		g_once_init_leave (&preferences_dialog_type_id__volatile, preferences_dialog_type_id);
	}
	return preferences_dialog_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



