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

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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gobject/gvaluecollector.h>
#include <gio/gio.h>
#include <gee.h>
#include <granite-7.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <gdk/gdk.h>
#include <pango/pango.h>
#include <glib/gstdio.h>
#include <gtksourceview/gtksource.h>
#include <libxml/tree.h>
#include <libxml/parser.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

typedef enum  {
	TAB_ADD_REASON_NEW,
	TAB_ADD_REASON_OPEN,
	TAB_ADD_REASON_IMPORT,
	TAB_ADD_REASON_LOAD
} TabAddReason;

#define TYPE_TAB_ADD_REASON (tab_add_reason_get_type ())
typedef enum  {
	PROPERTY_GRAB_NONE,
	PROPERTY_GRAB_FIRST,
	PROPERTY_GRAB_NOTE
} PropertyGrab;

#define TYPE_PROPERTY_GRAB (property_grab_get_type ())
typedef enum  {
	SEARCH_OPTIONS_NODES,
	SEARCH_OPTIONS_CONNECTIONS,
	SEARCH_OPTIONS_CALLOUTS,
	SEARCH_OPTIONS_GROUPS,
	SEARCH_OPTIONS_TITLES,
	SEARCH_OPTIONS_NOTES,
	SEARCH_OPTIONS_FOLDED,
	SEARCH_OPTIONS_UNFOLDED,
	SEARCH_OPTIONS_TASKS,
	SEARCH_OPTIONS_NONTASKS,
	SEARCH_OPTIONS_NUM
} SearchOptions;

#define TYPE_SEARCH_OPTIONS (search_options_get_type ())

#define TYPE_SHORTCUT_TOOLTIP (shortcut_tooltip_get_type ())
#define SHORTCUT_TOOLTIP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SHORTCUT_TOOLTIP, ShortcutTooltip))
#define SHORTCUT_TOOLTIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SHORTCUT_TOOLTIP, ShortcutTooltipClass))
#define IS_SHORTCUT_TOOLTIP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SHORTCUT_TOOLTIP))
#define IS_SHORTCUT_TOOLTIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SHORTCUT_TOOLTIP))
#define SHORTCUT_TOOLTIP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SHORTCUT_TOOLTIP, ShortcutTooltipClass))

typedef struct _ShortcutTooltip ShortcutTooltip;
typedef struct _ShortcutTooltipClass ShortcutTooltipClass;
typedef struct _ShortcutTooltipPrivate ShortcutTooltipPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_SHORTCUT (shortcut_get_type ())
#define SHORTCUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SHORTCUT, Shortcut))
#define SHORTCUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SHORTCUT, ShortcutClass))
#define IS_SHORTCUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SHORTCUT))
#define IS_SHORTCUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SHORTCUT))
#define SHORTCUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SHORTCUT, ShortcutClass))

typedef struct _Shortcut Shortcut;
typedef struct _ShortcutClass ShortcutClass;
typedef struct _ParamSpecShortcutTooltip ParamSpecShortcutTooltip;
typedef void (*AfterLoadTabFunc) (gpointer user_data);

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;
typedef struct _MainWindowPrivate MainWindowPrivate;

#define TYPE_EXPORTER (exporter_get_type ())
#define EXPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXPORTER, Exporter))
#define EXPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXPORTER, ExporterClass))
#define IS_EXPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXPORTER))
#define IS_EXPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXPORTER))
#define EXPORTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXPORTER, ExporterClass))

typedef struct _Exporter Exporter;
typedef struct _ExporterClass ExporterClass;

#define TYPE_THEME_EDITOR (theme_editor_get_type ())
#define THEME_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THEME_EDITOR, ThemeEditor))
#define THEME_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THEME_EDITOR, ThemeEditorClass))
#define IS_THEME_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THEME_EDITOR))
#define IS_THEME_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THEME_EDITOR))
#define THEME_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THEME_EDITOR, ThemeEditorClass))

typedef struct _ThemeEditor ThemeEditor;
typedef struct _ThemeEditorClass ThemeEditorClass;

#define TYPE_EXPORTS (exports_get_type ())
#define EXPORTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXPORTS, Exports))
#define EXPORTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXPORTS, ExportsClass))
#define IS_EXPORTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXPORTS))
#define IS_EXPORTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXPORTS))
#define EXPORTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXPORTS, ExportsClass))

typedef struct _Exports Exports;
typedef struct _ExportsClass ExportsClass;

#define TYPE_UNICODE_INSERT (unicode_insert_get_type ())
#define UNICODE_INSERT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNICODE_INSERT, UnicodeInsert))
#define UNICODE_INSERT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNICODE_INSERT, UnicodeInsertClass))
#define IS_UNICODE_INSERT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNICODE_INSERT))
#define IS_UNICODE_INSERT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNICODE_INSERT))
#define UNICODE_INSERT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNICODE_INSERT, UnicodeInsertClass))

typedef struct _UnicodeInsert UnicodeInsert;
typedef struct _UnicodeInsertClass UnicodeInsertClass;

#define TYPE_BRAINDUMP (braindump_get_type ())
#define BRAINDUMP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BRAINDUMP, Braindump))
#define BRAINDUMP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BRAINDUMP, BraindumpClass))
#define IS_BRAINDUMP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BRAINDUMP))
#define IS_BRAINDUMP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BRAINDUMP))
#define BRAINDUMP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BRAINDUMP, BraindumpClass))

typedef struct _Braindump Braindump;
typedef struct _BraindumpClass BraindumpClass;

#define TYPE_SHORTCUTS (shortcuts_get_type ())
#define SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SHORTCUTS, Shortcuts))
#define SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SHORTCUTS, ShortcutsClass))
#define IS_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SHORTCUTS))
#define IS_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SHORTCUTS))
#define SHORTCUTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SHORTCUTS, ShortcutsClass))

typedef struct _Shortcuts Shortcuts;
typedef struct _ShortcutsClass ShortcutsClass;
typedef enum  {
	KEY_COMMAND_DO_NOTHING,
	KEY_COMMAND_GENERAL_START,
	KEY_COMMAND_FILE_START,
	KEY_COMMAND_FILE_NEW,
	KEY_COMMAND_FILE_OPEN,
	KEY_COMMAND_FILE_OPEN_DIR,
	KEY_COMMAND_FILE_SAVE,
	KEY_COMMAND_FILE_SAVE_AS,
	KEY_COMMAND_FILE_PRINT,
	KEY_COMMAND_FILE_END,
	KEY_COMMAND_TAB_START,
	KEY_COMMAND_TAB_GOTO_NEXT,
	KEY_COMMAND_TAB_GOTO_PREV,
	KEY_COMMAND_TAB_CLOSE_CURRENT,
	KEY_COMMAND_TAB_END,
	KEY_COMMAND_UNDO_START,
	KEY_COMMAND_UNDO_ACTION,
	KEY_COMMAND_REDO_ACTION,
	KEY_COMMAND_UNDO_END,
	KEY_COMMAND_ZOOM_START,
	KEY_COMMAND_ZOOM_IN,
	KEY_COMMAND_ZOOM_OUT,
	KEY_COMMAND_ZOOM_FIT,
	KEY_COMMAND_ZOOM_SELECTED,
	KEY_COMMAND_ZOOM_ACTUAL,
	KEY_COMMAND_ZOOM_END,
	KEY_COMMAND_SIDEBAR_START,
	KEY_COMMAND_SHOW_CURRENT_SIDEBAR,
	KEY_COMMAND_SHOW_STYLE_SIDEBAR,
	KEY_COMMAND_SHOW_TAG_SIDEBAR,
	KEY_COMMAND_SHOW_STICKER_SIDEBAR,
	KEY_COMMAND_SHOW_MAP_SIDEBAR,
	KEY_COMMAND_SHOW_CURRENT_INFO,
	KEY_COMMAND_SIDEBAR_END,
	KEY_COMMAND_MAP_START,
	KEY_COMMAND_TOGGLE_CONNECTIONS,
	KEY_COMMAND_TOGGLE_CALLOUTS,
	KEY_COMMAND_BALANCE_NODES,
	KEY_COMMAND_FOLD_COMPLETED_TASKS,
	KEY_COMMAND_UNFOLD_ALL_NODES,
	KEY_COMMAND_MAP_END,
	KEY_COMMAND_MISCELLANEOUS_START,
	KEY_COMMAND_SHOW_PREFERENCES,
	KEY_COMMAND_SHOW_SHORTCUTS,
	KEY_COMMAND_SHOW_CONTEXTUAL_MENU,
	KEY_COMMAND_SHOW_FIND,
	KEY_COMMAND_SHOW_ABOUT,
	KEY_COMMAND_TOGGLE_BRAINDUMP,
	KEY_COMMAND_TOGGLE_FOCUS_MODE,
	KEY_COMMAND_EDIT_NOTE,
	KEY_COMMAND_EDIT_SELECTED,
	KEY_COMMAND_SHOW_SELECTED,
	KEY_COMMAND_REMOVE_STICKER_SELECTED,
	KEY_COMMAND_QUIT,
	KEY_COMMAND_MISCELLANEOUS_END,
	KEY_COMMAND_CONTROL_PRESSED,
	KEY_COMMAND_ESCAPE,
	KEY_COMMAND_GENERAL_END,
	KEY_COMMAND_NODE_START,
	KEY_COMMAND_NODE_EXIST_START,
	KEY_COMMAND_NODE_ADD_ROOT,
	KEY_COMMAND_NODE_ADD_SIBLING_AFTER,
	KEY_COMMAND_NODE_ADD_SIBLING_BEFORE,
	KEY_COMMAND_NODE_ADD_CHILD,
	KEY_COMMAND_NODE_ADD_PARENT,
	KEY_COMMAND_NODE_QUICK_ENTRY_INSERT,
	KEY_COMMAND_NODE_QUICK_ENTRY_REPLACE,
	KEY_COMMAND_NODE_REMOVE,
	KEY_COMMAND_NODE_REMOVE_ONLY,
	KEY_COMMAND_NODE_EXIST_END,
	KEY_COMMAND_NODE_CLIPBOARD_START,
	KEY_COMMAND_NODE_PASTE_NODE_LINK,
	KEY_COMMAND_NODE_PASTE_REPLACE,
	KEY_COMMAND_NODE_CLIPBOARD_END,
	KEY_COMMAND_NODE_VIEW_START,
	KEY_COMMAND_NODE_CENTER,
	KEY_COMMAND_NODE_VIEW_END,
	KEY_COMMAND_NODE_CHANGE_START,
	KEY_COMMAND_NODE_CHANGE_TASK,
	KEY_COMMAND_NODE_CHANGE_IMAGE,
	KEY_COMMAND_NODE_REMOVE_IMAGE,
	KEY_COMMAND_NODE_CHANGE_LINK_COLOR,
	KEY_COMMAND_NODE_RANDOMIZE_LINK_COLOR,
	KEY_COMMAND_NODE_REPARENT_LINK_COLOR,
	KEY_COMMAND_NODE_TOGGLE_FOLDS_SHALLOW,
	KEY_COMMAND_NODE_TOGGLE_FOLDS_DEEP,
	KEY_COMMAND_NODE_TOGGLE_LINKS,
	KEY_COMMAND_NODE_ADD_GROUP,
	KEY_COMMAND_NODE_ADD_CONNECTION,
	KEY_COMMAND_NODE_TOGGLE_CALLOUT,
	KEY_COMMAND_NODE_TOGGLE_SEQUENCE,
	KEY_COMMAND_NODE_CHANGE_END,
	KEY_COMMAND_NODE_SELECT_START,
	KEY_COMMAND_NODE_SELECT_ROOT,
	KEY_COMMAND_NODE_SELECT_PARENT,
	KEY_COMMAND_NODE_SELECT_SIBLING_NEXT,
	KEY_COMMAND_NODE_SELECT_SIBLING_PREV,
	KEY_COMMAND_NODE_SELECT_CHILD,
	KEY_COMMAND_NODE_SELECT_CHILDREN,
	KEY_COMMAND_NODE_SELECT_TREE,
	KEY_COMMAND_NODE_SELECT_DOWN,
	KEY_COMMAND_NODE_SELECT_UP,
	KEY_COMMAND_NODE_SELECT_RIGHT,
	KEY_COMMAND_NODE_SELECT_LEFT,
	KEY_COMMAND_NODE_SELECT_LINKED,
	KEY_COMMAND_NODE_SELECT_CALLOUT,
	KEY_COMMAND_NODE_SELECT_CONNECTION,
	KEY_COMMAND_NODE_SELECT_END,
	KEY_COMMAND_NODE_MOVE_START,
	KEY_COMMAND_NODE_SWAP_RIGHT,
	KEY_COMMAND_NODE_SWAP_LEFT,
	KEY_COMMAND_NODE_SWAP_UP,
	KEY_COMMAND_NODE_SWAP_DOWN,
	KEY_COMMAND_NODE_SORT_ALPHABETICALLY,
	KEY_COMMAND_NODE_SORT_RANDOMLY,
	KEY_COMMAND_NODE_DETACH,
	KEY_COMMAND_NODE_MOVE_END,
	KEY_COMMAND_NODE_ALIGN_START,
	KEY_COMMAND_NODE_ALIGN_TOP,
	KEY_COMMAND_NODE_ALIGN_VCENTER,
	KEY_COMMAND_NODE_ALIGN_BOTTOM,
	KEY_COMMAND_NODE_ALIGN_LEFT,
	KEY_COMMAND_NODE_ALIGN_HCENTER,
	KEY_COMMAND_NODE_ALIGN_RIGHT,
	KEY_COMMAND_NODE_ALIGN_END,
	KEY_COMMAND_NODE_END,
	KEY_COMMAND_CALLOUT_START,
	KEY_COMMAND_CALLOUT_SELECT_START,
	KEY_COMMAND_CALLOUT_SELECT_NODE,
	KEY_COMMAND_CALLOUT_SELECT_END,
	KEY_COMMAND_CALLOUT_REMOVE,
	KEY_COMMAND_CALLOUT_END,
	KEY_COMMAND_CONNECTION_START,
	KEY_COMMAND_CONNECTION_EXIST_START,
	KEY_COMMAND_CONNECTION_REMOVE,
	KEY_COMMAND_CONNECTION_EXIST_END,
	KEY_COMMAND_CONNECTION_SELECT_START,
	KEY_COMMAND_CONNECTION_SELECT_FROM,
	KEY_COMMAND_CONNECTION_SELECT_TO,
	KEY_COMMAND_CONNECTION_SELECT_NEXT,
	KEY_COMMAND_CONNECTION_SELECT_PREV,
	KEY_COMMAND_CONNECTION_SELECT_END,
	KEY_COMMAND_CONNECTION_END,
	KEY_COMMAND_STICKER_START,
	KEY_COMMAND_STICKER_REMOVE,
	KEY_COMMAND_STICKER_END,
	KEY_COMMAND_GROUP_START,
	KEY_COMMAND_GROUP_CHANGE_START,
	KEY_COMMAND_GROUP_CHANGE_COLOR,
	KEY_COMMAND_GROUP_MERGE,
	KEY_COMMAND_GROUP_REMOVE,
	KEY_COMMAND_GROUP_CHANGE_END,
	KEY_COMMAND_GROUP_SELECT_START,
	KEY_COMMAND_GROUP_SELECT_MAIN,
	KEY_COMMAND_GROUP_SELECT_ALL,
	KEY_COMMAND_GROUP_SELECT_END,
	KEY_COMMAND_GROUP_END,
	KEY_COMMAND_EDIT_START,
	KEY_COMMAND_EDIT_TEXT_START,
	KEY_COMMAND_EDIT_INSERT_NEWLINE,
	KEY_COMMAND_EDIT_INSERT_TAB,
	KEY_COMMAND_EDIT_INSERT_EMOJI,
	KEY_COMMAND_EDIT_ESCAPE,
	KEY_COMMAND_EDIT_BACKSPACE,
	KEY_COMMAND_EDIT_DELETE,
	KEY_COMMAND_EDIT_REMOVE_WORD_NEXT,
	KEY_COMMAND_EDIT_REMOVE_WORD_PREV,
	KEY_COMMAND_EDIT_TEXT_END,
	KEY_COMMAND_EDIT_MARKDOWN_START,
	KEY_COMMAND_EDIT_HEADER1,
	KEY_COMMAND_EDIT_HEADER2,
	KEY_COMMAND_EDIT_HEADER3,
	KEY_COMMAND_EDIT_HEADER4,
	KEY_COMMAND_EDIT_HEADER5,
	KEY_COMMAND_EDIT_HEADER6,
	KEY_COMMAND_EDIT_BOLD,
	KEY_COMMAND_EDIT_ITALICS,
	KEY_COMMAND_EDIT_STRIKE,
	KEY_COMMAND_EDIT_CODE,
	KEY_COMMAND_EDIT_HIGHLIGHT,
	KEY_COMMAND_EDIT_SUPERSCRIPT,
	KEY_COMMAND_EDIT_SUBSCRIPT,
	KEY_COMMAND_EDIT_LINK,
	KEY_COMMAND_EDIT_MARKDOWN_END,
	KEY_COMMAND_EDIT_CLIPBOARD_START,
	KEY_COMMAND_EDIT_COPY,
	KEY_COMMAND_EDIT_CUT,
	KEY_COMMAND_EDIT_PASTE,
	KEY_COMMAND_EDIT_CLIPBOARD_END,
	KEY_COMMAND_EDIT_URL_START,
	KEY_COMMAND_EDIT_OPEN_URL,
	KEY_COMMAND_EDIT_ADD_URL,
	KEY_COMMAND_EDIT_EDIT_URL,
	KEY_COMMAND_EDIT_REMOVE_URL,
	KEY_COMMAND_EDIT_URL_END,
	KEY_COMMAND_EDIT_CURSOR_START,
	KEY_COMMAND_EDIT_CURSOR_CHAR_NEXT,
	KEY_COMMAND_EDIT_CURSOR_CHAR_PREV,
	KEY_COMMAND_EDIT_CURSOR_UP,
	KEY_COMMAND_EDIT_CURSOR_DOWN,
	KEY_COMMAND_EDIT_CURSOR_WORD_NEXT,
	KEY_COMMAND_EDIT_CURSOR_WORD_PREV,
	KEY_COMMAND_EDIT_CURSOR_FIRST,
	KEY_COMMAND_EDIT_CURSOR_LAST,
	KEY_COMMAND_EDIT_CURSOR_LINESTART,
	KEY_COMMAND_EDIT_CURSOR_LINEEND,
	KEY_COMMAND_EDIT_CURSOR_END,
	KEY_COMMAND_EDIT_SELECT_START,
	KEY_COMMAND_EDIT_SELECT_CHAR_NEXT,
	KEY_COMMAND_EDIT_SELECT_CHAR_PREV,
	KEY_COMMAND_EDIT_SELECT_UP,
	KEY_COMMAND_EDIT_SELECT_DOWN,
	KEY_COMMAND_EDIT_SELECT_WORD_NEXT,
	KEY_COMMAND_EDIT_SELECT_WORD_PREV,
	KEY_COMMAND_EDIT_SELECT_START_UP,
	KEY_COMMAND_EDIT_SELECT_START_HOME,
	KEY_COMMAND_EDIT_SELECT_END_DOWN,
	KEY_COMMAND_EDIT_SELECT_END_END,
	KEY_COMMAND_EDIT_SELECT_LINESTART,
	KEY_COMMAND_EDIT_SELECT_LINEEND,
	KEY_COMMAND_EDIT_SELECT_ALL,
	KEY_COMMAND_EDIT_SELECT_NONE,
	KEY_COMMAND_EDIT_SELECT_END,
	KEY_COMMAND_EDIT_MISC_START,
	KEY_COMMAND_EDIT_RETURN,
	KEY_COMMAND_EDIT_SHIFT_RETURN,
	KEY_COMMAND_EDIT_TAB,
	KEY_COMMAND_EDIT_SHIFT_TAB,
	KEY_COMMAND_EDIT_MISC_END,
	KEY_COMMAND_EDIT_END,
	KEY_COMMAND_NUM
} KeyCommand;

#define TYPE_KEY_COMMAND (key_command_get_type ())

#define TYPE_TEMPLATES (templates_get_type ())
#define TEMPLATES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEMPLATES, Templates))
#define TEMPLATES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEMPLATES, TemplatesClass))
#define IS_TEMPLATES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEMPLATES))
#define IS_TEMPLATES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEMPLATES))
#define TEMPLATES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEMPLATES, TemplatesClass))

typedef struct _Templates Templates;
typedef struct _TemplatesClass TemplatesClass;

#define TYPE_THEMES (themes_get_type ())
#define THEMES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THEMES, Themes))
#define THEMES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THEMES, ThemesClass))
#define IS_THEMES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THEMES))
#define IS_THEMES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THEMES))
#define THEMES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THEMES, ThemesClass))

typedef struct _Themes Themes;
typedef struct _ThemesClass ThemesClass;
enum  {
	MAIN_WINDOW_0_PROPERTY,
	MAIN_WINDOW_THEMES_PROPERTY,
	MAIN_WINDOW_SETTINGS_PROPERTY,
	MAIN_WINDOW_TEXT_SIZE_PROPERTY,
	MAIN_WINDOW_EXPORTS_PROPERTY,
	MAIN_WINDOW_UNICODER_PROPERTY,
	MAIN_WINDOW_BRAINDUMP_PROPERTY,
	MAIN_WINDOW_SHORTCUTS_PROPERTY,
	MAIN_WINDOW_TEMPLATES_PROPERTY,
	MAIN_WINDOW_NUM_PROPERTIES
};
static GParamSpec* main_window_properties[MAIN_WINDOW_NUM_PROPERTIES];
#define _exports_unref0(var) ((var == NULL) ? NULL : (var = (exports_unref (var), NULL)))
#define _unicode_insert_unref0(var) ((var == NULL) ? NULL : (var = (unicode_insert_unref (var), NULL)))
#define _shortcuts_unref0(var) ((var == NULL) ? NULL : (var = (shortcuts_unref (var), NULL)))
#define _templates_unref0(var) ((var == NULL) ? NULL : (var = (templates_unref (var), NULL)))
typedef struct _Block30Data Block30Data;
typedef enum  {
	BRAINDUMP_CHANGE_TYPE_ADD,
	BRAINDUMP_CHANGE_TYPE_REMOVE,
	BRAINDUMP_CHANGE_TYPE_CLEAR
} BraindumpChangeType;

#define TYPE_BRAINDUMP_CHANGE_TYPE (braindump_change_type_get_type ())

#define TYPE_MIND_MAP (mind_map_get_type ())
#define MIND_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MIND_MAP, MindMap))
#define MIND_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MIND_MAP, MindMapClass))
#define IS_MIND_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MIND_MAP))
#define IS_MIND_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MIND_MAP))
#define MIND_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MIND_MAP, MindMapClass))

typedef struct _MindMap MindMap;
typedef struct _MindMapClass MindMapClass;

#define TYPE_MAP_MODEL (map_model_get_type ())
#define MAP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAP_MODEL, MapModel))
#define MAP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAP_MODEL, MapModelClass))
#define IS_MAP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAP_MODEL))
#define IS_MAP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAP_MODEL))
#define MAP_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAP_MODEL, MapModelClass))

typedef struct _MapModel MapModel;
typedef struct _MapModelClass MapModelClass;
#define _mind_map_unref0(var) ((var == NULL) ? NULL : (var = (mind_map_unref (var), NULL)))

#define TYPE_DRAW_AREA (draw_area_get_type ())
#define DRAW_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DRAW_AREA, DrawArea))
#define DRAW_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DRAW_AREA, DrawAreaClass))
#define IS_DRAW_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DRAW_AREA))
#define IS_DRAW_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DRAW_AREA))
#define DRAW_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DRAW_AREA, DrawAreaClass))

typedef struct _DrawArea DrawArea;
typedef struct _DrawAreaClass DrawAreaClass;

#define TYPE_CURRENT_INSPECTOR (current_inspector_get_type ())
#define CURRENT_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CURRENT_INSPECTOR, CurrentInspector))
#define CURRENT_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CURRENT_INSPECTOR, CurrentInspectorClass))
#define IS_CURRENT_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CURRENT_INSPECTOR))
#define IS_CURRENT_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CURRENT_INSPECTOR))
#define CURRENT_INSPECTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CURRENT_INSPECTOR, CurrentInspectorClass))

typedef struct _CurrentInspector CurrentInspector;
typedef struct _CurrentInspectorClass CurrentInspectorClass;

#define TYPE_ANIMATOR (animator_get_type ())
#define ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ANIMATOR, Animator))
#define ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ANIMATOR, AnimatorClass))
#define IS_ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ANIMATOR))
#define IS_ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ANIMATOR))
#define ANIMATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ANIMATOR, AnimatorClass))

typedef struct _Animator Animator;
typedef struct _AnimatorClass AnimatorClass;

#define TYPE_TEXT_PARSER (text_parser_get_type ())
#define TEXT_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEXT_PARSER, TextParser))
#define TEXT_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEXT_PARSER, TextParserClass))
#define IS_TEXT_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEXT_PARSER))
#define IS_TEXT_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEXT_PARSER))
#define TEXT_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEXT_PARSER, TextParserClass))

typedef struct _TextParser TextParser;
typedef struct _TextParserClass TextParserClass;

#define TYPE_URL_PARSER (url_parser_get_type ())
#define URL_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_URL_PARSER, UrlParser))
#define URL_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_URL_PARSER, UrlParserClass))
#define IS_URL_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_URL_PARSER))
#define IS_URL_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_URL_PARSER))
#define URL_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_URL_PARSER, UrlParserClass))

typedef struct _UrlParser UrlParser;
typedef struct _UrlParserClass UrlParserClass;

#define TYPE_UNICODE_PARSER (unicode_parser_get_type ())
#define UNICODE_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNICODE_PARSER, UnicodeParser))
#define UNICODE_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNICODE_PARSER, UnicodeParserClass))
#define IS_UNICODE_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNICODE_PARSER))
#define IS_UNICODE_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNICODE_PARSER))
#define UNICODE_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNICODE_PARSER, UnicodeParserClass))

typedef struct _UnicodeParser UnicodeParser;
typedef struct _UnicodeParserClass UnicodeParserClass;

#define TYPE_UNDO_BUFFER (undo_buffer_get_type ())
#define UNDO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_BUFFER, UndoBuffer))
#define UNDO_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_BUFFER, UndoBufferClass))
#define IS_UNDO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_BUFFER))
#define IS_UNDO_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_BUFFER))
#define UNDO_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_BUFFER, UndoBufferClass))

typedef struct _UndoBuffer UndoBuffer;
typedef struct _UndoBufferClass UndoBufferClass;

#define TYPE_DOCUMENT (document_get_type ())
#define DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DOCUMENT, Document))
#define DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DOCUMENT, DocumentClass))
#define IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DOCUMENT))
#define IS_DOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DOCUMENT))
#define DOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DOCUMENT, DocumentClass))

typedef struct _Document Document;
typedef struct _DocumentClass DocumentClass;
typedef struct _Block31Data Block31Data;

#define TYPE_UNDO_TEXT_BUFFER (undo_text_buffer_get_type ())
#define UNDO_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_TEXT_BUFFER, UndoTextBuffer))
#define UNDO_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_TEXT_BUFFER, UndoTextBufferClass))
#define IS_UNDO_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_TEXT_BUFFER))
#define IS_UNDO_TEXT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_TEXT_BUFFER))
#define UNDO_TEXT_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_TEXT_BUFFER, UndoTextBufferClass))

typedef struct _UndoTextBuffer UndoTextBuffer;
typedef struct _UndoTextBufferClass UndoTextBufferClass;

#define TYPE_TAGS (tags_get_type ())
#define TAGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAGS, Tags))
#define TAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAGS, TagsClass))
#define IS_TAGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAGS))
#define IS_TAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAGS))
#define TAGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAGS, TagsClass))

typedef struct _Tags Tags;
typedef struct _TagsClass TagsClass;

#define TYPE_NODE (node_get_type ())
#define NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE, Node))
#define NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE, NodeClass))
#define IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE))
#define IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE))
#define NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE, NodeClass))

typedef struct _Node Node;
typedef struct _NodeClass NodeClass;

#define TYPE_CONNECTION (connection_get_type ())
#define CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONNECTION, Connection))
#define CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONNECTION, ConnectionClass))
#define IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONNECTION))
#define IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONNECTION))
#define CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONNECTION, ConnectionClass))

typedef struct _Connection Connection;
typedef struct _ConnectionClass ConnectionClass;

#define TYPE_CALLOUT (callout_get_type ())
#define CALLOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CALLOUT, Callout))
#define CALLOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CALLOUT, CalloutClass))
#define IS_CALLOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CALLOUT))
#define IS_CALLOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CALLOUT))
#define CALLOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CALLOUT, CalloutClass))

typedef struct _Callout Callout;
typedef struct _CalloutClass CalloutClass;

#define TYPE_NODE_GROUP (node_group_get_type ())
#define NODE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_GROUP, NodeGroup))
#define NODE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_GROUP, NodeGroupClass))
#define IS_NODE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_GROUP))
#define IS_NODE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_GROUP))
#define NODE_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_GROUP, NodeGroupClass))

typedef struct _NodeGroup NodeGroup;
typedef struct _NodeGroupClass NodeGroupClass;
typedef struct _Block32Data Block32Data;

#define TYPE_MODE_BUTTONS (mode_buttons_get_type ())
#define MODE_BUTTONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MODE_BUTTONS, ModeButtons))
#define MODE_BUTTONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MODE_BUTTONS, ModeButtonsClass))
#define IS_MODE_BUTTONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MODE_BUTTONS))
#define IS_MODE_BUTTONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MODE_BUTTONS))
#define MODE_BUTTONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MODE_BUTTONS, ModeButtonsClass))

typedef struct _ModeButtons ModeButtons;
typedef struct _ModeButtonsClass ModeButtonsClass;
typedef struct _Block33Data Block33Data;

#define TYPE_STYLE_INSPECTOR (style_inspector_get_type ())
#define STYLE_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STYLE_INSPECTOR, StyleInspector))
#define STYLE_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STYLE_INSPECTOR, StyleInspectorClass))
#define IS_STYLE_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STYLE_INSPECTOR))
#define IS_STYLE_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STYLE_INSPECTOR))
#define STYLE_INSPECTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STYLE_INSPECTOR, StyleInspectorClass))

typedef struct _StyleInspector StyleInspector;
typedef struct _StyleInspectorClass StyleInspectorClass;

#define TYPE_TAG_INSPECTOR (tag_inspector_get_type ())
#define TAG_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_INSPECTOR, TagInspector))
#define TAG_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_INSPECTOR, TagInspectorClass))
#define IS_TAG_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_INSPECTOR))
#define IS_TAG_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_INSPECTOR))
#define TAG_INSPECTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_INSPECTOR, TagInspectorClass))

typedef struct _TagInspector TagInspector;
typedef struct _TagInspectorClass TagInspectorClass;

#define TYPE_STICKER_INSPECTOR (sticker_inspector_get_type ())
#define STICKER_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STICKER_INSPECTOR, StickerInspector))
#define STICKER_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STICKER_INSPECTOR, StickerInspectorClass))
#define IS_STICKER_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STICKER_INSPECTOR))
#define IS_STICKER_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STICKER_INSPECTOR))
#define STICKER_INSPECTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STICKER_INSPECTOR, StickerInspectorClass))

typedef struct _StickerInspector StickerInspector;
typedef struct _StickerInspectorClass StickerInspectorClass;

#define TYPE_MAP_INSPECTOR (map_inspector_get_type ())
#define MAP_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAP_INSPECTOR, MapInspector))
#define MAP_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAP_INSPECTOR, MapInspectorClass))
#define IS_MAP_INSPECTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAP_INSPECTOR))
#define IS_MAP_INSPECTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAP_INSPECTOR))
#define MAP_INSPECTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAP_INSPECTOR, MapInspectorClass))

typedef struct _MapInspector MapInspector;
typedef struct _MapInspectorClass MapInspectorClass;
typedef struct _Block34Data Block34Data;
typedef void (*MainWindowOverwriteFunc) (gboolean overwrite, gpointer user_data);
typedef struct _Block35Data Block35Data;
typedef struct _Block36Data Block36Data;

#define TYPE_EXPORT (export_get_type ())
#define EXPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXPORT, Export))
#define EXPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXPORT, ExportClass))
#define IS_EXPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXPORT))
#define IS_EXPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXPORT))
#define EXPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXPORT, ExportClass))

typedef struct _Export Export;
typedef struct _ExportClass ExportClass;
#define _export_unref0(var) ((var == NULL) ? NULL : (var = (export_unref (var), NULL)))
typedef enum  {
	UPGRADE_ACTION_OVERRIDE,
	UPGRADE_ACTION_SAVE_ORIG,
	UPGRADE_ACTION_READ_ONLY,
	UPGRADE_ACTION_NUM
} UpgradeAction;

#define TYPE_UPGRADE_ACTION (upgrade_action_get_type ())
typedef void (*AfterLoadFunc) (gboolean loaded, const gchar* msg, gpointer user_data);
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _Block37Data Block37Data;
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))

#define TYPE_CANVAS_TEXT (canvas_text_get_type ())
#define CANVAS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CANVAS_TEXT, CanvasText))
#define CANVAS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CANVAS_TEXT, CanvasTextClass))
#define IS_CANVAS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CANVAS_TEXT))
#define IS_CANVAS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CANVAS_TEXT))
#define CANVAS_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CANVAS_TEXT, CanvasTextClass))

typedef struct _CanvasText CanvasText;
typedef struct _CanvasTextClass CanvasTextClass;

#define TYPE_FORMATTED_TEXT (formatted_text_get_type ())
#define FORMATTED_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORMATTED_TEXT, FormattedText))
#define FORMATTED_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORMATTED_TEXT, FormattedTextClass))
#define IS_FORMATTED_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORMATTED_TEXT))
#define IS_FORMATTED_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORMATTED_TEXT))
#define FORMATTED_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORMATTED_TEXT, FormattedTextClass))

typedef struct _FormattedText FormattedText;
typedef struct _FormattedTextClass FormattedTextClass;

#define TYPE_NOTE_VIEW (note_view_get_type ())
#define NOTE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NOTE_VIEW, NoteView))
#define NOTE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NOTE_VIEW, NoteViewClass))
#define IS_NOTE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NOTE_VIEW))
#define IS_NOTE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NOTE_VIEW))
#define NOTE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NOTE_VIEW, NoteViewClass))

typedef struct _NoteView NoteView;
typedef struct _NoteViewClass NoteViewClass;

#define TYPE_THEME (theme_get_type ())
#define THEME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THEME, Theme))
#define THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THEME, ThemeClass))
#define IS_THEME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THEME))
#define IS_THEME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THEME))
#define THEME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THEME, ThemeClass))

typedef struct _Theme Theme;
typedef struct _ThemeClass ThemeClass;

#define TYPE_EXPORT_PRINT (export_print_get_type ())
#define EXPORT_PRINT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXPORT_PRINT, ExportPrint))
#define EXPORT_PRINT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXPORT_PRINT, ExportPrintClass))
#define IS_EXPORT_PRINT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXPORT_PRINT))
#define IS_EXPORT_PRINT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXPORT_PRINT))
#define EXPORT_PRINT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXPORT_PRINT, ExportPrintClass))

typedef struct _ExportPrint ExportPrint;
typedef struct _ExportPrintClass ExportPrintClass;

#define TYPE_PREFERENCES (preferences_get_type ())
#define PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PREFERENCES, Preferences))
#define PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PREFERENCES, PreferencesClass))
#define IS_PREFERENCES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PREFERENCES))
#define IS_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PREFERENCES))
#define PREFERENCES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PREFERENCES, PreferencesClass))

typedef struct _Preferences Preferences;
typedef struct _PreferencesClass PreferencesClass;

#define TYPE_ABOUT (about_get_type ())
#define ABOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ABOUT, About))
#define ABOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ABOUT, AboutClass))
#define IS_ABOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ABOUT))
#define IS_ABOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ABOUT))
#define ABOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ABOUT, AboutClass))

typedef struct _About About;
typedef struct _AboutClass AboutClass;
#define _about_unref0(var) ((var == NULL) ? NULL : (var = (about_unref (var), NULL)))
#define _xmlFreeDoc0(var) ((var == NULL) ? NULL : (var = (xmlFreeDoc (var), NULL)))
typedef struct _Block38Data Block38Data;
typedef struct _Block39Data Block39Data;
typedef void (*KeyCommandFunc) (MindMap* map, gboolean key_activated, gpointer user_data);
#define _shortcut_unref0(var) ((var == NULL) ? NULL : (var = (shortcut_unref (var), NULL)))
#define _shortcut_tooltip_unref0(var) ((var == NULL) ? NULL : (var = (shortcut_tooltip_unref (var), NULL)))
typedef void (*MainWindowChangedFunc) (gpointer user_data);
enum  {
	MAIN_WINDOW_CANVAS_CHANGED_SIGNAL,
	MAIN_WINDOW_NUM_SIGNALS
};
static guint main_window_signals[MAIN_WINDOW_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _ShortcutTooltip {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ShortcutTooltipPrivate * priv;
};

struct _ShortcutTooltipClass {
	GTypeClass parent_class;
	void (*finalize) (ShortcutTooltip *self);
};

struct _ShortcutTooltipPrivate {
	GtkWidget* _widget;
	gchar* _label;
};

struct _ParamSpecShortcutTooltip {
	GParamSpec parent_instance;
};

struct _MainWindow {
	GtkApplicationWindow parent_instance;
	MainWindowPrivate * priv;
};

struct _MainWindowClass {
	GtkApplicationWindowClass parent_class;
};

struct _MainWindowPrivate {
	GSettings* _settings;
	GtkHeaderBar* _header;
	GtkLabel* _title;
	GtkNotebook* _nb;
	GtkRevealer* _inspector;
	GtkPaned* _pane;
	GtkNotebook* _inspector_nb;
	GtkStack* _stack;
	GtkPopover* _zoom;
	GtkPopover* _search;
	GtkMenuButton* _search_btn;
	GtkSearchEntry* _search_entry;
	GtkTreeView* _search_list;
	GtkListStore* _search_items;
	GtkScrolledWindow* _search_scroll;
	GtkCheckButton* _search_nodes;
	GtkCheckButton* _search_connections;
	GtkCheckButton* _search_callouts;
	GtkCheckButton* _search_groups;
	GtkCheckButton* _search_titles;
	GtkCheckButton* _search_notes;
	GtkCheckButton* _search_folded;
	GtkCheckButton* _search_unfolded;
	GtkCheckButton* _search_tasks;
	GtkCheckButton* _search_nontasks;
	GtkSwitch* _search_all_tabs;
	Exporter* _exporter;
	GtkMenuButton* _zoom_btn;
	GtkScale* _zoom_scale;
	GtkButton* _zoom_in;
	GtkButton* _zoom_out;
	GtkButton* _undo_btn;
	GtkButton* _redo_btn;
	GtkToggleButton* _brain_btn;
	GtkToggleButton* _focus_btn;
	GtkToggleButton* _prop_btn;
	gchar* _prop_show;
	gchar* _prop_hide;
	gboolean _debug;
	ThemeEditor* _themer;
	GtkLabel* _scale_lbl;
	gint _text_size;
	Exports* _exports;
	UnicodeInsert* _unicoder;
	Braindump* _brain;
	Shortcuts* _shortcuts;
	GSimpleActionGroup* _actions;
	GeeHashMap* _shortcut_widgets;
	Templates* _templates;
	gboolean on_elementary;
	Themes* _themes;
};

struct _Block30Data {
	int _ref_count_;
	MainWindow* self;
	GraniteSettings* granite_settings;
};

struct _Block31Data {
	int _ref_count_;
	MainWindow* self;
	MindMap* map;
	GtkButton* tab_close;
	GtkRevealer* tab_revealer;
	gint tab_index;
};

struct _Block32Data {
	int _ref_count_;
	MainWindow* self;
	GtkPopoverMenu* popover;
};

struct _Block33Data {
	int _ref_count_;
	MainWindow* self;
	ModeButtons* sidebar_switcher;
};

struct _Block34Data {
	int _ref_count_;
	MainWindow* self;
	GraniteMessageDialog* dialog;
	MindMap* map;
};

struct _Block35Data {
	int _ref_count_;
	MainWindow* self;
	GraniteMessageDialog* dialog;
	MainWindowOverwriteFunc func;
	gpointer func_target;
};

struct _Block36Data {
	int _ref_count_;
	MainWindow* self;
	GtkFileDialog* dialog;
	gboolean dir;
};

struct _Block37Data {
	int _ref_count_;
	MainWindow* self;
	GtkFileDialog* dialog;
	MindMap* map;
	gboolean remove_after_save;
};

struct _Block38Data {
	int _ref_count_;
	MainWindow* self;
	GraniteMessageDialog* dialog;
	GtkDropDown* options;
	GtkLabel* description;
	GtkCheckButton* remember;
	AfterLoadTabFunc func;
	gpointer func_target;
};

struct _Block39Data {
	int _ref_count_;
	MainWindow* self;
	KeyCommand command;
};

static gint ShortcutTooltip_private_offset;
static gpointer shortcut_tooltip_parent_class = NULL;
static gint MainWindow_private_offset;
static gpointer main_window_parent_class = NULL;
VALA_EXTERN gboolean minder_debug;
VALA_EXTERN gboolean minder_debug_advance;
VALA_EXTERN GSettings* minder_settings;

VALA_EXTERN GType tab_add_reason_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType property_grab_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType search_options_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer shortcut_tooltip_ref (gpointer instance);
VALA_EXTERN void shortcut_tooltip_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_shortcut_tooltip (const gchar* name,
                                         const gchar* nick,
                                         const gchar* blurb,
                                         GType object_type,
                                         GParamFlags flags);
VALA_EXTERN void value_set_shortcut_tooltip (GValue* value,
                                 gpointer v_object);
VALA_EXTERN void value_take_shortcut_tooltip (GValue* value,
                                  gpointer v_object);
VALA_EXTERN gpointer value_get_shortcut_tooltip (const GValue* value);
VALA_EXTERN GType shortcut_tooltip_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShortcutTooltip, shortcut_tooltip_unref)
VALA_EXTERN ShortcutTooltip* shortcut_tooltip_new (GtkWidget* w,
                                       const gchar* l);
VALA_EXTERN ShortcutTooltip* shortcut_tooltip_construct (GType object_type,
                                             GtkWidget* w,
                                             const gchar* l);
VALA_EXTERN gpointer shortcut_ref (gpointer instance);
VALA_EXTERN void shortcut_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_shortcut (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags);
VALA_EXTERN void value_set_shortcut (GValue* value,
                         gpointer v_object);
VALA_EXTERN void value_take_shortcut (GValue* value,
                          gpointer v_object);
VALA_EXTERN gpointer value_get_shortcut (const GValue* value);
VALA_EXTERN GType shortcut_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Shortcut, shortcut_unref)
VALA_EXTERN void shortcut_tooltip_set_tooltip (ShortcutTooltip* self,
                                   Shortcut* shortcut);
VALA_EXTERN gchar* utils_tooltip_with_accel (const gchar* tooltip,
                                 const gchar* accel);
VALA_EXTERN gchar* shortcut_get_accelerator (Shortcut* self);
static void shortcut_tooltip_finalize (ShortcutTooltip * obj);
static GType shortcut_tooltip_get_type_once (void);
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
VALA_EXTERN GType exporter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Exporter, g_object_unref)
VALA_EXTERN GType theme_editor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThemeEditor, g_object_unref)
VALA_EXTERN gpointer exports_ref (gpointer instance);
VALA_EXTERN void exports_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_exports (const gchar* name,
                                const gchar* nick,
                                const gchar* blurb,
                                GType object_type,
                                GParamFlags flags);
VALA_EXTERN void value_set_exports (GValue* value,
                        gpointer v_object);
VALA_EXTERN void value_take_exports (GValue* value,
                         gpointer v_object);
VALA_EXTERN gpointer value_get_exports (const GValue* value);
VALA_EXTERN GType exports_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Exports, exports_unref)
VALA_EXTERN gpointer unicode_insert_ref (gpointer instance);
VALA_EXTERN void unicode_insert_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_unicode_insert (const gchar* name,
                                       const gchar* nick,
                                       const gchar* blurb,
                                       GType object_type,
                                       GParamFlags flags);
VALA_EXTERN void value_set_unicode_insert (GValue* value,
                               gpointer v_object);
VALA_EXTERN void value_take_unicode_insert (GValue* value,
                                gpointer v_object);
VALA_EXTERN gpointer value_get_unicode_insert (const GValue* value);
VALA_EXTERN GType unicode_insert_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UnicodeInsert, unicode_insert_unref)
VALA_EXTERN GType braindump_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Braindump, g_object_unref)
VALA_EXTERN gpointer shortcuts_ref (gpointer instance);
VALA_EXTERN void shortcuts_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_shortcuts (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_shortcuts (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_shortcuts (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_shortcuts (const GValue* value);
VALA_EXTERN GType shortcuts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Shortcuts, shortcuts_unref)
VALA_EXTERN GType key_command_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer templates_ref (gpointer instance);
VALA_EXTERN void templates_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_templates (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_templates (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_templates (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_templates (const GValue* value);
VALA_EXTERN GType templates_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Templates, templates_unref)
VALA_EXTERN GType themes_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Themes, g_object_unref)
VALA_EXTERN gboolean utils_on_elementary (void);
VALA_EXTERN Themes* themes_new (void);
VALA_EXTERN Themes* themes_construct (GType object_type);
VALA_EXTERN MainWindow* main_window_new (GtkApplication* app,
                             GSettings* settings);
VALA_EXTERN MainWindow* main_window_construct (GType object_type,
                                   GtkApplication* app,
                                   GSettings* settings);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
VALA_EXTERN Templates* templates_new (void);
VALA_EXTERN Templates* templates_construct (GType object_type);
VALA_EXTERN Exports* exports_new (gboolean save_settings);
VALA_EXTERN Exports* exports_construct (GType object_type,
                            gboolean save_settings);
VALA_EXTERN Shortcuts* shortcuts_new (void);
VALA_EXTERN Shortcuts* shortcuts_construct (GType object_type);
static void main_window_shortcut_changed (MainWindow* self,
                                   KeyCommand command,
                                   Shortcut* shortcut);
static void _main_window_shortcut_changed_shortcuts_shortcut_changed (Shortcuts* _sender,
                                                               KeyCommand command,
                                                               Shortcut* shortcut,
                                                               gpointer self);
static void main_window_tab_switched (MainWindow* self,
                               GtkWidget* page,
                               guint page_num);
static void _main_window_tab_switched_gtk_notebook_switch_page (GtkNotebook* _sender,
                                                         GtkWidget* page,
                                                         guint page_num,
                                                         gpointer self);
static void main_window_tab_reordered (MainWindow* self,
                                GtkWidget* w,
                                guint page_num);
static void _main_window_tab_reordered_gtk_notebook_page_reordered (GtkNotebook* _sender,
                                                             GtkWidget* child,
                                                             guint page_num,
                                                             gpointer self);
static void main_window_tab_removed (MainWindow* self,
                              GtkWidget* w,
                              guint page_num);
static void _main_window_tab_removed_gtk_notebook_page_removed (GtkNotebook* _sender,
                                                         GtkWidget* child,
                                                         guint page_num,
                                                         gpointer self);
static void main_window_set_action_for_command (MainWindow* self,
                                         KeyCommand command,
                                         gboolean key_only);
VALA_EXTERN Braindump* braindump_new (MainWindow* win);
VALA_EXTERN Braindump* braindump_construct (GType object_type,
                                MainWindow* win);
VALA_EXTERN GType braindump_change_type_get_type (void) G_GNUC_CONST ;
static void __lambda247_ (MainWindow* self,
                   BraindumpChangeType change,
                   const gchar* name_index);
VALA_EXTERN gpointer mind_map_ref (gpointer instance);
VALA_EXTERN void mind_map_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_mind_map (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags);
VALA_EXTERN void value_set_mind_map (GValue* value,
                         gpointer v_object);
VALA_EXTERN void value_take_mind_map (GValue* value,
                          gpointer v_object);
VALA_EXTERN gpointer value_get_mind_map (const GValue* value);
VALA_EXTERN GType mind_map_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MindMap, mind_map_unref)
VALA_EXTERN MindMap* main_window_get_current_map (MainWindow* self,
                                      const gchar* caller);
VALA_EXTERN gpointer map_model_ref (gpointer instance);
VALA_EXTERN void map_model_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_map_model (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_map_model (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_map_model (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_map_model (const GValue* value);
VALA_EXTERN GType map_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MapModel, map_model_unref)
VALA_EXTERN MapModel* mind_map_get_model (MindMap* self);
VALA_EXTERN GArray* map_model_get_braindump (MapModel* self);
VALA_EXTERN void mind_map_auto_save (MindMap* self);
static void ___lambda247__braindump_ideas_changed (Braindump* _sender,
                                            BraindumpChangeType change,
                                            const gchar* name_index,
                                            gpointer self);
static gchar* main_window_get_icon_name (MainWindow* self,
                                  const gchar* icon_name);
VALA_EXTERN void main_window_register_widget_for_shortcut (MainWindow* self,
                                               GtkWidget* w,
                                               KeyCommand command,
                                               const gchar* label);
static void __lambda248_ (MainWindow* self);
VALA_EXTERN void main_window_execute_command (MainWindow* self,
                                  KeyCommand command);
static void ___lambda248__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda249_ (MainWindow* self);
static void ___lambda249__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda250_ (MainWindow* self);
static void ___lambda250__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda251_ (MainWindow* self);
static void ___lambda251__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda252_ (MainWindow* self);
static void ___lambda252__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
VALA_EXTERN UnicodeInsert* unicode_insert_new (void);
VALA_EXTERN UnicodeInsert* unicode_insert_construct (GType object_type);
static void main_window_add_property_button (MainWindow* self);
static void main_window_add_miscellaneous_button (MainWindow* self);
static void main_window_add_export_button (MainWindow* self);
static void main_window_add_search_button (MainWindow* self);
static void main_window_add_zoom_button (MainWindow* self);
static void main_window_add_focus_button (MainWindow* self);
static void main_window_add_braindump_button (MainWindow* self);
static void main_window_add_debug_button (MainWindow* self);
static gboolean __lambda274_ (MainWindow* self);
static gboolean ___lambda274__gtk_paned_move_handle (GtkPaned* _sender,
                                              GtkScrollType scroll_type,
                                              gpointer self);
static void __lambda275_ (MainWindow* self);
static void ___lambda275__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void main_window_show_properties (MainWindow* self,
                                  const gchar* tab,
                                  PropertyGrab grab_type);
static void __lambda276_ (MainWindow* self,
                   const gchar* key);
static void main_window_setting_changed_text_size (MainWindow* self);
static void main_window_setting_changed_animations (MainWindow* self);
static void main_window_setting_changed_ui_animations (MainWindow* self);
static void main_window_setting_changed_embedded_urls (MainWindow* self);
static void main_window_setting_changed_markdown (MainWindow* self);
static void main_window_setting_changed_unicode_input (MainWindow* self);
static void ___lambda276__g_settings_changed (GSettings* _sender,
                                       const gchar* key,
                                       gpointer self);
static void main_window_on_dark_mode_changed (MainWindow* self,
                                       gboolean dark_mode);
static void __lambda277_ (Block30Data* _data30_);
static void ___lambda277__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda278_ (MainWindow* self);
static void main_window_update_title (MainWindow* self,
                               MindMap* map);
static void ___lambda278__gtk_event_controller_focus_enter (GtkEventControllerFocus* _sender,
                                                     gpointer self);
VALA_EXTERN void exports_load (Exports* self);
VALA_EXTERN void templates_load (Templates* self);
static gboolean __lambda279_ (MainWindow* self);
static void main_window_save_window_size (MainWindow* self);
static void main_window_save_tabs (MainWindow* self);
static gboolean ___lambda279__gtk_window_close_request (GtkWindow* _sender,
                                                 gpointer self);
static void main_window_set_window_size (MainWindow* self);
static MindMap* main_window_get_map (MainWindow* self,
                              gint page);
VALA_EXTERN GType draw_area_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DrawArea, g_object_unref)
VALA_EXTERN MindMap* draw_area_get_map (DrawArea* self);
static gchar* main_window_get_tab_label_name (MainWindow* self,
                                       gint page_num);
VALA_EXTERN GtkWidget* utils_get_child_at_index (GtkWidget* parent,
                                     gint index);
static void main_window_set_tab_label_info (MainWindow* self,
                                     gint page_num,
                                     gboolean editable,
                                     const gchar* label,
                                     const gchar* tooltip);
VALA_EXTERN GSettings* main_window_get_settings (MainWindow* self);
VALA_EXTERN void map_model_update_css (MapModel* self);
VALA_EXTERN GType current_inspector_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CurrentInspector, g_object_unref)
VALA_EXTERN void current_inspector_set_transition_duration (CurrentInspector* self,
                                                gint duration);
VALA_EXTERN GType animator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Animator, g_object_unref)
VALA_EXTERN Animator* mind_map_get_animator (MindMap* self);
VALA_EXTERN void animator_set_enable (Animator* self,
                          gboolean value);
VALA_EXTERN gpointer text_parser_ref (gpointer instance);
VALA_EXTERN void text_parser_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_text_parser (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_text_parser (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_text_parser (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_text_parser (const GValue* value);
VALA_EXTERN GType text_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TextParser, text_parser_unref)
VALA_EXTERN GType url_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UrlParser, text_parser_unref)
VALA_EXTERN UrlParser* mind_map_get_url_parser (MindMap* self);
VALA_EXTERN void text_parser_set_enable (TextParser* self,
                             gboolean value);
VALA_EXTERN void mind_map_update_enable_markdown (MindMap* self,
                                      gboolean enable);
VALA_EXTERN GType unicode_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UnicodeParser, text_parser_unref)
VALA_EXTERN UnicodeParser* mind_map_get_unicode_parser (MindMap* self);
static void main_window_tab_changed (MainWindow* self,
                              gint page_num);
VALA_EXTERN GType undo_buffer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoBuffer, g_object_unref)
VALA_EXTERN void main_window_do_buffer_changed (MainWindow* self,
                                    UndoBuffer* buf);
VALA_EXTERN UndoBuffer* mind_map_current_undo_buffer (MindMap* self);
static void main_window_on_current_changed (MainWindow* self,
                                     MindMap* map);
VALA_EXTERN void braindump_set_list (Braindump* self,
                         GArray* list);
VALA_EXTERN gboolean mind_map_get_editable (MindMap* self);
VALA_EXTERN void main_window_set_braindump_ui (MainWindow* self,
                                   MindMap* map,
                                   gboolean show);
VALA_EXTERN gboolean map_model_get_braindump_shown (MapModel* self);
static void main_window_save_tab_state (MainWindow* self,
                                 guint current_page);
VALA_EXTERN void main_window_update_node_sizes (MainWindow* self);
VALA_EXTERN void map_model_update_node_sizes (MapModel* self);
VALA_EXTERN void main_window_close_current_tab (MainWindow* self);
static void main_window_close_tab (MainWindow* self,
                            gint page_num);
VALA_EXTERN GType document_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Document, g_object_unref)
VALA_EXTERN Document* mind_map_get_doc (MindMap* self);
VALA_EXTERN gboolean document_is_saved (Document* self);
VALA_EXTERN void mind_map_close (MindMap* self);
static void main_window_remove_tab (MainWindow* self,
                             gint* page_num);
VALA_EXTERN void main_window_show_save_warning (MainWindow* self,
                                    MindMap* map);
static gint* _int_dup (gint* self);
VALA_EXTERN MindMap* main_window_add_tab (MainWindow* self,
                              const gchar* fname,
                              TabAddReason reason);
VALA_EXTERN MindMap* main_window_create_map (MainWindow* self);
VALA_EXTERN MindMap* mind_map_new (MainWindow* win,
                       GSettings* settings);
VALA_EXTERN MindMap* mind_map_construct (GType object_type,
                             MainWindow* win,
                             GSettings* settings);
static Block31Data* block31_data_ref (Block31Data* _data31_);
static void block31_data_unref (void * _userdata_);
static void _main_window_on_current_changed_mind_map_current_changed (MindMap* _sender,
                                                               MindMap* map,
                                                               gpointer self);
static void main_window_change_scale (MainWindow* self,
                               gdouble scale_factor);
static void _main_window_change_scale_mind_map_scale_changed (MindMap* _sender,
                                                       gdouble scale,
                                                       gpointer self);
static void main_window_change_origin (MainWindow* self);
static void _main_window_change_origin_mind_map_scroll_changed (MindMap* _sender,
                                                         gpointer self);
static void _main_window_show_properties_mind_map_show_properties (MindMap* _sender,
                                                            const gchar* tab,
                                                            PropertyGrab grab_type,
                                                            gpointer self);
static void main_window_hide_properties (MainWindow* self);
static void _main_window_hide_properties_mind_map_hide_properties (MindMap* _sender,
                                                            gpointer self);
VALA_EXTERN UndoBuffer* mind_map_get_undo_buffer (MindMap* self);
static void _main_window_do_buffer_changed_undo_buffer_buffer_changed (UndoBuffer* _sender,
                                                                UndoBuffer* buf,
                                                                gpointer self);
VALA_EXTERN GType undo_text_buffer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoTextBuffer, g_object_unref)
VALA_EXTERN UndoTextBuffer* mind_map_get_undo_text (MindMap* self);
static void main_window_on_editable_changed (MainWindow* self,
                                      MindMap* map);
static void _main_window_on_editable_changed_mind_map_editable_changed (MindMap* _sender,
                                                                 MindMap* map,
                                                                 gpointer self);
VALA_EXTERN gpointer tags_ref (gpointer instance);
VALA_EXTERN void tags_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_tags (const gchar* name,
                             const gchar* nick,
                             const gchar* blurb,
                             GType object_type,
                             GParamFlags flags);
VALA_EXTERN void value_set_tags (GValue* value,
                     gpointer v_object);
VALA_EXTERN void value_take_tags (GValue* value,
                      gpointer v_object);
VALA_EXTERN gpointer value_get_tags (const GValue* value);
VALA_EXTERN GType tags_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tags, tags_unref)
VALA_EXTERN Tags* mind_map_get_highlighted (MindMap* self);
static void __lambda180_ (Block31Data* _data31_);
static void main_window_on_tag_highlight_changed (MainWindow* self,
                                           MindMap* map);
static void ___lambda180__tags_changed (Tags* _sender,
                                 gpointer self);
VALA_EXTERN void document_load_filename (Document* self,
                             const gchar* fname,
                             gboolean saved);
VALA_EXTERN DrawArea* mind_map_get_canvas (MindMap* self);
VALA_EXTERN gchar* document_get_label (Document* self);
static void __lambda181_ (Block31Data* _data31_);
VALA_EXTERN gboolean document_get_save_needed (Document* self);
static void ___lambda181__document_save_changed (Document* _sender,
                                          gpointer self);
static void __lambda182_ (Block31Data* _data31_,
                   gdouble x,
                   gdouble y);
static void ___lambda182__gtk_event_controller_motion_enter (GtkEventControllerMotion* _sender,
                                                      gdouble x,
                                                      gdouble y,
                                                      gpointer self);
static void __lambda183_ (Block31Data* _data31_);
static void ___lambda183__gtk_event_controller_motion_leave (GtkEventControllerMotion* _sender,
                                                      gpointer self);
static void __lambda184_ (Block31Data* _data31_);
static void ___lambda184__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
VALA_EXTERN void mind_map_initialize_for_new (MindMap* self);
VALA_EXTERN void mind_map_initialize_for_open (MindMap* self);
VALA_EXTERN void mind_map_set_editable (MindMap* self,
                            gboolean value);
static void main_window_close_unchanged_tabs (MainWindow* self);
VALA_EXTERN gboolean map_model_get_is_loaded (MapModel* self);
static gboolean main_window_find_unchanged_tab (MainWindow* self);
static MindMap* main_window_add_tab_conditionally (MainWindow* self,
                                            const gchar* fname,
                                            TabAddReason reason);
VALA_EXTERN const gchar* document_get_filename (Document* self);
VALA_EXTERN void main_window_next_tab (MainWindow* self);
VALA_EXTERN void main_window_previous_tab (MainWindow* self);
VALA_EXTERN gint tags_size (Tags* self);
VALA_EXTERN gboolean document_get_read_only (Document* self);
static void main_window_append_menu_item (MainWindow* self,
                                   GMenu* menu,
                                   KeyCommand command,
                                   const gchar* label);
VALA_EXTERN gdouble* draw_area_get_scale_marks (gint* result_length1);
static gboolean main_window_adjust_zoom (MainWindow* self,
                                  GtkScrollType scroll,
                                  gdouble new_value);
static gboolean _main_window_adjust_zoom_gtk_range_change_value (GtkRange* _sender,
                                                          GtkScrollType scroll,
                                                          gdouble new_value,
                                                          gpointer self);
static void __lambda269_ (MainWindow* self);
static void ___lambda269__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda270_ (MainWindow* self);
static void ___lambda270__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void main_window_on_search_change (MainWindow* self);
static void _main_window_on_search_change_gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                    gpointer self);
static gboolean __lambda257_ (MainWindow* self,
                       guint keyval,
                       guint keycode,
                       GdkModifierType state);
static gboolean ___lambda257__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                             guint keyval,
                                                             guint keycode,
                                                             GdkModifierType state,
                                                             gpointer self);
VALA_EXTERN GType node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Node, g_object_unref)
VALA_EXTERN GType connection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Connection, g_object_unref)
VALA_EXTERN GType callout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Callout, g_object_unref)
VALA_EXTERN GType node_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeGroup, g_object_unref)
static void main_window_on_search_clicked (MainWindow* self,
                                    GtkTreeView* view,
                                    GtkTreePath* path,
                                    GtkTreeViewColumn* col);
static void _main_window_on_search_clicked_gtk_tree_view_row_activated (GtkTreeView* _sender,
                                                                 GtkTreePath* path,
                                                                 GtkTreeViewColumn* column,
                                                                 gpointer self);
static GtkGrid* main_window_create_search_options_box (MainWindow* self);
static void __lambda268_ (MainWindow* self);
static void ___lambda268__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda258_ (MainWindow* self);
static void ___lambda258__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda259_ (MainWindow* self);
static void ___lambda259__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda260_ (MainWindow* self);
static void ___lambda260__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda261_ (MainWindow* self);
static void ___lambda261__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda262_ (MainWindow* self);
static void ___lambda262__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda263_ (MainWindow* self);
static void ___lambda263__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda264_ (MainWindow* self);
static void ___lambda264__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda265_ (MainWindow* self);
static void ___lambda265__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda266_ (MainWindow* self);
static void ___lambda266__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static void __lambda267_ (MainWindow* self);
static void ___lambda267__gtk_check_button_toggled (GtkCheckButton* _sender,
                                             gpointer self);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
VALA_EXTERN Exporter* exporter_new (MainWindow* win);
VALA_EXTERN Exporter* exporter_construct (GType object_type,
                              MainWindow* win);
static void __lambda256_ (Block32Data* _data32_);
static void ___lambda256__exporter_export_done (Exporter* _sender,
                                         gpointer self);
static void __lambda272_ (MainWindow* self,
                   GtkButton* e);
static void ___lambda272__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
VALA_EXTERN void map_model_set_braindump_shown (MapModel* self,
                                    gboolean value);
static void __lambda273_ (MainWindow* self);
static void ___lambda273__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda271_ (MainWindow* self,
                   GtkButton* e);
VALA_EXTERN void mind_map_set_focus_mode (MindMap* self,
                              gboolean value);
static void ___lambda271__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
VALA_EXTERN GMenu* main_window_make_markdown_menu (MainWindow* self);
VALA_EXTERN GType mode_buttons_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ModeButtons, g_object_unref)
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void main_window_inspector_clicked (MainWindow* self);
static void _main_window_inspector_clicked_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                               gpointer self);
VALA_EXTERN CurrentInspector* current_inspector_new (MainWindow* win);
VALA_EXTERN CurrentInspector* current_inspector_construct (GType object_type,
                                               MainWindow* win);
VALA_EXTERN StyleInspector* style_inspector_new (MainWindow* win,
                                     GSettings* settings);
VALA_EXTERN StyleInspector* style_inspector_construct (GType object_type,
                                           MainWindow* win,
                                           GSettings* settings);
VALA_EXTERN GType style_inspector_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (StyleInspector, g_object_unref)
VALA_EXTERN TagInspector* tag_inspector_new (MainWindow* win);
VALA_EXTERN TagInspector* tag_inspector_construct (GType object_type,
                                       MainWindow* win);
VALA_EXTERN GType tag_inspector_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagInspector, g_object_unref)
VALA_EXTERN StickerInspector* sticker_inspector_new (MainWindow* win,
                                         GSettings* settings);
VALA_EXTERN StickerInspector* sticker_inspector_construct (GType object_type,
                                               MainWindow* win,
                                               GSettings* settings);
VALA_EXTERN GType sticker_inspector_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (StickerInspector, g_object_unref)
VALA_EXTERN MapInspector* map_inspector_new (MainWindow* win,
                                 GSettings* settings);
VALA_EXTERN MapInspector* map_inspector_construct (GType object_type,
                                       MainWindow* win,
                                       GSettings* settings);
VALA_EXTERN GType map_inspector_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MapInspector, g_object_unref)
static gboolean main_window_stack_keypress (MainWindow* self,
                                     guint keyval,
                                     guint keycode,
                                     GdkModifierType state);
static gboolean _main_window_stack_keypress_gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                           guint keyval,
                                                                           guint keycode,
                                                                           GdkModifierType state,
                                                                           gpointer self);
static void __lambda253_ (MainWindow* self,
                   GParamSpec* ps);
VALA_EXTERN void current_inspector_grab_first (CurrentInspector* self);
VALA_EXTERN void style_inspector_grab_first (StyleInspector* self);
VALA_EXTERN void tag_inspector_grab_first (TagInspector* self);
VALA_EXTERN void sticker_inspector_grab_first (StickerInspector* self);
VALA_EXTERN void map_inspector_grab_first (MapInspector* self);
static void ___lambda253__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
VALA_EXTERN ModeButtons* mode_buttons_new (void);
VALA_EXTERN ModeButtons* mode_buttons_construct (GType object_type);
VALA_EXTERN void mode_buttons_add_stack_tab (ModeButtons* self,
                                 const gchar* label);
static void __lambda254_ (MainWindow* self,
                   gint index);
static void ___lambda254__mode_buttons_changed (ModeButtons* _sender,
                                         gint index,
                                         gpointer self);
static void __lambda255_ (Block33Data* _data33_);
VALA_EXTERN void mode_buttons_set_selected (ModeButtons* self,
                                gint value);
static void ___lambda255__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
VALA_EXTERN void utils_set_switcher_tab_widths (GtkWidget* switcher);
VALA_EXTERN ThemeEditor* theme_editor_new (MainWindow* win);
VALA_EXTERN ThemeEditor* theme_editor_construct (GType object_type,
                                     MainWindow* win);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
static void __lambda34_ (Block34Data* _data34_,
                  gint id);
VALA_EXTERN void main_window_save_file (MainWindow* self,
                            MindMap* map,
                            gboolean remove_after_save);
VALA_EXTERN gboolean document_remove (Document* self);
static void ___lambda34__gtk_dialog_response (GtkDialog* _sender,
                                       gint response_id,
                                       gpointer self);
VALA_EXTERN void main_window_ask_modified_overwrite (MainWindow* self,
                                         MindMap* map,
                                         MainWindowOverwriteFunc func,
                                         gpointer func_target);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
static void __lambda11_ (Block35Data* _data35_,
                  gint id);
static void ___lambda11__gtk_dialog_response (GtkDialog* _sender,
                                       gint response_id,
                                       gpointer self);
VALA_EXTERN void main_window_do_new_file (MainWindow* self);
VALA_EXTERN void main_window_do_open_file (MainWindow* self);
VALA_EXTERN void main_window_do_open (MainWindow* self,
                          gboolean dir);
VALA_EXTERN void main_window_do_open_directory (MainWindow* self);
static Block36Data* block36_data_ref (Block36Data* _data36_);
static void block36_data_unref (void * _userdata_);
VALA_EXTERN GtkFileDialog* utils_make_file_chooser (const gchar* user_title,
                                        const gchar* user_accept_label);
VALA_EXTERN Exports* main_window_get_exports (MainWindow* self);
VALA_EXTERN gint exports_length (Exports* self);
VALA_EXTERN gpointer export_ref (gpointer instance);
VALA_EXTERN void export_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_export (const gchar* name,
                               const gchar* nick,
                               const gchar* blurb,
                               GType object_type,
                               GParamFlags flags);
VALA_EXTERN void value_set_export (GValue* value,
                       gpointer v_object);
VALA_EXTERN void value_take_export (GValue* value,
                        gpointer v_object);
VALA_EXTERN gpointer value_get_export (const GValue* value);
VALA_EXTERN GType export_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Export, export_unref)
VALA_EXTERN Export* exports_index (Exports* self,
                       gint idx);
VALA_EXTERN gboolean export_get_importable (Export* self);
VALA_EXTERN gboolean export_get_dir (Export* self);
VALA_EXTERN const gchar* export_get_label (Export* self);
VALA_EXTERN gchar** export_get_extensions (Export* self,
                               gint* result_length1);
static void ___lambda39_ (Block36Data* _data36_,
                   GObject* obj,
                   GAsyncResult* res);
VALA_EXTERN gboolean main_window_open_file (MainWindow* self,
                                const gchar* fname,
                                gboolean dir);
VALA_EXTERN void utils_store_chooser_folder (const gchar* file,
                                 gboolean is_dir);
static void ____lambda39__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void ___lambda40_ (Block36Data* _data36_,
                   GObject* obj,
                   GAsyncResult* res);
static void ____lambda40__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
VALA_EXTERN GType upgrade_action_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void document_load (Document* self,
                    UpgradeAction force_upgrade_action,
                    AfterLoadFunc func,
                    gpointer func_target);
static void ___lambda33_ (MainWindow* self,
                   gboolean valid,
                   const gchar* msg);
static void ____lambda33__after_load_func (gboolean loaded,
                                    const gchar* msg,
                                    gpointer self);
VALA_EXTERN gboolean export_filename_matches (Export* self,
                                  const gchar* fname,
                                  gchar** basename);
VALA_EXTERN gboolean export_import (Export* self,
                        const gchar* fname,
                        MindMap* map);
VALA_EXTERN gboolean main_window_import_file (MainWindow* self,
                                  const gchar* fname,
                                  const gchar* export_name,
                                  gchar** new_fname);
VALA_EXTERN const gchar* export_get_name (Export* self);
VALA_EXTERN void main_window_do_undo (MainWindow* self);
VALA_EXTERN void undo_buffer_undo (UndoBuffer* self);
VALA_EXTERN void main_window_do_redo (MainWindow* self);
VALA_EXTERN void undo_buffer_redo (UndoBuffer* self);
VALA_EXTERN gboolean utils_use_dark_mode (GtkWidget* w);
VALA_EXTERN gboolean undo_buffer_undoable (UndoBuffer* self);
VALA_EXTERN gchar* undo_buffer_undo_tooltip (UndoBuffer* self);
static gchar* main_window_get_accelerator (MainWindow* self,
                                    KeyCommand command);
VALA_EXTERN gboolean undo_buffer_redoable (UndoBuffer* self);
VALA_EXTERN gchar* undo_buffer_redo_tooltip (UndoBuffer* self);
static gchar* main_window_convert_name_to_filename (MainWindow* self,
                                             const gchar* name);
static Block37Data* block37_data_ref (Block37Data* _data37_);
static void block37_data_unref (void * _userdata_);
VALA_EXTERN GArray* mind_map_get_nodes (MindMap* self);
VALA_EXTERN GType canvas_text_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CanvasText, g_object_unref)
VALA_EXTERN CanvasText* node_get_name (Node* self);
VALA_EXTERN gpointer formatted_text_ref (gpointer instance);
VALA_EXTERN void formatted_text_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_formatted_text (const gchar* name,
                                       const gchar* nick,
                                       const gchar* blurb,
                                       GType object_type,
                                       GParamFlags flags);
VALA_EXTERN void value_set_formatted_text (GValue* value,
                               gpointer v_object);
VALA_EXTERN void value_take_formatted_text (GValue* value,
                                gpointer v_object);
VALA_EXTERN gpointer value_get_formatted_text (const GValue* value);
VALA_EXTERN GType formatted_text_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FormattedText, formatted_text_unref)
VALA_EXTERN FormattedText* canvas_text_get_text (CanvasText* self);
VALA_EXTERN const gchar* formatted_text_get_text (FormattedText* self);
static void __lambda35_ (Block37Data* _data37_,
                  GObject* obj,
                  GAsyncResult* res);
VALA_EXTERN void document_set_filename (Document* self,
                            const gchar* value);
VALA_EXTERN gboolean document_save (Document* self);
static void ___lambda35__gasync_ready_callback (GObject* source_object,
                                         GAsyncResult* res,
                                         gpointer self);
VALA_EXTERN void main_window_do_save_as_file (MainWindow* self);
VALA_EXTERN Node* mind_map_get_current_node (MindMap* self);
VALA_EXTERN gboolean mind_map_get_focus_mode (MindMap* self);
VALA_EXTERN void draw_area_see (DrawArea* self,
                    gboolean animate,
                    gdouble width_adjust,
                    gdouble pad);
VALA_EXTERN void current_inspector_grab_note (CurrentInspector* self);
VALA_EXTERN GType note_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NoteView, g_object_unref)
VALA_EXTERN NoteView* main_window_get_current_note (MainWindow* self);
VALA_EXTERN NoteView* current_inspector_get_note (CurrentInspector* self);
VALA_EXTERN GType theme_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Theme, g_object_unref)
VALA_EXTERN void main_window_show_theme_editor (MainWindow* self,
                                    Theme* theme);
VALA_EXTERN void theme_editor_initialize (ThemeEditor* self,
                              Theme* theme,
                              gboolean edit);
VALA_EXTERN Theme* mind_map_get_theme (MindMap* self);
VALA_EXTERN void main_window_hide_theme_editor (MainWindow* self);
static gdouble main_window_zoom_to_value (MainWindow* self,
                                   gdouble value);
VALA_EXTERN gboolean draw_area_set_scaling_factor (DrawArea* self,
                                       gdouble sf);
static void main_window_action_new (MainWindow* self);
static void main_window_action_open (MainWindow* self);
static void main_window_action_save (MainWindow* self);
static void main_window_action_save_as (MainWindow* self);
static void main_window_action_quit (MainWindow* self);
static void main_window_action_undo (MainWindow* self);
static void main_window_action_redo (MainWindow* self);
static void main_window_action_zoom_in (MainWindow* self);
VALA_EXTERN gboolean draw_area_zoom_in (DrawArea* self);
static void main_window_action_zoom_out (MainWindow* self);
VALA_EXTERN gboolean draw_area_zoom_out (DrawArea* self);
static void main_window_action_zoom_fit (MainWindow* self);
VALA_EXTERN void draw_area_zoom_to_fit (DrawArea* self);
static void main_window_action_zoom_selected (MainWindow* self);
VALA_EXTERN void draw_area_zoom_to_selected (DrawArea* self);
static void main_window_action_zoom_actual (MainWindow* self);
VALA_EXTERN void draw_area_zoom_actual (DrawArea* self);
VALA_EXTERN void map_model_get_match_items (MapModel* self,
                                const gchar* tabname,
                                const gchar* pattern,
                                gboolean* search_opts,
                                gint search_opts_length1,
                                GtkListStore** matches);
VALA_EXTERN void mind_map_set_current_node (MindMap* self,
                                Node* n);
VALA_EXTERN void mind_map_set_current_connection (MindMap* self,
                                      Connection* c);
VALA_EXTERN void mind_map_set_current_callout (MindMap* self,
                                   Callout* c);
VALA_EXTERN void mind_map_set_current_group (MindMap* self,
                                 NodeGroup* g);
VALA_EXTERN gchar* main_window_repair_filename (MainWindow* self,
                                    const gchar* fname,
                                    gchar** extensions,
                                    gint extensions_length1);
static void main_window_action_print (MainWindow* self);
VALA_EXTERN GType export_print_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExportPrint, g_object_unref)
VALA_EXTERN ExportPrint* export_print_new (void);
VALA_EXTERN ExportPrint* export_print_construct (GType object_type);
VALA_EXTERN void export_print_print (ExportPrint* self,
                         MindMap* map,
                         MainWindow* main);
static void main_window_action_prefs (MainWindow* self);
VALA_EXTERN GType preferences_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Preferences, g_object_unref)
VALA_EXTERN Preferences* preferences_new (MainWindow* win);
VALA_EXTERN Preferences* preferences_construct (GType object_type,
                                    MainWindow* win);
static void main_window_action_shortcuts (MainWindow* self);
VALA_EXTERN Shortcuts* main_window_get_shortcuts (MainWindow* self);
VALA_EXTERN gchar* shortcuts_get_ui_string (Shortcuts* self);
VALA_EXTERN gboolean mind_map_is_node_editable (MindMap* self);
VALA_EXTERN gboolean mind_map_is_connection_editable (MindMap* self);
VALA_EXTERN gboolean mind_map_is_node_selected (MindMap* self);
VALA_EXTERN gboolean mind_map_is_connection_selected (MindMap* self);
VALA_EXTERN gboolean mind_map_is_callout_selected (MindMap* self);
VALA_EXTERN gboolean mind_map_is_group_selected (MindMap* self);
static void main_window_action_next_tab (MainWindow* self);
static void main_window_action_prev_tab (MainWindow* self);
static void main_window_action_about (MainWindow* self);
VALA_EXTERN gpointer about_ref (gpointer instance);
VALA_EXTERN void about_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_about (const gchar* name,
                              const gchar* nick,
                              const gchar* blurb,
                              GType object_type,
                              GParamFlags flags);
VALA_EXTERN void value_set_about (GValue* value,
                      gpointer v_object);
VALA_EXTERN void value_take_about (GValue* value,
                       gpointer v_object);
VALA_EXTERN gpointer value_get_about (const GValue* value);
VALA_EXTERN GType about_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (About, about_unref)
VALA_EXTERN About* about_new (MainWindow* win);
VALA_EXTERN About* about_construct (GType object_type,
                        MainWindow* win);
VALA_EXTERN void about_show (About* self);
VALA_EXTERN void main_window_toggle_braindump (MainWindow* self);
VALA_EXTERN void main_window_toggle_focus_mode (MainWindow* self);
VALA_EXTERN void main_window_show_find (MainWindow* self);
static void main_window_action_close_current_tab (MainWindow* self);
VALA_EXTERN gdouble draw_area_get_origin_x (DrawArea* self);
VALA_EXTERN gdouble draw_area_get_origin_y (DrawArea* self);
VALA_EXTERN gdouble draw_area_get_sfactor (DrawArea* self);
static gchar* main_window_get_tab_state_path (MainWindow* self);
VALA_EXTERN void main_window_load_tab_state (MainWindow* self);
static gboolean ___lambda186_ (MainWindow* self);
static void main_window_request_upgrade_action (MainWindow* self,
                                         AfterLoadTabFunc func,
                                         gpointer func_target);
static void __lambda189_ (MainWindow* self);
static void main_window_load_tab_state_xml (MainWindow* self);
static void ___lambda189__after_load_tab_func (gpointer self);
static gboolean ____lambda186__gsource_func (gpointer self);
static Block38Data* block38_data_ref (Block38Data* _data38_);
static void block38_data_unref (void * _userdata_);
VALA_EXTERN gchar** upgrade_action_tab_labels (gint* result_length1);
static void __lambda187_ (Block38Data* _data38_);
static void ___lambda187__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda188_ (Block38Data* _data38_,
                   gint id);
static void ___lambda188__gtk_dialog_response (GtkDialog* _sender,
                                        gint response_id,
                                        gpointer self);
VALA_EXTERN void draw_area_set_origin_x (DrawArea* self,
                             gdouble value);
VALA_EXTERN void draw_area_set_origin_y (DrawArea* self,
                             gdouble value);
VALA_EXTERN void draw_area_set_sfactor (DrawArea* self,
                            gdouble value);
VALA_EXTERN gint main_window_get_label_height (MainWindow* self);
VALA_EXTERN void main_window_notification (MainWindow* self,
                               const gchar* title,
                               const gchar* msg,
                               GNotificationPriority priority);
static Block39Data* block39_data_ref (Block39Data* _data39_);
static void block39_data_unref (void * _userdata_);
VALA_EXTERN gchar* key_command_to_string (KeyCommand self);
static void ___lambda127_ (Block39Data* _data39_,
                    GVariant* v);
VALA_EXTERN KeyCommandFunc key_command_get_func (KeyCommand self,
                                     gpointer* result_target,
                                     GDestroyNotify* result_target_destroy_notify);
static void ____lambda127__g_simple_action_activate (GSimpleAction* _sender,
                                              GVariant* parameter,
                                              gpointer self);
static void __lambda128_ (Block39Data* _data39_,
                   GVariant* v);
static void ___lambda128__g_simple_action_activate (GSimpleAction* _sender,
                                             GVariant* parameter,
                                             gpointer self);
VALA_EXTERN Shortcut* shortcuts_get_shortcut (Shortcuts* self,
                                  KeyCommand command);
VALA_EXTERN void main_window_register_widget_for_tooltip (MainWindow* self,
                                              GtkWidget* w,
                                              KeyCommand command,
                                              const gchar* label);
VALA_EXTERN Themes* main_window_get_themes (MainWindow* self);
VALA_EXTERN void main_window_set_themes (MainWindow* self,
                             Themes* value);
VALA_EXTERN gint main_window_get_text_size (MainWindow* self);
VALA_EXTERN UnicodeInsert* main_window_get_unicoder (MainWindow* self);
VALA_EXTERN Braindump* main_window_get_braindump (MainWindow* self);
VALA_EXTERN Templates* main_window_get_templates (MainWindow* self);
static void g_cclosure_user_marshal_VOID__MIND_MAP (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data);
static void main_window_finalize (GObject * obj);
static GType main_window_get_type_once (void);
static void _vala_main_window_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec);
static void _vala_main_window_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static GType
tab_add_reason_get_type_once (void)
{
	static const GEnumValue values[] = {{TAB_ADD_REASON_NEW, "TAB_ADD_REASON_NEW", "new"}, {TAB_ADD_REASON_OPEN, "TAB_ADD_REASON_OPEN", "open"}, {TAB_ADD_REASON_IMPORT, "TAB_ADD_REASON_IMPORT", "import"}, {TAB_ADD_REASON_LOAD, "TAB_ADD_REASON_LOAD", "load"}, {0, NULL, NULL}};
	GType tab_add_reason_type_id;
	tab_add_reason_type_id = g_enum_register_static ("TabAddReason", values);
	return tab_add_reason_type_id;
}

GType
tab_add_reason_get_type (void)
{
	static volatile gsize tab_add_reason_type_id__once = 0;
	if (g_once_init_enter (&tab_add_reason_type_id__once)) {
		GType tab_add_reason_type_id;
		tab_add_reason_type_id = tab_add_reason_get_type_once ();
		g_once_init_leave (&tab_add_reason_type_id__once, tab_add_reason_type_id);
	}
	return tab_add_reason_type_id__once;
}

static GType
property_grab_get_type_once (void)
{
	static const GEnumValue values[] = {{PROPERTY_GRAB_NONE, "PROPERTY_GRAB_NONE", "none"}, {PROPERTY_GRAB_FIRST, "PROPERTY_GRAB_FIRST", "first"}, {PROPERTY_GRAB_NOTE, "PROPERTY_GRAB_NOTE", "note"}, {0, NULL, NULL}};
	GType property_grab_type_id;
	property_grab_type_id = g_enum_register_static ("PropertyGrab", values);
	return property_grab_type_id;
}

GType
property_grab_get_type (void)
{
	static volatile gsize property_grab_type_id__once = 0;
	if (g_once_init_enter (&property_grab_type_id__once)) {
		GType property_grab_type_id;
		property_grab_type_id = property_grab_get_type_once ();
		g_once_init_leave (&property_grab_type_id__once, property_grab_type_id);
	}
	return property_grab_type_id__once;
}

static GType
search_options_get_type_once (void)
{
	static const GEnumValue values[] = {{SEARCH_OPTIONS_NODES, "SEARCH_OPTIONS_NODES", "nodes"}, {SEARCH_OPTIONS_CONNECTIONS, "SEARCH_OPTIONS_CONNECTIONS", "connections"}, {SEARCH_OPTIONS_CALLOUTS, "SEARCH_OPTIONS_CALLOUTS", "callouts"}, {SEARCH_OPTIONS_GROUPS, "SEARCH_OPTIONS_GROUPS", "groups"}, {SEARCH_OPTIONS_TITLES, "SEARCH_OPTIONS_TITLES", "titles"}, {SEARCH_OPTIONS_NOTES, "SEARCH_OPTIONS_NOTES", "notes"}, {SEARCH_OPTIONS_FOLDED, "SEARCH_OPTIONS_FOLDED", "folded"}, {SEARCH_OPTIONS_UNFOLDED, "SEARCH_OPTIONS_UNFOLDED", "unfolded"}, {SEARCH_OPTIONS_TASKS, "SEARCH_OPTIONS_TASKS", "tasks"}, {SEARCH_OPTIONS_NONTASKS, "SEARCH_OPTIONS_NONTASKS", "nontasks"}, {SEARCH_OPTIONS_NUM, "SEARCH_OPTIONS_NUM", "num"}, {0, NULL, NULL}};
	GType search_options_type_id;
	search_options_type_id = g_enum_register_static ("SearchOptions", values);
	return search_options_type_id;
}

GType
search_options_get_type (void)
{
	static volatile gsize search_options_type_id__once = 0;
	if (g_once_init_enter (&search_options_type_id__once)) {
		GType search_options_type_id;
		search_options_type_id = search_options_get_type_once ();
		g_once_init_leave (&search_options_type_id__once, search_options_type_id);
	}
	return search_options_type_id__once;
}

static inline gpointer
shortcut_tooltip_get_instance_private (ShortcutTooltip* self)
{
	return G_STRUCT_MEMBER_P (self, ShortcutTooltip_private_offset);
}

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

ShortcutTooltip*
shortcut_tooltip_construct (GType object_type,
                            GtkWidget* w,
                            const gchar* l)
{
	ShortcutTooltip* self = NULL;
	GtkWidget* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (w != NULL, NULL);
	g_return_val_if_fail (l != NULL, NULL);
	self = (ShortcutTooltip*) g_type_create_instance (object_type);
	_tmp0_ = _g_object_ref0 (w);
	_g_object_unref0 (self->priv->_widget);
	self->priv->_widget = _tmp0_;
	_tmp1_ = g_strdup (l);
	_g_free0 (self->priv->_label);
	self->priv->_label = _tmp1_;
	return self;
}

ShortcutTooltip*
shortcut_tooltip_new (GtkWidget* w,
                      const gchar* l)
{
	return shortcut_tooltip_construct (TYPE_SHORTCUT_TOOLTIP, w, l);
}

void
shortcut_tooltip_set_tooltip (ShortcutTooltip* self,
                              Shortcut* shortcut)
{
	gchar* _tmp0_ = NULL;
	GtkWidget* _tmp7_;
	g_return_if_fail (self != NULL);
	if (shortcut == NULL) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = self->priv->_label;
		_tmp2_ = g_strdup (_tmp1_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp2_;
	} else {
		const gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp3_ = self->priv->_label;
		_tmp4_ = shortcut_get_accelerator (shortcut);
		_tmp5_ = _tmp4_;
		_tmp6_ = utils_tooltip_with_accel (_tmp3_, _tmp5_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp6_;
		_g_free0 (_tmp5_);
	}
	_tmp7_ = self->priv->_widget;
	gtk_widget_set_tooltip_markup (_tmp7_, _tmp0_);
	_g_free0 (_tmp0_);
}

static void
value_shortcut_tooltip_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
value_shortcut_tooltip_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		shortcut_tooltip_unref (value->data[0].v_pointer);
	}
}

static void
value_shortcut_tooltip_copy_value (const GValue* src_value,
                                   GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = shortcut_tooltip_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
value_shortcut_tooltip_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
value_shortcut_tooltip_collect_value (GValue* value,
                                      guint n_collect_values,
                                      GTypeCValue* collect_values,
                                      guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		ShortcutTooltip * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = shortcut_tooltip_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
value_shortcut_tooltip_lcopy_value (const GValue* value,
                                    guint n_collect_values,
                                    GTypeCValue* collect_values,
                                    guint collect_flags)
{
	ShortcutTooltip ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = shortcut_tooltip_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
param_spec_shortcut_tooltip (const gchar* name,
                             const gchar* nick,
                             const gchar* blurb,
                             GType object_type,
                             GParamFlags flags)
{
	ParamSpecShortcutTooltip* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_SHORTCUT_TOOLTIP), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
value_get_shortcut_tooltip (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SHORTCUT_TOOLTIP), NULL);
	return value->data[0].v_pointer;
}

void
value_set_shortcut_tooltip (GValue* value,
                            gpointer v_object)
{
	ShortcutTooltip * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SHORTCUT_TOOLTIP));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_SHORTCUT_TOOLTIP));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		shortcut_tooltip_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		shortcut_tooltip_unref (old);
	}
}

void
value_take_shortcut_tooltip (GValue* value,
                             gpointer v_object)
{
	ShortcutTooltip * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_SHORTCUT_TOOLTIP));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_SHORTCUT_TOOLTIP));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		shortcut_tooltip_unref (old);
	}
}

static void
shortcut_tooltip_class_init (ShortcutTooltipClass * klass,
                             gpointer klass_data)
{
	shortcut_tooltip_parent_class = g_type_class_peek_parent (klass);
	((ShortcutTooltipClass *) klass)->finalize = shortcut_tooltip_finalize;
	g_type_class_adjust_private_offset (klass, &ShortcutTooltip_private_offset);
}

static void
shortcut_tooltip_instance_init (ShortcutTooltip * self,
                                gpointer klass)
{
	self->priv = shortcut_tooltip_get_instance_private (self);
	self->ref_count = 1;
}

static void
shortcut_tooltip_finalize (ShortcutTooltip * obj)
{
	ShortcutTooltip * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SHORTCUT_TOOLTIP, ShortcutTooltip);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->_widget);
	_g_free0 (self->priv->_label);
}

static GType
shortcut_tooltip_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { value_shortcut_tooltip_init, value_shortcut_tooltip_free_value, value_shortcut_tooltip_copy_value, value_shortcut_tooltip_peek_pointer, "p", value_shortcut_tooltip_collect_value, "p", value_shortcut_tooltip_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ShortcutTooltipClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) shortcut_tooltip_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ShortcutTooltip), 0, (GInstanceInitFunc) shortcut_tooltip_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType shortcut_tooltip_type_id;
	shortcut_tooltip_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ShortcutTooltip", &g_define_type_info, &g_define_type_fundamental_info, 0);
	ShortcutTooltip_private_offset = g_type_add_instance_private (shortcut_tooltip_type_id, sizeof (ShortcutTooltipPrivate));
	return shortcut_tooltip_type_id;
}

GType
shortcut_tooltip_get_type (void)
{
	static volatile gsize shortcut_tooltip_type_id__once = 0;
	if (g_once_init_enter (&shortcut_tooltip_type_id__once)) {
		GType shortcut_tooltip_type_id;
		shortcut_tooltip_type_id = shortcut_tooltip_get_type_once ();
		g_once_init_leave (&shortcut_tooltip_type_id__once, shortcut_tooltip_type_id);
	}
	return shortcut_tooltip_type_id__once;
}

gpointer
shortcut_tooltip_ref (gpointer instance)
{
	ShortcutTooltip * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
shortcut_tooltip_unref (gpointer instance)
{
	ShortcutTooltip * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		SHORTCUT_TOOLTIP_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
main_window_get_instance_private (MainWindow* self)
{
	return G_STRUCT_MEMBER_P (self, MainWindow_private_offset);
}

static Block30Data*
block30_data_ref (Block30Data* _data30_)
{
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}

static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		MainWindow* self;
		self = _data30_->self;
		_g_object_unref0 (_data30_->granite_settings);
		_g_object_unref0 (self);
		g_slice_free (Block30Data, _data30_);
	}
}

static void
_main_window_shortcut_changed_shortcuts_shortcut_changed (Shortcuts* _sender,
                                                          KeyCommand command,
                                                          Shortcut* shortcut,
                                                          gpointer self)
{
	main_window_shortcut_changed ((MainWindow*) self, command, shortcut);
}

static void
_main_window_tab_switched_gtk_notebook_switch_page (GtkNotebook* _sender,
                                                    GtkWidget* page,
                                                    guint page_num,
                                                    gpointer self)
{
	main_window_tab_switched ((MainWindow*) self, page, page_num);
}

static void
_main_window_tab_reordered_gtk_notebook_page_reordered (GtkNotebook* _sender,
                                                        GtkWidget* child,
                                                        guint page_num,
                                                        gpointer self)
{
	main_window_tab_reordered ((MainWindow*) self, child, page_num);
}

static void
_main_window_tab_removed_gtk_notebook_page_removed (GtkNotebook* _sender,
                                                    GtkWidget* child,
                                                    guint page_num,
                                                    gpointer self)
{
	main_window_tab_removed ((MainWindow*) self, child, page_num);
}

static gpointer
vala_g_array_remove_index (GArray* self,
                           guint index)
{
	gpointer g = NULL;
	gpointer* _tmp0_;
	gint _tmp0__length1;
	gpointer _tmp1_;
	gpointer result;
	g_return_val_if_fail (self != NULL, NULL);
	_vala_assert (self->len > index, "length > index");
	_tmp0_ = self->data;
	_tmp0__length1 = self->len;
	_tmp1_ = _tmp0_[index];
	_tmp0_[index] = NULL;
	g = _tmp1_;
	g_array_remove_index (self, index);
	result = g;
	return result;
}

static gpointer*
vala_g_array_remove_range (GArray* self,
                           guint index,
                           guint length,
                           gint* result_length1)
{
	gpointer* ga = NULL;
	gpointer* _tmp0_;
	gint ga_length1;
	gint _ga_size_;
	gpointer* _tmp6_;
	gint _tmp6__length1;
	gpointer* result;
	g_return_val_if_fail (self != NULL, NULL);
	_vala_assert (self->len >= (index + length), "this.length >= index + length");
	_tmp0_ = g_new0 (gpointer, length);
	ga = _tmp0_;
	ga_length1 = length;
	_ga_size_ = ga_length1;
	{
		guint i = 0U;
		i = (guint) 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				gpointer* _tmp3_;
				gint _tmp3__length1;
				gpointer* _tmp4_;
				gint _tmp4__length1;
				gpointer _tmp5_;
				if (!_tmp1_) {
					guint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				if (!(i < length)) {
					break;
				}
				_tmp3_ = ga;
				_tmp3__length1 = ga_length1;
				_tmp4_ = self->data;
				_tmp4__length1 = self->len;
				_tmp5_ = _tmp4_[i + index];
				_tmp4_[i + index] = NULL;
				_tmp3_[i] = _tmp5_;
			}
		}
	}
	g_array_remove_range (self, index, length);
	_tmp6_ = ga;
	_tmp6__length1 = ga_length1;
	if (result_length1) {
		*result_length1 = _tmp6__length1;
	}
	result = _tmp6_;
	return result;
}

static void
__lambda247_ (MainWindow* self,
              BraindumpChangeType change,
              const gchar* name_index)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp27_;
	g_return_if_fail (name_index != NULL);
	_tmp0_ = main_window_get_current_map (self, NULL);
	map = _tmp0_;
	switch (change) {
		case BRAINDUMP_CHANGE_TYPE_ADD:
		{
			MindMap* _tmp1_;
			MapModel* _tmp2_;
			MapModel* _tmp3_;
			GArray* _tmp4_;
			GArray* _tmp5_;
			gchar* _tmp6_;
			_tmp1_ = map;
			_tmp2_ = mind_map_get_model (_tmp1_);
			_tmp3_ = _tmp2_;
			_tmp4_ = map_model_get_braindump (_tmp3_);
			_tmp5_ = _tmp4_;
			_tmp6_ = g_strdup (name_index);
			g_array_append_val (_tmp5_, _tmp6_);
			break;
		}
		case BRAINDUMP_CHANGE_TYPE_REMOVE:
		{
			MindMap* _tmp7_;
			MapModel* _tmp8_;
			MapModel* _tmp9_;
			GArray* _tmp10_;
			GArray* _tmp11_;
			gchar* _tmp12_;
			gchar* _tmp13_;
			_tmp7_ = map;
			_tmp8_ = mind_map_get_model (_tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = map_model_get_braindump (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = vala_g_array_remove_index (_tmp11_, (guint) atoi (name_index));
			_tmp13_ = _tmp12_;
			_g_free0 (_tmp13_);
			break;
		}
		case BRAINDUMP_CHANGE_TYPE_CLEAR:
		{
			MindMap* _tmp14_;
			MapModel* _tmp15_;
			MapModel* _tmp16_;
			GArray* _tmp17_;
			GArray* _tmp18_;
			MindMap* _tmp19_;
			MapModel* _tmp20_;
			MapModel* _tmp21_;
			GArray* _tmp22_;
			GArray* _tmp23_;
			gint _tmp24_ = 0;
			gpointer* _tmp25_;
			gchar** _tmp26_;
			gint _tmp26__length1;
			_tmp14_ = map;
			_tmp15_ = mind_map_get_model (_tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = map_model_get_braindump (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = map;
			_tmp20_ = mind_map_get_model (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp22_ = map_model_get_braindump (_tmp21_);
			_tmp23_ = _tmp22_;
			_tmp25_ = vala_g_array_remove_range (_tmp18_, (guint) 0, _tmp23_->len, &_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp26__length1 = _tmp24_;
			_tmp26_ = (_vala_array_free (_tmp26_, _tmp26__length1, (GDestroyNotify) g_free), NULL);
			break;
		}
		default:
		break;
	}
	_tmp27_ = map;
	mind_map_auto_save (_tmp27_);
	_mind_map_unref0 (map);
}

static void
___lambda247__braindump_ideas_changed (Braindump* _sender,
                                       BraindumpChangeType change,
                                       const gchar* name_index,
                                       gpointer self)
{
	__lambda247_ ((MainWindow*) self, change, name_index);
}

static void
__lambda248_ (MainWindow* self)
{
	main_window_execute_command (self, KEY_COMMAND_FILE_NEW);
}

static void
___lambda248__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda248_ ((MainWindow*) self);
}

static void
__lambda249_ (MainWindow* self)
{
	main_window_execute_command (self, KEY_COMMAND_FILE_OPEN);
}

static void
___lambda249__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda249_ ((MainWindow*) self);
}

static void
__lambda250_ (MainWindow* self)
{
	main_window_execute_command (self, KEY_COMMAND_FILE_SAVE_AS);
}

static void
___lambda250__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda250_ ((MainWindow*) self);
}

static void
__lambda251_ (MainWindow* self)
{
	main_window_execute_command (self, KEY_COMMAND_UNDO_ACTION);
}

static void
___lambda251__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda251_ ((MainWindow*) self);
}

static void
__lambda252_ (MainWindow* self)
{
	main_window_execute_command (self, KEY_COMMAND_REDO_ACTION);
}

static void
___lambda252__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda252_ ((MainWindow*) self);
}

static gboolean
__lambda274_ (MainWindow* self)
{
	gboolean result;
	result = FALSE;
	return result;
}

static gboolean
___lambda274__gtk_paned_move_handle (GtkPaned* _sender,
                                     GtkScrollType scroll_type,
                                     gpointer self)
{
	gboolean result;
	result = __lambda274_ ((MainWindow*) self);
	return result;
}

static void
__lambda275_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkPaned* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_pane;
	_tmp2_ = gtk_paned_get_position (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_int (_tmp0_, "properties-width", _tmp3_);
}

static void
___lambda275__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda275_ ((MainWindow*) self);
}

static void
__lambda276_ (MainWindow* self,
              const gchar* key)
{
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	static GQuark _tmp1_label2 = 0;
	static GQuark _tmp1_label3 = 0;
	static GQuark _tmp1_label4 = 0;
	static GQuark _tmp1_label5 = 0;
	static GQuark _tmp1_label6 = 0;
	g_return_if_fail (key != NULL);
	_tmp0_ = key;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if ((_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("text-field-use-custom-font-size")))) || (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("text-field-custom-font-size"))))) {
		switch (0) {
			default:
			{
				main_window_setting_changed_text_size (self);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("enable-animations")))) {
		switch (0) {
			default:
			{
				main_window_setting_changed_animations (self);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("enable-ui-animations")))) {
		switch (0) {
			default:
			{
				main_window_setting_changed_ui_animations (self);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label4) ? _tmp1_label4 : (_tmp1_label4 = g_quark_from_static_string ("auto-parse-embedded-urls")))) {
		switch (0) {
			default:
			{
				main_window_setting_changed_embedded_urls (self);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label5) ? _tmp1_label5 : (_tmp1_label5 = g_quark_from_static_string ("enable-markdown")))) {
		switch (0) {
			default:
			{
				main_window_setting_changed_markdown (self);
				break;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label6) ? _tmp1_label6 : (_tmp1_label6 = g_quark_from_static_string ("enable-unicode-input")))) {
		switch (0) {
			default:
			{
				main_window_setting_changed_unicode_input (self);
				break;
			}
		}
	}
}

static void
___lambda276__g_settings_changed (GSettings* _sender,
                                  const gchar* key,
                                  gpointer self)
{
	__lambda276_ ((MainWindow*) self, key);
}

static void
__lambda277_ (Block30Data* _data30_)
{
	MainWindow* self;
	GraniteSettingsColorScheme _tmp0_;
	GraniteSettingsColorScheme _tmp1_;
	self = _data30_->self;
	_tmp0_ = granite_settings_get_prefers_color_scheme (_data30_->granite_settings);
	_tmp1_ = _tmp0_;
	main_window_on_dark_mode_changed (self, _tmp1_ == GRANITE_SETTINGS_COLOR_SCHEME_DARK);
}

static void
___lambda277__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda277_ (self);
}

static void
__lambda278_ (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	_tmp0_ = main_window_get_current_map (self, NULL);
	map = _tmp0_;
	main_window_update_title (self, map);
	_mind_map_unref0 (map);
}

static void
___lambda278__gtk_event_controller_focus_enter (GtkEventControllerFocus* _sender,
                                                gpointer self)
{
	__lambda278_ ((MainWindow*) self);
}

static gboolean
__lambda279_ (MainWindow* self)
{
	gboolean result;
	main_window_save_window_size (self);
	main_window_save_tabs (self);
	result = FALSE;
	return result;
}

static gboolean
___lambda279__gtk_window_close_request (GtkWindow* _sender,
                                        gpointer self)
{
	gboolean result;
	result = __lambda279_ ((MainWindow*) self);
	return result;
}

MainWindow*
main_window_construct (GType object_type,
                       GtkApplication* app,
                       GSettings* settings)
{
	MainWindow * self = NULL;
	Block30Data* _data30_;
	GSettings* _tmp0_;
	Templates* _tmp1_;
	gint window_w = 0;
	gint window_h = 0;
	Exports* _tmp2_;
	GtkLabel* _tmp3_;
	GtkHeaderBar* _tmp4_ = NULL;
	GtkHeaderBar* _tmp5_;
	Shortcuts* _tmp6_;
	Shortcuts* _tmp7_;
	GeeHashMap* _tmp8_;
	GSimpleActionGroup* _tmp9_;
	GSimpleActionGroup* _tmp10_;
	GtkNotebook* _tmp11_ = NULL;
	GtkNotebook* _tmp12_;
	GtkNotebook* _tmp13_;
	GtkNotebook* _tmp14_;
	Braindump* _tmp15_ = NULL;
	Braindump* _tmp16_;
	GtkBox* content = NULL;
	GtkBox* _tmp17_;
	GtkBox* _tmp18_;
	GtkNotebook* _tmp19_;
	GtkBox* _tmp20_;
	Braindump* _tmp21_;
	GtkButton* new_btn = NULL;
	gchar* _tmp22_;
	gchar* _tmp23_;
	GtkButton* _tmp24_;
	GtkButton* _tmp25_;
	GtkButton* _tmp26_;
	GtkButton* _tmp27_;
	GtkHeaderBar* _tmp28_;
	GtkButton* _tmp29_;
	GtkButton* open_btn = NULL;
	gchar* _tmp30_;
	gchar* _tmp31_;
	GtkButton* _tmp32_;
	GtkButton* _tmp33_;
	GtkButton* _tmp34_;
	GtkButton* _tmp35_;
	GtkHeaderBar* _tmp36_;
	GtkButton* _tmp37_;
	GtkButton* save_btn = NULL;
	gchar* _tmp38_;
	gchar* _tmp39_;
	GtkButton* _tmp40_;
	GtkButton* _tmp41_;
	GtkButton* _tmp42_;
	GtkButton* _tmp43_;
	GtkHeaderBar* _tmp44_;
	GtkButton* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	GtkButton* _tmp48_ = NULL;
	GtkButton* _tmp49_;
	GtkButton* _tmp50_;
	GtkHeaderBar* _tmp51_;
	GtkButton* _tmp52_;
	gchar* _tmp53_;
	gchar* _tmp54_;
	GtkButton* _tmp55_ = NULL;
	GtkButton* _tmp56_;
	GtkButton* _tmp57_;
	GtkHeaderBar* _tmp58_;
	GtkButton* _tmp59_;
	UnicodeInsert* _tmp60_;
	GtkBox* _tmp61_;
	GtkWidget* _tmp62_;
	GSettings* _tmp63_;
	GtkPaned* _tmp64_ = NULL;
	GtkPaned* _tmp65_;
	GtkPaned* _tmp66_;
	GtkPaned* _tmp67_;
	GSettings* _tmp68_;
	gint _tmp73_ = 0;
	GraniteSettings* _tmp74_;
	GraniteSettings* _tmp75_;
	GraniteSettingsColorScheme _tmp76_;
	GraniteSettingsColorScheme _tmp77_;
	GtkEventControllerFocus* focus = NULL;
	GtkEventControllerFocus* _tmp78_;
	GtkPaned* _tmp79_;
	GtkEventController* _tmp80_;
	Exports* _tmp81_;
	Templates* _tmp82_;
	g_return_val_if_fail (app != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	_data30_ = g_slice_new0 (Block30Data);
	_data30_->_ref_count_ = 1;
	self = (MainWindow*) g_object_new (object_type, "application", app, NULL);
	_data30_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (settings);
	_g_object_unref0 (self->priv->_settings);
	self->priv->_settings = _tmp0_;
	_tmp1_ = templates_new ();
	_templates_unref0 (self->priv->_templates);
	self->priv->_templates = _tmp1_;
	window_w = g_settings_get_int (settings, "window-w");
	window_h = g_settings_get_int (settings, "window-h");
	_tmp2_ = exports_new (TRUE);
	_exports_unref0 (self->priv->_exports);
	self->priv->_exports = _tmp2_;
	_tmp3_ = (GtkLabel*) gtk_label_new (_ ("Minder"));
	g_object_ref_sink (_tmp3_);
	_tmp4_ = (GtkHeaderBar*) gtk_header_bar_new ();
	gtk_header_bar_set_show_title_buttons (_tmp4_, TRUE);
	gtk_header_bar_set_title_widget (_tmp4_, (GtkWidget*) _tmp3_);
	_g_object_unref0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->_header);
	self->priv->_header = _tmp4_;
	_tmp5_ = self->priv->_header;
	gtk_window_set_titlebar ((GtkWindow*) self, (GtkWidget*) _tmp5_);
	gtk_window_set_default_size ((GtkWindow*) self, window_w, window_h);
	_tmp6_ = shortcuts_new ();
	_shortcuts_unref0 (self->priv->_shortcuts);
	self->priv->_shortcuts = _tmp6_;
	_tmp7_ = self->priv->_shortcuts;
	g_signal_connect_object (_tmp7_, "shortcut-changed", (GCallback) _main_window_shortcut_changed_shortcuts_shortcut_changed, self, 0);
	_tmp8_ = gee_hash_map_new (TYPE_KEY_COMMAND, NULL, NULL, TYPE_SHORTCUT_TOOLTIP, (GBoxedCopyFunc) shortcut_tooltip_ref, (GDestroyNotify) shortcut_tooltip_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->_shortcut_widgets);
	self->priv->_shortcut_widgets = _tmp8_;
	_tmp9_ = g_simple_action_group_new ();
	_g_object_unref0 (self->priv->_actions);
	self->priv->_actions = _tmp9_;
	_tmp10_ = self->priv->_actions;
	gtk_widget_insert_action_group ((GtkWidget*) self, "win", (GActionGroup*) _tmp10_);
	_tmp11_ = (GtkNotebook*) gtk_notebook_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp11_, GTK_ALIGN_FILL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp11_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp11_, GTK_ALIGN_FILL);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp11_, TRUE);
	gtk_notebook_set_scrollable (_tmp11_, TRUE);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->_nb);
	self->priv->_nb = _tmp11_;
	_tmp12_ = self->priv->_nb;
	g_signal_connect_object (_tmp12_, "switch-page", (GCallback) _main_window_tab_switched_gtk_notebook_switch_page, self, 0);
	_tmp13_ = self->priv->_nb;
	g_signal_connect_object (_tmp13_, "page-reordered", (GCallback) _main_window_tab_reordered_gtk_notebook_page_reordered, self, 0);
	_tmp14_ = self->priv->_nb;
	g_signal_connect_object (_tmp14_, "page-removed", (GCallback) _main_window_tab_removed_gtk_notebook_page_removed, self, 0);
	main_window_set_action_for_command (self, KEY_COMMAND_TAB_GOTO_NEXT, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_TAB_GOTO_PREV, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_TAB_CLOSE_CURRENT, TRUE);
	_tmp15_ = braindump_new (self);
	gtk_widget_set_halign ((GtkWidget*) _tmp15_, GTK_ALIGN_START);
	gtk_widget_set_hexpand_set ((GtkWidget*) _tmp15_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp15_, GTK_ALIGN_FILL);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp15_, TRUE);
	gtk_widget_set_visible ((GtkWidget*) _tmp15_, FALSE);
	g_object_ref_sink (_tmp15_);
	_g_object_unref0 (self->priv->_brain);
	self->priv->_brain = _tmp15_;
	_tmp16_ = self->priv->_brain;
	g_signal_connect_object (_tmp16_, "ideas-changed", (GCallback) ___lambda247__braindump_ideas_changed, self, 0);
	_tmp17_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp17_);
	content = _tmp17_;
	_tmp18_ = content;
	_tmp19_ = self->priv->_nb;
	gtk_box_append (_tmp18_, (GtkWidget*) _tmp19_);
	_tmp20_ = content;
	_tmp21_ = self->priv->_brain;
	gtk_box_append (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = main_window_get_icon_name (self, "document-new");
	_tmp23_ = _tmp22_;
	_tmp24_ = (GtkButton*) gtk_button_new_from_icon_name (_tmp23_);
	g_object_ref_sink (_tmp24_);
	_tmp25_ = _tmp24_;
	_g_free0 (_tmp23_);
	new_btn = _tmp25_;
	_tmp26_ = new_btn;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp26_, KEY_COMMAND_FILE_NEW, _ ("New File"));
	_tmp27_ = new_btn;
	g_signal_connect_object (_tmp27_, "clicked", (GCallback) ___lambda248__gtk_button_clicked, self, 0);
	_tmp28_ = self->priv->_header;
	_tmp29_ = new_btn;
	gtk_header_bar_pack_start (_tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = main_window_get_icon_name (self, "document-open");
	_tmp31_ = _tmp30_;
	_tmp32_ = (GtkButton*) gtk_button_new_from_icon_name (_tmp31_);
	g_object_ref_sink (_tmp32_);
	_tmp33_ = _tmp32_;
	_g_free0 (_tmp31_);
	open_btn = _tmp33_;
	_tmp34_ = open_btn;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp34_, KEY_COMMAND_FILE_OPEN, _ ("Open File"));
	_tmp35_ = open_btn;
	g_signal_connect_object (_tmp35_, "clicked", (GCallback) ___lambda249__gtk_button_clicked, self, 0);
	_tmp36_ = self->priv->_header;
	_tmp37_ = open_btn;
	gtk_header_bar_pack_start (_tmp36_, (GtkWidget*) _tmp37_);
	_tmp38_ = main_window_get_icon_name (self, "document-save-as");
	_tmp39_ = _tmp38_;
	_tmp40_ = (GtkButton*) gtk_button_new_from_icon_name (_tmp39_);
	g_object_ref_sink (_tmp40_);
	_tmp41_ = _tmp40_;
	_g_free0 (_tmp39_);
	save_btn = _tmp41_;
	_tmp42_ = save_btn;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp42_, KEY_COMMAND_FILE_SAVE_AS, _ ("Save File As"));
	_tmp43_ = save_btn;
	g_signal_connect_object (_tmp43_, "clicked", (GCallback) ___lambda250__gtk_button_clicked, self, 0);
	_tmp44_ = self->priv->_header;
	_tmp45_ = save_btn;
	gtk_header_bar_pack_start (_tmp44_, (GtkWidget*) _tmp45_);
	_tmp46_ = main_window_get_icon_name (self, "edit-undo");
	_tmp47_ = _tmp46_;
	_tmp48_ = (GtkButton*) gtk_button_new_from_icon_name (_tmp47_);
	gtk_widget_set_sensitive ((GtkWidget*) _tmp48_, FALSE);
	g_object_ref_sink (_tmp48_);
	_g_object_unref0 (self->priv->_undo_btn);
	self->priv->_undo_btn = _tmp48_;
	_g_free0 (_tmp47_);
	_tmp49_ = self->priv->_undo_btn;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp49_, KEY_COMMAND_UNDO_ACTION, _ ("Undo"));
	_tmp50_ = self->priv->_undo_btn;
	g_signal_connect_object (_tmp50_, "clicked", (GCallback) ___lambda251__gtk_button_clicked, self, 0);
	_tmp51_ = self->priv->_header;
	_tmp52_ = self->priv->_undo_btn;
	gtk_header_bar_pack_start (_tmp51_, (GtkWidget*) _tmp52_);
	_tmp53_ = main_window_get_icon_name (self, "edit-redo");
	_tmp54_ = _tmp53_;
	_tmp55_ = (GtkButton*) gtk_button_new_from_icon_name (_tmp54_);
	gtk_widget_set_sensitive ((GtkWidget*) _tmp55_, FALSE);
	g_object_ref_sink (_tmp55_);
	_g_object_unref0 (self->priv->_redo_btn);
	self->priv->_redo_btn = _tmp55_;
	_g_free0 (_tmp54_);
	_tmp56_ = self->priv->_redo_btn;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp56_, KEY_COMMAND_REDO_ACTION, _ ("Redo"));
	_tmp57_ = self->priv->_redo_btn;
	g_signal_connect_object (_tmp57_, "clicked", (GCallback) ___lambda252__gtk_button_clicked, self, 0);
	_tmp58_ = self->priv->_header;
	_tmp59_ = self->priv->_redo_btn;
	gtk_header_bar_pack_start (_tmp58_, (GtkWidget*) _tmp59_);
	_tmp60_ = unicode_insert_new ();
	_unicode_insert_unref0 (self->priv->_unicoder);
	self->priv->_unicoder = _tmp60_;
	main_window_add_property_button (self);
	main_window_add_miscellaneous_button (self);
	main_window_add_export_button (self);
	main_window_add_search_button (self);
	main_window_add_zoom_button (self);
	main_window_add_focus_button (self);
	main_window_add_braindump_button (self);
	main_window_add_debug_button (self);
	_tmp61_ = content;
	_tmp62_ = _g_object_ref0 ((GtkWidget*) _tmp61_);
	_tmp63_ = self->priv->_settings;
	_tmp64_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	gtk_widget_set_halign ((GtkWidget*) _tmp64_, GTK_ALIGN_FILL);
	gtk_widget_set_valign ((GtkWidget*) _tmp64_, GTK_ALIGN_FILL);
	gtk_paned_set_start_child (_tmp64_, _tmp62_);
	_g_object_unref0 (_tmp62_);
	gtk_paned_set_resize_end_child (_tmp64_, FALSE);
	gtk_paned_set_shrink_end_child (_tmp64_, FALSE);
	gtk_paned_set_position (_tmp64_, g_settings_get_int (_tmp63_, "properties-width"));
	g_object_ref_sink (_tmp64_);
	_g_object_unref0 (self->priv->_pane);
	self->priv->_pane = _tmp64_;
	_tmp65_ = self->priv->_pane;
	g_signal_connect_object (_tmp65_, "move-handle", (GCallback) ___lambda274__gtk_paned_move_handle, self, 0);
	_tmp66_ = self->priv->_pane;
	g_signal_connect_object ((GObject*) _tmp66_, "notify::position", (GCallback) ___lambda275__g_object_notify, self, 0);
	_tmp67_ = self->priv->_pane;
	gtk_window_set_child ((GtkWindow*) self, (GtkWidget*) _tmp67_);
	_tmp68_ = self->priv->_settings;
	if (g_settings_get_boolean (_tmp68_, "current-properties-shown")) {
		main_window_show_properties (self, "current", PROPERTY_GRAB_NONE);
	} else {
		GSettings* _tmp69_;
		_tmp69_ = self->priv->_settings;
		if (g_settings_get_boolean (_tmp69_, "style-properties-shown")) {
			main_window_show_properties (self, "style", PROPERTY_GRAB_NONE);
		} else {
			GSettings* _tmp70_;
			_tmp70_ = self->priv->_settings;
			if (g_settings_get_boolean (_tmp70_, "tag-properties-shown")) {
				main_window_show_properties (self, "tag", PROPERTY_GRAB_NONE);
			} else {
				GSettings* _tmp71_;
				_tmp71_ = self->priv->_settings;
				if (g_settings_get_boolean (_tmp71_, "sticker-properties-shown")) {
					main_window_show_properties (self, "sticker", PROPERTY_GRAB_NONE);
				} else {
					GSettings* _tmp72_;
					_tmp72_ = self->priv->_settings;
					if (g_settings_get_boolean (_tmp72_, "map-properties-shown")) {
						main_window_show_properties (self, "map", PROPERTY_GRAB_NONE);
					}
				}
			}
		}
	}
	if (g_settings_get_boolean (settings, "text-field-use-custom-font-size")) {
		_tmp73_ = g_settings_get_int (settings, "text-field-custom-font-size");
	} else {
		_tmp73_ = -1;
	}
	self->priv->_text_size = _tmp73_;
	g_signal_connect_object (settings, "changed", (GCallback) ___lambda276__g_settings_changed, self, 0);
	_tmp74_ = granite_settings_get_default ();
	_tmp75_ = _g_object_ref0 (_tmp74_);
	_data30_->granite_settings = _tmp75_;
	_tmp76_ = granite_settings_get_prefers_color_scheme (_data30_->granite_settings);
	_tmp77_ = _tmp76_;
	main_window_on_dark_mode_changed (self, _tmp77_ == GRANITE_SETTINGS_COLOR_SCHEME_DARK);
	g_signal_connect_data ((GObject*) _data30_->granite_settings, "notify::prefers-color-scheme", (GCallback) ___lambda277__g_object_notify, block30_data_ref (_data30_), (GClosureNotify) block30_data_unref, 0);
	_tmp78_ = (GtkEventControllerFocus*) gtk_event_controller_focus_new ();
	focus = _tmp78_;
	_tmp79_ = self->priv->_pane;
	_tmp80_ = _g_object_ref0 ((GtkEventController*) focus);
	gtk_widget_add_controller ((GtkWidget*) _tmp79_, _tmp80_);
	g_signal_connect_object (focus, "enter", (GCallback) ___lambda278__gtk_event_controller_focus_enter, self, 0);
	_tmp81_ = self->priv->_exports;
	exports_load (_tmp81_);
	_tmp82_ = self->priv->_templates;
	templates_load (_tmp82_);
	g_signal_connect_object ((GtkWindow*) self, "close-request", (GCallback) ___lambda279__gtk_window_close_request, self, 0);
	main_window_set_action_for_command (self, KEY_COMMAND_FILE_SAVE, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_QUIT, TRUE);
	main_window_set_window_size (self);
	_g_object_unref0 (focus);
	_g_object_unref0 (save_btn);
	_g_object_unref0 (open_btn);
	_g_object_unref0 (new_btn);
	_g_object_unref0 (content);
	block30_data_unref (_data30_);
	_data30_ = NULL;
	return self;
}

MainWindow*
main_window_new (GtkApplication* app,
                 GSettings* settings)
{
	return main_window_construct (TYPE_MAIN_WINDOW, app, settings);
}

static gchar*
main_window_get_icon_name (MainWindow* self,
                           const gchar* icon_name)
{
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (icon_name != NULL, NULL);
	if (self->priv->on_elementary) {
		_tmp0_ = "";
	} else {
		_tmp0_ = "-symbolic";
	}
	_tmp1_ = g_strdup_printf ("%s%s", icon_name, _tmp0_);
	result = _tmp1_;
	return result;
}

static gpointer
_mind_map_ref0 (gpointer self)
{
	return self ? mind_map_ref (self) : NULL;
}

static MindMap*
main_window_get_map (MainWindow* self,
                     gint page)
{
	GtkOverlay* ol = NULL;
	GtkNotebook* _tmp0_;
	GtkWidget* _tmp1_;
	GtkOverlay* _tmp2_;
	DrawArea* da = NULL;
	GtkWidget* _tmp3_;
	GtkWidget* _tmp4_;
	DrawArea* _tmp5_;
	MindMap* _tmp6_;
	MindMap* _tmp7_;
	MindMap* _tmp8_;
	MindMap* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_nb;
	_tmp1_ = gtk_notebook_get_nth_page (_tmp0_, page);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_overlay_get_type (), GtkOverlay));
	ol = _tmp2_;
	_tmp3_ = gtk_overlay_get_child (ol);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_DRAW_AREA, DrawArea));
	da = _tmp5_;
	_tmp6_ = draw_area_get_map (da);
	_tmp7_ = _tmp6_;
	_tmp8_ = _mind_map_ref0 (_tmp7_);
	result = _tmp8_;
	_g_object_unref0 (da);
	_g_object_unref0 (ol);
	return result;
}

static gchar*
main_window_get_tab_label_name (MainWindow* self,
                                gint page_num)
{
	GtkWidget* page = NULL;
	GtkNotebook* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* tab = NULL;
	GtkNotebook* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	GtkLabel* label = NULL;
	GtkWidget* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_nb;
	_tmp1_ = gtk_notebook_get_nth_page (_tmp0_, page_num);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	page = _tmp2_;
	_tmp3_ = self->priv->_nb;
	_tmp4_ = gtk_notebook_get_tab_label (_tmp3_, page);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	tab = _tmp5_;
	_tmp6_ = utils_get_child_at_index (tab, 1);
	label = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_label_get_type (), GtkLabel);
	_tmp7_ = gtk_label_get_label (label);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strdup (_tmp8_);
	result = _tmp9_;
	_g_object_unref0 (label);
	_g_object_unref0 (tab);
	_g_object_unref0 (page);
	return result;
}

static void
main_window_set_tab_label_info (MainWindow* self,
                                gint page_num,
                                gboolean editable,
                                const gchar* label,
                                const gchar* tooltip)
{
	GtkWidget* page = NULL;
	GtkNotebook* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* _tmp2_;
	GtkWidget* tab = NULL;
	GtkNotebook* _tmp3_;
	GtkWidget* _tmp4_;
	GtkWidget* _tmp5_;
	GtkImage* lock = NULL;
	GtkWidget* _tmp6_;
	GtkLabel* lbl = NULL;
	GtkWidget* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label != NULL);
	g_return_if_fail (tooltip != NULL);
	_tmp0_ = self->priv->_nb;
	_tmp1_ = gtk_notebook_get_nth_page (_tmp0_, page_num);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	page = _tmp2_;
	_tmp3_ = self->priv->_nb;
	_tmp4_ = gtk_notebook_get_tab_label (_tmp3_, page);
	_tmp5_ = _g_object_ref0 (_tmp4_);
	tab = _tmp5_;
	_tmp6_ = utils_get_child_at_index (tab, 0);
	lock = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_image_get_type (), GtkImage);
	_tmp7_ = utils_get_child_at_index (tab, 1);
	lbl = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_label_get_type (), GtkLabel);
	gtk_widget_set_visible ((GtkWidget*) lock, !editable);
	gtk_label_set_label (lbl, label);
	gtk_widget_set_tooltip_text ((GtkWidget*) lbl, tooltip);
	_g_object_unref0 (lbl);
	_g_object_unref0 (lock);
	_g_object_unref0 (tab);
	_g_object_unref0 (page);
}

static void
main_window_setting_changed_text_size (MainWindow* self)
{
	gint _tmp0_ = 0;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	gint value = 0;
	g_return_if_fail (self != NULL);
	_tmp1_ = main_window_get_settings (self);
	_tmp2_ = _tmp1_;
	if (g_settings_get_boolean (_tmp2_, "text-field-use-custom-font-size")) {
		GSettings* _tmp3_;
		GSettings* _tmp4_;
		_tmp3_ = main_window_get_settings (self);
		_tmp4_ = _tmp3_;
		_tmp0_ = g_settings_get_int (_tmp4_, "text-field-custom-font-size");
	} else {
		_tmp0_ = -1;
	}
	value = _tmp0_;
	self->priv->_text_size = value;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp7_;
				MindMap* map = NULL;
				MindMap* _tmp8_;
				MindMap* _tmp9_;
				MapModel* _tmp10_;
				MapModel* _tmp11_;
				if (!_tmp5_) {
					gint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				_tmp7_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp7_))) {
					break;
				}
				_tmp8_ = main_window_get_map (self, i);
				map = _tmp8_;
				_tmp9_ = map;
				_tmp10_ = mind_map_get_model (_tmp9_);
				_tmp11_ = _tmp10_;
				map_model_update_css (_tmp11_);
				_mind_map_unref0 (map);
			}
		}
	}
}

static void
main_window_setting_changed_ui_animations (MainWindow* self)
{
	gint _tmp0_ = 0;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	gint duration = 0;
	CurrentInspector* current = NULL;
	GtkStack* _tmp3_;
	GtkWidget* _tmp4_;
	CurrentInspector* _tmp5_;
	GtkStack* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp1_ = main_window_get_settings (self);
	_tmp2_ = _tmp1_;
	if (g_settings_get_boolean (_tmp2_, "enable-ui-animations")) {
		_tmp0_ = 500;
	} else {
		_tmp0_ = 0;
	}
	duration = _tmp0_;
	_tmp3_ = self->priv->_stack;
	_tmp4_ = gtk_stack_get_child_by_name (_tmp3_, "current");
	_tmp5_ = _g_object_ref0 (IS_CURRENT_INSPECTOR (_tmp4_) ? ((CurrentInspector*) _tmp4_) : NULL);
	current = _tmp5_;
	_tmp6_ = self->priv->_stack;
	gtk_stack_set_transition_duration (_tmp6_, (guint) duration);
	current_inspector_set_transition_duration (current, duration);
	_g_object_unref0 (current);
}

static void
main_window_setting_changed_animations (MainWindow* self)
{
	gboolean value = FALSE;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_settings (self);
	_tmp1_ = _tmp0_;
	value = g_settings_get_boolean (_tmp1_, "enable-animations");
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp4_;
				MindMap* map = NULL;
				MindMap* _tmp5_;
				MindMap* _tmp6_;
				Animator* _tmp7_;
				Animator* _tmp8_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp4_))) {
					break;
				}
				_tmp5_ = main_window_get_map (self, i);
				map = _tmp5_;
				_tmp6_ = map;
				_tmp7_ = mind_map_get_animator (_tmp6_);
				_tmp8_ = _tmp7_;
				animator_set_enable (_tmp8_, value);
				_mind_map_unref0 (map);
			}
		}
	}
}

static void
main_window_setting_changed_embedded_urls (MainWindow* self)
{
	gboolean value = FALSE;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_settings (self);
	_tmp1_ = _tmp0_;
	value = g_settings_get_boolean (_tmp1_, "auto-parse-embedded-urls");
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp4_;
				MindMap* map = NULL;
				MindMap* _tmp5_;
				MindMap* _tmp6_;
				UrlParser* _tmp7_;
				UrlParser* _tmp8_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp4_))) {
					break;
				}
				_tmp5_ = main_window_get_map (self, i);
				map = _tmp5_;
				_tmp6_ = map;
				_tmp7_ = mind_map_get_url_parser (_tmp6_);
				_tmp8_ = _tmp7_;
				text_parser_set_enable ((TextParser*) _tmp8_, value);
				_mind_map_unref0 (map);
			}
		}
	}
}

static void
main_window_setting_changed_markdown (MainWindow* self)
{
	gboolean value = FALSE;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_settings (self);
	_tmp1_ = _tmp0_;
	value = g_settings_get_boolean (_tmp1_, "enable-markdown");
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp4_;
				MindMap* map = NULL;
				MindMap* _tmp5_;
				MindMap* _tmp6_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp4_))) {
					break;
				}
				_tmp5_ = main_window_get_map (self, i);
				map = _tmp5_;
				_tmp6_ = map;
				mind_map_update_enable_markdown (_tmp6_, value);
				_mind_map_unref0 (map);
			}
		}
	}
}

static void
main_window_setting_changed_unicode_input (MainWindow* self)
{
	gboolean value = FALSE;
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_settings (self);
	_tmp1_ = _tmp0_;
	value = g_settings_get_boolean (_tmp1_, "enable-unicode-input");
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp4_;
				MindMap* map = NULL;
				MindMap* _tmp5_;
				MindMap* _tmp6_;
				UnicodeParser* _tmp7_;
				UnicodeParser* _tmp8_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp4_))) {
					break;
				}
				_tmp5_ = main_window_get_map (self, i);
				map = _tmp5_;
				_tmp6_ = map;
				_tmp7_ = mind_map_get_unicode_parser (_tmp6_);
				_tmp8_ = _tmp7_;
				text_parser_set_enable ((TextParser*) _tmp8_, value);
				_mind_map_unref0 (map);
			}
		}
	}
}

static void
main_window_tab_switched (MainWindow* self,
                          GtkWidget* page,
                          guint page_num)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (page != NULL);
	main_window_tab_changed (self, (gint) page_num);
}

static void
main_window_tab_changed (MainWindow* self,
                         gint page_num)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	UndoBuffer* _tmp1_;
	UndoBuffer* _tmp2_;
	Braindump* _tmp3_;
	MapModel* _tmp4_;
	MapModel* _tmp5_;
	GArray* _tmp6_;
	GArray* _tmp7_;
	GtkToggleButton* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	MapModel* _tmp11_;
	MapModel* _tmp12_;
	gboolean _tmp13_;
	gboolean _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_map (self, page_num);
	map = _tmp0_;
	_tmp1_ = mind_map_current_undo_buffer (map);
	_tmp2_ = _tmp1_;
	main_window_do_buffer_changed (self, _tmp2_);
	_g_object_unref0 (_tmp2_);
	main_window_on_current_changed (self, map);
	main_window_update_title (self, map);
	g_signal_emit (self, main_window_signals[MAIN_WINDOW_CANVAS_CHANGED_SIGNAL], 0, map);
	_tmp3_ = self->priv->_brain;
	_tmp4_ = mind_map_get_model (map);
	_tmp5_ = _tmp4_;
	_tmp6_ = map_model_get_braindump (_tmp5_);
	_tmp7_ = _tmp6_;
	braindump_set_list (_tmp3_, _tmp7_);
	_tmp8_ = self->priv->_brain_btn;
	_tmp9_ = mind_map_get_editable (map);
	_tmp10_ = _tmp9_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, _tmp10_);
	_tmp11_ = mind_map_get_model (map);
	_tmp12_ = _tmp11_;
	_tmp13_ = map_model_get_braindump_shown (_tmp12_);
	_tmp14_ = _tmp13_;
	main_window_set_braindump_ui (self, map, _tmp14_);
	main_window_save_tab_state (self, (guint) page_num);
	_mind_map_unref0 (map);
}

static void
main_window_tab_reordered (MainWindow* self,
                           GtkWidget* w,
                           guint page_num)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (w != NULL);
	main_window_save_tab_state (self, (guint) ((gint) page_num));
}

void
main_window_update_node_sizes (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp2_;
				MindMap* map = NULL;
				MindMap* _tmp3_;
				MindMap* _tmp4_;
				MapModel* _tmp5_;
				MapModel* _tmp6_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp2_))) {
					break;
				}
				_tmp3_ = main_window_get_map (self, i);
				map = _tmp3_;
				_tmp4_ = map;
				_tmp5_ = mind_map_get_model (_tmp4_);
				_tmp6_ = _tmp5_;
				map_model_update_node_sizes (_tmp6_);
				_mind_map_unref0 (map);
			}
		}
	}
}

void
main_window_close_current_tab (MainWindow* self)
{
	GtkNotebook* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_nb;
	g_object_get (_tmp0_, "page", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	main_window_close_tab (self, _tmp2_);
}

static void
main_window_close_tab (MainWindow* self,
                       gint page_num)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Document* _tmp2_;
	Document* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_map (self, page_num);
	map = _tmp0_;
	_tmp1_ = map;
	_tmp2_ = mind_map_get_doc (_tmp1_);
	_tmp3_ = _tmp2_;
	if (document_is_saved (_tmp3_)) {
		MindMap* _tmp4_;
		_tmp4_ = map;
		mind_map_close (_tmp4_);
		main_window_remove_tab (self, &page_num);
	} else {
		MindMap* _tmp5_;
		_tmp5_ = map;
		main_window_show_save_warning (self, _tmp5_);
	}
	_mind_map_unref0 (map);
}

static gint*
_int_dup (gint* self)
{
	gint* dup;
	dup = g_new0 (gint, 1);
	memcpy (dup, self, sizeof (gint));
	return dup;
}

static gpointer
__int_dup0 (gpointer self)
{
	return self ? _int_dup (self) : NULL;
}

static void
main_window_remove_tab (MainWindow* self,
                        gint* page_num)
{
	gint* _tmp0_ = NULL;
	gint* _tmp1_;
	GtkNotebook* _tmp6_;
	GtkNotebook* _tmp7_;
	GtkWidget* _tmp8_;
	GtkNotebook* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp1_ = __int_dup0 (page_num);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		GtkNotebook* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint* _tmp5_;
		_tmp2_ = self->priv->_nb;
		g_object_get (_tmp2_, "page", &_tmp3_, NULL);
		_tmp4_ = _tmp3_;
		_tmp5_ = __int_dup0 (&_tmp4_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp5_;
	}
	_tmp6_ = self->priv->_nb;
	_tmp7_ = self->priv->_nb;
	_tmp8_ = gtk_notebook_get_nth_page (_tmp7_, *_tmp0_);
	gtk_notebook_detach_tab (_tmp6_, _tmp8_);
	_tmp9_ = self->priv->_nb;
	if (gtk_notebook_get_n_pages (_tmp9_) == 0) {
		MindMap* _tmp10_;
		MindMap* _tmp11_;
		_tmp10_ = main_window_add_tab (self, NULL, TAB_ADD_REASON_NEW);
		_tmp11_ = _tmp10_;
		_mind_map_unref0 (_tmp11_);
	}
	_g_free0 (_tmp0_);
}

static void
main_window_tab_removed (MainWindow* self,
                         GtkWidget* w,
                         guint page_num)
{
	GtkNotebook* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (w != NULL);
	_tmp0_ = self->priv->_nb;
	g_object_get (_tmp0_, "page", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	main_window_save_tab_state (self, (guint) _tmp2_);
}

MindMap*
main_window_create_map (MainWindow* self)
{
	MindMap* map = NULL;
	GSettings* _tmp0_;
	MindMap* _tmp1_;
	MindMap* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_settings;
	_tmp1_ = mind_map_new (self, _tmp0_);
	map = _tmp1_;
	result = map;
	return result;
}

static Block31Data*
block31_data_ref (Block31Data* _data31_)
{
	g_atomic_int_inc (&_data31_->_ref_count_);
	return _data31_;
}

static void
block31_data_unref (void * _userdata_)
{
	Block31Data* _data31_;
	_data31_ = (Block31Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data31_->_ref_count_)) {
		MainWindow* self;
		self = _data31_->self;
		_g_object_unref0 (_data31_->tab_revealer);
		_g_object_unref0 (_data31_->tab_close);
		_mind_map_unref0 (_data31_->map);
		_g_object_unref0 (self);
		g_slice_free (Block31Data, _data31_);
	}
}

static void
_main_window_on_current_changed_mind_map_current_changed (MindMap* _sender,
                                                          MindMap* map,
                                                          gpointer self)
{
	main_window_on_current_changed ((MainWindow*) self, map);
}

static void
_main_window_change_scale_mind_map_scale_changed (MindMap* _sender,
                                                  gdouble scale,
                                                  gpointer self)
{
	main_window_change_scale ((MainWindow*) self, scale);
}

static void
_main_window_change_origin_mind_map_scroll_changed (MindMap* _sender,
                                                    gpointer self)
{
	main_window_change_origin ((MainWindow*) self);
}

static void
_main_window_show_properties_mind_map_show_properties (MindMap* _sender,
                                                       const gchar* tab,
                                                       PropertyGrab grab_type,
                                                       gpointer self)
{
	main_window_show_properties ((MainWindow*) self, tab, grab_type);
}

static void
_main_window_hide_properties_mind_map_hide_properties (MindMap* _sender,
                                                       gpointer self)
{
	main_window_hide_properties ((MainWindow*) self);
}

static void
_main_window_do_buffer_changed_undo_buffer_buffer_changed (UndoBuffer* _sender,
                                                           UndoBuffer* buf,
                                                           gpointer self)
{
	main_window_do_buffer_changed ((MainWindow*) self, buf);
}

static void
_main_window_on_editable_changed_mind_map_editable_changed (MindMap* _sender,
                                                            MindMap* map,
                                                            gpointer self)
{
	main_window_on_editable_changed ((MainWindow*) self, map);
}

static void
__lambda180_ (Block31Data* _data31_)
{
	MainWindow* self;
	MindMap* _tmp0_;
	self = _data31_->self;
	_tmp0_ = _data31_->map;
	main_window_on_tag_highlight_changed (self, _tmp0_);
}

static void
___lambda180__tags_changed (Tags* _sender,
                            gpointer self)
{
	__lambda180_ (self);
}

static void
__lambda181_ (Block31Data* _data31_)
{
	MainWindow* self;
	const gchar* _tmp0_ = NULL;
	MindMap* _tmp1_;
	Document* _tmp2_;
	Document* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkButton* _tmp6_;
	self = _data31_->self;
	_tmp1_ = _data31_->map;
	_tmp2_ = mind_map_get_doc (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = document_get_save_needed (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		_tmp0_ = "media-record-symbolic";
	} else {
		_tmp0_ = "window-close-symbolic";
	}
	_tmp6_ = _data31_->tab_close;
	gtk_button_set_icon_name (_tmp6_, _tmp0_);
}

static void
___lambda181__document_save_changed (Document* _sender,
                                     gpointer self)
{
	__lambda181_ (self);
}

static void
__lambda182_ (Block31Data* _data31_,
              gdouble x,
              gdouble y)
{
	MainWindow* self;
	GtkRevealer* _tmp0_;
	self = _data31_->self;
	_tmp0_ = _data31_->tab_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, TRUE);
}

static void
___lambda182__gtk_event_controller_motion_enter (GtkEventControllerMotion* _sender,
                                                 gdouble x,
                                                 gdouble y,
                                                 gpointer self)
{
	__lambda182_ (self, x, y);
}

static void
__lambda183_ (Block31Data* _data31_)
{
	MainWindow* self;
	GtkRevealer* _tmp0_;
	GtkNotebook* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	self = _data31_->self;
	_tmp0_ = _data31_->tab_revealer;
	_tmp1_ = self->priv->_nb;
	g_object_get (_tmp1_, "page", &_tmp2_, NULL);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, _tmp3_ == _data31_->tab_index);
}

static void
___lambda183__gtk_event_controller_motion_leave (GtkEventControllerMotion* _sender,
                                                 gpointer self)
{
	__lambda183_ (self);
}

static void
__lambda184_ (Block31Data* _data31_)
{
	MainWindow* self;
	self = _data31_->self;
	main_window_close_tab (self, _data31_->tab_index);
}

static void
___lambda184__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda184_ (self);
}

MindMap*
main_window_add_tab (MainWindow* self,
                     const gchar* fname,
                     TabAddReason reason)
{
	Block31Data* _data31_;
	GSettings* _tmp0_;
	MindMap* _tmp1_;
	MindMap* _tmp2_;
	MindMap* _tmp3_;
	MindMap* _tmp4_;
	MindMap* _tmp5_;
	MindMap* _tmp6_;
	MindMap* _tmp7_;
	UndoBuffer* _tmp8_;
	UndoBuffer* _tmp9_;
	MindMap* _tmp10_;
	UndoTextBuffer* _tmp11_;
	UndoTextBuffer* _tmp12_;
	MindMap* _tmp13_;
	MindMap* _tmp14_;
	Tags* _tmp15_;
	Tags* _tmp16_;
	MindMap* _tmp17_;
	Animator* _tmp18_;
	Animator* _tmp19_;
	GSettings* _tmp20_;
	GtkOverlay* overlay = NULL;
	MindMap* _tmp24_;
	DrawArea* _tmp25_;
	DrawArea* _tmp26_;
	GtkWidget* _tmp27_;
	GtkOverlay* _tmp28_ = NULL;
	GtkImage* tab_lock = NULL;
	MindMap* _tmp29_;
	gboolean _tmp30_;
	gboolean _tmp31_;
	GtkImage* _tmp32_ = NULL;
	GtkImage* _tmp33_;
	GtkLabel* tab_label = NULL;
	MindMap* _tmp34_;
	Document* _tmp35_;
	Document* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	MindMap* _tmp40_;
	Document* _tmp41_;
	Document* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	GtkLabel* _tmp45_ = NULL;
	GtkLabel* _tmp46_;
	GtkLabel* _tmp47_;
	GtkButton* _tmp48_ = NULL;
	GtkButton* _tmp49_;
	MindMap* _tmp50_;
	Document* _tmp51_;
	Document* _tmp52_;
	GtkButton* _tmp53_;
	GtkWidget* _tmp54_;
	GtkRevealer* _tmp55_ = NULL;
	GtkBox* tab_box = NULL;
	GtkBox* _tmp56_;
	GtkBox* _tmp57_;
	GtkImage* _tmp58_;
	GtkBox* _tmp59_;
	GtkLabel* _tmp60_;
	GtkBox* _tmp61_;
	GtkRevealer* _tmp62_;
	GtkEventControllerMotion* tab_motion = NULL;
	GtkEventControllerMotion* _tmp63_;
	GtkBox* _tmp64_;
	GtkEventControllerMotion* _tmp65_;
	GtkEventController* _tmp66_;
	GtkNotebook* _tmp67_;
	GtkOverlay* _tmp68_;
	GtkBox* _tmp69_;
	GtkEventControllerMotion* _tmp70_;
	GtkEventControllerMotion* _tmp71_;
	GtkButton* _tmp72_;
	MindMap* _tmp73_;
	MindMap* _tmp78_;
	DrawArea* _tmp79_;
	DrawArea* _tmp80_;
	MindMap* _tmp81_;
	MindMap* _tmp82_;
	MindMap* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data31_ = g_slice_new0 (Block31Data);
	_data31_->_ref_count_ = 1;
	_data31_->self = g_object_ref (self);
	_tmp0_ = self->priv->_settings;
	_tmp1_ = mind_map_new (self, _tmp0_);
	_data31_->map = _tmp1_;
	_tmp2_ = _data31_->map;
	g_signal_connect_object (_tmp2_, "current-changed", (GCallback) _main_window_on_current_changed_mind_map_current_changed, self, 0);
	_tmp3_ = _data31_->map;
	g_signal_connect_object (_tmp3_, "scale-changed", (GCallback) _main_window_change_scale_mind_map_scale_changed, self, 0);
	_tmp4_ = _data31_->map;
	g_signal_connect_object (_tmp4_, "scroll-changed", (GCallback) _main_window_change_origin_mind_map_scroll_changed, self, 0);
	_tmp5_ = _data31_->map;
	g_signal_connect_object (_tmp5_, "show-properties", (GCallback) _main_window_show_properties_mind_map_show_properties, self, 0);
	_tmp6_ = _data31_->map;
	g_signal_connect_object (_tmp6_, "hide-properties", (GCallback) _main_window_hide_properties_mind_map_hide_properties, self, 0);
	_tmp7_ = _data31_->map;
	_tmp8_ = mind_map_get_undo_buffer (_tmp7_);
	_tmp9_ = _tmp8_;
	g_signal_connect_object (_tmp9_, "buffer-changed", (GCallback) _main_window_do_buffer_changed_undo_buffer_buffer_changed, self, 0);
	_tmp10_ = _data31_->map;
	_tmp11_ = mind_map_get_undo_text (_tmp10_);
	_tmp12_ = _tmp11_;
	g_signal_connect_object ((UndoBuffer*) _tmp12_, "buffer-changed", (GCallback) _main_window_do_buffer_changed_undo_buffer_buffer_changed, self, 0);
	_tmp13_ = _data31_->map;
	g_signal_connect_object (_tmp13_, "editable-changed", (GCallback) _main_window_on_editable_changed_mind_map_editable_changed, self, 0);
	_tmp14_ = _data31_->map;
	_tmp15_ = mind_map_get_highlighted (_tmp14_);
	_tmp16_ = _tmp15_;
	g_signal_connect_data (_tmp16_, "changed", (GCallback) ___lambda180__tags_changed, block31_data_ref (_data31_), (GClosureNotify) block31_data_unref, 0);
	_tmp17_ = _data31_->map;
	_tmp18_ = mind_map_get_animator (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = self->priv->_settings;
	animator_set_enable (_tmp19_, g_settings_get_boolean (_tmp20_, "enable-animations"));
	if (fname != NULL) {
		MindMap* _tmp21_;
		Document* _tmp22_;
		Document* _tmp23_;
		_tmp21_ = _data31_->map;
		_tmp22_ = mind_map_get_doc (_tmp21_);
		_tmp23_ = _tmp22_;
		document_load_filename (_tmp23_, fname, reason == TAB_ADD_REASON_OPEN);
	}
	_tmp24_ = _data31_->map;
	_tmp25_ = mind_map_get_canvas (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = _g_object_ref0 ((GtkWidget*) _tmp26_);
	_tmp28_ = (GtkOverlay*) gtk_overlay_new ();
	gtk_overlay_set_child (_tmp28_, _tmp27_);
	_g_object_unref0 (_tmp27_);
	g_object_ref_sink (_tmp28_);
	overlay = _tmp28_;
	_tmp29_ = _data31_->map;
	_tmp30_ = mind_map_get_editable (_tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = (GtkImage*) gtk_image_new_from_icon_name ("system-lock-screen-symbolic");
	gtk_widget_set_halign ((GtkWidget*) _tmp32_, GTK_ALIGN_START);
	gtk_widget_set_visible ((GtkWidget*) _tmp32_, !_tmp31_);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp32_, 10);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp32_, 5);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp32_, 5);
	g_object_ref_sink (_tmp32_);
	tab_lock = _tmp32_;
	_tmp33_ = tab_lock;
	gtk_widget_add_css_class ((GtkWidget*) _tmp33_, "tab");
	_tmp34_ = _data31_->map;
	_tmp35_ = mind_map_get_doc (_tmp34_);
	_tmp36_ = _tmp35_;
	_tmp37_ = document_get_label (_tmp36_);
	_tmp38_ = _tmp37_;
	_tmp39_ = _tmp38_;
	_tmp40_ = _data31_->map;
	_tmp41_ = mind_map_get_doc (_tmp40_);
	_tmp42_ = _tmp41_;
	_tmp43_ = document_get_label (_tmp42_);
	_tmp44_ = _tmp43_;
	_tmp45_ = (GtkLabel*) gtk_label_new (_tmp39_);
	gtk_widget_set_halign ((GtkWidget*) _tmp45_, GTK_ALIGN_CENTER);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp45_, TRUE);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp45_, 5);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp45_, 5);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp45_, 5);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp45_, 5);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp45_, _tmp44_);
	_g_free0 (_tmp44_);
	g_object_ref_sink (_tmp45_);
	_tmp46_ = _tmp45_;
	_g_free0 (_tmp39_);
	tab_label = _tmp46_;
	_tmp47_ = tab_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp47_, "tab");
	_tmp48_ = (GtkButton*) gtk_button_new_from_icon_name ("window-close-symbolic");
	gtk_button_set_has_frame (_tmp48_, FALSE);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp48_, 10);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp48_, 5);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp48_, 5);
	g_object_ref_sink (_tmp48_);
	_data31_->tab_close = _tmp48_;
	_tmp49_ = _data31_->tab_close;
	gtk_widget_add_css_class ((GtkWidget*) _tmp49_, "tab");
	_tmp50_ = _data31_->map;
	_tmp51_ = mind_map_get_doc (_tmp50_);
	_tmp52_ = _tmp51_;
	g_signal_connect_data (_tmp52_, "save-changed", (GCallback) ___lambda181__document_save_changed, block31_data_ref (_data31_), (GClosureNotify) block31_data_unref, 0);
	_tmp53_ = _data31_->tab_close;
	_tmp54_ = _g_object_ref0 ((GtkWidget*) _tmp53_);
	_tmp55_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp55_, GTK_ALIGN_END);
	gtk_revealer_set_reveal_child (_tmp55_, TRUE);
	gtk_revealer_set_transition_type (_tmp55_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_revealer_set_child (_tmp55_, _tmp54_);
	_g_object_unref0 (_tmp54_);
	g_object_ref_sink (_tmp55_);
	_data31_->tab_revealer = _tmp55_;
	_tmp56_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
	g_object_ref_sink (_tmp56_);
	tab_box = _tmp56_;
	_tmp57_ = tab_box;
	_tmp58_ = tab_lock;
	gtk_box_append (_tmp57_, (GtkWidget*) _tmp58_);
	_tmp59_ = tab_box;
	_tmp60_ = tab_label;
	gtk_box_append (_tmp59_, (GtkWidget*) _tmp60_);
	_tmp61_ = tab_box;
	_tmp62_ = _data31_->tab_revealer;
	gtk_box_append (_tmp61_, (GtkWidget*) _tmp62_);
	_tmp63_ = (GtkEventControllerMotion*) gtk_event_controller_motion_new ();
	tab_motion = _tmp63_;
	_tmp64_ = tab_box;
	_tmp65_ = tab_motion;
	_tmp66_ = _g_object_ref0 ((GtkEventController*) _tmp65_);
	gtk_widget_add_controller ((GtkWidget*) _tmp64_, _tmp66_);
	_tmp67_ = self->priv->_nb;
	_tmp68_ = overlay;
	_tmp69_ = tab_box;
	_data31_->tab_index = gtk_notebook_append_page (_tmp67_, (GtkWidget*) _tmp68_, (GtkWidget*) _tmp69_);
	_tmp70_ = tab_motion;
	g_signal_connect_data (_tmp70_, "enter", (GCallback) ___lambda182__gtk_event_controller_motion_enter, block31_data_ref (_data31_), (GClosureNotify) block31_data_unref, 0);
	_tmp71_ = tab_motion;
	g_signal_connect_data (_tmp71_, "leave", (GCallback) ___lambda183__gtk_event_controller_motion_leave, block31_data_ref (_data31_), (GClosureNotify) block31_data_unref, 0);
	_tmp72_ = _data31_->tab_close;
	g_signal_connect_data (_tmp72_, "clicked", (GCallback) ___lambda184__gtk_button_clicked, block31_data_ref (_data31_), (GClosureNotify) block31_data_unref, 0);
	_tmp73_ = _data31_->map;
	main_window_update_title (self, _tmp73_);
	if (reason == TAB_ADD_REASON_NEW) {
		MindMap* _tmp74_;
		_tmp74_ = _data31_->map;
		mind_map_initialize_for_new (_tmp74_);
	} else {
		MindMap* _tmp75_;
		_tmp75_ = _data31_->map;
		mind_map_initialize_for_open (_tmp75_);
	}
	if (reason != TAB_ADD_REASON_LOAD) {
		GtkNotebook* _tmp77_;
		if (reason == TAB_ADD_REASON_OPEN) {
			MindMap* _tmp76_;
			_tmp76_ = _data31_->map;
			mind_map_set_editable (_tmp76_, TRUE);
		}
		_tmp77_ = self->priv->_nb;
		g_object_set (_tmp77_, "page", _data31_->tab_index, NULL);
	}
	_tmp78_ = _data31_->map;
	_tmp79_ = mind_map_get_canvas (_tmp78_);
	_tmp80_ = _tmp79_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp80_);
	_tmp81_ = _data31_->map;
	_tmp82_ = _mind_map_ref0 (_tmp81_);
	result = _tmp82_;
	_g_object_unref0 (tab_motion);
	_g_object_unref0 (tab_box);
	_g_object_unref0 (tab_label);
	_g_object_unref0 (tab_lock);
	_g_object_unref0 (overlay);
	block31_data_unref (_data31_);
	_data31_ = NULL;
	return result;
}

static void
main_window_close_unchanged_tabs (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp2_;
				MindMap* map = NULL;
				MindMap* _tmp3_;
				MindMap* _tmp4_;
				MapModel* _tmp5_;
				MapModel* _tmp6_;
				gboolean _tmp7_;
				gboolean _tmp8_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp2_))) {
					break;
				}
				_tmp3_ = main_window_get_map (self, i);
				map = _tmp3_;
				_tmp4_ = map;
				_tmp5_ = mind_map_get_model (_tmp4_);
				_tmp6_ = _tmp5_;
				_tmp7_ = map_model_get_is_loaded (_tmp6_);
				_tmp8_ = _tmp7_;
				if (!_tmp8_) {
					GtkNotebook* _tmp9_;
					GtkNotebook* _tmp10_;
					GtkWidget* _tmp11_;
					_tmp9_ = self->priv->_nb;
					_tmp10_ = self->priv->_nb;
					_tmp11_ = gtk_notebook_get_nth_page (_tmp10_, i);
					gtk_notebook_detach_tab (_tmp9_, _tmp11_);
					_mind_map_unref0 (map);
					return;
				}
				_mind_map_unref0 (map);
			}
		}
	}
}

static gboolean
main_window_find_unchanged_tab (MainWindow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp2_;
				MindMap* map = NULL;
				MindMap* _tmp3_;
				MindMap* _tmp4_;
				MapModel* _tmp5_;
				MapModel* _tmp6_;
				gboolean _tmp7_;
				gboolean _tmp8_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp2_))) {
					break;
				}
				_tmp3_ = main_window_get_map (self, i);
				map = _tmp3_;
				_tmp4_ = map;
				_tmp5_ = mind_map_get_model (_tmp4_);
				_tmp6_ = _tmp5_;
				_tmp7_ = map_model_get_is_loaded (_tmp6_);
				_tmp8_ = _tmp7_;
				if (!_tmp8_) {
					GtkNotebook* _tmp9_;
					MindMap* _tmp10_;
					DrawArea* _tmp11_;
					DrawArea* _tmp12_;
					_tmp9_ = self->priv->_nb;
					g_object_set (_tmp9_, "page", i, NULL);
					_tmp10_ = map;
					_tmp11_ = mind_map_get_canvas (_tmp10_);
					_tmp12_ = _tmp11_;
					gtk_widget_grab_focus ((GtkWidget*) _tmp12_);
					result = TRUE;
					_mind_map_unref0 (map);
					return result;
				}
				_mind_map_unref0 (map);
			}
		}
	}
	result = FALSE;
	return result;
}

static MindMap*
main_window_add_tab_conditionally (MainWindow* self,
                                   const gchar* fname,
                                   TabAddReason reason)
{
	MindMap* _tmp11_;
	MindMap* result;
	g_return_val_if_fail (self != NULL, NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp2_;
				MindMap* map = NULL;
				MindMap* _tmp3_;
				MindMap* _tmp4_;
				Document* _tmp5_;
				Document* _tmp6_;
				const gchar* _tmp7_;
				const gchar* _tmp8_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp2_))) {
					break;
				}
				_tmp3_ = main_window_get_map (self, i);
				map = _tmp3_;
				_tmp4_ = map;
				_tmp5_ = mind_map_get_doc (_tmp4_);
				_tmp6_ = _tmp5_;
				_tmp7_ = document_get_filename (_tmp6_);
				_tmp8_ = _tmp7_;
				if (g_strcmp0 (_tmp8_, fname) == 0) {
					MindMap* _tmp9_;
					GtkNotebook* _tmp10_;
					_tmp9_ = map;
					mind_map_initialize_for_open (_tmp9_);
					_tmp10_ = self->priv->_nb;
					g_object_set (_tmp10_, "page", i, NULL);
					result = map;
					return result;
				}
				_mind_map_unref0 (map);
			}
		}
	}
	_tmp11_ = main_window_add_tab (self, fname, reason);
	result = _tmp11_;
	return result;
}

void
main_window_next_tab (MainWindow* self)
{
	GtkNotebook* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_nb;
	gtk_notebook_next_page (_tmp0_);
}

void
main_window_previous_tab (MainWindow* self)
{
	GtkNotebook* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_nb;
	gtk_notebook_prev_page (_tmp0_);
}

MindMap*
main_window_get_current_map (MainWindow* self,
                             const gchar* caller)
{
	gboolean _tmp0_ = FALSE;
	GtkNotebook* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	GtkNotebook* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	MindMap* _tmp8_;
	MindMap* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (self->priv->_debug) {
		_tmp0_ = caller != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		FILE* _tmp1_;
		_tmp1_ = stdout;
		fprintf (_tmp1_, "get_current_map called from %s\n", caller);
	}
	_tmp2_ = self->priv->_nb;
	g_object_get (_tmp2_, "page", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == -1) {
		result = NULL;
		return result;
	}
	_tmp5_ = self->priv->_nb;
	g_object_get (_tmp5_, "page", &_tmp6_, NULL);
	_tmp7_ = _tmp6_;
	_tmp8_ = main_window_get_map (self, _tmp7_);
	result = _tmp8_;
	return result;
}

static void
main_window_update_title (MainWindow* self,
                          MindMap* map)
{
	gchar* label = NULL;
	gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp15_ = FALSE;
	GtkLabel* lbl = NULL;
	GtkHeaderBar* _tmp39_;
	GtkWidget* _tmp40_;
	GtkWidget* _tmp41_;
	GtkLabel* _tmp42_;
	const gchar* _tmp43_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (" \u2014 Minder");
	label = _tmp0_;
	if (map != NULL) {
		Tags* _tmp2_;
		Tags* _tmp3_;
		_tmp2_ = mind_map_get_highlighted (map);
		_tmp3_ = _tmp2_;
		_tmp1_ = tags_size (_tmp3_) > 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp4_ = label;
		_tmp5_ = g_strdup_printf (" (%s)", _ ("Tag Highlight Mode"));
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strconcat (_tmp4_, _tmp6_, NULL);
		_g_free0 (label);
		label = _tmp7_;
		_g_free0 (_tmp6_);
	} else {
		GtkToggleButton* _tmp8_;
		gboolean _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = self->priv->_focus_btn;
		_tmp9_ = gtk_toggle_button_get_active (_tmp8_);
		_tmp10_ = _tmp9_;
		if (_tmp10_) {
			const gchar* _tmp11_;
			gchar* _tmp12_;
			gchar* _tmp13_;
			gchar* _tmp14_;
			_tmp11_ = label;
			_tmp12_ = g_strdup_printf (" (%s)", _ ("Focus Mode"));
			_tmp13_ = _tmp12_;
			_tmp14_ = g_strconcat (_tmp11_, _tmp13_, NULL);
			_g_free0 (label);
			label = _tmp14_;
			_g_free0 (_tmp13_);
		}
	}
	if (map == NULL) {
		_tmp15_ = TRUE;
	} else {
		Document* _tmp16_;
		Document* _tmp17_;
		_tmp16_ = mind_map_get_doc (map);
		_tmp17_ = _tmp16_;
		_tmp15_ = !document_is_saved (_tmp17_);
	}
	if (_tmp15_) {
		const gchar* _tmp18_;
		gchar* _tmp19_;
		_tmp18_ = label;
		_tmp19_ = g_strconcat (_ ("Unnamed Document"), _tmp18_, NULL);
		_g_free0 (label);
		label = _tmp19_;
	} else {
		gboolean _tmp20_ = FALSE;
		Document* _tmp21_;
		Document* _tmp22_;
		gboolean _tmp23_;
		gboolean _tmp24_;
		Document* _tmp31_;
		Document* _tmp32_;
		const gchar* _tmp33_;
		const gchar* _tmp34_;
		gchar* _tmp35_;
		gchar* _tmp36_;
		const gchar* _tmp37_;
		gchar* _tmp38_;
		_tmp21_ = mind_map_get_doc (map);
		_tmp22_ = _tmp21_;
		_tmp23_ = document_get_read_only (_tmp22_);
		_tmp24_ = _tmp23_;
		if (_tmp24_) {
			_tmp20_ = TRUE;
		} else {
			gboolean _tmp25_;
			gboolean _tmp26_;
			_tmp25_ = mind_map_get_editable (map);
			_tmp26_ = _tmp25_;
			_tmp20_ = !_tmp26_;
		}
		if (_tmp20_) {
			const gchar* _tmp27_;
			gchar* _tmp28_;
			gchar* _tmp29_;
			gchar* _tmp30_;
			_tmp27_ = label;
			_tmp28_ = g_strdup_printf (" [%s]", _ ("Read-Only"));
			_tmp29_ = _tmp28_;
			_tmp30_ = g_strconcat (_tmp27_, _tmp29_, NULL);
			_g_free0 (label);
			label = _tmp30_;
			_g_free0 (_tmp29_);
		}
		_tmp31_ = mind_map_get_doc (map);
		_tmp32_ = _tmp31_;
		_tmp33_ = document_get_filename (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp35_ = g_path_get_basename (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp37_ = label;
		_tmp38_ = g_strconcat (_tmp36_, _tmp37_, NULL);
		_g_free0 (label);
		label = _tmp38_;
		_g_free0 (_tmp36_);
	}
	_tmp39_ = self->priv->_header;
	_tmp40_ = gtk_header_bar_get_title_widget (_tmp39_);
	_tmp41_ = _tmp40_;
	_tmp42_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, gtk_label_get_type (), GtkLabel));
	lbl = _tmp42_;
	_tmp43_ = label;
	gtk_label_set_label (lbl, _tmp43_);
	_g_object_unref0 (lbl);
	_g_free0 (label);
}

static gboolean
_main_window_adjust_zoom_gtk_range_change_value (GtkRange* _sender,
                                                 GtkScrollType scroll,
                                                 gdouble new_value,
                                                 gpointer self)
{
	gboolean result;
	result = main_window_adjust_zoom ((MainWindow*) self, scroll, new_value);
	return result;
}

static void
__lambda269_ (MainWindow* self)
{
	main_window_execute_command (self, KEY_COMMAND_ZOOM_IN);
}

static void
___lambda269__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda269_ ((MainWindow*) self);
}

static void
__lambda270_ (MainWindow* self)
{
	main_window_execute_command (self, KEY_COMMAND_ZOOM_OUT);
}

static void
___lambda270__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda270_ ((MainWindow*) self);
}

static void
main_window_add_zoom_button (MainWindow* self)
{
	GMenuItem* zoom_item = NULL;
	GMenuItem* _tmp0_;
	GMenuItem* _tmp1_;
	GMenu* scale_menu = NULL;
	GMenu* _tmp2_;
	GMenu* _tmp3_;
	GMenuItem* _tmp4_;
	GMenu* fit_menu = NULL;
	GMenu* _tmp5_;
	GMenu* _tmp6_;
	GMenu* _tmp7_;
	GMenu* _tmp8_;
	GMenu* menu = NULL;
	GMenu* _tmp9_;
	GMenu* _tmp10_;
	GMenu* _tmp11_;
	GMenu* _tmp12_;
	GMenu* _tmp13_;
	gdouble* marks = NULL;
	gint _tmp14_ = 0;
	gdouble* _tmp15_;
	gint marks_length1;
	gint _marks_size_;
	GtkLabel* _tmp16_;
	gdouble* _tmp17_;
	gint _tmp17__length1;
	gdouble _tmp18_;
	gdouble* _tmp19_;
	gint _tmp19__length1;
	gdouble* _tmp20_;
	gint _tmp20__length1;
	gdouble _tmp21_;
	GtkScale* _tmp22_ = NULL;
	GtkScale* _tmp23_;
	gdouble* _tmp24_;
	gint _tmp24__length1;
	GtkScale* _tmp26_;
	GtkButton* _tmp27_ = NULL;
	GtkButton* _tmp28_;
	GtkButton* _tmp29_;
	GtkButton* _tmp30_ = NULL;
	GtkButton* _tmp31_;
	GtkButton* _tmp32_;
	GtkBox* zoom_box = NULL;
	GtkBox* _tmp33_;
	GtkButton* _tmp34_;
	GtkScale* _tmp35_;
	GtkButton* _tmp36_;
	GtkBox* zbox = NULL;
	GtkBox* _tmp37_;
	GtkLabel* _tmp38_;
	GtkPopoverMenu* popover = NULL;
	GMenu* _tmp39_;
	GtkPopoverMenu* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	GtkPopover* _tmp43_;
	GtkMenuButton* _tmp44_ = NULL;
	GtkHeaderBar* _tmp45_;
	GtkMenuButton* _tmp46_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_menu_item_new (NULL, NULL);
	zoom_item = _tmp0_;
	_tmp1_ = zoom_item;
	g_menu_item_set_attribute (_tmp1_, "custom", "s", "scale", NULL);
	_tmp2_ = g_menu_new ();
	scale_menu = _tmp2_;
	_tmp3_ = scale_menu;
	_tmp4_ = zoom_item;
	g_menu_append_item (_tmp3_, _tmp4_);
	_tmp5_ = g_menu_new ();
	fit_menu = _tmp5_;
	_tmp6_ = fit_menu;
	main_window_append_menu_item (self, _tmp6_, KEY_COMMAND_ZOOM_FIT, _ ("Zoom to Fit"));
	_tmp7_ = fit_menu;
	main_window_append_menu_item (self, _tmp7_, KEY_COMMAND_ZOOM_SELECTED, _ ("Zoom to Fit Selected Node Tree"));
	_tmp8_ = fit_menu;
	main_window_append_menu_item (self, _tmp8_, KEY_COMMAND_ZOOM_ACTUAL, _ ("Zoom to Actual Size"));
	_tmp9_ = g_menu_new ();
	menu = _tmp9_;
	_tmp10_ = menu;
	_tmp11_ = scale_menu;
	g_menu_append_section (_tmp10_, NULL, (GMenuModel*) _tmp11_);
	_tmp12_ = menu;
	_tmp13_ = fit_menu;
	g_menu_append_section (_tmp12_, NULL, (GMenuModel*) _tmp13_);
	_tmp15_ = draw_area_get_scale_marks (&_tmp14_);
	marks = _tmp15_;
	marks_length1 = _tmp14_;
	_marks_size_ = marks_length1;
	_tmp16_ = (GtkLabel*) gtk_label_new (_ ("Zoom to Percent"));
	g_object_ref_sink (_tmp16_);
	_g_object_unref0 (self->priv->_scale_lbl);
	self->priv->_scale_lbl = _tmp16_;
	_tmp17_ = marks;
	_tmp17__length1 = marks_length1;
	_tmp18_ = _tmp17_[0];
	_tmp19_ = marks;
	_tmp19__length1 = marks_length1;
	_tmp20_ = marks;
	_tmp20__length1 = marks_length1;
	_tmp21_ = _tmp19_[_tmp20__length1 - 1];
	_tmp22_ = (GtkScale*) gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, _tmp18_, _tmp21_, (gdouble) 25);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp22_, TRUE);
	gtk_scale_set_has_origin (_tmp22_, FALSE);
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->_zoom_scale);
	self->priv->_zoom_scale = _tmp22_;
	_tmp23_ = self->priv->_zoom_scale;
	gtk_range_set_value ((GtkRange*) _tmp23_, (gdouble) 100);
	_tmp24_ = marks;
	_tmp24__length1 = marks_length1;
	{
		gdouble* mark_collection = NULL;
		gint mark_collection_length1 = 0;
		gint _mark_collection_size_ = 0;
		gint mark_it = 0;
		mark_collection = _tmp24_;
		mark_collection_length1 = _tmp24__length1;
		for (mark_it = 0; mark_it < mark_collection_length1; mark_it = mark_it + 1) {
			gdouble mark = 0.0;
			mark = mark_collection[mark_it];
			{
				GtkScale* _tmp25_;
				_tmp25_ = self->priv->_zoom_scale;
				gtk_scale_add_mark (_tmp25_, mark, GTK_POS_BOTTOM, NULL);
			}
		}
	}
	_tmp26_ = self->priv->_zoom_scale;
	g_signal_connect_object ((GtkRange*) _tmp26_, "change-value", (GCallback) _main_window_adjust_zoom_gtk_range_change_value, self, 0);
	_tmp27_ = (GtkButton*) gtk_button_new_from_icon_name ("zoom-in-symbolic");
	gtk_button_set_has_frame (_tmp27_, FALSE);
	gtk_widget_set_can_focus ((GtkWidget*) _tmp27_, FALSE);
	g_object_ref_sink (_tmp27_);
	_g_object_unref0 (self->priv->_zoom_in);
	self->priv->_zoom_in = _tmp27_;
	_tmp28_ = self->priv->_zoom_in;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp28_, KEY_COMMAND_ZOOM_IN, _ ("Zoom In"));
	_tmp29_ = self->priv->_zoom_in;
	g_signal_connect_object (_tmp29_, "clicked", (GCallback) ___lambda269__gtk_button_clicked, self, 0);
	_tmp30_ = (GtkButton*) gtk_button_new_from_icon_name ("zoom-out-symbolic");
	gtk_button_set_has_frame (_tmp30_, FALSE);
	gtk_widget_set_can_focus ((GtkWidget*) _tmp30_, FALSE);
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->priv->_zoom_out);
	self->priv->_zoom_out = _tmp30_;
	_tmp31_ = self->priv->_zoom_out;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp31_, KEY_COMMAND_ZOOM_OUT, _ ("Zoom Out"));
	_tmp32_ = self->priv->_zoom_out;
	g_signal_connect_object (_tmp32_, "clicked", (GCallback) ___lambda270__gtk_button_clicked, self, 0);
	_tmp33_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
	g_object_ref_sink (_tmp33_);
	zoom_box = _tmp33_;
	_tmp34_ = self->priv->_zoom_out;
	gtk_box_append (zoom_box, (GtkWidget*) _tmp34_);
	_tmp35_ = self->priv->_zoom_scale;
	gtk_box_append (zoom_box, (GtkWidget*) _tmp35_);
	_tmp36_ = self->priv->_zoom_in;
	gtk_box_append (zoom_box, (GtkWidget*) _tmp36_);
	_tmp37_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
	g_object_ref_sink (_tmp37_);
	zbox = _tmp37_;
	_tmp38_ = self->priv->_scale_lbl;
	gtk_box_append (zbox, (GtkWidget*) _tmp38_);
	gtk_box_append (zbox, (GtkWidget*) zoom_box);
	_tmp39_ = menu;
	_tmp40_ = (GtkPopoverMenu*) gtk_popover_menu_new_from_model ((GMenuModel*) _tmp39_);
	g_object_ref_sink (_tmp40_);
	popover = _tmp40_;
	gtk_popover_menu_add_child (popover, (GtkWidget*) zbox, "scale");
	_tmp41_ = main_window_get_icon_name (self, "zoom-fit-best");
	_tmp42_ = g_strdup_printf (_ ("Zoom (%d%%)"), 100);
	_tmp43_ = _g_object_ref0 ((GtkPopover*) popover);
	_tmp44_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_icon_name (_tmp44_, _tmp41_);
	_g_free0 (_tmp41_);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp44_, _tmp42_);
	_g_free0 (_tmp42_);
	gtk_menu_button_set_popover (_tmp44_, _tmp43_);
	_g_object_unref0 (_tmp43_);
	g_object_ref_sink (_tmp44_);
	_g_object_unref0 (self->priv->_zoom_btn);
	self->priv->_zoom_btn = _tmp44_;
	_tmp45_ = self->priv->_header;
	_tmp46_ = self->priv->_zoom_btn;
	gtk_header_bar_pack_end (_tmp45_, (GtkWidget*) _tmp46_);
	_g_object_unref0 (popover);
	_g_object_unref0 (zbox);
	_g_object_unref0 (zoom_box);
	marks = (g_free (marks), NULL);
	_g_object_unref0 (menu);
	_g_object_unref0 (fit_menu);
	_g_object_unref0 (scale_menu);
	_g_object_unref0 (zoom_item);
}

static void
_main_window_on_search_change_gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                               gpointer self)
{
	main_window_on_search_change ((MainWindow*) self);
}

static gboolean
__lambda257_ (MainWindow* self,
              guint keyval,
              guint keycode,
              GdkModifierType state)
{
	gboolean result;
	if (keyval == GDK_KEY_Escape) {
		GtkMenuButton* _tmp0_;
		_tmp0_ = self->priv->_search_btn;
		gtk_menu_button_set_active (_tmp0_, FALSE);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
___lambda257__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                    guint keyval,
                                                    guint keycode,
                                                    GdkModifierType state,
                                                    gpointer self)
{
	gboolean result;
	result = __lambda257_ ((MainWindow*) self, keyval, keycode, state);
	return result;
}

static void
_main_window_on_search_clicked_gtk_tree_view_row_activated (GtkTreeView* _sender,
                                                            GtkTreePath* path,
                                                            GtkTreeViewColumn* column,
                                                            gpointer self)
{
	main_window_on_search_clicked ((MainWindow*) self, _sender, path, column);
}

static void
__lambda268_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkSwitch* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_all_tabs;
	_tmp2_ = gtk_switch_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-all-tabs", !_tmp3_);
	main_window_on_search_change (self);
}

static void
___lambda268__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda268_ ((MainWindow*) self);
}

static void
main_window_add_search_button (MainWindow* self)
{
	gchar* _tmp0_;
	GtkSearchEntry* _tmp1_ = NULL;
	GtkSearchEntry* _tmp2_;
	GtkEventControllerKey* search_key = NULL;
	GtkEventControllerKey* _tmp3_;
	GtkSearchEntry* _tmp4_;
	GtkEventControllerKey* _tmp5_;
	GtkEventController* _tmp6_;
	GtkEventControllerKey* _tmp7_;
	GtkListStore* _tmp8_;
	GtkListStore* _tmp9_;
	GtkTreeView* _tmp10_ = NULL;
	GtkCellRendererText* type_cell = NULL;
	GtkCellRendererText* _tmp11_ = NULL;
	GtkCellRendererText* str_cell = NULL;
	GtkCellRendererText* _tmp12_ = NULL;
	GtkCellRendererText* tab_cell = NULL;
	GtkCellRendererText* _tmp13_;
	GtkTreeView* _tmp14_;
	GtkCellRendererText* _tmp15_;
	GtkTreeView* _tmp16_;
	GtkCellRendererText* _tmp17_;
	GtkTreeView* _tmp18_;
	GtkCellRendererText* _tmp19_;
	GtkTreeView* _tmp20_;
	GtkTreeView* _tmp21_;
	GtkWidget* _tmp22_;
	GtkScrolledWindow* _tmp23_ = NULL;
	GtkExpander* search_opts = NULL;
	GtkGrid* _tmp24_;
	GtkExpander* _tmp25_ = NULL;
	GtkLabel* search_all_label = NULL;
	GtkLabel* _tmp26_ = NULL;
	GSettings* _tmp27_;
	GtkSwitch* _tmp28_ = NULL;
	GtkSwitch* _tmp29_;
	GtkBox* search_all_box = NULL;
	GtkBox* _tmp30_;
	GtkBox* _tmp31_;
	GtkLabel* _tmp32_;
	GtkBox* _tmp33_;
	GtkSwitch* _tmp34_;
	GtkBox* box = NULL;
	GtkBox* _tmp35_ = NULL;
	GtkBox* _tmp36_;
	GtkSearchEntry* _tmp37_;
	GtkBox* _tmp38_;
	GtkScrolledWindow* _tmp39_;
	GtkBox* _tmp40_;
	GtkSeparator* _tmp41_;
	GtkSeparator* _tmp42_;
	GtkBox* _tmp43_;
	GtkExpander* _tmp44_;
	GtkBox* _tmp45_;
	GtkSeparator* _tmp46_;
	GtkSeparator* _tmp47_;
	GtkBox* _tmp48_;
	GtkBox* _tmp49_;
	GtkBox* _tmp50_;
	GtkWidget* _tmp51_;
	GtkPopover* _tmp52_ = NULL;
	const gchar* _tmp53_ = NULL;
	gchar* _tmp54_;
	GtkPopover* _tmp55_;
	GtkPopover* _tmp56_;
	GtkMenuButton* _tmp57_ = NULL;
	GtkMenuButton* _tmp58_;
	GtkHeaderBar* _tmp59_;
	GtkMenuButton* _tmp60_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (_ ("Search Nodes, Callouts and Connections"));
	_tmp1_ = (GtkSearchEntry*) gtk_search_entry_new ();
	g_object_set (_tmp1_, "placeholder-text", _tmp0_, NULL);
	_g_free0 (_tmp0_);
	gtk_editable_set_width_chars ((GtkEditable*) _tmp1_, 60);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_search_entry);
	self->priv->_search_entry = _tmp1_;
	_tmp2_ = self->priv->_search_entry;
	g_signal_connect_object (_tmp2_, "search-changed", (GCallback) _main_window_on_search_change_gtk_search_entry_search_changed, self, 0);
	_tmp3_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	search_key = _tmp3_;
	_tmp4_ = self->priv->_search_entry;
	_tmp5_ = search_key;
	_tmp6_ = _g_object_ref0 ((GtkEventController*) _tmp5_);
	gtk_widget_add_controller ((GtkWidget*) _tmp4_, _tmp6_);
	_tmp7_ = search_key;
	g_signal_connect_object (_tmp7_, "key-pressed", (GCallback) ___lambda257__gtk_event_controller_key_key_pressed, self, 0);
	_tmp8_ = gtk_list_store_new (8, G_TYPE_STRING, G_TYPE_STRING, TYPE_NODE, TYPE_CONNECTION, TYPE_CALLOUT, TYPE_NODE_GROUP, G_TYPE_STRING, G_TYPE_STRING, -1);
	_g_object_unref0 (self->priv->_search_items);
	self->priv->_search_items = _tmp8_;
	_tmp9_ = self->priv->_search_items;
	_tmp10_ = (GtkTreeView*) gtk_tree_view_new_with_model ((GtkTreeModel*) _tmp9_);
	gtk_tree_view_set_headers_visible (_tmp10_, FALSE);
	gtk_tree_view_set_activate_on_single_click (_tmp10_, TRUE);
	gtk_tree_view_set_enable_search (_tmp10_, FALSE);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->_search_list);
	self->priv->_search_list = _tmp10_;
	_tmp11_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_set ((GtkCellRenderer*) _tmp11_, "xalign", (gfloat) 1, NULL);
	g_object_ref_sink (_tmp11_);
	type_cell = _tmp11_;
	_tmp12_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_set (_tmp12_, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
	g_object_set (_tmp12_, "ellipsize-set", TRUE, NULL);
	g_object_set (_tmp12_, "width-chars", 50, NULL);
	g_object_ref_sink (_tmp12_);
	str_cell = _tmp12_;
	_tmp13_ = (GtkCellRendererText*) gtk_cell_renderer_text_new ();
	g_object_ref_sink (_tmp13_);
	tab_cell = _tmp13_;
	_tmp14_ = self->priv->_search_list;
	_tmp15_ = type_cell;
	gtk_tree_view_insert_column_with_attributes (_tmp14_, -1, NULL, (GtkCellRenderer*) _tmp15_, "markup", 0, NULL, NULL);
	_tmp16_ = self->priv->_search_list;
	_tmp17_ = str_cell;
	gtk_tree_view_insert_column_with_attributes (_tmp16_, -1, NULL, (GtkCellRenderer*) _tmp17_, "markup", 1, NULL, NULL);
	_tmp18_ = self->priv->_search_list;
	_tmp19_ = tab_cell;
	gtk_tree_view_insert_column_with_attributes (_tmp18_, -1, NULL, (GtkCellRenderer*) _tmp19_, "markup", 7, NULL, NULL);
	_tmp20_ = self->priv->_search_list;
	g_signal_connect_object (_tmp20_, "row-activated", (GCallback) _main_window_on_search_clicked_gtk_tree_view_row_activated, self, 0);
	_tmp21_ = self->priv->_search_list;
	_tmp22_ = _g_object_ref0 ((GtkWidget*) _tmp21_);
	_tmp23_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_set ((GtkWidget*) _tmp23_, "height-request", 200, NULL);
	g_object_set (_tmp23_, "hscrollbar-policy", GTK_POLICY_EXTERNAL, NULL);
	gtk_scrolled_window_set_child (_tmp23_, _tmp22_);
	_g_object_unref0 (_tmp22_);
	g_object_ref_sink (_tmp23_);
	_g_object_unref0 (self->priv->_search_scroll);
	self->priv->_search_scroll = _tmp23_;
	_tmp24_ = main_window_create_search_options_box (self);
	_tmp25_ = (GtkExpander*) gtk_expander_new (_ ("Search Criteria"));
	gtk_expander_set_child (_tmp25_, (GtkWidget*) _tmp24_);
	_g_object_unref0 (_tmp24_);
	g_object_ref_sink (_tmp25_);
	search_opts = _tmp25_;
	_tmp26_ = (GtkLabel*) gtk_label_new (_ ("Search all tabs"));
	gtk_widget_set_halign ((GtkWidget*) _tmp26_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp26_);
	search_all_label = _tmp26_;
	_tmp27_ = self->priv->_settings;
	_tmp28_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp28_, GTK_ALIGN_END);
	gtk_switch_set_active (_tmp28_, g_settings_get_boolean (_tmp27_, "search-opt-all-tabs"));
	g_object_ref_sink (_tmp28_);
	_g_object_unref0 (self->priv->_search_all_tabs);
	self->priv->_search_all_tabs = _tmp28_;
	_tmp29_ = self->priv->_search_all_tabs;
	g_signal_connect_object ((GObject*) _tmp29_, "notify::active", (GCallback) ___lambda268__g_object_notify, self, 0);
	_tmp30_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
	g_object_ref_sink (_tmp30_);
	search_all_box = _tmp30_;
	_tmp31_ = search_all_box;
	_tmp32_ = search_all_label;
	gtk_box_append (_tmp31_, (GtkWidget*) _tmp32_);
	_tmp33_ = search_all_box;
	_tmp34_ = self->priv->_search_all_tabs;
	gtk_box_append (_tmp33_, (GtkWidget*) _tmp34_);
	_tmp35_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 5);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp35_, 5);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp35_, 5);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp35_, 5);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp35_, 5);
	g_object_ref_sink (_tmp35_);
	box = _tmp35_;
	_tmp36_ = box;
	_tmp37_ = self->priv->_search_entry;
	gtk_box_append (_tmp36_, (GtkWidget*) _tmp37_);
	_tmp38_ = box;
	_tmp39_ = self->priv->_search_scroll;
	gtk_box_append (_tmp38_, (GtkWidget*) _tmp39_);
	_tmp40_ = box;
	_tmp41_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp41_);
	_tmp42_ = _tmp41_;
	gtk_box_append (_tmp40_, (GtkWidget*) _tmp42_);
	_g_object_unref0 (_tmp42_);
	_tmp43_ = box;
	_tmp44_ = search_opts;
	gtk_box_append (_tmp43_, (GtkWidget*) _tmp44_);
	_tmp45_ = box;
	_tmp46_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp46_);
	_tmp47_ = _tmp46_;
	gtk_box_append (_tmp45_, (GtkWidget*) _tmp47_);
	_g_object_unref0 (_tmp47_);
	_tmp48_ = box;
	_tmp49_ = search_all_box;
	gtk_box_append (_tmp48_, (GtkWidget*) _tmp49_);
	_tmp50_ = box;
	_tmp51_ = _g_object_ref0 ((GtkWidget*) _tmp50_);
	_tmp52_ = (GtkPopover*) gtk_popover_new ();
	gtk_popover_set_child (_tmp52_, _tmp51_);
	_g_object_unref0 (_tmp51_);
	g_object_ref_sink (_tmp52_);
	_g_object_unref0 (self->priv->_search);
	self->priv->_search = _tmp52_;
	if (self->priv->on_elementary) {
		_tmp53_ = "minder-search";
	} else {
		_tmp53_ = "edit-find-symbolic";
	}
	_tmp54_ = g_strdup (_tmp53_);
	_tmp55_ = self->priv->_search;
	_tmp56_ = _g_object_ref0 (_tmp55_);
	_tmp57_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_icon_name (_tmp57_, _tmp54_);
	_g_free0 (_tmp54_);
	gtk_menu_button_set_popover (_tmp57_, _tmp56_);
	_g_object_unref0 (_tmp56_);
	g_object_ref_sink (_tmp57_);
	_g_object_unref0 (self->priv->_search_btn);
	self->priv->_search_btn = _tmp57_;
	_tmp58_ = self->priv->_search_btn;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp58_, KEY_COMMAND_SHOW_FIND, _ ("Search"));
	_tmp59_ = self->priv->_header;
	_tmp60_ = self->priv->_search_btn;
	gtk_header_bar_pack_end (_tmp59_, (GtkWidget*) _tmp60_);
	_g_object_unref0 (box);
	_g_object_unref0 (search_all_box);
	_g_object_unref0 (search_all_label);
	_g_object_unref0 (search_opts);
	_g_object_unref0 (tab_cell);
	_g_object_unref0 (str_cell);
	_g_object_unref0 (type_cell);
	_g_object_unref0 (search_key);
}

static void
__lambda258_ (MainWindow* self)
{
	gboolean nodes = FALSE;
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GSettings* _tmp3_;
	GtkCheckButton* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	GtkCheckButton* _tmp15_;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	GtkCheckButton* _tmp24_;
	gboolean _tmp25_ = FALSE;
	gboolean _tmp26_ = FALSE;
	GtkCheckButton* _tmp33_;
	GtkCheckButton* _tmp34_;
	GtkCheckButton* _tmp35_;
	GtkCheckButton* _tmp36_;
	GtkCheckButton* _tmp37_;
	_tmp0_ = self->priv->_search_nodes;
	_tmp1_ = gtk_check_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	nodes = _tmp2_;
	_tmp3_ = self->priv->_settings;
	_tmp4_ = self->priv->_search_nodes;
	_tmp5_ = gtk_check_button_get_active (_tmp4_);
	_tmp6_ = _tmp5_;
	g_settings_set_boolean (_tmp3_, "search-opt-nodes", _tmp6_);
	if (nodes) {
		_tmp8_ = TRUE;
	} else {
		GtkCheckButton* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp9_ = self->priv->_search_callouts;
		_tmp10_ = gtk_check_button_get_active (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp8_ = _tmp11_;
	}
	if (_tmp8_) {
		_tmp7_ = TRUE;
	} else {
		GtkCheckButton* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		_tmp12_ = self->priv->_search_groups;
		_tmp13_ = gtk_check_button_get_active (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp7_ = _tmp14_;
	}
	_tmp15_ = self->priv->_search_connections;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp15_, _tmp7_);
	if (nodes) {
		_tmp17_ = TRUE;
	} else {
		GtkCheckButton* _tmp18_;
		gboolean _tmp19_;
		gboolean _tmp20_;
		_tmp18_ = self->priv->_search_connections;
		_tmp19_ = gtk_check_button_get_active (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp17_ = _tmp20_;
	}
	if (_tmp17_) {
		_tmp16_ = TRUE;
	} else {
		GtkCheckButton* _tmp21_;
		gboolean _tmp22_;
		gboolean _tmp23_;
		_tmp21_ = self->priv->_search_groups;
		_tmp22_ = gtk_check_button_get_active (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp16_ = _tmp23_;
	}
	_tmp24_ = self->priv->_search_callouts;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp24_, _tmp16_);
	if (nodes) {
		_tmp26_ = TRUE;
	} else {
		GtkCheckButton* _tmp27_;
		gboolean _tmp28_;
		gboolean _tmp29_;
		_tmp27_ = self->priv->_search_connections;
		_tmp28_ = gtk_check_button_get_active (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp26_ = _tmp29_;
	}
	if (_tmp26_) {
		_tmp25_ = TRUE;
	} else {
		GtkCheckButton* _tmp30_;
		gboolean _tmp31_;
		gboolean _tmp32_;
		_tmp30_ = self->priv->_search_callouts;
		_tmp31_ = gtk_check_button_get_active (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp25_ = _tmp32_;
	}
	_tmp33_ = self->priv->_search_groups;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp33_, _tmp25_);
	_tmp34_ = self->priv->_search_folded;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp34_, nodes);
	_tmp35_ = self->priv->_search_unfolded;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp35_, nodes);
	_tmp36_ = self->priv->_search_tasks;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp36_, nodes);
	_tmp37_ = self->priv->_search_nontasks;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp37_, nodes);
	main_window_on_search_change (self);
}

static void
___lambda258__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda258_ ((MainWindow*) self);
}

static void
__lambda259_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	GtkCheckButton* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	GtkCheckButton* _tmp15_;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	GtkCheckButton* _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_;
	GtkCheckButton* _tmp27_;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp29_ = FALSE;
	GtkCheckButton* _tmp30_;
	gboolean _tmp31_;
	gboolean _tmp32_;
	GtkCheckButton* _tmp39_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_connections;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-connections", _tmp3_);
	_tmp6_ = self->priv->_search_connections;
	_tmp7_ = gtk_check_button_get_active (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		_tmp5_ = TRUE;
	} else {
		GtkCheckButton* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp9_ = self->priv->_search_callouts;
		_tmp10_ = gtk_check_button_get_active (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp5_ = _tmp11_;
	}
	if (_tmp5_) {
		_tmp4_ = TRUE;
	} else {
		GtkCheckButton* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		_tmp12_ = self->priv->_search_groups;
		_tmp13_ = gtk_check_button_get_active (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp4_ = _tmp14_;
	}
	_tmp15_ = self->priv->_search_nodes;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp15_, _tmp4_);
	_tmp18_ = self->priv->_search_connections;
	_tmp19_ = gtk_check_button_get_active (_tmp18_);
	_tmp20_ = _tmp19_;
	if (_tmp20_) {
		_tmp17_ = TRUE;
	} else {
		GtkCheckButton* _tmp21_;
		gboolean _tmp22_;
		gboolean _tmp23_;
		_tmp21_ = self->priv->_search_nodes;
		_tmp22_ = gtk_check_button_get_active (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp17_ = _tmp23_;
	}
	if (_tmp17_) {
		_tmp16_ = TRUE;
	} else {
		GtkCheckButton* _tmp24_;
		gboolean _tmp25_;
		gboolean _tmp26_;
		_tmp24_ = self->priv->_search_groups;
		_tmp25_ = gtk_check_button_get_active (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp16_ = _tmp26_;
	}
	_tmp27_ = self->priv->_search_callouts;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp27_, _tmp16_);
	_tmp30_ = self->priv->_search_connections;
	_tmp31_ = gtk_check_button_get_active (_tmp30_);
	_tmp32_ = _tmp31_;
	if (_tmp32_) {
		_tmp29_ = TRUE;
	} else {
		GtkCheckButton* _tmp33_;
		gboolean _tmp34_;
		gboolean _tmp35_;
		_tmp33_ = self->priv->_search_nodes;
		_tmp34_ = gtk_check_button_get_active (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp29_ = _tmp35_;
	}
	if (_tmp29_) {
		_tmp28_ = TRUE;
	} else {
		GtkCheckButton* _tmp36_;
		gboolean _tmp37_;
		gboolean _tmp38_;
		_tmp36_ = self->priv->_search_callouts;
		_tmp37_ = gtk_check_button_get_active (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp28_ = _tmp38_;
	}
	_tmp39_ = self->priv->_search_groups;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp39_, _tmp28_);
	main_window_on_search_change (self);
}

static void
___lambda259__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda259_ ((MainWindow*) self);
}

static void
__lambda260_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	GtkCheckButton* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	GtkCheckButton* _tmp15_;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	GtkCheckButton* _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_;
	GtkCheckButton* _tmp27_;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp29_ = FALSE;
	GtkCheckButton* _tmp30_;
	gboolean _tmp31_;
	gboolean _tmp32_;
	GtkCheckButton* _tmp39_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_callouts;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-callouts", _tmp3_);
	_tmp6_ = self->priv->_search_callouts;
	_tmp7_ = gtk_check_button_get_active (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		_tmp5_ = TRUE;
	} else {
		GtkCheckButton* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp9_ = self->priv->_search_connections;
		_tmp10_ = gtk_check_button_get_active (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp5_ = _tmp11_;
	}
	if (_tmp5_) {
		_tmp4_ = TRUE;
	} else {
		GtkCheckButton* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		_tmp12_ = self->priv->_search_groups;
		_tmp13_ = gtk_check_button_get_active (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp4_ = _tmp14_;
	}
	_tmp15_ = self->priv->_search_nodes;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp15_, _tmp4_);
	_tmp18_ = self->priv->_search_callouts;
	_tmp19_ = gtk_check_button_get_active (_tmp18_);
	_tmp20_ = _tmp19_;
	if (_tmp20_) {
		_tmp17_ = TRUE;
	} else {
		GtkCheckButton* _tmp21_;
		gboolean _tmp22_;
		gboolean _tmp23_;
		_tmp21_ = self->priv->_search_nodes;
		_tmp22_ = gtk_check_button_get_active (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp17_ = _tmp23_;
	}
	if (_tmp17_) {
		_tmp16_ = TRUE;
	} else {
		GtkCheckButton* _tmp24_;
		gboolean _tmp25_;
		gboolean _tmp26_;
		_tmp24_ = self->priv->_search_groups;
		_tmp25_ = gtk_check_button_get_active (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp16_ = _tmp26_;
	}
	_tmp27_ = self->priv->_search_connections;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp27_, _tmp16_);
	_tmp30_ = self->priv->_search_callouts;
	_tmp31_ = gtk_check_button_get_active (_tmp30_);
	_tmp32_ = _tmp31_;
	if (_tmp32_) {
		_tmp29_ = TRUE;
	} else {
		GtkCheckButton* _tmp33_;
		gboolean _tmp34_;
		gboolean _tmp35_;
		_tmp33_ = self->priv->_search_connections;
		_tmp34_ = gtk_check_button_get_active (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp29_ = _tmp35_;
	}
	if (_tmp29_) {
		_tmp28_ = TRUE;
	} else {
		GtkCheckButton* _tmp36_;
		gboolean _tmp37_;
		gboolean _tmp38_;
		_tmp36_ = self->priv->_search_nodes;
		_tmp37_ = gtk_check_button_get_active (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp28_ = _tmp38_;
	}
	_tmp39_ = self->priv->_search_groups;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp39_, _tmp28_);
	main_window_on_search_change (self);
}

static void
___lambda260__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda260_ ((MainWindow*) self);
}

static void
__lambda261_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	GtkCheckButton* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	GtkCheckButton* _tmp15_;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	GtkCheckButton* _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_;
	GtkCheckButton* _tmp27_;
	gboolean _tmp28_ = FALSE;
	gboolean _tmp29_ = FALSE;
	GtkCheckButton* _tmp30_;
	gboolean _tmp31_;
	gboolean _tmp32_;
	GtkCheckButton* _tmp39_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_groups;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-groups", _tmp3_);
	_tmp6_ = self->priv->_search_callouts;
	_tmp7_ = gtk_check_button_get_active (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		_tmp5_ = TRUE;
	} else {
		GtkCheckButton* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp9_ = self->priv->_search_connections;
		_tmp10_ = gtk_check_button_get_active (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp5_ = _tmp11_;
	}
	if (_tmp5_) {
		_tmp4_ = TRUE;
	} else {
		GtkCheckButton* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		_tmp12_ = self->priv->_search_groups;
		_tmp13_ = gtk_check_button_get_active (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp4_ = _tmp14_;
	}
	_tmp15_ = self->priv->_search_nodes;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp15_, _tmp4_);
	_tmp18_ = self->priv->_search_callouts;
	_tmp19_ = gtk_check_button_get_active (_tmp18_);
	_tmp20_ = _tmp19_;
	if (_tmp20_) {
		_tmp17_ = TRUE;
	} else {
		GtkCheckButton* _tmp21_;
		gboolean _tmp22_;
		gboolean _tmp23_;
		_tmp21_ = self->priv->_search_nodes;
		_tmp22_ = gtk_check_button_get_active (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp17_ = _tmp23_;
	}
	if (_tmp17_) {
		_tmp16_ = TRUE;
	} else {
		GtkCheckButton* _tmp24_;
		gboolean _tmp25_;
		gboolean _tmp26_;
		_tmp24_ = self->priv->_search_groups;
		_tmp25_ = gtk_check_button_get_active (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp16_ = _tmp26_;
	}
	_tmp27_ = self->priv->_search_connections;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp27_, _tmp16_);
	_tmp30_ = self->priv->_search_nodes;
	_tmp31_ = gtk_check_button_get_active (_tmp30_);
	_tmp32_ = _tmp31_;
	if (_tmp32_) {
		_tmp29_ = TRUE;
	} else {
		GtkCheckButton* _tmp33_;
		gboolean _tmp34_;
		gboolean _tmp35_;
		_tmp33_ = self->priv->_search_connections;
		_tmp34_ = gtk_check_button_get_active (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp29_ = _tmp35_;
	}
	if (_tmp29_) {
		_tmp28_ = TRUE;
	} else {
		GtkCheckButton* _tmp36_;
		gboolean _tmp37_;
		gboolean _tmp38_;
		_tmp36_ = self->priv->_search_groups;
		_tmp37_ = gtk_check_button_get_active (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp28_ = _tmp38_;
	}
	_tmp39_ = self->priv->_search_callouts;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp39_, _tmp28_);
	main_window_on_search_change (self);
}

static void
___lambda261__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda261_ ((MainWindow*) self);
}

static void
__lambda262_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_titles;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-titles", _tmp3_);
	_tmp4_ = self->priv->_search_notes;
	_tmp5_ = self->priv->_search_titles;
	_tmp6_ = gtk_check_button_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp7_);
	main_window_on_search_change (self);
}

static void
___lambda262__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda262_ ((MainWindow*) self);
}

static void
__lambda263_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_notes;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-notes", _tmp3_);
	_tmp4_ = self->priv->_search_titles;
	_tmp5_ = self->priv->_search_notes;
	_tmp6_ = gtk_check_button_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp7_);
	main_window_on_search_change (self);
}

static void
___lambda263__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda263_ ((MainWindow*) self);
}

static void
__lambda264_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_folded;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-folded", _tmp3_);
	_tmp4_ = self->priv->_search_unfolded;
	_tmp5_ = self->priv->_search_folded;
	_tmp6_ = gtk_check_button_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp7_);
	main_window_on_search_change (self);
}

static void
___lambda264__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda264_ ((MainWindow*) self);
}

static void
__lambda265_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_unfolded;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-unfolded", _tmp3_);
	_tmp4_ = self->priv->_search_folded;
	_tmp5_ = self->priv->_search_unfolded;
	_tmp6_ = gtk_check_button_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp7_);
	main_window_on_search_change (self);
}

static void
___lambda265__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda265_ ((MainWindow*) self);
}

static void
__lambda266_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_tasks;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-tasks", _tmp3_);
	_tmp4_ = self->priv->_search_nontasks;
	_tmp5_ = self->priv->_search_tasks;
	_tmp6_ = gtk_check_button_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp7_);
	main_window_on_search_change (self);
}

static void
___lambda266__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda266_ ((MainWindow*) self);
}

static void
__lambda267_ (MainWindow* self)
{
	GSettings* _tmp0_;
	GtkCheckButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	_tmp0_ = self->priv->_settings;
	_tmp1_ = self->priv->_search_nontasks;
	_tmp2_ = gtk_check_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	g_settings_set_boolean (_tmp0_, "search-opt-nontasks", _tmp3_);
	_tmp4_ = self->priv->_search_tasks;
	_tmp5_ = self->priv->_search_nontasks;
	_tmp6_ = gtk_check_button_get_active (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp7_);
	main_window_on_search_change (self);
}

static void
___lambda267__gtk_check_button_toggled (GtkCheckButton* _sender,
                                        gpointer self)
{
	__lambda267_ ((MainWindow*) self);
}

static GtkGrid*
main_window_create_search_options_box (MainWindow* self)
{
	GtkCheckButton* _tmp0_;
	GtkCheckButton* _tmp1_;
	GtkCheckButton* _tmp2_;
	GtkCheckButton* _tmp3_;
	GtkCheckButton* _tmp4_;
	GtkCheckButton* _tmp5_;
	GtkCheckButton* _tmp6_;
	GtkCheckButton* _tmp7_;
	GtkCheckButton* _tmp8_;
	GtkCheckButton* _tmp9_;
	GtkCheckButton* _tmp10_;
	GSettings* _tmp11_;
	GtkCheckButton* _tmp12_;
	GSettings* _tmp13_;
	GtkCheckButton* _tmp14_;
	GSettings* _tmp15_;
	GtkCheckButton* _tmp16_;
	GSettings* _tmp17_;
	GtkCheckButton* _tmp18_;
	GSettings* _tmp19_;
	GtkCheckButton* _tmp20_;
	GSettings* _tmp21_;
	GtkCheckButton* _tmp22_;
	GSettings* _tmp23_;
	GtkCheckButton* _tmp24_;
	GSettings* _tmp25_;
	GtkCheckButton* _tmp26_;
	GSettings* _tmp27_;
	GtkCheckButton* _tmp28_;
	GSettings* _tmp29_;
	gboolean _tmp30_ = FALSE;
	gboolean _tmp31_ = FALSE;
	GtkCheckButton* _tmp32_;
	gboolean _tmp33_;
	gboolean _tmp34_;
	GtkCheckButton* _tmp41_;
	gboolean _tmp42_ = FALSE;
	gboolean _tmp43_ = FALSE;
	GtkCheckButton* _tmp44_;
	gboolean _tmp45_;
	gboolean _tmp46_;
	GtkCheckButton* _tmp53_;
	gboolean _tmp54_ = FALSE;
	gboolean _tmp55_ = FALSE;
	GtkCheckButton* _tmp56_;
	gboolean _tmp57_;
	gboolean _tmp58_;
	GtkCheckButton* _tmp65_;
	gboolean _tmp66_ = FALSE;
	gboolean _tmp67_ = FALSE;
	GtkCheckButton* _tmp68_;
	gboolean _tmp69_;
	gboolean _tmp70_;
	GtkCheckButton* _tmp77_;
	GtkCheckButton* _tmp78_;
	GtkCheckButton* _tmp79_;
	gboolean _tmp80_;
	gboolean _tmp81_;
	GtkCheckButton* _tmp82_;
	GtkCheckButton* _tmp83_;
	gboolean _tmp84_;
	gboolean _tmp85_;
	gboolean _tmp86_ = FALSE;
	GtkCheckButton* _tmp87_;
	gboolean _tmp88_;
	gboolean _tmp89_;
	GtkCheckButton* _tmp93_;
	gboolean _tmp94_ = FALSE;
	GtkCheckButton* _tmp95_;
	gboolean _tmp96_;
	gboolean _tmp97_;
	GtkCheckButton* _tmp101_;
	gboolean _tmp102_ = FALSE;
	GtkCheckButton* _tmp103_;
	gboolean _tmp104_;
	gboolean _tmp105_;
	GtkCheckButton* _tmp109_;
	gboolean _tmp110_ = FALSE;
	GtkCheckButton* _tmp111_;
	gboolean _tmp112_;
	gboolean _tmp113_;
	GtkCheckButton* _tmp117_;
	GtkCheckButton* _tmp118_;
	GtkCheckButton* _tmp119_;
	GtkCheckButton* _tmp120_;
	GtkCheckButton* _tmp121_;
	GtkCheckButton* _tmp122_;
	GtkCheckButton* _tmp123_;
	GtkCheckButton* _tmp124_;
	GtkCheckButton* _tmp125_;
	GtkCheckButton* _tmp126_;
	GtkCheckButton* _tmp127_;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp128_ = NULL;
	GtkCheckButton* _tmp129_;
	GtkCheckButton* _tmp130_;
	GtkCheckButton* _tmp131_;
	GtkCheckButton* _tmp132_;
	GtkCheckButton* _tmp133_;
	GtkCheckButton* _tmp134_;
	GtkCheckButton* _tmp135_;
	GtkCheckButton* _tmp136_;
	GtkCheckButton* _tmp137_;
	GtkCheckButton* _tmp138_;
	GtkGrid* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Nodes"));
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->_search_nodes);
	self->priv->_search_nodes = _tmp0_;
	_tmp1_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Connections"));
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_search_connections);
	self->priv->_search_connections = _tmp1_;
	_tmp2_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Callouts"));
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->_search_callouts);
	self->priv->_search_callouts = _tmp2_;
	_tmp3_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Groups"));
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->_search_groups);
	self->priv->_search_groups = _tmp3_;
	_tmp4_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Titles"));
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->_search_titles);
	self->priv->_search_titles = _tmp4_;
	_tmp5_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Notes"));
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->_search_notes);
	self->priv->_search_notes = _tmp5_;
	_tmp6_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Folded"));
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->_search_folded);
	self->priv->_search_folded = _tmp6_;
	_tmp7_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Unfolded"));
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->_search_unfolded);
	self->priv->_search_unfolded = _tmp7_;
	_tmp8_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Tasks"));
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->_search_tasks);
	self->priv->_search_tasks = _tmp8_;
	_tmp9_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Non-tasks"));
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->_search_nontasks);
	self->priv->_search_nontasks = _tmp9_;
	_tmp10_ = self->priv->_search_nodes;
	_tmp11_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp10_, g_settings_get_boolean (_tmp11_, "search-opt-nodes"));
	_tmp12_ = self->priv->_search_connections;
	_tmp13_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp12_, g_settings_get_boolean (_tmp13_, "search-opt-connections"));
	_tmp14_ = self->priv->_search_callouts;
	_tmp15_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp14_, g_settings_get_boolean (_tmp15_, "search-opt-callouts"));
	_tmp16_ = self->priv->_search_groups;
	_tmp17_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp16_, g_settings_get_boolean (_tmp17_, "search-opt-groups"));
	_tmp18_ = self->priv->_search_titles;
	_tmp19_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp18_, g_settings_get_boolean (_tmp19_, "search-opt-titles"));
	_tmp20_ = self->priv->_search_notes;
	_tmp21_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp20_, g_settings_get_boolean (_tmp21_, "search-opt-notes"));
	_tmp22_ = self->priv->_search_folded;
	_tmp23_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp22_, g_settings_get_boolean (_tmp23_, "search-opt-folded"));
	_tmp24_ = self->priv->_search_unfolded;
	_tmp25_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp24_, g_settings_get_boolean (_tmp25_, "search-opt-unfolded"));
	_tmp26_ = self->priv->_search_tasks;
	_tmp27_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp26_, g_settings_get_boolean (_tmp27_, "search-opt-tasks"));
	_tmp28_ = self->priv->_search_nontasks;
	_tmp29_ = self->priv->_settings;
	gtk_check_button_set_active (_tmp28_, g_settings_get_boolean (_tmp29_, "search-opt-nontasks"));
	_tmp32_ = self->priv->_search_callouts;
	_tmp33_ = gtk_check_button_get_active (_tmp32_);
	_tmp34_ = _tmp33_;
	if (_tmp34_) {
		_tmp31_ = TRUE;
	} else {
		GtkCheckButton* _tmp35_;
		gboolean _tmp36_;
		gboolean _tmp37_;
		_tmp35_ = self->priv->_search_connections;
		_tmp36_ = gtk_check_button_get_active (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp31_ = _tmp37_;
	}
	if (_tmp31_) {
		_tmp30_ = TRUE;
	} else {
		GtkCheckButton* _tmp38_;
		gboolean _tmp39_;
		gboolean _tmp40_;
		_tmp38_ = self->priv->_search_groups;
		_tmp39_ = gtk_check_button_get_active (_tmp38_);
		_tmp40_ = _tmp39_;
		_tmp30_ = _tmp40_;
	}
	_tmp41_ = self->priv->_search_nodes;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp41_, _tmp30_);
	_tmp44_ = self->priv->_search_nodes;
	_tmp45_ = gtk_check_button_get_active (_tmp44_);
	_tmp46_ = _tmp45_;
	if (_tmp46_) {
		_tmp43_ = TRUE;
	} else {
		GtkCheckButton* _tmp47_;
		gboolean _tmp48_;
		gboolean _tmp49_;
		_tmp47_ = self->priv->_search_callouts;
		_tmp48_ = gtk_check_button_get_active (_tmp47_);
		_tmp49_ = _tmp48_;
		_tmp43_ = _tmp49_;
	}
	if (_tmp43_) {
		_tmp42_ = TRUE;
	} else {
		GtkCheckButton* _tmp50_;
		gboolean _tmp51_;
		gboolean _tmp52_;
		_tmp50_ = self->priv->_search_groups;
		_tmp51_ = gtk_check_button_get_active (_tmp50_);
		_tmp52_ = _tmp51_;
		_tmp42_ = _tmp52_;
	}
	_tmp53_ = self->priv->_search_connections;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp53_, _tmp42_);
	_tmp56_ = self->priv->_search_nodes;
	_tmp57_ = gtk_check_button_get_active (_tmp56_);
	_tmp58_ = _tmp57_;
	if (_tmp58_) {
		_tmp55_ = TRUE;
	} else {
		GtkCheckButton* _tmp59_;
		gboolean _tmp60_;
		gboolean _tmp61_;
		_tmp59_ = self->priv->_search_connections;
		_tmp60_ = gtk_check_button_get_active (_tmp59_);
		_tmp61_ = _tmp60_;
		_tmp55_ = _tmp61_;
	}
	if (_tmp55_) {
		_tmp54_ = TRUE;
	} else {
		GtkCheckButton* _tmp62_;
		gboolean _tmp63_;
		gboolean _tmp64_;
		_tmp62_ = self->priv->_search_groups;
		_tmp63_ = gtk_check_button_get_active (_tmp62_);
		_tmp64_ = _tmp63_;
		_tmp54_ = _tmp64_;
	}
	_tmp65_ = self->priv->_search_callouts;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp65_, _tmp54_);
	_tmp68_ = self->priv->_search_nodes;
	_tmp69_ = gtk_check_button_get_active (_tmp68_);
	_tmp70_ = _tmp69_;
	if (_tmp70_) {
		_tmp67_ = TRUE;
	} else {
		GtkCheckButton* _tmp71_;
		gboolean _tmp72_;
		gboolean _tmp73_;
		_tmp71_ = self->priv->_search_connections;
		_tmp72_ = gtk_check_button_get_active (_tmp71_);
		_tmp73_ = _tmp72_;
		_tmp67_ = _tmp73_;
	}
	if (_tmp67_) {
		_tmp66_ = TRUE;
	} else {
		GtkCheckButton* _tmp74_;
		gboolean _tmp75_;
		gboolean _tmp76_;
		_tmp74_ = self->priv->_search_callouts;
		_tmp75_ = gtk_check_button_get_active (_tmp74_);
		_tmp76_ = _tmp75_;
		_tmp66_ = _tmp76_;
	}
	_tmp77_ = self->priv->_search_groups;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp77_, _tmp66_);
	_tmp78_ = self->priv->_search_titles;
	_tmp79_ = self->priv->_search_notes;
	_tmp80_ = gtk_check_button_get_active (_tmp79_);
	_tmp81_ = _tmp80_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp78_, _tmp81_);
	_tmp82_ = self->priv->_search_notes;
	_tmp83_ = self->priv->_search_titles;
	_tmp84_ = gtk_check_button_get_active (_tmp83_);
	_tmp85_ = _tmp84_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp82_, _tmp85_);
	_tmp87_ = self->priv->_search_nodes;
	_tmp88_ = gtk_check_button_get_active (_tmp87_);
	_tmp89_ = _tmp88_;
	if (_tmp89_) {
		GtkCheckButton* _tmp90_;
		gboolean _tmp91_;
		gboolean _tmp92_;
		_tmp90_ = self->priv->_search_unfolded;
		_tmp91_ = gtk_check_button_get_active (_tmp90_);
		_tmp92_ = _tmp91_;
		_tmp86_ = _tmp92_;
	} else {
		_tmp86_ = FALSE;
	}
	_tmp93_ = self->priv->_search_folded;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp93_, _tmp86_);
	_tmp95_ = self->priv->_search_nodes;
	_tmp96_ = gtk_check_button_get_active (_tmp95_);
	_tmp97_ = _tmp96_;
	if (_tmp97_) {
		GtkCheckButton* _tmp98_;
		gboolean _tmp99_;
		gboolean _tmp100_;
		_tmp98_ = self->priv->_search_folded;
		_tmp99_ = gtk_check_button_get_active (_tmp98_);
		_tmp100_ = _tmp99_;
		_tmp94_ = _tmp100_;
	} else {
		_tmp94_ = FALSE;
	}
	_tmp101_ = self->priv->_search_unfolded;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp101_, _tmp94_);
	_tmp103_ = self->priv->_search_nodes;
	_tmp104_ = gtk_check_button_get_active (_tmp103_);
	_tmp105_ = _tmp104_;
	if (_tmp105_) {
		GtkCheckButton* _tmp106_;
		gboolean _tmp107_;
		gboolean _tmp108_;
		_tmp106_ = self->priv->_search_nontasks;
		_tmp107_ = gtk_check_button_get_active (_tmp106_);
		_tmp108_ = _tmp107_;
		_tmp102_ = _tmp108_;
	} else {
		_tmp102_ = FALSE;
	}
	_tmp109_ = self->priv->_search_tasks;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp109_, _tmp102_);
	_tmp111_ = self->priv->_search_nodes;
	_tmp112_ = gtk_check_button_get_active (_tmp111_);
	_tmp113_ = _tmp112_;
	if (_tmp113_) {
		GtkCheckButton* _tmp114_;
		gboolean _tmp115_;
		gboolean _tmp116_;
		_tmp114_ = self->priv->_search_tasks;
		_tmp115_ = gtk_check_button_get_active (_tmp114_);
		_tmp116_ = _tmp115_;
		_tmp110_ = _tmp116_;
	} else {
		_tmp110_ = FALSE;
	}
	_tmp117_ = self->priv->_search_nontasks;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp117_, _tmp110_);
	_tmp118_ = self->priv->_search_nodes;
	g_signal_connect_object (_tmp118_, "toggled", (GCallback) ___lambda258__gtk_check_button_toggled, self, 0);
	_tmp119_ = self->priv->_search_connections;
	g_signal_connect_object (_tmp119_, "toggled", (GCallback) ___lambda259__gtk_check_button_toggled, self, 0);
	_tmp120_ = self->priv->_search_callouts;
	g_signal_connect_object (_tmp120_, "toggled", (GCallback) ___lambda260__gtk_check_button_toggled, self, 0);
	_tmp121_ = self->priv->_search_groups;
	g_signal_connect_object (_tmp121_, "toggled", (GCallback) ___lambda261__gtk_check_button_toggled, self, 0);
	_tmp122_ = self->priv->_search_titles;
	g_signal_connect_object (_tmp122_, "toggled", (GCallback) ___lambda262__gtk_check_button_toggled, self, 0);
	_tmp123_ = self->priv->_search_notes;
	g_signal_connect_object (_tmp123_, "toggled", (GCallback) ___lambda263__gtk_check_button_toggled, self, 0);
	_tmp124_ = self->priv->_search_folded;
	g_signal_connect_object (_tmp124_, "toggled", (GCallback) ___lambda264__gtk_check_button_toggled, self, 0);
	_tmp125_ = self->priv->_search_unfolded;
	g_signal_connect_object (_tmp125_, "toggled", (GCallback) ___lambda265__gtk_check_button_toggled, self, 0);
	_tmp126_ = self->priv->_search_tasks;
	g_signal_connect_object (_tmp126_, "toggled", (GCallback) ___lambda266__gtk_check_button_toggled, self, 0);
	_tmp127_ = self->priv->_search_nontasks;
	g_signal_connect_object (_tmp127_, "toggled", (GCallback) ___lambda267__gtk_check_button_toggled, self, 0);
	_tmp128_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp128_, 10);
	gtk_grid_set_column_homogeneous (_tmp128_, TRUE);
	gtk_grid_set_column_spacing (_tmp128_, 10);
	gtk_grid_set_row_spacing (_tmp128_, 10);
	g_object_ref_sink (_tmp128_);
	grid = _tmp128_;
	_tmp129_ = self->priv->_search_nodes;
	gtk_grid_attach (grid, (GtkWidget*) _tmp129_, 0, 0, 1, 1);
	_tmp130_ = self->priv->_search_connections;
	gtk_grid_attach (grid, (GtkWidget*) _tmp130_, 0, 1, 1, 1);
	_tmp131_ = self->priv->_search_callouts;
	gtk_grid_attach (grid, (GtkWidget*) _tmp131_, 0, 2, 1, 1);
	_tmp132_ = self->priv->_search_groups;
	gtk_grid_attach (grid, (GtkWidget*) _tmp132_, 0, 3, 1, 1);
	_tmp133_ = self->priv->_search_titles;
	gtk_grid_attach (grid, (GtkWidget*) _tmp133_, 1, 0, 1, 1);
	_tmp134_ = self->priv->_search_notes;
	gtk_grid_attach (grid, (GtkWidget*) _tmp134_, 1, 1, 1, 1);
	_tmp135_ = self->priv->_search_folded;
	gtk_grid_attach (grid, (GtkWidget*) _tmp135_, 2, 0, 1, 1);
	_tmp136_ = self->priv->_search_unfolded;
	gtk_grid_attach (grid, (GtkWidget*) _tmp136_, 2, 1, 1, 1);
	_tmp137_ = self->priv->_search_tasks;
	gtk_grid_attach (grid, (GtkWidget*) _tmp137_, 3, 0, 1, 1);
	_tmp138_ = self->priv->_search_nontasks;
	gtk_grid_attach (grid, (GtkWidget*) _tmp138_, 3, 1, 1, 1);
	result = grid;
	return result;
}

static Block32Data*
block32_data_ref (Block32Data* _data32_)
{
	g_atomic_int_inc (&_data32_->_ref_count_);
	return _data32_;
}

static void
block32_data_unref (void * _userdata_)
{
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
		MainWindow* self;
		self = _data32_->self;
		_g_object_unref0 (_data32_->popover);
		_g_object_unref0 (self);
		g_slice_free (Block32Data, _data32_);
	}
}

static void
__lambda256_ (Block32Data* _data32_)
{
	MainWindow* self;
	GtkPopoverMenu* _tmp0_;
	self = _data32_->self;
	_tmp0_ = _data32_->popover;
	gtk_popover_popdown ((GtkPopover*) _tmp0_);
}

static void
___lambda256__exporter_export_done (Exporter* _sender,
                                    gpointer self)
{
	__lambda256_ (self);
}

static void
main_window_add_export_button (MainWindow* self)
{
	Block32Data* _data32_;
	GMenuItem* export_item = NULL;
	GMenuItem* _tmp0_;
	GMenuItem* _tmp1_;
	GMenu* export_menu = NULL;
	GMenu* _tmp2_;
	GMenu* _tmp3_;
	GMenuItem* _tmp4_;
	GMenu* print_menu = NULL;
	GMenu* _tmp5_;
	GMenu* _tmp6_;
	GMenu* menu = NULL;
	GMenu* _tmp7_;
	GMenu* _tmp8_;
	GMenu* _tmp9_;
	GMenu* _tmp10_;
	GMenu* _tmp11_;
	GMenu* _tmp12_;
	GtkPopoverMenu* _tmp13_ = NULL;
	Exporter* _tmp14_ = NULL;
	Exporter* _tmp15_;
	GtkPopoverMenu* _tmp16_;
	Exporter* _tmp17_;
	const gchar* _tmp18_ = NULL;
	GtkMenuButton* menu_btn = NULL;
	gchar* _tmp19_;
	gchar* _tmp20_;
	GtkPopoverMenu* _tmp21_;
	GtkPopover* _tmp22_;
	GtkMenuButton* _tmp23_ = NULL;
	GtkHeaderBar* _tmp24_;
	g_return_if_fail (self != NULL);
	_data32_ = g_slice_new0 (Block32Data);
	_data32_->_ref_count_ = 1;
	_data32_->self = g_object_ref (self);
	_tmp0_ = g_menu_item_new (NULL, NULL);
	export_item = _tmp0_;
	_tmp1_ = export_item;
	g_menu_item_set_attribute (_tmp1_, "custom", "s", "export", NULL);
	_tmp2_ = g_menu_new ();
	export_menu = _tmp2_;
	_tmp3_ = export_menu;
	_tmp4_ = export_item;
	g_menu_append_item (_tmp3_, _tmp4_);
	_tmp5_ = g_menu_new ();
	print_menu = _tmp5_;
	_tmp6_ = print_menu;
	main_window_append_menu_item (self, _tmp6_, KEY_COMMAND_FILE_PRINT, _ ("Print…"));
	_tmp7_ = g_menu_new ();
	menu = _tmp7_;
	_tmp8_ = menu;
	_tmp9_ = export_menu;
	g_menu_append_section (_tmp8_, NULL, (GMenuModel*) _tmp9_);
	_tmp10_ = menu;
	_tmp11_ = print_menu;
	g_menu_append_section (_tmp10_, NULL, (GMenuModel*) _tmp11_);
	_tmp12_ = menu;
	_tmp13_ = (GtkPopoverMenu*) gtk_popover_menu_new_from_model ((GMenuModel*) _tmp12_);
	gtk_popover_set_cascade_popdown ((GtkPopover*) _tmp13_, FALSE);
	g_object_ref_sink (_tmp13_);
	_data32_->popover = _tmp13_;
	_tmp14_ = exporter_new (self);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp14_, 5);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp14_, 5);
	g_object_ref_sink (_tmp14_);
	_g_object_unref0 (self->priv->_exporter);
	self->priv->_exporter = _tmp14_;
	_tmp15_ = self->priv->_exporter;
	g_signal_connect_data (_tmp15_, "export-done", (GCallback) ___lambda256__exporter_export_done, block32_data_ref (_data32_), (GClosureNotify) block32_data_unref, 0);
	_tmp16_ = _data32_->popover;
	_tmp17_ = self->priv->_exporter;
	gtk_popover_menu_add_child (_tmp16_, (GtkWidget*) _tmp17_, "export");
	if (self->priv->on_elementary) {
		_tmp18_ = "document-export";
	} else {
		_tmp18_ = "document-send-symbolic";
	}
	_tmp19_ = g_strdup (_tmp18_);
	_tmp20_ = g_strdup (_ ("Export"));
	_tmp21_ = _data32_->popover;
	_tmp22_ = _g_object_ref0 ((GtkPopover*) _tmp21_);
	_tmp23_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_icon_name (_tmp23_, _tmp19_);
	_g_free0 (_tmp19_);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp23_, _tmp20_);
	_g_free0 (_tmp20_);
	gtk_menu_button_set_popover (_tmp23_, _tmp22_);
	_g_object_unref0 (_tmp22_);
	g_object_ref_sink (_tmp23_);
	menu_btn = _tmp23_;
	_tmp24_ = self->priv->_header;
	gtk_header_bar_pack_end (_tmp24_, (GtkWidget*) menu_btn);
	_g_object_unref0 (menu_btn);
	_g_object_unref0 (menu);
	_g_object_unref0 (print_menu);
	_g_object_unref0 (export_menu);
	_g_object_unref0 (export_item);
	block32_data_unref (_data32_);
	_data32_ = NULL;
}

static void
__lambda272_ (MainWindow* self,
              GtkButton* e)
{
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Braindump* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GtkNotebook* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	g_return_if_fail (e != NULL);
	_tmp0_ = main_window_get_current_map (self, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_brain;
	_tmp3_ = gtk_widget_get_visible ((GtkWidget*) _tmp2_);
	_tmp4_ = _tmp3_;
	main_window_set_braindump_ui (self, _tmp1_, !_tmp4_);
	_mind_map_unref0 (_tmp1_);
	_tmp5_ = self->priv->_nb;
	g_object_get (_tmp5_, "page", &_tmp6_, NULL);
	_tmp7_ = _tmp6_;
	main_window_save_tab_state (self, (guint) _tmp7_);
}

static void
___lambda272__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda272_ ((MainWindow*) self, _sender);
}

static void
main_window_add_braindump_button (MainWindow* self)
{
	gchar* _tmp0_;
	GtkToggleButton* _tmp1_ = NULL;
	GtkToggleButton* _tmp2_;
	GtkToggleButton* _tmp3_;
	GtkHeaderBar* _tmp4_;
	GtkToggleButton* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("minder-braindump-light-symbolic");
	_tmp1_ = (GtkToggleButton*) gtk_toggle_button_new ();
	gtk_button_set_icon_name ((GtkButton*) _tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_brain_btn);
	self->priv->_brain_btn = _tmp1_;
	_tmp2_ = self->priv->_brain_btn;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp2_, KEY_COMMAND_TOGGLE_BRAINDUMP, _ ("Brain Dump"));
	_tmp3_ = self->priv->_brain_btn;
	g_signal_connect_object ((GtkButton*) _tmp3_, "clicked", (GCallback) ___lambda272__gtk_button_clicked, self, 0);
	_tmp4_ = self->priv->_header;
	_tmp5_ = self->priv->_brain_btn;
	gtk_header_bar_pack_end (_tmp4_, (GtkWidget*) _tmp5_);
}

void
main_window_set_braindump_ui (MainWindow* self,
                              MindMap* map,
                              gboolean show)
{
	gboolean _tmp0_ = FALSE;
	gboolean show_ui = FALSE;
	MapModel* _tmp3_;
	MapModel* _tmp4_;
	Braindump* _tmp5_;
	GtkToggleButton* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	if (show) {
		gboolean _tmp1_;
		gboolean _tmp2_;
		_tmp1_ = mind_map_get_editable (map);
		_tmp2_ = _tmp1_;
		_tmp0_ = _tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	show_ui = _tmp0_;
	_tmp3_ = mind_map_get_model (map);
	_tmp4_ = _tmp3_;
	map_model_set_braindump_shown (_tmp4_, show);
	_tmp5_ = self->priv->_brain;
	gtk_widget_set_visible ((GtkWidget*) _tmp5_, show_ui);
	_tmp6_ = self->priv->_brain_btn;
	gtk_toggle_button_set_active (_tmp6_, show_ui);
	if (show_ui) {
		Braindump* _tmp7_;
		_tmp7_ = self->priv->_brain;
		gtk_widget_grab_focus ((GtkWidget*) _tmp7_);
	} else {
		DrawArea* _tmp8_;
		DrawArea* _tmp9_;
		_tmp8_ = mind_map_get_canvas (map);
		_tmp9_ = _tmp8_;
		gtk_widget_grab_focus ((GtkWidget*) _tmp9_);
	}
}

static void
__lambda273_ (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	minder_debug_advance = TRUE;
	_tmp0_ = main_window_get_current_map (self, NULL);
	map = _tmp0_;
	_tmp1_ = map;
	if (_tmp1_ != NULL) {
		MindMap* _tmp2_;
		DrawArea* _tmp3_;
		DrawArea* _tmp4_;
		_tmp2_ = map;
		_tmp3_ = mind_map_get_canvas (_tmp2_);
		_tmp4_ = _tmp3_;
		gtk_widget_grab_focus ((GtkWidget*) _tmp4_);
	}
	_mind_map_unref0 (map);
}

static void
___lambda273__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda273_ ((MainWindow*) self);
}

static void
main_window_add_debug_button (MainWindow* self)
{
	GtkButton* btn = NULL;
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	GtkHeaderBar* _tmp2_;
	GtkButton* _tmp3_;
	g_return_if_fail (self != NULL);
	if (!minder_debug) {
		return;
	}
	_tmp0_ = (GtkButton*) gtk_button_new_from_icon_name ("media-playback-start-symbolic");
	g_object_ref_sink (_tmp0_);
	btn = _tmp0_;
	_tmp1_ = btn;
	g_signal_connect_object (_tmp1_, "clicked", (GCallback) ___lambda273__gtk_button_clicked, self, 0);
	_tmp2_ = self->priv->_header;
	_tmp3_ = btn;
	gtk_header_bar_pack_end (_tmp2_, (GtkWidget*) _tmp3_);
	_g_object_unref0 (btn);
}

static void
__lambda271_ (MainWindow* self,
              GtkButton* e)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	GtkToggleButton* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	DrawArea* _tmp4_;
	DrawArea* _tmp5_;
	g_return_if_fail (e != NULL);
	_tmp0_ = main_window_get_current_map (self, NULL);
	map = _tmp0_;
	main_window_update_title (self, map);
	_tmp1_ = self->priv->_focus_btn;
	_tmp2_ = gtk_toggle_button_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	mind_map_set_focus_mode (map, _tmp3_);
	_tmp4_ = mind_map_get_canvas (map);
	_tmp5_ = _tmp4_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp5_);
	_mind_map_unref0 (map);
}

static void
___lambda271__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda271_ ((MainWindow*) self, _sender);
}

static void
main_window_add_focus_button (MainWindow* self)
{
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GtkToggleButton* _tmp2_ = NULL;
	GtkToggleButton* _tmp3_;
	GtkToggleButton* _tmp4_;
	GtkHeaderBar* _tmp5_;
	GtkToggleButton* _tmp6_;
	g_return_if_fail (self != NULL);
	if (self->priv->on_elementary) {
		_tmp0_ = "minder-focus";
	} else {
		_tmp0_ = "media-optical-symbolic";
	}
	_tmp1_ = g_strdup (_tmp0_);
	_tmp2_ = (GtkToggleButton*) gtk_toggle_button_new ();
	gtk_button_set_icon_name ((GtkButton*) _tmp2_, _tmp1_);
	_g_free0 (_tmp1_);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->_focus_btn);
	self->priv->_focus_btn = _tmp2_;
	_tmp3_ = self->priv->_focus_btn;
	main_window_register_widget_for_shortcut (self, (GtkWidget*) _tmp3_, KEY_COMMAND_TOGGLE_FOCUS_MODE, _ ("Focus Mode"));
	_tmp4_ = self->priv->_focus_btn;
	g_signal_connect_object ((GtkButton*) _tmp4_, "clicked", (GCallback) ___lambda271__gtk_button_clicked, self, 0);
	_tmp5_ = self->priv->_header;
	_tmp6_ = self->priv->_focus_btn;
	gtk_header_bar_pack_end (_tmp5_, (GtkWidget*) _tmp6_);
}

static void
main_window_add_miscellaneous_button (MainWindow* self)
{
	GMenu* menu = NULL;
	GMenu* misc_menu = NULL;
	GMenu* _tmp0_;
	GMenu* about_menu = NULL;
	GMenu* _tmp1_;
	GMenu* _tmp2_;
	GtkMenuButton* misc_btn = NULL;
	gchar* _tmp3_;
	GMenuModel* _tmp4_;
	GtkMenuButton* _tmp5_ = NULL;
	GtkHeaderBar* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_menu_new ();
	misc_menu = _tmp0_;
	main_window_append_menu_item (self, misc_menu, KEY_COMMAND_SHOW_PREFERENCES, _ ("Preferences"));
	main_window_append_menu_item (self, misc_menu, KEY_COMMAND_SHOW_SHORTCUTS, _ ("Shortcuts Cheatsheet"));
	_tmp1_ = g_menu_new ();
	about_menu = _tmp1_;
	main_window_append_menu_item (self, about_menu, KEY_COMMAND_SHOW_ABOUT, _ ("About Minder"));
	_tmp2_ = g_menu_new ();
	_g_object_unref0 (menu);
	menu = _tmp2_;
	g_menu_append_section (menu, NULL, (GMenuModel*) misc_menu);
	g_menu_append_section (menu, NULL, (GMenuModel*) about_menu);
	_tmp3_ = main_window_get_icon_name (self, "open-menu");
	_tmp4_ = _g_object_ref0 ((GMenuModel*) menu);
	_tmp5_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_icon_name (_tmp5_, _tmp3_);
	_g_free0 (_tmp3_);
	gtk_menu_button_set_menu_model (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	misc_btn = _tmp5_;
	_tmp6_ = self->priv->_header;
	gtk_header_bar_pack_end (_tmp6_, (GtkWidget*) misc_btn);
	_g_object_unref0 (misc_btn);
	_g_object_unref0 (about_menu);
	_g_object_unref0 (misc_menu);
	_g_object_unref0 (menu);
}

GMenu*
main_window_make_markdown_menu (MainWindow* self)
{
	GMenu* md_menu = NULL;
	GMenu* _tmp0_;
	GMenu* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_menu_new ();
	md_menu = _tmp0_;
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_HEADER1, _ ("# Header1"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_HEADER2, _ ("## Header2"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_HEADER3, _ ("### Header3"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_HEADER4, _ ("#### Header4"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_HEADER5, _ ("##### Header5"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_HEADER6, _ ("###### Header6"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_BOLD, _ ("**Bold**"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_ITALICS, _ ("__Italicize_"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_STRIKE, _ ("~~Strikeout~~"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_CODE, _ ("`Code`"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_HIGHLIGHT, _ ("==Highlight=="));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_SUPERSCRIPT, _ ("<sup>Superscript</sup>"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_SUBSCRIPT, _ ("<sub>Subscript</sub>"));
	main_window_append_menu_item (self, md_menu, KEY_COMMAND_EDIT_LINK, _ ("[Link text](URL)"));
	result = md_menu;
	return result;
}

static Block33Data*
block33_data_ref (Block33Data* _data33_)
{
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		MainWindow* self;
		self = _data33_->self;
		_g_object_unref0 (_data33_->sidebar_switcher);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

static void
_main_window_inspector_clicked_gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                          gpointer self)
{
	main_window_inspector_clicked ((MainWindow*) self);
}

static gboolean
_main_window_stack_keypress_gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                  guint keyval,
                                                                  guint keycode,
                                                                  GdkModifierType state,
                                                                  gpointer self)
{
	gboolean result;
	result = main_window_stack_keypress ((MainWindow*) self, keyval, keycode, state);
	return result;
}

static void
__lambda253_ (MainWindow* self,
              GParamSpec* ps)
{
	const gchar* _tmp0_;
	g_return_if_fail (ps != NULL);
	_tmp0_ = ps->name;
	if (g_strcmp0 (_tmp0_, "visible-child") == 0) {
		GSettings* _tmp1_;
		GtkStack* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		GSettings* _tmp5_;
		GtkStack* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		GSettings* _tmp9_;
		GtkStack* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		GSettings* _tmp13_;
		GtkStack* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		GSettings* _tmp17_;
		GtkStack* _tmp18_;
		const gchar* _tmp19_;
		const gchar* _tmp20_;
		GtkStack* _tmp21_;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		GQuark _tmp26_ = 0U;
		static GQuark _tmp25_label0 = 0;
		static GQuark _tmp25_label1 = 0;
		static GQuark _tmp25_label2 = 0;
		static GQuark _tmp25_label3 = 0;
		static GQuark _tmp25_label4 = 0;
		_tmp1_ = self->priv->_settings;
		_tmp2_ = self->priv->_stack;
		_tmp3_ = gtk_stack_get_visible_child_name (_tmp2_);
		_tmp4_ = _tmp3_;
		g_settings_set_boolean (_tmp1_, "current-properties-shown", g_strcmp0 (_tmp4_, "current") == 0);
		_tmp5_ = self->priv->_settings;
		_tmp6_ = self->priv->_stack;
		_tmp7_ = gtk_stack_get_visible_child_name (_tmp6_);
		_tmp8_ = _tmp7_;
		g_settings_set_boolean (_tmp5_, "style-properties-shown", g_strcmp0 (_tmp8_, "style") == 0);
		_tmp9_ = self->priv->_settings;
		_tmp10_ = self->priv->_stack;
		_tmp11_ = gtk_stack_get_visible_child_name (_tmp10_);
		_tmp12_ = _tmp11_;
		g_settings_set_boolean (_tmp9_, "tag-properties-shown", g_strcmp0 (_tmp12_, "tag") == 0);
		_tmp13_ = self->priv->_settings;
		_tmp14_ = self->priv->_stack;
		_tmp15_ = gtk_stack_get_visible_child_name (_tmp14_);
		_tmp16_ = _tmp15_;
		g_settings_set_boolean (_tmp13_, "sticker-properties-shown", g_strcmp0 (_tmp16_, "sticker") == 0);
		_tmp17_ = self->priv->_settings;
		_tmp18_ = self->priv->_stack;
		_tmp19_ = gtk_stack_get_visible_child_name (_tmp18_);
		_tmp20_ = _tmp19_;
		g_settings_set_boolean (_tmp17_, "map-properties-shown", g_strcmp0 (_tmp20_, "map") == 0);
		_tmp21_ = self->priv->_stack;
		_tmp22_ = gtk_stack_get_visible_child_name (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = _tmp23_;
		_tmp26_ = (NULL == _tmp24_) ? 0 : g_quark_from_string (_tmp24_);
		if (_tmp26_ == ((0 != _tmp25_label0) ? _tmp25_label0 : (_tmp25_label0 = g_quark_from_static_string ("current")))) {
			switch (0) {
				default:
				{
					GtkStack* _tmp27_;
					GtkWidget* _tmp28_;
					GtkWidget* _tmp29_;
					_tmp27_ = self->priv->_stack;
					_tmp28_ = gtk_stack_get_visible_child (_tmp27_);
					_tmp29_ = _tmp28_;
					current_inspector_grab_first (IS_CURRENT_INSPECTOR (_tmp29_) ? ((CurrentInspector*) _tmp29_) : NULL);
					break;
				}
			}
		} else if (_tmp26_ == ((0 != _tmp25_label1) ? _tmp25_label1 : (_tmp25_label1 = g_quark_from_static_string ("style")))) {
			switch (0) {
				default:
				{
					GtkStack* _tmp30_;
					GtkWidget* _tmp31_;
					GtkWidget* _tmp32_;
					_tmp30_ = self->priv->_stack;
					_tmp31_ = gtk_stack_get_visible_child (_tmp30_);
					_tmp32_ = _tmp31_;
					style_inspector_grab_first (IS_STYLE_INSPECTOR (_tmp32_) ? ((StyleInspector*) _tmp32_) : NULL);
					break;
				}
			}
		} else if (_tmp26_ == ((0 != _tmp25_label2) ? _tmp25_label2 : (_tmp25_label2 = g_quark_from_static_string ("tag")))) {
			switch (0) {
				default:
				{
					GtkStack* _tmp33_;
					GtkWidget* _tmp34_;
					GtkWidget* _tmp35_;
					_tmp33_ = self->priv->_stack;
					_tmp34_ = gtk_stack_get_visible_child (_tmp33_);
					_tmp35_ = _tmp34_;
					tag_inspector_grab_first (IS_TAG_INSPECTOR (_tmp35_) ? ((TagInspector*) _tmp35_) : NULL);
					break;
				}
			}
		} else if (_tmp26_ == ((0 != _tmp25_label3) ? _tmp25_label3 : (_tmp25_label3 = g_quark_from_static_string ("sticker")))) {
			switch (0) {
				default:
				{
					GtkStack* _tmp36_;
					GtkWidget* _tmp37_;
					GtkWidget* _tmp38_;
					_tmp36_ = self->priv->_stack;
					_tmp37_ = gtk_stack_get_visible_child (_tmp36_);
					_tmp38_ = _tmp37_;
					sticker_inspector_grab_first (IS_STICKER_INSPECTOR (_tmp38_) ? ((StickerInspector*) _tmp38_) : NULL);
					break;
				}
			}
		} else if (_tmp26_ == ((0 != _tmp25_label4) ? _tmp25_label4 : (_tmp25_label4 = g_quark_from_static_string ("map")))) {
			switch (0) {
				default:
				{
					GtkStack* _tmp39_;
					GtkWidget* _tmp40_;
					GtkWidget* _tmp41_;
					_tmp39_ = self->priv->_stack;
					_tmp40_ = gtk_stack_get_visible_child (_tmp39_);
					_tmp41_ = _tmp40_;
					map_inspector_grab_first (IS_MAP_INSPECTOR (_tmp41_) ? ((MapInspector*) _tmp41_) : NULL);
					break;
				}
			}
		} else {
			switch (0) {
				default:
				{
					break;
				}
			}
		}
	}
}

static void
___lambda253__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda253_ ((MainWindow*) self, pspec);
}

static void
__lambda254_ (MainWindow* self,
              gint index)
{
	switch (index) {
		case 0:
		{
			GtkStack* _tmp0_;
			_tmp0_ = self->priv->_stack;
			gtk_stack_set_visible_child_name (_tmp0_, "current");
			break;
		}
		case 1:
		{
			GtkStack* _tmp1_;
			_tmp1_ = self->priv->_stack;
			gtk_stack_set_visible_child_name (_tmp1_, "style");
			break;
		}
		case 2:
		{
			GtkStack* _tmp2_;
			_tmp2_ = self->priv->_stack;
			gtk_stack_set_visible_child_name (_tmp2_, "tag");
			break;
		}
		case 3:
		{
			GtkStack* _tmp3_;
			_tmp3_ = self->priv->_stack;
			gtk_stack_set_visible_child_name (_tmp3_, "sticker");
			break;
		}
		case 4:
		{
			GtkStack* _tmp4_;
			_tmp4_ = self->priv->_stack;
			gtk_stack_set_visible_child_name (_tmp4_, "map");
			break;
		}
		default:
		break;
	}
}

static void
___lambda254__mode_buttons_changed (ModeButtons* _sender,
                                    gint index,
                                    gpointer self)
{
	__lambda254_ ((MainWindow*) self, index);
}

static void
__lambda255_ (Block33Data* _data33_)
{
	MainWindow* self;
	GtkStack* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	GQuark _tmp5_ = 0U;
	static GQuark _tmp4_label0 = 0;
	static GQuark _tmp4_label1 = 0;
	static GQuark _tmp4_label2 = 0;
	static GQuark _tmp4_label3 = 0;
	static GQuark _tmp4_label4 = 0;
	self = _data33_->self;
	_tmp0_ = self->priv->_stack;
	_tmp1_ = gtk_stack_get_visible_child_name (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp5_ = (NULL == _tmp3_) ? 0 : g_quark_from_string (_tmp3_);
	if (_tmp5_ == ((0 != _tmp4_label0) ? _tmp4_label0 : (_tmp4_label0 = g_quark_from_static_string ("current")))) {
		switch (0) {
			default:
			{
				mode_buttons_set_selected (_data33_->sidebar_switcher, 0);
				break;
			}
		}
	} else if (_tmp5_ == ((0 != _tmp4_label1) ? _tmp4_label1 : (_tmp4_label1 = g_quark_from_static_string ("style")))) {
		switch (0) {
			default:
			{
				mode_buttons_set_selected (_data33_->sidebar_switcher, 1);
				break;
			}
		}
	} else if (_tmp5_ == ((0 != _tmp4_label2) ? _tmp4_label2 : (_tmp4_label2 = g_quark_from_static_string ("tag")))) {
		switch (0) {
			default:
			{
				mode_buttons_set_selected (_data33_->sidebar_switcher, 2);
				break;
			}
		}
	} else if (_tmp5_ == ((0 != _tmp4_label3) ? _tmp4_label3 : (_tmp4_label3 = g_quark_from_static_string ("sticker")))) {
		switch (0) {
			default:
			{
				mode_buttons_set_selected (_data33_->sidebar_switcher, 3);
				break;
			}
		}
	} else if (_tmp5_ == ((0 != _tmp4_label4) ? _tmp4_label4 : (_tmp4_label4 = g_quark_from_static_string ("map")))) {
		switch (0) {
			default:
			{
				mode_buttons_set_selected (_data33_->sidebar_switcher, 4);
				break;
			}
		}
	}
}

static void
___lambda255__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda255_ (self);
}

static void
main_window_add_property_button (MainWindow* self)
{
	Block33Data* _data33_;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GtkToggleButton* _tmp7_ = NULL;
	GtkToggleButton* _tmp8_;
	GtkHeaderBar* _tmp9_;
	GtkToggleButton* _tmp10_;
	GtkStack* _tmp11_ = NULL;
	GtkStack* _tmp12_;
	CurrentInspector* _tmp13_;
	CurrentInspector* _tmp14_;
	GtkStack* _tmp15_;
	GSettings* _tmp16_;
	StyleInspector* _tmp17_;
	StyleInspector* _tmp18_;
	GtkStack* _tmp19_;
	TagInspector* _tmp20_;
	TagInspector* _tmp21_;
	GtkStack* _tmp22_;
	GSettings* _tmp23_;
	StickerInspector* _tmp24_;
	StickerInspector* _tmp25_;
	GtkStack* _tmp26_;
	GSettings* _tmp27_;
	MapInspector* _tmp28_;
	MapInspector* _tmp29_;
	GtkEventControllerKey* key = NULL;
	GtkEventControllerKey* _tmp30_;
	GtkStack* _tmp31_;
	GtkEventController* _tmp32_;
	GtkStack* _tmp33_;
	ModeButtons* _tmp34_ = NULL;
	GtkStack* _tmp35_;
	GtkBox* box = NULL;
	GtkBox* _tmp36_ = NULL;
	GtkStack* _tmp37_;
	ThemeEditor* _tmp38_;
	GtkNotebook* _tmp39_ = NULL;
	GtkNotebook* _tmp40_;
	GtkNotebook* _tmp41_;
	ThemeEditor* _tmp42_;
	g_return_if_fail (self != NULL);
	_data33_ = g_slice_new0 (Block33Data);
	_data33_->_ref_count_ = 1;
	_data33_->self = g_object_ref (self);
	if (self->priv->on_elementary) {
		_tmp0_ = "minder-sidebar-open";
	} else {
		_tmp0_ = "minder-sidebar-light-symbolic";
	}
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->priv->_prop_show);
	self->priv->_prop_show = _tmp1_;
	if (self->priv->on_elementary) {
		_tmp2_ = "minder-sidebar-close";
	} else {
		_tmp2_ = "minder-sidebar-light-symbolic";
	}
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 (self->priv->_prop_hide);
	self->priv->_prop_hide = _tmp3_;
	_tmp4_ = self->priv->_prop_show;
	_tmp5_ = g_strdup (_tmp4_);
	_tmp6_ = g_strdup (_ ("Show Property Sidebar"));
	_tmp7_ = (GtkToggleButton*) gtk_toggle_button_new ();
	gtk_button_set_icon_name ((GtkButton*) _tmp7_, _tmp5_);
	_g_free0 (_tmp5_);
	gtk_toggle_button_set_active (_tmp7_, FALSE);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp7_, _tmp6_);
	_g_free0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->_prop_btn);
	self->priv->_prop_btn = _tmp7_;
	_tmp8_ = self->priv->_prop_btn;
	g_signal_connect_object (_tmp8_, "toggled", (GCallback) _main_window_inspector_clicked_gtk_toggle_button_toggled, self, 0);
	_tmp9_ = self->priv->_header;
	_tmp10_ = self->priv->_prop_btn;
	gtk_header_bar_pack_end (_tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = (GtkStack*) gtk_stack_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp11_, GTK_ALIGN_FILL);
	gtk_widget_set_valign ((GtkWidget*) _tmp11_, GTK_ALIGN_FILL);
	gtk_stack_set_transition_type (_tmp11_, GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT);
	gtk_stack_set_transition_duration (_tmp11_, (guint) 500);
	g_object_ref_sink (_tmp11_);
	_g_object_unref0 (self->priv->_stack);
	self->priv->_stack = _tmp11_;
	_tmp12_ = self->priv->_stack;
	_tmp13_ = current_inspector_new (self);
	g_object_ref_sink (_tmp13_);
	_tmp14_ = _tmp13_;
	gtk_stack_add_titled (_tmp12_, (GtkWidget*) _tmp14_, "current", _ ("Current"));
	_g_object_unref0 (_tmp14_);
	_tmp15_ = self->priv->_stack;
	_tmp16_ = self->priv->_settings;
	_tmp17_ = style_inspector_new (self, _tmp16_);
	g_object_ref_sink (_tmp17_);
	_tmp18_ = _tmp17_;
	gtk_stack_add_titled (_tmp15_, (GtkWidget*) _tmp18_, "style", _ ("Style"));
	_g_object_unref0 (_tmp18_);
	_tmp19_ = self->priv->_stack;
	_tmp20_ = tag_inspector_new (self);
	g_object_ref_sink (_tmp20_);
	_tmp21_ = _tmp20_;
	gtk_stack_add_titled (_tmp19_, (GtkWidget*) _tmp21_, "tag", _ ("Tags"));
	_g_object_unref0 (_tmp21_);
	_tmp22_ = self->priv->_stack;
	_tmp23_ = self->priv->_settings;
	_tmp24_ = sticker_inspector_new (self, _tmp23_);
	g_object_ref_sink (_tmp24_);
	_tmp25_ = _tmp24_;
	gtk_stack_add_titled (_tmp22_, (GtkWidget*) _tmp25_, "sticker", _ ("Stickers"));
	_g_object_unref0 (_tmp25_);
	_tmp26_ = self->priv->_stack;
	_tmp27_ = self->priv->_settings;
	_tmp28_ = map_inspector_new (self, _tmp27_);
	g_object_ref_sink (_tmp28_);
	_tmp29_ = _tmp28_;
	gtk_stack_add_titled (_tmp26_, (GtkWidget*) _tmp29_, "map", _ ("Map"));
	_g_object_unref0 (_tmp29_);
	_tmp30_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	key = _tmp30_;
	_tmp31_ = self->priv->_stack;
	_tmp32_ = _g_object_ref0 ((GtkEventController*) key);
	gtk_widget_add_controller ((GtkWidget*) _tmp31_, _tmp32_);
	g_signal_connect_object (key, "key-pressed", (GCallback) _main_window_stack_keypress_gtk_event_controller_key_key_pressed, self, 0);
	_tmp33_ = self->priv->_stack;
	g_signal_connect_object ((GObject*) _tmp33_, "notify", (GCallback) ___lambda253__g_object_notify, self, 0);
	main_window_set_action_for_command (self, KEY_COMMAND_SHOW_CURRENT_SIDEBAR, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_SHOW_STYLE_SIDEBAR, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_SHOW_TAG_SIDEBAR, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_SHOW_STICKER_SIDEBAR, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_SHOW_MAP_SIDEBAR, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_HEADER1, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_HEADER2, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_HEADER3, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_HEADER4, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_HEADER5, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_HEADER6, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_BOLD, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_ITALICS, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_STRIKE, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_HIGHLIGHT, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_CODE, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_SUPERSCRIPT, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_SUBSCRIPT, TRUE);
	main_window_set_action_for_command (self, KEY_COMMAND_EDIT_LINK, TRUE);
	main_window_setting_changed_ui_animations (self);
	_tmp34_ = mode_buttons_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp34_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp34_);
	_data33_->sidebar_switcher = _tmp34_;
	mode_buttons_add_stack_tab (_data33_->sidebar_switcher, _ ("Current"));
	mode_buttons_add_stack_tab (_data33_->sidebar_switcher, _ ("Style"));
	mode_buttons_add_stack_tab (_data33_->sidebar_switcher, _ ("Tags"));
	mode_buttons_add_stack_tab (_data33_->sidebar_switcher, _ ("Stickers"));
	mode_buttons_add_stack_tab (_data33_->sidebar_switcher, _ ("Map"));
	g_signal_connect_object (_data33_->sidebar_switcher, "changed", (GCallback) ___lambda254__mode_buttons_changed, self, 0);
	_tmp35_ = self->priv->_stack;
	g_signal_connect_data ((GObject*) _tmp35_, "notify::visible-child-name", (GCallback) ___lambda255__g_object_notify, block33_data_ref (_data33_), (GClosureNotify) block33_data_unref, 0);
	utils_set_switcher_tab_widths ((GtkWidget*) _data33_->sidebar_switcher);
	_tmp36_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 20);
	gtk_widget_set_halign ((GtkWidget*) _tmp36_, GTK_ALIGN_FILL);
	gtk_widget_set_valign ((GtkWidget*) _tmp36_, GTK_ALIGN_FILL);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp36_, 10);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp36_, 10);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp36_, 5);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp36_, 5);
	g_object_ref_sink (_tmp36_);
	box = _tmp36_;
	gtk_box_append (box, (GtkWidget*) _data33_->sidebar_switcher);
	_tmp37_ = self->priv->_stack;
	gtk_box_append (box, (GtkWidget*) _tmp37_);
	_tmp38_ = theme_editor_new (self);
	g_object_ref_sink (_tmp38_);
	_g_object_unref0 (self->priv->_themer);
	self->priv->_themer = _tmp38_;
	_tmp39_ = (GtkNotebook*) gtk_notebook_new ();
	gtk_notebook_set_show_tabs (_tmp39_, FALSE);
	g_object_ref_sink (_tmp39_);
	_g_object_unref0 (self->priv->_inspector_nb);
	self->priv->_inspector_nb = _tmp39_;
	_tmp40_ = self->priv->_inspector_nb;
	gtk_notebook_append_page (_tmp40_, (GtkWidget*) box, NULL);
	_tmp41_ = self->priv->_inspector_nb;
	_tmp42_ = self->priv->_themer;
	gtk_notebook_append_page (_tmp41_, (GtkWidget*) _tmp42_, NULL);
	_g_object_unref0 (box);
	_g_object_unref0 (key);
	block33_data_unref (_data33_);
	_data33_ = NULL;
}

static gboolean
main_window_stack_keypress (MainWindow* self,
                            guint keyval,
                            guint keycode,
                            GdkModifierType state)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (keyval == GDK_KEY_Escape) {
		main_window_hide_properties (self);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

static void
main_window_inspector_clicked (MainWindow* self)
{
	GtkNotebook* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_inspector_nb;
	if (gtk_widget_get_mapped ((GtkWidget*) _tmp0_)) {
		main_window_hide_properties (self);
	} else {
		main_window_show_properties (self, NULL, PROPERTY_GRAB_NONE);
	}
}

static Block34Data*
block34_data_ref (Block34Data* _data34_)
{
	g_atomic_int_inc (&_data34_->_ref_count_);
	return _data34_;
}

static void
block34_data_unref (void * _userdata_)
{
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
		MainWindow* self;
		self = _data34_->self;
		_g_object_unref0 (_data34_->dialog);
		_mind_map_unref0 (_data34_->map);
		_g_object_unref0 (self);
		g_slice_free (Block34Data, _data34_);
	}
}

static void
__lambda34_ (Block34Data* _data34_,
             gint id)
{
	MainWindow* self;
	self = _data34_->self;
	switch (id) {
		case GTK_RESPONSE_ACCEPT:
		{
			main_window_save_file (self, _data34_->map, TRUE);
			break;
		}
		case GTK_RESPONSE_CLOSE:
		{
			Document* _tmp0_;
			Document* _tmp1_;
			mind_map_close (_data34_->map);
			_tmp0_ = mind_map_get_doc (_data34_->map);
			_tmp1_ = _tmp0_;
			document_remove (_tmp1_);
			main_window_remove_tab (self, NULL);
			break;
		}
		default:
		break;
	}
	g_signal_emit_by_name ((GtkDialog*) _data34_->dialog, "close");
}

static void
___lambda34__gtk_dialog_response (GtkDialog* _sender,
                                  gint response_id,
                                  gpointer self)
{
	__lambda34_ (self, response_id);
}

void
main_window_show_save_warning (MainWindow* self,
                               MindMap* map)
{
	Block34Data* _data34_;
	MindMap* _tmp0_;
	GraniteMessageDialog* _tmp1_;
	GtkButton* dont = NULL;
	GtkButton* _tmp2_;
	GtkButton* cancel = NULL;
	GtkButton* _tmp3_;
	GtkButton* save = NULL;
	GtkButton* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	_data34_ = g_slice_new0 (Block34Data);
	_data34_->_ref_count_ = 1;
	_data34_->self = g_object_ref (self);
	_tmp0_ = _mind_map_ref0 (map);
	_mind_map_unref0 (_data34_->map);
	_data34_->map = _tmp0_;
	_tmp1_ = granite_message_dialog_new_with_image_from_icon_name (_ ("Save current unnamed document?"), _ ("Changes will be permanently lost if not saved."), "dialog-warning", GTK_BUTTONS_NONE);
	g_object_ref_sink (_tmp1_);
	_data34_->dialog = _tmp1_;
	_tmp2_ = (GtkButton*) gtk_button_new_with_label (_ ("Discard Changes"));
	g_object_ref_sink (_tmp2_);
	dont = _tmp2_;
	gtk_dialog_add_action_widget ((GtkDialog*) _data34_->dialog, (GtkWidget*) dont, (gint) GTK_RESPONSE_CLOSE);
	_tmp3_ = (GtkButton*) gtk_button_new_with_label (_ ("Cancel"));
	g_object_ref_sink (_tmp3_);
	cancel = _tmp3_;
	gtk_dialog_add_action_widget ((GtkDialog*) _data34_->dialog, (GtkWidget*) cancel, (gint) GTK_RESPONSE_CANCEL);
	_tmp4_ = (GtkButton*) gtk_button_new_with_label (_ ("Save"));
	g_object_ref_sink (_tmp4_);
	save = _tmp4_;
	gtk_widget_add_css_class ((GtkWidget*) save, GRANITE_STYLE_CLASS_SUGGESTED_ACTION);
	gtk_dialog_add_action_widget ((GtkDialog*) _data34_->dialog, (GtkWidget*) save, (gint) GTK_RESPONSE_ACCEPT);
	gtk_window_set_transient_for ((GtkWindow*) _data34_->dialog, (GtkWindow*) self);
	gtk_dialog_set_default_response ((GtkDialog*) _data34_->dialog, (gint) GTK_RESPONSE_ACCEPT);
	gtk_window_set_title ((GtkWindow*) _data34_->dialog, "");
	g_signal_connect_data ((GtkDialog*) _data34_->dialog, "response", (GCallback) ___lambda34__gtk_dialog_response, block34_data_ref (_data34_), (GClosureNotify) block34_data_unref, 0);
	gtk_widget_show ((GtkWidget*) _data34_->dialog);
	_g_object_unref0 (save);
	_g_object_unref0 (cancel);
	_g_object_unref0 (dont);
	block34_data_unref (_data34_);
	_data34_ = NULL;
}

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_)) {
		MainWindow* self;
		self = _data35_->self;
		_g_object_unref0 (_data35_->dialog);
		_g_object_unref0 (self);
		g_slice_free (Block35Data, _data35_);
	}
}

static void
__lambda11_ (Block35Data* _data35_,
             gint id)
{
	MainWindow* self;
	self = _data35_->self;
	_data35_->func (id == ((gint) GTK_RESPONSE_ACCEPT), _data35_->func_target);
	g_signal_emit_by_name ((GtkDialog*) _data35_->dialog, "close");
}

static void
___lambda11__gtk_dialog_response (GtkDialog* _sender,
                                  gint response_id,
                                  gpointer self)
{
	__lambda11_ (self, response_id);
}

void
main_window_ask_modified_overwrite (MainWindow* self,
                                    MindMap* map,
                                    MainWindowOverwriteFunc func,
                                    gpointer func_target)
{
	Block35Data* _data35_;
	Document* _tmp0_;
	Document* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GraniteMessageDialog* _tmp6_;
	GraniteMessageDialog* _tmp7_;
	GtkButton* dont = NULL;
	GtkButton* _tmp8_;
	GtkButton* save = NULL;
	GtkButton* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	_data35_ = g_slice_new0 (Block35Data);
	_data35_->_ref_count_ = 1;
	_data35_->self = g_object_ref (self);
	_data35_->func = func;
	_data35_->func_target = func_target;
	_tmp0_ = mind_map_get_doc (map);
	_tmp1_ = _tmp0_;
	_tmp2_ = document_get_filename (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf (_ ("The file %s was modified outside of the application."), _tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = granite_message_dialog_new_with_image_from_icon_name (_tmp5_, _ ("What do you want to do?"), "dialog-warning", GTK_BUTTONS_NONE);
	g_object_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_data35_->dialog = _tmp7_;
	_tmp8_ = (GtkButton*) gtk_button_new_with_label (_ ("Discard Changes and reload"));
	g_object_ref_sink (_tmp8_);
	dont = _tmp8_;
	gtk_dialog_add_action_widget ((GtkDialog*) _data35_->dialog, (GtkWidget*) dont, (gint) GTK_RESPONSE_CLOSE);
	_tmp9_ = (GtkButton*) gtk_button_new_with_label (_ ("Save local version and overwrite"));
	g_object_ref_sink (_tmp9_);
	save = _tmp9_;
	gtk_dialog_add_action_widget ((GtkDialog*) _data35_->dialog, (GtkWidget*) save, (gint) GTK_RESPONSE_ACCEPT);
	gtk_window_set_transient_for ((GtkWindow*) _data35_->dialog, (GtkWindow*) self);
	gtk_window_set_title ((GtkWindow*) _data35_->dialog, "Overwrite or reload?");
	g_signal_connect_data ((GtkDialog*) _data35_->dialog, "response", (GCallback) ___lambda11__gtk_dialog_response, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
	gtk_widget_show ((GtkWidget*) _data35_->dialog);
	_g_object_unref0 (save);
	_g_object_unref0 (dont);
	block35_data_unref (_data35_);
	_data35_ = NULL;
}

void
main_window_do_new_file (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	g_return_if_fail (self != NULL);
	if (main_window_find_unchanged_tab (self)) {
		return;
	}
	_tmp0_ = main_window_add_tab (self, NULL, TAB_ADD_REASON_NEW);
	map = _tmp0_;
	_tmp1_ = map;
	main_window_update_title (self, _tmp1_);
	_mind_map_unref0 (map);
}

void
main_window_do_open_file (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	main_window_do_open (self, FALSE);
}

void
main_window_do_open_directory (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	main_window_do_open (self, TRUE);
}

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_)) {
		MainWindow* self;
		self = _data36_->self;
		_g_object_unref0 (_data36_->dialog);
		_g_object_unref0 (self);
		g_slice_free (Block36Data, _data36_);
	}
}

static void
___lambda39_ (Block36Data* _data36_,
              GObject* obj,
              GAsyncResult* res)
{
	MainWindow* self;
	GError* _inner_error0_ = NULL;
	self = _data36_->self;
	g_return_if_fail (res != NULL);
	{
		GFile* file = NULL;
		GtkFileDialog* _tmp0_;
		GFile* _tmp1_;
		_tmp0_ = _data36_->dialog;
		_tmp1_ = gtk_file_dialog_select_folder_finish (_tmp0_, res, &_inner_error0_);
		file = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (file != NULL) {
			gchar* _tmp2_;
			gchar* _tmp3_;
			gchar* _tmp4_;
			gchar* _tmp5_;
			MindMap* _tmp6_;
			MindMap* _tmp7_;
			DrawArea* _tmp8_;
			DrawArea* _tmp9_;
			_tmp2_ = g_file_get_path (file);
			_tmp3_ = _tmp2_;
			main_window_open_file (self, _tmp3_, _data36_->dir);
			_g_free0 (_tmp3_);
			_tmp4_ = g_file_get_path (file);
			_tmp5_ = _tmp4_;
			utils_store_chooser_folder (_tmp5_, _data36_->dir);
			_g_free0 (_tmp5_);
			_tmp6_ = main_window_get_current_map (self, "do_open");
			_tmp7_ = _tmp6_;
			_tmp8_ = mind_map_get_canvas (_tmp7_);
			_tmp9_ = _tmp8_;
			gtk_widget_grab_focus ((GtkWidget*) _tmp9_);
			_mind_map_unref0 (_tmp7_);
		}
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
____lambda39__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda39_ (self, source_object, res);
	block36_data_unref (self);
}

static void
___lambda40_ (Block36Data* _data36_,
              GObject* obj,
              GAsyncResult* res)
{
	MainWindow* self;
	GError* _inner_error0_ = NULL;
	self = _data36_->self;
	g_return_if_fail (res != NULL);
	{
		GFile* file = NULL;
		GtkFileDialog* _tmp0_;
		GFile* _tmp1_;
		_tmp0_ = _data36_->dialog;
		_tmp1_ = gtk_file_dialog_open_finish (_tmp0_, res, &_inner_error0_);
		file = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (file != NULL) {
			gchar* _tmp2_;
			gchar* _tmp3_;
			gchar* _tmp4_;
			gchar* _tmp5_;
			MindMap* _tmp6_;
			MindMap* _tmp7_;
			DrawArea* _tmp8_;
			DrawArea* _tmp9_;
			_tmp2_ = g_file_get_path (file);
			_tmp3_ = _tmp2_;
			main_window_open_file (self, _tmp3_, _data36_->dir);
			_g_free0 (_tmp3_);
			_tmp4_ = g_file_get_path (file);
			_tmp5_ = _tmp4_;
			utils_store_chooser_folder (_tmp5_, _data36_->dir);
			_g_free0 (_tmp5_);
			_tmp6_ = main_window_get_current_map (self, "do_open");
			_tmp7_ = _tmp6_;
			_tmp8_ = mind_map_get_canvas (_tmp7_);
			_tmp9_ = _tmp8_;
			gtk_widget_grab_focus ((GtkWidget*) _tmp9_);
			_mind_map_unref0 (_tmp7_);
		}
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
____lambda40__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	___lambda40_ (self, source_object, res);
	block36_data_unref (self);
}

void
main_window_do_open (MainWindow* self,
                     gboolean dir)
{
	Block36Data* _data36_;
	const gchar* _tmp0_ = NULL;
	GtkFileDialog* _tmp1_;
	GListStore* filters = NULL;
	GListStore* _tmp2_;
	GtkFileDialog* _tmp49_;
	GListStore* _tmp50_;
	g_return_if_fail (self != NULL);
	_data36_ = g_slice_new0 (Block36Data);
	_data36_->_ref_count_ = 1;
	_data36_->self = g_object_ref (self);
	_data36_->dir = dir;
	if (_data36_->dir) {
		_tmp0_ = _ ("Open Directory");
	} else {
		_tmp0_ = _ ("Open File");
	}
	_tmp1_ = utils_make_file_chooser (_tmp0_, _ ("Open"));
	_data36_->dialog = _tmp1_;
	_tmp2_ = g_list_store_new (gtk_file_filter_get_type ());
	filters = _tmp2_;
	if (!_data36_->dir) {
		GtkFileFilter* filter = NULL;
		GtkFileFilter* _tmp3_;
		GtkFileFilter* _tmp4_;
		GtkFileFilter* _tmp5_;
		GListStore* _tmp6_;
		GtkFileFilter* _tmp7_;
		_tmp3_ = gtk_file_filter_new ();
		filter = _tmp3_;
		_tmp4_ = filter;
		gtk_file_filter_set_name (_tmp4_, "Minder");
		_tmp5_ = filter;
		gtk_file_filter_add_pattern (_tmp5_, "*.minder");
		_tmp6_ = filters;
		_tmp7_ = filter;
		g_list_store_append (_tmp6_, (GObject*) _tmp7_);
		_g_object_unref0 (filter);
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp8_ = FALSE;
			_tmp8_ = TRUE;
			while (TRUE) {
				Exports* _tmp10_;
				Exports* _tmp11_;
				gboolean _tmp12_ = FALSE;
				Exports* _tmp13_;
				Exports* _tmp14_;
				Export* _tmp15_;
				Export* _tmp16_;
				gboolean _tmp17_;
				gboolean _tmp18_;
				gboolean _tmp19_;
				if (!_tmp8_) {
					gint _tmp9_;
					_tmp9_ = i;
					i = _tmp9_ + 1;
				}
				_tmp8_ = FALSE;
				_tmp10_ = main_window_get_exports (self);
				_tmp11_ = _tmp10_;
				if (!(i < exports_length (_tmp11_))) {
					break;
				}
				_tmp13_ = main_window_get_exports (self);
				_tmp14_ = _tmp13_;
				_tmp15_ = exports_index (_tmp14_, i);
				_tmp16_ = _tmp15_;
				_tmp17_ = export_get_importable (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = _tmp18_;
				_export_unref0 (_tmp16_);
				if (_tmp19_) {
					Exports* _tmp20_;
					Exports* _tmp21_;
					Export* _tmp22_;
					Export* _tmp23_;
					gboolean _tmp24_;
					gboolean _tmp25_;
					_tmp20_ = main_window_get_exports (self);
					_tmp21_ = _tmp20_;
					_tmp22_ = exports_index (_tmp21_, i);
					_tmp23_ = _tmp22_;
					_tmp24_ = export_get_dir (_tmp23_);
					_tmp25_ = _tmp24_;
					_tmp12_ = _tmp25_ == _data36_->dir;
					_export_unref0 (_tmp23_);
				} else {
					_tmp12_ = FALSE;
				}
				if (_tmp12_) {
					GtkFileFilter* filter = NULL;
					GtkFileFilter* _tmp26_;
					GtkFileFilter* _tmp27_;
					Exports* _tmp28_;
					Exports* _tmp29_;
					Export* _tmp30_;
					Export* _tmp31_;
					const gchar* _tmp32_;
					const gchar* _tmp33_;
					Exports* _tmp34_;
					Exports* _tmp35_;
					Export* _tmp36_;
					Export* _tmp37_;
					gchar** _tmp38_;
					gint _tmp38__length1;
					gint _tmp39_ = 0;
					gchar** _tmp40_;
					gint _tmp40__length1;
					gchar** _tmp41_;
					gint _tmp41__length1;
					GListStore* _tmp47_;
					GtkFileFilter* _tmp48_;
					_tmp26_ = gtk_file_filter_new ();
					filter = _tmp26_;
					_tmp27_ = filter;
					_tmp28_ = main_window_get_exports (self);
					_tmp29_ = _tmp28_;
					_tmp30_ = exports_index (_tmp29_, i);
					_tmp31_ = _tmp30_;
					_tmp32_ = export_get_label (_tmp31_);
					_tmp33_ = _tmp32_;
					gtk_file_filter_set_name (_tmp27_, _tmp33_);
					_export_unref0 (_tmp31_);
					_tmp34_ = main_window_get_exports (self);
					_tmp35_ = _tmp34_;
					_tmp36_ = exports_index (_tmp35_, i);
					_tmp37_ = _tmp36_;
					_tmp38_ = export_get_extensions (_tmp37_, &_tmp39_);
					_tmp38__length1 = _tmp39_;
					_tmp40_ = _tmp38_;
					_tmp40__length1 = _tmp38__length1;
					_tmp41_ = _tmp40_;
					_tmp41__length1 = _tmp40__length1;
					_export_unref0 (_tmp37_);
					{
						gchar** extension_collection = NULL;
						gint extension_collection_length1 = 0;
						gint _extension_collection_size_ = 0;
						gint extension_it = 0;
						extension_collection = _tmp41_;
						extension_collection_length1 = _tmp41__length1;
						for (extension_it = 0; extension_it < extension_collection_length1; extension_it = extension_it + 1) {
							gchar* _tmp42_;
							gchar* extension = NULL;
							_tmp42_ = g_strdup (extension_collection[extension_it]);
							extension = _tmp42_;
							{
								GtkFileFilter* _tmp43_;
								const gchar* _tmp44_;
								gchar* _tmp45_;
								gchar* _tmp46_;
								_tmp43_ = filter;
								_tmp44_ = extension;
								_tmp45_ = g_strconcat ("*", _tmp44_, NULL);
								_tmp46_ = _tmp45_;
								gtk_file_filter_add_pattern (_tmp43_, _tmp46_);
								_g_free0 (_tmp46_);
								_g_free0 (extension);
							}
						}
					}
					_tmp47_ = filters;
					_tmp48_ = filter;
					g_list_store_append (_tmp47_, (GObject*) _tmp48_);
					_g_object_unref0 (filter);
				}
			}
		}
	}
	_tmp49_ = _data36_->dialog;
	_tmp50_ = filters;
	gtk_file_dialog_set_filters (_tmp49_, (GListModel*) _tmp50_);
	if (_data36_->dir) {
		GtkFileDialog* _tmp51_;
		_tmp51_ = _data36_->dialog;
		gtk_file_dialog_select_folder (_tmp51_, (GtkWindow*) self, NULL, ____lambda39__gasync_ready_callback, block36_data_ref (_data36_));
	} else {
		GtkFileDialog* _tmp52_;
		_tmp52_ = _data36_->dialog;
		gtk_file_dialog_open (_tmp52_, (GtkWindow*) self, NULL, ____lambda40__gasync_ready_callback, block36_data_ref (_data36_));
	}
	_g_object_unref0 (filters);
	block36_data_unref (_data36_);
	_data36_ = NULL;
}

static void
___lambda33_ (MainWindow* self,
              gboolean valid,
              const gchar* msg)
{
	g_return_if_fail (msg != NULL);
	if (valid) {
		GtkNotebook* _tmp0_;
		gint _tmp1_;
		gint _tmp2_;
		_tmp0_ = self->priv->_nb;
		g_object_get (_tmp0_, "page", &_tmp1_, NULL);
		_tmp2_ = _tmp1_;
		main_window_save_tab_state (self, (guint) _tmp2_);
	} else {
		main_window_close_current_tab (self);
	}
}

static void
____lambda33__after_load_func (gboolean loaded,
                               const gchar* msg,
                               gpointer self)
{
	___lambda33_ ((MainWindow*) self, loaded, msg);
}

gboolean
main_window_open_file (MainWindow* self,
                       const gchar* fname,
                       gboolean dir)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (fname != NULL, FALSE);
	if (dir) {
		_tmp1_ = !g_file_test (fname, G_FILE_TEST_IS_DIR);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp2_ = FALSE;
		if (!dir) {
			_tmp2_ = !g_file_test (fname, G_FILE_TEST_IS_REGULAR);
		} else {
			_tmp2_ = FALSE;
		}
		_tmp0_ = _tmp2_;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	main_window_close_unchanged_tabs (self);
	if (g_str_has_suffix (fname, ".minder")) {
		MindMap* map = NULL;
		MindMap* _tmp3_;
		MindMap* _tmp4_;
		MindMap* _tmp5_;
		Document* _tmp6_;
		Document* _tmp7_;
		_tmp3_ = main_window_add_tab_conditionally (self, fname, TAB_ADD_REASON_OPEN);
		map = _tmp3_;
		_tmp4_ = map;
		main_window_update_title (self, _tmp4_);
		_tmp5_ = map;
		_tmp6_ = mind_map_get_doc (_tmp5_);
		_tmp7_ = _tmp6_;
		document_load (_tmp7_, UPGRADE_ACTION_NUM, ____lambda33__after_load_func, self);
		result = TRUE;
		_mind_map_unref0 (map);
		return result;
	} else {
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp8_ = FALSE;
				_tmp8_ = TRUE;
				while (TRUE) {
					Exports* _tmp10_;
					Exports* _tmp11_;
					gboolean _tmp12_ = FALSE;
					Exports* _tmp13_;
					Exports* _tmp14_;
					Export* _tmp15_;
					Export* _tmp16_;
					gboolean _tmp17_;
					gboolean _tmp18_;
					gboolean _tmp19_;
					if (!_tmp8_) {
						gint _tmp9_;
						_tmp9_ = i;
						i = _tmp9_ + 1;
					}
					_tmp8_ = FALSE;
					_tmp10_ = main_window_get_exports (self);
					_tmp11_ = _tmp10_;
					if (!(i < exports_length (_tmp11_))) {
						break;
					}
					_tmp13_ = main_window_get_exports (self);
					_tmp14_ = _tmp13_;
					_tmp15_ = exports_index (_tmp14_, i);
					_tmp16_ = _tmp15_;
					_tmp17_ = export_get_importable (_tmp16_);
					_tmp18_ = _tmp17_;
					_tmp19_ = _tmp18_;
					_export_unref0 (_tmp16_);
					if (_tmp19_) {
						Exports* _tmp20_;
						Exports* _tmp21_;
						Export* _tmp22_;
						Export* _tmp23_;
						gboolean _tmp24_;
						gboolean _tmp25_;
						_tmp20_ = main_window_get_exports (self);
						_tmp21_ = _tmp20_;
						_tmp22_ = exports_index (_tmp21_, i);
						_tmp23_ = _tmp22_;
						_tmp24_ = export_get_dir (_tmp23_);
						_tmp25_ = _tmp24_;
						_tmp12_ = _tmp25_ == dir;
						_export_unref0 (_tmp23_);
					} else {
						_tmp12_ = FALSE;
					}
					if (_tmp12_) {
						gchar* new_fname = NULL;
						Exports* _tmp26_;
						Exports* _tmp27_;
						Export* _tmp28_;
						Export* _tmp29_;
						gchar* _tmp30_ = NULL;
						gboolean _tmp31_;
						gboolean _tmp32_;
						_tmp26_ = main_window_get_exports (self);
						_tmp27_ = _tmp26_;
						_tmp28_ = exports_index (_tmp27_, i);
						_tmp29_ = _tmp28_;
						_tmp31_ = export_filename_matches (_tmp29_, fname, &_tmp30_);
						_g_free0 (new_fname);
						new_fname = _tmp30_;
						_tmp32_ = _tmp31_;
						_export_unref0 (_tmp29_);
						if (_tmp32_) {
							MindMap* map = NULL;
							MindMap* _tmp33_;
							MindMap* _tmp34_;
							Exports* _tmp35_;
							Exports* _tmp36_;
							Export* _tmp37_;
							Export* _tmp38_;
							MindMap* _tmp39_;
							gboolean _tmp40_;
							_tmp33_ = main_window_add_tab_conditionally (self, NULL, TAB_ADD_REASON_IMPORT);
							map = _tmp33_;
							_tmp34_ = map;
							main_window_update_title (self, _tmp34_);
							_tmp35_ = main_window_get_exports (self);
							_tmp36_ = _tmp35_;
							_tmp37_ = exports_index (_tmp36_, i);
							_tmp38_ = _tmp37_;
							_tmp39_ = map;
							_tmp40_ = export_import (_tmp38_, fname, _tmp39_);
							_export_unref0 (_tmp38_);
							if (_tmp40_) {
								GtkNotebook* _tmp41_;
								gint _tmp42_;
								gint _tmp43_;
								_tmp41_ = self->priv->_nb;
								g_object_get (_tmp41_, "page", &_tmp42_, NULL);
								_tmp43_ = _tmp42_;
								main_window_save_tab_state (self, (guint) _tmp43_);
								result = TRUE;
								_mind_map_unref0 (map);
								_g_free0 (new_fname);
								return result;
							}
							main_window_close_current_tab (self);
							_mind_map_unref0 (map);
						}
						_g_free0 (new_fname);
					}
				}
			}
		}
	}
	result = FALSE;
	return result;
}

gboolean
main_window_import_file (MainWindow* self,
                         const gchar* fname,
                         const gchar* export_name,
                         gchar** new_fname)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (fname != NULL, FALSE);
	g_return_val_if_fail (export_name != NULL, FALSE);
	g_return_val_if_fail (*new_fname != NULL, FALSE);
	main_window_close_unchanged_tabs (self);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				Exports* _tmp2_;
				Exports* _tmp3_;
				gboolean _tmp4_ = FALSE;
				Exports* _tmp5_;
				Exports* _tmp6_;
				Export* _tmp7_;
				Export* _tmp8_;
				gboolean _tmp9_;
				gboolean _tmp10_;
				gboolean _tmp11_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = main_window_get_exports (self);
				_tmp3_ = _tmp2_;
				if (!(i < exports_length (_tmp3_))) {
					break;
				}
				_tmp5_ = main_window_get_exports (self);
				_tmp6_ = _tmp5_;
				_tmp7_ = exports_index (_tmp6_, i);
				_tmp8_ = _tmp7_;
				_tmp9_ = export_get_importable (_tmp8_);
				_tmp10_ = _tmp9_;
				_tmp11_ = _tmp10_;
				_export_unref0 (_tmp8_);
				if (_tmp11_) {
					Exports* _tmp12_;
					Exports* _tmp13_;
					Export* _tmp14_;
					Export* _tmp15_;
					const gchar* _tmp16_;
					const gchar* _tmp17_;
					_tmp12_ = main_window_get_exports (self);
					_tmp13_ = _tmp12_;
					_tmp14_ = exports_index (_tmp13_, i);
					_tmp15_ = _tmp14_;
					_tmp16_ = export_get_name (_tmp15_);
					_tmp17_ = _tmp16_;
					_tmp4_ = g_strcmp0 (_tmp17_, export_name) == 0;
					_export_unref0 (_tmp15_);
				} else {
					_tmp4_ = FALSE;
				}
				if (_tmp4_) {
					MindMap* map = NULL;
					MindMap* _tmp18_;
					MindMap* _tmp19_;
					Exports* _tmp20_;
					Exports* _tmp21_;
					Export* _tmp22_;
					Export* _tmp23_;
					MindMap* _tmp24_;
					gboolean _tmp25_;
					_tmp18_ = main_window_add_tab_conditionally (self, NULL, TAB_ADD_REASON_IMPORT);
					map = _tmp18_;
					_tmp19_ = map;
					main_window_update_title (self, _tmp19_);
					_tmp20_ = main_window_get_exports (self);
					_tmp21_ = _tmp20_;
					_tmp22_ = exports_index (_tmp21_, i);
					_tmp23_ = _tmp22_;
					_tmp24_ = map;
					_tmp25_ = export_import (_tmp23_, fname, _tmp24_);
					_export_unref0 (_tmp23_);
					if (_tmp25_) {
						result = TRUE;
						_mind_map_unref0 (map);
						return result;
					}
					main_window_close_current_tab (self);
					result = FALSE;
					_mind_map_unref0 (map);
					return result;
				}
			}
		}
	}
	result = FALSE;
	return result;
}

void
main_window_do_undo (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	UndoBuffer* _tmp1_;
	UndoBuffer* _tmp2_;
	DrawArea* _tmp3_;
	DrawArea* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_current_map (self, "do_undo");
	map = _tmp0_;
	_tmp1_ = mind_map_current_undo_buffer (map);
	_tmp2_ = _tmp1_;
	undo_buffer_undo (_tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = mind_map_get_canvas (map);
	_tmp4_ = _tmp3_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp4_);
	_mind_map_unref0 (map);
}

void
main_window_do_redo (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	UndoBuffer* _tmp1_;
	UndoBuffer* _tmp2_;
	DrawArea* _tmp3_;
	DrawArea* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_current_map (self, "do_redo");
	map = _tmp0_;
	_tmp1_ = mind_map_current_undo_buffer (map);
	_tmp2_ = _tmp1_;
	undo_buffer_redo (_tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = mind_map_get_canvas (map);
	_tmp4_ = _tmp3_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp4_);
	_mind_map_unref0 (map);
}

static void
main_window_on_dark_mode_changed (MainWindow* self,
                                  gboolean dark_mode)
{
	GtkSettings* gtk_settings = NULL;
	GtkSettings* _tmp0_;
	GtkSettings* _tmp1_;
	GtkSettings* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_settings_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	gtk_settings = _tmp1_;
	_tmp2_ = gtk_settings;
	if (_tmp2_ != NULL) {
		GtkSettings* _tmp3_;
		const gchar* _tmp4_ = NULL;
		GtkHeaderBar* _tmp5_;
		GtkToggleButton* _tmp6_;
		GtkStack* _tmp10_;
		GtkWidget* _tmp11_;
		GtkStack* _tmp12_;
		GtkWidget* _tmp13_;
		GtkStack* _tmp14_;
		GtkWidget* _tmp15_;
		GtkStack* _tmp16_;
		GtkWidget* _tmp17_;
		_tmp3_ = gtk_settings;
		g_object_set (_tmp3_, "gtk-application-prefer-dark-theme", dark_mode, NULL);
		_tmp5_ = self->priv->_header;
		if (utils_use_dark_mode ((GtkWidget*) _tmp5_)) {
			_tmp4_ = "minder-braindump-dark-symbolic";
		} else {
			_tmp4_ = "minder-braindump-light-symbolic";
		}
		_tmp6_ = self->priv->_brain_btn;
		gtk_button_set_icon_name ((GtkButton*) _tmp6_, _tmp4_);
		if (!self->priv->on_elementary) {
			const gchar* _tmp7_ = NULL;
			GtkHeaderBar* _tmp8_;
			GtkToggleButton* _tmp9_;
			_tmp8_ = self->priv->_header;
			if (utils_use_dark_mode ((GtkWidget*) _tmp8_)) {
				_tmp7_ = "minder-sidebar-dark-symbolic";
			} else {
				_tmp7_ = "minder-sidebar-light-symbolic";
			}
			_tmp9_ = self->priv->_prop_btn;
			gtk_button_set_icon_name ((GtkButton*) _tmp9_, _tmp7_);
		}
		_tmp10_ = self->priv->_stack;
		_tmp11_ = gtk_stack_get_child_by_name (_tmp10_, "current");
		g_signal_emit_by_name (IS_CURRENT_INSPECTOR (_tmp11_) ? ((CurrentInspector*) _tmp11_) : NULL, "update-icons");
		_tmp12_ = self->priv->_stack;
		_tmp13_ = gtk_stack_get_child_by_name (_tmp12_, "style");
		g_signal_emit_by_name (IS_STYLE_INSPECTOR (_tmp13_) ? ((StyleInspector*) _tmp13_) : NULL, "update-icons");
		_tmp14_ = self->priv->_stack;
		_tmp15_ = gtk_stack_get_child_by_name (_tmp14_, "tag");
		g_signal_emit_by_name (IS_TAG_INSPECTOR (_tmp15_) ? ((TagInspector*) _tmp15_) : NULL, "update-icons");
		_tmp16_ = self->priv->_stack;
		_tmp17_ = gtk_stack_get_child_by_name (_tmp16_, "map");
		g_signal_emit_by_name (IS_MAP_INSPECTOR (_tmp17_) ? ((MapInspector*) _tmp17_) : NULL, "update-icons");
	}
	_g_object_unref0 (gtk_settings);
}

static void
main_window_on_editable_changed (MainWindow* self,
                                 MindMap* map)
{
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	MapModel* _tmp3_;
	MapModel* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	GtkStack* _tmp7_;
	GtkWidget* _tmp8_;
	GtkStack* _tmp9_;
	GtkWidget* _tmp10_;
	GtkStack* _tmp11_;
	GtkWidget* _tmp12_;
	GtkStack* _tmp13_;
	GtkWidget* _tmp14_;
	gchar* label = NULL;
	Document* _tmp15_;
	Document* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	_tmp0_ = self->priv->_brain_btn;
	_tmp1_ = mind_map_get_editable (map);
	_tmp2_ = _tmp1_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _tmp2_);
	_tmp3_ = mind_map_get_model (map);
	_tmp4_ = _tmp3_;
	_tmp5_ = map_model_get_braindump_shown (_tmp4_);
	_tmp6_ = _tmp5_;
	main_window_set_braindump_ui (self, map, _tmp6_);
	_tmp7_ = self->priv->_stack;
	_tmp8_ = gtk_stack_get_child_by_name (_tmp7_, "current");
	g_signal_emit_by_name (IS_CURRENT_INSPECTOR (_tmp8_) ? ((CurrentInspector*) _tmp8_) : NULL, "editable-changed");
	_tmp9_ = self->priv->_stack;
	_tmp10_ = gtk_stack_get_child_by_name (_tmp9_, "style");
	g_signal_emit_by_name (IS_STYLE_INSPECTOR (_tmp10_) ? ((StyleInspector*) _tmp10_) : NULL, "editable-changed");
	_tmp11_ = self->priv->_stack;
	_tmp12_ = gtk_stack_get_child_by_name (_tmp11_, "tag");
	g_signal_emit_by_name (IS_TAG_INSPECTOR (_tmp12_) ? ((TagInspector*) _tmp12_) : NULL, "editable-changed");
	_tmp13_ = self->priv->_stack;
	_tmp14_ = gtk_stack_get_child_by_name (_tmp13_, "map");
	g_signal_emit_by_name (IS_MAP_INSPECTOR (_tmp14_) ? ((MapInspector*) _tmp14_) : NULL, "editable-changed");
	_tmp15_ = mind_map_get_doc (map);
	_tmp16_ = _tmp15_;
	_tmp17_ = document_get_label (_tmp16_);
	_tmp18_ = _tmp17_;
	label = _tmp18_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp19_ = FALSE;
			_tmp19_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp21_;
				MindMap* _tmp22_;
				MindMap* _tmp23_;
				gboolean _tmp24_;
				if (!_tmp19_) {
					gint _tmp20_;
					_tmp20_ = i;
					i = _tmp20_ + 1;
				}
				_tmp19_ = FALSE;
				_tmp21_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp21_))) {
					break;
				}
				_tmp22_ = main_window_get_map (self, i);
				_tmp23_ = _tmp22_;
				_tmp24_ = _tmp23_ == map;
				_mind_map_unref0 (_tmp23_);
				if (_tmp24_) {
					gboolean _tmp25_;
					gboolean _tmp26_;
					const gchar* _tmp27_;
					Document* _tmp28_;
					Document* _tmp29_;
					const gchar* _tmp30_;
					const gchar* _tmp31_;
					_tmp25_ = mind_map_get_editable (map);
					_tmp26_ = _tmp25_;
					_tmp27_ = label;
					_tmp28_ = mind_map_get_doc (map);
					_tmp29_ = _tmp28_;
					_tmp30_ = document_get_filename (_tmp29_);
					_tmp31_ = _tmp30_;
					main_window_set_tab_label_info (self, i, _tmp26_, _tmp27_, _tmp31_);
					break;
				}
			}
		}
	}
	main_window_update_title (self, map);
	_g_free0 (label);
}

static void
main_window_on_tag_highlight_changed (MainWindow* self,
                                      MindMap* map)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	main_window_update_title (self, map);
}

void
main_window_do_buffer_changed (MainWindow* self,
                               UndoBuffer* buf)
{
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (buf != NULL);
	_tmp0_ = self->priv->_undo_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, undo_buffer_undoable (buf));
	_tmp1_ = self->priv->_undo_btn;
	_tmp2_ = undo_buffer_undo_tooltip (buf);
	_tmp3_ = _tmp2_;
	_tmp4_ = main_window_get_accelerator (self, KEY_COMMAND_UNDO_ACTION);
	_tmp5_ = _tmp4_;
	_tmp6_ = utils_tooltip_with_accel (_tmp3_, _tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp1_, _tmp7_);
	_g_free0 (_tmp7_);
	_g_free0 (_tmp5_);
	_g_free0 (_tmp3_);
	_tmp8_ = self->priv->_redo_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, undo_buffer_redoable (buf));
	_tmp9_ = self->priv->_redo_btn;
	_tmp10_ = undo_buffer_redo_tooltip (buf);
	_tmp11_ = _tmp10_;
	_tmp12_ = main_window_get_accelerator (self, KEY_COMMAND_REDO_ACTION);
	_tmp13_ = _tmp12_;
	_tmp14_ = utils_tooltip_with_accel (_tmp11_, _tmp13_);
	_tmp15_ = _tmp14_;
	gtk_widget_set_tooltip_markup ((GtkWidget*) _tmp9_, _tmp15_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp11_);
}

static gchar*
string_delimit (const gchar* self,
                const gchar* delimiters,
                gchar new_delimiter)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (delimiters != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strdelimit (_result_, delimiters, new_delimiter);
	result = _result_;
	return result;
}

static gchar*
main_window_convert_name_to_filename (MainWindow* self,
                                      const gchar* name)
{
	gchar* first_line = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* base_name = NULL;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp1_ = _tmp0_ = g_strsplit (name, "\n", 0);
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _vala_array_length (_tmp0_);
	_tmp3_ = _tmp2_[0];
	_tmp4_ = g_strdup (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	first_line = _tmp5_;
	_tmp6_ = first_line;
	_tmp7_ = string_delimit (_tmp6_, "~!@#$%^&*+`={}[]|\\/,.<>?;:\"' \t", '-');
	base_name = _tmp7_;
	{
		GRegex* re1 = NULL;
		GRegex* _tmp8_;
		GRegex* re2 = NULL;
		GRegex* _tmp9_;
		gchar* _tmp10_ = NULL;
		GRegex* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_ = NULL;
		GRegex* _tmp19_;
		const gchar* _tmp20_;
		const gchar* _tmp21_;
		gint _tmp22_;
		gint _tmp23_;
		gchar* _tmp24_;
		gchar* _tmp25_;
		_tmp8_ = g_regex_new ("-+", 0, 0, &_inner_error0_);
		re1 = _tmp8_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			_g_free0 (base_name);
			_g_free0 (first_line);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp9_ = g_regex_new ("^-|-$", 0, 0, &_inner_error0_);
		re2 = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (re1);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			_g_free0 (base_name);
			_g_free0 (first_line);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp11_ = re1;
		_tmp12_ = base_name;
		_tmp13_ = base_name;
		_tmp14_ = strlen (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = g_regex_replace (_tmp11_, _tmp12_, (gssize) _tmp15_, 0, "-", 0, &_inner_error0_);
		_tmp10_ = _tmp16_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (re2);
			_g_regex_unref0 (re1);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			_g_free0 (base_name);
			_g_free0 (first_line);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp17_ = _tmp10_;
		_tmp10_ = NULL;
		_g_free0 (base_name);
		base_name = _tmp17_;
		_tmp19_ = re2;
		_tmp20_ = base_name;
		_tmp21_ = base_name;
		_tmp22_ = strlen (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = g_regex_replace (_tmp19_, _tmp20_, (gssize) _tmp23_, 0, "", 0, &_inner_error0_);
		_tmp18_ = _tmp24_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (_tmp10_);
			_g_regex_unref0 (re2);
			_g_regex_unref0 (re1);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			_g_free0 (base_name);
			_g_free0 (first_line);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp25_ = _tmp18_;
		_tmp18_ = NULL;
		_g_free0 (base_name);
		base_name = _tmp25_;
		_g_free0 (_tmp18_);
		_g_free0 (_tmp10_);
		_g_regex_unref0 (re2);
		_g_regex_unref0 (re1);
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (base_name);
		_g_free0 (first_line);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	result = base_name;
	_g_free0 (first_line);
	return result;
}

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_)) {
		MainWindow* self;
		self = _data37_->self;
		_g_object_unref0 (_data37_->dialog);
		_mind_map_unref0 (_data37_->map);
		_g_object_unref0 (self);
		g_slice_free (Block37Data, _data37_);
	}
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
__lambda35_ (Block37Data* _data37_,
             GObject* obj,
             GAsyncResult* res)
{
	MainWindow* self;
	GError* _inner_error0_ = NULL;
	self = _data37_->self;
	g_return_if_fail (res != NULL);
	{
		GFile* file = NULL;
		GtkFileDialog* _tmp0_;
		GFile* _tmp1_;
		_tmp0_ = _data37_->dialog;
		_tmp1_ = gtk_file_dialog_save_finish (_tmp0_, res, &_inner_error0_);
		file = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (file != NULL) {
			gchar* fname = NULL;
			gchar* _tmp2_;
			const gchar* _tmp3_;
			Document* _tmp6_;
			Document* _tmp7_;
			const gchar* _tmp8_;
			Document* _tmp9_;
			Document* _tmp10_;
			_tmp2_ = g_file_get_path (file);
			fname = _tmp2_;
			_tmp3_ = fname;
			if (!g_str_has_suffix (_tmp3_, ".minder")) {
				const gchar* _tmp4_;
				gchar* _tmp5_;
				_tmp4_ = fname;
				_tmp5_ = g_strconcat (_tmp4_, ".minder", NULL);
				_g_free0 (fname);
				fname = _tmp5_;
			}
			_tmp6_ = mind_map_get_doc (_data37_->map);
			_tmp7_ = _tmp6_;
			_tmp8_ = fname;
			document_set_filename (_tmp7_, _tmp8_);
			_tmp9_ = mind_map_get_doc (_data37_->map);
			_tmp10_ = _tmp9_;
			document_save (_tmp10_);
			if (_data37_->remove_after_save) {
				mind_map_close (_data37_->map);
				main_window_remove_tab (self, NULL);
			} else {
				GtkNotebook* _tmp11_;
				gint _tmp12_;
				gint _tmp13_;
				gboolean _tmp14_;
				gboolean _tmp15_;
				Document* _tmp16_;
				Document* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
				gchar* _tmp20_;
				const gchar* _tmp21_;
				GtkNotebook* _tmp22_;
				gint _tmp23_;
				gint _tmp24_;
				const gchar* _tmp25_;
				DrawArea* _tmp26_;
				DrawArea* _tmp27_;
				_tmp11_ = self->priv->_nb;
				g_object_get (_tmp11_, "page", &_tmp12_, NULL);
				_tmp13_ = _tmp12_;
				_tmp14_ = mind_map_get_editable (_data37_->map);
				_tmp15_ = _tmp14_;
				_tmp16_ = mind_map_get_doc (_data37_->map);
				_tmp17_ = _tmp16_;
				_tmp18_ = document_get_label (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = _tmp19_;
				_tmp21_ = fname;
				main_window_set_tab_label_info (self, _tmp13_, _tmp15_, _tmp20_, _tmp21_);
				_g_free0 (_tmp20_);
				main_window_update_title (self, _data37_->map);
				_tmp22_ = self->priv->_nb;
				g_object_get (_tmp22_, "page", &_tmp23_, NULL);
				_tmp24_ = _tmp23_;
				main_window_save_tab_state (self, (guint) _tmp24_);
				_tmp25_ = fname;
				utils_store_chooser_folder (_tmp25_, FALSE);
				_tmp26_ = mind_map_get_canvas (_data37_->map);
				_tmp27_ = _tmp26_;
				gtk_widget_grab_focus ((GtkWidget*) _tmp27_);
			}
			_g_free0 (fname);
		}
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda35__gasync_ready_callback (GObject* source_object,
                                    GAsyncResult* res,
                                    gpointer self)
{
	__lambda35_ (self, source_object, res);
	block37_data_unref (self);
}

void
main_window_save_file (MainWindow* self,
                       MindMap* map,
                       gboolean remove_after_save)
{
	Block37Data* _data37_;
	MindMap* _tmp0_;
	GtkFileDialog* _tmp1_;
	GListStore* filters = NULL;
	GListStore* _tmp2_;
	GtkFileFilter* filter = NULL;
	GtkFileFilter* _tmp3_;
	GtkFileFilter* _tmp4_;
	GtkFileFilter* _tmp5_;
	GListStore* _tmp6_;
	GtkFileFilter* _tmp7_;
	Document* _tmp8_;
	Document* _tmp9_;
	GtkFileDialog* _tmp42_;
	GListStore* _tmp43_;
	GtkFileDialog* _tmp44_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	_data37_ = g_slice_new0 (Block37Data);
	_data37_->_ref_count_ = 1;
	_data37_->self = g_object_ref (self);
	_tmp0_ = _mind_map_ref0 (map);
	_mind_map_unref0 (_data37_->map);
	_data37_->map = _tmp0_;
	_data37_->remove_after_save = remove_after_save;
	_tmp1_ = utils_make_file_chooser (_ ("Save File"), _ ("Save"));
	_data37_->dialog = _tmp1_;
	_tmp2_ = g_list_store_new (gtk_file_filter_get_type ());
	filters = _tmp2_;
	_tmp3_ = gtk_file_filter_new ();
	filter = _tmp3_;
	_tmp4_ = filter;
	gtk_file_filter_set_name (_tmp4_, _ ("Minder"));
	_tmp5_ = filter;
	gtk_file_filter_add_pattern (_tmp5_, "*.minder");
	_tmp6_ = filters;
	_tmp7_ = filter;
	g_list_store_append (_tmp6_, (GObject*) _tmp7_);
	_tmp8_ = mind_map_get_doc (_data37_->map);
	_tmp9_ = _tmp8_;
	if (document_is_saved (_tmp9_)) {
		GFile* fname = NULL;
		Document* _tmp10_;
		Document* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		GFile* _tmp14_;
		GtkFileDialog* _tmp15_;
		GFile* _tmp16_;
		_tmp10_ = mind_map_get_doc (_data37_->map);
		_tmp11_ = _tmp10_;
		_tmp12_ = document_get_filename (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = g_file_new_for_path (_tmp13_);
		fname = _tmp14_;
		_tmp15_ = _data37_->dialog;
		_tmp16_ = fname;
		gtk_file_dialog_set_initial_file (_tmp15_, _tmp16_);
		_g_object_unref0 (fname);
	} else {
		GtkFileDialog* _tmp17_;
		Document* _tmp18_;
		Document* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		GArray* _tmp23_;
		GArray* _tmp24_;
		gboolean _tmp25_;
		_tmp17_ = _data37_->dialog;
		_tmp18_ = mind_map_get_doc (_data37_->map);
		_tmp19_ = _tmp18_;
		_tmp20_ = document_get_label (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = _tmp21_;
		gtk_file_dialog_set_initial_name (_tmp17_, _tmp22_);
		_g_free0 (_tmp22_);
		_tmp23_ = mind_map_get_nodes (_data37_->map);
		_tmp24_ = _tmp23_;
		_tmp25_ = _tmp24_->len > ((guint) 0);
		_g_array_unref0 (_tmp24_);
		if (_tmp25_) {
			gchar* root_str = NULL;
			GArray* _tmp26_;
			GArray* _tmp27_;
			Node* _tmp28_;
			CanvasText* _tmp29_;
			CanvasText* _tmp30_;
			FormattedText* _tmp31_;
			FormattedText* _tmp32_;
			const gchar* _tmp33_;
			const gchar* _tmp34_;
			gchar* _tmp35_;
			gchar* _tmp36_;
			const gchar* _tmp37_;
			_tmp26_ = mind_map_get_nodes (_data37_->map);
			_tmp27_ = _tmp26_;
			_tmp28_ = g_array_index (_tmp27_, Node*, (guint) 0);
			_tmp29_ = node_get_name (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = canvas_text_get_text (_tmp30_);
			_tmp32_ = _tmp31_;
			_tmp33_ = formatted_text_get_text (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = string_strip (_tmp34_);
			_tmp36_ = _tmp35_;
			_g_array_unref0 (_tmp27_);
			root_str = _tmp36_;
			_tmp37_ = root_str;
			if (g_strcmp0 (_tmp37_, "") != 0) {
				GtkFileDialog* _tmp38_;
				const gchar* _tmp39_;
				gchar* _tmp40_;
				gchar* _tmp41_;
				_tmp38_ = _data37_->dialog;
				_tmp39_ = root_str;
				_tmp40_ = main_window_convert_name_to_filename (self, _tmp39_);
				_tmp41_ = _tmp40_;
				gtk_file_dialog_set_initial_name (_tmp38_, _tmp41_);
				_g_free0 (_tmp41_);
			}
			_g_free0 (root_str);
		}
	}
	_tmp42_ = _data37_->dialog;
	_tmp43_ = filters;
	gtk_file_dialog_set_filters (_tmp42_, (GListModel*) _tmp43_);
	_tmp44_ = _data37_->dialog;
	gtk_file_dialog_save (_tmp44_, (GtkWindow*) self, NULL, ___lambda35__gasync_ready_callback, block37_data_ref (_data37_));
	_g_object_unref0 (filter);
	_g_object_unref0 (filters);
	block37_data_unref (_data37_);
	_data37_ = NULL;
}

void
main_window_do_save_as_file (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_current_map (self, "do_save_as_file");
	map = _tmp0_;
	main_window_save_file (self, map, FALSE);
	_mind_map_unref0 (map);
}

static void
main_window_on_current_changed (MainWindow* self,
                                MindMap* map)
{
	Node* _tmp0_;
	Node* _tmp1_;
	GtkToggleButton* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	MapModel* _tmp5_;
	MapModel* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	_tmp0_ = mind_map_get_current_node (map);
	_tmp1_ = _tmp0_;
	gtk_widget_action_set_enabled ((GtkWidget*) self, "win.action_zoom_selected", _tmp1_ != NULL);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = self->priv->_focus_btn;
	_tmp3_ = mind_map_get_focus_mode (map);
	_tmp4_ = _tmp3_;
	gtk_toggle_button_set_active (_tmp2_, _tmp4_);
	_tmp5_ = mind_map_get_model (map);
	_tmp6_ = _tmp5_;
	map_model_update_css (_tmp6_);
}

static void
main_window_change_scale (MainWindow* self,
                          gdouble scale_factor)
{
	gdouble* marks = NULL;
	gint _tmp0_ = 0;
	gdouble* _tmp1_;
	gint marks_length1;
	gint _marks_size_;
	gdouble scale_value = 0.0;
	gint int_value = 0;
	GtkMenuButton* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	GtkScale* _tmp5_;
	GtkButton* _tmp6_;
	gdouble _tmp7_;
	GtkButton* _tmp8_;
	gdouble _tmp9_;
	GtkNotebook* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp1_ = draw_area_get_scale_marks (&_tmp0_);
	marks = _tmp1_;
	marks_length1 = _tmp0_;
	_marks_size_ = marks_length1;
	scale_value = scale_factor * 100;
	int_value = (gint) scale_value;
	_tmp2_ = self->priv->_zoom_btn;
	_tmp3_ = g_strdup_printf (_ ("Zoom (%d%%)"), int_value);
	_tmp4_ = _tmp3_;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp2_, _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = self->priv->_zoom_scale;
	gtk_range_set_value ((GtkRange*) _tmp5_, scale_value);
	_tmp6_ = self->priv->_zoom_in;
	_tmp7_ = marks[marks_length1 - 1];
	gtk_widget_set_sensitive ((GtkWidget*) _tmp6_, scale_value < _tmp7_);
	_tmp8_ = self->priv->_zoom_out;
	_tmp9_ = marks[0];
	gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, scale_value > _tmp9_);
	_tmp10_ = self->priv->_nb;
	g_object_get (_tmp10_, "page", &_tmp11_, NULL);
	_tmp12_ = _tmp11_;
	main_window_save_tab_state (self, (guint) _tmp12_);
	marks = (g_free (marks), NULL);
}

static void
main_window_change_origin (MainWindow* self)
{
	GtkNotebook* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_nb;
	g_object_get (_tmp0_, "page", &_tmp1_, NULL);
	_tmp2_ = _tmp1_;
	main_window_save_tab_state (self, (guint) _tmp2_);
}

static void
main_window_save_tabs (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp2_;
				MindMap* map = NULL;
				MindMap* _tmp3_;
				MindMap* _tmp4_;
				gboolean _tmp5_;
				gboolean _tmp6_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp2_))) {
					break;
				}
				_tmp3_ = main_window_get_map (self, i);
				map = _tmp3_;
				_tmp4_ = map;
				_tmp5_ = mind_map_get_editable (_tmp4_);
				_tmp6_ = _tmp5_;
				if (_tmp6_) {
					MindMap* _tmp7_;
					_tmp7_ = map;
					mind_map_close (_tmp7_);
				}
				_mind_map_unref0 (map);
			}
		}
	}
}

static void
main_window_show_properties (MainWindow* self,
                             const gchar* tab,
                             PropertyGrab grab_type)
{
	gboolean _tmp0_ = FALSE;
	GtkNotebook* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_inspector_nb;
	if (!gtk_widget_get_mapped ((GtkWidget*) _tmp1_)) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp2_ = FALSE;
		if (tab != NULL) {
			GtkStack* _tmp3_;
			const gchar* _tmp4_;
			const gchar* _tmp5_;
			_tmp3_ = self->priv->_stack;
			_tmp4_ = gtk_stack_get_visible_child_name (_tmp3_);
			_tmp5_ = _tmp4_;
			_tmp2_ = g_strcmp0 (_tmp5_, tab) != 0;
		} else {
			_tmp2_ = FALSE;
		}
		_tmp0_ = _tmp2_;
	}
	if (_tmp0_) {
		GtkToggleButton* _tmp6_;
		const gchar* _tmp7_;
		GtkToggleButton* _tmp8_;
		GtkToggleButton* _tmp9_;
		GtkNotebook* _tmp11_;
		GSettings* _tmp23_;
		GtkStack* _tmp24_;
		const gchar* _tmp25_;
		const gchar* _tmp26_;
		gchar* _tmp27_;
		gchar* _tmp28_;
		_tmp6_ = self->priv->_prop_btn;
		_tmp7_ = self->priv->_prop_hide;
		gtk_button_set_icon_name ((GtkButton*) _tmp6_, _tmp7_);
		_tmp8_ = self->priv->_prop_btn;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp8_, _ ("Hide Property Sidebar"));
		_tmp9_ = self->priv->_prop_btn;
		gtk_toggle_button_set_active (_tmp9_, TRUE);
		if (tab != NULL) {
			GtkStack* _tmp10_;
			_tmp10_ = self->priv->_stack;
			gtk_stack_set_visible_child_name (_tmp10_, tab);
		}
		_tmp11_ = self->priv->_inspector_nb;
		if (!gtk_widget_get_mapped ((GtkWidget*) _tmp11_)) {
			GtkPaned* _tmp12_;
			GtkNotebook* _tmp13_;
			GtkPaned* _tmp14_;
			GSettings* _tmp15_;
			MindMap* _tmp16_;
			MindMap* _tmp17_;
			gboolean _tmp18_;
			_tmp12_ = self->priv->_pane;
			_tmp13_ = self->priv->_inspector_nb;
			gtk_paned_set_end_child (_tmp12_, (GtkWidget*) _tmp13_);
			_tmp14_ = self->priv->_pane;
			_tmp15_ = self->priv->_settings;
			gtk_paned_set_position (_tmp14_, g_settings_get_int (_tmp15_, "properties-width"));
			_tmp16_ = main_window_get_current_map (self, "show_properties 1");
			_tmp17_ = _tmp16_;
			_tmp18_ = _tmp17_ != NULL;
			_mind_map_unref0 (_tmp17_);
			if (_tmp18_) {
				MindMap* _tmp19_;
				MindMap* _tmp20_;
				DrawArea* _tmp21_;
				DrawArea* _tmp22_;
				_tmp19_ = main_window_get_current_map (self, "show_properties 2");
				_tmp20_ = _tmp19_;
				_tmp21_ = mind_map_get_canvas (_tmp20_);
				_tmp22_ = _tmp21_;
				draw_area_see (_tmp22_, TRUE, (gdouble) -300, 100.0);
				_mind_map_unref0 (_tmp20_);
			}
		}
		_tmp23_ = self->priv->_settings;
		_tmp24_ = self->priv->_stack;
		_tmp25_ = gtk_stack_get_visible_child_name (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = g_strconcat (_tmp26_, "-properties-shown", NULL);
		_tmp28_ = _tmp27_;
		g_settings_set_boolean (_tmp23_, _tmp28_, TRUE);
		_g_free0 (_tmp28_);
	}
	switch (grab_type) {
		case PROPERTY_GRAB_FIRST:
		{
			GtkStack* _tmp29_;
			const gchar* _tmp30_;
			const gchar* _tmp31_;
			const gchar* _tmp32_;
			GQuark _tmp34_ = 0U;
			static GQuark _tmp33_label0 = 0;
			static GQuark _tmp33_label1 = 0;
			static GQuark _tmp33_label2 = 0;
			static GQuark _tmp33_label3 = 0;
			static GQuark _tmp33_label4 = 0;
			_tmp29_ = self->priv->_stack;
			_tmp30_ = gtk_stack_get_visible_child_name (_tmp29_);
			_tmp31_ = _tmp30_;
			_tmp32_ = _tmp31_;
			_tmp34_ = (NULL == _tmp32_) ? 0 : g_quark_from_string (_tmp32_);
			if (_tmp34_ == ((0 != _tmp33_label0) ? _tmp33_label0 : (_tmp33_label0 = g_quark_from_static_string ("current")))) {
				switch (0) {
					default:
					{
						GtkStack* _tmp35_;
						GtkWidget* _tmp36_;
						_tmp35_ = self->priv->_stack;
						_tmp36_ = gtk_stack_get_child_by_name (_tmp35_, "current");
						current_inspector_grab_first (IS_CURRENT_INSPECTOR (_tmp36_) ? ((CurrentInspector*) _tmp36_) : NULL);
						break;
					}
				}
			} else if (_tmp34_ == ((0 != _tmp33_label1) ? _tmp33_label1 : (_tmp33_label1 = g_quark_from_static_string ("style")))) {
				switch (0) {
					default:
					{
						GtkStack* _tmp37_;
						GtkWidget* _tmp38_;
						_tmp37_ = self->priv->_stack;
						_tmp38_ = gtk_stack_get_child_by_name (_tmp37_, "style");
						style_inspector_grab_first (IS_STYLE_INSPECTOR (_tmp38_) ? ((StyleInspector*) _tmp38_) : NULL);
						break;
					}
				}
			} else if (_tmp34_ == ((0 != _tmp33_label2) ? _tmp33_label2 : (_tmp33_label2 = g_quark_from_static_string ("tag")))) {
				switch (0) {
					default:
					{
						GtkStack* _tmp39_;
						GtkWidget* _tmp40_;
						_tmp39_ = self->priv->_stack;
						_tmp40_ = gtk_stack_get_child_by_name (_tmp39_, "tag");
						tag_inspector_grab_first (IS_TAG_INSPECTOR (_tmp40_) ? ((TagInspector*) _tmp40_) : NULL);
						break;
					}
				}
			} else if (_tmp34_ == ((0 != _tmp33_label3) ? _tmp33_label3 : (_tmp33_label3 = g_quark_from_static_string ("sticker")))) {
				switch (0) {
					default:
					{
						GtkStack* _tmp41_;
						GtkWidget* _tmp42_;
						_tmp41_ = self->priv->_stack;
						_tmp42_ = gtk_stack_get_child_by_name (_tmp41_, "sticker");
						sticker_inspector_grab_first (IS_STICKER_INSPECTOR (_tmp42_) ? ((StickerInspector*) _tmp42_) : NULL);
						break;
					}
				}
			} else if (_tmp34_ == ((0 != _tmp33_label4) ? _tmp33_label4 : (_tmp33_label4 = g_quark_from_static_string ("map")))) {
				switch (0) {
					default:
					{
						GtkStack* _tmp43_;
						GtkWidget* _tmp44_;
						_tmp43_ = self->priv->_stack;
						_tmp44_ = gtk_stack_get_child_by_name (_tmp43_, "map");
						map_inspector_grab_first (IS_MAP_INSPECTOR (_tmp44_) ? ((MapInspector*) _tmp44_) : NULL);
						break;
					}
				}
			}
			break;
		}
		case PROPERTY_GRAB_NOTE:
		{
			gboolean _tmp45_ = FALSE;
			if (tab != NULL) {
				_tmp45_ = g_strcmp0 (tab, "current") == 0;
			} else {
				_tmp45_ = FALSE;
			}
			if (_tmp45_) {
				CurrentInspector* ci = NULL;
				GtkStack* _tmp46_;
				GtkWidget* _tmp47_;
				CurrentInspector* _tmp48_;
				CurrentInspector* _tmp49_;
				_tmp46_ = self->priv->_stack;
				_tmp47_ = gtk_stack_get_child_by_name (_tmp46_, tab);
				_tmp48_ = _g_object_ref0 (IS_CURRENT_INSPECTOR (_tmp47_) ? ((CurrentInspector*) _tmp47_) : NULL);
				ci = _tmp48_;
				_tmp49_ = ci;
				if (_tmp49_ != NULL) {
					CurrentInspector* _tmp50_;
					_tmp50_ = ci;
					current_inspector_grab_note (_tmp50_);
				}
				_g_object_unref0 (ci);
			}
			break;
		}
		default:
		break;
	}
}

NoteView*
main_window_get_current_note (MainWindow* self)
{
	CurrentInspector* current = NULL;
	GtkStack* _tmp0_;
	GtkWidget* _tmp1_;
	CurrentInspector* _tmp2_;
	CurrentInspector* _tmp3_;
	NoteView* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_stack;
	_tmp1_ = gtk_stack_get_child_by_name (_tmp0_, "current");
	_tmp2_ = _g_object_ref0 (IS_CURRENT_INSPECTOR (_tmp1_) ? ((CurrentInspector*) _tmp1_) : NULL);
	current = _tmp2_;
	_tmp3_ = current;
	if (_tmp3_ != NULL) {
		CurrentInspector* _tmp4_;
		NoteView* _tmp5_;
		_tmp4_ = current;
		_tmp5_ = current_inspector_get_note (_tmp4_);
		result = _tmp5_;
		_g_object_unref0 (current);
		return result;
	}
	result = NULL;
	_g_object_unref0 (current);
	return result;
}

void
main_window_show_theme_editor (MainWindow* self,
                               Theme* theme)
{
	GtkNotebook* _tmp6_;
	g_return_if_fail (self != NULL);
	if (theme == NULL) {
		ThemeEditor* _tmp0_;
		MindMap* _tmp1_;
		MindMap* _tmp2_;
		Theme* _tmp3_;
		Theme* _tmp4_;
		_tmp0_ = self->priv->_themer;
		_tmp1_ = main_window_get_current_map (self, NULL);
		_tmp2_ = _tmp1_;
		_tmp3_ = mind_map_get_theme (_tmp2_);
		_tmp4_ = _tmp3_;
		theme_editor_initialize (_tmp0_, _tmp4_, FALSE);
		_g_object_unref0 (_tmp4_);
		_mind_map_unref0 (_tmp2_);
	} else {
		ThemeEditor* _tmp5_;
		_tmp5_ = self->priv->_themer;
		theme_editor_initialize (_tmp5_, theme, TRUE);
	}
	_tmp6_ = self->priv->_inspector_nb;
	g_object_set (_tmp6_, "page", 1, NULL);
}

void
main_window_hide_theme_editor (MainWindow* self)
{
	GtkNotebook* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_inspector_nb;
	g_object_set (_tmp0_, "page", 0, NULL);
}

static void
main_window_hide_properties (MainWindow* self)
{
	GtkNotebook* _tmp0_;
	GtkToggleButton* _tmp1_;
	const gchar* _tmp2_;
	GtkToggleButton* _tmp3_;
	GtkToggleButton* _tmp4_;
	GtkPaned* _tmp5_;
	GtkPaned* _tmp6_;
	MindMap* _tmp7_;
	MindMap* _tmp8_;
	DrawArea* _tmp9_;
	DrawArea* _tmp10_;
	GSettings* _tmp11_;
	GSettings* _tmp12_;
	GSettings* _tmp13_;
	GSettings* _tmp14_;
	GSettings* _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_inspector_nb;
	if (!gtk_widget_get_mapped ((GtkWidget*) _tmp0_)) {
		return;
	}
	_tmp1_ = self->priv->_prop_btn;
	_tmp2_ = self->priv->_prop_show;
	gtk_button_set_icon_name ((GtkButton*) _tmp1_, _tmp2_);
	_tmp3_ = self->priv->_prop_btn;
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp3_, _ ("Show Property Sidebar"));
	_tmp4_ = self->priv->_prop_btn;
	gtk_toggle_button_set_active (_tmp4_, FALSE);
	_tmp5_ = self->priv->_pane;
	g_object_set (_tmp5_, "position-set", FALSE, NULL);
	_tmp6_ = self->priv->_pane;
	gtk_paned_set_end_child (_tmp6_, NULL);
	_tmp7_ = main_window_get_current_map (self, "hide_properties");
	_tmp8_ = _tmp7_;
	_tmp9_ = mind_map_get_canvas (_tmp8_);
	_tmp10_ = _tmp9_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp10_);
	_mind_map_unref0 (_tmp8_);
	_tmp11_ = self->priv->_settings;
	g_settings_set_boolean (_tmp11_, "current-properties-shown", FALSE);
	_tmp12_ = self->priv->_settings;
	g_settings_set_boolean (_tmp12_, "style-properties-shown", FALSE);
	_tmp13_ = self->priv->_settings;
	g_settings_set_boolean (_tmp13_, "tag-properties-shown", FALSE);
	_tmp14_ = self->priv->_settings;
	g_settings_set_boolean (_tmp14_, "sticker-properties-shown", FALSE);
	_tmp15_ = self->priv->_settings;
	g_settings_set_boolean (_tmp15_, "map-properties-shown", FALSE);
}

static gdouble
main_window_zoom_to_value (MainWindow* self,
                           gdouble value)
{
	gdouble last = 0.0;
	gint _tmp0_ = 0;
	gdouble* _tmp1_;
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	last = (gdouble) -1;
	_tmp1_ = draw_area_get_scale_marks (&_tmp0_);
	{
		gdouble* mark_collection = NULL;
		gint mark_collection_length1 = 0;
		gint _mark_collection_size_ = 0;
		gint mark_it = 0;
		mark_collection = _tmp1_;
		mark_collection_length1 = _tmp0_;
		for (mark_it = 0; mark_it < mark_collection_length1; mark_it = mark_it + 1) {
			gdouble mark = 0.0;
			mark = mark_collection[mark_it];
			{
				if (last != ((gdouble) -1)) {
					if (value < ((mark + last) / 2)) {
						result = last;
						mark_collection = (g_free (mark_collection), NULL);
						return result;
					}
				}
				last = mark;
			}
		}
		mark_collection = (g_free (mark_collection), NULL);
	}
	result = last;
	return result;
}

static gboolean
main_window_adjust_zoom (MainWindow* self,
                         GtkScrollType scroll,
                         gdouble new_value)
{
	gdouble value = 0.0;
	gdouble scale_factor = 0.0;
	MindMap* map = NULL;
	MindMap* _tmp0_;
	DrawArea* _tmp1_;
	DrawArea* _tmp2_;
	DrawArea* _tmp3_;
	DrawArea* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	value = main_window_zoom_to_value (self, new_value);
	scale_factor = value / 100;
	_tmp0_ = main_window_get_current_map (self, "adjust_zoom");
	map = _tmp0_;
	_tmp1_ = mind_map_get_canvas (map);
	_tmp2_ = _tmp1_;
	draw_area_set_scaling_factor (_tmp2_, scale_factor);
	_tmp3_ = mind_map_get_canvas (map);
	_tmp4_ = _tmp3_;
	gtk_widget_queue_draw ((GtkWidget*) _tmp4_);
	result = FALSE;
	_mind_map_unref0 (map);
	return result;
}

static void
main_window_action_new (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	main_window_do_new_file (self);
}

static void
main_window_action_open (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	main_window_do_open_file (self);
}

static void
main_window_action_save (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Document* _tmp2_;
	Document* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_current_map (self, "action_save");
	map = _tmp0_;
	_tmp1_ = map;
	_tmp2_ = mind_map_get_doc (_tmp1_);
	_tmp3_ = _tmp2_;
	if (document_is_saved (_tmp3_)) {
		MindMap* _tmp4_;
		Document* _tmp5_;
		Document* _tmp6_;
		_tmp4_ = map;
		_tmp5_ = mind_map_get_doc (_tmp4_);
		_tmp6_ = _tmp5_;
		document_save (_tmp6_);
	} else {
		MindMap* _tmp7_;
		_tmp7_ = map;
		main_window_save_file (self, _tmp7_, FALSE);
	}
	_mind_map_unref0 (map);
}

static void
main_window_action_save_as (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	main_window_do_save_as_file (self);
}

static void
main_window_save_window_size (MainWindow* self)
{
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = minder_settings;
	g_settings_set_int (_tmp0_, "window-w", gtk_widget_get_width ((GtkWidget*) self));
	_tmp1_ = minder_settings;
	g_settings_set_int (_tmp1_, "window-h", gtk_widget_get_height ((GtkWidget*) self));
}

static void
main_window_set_window_size (MainWindow* self)
{
	GSettings* _tmp0_;
	GSettings* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = minder_settings;
	_tmp1_ = minder_settings;
	gtk_window_set_default_size ((GtkWindow*) self, g_settings_get_int (_tmp0_, "window-w"), g_settings_get_int (_tmp1_, "window-h"));
}

static void
main_window_action_quit (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	main_window_save_window_size (self);
	main_window_save_tabs (self);
	gtk_window_destroy ((GtkWindow*) self);
}

static void
main_window_action_undo (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	main_window_do_undo (self);
}

static void
main_window_action_redo (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	main_window_do_redo (self);
}

static void
main_window_action_zoom_in (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	DrawArea* _tmp1_;
	DrawArea* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_current_map (self, "action_zoom_in");
	map = _tmp0_;
	_tmp1_ = mind_map_get_canvas (map);
	_tmp2_ = _tmp1_;
	draw_area_zoom_in (_tmp2_);
	_mind_map_unref0 (map);
}

static void
main_window_action_zoom_out (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	DrawArea* _tmp1_;
	DrawArea* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_current_map (self, "action_zoom_out");
	map = _tmp0_;
	_tmp1_ = mind_map_get_canvas (map);
	_tmp2_ = _tmp1_;
	draw_area_zoom_out (_tmp2_);
	_mind_map_unref0 (map);
}

static void
main_window_action_zoom_fit (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	DrawArea* _tmp1_;
	DrawArea* _tmp2_;
	DrawArea* _tmp3_;
	DrawArea* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_current_map (self, "action_zoom_fit");
	map = _tmp0_;
	_tmp1_ = mind_map_get_canvas (map);
	_tmp2_ = _tmp1_;
	draw_area_zoom_to_fit (_tmp2_);
	_tmp3_ = mind_map_get_canvas (map);
	_tmp4_ = _tmp3_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp4_);
	_mind_map_unref0 (map);
}

static void
main_window_action_zoom_selected (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	DrawArea* _tmp1_;
	DrawArea* _tmp2_;
	DrawArea* _tmp3_;
	DrawArea* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_current_map (self, "action_zoom_selected");
	map = _tmp0_;
	_tmp1_ = mind_map_get_canvas (map);
	_tmp2_ = _tmp1_;
	draw_area_zoom_to_selected (_tmp2_);
	_tmp3_ = mind_map_get_canvas (map);
	_tmp4_ = _tmp3_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp4_);
	_mind_map_unref0 (map);
}

static void
main_window_action_zoom_actual (MainWindow* self)
{
	MindMap* map = NULL;
	MindMap* _tmp0_;
	DrawArea* _tmp1_;
	DrawArea* _tmp2_;
	DrawArea* _tmp3_;
	DrawArea* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_current_map (self, "action_zoom_actual");
	map = _tmp0_;
	_tmp1_ = mind_map_get_canvas (map);
	_tmp2_ = _tmp1_;
	draw_area_zoom_actual (_tmp2_);
	_tmp3_ = mind_map_get_canvas (map);
	_tmp4_ = _tmp3_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp4_);
	_mind_map_unref0 (map);
}

static void
main_window_on_search_change (MainWindow* self)
{
	gboolean* search_opts = NULL;
	gboolean* _tmp0_;
	gint search_opts_length1;
	gint _search_opts_size_;
	gboolean* _tmp1_;
	gint _tmp1__length1;
	GtkCheckButton* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean* _tmp5_;
	gint _tmp5__length1;
	GtkCheckButton* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	gboolean* _tmp9_;
	gint _tmp9__length1;
	GtkCheckButton* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	gboolean* _tmp13_;
	gint _tmp13__length1;
	GtkCheckButton* _tmp14_;
	gboolean _tmp15_;
	gboolean _tmp16_;
	gboolean* _tmp17_;
	gint _tmp17__length1;
	GtkCheckButton* _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp20_;
	gboolean* _tmp21_;
	gint _tmp21__length1;
	GtkCheckButton* _tmp22_;
	gboolean _tmp23_;
	gboolean _tmp24_;
	gboolean* _tmp25_;
	gint _tmp25__length1;
	GtkCheckButton* _tmp26_;
	gboolean _tmp27_;
	gboolean _tmp28_;
	gboolean* _tmp29_;
	gint _tmp29__length1;
	GtkCheckButton* _tmp30_;
	gboolean _tmp31_;
	gboolean _tmp32_;
	gboolean* _tmp33_;
	gint _tmp33__length1;
	GtkCheckButton* _tmp34_;
	gboolean _tmp35_;
	gboolean _tmp36_;
	gboolean* _tmp37_;
	gint _tmp37__length1;
	GtkCheckButton* _tmp38_;
	gboolean _tmp39_;
	gboolean _tmp40_;
	GtkListStore* _tmp41_;
	gboolean all_tabs = FALSE;
	GSettings* _tmp42_;
	MindMap* current = NULL;
	MindMap* _tmp43_;
	gchar* text = NULL;
	GtkSearchEntry* _tmp44_;
	const gchar* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_ = NULL;
	gchar* name = NULL;
	gchar* _tmp53_;
	const gchar* _tmp54_;
	MindMap* _tmp55_;
	MapModel* _tmp56_;
	MapModel* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	gboolean* _tmp60_;
	gint _tmp60__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_new0 (gboolean, SEARCH_OPTIONS_NUM);
	search_opts = _tmp0_;
	search_opts_length1 = SEARCH_OPTIONS_NUM;
	_search_opts_size_ = search_opts_length1;
	_tmp1_ = search_opts;
	_tmp1__length1 = search_opts_length1;
	_tmp2_ = self->priv->_search_nodes;
	_tmp3_ = gtk_check_button_get_active (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp1_[SEARCH_OPTIONS_NODES] = _tmp4_;
	_tmp5_ = search_opts;
	_tmp5__length1 = search_opts_length1;
	_tmp6_ = self->priv->_search_connections;
	_tmp7_ = gtk_check_button_get_active (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp5_[SEARCH_OPTIONS_CONNECTIONS] = _tmp8_;
	_tmp9_ = search_opts;
	_tmp9__length1 = search_opts_length1;
	_tmp10_ = self->priv->_search_callouts;
	_tmp11_ = gtk_check_button_get_active (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp9_[SEARCH_OPTIONS_CALLOUTS] = _tmp12_;
	_tmp13_ = search_opts;
	_tmp13__length1 = search_opts_length1;
	_tmp14_ = self->priv->_search_groups;
	_tmp15_ = gtk_check_button_get_active (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp13_[SEARCH_OPTIONS_GROUPS] = _tmp16_;
	_tmp17_ = search_opts;
	_tmp17__length1 = search_opts_length1;
	_tmp18_ = self->priv->_search_titles;
	_tmp19_ = gtk_check_button_get_active (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp17_[SEARCH_OPTIONS_TITLES] = _tmp20_;
	_tmp21_ = search_opts;
	_tmp21__length1 = search_opts_length1;
	_tmp22_ = self->priv->_search_notes;
	_tmp23_ = gtk_check_button_get_active (_tmp22_);
	_tmp24_ = _tmp23_;
	_tmp21_[SEARCH_OPTIONS_NOTES] = _tmp24_;
	_tmp25_ = search_opts;
	_tmp25__length1 = search_opts_length1;
	_tmp26_ = self->priv->_search_folded;
	_tmp27_ = gtk_check_button_get_active (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp25_[SEARCH_OPTIONS_FOLDED] = _tmp28_;
	_tmp29_ = search_opts;
	_tmp29__length1 = search_opts_length1;
	_tmp30_ = self->priv->_search_unfolded;
	_tmp31_ = gtk_check_button_get_active (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp29_[SEARCH_OPTIONS_UNFOLDED] = _tmp32_;
	_tmp33_ = search_opts;
	_tmp33__length1 = search_opts_length1;
	_tmp34_ = self->priv->_search_tasks;
	_tmp35_ = gtk_check_button_get_active (_tmp34_);
	_tmp36_ = _tmp35_;
	_tmp33_[SEARCH_OPTIONS_TASKS] = _tmp36_;
	_tmp37_ = search_opts;
	_tmp37__length1 = search_opts_length1;
	_tmp38_ = self->priv->_search_nontasks;
	_tmp39_ = gtk_check_button_get_active (_tmp38_);
	_tmp40_ = _tmp39_;
	_tmp37_[SEARCH_OPTIONS_NONTASKS] = _tmp40_;
	_tmp41_ = self->priv->_search_items;
	gtk_list_store_clear (_tmp41_);
	_tmp42_ = self->priv->_settings;
	all_tabs = g_settings_get_boolean (_tmp42_, "search-opt-all-tabs");
	_tmp43_ = main_window_get_current_map (self, "on_search_change");
	current = _tmp43_;
	_tmp44_ = self->priv->_search_entry;
	_tmp45_ = gtk_editable_get_text ((GtkEditable*) _tmp44_);
	_tmp46_ = g_utf8_casefold (_tmp45_, (gssize) -1);
	text = _tmp46_;
	if (all_tabs) {
		GtkNotebook* _tmp48_;
		gint _tmp49_;
		gint _tmp50_;
		gchar* _tmp51_;
		_tmp48_ = self->priv->_nb;
		g_object_get (_tmp48_, "page", &_tmp49_, NULL);
		_tmp50_ = _tmp49_;
		_tmp51_ = main_window_get_tab_label_name (self, _tmp50_);
		_g_free0 (_tmp47_);
		_tmp47_ = _tmp51_;
	} else {
		gchar* _tmp52_;
		_tmp52_ = g_strdup ("");
		_g_free0 (_tmp47_);
		_tmp47_ = _tmp52_;
	}
	_tmp53_ = _tmp47_;
	_tmp47_ = NULL;
	name = _tmp53_;
	_tmp54_ = text;
	if (g_strcmp0 (_tmp54_, "") == 0) {
		_g_free0 (name);
		_g_free0 (_tmp47_);
		_g_free0 (text);
		_mind_map_unref0 (current);
		search_opts = (g_free (search_opts), NULL);
		return;
	}
	_tmp55_ = current;
	_tmp56_ = mind_map_get_model (_tmp55_);
	_tmp57_ = _tmp56_;
	_tmp58_ = name;
	_tmp59_ = text;
	_tmp60_ = search_opts;
	_tmp60__length1 = search_opts_length1;
	map_model_get_match_items (_tmp57_, _tmp58_, _tmp59_, _tmp60_, (gint) _tmp60__length1, &self->priv->_search_items);
	if (all_tabs) {
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp61_ = FALSE;
				_tmp61_ = TRUE;
				while (TRUE) {
					GtkNotebook* _tmp63_;
					MindMap* map = NULL;
					MindMap* _tmp64_;
					MindMap* _tmp65_;
					MindMap* _tmp66_;
					if (!_tmp61_) {
						gint _tmp62_;
						_tmp62_ = i;
						i = _tmp62_ + 1;
					}
					_tmp61_ = FALSE;
					_tmp63_ = self->priv->_nb;
					if (!(i < gtk_notebook_get_n_pages (_tmp63_))) {
						break;
					}
					_tmp64_ = main_window_get_map (self, i);
					map = _tmp64_;
					_tmp65_ = map;
					_tmp66_ = current;
					if (_tmp65_ != _tmp66_) {
						MindMap* _tmp67_;
						MapModel* _tmp68_;
						MapModel* _tmp69_;
						gchar* _tmp70_;
						gchar* _tmp71_;
						const gchar* _tmp72_;
						gboolean* _tmp73_;
						gint _tmp73__length1;
						_tmp67_ = map;
						_tmp68_ = mind_map_get_model (_tmp67_);
						_tmp69_ = _tmp68_;
						_tmp70_ = main_window_get_tab_label_name (self, i);
						_tmp71_ = _tmp70_;
						_tmp72_ = text;
						_tmp73_ = search_opts;
						_tmp73__length1 = search_opts_length1;
						map_model_get_match_items (_tmp69_, _tmp71_, _tmp72_, _tmp73_, (gint) _tmp73__length1, &self->priv->_search_items);
						_g_free0 (_tmp71_);
					}
					_mind_map_unref0 (map);
				}
			}
		}
	}
	_g_free0 (name);
	_g_free0 (_tmp47_);
	_g_free0 (text);
	_mind_map_unref0 (current);
	search_opts = (g_free (search_opts), NULL);
}

static void
main_window_on_search_clicked (MainWindow* self,
                               GtkTreeView* view,
                               GtkTreePath* path,
                               GtkTreeViewColumn* col)
{
	GtkTreeIter it = {0};
	gchar* tabname = NULL;
	gchar* _tmp0_;
	Node* node = NULL;
	Connection* conn = NULL;
	Callout* callout = NULL;
	NodeGroup* group = NULL;
	MindMap* map = NULL;
	MindMap* _tmp1_;
	GtkListStore* _tmp2_;
	GtkTreeIter _tmp3_ = {0};
	GtkListStore* _tmp4_;
	GtkTreeIter _tmp5_;
	Node* _tmp15_;
	GtkPopover* _tmp39_;
	MindMap* _tmp40_;
	DrawArea* _tmp41_;
	DrawArea* _tmp42_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (view != NULL);
	g_return_if_fail (path != NULL);
	_tmp0_ = g_strdup ("");
	tabname = _tmp0_;
	node = NULL;
	conn = NULL;
	callout = NULL;
	group = NULL;
	_tmp1_ = main_window_get_current_map (self, "on_search_clicked");
	map = _tmp1_;
	_tmp2_ = self->priv->_search_items;
	gtk_tree_model_get_iter ((GtkTreeModel*) _tmp2_, &_tmp3_, path);
	it = _tmp3_;
	_tmp4_ = self->priv->_search_items;
	_tmp5_ = it;
	gtk_tree_model_get ((GtkTreeModel*) _tmp4_, &_tmp5_, 2, &node, 3, &conn, 4, &callout, 5, &group, 6, &tabname, -1, -1);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp8_;
				gchar* _tmp9_;
				gchar* _tmp10_;
				const gchar* _tmp11_;
				gboolean _tmp12_;
				if (!_tmp6_) {
					gint _tmp7_;
					_tmp7_ = i;
					i = _tmp7_ + 1;
				}
				_tmp6_ = FALSE;
				_tmp8_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp8_))) {
					break;
				}
				_tmp9_ = main_window_get_tab_label_name (self, i);
				_tmp10_ = _tmp9_;
				_tmp11_ = tabname;
				_tmp12_ = g_strcmp0 (_tmp10_, _tmp11_) == 0;
				_g_free0 (_tmp10_);
				if (_tmp12_) {
					MindMap* _tmp13_;
					GtkNotebook* _tmp14_;
					_tmp13_ = main_window_get_map (self, i);
					_mind_map_unref0 (map);
					map = _tmp13_;
					_tmp14_ = self->priv->_nb;
					g_object_set (_tmp14_, "page", i, NULL);
					break;
				}
			}
		}
	}
	_tmp15_ = node;
	if (_tmp15_ != NULL) {
		MindMap* _tmp16_;
		Node* _tmp17_;
		MindMap* _tmp18_;
		DrawArea* _tmp19_;
		DrawArea* _tmp20_;
		_tmp16_ = map;
		_tmp17_ = node;
		mind_map_set_current_node (_tmp16_, _tmp17_);
		_tmp18_ = map;
		_tmp19_ = mind_map_get_canvas (_tmp18_);
		_tmp20_ = _tmp19_;
		draw_area_see (_tmp20_, TRUE, (gdouble) 0, 100.0);
	} else {
		Connection* _tmp21_;
		_tmp21_ = conn;
		if (_tmp21_ != NULL) {
			MindMap* _tmp22_;
			Connection* _tmp23_;
			MindMap* _tmp24_;
			DrawArea* _tmp25_;
			DrawArea* _tmp26_;
			_tmp22_ = map;
			_tmp23_ = conn;
			mind_map_set_current_connection (_tmp22_, _tmp23_);
			_tmp24_ = map;
			_tmp25_ = mind_map_get_canvas (_tmp24_);
			_tmp26_ = _tmp25_;
			draw_area_see (_tmp26_, TRUE, (gdouble) 0, 100.0);
		} else {
			Callout* _tmp27_;
			_tmp27_ = callout;
			if (_tmp27_ != NULL) {
				MindMap* _tmp28_;
				Callout* _tmp29_;
				MindMap* _tmp30_;
				DrawArea* _tmp31_;
				DrawArea* _tmp32_;
				_tmp28_ = map;
				_tmp29_ = callout;
				mind_map_set_current_callout (_tmp28_, _tmp29_);
				_tmp30_ = map;
				_tmp31_ = mind_map_get_canvas (_tmp30_);
				_tmp32_ = _tmp31_;
				draw_area_see (_tmp32_, TRUE, (gdouble) 0, 100.0);
			} else {
				NodeGroup* _tmp33_;
				_tmp33_ = group;
				if (_tmp33_ != NULL) {
					MindMap* _tmp34_;
					NodeGroup* _tmp35_;
					MindMap* _tmp36_;
					DrawArea* _tmp37_;
					DrawArea* _tmp38_;
					_tmp34_ = map;
					_tmp35_ = group;
					mind_map_set_current_group (_tmp34_, _tmp35_);
					_tmp36_ = map;
					_tmp37_ = mind_map_get_canvas (_tmp36_);
					_tmp38_ = _tmp37_;
					draw_area_see (_tmp38_, TRUE, (gdouble) 0, 100.0);
				}
			}
		}
	}
	_tmp39_ = self->priv->_search;
	g_signal_emit_by_name (_tmp39_, "closed");
	_tmp40_ = map;
	_tmp41_ = mind_map_get_canvas (_tmp40_);
	_tmp42_ = _tmp41_;
	gtk_widget_grab_focus ((GtkWidget*) _tmp42_);
	_mind_map_unref0 (map);
	_g_object_unref0 (group);
	_g_object_unref0 (callout);
	_g_object_unref0 (conn);
	_g_object_unref0 (node);
	_g_free0 (tabname);
}

gchar*
main_window_repair_filename (MainWindow* self,
                             const gchar* fname,
                             gchar** extensions,
                             gint extensions_length1)
{
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (fname != NULL, NULL);
	{
		gchar** ext_collection = NULL;
		gint ext_collection_length1 = 0;
		gint _ext_collection_size_ = 0;
		gint ext_it = 0;
		ext_collection = extensions;
		ext_collection_length1 = extensions_length1;
		for (ext_it = 0; ext_it < ext_collection_length1; ext_it = ext_it + 1) {
			gchar* _tmp0_;
			gchar* ext = NULL;
			_tmp0_ = g_strdup (ext_collection[ext_it]);
			ext = _tmp0_;
			{
				const gchar* _tmp1_;
				_tmp1_ = ext;
				if (g_str_has_suffix (fname, _tmp1_)) {
					gchar* _tmp2_;
					_tmp2_ = g_strdup (fname);
					result = _tmp2_;
					_g_free0 (ext);
					return result;
				}
				_g_free0 (ext);
			}
		}
	}
	_tmp3_ = extensions[0];
	_tmp4_ = g_strconcat (fname, _tmp3_, NULL);
	result = _tmp4_;
	return result;
}

static void
main_window_action_print (MainWindow* self)
{
	ExportPrint* print = NULL;
	ExportPrint* _tmp0_;
	MindMap* _tmp1_;
	MindMap* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = export_print_new ();
	print = _tmp0_;
	_tmp1_ = main_window_get_current_map (self, "action_print");
	_tmp2_ = _tmp1_;
	export_print_print (print, _tmp2_, self);
	_mind_map_unref0 (_tmp2_);
	_g_object_unref0 (print);
}

static void
main_window_action_prefs (MainWindow* self)
{
	Preferences* prefs = NULL;
	Preferences* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = preferences_new (self);
	g_object_ref_sink (_tmp0_);
	prefs = _tmp0_;
	gtk_window_present ((GtkWindow*) prefs);
	_g_object_unref0 (prefs);
}

static void
main_window_action_shortcuts (MainWindow* self)
{
	gchar* ui_str = NULL;
	Shortcuts* _tmp0_;
	Shortcuts* _tmp1_;
	gchar* _tmp2_;
	GtkBuilder* builder = NULL;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	GtkBuilder* _tmp7_;
	GtkShortcutsWindow* win = NULL;
	GtkBuilder* _tmp8_;
	GObject* _tmp9_;
	GtkShortcutsWindow* _tmp10_;
	MindMap* map = NULL;
	MindMap* _tmp11_;
	GtkShortcutsWindow* _tmp12_;
	GtkShortcutsWindow* _tmp13_;
	gboolean _tmp14_ = FALSE;
	MindMap* _tmp15_;
	GtkShortcutsWindow* _tmp27_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_shortcuts (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = shortcuts_get_ui_string (_tmp1_);
	ui_str = _tmp2_;
	_tmp3_ = ui_str;
	_tmp4_ = ui_str;
	_tmp5_ = strlen (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = gtk_builder_new_from_string (_tmp3_, (gssize) _tmp6_);
	builder = _tmp7_;
	_tmp8_ = builder;
	_tmp9_ = gtk_builder_get_object (_tmp8_, "shortcuts");
	_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp9_, gtk_shortcuts_window_get_type ()) ? ((GtkShortcutsWindow*) _tmp9_) : NULL);
	win = _tmp10_;
	_tmp11_ = main_window_get_current_map (self, NULL);
	map = _tmp11_;
	_tmp12_ = win;
	gtk_window_set_transient_for ((GtkWindow*) _tmp12_, (GtkWindow*) self);
	_tmp13_ = win;
	g_object_set (_tmp13_, "view-name", NULL, NULL);
	_tmp15_ = map;
	if (mind_map_is_node_editable (_tmp15_)) {
		_tmp14_ = TRUE;
	} else {
		MindMap* _tmp16_;
		_tmp16_ = map;
		_tmp14_ = mind_map_is_connection_editable (_tmp16_);
	}
	if (_tmp14_) {
		GtkShortcutsWindow* _tmp17_;
		_tmp17_ = win;
		g_object_set (_tmp17_, "section-name", "editing", NULL);
	} else {
		MindMap* _tmp18_;
		_tmp18_ = map;
		if (mind_map_is_node_selected (_tmp18_)) {
			GtkShortcutsWindow* _tmp19_;
			_tmp19_ = win;
			g_object_set (_tmp19_, "section-name", "node", NULL);
		} else {
			MindMap* _tmp20_;
			_tmp20_ = map;
			if (mind_map_is_connection_selected (_tmp20_)) {
				GtkShortcutsWindow* _tmp21_;
				_tmp21_ = win;
				g_object_set (_tmp21_, "section-name", "connection", NULL);
			} else {
				MindMap* _tmp22_;
				_tmp22_ = map;
				if (mind_map_is_callout_selected (_tmp22_)) {
					GtkShortcutsWindow* _tmp23_;
					_tmp23_ = win;
					g_object_set (_tmp23_, "section-name", "callout", NULL);
				} else {
					MindMap* _tmp24_;
					_tmp24_ = map;
					if (mind_map_is_group_selected (_tmp24_)) {
						GtkShortcutsWindow* _tmp25_;
						_tmp25_ = win;
						g_object_set (_tmp25_, "section-name", "group", NULL);
					} else {
						GtkShortcutsWindow* _tmp26_;
						_tmp26_ = win;
						g_object_set (_tmp26_, "section-name", "general", NULL);
					}
				}
			}
		}
	}
	_tmp27_ = win;
	gtk_widget_show ((GtkWidget*) _tmp27_);
	_mind_map_unref0 (map);
	_g_object_unref0 (win);
	_g_object_unref0 (builder);
	_g_free0 (ui_str);
}

static void
main_window_action_next_tab (MainWindow* self)
{
	GtkNotebook* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_nb;
	gtk_notebook_next_page (_tmp0_);
}

static void
main_window_action_prev_tab (MainWindow* self)
{
	GtkNotebook* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_nb;
	gtk_notebook_prev_page (_tmp0_);
}

static void
main_window_action_about (MainWindow* self)
{
	About* about_win = NULL;
	About* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = about_new (self);
	about_win = _tmp0_;
	about_show (about_win);
	_about_unref0 (about_win);
}

void
main_window_toggle_braindump (MainWindow* self)
{
	GtkToggleButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_brain_btn;
	g_signal_emit_by_name ((GtkButton*) _tmp0_, "clicked");
}

void
main_window_toggle_focus_mode (MainWindow* self)
{
	GtkToggleButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_focus_btn;
	g_signal_emit_by_name ((GtkButton*) _tmp0_, "clicked");
}

void
main_window_show_find (MainWindow* self)
{
	GtkMenuButton* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_search_btn;
	g_signal_emit_by_name (_tmp0_, "activate");
}

static void
main_window_action_close_current_tab (MainWindow* self)
{
	g_return_if_fail (self != NULL);
	main_window_close_current_tab (self);
}

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

static 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
main_window_save_tab_state (MainWindow* self,
                            guint current_page)
{
	gchar* dir = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* fname = NULL;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	xmlDoc* doc = NULL;
	xmlDoc* _tmp5_;
	xmlNode* root = NULL;
	xmlNode* _tmp6_;
	xmlDoc* _tmp7_;
	xmlNode* _tmp8_;
	xmlNode* _tmp66_;
	gchar* _tmp67_;
	gchar* _tmp68_;
	xmlNode* _tmp69_;
	xmlDoc* _tmp70_;
	const gchar* _tmp71_;
	xmlDoc* _tmp72_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_get_user_data_dir ();
	_tmp1_ = g_build_filename (_tmp0_, "minder", NULL);
	dir = _tmp1_;
	_tmp2_ = dir;
	if (g_mkdir_with_parents (_tmp2_, 0775) != 0) {
		_g_free0 (dir);
		return;
	}
	_tmp3_ = dir;
	_tmp4_ = g_build_filename (_tmp3_, "tab_state.xml", NULL);
	fname = _tmp4_;
	_tmp5_ = xmlNewDoc ((xmlChar*) "1.0");
	doc = _tmp5_;
	_tmp6_ = xmlNewNode (NULL, (xmlChar*) "tabs");
	root = _tmp6_;
	_tmp7_ = doc;
	_tmp8_ = root;
	xmlDocSetRootElement (_tmp7_, _tmp8_);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp9_ = FALSE;
			_tmp9_ = TRUE;
			while (TRUE) {
				GtkNotebook* _tmp11_;
				MindMap* map = NULL;
				MindMap* _tmp12_;
				xmlNode* node = NULL;
				xmlNode* _tmp13_;
				xmlNode* _tmp14_;
				MindMap* _tmp15_;
				Document* _tmp16_;
				Document* _tmp17_;
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				xmlNode* _tmp20_;
				MindMap* _tmp21_;
				Document* _tmp22_;
				Document* _tmp23_;
				gchar* _tmp24_;
				gchar* _tmp25_;
				xmlNode* _tmp26_;
				MindMap* _tmp27_;
				DrawArea* _tmp28_;
				DrawArea* _tmp29_;
				gdouble _tmp30_;
				gdouble _tmp31_;
				gchar* _tmp32_;
				gchar* _tmp33_;
				xmlNode* _tmp34_;
				MindMap* _tmp35_;
				DrawArea* _tmp36_;
				DrawArea* _tmp37_;
				gdouble _tmp38_;
				gdouble _tmp39_;
				gchar* _tmp40_;
				gchar* _tmp41_;
				xmlNode* _tmp42_;
				MindMap* _tmp43_;
				DrawArea* _tmp44_;
				DrawArea* _tmp45_;
				gdouble _tmp46_;
				gdouble _tmp47_;
				gchar* _tmp48_;
				gchar* _tmp49_;
				xmlNode* _tmp50_;
				MindMap* _tmp51_;
				MapModel* _tmp52_;
				MapModel* _tmp53_;
				gboolean _tmp54_;
				gboolean _tmp55_;
				gchar* _tmp56_;
				gchar* _tmp57_;
				xmlNode* _tmp58_;
				MindMap* _tmp59_;
				gboolean _tmp60_;
				gboolean _tmp61_;
				gchar* _tmp62_;
				gchar* _tmp63_;
				xmlNode* _tmp64_;
				xmlNode* _tmp65_;
				if (!_tmp9_) {
					gint _tmp10_;
					_tmp10_ = i;
					i = _tmp10_ + 1;
				}
				_tmp9_ = FALSE;
				_tmp11_ = self->priv->_nb;
				if (!(i < gtk_notebook_get_n_pages (_tmp11_))) {
					break;
				}
				_tmp12_ = main_window_get_map (self, i);
				map = _tmp12_;
				_tmp13_ = xmlNewNode (NULL, (xmlChar*) "tab");
				node = _tmp13_;
				_tmp14_ = node;
				_tmp15_ = map;
				_tmp16_ = mind_map_get_doc (_tmp15_);
				_tmp17_ = _tmp16_;
				_tmp18_ = document_get_filename (_tmp17_);
				_tmp19_ = _tmp18_;
				xmlNewProp (_tmp14_, (xmlChar*) "path", (xmlChar*) _tmp19_);
				_tmp20_ = node;
				_tmp21_ = map;
				_tmp22_ = mind_map_get_doc (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = bool_to_string (document_is_saved (_tmp23_));
				_tmp25_ = _tmp24_;
				xmlNewProp (_tmp20_, (xmlChar*) "saved", (xmlChar*) _tmp25_);
				_g_free0 (_tmp25_);
				_tmp26_ = node;
				_tmp27_ = map;
				_tmp28_ = mind_map_get_canvas (_tmp27_);
				_tmp29_ = _tmp28_;
				_tmp30_ = draw_area_get_origin_x (_tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = double_to_string (_tmp31_);
				_tmp33_ = _tmp32_;
				xmlNewProp (_tmp26_, (xmlChar*) "origin-x", (xmlChar*) _tmp33_);
				_g_free0 (_tmp33_);
				_tmp34_ = node;
				_tmp35_ = map;
				_tmp36_ = mind_map_get_canvas (_tmp35_);
				_tmp37_ = _tmp36_;
				_tmp38_ = draw_area_get_origin_y (_tmp37_);
				_tmp39_ = _tmp38_;
				_tmp40_ = double_to_string (_tmp39_);
				_tmp41_ = _tmp40_;
				xmlNewProp (_tmp34_, (xmlChar*) "origin-y", (xmlChar*) _tmp41_);
				_g_free0 (_tmp41_);
				_tmp42_ = node;
				_tmp43_ = map;
				_tmp44_ = mind_map_get_canvas (_tmp43_);
				_tmp45_ = _tmp44_;
				_tmp46_ = draw_area_get_sfactor (_tmp45_);
				_tmp47_ = _tmp46_;
				_tmp48_ = double_to_string (_tmp47_);
				_tmp49_ = _tmp48_;
				xmlNewProp (_tmp42_, (xmlChar*) "scale", (xmlChar*) _tmp49_);
				_g_free0 (_tmp49_);
				_tmp50_ = node;
				_tmp51_ = map;
				_tmp52_ = mind_map_get_model (_tmp51_);
				_tmp53_ = _tmp52_;
				_tmp54_ = map_model_get_braindump_shown (_tmp53_);
				_tmp55_ = _tmp54_;
				_tmp56_ = bool_to_string (_tmp55_);
				_tmp57_ = _tmp56_;
				xmlNewProp (_tmp50_, (xmlChar*) "braindump", (xmlChar*) _tmp57_);
				_g_free0 (_tmp57_);
				_tmp58_ = node;
				_tmp59_ = map;
				_tmp60_ = mind_map_get_editable (_tmp59_);
				_tmp61_ = _tmp60_;
				_tmp62_ = bool_to_string (!_tmp61_);
				_tmp63_ = _tmp62_;
				xmlNewProp (_tmp58_, (xmlChar*) "readonly", (xmlChar*) _tmp63_);
				_g_free0 (_tmp63_);
				_tmp64_ = root;
				_tmp65_ = node;
				xmlAddChild (_tmp64_, _tmp65_);
				_mind_map_unref0 (map);
			}
		}
	}
	_tmp66_ = root;
	_tmp67_ = g_strdup_printf ("%u", current_page);
	_tmp68_ = _tmp67_;
	xmlNewProp (_tmp66_, (xmlChar*) "selected", (xmlChar*) _tmp68_);
	_g_free0 (_tmp68_);
	_tmp69_ = root;
	xmlNewProp (_tmp69_, (xmlChar*) "version", (xmlChar*) "2");
	_tmp70_ = doc;
	_tmp71_ = fname;
	xmlSaveFormatFile (_tmp71_, _tmp70_, 1);
	_tmp72_ = doc;
	_xmlFreeDoc0 (_tmp72_);
	_g_free0 (fname);
	_g_free0 (dir);
}

static gchar*
main_window_get_tab_state_path (MainWindow* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_get_user_data_dir ();
	_tmp1_ = g_build_filename (_tmp0_, "minder", "tab_state.xml", NULL);
	result = _tmp1_;
	return result;
}

static void
__lambda189_ (MainWindow* self)
{
	main_window_load_tab_state_xml (self);
}

static void
___lambda189__after_load_tab_func (gpointer self)
{
	__lambda189_ ((MainWindow*) self);
}

static gboolean
___lambda186_ (MainWindow* self)
{
	gboolean result;
	main_window_request_upgrade_action (self, ___lambda189__after_load_tab_func, self);
	result = FALSE;
	return result;
}

static gboolean
____lambda186__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda186_ ((MainWindow*) self);
	return result;
}

void
main_window_load_tab_state (MainWindow* self)
{
	gchar* tab_state = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	xmlDoc* doc = NULL;
	const gchar* _tmp2_;
	xmlDoc* _tmp3_;
	xmlDoc* _tmp4_;
	xmlNode* root = NULL;
	xmlDoc* _tmp5_;
	xmlNode* _tmp6_;
	gchar* version = NULL;
	xmlNode* _tmp7_;
	gchar* _tmp8_;
	xmlDoc* _tmp9_;
	const gchar* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_tab_state_path (self);
	tab_state = _tmp0_;
	_tmp1_ = tab_state;
	if (!g_file_test (_tmp1_, G_FILE_TEST_EXISTS)) {
		main_window_do_new_file (self);
		_g_free0 (tab_state);
		return;
	}
	_tmp2_ = tab_state;
	_tmp3_ = xmlParseFile (_tmp2_);
	doc = _tmp3_;
	_tmp4_ = doc;
	if (_tmp4_ == NULL) {
		main_window_do_new_file (self);
		_g_free0 (tab_state);
		return;
	}
	_tmp5_ = doc;
	_tmp6_ = xmlDocGetRootElement (_tmp5_);
	root = _tmp6_;
	_tmp7_ = root;
	_tmp8_ = (gchar*) xmlGetProp (_tmp7_, (xmlChar*) "version");
	version = _tmp8_;
	_tmp9_ = doc;
	_xmlFreeDoc0 (_tmp9_);
	_tmp10_ = version;
	if (_tmp10_ == NULL) {
		g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda186__gsource_func, g_object_ref (self), g_object_unref);
	} else {
		main_window_load_tab_state_xml (self);
	}
	_g_free0 (version);
	_g_free0 (tab_state);
}

static Block38Data*
block38_data_ref (Block38Data* _data38_)
{
	g_atomic_int_inc (&_data38_->_ref_count_);
	return _data38_;
}

static void
block38_data_unref (void * _userdata_)
{
	Block38Data* _data38_;
	_data38_ = (Block38Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data38_->_ref_count_)) {
		MainWindow* self;
		self = _data38_->self;
		_g_object_unref0 (_data38_->remember);
		_g_object_unref0 (_data38_->description);
		_g_object_unref0 (_data38_->options);
		_g_object_unref0 (_data38_->dialog);
		_g_object_unref0 (self);
		g_slice_free (Block38Data, _data38_);
	}
}

static void
__lambda187_ (Block38Data* _data38_)
{
	MainWindow* self;
	guint _tmp0_;
	guint _tmp1_;
	self = _data38_->self;
	_tmp0_ = gtk_drop_down_get_selected (_data38_->options);
	_tmp1_ = _tmp0_;
	switch (_tmp1_) {
		case 0:
		{
			gtk_label_set_label (_data38_->description, _ ("<small>Upgrades each Minder file which had a tab opened for it in the " \
"last Minder session.  This action is irreversible as older versions of" \
" Minder cannot read the upgraded format.</small>"));
			break;
		}
		case 1:
		{
			gtk_label_set_label (_data38_->description, _ ("<small>Upgrades each Minder file which had a tab opened for it in the " \
"last Minder session, but saves a copy of the older, original file in i" \
"ts original directory.</small>"));
			break;
		}
		case 2:
		{
			gtk_label_set_label (_data38_->description, _ ("<small>Leaves each Minder file in the original format, but opens each " \
"tab as read-only.  Read-only mindmaps can be viewed but cannot be chan" \
"ged.  To change a read-only mindmap, you can use the 'Save As' button " \
"in the header bar to write it to the newer format.</small>"));
			break;
		}
		default:
		break;
	}
}

static void
___lambda187__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda187_ (self);
}

static void
__lambda188_ (Block38Data* _data38_,
              gint id)
{
	MainWindow* self;
	self = _data38_->self;
	if (id == ((gint) GTK_RESPONSE_APPLY)) {
		UpgradeAction action = 0;
		guint _tmp0_;
		guint _tmp1_;
		GSettings* _tmp2_;
		GSettings* _tmp3_;
		GSettings* _tmp4_;
		GSettings* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp0_ = gtk_drop_down_get_selected (_data38_->options);
		_tmp1_ = _tmp0_;
		action = (UpgradeAction) _tmp1_;
		_tmp2_ = main_window_get_settings (self);
		_tmp3_ = _tmp2_;
		g_settings_set_int (_tmp3_, "upgrade-action", (gint) action);
		_tmp4_ = main_window_get_settings (self);
		_tmp5_ = _tmp4_;
		_tmp6_ = gtk_check_button_get_active (_data38_->remember);
		_tmp7_ = _tmp6_;
		g_settings_set_boolean (_tmp5_, "ask-for-upgrade-action", !_tmp7_);
		if (_data38_->func != NULL) {
			_data38_->func (_data38_->func_target);
		}
	} else {
		if (id == ((gint) GTK_RESPONSE_CLOSE)) {
			gtk_window_destroy ((GtkWindow*) self);
		}
	}
	g_signal_emit_by_name ((GtkDialog*) _data38_->dialog, "close");
}

static void
___lambda188__gtk_dialog_response (GtkDialog* _sender,
                                   gint response_id,
                                   gpointer self)
{
	__lambda188_ (self, response_id);
}

static void
main_window_request_upgrade_action (MainWindow* self,
                                    AfterLoadTabFunc func,
                                    gpointer func_target)
{
	Block38Data* _data38_;
	GraniteMessageDialog* _tmp0_;
	GtkButton* exit = NULL;
	GtkButton* _tmp1_;
	GtkButton* apply = NULL;
	GtkButton* _tmp2_;
	gint _tmp3_ = 0;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	GtkDropDown* _tmp6_ = NULL;
	GtkDropDown* _tmp7_;
	GtkLabel* _tmp8_ = NULL;
	GtkExpander* desc_exp = NULL;
	GtkWidget* _tmp9_;
	GtkExpander* _tmp10_ = NULL;
	GSettings* _tmp11_;
	GSettings* _tmp12_;
	GtkCheckButton* _tmp13_;
	GtkLabel* rem_description = NULL;
	GtkLabel* _tmp14_ = NULL;
	GtkLabel* rem_info = NULL;
	GtkLabel* _tmp15_ = NULL;
	GtkGrid* grid = NULL;
	GtkGrid* _tmp16_ = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp17_;
	GtkBox* _tmp18_;
	g_return_if_fail (self != NULL);
	_data38_ = g_slice_new0 (Block38Data);
	_data38_->_ref_count_ = 1;
	_data38_->self = g_object_ref (self);
	_data38_->func = func;
	_data38_->func_target = func_target;
	_tmp0_ = granite_message_dialog_new_with_image_from_icon_name (_ ("File upgrades needed"), _ ("All previously opened tabs contain Minder files that need to be upgrad" \
"ed to be edited by this version of Minder.\n" \
"\n" \
"Select an upgrade option below."), "system-software-update", GTK_BUTTONS_NONE);
	g_object_ref_sink (_tmp0_);
	_data38_->dialog = _tmp0_;
	_tmp1_ = (GtkButton*) gtk_button_new_with_label (_ ("Quit Minder"));
	g_object_ref_sink (_tmp1_);
	exit = _tmp1_;
	gtk_dialog_add_action_widget ((GtkDialog*) _data38_->dialog, (GtkWidget*) exit, (gint) GTK_RESPONSE_CLOSE);
	_tmp2_ = (GtkButton*) gtk_button_new_with_label (_ ("Apply"));
	g_object_ref_sink (_tmp2_);
	apply = _tmp2_;
	gtk_dialog_add_action_widget ((GtkDialog*) _data38_->dialog, (GtkWidget*) apply, (gint) GTK_RESPONSE_APPLY);
	_tmp4_ = upgrade_action_tab_labels (&_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _tmp3_;
	_tmp6_ = (GtkDropDown*) gtk_drop_down_new_from_strings (_tmp5_);
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	gtk_drop_down_set_selected (_tmp6_, (guint) -1);
	g_object_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_free), NULL);
	_data38_->options = _tmp7_;
	_tmp8_ = (GtkLabel*) gtk_label_new ("");
	gtk_widget_set_halign ((GtkWidget*) _tmp8_, GTK_ALIGN_FILL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp8_, TRUE);
	gtk_label_set_use_markup (_tmp8_, TRUE);
	gtk_label_set_max_width_chars (_tmp8_, 0);
	gtk_label_set_wrap (_tmp8_, TRUE);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp8_, 20);
	g_object_ref_sink (_tmp8_);
	_data38_->description = _tmp8_;
	_tmp9_ = _g_object_ref0 ((GtkWidget*) _data38_->description);
	_tmp10_ = (GtkExpander*) gtk_expander_new (_ ("Detail"));
	gtk_expander_set_child (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	gtk_expander_set_expanded (_tmp10_, FALSE);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp10_, 10);
	g_object_ref_sink (_tmp10_);
	desc_exp = _tmp10_;
	g_signal_connect_data ((GObject*) _data38_->options, "notify::selected", (GCallback) ___lambda187__g_object_notify, block38_data_ref (_data38_), (GClosureNotify) block38_data_unref, 0);
	_tmp11_ = main_window_get_settings (self);
	_tmp12_ = _tmp11_;
	gtk_drop_down_set_selected (_data38_->options, (guint) g_settings_get_int (_tmp12_, "upgrade-action"));
	_tmp13_ = (GtkCheckButton*) gtk_check_button_new ();
	g_object_ref_sink (_tmp13_);
	_data38_->remember = _tmp13_;
	_tmp14_ = (GtkLabel*) gtk_label_new (_ ("Use the selected option when future older Minder files are opened"));
	gtk_widget_set_halign ((GtkWidget*) _tmp14_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp14_);
	rem_description = _tmp14_;
	_tmp15_ = (GtkLabel*) gtk_label_new (_ ("<small>This can be changed in preferences</small>"));
	gtk_widget_set_halign ((GtkWidget*) _tmp15_, GTK_ALIGN_START);
	gtk_label_set_use_markup (_tmp15_, TRUE);
	g_object_ref_sink (_tmp15_);
	rem_info = _tmp15_;
	_tmp16_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_row_spacing (_tmp16_, 10);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp16_, 20);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp16_, 20);
	g_object_ref_sink (_tmp16_);
	grid = _tmp16_;
	gtk_grid_attach (grid, (GtkWidget*) _data38_->options, 0, 0, 2, 1);
	gtk_grid_attach (grid, (GtkWidget*) desc_exp, 0, 1, 2, 1);
	gtk_grid_attach (grid, (GtkWidget*) _data38_->remember, 0, 2, 1, 1);
	gtk_grid_attach (grid, (GtkWidget*) rem_description, 1, 2, 1, 1);
	gtk_grid_attach (grid, (GtkWidget*) rem_info, 1, 3, 1, 1);
	_tmp17_ = gtk_dialog_get_content_area ((GtkDialog*) _data38_->dialog);
	_tmp18_ = _g_object_ref0 (_tmp17_);
	box = _tmp18_;
	gtk_box_append (box, (GtkWidget*) grid);
	gtk_window_set_transient_for ((GtkWindow*) _data38_->dialog, (GtkWindow*) self);
	gtk_window_set_modal ((GtkWindow*) _data38_->dialog, TRUE);
	gtk_dialog_set_default_response ((GtkDialog*) _data38_->dialog, (gint) GTK_RESPONSE_APPLY);
	gtk_window_set_title ((GtkWindow*) _data38_->dialog, _ ("Upgrades Needed"));
	g_signal_connect_data ((GtkDialog*) _data38_->dialog, "response", (GCallback) ___lambda188__gtk_dialog_response, block38_data_ref (_data38_), (GClosureNotify) block38_data_unref, 0);
	gtk_window_present ((GtkWindow*) _data38_->dialog);
	_g_object_unref0 (box);
	_g_object_unref0 (grid);
	_g_object_unref0 (rem_info);
	_g_object_unref0 (rem_description);
	_g_object_unref0 (desc_exp);
	_g_object_unref0 (apply);
	_g_object_unref0 (exit);
	block38_data_unref (_data38_);
	_data38_ = NULL;
}

static gdouble
double_parse (const gchar* str)
{
	gdouble result;
	g_return_val_if_fail (str != NULL, -1.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;
	}
}

static void
main_window_load_tab_state_xml (MainWindow* self)
{
	xmlDoc* doc = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	xmlDoc* _tmp2_;
	xmlDoc* _tmp3_;
	xmlDoc* _tmp4_;
	xmlNode* root = NULL;
	xmlDoc* _tmp5_;
	xmlNode* _tmp6_;
	gint tabs = 0;
	gboolean tab_skipped = FALSE;
	UpgradeAction* upgrade_action = NULL;
	gboolean _tmp79_ = FALSE;
	xmlDoc* _tmp83_;
	g_return_if_fail (self != NULL);
	_tmp0_ = main_window_get_tab_state_path (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmlParseFile (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	doc = _tmp3_;
	_tmp4_ = doc;
	if (_tmp4_ == NULL) {
		return;
	}
	_tmp5_ = doc;
	_tmp6_ = xmlDocGetRootElement (_tmp5_);
	root = _tmp6_;
	tabs = 0;
	tab_skipped = FALSE;
	upgrade_action = NULL;
	{
		xmlNode* it = NULL;
		xmlNode* _tmp7_;
		xmlNode* _tmp8_;
		_tmp7_ = root;
		_tmp8_ = _tmp7_->children;
		it = _tmp8_;
		{
			gboolean _tmp9_ = FALSE;
			_tmp9_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp12_;
				gboolean _tmp13_ = FALSE;
				xmlNode* _tmp14_;
				if (!_tmp9_) {
					xmlNode* _tmp10_;
					xmlNode* _tmp11_;
					_tmp10_ = it;
					_tmp11_ = _tmp10_->next;
					it = _tmp11_;
				}
				_tmp9_ = FALSE;
				_tmp12_ = it;
				if (!(_tmp12_ != NULL)) {
					break;
				}
				_tmp14_ = it;
				if (_tmp14_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp15_;
					const gchar* _tmp16_;
					_tmp15_ = it;
					_tmp16_ = _tmp15_->name;
					_tmp13_ = g_strcmp0 (_tmp16_, "tab") == 0;
				} else {
					_tmp13_ = FALSE;
				}
				if (_tmp13_) {
					gchar* fname = NULL;
					xmlNode* _tmp17_;
					gchar* _tmp18_;
					const gchar* _tmp19_;
					_tmp17_ = it;
					_tmp18_ = (gchar*) xmlGetProp (_tmp17_, (xmlChar*) "path");
					fname = _tmp18_;
					_tmp19_ = fname;
					if (g_file_test (_tmp19_, G_FILE_TEST_EXISTS)) {
						gchar* saved = NULL;
						xmlNode* _tmp20_;
						gchar* _tmp21_;
						gchar* origin_x = NULL;
						xmlNode* _tmp22_;
						gchar* _tmp23_;
						gchar* origin_y = NULL;
						xmlNode* _tmp24_;
						gchar* _tmp25_;
						gchar* sfactor = NULL;
						xmlNode* _tmp26_;
						gchar* _tmp27_;
						gchar* braindump = NULL;
						xmlNode* _tmp28_;
						gchar* _tmp29_;
						gchar* read_only = NULL;
						xmlNode* _tmp30_;
						gchar* _tmp31_;
						MindMap* map = NULL;
						const gchar* _tmp32_;
						MindMap* _tmp33_;
						const gchar* _tmp34_;
						const gchar* _tmp39_;
						const gchar* _tmp44_;
						const gchar* _tmp54_;
						const gchar* _tmp59_;
						MindMap* _tmp62_;
						Document* _tmp63_;
						Document* _tmp64_;
						const gchar* _tmp65_;
						const gchar* _tmp66_;
						MindMap* _tmp67_;
						Document* _tmp68_;
						Document* _tmp69_;
						gint _tmp70_;
						_tmp20_ = it;
						_tmp21_ = (gchar*) xmlGetProp (_tmp20_, (xmlChar*) "saved");
						saved = _tmp21_;
						_tmp22_ = it;
						_tmp23_ = (gchar*) xmlGetProp (_tmp22_, (xmlChar*) "origin-x");
						origin_x = _tmp23_;
						_tmp24_ = it;
						_tmp25_ = (gchar*) xmlGetProp (_tmp24_, (xmlChar*) "origin-y");
						origin_y = _tmp25_;
						_tmp26_ = it;
						_tmp27_ = (gchar*) xmlGetProp (_tmp26_, (xmlChar*) "scale");
						sfactor = _tmp27_;
						_tmp28_ = it;
						_tmp29_ = (gchar*) xmlGetProp (_tmp28_, (xmlChar*) "braindump");
						braindump = _tmp29_;
						_tmp30_ = it;
						_tmp31_ = (gchar*) xmlGetProp (_tmp30_, (xmlChar*) "readonly");
						read_only = _tmp31_;
						_tmp32_ = fname;
						_tmp33_ = main_window_add_tab (self, _tmp32_, TAB_ADD_REASON_LOAD);
						map = _tmp33_;
						_tmp34_ = origin_x;
						if (_tmp34_ != NULL) {
							MindMap* _tmp35_;
							DrawArea* _tmp36_;
							DrawArea* _tmp37_;
							const gchar* _tmp38_;
							_tmp35_ = map;
							_tmp36_ = mind_map_get_canvas (_tmp35_);
							_tmp37_ = _tmp36_;
							_tmp38_ = origin_x;
							draw_area_set_origin_x (_tmp37_, (gdouble) atoi (_tmp38_));
						}
						_tmp39_ = origin_y;
						if (_tmp39_ != NULL) {
							MindMap* _tmp40_;
							DrawArea* _tmp41_;
							DrawArea* _tmp42_;
							const gchar* _tmp43_;
							_tmp40_ = map;
							_tmp41_ = mind_map_get_canvas (_tmp40_);
							_tmp42_ = _tmp41_;
							_tmp43_ = origin_y;
							draw_area_set_origin_y (_tmp42_, (gdouble) atoi (_tmp43_));
						}
						_tmp44_ = sfactor;
						if (_tmp44_ != NULL) {
							MindMap* _tmp45_;
							DrawArea* _tmp46_;
							DrawArea* _tmp47_;
							const gchar* _tmp48_;
							MindMap* _tmp49_;
							DrawArea* _tmp50_;
							DrawArea* _tmp51_;
							gdouble _tmp52_;
							gdouble _tmp53_;
							_tmp45_ = map;
							_tmp46_ = mind_map_get_canvas (_tmp45_);
							_tmp47_ = _tmp46_;
							_tmp48_ = sfactor;
							draw_area_set_sfactor (_tmp47_, double_parse (_tmp48_));
							_tmp49_ = map;
							_tmp50_ = mind_map_get_canvas (_tmp49_);
							_tmp51_ = _tmp50_;
							_tmp52_ = draw_area_get_sfactor (_tmp51_);
							_tmp53_ = _tmp52_;
							main_window_change_scale (self, _tmp53_);
						}
						_tmp54_ = braindump;
						if (_tmp54_ != NULL) {
							MindMap* _tmp55_;
							MapModel* _tmp56_;
							MapModel* _tmp57_;
							const gchar* _tmp58_;
							_tmp55_ = map;
							_tmp56_ = mind_map_get_model (_tmp55_);
							_tmp57_ = _tmp56_;
							_tmp58_ = braindump;
							map_model_set_braindump_shown (_tmp57_, bool_parse (_tmp58_));
						}
						_tmp59_ = read_only;
						if (_tmp59_ != NULL) {
							MindMap* _tmp60_;
							const gchar* _tmp61_;
							_tmp60_ = map;
							_tmp61_ = read_only;
							mind_map_set_editable (_tmp60_, !bool_parse (_tmp61_));
						}
						_tmp62_ = map;
						_tmp63_ = mind_map_get_doc (_tmp62_);
						_tmp64_ = _tmp63_;
						_tmp65_ = fname;
						_tmp66_ = saved;
						document_load_filename (_tmp64_, _tmp65_, bool_parse (_tmp66_));
						_tmp67_ = map;
						_tmp68_ = mind_map_get_doc (_tmp67_);
						_tmp69_ = _tmp68_;
						document_load (_tmp69_, UPGRADE_ACTION_READ_ONLY, NULL, NULL);
						_tmp70_ = tabs;
						tabs = _tmp70_ + 1;
						_mind_map_unref0 (map);
						_g_free0 (read_only);
						_g_free0 (braindump);
						_g_free0 (sfactor);
						_g_free0 (origin_y);
						_g_free0 (origin_x);
						_g_free0 (saved);
					} else {
						tab_skipped = TRUE;
					}
					_g_free0 (fname);
				}
			}
		}
	}
	if (tabs == 0) {
		main_window_do_new_file (self);
	} else {
		if (!tab_skipped) {
			gchar* s = NULL;
			xmlNode* _tmp71_;
			gchar* _tmp72_;
			const gchar* _tmp73_;
			_tmp71_ = root;
			_tmp72_ = (gchar*) xmlGetProp (_tmp71_, (xmlChar*) "selected");
			s = _tmp72_;
			_tmp73_ = s;
			if (_tmp73_ != NULL) {
				GtkNotebook* _tmp74_;
				const gchar* _tmp75_;
				GtkNotebook* _tmp76_;
				gint _tmp77_;
				gint _tmp78_;
				_tmp74_ = self->priv->_nb;
				_tmp75_ = s;
				g_object_set (_tmp74_, "page", atoi (_tmp75_), NULL);
				_tmp76_ = self->priv->_nb;
				g_object_get (_tmp76_, "page", &_tmp77_, NULL);
				_tmp78_ = _tmp77_;
				main_window_tab_changed (self, _tmp78_);
			}
			_g_free0 (s);
		}
	}
	if (tabs == 0) {
		_tmp79_ = TRUE;
	} else {
		_tmp79_ = tab_skipped;
	}
	if (_tmp79_) {
		GtkNotebook* _tmp80_;
		gint _tmp81_;
		gint _tmp82_;
		_tmp80_ = self->priv->_nb;
		g_object_get (_tmp80_, "page", &_tmp81_, NULL);
		_tmp82_ = _tmp81_;
		main_window_save_tab_state (self, (guint) _tmp82_);
	}
	_tmp83_ = doc;
	_xmlFreeDoc0 (_tmp83_);
	_g_free0 (upgrade_action);
}

gint
main_window_get_label_height (MainWindow* self)
{
	GtkRequisition min = {0};
	GtkRequisition nat = {0};
	GtkLabel* _tmp0_;
	GtkRequisition _tmp1_ = {0};
	GtkRequisition _tmp2_ = {0};
	GtkRequisition _tmp3_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = self->priv->_scale_lbl;
	gtk_widget_get_preferred_size ((GtkWidget*) _tmp0_, &_tmp1_, &_tmp2_);
	min = _tmp1_;
	nat = _tmp2_;
	_tmp3_ = nat;
	result = _tmp3_.height;
	return result;
}

void
main_window_notification (MainWindow* self,
                          const gchar* title,
                          const gchar* msg,
                          GNotificationPriority priority)
{
	GApplication* app = NULL;
	GApplication* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (msg != NULL);
	app = NULL;
	g_object_get ((GObject*) self, "application", &app, NULL);
	_tmp0_ = app;
	if (_tmp0_ != NULL) {
		GNotification* notification = NULL;
		GNotification* _tmp1_;
		GNotification* _tmp2_;
		GNotification* _tmp3_;
		GApplication* _tmp4_;
		GNotification* _tmp5_;
		_tmp1_ = g_notification_new (title);
		notification = _tmp1_;
		_tmp2_ = notification;
		g_notification_set_body (_tmp2_, msg);
		_tmp3_ = notification;
		g_notification_set_priority (_tmp3_, priority);
		_tmp4_ = app;
		_tmp5_ = notification;
		g_application_send_notification (_tmp4_, "com.github.phase1geo.minder", _tmp5_);
		_g_object_unref0 (notification);
	}
	_g_object_unref0 (app);
}

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_)) {
		MainWindow* self;
		self = _data39_->self;
		_g_object_unref0 (self);
		g_slice_free (Block39Data, _data39_);
	}
}

static void
___lambda127_ (Block39Data* _data39_,
               GVariant* v)
{
	MainWindow* self;
	KeyCommandFunc func = NULL;
	gpointer _tmp0_ = NULL;
	GDestroyNotify _tmp1_ = NULL;
	KeyCommandFunc _tmp2_;
	gpointer func_target;
	GDestroyNotify func_target_destroy_notify;
	MindMap* _tmp3_;
	MindMap* _tmp4_;
	self = _data39_->self;
	_tmp2_ = key_command_get_func (_data39_->command, &_tmp0_, &_tmp1_);
	func = _tmp2_;
	func_target = _tmp0_;
	func_target_destroy_notify = _tmp1_;
	_tmp3_ = main_window_get_current_map (self, NULL);
	_tmp4_ = _tmp3_;
	func (_tmp4_, FALSE, func_target);
	_mind_map_unref0 (_tmp4_);
	(func_target_destroy_notify == NULL) ? NULL : (func_target_destroy_notify (func_target), NULL);
	func = NULL;
	func_target = NULL;
	func_target_destroy_notify = NULL;
}

static void
____lambda127__g_simple_action_activate (GSimpleAction* _sender,
                                         GVariant* parameter,
                                         gpointer self)
{
	___lambda127_ (self, parameter);
}

static void
__lambda128_ (Block39Data* _data39_,
              GVariant* v)
{
	MainWindow* self;
	KeyCommandFunc func = NULL;
	gpointer _tmp0_ = NULL;
	GDestroyNotify _tmp1_ = NULL;
	KeyCommandFunc _tmp2_;
	gpointer func_target;
	GDestroyNotify func_target_destroy_notify;
	MindMap* _tmp3_;
	MindMap* _tmp4_;
	self = _data39_->self;
	_tmp2_ = key_command_get_func (_data39_->command, &_tmp0_, &_tmp1_);
	func = _tmp2_;
	func_target = _tmp0_;
	func_target_destroy_notify = _tmp1_;
	_tmp3_ = main_window_get_current_map (self, NULL);
	_tmp4_ = _tmp3_;
	func (_tmp4_, TRUE, func_target);
	_mind_map_unref0 (_tmp4_);
	(func_target_destroy_notify == NULL) ? NULL : (func_target_destroy_notify (func_target), NULL);
	func = NULL;
	func_target = NULL;
	func_target_destroy_notify = NULL;
}

static void
___lambda128__g_simple_action_activate (GSimpleAction* _sender,
                                        GVariant* parameter,
                                        gpointer self)
{
	__lambda128_ (self, parameter);
}

static void
main_window_set_action_for_command (MainWindow* self,
                                    KeyCommand command,
                                    gboolean key_only)
{
	Block39Data* _data39_;
	GSimpleAction* action = NULL;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GSimpleAction* _tmp11_;
	GSimpleAction* _tmp12_;
	GSimpleAction* _tmp13_;
	GSimpleActionGroup* _tmp14_;
	GSimpleAction* _tmp15_;
	Shortcut* shortcut = NULL;
	Shortcuts* _tmp16_;
	Shortcuts* _tmp17_;
	Shortcut* _tmp18_;
	Shortcut* _tmp19_;
	g_return_if_fail (self != NULL);
	_data39_ = g_slice_new0 (Block39Data);
	_data39_->_ref_count_ = 1;
	_data39_->self = g_object_ref (self);
	_data39_->command = command;
	if (!key_only) {
		GSimpleAction* action = NULL;
		gchar* _tmp0_;
		gchar* _tmp1_;
		GSimpleAction* _tmp2_;
		GSimpleAction* _tmp3_;
		GSimpleAction* _tmp4_;
		GSimpleActionGroup* _tmp5_;
		GSimpleAction* _tmp6_;
		_tmp0_ = key_command_to_string (_data39_->command);
		_tmp1_ = _tmp0_;
		_tmp2_ = g_simple_action_new (_tmp1_, NULL);
		_tmp3_ = _tmp2_;
		_g_free0 (_tmp1_);
		action = _tmp3_;
		_tmp4_ = action;
		g_signal_connect_data (_tmp4_, "activate", (GCallback) ____lambda127__g_simple_action_activate, block39_data_ref (_data39_), (GClosureNotify) block39_data_unref, 0);
		_tmp5_ = self->priv->_actions;
		_tmp6_ = action;
		g_action_map_add_action ((GActionMap*) _tmp5_, (GAction*) _tmp6_);
		_g_object_unref0 (action);
	}
	_tmp7_ = key_command_to_string (_data39_->command);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strconcat (_tmp8_, "_key", NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_simple_action_new (_tmp10_, NULL);
	_tmp12_ = _tmp11_;
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	action = _tmp12_;
	_tmp13_ = action;
	g_signal_connect_data (_tmp13_, "activate", (GCallback) ___lambda128__g_simple_action_activate, block39_data_ref (_data39_), (GClosureNotify) block39_data_unref, 0);
	_tmp14_ = self->priv->_actions;
	_tmp15_ = action;
	g_action_map_add_action ((GActionMap*) _tmp14_, (GAction*) _tmp15_);
	_tmp16_ = main_window_get_shortcuts (self);
	_tmp17_ = _tmp16_;
	_tmp18_ = shortcuts_get_shortcut (_tmp17_, _data39_->command);
	shortcut = _tmp18_;
	_tmp19_ = shortcut;
	if (_tmp19_ != NULL) {
		GtkApplication* _tmp20_;
		GtkApplication* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		gchar* _tmp24_;
		gchar* _tmp25_;
		Shortcut* _tmp26_;
		gchar* _tmp27_;
		gchar** _tmp28_;
		gchar** _tmp29_;
		gint _tmp29__length1;
		_tmp20_ = gtk_window_get_application ((GtkWindow*) self);
		_tmp21_ = _tmp20_;
		_tmp22_ = key_command_to_string (_data39_->command);
		_tmp23_ = _tmp22_;
		_tmp24_ = g_strdup_printf ("win.%s_key", _tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = shortcut;
		_tmp27_ = shortcut_get_accelerator (_tmp26_);
		_tmp28_ = g_new0 (gchar*, 1 + 1);
		_tmp28_[0] = _tmp27_;
		_tmp29_ = _tmp28_;
		_tmp29__length1 = 1;
		gtk_application_set_accels_for_action (_tmp21_, _tmp25_, _tmp29_);
		_tmp29_ = (_vala_array_free (_tmp29_, _tmp29__length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (_tmp25_);
		_g_free0 (_tmp23_);
	}
	_shortcut_unref0 (shortcut);
	_g_object_unref0 (action);
	block39_data_unref (_data39_);
	_data39_ = NULL;
}

static void
main_window_append_menu_item (MainWindow* self,
                              GMenu* menu,
                              KeyCommand command,
                              const gchar* label)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu != NULL);
	g_return_if_fail (label != NULL);
	_tmp0_ = key_command_to_string (command);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf ("win.%s", _tmp1_);
	_tmp3_ = _tmp2_;
	g_menu_append (menu, label, _tmp3_);
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	main_window_set_action_for_command (self, command, FALSE);
}

void
main_window_register_widget_for_tooltip (MainWindow* self,
                                         GtkWidget* w,
                                         KeyCommand command,
                                         const gchar* label)
{
	ShortcutTooltip* tooltip = NULL;
	ShortcutTooltip* _tmp0_;
	GeeHashMap* _tmp1_;
	ShortcutTooltip* _tmp2_;
	Shortcut* shortcut = NULL;
	Shortcuts* _tmp3_;
	Shortcuts* _tmp4_;
	Shortcut* _tmp5_;
	Shortcut* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (w != NULL);
	g_return_if_fail (label != NULL);
	_tmp0_ = shortcut_tooltip_new (w, label);
	tooltip = _tmp0_;
	_tmp1_ = self->priv->_shortcut_widgets;
	_tmp2_ = tooltip;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp1_, (gpointer) ((gintptr) command), _tmp2_);
	_tmp3_ = main_window_get_shortcuts (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = shortcuts_get_shortcut (_tmp4_, command);
	shortcut = _tmp5_;
	_tmp6_ = shortcut;
	if (_tmp6_ != NULL) {
		ShortcutTooltip* _tmp7_;
		Shortcut* _tmp8_;
		_tmp7_ = tooltip;
		_tmp8_ = shortcut;
		shortcut_tooltip_set_tooltip (_tmp7_, _tmp8_);
	}
	_shortcut_unref0 (shortcut);
	_shortcut_tooltip_unref0 (tooltip);
}

void
main_window_register_widget_for_shortcut (MainWindow* self,
                                          GtkWidget* w,
                                          KeyCommand command,
                                          const gchar* label)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (w != NULL);
	g_return_if_fail (label != NULL);
	main_window_register_widget_for_tooltip (self, w, command, label);
	main_window_set_action_for_command (self, command, FALSE);
}

static void
main_window_shortcut_changed (MainWindow* self,
                              KeyCommand command,
                              Shortcut* shortcut)
{
	GAction* action = NULL;
	GSimpleActionGroup* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	GAction* _tmp3_;
	GAction* _tmp4_;
	GAction* _tmp5_;
	GAction* _tmp6_;
	GeeHashMap* _tmp22_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_actions;
	_tmp1_ = key_command_to_string (command);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_action_map_lookup_action ((GActionMap*) _tmp0_, _tmp2_);
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp2_);
	action = _tmp5_;
	_tmp6_ = action;
	if (_tmp6_ != NULL) {
		gchar* detail_name = NULL;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp7_ = key_command_to_string (command);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strdup_printf ("win.%s", _tmp8_);
		_tmp10_ = _tmp9_;
		_g_free0 (_tmp8_);
		detail_name = _tmp10_;
		if (shortcut == NULL) {
			GtkApplication* _tmp11_;
			GtkApplication* _tmp12_;
			const gchar* _tmp13_;
			gchar** _tmp14_;
			gchar** _tmp15_;
			gint _tmp15__length1;
			_tmp11_ = gtk_window_get_application ((GtkWindow*) self);
			_tmp12_ = _tmp11_;
			_tmp13_ = detail_name;
			_tmp14_ = g_new0 (gchar*, 0 + 1);
			_tmp15_ = _tmp14_;
			_tmp15__length1 = 0;
			gtk_application_set_accels_for_action (_tmp12_, _tmp13_, _tmp15_);
			_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
		} else {
			GtkApplication* _tmp16_;
			GtkApplication* _tmp17_;
			const gchar* _tmp18_;
			gchar* _tmp19_;
			gchar** _tmp20_;
			gchar** _tmp21_;
			gint _tmp21__length1;
			_tmp16_ = gtk_window_get_application ((GtkWindow*) self);
			_tmp17_ = _tmp16_;
			_tmp18_ = detail_name;
			_tmp19_ = shortcut_get_accelerator (shortcut);
			_tmp20_ = g_new0 (gchar*, 1 + 1);
			_tmp20_[0] = _tmp19_;
			_tmp21_ = _tmp20_;
			_tmp21__length1 = 1;
			gtk_application_set_accels_for_action (_tmp17_, _tmp18_, _tmp21_);
			_tmp21_ = (_vala_array_free (_tmp21_, _tmp21__length1, (GDestroyNotify) g_free), NULL);
		}
		_g_free0 (detail_name);
	}
	_tmp22_ = self->priv->_shortcut_widgets;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp22_, (gpointer) ((gintptr) command))) {
		GeeHashMap* _tmp23_;
		gpointer _tmp24_;
		ShortcutTooltip* _tmp25_;
		_tmp23_ = self->priv->_shortcut_widgets;
		_tmp24_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp23_, (gpointer) ((gintptr) command));
		_tmp25_ = (ShortcutTooltip*) _tmp24_;
		shortcut_tooltip_set_tooltip (_tmp25_, shortcut);
		_shortcut_tooltip_unref0 (_tmp25_);
	}
	_g_object_unref0 (action);
}

static gchar*
main_window_get_accelerator (MainWindow* self,
                             KeyCommand command)
{
	Shortcut* shortcut = NULL;
	Shortcuts* _tmp0_;
	Shortcuts* _tmp1_;
	Shortcut* _tmp2_;
	Shortcut* _tmp3_;
	gchar* _tmp6_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = main_window_get_shortcuts (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = shortcuts_get_shortcut (_tmp1_, command);
	shortcut = _tmp2_;
	_tmp3_ = shortcut;
	if (_tmp3_ != NULL) {
		Shortcut* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = shortcut;
		_tmp5_ = shortcut_get_accelerator (_tmp4_);
		result = _tmp5_;
		_shortcut_unref0 (shortcut);
		return result;
	}
	_tmp6_ = g_strdup ("");
	result = _tmp6_;
	_shortcut_unref0 (shortcut);
	return result;
}

void
main_window_execute_command (MainWindow* self,
                             KeyCommand command)
{
	KeyCommandFunc func = NULL;
	gpointer _tmp0_ = NULL;
	GDestroyNotify _tmp1_ = NULL;
	KeyCommandFunc _tmp2_;
	gpointer func_target;
	GDestroyNotify func_target_destroy_notify;
	MindMap* _tmp3_;
	MindMap* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp2_ = key_command_get_func (command, &_tmp0_, &_tmp1_);
	func = _tmp2_;
	func_target = _tmp0_;
	func_target_destroy_notify = _tmp1_;
	_tmp3_ = main_window_get_current_map (self, NULL);
	_tmp4_ = _tmp3_;
	func (_tmp4_, FALSE, func_target);
	_mind_map_unref0 (_tmp4_);
	(func_target_destroy_notify == NULL) ? NULL : (func_target_destroy_notify (func_target), NULL);
	func = NULL;
	func_target = NULL;
	func_target_destroy_notify = NULL;
}

Themes*
main_window_get_themes (MainWindow* self)
{
	Themes* result;
	Themes* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_themes;
	result = _tmp0_;
	return result;
}

void
main_window_set_themes (MainWindow* self,
                        Themes* value)
{
	Themes* old_value;
	g_return_if_fail (self != NULL);
	old_value = main_window_get_themes (self);
	if (old_value != value) {
		Themes* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_themes);
		self->priv->_themes = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, main_window_properties[MAIN_WINDOW_THEMES_PROPERTY]);
	}
}

GSettings*
main_window_get_settings (MainWindow* self)
{
	GSettings* result;
	GSettings* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_settings;
	result = _tmp0_;
	return result;
}

gint
main_window_get_text_size (MainWindow* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_text_size;
	return result;
}

Exports*
main_window_get_exports (MainWindow* self)
{
	Exports* result;
	Exports* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_exports;
	result = _tmp0_;
	return result;
}

UnicodeInsert*
main_window_get_unicoder (MainWindow* self)
{
	UnicodeInsert* result;
	UnicodeInsert* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_unicoder;
	result = _tmp0_;
	return result;
}

Braindump*
main_window_get_braindump (MainWindow* self)
{
	Braindump* result;
	Braindump* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_brain;
	result = _tmp0_;
	return result;
}

Shortcuts*
main_window_get_shortcuts (MainWindow* self)
{
	Shortcuts* result;
	Shortcuts* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_shortcuts;
	result = _tmp0_;
	return result;
}

Templates*
main_window_get_templates (MainWindow* self)
{
	Templates* result;
	Templates* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_templates;
	result = _tmp0_;
	return result;
}

static void
g_cclosure_user_marshal_VOID__MIND_MAP (GClosure * closure,
                                        GValue * return_value,
                                        guint n_param_values,
                                        const GValue * param_values,
                                        gpointer invocation_hint,
                                        gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__MIND_MAP) (gpointer data1, gpointer arg_1, gpointer data2);
	register GMarshalFunc_VOID__MIND_MAP callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 2);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__MIND_MAP) (marshal_data ? marshal_data : cc->callback);
	callback (data1, value_get_mind_map (param_values + 1), data2);
}

static void
main_window_class_init (MainWindowClass * klass,
                        gpointer klass_data)
{
	main_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &MainWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_main_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_main_window_set_property;
	G_OBJECT_CLASS (klass)->finalize = main_window_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_THEMES_PROPERTY, main_window_properties[MAIN_WINDOW_THEMES_PROPERTY] = g_param_spec_object ("themes", "themes", "themes", TYPE_THEMES, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_SETTINGS_PROPERTY, main_window_properties[MAIN_WINDOW_SETTINGS_PROPERTY] = g_param_spec_object ("settings", "settings", "settings", g_settings_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_TEXT_SIZE_PROPERTY, main_window_properties[MAIN_WINDOW_TEXT_SIZE_PROPERTY] = g_param_spec_int ("text-size", "text-size", "text-size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_EXPORTS_PROPERTY, main_window_properties[MAIN_WINDOW_EXPORTS_PROPERTY] = param_spec_exports ("exports", "exports", "exports", TYPE_EXPORTS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_UNICODER_PROPERTY, main_window_properties[MAIN_WINDOW_UNICODER_PROPERTY] = param_spec_unicode_insert ("unicoder", "unicoder", "unicoder", TYPE_UNICODE_INSERT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_BRAINDUMP_PROPERTY, main_window_properties[MAIN_WINDOW_BRAINDUMP_PROPERTY] = g_param_spec_object ("braindump", "braindump", "braindump", TYPE_BRAINDUMP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_SHORTCUTS_PROPERTY, main_window_properties[MAIN_WINDOW_SHORTCUTS_PROPERTY] = param_spec_shortcuts ("shortcuts", "shortcuts", "shortcuts", TYPE_SHORTCUTS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAIN_WINDOW_TEMPLATES_PROPERTY, main_window_properties[MAIN_WINDOW_TEMPLATES_PROPERTY] = param_spec_templates ("templates", "templates", "templates", TYPE_TEMPLATES, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	main_window_signals[MAIN_WINDOW_CANVAS_CHANGED_SIGNAL] = g_signal_new ("canvas-changed", TYPE_MAIN_WINDOW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__MIND_MAP, G_TYPE_NONE, 1, TYPE_MIND_MAP);
}

static void
main_window_instance_init (MainWindow * self,
                           gpointer klass)
{
	Themes* _tmp0_;
	self->priv = main_window_get_instance_private (self);
	self->priv->_nb = NULL;
	self->priv->_inspector = NULL;
	self->priv->_pane = NULL;
	self->priv->_inspector_nb = NULL;
	self->priv->_stack = NULL;
	self->priv->_zoom = NULL;
	self->priv->_search = NULL;
	self->priv->_search_btn = NULL;
	self->priv->_search_entry = NULL;
	self->priv->_zoom_scale = NULL;
	self->priv->_zoom_in = NULL;
	self->priv->_zoom_out = NULL;
	self->priv->_undo_btn = NULL;
	self->priv->_redo_btn = NULL;
	self->priv->_brain_btn = NULL;
	self->priv->_focus_btn = NULL;
	self->priv->_prop_btn = NULL;
	self->priv->_debug = FALSE;
	self->priv->on_elementary = utils_on_elementary ();
	_tmp0_ = themes_new ();
	self->priv->_themes = _tmp0_;
}

static void
main_window_finalize (GObject * obj)
{
	MainWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAIN_WINDOW, MainWindow);
	_g_object_unref0 (self->priv->_settings);
	_g_object_unref0 (self->priv->_header);
	_g_object_unref0 (self->priv->_title);
	_g_object_unref0 (self->priv->_nb);
	_g_object_unref0 (self->priv->_inspector);
	_g_object_unref0 (self->priv->_pane);
	_g_object_unref0 (self->priv->_inspector_nb);
	_g_object_unref0 (self->priv->_stack);
	_g_object_unref0 (self->priv->_zoom);
	_g_object_unref0 (self->priv->_search);
	_g_object_unref0 (self->priv->_search_btn);
	_g_object_unref0 (self->priv->_search_entry);
	_g_object_unref0 (self->priv->_search_list);
	_g_object_unref0 (self->priv->_search_items);
	_g_object_unref0 (self->priv->_search_scroll);
	_g_object_unref0 (self->priv->_search_nodes);
	_g_object_unref0 (self->priv->_search_connections);
	_g_object_unref0 (self->priv->_search_callouts);
	_g_object_unref0 (self->priv->_search_groups);
	_g_object_unref0 (self->priv->_search_titles);
	_g_object_unref0 (self->priv->_search_notes);
	_g_object_unref0 (self->priv->_search_folded);
	_g_object_unref0 (self->priv->_search_unfolded);
	_g_object_unref0 (self->priv->_search_tasks);
	_g_object_unref0 (self->priv->_search_nontasks);
	_g_object_unref0 (self->priv->_search_all_tabs);
	_g_object_unref0 (self->priv->_exporter);
	_g_object_unref0 (self->priv->_zoom_btn);
	_g_object_unref0 (self->priv->_zoom_scale);
	_g_object_unref0 (self->priv->_zoom_in);
	_g_object_unref0 (self->priv->_zoom_out);
	_g_object_unref0 (self->priv->_undo_btn);
	_g_object_unref0 (self->priv->_redo_btn);
	_g_object_unref0 (self->priv->_brain_btn);
	_g_object_unref0 (self->priv->_focus_btn);
	_g_object_unref0 (self->priv->_prop_btn);
	_g_free0 (self->priv->_prop_show);
	_g_free0 (self->priv->_prop_hide);
	_g_object_unref0 (self->priv->_themer);
	_g_object_unref0 (self->priv->_scale_lbl);
	_exports_unref0 (self->priv->_exports);
	_unicode_insert_unref0 (self->priv->_unicoder);
	_g_object_unref0 (self->priv->_brain);
	_shortcuts_unref0 (self->priv->_shortcuts);
	_g_object_unref0 (self->priv->_actions);
	_g_object_unref0 (self->priv->_shortcut_widgets);
	_templates_unref0 (self->priv->_templates);
	_g_object_unref0 (self->priv->_themes);
	G_OBJECT_CLASS (main_window_parent_class)->finalize (obj);
}

static GType
main_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MainWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) main_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MainWindow), 0, (GInstanceInitFunc) main_window_instance_init, NULL };
	GType main_window_type_id;
	main_window_type_id = g_type_register_static (gtk_application_window_get_type (), "MainWindow", &g_define_type_info, 0);
	MainWindow_private_offset = g_type_add_instance_private (main_window_type_id, sizeof (MainWindowPrivate));
	return main_window_type_id;
}

GType
main_window_get_type (void)
{
	static volatile gsize main_window_type_id__once = 0;
	if (g_once_init_enter (&main_window_type_id__once)) {
		GType main_window_type_id;
		main_window_type_id = main_window_get_type_once ();
		g_once_init_leave (&main_window_type_id__once, main_window_type_id);
	}
	return main_window_type_id__once;
}

static void
_vala_main_window_get_property (GObject * object,
                                guint property_id,
                                GValue * value,
                                GParamSpec * pspec)
{
	MainWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MAIN_WINDOW, MainWindow);
	switch (property_id) {
		case MAIN_WINDOW_THEMES_PROPERTY:
		g_value_set_object (value, main_window_get_themes (self));
		break;
		case MAIN_WINDOW_SETTINGS_PROPERTY:
		g_value_set_object (value, main_window_get_settings (self));
		break;
		case MAIN_WINDOW_TEXT_SIZE_PROPERTY:
		g_value_set_int (value, main_window_get_text_size (self));
		break;
		case MAIN_WINDOW_EXPORTS_PROPERTY:
		value_set_exports (value, main_window_get_exports (self));
		break;
		case MAIN_WINDOW_UNICODER_PROPERTY:
		value_set_unicode_insert (value, main_window_get_unicoder (self));
		break;
		case MAIN_WINDOW_BRAINDUMP_PROPERTY:
		g_value_set_object (value, main_window_get_braindump (self));
		break;
		case MAIN_WINDOW_SHORTCUTS_PROPERTY:
		value_set_shortcuts (value, main_window_get_shortcuts (self));
		break;
		case MAIN_WINDOW_TEMPLATES_PROPERTY:
		value_set_templates (value, main_window_get_templates (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_main_window_set_property (GObject * object,
                                guint property_id,
                                const GValue * value,
                                GParamSpec * pspec)
{
	MainWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_MAIN_WINDOW, MainWindow);
	switch (property_id) {
		case MAIN_WINDOW_THEMES_PROPERTY:
		main_window_set_themes (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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

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

