/* MapInspector.c generated by valac 0.56.19, the Vala compiler
 * generated from MapInspector.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 <gtk/gtk.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <float.h>
#include <math.h>

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

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

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

#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_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;
enum  {
	MAP_INSPECTOR_0_PROPERTY,
	MAP_INSPECTOR_NUM_PROPERTIES
};
static GParamSpec* map_inspector_properties[MAP_INSPECTOR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _mind_map_unref0(var) ((var == NULL) ? NULL : (var = (mind_map_unref (var), NULL)))

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

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

#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_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 TYPE_CONNECTIONS (connections_get_type ())
#define CONNECTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONNECTIONS, Connections))
#define CONNECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONNECTIONS, ConnectionsClass))
#define IS_CONNECTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONNECTIONS))
#define IS_CONNECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONNECTIONS))
#define CONNECTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONNECTIONS, ConnectionsClass))

typedef struct _Connections Connections;
typedef struct _ConnectionsClass ConnectionsClass;

#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 _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_SELECTION (selection_get_type ())
#define SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SELECTION, Selection))
#define SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SELECTION, SelectionClass))
#define IS_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SELECTION))
#define IS_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SELECTION))
#define SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SELECTION, SelectionClass))

typedef struct _Selection Selection;
typedef struct _SelectionClass SelectionClass;

#define TYPE_LAYOUTS (layouts_get_type ())
#define LAYOUTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LAYOUTS, Layouts))
#define LAYOUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LAYOUTS, LayoutsClass))
#define IS_LAYOUTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LAYOUTS))
#define IS_LAYOUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LAYOUTS))
#define LAYOUTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LAYOUTS, LayoutsClass))

typedef struct _Layouts Layouts;
typedef struct _LayoutsClass LayoutsClass;
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))

#define TYPE_LAYOUT (layout_get_type ())
#define LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LAYOUT, Layout))
#define LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LAYOUT, LayoutClass))
#define IS_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LAYOUT))
#define IS_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LAYOUT))
#define LAYOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LAYOUT, LayoutClass))

typedef struct _Layout Layout;
typedef struct _LayoutClass LayoutClass;

#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;
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 ())
typedef struct _Block40Data Block40Data;
typedef struct _Block41Data Block41Data;
enum  {
	MAP_INSPECTOR_UPDATE_ICONS_SIGNAL,
	MAP_INSPECTOR_EDITABLE_CHANGED_SIGNAL,
	MAP_INSPECTOR_NUM_SIGNALS
};
static guint map_inspector_signals[MAP_INSPECTOR_NUM_SIGNALS] = {0};

struct _MapInspector {
	GtkBox parent_instance;
	MapInspectorPrivate * priv;
};

struct _MapInspectorClass {
	GtkBoxClass parent_class;
};

struct _MapInspectorPrivate {
	MainWindow* _win;
	MindMap* _map;
	GSettings* _settings;
	ModeButtons* _layout;
	GtkGrid* _theme_grid;
	GtkButton* _add_theme;
	GtkButton* _balance;
	GtkButton* _fold_completed;
	GtkButton* _unfold_all;
	GtkSwitch* _read_only;
	GtkSwitch* _hide_connections;
	GtkSwitch* _hide_callouts;
	GtkButton* _hleft;
	GtkButton* _hcenter;
	GtkButton* _hright;
	GtkButton* _vtop;
	GtkButton* _vcenter;
	GtkButton* _vbottom;
	GtkRevealer* _alignment_revealer;
	GtkLinkButton* _map_dir;
};

struct _Block40Data {
	int _ref_count_;
	MapInspector* self;
	GtkGrid* grid;
};

struct _Block41Data {
	int _ref_count_;
	MapInspector* self;
	gchar* name;
	Theme* theme;
};

static gint MapInspector_private_offset;
static gpointer map_inspector_parent_class = NULL;

VALA_EXTERN GType map_inspector_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MapInspector, g_object_unref)
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
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 GType mode_buttons_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ModeButtons, 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);
static void map_inspector_add_readonly_ui (MapInspector* self);
static void map_inspector_add_connection_ui (MapInspector* self);
static void map_inspector_add_callout_ui (MapInspector* self);
static void map_inspector_add_layout_ui (MapInspector* self);
static void map_inspector_add_alignment_ui (MapInspector* self);
static void map_inspector_add_theme_ui (MapInspector* self);
static void map_inspector_add_dir_ui (MapInspector* self);
static void map_inspector_add_button_ui (MapInspector* self);
static void map_inspector_tab_changed (MapInspector* self,
                                MindMap* map);
static void _map_inspector_tab_changed_main_window_canvas_changed (MainWindow* _sender,
                                                            MindMap* map,
                                                            gpointer self);
VALA_EXTERN GType themes_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Themes, g_object_unref)
VALA_EXTERN Themes* main_window_get_themes (MainWindow* self);
static void map_inspector_update_themes (MapInspector* self);
static void _map_inspector_update_themes_themes_themes_changed (Themes* _sender,
                                                         gpointer self);
static void __lambda171_ (MapInspector* self);
static void map_inspector_current_changed (MapInspector* self);
VALA_EXTERN gboolean mind_map_get_editable (MindMap* self);
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_get_read_only (Document* self);
static void ___lambda171__map_inspector_editable_changed (MapInspector* _sender,
                                                   gpointer self);
static void map_inspector_update_theme_layout (MapInspector* self);
static void _map_inspector_update_theme_layout_mind_map_loaded (MindMap* _sender,
                                                         gpointer self);
static void _map_inspector_current_changed_mind_map_current_changed (MindMap* _sender,
                                                              MindMap* map,
                                                              gpointer self);
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 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 gpointer connections_ref (gpointer instance);
VALA_EXTERN void connections_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_connections (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_connections (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_connections (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_connections (const GValue* value);
VALA_EXTERN GType connections_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Connections, connections_unref)
VALA_EXTERN Connections* map_model_get_connections (MapModel* self);
VALA_EXTERN gboolean connections_get_hide (Connections* self);
VALA_EXTERN gboolean map_model_get_hide_callouts (MapModel* self);
VALA_EXTERN GType theme_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Theme, g_object_unref)
VALA_EXTERN void map_model_set_theme (MapModel* self,
                          Theme* theme,
                          gboolean save);
VALA_EXTERN Theme* mind_map_get_theme (MindMap* self);
VALA_EXTERN const gchar* document_get_temp_dir (Document* self);
static void map_inspector_read_only_changed (MapInspector* self);
static void _map_inspector_read_only_changed_g_object_notify (GObject* _sender,
                                                       GParamSpec* pspec,
                                                       gpointer self);
VALA_EXTERN void mind_map_set_editable (MindMap* self,
                            gboolean value);
static void map_inspector_hide_connections_changed (MapInspector* self);
static void _map_inspector_hide_connections_changed_g_object_notify (GObject* _sender,
                                                              GParamSpec* pspec,
                                                              gpointer self);
VALA_EXTERN gpointer selection_ref (gpointer instance);
VALA_EXTERN void selection_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_selection (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_selection (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_selection (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_selection (const GValue* value);
VALA_EXTERN GType selection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Selection, selection_unref)
VALA_EXTERN Selection* mind_map_get_selected (MindMap* self);
VALA_EXTERN gboolean selection_clear_connections (Selection* self,
                                      gboolean signal_change,
                                      gdouble alpha);
VALA_EXTERN Connections* mind_map_get_connections (MindMap* self);
VALA_EXTERN void connections_set_hide (Connections* self,
                           gboolean value);
VALA_EXTERN void mind_map_queue_draw (MindMap* self);
static void map_inspector_hide_callouts_changed (MapInspector* self);
static void _map_inspector_hide_callouts_changed_g_object_notify (GObject* _sender,
                                                           GParamSpec* pspec,
                                                           gpointer self);
VALA_EXTERN gboolean selection_clear_callouts (Selection* self,
                                   gboolean signal_change,
                                   gdouble alpha);
VALA_EXTERN void map_model_set_hide_callouts (MapModel* self,
                                  gboolean value);
VALA_EXTERN GType layouts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Layouts, g_object_unref)
VALA_EXTERN Layouts* layouts_new (void);
VALA_EXTERN Layouts* layouts_construct (GType object_type);
static void _g_free0_ (gpointer var);
static void _vala_gchar_free_function_content_of (gpointer data);
VALA_EXTERN void layouts_get_icons (Layouts* self,
                        GArray** light_icons,
                        GArray** dark_icons);
VALA_EXTERN void layouts_get_names (Layouts* self,
                        GArray** names);
VALA_EXTERN ModeButtons* mode_buttons_new (void);
VALA_EXTERN ModeButtons* mode_buttons_construct (GType object_type);
static void map_inspector_set_layout (MapInspector* self,
                               gint index);
static void _map_inspector_set_layout_mode_buttons_changed (ModeButtons* _sender,
                                                     gint index,
                                                     gpointer self);
static void __lambda155_ (MapInspector* self);
static void ___lambda155__map_inspector_update_icons (MapInspector* _sender,
                                               gpointer self);
VALA_EXTERN void mode_buttons_add_button (ModeButtons* self,
                              const gchar* light_icon_name,
                              const gchar* dark_icon_name,
                              const gchar* tooltip);
VALA_EXTERN Layouts* mind_map_get_layouts (MindMap* self);
VALA_EXTERN GType layout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Layout, g_object_unref)
VALA_EXTERN Layout* layouts_get_layout (Layouts* self,
                            const gchar* name);
VALA_EXTERN GType node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Node, g_object_unref)
VALA_EXTERN Node* mind_map_get_current_node (MindMap* self);
VALA_EXTERN Node* node_get_root (Node* self);
VALA_EXTERN void map_model_set_layout (MapModel* self,
                           const gchar* name,
                           Node* root_node,
                           gboolean undoable);
VALA_EXTERN gboolean layout_get_balanceable (Layout* self);
VALA_EXTERN GType key_command_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void main_window_register_widget_for_tooltip (MainWindow* self,
                                              GtkWidget* w,
                                              KeyCommand command,
                                              const gchar* label);
static void __lambda156_ (MapInspector* self);
VALA_EXTERN void main_window_execute_command (MainWindow* self,
                                  KeyCommand command);
static void ___lambda156__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda157_ (MapInspector* self);
static void ___lambda157__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda158_ (MapInspector* self);
static void ___lambda158__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda159_ (MapInspector* self);
static void ___lambda159__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda160_ (MapInspector* self);
static void ___lambda160__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda161_ (MapInspector* self);
static void ___lambda161__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void map_inspector_update_node_alignment (MapInspector* self);
VALA_EXTERN gboolean map_model_nodes_alignable (MapModel* self);
static void map_inspector_create_custom_theme (MapInspector* self);
static void _map_inspector_create_custom_theme_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self);
static void __lambda166_ (MapInspector* self,
                   const gchar* key);
static void ___lambda166__g_settings_changed (GSettings* _sender,
                                       const gchar* key,
                                       gpointer self);
static Block40Data* block40_data_ref (Block40Data* _data40_);
static void block40_data_unref (void * _userdata_);
VALA_EXTERN void main_window_register_widget_for_shortcut (MainWindow* self,
                                               GtkWidget* w,
                                               KeyCommand command,
                                               const gchar* label);
static void __lambda167_ (MapInspector* self);
static void ___lambda167__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda168_ (MapInspector* self);
static void ___lambda168__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda169_ (MapInspector* self);
static void ___lambda169__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda170_ (Block40Data* _data40_);
VALA_EXTERN gboolean utils_use_dark_mode (GtkWidget* w);
static void ___lambda170__map_inspector_update_icons (MapInspector* _sender,
                                               gpointer self);
static void _g_object_unref0_ (gpointer var);
static void _vala_GtkPicture_free_function_content_of (gpointer data);
VALA_EXTERN void themes_names (Themes* self,
                   GArray** names);
VALA_EXTERN void themes_icons (Themes* self,
                   GArray** icons);
static Block41Data* block41_data_ref (Block41Data* _data41_);
static void block41_data_unref (void * _userdata_);
VALA_EXTERN Theme* themes_get_theme (Themes* self,
                         const gchar* name);
static gchar* map_inspector_theme_label (MapInspector* self,
                                  const gchar* name);
static void _____lambda162_ (Block41Data* _data41_,
                      gint n_press,
                      gdouble x,
                      gdouble y);
static void map_inspector_select_theme (MapInspector* self,
                                 const gchar* name);
VALA_EXTERN gboolean theme_get_custom (Theme* self);
static void map_inspector_edit_theme (MapInspector* self,
                               Theme* theme);
static void ______lambda162__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                 gint n_press,
                                                 gdouble x,
                                                 gdouble y,
                                                 gpointer self);
VALA_EXTERN const gchar* theme_get_name (Theme* self);
static void map_inspector_select_layout (MapInspector* self,
                                  const gchar* name);
VALA_EXTERN void mode_buttons_set_selected (ModeButtons* self,
                                gint value);
VALA_EXTERN const gchar* theme_get_label (Theme* self);
VALA_EXTERN GtkWidget* utils_get_child_at_index (GtkWidget* parent,
                                     gint index);
VALA_EXTERN void main_window_show_theme_editor (MainWindow* self,
                                    Theme* theme);
VALA_EXTERN gboolean map_model_completed_tasks_foldable (MapModel* self);
VALA_EXTERN gboolean map_model_unfoldable (MapModel* self);
VALA_EXTERN Layout* node_get_layout (Node* self);
VALA_EXTERN const gchar* layout_get_name (Layout* self);
VALA_EXTERN GArray* mind_map_get_nodes (MindMap* self);
VALA_EXTERN Layout* layouts_get_default (Layouts* self);
VALA_EXTERN void map_inspector_grab_first (MapInspector* self);
static void map_inspector_finalize (GObject * obj);
static GType map_inspector_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
map_inspector_get_instance_private (MapInspector* self)
{
	return G_STRUCT_MEMBER_P (self, MapInspector_private_offset);
}

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

static void
_map_inspector_tab_changed_main_window_canvas_changed (MainWindow* _sender,
                                                       MindMap* map,
                                                       gpointer self)
{
	map_inspector_tab_changed ((MapInspector*) self, map);
}

static void
_map_inspector_update_themes_themes_themes_changed (Themes* _sender,
                                                    gpointer self)
{
	map_inspector_update_themes ((MapInspector*) self);
}

static void
__lambda171_ (MapInspector* self)
{
	ModeButtons* _tmp0_;
	MindMap* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	GtkButton* _tmp4_;
	MindMap* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	GtkSwitch* _tmp8_;
	MindMap* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GtkSwitch* _tmp12_;
	MindMap* _tmp13_;
	Document* _tmp14_;
	Document* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	map_inspector_current_changed (self);
	_tmp0_ = self->priv->_layout;
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_editable (_tmp1_);
	_tmp3_ = _tmp2_;
	g_signal_emit_by_name (_tmp0_, "editable-changed", _tmp3_);
	_tmp4_ = self->priv->_add_theme;
	_tmp5_ = self->priv->_map;
	_tmp6_ = mind_map_get_editable (_tmp5_);
	_tmp7_ = _tmp6_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, _tmp7_);
	_tmp8_ = self->priv->_read_only;
	_tmp9_ = self->priv->_map;
	_tmp10_ = mind_map_get_editable (_tmp9_);
	_tmp11_ = _tmp10_;
	gtk_switch_set_active (_tmp8_, !_tmp11_);
	_tmp12_ = self->priv->_read_only;
	_tmp13_ = self->priv->_map;
	_tmp14_ = mind_map_get_doc (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = document_get_read_only (_tmp15_);
	_tmp17_ = _tmp16_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp12_, !_tmp17_);
}

static void
___lambda171__map_inspector_editable_changed (MapInspector* _sender,
                                              gpointer self)
{
	__lambda171_ ((MapInspector*) self);
}

MapInspector*
map_inspector_construct (GType object_type,
                         MainWindow* win,
                         GSettings* settings)
{
	MapInspector * self = NULL;
	MainWindow* _tmp0_;
	GSettings* _tmp1_;
	Themes* _tmp2_;
	Themes* _tmp3_;
	g_return_val_if_fail (win != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	self = (MapInspector*) g_object_new (object_type, "orientation", GTK_ORIENTATION_VERTICAL, "spacing", 10, NULL);
	_tmp0_ = _g_object_ref0 (win);
	_g_object_unref0 (self->priv->_win);
	self->priv->_win = _tmp0_;
	_tmp1_ = _g_object_ref0 (settings);
	_g_object_unref0 (self->priv->_settings);
	self->priv->_settings = _tmp1_;
	map_inspector_add_readonly_ui (self);
	map_inspector_add_connection_ui (self);
	map_inspector_add_callout_ui (self);
	map_inspector_add_layout_ui (self);
	map_inspector_add_alignment_ui (self);
	map_inspector_add_theme_ui (self);
	map_inspector_add_dir_ui (self);
	map_inspector_add_button_ui (self);
	g_signal_connect_object (win, "canvas-changed", (GCallback) _map_inspector_tab_changed_main_window_canvas_changed, self, 0);
	_tmp2_ = main_window_get_themes (win);
	_tmp3_ = _tmp2_;
	g_signal_connect_object (_tmp3_, "themes-changed", (GCallback) _map_inspector_update_themes_themes_themes_changed, self, 0);
	g_signal_connect_object (self, "editable-changed", (GCallback) ___lambda171__map_inspector_editable_changed, self, 0);
	return self;
}

MapInspector*
map_inspector_new (MainWindow* win,
                   GSettings* settings)
{
	return map_inspector_construct (TYPE_MAP_INSPECTOR, win, settings);
}

static void
_map_inspector_update_theme_layout_mind_map_loaded (MindMap* _sender,
                                                    gpointer self)
{
	map_inspector_update_theme_layout ((MapInspector*) self);
}

static void
_map_inspector_current_changed_mind_map_current_changed (MindMap* _sender,
                                                         MindMap* map,
                                                         gpointer self)
{
	map_inspector_current_changed ((MapInspector*) self);
}

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

static void
map_inspector_tab_changed (MapInspector* self,
                           MindMap* map)
{
	MindMap* _tmp0_;
	MindMap* _tmp5_;
	MindMap* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	if (_tmp0_ != NULL) {
		MindMap* _tmp1_;
		guint _tmp2_;
		MindMap* _tmp3_;
		guint _tmp4_;
		_tmp1_ = self->priv->_map;
		g_signal_parse_name ("loaded", TYPE_MIND_MAP, &_tmp2_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _map_inspector_update_theme_layout_mind_map_loaded, self);
		_tmp3_ = self->priv->_map;
		g_signal_parse_name ("current-changed", TYPE_MIND_MAP, &_tmp4_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _map_inspector_current_changed_mind_map_current_changed, self);
	}
	if (map != NULL) {
		g_signal_connect_object (map, "loaded", (GCallback) _map_inspector_update_theme_layout_mind_map_loaded, self, 0);
		g_signal_connect_object (map, "current-changed", (GCallback) _map_inspector_current_changed_mind_map_current_changed, self, 0);
	}
	_tmp5_ = _mind_map_ref0 (map);
	_mind_map_unref0 (self->priv->_map);
	self->priv->_map = _tmp5_;
	_tmp6_ = self->priv->_map;
	if (_tmp6_ != NULL) {
		MindMap* _tmp7_;
		Animator* _tmp8_;
		Animator* _tmp9_;
		GSettings* _tmp10_;
		GtkSwitch* _tmp11_;
		MindMap* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		GtkSwitch* _tmp15_;
		MindMap* _tmp16_;
		Document* _tmp17_;
		Document* _tmp18_;
		gboolean _tmp19_;
		gboolean _tmp20_;
		GtkSwitch* _tmp21_;
		MindMap* _tmp22_;
		MapModel* _tmp23_;
		MapModel* _tmp24_;
		Connections* _tmp25_;
		Connections* _tmp26_;
		gboolean _tmp27_;
		gboolean _tmp28_;
		GtkSwitch* _tmp29_;
		MindMap* _tmp30_;
		MapModel* _tmp31_;
		MapModel* _tmp32_;
		gboolean _tmp33_;
		gboolean _tmp34_;
		MindMap* _tmp35_;
		MapModel* _tmp36_;
		MapModel* _tmp37_;
		MindMap* _tmp38_;
		Theme* _tmp39_;
		Theme* _tmp40_;
		GtkLinkButton* _tmp41_;
		MindMap* _tmp42_;
		Document* _tmp43_;
		Document* _tmp44_;
		const gchar* _tmp45_;
		const gchar* _tmp46_;
		gchar* _tmp47_;
		gchar* _tmp48_;
		GtkLinkButton* _tmp49_;
		MindMap* _tmp50_;
		Document* _tmp51_;
		Document* _tmp52_;
		const gchar* _tmp53_;
		const gchar* _tmp54_;
		gchar* _tmp55_;
		gchar* _tmp56_;
		_tmp7_ = self->priv->_map;
		_tmp8_ = mind_map_get_animator (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = self->priv->_settings;
		animator_set_enable (_tmp9_, g_settings_get_boolean (_tmp10_, "enable-animations"));
		_tmp11_ = self->priv->_read_only;
		_tmp12_ = self->priv->_map;
		_tmp13_ = mind_map_get_editable (_tmp12_);
		_tmp14_ = _tmp13_;
		gtk_switch_set_active (_tmp11_, !_tmp14_);
		_tmp15_ = self->priv->_read_only;
		_tmp16_ = self->priv->_map;
		_tmp17_ = mind_map_get_doc (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = document_get_read_only (_tmp18_);
		_tmp20_ = _tmp19_;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp15_, !_tmp20_);
		_tmp21_ = self->priv->_hide_connections;
		_tmp22_ = self->priv->_map;
		_tmp23_ = mind_map_get_model (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = map_model_get_connections (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = connections_get_hide (_tmp26_);
		_tmp28_ = _tmp27_;
		gtk_switch_set_active (_tmp21_, _tmp28_);
		_tmp29_ = self->priv->_hide_callouts;
		_tmp30_ = self->priv->_map;
		_tmp31_ = mind_map_get_model (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = map_model_get_hide_callouts (_tmp32_);
		_tmp34_ = _tmp33_;
		gtk_switch_set_active (_tmp29_, _tmp34_);
		_tmp35_ = self->priv->_map;
		_tmp36_ = mind_map_get_model (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp38_ = self->priv->_map;
		_tmp39_ = mind_map_get_theme (_tmp38_);
		_tmp40_ = _tmp39_;
		map_model_set_theme (_tmp37_, _tmp40_, FALSE);
		_g_object_unref0 (_tmp40_);
		_tmp41_ = self->priv->_map_dir;
		_tmp42_ = self->priv->_map;
		_tmp43_ = mind_map_get_doc (_tmp42_);
		_tmp44_ = _tmp43_;
		_tmp45_ = document_get_temp_dir (_tmp44_);
		_tmp46_ = _tmp45_;
		_tmp47_ = g_path_get_basename (_tmp46_);
		_tmp48_ = _tmp47_;
		gtk_button_set_label ((GtkButton*) _tmp41_, _tmp48_);
		_g_free0 (_tmp48_);
		_tmp49_ = self->priv->_map_dir;
		_tmp50_ = self->priv->_map;
		_tmp51_ = mind_map_get_doc (_tmp50_);
		_tmp52_ = _tmp51_;
		_tmp53_ = document_get_temp_dir (_tmp52_);
		_tmp54_ = _tmp53_;
		_tmp55_ = g_strconcat ("file://", _tmp54_, NULL);
		_tmp56_ = _tmp55_;
		gtk_link_button_set_uri (_tmp49_, _tmp56_);
		_g_free0 (_tmp56_);
	}
	map_inspector_update_theme_layout (self);
}

static void
_map_inspector_read_only_changed_g_object_notify (GObject* _sender,
                                                  GParamSpec* pspec,
                                                  gpointer self)
{
	map_inspector_read_only_changed ((MapInspector*) self);
}

static void
map_inspector_add_readonly_ui (MapInspector* self)
{
	GtkLabel* lbl = NULL;
	GtkLabel* _tmp0_ = NULL;
	GtkSwitch* _tmp1_ = NULL;
	GtkSwitch* _tmp2_;
	GtkBox* box = NULL;
	GtkBox* _tmp3_ = NULL;
	GtkSwitch* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (_ ("Read-only"));
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_label_set_xalign (_tmp0_, (gfloat) 0);
	g_object_ref_sink (_tmp0_);
	lbl = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) lbl, "titled");
	_tmp1_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	gtk_switch_set_active (_tmp1_, FALSE);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_read_only);
	self->priv->_read_only = _tmp1_;
	_tmp2_ = self->priv->_read_only;
	g_signal_connect_object ((GObject*) _tmp2_, "notify::active", (GCallback) _map_inspector_read_only_changed_g_object_notify, self, 0);
	_tmp3_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_FILL);
	g_object_ref_sink (_tmp3_);
	box = _tmp3_;
	gtk_box_append (box, (GtkWidget*) lbl);
	_tmp4_ = self->priv->_read_only;
	gtk_box_append (box, (GtkWidget*) _tmp4_);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) box);
	_g_object_unref0 (box);
	_g_object_unref0 (lbl);
}

static void
map_inspector_read_only_changed (MapInspector* self)
{
	MindMap* _tmp0_;
	Document* _tmp1_;
	Document* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_doc (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = document_get_read_only (_tmp2_);
	_tmp4_ = _tmp3_;
	if (!_tmp4_) {
		MindMap* _tmp5_;
		GtkSwitch* _tmp6_;
		gboolean _tmp7_;
		gboolean _tmp8_;
		_tmp5_ = self->priv->_map;
		_tmp6_ = self->priv->_read_only;
		_tmp7_ = gtk_switch_get_active (_tmp6_);
		_tmp8_ = _tmp7_;
		mind_map_set_editable (_tmp5_, !_tmp8_);
	}
}

static void
_map_inspector_hide_connections_changed_g_object_notify (GObject* _sender,
                                                         GParamSpec* pspec,
                                                         gpointer self)
{
	map_inspector_hide_connections_changed ((MapInspector*) self);
}

static void
map_inspector_add_connection_ui (MapInspector* self)
{
	GtkLabel* lbl = NULL;
	GtkLabel* _tmp0_ = NULL;
	GtkSwitch* _tmp1_ = NULL;
	GtkSwitch* _tmp2_;
	GtkBox* box = NULL;
	GtkBox* _tmp3_ = NULL;
	GtkSwitch* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (_ ("Hide connections"));
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_label_set_xalign (_tmp0_, (gfloat) 0);
	g_object_ref_sink (_tmp0_);
	lbl = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) lbl, "titled");
	_tmp1_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	gtk_switch_set_active (_tmp1_, FALSE);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_hide_connections);
	self->priv->_hide_connections = _tmp1_;
	_tmp2_ = self->priv->_hide_connections;
	g_signal_connect_object ((GObject*) _tmp2_, "notify::active", (GCallback) _map_inspector_hide_connections_changed_g_object_notify, self, 0);
	_tmp3_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_FILL);
	g_object_ref_sink (_tmp3_);
	box = _tmp3_;
	gtk_box_append (box, (GtkWidget*) lbl);
	_tmp4_ = self->priv->_hide_connections;
	gtk_box_append (box, (GtkWidget*) _tmp4_);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) box);
	_g_object_unref0 (box);
	_g_object_unref0 (lbl);
}

static void
map_inspector_hide_connections_changed (MapInspector* self)
{
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	MindMap* _tmp3_;
	Connections* _tmp4_;
	Connections* _tmp5_;
	MindMap* _tmp6_;
	Connections* _tmp7_;
	Connections* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	MindMap* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	selection_clear_connections (_tmp2_, TRUE, 1.0);
	_tmp3_ = self->priv->_map;
	_tmp4_ = mind_map_get_connections (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->_map;
	_tmp7_ = mind_map_get_connections (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = connections_get_hide (_tmp8_);
	_tmp10_ = _tmp9_;
	connections_set_hide (_tmp5_, !_tmp10_);
	_tmp11_ = self->priv->_map;
	mind_map_queue_draw (_tmp11_);
}

static void
_map_inspector_hide_callouts_changed_g_object_notify (GObject* _sender,
                                                      GParamSpec* pspec,
                                                      gpointer self)
{
	map_inspector_hide_callouts_changed ((MapInspector*) self);
}

static void
map_inspector_add_callout_ui (MapInspector* self)
{
	GtkLabel* lbl = NULL;
	GtkLabel* _tmp0_ = NULL;
	GtkSwitch* _tmp1_ = NULL;
	GtkSwitch* _tmp2_;
	GtkBox* box = NULL;
	GtkBox* _tmp3_ = NULL;
	GtkSwitch* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (_ ("Hide callouts"));
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp0_, TRUE);
	gtk_label_set_xalign (_tmp0_, (gfloat) 0);
	g_object_ref_sink (_tmp0_);
	lbl = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) lbl, "titled");
	_tmp1_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp1_, GTK_ALIGN_END);
	gtk_switch_set_active (_tmp1_, FALSE);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_hide_callouts);
	self->priv->_hide_callouts = _tmp1_;
	_tmp2_ = self->priv->_hide_callouts;
	g_signal_connect_object ((GObject*) _tmp2_, "notify::active", (GCallback) _map_inspector_hide_callouts_changed_g_object_notify, self, 0);
	_tmp3_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_FILL);
	g_object_ref_sink (_tmp3_);
	box = _tmp3_;
	gtk_box_append (box, (GtkWidget*) lbl);
	_tmp4_ = self->priv->_hide_callouts;
	gtk_box_append (box, (GtkWidget*) _tmp4_);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) box);
	_g_object_unref0 (box);
	_g_object_unref0 (lbl);
}

static void
map_inspector_hide_callouts_changed (MapInspector* self)
{
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	MindMap* _tmp3_;
	MapModel* _tmp4_;
	MapModel* _tmp5_;
	MindMap* _tmp6_;
	MapModel* _tmp7_;
	MapModel* _tmp8_;
	gboolean _tmp9_;
	gboolean _tmp10_;
	MindMap* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	selection_clear_callouts (_tmp2_, TRUE, 1.0);
	_tmp3_ = self->priv->_map;
	_tmp4_ = mind_map_get_model (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->_map;
	_tmp7_ = mind_map_get_model (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = map_model_get_hide_callouts (_tmp8_);
	_tmp10_ = _tmp9_;
	map_model_set_hide_callouts (_tmp5_, !_tmp10_);
	_tmp11_ = self->priv->_map;
	mind_map_queue_draw (_tmp11_);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static void
_vala_gchar_free_function_content_of (gpointer data)
{
	gchar* self;
	self = *((gchar**) data);
	_g_free0_ (self);
}

static void
_map_inspector_set_layout_mode_buttons_changed (ModeButtons* _sender,
                                                gint index,
                                                gpointer self)
{
	map_inspector_set_layout ((MapInspector*) self, index);
}

static void
__lambda155_ (MapInspector* self)
{
	ModeButtons* _tmp0_;
	_tmp0_ = self->priv->_layout;
	g_signal_emit_by_name (_tmp0_, "update-icons");
}

static void
___lambda155__map_inspector_update_icons (MapInspector* _sender,
                                          gpointer self)
{
	__lambda155_ ((MapInspector*) self);
}

static void
map_inspector_add_layout_ui (MapInspector* self)
{
	Layouts* layouts = NULL;
	Layouts* _tmp0_;
	GArray* light_icons = NULL;
	GArray* _tmp1_;
	GArray* dark_icons = NULL;
	GArray* _tmp2_;
	GArray* names = NULL;
	GArray* _tmp3_;
	Layouts* _tmp4_;
	Layouts* _tmp5_;
	GtkLabel* lbl = NULL;
	GtkLabel* _tmp6_ = NULL;
	GtkLabel* _tmp7_;
	ModeButtons* _tmp8_ = NULL;
	ModeButtons* _tmp9_;
	GtkBox* box = NULL;
	GtkBox* _tmp20_ = NULL;
	GtkLabel* _tmp21_;
	ModeButtons* _tmp22_;
	g_return_if_fail (self != NULL);
	_tmp0_ = layouts_new ();
	layouts = _tmp0_;
	_tmp1_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp1_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	light_icons = _tmp1_;
	_tmp2_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp2_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	dark_icons = _tmp2_;
	_tmp3_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp3_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	names = _tmp3_;
	_tmp4_ = layouts;
	layouts_get_icons (_tmp4_, &light_icons, &dark_icons);
	_tmp5_ = layouts;
	layouts_get_names (_tmp5_, &names);
	_tmp6_ = (GtkLabel*) gtk_label_new (_ ("Node Layouts"));
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp6_, TRUE);
	gtk_label_set_xalign (_tmp6_, (gfloat) 0);
	g_object_ref_sink (_tmp6_);
	lbl = _tmp6_;
	_tmp7_ = lbl;
	gtk_widget_add_css_class ((GtkWidget*) _tmp7_, "titled");
	_tmp8_ = mode_buttons_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp8_, GTK_ALIGN_END);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->_layout);
	self->priv->_layout = _tmp8_;
	_tmp9_ = self->priv->_layout;
	g_signal_connect_object (_tmp9_, "changed", (GCallback) _map_inspector_set_layout_mode_buttons_changed, self, 0);
	g_signal_connect_object (self, "update-icons", (GCallback) ___lambda155__map_inspector_update_icons, self, 0);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp10_ = FALSE;
			_tmp10_ = TRUE;
			while (TRUE) {
				GArray* _tmp12_;
				ModeButtons* _tmp13_;
				GArray* _tmp14_;
				const gchar* _tmp15_;
				GArray* _tmp16_;
				const gchar* _tmp17_;
				GArray* _tmp18_;
				const gchar* _tmp19_;
				if (!_tmp10_) {
					gint _tmp11_;
					_tmp11_ = i;
					i = _tmp11_ + 1;
				}
				_tmp10_ = FALSE;
				_tmp12_ = names;
				if (!(((guint) i) < _tmp12_->len)) {
					break;
				}
				_tmp13_ = self->priv->_layout;
				_tmp14_ = light_icons;
				_tmp15_ = g_array_index (_tmp14_, gchar*, (guint) i);
				_tmp16_ = dark_icons;
				_tmp17_ = g_array_index (_tmp16_, gchar*, (guint) i);
				_tmp18_ = names;
				_tmp19_ = g_array_index (_tmp18_, gchar*, (guint) i);
				mode_buttons_add_button (_tmp13_, _tmp15_, _tmp17_, _tmp19_);
			}
		}
	}
	_tmp20_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
	gtk_widget_set_halign ((GtkWidget*) _tmp20_, GTK_ALIGN_FILL);
	g_object_ref_sink (_tmp20_);
	box = _tmp20_;
	_tmp21_ = lbl;
	gtk_box_append (box, (GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->_layout;
	gtk_box_append (box, (GtkWidget*) _tmp22_);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) box);
	_g_object_unref0 (box);
	_g_object_unref0 (lbl);
	_g_array_unref0 (names);
	_g_array_unref0 (dark_icons);
	_g_array_unref0 (light_icons);
	_g_object_unref0 (layouts);
}

static void
map_inspector_set_layout (MapInspector* self,
                          gint index)
{
	GArray* names = NULL;
	GArray* _tmp0_;
	MindMap* _tmp1_;
	Layouts* _tmp2_;
	Layouts* _tmp3_;
	GArray* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp0_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	names = _tmp0_;
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_layouts (_tmp1_);
	_tmp3_ = _tmp2_;
	layouts_get_names (_tmp3_, &names);
	_tmp4_ = names;
	if (((guint) index) < _tmp4_->len) {
		gchar* name = NULL;
		GArray* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		Layout* layout = NULL;
		MindMap* _tmp8_;
		Layouts* _tmp9_;
		Layouts* _tmp10_;
		const gchar* _tmp11_;
		Layout* _tmp12_;
		Node* node = NULL;
		MindMap* _tmp13_;
		Node* _tmp14_;
		Node* _tmp15_ = NULL;
		Node* _tmp16_;
		MindMap* _tmp19_;
		MapModel* _tmp20_;
		MapModel* _tmp21_;
		const gchar* _tmp22_;
		GtkButton* _tmp23_;
		Layout* _tmp24_;
		gboolean _tmp25_;
		gboolean _tmp26_;
		GtkRevealer* _tmp27_;
		const gchar* _tmp28_;
		_tmp5_ = names;
		_tmp6_ = g_array_index (_tmp5_, gchar*, (guint) index);
		_tmp7_ = g_strdup (_tmp6_);
		name = _tmp7_;
		_tmp8_ = self->priv->_map;
		_tmp9_ = mind_map_get_layouts (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = name;
		_tmp12_ = layouts_get_layout (_tmp10_, _tmp11_);
		layout = _tmp12_;
		_tmp13_ = self->priv->_map;
		_tmp14_ = mind_map_get_current_node (_tmp13_);
		node = _tmp14_;
		_tmp16_ = node;
		if (_tmp16_ == NULL) {
			_g_object_unref0 (_tmp15_);
			_tmp15_ = NULL;
		} else {
			Node* _tmp17_;
			Node* _tmp18_;
			_tmp17_ = node;
			_tmp18_ = node_get_root (_tmp17_);
			_g_object_unref0 (_tmp15_);
			_tmp15_ = _tmp18_;
		}
		_tmp19_ = self->priv->_map;
		_tmp20_ = mind_map_get_model (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = name;
		map_model_set_layout (_tmp21_, _tmp22_, _tmp15_, TRUE);
		_tmp23_ = self->priv->_balance;
		_tmp24_ = layout;
		_tmp25_ = layout_get_balanceable (_tmp24_);
		_tmp26_ = _tmp25_;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp23_, _tmp26_);
		_tmp27_ = self->priv->_alignment_revealer;
		_tmp28_ = name;
		gtk_revealer_set_reveal_child (_tmp27_, g_strcmp0 (_tmp28_, _ ("Manual")) == 0);
		_g_object_unref0 (_tmp15_);
		_g_object_unref0 (node);
		_g_object_unref0 (layout);
		_g_free0 (name);
	}
	_g_array_unref0 (names);
}

static void
__lambda156_ (MapInspector* self)
{
	MainWindow* _tmp0_;
	_tmp0_ = self->priv->_win;
	main_window_execute_command (_tmp0_, KEY_COMMAND_NODE_ALIGN_LEFT);
}

static void
___lambda156__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda156_ ((MapInspector*) self);
}

static void
__lambda157_ (MapInspector* self)
{
	MainWindow* _tmp0_;
	_tmp0_ = self->priv->_win;
	main_window_execute_command (_tmp0_, KEY_COMMAND_NODE_ALIGN_HCENTER);
}

static void
___lambda157__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda157_ ((MapInspector*) self);
}

static void
__lambda158_ (MapInspector* self)
{
	MainWindow* _tmp0_;
	_tmp0_ = self->priv->_win;
	main_window_execute_command (_tmp0_, KEY_COMMAND_NODE_ALIGN_RIGHT);
}

static void
___lambda158__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda158_ ((MapInspector*) self);
}

static void
__lambda159_ (MapInspector* self)
{
	MainWindow* _tmp0_;
	_tmp0_ = self->priv->_win;
	main_window_execute_command (_tmp0_, KEY_COMMAND_NODE_ALIGN_TOP);
}

static void
___lambda159__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda159_ ((MapInspector*) self);
}

static void
__lambda160_ (MapInspector* self)
{
	MainWindow* _tmp0_;
	_tmp0_ = self->priv->_win;
	main_window_execute_command (_tmp0_, KEY_COMMAND_NODE_ALIGN_VCENTER);
}

static void
___lambda160__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda160_ ((MapInspector*) self);
}

static void
__lambda161_ (MapInspector* self)
{
	MainWindow* _tmp0_;
	_tmp0_ = self->priv->_win;
	main_window_execute_command (_tmp0_, KEY_COMMAND_NODE_ALIGN_BOTTOM);
}

static void
___lambda161__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda161_ ((MapInspector*) self);
}

static void
map_inspector_add_alignment_ui (MapInspector* self)
{
	GtkLabel* lbl = NULL;
	GtkLabel* _tmp0_ = NULL;
	GtkButton* _tmp1_;
	MainWindow* _tmp2_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	MainWindow* _tmp6_;
	GtkButton* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	MainWindow* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	MainWindow* _tmp14_;
	GtkButton* _tmp15_;
	GtkButton* _tmp16_;
	GtkButton* _tmp17_;
	MainWindow* _tmp18_;
	GtkButton* _tmp19_;
	GtkButton* _tmp20_;
	GtkButton* _tmp21_;
	MainWindow* _tmp22_;
	GtkButton* _tmp23_;
	GtkButton* _tmp24_;
	GtkBox* toolbar = NULL;
	GtkBox* _tmp25_;
	GtkButton* _tmp26_;
	GtkButton* _tmp27_;
	GtkButton* _tmp28_;
	GtkButton* _tmp29_;
	GtkButton* _tmp30_;
	GtkButton* _tmp31_;
	GtkBox* box = NULL;
	GtkBox* _tmp32_ = NULL;
	GtkWidget* _tmp33_;
	GtkRevealer* _tmp34_ = NULL;
	GtkRevealer* _tmp35_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (_ ("Node Alignment"));
	gtk_label_set_xalign (_tmp0_, (gfloat) 0);
	g_object_ref_sink (_tmp0_);
	lbl = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) lbl, "titled");
	_tmp1_ = (GtkButton*) gtk_button_new_from_icon_name ("align-horizontal-left-symbolic");
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_hleft);
	self->priv->_hleft = _tmp1_;
	_tmp2_ = self->priv->_win;
	_tmp3_ = self->priv->_hleft;
	main_window_register_widget_for_tooltip (_tmp2_, (GtkWidget*) _tmp3_, KEY_COMMAND_NODE_ALIGN_LEFT, _ ("Align left edges"));
	_tmp4_ = self->priv->_hleft;
	g_signal_connect_object (_tmp4_, "clicked", (GCallback) ___lambda156__gtk_button_clicked, self, 0);
	_tmp5_ = (GtkButton*) gtk_button_new_from_icon_name ("align-horizontal-center-symbolic");
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->_hcenter);
	self->priv->_hcenter = _tmp5_;
	_tmp6_ = self->priv->_win;
	_tmp7_ = self->priv->_hcenter;
	main_window_register_widget_for_tooltip (_tmp6_, (GtkWidget*) _tmp7_, KEY_COMMAND_NODE_ALIGN_HCENTER, _ ("Align horizontal centers"));
	_tmp8_ = self->priv->_hcenter;
	g_signal_connect_object (_tmp8_, "clicked", (GCallback) ___lambda157__gtk_button_clicked, self, 0);
	_tmp9_ = (GtkButton*) gtk_button_new_from_icon_name ("align-horizontal-right-symbolic");
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->_hright);
	self->priv->_hright = _tmp9_;
	_tmp10_ = self->priv->_win;
	_tmp11_ = self->priv->_hright;
	main_window_register_widget_for_tooltip (_tmp10_, (GtkWidget*) _tmp11_, KEY_COMMAND_NODE_ALIGN_RIGHT, _ ("Align right edges"));
	_tmp12_ = self->priv->_hright;
	g_signal_connect_object (_tmp12_, "clicked", (GCallback) ___lambda158__gtk_button_clicked, self, 0);
	_tmp13_ = (GtkButton*) gtk_button_new_from_icon_name ("align-vertical-top-symbolic");
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->_vtop);
	self->priv->_vtop = _tmp13_;
	_tmp14_ = self->priv->_win;
	_tmp15_ = self->priv->_vtop;
	main_window_register_widget_for_tooltip (_tmp14_, (GtkWidget*) _tmp15_, KEY_COMMAND_NODE_ALIGN_TOP, _ ("Align top edges"));
	_tmp16_ = self->priv->_vtop;
	g_signal_connect_object (_tmp16_, "clicked", (GCallback) ___lambda159__gtk_button_clicked, self, 0);
	_tmp17_ = (GtkButton*) gtk_button_new_from_icon_name ("align-vertical-center-symbolic");
	g_object_ref_sink (_tmp17_);
	_g_object_unref0 (self->priv->_vcenter);
	self->priv->_vcenter = _tmp17_;
	_tmp18_ = self->priv->_win;
	_tmp19_ = self->priv->_vcenter;
	main_window_register_widget_for_tooltip (_tmp18_, (GtkWidget*) _tmp19_, KEY_COMMAND_NODE_ALIGN_VCENTER, _ ("Align vertical centers"));
	_tmp20_ = self->priv->_vcenter;
	g_signal_connect_object (_tmp20_, "clicked", (GCallback) ___lambda160__gtk_button_clicked, self, 0);
	_tmp21_ = (GtkButton*) gtk_button_new_from_icon_name ("align-vertical-bottom-symbolic");
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->_vbottom);
	self->priv->_vbottom = _tmp21_;
	_tmp22_ = self->priv->_win;
	_tmp23_ = self->priv->_vbottom;
	main_window_register_widget_for_tooltip (_tmp22_, (GtkWidget*) _tmp23_, KEY_COMMAND_NODE_ALIGN_BOTTOM, _ ("Align bottom edges"));
	_tmp24_ = self->priv->_vbottom;
	g_signal_connect_object (_tmp24_, "clicked", (GCallback) ___lambda161__gtk_button_clicked, self, 0);
	_tmp25_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5);
	g_object_ref_sink (_tmp25_);
	toolbar = _tmp25_;
	_tmp26_ = self->priv->_hleft;
	gtk_box_append (toolbar, (GtkWidget*) _tmp26_);
	_tmp27_ = self->priv->_hcenter;
	gtk_box_append (toolbar, (GtkWidget*) _tmp27_);
	_tmp28_ = self->priv->_hright;
	gtk_box_append (toolbar, (GtkWidget*) _tmp28_);
	_tmp29_ = self->priv->_vtop;
	gtk_box_append (toolbar, (GtkWidget*) _tmp29_);
	_tmp30_ = self->priv->_vcenter;
	gtk_box_append (toolbar, (GtkWidget*) _tmp30_);
	_tmp31_ = self->priv->_vbottom;
	gtk_box_append (toolbar, (GtkWidget*) _tmp31_);
	_tmp32_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
	gtk_widget_set_halign ((GtkWidget*) _tmp32_, GTK_ALIGN_FILL);
	g_object_ref_sink (_tmp32_);
	box = _tmp32_;
	gtk_box_append (box, (GtkWidget*) lbl);
	gtk_box_append (box, (GtkWidget*) toolbar);
	_tmp33_ = _g_object_ref0 ((GtkWidget*) box);
	_tmp34_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp34_, _tmp33_);
	_g_object_unref0 (_tmp33_);
	g_object_ref_sink (_tmp34_);
	_g_object_unref0 (self->priv->_alignment_revealer);
	self->priv->_alignment_revealer = _tmp34_;
	_tmp35_ = self->priv->_alignment_revealer;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp35_);
	_g_object_unref0 (box);
	_g_object_unref0 (toolbar);
	_g_object_unref0 (lbl);
}

static void
map_inspector_update_node_alignment (MapInspector* self)
{
	gboolean _tmp0_ = FALSE;
	MindMap* _tmp1_;
	MapModel* _tmp2_;
	MapModel* _tmp3_;
	gboolean enable_alignment = FALSE;
	GtkButton* _tmp7_;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* _tmp10_;
	GtkButton* _tmp11_;
	GtkButton* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_model (_tmp1_);
	_tmp3_ = _tmp2_;
	if (map_model_nodes_alignable (_tmp3_)) {
		MindMap* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_editable (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = _tmp6_;
	} else {
		_tmp0_ = FALSE;
	}
	enable_alignment = _tmp0_;
	_tmp7_ = self->priv->_hleft;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp7_, enable_alignment);
	_tmp8_ = self->priv->_hcenter;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp8_, enable_alignment);
	_tmp9_ = self->priv->_hright;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, enable_alignment);
	_tmp10_ = self->priv->_vtop;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp10_, enable_alignment);
	_tmp11_ = self->priv->_vcenter;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp11_, enable_alignment);
	_tmp12_ = self->priv->_vbottom;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp12_, enable_alignment);
}

static void
_map_inspector_create_custom_theme_gtk_button_clicked (GtkButton* _sender,
                                                       gpointer self)
{
	map_inspector_create_custom_theme ((MapInspector*) self);
}

static void
map_inspector_add_theme_ui (MapInspector* self)
{
	GtkLabel* lbl = NULL;
	GtkLabel* _tmp0_ = NULL;
	GtkGrid* _tmp1_ = NULL;
	GtkBox* tb = NULL;
	GtkBox* _tmp2_;
	GtkGrid* _tmp3_;
	GtkScrolledWindow* sw = NULL;
	GtkWidget* _tmp4_;
	GtkScrolledWindow* _tmp5_ = NULL;
	gchar* _tmp6_;
	GtkButton* _tmp7_ = NULL;
	GtkButton* _tmp8_;
	GtkButton* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkLabel*) gtk_label_new (_ ("Themes"));
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_FILL);
	gtk_label_set_xalign (_tmp0_, (gfloat) 0);
	g_object_ref_sink (_tmp0_);
	lbl = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) lbl, "titled");
	_tmp1_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_homogeneous (_tmp1_, TRUE);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->_theme_grid);
	self->priv->_theme_grid = _tmp1_;
	_tmp2_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp2_);
	tb = _tmp2_;
	_tmp3_ = self->priv->_theme_grid;
	gtk_box_append (tb, (GtkWidget*) _tmp3_);
	_tmp4_ = _g_object_ref0 ((GtkWidget*) tb);
	_tmp5_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp5_, GTK_ALIGN_FILL);
	gtk_widget_set_valign ((GtkWidget*) _tmp5_, GTK_ALIGN_FILL);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp5_, TRUE);
	gtk_scrolled_window_set_child (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	sw = _tmp5_;
	map_inspector_update_themes (self);
	_tmp6_ = g_strdup (_ ("Add Custom Theme"));
	_tmp7_ = (GtkButton*) gtk_button_new_from_icon_name ("list-add-symbolic");
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_END);
	gtk_button_set_has_frame (_tmp7_, FALSE);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp7_, _tmp6_);
	_g_free0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->_add_theme);
	self->priv->_add_theme = _tmp7_;
	_tmp8_ = self->priv->_add_theme;
	g_signal_connect_object (_tmp8_, "clicked", (GCallback) _map_inspector_create_custom_theme_gtk_button_clicked, self, 0);
	_tmp9_ = self->priv->_add_theme;
	gtk_box_append (tb, (GtkWidget*) _tmp9_);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) lbl);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) sw);
	_g_object_unref0 (sw);
	_g_object_unref0 (tb);
	_g_object_unref0 (lbl);
}

static void
__lambda166_ (MapInspector* self,
              const gchar* key)
{
	g_return_if_fail (key != NULL);
	if (g_strcmp0 (key, "show-temp-dir-in-map-sidebar") == 0) {
		GtkLinkButton* _tmp0_;
		GSettings* _tmp1_;
		_tmp0_ = self->priv->_map_dir;
		_tmp1_ = self->priv->_settings;
		gtk_widget_set_visible ((GtkWidget*) _tmp0_, g_settings_get_boolean (_tmp1_, key));
	}
}

static void
___lambda166__g_settings_changed (GSettings* _sender,
                                  const gchar* key,
                                  gpointer self)
{
	__lambda166_ ((MapInspector*) self, key);
}

static void
map_inspector_add_dir_ui (MapInspector* self)
{
	GSettings* _tmp0_;
	gchar* _tmp1_;
	GtkLinkButton* _tmp2_ = NULL;
	GSettings* _tmp3_;
	GtkLinkButton* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_settings;
	_tmp1_ = g_strdup (_ ("Copy location of temporary directory"));
	_tmp2_ = (GtkLinkButton*) gtk_link_button_new ("");
	gtk_widget_set_halign ((GtkWidget*) _tmp2_, GTK_ALIGN_CENTER);
	gtk_widget_set_visible ((GtkWidget*) _tmp2_, g_settings_get_boolean (_tmp0_, "show-temp-dir-in-map-sidebar"));
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp2_, _tmp1_);
	_g_free0 (_tmp1_);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->_map_dir);
	self->priv->_map_dir = _tmp2_;
	_tmp3_ = self->priv->_settings;
	g_signal_connect_object (_tmp3_, "changed", (GCallback) ___lambda166__g_settings_changed, self, 0);
	_tmp4_ = self->priv->_map_dir;
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _tmp4_);
}

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

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

static void
__lambda167_ (MapInspector* self)
{
	MainWindow* _tmp0_;
	_tmp0_ = self->priv->_win;
	main_window_execute_command (_tmp0_, KEY_COMMAND_BALANCE_NODES);
}

static void
___lambda167__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda167_ ((MapInspector*) self);
}

static void
__lambda168_ (MapInspector* self)
{
	MainWindow* _tmp0_;
	_tmp0_ = self->priv->_win;
	main_window_execute_command (_tmp0_, KEY_COMMAND_FOLD_COMPLETED_TASKS);
}

static void
___lambda168__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda168_ ((MapInspector*) self);
}

static void
__lambda169_ (MapInspector* self)
{
	MainWindow* _tmp0_;
	_tmp0_ = self->priv->_win;
	main_window_execute_command (_tmp0_, KEY_COMMAND_UNFOLD_ALL_NODES);
}

static void
___lambda169__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda169_ ((MapInspector*) self);
}

static void
__lambda170_ (Block40Data* _data40_)
{
	MapInspector* self;
	gboolean dark = FALSE;
	const gchar* _tmp0_ = NULL;
	GtkButton* _tmp1_;
	const gchar* _tmp2_ = NULL;
	GtkButton* _tmp3_;
	const gchar* _tmp4_ = NULL;
	GtkButton* _tmp5_;
	self = _data40_->self;
	dark = utils_use_dark_mode ((GtkWidget*) _data40_->grid);
	if (dark) {
		_tmp0_ = "minder-balance-dark-symbolic";
	} else {
		_tmp0_ = "minder-balance-light-symbolic";
	}
	_tmp1_ = self->priv->_balance;
	gtk_button_set_icon_name (_tmp1_, _tmp0_);
	if (dark) {
		_tmp2_ = "minder-fold-completed-dark-symbolic";
	} else {
		_tmp2_ = "minder-fold-completed-light-symbolic";
	}
	_tmp3_ = self->priv->_fold_completed;
	gtk_button_set_icon_name (_tmp3_, _tmp2_);
	if (dark) {
		_tmp4_ = "minder-unfold-dark-symbolic";
	} else {
		_tmp4_ = "minder-unfold-light-symbolic";
	}
	_tmp5_ = self->priv->_unfold_all;
	gtk_button_set_icon_name (_tmp5_, _tmp4_);
}

static void
___lambda170__map_inspector_update_icons (MapInspector* _sender,
                                          gpointer self)
{
	__lambda170_ (self);
}

static void
map_inspector_add_button_ui (MapInspector* self)
{
	Block40Data* _data40_;
	GtkGrid* _tmp0_ = NULL;
	gchar* _tmp1_;
	GtkButton* _tmp2_ = NULL;
	MainWindow* _tmp3_;
	GtkButton* _tmp4_;
	GtkButton* _tmp5_;
	gchar* _tmp6_;
	GtkButton* _tmp7_ = NULL;
	MainWindow* _tmp8_;
	GtkButton* _tmp9_;
	GtkButton* _tmp10_;
	gchar* _tmp11_;
	GtkButton* _tmp12_ = NULL;
	MainWindow* _tmp13_;
	GtkButton* _tmp14_;
	GtkButton* _tmp15_;
	GtkButton* _tmp16_;
	GtkButton* _tmp17_;
	GtkButton* _tmp18_;
	g_return_if_fail (self != NULL);
	_data40_ = g_slice_new0 (Block40Data);
	_data40_->_ref_count_ = 1;
	_data40_->self = g_object_ref (self);
	_tmp0_ = (GtkGrid*) gtk_grid_new ();
	gtk_widget_set_halign ((GtkWidget*) _tmp0_, GTK_ALIGN_FILL);
	gtk_grid_set_column_homogeneous (_tmp0_, TRUE);
	gtk_grid_set_column_spacing (_tmp0_, 5);
	gtk_grid_set_row_spacing (_tmp0_, 5);
	g_object_ref_sink (_tmp0_);
	_data40_->grid = _tmp0_;
	_tmp1_ = g_strdup (_ ("Balance nodes"));
	_tmp2_ = (GtkButton*) gtk_button_new_from_icon_name ("minder-balance-light-symbolic");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp2_, _tmp1_);
	_g_free0 (_tmp1_);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->_balance);
	self->priv->_balance = _tmp2_;
	_tmp3_ = self->priv->_win;
	_tmp4_ = self->priv->_balance;
	main_window_register_widget_for_shortcut (_tmp3_, (GtkWidget*) _tmp4_, KEY_COMMAND_BALANCE_NODES, _ ("Balance Nodes"));
	_tmp5_ = self->priv->_balance;
	g_signal_connect_object (_tmp5_, "clicked", (GCallback) ___lambda167__gtk_button_clicked, self, 0);
	_tmp6_ = g_strdup (_ ("Fold nodes with completed tasks"));
	_tmp7_ = (GtkButton*) gtk_button_new_from_icon_name ("minder-fold-completed-light-symbolic");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp7_, _tmp6_);
	_g_free0 (_tmp6_);
	g_object_ref_sink (_tmp7_);
	_g_object_unref0 (self->priv->_fold_completed);
	self->priv->_fold_completed = _tmp7_;
	_tmp8_ = self->priv->_win;
	_tmp9_ = self->priv->_fold_completed;
	main_window_register_widget_for_shortcut (_tmp8_, (GtkWidget*) _tmp9_, KEY_COMMAND_FOLD_COMPLETED_TASKS, _ ("Fold Completed Tasks"));
	_tmp10_ = self->priv->_fold_completed;
	g_signal_connect_object (_tmp10_, "clicked", (GCallback) ___lambda168__gtk_button_clicked, self, 0);
	_tmp11_ = g_strdup (_ ("Unfold all nodes"));
	_tmp12_ = (GtkButton*) gtk_button_new_from_icon_name ("minder-unfold-light-symbolic");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp12_, _tmp11_);
	_g_free0 (_tmp11_);
	g_object_ref_sink (_tmp12_);
	_g_object_unref0 (self->priv->_unfold_all);
	self->priv->_unfold_all = _tmp12_;
	_tmp13_ = self->priv->_win;
	_tmp14_ = self->priv->_unfold_all;
	main_window_register_widget_for_shortcut (_tmp13_, (GtkWidget*) _tmp14_, KEY_COMMAND_UNFOLD_ALL_NODES, _ ("Unfold All Nodes"));
	_tmp15_ = self->priv->_unfold_all;
	g_signal_connect_object (_tmp15_, "clicked", (GCallback) ___lambda169__gtk_button_clicked, self, 0);
	g_signal_connect_data (self, "update-icons", (GCallback) ___lambda170__map_inspector_update_icons, block40_data_ref (_data40_), (GClosureNotify) block40_data_unref, 0);
	_tmp16_ = self->priv->_balance;
	gtk_grid_attach (_data40_->grid, (GtkWidget*) _tmp16_, 0, 0, 1, 1);
	_tmp17_ = self->priv->_fold_completed;
	gtk_grid_attach (_data40_->grid, (GtkWidget*) _tmp17_, 1, 0, 1, 1);
	_tmp18_ = self->priv->_unfold_all;
	gtk_grid_attach (_data40_->grid, (GtkWidget*) _tmp18_, 2, 0, 1, 1);
	gtk_box_append ((GtkBox*) self, (GtkWidget*) _data40_->grid);
	block40_data_unref (_data40_);
	_data40_ = NULL;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static void
_vala_GtkPicture_free_function_content_of (gpointer data)
{
	GtkPicture* self;
	self = *((GtkPicture**) data);
	_g_object_unref0_ (self);
}

static Block41Data*
block41_data_ref (Block41Data* _data41_)
{
	g_atomic_int_inc (&_data41_->_ref_count_);
	return _data41_;
}

static void
block41_data_unref (void * _userdata_)
{
	Block41Data* _data41_;
	_data41_ = (Block41Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data41_->_ref_count_)) {
		MapInspector* self;
		self = _data41_->self;
		_g_object_unref0 (_data41_->theme);
		_g_free0 (_data41_->name);
		_g_object_unref0 (self);
		g_slice_free (Block41Data, _data41_);
	}
}

static void
_____lambda162_ (Block41Data* _data41_,
                 gint n_press,
                 gdouble x,
                 gdouble y)
{
	MapInspector* self;
	MindMap* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data41_->self;
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_editable (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		const gchar* _tmp3_;
		MindMap* _tmp4_;
		MapModel* _tmp5_;
		MapModel* _tmp6_;
		Theme* _tmp7_;
		gboolean _tmp8_ = FALSE;
		Theme* _tmp9_;
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp3_ = _data41_->name;
		map_inspector_select_theme (self, _tmp3_);
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_model (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = _data41_->theme;
		map_model_set_theme (_tmp6_, _tmp7_, TRUE);
		_tmp9_ = _data41_->theme;
		_tmp10_ = theme_get_custom (_tmp9_);
		_tmp11_ = _tmp10_;
		if (_tmp11_) {
			_tmp8_ = n_press == 2;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			Theme* _tmp12_;
			_tmp12_ = _data41_->theme;
			map_inspector_edit_theme (self, _tmp12_);
		}
	}
}

static void
______lambda162__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                            gint n_press,
                                            gdouble x,
                                            gdouble y,
                                            gpointer self)
{
	_____lambda162_ (self, n_press, x, y);
}

static void
map_inspector_update_themes (MapInspector* self)
{
	GArray* names = NULL;
	GArray* _tmp3_;
	GArray* icons = NULL;
	GArray* _tmp4_;
	MainWindow* _tmp5_;
	Themes* _tmp6_;
	Themes* _tmp7_;
	MainWindow* _tmp8_;
	Themes* _tmp9_;
	Themes* _tmp10_;
	gint index = 0;
	MindMap* _tmp41_;
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GtkGrid* _tmp2_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < 2)) {
					break;
				}
				_tmp2_ = self->priv->_theme_grid;
				gtk_grid_remove_column (_tmp2_, 0);
			}
		}
	}
	_tmp3_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp3_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	names = _tmp3_;
	_tmp4_ = g_array_new (TRUE, TRUE, sizeof (GtkPicture*));
	g_array_set_clear_func (_tmp4_, (GDestroyNotify) _vala_GtkPicture_free_function_content_of);
	icons = _tmp4_;
	_tmp5_ = self->priv->_win;
	_tmp6_ = main_window_get_themes (_tmp5_);
	_tmp7_ = _tmp6_;
	themes_names (_tmp7_, &names);
	_tmp8_ = self->priv->_win;
	_tmp9_ = main_window_get_themes (_tmp8_);
	_tmp10_ = _tmp9_;
	themes_icons (_tmp10_, &icons);
	index = 0;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp11_ = FALSE;
			_tmp11_ = TRUE;
			while (TRUE) {
				Block41Data* _data41_;
				GArray* _tmp13_;
				GArray* _tmp14_;
				const gchar* _tmp15_;
				gchar* _tmp16_;
				MainWindow* _tmp17_;
				Themes* _tmp18_;
				Themes* _tmp19_;
				const gchar* _tmp20_;
				Theme* _tmp21_;
				GtkLabel* label = NULL;
				const gchar* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				GtkLabel* _tmp25_;
				GtkLabel* _tmp26_;
				GtkBox* item = NULL;
				GtkBox* _tmp27_ = NULL;
				GtkBox* _tmp28_;
				GArray* _tmp29_;
				GtkPicture* _tmp30_;
				GtkBox* _tmp31_;
				GtkLabel* _tmp32_;
				GtkGestureClick* click = NULL;
				GtkGestureClick* _tmp33_;
				GtkBox* _tmp34_;
				GtkGestureClick* _tmp35_;
				GtkEventController* _tmp36_;
				GtkGestureClick* _tmp37_;
				GtkGrid* _tmp38_;
				GtkBox* _tmp39_;
				gint _tmp40_;
				_data41_ = g_slice_new0 (Block41Data);
				_data41_->_ref_count_ = 1;
				_data41_->self = g_object_ref (self);
				if (!_tmp11_) {
					gint _tmp12_;
					_tmp12_ = i;
					i = _tmp12_ + 1;
				}
				_tmp11_ = FALSE;
				_tmp13_ = names;
				if (!(((guint) i) < _tmp13_->len)) {
					block41_data_unref (_data41_);
					_data41_ = NULL;
					break;
				}
				_tmp14_ = names;
				_tmp15_ = g_array_index (_tmp14_, gchar*, (guint) i);
				_tmp16_ = g_strdup (_tmp15_);
				_data41_->name = _tmp16_;
				_tmp17_ = self->priv->_win;
				_tmp18_ = main_window_get_themes (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = _data41_->name;
				_tmp21_ = themes_get_theme (_tmp19_, _tmp20_);
				_data41_->theme = _tmp21_;
				_tmp22_ = _data41_->name;
				_tmp23_ = map_inspector_theme_label (self, _tmp22_);
				_tmp24_ = _tmp23_;
				_tmp25_ = (GtkLabel*) gtk_label_new (_tmp24_);
				g_object_ref_sink (_tmp25_);
				_tmp26_ = _tmp25_;
				_g_free0 (_tmp24_);
				label = _tmp26_;
				_tmp27_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
				gtk_widget_set_margin_start ((GtkWidget*) _tmp27_, 5);
				gtk_widget_set_margin_end ((GtkWidget*) _tmp27_, 5);
				gtk_widget_set_margin_top ((GtkWidget*) _tmp27_, 5);
				gtk_widget_set_margin_bottom ((GtkWidget*) _tmp27_, 5);
				g_object_ref_sink (_tmp27_);
				item = _tmp27_;
				_tmp28_ = item;
				_tmp29_ = icons;
				_tmp30_ = g_array_index (_tmp29_, GtkPicture*, (guint) i);
				gtk_box_append (_tmp28_, (GtkWidget*) _tmp30_);
				_tmp31_ = item;
				_tmp32_ = label;
				gtk_box_append (_tmp31_, (GtkWidget*) _tmp32_);
				_tmp33_ = (GtkGestureClick*) gtk_gesture_click_new ();
				click = _tmp33_;
				_tmp34_ = item;
				_tmp35_ = click;
				_tmp36_ = _g_object_ref0 ((GtkEventController*) _tmp35_);
				gtk_widget_add_controller ((GtkWidget*) _tmp34_, _tmp36_);
				_tmp37_ = click;
				g_signal_connect_data (_tmp37_, "pressed", (GCallback) ______lambda162__gtk_gesture_click_pressed, block41_data_ref (_data41_), (GClosureNotify) block41_data_unref, 0);
				_tmp38_ = self->priv->_theme_grid;
				_tmp39_ = item;
				gtk_grid_attach (_tmp38_, (GtkWidget*) _tmp39_, index % 2, index / 2, 1, 1);
				_tmp40_ = index;
				index = _tmp40_ + 1;
				_g_object_unref0 (click);
				_g_object_unref0 (item);
				_g_object_unref0 (label);
				block41_data_unref (_data41_);
				_data41_ = NULL;
			}
		}
	}
	_tmp41_ = self->priv->_map;
	if (_tmp41_ != NULL) {
		MindMap* _tmp42_;
		Theme* _tmp43_;
		Theme* _tmp44_;
		const gchar* _tmp45_;
		const gchar* _tmp46_;
		_tmp42_ = self->priv->_map;
		_tmp43_ = mind_map_get_theme (_tmp42_);
		_tmp44_ = _tmp43_;
		_tmp45_ = theme_get_name (_tmp44_);
		_tmp46_ = _tmp45_;
		map_inspector_select_theme (self, _tmp46_);
		_g_object_unref0 (_tmp44_);
	}
	_g_array_unref0 (icons);
	_g_array_unref0 (names);
}

static void
map_inspector_select_layout (MapInspector* self,
                             const gchar* name)
{
	GArray* names = NULL;
	GArray* _tmp0_;
	MindMap* _tmp1_;
	Layouts* _tmp2_;
	Layouts* _tmp3_;
	gboolean _tmp10_ = FALSE;
	MindMap* _tmp11_;
	Layouts* _tmp12_;
	Layouts* _tmp13_;
	Layout* _tmp14_;
	Layout* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	GtkButton* _tmp22_;
	GtkRevealer* _tmp23_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp0_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	names = _tmp0_;
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_layouts (_tmp1_);
	_tmp3_ = _tmp2_;
	layouts_get_names (_tmp3_, &names);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				GArray* _tmp6_;
				GArray* _tmp7_;
				const gchar* _tmp8_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				_tmp6_ = names;
				if (!(((guint) i) < _tmp6_->len)) {
					break;
				}
				_tmp7_ = names;
				_tmp8_ = g_array_index (_tmp7_, gchar*, (guint) i);
				if (g_strcmp0 (name, _tmp8_) == 0) {
					ModeButtons* _tmp9_;
					_tmp9_ = self->priv->_layout;
					mode_buttons_set_selected (_tmp9_, i);
					break;
				}
			}
		}
	}
	_tmp11_ = self->priv->_map;
	_tmp12_ = mind_map_get_layouts (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = layouts_get_layout (_tmp13_, name);
	_tmp15_ = _tmp14_;
	_tmp16_ = layout_get_balanceable (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = _tmp17_;
	_g_object_unref0 (_tmp15_);
	if (_tmp18_) {
		MindMap* _tmp19_;
		gboolean _tmp20_;
		gboolean _tmp21_;
		_tmp19_ = self->priv->_map;
		_tmp20_ = mind_map_get_editable (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp10_ = _tmp21_;
	} else {
		_tmp10_ = FALSE;
	}
	_tmp22_ = self->priv->_balance;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp22_, _tmp10_);
	_tmp23_ = self->priv->_alignment_revealer;
	gtk_revealer_set_reveal_child (_tmp23_, g_strcmp0 (name, _ ("Manual")) == 0);
	_g_array_unref0 (names);
}

static gchar*
map_inspector_theme_label (MapInspector* self,
                           const gchar* name)
{
	Theme* theme = NULL;
	MainWindow* _tmp0_;
	Themes* _tmp1_;
	Themes* _tmp2_;
	Theme* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = self->priv->_win;
	_tmp1_ = main_window_get_themes (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = themes_get_theme (_tmp2_, name);
	theme = _tmp3_;
	_tmp4_ = theme_get_label (theme);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strdup (_tmp5_);
	result = _tmp6_;
	_g_object_unref0 (theme);
	return result;
}

static void
map_inspector_select_theme (MapInspector* self,
                            const gchar* name)
{
	GArray* names = NULL;
	GArray* _tmp0_;
	MainWindow* _tmp1_;
	Themes* _tmp2_;
	Themes* _tmp3_;
	gint index = 0;
	GtkWidget* child = NULL;
	GtkGrid* _tmp4_;
	GtkWidget* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = g_array_new (TRUE, TRUE, sizeof (gchar*));
	g_array_set_clear_func (_tmp0_, (GDestroyNotify) _vala_gchar_free_function_content_of);
	names = _tmp0_;
	_tmp1_ = self->priv->_win;
	_tmp2_ = main_window_get_themes (_tmp1_);
	_tmp3_ = _tmp2_;
	themes_names (_tmp3_, &names);
	index = 0;
	_tmp4_ = self->priv->_theme_grid;
	_tmp5_ = utils_get_child_at_index ((GtkWidget*) _tmp4_, index);
	child = _tmp5_;
	while (TRUE) {
		GtkWidget* _tmp6_;
		GArray* _tmp7_;
		const gchar* _tmp8_;
		GtkGrid* _tmp27_;
		gint _tmp28_;
		GtkWidget* _tmp29_;
		_tmp6_ = child;
		if (!(_tmp6_ != NULL)) {
			break;
		}
		_tmp7_ = names;
		_tmp8_ = g_array_index (_tmp7_, gchar*, (guint) index);
		if (g_strcmp0 (_tmp8_, name) == 0) {
			GtkWidget* _tmp9_;
			GtkLabel* l = NULL;
			GtkWidget* _tmp10_;
			GtkWidget* _tmp11_;
			GtkLabel* _tmp12_;
			GArray* _tmp13_;
			const gchar* _tmp14_;
			gchar* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			_tmp9_ = child;
			gtk_widget_add_css_class (_tmp9_, "theme-selected");
			_tmp10_ = child;
			_tmp11_ = utils_get_child_at_index (_tmp10_, 1);
			l = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_label_get_type (), GtkLabel);
			_tmp12_ = l;
			_tmp13_ = names;
			_tmp14_ = g_array_index (_tmp13_, gchar*, (guint) index);
			_tmp15_ = map_inspector_theme_label (self, _tmp14_);
			_tmp16_ = _tmp15_;
			_tmp17_ = g_strdup_printf ("<span color=\"white\">%s</span>", _tmp16_);
			_tmp18_ = _tmp17_;
			gtk_label_set_markup (_tmp12_, _tmp18_);
			_g_free0 (_tmp18_);
			_g_free0 (_tmp16_);
			_g_object_unref0 (l);
		} else {
			GtkWidget* _tmp19_;
			GtkLabel* l = NULL;
			GtkWidget* _tmp20_;
			GtkWidget* _tmp21_;
			GtkLabel* _tmp22_;
			GArray* _tmp23_;
			const gchar* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			_tmp19_ = child;
			gtk_widget_remove_css_class (_tmp19_, "theme-selected");
			_tmp20_ = child;
			_tmp21_ = utils_get_child_at_index (_tmp20_, 1);
			l = G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_label_get_type (), GtkLabel);
			_tmp22_ = l;
			_tmp23_ = names;
			_tmp24_ = g_array_index (_tmp23_, gchar*, (guint) index);
			_tmp25_ = map_inspector_theme_label (self, _tmp24_);
			_tmp26_ = _tmp25_;
			gtk_label_set_markup (_tmp22_, _tmp26_);
			_g_free0 (_tmp26_);
			_g_object_unref0 (l);
		}
		_tmp27_ = self->priv->_theme_grid;
		index = index + 1;
		_tmp28_ = index;
		_tmp29_ = utils_get_child_at_index ((GtkWidget*) _tmp27_, _tmp28_);
		_g_object_unref0 (child);
		child = _tmp29_;
	}
	_g_object_unref0 (child);
	_g_array_unref0 (names);
}

static void
map_inspector_update_theme_layout (MapInspector* self)
{
	MindMap* _tmp0_;
	Theme* _tmp1_;
	Theme* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_theme (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = theme_get_name (_tmp2_);
	_tmp4_ = _tmp3_;
	map_inspector_select_theme (self, _tmp4_);
	_g_object_unref0 (_tmp2_);
	map_inspector_current_changed (self);
}

static void
map_inspector_create_custom_theme (MapInspector* self)
{
	MainWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_win;
	main_window_show_theme_editor (_tmp0_, NULL);
}

static void
map_inspector_edit_theme (MapInspector* self,
                          Theme* theme)
{
	MainWindow* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (theme != NULL);
	_tmp0_ = self->priv->_win;
	main_window_show_theme_editor (_tmp0_, theme);
}

static void
map_inspector_current_changed (MapInspector* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	Node* _tmp1_;
	gboolean foldable = FALSE;
	MindMap* _tmp2_;
	MapModel* _tmp3_;
	MapModel* _tmp4_;
	gboolean unfoldable = FALSE;
	MindMap* _tmp5_;
	MapModel* _tmp6_;
	MapModel* _tmp7_;
	gboolean layout_selected = FALSE;
	Node* _tmp8_;
	gboolean _tmp43_ = FALSE;
	GtkButton* _tmp47_;
	gboolean _tmp48_ = FALSE;
	GtkButton* _tmp52_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_current_node (_tmp0_);
	current = _tmp1_;
	_tmp2_ = self->priv->_map;
	_tmp3_ = mind_map_get_model (_tmp2_);
	_tmp4_ = _tmp3_;
	foldable = map_model_completed_tasks_foldable (_tmp4_);
	_tmp5_ = self->priv->_map;
	_tmp6_ = mind_map_get_model (_tmp5_);
	_tmp7_ = _tmp6_;
	unfoldable = map_model_unfoldable (_tmp7_);
	layout_selected = FALSE;
	_tmp8_ = current;
	if (_tmp8_ != NULL) {
		Node* _tmp9_;
		Layout* _tmp10_;
		Layout* _tmp11_;
		_tmp9_ = current;
		_tmp10_ = node_get_layout (_tmp9_);
		_tmp11_ = _tmp10_;
		layout_selected = _tmp11_ != NULL;
		if (layout_selected) {
			Node* _tmp12_;
			Layout* _tmp13_;
			Layout* _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			_tmp12_ = current;
			_tmp13_ = node_get_layout (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = layout_get_name (_tmp14_);
			_tmp16_ = _tmp15_;
			map_inspector_select_layout (self, _tmp16_);
		}
	} else {
		MindMap* _tmp17_;
		GArray* _tmp18_;
		GArray* _tmp19_;
		gboolean _tmp20_;
		_tmp17_ = self->priv->_map;
		_tmp18_ = mind_map_get_nodes (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = _tmp19_->len > ((guint) 0);
		_g_array_unref0 (_tmp19_);
		if (_tmp20_) {
			MindMap* _tmp21_;
			GArray* _tmp22_;
			GArray* _tmp23_;
			Node* _tmp24_;
			Layout* _tmp25_;
			Layout* _tmp26_;
			gboolean _tmp27_;
			_tmp21_ = self->priv->_map;
			_tmp22_ = mind_map_get_nodes (_tmp21_);
			_tmp23_ = _tmp22_;
			_tmp24_ = g_array_index (_tmp23_, Node*, (guint) 0);
			_tmp25_ = node_get_layout (_tmp24_);
			_tmp26_ = _tmp25_;
			layout_selected = _tmp26_ != NULL;
			_tmp27_ = layout_selected;
			_g_array_unref0 (_tmp23_);
			if (_tmp27_) {
				MindMap* _tmp28_;
				GArray* _tmp29_;
				GArray* _tmp30_;
				Node* _tmp31_;
				Layout* _tmp32_;
				Layout* _tmp33_;
				const gchar* _tmp34_;
				const gchar* _tmp35_;
				_tmp28_ = self->priv->_map;
				_tmp29_ = mind_map_get_nodes (_tmp28_);
				_tmp30_ = _tmp29_;
				_tmp31_ = g_array_index (_tmp30_, Node*, (guint) 0);
				_tmp32_ = node_get_layout (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = layout_get_name (_tmp33_);
				_tmp35_ = _tmp34_;
				map_inspector_select_layout (self, _tmp35_);
				_g_array_unref0 (_tmp30_);
			}
		}
	}
	if (!layout_selected) {
		MindMap* _tmp36_;
		Layouts* _tmp37_;
		Layouts* _tmp38_;
		Layout* _tmp39_;
		Layout* _tmp40_;
		const gchar* _tmp41_;
		const gchar* _tmp42_;
		_tmp36_ = self->priv->_map;
		_tmp37_ = mind_map_get_layouts (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = layouts_get_default (_tmp38_);
		_tmp40_ = _tmp39_;
		_tmp41_ = layout_get_name (_tmp40_);
		_tmp42_ = _tmp41_;
		map_inspector_select_layout (self, _tmp42_);
		_g_object_unref0 (_tmp40_);
	}
	if (foldable) {
		MindMap* _tmp44_;
		gboolean _tmp45_;
		gboolean _tmp46_;
		_tmp44_ = self->priv->_map;
		_tmp45_ = mind_map_get_editable (_tmp44_);
		_tmp46_ = _tmp45_;
		_tmp43_ = _tmp46_;
	} else {
		_tmp43_ = FALSE;
	}
	_tmp47_ = self->priv->_fold_completed;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp47_, _tmp43_);
	if (unfoldable) {
		MindMap* _tmp49_;
		gboolean _tmp50_;
		gboolean _tmp51_;
		_tmp49_ = self->priv->_map;
		_tmp50_ = mind_map_get_editable (_tmp49_);
		_tmp51_ = _tmp50_;
		_tmp48_ = _tmp51_;
	} else {
		_tmp48_ = FALSE;
	}
	_tmp52_ = self->priv->_unfold_all;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp52_, _tmp48_);
	map_inspector_update_node_alignment (self);
	_g_object_unref0 (current);
}

void
map_inspector_grab_first (MapInspector* self)
{
	ModeButtons* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_layout;
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}

static void
map_inspector_class_init (MapInspectorClass * klass,
                          gpointer klass_data)
{
	map_inspector_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &MapInspector_private_offset);
	G_OBJECT_CLASS (klass)->finalize = map_inspector_finalize;
	map_inspector_signals[MAP_INSPECTOR_UPDATE_ICONS_SIGNAL] = g_signal_new ("update-icons", TYPE_MAP_INSPECTOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	map_inspector_signals[MAP_INSPECTOR_EDITABLE_CHANGED_SIGNAL] = g_signal_new ("editable-changed", TYPE_MAP_INSPECTOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
map_inspector_instance_init (MapInspector * self,
                             gpointer klass)
{
	self->priv = map_inspector_get_instance_private (self);
	self->priv->_map = NULL;
	self->priv->_theme_grid = NULL;
	self->priv->_balance = NULL;
	self->priv->_fold_completed = NULL;
	self->priv->_unfold_all = NULL;
}

static void
map_inspector_finalize (GObject * obj)
{
	MapInspector * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MAP_INSPECTOR, MapInspector);
	_g_object_unref0 (self->priv->_win);
	_mind_map_unref0 (self->priv->_map);
	_g_object_unref0 (self->priv->_settings);
	_g_object_unref0 (self->priv->_layout);
	_g_object_unref0 (self->priv->_theme_grid);
	_g_object_unref0 (self->priv->_add_theme);
	_g_object_unref0 (self->priv->_balance);
	_g_object_unref0 (self->priv->_fold_completed);
	_g_object_unref0 (self->priv->_unfold_all);
	_g_object_unref0 (self->priv->_read_only);
	_g_object_unref0 (self->priv->_hide_connections);
	_g_object_unref0 (self->priv->_hide_callouts);
	_g_object_unref0 (self->priv->_hleft);
	_g_object_unref0 (self->priv->_hcenter);
	_g_object_unref0 (self->priv->_hright);
	_g_object_unref0 (self->priv->_vtop);
	_g_object_unref0 (self->priv->_vcenter);
	_g_object_unref0 (self->priv->_vbottom);
	_g_object_unref0 (self->priv->_alignment_revealer);
	_g_object_unref0 (self->priv->_map_dir);
	G_OBJECT_CLASS (map_inspector_parent_class)->finalize (obj);
}

static GType
map_inspector_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MapInspectorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) map_inspector_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MapInspector), 0, (GInstanceInitFunc) map_inspector_instance_init, NULL };
	GType map_inspector_type_id;
	map_inspector_type_id = g_type_register_static (gtk_box_get_type (), "MapInspector", &g_define_type_info, 0);
	MapInspector_private_offset = g_type_add_instance_private (map_inspector_type_id, sizeof (MapInspectorPrivate));
	return map_inspector_type_id;
}

GType
map_inspector_get_type (void)
{
	static volatile gsize map_inspector_type_id__once = 0;
	if (g_once_init_enter (&map_inspector_type_id__once)) {
		GType map_inspector_type_id;
		map_inspector_type_id = map_inspector_get_type_once ();
		g_once_init_leave (&map_inspector_type_id__once, map_inspector_type_id);
	}
	return map_inspector_type_id__once;
}

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

