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

/*
Copyright (C) 2014 2015 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 <gee.h>
#include <glib-object.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

enum  {
	BIRD_FONT_OVERVIEW_TOOLS_0_PROPERTY,
	BIRD_FONT_OVERVIEW_TOOLS_NUM_PROPERTIES
};
static GParamSpec* bird_font_overview_tools_properties[BIRD_FONT_OVERVIEW_TOOLS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block39Data Block39Data;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _bird_font_glyph_range_unref0(var) ((var == NULL) ? NULL : (var = (bird_font_glyph_range_unref (var), NULL)))
typedef struct _Block40Data Block40Data;
#define _g_source_unref0(var) ((var == NULL) ? NULL : (var = (g_source_unref (var), NULL)))
#define _bird_font_overview_overview_undo_item_unref0(var) ((var == NULL) ? NULL : (var = (bird_font_overview_overview_undo_item_unref (var), NULL)))

struct _Block39Data {
	int _ref_count_;
	BirdFontOverviewTools* self;
	BirdFontTool* transform_slant;
	BirdFontTool* transform_size;
};

struct _Block40Data {
	int _ref_count_;
	BirdFontOverviewTools* self;
	BirdFontTool* _self_;
};

static gpointer bird_font_overview_tools_parent_class = NULL;
static BirdFontLabelTool* bird_font_overview_tools_all_glyphs;
static BirdFontLabelTool* bird_font_overview_tools_all_glyphs = NULL;
static BirdFontLabelTool* bird_font_overview_tools_default_glyphs;
static BirdFontLabelTool* bird_font_overview_tools_default_glyphs = NULL;
static BirdFontLabelTool* bird_font_overview_tools_unicode;
static BirdFontLabelTool* bird_font_overview_tools_unicode = NULL;
static GeeArrayList* bird_font_overview_tools_custom_character_sets;
static GeeArrayList* bird_font_overview_tools_custom_character_sets = NULL;
GeeArrayList* bird_font_overview_tools_expanders = NULL;
BirdFontExpander* bird_font_overview_tools_zoom_expander = NULL;
BirdFontSpinButton* bird_font_overview_tools_skew = NULL;
BirdFontSpinButton* bird_font_overview_tools_resize = NULL;
gdouble bird_font_overview_tools_current_master_size = 0.0;

static Block39Data* block39_data_ref (Block39Data* _data39_);
static void block39_data_unref (void * _userdata_);
static void __lambda100_ (BirdFontOverviewTools* self,
                   gdouble z);
static void ___lambda100__bird_font_zoom_bar_new_zoom (BirdFontZoomBar* _sender,
                                                gdouble zoom_level,
                                                gpointer self);
static void __lambda101_ (BirdFontOverviewTools* self,
                   BirdFontTool* _self_);
static void ___lambda101__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda102_ (BirdFontOverviewTools* self,
                   BirdFontTool* _self_);
static void ___lambda102__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda103_ (BirdFontOverviewTools* self,
                   BirdFontTool* _self_);
static void ___lambda103__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda105_ (Block39Data* _data39_,
                   BirdFontTool* _self_);
static void ___lambda105__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void __lambda114_ (Block39Data* _data39_,
                   BirdFontTool* _self_);
static void ___lambda114__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void _bird_font_overview_tools_add_new_alternate_bird_font_tool_select_action (BirdFontTool* _sender,
                                                                               BirdFontTool* selected,
                                                                               gpointer self);
static void __lambda226_ (BirdFontOverviewTools* self,
                   BirdFontTool* _self_);
static Block40Data* block40_data_ref (Block40Data* _data40_);
static void block40_data_unref (void * _userdata_);
static void bird_font_overview_tools_fix_curve_orientation (BirdFontOverviewTools* self);
static void _bird_font_overview_tools_fix_curve_orientation_bird_font_task_runnable (gpointer self);
static gboolean __lambda227_ (Block40Data* _data40_);
static gboolean ___lambda227__gsource_func (gpointer self);
static void ___lambda226__bird_font_tool_select_action (BirdFontTool* _sender,
                                                 BirdFontTool* selected,
                                                 gpointer self);
static void _bird_font_overview_tools_search_for_glyph_bird_font_tool_select_action (BirdFontTool* _sender,
                                                                              BirdFontTool* selected,
                                                                              gpointer self);
static void __lambda230_ (BirdFontOverviewTools* self,
                   BirdFontSpinButton* _self_);
static void ___lambda230__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                           BirdFontSpinButton* selected,
                                                           gpointer self);
static void bird_font_overview_tools_create_master (BirdFontOverviewTools* self);
static void _bird_font_overview_tools_create_master_bird_font_tool_select_action (BirdFontTool* _sender,
                                                                           BirdFontTool* selected,
                                                                           gpointer self);
static gchar* bird_font_overview_tools_get_display_value (guint size);
static GeeArrayList* bird_font_overview_tools_real_get_expanders (BirdFontToolCollection* base);
static GeeArrayList* bird_font_overview_tools_real_get_displays (BirdFontToolCollection* base);
static void bird_font_overview_tools_finalize (GObject * obj);
static GType bird_font_overview_tools_get_type_once (void);

static GType
bird_font_transform_get_type_once (void)
{
	static const GEnumValue values[] = {{BIRD_FONT_TRANSFORM_SLANT, "BIRD_FONT_TRANSFORM_SLANT", "slant"}, {BIRD_FONT_TRANSFORM_SIZE, "BIRD_FONT_TRANSFORM_SIZE", "size"}, {0, NULL, NULL}};
	GType bird_font_transform_type_id;
	bird_font_transform_type_id = g_enum_register_static ("BirdFontTransform", values);
	return bird_font_transform_type_id;
}

GType
bird_font_transform_get_type (void)
{
	static volatile gsize bird_font_transform_type_id__once = 0;
	if (g_once_init_enter (&bird_font_transform_type_id__once)) {
		GType bird_font_transform_type_id;
		bird_font_transform_type_id = bird_font_transform_get_type_once ();
		g_once_init_leave (&bird_font_transform_type_id__once, bird_font_transform_type_id);
	}
	return bird_font_transform_type_id__once;
}

static Block39Data*
block39_data_ref (Block39Data* _data39_)
{
	g_atomic_int_inc (&_data39_->_ref_count_);
	return _data39_;
}

static void
block39_data_unref (void * _userdata_)
{
	Block39Data* _data39_;
	_data39_ = (Block39Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data39_->_ref_count_)) {
		BirdFontOverviewTools* self;
		self = _data39_->self;
		_g_object_unref0 (_data39_->transform_size);
		_g_object_unref0 (_data39_->transform_slant);
		_g_object_unref0 (self);
		g_slice_free (Block39Data, _data39_);
	}
}

static void
__lambda100_ (BirdFontOverviewTools* self,
              gdouble z)
{
	BirdFontOverview* _tmp0_;
	BirdFontOverview* _tmp1_;
	_tmp0_ = bird_font_overview_tools_get_overview (self);
	_tmp1_ = _tmp0_;
	bird_font_overview_set_zoom (_tmp1_, z);
	_g_object_unref0 (_tmp1_);
}

static void
___lambda100__bird_font_zoom_bar_new_zoom (BirdFontZoomBar* _sender,
                                           gdouble zoom_level,
                                           gpointer self)
{
	__lambda100_ ((BirdFontOverviewTools*) self, zoom_level);
}

static void
__lambda101_ (BirdFontOverviewTools* self,
              BirdFontTool* _self_)
{
	BirdFontOverview* overview = NULL;
	BirdFontOverview* _tmp0_;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_overview_tools_get_overview (self);
	overview = _tmp0_;
	bird_font_overview_display_all_available_glyphs (overview);
	bird_font_overview_tools_update_overview_characterset (overview);
	bird_font_font_display_dirty_scrollbar = TRUE;
	_g_object_unref0 (overview);
}

static void
___lambda101__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda101_ ((BirdFontOverviewTools*) self, selected);
}

static void
__lambda102_ (BirdFontOverviewTools* self,
              BirdFontTool* _self_)
{
	BirdFontOverview* overview = NULL;
	BirdFontOverview* _tmp0_;
	BirdFontGlyphRange* gr = NULL;
	BirdFontGlyphRange* _tmp1_;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_overview_tools_get_overview (self);
	overview = _tmp0_;
	_tmp1_ = bird_font_glyph_range_new ();
	gr = _tmp1_;
	bird_font_default_character_set_use_default_range (gr);
	bird_font_overview_set_current_glyph_range (overview, gr);
	bird_font_overview_tools_update_overview_characterset (overview);
	bird_font_font_display_dirty_scrollbar = TRUE;
	_bird_font_glyph_range_unref0 (gr);
	_g_object_unref0 (overview);
}

static void
___lambda102__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda102_ ((BirdFontOverviewTools*) self, selected);
}

static void
__lambda103_ (BirdFontOverviewTools* self,
              BirdFontTool* _self_)
{
	BirdFontOverview* overview = NULL;
	BirdFontOverview* _tmp0_;
	BirdFontGlyphRange* gr = NULL;
	BirdFontGlyphRange* _tmp1_;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_overview_tools_get_overview (self);
	overview = _tmp0_;
	_tmp1_ = bird_font_glyph_range_new ();
	gr = _tmp1_;
	bird_font_default_character_set_use_full_unicode_range (gr);
	bird_font_overview_set_current_glyph_range (overview, gr);
	bird_font_overview_tools_update_overview_characterset (overview);
	bird_font_font_display_dirty_scrollbar = TRUE;
	_bird_font_glyph_range_unref0 (gr);
	_g_object_unref0 (overview);
}

static void
___lambda103__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda103_ ((BirdFontOverviewTools*) self, selected);
}

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

static gchar*
double_to_string (gdouble self)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint _tmp1__length1;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	_tmp0_ = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = G_ASCII_DTOSTR_BUF_SIZE;
	_tmp2_ = g_ascii_dtostr (_tmp1_, (gint) G_ASCII_DTOSTR_BUF_SIZE, self);
	_tmp3_ = g_strdup (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp1_ = (g_free (_tmp1_), NULL);
	result = _tmp4_;
	return result;
}

static void
__lambda105_ (Block39Data* _data39_,
              BirdFontTool* _self_)
{
	BirdFontOverviewTools* self;
	BirdFontFontSettings* fs = NULL;
	BirdFontFont* _tmp0_;
	BirdFontFont* _tmp1_;
	BirdFontFontSettings* _tmp2_;
	BirdFontFontSettings* _tmp3_;
	BirdFontFontSettings* _tmp4_;
	BirdFontSpinButton* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	BirdFontTool* _tmp8_;
	BirdFontFont* _tmp9_;
	BirdFontFont* _tmp10_;
	self = _data39_->self;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_bird_font_get_current_font ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	fs = _tmp4_;
	_tmp5_ = bird_font_overview_tools_skew;
	_tmp6_ = double_to_string (bird_font_spin_button_get_value (_tmp5_));
	_tmp7_ = _tmp6_;
	bird_font_font_settings_set_setting (fs, "skew_overview", _tmp7_);
	_g_free0 (_tmp7_);
	_tmp8_ = _data39_->transform_slant;
	_tmp8_->selected = FALSE;
	bird_font_overview_tools_process_transform (self, BIRD_FONT_TRANSFORM_SLANT);
	_tmp9_ = bird_font_bird_font_get_current_font ();
	_tmp10_ = _tmp9_;
	bird_font_font_touch (_tmp10_);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (fs);
}

static void
___lambda105__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda105_ (self, selected);
}

static void
__lambda114_ (Block39Data* _data39_,
              BirdFontTool* _self_)
{
	BirdFontOverviewTools* self;
	BirdFontFontSettings* fs = NULL;
	BirdFontFont* _tmp0_;
	BirdFontFont* _tmp1_;
	BirdFontFontSettings* _tmp2_;
	BirdFontFontSettings* _tmp3_;
	BirdFontFontSettings* _tmp4_;
	BirdFontSpinButton* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	BirdFontTool* _tmp8_;
	BirdFontFont* _tmp9_;
	BirdFontFont* _tmp10_;
	self = _data39_->self;
	g_return_if_fail (_self_ != NULL);
	_tmp0_ = bird_font_bird_font_get_current_font ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_object_unref0 (_tmp1_);
	fs = _tmp4_;
	_tmp5_ = bird_font_overview_tools_resize;
	_tmp6_ = double_to_string (bird_font_spin_button_get_value (_tmp5_));
	_tmp7_ = _tmp6_;
	bird_font_font_settings_set_setting (fs, "resize_overview", _tmp7_);
	_g_free0 (_tmp7_);
	_tmp8_ = _data39_->transform_size;
	_tmp8_->selected = FALSE;
	bird_font_overview_tools_process_transform (self, BIRD_FONT_TRANSFORM_SIZE);
	_tmp9_ = bird_font_bird_font_get_current_font ();
	_tmp10_ = _tmp9_;
	bird_font_font_touch (_tmp10_);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (fs);
}

static void
___lambda114__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda114_ (self, selected);
}

static void
_bird_font_overview_tools_add_new_alternate_bird_font_tool_select_action (BirdFontTool* _sender,
                                                                          BirdFontTool* selected,
                                                                          gpointer self)
{
	bird_font_overview_tools_add_new_alternate ((BirdFontOverviewTools*) self, selected);
}

static Block40Data*
block40_data_ref (Block40Data* _data40_)
{
	g_atomic_int_inc (&_data40_->_ref_count_);
	return _data40_;
}

static void
block40_data_unref (void * _userdata_)
{
	Block40Data* _data40_;
	_data40_ = (Block40Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data40_->_ref_count_)) {
		BirdFontOverviewTools* self;
		self = _data40_->self;
		_g_object_unref0 (_data40_->_self_);
		_g_object_unref0 (self);
		g_slice_free (Block40Data, _data40_);
	}
}

static void
_bird_font_overview_tools_fix_curve_orientation_bird_font_task_runnable (gpointer self)
{
	bird_font_overview_tools_fix_curve_orientation ((BirdFontOverviewTools*) self);
}

static gboolean
__lambda227_ (Block40Data* _data40_)
{
	BirdFontOverviewTools* self;
	BirdFontFont* _tmp0_;
	BirdFontFont* _tmp1_;
	gboolean result;
	self = _data40_->self;
	bird_font_tool_set_selected (_data40_->_self_, FALSE);
	_tmp0_ = bird_font_bird_font_get_current_font ();
	_tmp1_ = _tmp0_;
	bird_font_font_touch (_tmp1_);
	_g_object_unref0 (_tmp1_);
	result = FALSE;
	return result;
}

static gboolean
___lambda227__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda227_ (self);
	return result;
}

static void
__lambda226_ (BirdFontOverviewTools* self,
              BirdFontTool* _self_)
{
	Block40Data* _data40_;
	BirdFontTool* _tmp0_;
	BirdFontTask* t = NULL;
	BirdFontTask* _tmp1_;
	GSource* idle = NULL;
	GSource* _tmp2_;
	g_return_if_fail (_self_ != NULL);
	_data40_ = g_slice_new0 (Block40Data);
	_data40_->_ref_count_ = 1;
	_data40_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (_self_);
	_g_object_unref0 (_data40_->_self_);
	_data40_->_self_ = _tmp0_;
	_tmp1_ = bird_font_task_new (_bird_font_overview_tools_fix_curve_orientation_bird_font_task_runnable, g_object_ref (self), g_object_unref, FALSE);
	t = _tmp1_;
	bird_font_main_window_run_blocking_task (t);
	_tmp2_ = g_idle_source_new ();
	idle = _tmp2_;
	g_source_set_callback (idle, ___lambda227__gsource_func, block40_data_ref (_data40_), block40_data_unref);
	g_source_attach (idle, NULL);
	_g_source_unref0 (idle);
	_g_object_unref0 (t);
	block40_data_unref (_data40_);
	_data40_ = NULL;
}

static void
___lambda226__bird_font_tool_select_action (BirdFontTool* _sender,
                                            BirdFontTool* selected,
                                            gpointer self)
{
	__lambda226_ ((BirdFontOverviewTools*) self, selected);
}

static void
_bird_font_overview_tools_search_for_glyph_bird_font_tool_select_action (BirdFontTool* _sender,
                                                                         BirdFontTool* selected,
                                                                         gpointer self)
{
	bird_font_overview_tools_search_for_glyph ((BirdFontOverviewTools*) self, selected);
}

static void
__lambda230_ (BirdFontOverviewTools* self,
              BirdFontSpinButton* _self_)
{
	BirdFontOverview* _tmp0_;
	BirdFontOverview* _tmp1_;
	g_return_if_fail (_self_ != NULL);
	bird_font_overview_tools_current_master_size = bird_font_spin_button_get_value (_self_);
	_tmp0_ = bird_font_main_window_get_overview ();
	_tmp1_ = _tmp0_;
	bird_font_overview_update_item_list (_tmp1_);
	_g_object_unref0 (_tmp1_);
	bird_font_glyph_canvas_redraw ();
}

static void
___lambda230__bird_font_spin_button_new_value_action (BirdFontSpinButton* _sender,
                                                      BirdFontSpinButton* selected,
                                                      gpointer self)
{
	__lambda230_ ((BirdFontOverviewTools*) self, selected);
}

static void
_bird_font_overview_tools_create_master_bird_font_tool_select_action (BirdFontTool* _sender,
                                                                      BirdFontTool* selected,
                                                                      gpointer self)
{
	bird_font_overview_tools_create_master ((BirdFontOverviewTools*) self);
}

BirdFontOverviewTools*
bird_font_overview_tools_construct (GType object_type)
{
	BirdFontOverviewTools * self = NULL;
	Block39Data* _data39_;
	BirdFontExpander* font_name = NULL;
	BirdFontExpander* _tmp0_;
	BirdFontExpander* character_sets = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	BirdFontExpander* _tmp3_;
	BirdFontExpander* _tmp4_;
	BirdFontExpander* zoom_expander = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	BirdFontExpander* _tmp7_;
	BirdFontExpander* _tmp8_;
	BirdFontExpander* transform_slant_expander = NULL;
	gchar* _tmp9_;
	gchar* _tmp10_;
	BirdFontExpander* _tmp11_;
	BirdFontExpander* _tmp12_;
	BirdFontExpander* transform_size_expander = NULL;
	BirdFontExpander* _tmp13_;
	BirdFontExpander* glyph_expander = NULL;
	gchar* _tmp14_;
	gchar* _tmp15_;
	BirdFontExpander* _tmp16_;
	BirdFontExpander* _tmp17_;
	BirdFontExpander* multi_master = NULL;
	gchar* _tmp18_;
	gchar* _tmp19_;
	BirdFontExpander* _tmp20_;
	BirdFontExpander* _tmp21_;
	GeeArrayList* _tmp22_;
	GeeArrayList* _tmp23_;
	BirdFontExpander* _tmp24_;
	BirdFontFontName* _tmp25_;
	BirdFontFontName* _tmp26_;
	BirdFontZoomBar* _tmp27_;
	BirdFontZoomBar* _tmp28_;
	BirdFontExpander* _tmp29_;
	BirdFontZoomBar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	BirdFontLabelTool* _tmp33_;
	BirdFontLabelTool* _tmp34_;
	BirdFontLabelTool* _tmp35_;
	BirdFontExpander* _tmp36_;
	BirdFontLabelTool* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	BirdFontLabelTool* _tmp40_;
	BirdFontLabelTool* _tmp41_;
	BirdFontLabelTool* _tmp42_;
	BirdFontExpander* _tmp43_;
	BirdFontLabelTool* _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_;
	BirdFontLabelTool* _tmp47_;
	BirdFontLabelTool* _tmp48_;
	BirdFontLabelTool* _tmp49_;
	BirdFontExpander* _tmp50_;
	BirdFontLabelTool* _tmp51_;
	BirdFontExpander* _tmp52_;
	BirdFontExpander* _tmp53_;
	gchar* _tmp54_;
	gchar* _tmp55_;
	BirdFontSpinButton* _tmp56_;
	BirdFontSpinButton* _tmp57_;
	BirdFontSpinButton* _tmp58_;
	BirdFontFontSettings* settings = NULL;
	BirdFontFont* _tmp59_;
	BirdFontFont* _tmp60_;
	BirdFontFontSettings* _tmp61_;
	BirdFontFontSettings* _tmp62_;
	BirdFontFontSettings* _tmp63_;
	gchar* skew_value = NULL;
	BirdFontFontSettings* _tmp64_;
	gchar* _tmp65_;
	const gchar* _tmp66_;
	BirdFontSpinButton* _tmp69_;
	BirdFontSpinButton* _tmp70_;
	BirdFontSpinButton* _tmp71_;
	BirdFontSpinButton* _tmp72_;
	BirdFontSpinButton* _tmp73_;
	BirdFontExpander* _tmp74_;
	BirdFontSpinButton* _tmp75_;
	gchar* _tmp76_;
	gchar* _tmp77_;
	BirdFontTool* _tmp78_;
	BirdFontTool* _tmp79_;
	BirdFontTool* _tmp80_;
	BirdFontTool* _tmp81_;
	BirdFontTool* _tmp82_;
	BirdFontTool* _tmp83_;
	BirdFontExpander* _tmp84_;
	BirdFontTool* _tmp85_;
	gchar* _tmp86_;
	gchar* _tmp87_;
	BirdFontSpinButton* _tmp88_;
	BirdFontSpinButton* _tmp89_;
	BirdFontSpinButton* _tmp90_;
	gchar* resize_value = NULL;
	BirdFontFontSettings* _tmp91_;
	gchar* _tmp92_;
	const gchar* _tmp93_;
	BirdFontSpinButton* _tmp98_;
	BirdFontSpinButton* _tmp99_;
	BirdFontSpinButton* _tmp100_;
	BirdFontSpinButton* _tmp101_;
	BirdFontSpinButton* _tmp102_;
	BirdFontExpander* _tmp103_;
	BirdFontSpinButton* _tmp104_;
	gchar* _tmp105_;
	gchar* _tmp106_;
	BirdFontTool* _tmp107_;
	BirdFontTool* _tmp108_;
	BirdFontTool* _tmp109_;
	BirdFontTool* _tmp110_;
	BirdFontTool* _tmp111_;
	BirdFontTool* _tmp112_;
	BirdFontExpander* _tmp113_;
	BirdFontTool* _tmp114_;
	BirdFontTool* alternate = NULL;
	gchar* _tmp115_;
	gchar* _tmp116_;
	BirdFontTool* _tmp117_;
	BirdFontTool* _tmp118_;
	BirdFontTool* _tmp119_;
	BirdFontExpander* _tmp120_;
	BirdFontTool* _tmp121_;
	BirdFontTool* curve_orientation = NULL;
	gchar* _tmp122_;
	gchar* _tmp123_;
	BirdFontTool* _tmp124_;
	BirdFontTool* _tmp125_;
	BirdFontTool* _tmp126_;
	BirdFontExpander* _tmp127_;
	BirdFontTool* _tmp128_;
	BirdFontTool* search_glyph = NULL;
	gchar* _tmp129_;
	gchar* _tmp130_;
	BirdFontTool* _tmp131_;
	BirdFontTool* _tmp132_;
	BirdFontTool* _tmp133_;
	BirdFontExpander* _tmp134_;
	BirdFontTool* _tmp135_;
	BirdFontSpinButton* master_size = NULL;
	gchar* _tmp136_;
	gchar* _tmp137_;
	BirdFontSpinButton* _tmp138_;
	BirdFontSpinButton* _tmp139_;
	BirdFontSpinButton* _tmp140_;
	BirdFontSpinButton* _tmp141_;
	BirdFontSpinButton* _tmp142_;
	BirdFontSpinButton* _tmp143_;
	BirdFontSpinButton* _tmp144_;
	BirdFontSpinButton* _tmp145_;
	BirdFontSpinButton* _tmp146_;
	BirdFontExpander* _tmp147_;
	BirdFontSpinButton* _tmp148_;
	BirdFontTool* create_new_master = NULL;
	gchar* _tmp149_;
	gchar* _tmp150_;
	BirdFontTool* _tmp151_;
	BirdFontTool* _tmp152_;
	BirdFontTool* _tmp153_;
	BirdFontExpander* _tmp154_;
	BirdFontTool* _tmp155_;
	GeeArrayList* _tmp156_;
	BirdFontExpander* _tmp157_;
	GeeArrayList* _tmp158_;
	BirdFontExpander* _tmp159_;
	GeeArrayList* _tmp160_;
	BirdFontExpander* _tmp161_;
	GeeArrayList* _tmp162_;
	BirdFontExpander* _tmp163_;
	GeeArrayList* _tmp164_;
	BirdFontExpander* _tmp165_;
	GeeArrayList* _tmp166_;
	BirdFontExpander* _tmp167_;
	_data39_ = g_slice_new0 (Block39Data);
	_data39_->_ref_count_ = 1;
	self = (BirdFontOverviewTools*) bird_font_tool_collection_construct (object_type);
	_data39_->self = g_object_ref (self);
	_tmp0_ = bird_font_expander_new (NULL);
	font_name = _tmp0_;
	_tmp1_ = bird_font_t_ ("Character Sets");
	_tmp2_ = _tmp1_;
	_tmp3_ = bird_font_expander_new (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	character_sets = _tmp4_;
	_tmp5_ = bird_font_t_ ("Zoom");
	_tmp6_ = _tmp5_;
	_tmp7_ = bird_font_expander_new (_tmp6_);
	_tmp8_ = _tmp7_;
	_g_free0 (_tmp6_);
	zoom_expander = _tmp8_;
	_tmp9_ = bird_font_t_ ("Transform");
	_tmp10_ = _tmp9_;
	_tmp11_ = bird_font_expander_new (_tmp10_);
	_tmp12_ = _tmp11_;
	_g_free0 (_tmp10_);
	transform_slant_expander = _tmp12_;
	_tmp13_ = bird_font_expander_new (NULL);
	transform_size_expander = _tmp13_;
	_tmp14_ = bird_font_t_ ("Glyph");
	_tmp15_ = _tmp14_;
	_tmp16_ = bird_font_expander_new (_tmp15_);
	_tmp17_ = _tmp16_;
	_g_free0 (_tmp15_);
	glyph_expander = _tmp17_;
	_tmp18_ = bird_font_t_ ("Multi-Master");
	_tmp19_ = _tmp18_;
	_tmp20_ = bird_font_expander_new (_tmp19_);
	_tmp21_ = _tmp20_;
	_g_free0 (_tmp19_);
	multi_master = _tmp21_;
	_tmp22_ = gee_array_list_new (BIRD_FONT_TYPE_EXPANDER, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (bird_font_overview_tools_expanders);
	bird_font_overview_tools_expanders = _tmp22_;
	_tmp23_ = gee_array_list_new (BIRD_FONT_TYPE_LABEL_TOOL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	_g_object_unref0 (bird_font_overview_tools_custom_character_sets);
	bird_font_overview_tools_custom_character_sets = _tmp23_;
	_tmp24_ = font_name;
	_tmp25_ = bird_font_font_name_new (NULL, "");
	_tmp26_ = _tmp25_;
	bird_font_expander_add_tool (_tmp24_, (BirdFontTool*) _tmp26_, -1);
	_g_object_unref0 (_tmp26_);
	_tmp27_ = bird_font_zoom_bar_new ();
	_g_object_unref0 (self->zoom_bar);
	self->zoom_bar = _tmp27_;
	_tmp28_ = self->zoom_bar;
	g_signal_connect_object (_tmp28_, "new-zoom", (GCallback) ___lambda100__bird_font_zoom_bar_new_zoom, self, 0);
	_tmp29_ = zoom_expander;
	_tmp30_ = self->zoom_bar;
	bird_font_expander_add_tool (_tmp29_, (BirdFontTool*) _tmp30_, -1);
	_tmp31_ = bird_font_t_ ("All Glyphs");
	_tmp32_ = _tmp31_;
	_tmp33_ = bird_font_label_tool_new (_tmp32_);
	_g_object_unref0 (bird_font_overview_tools_all_glyphs);
	bird_font_overview_tools_all_glyphs = _tmp33_;
	_g_free0 (_tmp32_);
	_tmp34_ = bird_font_overview_tools_all_glyphs;
	bird_font_label_tool_set_has_counter (_tmp34_, TRUE);
	_tmp35_ = bird_font_overview_tools_all_glyphs;
	g_signal_connect_object ((BirdFontTool*) _tmp35_, "select-action", (GCallback) ___lambda101__bird_font_tool_select_action, self, 0);
	_tmp36_ = character_sets;
	_tmp37_ = bird_font_overview_tools_all_glyphs;
	bird_font_expander_add_tool (_tmp36_, (BirdFontTool*) _tmp37_, -1);
	_tmp38_ = bird_font_t_ ("Default");
	_tmp39_ = _tmp38_;
	_tmp40_ = bird_font_label_tool_new (_tmp39_);
	_g_object_unref0 (bird_font_overview_tools_default_glyphs);
	bird_font_overview_tools_default_glyphs = _tmp40_;
	_g_free0 (_tmp39_);
	_tmp41_ = bird_font_overview_tools_default_glyphs;
	bird_font_label_tool_set_has_counter (_tmp41_, TRUE);
	_tmp42_ = bird_font_overview_tools_default_glyphs;
	g_signal_connect_object ((BirdFontTool*) _tmp42_, "select-action", (GCallback) ___lambda102__bird_font_tool_select_action, self, 0);
	_tmp43_ = character_sets;
	_tmp44_ = bird_font_overview_tools_default_glyphs;
	bird_font_expander_add_tool (_tmp43_, (BirdFontTool*) _tmp44_, -1);
	_tmp45_ = bird_font_t_ ("Unicode");
	_tmp46_ = _tmp45_;
	_tmp47_ = bird_font_label_tool_new (_tmp46_);
	_g_object_unref0 (bird_font_overview_tools_unicode);
	bird_font_overview_tools_unicode = _tmp47_;
	_g_free0 (_tmp46_);
	_tmp48_ = bird_font_overview_tools_unicode;
	bird_font_label_tool_set_has_counter (_tmp48_, TRUE);
	_tmp49_ = bird_font_overview_tools_unicode;
	g_signal_connect_object ((BirdFontTool*) _tmp49_, "select-action", (GCallback) ___lambda103__bird_font_tool_select_action, self, 0);
	_tmp50_ = character_sets;
	_tmp51_ = bird_font_overview_tools_unicode;
	bird_font_expander_add_tool (_tmp50_, (BirdFontTool*) _tmp51_, -1);
	_tmp52_ = character_sets;
	bird_font_expander_set_persistent (_tmp52_, TRUE);
	_tmp53_ = character_sets;
	bird_font_expander_set_unique (_tmp53_, FALSE);
	_tmp54_ = bird_font_t_ ("Skew");
	_tmp55_ = _tmp54_;
	_tmp56_ = bird_font_spin_button_new ("skew_overview", _tmp55_);
	_g_object_unref0 (bird_font_overview_tools_skew);
	bird_font_overview_tools_skew = _tmp56_;
	_g_free0 (_tmp55_);
	_tmp57_ = bird_font_overview_tools_skew;
	bird_font_spin_button_set_big_number (_tmp57_, TRUE);
	_tmp58_ = bird_font_overview_tools_skew;
	bird_font_spin_button_set_int_value (_tmp58_, "0.000");
	_tmp59_ = bird_font_bird_font_get_current_font ();
	_tmp60_ = _tmp59_;
	_tmp61_ = _tmp60_->settings;
	_tmp62_ = _g_object_ref0 (_tmp61_);
	_tmp63_ = _tmp62_;
	_g_object_unref0 (_tmp60_);
	settings = _tmp63_;
	_tmp64_ = settings;
	_tmp65_ = bird_font_font_settings_get_setting (_tmp64_, "skew_overview");
	skew_value = _tmp65_;
	_tmp66_ = skew_value;
	if (_tmp66_ != NULL) {
		BirdFontSpinButton* _tmp67_;
		const gchar* _tmp68_;
		_tmp67_ = bird_font_overview_tools_skew;
		_tmp68_ = skew_value;
		bird_font_spin_button_set_int_value (_tmp67_, (const gchar*) _tmp68_);
	}
	_tmp69_ = bird_font_overview_tools_skew;
	bird_font_spin_button_set_int_step (_tmp69_, (gdouble) 1);
	_tmp70_ = bird_font_overview_tools_skew;
	bird_font_spin_button_set_min (_tmp70_, (gdouble) -100);
	_tmp71_ = bird_font_overview_tools_skew;
	bird_font_spin_button_set_max (_tmp71_, (gdouble) 100);
	_tmp72_ = bird_font_overview_tools_skew;
	bird_font_spin_button_show_icon (_tmp72_, TRUE);
	_tmp73_ = bird_font_overview_tools_skew;
	bird_font_tool_set_persistent ((BirdFontTool*) _tmp73_, FALSE);
	_tmp74_ = transform_slant_expander;
	_tmp75_ = bird_font_overview_tools_skew;
	bird_font_expander_add_tool (_tmp74_, (BirdFontTool*) _tmp75_, -1);
	_tmp76_ = bird_font_t_ ("Transform");
	_tmp77_ = _tmp76_;
	_tmp78_ = bird_font_tool_new ("transform_slant", _tmp77_);
	_tmp79_ = _tmp78_;
	_g_free0 (_tmp77_);
	_data39_->transform_slant = _tmp79_;
	_tmp80_ = _data39_->transform_slant;
	bird_font_tool_set_icon (_tmp80_, "transform");
	_tmp81_ = _data39_->transform_slant;
	g_signal_connect_data (_tmp81_, "select-action", (GCallback) ___lambda105__bird_font_tool_select_action, block39_data_ref (_data39_), (GClosureNotify) block39_data_unref, 0);
	_tmp82_ = _data39_->transform_slant;
	_tmp82_->selected = FALSE;
	_tmp83_ = _data39_->transform_slant;
	bird_font_tool_set_persistent (_tmp83_, FALSE);
	_tmp84_ = transform_slant_expander;
	_tmp85_ = _data39_->transform_slant;
	bird_font_expander_add_tool (_tmp84_, _tmp85_, -1);
	_tmp86_ = bird_font_t_ ("Resize");
	_tmp87_ = _tmp86_;
	_tmp88_ = bird_font_spin_button_new ("resize_overview", _tmp87_);
	_g_object_unref0 (bird_font_overview_tools_resize);
	bird_font_overview_tools_resize = _tmp88_;
	_g_free0 (_tmp87_);
	_tmp89_ = bird_font_overview_tools_resize;
	bird_font_spin_button_set_big_number (_tmp89_, TRUE);
	_tmp90_ = bird_font_overview_tools_resize;
	bird_font_spin_button_set_int_value (_tmp90_, "100.0");
	_tmp91_ = settings;
	_tmp92_ = bird_font_font_settings_get_setting (_tmp91_, "resize_overview");
	resize_value = _tmp92_;
	_tmp93_ = resize_value;
	if (_tmp93_ != NULL) {
		BirdFontSpinButton* _tmp94_;
		const gchar* _tmp95_;
		BirdFontSpinButton* _tmp96_;
		_tmp94_ = bird_font_overview_tools_resize;
		_tmp95_ = resize_value;
		bird_font_spin_button_set_int_value (_tmp94_, (const gchar*) _tmp95_);
		_tmp96_ = bird_font_overview_tools_resize;
		if (bird_font_spin_button_get_value (_tmp96_) <= ((gdouble) 0)) {
			BirdFontSpinButton* _tmp97_;
			_tmp97_ = bird_font_overview_tools_resize;
			bird_font_spin_button_set_int_value (_tmp97_, "100.0");
		}
	}
	_tmp98_ = bird_font_overview_tools_resize;
	bird_font_spin_button_set_int_step (_tmp98_, (gdouble) 1);
	_tmp99_ = bird_font_overview_tools_resize;
	bird_font_spin_button_set_min (_tmp99_, (gdouble) 0);
	_tmp100_ = bird_font_overview_tools_resize;
	bird_font_spin_button_set_max (_tmp100_, (gdouble) 300);
	_tmp101_ = bird_font_overview_tools_resize;
	bird_font_spin_button_show_icon (_tmp101_, TRUE);
	_tmp102_ = bird_font_overview_tools_resize;
	bird_font_tool_set_persistent ((BirdFontTool*) _tmp102_, FALSE);
	_tmp103_ = transform_size_expander;
	_tmp104_ = bird_font_overview_tools_resize;
	bird_font_expander_add_tool (_tmp103_, (BirdFontTool*) _tmp104_, -1);
	_tmp105_ = bird_font_t_ ("Transform");
	_tmp106_ = _tmp105_;
	_tmp107_ = bird_font_tool_new ("transform_size", _tmp106_);
	_tmp108_ = _tmp107_;
	_g_free0 (_tmp106_);
	_data39_->transform_size = _tmp108_;
	_tmp109_ = _data39_->transform_size;
	bird_font_tool_set_icon (_tmp109_, "transform");
	_tmp110_ = _data39_->transform_size;
	g_signal_connect_data (_tmp110_, "select-action", (GCallback) ___lambda114__bird_font_tool_select_action, block39_data_ref (_data39_), (GClosureNotify) block39_data_unref, 0);
	_tmp111_ = _data39_->transform_size;
	_tmp111_->selected = FALSE;
	_tmp112_ = _data39_->transform_size;
	bird_font_tool_set_persistent (_tmp112_, FALSE);
	_tmp113_ = transform_size_expander;
	_tmp114_ = _data39_->transform_size;
	bird_font_expander_add_tool (_tmp113_, _tmp114_, -1);
	_tmp115_ = bird_font_t_ ("Create alternate");
	_tmp116_ = _tmp115_;
	_tmp117_ = bird_font_tool_new ("alternate", _tmp116_);
	_tmp118_ = _tmp117_;
	_g_free0 (_tmp116_);
	alternate = _tmp118_;
	_tmp119_ = alternate;
	g_signal_connect_object (_tmp119_, "select-action", (GCallback) _bird_font_overview_tools_add_new_alternate_bird_font_tool_select_action, self, 0);
	_tmp120_ = glyph_expander;
	_tmp121_ = alternate;
	bird_font_expander_add_tool (_tmp120_, _tmp121_, -1);
	_tmp122_ = bird_font_t_ ("Set curve orientation");
	_tmp123_ = _tmp122_;
	_tmp124_ = bird_font_tool_new ("curve_orientation", _tmp123_);
	_tmp125_ = _tmp124_;
	_g_free0 (_tmp123_);
	curve_orientation = _tmp125_;
	_tmp126_ = curve_orientation;
	g_signal_connect_object (_tmp126_, "select-action", (GCallback) ___lambda226__bird_font_tool_select_action, self, 0);
	_tmp127_ = glyph_expander;
	_tmp128_ = curve_orientation;
	bird_font_expander_add_tool (_tmp127_, _tmp128_, -1);
	_tmp129_ = bird_font_t_ ("Search");
	_tmp130_ = _tmp129_;
	_tmp131_ = bird_font_tool_new ("search", _tmp130_);
	_tmp132_ = _tmp131_;
	_g_free0 (_tmp130_);
	search_glyph = _tmp132_;
	_tmp133_ = search_glyph;
	g_signal_connect_object (_tmp133_, "select-action", (GCallback) _bird_font_overview_tools_search_for_glyph_bird_font_tool_select_action, self, 0);
	_tmp134_ = glyph_expander;
	_tmp135_ = search_glyph;
	bird_font_expander_add_tool (_tmp134_, _tmp135_, -1);
	bird_font_overview_tools_current_master_size = (gdouble) 0;
	_tmp136_ = bird_font_t_ ("Master Size");
	_tmp137_ = _tmp136_;
	_tmp138_ = bird_font_spin_button_new ("master_size", _tmp137_);
	_g_object_unref0 (master_size);
	master_size = _tmp138_;
	_g_free0 (_tmp137_);
	_tmp139_ = master_size;
	bird_font_spin_button_set_big_number (_tmp139_, FALSE);
	_tmp140_ = master_size;
	bird_font_spin_button_set_int_value (_tmp140_, "0.000");
	_tmp141_ = master_size;
	bird_font_spin_button_set_int_step (_tmp141_, (gdouble) 1);
	_tmp142_ = master_size;
	bird_font_spin_button_set_min (_tmp142_, (gdouble) -1);
	_tmp143_ = master_size;
	bird_font_spin_button_set_max (_tmp143_, (gdouble) 1);
	_tmp144_ = master_size;
	bird_font_spin_button_show_icon (_tmp144_, TRUE);
	_tmp145_ = master_size;
	bird_font_tool_set_persistent ((BirdFontTool*) _tmp145_, FALSE);
	_tmp146_ = master_size;
	g_signal_connect_object (_tmp146_, "new-value-action", (GCallback) ___lambda230__bird_font_spin_button_new_value_action, self, 0);
	_tmp147_ = multi_master;
	_tmp148_ = master_size;
	bird_font_expander_add_tool (_tmp147_, (BirdFontTool*) _tmp148_, -1);
	_tmp149_ = bird_font_t_ ("Create new master font");
	_tmp150_ = _tmp149_;
	_tmp151_ = bird_font_tool_new ("new_master", _tmp150_);
	_tmp152_ = _tmp151_;
	_g_free0 (_tmp150_);
	create_new_master = _tmp152_;
	_tmp153_ = create_new_master;
	g_signal_connect_object (_tmp153_, "select-action", (GCallback) _bird_font_overview_tools_create_master_bird_font_tool_select_action, self, 0);
	_tmp154_ = multi_master;
	_tmp155_ = create_new_master;
	bird_font_expander_add_tool (_tmp154_, _tmp155_, -1);
	_tmp156_ = bird_font_overview_tools_expanders;
	_tmp157_ = font_name;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp156_, _tmp157_);
	_tmp158_ = bird_font_overview_tools_expanders;
	_tmp159_ = zoom_expander;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp158_, _tmp159_);
	_tmp160_ = bird_font_overview_tools_expanders;
	_tmp161_ = character_sets;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp160_, _tmp161_);
	_tmp162_ = bird_font_overview_tools_expanders;
	_tmp163_ = transform_slant_expander;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp162_, _tmp163_);
	_tmp164_ = bird_font_overview_tools_expanders;
	_tmp165_ = transform_size_expander;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp164_, _tmp165_);
	_tmp166_ = bird_font_overview_tools_expanders;
	_tmp167_ = glyph_expander;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp166_, _tmp167_);
	if (bird_font_bird_font_has_argument ("--test")) {
		GeeArrayList* _tmp168_;
		BirdFontExpander* _tmp169_;
		_tmp168_ = bird_font_overview_tools_expanders;
		_tmp169_ = multi_master;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp168_, _tmp169_);
	}
	_g_object_unref0 (create_new_master);
	_g_object_unref0 (master_size);
	_g_object_unref0 (search_glyph);
	_g_object_unref0 (curve_orientation);
	_g_object_unref0 (alternate);
	_g_free0 (resize_value);
	_g_free0 (skew_value);
	_g_object_unref0 (settings);
	_g_object_unref0 (multi_master);
	_g_object_unref0 (glyph_expander);
	_g_object_unref0 (transform_size_expander);
	_g_object_unref0 (transform_slant_expander);
	_g_object_unref0 (zoom_expander);
	_g_object_unref0 (character_sets);
	_g_object_unref0 (font_name);
	block39_data_unref (_data39_);
	_data39_ = NULL;
	return self;
}

BirdFontOverviewTools*
bird_font_overview_tools_new (void)
{
	return bird_font_overview_tools_construct (BIRD_FONT_TYPE_OVERVIEW_TOOLS);
}

static void
bird_font_overview_tools_create_master (BirdFontOverviewTools* self)
{
	BirdFontFont* font = NULL;
	BirdFontFont* _tmp0_;
	gint i = 0;
	BirdFontGlyphCollection* glyph_collection = NULL;
	BirdFontGlyphCollection* gc = NULL;
	BirdFontFont* _tmp1_;
	BirdFontGlyphCollection* _tmp2_;
	BirdFontGlyph* g = NULL;
	BirdFontOverview* _tmp18_;
	BirdFontOverview* _tmp19_;
	g_return_if_fail (self != NULL);
	_tmp0_ = bird_font_bird_font_get_current_font ();
	font = _tmp0_;
	i = 0;
	_tmp1_ = font;
	_tmp2_ = bird_font_font_get_glyph_collection_index (_tmp1_, (gunichar) i);
	gc = _tmp2_;
	while (TRUE) {
		BirdFontGlyphCollection* _tmp3_;
		BirdFontGlyphCollection* _tmp4_;
		BirdFontGlyphCollection* _tmp5_;
		BirdFontGlyphMaster* master = NULL;
		BirdFontGlyphMaster* _tmp6_;
		BirdFontGlyphCollection* _tmp7_;
		BirdFontGlyph* _tmp8_;
		BirdFontGlyphMaster* _tmp9_;
		BirdFontGlyph* _tmp10_;
		BirdFontGlyphCollection* _tmp11_;
		BirdFontGlyphMaster* _tmp12_;
		BirdFontGlyphCollection* _tmp13_;
		BirdFontGlyphMaster* _tmp14_;
		gint _tmp15_;
		BirdFontFont* _tmp16_;
		BirdFontGlyphCollection* _tmp17_;
		_tmp3_ = gc;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = gc;
		_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, BIRD_FONT_TYPE_GLYPH_COLLECTION, BirdFontGlyphCollection));
		_g_object_unref0 (glyph_collection);
		glyph_collection = _tmp5_;
		_tmp6_ = bird_font_glyph_master_new_for_id ("Master 2");
		master = _tmp6_;
		_tmp7_ = glyph_collection;
		_tmp8_ = bird_font_glyph_collection_get_interpolated (_tmp7_, bird_font_overview_tools_current_master_size);
		_g_object_unref0 (g);
		g = _tmp8_;
		_tmp9_ = master;
		_tmp10_ = g;
		bird_font_glyph_master_add_glyph (_tmp9_, _tmp10_);
		_tmp11_ = glyph_collection;
		_tmp12_ = master;
		bird_font_glyph_collection_add_master (_tmp11_, _tmp12_);
		_tmp13_ = glyph_collection;
		_tmp14_ = master;
		bird_font_glyph_collection_set_selected_master (_tmp13_, _tmp14_);
		_tmp15_ = i;
		i = _tmp15_ + 1;
		_tmp16_ = font;
		_tmp17_ = bird_font_font_get_glyph_collection_index (_tmp16_, (gunichar) i);
		_g_object_unref0 (gc);
		gc = _tmp17_;
		_g_object_unref0 (master);
	}
	_tmp18_ = bird_font_main_window_get_overview ();
	_tmp19_ = _tmp18_;
	bird_font_overview_update_item_list (_tmp19_);
	_g_object_unref0 (_tmp19_);
	bird_font_glyph_canvas_redraw ();
	_g_object_unref0 (g);
	_g_object_unref0 (gc);
	_g_object_unref0 (glyph_collection);
	_g_object_unref0 (font);
}

static void
bird_font_overview_tools_fix_curve_orientation (BirdFontOverviewTools* self)
{
	BirdFontOverview* o = NULL;
	BirdFontGlyph* g = NULL;
	BirdFontOverviewOverviewUndoItem* ui = NULL;
	BirdFontOverview* _tmp0_;
	BirdFontOverviewOverviewUndoItem* _tmp1_;
	BirdFontFont* f = NULL;
	BirdFontFont* _tmp2_;
	BirdFontOverviewOverviewUndoItem* _tmp3_;
	BirdFontFont* _tmp4_;
	BirdFontAlternateSets* _tmp5_;
	BirdFontAlternateSets* _tmp6_;
	BirdFontOverview* _tmp26_;
	GeeArrayList* _tmp27_;
	BirdFontOverviewOverviewUndoItem* _tmp28_;
	g_return_if_fail (self != NULL);
	_tmp0_ = bird_font_overview_tools_get_overview (self);
	_g_object_unref0 (o);
	o = _tmp0_;
	_tmp1_ = bird_font_overview_overview_undo_item_new ();
	_bird_font_overview_overview_undo_item_unref0 (ui);
	ui = _tmp1_;
	_tmp2_ = bird_font_bird_font_get_current_font ();
	f = _tmp2_;
	_tmp3_ = ui;
	_tmp4_ = f;
	_tmp5_ = _tmp4_->alternates;
	_tmp6_ = bird_font_alternate_sets_copy (_tmp5_);
	_g_object_unref0 (_tmp3_->alternate_sets);
	_tmp3_->alternate_sets = _tmp6_;
	{
		GeeArrayList* _gc_list = NULL;
		BirdFontOverview* _tmp7_;
		GeeArrayList* _tmp8_;
		gint _gc_size = 0;
		GeeArrayList* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		gint _gc_index = 0;
		_tmp7_ = o;
		_tmp8_ = _tmp7_->selected_items;
		_gc_list = _tmp8_;
		_tmp9_ = _gc_list;
		_tmp10_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp9_);
		_tmp11_ = _tmp10_;
		_gc_size = _tmp11_;
		_gc_index = -1;
		while (TRUE) {
			gint _tmp12_;
			gint _tmp13_;
			BirdFontGlyphCollection* gc = NULL;
			GeeArrayList* _tmp14_;
			gpointer _tmp15_;
			BirdFontGlyphCollection* _tmp16_;
			_gc_index = _gc_index + 1;
			_tmp12_ = _gc_index;
			_tmp13_ = _gc_size;
			if (!(_tmp12_ < _tmp13_)) {
				break;
			}
			_tmp14_ = _gc_list;
			_tmp15_ = gee_abstract_list_get ((GeeAbstractList*) _tmp14_, _gc_index);
			gc = (BirdFontGlyphCollection*) _tmp15_;
			_tmp16_ = gc;
			if (bird_font_glyph_collection_length (_tmp16_) > ((guint) 0)) {
				BirdFontGlyphCollection* _tmp17_;
				BirdFontGlyph* _tmp18_;
				BirdFontOverviewOverviewUndoItem* _tmp19_;
				GeeArrayList* _tmp20_;
				BirdFontGlyphCollection* _tmp21_;
				BirdFontGlyphCollection* _tmp22_;
				BirdFontGlyphCollection* _tmp23_;
				BirdFontGlyph* _tmp24_;
				BirdFontGlyph* _tmp25_;
				_tmp17_ = gc;
				_tmp18_ = bird_font_glyph_collection_get_current (_tmp17_);
				_g_object_unref0 (g);
				g = _tmp18_;
				_tmp19_ = ui;
				_tmp20_ = _tmp19_->glyphs;
				_tmp21_ = gc;
				_tmp22_ = bird_font_glyph_collection_copy_deep (_tmp21_);
				_tmp23_ = _tmp22_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp20_, _tmp23_);
				_g_object_unref0 (_tmp23_);
				_tmp24_ = g;
				bird_font_glyph_add_help_lines (_tmp24_);
				_tmp25_ = g;
				bird_font_glyph_fix_curve_orientation (_tmp25_);
			}
			_g_object_unref0 (gc);
		}
	}
	_tmp26_ = o;
	_tmp27_ = _tmp26_->undo_items;
	_tmp28_ = ui;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp27_, _tmp28_);
	bird_font_glyph_canvas_redraw ();
	_g_object_unref0 (f);
	_bird_font_overview_overview_undo_item_unref0 (ui);
	_g_object_unref0 (g);
	_g_object_unref0 (o);
}

void
bird_font_overview_tools_search_for_glyph (BirdFontOverviewTools* self,
                                           BirdFontTool* tool)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (tool != NULL);
	bird_font_tool_set_selected (tool, FALSE);
	bird_font_overview_search ();
}

void
bird_font_overview_tools_add_new_alternate (BirdFontOverviewTools* self,
                                            BirdFontTool* tool)
{
	BirdFontOverview* o = NULL;
	BirdFontOverview* _tmp0_;
	BirdFontOverviewItem* oi = NULL;
	BirdFontOverview* _tmp1_;
	BirdFontOverviewItem* _tmp2_;
	BirdFontOverviewItem* _tmp3_;
	BirdFontGlyphCollection* gc = NULL;
	BirdFontOverviewItem* _tmp4_;
	BirdFontGlyphCollection* _tmp5_;
	BirdFontGlyphCollection* _tmp6_;
	gboolean _tmp7_ = FALSE;
	BirdFontOverviewItem* _tmp8_;
	BirdFontGlyphCollection* _tmp9_;
	BirdFontTabBar* _tmp12_;
	BirdFontGlyphCollection* _tmp13_;
	BirdFontOtfFeatureTable* _tmp14_;
	BirdFontOtfFeatureTable* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tool != NULL);
	_tmp0_ = bird_font_main_window_get_overview ();
	o = _tmp0_;
	_tmp1_ = o;
	_tmp2_ = _tmp1_->selected_item;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	oi = _tmp3_;
	bird_font_tool_set_selected (tool, FALSE);
	_tmp4_ = oi;
	_tmp5_ = _tmp4_->glyphs;
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, BIRD_FONT_TYPE_GLYPH_COLLECTION, BirdFontGlyphCollection));
	_g_object_unref0 (gc);
	gc = _tmp6_;
	_tmp8_ = oi;
	_tmp9_ = _tmp8_->glyphs;
	if (_tmp9_ != NULL) {
		BirdFontOverviewItem* _tmp10_;
		BirdFontGlyphCollection* _tmp11_;
		_tmp10_ = oi;
		_tmp11_ = _tmp10_->glyphs;
		_tmp7_ = bird_font_glyph_collection_is_unassigned (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, BIRD_FONT_TYPE_GLYPH_COLLECTION, BirdFontGlyphCollection));
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		_g_object_unref0 (gc);
		gc = NULL;
	}
	_tmp12_ = bird_font_main_window_tabs;
	_tmp13_ = gc;
	_tmp14_ = bird_font_otf_feature_table_new (_tmp13_);
	_tmp15_ = _tmp14_;
	bird_font_tab_bar_add_tab (_tmp12_, (BirdFontFontDisplay*) _tmp15_, TRUE, NULL);
	_g_object_unref0 (_tmp15_);
	_g_object_unref0 (gc);
	_g_object_unref0 (oi);
	_g_object_unref0 (o);
}

void
bird_font_overview_tools_process_transform (BirdFontOverviewTools* self,
                                            BirdFontTransform transform)
{
	BirdFontOverview* o = NULL;
	BirdFontGlyph* g = NULL;
	BirdFontOverviewOverviewUndoItem* ui = NULL;
	BirdFontOverview* _tmp0_;
	BirdFontOverviewOverviewUndoItem* _tmp1_;
	BirdFontFont* f = NULL;
	BirdFontFont* _tmp2_;
	BirdFontOverviewOverviewUndoItem* _tmp3_;
	BirdFontFont* _tmp4_;
	BirdFontAlternateSets* _tmp5_;
	BirdFontAlternateSets* _tmp6_;
	BirdFontOverview* _tmp44_;
	GeeArrayList* _tmp45_;
	BirdFontOverviewOverviewUndoItem* _tmp46_;
	BirdFontOverview* _tmp47_;
	BirdFontOverview* _tmp48_;
	g_return_if_fail (self != NULL);
	_tmp0_ = bird_font_overview_tools_get_overview (self);
	_g_object_unref0 (o);
	o = _tmp0_;
	_tmp1_ = bird_font_overview_overview_undo_item_new ();
	_bird_font_overview_overview_undo_item_unref0 (ui);
	ui = _tmp1_;
	_tmp2_ = bird_font_bird_font_get_current_font ();
	f = _tmp2_;
	_tmp3_ = ui;
	_tmp4_ = f;
	_tmp5_ = _tmp4_->alternates;
	_tmp6_ = bird_font_alternate_sets_copy (_tmp5_);
	_g_object_unref0 (_tmp3_->alternate_sets);
	_tmp3_->alternate_sets = _tmp6_;
	{
		GeeArrayList* _gc_list = NULL;
		BirdFontOverview* _tmp7_;
		GeeArrayList* _tmp8_;
		gint _gc_size = 0;
		GeeArrayList* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		gint _gc_index = 0;
		_tmp7_ = o;
		_tmp8_ = _tmp7_->selected_items;
		_gc_list = _tmp8_;
		_tmp9_ = _gc_list;
		_tmp10_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp9_);
		_tmp11_ = _tmp10_;
		_gc_size = _tmp11_;
		_gc_index = -1;
		while (TRUE) {
			gint _tmp12_;
			gint _tmp13_;
			BirdFontGlyphCollection* gc = NULL;
			GeeArrayList* _tmp14_;
			gpointer _tmp15_;
			BirdFontGlyphCollection* _tmp16_;
			_gc_index = _gc_index + 1;
			_tmp12_ = _gc_index;
			_tmp13_ = _gc_size;
			if (!(_tmp12_ < _tmp13_)) {
				break;
			}
			_tmp14_ = _gc_list;
			_tmp15_ = gee_abstract_list_get ((GeeAbstractList*) _tmp14_, _gc_index);
			gc = (BirdFontGlyphCollection*) _tmp15_;
			_tmp16_ = gc;
			if (bird_font_glyph_collection_length (_tmp16_) > ((guint) 0)) {
				BirdFontGlyphCollection* _tmp17_;
				BirdFontGlyph* _tmp18_;
				BirdFontOverviewOverviewUndoItem* _tmp19_;
				GeeArrayList* _tmp20_;
				BirdFontGlyphCollection* _tmp21_;
				BirdFontGlyphCollection* _tmp22_;
				BirdFontGlyphCollection* _tmp23_;
				BirdFontGlyph* _tmp24_;
				_tmp17_ = gc;
				_tmp18_ = bird_font_glyph_collection_get_current (_tmp17_);
				_g_object_unref0 (g);
				g = _tmp18_;
				_tmp19_ = ui;
				_tmp20_ = _tmp19_->glyphs;
				_tmp21_ = gc;
				_tmp22_ = bird_font_glyph_collection_copy_deep (_tmp21_);
				_tmp23_ = _tmp22_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp20_, _tmp23_);
				_g_object_unref0 (_tmp23_);
				_tmp24_ = g;
				bird_font_glyph_add_help_lines (_tmp24_);
				if (transform == BIRD_FONT_TRANSFORM_SLANT) {
					BirdFontSpinButton* _tmp25_;
					_tmp25_ = bird_font_overview_tools_skew;
					if (bird_font_spin_button_get_value (_tmp25_) != ((gdouble) 0)) {
						BirdFontResizeTool* _tmp26_;
						BirdFontGlyph* _tmp27_;
						BirdFontSpinButton* _tmp28_;
						_tmp26_ = bird_font_drawing_tools_resize_tool;
						_tmp27_ = g;
						_tmp28_ = bird_font_overview_tools_skew;
						bird_font_resize_tool_skew_glyph (_tmp26_, _tmp27_, -bird_font_spin_button_get_value (_tmp28_), (gdouble) 0, FALSE);
					}
				}
				if (transform == BIRD_FONT_TRANSFORM_SIZE) {
					BirdFontSpinButton* _tmp29_;
					_tmp29_ = bird_font_overview_tools_resize;
					if (bird_font_spin_button_get_value (_tmp29_) != ((gdouble) 100)) {
						gdouble scale = 0.0;
						BirdFontSpinButton* _tmp30_;
						BirdFontResizeTool* _tmp31_;
						BirdFontGlyph* _tmp32_;
						_tmp30_ = bird_font_overview_tools_resize;
						scale = bird_font_spin_button_get_value (_tmp30_) / 100;
						_tmp31_ = bird_font_drawing_tools_resize_tool;
						_tmp32_ = g;
						bird_font_resize_tool_resize_glyph (_tmp31_, _tmp32_, scale, scale, FALSE, FALSE);
					}
				}
			}
			_g_object_unref0 (gc);
		}
	}
	{
		GeeArrayList* _item_list = NULL;
		BirdFontOverview* _tmp33_;
		GeeArrayList* _tmp34_;
		gint _item_size = 0;
		GeeArrayList* _tmp35_;
		gint _tmp36_;
		gint _tmp37_;
		gint _item_index = 0;
		_tmp33_ = o;
		_tmp34_ = _tmp33_->visible_items;
		_item_list = _tmp34_;
		_tmp35_ = _item_list;
		_tmp36_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp35_);
		_tmp37_ = _tmp36_;
		_item_size = _tmp37_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp38_;
			gint _tmp39_;
			BirdFontOverviewItem* item = NULL;
			GeeArrayList* _tmp40_;
			gpointer _tmp41_;
			BirdFontOverviewItem* _tmp42_;
			BirdFontOverviewItem* _tmp43_;
			_item_index = _item_index + 1;
			_tmp38_ = _item_index;
			_tmp39_ = _item_size;
			if (!(_tmp38_ < _tmp39_)) {
				break;
			}
			_tmp40_ = _item_list;
			_tmp41_ = gee_abstract_list_get ((GeeAbstractList*) _tmp40_, _item_index);
			item = (BirdFontOverviewItem*) _tmp41_;
			_tmp42_ = item;
			bird_font_overview_item_clear_cache (_tmp42_);
			_tmp43_ = item;
			bird_font_overview_item_draw_glyph_from_font (_tmp43_);
			_g_object_unref0 (item);
		}
	}
	_tmp44_ = o;
	_tmp45_ = _tmp44_->undo_items;
	_tmp46_ = ui;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp45_, _tmp46_);
	_tmp47_ = bird_font_main_window_get_overview ();
	_tmp48_ = _tmp47_;
	bird_font_overview_update_item_list (_tmp48_);
	_g_object_unref0 (_tmp48_);
	bird_font_glyph_canvas_redraw ();
	_g_object_unref0 (f);
	_bird_font_overview_overview_undo_item_unref0 (ui);
	_g_object_unref0 (g);
	_g_object_unref0 (o);
}

BirdFontOverview*
bird_font_overview_tools_get_overview (BirdFontOverviewTools* self)
{
	BirdFontFontDisplay* fd = NULL;
	BirdFontFontDisplay* _tmp0_;
	gboolean _tmp1_ = FALSE;
	BirdFontFontDisplay* _tmp2_;
	BirdFontOverview* _tmp6_;
	BirdFontOverview* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = bird_font_main_window_get_current_display ();
	fd = _tmp0_;
	_tmp2_ = fd;
	if (BIRD_FONT_IS_OVERVIEW (_tmp2_)) {
		_tmp1_ = TRUE;
	} else {
		BirdFontFontDisplay* _tmp3_;
		_tmp3_ = fd;
		_tmp1_ = BIRD_FONT_IS_GLYPH_SELECTION (_tmp3_);
	}
	if (_tmp1_) {
		BirdFontFontDisplay* _tmp4_;
		BirdFontOverview* _tmp5_;
		_tmp4_ = fd;
		_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, BIRD_FONT_TYPE_OVERVIEW, BirdFontOverview));
		result = _tmp5_;
		_g_object_unref0 (fd);
		return result;
	}
	g_warning ("OverviewTools.vala:345: Current tab is not overview.");
	_tmp6_ = bird_font_overview_new (NULL, TRUE, TRUE);
	result = _tmp6_;
	_g_object_unref0 (fd);
	return result;
}

void
bird_font_overview_tools_show_all_available_characters (void)
{
	BirdFontLabelTool* _tmp0_;
	BirdFontLabelTool* _tmp1_;
	_tmp0_ = bird_font_overview_tools_all_glyphs;
	_tmp1_ = bird_font_overview_tools_all_glyphs;
	g_signal_emit_by_name ((BirdFontTool*) _tmp0_, "select-action", (BirdFontTool*) _tmp1_);
}

void
bird_font_overview_tools_update_overview_characterset (BirdFontOverview* tab)
{
	BirdFontGlyphRange* gr = NULL;
	guint size = 0U;
	BirdFontOverview* overview = NULL;
	BirdFontFont* _tmp0_;
	BirdFontFont* _tmp1_;
	BirdFontLabelTool* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	BirdFontGlyphRange* _tmp5_;
	BirdFontGlyphRange* _tmp6_;
	BirdFontGlyphRange* _tmp7_;
	BirdFontLabelTool* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	BirdFontGlyphRange* _tmp11_;
	BirdFontGlyphRange* _tmp12_;
	BirdFontGlyphRange* _tmp13_;
	BirdFontLabelTool* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	BirdFontOverview* _tmp17_ = NULL;
	BirdFontOverview* _tmp20_;
	BirdFontLabelTool* _tmp21_;
	BirdFontLabelTool* _tmp22_;
	BirdFontLabelTool* _tmp23_;
	BirdFontOverview* _tmp24_;
	gboolean _tmp25_;
	gboolean _tmp26_;
	_tmp0_ = bird_font_bird_font_get_current_font ();
	_tmp1_ = _tmp0_;
	size = bird_font_font_length (_tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = bird_font_overview_tools_all_glyphs;
	_tmp3_ = bird_font_overview_tools_get_display_value (size);
	_tmp4_ = _tmp3_;
	bird_font_label_tool_set_number (_tmp2_, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = bird_font_glyph_range_new ();
	_bird_font_glyph_range_unref0 (gr);
	gr = _tmp5_;
	_tmp6_ = gr;
	bird_font_default_character_set_use_default_range (_tmp6_);
	_tmp7_ = gr;
	size = (guint) bird_font_glyph_range_get_length (_tmp7_);
	_tmp8_ = bird_font_overview_tools_default_glyphs;
	_tmp9_ = bird_font_overview_tools_get_display_value (size);
	_tmp10_ = _tmp9_;
	bird_font_label_tool_set_number (_tmp8_, _tmp10_);
	_g_free0 (_tmp10_);
	_tmp11_ = bird_font_glyph_range_new ();
	_bird_font_glyph_range_unref0 (gr);
	gr = _tmp11_;
	_tmp12_ = gr;
	bird_font_default_character_set_use_full_unicode_range (_tmp12_);
	_tmp13_ = gr;
	size = (guint) bird_font_glyph_range_get_length (_tmp13_);
	_tmp14_ = bird_font_overview_tools_unicode;
	_tmp15_ = bird_font_overview_tools_get_display_value (size);
	_tmp16_ = _tmp15_;
	bird_font_label_tool_set_number (_tmp14_, _tmp16_);
	_g_free0 (_tmp16_);
	if (tab == NULL) {
		BirdFontOverview* _tmp18_;
		_tmp18_ = bird_font_main_window_get_overview ();
		_g_object_unref0 (_tmp17_);
		_tmp17_ = _tmp18_;
	} else {
		BirdFontOverview* _tmp19_;
		_tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (tab, BIRD_FONT_TYPE_OVERVIEW, BirdFontOverview));
		_g_object_unref0 (_tmp17_);
		_tmp17_ = _tmp19_;
	}
	_tmp20_ = _g_object_ref0 (_tmp17_);
	_g_object_unref0 (overview);
	overview = _tmp20_;
	_tmp21_ = bird_font_overview_tools_all_glyphs;
	bird_font_tool_set_selected ((BirdFontTool*) _tmp21_, FALSE);
	_tmp22_ = bird_font_overview_tools_default_glyphs;
	bird_font_tool_set_selected ((BirdFontTool*) _tmp22_, FALSE);
	_tmp23_ = bird_font_overview_tools_unicode;
	bird_font_tool_set_selected ((BirdFontTool*) _tmp23_, FALSE);
	_tmp24_ = overview;
	_tmp25_ = bird_font_overview_get_all_available (_tmp24_);
	_tmp26_ = _tmp25_;
	if (_tmp26_) {
		BirdFontLabelTool* _tmp27_;
		_tmp27_ = bird_font_overview_tools_all_glyphs;
		bird_font_tool_set_selected ((BirdFontTool*) _tmp27_, TRUE);
	} else {
		BirdFontOverview* _tmp28_;
		BirdFontGlyphRange* _tmp29_;
		BirdFontGlyphRange* _tmp30_;
		const gchar* _tmp31_;
		const gchar* _tmp32_;
		_tmp28_ = overview;
		_tmp29_ = bird_font_overview_get_glyph_range (_tmp28_);
		_tmp30_ = _tmp29_;
		_tmp31_ = bird_font_glyph_range_get_name (_tmp30_);
		_tmp32_ = _tmp31_;
		if (g_strcmp0 (_tmp32_, "Default") == 0) {
			BirdFontLabelTool* _tmp33_;
			_tmp33_ = bird_font_overview_tools_default_glyphs;
			bird_font_tool_set_selected ((BirdFontTool*) _tmp33_, TRUE);
		} else {
			BirdFontOverview* _tmp34_;
			BirdFontGlyphRange* _tmp35_;
			BirdFontGlyphRange* _tmp36_;
			const gchar* _tmp37_;
			const gchar* _tmp38_;
			_tmp34_ = overview;
			_tmp35_ = bird_font_overview_get_glyph_range (_tmp34_);
			_tmp36_ = _tmp35_;
			_tmp37_ = bird_font_glyph_range_get_name (_tmp36_);
			_tmp38_ = _tmp37_;
			if (g_strcmp0 (_tmp38_, "Unicode") == 0) {
				BirdFontLabelTool* _tmp39_;
				_tmp39_ = bird_font_overview_tools_unicode;
				bird_font_tool_set_selected ((BirdFontTool*) _tmp39_, TRUE);
			}
		}
	}
	bird_font_toolbox_redraw_tool_box ();
	_g_object_unref0 (_tmp17_);
	_g_object_unref0 (overview);
	_bird_font_glyph_range_unref0 (gr);
}

static gchar*
bird_font_overview_tools_get_display_value (guint size)
{
	gdouble k = 0.0;
	gchar* display_size = NULL;
	gchar* result;
	if (size >= ((guint) 1000)) {
		gchar* _tmp0_;
		gchar* _tmp1_;
		gchar* _tmp2_;
		k = size / 1000.0;
		size = (guint) rint (k);
		_tmp0_ = g_strdup_printf ("%u", size);
		_tmp1_ = _tmp0_;
		_tmp2_ = g_strconcat (_tmp1_, "k", NULL);
		_g_free0 (display_size);
		display_size = _tmp2_;
		_g_free0 (_tmp1_);
	} else {
		gchar* _tmp3_;
		_tmp3_ = g_strdup_printf ("%u", size);
		_g_free0 (display_size);
		display_size = _tmp3_;
	}
	result = display_size;
	return result;
}

static GeeArrayList*
bird_font_overview_tools_real_get_expanders (BirdFontToolCollection* base)
{
	BirdFontOverviewTools * self;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeArrayList* result;
	self = (BirdFontOverviewTools*) base;
	_tmp0_ = bird_font_overview_tools_expanders;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static GeeArrayList*
bird_font_overview_tools_real_get_displays (BirdFontToolCollection* base)
{
	BirdFontOverviewTools * self;
	GeeArrayList* d = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* result;
	self = (BirdFontOverviewTools*) base;
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	d = _tmp0_;
	gee_abstract_collection_add ((GeeAbstractCollection*) d, "Overview");
	result = d;
	return result;
}

static void
bird_font_overview_tools_class_init (BirdFontOverviewToolsClass * klass,
                                     gpointer klass_data)
{
	bird_font_overview_tools_parent_class = g_type_class_peek_parent (klass);
	((BirdFontToolCollectionClass *) klass)->get_expanders = (GeeArrayList* (*) (BirdFontToolCollection*)) bird_font_overview_tools_real_get_expanders;
	((BirdFontToolCollectionClass *) klass)->get_displays = (GeeArrayList* (*) (BirdFontToolCollection*)) bird_font_overview_tools_real_get_displays;
	G_OBJECT_CLASS (klass)->finalize = bird_font_overview_tools_finalize;
}

static void
bird_font_overview_tools_instance_init (BirdFontOverviewTools * self,
                                        gpointer klass)
{
}

static void
bird_font_overview_tools_finalize (GObject * obj)
{
	BirdFontOverviewTools * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIRD_FONT_TYPE_OVERVIEW_TOOLS, BirdFontOverviewTools);
	_g_object_unref0 (self->zoom_bar);
	G_OBJECT_CLASS (bird_font_overview_tools_parent_class)->finalize (obj);
}

static GType
bird_font_overview_tools_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BirdFontOverviewToolsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bird_font_overview_tools_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BirdFontOverviewTools), 0, (GInstanceInitFunc) bird_font_overview_tools_instance_init, NULL };
	GType bird_font_overview_tools_type_id;
	bird_font_overview_tools_type_id = g_type_register_static (BIRD_FONT_TYPE_TOOL_COLLECTION, "BirdFontOverviewTools", &g_define_type_info, 0);
	return bird_font_overview_tools_type_id;
}

GType
bird_font_overview_tools_get_type (void)
{
	static volatile gsize bird_font_overview_tools_type_id__once = 0;
	if (g_once_init_enter (&bird_font_overview_tools_type_id__once)) {
		GType bird_font_overview_tools_type_id;
		bird_font_overview_tools_type_id = bird_font_overview_tools_get_type_once ();
		g_once_init_leave (&bird_font_overview_tools_type_id__once, bird_font_overview_tools_type_id);
	}
	return bird_font_overview_tools_type_id__once;
}

