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

/*
Copyright (C) 2012, 2014 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 <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <gee.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_MENU_TAB_0_PROPERTY,
	BIRD_FONT_MENU_TAB_NUM_PROPERTIES
};
static GParamSpec* bird_font_menu_tab_properties[BIRD_FONT_MENU_TAB_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_source_unref0(var) ((var == NULL) ? NULL : (var = (g_source_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block35Data Block35Data;
typedef struct _Block36Data Block36Data;
typedef struct _Block37Data Block37Data;
#define _bird_font_glyph_range_unref0(var) ((var == NULL) ? NULL : (var = (bird_font_glyph_range_unref (var), NULL)))

#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;

#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;

#define BIRD_FONT_TYPE_THEME_TAB (bird_font_theme_tab_get_type ())
#define BIRD_FONT_THEME_TAB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BIRD_FONT_TYPE_THEME_TAB, BirdFontThemeTab))
#define BIRD_FONT_THEME_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BIRD_FONT_TYPE_THEME_TAB, BirdFontThemeTabClass))
#define BIRD_FONT_IS_THEME_TAB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BIRD_FONT_TYPE_THEME_TAB))
#define BIRD_FONT_IS_THEME_TAB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BIRD_FONT_TYPE_THEME_TAB))
#define BIRD_FONT_THEME_TAB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BIRD_FONT_TYPE_THEME_TAB, BirdFontThemeTabClass))

typedef struct _BirdFontThemeTab BirdFontThemeTab;
typedef struct _BirdFontThemeTabClass BirdFontThemeTabClass;

struct _Block35Data {
	int _ref_count_;
	BirdFontSaveDialogListener* dialog;
};

struct _Block36Data {
	int _ref_count_;
	BirdFontTabBar* tab_bar;
};

struct _Block37Data {
	int _ref_count_;
	gchar* ligature_name;
};

static gpointer bird_font_menu_tab_parent_class = NULL;
static gboolean bird_font_menu_tab_suppress_event;
static GRecMutex __lock_bird_font_menu_tab_bird_font_menu_tab_suppress_event = {0};
static gboolean bird_font_menu_tab_suppress_event = FALSE;
gboolean bird_font_menu_tab_background_thread = FALSE;
BirdFontSaveCallback* bird_font_menu_tab_save_callback = NULL;
BirdFontLoadCallback* bird_font_menu_tab_load_callback = NULL;
BirdFontExportCallback* bird_font_menu_tab_export_callback = NULL;

static gboolean __lambda385_ (void);
static gboolean ___lambda385__gsource_func (gpointer self);
static void ___lambda211_ (void);
static void ____lambda211__bird_font_export_callback_file_exported (BirdFontExportCallback* _sender,
                                                             gpointer self);
static gboolean ___lambda384_ (void);
static gboolean ____lambda384__gsource_func (gpointer self);
static gchar* bird_font_menu_tab_real_get_label (BirdFontFontDisplay* base);
static gchar* bird_font_menu_tab_real_get_name (BirdFontFontDisplay* base);
static gboolean __lambda386_ (void);
static gboolean ___lambda386__gsource_func (gpointer self);
static gboolean __lambda387_ (void);
static gboolean ___lambda387__gsource_func (gpointer self);
static gboolean __lambda388_ (void);
static gboolean ___lambda388__gsource_func (gpointer self);
static void __lambda389_ (const gchar* fn);
static void ___lambda389__bird_font_file_chooser_file_selected (BirdFontFileChooser* _sender,
                                                         const gchar* path,
                                                         gpointer self);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
static void __lambda78_ (void);
static void ___lambda78__bird_font_save_dialog_listener_signal_discard (BirdFontSaveDialogListener* _sender,
                                                                 gpointer self);
static void __lambda329_ (Block35Data* _data35_);
static void __lambda330_ (Block35Data* _data35_);
static void ___lambda330__bird_font_save_callback_file_saved (BirdFontSaveCallback* _sender,
                                                       gpointer self);
static void ___lambda329__bird_font_save_dialog_listener_signal_save (BirdFontSaveDialogListener* _sender,
                                                               gpointer self);
static void __lambda331_ (void);
static void ___lambda331__bird_font_save_dialog_listener_signal_cancel (BirdFontSaveDialogListener* _sender,
                                                                 gpointer self);
static void __lambda390_ (void);
static void ___lambda390__bird_font_save_dialog_listener_signal_discard (BirdFontSaveDialogListener* _sender,
                                                                  gpointer self);
static void __lambda391_ (void);
static void __lambda392_ (void);
static void ___lambda392__bird_font_save_callback_file_saved (BirdFontSaveCallback* _sender,
                                                       gpointer self);
static void ___lambda391__bird_font_save_dialog_listener_signal_save (BirdFontSaveDialogListener* _sender,
                                                               gpointer self);
static void __lambda393_ (void);
static void ___lambda393__bird_font_save_dialog_listener_signal_cancel (BirdFontSaveDialogListener* _sender,
                                                                 gpointer self);
static void ___lambda119_ (void);
static void ____lambda119__bird_font_save_callback_file_saved (BirdFontSaveCallback* _sender,
                                                        gpointer self);
static Block36Data* block36_data_ref (Block36Data* _data36_);
static void block36_data_unref (void * _userdata_);
static void __lambda120_ (Block36Data* _data36_);
static void ___lambda120__bird_font_over_write_dialog_listener_overwrite_signal (BirdFontOverWriteDialogListener* _sender,
                                                                          gpointer self);
static void __lambda290_ (void);
static void ___lambda290__bird_font_load_callback_file_loaded (BirdFontLoadCallback* _sender,
                                                        gpointer self);
static void bird_font_menu_tab_simplify (void);
static void _bird_font_menu_tab_simplify_bird_font_task_runnable (gpointer self);
static Block37Data* block37_data_ref (Block37Data* _data37_);
static void block37_data_unref (void * _userdata_);
static void __lambda411_ (Block37Data* _data37_,
                   const gchar* text);
static void ___lambda411__bird_font_text_listener_signal_text_input (BirdFontTextListener* _sender,
                                                              const gchar* text,
                                                              gpointer self);
static void __lambda412_ (Block37Data* _data37_);
static void ___lambda412__bird_font_text_listener_signal_submit (BirdFontTextListener* _sender,
                                                          const gchar* text,
                                                          gpointer self);
VALA_EXTERN BirdFontSettingsTab* bird_font_settings_tab_new (void);
VALA_EXTERN BirdFontSettingsTab* bird_font_settings_tab_construct (GType object_type);
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 BirdFontThemeTab* bird_font_theme_tab_new (void);
VALA_EXTERN BirdFontThemeTab* bird_font_theme_tab_construct (GType object_type);
VALA_EXTERN GType bird_font_theme_tab_get_type (void) G_GNUC_CONST ;
static void bird_font_menu_tab_finalize (GObject * obj);
static GType bird_font_menu_tab_get_type_once (void);

BirdFontMenuTab*
bird_font_menu_tab_construct (GType object_type)
{
	BirdFontMenuTab * self = NULL;
	BirdFontSaveCallback* _tmp0_;
	BirdFontSaveCallback* _tmp1_;
	BirdFontLoadCallback* _tmp2_;
	BirdFontExportCallback* _tmp3_;
	self = (BirdFontMenuTab*) bird_font_font_display_construct (object_type);
	_tmp0_ = bird_font_save_callback_new ();
	_g_object_unref0 (bird_font_menu_tab_save_callback);
	bird_font_menu_tab_save_callback = _tmp0_;
	_tmp1_ = bird_font_menu_tab_save_callback;
	_tmp1_->is_done = TRUE;
	_tmp2_ = bird_font_load_callback_new ();
	_g_object_unref0 (bird_font_menu_tab_load_callback);
	bird_font_menu_tab_load_callback = _tmp2_;
	_tmp3_ = bird_font_export_callback_new ();
	_g_object_unref0 (bird_font_menu_tab_export_callback);
	bird_font_menu_tab_export_callback = _tmp3_;
	bird_font_menu_tab_suppress_event = FALSE;
	bird_font_menu_tab_background_thread = FALSE;
	return self;
}

BirdFontMenuTab*
bird_font_menu_tab_new (void)
{
	return bird_font_menu_tab_construct (BIRD_FONT_TYPE_MENU_TAB);
}

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

BirdFontExportCallback*
bird_font_menu_tab_get_export_callback (void)
{
	BirdFontExportCallback* _tmp0_;
	BirdFontExportCallback* _tmp1_;
	BirdFontExportCallback* result;
	_tmp0_ = bird_font_menu_tab_export_callback;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

gboolean
bird_font_menu_tab_has_suppress_event (void)
{
	gboolean suppress = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	{
		g_rec_mutex_lock (&__lock_bird_font_menu_tab_bird_font_menu_tab_suppress_event);
		{
			suppress = bird_font_menu_tab_suppress_event;
		}
		__finally0:
		{
			g_rec_mutex_unlock (&__lock_bird_font_menu_tab_bird_font_menu_tab_suppress_event);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp0_ = FALSE;
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp0_;
		}
	}
	result = suppress;
	return result;
}

void
bird_font_menu_tab_set_save_callback (BirdFontSaveCallback* c)
{
	BirdFontSaveCallback* _tmp0_;
	BirdFontSaveCallback* _tmp1_;
	g_return_if_fail (c != NULL);
	_tmp0_ = bird_font_menu_tab_save_callback;
	if (!_tmp0_->is_done) {
		g_warning ("MenuTab.vala:67: Prevoius save command has not finished");
	}
	_tmp1_ = _g_object_ref0 (c);
	_g_object_unref0 (bird_font_menu_tab_save_callback);
	bird_font_menu_tab_save_callback = _tmp1_;
}

void
bird_font_menu_tab_start_background_thread (void)
{
	if (!bird_font_menu_tab_set_suppress_event (TRUE)) {
		g_warning ("MenuTab.vala:75: suppressed event");
		return;
	}
	bird_font_tab_bar_start_wheel ();
}

static gboolean
__lambda385_ (void)
{
	gboolean result;
	bird_font_menu_tab_set_suppress_event (FALSE);
	bird_font_tab_bar_stop_wheel ();
	bird_font_glyph_canvas_redraw ();
	result = FALSE;
	return result;
}

static gboolean
___lambda385__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda385_ ();
	return result;
}

void
bird_font_menu_tab_stop_background_thread (void)
{
	GSource* idle = NULL;
	GSource* _tmp0_;
	_tmp0_ = g_idle_source_new ();
	idle = _tmp0_;
	g_source_set_callback (idle, ___lambda385__gsource_func, NULL, NULL);
	g_source_attach (idle, NULL);
	_g_source_unref0 (idle);
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

gboolean
bird_font_menu_tab_validate_metadata (void)
{
	BirdFontFont* font = NULL;
	BirdFontFont* _tmp0_;
	gchar* m = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	BirdFontFont* _tmp5_;
	const gchar* _tmp6_;
	BirdFontFont* _tmp14_;
	const gchar* _tmp15_;
	BirdFontFont* _tmp23_;
	const gchar* _tmp24_;
	BirdFontFont* _tmp32_;
	const gchar* _tmp33_;
	BirdFontFont* _tmp41_;
	const gchar* _tmp42_;
	BirdFontFont* current_font = NULL;
	BirdFontFont* _tmp50_;
	gchar* ttf_name = NULL;
	BirdFontFont* _tmp51_;
	gchar* _tmp52_;
	gchar* _tmp53_;
	gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* ttf_name_mac = NULL;
	BirdFontFont* _tmp56_;
	gchar* _tmp57_;
	gchar* _tmp58_;
	gchar* _tmp59_;
	gchar* _tmp60_;
	const gchar* _tmp61_;
	const gchar* _tmp62_;
	const gchar* _tmp63_;
	const gchar* _tmp64_;
	gchar* _tmp65_;
	gchar* _tmp66_;
	const gchar* _tmp67_;
	const gchar* _tmp68_;
	gboolean result;
	_tmp0_ = bird_font_bird_font_get_current_font ();
	font = _tmp0_;
	_tmp1_ = bird_font_t_ ("Missing metadata in font:");
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (_tmp2_, "\n", NULL);
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	m = _tmp4_;
	_tmp5_ = font;
	_tmp6_ = _tmp5_->postscript_name;
	if (g_strcmp0 (_tmp6_, "") == 0) {
		const gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		BirdFontMessageDialog* _tmp12_;
		BirdFontMessageDialog* _tmp13_;
		_tmp7_ = m;
		_tmp8_ = bird_font_t_ ("PostScript Name");
		_tmp9_ = _tmp8_;
		_tmp10_ = g_strconcat (_tmp7_, _tmp9_, NULL);
		_tmp11_ = _tmp10_;
		_tmp12_ = bird_font_main_window_show_message (_tmp11_);
		_tmp13_ = _tmp12_;
		_g_object_unref0 (_tmp13_);
		_g_free0 (_tmp11_);
		_g_free0 (_tmp9_);
		result = FALSE;
		_g_free0 (m);
		_g_object_unref0 (font);
		return result;
	}
	_tmp14_ = font;
	_tmp15_ = _tmp14_->name;
	if (g_strcmp0 (_tmp15_, "") == 0) {
		const gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		gchar* _tmp20_;
		BirdFontMessageDialog* _tmp21_;
		BirdFontMessageDialog* _tmp22_;
		_tmp16_ = m;
		_tmp17_ = bird_font_t_ ("Name");
		_tmp18_ = _tmp17_;
		_tmp19_ = g_strconcat (_tmp16_, _tmp18_, NULL);
		_tmp20_ = _tmp19_;
		_tmp21_ = bird_font_main_window_show_message (_tmp20_);
		_tmp22_ = _tmp21_;
		_g_object_unref0 (_tmp22_);
		_g_free0 (_tmp20_);
		_g_free0 (_tmp18_);
		result = FALSE;
		_g_free0 (m);
		_g_object_unref0 (font);
		return result;
	}
	_tmp23_ = font;
	_tmp24_ = _tmp23_->subfamily;
	if (g_strcmp0 (_tmp24_, "") == 0) {
		const gchar* _tmp25_;
		gchar* _tmp26_;
		gchar* _tmp27_;
		gchar* _tmp28_;
		gchar* _tmp29_;
		BirdFontMessageDialog* _tmp30_;
		BirdFontMessageDialog* _tmp31_;
		_tmp25_ = m;
		_tmp26_ = bird_font_t_ ("Style");
		_tmp27_ = _tmp26_;
		_tmp28_ = g_strconcat (_tmp25_, _tmp27_, NULL);
		_tmp29_ = _tmp28_;
		_tmp30_ = bird_font_main_window_show_message (_tmp29_);
		_tmp31_ = _tmp30_;
		_g_object_unref0 (_tmp31_);
		_g_free0 (_tmp29_);
		_g_free0 (_tmp27_);
		result = FALSE;
		_g_free0 (m);
		_g_object_unref0 (font);
		return result;
	}
	_tmp32_ = font;
	_tmp33_ = _tmp32_->full_name;
	if (g_strcmp0 (_tmp33_, "") == 0) {
		const gchar* _tmp34_;
		gchar* _tmp35_;
		gchar* _tmp36_;
		gchar* _tmp37_;
		gchar* _tmp38_;
		BirdFontMessageDialog* _tmp39_;
		BirdFontMessageDialog* _tmp40_;
		_tmp34_ = m;
		_tmp35_ = bird_font_t_ ("Full Name (Name and Style)");
		_tmp36_ = _tmp35_;
		_tmp37_ = g_strconcat (_tmp34_, _tmp36_, NULL);
		_tmp38_ = _tmp37_;
		_tmp39_ = bird_font_main_window_show_message (_tmp38_);
		_tmp40_ = _tmp39_;
		_g_object_unref0 (_tmp40_);
		_g_free0 (_tmp38_);
		_g_free0 (_tmp36_);
		result = FALSE;
		_g_free0 (m);
		_g_object_unref0 (font);
		return result;
	}
	_tmp41_ = font;
	_tmp42_ = _tmp41_->unique_identifier;
	if (g_strcmp0 (_tmp42_, "") == 0) {
		const gchar* _tmp43_;
		gchar* _tmp44_;
		gchar* _tmp45_;
		gchar* _tmp46_;
		gchar* _tmp47_;
		BirdFontMessageDialog* _tmp48_;
		BirdFontMessageDialog* _tmp49_;
		_tmp43_ = m;
		_tmp44_ = bird_font_t_ ("Unique Identifier");
		_tmp45_ = _tmp44_;
		_tmp46_ = g_strconcat (_tmp43_, _tmp45_, NULL);
		_tmp47_ = _tmp46_;
		_tmp48_ = bird_font_main_window_show_message (_tmp47_);
		_tmp49_ = _tmp48_;
		_g_object_unref0 (_tmp49_);
		_g_free0 (_tmp47_);
		_g_free0 (_tmp45_);
		result = FALSE;
		_g_free0 (m);
		_g_object_unref0 (font);
		return result;
	}
	_tmp50_ = bird_font_bird_font_get_current_font ();
	current_font = _tmp50_;
	_tmp51_ = current_font;
	_tmp52_ = bird_font_export_settings_get_file_name (_tmp51_);
	_tmp53_ = _tmp52_;
	_tmp54_ = g_strconcat (_tmp53_, ".ttf", NULL);
	_tmp55_ = _tmp54_;
	_g_free0 (_tmp53_);
	ttf_name = _tmp55_;
	_tmp56_ = current_font;
	_tmp57_ = bird_font_export_settings_get_file_name_mac (_tmp56_);
	_tmp58_ = _tmp57_;
	_tmp59_ = g_strconcat (_tmp58_, ".ttf", NULL);
	_tmp60_ = _tmp59_;
	_g_free0 (_tmp58_);
	ttf_name_mac = _tmp60_;
	_tmp61_ = ttf_name;
	_tmp62_ = string_to_string (_tmp61_);
	_tmp63_ = ttf_name_mac;
	_tmp64_ = string_to_string (_tmp63_);
	_tmp65_ = g_strconcat (_tmp62_, " == ", _tmp64_, NULL);
	_tmp66_ = _tmp65_;
	g_print ("%s", _tmp66_);
	_g_free0 (_tmp66_);
	_tmp67_ = ttf_name;
	_tmp68_ = ttf_name_mac;
	if (g_strcmp0 (_tmp67_, _tmp68_) == 0) {
		gchar* _tmp69_;
		gchar* _tmp70_;
		BirdFontMessageDialog* _tmp71_;
		BirdFontMessageDialog* _tmp72_;
		BirdFontFont* _tmp73_;
		gchar* _tmp74_;
		gchar* _tmp75_;
		gchar* _tmp76_;
		_tmp69_ = bird_font_t_ ("You need to choose a different name for the TTF file with Mac adjustme" \
"ts.");
		_tmp70_ = _tmp69_;
		_tmp71_ = bird_font_main_window_show_message (_tmp70_);
		_tmp72_ = _tmp71_;
		_g_object_unref0 (_tmp72_);
		_g_free0 (_tmp70_);
		_tmp73_ = current_font;
		_tmp74_ = bird_font_export_settings_get_file_name_mac (_tmp73_);
		_tmp75_ = _tmp74_;
		_tmp76_ = g_strconcat (_tmp75_, " Mac.ttf", NULL);
		_g_free0 (ttf_name_mac);
		ttf_name_mac = _tmp76_;
		_g_free0 (_tmp75_);
		result = FALSE;
		_g_free0 (ttf_name_mac);
		_g_free0 (ttf_name);
		_g_object_unref0 (current_font);
		_g_free0 (m);
		_g_object_unref0 (font);
		return result;
	}
	result = TRUE;
	_g_free0 (ttf_name_mac);
	_g_free0 (ttf_name);
	_g_object_unref0 (current_font);
	_g_free0 (m);
	_g_object_unref0 (font);
	return result;
}

static void
___lambda211_ (void)
{
	gchar* first_export = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	_tmp0_ = bird_font_preferences_get ("first_export_done");
	first_export = _tmp0_;
	_tmp1_ = first_export;
	if (g_strcmp0 (_tmp1_, "") == 0) {
		gchar* _tmp2_;
		gchar* _tmp3_;
		BirdFontMessageDialog* _tmp4_;
		BirdFontMessageDialog* _tmp5_;
		bird_font_preferences_set ("first_export_done", "true");
		_tmp2_ = bird_font_t_ ("Congratulations to your first font!\n\n" "Please consider supporting the project by purchasing the pro version a" \
"t birdfont.org.\n");
		_tmp3_ = _tmp2_;
		_tmp4_ = bird_font_main_window_show_message (_tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp5_);
		_g_free0 (_tmp3_);
	}
	_g_free0 (first_export);
}

static void
____lambda211__bird_font_export_callback_file_exported (BirdFontExportCallback* _sender,
                                                        gpointer self)
{
	___lambda211_ ();
}

void
bird_font_menu_tab_export_fonts_in_background (void)
{
	BirdFontFont* f = NULL;
	gboolean _tmp0_ = FALSE;
	BirdFontFont* _tmp2_;
	BirdFontFont* _tmp3_;
	const gchar* _tmp4_;
	BirdFontFont* _tmp9_;
	if (bird_font_menu_tab_suppress_event) {
		_tmp0_ = TRUE;
	} else {
		BirdFontNativeWindow* _tmp1_;
		_tmp1_ = bird_font_main_window_native_window;
		_tmp0_ = !bird_font_native_window_can_export (_tmp1_);
	}
	if (_tmp0_) {
		_g_object_unref0 (f);
		return;
	}
	_tmp2_ = bird_font_bird_font_get_current_font ();
	_g_object_unref0 (f);
	f = _tmp2_;
	_tmp3_ = f;
	_tmp4_ = _tmp3_->font_file;
	if (_tmp4_ == NULL) {
		gchar* _tmp5_;
		gchar* _tmp6_;
		BirdFontMessageDialog* _tmp7_;
		BirdFontMessageDialog* _tmp8_;
		_tmp5_ = bird_font_t_ ("You need to save your font before exporting it.");
		_tmp6_ = _tmp5_;
		_tmp7_ = bird_font_main_window_show_message (_tmp6_);
		_tmp8_ = _tmp7_;
		_g_object_unref0 (_tmp8_);
		_g_free0 (_tmp6_);
		_g_object_unref0 (f);
		return;
	}
	if (!bird_font_menu_tab_validate_metadata ()) {
		_g_object_unref0 (f);
		return;
	}
	_tmp9_ = f;
	if (!bird_font_export_settings_has_export_settings (_tmp9_)) {
		bird_font_menu_tab_show_export_settings_tab ();
	} else {
		BirdFontExportCallback* _tmp10_;
		BirdFontExportCallback* _tmp11_;
		BirdFontExportCallback* _tmp12_;
		_tmp10_ = bird_font_export_callback_new ();
		_g_object_unref0 (bird_font_menu_tab_export_callback);
		bird_font_menu_tab_export_callback = _tmp10_;
		_tmp11_ = bird_font_menu_tab_export_callback;
		bird_font_export_callback_export_fonts_in_background (_tmp11_);
		_tmp12_ = bird_font_menu_tab_export_callback;
		g_signal_connect (_tmp12_, "file-exported", (GCallback) ____lambda211__bird_font_export_callback_file_exported, NULL);
	}
	_g_object_unref0 (f);
}

static gboolean
___lambda384_ (void)
{
	gboolean result;
	bird_font_key_bindings_reset ();
	result = FALSE;
	return result;
}

static gboolean
____lambda384__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda384_ ();
	return result;
}

gboolean
bird_font_menu_tab_set_suppress_event (gboolean e)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	if (bird_font_menu_tab_suppress_event) {
		_tmp0_ = e;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		g_warning ("MenuTab.vala:174: suppress_event is already set");
		result = FALSE;
		return result;
	}
	if (e) {
		bird_font_tab_content_create_pause_surface ();
	}
	bird_font_menu_tab_background_thread = e;
	bird_font_menu_tab_suppress_event = e;
	if (bird_font_menu_tab_suppress_event) {
		GSource* idle = NULL;
		GSource* _tmp1_;
		GSource* _tmp2_;
		GSource* _tmp3_;
		_tmp1_ = g_idle_source_new ();
		idle = _tmp1_;
		_tmp2_ = idle;
		g_source_set_callback (_tmp2_, ____lambda384__gsource_func, NULL, NULL);
		_tmp3_ = idle;
		g_source_attach (_tmp3_, NULL);
		_g_source_unref0 (idle);
	}
	result = TRUE;
	return result;
}

static gchar*
bird_font_menu_tab_real_get_label (BirdFontFontDisplay* base)
{
	BirdFontMenuTab * self;
	gchar* _tmp0_;
	gchar* result;
	self = (BirdFontMenuTab*) base;
	_tmp0_ = bird_font_t_ ("Menu");
	result = _tmp0_;
	return result;
}

static gchar*
bird_font_menu_tab_real_get_name (BirdFontFontDisplay* base)
{
	BirdFontMenuTab * self;
	gchar* _tmp0_;
	gchar* result;
	self = (BirdFontMenuTab*) base;
	_tmp0_ = g_strdup ("Menu");
	result = _tmp0_;
	return result;
}

void
bird_font_menu_tab_select_overview (void)
{
	BirdFontFont* _tmp0_;
	BirdFontFont* _tmp1_;
	gboolean _tmp2_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_bird_font_get_current_font ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_font_is_empty (_tmp1_);
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		bird_font_menu_tab_show_default_characters ();
	} else {
		BirdFontTabBar* _tmp3_;
		BirdFontTabBar* _tmp4_;
		BirdFontOverview* _tmp5_;
		BirdFontOverview* _tmp6_;
		BirdFontTabBar* _tmp7_;
		BirdFontTabBar* _tmp8_;
		_tmp3_ = bird_font_main_window_get_tab_bar ();
		_tmp4_ = _tmp3_;
		_tmp5_ = bird_font_overview_new (NULL, TRUE, TRUE);
		_tmp6_ = _tmp5_;
		bird_font_tab_bar_add_unique_tab (_tmp4_, (BirdFontFontDisplay*) _tmp6_, TRUE);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (_tmp4_);
		_tmp7_ = bird_font_main_window_get_tab_bar ();
		_tmp8_ = _tmp7_;
		bird_font_tab_bar_select_tab_name (_tmp8_, "Overview");
		_g_object_unref0 (_tmp8_);
	}
}

void
bird_font_menu_tab_clear_font_settings (void)
{
	BirdFontBackgroundTools* _tmp0_;
	_tmp0_ = bird_font_background_tools_new ();
	_g_object_unref0 (bird_font_toolbox_background_tools);
	bird_font_toolbox_background_tools = _tmp0_;
}

static gboolean
__lambda386_ (void)
{
	BirdFontExportCallback* _tmp0_;
	const gchar* _tmp1_;
	gboolean result;
	_tmp0_ = bird_font_menu_tab_export_callback;
	g_signal_emit_by_name (_tmp0_, "file-exported");
	_tmp1_ = bird_font_export_tool_error_message;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		BirdFontMessageDialog* _tmp9_;
		BirdFontMessageDialog* _tmp10_;
		_tmp2_ = bird_font_t_ ("Can't create TTF font.");
		_tmp3_ = _tmp2_;
		_tmp4_ = g_strconcat (_tmp3_, "\n", NULL);
		_tmp5_ = _tmp4_;
		_tmp6_ = bird_font_export_tool_error_message;
		_tmp7_ = g_strconcat (_tmp5_, (const gchar*) _tmp6_, NULL);
		_tmp8_ = _tmp7_;
		_tmp9_ = bird_font_main_window_show_message (_tmp8_);
		_tmp10_ = _tmp9_;
		_g_object_unref0 (_tmp10_);
		_g_free0 (_tmp8_);
		_g_free0 (_tmp5_);
		_g_free0 (_tmp3_);
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda386__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda386_ ();
	return result;
}

void
bird_font_menu_tab_signal_file_exported (void)
{
	GSource* idle = NULL;
	GSource* _tmp0_;
	_tmp0_ = g_idle_source_new ();
	idle = _tmp0_;
	g_source_set_callback (idle, ___lambda386__gsource_func, NULL, NULL);
	g_source_attach (idle, NULL);
	_g_source_unref0 (idle);
}

static gboolean
__lambda387_ (void)
{
	BirdFontSaveCallback* _tmp0_;
	gboolean result;
	_tmp0_ = bird_font_menu_tab_save_callback;
	g_signal_emit_by_name (_tmp0_, "file-saved");
	result = FALSE;
	return result;
}

static gboolean
___lambda387__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda387_ ();
	return result;
}

void
bird_font_menu_tab_signal_file_saved (void)
{
	GSource* idle = NULL;
	GSource* _tmp0_;
	_tmp0_ = g_idle_source_new ();
	idle = _tmp0_;
	g_source_set_callback (idle, ___lambda387__gsource_func, NULL, NULL);
	g_source_attach (idle, NULL);
	_g_source_unref0 (idle);
}

static gboolean
__lambda388_ (void)
{
	BirdFontLoadCallback* _tmp0_;
	BirdFontNativeWindow* _tmp1_;
	gboolean result;
	_tmp0_ = bird_font_menu_tab_load_callback;
	g_signal_emit_by_name (_tmp0_, "file-loaded");
	_tmp1_ = bird_font_main_window_native_window;
	bird_font_native_window_font_loaded (_tmp1_);
	result = FALSE;
	return result;
}

static gboolean
___lambda388__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda388_ ();
	return result;
}

void
bird_font_menu_tab_signal_file_loaded (void)
{
	GSource* idle = NULL;
	GSource* _tmp0_;
	_tmp0_ = g_idle_source_new ();
	idle = _tmp0_;
	g_source_set_callback (idle, ___lambda388__gsource_func, NULL, NULL);
	g_source_attach (idle, NULL);
	_g_source_unref0 (idle);
}

static gdouble
double_parse (const gchar* str)
{
	gdouble result;
	g_return_val_if_fail (str != NULL, 0.0);
	result = g_ascii_strtod (str, NULL);
	return result;
}

static gboolean
bool_parse (const gchar* str)
{
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	if (g_strcmp0 (str, "true") == 0) {
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

void
bird_font_menu_tab_apply_font_setting (BirdFontFont* f)
{
	BirdFontSpinButton* _tmp0_;
	const gchar* _tmp1_;
	BirdFontExpander* _tmp2_;
	BirdFontExpander* _tmp3_;
	GeeArrayList* _tmp4_;
	GeeArrayList* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gchar* sw = NULL;
	BirdFontFontSettings* _tmp22_;
	gchar* _tmp23_;
	const gchar* _tmp24_;
	gchar* pt = NULL;
	BirdFontFontSettings* _tmp27_;
	gchar* _tmp28_;
	const gchar* _tmp29_;
	gchar* stroke = NULL;
	BirdFontFontSettings* _tmp30_;
	gchar* _tmp31_;
	gboolean s = FALSE;
	const gchar* _tmp32_;
	BirdFontTool* _tmp33_;
	BirdFontTool* _tmp34_;
	gchar* lc = NULL;
	BirdFontFontSettings* _tmp35_;
	gchar* _tmp36_;
	const gchar* _tmp37_;
	gchar* lock_grid = NULL;
	BirdFontFontSettings* _tmp40_;
	gchar* _tmp41_;
	gboolean lg = FALSE;
	const gchar* _tmp42_;
	BirdFontTool* _tmp43_;
	BirdFontTool* _tmp44_;
	gchar* skew_overview = NULL;
	BirdFontFontSettings* _tmp45_;
	gchar* _tmp46_;
	const gchar* _tmp47_;
	gchar* autotrace_resolution = NULL;
	BirdFontFontSettings* _tmp50_;
	gchar* _tmp51_;
	const gchar* _tmp52_;
	gchar* autotrace_threshold = NULL;
	BirdFontFontSettings* _tmp55_;
	gchar* _tmp56_;
	const gchar* _tmp57_;
	gchar* autotrace_simplification = NULL;
	BirdFontFontSettings* _tmp60_;
	gchar* _tmp61_;
	const gchar* _tmp62_;
	gchar* kerning_zoom = NULL;
	BirdFontFontSettings* _tmp65_;
	gchar* _tmp66_;
	const gchar* _tmp67_;
	gchar* spacing_zoom = NULL;
	BirdFontFontSettings* _tmp72_;
	gchar* _tmp73_;
	const gchar* _tmp74_;
	BirdFontToolbox* _tmp79_;
	BirdFontToolbox* _tmp80_;
	BirdFontToolbox* _tmp81_;
	BirdFontToolbox* _tmp82_;
	g_return_if_fail (f != NULL);
	_tmp0_ = bird_font_drawing_tools_background_scale;
	_tmp1_ = f->background_scale;
	bird_font_spin_button_set_value (_tmp0_, _tmp1_, TRUE, TRUE);
	_tmp2_ = bird_font_drawing_tools_get_grid_expander ();
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_->tool;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp4_);
	_tmp5_ = f->grid_width;
	_tmp6_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_ == 0) {
		GeeArrayList* _tmp8_;
		GeeArrayList* _tmp9_;
		GeeArrayList* _tmp10_;
		_tmp8_ = f->grid_width;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp8_, "1");
		_tmp9_ = f->grid_width;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, "2");
		_tmp10_ = f->grid_width;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, "4");
	}
	{
		GeeArrayList* _grid_list = NULL;
		GeeArrayList* _tmp11_;
		gint _grid_size = 0;
		GeeArrayList* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		gint _grid_index = 0;
		_tmp11_ = f->grid_width;
		_grid_list = _tmp11_;
		_tmp12_ = _grid_list;
		_tmp13_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp12_);
		_tmp14_ = _tmp13_;
		_grid_size = _tmp14_;
		_grid_index = -1;
		while (TRUE) {
			gint _tmp15_;
			gint _tmp16_;
			gchar* grid = NULL;
			GeeArrayList* _tmp17_;
			gpointer _tmp18_;
			const gchar* _tmp19_;
			BirdFontSpinButton* _tmp20_;
			BirdFontSpinButton* _tmp21_;
			_grid_index = _grid_index + 1;
			_tmp15_ = _grid_index;
			_tmp16_ = _grid_size;
			if (!(_tmp15_ < _tmp16_)) {
				break;
			}
			_tmp17_ = _grid_list;
			_tmp18_ = gee_abstract_list_get ((GeeAbstractList*) _tmp17_, _grid_index);
			grid = (gchar*) _tmp18_;
			_tmp19_ = grid;
			_tmp20_ = bird_font_drawing_tools_add_new_grid (double_parse (_tmp19_), FALSE);
			_tmp21_ = _tmp20_;
			_g_object_unref0 (_tmp21_);
			_g_free0 (grid);
		}
	}
	_tmp22_ = f->settings;
	_tmp23_ = bird_font_font_settings_get_setting (_tmp22_, "stroke_width");
	sw = _tmp23_;
	_tmp24_ = sw;
	if (g_strcmp0 (_tmp24_, "") != 0) {
		const gchar* _tmp25_;
		BirdFontSpinButton* _tmp26_;
		_tmp25_ = sw;
		bird_font_stroke_tool_stroke_width = double_parse (_tmp25_);
		_tmp26_ = bird_font_drawing_tools_object_stroke;
		bird_font_spin_button_set_value_round (_tmp26_, bird_font_stroke_tool_stroke_width, TRUE, TRUE);
	}
	_tmp27_ = f->settings;
	_tmp28_ = bird_font_font_settings_get_setting (_tmp27_, "point_type");
	pt = _tmp28_;
	_tmp29_ = pt;
	bird_font_drawing_tools_set_default_point_type (_tmp29_);
	_tmp30_ = f->settings;
	_tmp31_ = bird_font_font_settings_get_setting (_tmp30_, "apply_stroke");
	stroke = _tmp31_;
	_tmp32_ = stroke;
	s = bool_parse (_tmp32_);
	_tmp33_ = bird_font_drawing_tools_get_add_stroke ();
	_tmp34_ = _tmp33_;
	bird_font_tool_set_selected (_tmp34_, s);
	bird_font_stroke_tool_add_stroke = s;
	_tmp35_ = f->settings;
	_tmp36_ = bird_font_font_settings_get_setting (_tmp35_, "line_cap");
	lc = _tmp36_;
	_tmp37_ = lc;
	if (g_strcmp0 (_tmp37_, "butt") == 0) {
		bird_font_stroke_tool_line_cap = BIRD_FONT_LINE_CAP_BUTT;
	} else {
		const gchar* _tmp38_;
		_tmp38_ = lc;
		if (g_strcmp0 (_tmp38_, "square") == 0) {
			bird_font_stroke_tool_line_cap = BIRD_FONT_LINE_CAP_SQUARE;
		} else {
			const gchar* _tmp39_;
			_tmp39_ = lc;
			if (g_strcmp0 (_tmp39_, "round") == 0) {
				bird_font_stroke_tool_line_cap = BIRD_FONT_LINE_CAP_ROUND;
			}
		}
	}
	bird_font_drawing_tools_set_stroke_tool_visibility ();
	_tmp40_ = f->settings;
	_tmp41_ = bird_font_font_settings_get_setting (_tmp40_, "lock_grid");
	lock_grid = _tmp41_;
	_tmp42_ = lock_grid;
	lg = bool_parse (_tmp42_);
	bird_font_grid_tool_lock_grid = lg;
	_tmp43_ = bird_font_drawing_tools_get_lock_grid ();
	_tmp44_ = _tmp43_;
	_tmp44_->selected = bird_font_grid_tool_lock_grid;
	_tmp45_ = f->settings;
	_tmp46_ = bird_font_font_settings_get_setting (_tmp45_, "skew_overview");
	skew_overview = _tmp46_;
	_tmp47_ = skew_overview;
	if (g_strcmp0 (_tmp47_, "") != 0) {
		gdouble so = 0.0;
		const gchar* _tmp48_;
		BirdFontSpinButton* _tmp49_;
		_tmp48_ = skew_overview;
		so = double_parse (_tmp48_);
		_tmp49_ = bird_font_overview_tools_skew;
		bird_font_spin_button_set_value_round (_tmp49_, so, TRUE, TRUE);
	}
	_tmp50_ = f->settings;
	_tmp51_ = bird_font_font_settings_get_setting (_tmp50_, "autotrace_resolution");
	autotrace_resolution = _tmp51_;
	_tmp52_ = autotrace_resolution;
	if (g_strcmp0 (_tmp52_, "") != 0) {
		gdouble ar = 0.0;
		const gchar* _tmp53_;
		BirdFontSpinButton* _tmp54_;
		_tmp53_ = autotrace_resolution;
		ar = double_parse (_tmp53_);
		_tmp54_ = bird_font_drawing_tools_background_threshold;
		bird_font_spin_button_set_value_round (_tmp54_, ar, TRUE, TRUE);
	}
	_tmp55_ = f->settings;
	_tmp56_ = bird_font_font_settings_get_setting (_tmp55_, "autotrace_threshold");
	autotrace_threshold = _tmp56_;
	_tmp57_ = autotrace_threshold;
	if (g_strcmp0 (_tmp57_, "") != 0) {
		gdouble at = 0.0;
		const gchar* _tmp58_;
		BirdFontSpinButton* _tmp59_;
		_tmp58_ = autotrace_threshold;
		at = double_parse (_tmp58_);
		_tmp59_ = bird_font_drawing_tools_auto_trace_resolution;
		bird_font_spin_button_set_value_round (_tmp59_, at, TRUE, TRUE);
	}
	_tmp60_ = f->settings;
	_tmp61_ = bird_font_font_settings_get_setting (_tmp60_, "autotrace_simplification");
	autotrace_simplification = _tmp61_;
	_tmp62_ = autotrace_simplification;
	if (g_strcmp0 (_tmp62_, "") != 0) {
		gdouble asi = 0.0;
		const gchar* _tmp63_;
		BirdFontSpinButton* _tmp64_;
		_tmp63_ = autotrace_simplification;
		asi = double_parse (_tmp63_);
		_tmp64_ = bird_font_drawing_tools_auto_trace_simplify;
		bird_font_spin_button_set_value_round (_tmp64_, asi, TRUE, TRUE);
	}
	_tmp65_ = f->settings;
	_tmp66_ = bird_font_font_settings_get_setting (_tmp65_, "kerning_zoom");
	kerning_zoom = _tmp66_;
	_tmp67_ = kerning_zoom;
	if (g_strcmp0 (_tmp67_, "") != 0) {
		gdouble k = 0.0;
		const gchar* _tmp68_;
		BirdFontZoomBar* _tmp69_;
		_tmp68_ = kerning_zoom;
		k = double_parse (_tmp68_);
		_tmp69_ = bird_font_kerning_tools_zoom_bar;
		if (!bird_font_is_null (_tmp69_)) {
			BirdFontZoomBar* _tmp70_;
			BirdFontZoomBar* _tmp71_;
			_tmp70_ = bird_font_kerning_tools_zoom_bar;
			_tmp70_->zoom_level = k;
			_tmp71_ = bird_font_kerning_tools_zoom_bar;
			g_signal_emit_by_name (_tmp71_, "new-zoom", k);
		}
	}
	_tmp72_ = f->settings;
	_tmp73_ = bird_font_font_settings_get_setting (_tmp72_, "spacing_zoom");
	spacing_zoom = _tmp73_;
	_tmp74_ = spacing_zoom;
	if (g_strcmp0 (_tmp74_, "") != 0) {
		gdouble sz = 0.0;
		const gchar* _tmp75_;
		BirdFontZoomBar* _tmp76_;
		_tmp75_ = spacing_zoom;
		sz = double_parse (_tmp75_);
		_tmp76_ = bird_font_spacing_tools_zoom_bar;
		if (!bird_font_is_null (_tmp76_)) {
			BirdFontZoomBar* _tmp77_;
			BirdFontZoomBar* _tmp78_;
			_tmp77_ = bird_font_spacing_tools_zoom_bar;
			_tmp77_->zoom_level = sz;
			_tmp78_ = bird_font_spacing_tools_zoom_bar;
			g_signal_emit_by_name (_tmp78_, "new-zoom", sz);
		}
	}
	_tmp79_ = bird_font_main_window_get_toolbox ();
	_tmp80_ = _tmp79_;
	bird_font_toolbox_update_expanders (_tmp80_);
	_g_object_unref0 (_tmp80_);
	_tmp81_ = bird_font_main_window_get_toolbox ();
	_tmp82_ = _tmp81_;
	bird_font_toolbox_update_all_expanders (_tmp82_);
	_g_object_unref0 (_tmp82_);
	bird_font_toolbox_redraw_tool_box ();
	_g_free0 (spacing_zoom);
	_g_free0 (kerning_zoom);
	_g_free0 (autotrace_simplification);
	_g_free0 (autotrace_threshold);
	_g_free0 (autotrace_resolution);
	_g_free0 (skew_overview);
	_g_free0 (lock_grid);
	_g_free0 (lc);
	_g_free0 (stroke);
	_g_free0 (pt);
	_g_free0 (sw);
}

static void
__lambda389_ (const gchar* fn)
{
	BirdFontFont* f = NULL;
	BirdFontFont* _tmp0_;
	_tmp0_ = bird_font_bird_font_get_current_font ();
	f = _tmp0_;
	if (fn != NULL) {
		BirdFontFont* _tmp1_;
		_tmp1_ = f;
		bird_font_font_init_bfp (_tmp1_, (const gchar*) fn);
	}
	bird_font_menu_tab_set_suppress_event (FALSE);
	_g_object_unref0 (f);
}

static void
___lambda389__bird_font_file_chooser_file_selected (BirdFontFileChooser* _sender,
                                                    const gchar* path,
                                                    gpointer self)
{
	__lambda389_ (path);
}

void
bird_font_menu_tab_save_as_bfp (void)
{
	BirdFontFileChooser* fc = NULL;
	BirdFontFileChooser* _tmp0_;
	BirdFontFileChooser* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	BirdFontFileChooser* _tmp4_;
	_tmp0_ = bird_font_file_chooser_new ();
	fc = _tmp0_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		_g_object_unref0 (fc);
		return;
	}
	if (!bird_font_menu_tab_set_suppress_event (TRUE)) {
		_g_object_unref0 (fc);
		return;
	}
	_tmp1_ = fc;
	g_signal_connect (_tmp1_, "file-selected", (GCallback) ___lambda389__bird_font_file_chooser_file_selected, NULL);
	_tmp2_ = bird_font_t_ ("Save");
	_tmp3_ = _tmp2_;
	_tmp4_ = fc;
	bird_font_main_window_file_chooser (_tmp3_, _tmp4_, BIRD_FONT_FILE_CHOOSER_SAVE);
	_g_free0 (_tmp3_);
	_g_object_unref0 (fc);
}

static Block35Data*
block35_data_ref (Block35Data* _data35_)
{
	g_atomic_int_inc (&_data35_->_ref_count_);
	return _data35_;
}

static void
block35_data_unref (void * _userdata_)
{
	Block35Data* _data35_;
	_data35_ = (Block35Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
		_g_object_unref0 (_data35_->dialog);
		g_slice_free (Block35Data, _data35_);
	}
}

static void
__lambda78_ (void)
{
	BirdFontFont* _tmp0_;
	BirdFontFont* _tmp1_;
	BirdFontNativeWindow* _tmp2_;
	bird_font_main_window_close_all_tabs ();
	_tmp0_ = bird_font_bird_font_new_font ();
	_tmp1_ = _tmp0_;
	_g_object_unref0 (_tmp1_);
	_tmp2_ = bird_font_main_window_native_window;
	bird_font_native_window_font_loaded (_tmp2_);
	bird_font_menu_tab_show_default_characters ();
	bird_font_glyph_canvas_redraw ();
}

static void
___lambda78__bird_font_save_dialog_listener_signal_discard (BirdFontSaveDialogListener* _sender,
                                                            gpointer self)
{
	__lambda78_ ();
}

static void
__lambda330_ (Block35Data* _data35_)
{
	BirdFontSaveDialogListener* _tmp0_;
	_tmp0_ = _data35_->dialog;
	g_signal_emit_by_name (_tmp0_, "signal-discard");
}

static void
___lambda330__bird_font_save_callback_file_saved (BirdFontSaveCallback* _sender,
                                                  gpointer self)
{
	__lambda330_ (self);
}

static void
__lambda329_ (Block35Data* _data35_)
{
	BirdFontSaveCallback* _tmp0_;
	BirdFontSaveCallback* _tmp1_;
	BirdFontSaveCallback* _tmp2_;
	_tmp0_ = bird_font_save_callback_new ();
	_g_object_unref0 (bird_font_menu_tab_save_callback);
	bird_font_menu_tab_save_callback = _tmp0_;
	_tmp1_ = bird_font_menu_tab_save_callback;
	g_signal_connect_data (_tmp1_, "file-saved", (GCallback) ___lambda330__bird_font_save_callback_file_saved, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
	_tmp2_ = bird_font_menu_tab_save_callback;
	bird_font_save_callback_save (_tmp2_);
}

static void
___lambda329__bird_font_save_dialog_listener_signal_save (BirdFontSaveDialogListener* _sender,
                                                          gpointer self)
{
	__lambda329_ (self);
}

static void
__lambda331_ (void)
{
	bird_font_main_window_hide_dialog ();
}

static void
___lambda331__bird_font_save_dialog_listener_signal_cancel (BirdFontSaveDialogListener* _sender,
                                                            gpointer self)
{
	__lambda331_ ();
}

void
bird_font_menu_tab_new_file (void)
{
	Block35Data* _data35_;
	BirdFontFont* font = NULL;
	BirdFontSaveDialogListener* _tmp0_;
	BirdFontFont* _tmp1_;
	BirdFontSaveDialogListener* _tmp2_;
	BirdFontSaveDialogListener* _tmp3_;
	BirdFontSaveDialogListener* _tmp4_;
	BirdFontFont* _tmp5_;
	_data35_ = g_slice_new0 (Block35Data);
	_data35_->_ref_count_ = 1;
	_tmp0_ = bird_font_save_dialog_listener_new ();
	_data35_->dialog = _tmp0_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		_g_object_unref0 (font);
		block35_data_unref (_data35_);
		_data35_ = NULL;
		return;
	}
	_tmp1_ = bird_font_bird_font_get_current_font ();
	_g_object_unref0 (font);
	font = _tmp1_;
	_tmp2_ = _data35_->dialog;
	g_signal_connect (_tmp2_, "signal-discard", (GCallback) ___lambda78__bird_font_save_dialog_listener_signal_discard, NULL);
	_tmp3_ = _data35_->dialog;
	g_signal_connect_data (_tmp3_, "signal-save", (GCallback) ___lambda329__bird_font_save_dialog_listener_signal_save, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
	_tmp4_ = _data35_->dialog;
	g_signal_connect (_tmp4_, "signal-cancel", (GCallback) ___lambda331__bird_font_save_dialog_listener_signal_cancel, NULL);
	_tmp5_ = font;
	if (!bird_font_font_is_modified (_tmp5_)) {
		BirdFontSaveDialogListener* _tmp6_;
		_tmp6_ = _data35_->dialog;
		g_signal_emit_by_name (_tmp6_, "signal-discard");
	} else {
		BirdFontSaveDialogListener* _tmp7_;
		BirdFontSaveDialog* _tmp8_;
		BirdFontSaveDialog* _tmp9_;
		_tmp7_ = _data35_->dialog;
		_tmp8_ = bird_font_save_dialog_new (_tmp7_);
		_tmp9_ = _tmp8_;
		bird_font_main_window_show_dialog ((BirdFontDialog*) _tmp9_);
		_g_object_unref0 (_tmp9_);
	}
	_g_object_unref0 (font);
	block35_data_unref (_data35_);
	_data35_ = NULL;
	return;
}

static void
__lambda390_ (void)
{
	BirdFontNativeWindow* _tmp0_;
	bird_font_menu_tab_ensure_main_loop_is_empty ();
	_tmp0_ = bird_font_main_window_native_window;
	bird_font_native_window_quit (_tmp0_);
}

static void
___lambda390__bird_font_save_dialog_listener_signal_discard (BirdFontSaveDialogListener* _sender,
                                                             gpointer self)
{
	__lambda390_ ();
}

static void
__lambda392_ (void)
{
	BirdFontNativeWindow* _tmp0_;
	bird_font_menu_tab_ensure_main_loop_is_empty ();
	_tmp0_ = bird_font_main_window_native_window;
	bird_font_native_window_quit (_tmp0_);
}

static void
___lambda392__bird_font_save_callback_file_saved (BirdFontSaveCallback* _sender,
                                                  gpointer self)
{
	__lambda392_ ();
}

static void
__lambda391_ (void)
{
	BirdFontSaveCallback* _tmp0_;
	BirdFontSaveCallback* _tmp1_;
	BirdFontSaveCallback* _tmp2_;
	BirdFontSaveCallback* _tmp3_;
	_tmp0_ = bird_font_save_callback_new ();
	_tmp1_ = _tmp0_;
	bird_font_menu_tab_set_save_callback (_tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = bird_font_menu_tab_save_callback;
	g_signal_connect (_tmp2_, "file-saved", (GCallback) ___lambda392__bird_font_save_callback_file_saved, NULL);
	_tmp3_ = bird_font_menu_tab_save_callback;
	bird_font_save_callback_save (_tmp3_);
}

static void
___lambda391__bird_font_save_dialog_listener_signal_save (BirdFontSaveDialogListener* _sender,
                                                          gpointer self)
{
	__lambda391_ ();
}

static void
__lambda393_ (void)
{
	bird_font_main_window_hide_dialog ();
}

static void
___lambda393__bird_font_save_dialog_listener_signal_cancel (BirdFontSaveDialogListener* _sender,
                                                            gpointer self)
{
	__lambda393_ ();
}

void
bird_font_menu_tab_quit (void)
{
	BirdFontSaveDialogListener* dialog = NULL;
	BirdFontSaveDialogListener* _tmp0_;
	BirdFontFont* font = NULL;
	BirdFontFont* _tmp1_;
	BirdFontSaveDialogListener* _tmp2_;
	BirdFontSaveDialogListener* _tmp3_;
	BirdFontSaveDialogListener* _tmp4_;
	BirdFontFont* _tmp5_;
	BirdFontNativeWindow* _tmp10_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	bird_font_tab_content_hide_text_input ();
	_tmp0_ = bird_font_save_dialog_listener_new ();
	dialog = _tmp0_;
	_tmp1_ = bird_font_bird_font_get_current_font ();
	font = _tmp1_;
	bird_font_preferences_save ();
	_tmp2_ = dialog;
	g_signal_connect (_tmp2_, "signal-discard", (GCallback) ___lambda390__bird_font_save_dialog_listener_signal_discard, NULL);
	_tmp3_ = dialog;
	g_signal_connect (_tmp3_, "signal-save", (GCallback) ___lambda391__bird_font_save_dialog_listener_signal_save, NULL);
	_tmp4_ = dialog;
	g_signal_connect (_tmp4_, "signal-cancel", (GCallback) ___lambda393__bird_font_save_dialog_listener_signal_cancel, NULL);
	_tmp5_ = font;
	if (!bird_font_font_is_modified (_tmp5_)) {
		BirdFontSaveDialogListener* _tmp6_;
		_tmp6_ = dialog;
		g_signal_emit_by_name (_tmp6_, "signal-discard");
	} else {
		BirdFontSaveDialogListener* _tmp7_;
		BirdFontSaveDialog* _tmp8_;
		BirdFontSaveDialog* _tmp9_;
		_tmp7_ = dialog;
		_tmp8_ = bird_font_save_dialog_new (_tmp7_);
		_tmp9_ = _tmp8_;
		bird_font_main_window_show_dialog ((BirdFontDialog*) _tmp9_);
		_g_object_unref0 (_tmp9_);
	}
	_tmp10_ = bird_font_main_window_native_window;
	bird_font_native_window_update_window_size (_tmp10_);
	_g_object_unref0 (font);
	_g_object_unref0 (dialog);
}

void
bird_font_menu_tab_show_export_settings_tab (void)
{
	BirdFontTabBar* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontExportSettings* _tmp2_;
	BirdFontExportSettings* _tmp3_;
	_tmp0_ = bird_font_main_window_get_tab_bar ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_export_settings_new ();
	_tmp3_ = _tmp2_;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

void
bird_font_menu_tab_show_description (void)
{
	BirdFontTabBar* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontDescriptionDisplay* _tmp2_;
	BirdFontDescriptionDisplay* _tmp3_;
	_tmp0_ = bird_font_main_window_get_tab_bar ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_description_display_new ();
	_tmp3_ = _tmp2_;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

void
bird_font_menu_tab_show_kerning_context (void)
{
	BirdFontKerningDisplay* kd = NULL;
	BirdFontKerningDisplay* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontTabBar* _tmp2_;
	BirdFontKerningDisplay* _tmp3_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_main_window_get_kerning_display ();
	kd = _tmp0_;
	_tmp1_ = bird_font_main_window_get_tab_bar ();
	_tmp2_ = _tmp1_;
	_tmp3_ = kd;
	bird_font_tab_bar_add_unique_tab (_tmp2_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (kd);
}

void
bird_font_menu_tab_show_spacing_tab (void)
{
	BirdFontSpacingTab* s = NULL;
	BirdFontSpacingTab* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontTabBar* _tmp2_;
	BirdFontSpacingTab* _tmp3_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_main_window_get_spacing_tab ();
	s = _tmp0_;
	_tmp1_ = bird_font_main_window_get_tab_bar ();
	_tmp2_ = _tmp1_;
	_tmp3_ = s;
	bird_font_tab_bar_add_unique_tab (_tmp2_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (s);
}

void
bird_font_menu_tab_show_ligature_tab (void)
{
	BirdFontLigatureList* d = NULL;
	BirdFontLigatureList* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontTabBar* _tmp2_;
	BirdFontLigatureList* _tmp3_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_main_window_get_ligature_display ();
	d = _tmp0_;
	_tmp1_ = bird_font_main_window_get_tab_bar ();
	_tmp2_ = _tmp1_;
	_tmp3_ = d;
	bird_font_tab_bar_add_unique_tab (_tmp2_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (d);
}

static void
___lambda119_ (void)
{
	bird_font_menu_tab_show_preview_tab ();
}

static void
____lambda119__bird_font_save_callback_file_saved (BirdFontSaveCallback* _sender,
                                                   gpointer self)
{
	___lambda119_ ();
}

void
bird_font_menu_tab_preview (void)
{
	BirdFontFont* font = NULL;
	BirdFontFont* _tmp0_;
	BirdFontFont* _tmp1_;
	const gchar* _tmp2_;
	_tmp0_ = bird_font_bird_font_get_current_font ();
	font = _tmp0_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		_g_object_unref0 (font);
		return;
	}
	_tmp1_ = font;
	_tmp2_ = _tmp1_->font_file;
	if (_tmp2_ == NULL) {
		BirdFontSaveCallback* _tmp3_;
		BirdFontSaveCallback* _tmp4_;
		BirdFontSaveCallback* _tmp5_;
		_tmp3_ = bird_font_save_callback_new ();
		_g_object_unref0 (bird_font_menu_tab_save_callback);
		bird_font_menu_tab_save_callback = _tmp3_;
		_tmp4_ = bird_font_menu_tab_save_callback;
		g_signal_connect (_tmp4_, "file-saved", (GCallback) ____lambda119__bird_font_save_callback_file_saved, NULL);
		_tmp5_ = bird_font_menu_tab_save_callback;
		bird_font_save_callback_save (_tmp5_);
	} else {
		bird_font_menu_tab_show_preview_tab ();
	}
	_g_object_unref0 (font);
}

static Block36Data*
block36_data_ref (Block36Data* _data36_)
{
	g_atomic_int_inc (&_data36_->_ref_count_);
	return _data36_;
}

static void
block36_data_unref (void * _userdata_)
{
	Block36Data* _data36_;
	_data36_ = (Block36Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data36_->_ref_count_)) {
		_g_object_unref0 (_data36_->tab_bar);
		g_slice_free (Block36Data, _data36_);
	}
}

static void
__lambda120_ (Block36Data* _data36_)
{
	BirdFontTabBar* _tmp0_;
	BirdFontPreview* _tmp1_;
	BirdFontPreview* _tmp2_;
	bird_font_key_bindings_set_modifier (BIRD_FONT_NONE);
	_tmp0_ = _data36_->tab_bar;
	_tmp1_ = bird_font_preview_new ();
	_tmp2_ = _tmp1_;
	bird_font_tab_bar_add_unique_tab (_tmp0_, (BirdFontFontDisplay*) _tmp2_, TRUE);
	_g_object_unref0 (_tmp2_);
	bird_font_preview_tools_update_preview ();
}

static void
___lambda120__bird_font_over_write_dialog_listener_overwrite_signal (BirdFontOverWriteDialogListener* _sender,
                                                                     gpointer self)
{
	__lambda120_ (self);
}

void
bird_font_menu_tab_show_preview_tab (void)
{
	Block36Data* _data36_;
	BirdFontOverWriteDialogListener* listener = NULL;
	BirdFontOverWriteDialogListener* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontFontFormat format = 0;
	BirdFontFont* _tmp2_;
	BirdFontFont* _tmp3_;
	BirdFontFontFormat _tmp4_;
	BirdFontOverWriteDialogListener* _tmp5_;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	_data36_ = g_slice_new0 (Block36Data);
	_data36_->_ref_count_ = 1;
	_tmp0_ = bird_font_over_write_dialog_listener_new ();
	listener = _tmp0_;
	_tmp1_ = bird_font_main_window_get_tab_bar ();
	_data36_->tab_bar = _tmp1_;
	_tmp2_ = bird_font_bird_font_get_current_font ();
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_->format;
	_g_object_unref0 (_tmp3_);
	format = _tmp4_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		_g_object_unref0 (listener);
		block36_data_unref (_data36_);
		_data36_ = NULL;
		return;
	}
	_tmp5_ = listener;
	g_signal_connect_data (_tmp5_, "overwrite-signal", (GCallback) ___lambda120__bird_font_over_write_dialog_listener_overwrite_signal, block36_data_ref (_data36_), (GClosureNotify) block36_data_unref, 0);
	if (format == BIRD_FONT_FONT_FORMAT_SVG) {
		_tmp7_ = TRUE;
	} else {
		_tmp7_ = format == BIRD_FONT_FONT_FORMAT_FREETYPE;
	}
	if (_tmp7_) {
		_tmp6_ = !bird_font_over_write_dialog_listener_dont_ask_again;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		BirdFontOverWriteDialogListener* _tmp8_;
		BirdFontOverwriteDialog* _tmp9_;
		BirdFontOverwriteDialog* _tmp10_;
		_tmp8_ = listener;
		_tmp9_ = bird_font_overwrite_dialog_new (_tmp8_);
		_tmp10_ = _tmp9_;
		bird_font_main_window_show_dialog ((BirdFontDialog*) _tmp10_);
		_g_object_unref0 (_tmp10_);
	} else {
		BirdFontOverWriteDialogListener* _tmp11_;
		_tmp11_ = listener;
		bird_font_over_write_dialog_listener_overwrite (_tmp11_);
	}
	_g_object_unref0 (listener);
	block36_data_unref (_data36_);
	_data36_ = NULL;
}

/** Display the language selection tab. */
void
bird_font_menu_tab_select_language (void)
{
	BirdFontTabBar* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontLanguageSelectionTab* _tmp2_;
	BirdFontLanguageSelectionTab* _tmp3_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_main_window_get_tab_bar ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_language_selection_tab_new ();
	_tmp3_ = _tmp2_;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

void
bird_font_menu_tab_use_current_glyph_as_background (void)
{
	BirdFontGlyph* _tmp0_;
	BirdFontFontDisplay* _tmp1_;
	BirdFontFontDisplay* _tmp2_;
	gboolean _tmp3_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_main_window_get_current_glyph ();
	_g_object_unref0 (bird_font_glyph_background_glyph);
	bird_font_glyph_background_glyph = _tmp0_;
	_tmp1_ = bird_font_main_window_get_current_display ();
	_tmp2_ = _tmp1_;
	_tmp3_ = BIRD_FONT_IS_OVERVIEW (_tmp2_);
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		BirdFontOverview* _tmp4_;
		BirdFontOverview* _tmp5_;
		BirdFontGlyph* _tmp6_;
		_tmp4_ = bird_font_main_window_get_overview ();
		_tmp5_ = _tmp4_;
		_tmp6_ = bird_font_overview_get_current_glyph (_tmp5_);
		_g_object_unref0 (bird_font_glyph_background_glyph);
		bird_font_glyph_background_glyph = _tmp6_;
		_g_object_unref0 (_tmp5_);
	}
}

void
bird_font_menu_tab_reset_glyph_background (void)
{
	_g_object_unref0 (bird_font_glyph_background_glyph);
	bird_font_glyph_background_glyph = NULL;
}

void
bird_font_menu_tab_remove_all_kerning_pairs (void)
{
	BirdFontKerningClasses* classes = NULL;
	BirdFontFont* _tmp0_;
	BirdFontFont* _tmp1_;
	BirdFontKerningClasses* _tmp2_;
	BirdFontKerningClasses* _tmp3_;
	BirdFontKerningClasses* _tmp4_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_bird_font_get_current_font ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_font_get_kerning_classes (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	classes = _tmp3_;
	_tmp4_ = classes;
	bird_font_kerning_classes_remove_all_pairs (_tmp4_);
	bird_font_kerning_tools_update_kerning_classes ();
	_g_object_unref0 (classes);
}

void
bird_font_menu_tab_list_all_kerning_pairs (void)
{
	BirdFontTabBar* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontKerningList* _tmp2_;
	BirdFontKerningList* _tmp3_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_main_window_get_tab_bar ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_kerning_list_new ();
	_tmp3_ = _tmp2_;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

void
bird_font_menu_tab_ensure_main_loop_is_empty (void)
{
	GMainContext* context = NULL;
	gboolean acquired = FALSE;
	GMainContext* _tmp0_;
	GMainContext* _tmp1_;
	GMainContext* _tmp4_;
	_tmp0_ = g_main_context_default ();
	context = _tmp0_;
	_tmp1_ = context;
	acquired = g_main_context_acquire (_tmp1_);
	if (G_UNLIKELY (!acquired)) {
		g_warning ("MenuTab.vala:594: Failed to acquire main loop.\n");
		return;
	}
	while (TRUE) {
		GMainContext* _tmp2_;
		GMainContext* _tmp3_;
		_tmp2_ = context;
		if (!g_main_context_pending (_tmp2_)) {
			break;
		}
		_tmp3_ = context;
		g_main_context_iteration (_tmp3_, TRUE);
	}
	_tmp4_ = context;
	g_main_context_release (_tmp4_);
}

void
bird_font_menu_tab_save_as (void)
{
	gboolean _tmp0_ = FALSE;
	BirdFontSaveCallback* _tmp2_;
	BirdFontSaveCallback* _tmp3_;
	BirdFontSaveCallback* _tmp4_;
	if (bird_font_menu_tab_has_suppress_event ()) {
		_tmp0_ = TRUE;
	} else {
		BirdFontSaveCallback* _tmp1_;
		_tmp1_ = bird_font_menu_tab_save_callback;
		_tmp0_ = !_tmp1_->is_done;
	}
	if (_tmp0_) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp2_ = bird_font_save_callback_new ();
	_tmp3_ = _tmp2_;
	bird_font_menu_tab_set_save_callback (_tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = bird_font_menu_tab_save_callback;
	bird_font_save_callback_save_as (_tmp4_);
}

void
bird_font_menu_tab_save (void)
{
	gboolean _tmp0_ = FALSE;
	BirdFontSaveCallback* _tmp2_;
	BirdFontSaveCallback* _tmp3_;
	BirdFontSaveCallback* _tmp4_;
	if (bird_font_menu_tab_has_suppress_event ()) {
		BirdFontSaveCallback* _tmp1_;
		_tmp1_ = bird_font_menu_tab_save_callback;
		_tmp0_ = !_tmp1_->is_done;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp2_ = bird_font_save_callback_new ();
	_tmp3_ = _tmp2_;
	bird_font_menu_tab_set_save_callback (_tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = bird_font_menu_tab_save_callback;
	bird_font_save_callback_save (_tmp4_);
}

static void
__lambda290_ (void)
{
	BirdFontFont* f = NULL;
	BirdFontFont* _tmp0_;
	_tmp0_ = bird_font_bird_font_get_current_font ();
	f = _tmp0_;
	bird_font_menu_tab_apply_font_setting (f);
	_g_object_unref0 (f);
}

static void
___lambda290__bird_font_load_callback_file_loaded (BirdFontLoadCallback* _sender,
                                                   gpointer self)
{
	__lambda290_ ();
}

void
bird_font_menu_tab_load (void)
{
	BirdFontLoadCallback* _tmp0_;
	BirdFontLoadCallback* _tmp1_;
	BirdFontLoadCallback* _tmp2_;
	if (bird_font_menu_tab_has_suppress_event ()) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_load_callback_new ();
	_g_object_unref0 (bird_font_menu_tab_load_callback);
	bird_font_menu_tab_load_callback = _tmp0_;
	_tmp1_ = bird_font_menu_tab_load_callback;
	bird_font_load_callback_load (_tmp1_);
	_tmp2_ = bird_font_menu_tab_load_callback;
	g_signal_connect (_tmp2_, "file-loaded", (GCallback) ___lambda290__bird_font_load_callback_file_loaded, NULL);
}

void
bird_font_menu_tab_move_to_baseline (void)
{
	BirdFontMoveTool* _tmp0_;
	BirdFontMoveTool* _tmp1_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_drawing_tools_get_move_tool ();
	_tmp1_ = _tmp0_;
	bird_font_move_tool_move_to_baseline (_tmp1_);
}

void
bird_font_menu_tab_show_file_dialog_tab (const gchar* title,
                                         BirdFontFileChooser* action,
                                         gboolean folder)
{
	BirdFontFileDialogTab* ft = NULL;
	BirdFontFileDialogTab* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontTabBar* _tmp2_;
	g_return_if_fail (title != NULL);
	g_return_if_fail (action != NULL);
	_tmp0_ = bird_font_file_dialog_tab_new (title, action, folder);
	ft = _tmp0_;
	_tmp1_ = bird_font_main_window_get_tab_bar ();
	_tmp2_ = _tmp1_;
	bird_font_tab_bar_add_tab (_tmp2_, (BirdFontFontDisplay*) ft, TRUE, NULL);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (ft);
}

static void
_bird_font_menu_tab_simplify_bird_font_task_runnable (gpointer self)
{
	bird_font_menu_tab_simplify ();
}

void
bird_font_menu_tab_simplify_path (void)
{
	BirdFontTask* t = NULL;
	BirdFontTask* _tmp0_;
	BirdFontTask* _tmp1_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		return;
	}
	_tmp0_ = bird_font_task_new (_bird_font_menu_tab_simplify_bird_font_task_runnable, NULL, NULL, FALSE);
	t = _tmp0_;
	_tmp1_ = t;
	bird_font_main_window_run_blocking_task (_tmp1_);
	_g_object_unref0 (t);
}

static void
bird_font_menu_tab_simplify (void)
{
	BirdFontGlyph* g = NULL;
	BirdFontGlyph* _tmp0_;
	GeeArrayList* paths = NULL;
	GeeArrayList* _tmp1_;
	GeeArrayList* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	BirdFontGlyph* _tmp42_;
	BirdFontGlyph* _tmp79_;
	GeeArrayList* _tmp80_;
	BirdFontGlyph* _tmp81_;
	_tmp0_ = bird_font_main_window_get_current_glyph ();
	g = _tmp0_;
	_tmp1_ = gee_array_list_new (BIRD_FONT_TYPE_PATH, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	paths = _tmp1_;
	{
		GeeArrayList* _p_list = NULL;
		BirdFontGlyph* _tmp2_;
		GeeArrayList* _tmp3_;
		gint _p_size = 0;
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _p_index = 0;
		_tmp2_ = g;
		_tmp3_ = _tmp2_->active_paths;
		_p_list = _tmp3_;
		_tmp4_ = _p_list;
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
		_tmp6_ = _tmp5_;
		_p_size = _tmp6_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			BirdFontPath* p = NULL;
			GeeArrayList* _tmp9_;
			gpointer _tmp10_;
			GeeArrayList* _tmp11_;
			BirdFontPath* _tmp12_;
			BirdFontPath* _tmp13_;
			BirdFontPath* _tmp14_;
			_p_index = _p_index + 1;
			_tmp7_ = _p_index;
			_tmp8_ = _p_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _p_list;
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _p_index);
			p = (BirdFontPath*) _tmp10_;
			_tmp11_ = paths;
			_tmp12_ = p;
			_tmp13_ = bird_font_pen_tool_simplify (_tmp12_, FALSE, bird_font_pen_tool_simplification_threshold);
			_tmp14_ = _tmp13_;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp14_);
			_g_object_unref0 (_tmp14_);
			_g_object_unref0 (p);
		}
	}
	_tmp15_ = paths;
	_tmp16_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp15_);
	_tmp17_ = _tmp16_;
	if (_tmp17_ == 0) {
		{
			GeeArrayList* _p_list = NULL;
			BirdFontGlyph* _tmp18_;
			GeeArrayList* _tmp19_;
			gint _p_size = 0;
			GeeArrayList* _tmp20_;
			gint _tmp21_;
			gint _tmp22_;
			gint _p_index = 0;
			_tmp18_ = g;
			_tmp19_ = bird_font_glyph_get_all_paths (_tmp18_);
			_p_list = _tmp19_;
			_tmp20_ = _p_list;
			_tmp21_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp20_);
			_tmp22_ = _tmp21_;
			_p_size = _tmp22_;
			_p_index = -1;
			while (TRUE) {
				gint _tmp23_;
				gint _tmp24_;
				BirdFontPath* p = NULL;
				GeeArrayList* _tmp25_;
				gpointer _tmp26_;
				BirdFontGlyph* _tmp27_;
				BirdFontPath* _tmp28_;
				_p_index = _p_index + 1;
				_tmp23_ = _p_index;
				_tmp24_ = _p_size;
				if (!(_tmp23_ < _tmp24_)) {
					break;
				}
				_tmp25_ = _p_list;
				_tmp26_ = gee_abstract_list_get ((GeeAbstractList*) _tmp25_, _p_index);
				p = (BirdFontPath*) _tmp26_;
				_tmp27_ = g;
				_tmp28_ = p;
				bird_font_glyph_add_active_path (_tmp27_, NULL, _tmp28_);
				_g_object_unref0 (p);
			}
			_g_object_unref0 (_p_list);
		}
		{
			GeeArrayList* _p_list = NULL;
			BirdFontGlyph* _tmp29_;
			GeeArrayList* _tmp30_;
			gint _p_size = 0;
			GeeArrayList* _tmp31_;
			gint _tmp32_;
			gint _tmp33_;
			gint _p_index = 0;
			_tmp29_ = g;
			_tmp30_ = _tmp29_->active_paths;
			_p_list = _tmp30_;
			_tmp31_ = _p_list;
			_tmp32_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp31_);
			_tmp33_ = _tmp32_;
			_p_size = _tmp33_;
			_p_index = -1;
			while (TRUE) {
				gint _tmp34_;
				gint _tmp35_;
				BirdFontPath* p = NULL;
				GeeArrayList* _tmp36_;
				gpointer _tmp37_;
				GeeArrayList* _tmp38_;
				BirdFontPath* _tmp39_;
				BirdFontPath* _tmp40_;
				BirdFontPath* _tmp41_;
				_p_index = _p_index + 1;
				_tmp34_ = _p_index;
				_tmp35_ = _p_size;
				if (!(_tmp34_ < _tmp35_)) {
					break;
				}
				_tmp36_ = _p_list;
				_tmp37_ = gee_abstract_list_get ((GeeAbstractList*) _tmp36_, _p_index);
				p = (BirdFontPath*) _tmp37_;
				_tmp38_ = paths;
				_tmp39_ = p;
				_tmp40_ = bird_font_pen_tool_simplify (_tmp39_, TRUE, bird_font_pen_tool_simplification_threshold);
				_tmp41_ = _tmp40_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp38_, _tmp41_);
				_g_object_unref0 (_tmp41_);
				_g_object_unref0 (p);
			}
		}
	}
	_tmp42_ = g;
	bird_font_glyph_store_undo_state (_tmp42_, FALSE);
	{
		GeeArrayList* _p_list = NULL;
		BirdFontGlyph* _tmp43_;
		GeeArrayList* _tmp44_;
		gint _p_size = 0;
		GeeArrayList* _tmp45_;
		gint _tmp46_;
		gint _tmp47_;
		gint _p_index = 0;
		_tmp43_ = g;
		_tmp44_ = _tmp43_->active_paths;
		_p_list = _tmp44_;
		_tmp45_ = _p_list;
		_tmp46_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp45_);
		_tmp47_ = _tmp46_;
		_p_size = _tmp47_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp48_;
			gint _tmp49_;
			BirdFontPath* p = NULL;
			GeeArrayList* _tmp50_;
			gpointer _tmp51_;
			BirdFontGlyph* _tmp52_;
			BirdFontLayer* _tmp53_;
			BirdFontPath* _tmp54_;
			_p_index = _p_index + 1;
			_tmp48_ = _p_index;
			_tmp49_ = _p_size;
			if (!(_tmp48_ < _tmp49_)) {
				break;
			}
			_tmp50_ = _p_list;
			_tmp51_ = gee_abstract_list_get ((GeeAbstractList*) _tmp50_, _p_index);
			p = (BirdFontPath*) _tmp51_;
			_tmp52_ = g;
			_tmp53_ = _tmp52_->layers;
			_tmp54_ = p;
			bird_font_layer_remove_path (_tmp53_, _tmp54_);
			_g_object_unref0 (p);
		}
	}
	{
		GeeArrayList* _p_list = NULL;
		BirdFontGlyph* _tmp55_;
		GeeArrayList* _tmp56_;
		gint _p_size = 0;
		GeeArrayList* _tmp57_;
		gint _tmp58_;
		gint _tmp59_;
		gint _p_index = 0;
		_tmp55_ = g;
		_tmp56_ = _tmp55_->active_paths;
		_p_list = _tmp56_;
		_tmp57_ = _p_list;
		_tmp58_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp57_);
		_tmp59_ = _tmp58_;
		_p_size = _tmp59_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp60_;
			gint _tmp61_;
			BirdFontPath* p = NULL;
			GeeArrayList* _tmp62_;
			gpointer _tmp63_;
			BirdFontGlyph* _tmp64_;
			BirdFontLayer* _tmp65_;
			BirdFontPath* _tmp66_;
			_p_index = _p_index + 1;
			_tmp60_ = _p_index;
			_tmp61_ = _p_size;
			if (!(_tmp60_ < _tmp61_)) {
				break;
			}
			_tmp62_ = _p_list;
			_tmp63_ = gee_abstract_list_get ((GeeAbstractList*) _tmp62_, _p_index);
			p = (BirdFontPath*) _tmp63_;
			_tmp64_ = g;
			_tmp65_ = _tmp64_->layers;
			_tmp66_ = p;
			bird_font_layer_remove_path (_tmp65_, _tmp66_);
			_g_object_unref0 (p);
		}
	}
	{
		GeeArrayList* _p_list = NULL;
		GeeArrayList* _tmp67_;
		gint _p_size = 0;
		GeeArrayList* _tmp68_;
		gint _tmp69_;
		gint _tmp70_;
		gint _p_index = 0;
		_tmp67_ = paths;
		_p_list = _tmp67_;
		_tmp68_ = _p_list;
		_tmp69_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp68_);
		_tmp70_ = _tmp69_;
		_p_size = _tmp70_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp71_;
			gint _tmp72_;
			BirdFontPath* p = NULL;
			GeeArrayList* _tmp73_;
			gpointer _tmp74_;
			BirdFontGlyph* _tmp75_;
			BirdFontPath* _tmp76_;
			BirdFontGlyph* _tmp77_;
			BirdFontPath* _tmp78_;
			_p_index = _p_index + 1;
			_tmp71_ = _p_index;
			_tmp72_ = _p_size;
			if (!(_tmp71_ < _tmp72_)) {
				break;
			}
			_tmp73_ = _p_list;
			_tmp74_ = gee_abstract_list_get ((GeeAbstractList*) _tmp73_, _p_index);
			p = (BirdFontPath*) _tmp74_;
			_tmp75_ = g;
			_tmp76_ = p;
			bird_font_glyph_add_path (_tmp75_, _tmp76_);
			_tmp77_ = g;
			_tmp78_ = p;
			bird_font_glyph_add_active_path (_tmp77_, NULL, _tmp78_);
			_g_object_unref0 (p);
		}
	}
	_tmp79_ = g;
	_tmp80_ = _tmp79_->active_paths;
	gee_abstract_collection_clear ((GeeAbstractCollection*) _tmp80_);
	_tmp81_ = g;
	bird_font_glyph_update_view (_tmp81_);
	_g_object_unref0 (paths);
	_g_object_unref0 (g);
}

void
bird_font_menu_tab_show_spacing_class_tab (void)
{
	BirdFontSpacingClassTab* t = NULL;
	BirdFontSpacingClassTab* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontTabBar* _tmp2_;
	_tmp0_ = bird_font_main_window_get_spacing_class_tab ();
	t = _tmp0_;
	_tmp1_ = bird_font_main_window_get_tab_bar ();
	_tmp2_ = _tmp1_;
	bird_font_tab_bar_add_unique_tab (_tmp2_, (BirdFontFontDisplay*) t, TRUE);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (t);
}

static Block37Data*
block37_data_ref (Block37Data* _data37_)
{
	g_atomic_int_inc (&_data37_->_ref_count_);
	return _data37_;
}

static void
block37_data_unref (void * _userdata_)
{
	Block37Data* _data37_;
	_data37_ = (Block37Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data37_->_ref_count_)) {
		_g_free0 (_data37_->ligature_name);
		g_slice_free (Block37Data, _data37_);
	}
}

static void
__lambda411_ (Block37Data* _data37_,
              const gchar* text)
{
	gchar* _tmp0_;
	g_return_if_fail (text != NULL);
	_tmp0_ = g_strdup (text);
	_g_free0 (_data37_->ligature_name);
	_data37_->ligature_name = _tmp0_;
}

static void
___lambda411__bird_font_text_listener_signal_text_input (BirdFontTextListener* _sender,
                                                         const gchar* text,
                                                         gpointer self)
{
	__lambda411_ (self, text);
}

static void
__lambda412_ (Block37Data* _data37_)
{
	BirdFontFont* font = NULL;
	BirdFontFont* _tmp0_;
	BirdFontGlyphCollection* fg = NULL;
	BirdFontGlyph* glyph = NULL;
	BirdFontGlyphCollection* glyph_collection = NULL;
	BirdFontOverview* o = NULL;
	BirdFontOverview* _tmp1_;
	BirdFontFont* _tmp2_;
	const gchar* _tmp3_;
	BirdFontGlyphCollection* _tmp4_;
	BirdFontGlyphCollection* _tmp5_;
	BirdFontOverview* _tmp15_;
	BirdFontOverview* _tmp16_;
	const gchar* _tmp17_;
	_tmp0_ = bird_font_bird_font_get_current_font ();
	font = _tmp0_;
	_tmp1_ = bird_font_main_window_get_overview ();
	o = _tmp1_;
	_tmp2_ = font;
	_tmp3_ = _data37_->ligature_name;
	_tmp4_ = bird_font_font_get_glyph_collection_by_name (_tmp2_, _tmp3_);
	_g_object_unref0 (fg);
	fg = _tmp4_;
	_tmp5_ = fg;
	if (_tmp5_ == NULL) {
		const gchar* _tmp6_;
		BirdFontGlyphCollection* _tmp7_;
		const gchar* _tmp8_;
		BirdFontGlyph* _tmp9_;
		BirdFontGlyphCollection* _tmp10_;
		BirdFontGlyphCollection* _tmp11_;
		BirdFontGlyph* _tmp12_;
		BirdFontFont* _tmp13_;
		BirdFontGlyphCollection* _tmp14_;
		_tmp6_ = _data37_->ligature_name;
		_tmp7_ = bird_font_glyph_collection_new ((gunichar) '\0', _tmp6_);
		_g_object_unref0 (glyph_collection);
		glyph_collection = _tmp7_;
		_tmp8_ = _data37_->ligature_name;
		_tmp9_ = bird_font_glyph_new (_tmp8_, (gunichar) '\0');
		_g_object_unref0 (glyph);
		glyph = _tmp9_;
		_tmp10_ = glyph_collection;
		bird_font_glyph_collection_set_unassigned (_tmp10_, TRUE);
		_tmp11_ = glyph_collection;
		_tmp12_ = glyph;
		bird_font_glyph_collection_insert_glyph (_tmp11_, _tmp12_, TRUE);
		_tmp13_ = font;
		_tmp14_ = glyph_collection;
		bird_font_font_add_glyph_collection (_tmp13_, _tmp14_);
	}
	_tmp15_ = o;
	bird_font_overview_display_all_available_glyphs (_tmp15_);
	_tmp16_ = o;
	_tmp17_ = _data37_->ligature_name;
	bird_font_overview_scroll_to_glyph (_tmp16_, _tmp17_);
	bird_font_tab_content_hide_text_input ();
	bird_font_menu_tab_show_all_available_characters ();
	_g_object_unref0 (o);
	_g_object_unref0 (glyph_collection);
	_g_object_unref0 (glyph);
	_g_object_unref0 (fg);
	_g_object_unref0 (font);
}

static void
___lambda412__bird_font_text_listener_signal_submit (BirdFontTextListener* _sender,
                                                     const gchar* text,
                                                     gpointer self)
{
	__lambda412_ (self);
}

void
bird_font_menu_tab_add_ligature (void)
{
	Block37Data* _data37_;
	BirdFontTextListener* listener = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	BirdFontTextListener* _tmp5_;
	BirdFontTextListener* _tmp6_;
	BirdFontTextListener* _tmp7_;
	BirdFontTextListener* _tmp8_;
	_data37_ = g_slice_new0 (Block37Data);
	_data37_->_ref_count_ = 1;
	_tmp0_ = g_strdup ("");
	_data37_->ligature_name = _tmp0_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		_g_object_unref0 (listener);
		block37_data_unref (_data37_);
		_data37_ = NULL;
		return;
	}
	_tmp1_ = bird_font_t_ ("Name");
	_tmp2_ = _tmp1_;
	_tmp3_ = bird_font_t_ ("Add ligature");
	_tmp4_ = _tmp3_;
	_tmp5_ = bird_font_text_listener_new (_tmp2_, "", _tmp4_);
	_g_object_unref0 (listener);
	listener = _tmp5_;
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	_tmp6_ = listener;
	g_signal_connect_data (_tmp6_, "signal-text-input", (GCallback) ___lambda411__bird_font_text_listener_signal_text_input, block37_data_ref (_data37_), (GClosureNotify) block37_data_unref, 0);
	_tmp7_ = listener;
	g_signal_connect_data (_tmp7_, "signal-submit", (GCallback) ___lambda412__bird_font_text_listener_signal_submit, block37_data_ref (_data37_), (GClosureNotify) block37_data_unref, 0);
	_tmp8_ = listener;
	bird_font_tab_content_show_text_input (_tmp8_);
	_g_object_unref0 (listener);
	block37_data_unref (_data37_);
	_data37_ = NULL;
}

void
bird_font_menu_tab_show_default_characters (void)
{
	BirdFontTabBar* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontOverview* _tmp2_;
	BirdFontOverview* _tmp3_;
	BirdFontOverview* o = NULL;
	BirdFontOverview* _tmp4_;
	BirdFontGlyphRange* gr = NULL;
	BirdFontGlyphRange* _tmp5_;
	BirdFontFont* _tmp6_;
	BirdFontFont* _tmp7_;
	gboolean _tmp8_;
	BirdFontGlyphRange* _tmp9_;
	BirdFontOverview* _tmp10_;
	BirdFontGlyphRange* _tmp11_;
	BirdFontTabBar* _tmp12_;
	BirdFontTabBar* _tmp13_;
	_tmp0_ = bird_font_main_window_get_tab_bar ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_overview_new (NULL, TRUE, TRUE);
	_tmp3_ = _tmp2_;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	_tmp4_ = bird_font_main_window_get_overview ();
	o = _tmp4_;
	_tmp5_ = bird_font_glyph_range_new ();
	gr = _tmp5_;
	_tmp6_ = bird_font_bird_font_get_current_font ();
	_tmp7_ = _tmp6_;
	_tmp8_ = !_tmp7_->initialised;
	_g_object_unref0 (_tmp7_);
	if (_tmp8_) {
		bird_font_menu_tab_new_file ();
	}
	_tmp9_ = gr;
	bird_font_default_character_set_use_default_range (_tmp9_);
	_tmp10_ = o;
	_tmp11_ = gr;
	bird_font_overview_set_current_glyph_range (_tmp10_, _tmp11_);
	_tmp12_ = bird_font_main_window_get_tab_bar ();
	_tmp13_ = _tmp12_;
	bird_font_tab_bar_select_tab_name (_tmp13_, "Overview");
	_g_object_unref0 (_tmp13_);
	_bird_font_glyph_range_unref0 (gr);
	_g_object_unref0 (o);
}

void
bird_font_menu_tab_show_all_available_characters (void)
{
	BirdFontTabBar* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontOverview* _tmp2_;
	BirdFontOverview* _tmp3_;
	BirdFontFont* _tmp4_;
	BirdFontFont* _tmp5_;
	gboolean _tmp6_;
	BirdFontTabBar* _tmp7_;
	BirdFontTabBar* _tmp8_;
	_tmp0_ = bird_font_main_window_get_tab_bar ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_overview_new (NULL, TRUE, TRUE);
	_tmp3_ = _tmp2_;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	_tmp4_ = bird_font_bird_font_get_current_font ();
	_tmp5_ = _tmp4_;
	_tmp6_ = !_tmp5_->initialised;
	_g_object_unref0 (_tmp5_);
	if (_tmp6_) {
		bird_font_menu_tab_new_file ();
	}
	_tmp7_ = bird_font_main_window_get_tab_bar ();
	_tmp8_ = _tmp7_;
	bird_font_tab_bar_select_tab_name (_tmp8_, "Overview");
	_g_object_unref0 (_tmp8_);
	bird_font_overview_tools_show_all_available_characters ();
}

void
bird_font_menu_tab_show_background_tab (void)
{
	BirdFontBackgroundTab* bt = NULL;
	BirdFontBackgroundTab* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontTabBar* _tmp2_;
	BirdFontBackgroundTab* _tmp3_;
	if (bird_font_menu_tab_suppress_event) {
		bird_font_warn_if_test ("Event suppressed");
		_g_object_unref0 (bt);
		return;
	}
	_tmp0_ = bird_font_background_tab_get_instance ();
	_g_object_unref0 (bt);
	bt = _tmp0_;
	_tmp1_ = bird_font_main_window_get_tab_bar ();
	_tmp2_ = _tmp1_;
	_tmp3_ = bt;
	bird_font_tab_bar_add_unique_tab (_tmp2_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp2_);
	_g_object_unref0 (bt);
}

void
bird_font_menu_tab_show_settings_tab (void)
{
	BirdFontTabBar* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontSettingsTab* _tmp2_;
	BirdFontSettingsTab* _tmp3_;
	_tmp0_ = bird_font_main_window_get_tab_bar ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_settings_tab_new ();
	_tmp3_ = _tmp2_;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

void
bird_font_menu_tab_show_theme_tab (void)
{
	BirdFontTabBar* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontThemeTab* _tmp2_;
	BirdFontThemeTab* _tmp3_;
	_tmp0_ = bird_font_main_window_get_tab_bar ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_theme_tab_new ();
	_tmp3_ = _tmp2_;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

void
bird_font_menu_tab_show_guide_tab (void)
{
	BirdFontTabBar* _tmp0_;
	BirdFontTabBar* _tmp1_;
	BirdFontGuideTab* _tmp2_;
	BirdFontGuideTab* _tmp3_;
	_tmp0_ = bird_font_main_window_get_tab_bar ();
	_tmp1_ = _tmp0_;
	_tmp2_ = bird_font_guide_tab_new ();
	_tmp3_ = _tmp2_;
	bird_font_tab_bar_add_unique_tab (_tmp1_, (BirdFontFontDisplay*) _tmp3_, TRUE);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

static void
bird_font_menu_tab_class_init (BirdFontMenuTabClass * klass,
                               gpointer klass_data)
{
	bird_font_menu_tab_parent_class = g_type_class_peek_parent (klass);
	((BirdFontFontDisplayClass *) klass)->get_label = (gchar* (*) (BirdFontFontDisplay*)) bird_font_menu_tab_real_get_label;
	((BirdFontFontDisplayClass *) klass)->get_name = (gchar* (*) (BirdFontFontDisplay*)) bird_font_menu_tab_real_get_name;
	G_OBJECT_CLASS (klass)->finalize = bird_font_menu_tab_finalize;
	g_rec_mutex_init (&__lock_bird_font_menu_tab_bird_font_menu_tab_suppress_event);
}

static void
bird_font_menu_tab_instance_init (BirdFontMenuTab * self,
                                  gpointer klass)
{
}

static void
bird_font_menu_tab_finalize (GObject * obj)
{
	BirdFontMenuTab * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BIRD_FONT_TYPE_MENU_TAB, BirdFontMenuTab);
	G_OBJECT_CLASS (bird_font_menu_tab_parent_class)->finalize (obj);
}

static GType
bird_font_menu_tab_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BirdFontMenuTabClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bird_font_menu_tab_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BirdFontMenuTab), 0, (GInstanceInitFunc) bird_font_menu_tab_instance_init, NULL };
	GType bird_font_menu_tab_type_id;
	bird_font_menu_tab_type_id = g_type_register_static (BIRD_FONT_TYPE_FONT_DISPLAY, "BirdFontMenuTab", &g_define_type_info, 0);
	return bird_font_menu_tab_type_id;
}

GType
bird_font_menu_tab_get_type (void)
{
	static volatile gsize bird_font_menu_tab_type_id__once = 0;
	if (g_once_init_enter (&bird_font_menu_tab_type_id__once)) {
		GType bird_font_menu_tab_type_id;
		bird_font_menu_tab_type_id = bird_font_menu_tab_get_type_once ();
		g_once_init_leave (&bird_font_menu_tab_type_id__once, bird_font_menu_tab_type_id);
	}
	return bird_font_menu_tab_type_id__once;
}

