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

/*
Copyright (C) 2014 2015 2016 Johan Mattsson

This library is free software; you can redistribute it and/or modify 
it under the terms of the GNU Lesser General Public License as 
published by the Free Software Foundation; either version 3 of the 
License, or (at your option) any later version.

This library 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 
Lesser General Public License for more details.
*/

#include "birdfont.h"
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define BIRD_FONT_TYPE_SETTINGS_DISPLAY (bird_font_settings_display_get_type ())
#define BIRD_FONT_SETTINGS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BIRD_FONT_TYPE_SETTINGS_DISPLAY, BirdFontSettingsDisplay))
#define BIRD_FONT_SETTINGS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BIRD_FONT_TYPE_SETTINGS_DISPLAY, BirdFontSettingsDisplayClass))
#define BIRD_FONT_IS_SETTINGS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BIRD_FONT_TYPE_SETTINGS_DISPLAY))
#define BIRD_FONT_IS_SETTINGS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BIRD_FONT_TYPE_SETTINGS_DISPLAY))
#define BIRD_FONT_SETTINGS_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BIRD_FONT_TYPE_SETTINGS_DISPLAY, BirdFontSettingsDisplayClass))

typedef struct _BirdFontSettingsDisplay BirdFontSettingsDisplay;
typedef struct _BirdFontSettingsDisplayClass BirdFontSettingsDisplayClass;
typedef struct _BirdFontSettingsDisplayPrivate BirdFontSettingsDisplayPrivate;

#define BIRD_FONT_TYPE_SETTINGS_TAB (bird_font_settings_tab_get_type ())
#define BIRD_FONT_SETTINGS_TAB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BIRD_FONT_TYPE_SETTINGS_TAB, BirdFontSettingsTab))
#define BIRD_FONT_SETTINGS_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BIRD_FONT_TYPE_SETTINGS_TAB, BirdFontSettingsTabClass))
#define BIRD_FONT_IS_SETTINGS_TAB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BIRD_FONT_TYPE_SETTINGS_TAB))
#define BIRD_FONT_IS_SETTINGS_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BIRD_FONT_TYPE_SETTINGS_TAB))
#define BIRD_FONT_SETTINGS_TAB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BIRD_FONT_TYPE_SETTINGS_TAB, BirdFontSettingsTabClass))

typedef struct _BirdFontSettingsTab BirdFontSettingsTab;
typedef struct _BirdFontSettingsTabClass BirdFontSettingsTabClass;
typedef struct _BirdFontSettingsTabPrivate BirdFontSettingsTabPrivate;
enum  {
	BIRD_FONT_SETTINGS_TAB_0_PROPERTY,
	BIRD_FONT_SETTINGS_TAB_NUM_PROPERTIES
};
static GParamSpec* bird_font_settings_tab_properties[BIRD_FONT_SETTINGS_TAB_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block58Data Block58Data;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _BirdFontSettingsDisplay {
	BirdFontFontDisplay parent_instance;
	BirdFontSettingsDisplayPrivate * priv;
	GeeArrayList* tools;
};

struct _BirdFontSettingsDisplayClass {
	BirdFontFontDisplayClass parent_class;
	void (*create_setting_items) (BirdFontSettingsDisplay* self);
};

struct _BirdFontSettingsTab {
	BirdFontSettingsDisplay parent_instance;
	BirdFontSettingsTabPrivate * priv;
};

struct _BirdFontSettingsTabClass {
	BirdFontSettingsDisplayClass parent_class;
};

struct _BirdFontSettingsTabPrivate {
	gchar* restart_message;
};

struct _Block58Data {
	int _ref_count_;
	BirdFontSettingsTab* self;
	BirdFontSpinButton* stroke_width;
	BirdFontSpinButton* freehand_samples;
	BirdFontSpinButton* simplification_threshold;
	BirdFontTool* translate_ui;
	BirdFontSpinButton* num_backups;
	BirdFontTool* load_backups;
};

static gint BirdFontSettingsTab_private_offset;
static gpointer bird_font_settings_tab_parent_class = NULL;
VALA_EXTERN BirdFontSpinButton* bird_font_settings_display_precision;

VALA_EXTERN GType bird_font_settings_display_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType bird_font_settings_tab_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void bird_font_settings_display_create_setting_items (BirdFontSettingsDisplay* self);
VALA_EXTERN BirdFontSettingsTab* bird_font_settings_tab_new (void);
VALA_EXTERN BirdFontSettingsTab* bird_font_settings_tab_construct (GType object_type);
VALA_EXTERN BirdFontSettingsDisplay* bird_font_settings_display_construct (GType object_type);
static void bird_font_settings_tab_real_create_setting_items (BirdFontSettingsDisplay* base);
static Block58Data* block58_data_ref (Block58Data* _data58_);
static void block58_data_unref (void * _userdata_);
static void __lambda295_ (Block58Data* _data58_,
                   BirdFontSpinButton* _self_);
static void ___lambda295__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                           BirdFontSpinButton* selected,
                                                           gpointer self);
static void __lambda296_ (BirdFontSettingsTab* self,
                   BirdFontSpinButton* _self_);
static void ___lambda296__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                           BirdFontSpinButton* selected,
                                                           gpointer self);
static void __lambda297_ (BirdFontSettingsTab* self,
                   BirdFontTool* _self_);
static void ___lambda297__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda298_ (BirdFontSettingsTab* self,
                   BirdFontTool* _self_);
static void ___lambda298__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda299_ (BirdFontSettingsTab* self,
                   BirdFontTool* _self_);
static void ___lambda299__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda300_ (BirdFontSettingsTab* self,
                   BirdFontTool* _self_);
static void ___lambda300__bird_font_tool_deselect_action (BirdFontTool* _sender,
                                                   BirdFontTool* selected,
                                                   gpointer self);
static void __lambda301_ (BirdFontSettingsTab* self,
                   BirdFontTool* _self_);
static void ___lambda301__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda302_ (Block58Data* _data58_,
                   BirdFontSpinButton* _self_);
static void ___lambda302__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                           BirdFontSpinButton* selected,
                                                           gpointer self);
static void __lambda303_ (Block58Data* _data58_,
                   BirdFontSpinButton* _self_);
static void ___lambda303__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                           BirdFontSpinButton* selected,
                                                           gpointer self);
static void __lambda304_ (Block58Data* _data58_,
                   BirdFontTool* _self_);
VALA_EXTERN void bird_font_theme_tab_redraw_ui (void);
static void ___lambda304__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda305_ (Block58Data* _data58_,
                   BirdFontTool* _self_);
static void ___lambda305__bird_font_tool_deselect_action (BirdFontTool* _sender,
                                                   BirdFontTool* selected,
                                                   gpointer self);
static void __lambda306_ (BirdFontSettingsTab* self,
                   BirdFontTool* _self_);
static void ___lambda306__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda307_ (Block58Data* _data58_,
                   BirdFontSpinButton* _self_);
static void ___lambda307__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                           BirdFontSpinButton* selected,
                                                           gpointer self);
static void __lambda308_ (Block58Data* _data58_,
                   BirdFontTool* _self_);
static void ___lambda308__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static gchar* bird_font_settings_tab_real_get_label (BirdFontFontDisplay* base);
static gchar* bird_font_settings_tab_real_get_name (BirdFontFontDisplay* base);
static void bird_font_settings_tab_finalize (GObject * obj);
static GType bird_font_settings_tab_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
bird_font_settings_tab_get_instance_private (BirdFontSettingsTab* self)
{
	return G_STRUCT_MEMBER_P (self, BirdFontSettingsTab_private_offset);
}

BirdFontSettingsTab*
bird_font_settings_tab_construct (GType object_type)
{
	BirdFontSettingsTab * self = NULL;
	self = (BirdFontSettingsTab*) bird_font_settings_display_construct (object_type);
	bird_font_settings_display_create_setting_items ((BirdFontSettingsDisplay*) self);
	return self;
}

BirdFontSettingsTab*
bird_font_settings_tab_new (void)
{
	return bird_font_settings_tab_construct (BIRD_FONT_TYPE_SETTINGS_TAB);
}

static Block58Data*
block58_data_ref (Block58Data* _data58_)
{
	g_atomic_int_inc (&_data58_->_ref_count_);
	return _data58_;
}

static void
block58_data_unref (void * _userdata_)
{
	Block58Data* _data58_;
	_data58_ = (Block58Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data58_->_ref_count_)) {
		BirdFontSettingsTab* self;
		self = _data58_->self;
		_g_object_unref0 (_data58_->load_backups);
		_g_object_unref0 (_data58_->num_backups);
		_g_object_unref0 (_data58_->translate_ui);
		_g_object_unref0 (_data58_->simplification_threshold);
		_g_object_unref0 (_data58_->freehand_samples);
		_g_object_unref0 (_data58_->stroke_width);
		_g_object_unref0 (self);
		g_slice_free (Block58Data, _data58_);
	}
}

static void
__lambda295_ (Block58Data* _data58_,
              BirdFontSpinButton* _self_)
{
	BirdFontSettingsTab* self;
	BirdFontGlyph* g = NULL;
	BirdFontGlyph* _tmp0_;
	BirdFontSpinButton* _tmp1_;
	BirdFontWidgetAllocation* _tmp2_;
	BirdFontWidgetAllocation* _tmp3_;
	BirdFontSpinButton* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	BirdFontToolbox* _tmp7_;
	BirdFontToolbox* _tmp8_;
	BirdFontSpinButton* _tmp9_;
	BirdFontSpinButton* _tmp10_;
	self = _data58_->self;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_main_window_get_current_glyph ();
	g = _tmp0_;
	_tmp1_ = _data58_->stroke_width;
	bird_font_path_stroke_width = bird_font_spin_button_get_value (_tmp1_);
	_tmp2_ = g->allocation;
	_tmp3_ = g->allocation;
	g_signal_emit_by_name ((BirdFontFontDisplay*) g, "redraw-area", (gdouble) 0, (gdouble) 0, (gdouble) _tmp2_->width, (gdouble) _tmp3_->height);
	_tmp4_ = _data58_->stroke_width;
	_tmp5_ = bird_font_spin_button_get_display_value (_tmp4_);
	_tmp6_ = _tmp5_;
	bird_font_preferences_set ("stroke_width_for_open_paths", _tmp6_);
	_g_free0 (_tmp6_);
	_tmp7_ = bird_font_main_window_get_toolbox ();
	_tmp8_ = _tmp7_;
	_tmp9_ = _data58_->stroke_width;
	_tmp10_ = _data58_->stroke_width;
	g_signal_emit_by_name (_tmp8_, "redraw", (gint) ((BirdFontTool*) _tmp9_)->x, (gint) ((BirdFontTool*) _tmp10_)->y, 70, 70);
	_g_object_unref0 (_tmp8_);
	_g_object_unref0 (g);
}

static void
___lambda295__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                      BirdFontSpinButton* selected,
                                                      gpointer self)
{
	__lambda295_ (self, selected);
}

static void
__lambda296_ (BirdFontSettingsTab* self,
              BirdFontSpinButton* _self_)
{
	BirdFontToolbox* _tmp0_;
	BirdFontToolbox* _tmp1_;
	BirdFontSpinButton* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	BirdFontToolbox* _tmp5_;
	BirdFontToolbox* _tmp6_;
	BirdFontSpinButton* _tmp7_;
	BirdFontSpinButton* _tmp8_;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_main_window_get_toolbox ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_settings_display_precision;
	bird_font_toolbox_select_tool (_tmp1_, (BirdFontTool*) _tmp2_);
	_g_object_unref0 (_tmp1_);
	_tmp3_ = bird_font_spin_button_get_display_value (_self_);
	_tmp4_ = _tmp3_;
	bird_font_preferences_set ("precision", _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = bird_font_main_window_get_toolbox ();
	_tmp6_ = _tmp5_;
	_tmp7_ = bird_font_settings_display_precision;
	_tmp8_ = bird_font_settings_display_precision;
	g_signal_emit_by_name (_tmp6_, "redraw", (gint) ((BirdFontTool*) _tmp7_)->x, (gint) ((BirdFontTool*) _tmp8_)->y, 70, 70);
	_g_object_unref0 (_tmp6_);
}

static void
___lambda296__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                      BirdFontSpinButton* selected,
                                                      gpointer self)
{
	__lambda296_ ((BirdFontSettingsTab*) self, selected);
}

static void
__lambda297_ (BirdFontSettingsTab* self,
              BirdFontTool* _self_)
{
	BirdFontPenTool* _tmp0_;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_drawing_tools_pen_tool;
	bird_font_pen_tool_set_precision (_tmp0_, bird_font_spin_button_get_value (G_TYPE_CHECK_INSTANCE_CAST (_self_, BIRD_FONT_TYPE_SPIN_BUTTON, BirdFontSpinButton)));
}

static void
___lambda297__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda297_ ((BirdFontSettingsTab*) self, selected);
}

static void
__lambda298_ (BirdFontSettingsTab* self,
              BirdFontTool* _self_)
{
	BirdFontGlyph* g = NULL;
	BirdFontGlyph* _tmp0_;
	BirdFontWidgetAllocation* _tmp1_;
	BirdFontWidgetAllocation* _tmp2_;
	g_return_if_fail (_self_ != NULL);
	bird_font_path_show_all_line_handles = !bird_font_path_show_all_line_handles;
	_tmp0_ = bird_font_main_window_get_current_glyph ();
	g = _tmp0_;
	_tmp1_ = g->allocation;
	_tmp2_ = g->allocation;
	g_signal_emit_by_name ((BirdFontFontDisplay*) g, "redraw-area", (gdouble) 0, (gdouble) 0, (gdouble) _tmp1_->width, (gdouble) _tmp2_->height);
	_g_object_unref0 (g);
}

static void
___lambda298__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda298_ ((BirdFontSettingsTab*) self, selected);
}

static void
__lambda299_ (BirdFontSettingsTab* self,
              BirdFontTool* _self_)
{
	g_return_if_fail (_self_ != NULL);
	bird_font_path_set_fill_open_path (TRUE);
}

static void
___lambda299__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda299_ ((BirdFontSettingsTab*) self, selected);
}

static void
__lambda300_ (BirdFontSettingsTab* self,
              BirdFontTool* _self_)
{
	g_return_if_fail (_self_ != NULL);
	bird_font_path_set_fill_open_path (FALSE);
}

static void
___lambda300__bird_font_tool_deselect_action (BirdFontTool* _sender,
                                              BirdFontTool* selected,
                                              gpointer self)
{
	__lambda300_ ((BirdFontSettingsTab*) self, selected);
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

static void
__lambda301_ (BirdFontSettingsTab* self,
              BirdFontTool* _self_)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (_self_ != NULL);
	bird_font_grid_tool_ttf_units = !bird_font_grid_tool_ttf_units;
	_tmp0_ = bool_to_string (bird_font_grid_tool_ttf_units);
	_tmp1_ = _tmp0_;
	bird_font_preferences_set ("ttf_units", _tmp1_);
	_g_free0 (_tmp1_);
}

static void
___lambda301__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda301_ ((BirdFontSettingsTab*) self, selected);
}

static void
__lambda302_ (Block58Data* _data58_,
              BirdFontSpinButton* _self_)
{
	BirdFontSettingsTab* self;
	BirdFontTrackTool* _tmp0_;
	BirdFontSpinButton* _tmp1_;
	self = _data58_->self;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_drawing_tools_track_tool;
	_tmp1_ = _data58_->freehand_samples;
	bird_font_track_tool_set_samples_per_point (_tmp0_, bird_font_spin_button_get_value (_tmp1_));
}

static void
___lambda302__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                      BirdFontSpinButton* selected,
                                                      gpointer self)
{
	__lambda302_ (self, selected);
}

static void
__lambda303_ (Block58Data* _data58_,
              BirdFontSpinButton* _self_)
{
	BirdFontSettingsTab* self;
	BirdFontPenTool* _tmp0_;
	BirdFontSpinButton* _tmp1_;
	self = _data58_->self;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_drawing_tools_pen_tool;
	_tmp1_ = _data58_->simplification_threshold;
	bird_font_pen_tool_set_simplification_threshold (_tmp0_, bird_font_spin_button_get_value (_tmp1_));
}

static void
___lambda303__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                      BirdFontSpinButton* selected,
                                                      gpointer self)
{
	__lambda303_ (self, selected);
}

static void
__lambda304_ (Block58Data* _data58_,
              BirdFontTool* _self_)
{
	BirdFontSettingsTab* self;
	BirdFontTool* _tmp0_;
	const gchar* _tmp1_;
	BirdFontMessageDialog* _tmp2_;
	BirdFontMessageDialog* _tmp3_;
	self = _data58_->self;
	g_return_if_fail (_self_ != NULL);
	bird_font_preferences_set ("translate", "true");
	bird_font_theme_tab_redraw_ui ();
	_tmp0_ = _data58_->translate_ui;
	_tmp0_->selected = TRUE;
	_tmp1_ = self->priv->restart_message;
	_tmp2_ = bird_font_message_dialog_new (_tmp1_);
	_tmp3_ = _tmp2_;
	bird_font_main_window_show_dialog ((BirdFontDialog*) _tmp3_);
	_g_object_unref0 (_tmp3_);
}

static void
___lambda304__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda304_ (self, selected);
}

static void
__lambda305_ (Block58Data* _data58_,
              BirdFontTool* _self_)
{
	BirdFontSettingsTab* self;
	BirdFontTool* _tmp0_;
	const gchar* _tmp1_;
	BirdFontMessageDialog* _tmp2_;
	BirdFontMessageDialog* _tmp3_;
	self = _data58_->self;
	g_return_if_fail (_self_ != NULL);
	bird_font_preferences_set ("translate", "false");
	_tmp0_ = _data58_->translate_ui;
	_tmp0_->selected = FALSE;
	_tmp1_ = self->priv->restart_message;
	_tmp2_ = bird_font_message_dialog_new (_tmp1_);
	_tmp3_ = _tmp2_;
	bird_font_main_window_show_dialog ((BirdFontDialog*) _tmp3_);
	_g_object_unref0 (_tmp3_);
	bird_font_theme_tab_redraw_ui ();
}

static void
___lambda305__bird_font_tool_deselect_action (BirdFontTool* _sender,
                                              BirdFontTool* selected,
                                              gpointer self)
{
	__lambda305_ (self, selected);
}

static void
__lambda306_ (BirdFontSettingsTab* self,
              BirdFontTool* _self_)
{
	g_return_if_fail (_self_ != NULL);
	bird_font_menu_tab_show_theme_tab ();
}

static void
___lambda306__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda306_ ((BirdFontSettingsTab*) self, selected);
}

static void
__lambda307_ (Block58Data* _data58_,
              BirdFontSpinButton* _self_)
{
	BirdFontSettingsTab* self;
	BirdFontSpinButton* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	self = _data58_->self;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = _data58_->num_backups;
	_tmp1_ = bird_font_spin_button_get_short_display_value (_tmp0_);
	_tmp2_ = _tmp1_;
	bird_font_preferences_set ("num_backups", _tmp2_);
	_g_free0 (_tmp2_);
}

static void
___lambda307__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                      BirdFontSpinButton* selected,
                                                      gpointer self)
{
	__lambda307_ (self, selected);
}

static void
__lambda308_ (Block58Data* _data58_,
              BirdFontTool* _self_)
{
	BirdFontSettingsTab* self;
	BirdFontBackupTab* backups = NULL;
	BirdFontBackupTab* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontTabBar* _tmp2_;
	BirdFontTool* _tmp3_;
	self = _data58_->self;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_backup_tab_new ();
	backups = _tmp0_;
	_tmp1_ = bird_font_main_window_tabs;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) backups, TRUE);
	_tmp2_ = bird_font_main_window_tabs;
	bird_font_tab_bar_select_tab_name (_tmp2_, "Backups");
	_tmp3_ = _data58_->load_backups;
	_tmp3_->selected = FALSE;
	_g_object_unref0 (backups);
}

static void
___lambda308__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda308_ (self, selected);
}

static void
bird_font_settings_tab_real_create_setting_items (BirdFontSettingsDisplay* base)
{
	BirdFontSettingsTab * self;
	Block58Data* _data58_;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	BirdFontSettingsItem* _tmp4_;
	BirdFontSettingsItem* _tmp5_;
	BirdFontSpinButton* _tmp6_;
	GeeArrayList* _tmp7_;
	BirdFontSpinButton* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	BirdFontSettingsItem* _tmp11_;
	BirdFontSettingsItem* _tmp12_;
	BirdFontSpinButton* _tmp13_;
	BirdFontSpinButton* _tmp14_;
	BirdFontSpinButton* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gboolean _tmp18_;
	BirdFontSpinButton* _tmp22_;
	BirdFontSpinButton* _tmp23_;
	gchar* precision_value = NULL;
	gchar* _tmp24_;
	const gchar* _tmp25_;
	BirdFontSpinButton* _tmp29_;
	BirdFontSpinButton* _tmp30_;
	BirdFontSpinButton* _tmp31_;
	BirdFontSpinButton* _tmp32_;
	GeeArrayList* _tmp33_;
	BirdFontSpinButton* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	BirdFontSettingsItem* _tmp37_;
	BirdFontSettingsItem* _tmp38_;
	BirdFontTool* show_all_line_handles = NULL;
	BirdFontTool* _tmp39_;
	BirdFontTool* _tmp40_;
	GeeArrayList* _tmp41_;
	BirdFontTool* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	BirdFontSettingsItem* _tmp45_;
	BirdFontSettingsItem* _tmp46_;
	BirdFontTool* fill_open_path = NULL;
	BirdFontTool* _tmp47_;
	BirdFontTool* _tmp48_;
	BirdFontTool* _tmp49_;
	GeeArrayList* _tmp50_;
	BirdFontTool* _tmp51_;
	gchar* _tmp52_;
	gchar* _tmp53_;
	BirdFontSettingsItem* _tmp54_;
	BirdFontSettingsItem* _tmp55_;
	BirdFontTool* ttf_units = NULL;
	BirdFontTool* _tmp56_;
	BirdFontTool* _tmp57_;
	GeeArrayList* _tmp58_;
	BirdFontTool* _tmp59_;
	gchar* _tmp60_;
	gchar* _tmp61_;
	BirdFontSettingsItem* _tmp62_;
	BirdFontSettingsItem* _tmp63_;
	BirdFontSpinButton* _tmp64_;
	GeeArrayList* _tmp65_;
	BirdFontSpinButton* _tmp66_;
	gchar* _tmp67_;
	gchar* _tmp68_;
	BirdFontSettingsItem* _tmp69_;
	BirdFontSettingsItem* _tmp70_;
	BirdFontSpinButton* _tmp71_;
	BirdFontSpinButton* _tmp72_;
	gchar* _tmp75_;
	gchar* _tmp76_;
	gboolean _tmp77_;
	BirdFontSpinButton* _tmp83_;
	BirdFontSpinButton* _tmp84_;
	BirdFontSpinButton* _tmp85_;
	GeeArrayList* _tmp86_;
	BirdFontSpinButton* _tmp87_;
	gchar* _tmp88_;
	gchar* _tmp89_;
	BirdFontSettingsItem* _tmp90_;
	BirdFontSettingsItem* _tmp91_;
	BirdFontSpinButton* _tmp92_;
	BirdFontSpinButton* _tmp93_;
	gchar* _tmp94_;
	gchar* _tmp95_;
	gboolean _tmp96_;
	BirdFontSpinButton* _tmp102_;
	BirdFontTool* _tmp103_;
	BirdFontTool* _tmp104_;
	BirdFontTool* _tmp105_;
	gchar* translate_setting = NULL;
	gchar* _tmp106_;
	gboolean _tmp107_ = FALSE;
	const gchar* _tmp108_;
	BirdFontTool* _tmp110_;
	GeeArrayList* _tmp111_;
	BirdFontTool* _tmp112_;
	gchar* _tmp113_;
	gchar* _tmp114_;
	BirdFontSettingsItem* _tmp115_;
	BirdFontSettingsItem* _tmp116_;
	BirdFontTool* themes = NULL;
	BirdFontTool* _tmp117_;
	BirdFontTool* _tmp118_;
	BirdFontTool* _tmp119_;
	GeeArrayList* _tmp120_;
	BirdFontTool* _tmp121_;
	gchar* _tmp122_;
	gchar* _tmp123_;
	BirdFontSettingsItem* _tmp124_;
	BirdFontSettingsItem* _tmp125_;
	BirdFontSpinButton* _tmp126_;
	GeeArrayList* _tmp127_;
	BirdFontSpinButton* _tmp128_;
	gchar* _tmp129_;
	gchar* _tmp130_;
	BirdFontSettingsItem* _tmp131_;
	BirdFontSettingsItem* _tmp132_;
	BirdFontSpinButton* _tmp133_;
	BirdFontSpinButton* _tmp134_;
	BirdFontSpinButton* _tmp135_;
	BirdFontSpinButton* _tmp136_;
	gchar* current_num_backups = NULL;
	gchar* _tmp137_;
	const gchar* _tmp138_;
	BirdFontSpinButton* _tmp141_;
	BirdFontTool* _tmp142_;
	BirdFontTool* _tmp143_;
	GeeArrayList* _tmp144_;
	BirdFontTool* _tmp145_;
	gchar* _tmp146_;
	gchar* _tmp147_;
	BirdFontSettingsItem* _tmp148_;
	BirdFontSettingsItem* _tmp149_;
	GeeArrayList* _tmp150_;
	gchar* _tmp151_;
	gchar* _tmp152_;
	BirdFontSettingsItem* _tmp153_;
	BirdFontSettingsItem* _tmp154_;
	self = (BirdFontSettingsTab*) base;
	_data58_ = g_slice_new0 (Block58Data);
	_data58_->_ref_count_ = 1;
	_data58_->self = g_object_ref (self);
	_tmp0_ = ((BirdFontSettingsDisplay*) self)->tools;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp0_);
	_tmp1_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp2_ = bird_font_t_ ("Settings");
	_tmp3_ = _tmp2_;
	_tmp4_ = bird_font_settings_item_new_head_line (_tmp3_);
	_tmp5_ = _tmp4_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp1_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	_g_free0 (_tmp3_);
	_tmp6_ = bird_font_spin_button_new ("stroke_width", "");
	_data58_->stroke_width = _tmp6_;
	_tmp7_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp8_ = _data58_->stroke_width;
	_tmp9_ = bird_font_t_ ("Stroke width");
	_tmp10_ = _tmp9_;
	_tmp11_ = bird_font_settings_item_new ((BirdFontTool*) _tmp8_, _tmp10_);
	_tmp12_ = _tmp11_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp7_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	_g_free0 (_tmp10_);
	_tmp13_ = _data58_->stroke_width;
	bird_font_spin_button_set_max (_tmp13_, (gdouble) 4);
	_tmp14_ = _data58_->stroke_width;
	bird_font_spin_button_set_min (_tmp14_, 0.002);
	_tmp15_ = _data58_->stroke_width;
	bird_font_spin_button_set_value_round (_tmp15_, (gdouble) 1, TRUE, TRUE);
	_tmp16_ = bird_font_preferences_get ("stroke_width_for_open_paths");
	_tmp17_ = _tmp16_;
	_tmp18_ = g_strcmp0 (_tmp17_, "") != 0;
	_g_free0 (_tmp17_);
	if (_tmp18_) {
		BirdFontSpinButton* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		_tmp19_ = _data58_->stroke_width;
		_tmp20_ = bird_font_preferences_get ("stroke_width_for_open_paths");
		_tmp21_ = _tmp20_;
		bird_font_spin_button_set_value (_tmp19_, _tmp21_, TRUE, TRUE);
		_g_free0 (_tmp21_);
	}
	_tmp22_ = _data58_->stroke_width;
	g_signal_connect_data (_tmp22_, "new-value-action", (GCallback) ___lambda295__bird_font_spin_button_new_value_action, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp23_ = _data58_->stroke_width;
	bird_font_path_stroke_width = bird_font_spin_button_get_value (_tmp23_);
	_tmp24_ = bird_font_preferences_get ("precision");
	precision_value = _tmp24_;
	_tmp25_ = precision_value;
	if (g_strcmp0 (_tmp25_, "") != 0) {
		BirdFontSpinButton* _tmp26_;
		const gchar* _tmp27_;
		_tmp26_ = bird_font_settings_display_precision;
		_tmp27_ = precision_value;
		bird_font_spin_button_set_value (_tmp26_, _tmp27_, TRUE, TRUE);
	} else {
		BirdFontSpinButton* _tmp28_;
		_tmp28_ = bird_font_settings_display_precision;
		bird_font_spin_button_set_value_round (_tmp28_, (gdouble) 1, TRUE, TRUE);
	}
	_tmp29_ = bird_font_settings_display_precision;
	g_signal_connect_object (_tmp29_, "new-value-action", (GCallback) ___lambda296__bird_font_spin_button_new_value_action, self, 0);
	_tmp30_ = bird_font_settings_display_precision;
	g_signal_connect_object ((BirdFontTool*) _tmp30_, "select-action", (GCallback) ___lambda297__bird_font_tool_select_action, self, 0);
	_tmp31_ = bird_font_settings_display_precision;
	bird_font_spin_button_set_min (_tmp31_, 0.001);
	_tmp32_ = bird_font_settings_display_precision;
	bird_font_spin_button_set_max (_tmp32_, (gdouble) 1);
	_tmp33_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp34_ = bird_font_settings_display_precision;
	_tmp35_ = bird_font_t_ ("Precision for pen tool");
	_tmp36_ = _tmp35_;
	_tmp37_ = bird_font_settings_item_new ((BirdFontTool*) _tmp34_, _tmp36_);
	_tmp38_ = _tmp37_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp33_, _tmp38_);
	_g_object_unref0 (_tmp38_);
	_g_free0 (_tmp36_);
	_tmp39_ = bird_font_tool_new ("show_all_line_handles", "");
	show_all_line_handles = _tmp39_;
	_tmp40_ = show_all_line_handles;
	g_signal_connect_object (_tmp40_, "select-action", (GCallback) ___lambda298__bird_font_tool_select_action, self, 0);
	_tmp41_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp42_ = show_all_line_handles;
	_tmp43_ = bird_font_t_ ("Show or hide control point handles");
	_tmp44_ = _tmp43_;
	_tmp45_ = bird_font_settings_item_new (_tmp42_, _tmp44_);
	_tmp46_ = _tmp45_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp41_, _tmp46_);
	_g_object_unref0 (_tmp46_);
	_g_free0 (_tmp44_);
	_tmp47_ = bird_font_tool_new ("fill_open_path", "");
	fill_open_path = _tmp47_;
	_tmp48_ = fill_open_path;
	g_signal_connect_object (_tmp48_, "select-action", (GCallback) ___lambda299__bird_font_tool_select_action, self, 0);
	_tmp49_ = fill_open_path;
	g_signal_connect_object (_tmp49_, "deselect-action", (GCallback) ___lambda300__bird_font_tool_deselect_action, self, 0);
	_tmp50_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp51_ = fill_open_path;
	_tmp52_ = bird_font_t_ ("Fill paths.");
	_tmp53_ = _tmp52_;
	_tmp54_ = bird_font_settings_item_new (_tmp51_, _tmp53_);
	_tmp55_ = _tmp54_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp50_, _tmp55_);
	_g_object_unref0 (_tmp55_);
	_g_free0 (_tmp53_);
	_tmp56_ = bird_font_tool_new ("ttf_units", "");
	ttf_units = _tmp56_;
	_tmp57_ = ttf_units;
	g_signal_connect_object (_tmp57_, "select-action", (GCallback) ___lambda301__bird_font_tool_select_action, self, 0);
	_tmp58_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp59_ = ttf_units;
	_tmp60_ = bird_font_t_ ("Use TTF units.");
	_tmp61_ = _tmp60_;
	_tmp62_ = bird_font_settings_item_new (_tmp59_, _tmp61_);
	_tmp63_ = _tmp62_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp58_, _tmp63_);
	_g_object_unref0 (_tmp63_);
	_g_free0 (_tmp61_);
	_tmp64_ = bird_font_spin_button_new ("freehand_samples_per_point", "");
	_data58_->freehand_samples = _tmp64_;
	_tmp65_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp66_ = _data58_->freehand_samples;
	_tmp67_ = bird_font_t_ ("Number of points added by the freehand tool");
	_tmp68_ = _tmp67_;
	_tmp69_ = bird_font_settings_item_new ((BirdFontTool*) _tmp66_, _tmp68_);
	_tmp70_ = _tmp69_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp65_, _tmp70_);
	_g_object_unref0 (_tmp70_);
	_g_free0 (_tmp68_);
	_tmp71_ = _data58_->freehand_samples;
	bird_font_spin_button_set_max (_tmp71_, (gdouble) 9);
	_tmp72_ = _data58_->freehand_samples;
	bird_font_spin_button_set_min (_tmp72_, 0.002);
	if (bird_font_bird_font_android) {
		BirdFontSpinButton* _tmp73_;
		_tmp73_ = _data58_->freehand_samples;
		bird_font_spin_button_set_value_round (_tmp73_, 2.5, TRUE, TRUE);
	} else {
		BirdFontSpinButton* _tmp74_;
		_tmp74_ = _data58_->freehand_samples;
		bird_font_spin_button_set_value_round (_tmp74_, (gdouble) 1, TRUE, TRUE);
	}
	_tmp75_ = bird_font_preferences_get ("freehand_samples");
	_tmp76_ = _tmp75_;
	_tmp77_ = g_strcmp0 (_tmp76_, "") != 0;
	_g_free0 (_tmp76_);
	if (_tmp77_) {
		BirdFontSpinButton* _tmp78_;
		gchar* _tmp79_;
		gchar* _tmp80_;
		BirdFontTrackTool* _tmp81_;
		BirdFontSpinButton* _tmp82_;
		_tmp78_ = _data58_->freehand_samples;
		_tmp79_ = bird_font_preferences_get ("freehand_samples");
		_tmp80_ = _tmp79_;
		bird_font_spin_button_set_value (_tmp78_, _tmp80_, TRUE, TRUE);
		_g_free0 (_tmp80_);
		_tmp81_ = bird_font_drawing_tools_track_tool;
		_tmp82_ = _data58_->freehand_samples;
		bird_font_track_tool_set_samples_per_point (_tmp81_, bird_font_spin_button_get_value (_tmp82_));
	}
	_tmp83_ = _data58_->freehand_samples;
	g_signal_connect_data (_tmp83_, "new-value-action", (GCallback) ___lambda302__bird_font_spin_button_new_value_action, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp84_ = bird_font_spin_button_new ("simplification_threshold", "");
	_data58_->simplification_threshold = _tmp84_;
	_tmp85_ = _data58_->simplification_threshold;
	bird_font_spin_button_set_value_round (_tmp85_, 0.5, TRUE, TRUE);
	_tmp86_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp87_ = _data58_->simplification_threshold;
	_tmp88_ = bird_font_t_ ("Path simplification threshold");
	_tmp89_ = _tmp88_;
	_tmp90_ = bird_font_settings_item_new ((BirdFontTool*) _tmp87_, _tmp89_);
	_tmp91_ = _tmp90_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp86_, _tmp91_);
	_g_object_unref0 (_tmp91_);
	_g_free0 (_tmp89_);
	_tmp92_ = _data58_->simplification_threshold;
	bird_font_spin_button_set_max (_tmp92_, (gdouble) 5);
	_tmp93_ = _data58_->freehand_samples;
	bird_font_spin_button_set_min (_tmp93_, 0.002);
	_tmp94_ = bird_font_preferences_get ("simplification_threshold");
	_tmp95_ = _tmp94_;
	_tmp96_ = g_strcmp0 (_tmp95_, "") != 0;
	_g_free0 (_tmp95_);
	if (_tmp96_) {
		BirdFontSpinButton* _tmp97_;
		gchar* _tmp98_;
		gchar* _tmp99_;
		BirdFontPenTool* _tmp100_;
		BirdFontSpinButton* _tmp101_;
		_tmp97_ = _data58_->freehand_samples;
		_tmp98_ = bird_font_preferences_get ("simplification_threshold");
		_tmp99_ = _tmp98_;
		bird_font_spin_button_set_value (_tmp97_, _tmp99_, TRUE, TRUE);
		_g_free0 (_tmp99_);
		_tmp100_ = bird_font_drawing_tools_pen_tool;
		_tmp101_ = _data58_->simplification_threshold;
		bird_font_pen_tool_set_simplification_threshold (_tmp100_, bird_font_spin_button_get_value (_tmp101_));
	}
	_tmp102_ = _data58_->freehand_samples;
	g_signal_connect_data (_tmp102_, "new-value-action", (GCallback) ___lambda303__bird_font_spin_button_new_value_action, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp103_ = bird_font_tool_new ("translate", "");
	_data58_->translate_ui = _tmp103_;
	_tmp104_ = _data58_->translate_ui;
	g_signal_connect_data (_tmp104_, "select-action", (GCallback) ___lambda304__bird_font_tool_select_action, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp105_ = _data58_->translate_ui;
	g_signal_connect_data (_tmp105_, "deselect-action", (GCallback) ___lambda305__bird_font_tool_deselect_action, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp106_ = bird_font_preferences_get ("translate");
	translate_setting = _tmp106_;
	_tmp108_ = translate_setting;
	if (g_strcmp0 (_tmp108_, "") == 0) {
		_tmp107_ = TRUE;
	} else {
		const gchar* _tmp109_;
		_tmp109_ = translate_setting;
		_tmp107_ = g_strcmp0 (_tmp109_, "true") == 0;
	}
	_tmp110_ = _data58_->translate_ui;
	_tmp110_->selected = _tmp107_;
	_tmp111_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp112_ = _data58_->translate_ui;
	_tmp113_ = bird_font_t_ ("Translate");
	_tmp114_ = _tmp113_;
	_tmp115_ = bird_font_settings_item_new (_tmp112_, _tmp114_);
	_tmp116_ = _tmp115_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp111_, _tmp116_);
	_g_object_unref0 (_tmp116_);
	_g_free0 (_tmp114_);
	_tmp117_ = bird_font_tool_new ("open_theme_tab", "");
	themes = _tmp117_;
	_tmp118_ = themes;
	bird_font_tool_set_icon (_tmp118_, "theme");
	_tmp119_ = themes;
	g_signal_connect_object (_tmp119_, "select-action", (GCallback) ___lambda306__bird_font_tool_select_action, self, 0);
	_tmp120_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp121_ = themes;
	_tmp122_ = bird_font_t_ ("Color theme");
	_tmp123_ = _tmp122_;
	_tmp124_ = bird_font_settings_item_new (_tmp121_, _tmp123_);
	_tmp125_ = _tmp124_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp120_, _tmp125_);
	_g_object_unref0 (_tmp125_);
	_g_free0 (_tmp123_);
	_tmp126_ = bird_font_spin_button_new ("num_backups", "");
	_data58_->num_backups = _tmp126_;
	_tmp127_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp128_ = _data58_->num_backups;
	_tmp129_ = bird_font_t_ ("Number of backups per font");
	_tmp130_ = _tmp129_;
	_tmp131_ = bird_font_settings_item_new ((BirdFontTool*) _tmp128_, _tmp130_);
	_tmp132_ = _tmp131_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp127_, _tmp132_);
	_g_object_unref0 (_tmp132_);
	_g_free0 (_tmp130_);
	_tmp133_ = _data58_->num_backups;
	bird_font_spin_button_set_integers (_tmp133_, TRUE);
	_tmp134_ = _data58_->num_backups;
	bird_font_spin_button_set_max (_tmp134_, (gdouble) 100);
	_tmp135_ = _data58_->num_backups;
	bird_font_spin_button_set_min (_tmp135_, (gdouble) 0);
	_tmp136_ = _data58_->num_backups;
	bird_font_spin_button_set_value (_tmp136_, "20", TRUE, TRUE);
	_tmp137_ = bird_font_preferences_get ("num_backups");
	current_num_backups = _tmp137_;
	_tmp138_ = current_num_backups;
	if (g_strcmp0 (_tmp138_, "") != 0) {
		BirdFontSpinButton* _tmp139_;
		const gchar* _tmp140_;
		_tmp139_ = _data58_->num_backups;
		_tmp140_ = current_num_backups;
		bird_font_spin_button_set_value (_tmp139_, _tmp140_, TRUE, TRUE);
	}
	_tmp141_ = _data58_->num_backups;
	g_signal_connect_data (_tmp141_, "new-value-action", (GCallback) ___lambda307__bird_font_spin_button_new_value_action, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp142_ = bird_font_tool_new ("load_backups", "");
	_data58_->load_backups = _tmp142_;
	_tmp143_ = _data58_->load_backups;
	g_signal_connect_data (_tmp143_, "select-action", (GCallback) ___lambda308__bird_font_tool_select_action, block58_data_ref (_data58_), (GClosureNotify) block58_data_unref, 0);
	_tmp144_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp145_ = _data58_->load_backups;
	_tmp146_ = bird_font_t_ ("Load a backup font");
	_tmp147_ = _tmp146_;
	_tmp148_ = bird_font_settings_item_new (_tmp145_, _tmp147_);
	_tmp149_ = _tmp148_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp144_, _tmp149_);
	_g_object_unref0 (_tmp149_);
	_g_free0 (_tmp147_);
	_tmp150_ = ((BirdFontSettingsDisplay*) self)->tools;
	_tmp151_ = bird_font_t_ ("Key Bindings");
	_tmp152_ = _tmp151_;
	_tmp153_ = bird_font_settings_item_new_head_line (_tmp152_);
	_tmp154_ = _tmp153_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp150_, _tmp154_);
	_g_object_unref0 (_tmp154_);
	_g_free0 (_tmp152_);
	{
		GeeArrayList* _menu_item_list = NULL;
		BirdFontAbstractMenu* _tmp155_;
		BirdFontAbstractMenu* _tmp156_;
		GeeArrayList* _tmp157_;
		GeeArrayList* _tmp158_;
		gint _menu_item_size = 0;
		GeeArrayList* _tmp159_;
		gint _tmp160_;
		gint _tmp161_;
		gint _menu_item_index = 0;
		_tmp155_ = bird_font_main_window_get_menu ();
		_tmp156_ = _tmp155_;
		_tmp157_ = _tmp156_->sorted_menu_items;
		_tmp158_ = _tmp157_;
		_g_object_unref0 (_tmp156_);
		_menu_item_list = _tmp158_;
		_tmp159_ = _menu_item_list;
		_tmp160_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp159_);
		_tmp161_ = _tmp160_;
		_menu_item_size = _tmp161_;
		_menu_item_index = -1;
		while (TRUE) {
			gint _tmp162_;
			gint _tmp163_;
			BirdFontMenuItem* menu_item = NULL;
			GeeArrayList* _tmp164_;
			gpointer _tmp165_;
			GeeArrayList* _tmp166_;
			BirdFontMenuItem* _tmp167_;
			BirdFontSettingsItem* _tmp168_;
			BirdFontSettingsItem* _tmp169_;
			_menu_item_index = _menu_item_index + 1;
			_tmp162_ = _menu_item_index;
			_tmp163_ = _menu_item_size;
			if (!(_tmp162_ < _tmp163_)) {
				break;
			}
			_tmp164_ = _menu_item_list;
			_tmp165_ = gee_abstract_list_get ((GeeAbstractList*) _tmp164_, _menu_item_index);
			menu_item = (BirdFontMenuItem*) _tmp165_;
			_tmp166_ = ((BirdFontSettingsDisplay*) self)->tools;
			_tmp167_ = menu_item;
			_tmp168_ = bird_font_settings_item_new_key_binding (_tmp167_);
			_tmp169_ = _tmp168_;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp166_, _tmp169_);
			_g_object_unref0 (_tmp169_);
			_g_object_unref0 (menu_item);
		}
	}
	_g_free0 (current_num_backups);
	_g_object_unref0 (themes);
	_g_free0 (translate_setting);
	_g_object_unref0 (ttf_units);
	_g_object_unref0 (fill_open_path);
	_g_object_unref0 (show_all_line_handles);
	_g_free0 (precision_value);
	block58_data_unref (_data58_);
	_data58_ = NULL;
}

static gchar*
bird_font_settings_tab_real_get_label (BirdFontFontDisplay* base)
{
	BirdFontSettingsTab * self;
	gchar* _tmp0_;
	gchar* result;
	self = (BirdFontSettingsTab*) base;
	_tmp0_ = bird_font_t_ ("Settings");
	result = _tmp0_;
	return result;
}

static gchar*
bird_font_settings_tab_real_get_name (BirdFontFontDisplay* base)
{
	BirdFontSettingsTab * self;
	gchar* _tmp0_;
	gchar* result;
	self = (BirdFontSettingsTab*) base;
	_tmp0_ = g_strdup ("Settings");
	result = _tmp0_;
	return result;
}

static void
bird_font_settings_tab_class_init (BirdFontSettingsTabClass * klass,
                                   gpointer klass_data)
{
	bird_font_settings_tab_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BirdFontSettingsTab_private_offset);
	((BirdFontSettingsDisplayClass *) klass)->create_setting_items = (void (*) (BirdFontSettingsDisplay*)) bird_font_settings_tab_real_create_setting_items;
	((BirdFontFontDisplayClass *) klass)->get_label = (gchar* (*) (BirdFontFontDisplay*)) bird_font_settings_tab_real_get_label;
	((BirdFontFontDisplayClass *) klass)->get_name = (gchar* (*) (BirdFontFontDisplay*)) bird_font_settings_tab_real_get_name;
	G_OBJECT_CLASS (klass)->finalize = bird_font_settings_tab_finalize;
}

static void
bird_font_settings_tab_instance_init (BirdFontSettingsTab * self,
                                      gpointer klass)
{
	gchar* _tmp0_;
	self->priv = bird_font_settings_tab_get_instance_private (self);
	_tmp0_ = g_strdup ("You need to restart the program in order to apply this setting.");
	self->priv->restart_message = _tmp0_;
}

static void
bird_font_settings_tab_finalize (GObject * obj)
{
	BirdFontSettingsTab * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIRD_FONT_TYPE_SETTINGS_TAB, BirdFontSettingsTab);
	_g_free0 (self->priv->restart_message);
	G_OBJECT_CLASS (bird_font_settings_tab_parent_class)->finalize (obj);
}

static GType
bird_font_settings_tab_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BirdFontSettingsTabClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bird_font_settings_tab_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BirdFontSettingsTab), 0, (GInstanceInitFunc) bird_font_settings_tab_instance_init, NULL };
	GType bird_font_settings_tab_type_id;
	bird_font_settings_tab_type_id = g_type_register_static (BIRD_FONT_TYPE_SETTINGS_DISPLAY, "BirdFontSettingsTab", &g_define_type_info, 0);
	BirdFontSettingsTab_private_offset = g_type_add_instance_private (bird_font_settings_tab_type_id, sizeof (BirdFontSettingsTabPrivate));
	return bird_font_settings_tab_type_id;
}

GType
bird_font_settings_tab_get_type (void)
{
	static volatile gsize bird_font_settings_tab_type_id__once = 0;
	if (g_once_init_enter (&bird_font_settings_tab_type_id__once)) {
		GType bird_font_settings_tab_type_id;
		bird_font_settings_tab_type_id = bird_font_settings_tab_get_type_once ();
		g_once_init_leave (&bird_font_settings_tab_type_id__once, bird_font_settings_tab_type_id);
	}
	return bird_font_settings_tab_type_id__once;
}

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

