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

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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdk.h>
#include <gobject/gvaluecollector.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_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;
typedef struct _MindMapPrivate MindMapPrivate;

#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_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_DRAW_AREA (draw_area_get_type ())
#define DRAW_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DRAW_AREA, DrawArea))
#define DRAW_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DRAW_AREA, DrawAreaClass))
#define IS_DRAW_AREA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DRAW_AREA))
#define IS_DRAW_AREA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DRAW_AREA))
#define DRAW_AREA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DRAW_AREA, DrawAreaClass))

typedef struct _DrawArea DrawArea;
typedef struct _DrawAreaClass DrawAreaClass;

#define TYPE_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_UNDO_BUFFER (undo_buffer_get_type ())
#define UNDO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_BUFFER, UndoBuffer))
#define UNDO_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_BUFFER, UndoBufferClass))
#define IS_UNDO_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_BUFFER))
#define IS_UNDO_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_BUFFER))
#define UNDO_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_BUFFER, UndoBufferClass))

typedef struct _UndoBuffer UndoBuffer;
typedef struct _UndoBufferClass UndoBufferClass;

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

typedef struct _UndoTextBuffer UndoTextBuffer;
typedef struct _UndoTextBufferClass UndoTextBufferClass;

#define TYPE_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_TAGS (tags_get_type ())
#define TAGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAGS, Tags))
#define TAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAGS, TagsClass))
#define IS_TAGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAGS))
#define IS_TAGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAGS))
#define TAGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAGS, TagsClass))

typedef struct _Tags Tags;
typedef struct _TagsClass TagsClass;
typedef enum  {
	TAG_COMBO_TYPE_AND,
	TAG_COMBO_TYPE_OR,
	TAG_COMBO_TYPE_NONE,
	TAG_COMBO_TYPE_NUM
} TagComboType;

#define TYPE_TAG_COMBO_TYPE (tag_combo_type_get_type ())

#define TYPE_STYLE (style_get_type ())
#define STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STYLE, Style))
#define STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STYLE, StyleClass))
#define IS_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STYLE))
#define IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STYLE))
#define STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STYLE, StyleClass))

typedef struct _Style Style;
typedef struct _StyleClass StyleClass;

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

typedef struct _TextParser TextParser;
typedef struct _TextParserClass TextParserClass;

#define TYPE_MARKDOWN_PARSER (markdown_parser_get_type ())
#define MARKDOWN_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MARKDOWN_PARSER, MarkdownParser))
#define MARKDOWN_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MARKDOWN_PARSER, MarkdownParserClass))
#define IS_MARKDOWN_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MARKDOWN_PARSER))
#define IS_MARKDOWN_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MARKDOWN_PARSER))
#define MARKDOWN_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MARKDOWN_PARSER, MarkdownParserClass))

typedef struct _MarkdownParser MarkdownParser;
typedef struct _MarkdownParserClass MarkdownParserClass;

#define TYPE_TAGGER_PARSER (tagger_parser_get_type ())
#define TAGGER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAGGER_PARSER, TaggerParser))
#define TAGGER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAGGER_PARSER, TaggerParserClass))
#define IS_TAGGER_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAGGER_PARSER))
#define IS_TAGGER_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAGGER_PARSER))
#define TAGGER_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAGGER_PARSER, TaggerParserClass))

typedef struct _TaggerParser TaggerParser;
typedef struct _TaggerParserClass TaggerParserClass;

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

typedef struct _UrlParser UrlParser;
typedef struct _UrlParserClass UrlParserClass;

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

typedef struct _UnicodeParser UnicodeParser;
typedef struct _UnicodeParserClass UnicodeParserClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _map_model_unref0(var) ((var == NULL) ? NULL : (var = (map_model_unref (var), NULL)))
#define _selection_unref0(var) ((var == NULL) ? NULL : (var = (selection_unref (var), NULL)))
#define _tags_unref0(var) ((var == NULL) ? NULL : (var = (tags_unref (var), NULL)))
#define _style_unref0(var) ((var == NULL) ? NULL : (var = (style_unref (var), NULL)))
#define _text_parser_unref0(var) ((var == NULL) ? NULL : (var = (text_parser_unref (var), NULL)))

#define TYPE_STYLES (styles_get_type ())
#define STYLES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STYLES, Styles))
#define STYLES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STYLES, StylesClass))
#define IS_STYLES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STYLES))
#define IS_STYLES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STYLES))
#define STYLES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STYLES, StylesClass))

typedef struct _Styles Styles;
typedef struct _StylesClass StylesClass;

#define TYPE_TEMPLATE (template_get_type ())
#define TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEMPLATE, Template))
#define TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEMPLATE, TemplateClass))
#define IS_TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEMPLATE))
#define IS_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEMPLATE))
#define TEMPLATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEMPLATE, TemplateClass))

typedef struct _Template Template;
typedef struct _TemplateClass TemplateClass;

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

typedef struct _Templates Templates;
typedef struct _TemplatesClass TemplatesClass;
typedef enum  {
	TEMPLATE_TYPE_STYLE_GENERAL,
	TEMPLATE_TYPE_STYLE_NODE,
	TEMPLATE_TYPE_STYLE_CONNECTION,
	TEMPLATE_TYPE_STYLE_CALLOUT,
	TEMPLATE_TYPE_STYLE_OPTION_BRANCH,
	TEMPLATE_TYPE_STYLE_OPTION_LINK,
	TEMPLATE_TYPE_STYLE_OPTION_NODE,
	TEMPLATE_TYPE_STYLE_OPTION_CONNECTION,
	TEMPLATE_TYPE_STYLE_OPTION_CALLOUT,
	TEMPLATE_TYPE_NUM
} TemplateType;

#define TYPE_TEMPLATE_TYPE (template_type_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))

#define TYPE_STYLE_TEMPLATE (style_template_get_type ())
#define STYLE_TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STYLE_TEMPLATE, StyleTemplate))
#define STYLE_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STYLE_TEMPLATE, StyleTemplateClass))
#define IS_STYLE_TEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STYLE_TEMPLATE))
#define IS_STYLE_TEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STYLE_TEMPLATE))
#define STYLE_TEMPLATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STYLE_TEMPLATE, StyleTemplateClass))

typedef struct _StyleTemplate StyleTemplate;
typedef struct _StyleTemplateClass StyleTemplateClass;
#define _template_unref0(var) ((var == NULL) ? NULL : (var = (template_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#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  {
	NODE_MODE_NONE = 0,
	NODE_MODE_CURRENT,
	NODE_MODE_SELECTED,
	NODE_MODE_EDITABLE,
	NODE_MODE_ATTACHABLE,
	NODE_MODE_DROPPABLE,
	NODE_MODE_HIGHLIGHTED
} NodeMode;

#define TYPE_NODE_MODE (node_mode_get_type ())

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

typedef struct _CanvasText CanvasText;
typedef struct _CanvasTextClass CanvasTextClass;

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

typedef struct _Connection Connection;
typedef struct _ConnectionClass ConnectionClass;

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

typedef struct _Callout Callout;
typedef struct _CalloutClass CalloutClass;
typedef enum  {
	CONN_MODE_NONE = 0,
	CONN_MODE_LINKING,
	CONN_MODE_CONNECTING,
	CONN_MODE_SELECTED,
	CONN_MODE_ADJUSTING,
	CONN_MODE_EDITABLE,
	CONN_MODE_DROPPABLE
} ConnMode;

#define TYPE_CONN_MODE (conn_mode_get_type ())
typedef enum  {
	CALLOUT_MODE_NONE = 0,
	CALLOUT_MODE_SELECTED,
	CALLOUT_MODE_EDITABLE,
	CALLOUT_MODE_HIDING,
	CALLOUT_MODE_HIDDEN
} CalloutMode;

#define TYPE_CALLOUT_MODE (callout_mode_get_type ())
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))

#define TYPE_UNDO_ITEM (undo_item_get_type ())
#define UNDO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_ITEM, UndoItem))
#define UNDO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_ITEM, UndoItemClass))
#define IS_UNDO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_ITEM))
#define IS_UNDO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_ITEM))
#define UNDO_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_ITEM, UndoItemClass))

typedef struct _UndoItem UndoItem;
typedef struct _UndoItemClass UndoItemClass;

#define TYPE_UNDO_NODE_FOLDS (undo_node_folds_get_type ())
#define UNDO_NODE_FOLDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_FOLDS, UndoNodeFolds))
#define UNDO_NODE_FOLDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_FOLDS, UndoNodeFoldsClass))
#define IS_UNDO_NODE_FOLDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_FOLDS))
#define IS_UNDO_NODE_FOLDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_FOLDS))
#define UNDO_NODE_FOLDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_FOLDS, UndoNodeFoldsClass))

typedef struct _UndoNodeFolds UndoNodeFolds;
typedef struct _UndoNodeFoldsClass UndoNodeFoldsClass;

#define TYPE_SUMMARY_NODE (summary_node_get_type ())
#define SUMMARY_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SUMMARY_NODE, SummaryNode))
#define SUMMARY_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SUMMARY_NODE, SummaryNodeClass))
#define IS_SUMMARY_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SUMMARY_NODE))
#define IS_SUMMARY_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SUMMARY_NODE))
#define SUMMARY_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SUMMARY_NODE, SummaryNodeClass))

typedef struct _SummaryNode SummaryNode;
typedef struct _SummaryNodeClass SummaryNodeClass;

#define TYPE_NODE_LINK (node_link_get_type ())
#define NODE_LINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_LINK, NodeLink))
#define NODE_LINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_LINK, NodeLinkClass))
#define IS_NODE_LINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_LINK))
#define IS_NODE_LINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_LINK))
#define NODE_LINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_LINK, NodeLinkClass))

typedef struct _NodeLink NodeLink;
typedef struct _NodeLinkClass NodeLinkClass;

#define TYPE_SELECT_BOX (select_box_get_type ())
typedef struct _SelectBox SelectBox;

#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_NODE_GROUP (node_group_get_type ())
#define NODE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_GROUP, NodeGroup))
#define NODE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_GROUP, NodeGroupClass))
#define IS_NODE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_GROUP))
#define IS_NODE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_GROUP))
#define NODE_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_GROUP, NodeGroupClass))

typedef struct _NodeGroup NodeGroup;
typedef struct _NodeGroupClass NodeGroupClass;

#define TYPE_STICKER (sticker_get_type ())
#define STICKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STICKER, Sticker))
#define STICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STICKER, StickerClass))
#define IS_STICKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STICKER))
#define IS_STICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STICKER))
#define STICKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STICKER, StickerClass))

typedef struct _Sticker Sticker;
typedef struct _StickerClass StickerClass;

#define TYPE_STICKERS (stickers_get_type ())
#define STICKERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_STICKERS, Stickers))
#define STICKERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_STICKERS, StickersClass))
#define IS_STICKERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_STICKERS))
#define IS_STICKERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_STICKERS))
#define STICKERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_STICKERS, StickersClass))

typedef struct _Stickers Stickers;
typedef struct _StickersClass StickersClass;

#define TYPE_UNDO_TEXT_ITEM (undo_text_item_get_type ())
#define UNDO_TEXT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_TEXT_ITEM, UndoTextItem))
#define UNDO_TEXT_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_TEXT_ITEM, UndoTextItemClass))
#define IS_UNDO_TEXT_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_TEXT_ITEM))
#define IS_UNDO_TEXT_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_TEXT_ITEM))
#define UNDO_TEXT_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_TEXT_ITEM, UndoTextItemClass))

typedef struct _UndoTextItem UndoTextItem;
typedef struct _UndoTextItemClass UndoTextItemClass;

#define TYPE_TAG (tag_get_type ())
#define TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG, Tag))
#define TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG, TagClass))
#define IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG))
#define IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG))
#define TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG, TagClass))

typedef struct _Tag Tag;
typedef struct _TagClass TagClass;

#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;
typedef enum  {
	NODE_SIDE_LEFT = 1,
	NODE_SIDE_TOP = 2,
	NODE_SIDE_RIGHT = 4,
	NODE_SIDE_BOTTOM = 8
} NodeSide;

#define TYPE_NODE_SIDE (node_side_get_type ())

#define TYPE_UNDO_NODE_MOVE (undo_node_move_get_type ())
#define UNDO_NODE_MOVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_MOVE, UndoNodeMove))
#define UNDO_NODE_MOVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_MOVE, UndoNodeMoveClass))
#define IS_UNDO_NODE_MOVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_MOVE))
#define IS_UNDO_NODE_MOVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_MOVE))
#define UNDO_NODE_MOVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_MOVE, UndoNodeMoveClass))

typedef struct _UndoNodeMove UndoNodeMove;
typedef struct _UndoNodeMoveClass UndoNodeMoveClass;

#define TYPE_UNDO_NODE_UNCLIFY (undo_node_unclify_get_type ())
#define UNDO_NODE_UNCLIFY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_UNCLIFY, UndoNodeUnclify))
#define UNDO_NODE_UNCLIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_UNCLIFY, UndoNodeUnclifyClass))
#define IS_UNDO_NODE_UNCLIFY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_UNCLIFY))
#define IS_UNDO_NODE_UNCLIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_UNCLIFY))
#define UNDO_NODE_UNCLIFY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_UNCLIFY, UndoNodeUnclifyClass))

typedef struct _UndoNodeUnclify UndoNodeUnclify;
typedef struct _UndoNodeUnclifyClass UndoNodeUnclifyClass;

#define TYPE_UNDO_NODE_REPARENT (undo_node_reparent_get_type ())
#define UNDO_NODE_REPARENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_REPARENT, UndoNodeReparent))
#define UNDO_NODE_REPARENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_REPARENT, UndoNodeReparentClass))
#define IS_UNDO_NODE_REPARENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_REPARENT))
#define IS_UNDO_NODE_REPARENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_REPARENT))
#define UNDO_NODE_REPARENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_REPARENT, UndoNodeReparentClass))

typedef struct _UndoNodeReparent UndoNodeReparent;
typedef struct _UndoNodeReparentClass UndoNodeReparentClass;

#define TYPE_UNDO_NODES_ATTACH (undo_nodes_attach_get_type ())
#define UNDO_NODES_ATTACH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODES_ATTACH, UndoNodesAttach))
#define UNDO_NODES_ATTACH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODES_ATTACH, UndoNodesAttachClass))
#define IS_UNDO_NODES_ATTACH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODES_ATTACH))
#define IS_UNDO_NODES_ATTACH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODES_ATTACH))
#define UNDO_NODES_ATTACH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODES_ATTACH, UndoNodesAttachClass))

typedef struct _UndoNodesAttach UndoNodesAttach;
typedef struct _UndoNodesAttachClass UndoNodesAttachClass;

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

typedef struct _Theme Theme;
typedef struct _ThemeClass ThemeClass;

#define TYPE_NODE_GROUPS (node_groups_get_type ())
#define NODE_GROUPS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_GROUPS, NodeGroups))
#define NODE_GROUPS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_GROUPS, NodeGroupsClass))
#define IS_NODE_GROUPS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_GROUPS))
#define IS_NODE_GROUPS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_GROUPS))
#define NODE_GROUPS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_GROUPS, NodeGroupsClass))

typedef struct _NodeGroups NodeGroups;
typedef struct _NodeGroupsClass NodeGroupsClass;

#define TYPE_IMAGE_MANAGER (image_manager_get_type ())
#define IMAGE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IMAGE_MANAGER, ImageManager))
#define IMAGE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMAGE_MANAGER, ImageManagerClass))
#define IS_IMAGE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IMAGE_MANAGER))
#define IS_IMAGE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IMAGE_MANAGER))
#define IMAGE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IMAGE_MANAGER, ImageManagerClass))

typedef struct _ImageManager ImageManager;
typedef struct _ImageManagerClass ImageManagerClass;

#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;
typedef enum  {
	PROPERTY_GRAB_NONE,
	PROPERTY_GRAB_FIRST,
	PROPERTY_GRAB_NOTE
} PropertyGrab;

#define TYPE_PROPERTY_GRAB (property_grab_get_type ())
typedef struct _ParamSpecMindMap ParamSpecMindMap;
enum  {
	MIND_MAP_CHANGED_SIGNAL,
	MIND_MAP_CURRENT_CHANGED_SIGNAL,
	MIND_MAP_THEME_CHANGED_SIGNAL,
	MIND_MAP_LOADED_SIGNAL,
	MIND_MAP_SCALE_CHANGED_SIGNAL,
	MIND_MAP_SCROLL_CHANGED_SIGNAL,
	MIND_MAP_SHOW_PROPERTIES_SIGNAL,
	MIND_MAP_HIDE_PROPERTIES_SIGNAL,
	MIND_MAP_UNDO_BUFFER_CHANGED_SIGNAL,
	MIND_MAP_EDITABLE_CHANGED_SIGNAL,
	MIND_MAP_RELOAD_TAGS_SIGNAL,
	MIND_MAP_NUM_SIGNALS
};
static guint mind_map_signals[MIND_MAP_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _MindMap {
	GTypeInstance parent_instance;
	volatile int ref_count;
	MindMapPrivate * priv;
};

struct _MindMapClass {
	GTypeClass parent_class;
	void (*finalize) (MindMap *self);
};

struct _MindMapPrivate {
	MainWindow* _win;
	GSettings* _settings;
	MapModel* _model;
	DrawArea* _canvas;
	Document* _doc;
	UndoBuffer* _undo_buffer;
	UndoTextBuffer* _undo_text;
	Selection* _selected;
	gboolean _focus_mode;
	gdouble _focus_alpha;
	Tags* _highlighted;
	TagComboType _highlight_mode;
	gboolean _editable;
	Style* _global_style;
	MarkdownParser* _markdown_parser;
	TaggerParser* _tagger_parser;
	UrlParser* _url_parser;
	UnicodeParser* _unicode_parser;
};

struct _SelectBox {
	gdouble x;
	gdouble y;
	gdouble w;
	gdouble h;
	gboolean valid;
};

struct _ParamSpecMindMap {
	GParamSpec parent_instance;
};

static gint MindMap_private_offset;
static gpointer mind_map_parent_class = NULL;
VALA_EXTERN Styles* style_inspector_styles;
VALA_EXTERN Style* style_inspector_last_global_style;
VALA_EXTERN GSettings* minder_settings;

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 main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
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 GType draw_area_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DrawArea, g_object_unref)
VALA_EXTERN GType document_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Document, g_object_unref)
VALA_EXTERN GType undo_buffer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoBuffer, g_object_unref)
VALA_EXTERN GType undo_text_buffer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoTextBuffer, g_object_unref)
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 gpointer tags_ref (gpointer instance);
VALA_EXTERN void tags_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_tags (const gchar* name,
                             const gchar* nick,
                             const gchar* blurb,
                             GType object_type,
                             GParamFlags flags);
VALA_EXTERN void value_set_tags (GValue* value,
                     gpointer v_object);
VALA_EXTERN void value_take_tags (GValue* value,
                      gpointer v_object);
VALA_EXTERN gpointer value_get_tags (const GValue* value);
VALA_EXTERN GType tags_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tags, tags_unref)
VALA_EXTERN GType tag_combo_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer style_ref (gpointer instance);
VALA_EXTERN void style_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_style (const gchar* name,
                              const gchar* nick,
                              const gchar* blurb,
                              GType object_type,
                              GParamFlags flags);
VALA_EXTERN void value_set_style (GValue* value,
                      gpointer v_object);
VALA_EXTERN void value_take_style (GValue* value,
                       gpointer v_object);
VALA_EXTERN gpointer value_get_style (const GValue* value);
VALA_EXTERN GType style_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Style, style_unref)
VALA_EXTERN gpointer text_parser_ref (gpointer instance);
VALA_EXTERN void text_parser_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_text_parser (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_text_parser (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_text_parser (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_text_parser (const GValue* value);
VALA_EXTERN GType text_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TextParser, text_parser_unref)
VALA_EXTERN GType markdown_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MarkdownParser, text_parser_unref)
VALA_EXTERN GType tagger_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TaggerParser, text_parser_unref)
VALA_EXTERN GType url_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UrlParser, text_parser_unref)
VALA_EXTERN GType unicode_parser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UnicodeParser, text_parser_unref)
VALA_EXTERN MindMap* mind_map_new (MainWindow* win,
                       GSettings* settings);
VALA_EXTERN MindMap* mind_map_construct (GType object_type,
                             MainWindow* win,
                             GSettings* settings);
VALA_EXTERN MapModel* map_model_new (MindMap* map);
VALA_EXTERN MapModel* map_model_construct (GType object_type,
                               MindMap* map);
VALA_EXTERN DrawArea* draw_area_new (MindMap* map,
                         MainWindow* w);
VALA_EXTERN DrawArea* draw_area_construct (GType object_type,
                               MindMap* map,
                               MainWindow* w);
VALA_EXTERN Document* document_new (MindMap* map);
VALA_EXTERN Document* document_construct (GType object_type,
                              MindMap* map);
VALA_EXTERN UndoBuffer* undo_buffer_new (MindMap* map);
VALA_EXTERN UndoBuffer* undo_buffer_construct (GType object_type,
                                   MindMap* map);
VALA_EXTERN UndoTextBuffer* undo_text_buffer_new (MindMap* map);
VALA_EXTERN UndoTextBuffer* undo_text_buffer_construct (GType object_type,
                                            MindMap* map);
VALA_EXTERN Selection* selection_new (MindMap* map);
VALA_EXTERN Selection* selection_construct (GType object_type,
                                MindMap* map);
VALA_EXTERN Style* style_new (void);
VALA_EXTERN Style* style_construct (GType object_type);
VALA_EXTERN Tags* tags_new (void);
VALA_EXTERN Tags* tags_construct (GType object_type);
VALA_EXTERN TaggerParser* tagger_parser_new (MindMap* map);
VALA_EXTERN TaggerParser* tagger_parser_construct (GType object_type,
                                       MindMap* map);
static void mind_map_set_tagger_parser (MindMap* self,
                                 TaggerParser* value);
VALA_EXTERN MarkdownParser* markdown_parser_new (MindMap* map);
VALA_EXTERN MarkdownParser* markdown_parser_construct (GType object_type,
                                           MindMap* map);
static void mind_map_set_markdown_parser (MindMap* self,
                                   MarkdownParser* value);
VALA_EXTERN UrlParser* url_parser_new (void);
VALA_EXTERN UrlParser* url_parser_construct (GType object_type);
static void mind_map_set_url_parser (MindMap* self,
                              UrlParser* value);
VALA_EXTERN UnicodeParser* unicode_parser_new (MindMap* map);
VALA_EXTERN UnicodeParser* unicode_parser_construct (GType object_type,
                                         MindMap* map);
static void mind_map_set_unicode_parser (MindMap* self,
                                  UnicodeParser* value);
VALA_EXTERN MarkdownParser* mind_map_get_markdown_parser (MindMap* self);
VALA_EXTERN void text_parser_set_enable (TextParser* self,
                             gboolean value);
VALA_EXTERN UrlParser* mind_map_get_url_parser (MindMap* self);
VALA_EXTERN UnicodeParser* mind_map_get_unicode_parser (MindMap* self);
static void mind_map_handle_model_changed (MindMap* self);
static void _mind_map_handle_model_changed_map_model_changed (MapModel* _sender,
                                                       gpointer self);
static void mind_map_handle_current_changed (MindMap* self);
static void _mind_map_handle_current_changed_map_model_current_changed (MapModel* _sender,
                                                                 gpointer self);
static void mind_map_handle_theme_changed (MindMap* self);
static void _mind_map_handle_theme_changed_map_model_theme_changed (MapModel* _sender,
                                                             gpointer self);
static void mind_map_handle_model_loaded (MindMap* self);
static void _mind_map_handle_model_loaded_map_model_loaded (MapModel* _sender,
                                                     gpointer self);
static void _gtk_widget_queue_draw_map_model_queue_draw (MapModel* _sender,
                                                  gpointer self);
VALA_EXTERN void draw_area_see (DrawArea* self,
                    gboolean animate,
                    gdouble width_adjust,
                    gdouble pad);
static void _draw_area_see_map_model_see (MapModel* _sender,
                                   gboolean animate,
                                   gdouble width_adjust,
                                   gdouble pad,
                                   gpointer self);
static void _mind_map_handle_current_changed_draw_area_current_changed (DrawArea* _sender,
                                                                 MindMap* map,
                                                                 gpointer self);
static void mind_map_handle_scale_changed (MindMap* self,
                                    gdouble scale);
static void _mind_map_handle_scale_changed_draw_area_scale_changed (DrawArea* _sender,
                                                             gdouble scale,
                                                             gpointer self);
static void mind_map_handle_scroll_changed (MindMap* self);
static void _mind_map_handle_scroll_changed_draw_area_scroll_changed (DrawArea* _sender,
                                                               gpointer self);
static void mind_map_handle_read_only_changed (MindMap* self);
static void _mind_map_handle_read_only_changed_document_read_only_changed (Document* _sender,
                                                                    gpointer self);
static void mind_map_handle_undo_buffer_changed (MindMap* self,
                                          UndoBuffer* buf);
static void _mind_map_handle_undo_buffer_changed_undo_buffer_buffer_changed (UndoBuffer* _sender,
                                                                      UndoBuffer* buf,
                                                                      gpointer self);
static void mind_map_handle_selection_changed (MindMap* self);
static void _mind_map_handle_selection_changed_selection_selection_changed (Selection* _sender,
                                                                     gpointer self);
static void mind_map_handle_tag_highlight_changed (MindMap* self);
static void _mind_map_handle_tag_highlight_changed_tags_changed (Tags* _sender,
                                                          gpointer self);
VALA_EXTERN void mind_map_update_focus_mode_alpha (MindMap* self);
static void __lambda239_ (MindMap* self);
static void ___lambda239__g_settings_changed (GSettings* _sender,
                                       const gchar* key,
                                       gpointer self);
VALA_EXTERN void mind_map_update_focus_mode (MindMap* self);
VALA_EXTERN void mind_map_close (MindMap* self);
VALA_EXTERN Document* mind_map_get_doc (MindMap* self);
VALA_EXTERN void document_cleanup (Document* self);
static void mind_map_initialize (MindMap* self);
VALA_EXTERN void map_model_initialize (MapModel* self);
VALA_EXTERN void draw_area_initialize (DrawArea* self);
VALA_EXTERN void undo_buffer_clear (UndoBuffer* self);
VALA_EXTERN gboolean selection_clear (Selection* self,
                          gboolean signal_change,
                          gdouble alpha);
VALA_EXTERN gboolean style_copy (Style* self,
                     Style* s);
VALA_EXTERN gpointer styles_ref (gpointer instance);
VALA_EXTERN void styles_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_styles (const gchar* name,
                               const gchar* nick,
                               const gchar* blurb,
                               GType object_type,
                               GParamFlags flags);
VALA_EXTERN void value_set_styles (GValue* value,
                       gpointer v_object);
VALA_EXTERN void value_take_styles (GValue* value,
                        gpointer v_object);
VALA_EXTERN gpointer value_get_styles (const GValue* value);
VALA_EXTERN GType styles_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Styles, styles_unref)
VALA_EXTERN Style* styles_get_global_style (Styles* self);
VALA_EXTERN gpointer template_ref (gpointer instance);
VALA_EXTERN void template_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_template (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags);
VALA_EXTERN void value_set_template (GValue* value,
                         gpointer v_object);
VALA_EXTERN void value_take_template (GValue* value,
                          gpointer v_object);
VALA_EXTERN gpointer value_get_template (const GValue* value);
VALA_EXTERN GType template_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Template, template_unref)
VALA_EXTERN gpointer templates_ref (gpointer instance);
VALA_EXTERN void templates_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_templates (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_templates (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_templates (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_templates (const GValue* value);
VALA_EXTERN GType templates_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Templates, templates_unref)
VALA_EXTERN Templates* main_window_get_templates (MainWindow* self);
VALA_EXTERN GType template_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Template* templates_get_template (Templates* self,
                                  TemplateType ttype,
                                  const gchar* name);
VALA_EXTERN GType style_template_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (StyleTemplate, template_unref)
VALA_EXTERN Style* style_template_get_style (StyleTemplate* self);
VALA_EXTERN void mind_map_initialize_for_open (MindMap* self);
VALA_EXTERN gint utils_compare_versions (const gchar* a,
                             const gchar* b);
VALA_EXTERN const gchar* document_get_load_version (Document* self);
VALA_EXTERN gboolean mind_map_get_editable (MindMap* self);
VALA_EXTERN Tags* map_model_get_tags (MapModel* self);
VALA_EXTERN void tags_load_variant (Tags* self,
                        GVariant* variant);
VALA_EXTERN GType node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Node, g_object_unref)
VALA_EXTERN void mind_map_set_current_node (MindMap* self,
                                Node* n);
VALA_EXTERN void mind_map_initialize_for_new (MindMap* self);
static void __lambda185_ (MindMap* self,
                   gint w,
                   gint h);
VALA_EXTERN Node* map_model_create_root_node (MapModel* self,
                                  const gchar* name);
VALA_EXTERN GType node_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void map_model_set_node_mode (MapModel* self,
                              Node* node,
                              NodeMode mode,
                              gboolean undoable);
VALA_EXTERN gboolean document_save_xml (Document* self);
VALA_EXTERN gboolean document_save (Document* self);
static void ___lambda185__draw_area_size_ready (DrawArea* _sender,
                                         gint width,
                                         gint height,
                                         gpointer self);
VALA_EXTERN void mind_map_update_enable_markdown (MindMap* self,
                                      gboolean enable);
VALA_EXTERN gboolean text_parser_get_enable (TextParser* self);
VALA_EXTERN void mind_map_queue_draw (MindMap* self);
VALA_EXTERN GType canvas_text_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CanvasText, g_object_unref)
VALA_EXTERN CanvasText* mind_map_get_current_text (MindMap* self);
VALA_EXTERN gboolean mind_map_is_node_editable (MindMap* self);
VALA_EXTERN Node* mind_map_get_current_node (MindMap* self);
VALA_EXTERN CanvasText* node_get_name (Node* self);
VALA_EXTERN gboolean mind_map_is_connection_editable (MindMap* self);
VALA_EXTERN GType connection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Connection, g_object_unref)
VALA_EXTERN Connection* mind_map_get_current_connection (MindMap* self);
VALA_EXTERN CanvasText* connection_get_title (Connection* self);
VALA_EXTERN gboolean mind_map_is_callout_editable (MindMap* self);
VALA_EXTERN GType callout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Callout, g_object_unref)
VALA_EXTERN Callout* mind_map_get_current_callout (MindMap* self);
VALA_EXTERN CanvasText* callout_get_text (Callout* self);
VALA_EXTERN void mind_map_unedit_text (MindMap* self);
VALA_EXTERN GType conn_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void map_model_set_connection_mode (MapModel* self,
                                    Connection* conn,
                                    ConnMode mode,
                                    gboolean undoable);
VALA_EXTERN GType callout_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void map_model_set_callout_mode (MapModel* self,
                                 Callout* callout,
                                 CalloutMode mode,
                                 gboolean undoable);
VALA_EXTERN Node* selection_current_node (Selection* self);
static gboolean mind_map_is_node_mode (MindMap* self,
                                NodeMode mode);
VALA_EXTERN NodeMode node_get_mode (Node* self);
VALA_EXTERN gboolean mind_map_is_node_selected (MindMap* self);
VALA_EXTERN gboolean selection_clear_nodes (Selection* self,
                                gboolean signal_change,
                                gdouble alpha);
VALA_EXTERN gboolean selection_is_node_selected (Selection* self,
                                     Node* node);
VALA_EXTERN gint selection_num_nodes (Selection* self);
VALA_EXTERN GArray* selection_nodes (Selection* self);
VALA_EXTERN Node* node_folded_ancestor (Node* self);
VALA_EXTERN void node_set_fold_only (Node* self,
                         gboolean value);
VALA_EXTERN GType undo_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoItem, g_object_unref)
VALA_EXTERN void mind_map_add_undo (MindMap* self,
                        UndoItem* item);
VALA_EXTERN UndoNodeFolds* undo_node_folds_new_single (Node* node);
VALA_EXTERN UndoNodeFolds* undo_node_folds_construct_single (GType object_type,
                                                 Node* node);
VALA_EXTERN GType undo_node_folds_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeFolds, g_object_unref)
VALA_EXTERN gboolean selection_add_node (Selection* self,
                             Node* node,
                             gboolean force_selected,
                             gboolean signal_change);
VALA_EXTERN gboolean mind_map_select_node (MindMap* self,
                               Node* n,
                               gboolean animate);
VALA_EXTERN void selection_set_current_node (Selection* self,
                                 Node* node,
                                 gdouble clear_alpha);
VALA_EXTERN Node* node_get_parent (Node* self);
VALA_EXTERN void node_set_last_selected_child (Node* self,
                                   Node* value);
VALA_EXTERN gboolean node_is_summarized (Node* self);
VALA_EXTERN GType summary_node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SummaryNode, g_object_unref)
VALA_EXTERN SummaryNode* node_summary_node (Node* self);
VALA_EXTERN void summary_node_set_last_selected_node (SummaryNode* self,
                                          Node* value);
VALA_EXTERN gboolean mind_map_root_selectable (MindMap* self);
VALA_EXTERN Connection* selection_current_connection (Selection* self);
VALA_EXTERN GArray* map_model_get_nodes (MapModel* self);
VALA_EXTERN Node* node_get_root (Node* self);
VALA_EXTERN void mind_map_select_root_node (MindMap* self);
VALA_EXTERN Node* mind_map_next_node_to_select (MindMap* self);
VALA_EXTERN gboolean node_is_root (Node* self);
VALA_EXTERN Node* node_next_child (Node* self,
                       Node* n,
                       gboolean wrap);
VALA_EXTERN Node* node_prev_child (Node* self,
                       Node* n,
                       gboolean wrap);
VALA_EXTERN void mind_map_select_sibling_node (MindMap* self,
                                   gint dir);
VALA_EXTERN Node* map_model_sibling_node (MapModel* self,
                              Node* node,
                              const gchar* dir,
                              gboolean wrap);
VALA_EXTERN gboolean mind_map_children_selectable (MindMap* self);
VALA_EXTERN gboolean node_is_leaf (Node* self);
VALA_EXTERN gboolean node_get_folded (Node* self);
VALA_EXTERN void mind_map_select_child_node (MindMap* self);
VALA_EXTERN Node* node_get_last_selected_child (Node* self);
VALA_EXTERN GArray* node_children (Node* self);
VALA_EXTERN void mind_map_select_child_nodes (MindMap* self);
VALA_EXTERN GArray* selection_nodes_copy (Selection* self);
VALA_EXTERN gboolean selection_add_child_nodes (Selection* self,
                                    Node* node,
                                    gboolean signal_change);
VALA_EXTERN void mind_map_select_node_tree (MindMap* self);
VALA_EXTERN gboolean selection_add_node_tree (Selection* self,
                                  Node* node,
                                  gboolean signal_change);
VALA_EXTERN gboolean mind_map_parent_selectable (MindMap* self);
VALA_EXTERN void mind_map_select_parent_nodes (MindMap* self);
static void _g_object_unref0_ (gpointer var);
static void _vala_Node_free_function_content_of (gpointer data);
VALA_EXTERN gboolean node_is_summary (Node* self);
VALA_EXTERN Node* summary_node_get_last_selected_node (SummaryNode* self);
VALA_EXTERN void mind_map_select_callout (MindMap* self);
VALA_EXTERN Callout* node_get_callout (Node* self);
VALA_EXTERN void mind_map_set_current_callout (MindMap* self,
                                   Callout* c);
VALA_EXTERN void mind_map_select_linked_node (MindMap* self,
                                  Node* node);
VALA_EXTERN gpointer node_link_ref (gpointer instance);
VALA_EXTERN void node_link_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_node_link (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_node_link (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_node_link (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_node_link (const GValue* value);
VALA_EXTERN GType node_link_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeLink, node_link_unref)
VALA_EXTERN NodeLink* node_get_linked_node (Node* self);
VALA_EXTERN void node_link_select (NodeLink* self,
                       MindMap* map);
VALA_EXTERN GArray* mind_map_get_selected_nodes (MindMap* self);
VALA_EXTERN GType select_box_get_type (void) G_GNUC_CONST ;
VALA_EXTERN SelectBox* select_box_dup (const SelectBox* self);
VALA_EXTERN void select_box_free (SelectBox* self);
VALA_EXTERN void mind_map_select_nodes_within_box (MindMap* self,
                                       SelectBox* select_box,
                                       gboolean shift);
VALA_EXTERN void map_model_get_nodes_within_rectangle (MapModel* self,
                                           GdkRectangle* box,
                                           GArray* nodes);
VALA_EXTERN gboolean selection_change_nodes (Selection* self,
                                 GArray* nodes,
                                 gboolean signal_change);
VALA_EXTERN gboolean selection_add_nodes (Selection* self,
                              GArray* nodes,
                              gboolean signal_change);
static gboolean mind_map_is_connection_mode (MindMap* self,
                                      ConnMode mode);
VALA_EXTERN ConnMode connection_get_mode (Connection* self);
VALA_EXTERN gboolean mind_map_is_connection_connecting (MindMap* self);
VALA_EXTERN gboolean mind_map_is_connection_selected (MindMap* self);
VALA_EXTERN void mind_map_set_current_connection (MindMap* self,
                                      Connection* c);
VALA_EXTERN void selection_set_current_connection (Selection* self,
                                       Connection* conn,
                                       gdouble clear_alpha);
VALA_EXTERN Node* connection_get_from_node (Connection* self);
VALA_EXTERN void node_set_last_selected_connection (Node* self,
                                        Connection* value);
VALA_EXTERN Node* connection_get_to_node (Connection* self);
VALA_EXTERN gboolean selection_clear_connections (Selection* self,
                                      gboolean signal_change,
                                      gdouble alpha);
VALA_EXTERN void mind_map_select_connection_node (MindMap* self,
                                      gboolean start);
VALA_EXTERN void draw_area_clear_current_connection (DrawArea* self,
                                         gboolean signal_change);
VALA_EXTERN void mind_map_select_connection (MindMap* self,
                                 gint dir);
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 Connection* connections_get_connection (Connections* self,
                                        Connection* conn,
                                        gint dir);
VALA_EXTERN void mind_map_select_attached_connection (MindMap* self);
VALA_EXTERN Connection* node_get_last_selected_connection (Node* self);
VALA_EXTERN Connection* connections_get_attached_connection (Connections* self,
                                                 Node* node,
                                                 gint index);
VALA_EXTERN GArray* mind_map_get_selected_connections (MindMap* self);
VALA_EXTERN GArray* selection_connections (Selection* self);
VALA_EXTERN void mind_map_select_callout_node (MindMap* self);
VALA_EXTERN gboolean mind_map_is_callout_selected (MindMap* self);
VALA_EXTERN Node* callout_get_node (Callout* self);
VALA_EXTERN gboolean selection_clear_callouts (Selection* self,
                                   gboolean signal_change,
                                   gdouble alpha);
VALA_EXTERN Callout* selection_current_callout (Selection* self);
static gboolean mind_map_is_callout_mode (MindMap* self,
                                   CalloutMode mode);
VALA_EXTERN CalloutMode callout_get_mode (Callout* self);
VALA_EXTERN void selection_set_current_callout (Selection* self,
                                    Callout* callout,
                                    gdouble clear_alpha);
VALA_EXTERN GArray* mind_map_get_selected_callouts (MindMap* self);
VALA_EXTERN GArray* selection_callouts (Selection* self);
VALA_EXTERN GType node_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeGroup, g_object_unref)
VALA_EXTERN NodeGroup* mind_map_get_current_group (MindMap* self);
VALA_EXTERN NodeGroup* selection_current_group (Selection* self);
VALA_EXTERN gboolean mind_map_is_group_selected (MindMap* self);
VALA_EXTERN void mind_map_set_current_group (MindMap* self,
                                 NodeGroup* g);
VALA_EXTERN void selection_set_current_group (Selection* self,
                                  NodeGroup* group,
                                  gdouble clear_alpha);
VALA_EXTERN void mind_map_group_select_main (MindMap* self);
VALA_EXTERN GArray* mind_map_get_selected_groups (MindMap* self);
VALA_EXTERN GArray* node_group_get_nodes (NodeGroup* self);
VALA_EXTERN Selection* mind_map_get_selected (MindMap* self);
VALA_EXTERN gboolean selection_clear_groups (Selection* self,
                                 gboolean signal_change);
VALA_EXTERN void mind_map_group_select_all (MindMap* self);
VALA_EXTERN GArray* selection_groups (Selection* self);
VALA_EXTERN GType sticker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Sticker, g_object_unref)
VALA_EXTERN Sticker* mind_map_get_current_sticker (MindMap* self);
VALA_EXTERN Sticker* selection_current_sticker (Selection* self);
VALA_EXTERN gboolean mind_map_is_sticker_selected (MindMap* self);
VALA_EXTERN void mind_map_set_current_sticker (MindMap* self,
                                   Sticker* s);
VALA_EXTERN void selection_set_current_sticker (Selection* self,
                                    Sticker* sticker,
                                    gdouble clear_alpha);
VALA_EXTERN gpointer stickers_ref (gpointer instance);
VALA_EXTERN void stickers_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_stickers (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags);
VALA_EXTERN void value_set_stickers (GValue* value,
                         gpointer v_object);
VALA_EXTERN void value_take_stickers (GValue* value,
                          gpointer v_object);
VALA_EXTERN gpointer value_get_stickers (const GValue* value);
VALA_EXTERN GType stickers_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Stickers, stickers_unref)
VALA_EXTERN Stickers* map_model_get_stickers (MapModel* self);
VALA_EXTERN void stickers_select_sticker (Stickers* self,
                              Sticker* sticker);
VALA_EXTERN void mind_map_select_all (MindMap* self);
VALA_EXTERN void canvas_text_set_cursor_all (CanvasText* self,
                                 gboolean motion);
VALA_EXTERN void mind_map_deselect_all (MindMap* self);
VALA_EXTERN void canvas_text_clear_selection (CanvasText* self,
                                  const gchar* msg);
VALA_EXTERN UndoBuffer* mind_map_current_undo_buffer (MindMap* self);
VALA_EXTERN UndoTextBuffer* mind_map_get_undo_text (MindMap* self);
VALA_EXTERN UndoBuffer* mind_map_get_undo_buffer (MindMap* self);
VALA_EXTERN void undo_buffer_add_item (UndoBuffer* self,
                           UndoItem* item);
VALA_EXTERN GType undo_text_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoTextItem, g_object_unref)
VALA_EXTERN void mind_map_add_text_undo (MindMap* self,
                             UndoTextItem* item);
VALA_EXTERN void mind_map_do_paste (MindMap* self,
                        gboolean shift);
VALA_EXTERN void minder_clipboard_paste (MindMap* map,
                             gboolean shift);
VALA_EXTERN void mind_map_do_paste_node_link (MindMap* self);
VALA_EXTERN gboolean minder_clipboard_node_pasteable (void);
VALA_EXTERN void minder_clipboard_paste_node_link (MindMap* map);
VALA_EXTERN GArray* mind_map_get_nodes (MindMap* self);
VALA_EXTERN Node* mind_map_sibling_node (MindMap* self,
                             gint dir,
                             gboolean wrap);
VALA_EXTERN void mind_map_change_current_link_color (MindMap* self);
static void __lambda108_ (MindMap* self,
                   GdkRGBA* color);
VALA_EXTERN void map_model_change_current_link_color (MapModel* self,
                                          GdkRGBA* color);
static void ___lambda108__gtk_color_chooser_color_activated (GtkColorChooser* _sender,
                                                      GdkRGBA* color,
                                                      gpointer self);
VALA_EXTERN GType tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tag, g_object_unref)
VALA_EXTERN void mind_map_remove_tag (MindMap* self,
                          Tag* tag,
                          GArray* nodes);
VALA_EXTERN void map_model_remove_tag (MapModel* self,
                           Tag* tag,
                           GArray* nodes);
VALA_EXTERN void mind_map_swap_nodes (MindMap* self,
                          Node* node,
                          Node* other);
VALA_EXTERN Node* node_previous_sibling (Node* self,
                             gboolean wrap);
VALA_EXTERN gint node_index (Node* 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_add_nodes (Animator* self,
                         GArray* n,
                         gboolean exclude_selected,
                         const gchar* name);
VALA_EXTERN void node_swap_with_previous_sibling (Node* self);
VALA_EXTERN GType node_side_get_type (void) G_GNUC_CONST ;
VALA_EXTERN NodeSide node_get_side (Node* self);
VALA_EXTERN UndoNodeMove* undo_node_move_new (Node* n,
                                  NodeSide old_side,
                                  gint old_index,
                                  SummaryNode* old_summary);
VALA_EXTERN UndoNodeMove* undo_node_move_construct (GType object_type,
                                        Node* n,
                                        NodeSide old_side,
                                        gint old_index,
                                        SummaryNode* old_summary);
VALA_EXTERN GType undo_node_move_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeMove, g_object_unref)
VALA_EXTERN UndoNodeUnclify* undo_node_unclify_new (Node* node);
VALA_EXTERN UndoNodeUnclify* undo_node_unclify_construct (GType object_type,
                                              Node* node);
VALA_EXTERN GType undo_node_unclify_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeUnclify, g_object_unref)
VALA_EXTERN void node_make_parent_sibling (Node* self);
VALA_EXTERN gboolean node_contains_node (Node* self,
                             Node* node);
VALA_EXTERN void node_make_children_siblings (Node* self);
VALA_EXTERN UndoNodeReparent* undo_node_reparent_new (Node* node,
                                          gint first_index,
                                          gint last_index);
VALA_EXTERN UndoNodeReparent* undo_node_reparent_construct (GType object_type,
                                                Node* node,
                                                gint first_index,
                                                gint last_index);
VALA_EXTERN GType undo_node_reparent_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeReparent, g_object_unref)
VALA_EXTERN void animator_animate (Animator* self);
VALA_EXTERN void mind_map_auto_save (MindMap* self);
VALA_EXTERN void mind_map_attach_selected_nodes (MindMap* self);
VALA_EXTERN Node* map_model_get_attach_node (MapModel* self);
VALA_EXTERN GArray* selection_ordered_nodes (Selection* self);
VALA_EXTERN UndoNodesAttach* undo_nodes_attach_new (GArray* nodes,
                                        Node* parent);
VALA_EXTERN UndoNodesAttach* undo_nodes_attach_construct (GType object_type,
                                              GArray* nodes,
                                              Node* parent);
VALA_EXTERN GType undo_nodes_attach_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodesAttach, g_object_unref)
VALA_EXTERN void map_model_attach_nodes (MapModel* self,
                             GArray* nodes,
                             Node* parent);
VALA_EXTERN void map_model_set_attach_node (MapModel* self,
                                Node* n,
                                NodeMode mode);
VALA_EXTERN gint tags_size (Tags* self);
VALA_EXTERN void node_set_alpha (Node* self,
                     gdouble value);
VALA_EXTERN void map_model_highlight_tags (MapModel* self,
                               Tags* tags,
                               TagComboType combo_type);
VALA_EXTERN void node_set_alpha_only (Node* self,
                          gdouble value);
VALA_EXTERN void connections_update_alpha (Connections* self);
VALA_EXTERN void connection_set_alpha (Connection* self,
                           gdouble value);
VALA_EXTERN void node_update_alpha (Node* self,
                        gdouble value);
VALA_EXTERN void mind_map_get_saved_dimensions (MindMap* self,
                                    gint* width,
                                    gint* height);
VALA_EXTERN void map_model_auto_save (MapModel* self);
VALA_EXTERN GType theme_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Theme, g_object_unref)
VALA_EXTERN Theme* mind_map_get_theme (MindMap* self);
VALA_EXTERN Theme* map_model_get_theme (MapModel* self);
VALA_EXTERN TaggerParser* mind_map_get_tagger_parser (MindMap* self);
VALA_EXTERN MainWindow* mind_map_get_win (MindMap* self);
VALA_EXTERN GSettings* mind_map_get_settings (MindMap* self);
VALA_EXTERN MapModel* mind_map_get_model (MindMap* self);
VALA_EXTERN DrawArea* mind_map_get_canvas (MindMap* self);
VALA_EXTERN gboolean mind_map_get_focus_mode (MindMap* self);
VALA_EXTERN void mind_map_set_focus_mode (MindMap* self,
                              gboolean value);
VALA_EXTERN gdouble mind_map_get_focus_alpha (MindMap* self);
VALA_EXTERN Tags* mind_map_get_highlighted (MindMap* self);
VALA_EXTERN TagComboType mind_map_get_highlight_mode (MindMap* self);
VALA_EXTERN void mind_map_set_highlight_mode (MindMap* self,
                                  TagComboType value);
VALA_EXTERN Style* mind_map_get_global_style (MindMap* self);
VALA_EXTERN gdouble mind_map_get_origin_x (MindMap* self);
VALA_EXTERN gdouble draw_area_get_origin_x (DrawArea* self);
VALA_EXTERN gdouble mind_map_get_origin_y (MindMap* self);
VALA_EXTERN gdouble draw_area_get_origin_y (DrawArea* self);
VALA_EXTERN Animator* draw_area_get_animator (DrawArea* self);
VALA_EXTERN GArray* mind_map_get_braindump (MindMap* self);
VALA_EXTERN GArray* map_model_get_braindump (MapModel* self);
VALA_EXTERN Connections* mind_map_get_connections (MindMap* self);
VALA_EXTERN Stickers* mind_map_get_stickers (MindMap* self);
VALA_EXTERN gpointer node_groups_ref (gpointer instance);
VALA_EXTERN void node_groups_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_node_groups (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_node_groups (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_node_groups (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_node_groups (const GValue* value);
VALA_EXTERN GType node_groups_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeGroups, node_groups_unref)
VALA_EXTERN NodeGroups* mind_map_get_groups (MindMap* self);
VALA_EXTERN NodeGroups* map_model_get_groups (MapModel* self);
VALA_EXTERN gpointer image_manager_ref (gpointer instance);
VALA_EXTERN void image_manager_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_image_manager (const gchar* name,
                                      const gchar* nick,
                                      const gchar* blurb,
                                      GType object_type,
                                      GParamFlags flags);
VALA_EXTERN void value_set_image_manager (GValue* value,
                              gpointer v_object);
VALA_EXTERN void value_take_image_manager (GValue* value,
                               gpointer v_object);
VALA_EXTERN gpointer value_get_image_manager (const GValue* value);
VALA_EXTERN GType image_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImageManager, image_manager_unref)
VALA_EXTERN ImageManager* mind_map_get_image_manager (MindMap* self);
VALA_EXTERN ImageManager* map_model_get_image_manager (MapModel* self);
VALA_EXTERN GType layouts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Layouts, g_object_unref)
VALA_EXTERN Layouts* mind_map_get_layouts (MindMap* self);
VALA_EXTERN Layouts* map_model_get_layouts (MapModel* self);
VALA_EXTERN gint mind_map_get_next_node_id (MindMap* self);
VALA_EXTERN gint map_model_get_next_node_id (MapModel* self);
VALA_EXTERN void mind_map_set_next_node_id (MindMap* self,
                                gint value);
VALA_EXTERN void map_model_set_next_node_id (MapModel* self,
                                 gint value);
VALA_EXTERN gboolean document_get_read_only (Document* self);
VALA_EXTERN void mind_map_set_editable (MindMap* self,
                            gboolean value);
static void g_cclosure_user_marshal_VOID__MIND_MAP (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data);
VALA_EXTERN GType property_grab_get_type (void) G_GNUC_CONST ;
static void g_cclosure_user_marshal_VOID__STRING_ENUM (GClosure * closure,
                                                GValue * return_value,
                                                guint n_param_values,
                                                const GValue * param_values,
                                                gpointer invocation_hint,
                                                gpointer marshal_data);
static void mind_map_finalize (MindMap * obj);
static GType mind_map_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
mind_map_get_instance_private (MindMap* self)
{
	return G_STRUCT_MEMBER_P (self, MindMap_private_offset);
}

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

static void
_mind_map_handle_model_changed_map_model_changed (MapModel* _sender,
                                                  gpointer self)
{
	mind_map_handle_model_changed ((MindMap*) self);
}

static void
_mind_map_handle_current_changed_map_model_current_changed (MapModel* _sender,
                                                            gpointer self)
{
	mind_map_handle_current_changed ((MindMap*) self);
}

static void
_mind_map_handle_theme_changed_map_model_theme_changed (MapModel* _sender,
                                                        gpointer self)
{
	mind_map_handle_theme_changed ((MindMap*) self);
}

static void
_mind_map_handle_model_loaded_map_model_loaded (MapModel* _sender,
                                                gpointer self)
{
	mind_map_handle_model_loaded ((MindMap*) self);
}

static void
_gtk_widget_queue_draw_map_model_queue_draw (MapModel* _sender,
                                             gpointer self)
{
	gtk_widget_queue_draw ((GtkWidget*) self);
}

static void
_draw_area_see_map_model_see (MapModel* _sender,
                              gboolean animate,
                              gdouble width_adjust,
                              gdouble pad,
                              gpointer self)
{
	draw_area_see ((DrawArea*) self, animate, width_adjust, pad);
}

static void
_mind_map_handle_current_changed_draw_area_current_changed (DrawArea* _sender,
                                                            MindMap* map,
                                                            gpointer self)
{
	mind_map_handle_current_changed ((MindMap*) self);
}

static void
_mind_map_handle_scale_changed_draw_area_scale_changed (DrawArea* _sender,
                                                        gdouble scale,
                                                        gpointer self)
{
	mind_map_handle_scale_changed ((MindMap*) self, scale);
}

static void
_mind_map_handle_scroll_changed_draw_area_scroll_changed (DrawArea* _sender,
                                                          gpointer self)
{
	mind_map_handle_scroll_changed ((MindMap*) self);
}

static void
_mind_map_handle_read_only_changed_document_read_only_changed (Document* _sender,
                                                               gpointer self)
{
	mind_map_handle_read_only_changed ((MindMap*) self);
}

static void
_mind_map_handle_undo_buffer_changed_undo_buffer_buffer_changed (UndoBuffer* _sender,
                                                                 UndoBuffer* buf,
                                                                 gpointer self)
{
	mind_map_handle_undo_buffer_changed ((MindMap*) self, buf);
}

static void
_mind_map_handle_selection_changed_selection_selection_changed (Selection* _sender,
                                                                gpointer self)
{
	mind_map_handle_selection_changed ((MindMap*) self);
}

static void
_mind_map_handle_tag_highlight_changed_tags_changed (Tags* _sender,
                                                     gpointer self)
{
	mind_map_handle_tag_highlight_changed ((MindMap*) self);
}

static void
__lambda239_ (MindMap* self)
{
	mind_map_update_focus_mode_alpha (self);
}

static void
___lambda239__g_settings_changed (GSettings* _sender,
                                  const gchar* key,
                                  gpointer self)
{
	__lambda239_ ((MindMap*) self);
}

MindMap*
mind_map_construct (GType object_type,
                    MainWindow* win,
                    GSettings* settings)
{
	MindMap* self = NULL;
	MainWindow* _tmp0_;
	GSettings* _tmp1_;
	MapModel* _tmp2_;
	DrawArea* _tmp3_;
	Document* _tmp4_;
	UndoBuffer* _tmp5_;
	UndoTextBuffer* _tmp6_;
	Selection* _tmp7_;
	Style* _tmp8_;
	Tags* _tmp9_;
	TaggerParser* _tmp10_;
	TaggerParser* _tmp11_;
	MarkdownParser* _tmp12_;
	MarkdownParser* _tmp13_;
	UrlParser* _tmp14_;
	UrlParser* _tmp15_;
	UnicodeParser* _tmp16_;
	UnicodeParser* _tmp17_;
	MarkdownParser* _tmp18_;
	UrlParser* _tmp19_;
	UnicodeParser* _tmp20_;
	MapModel* _tmp21_;
	MapModel* _tmp22_;
	MapModel* _tmp23_;
	MapModel* _tmp24_;
	MapModel* _tmp25_;
	DrawArea* _tmp26_;
	MapModel* _tmp27_;
	DrawArea* _tmp28_;
	DrawArea* _tmp29_;
	DrawArea* _tmp30_;
	DrawArea* _tmp31_;
	Document* _tmp32_;
	UndoBuffer* _tmp33_;
	Selection* _tmp34_;
	Tags* _tmp35_;
	GSettings* _tmp36_;
	g_return_val_if_fail (win != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	self = (MindMap*) g_type_create_instance (object_type);
	_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_;
	_tmp2_ = map_model_new (self);
	_map_model_unref0 (self->priv->_model);
	self->priv->_model = _tmp2_;
	_tmp3_ = draw_area_new (self, win);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->_canvas);
	self->priv->_canvas = _tmp3_;
	_tmp4_ = document_new (self);
	_g_object_unref0 (self->priv->_doc);
	self->priv->_doc = _tmp4_;
	_tmp5_ = undo_buffer_new (self);
	_g_object_unref0 (self->priv->_undo_buffer);
	self->priv->_undo_buffer = _tmp5_;
	_tmp6_ = undo_text_buffer_new (self);
	_g_object_unref0 (self->priv->_undo_text);
	self->priv->_undo_text = _tmp6_;
	_tmp7_ = selection_new (self);
	_selection_unref0 (self->priv->_selected);
	self->priv->_selected = _tmp7_;
	_tmp8_ = style_new ();
	_style_unref0 (self->priv->_global_style);
	self->priv->_global_style = _tmp8_;
	_tmp9_ = tags_new ();
	_tags_unref0 (self->priv->_highlighted);
	self->priv->_highlighted = _tmp9_;
	_tmp10_ = tagger_parser_new (self);
	_tmp11_ = _tmp10_;
	mind_map_set_tagger_parser (self, _tmp11_);
	_text_parser_unref0 (_tmp11_);
	_tmp12_ = markdown_parser_new (self);
	_tmp13_ = _tmp12_;
	mind_map_set_markdown_parser (self, _tmp13_);
	_text_parser_unref0 (_tmp13_);
	_tmp14_ = url_parser_new ();
	_tmp15_ = _tmp14_;
	mind_map_set_url_parser (self, _tmp15_);
	_text_parser_unref0 (_tmp15_);
	_tmp16_ = unicode_parser_new (self);
	_tmp17_ = _tmp16_;
	mind_map_set_unicode_parser (self, _tmp17_);
	_text_parser_unref0 (_tmp17_);
	_tmp18_ = self->priv->_markdown_parser;
	text_parser_set_enable ((TextParser*) _tmp18_, g_settings_get_boolean (settings, "enable-markdown"));
	_tmp19_ = self->priv->_url_parser;
	text_parser_set_enable ((TextParser*) _tmp19_, g_settings_get_boolean (settings, "auto-parse-embedded-urls"));
	_tmp20_ = self->priv->_unicode_parser;
	text_parser_set_enable ((TextParser*) _tmp20_, g_settings_get_boolean (settings, "enable-unicode-input"));
	_tmp21_ = self->priv->_model;
	g_signal_connect (_tmp21_, "changed", (GCallback) _mind_map_handle_model_changed_map_model_changed, self);
	_tmp22_ = self->priv->_model;
	g_signal_connect (_tmp22_, "current-changed", (GCallback) _mind_map_handle_current_changed_map_model_current_changed, self);
	_tmp23_ = self->priv->_model;
	g_signal_connect (_tmp23_, "theme-changed", (GCallback) _mind_map_handle_theme_changed_map_model_theme_changed, self);
	_tmp24_ = self->priv->_model;
	g_signal_connect (_tmp24_, "loaded", (GCallback) _mind_map_handle_model_loaded_map_model_loaded, self);
	_tmp25_ = self->priv->_model;
	_tmp26_ = self->priv->_canvas;
	g_signal_connect_object (_tmp25_, "queue-draw", (GCallback) _gtk_widget_queue_draw_map_model_queue_draw, (GtkWidget*) _tmp26_, 0);
	_tmp27_ = self->priv->_model;
	_tmp28_ = self->priv->_canvas;
	g_signal_connect_object (_tmp27_, "see", (GCallback) _draw_area_see_map_model_see, _tmp28_, 0);
	_tmp29_ = self->priv->_canvas;
	g_signal_connect (_tmp29_, "current-changed", (GCallback) _mind_map_handle_current_changed_draw_area_current_changed, self);
	_tmp30_ = self->priv->_canvas;
	g_signal_connect (_tmp30_, "scale-changed", (GCallback) _mind_map_handle_scale_changed_draw_area_scale_changed, self);
	_tmp31_ = self->priv->_canvas;
	g_signal_connect (_tmp31_, "scroll-changed", (GCallback) _mind_map_handle_scroll_changed_draw_area_scroll_changed, self);
	_tmp32_ = self->priv->_doc;
	g_signal_connect (_tmp32_, "read-only-changed", (GCallback) _mind_map_handle_read_only_changed_document_read_only_changed, self);
	_tmp33_ = self->priv->_undo_buffer;
	g_signal_connect (_tmp33_, "buffer-changed", (GCallback) _mind_map_handle_undo_buffer_changed_undo_buffer_buffer_changed, self);
	_tmp34_ = self->priv->_selected;
	g_signal_connect (_tmp34_, "selection-changed", (GCallback) _mind_map_handle_selection_changed_selection_selection_changed, self);
	_tmp35_ = self->priv->_highlighted;
	g_signal_connect (_tmp35_, "changed", (GCallback) _mind_map_handle_tag_highlight_changed_tags_changed, self);
	mind_map_update_focus_mode_alpha (self);
	_tmp36_ = self->priv->_settings;
	g_signal_connect (_tmp36_, "changed", (GCallback) ___lambda239__g_settings_changed, self);
	return self;
}

MindMap*
mind_map_new (MainWindow* win,
              GSettings* settings)
{
	return mind_map_construct (TYPE_MIND_MAP, win, settings);
}

static void
mind_map_handle_model_changed (MindMap* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, mind_map_signals[MIND_MAP_CHANGED_SIGNAL], 0);
}

static void
mind_map_handle_current_changed (MindMap* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, mind_map_signals[MIND_MAP_CURRENT_CHANGED_SIGNAL], 0, self);
}

static void
mind_map_handle_theme_changed (MindMap* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, mind_map_signals[MIND_MAP_THEME_CHANGED_SIGNAL], 0, self);
}

static void
mind_map_handle_model_loaded (MindMap* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, mind_map_signals[MIND_MAP_LOADED_SIGNAL], 0);
	g_signal_emit (self, mind_map_signals[MIND_MAP_RELOAD_TAGS_SIGNAL], 0);
}

static void
mind_map_handle_scale_changed (MindMap* self,
                               gdouble scale)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, mind_map_signals[MIND_MAP_SCALE_CHANGED_SIGNAL], 0, scale);
}

static void
mind_map_handle_scroll_changed (MindMap* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, mind_map_signals[MIND_MAP_SCROLL_CHANGED_SIGNAL], 0);
}

static void
mind_map_handle_read_only_changed (MindMap* self)
{
	g_return_if_fail (self != NULL);
	g_signal_emit (self, mind_map_signals[MIND_MAP_EDITABLE_CHANGED_SIGNAL], 0, self);
}

static void
mind_map_handle_undo_buffer_changed (MindMap* self,
                                     UndoBuffer* buf)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (buf != NULL);
	g_signal_emit (self, mind_map_signals[MIND_MAP_UNDO_BUFFER_CHANGED_SIGNAL], 0, buf);
}

static void
mind_map_handle_selection_changed (MindMap* self)
{
	DrawArea* _tmp0_;
	g_return_if_fail (self != NULL);
	mind_map_update_focus_mode (self);
	_tmp0_ = self->priv->_canvas;
	gtk_widget_queue_draw ((GtkWidget*) _tmp0_);
	g_signal_emit (self, mind_map_signals[MIND_MAP_CURRENT_CHANGED_SIGNAL], 0, self);
}

static void
mind_map_handle_tag_highlight_changed (MindMap* self)
{
	DrawArea* _tmp0_;
	g_return_if_fail (self != NULL);
	mind_map_update_focus_mode (self);
	_tmp0_ = self->priv->_canvas;
	gtk_widget_queue_draw ((GtkWidget*) _tmp0_);
}

void
mind_map_close (MindMap* self)
{
	Document* _tmp0_;
	Document* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_doc (self);
	_tmp1_ = _tmp0_;
	document_cleanup (_tmp1_);
}

static gpointer
_template_ref0 (gpointer self)
{
	return self ? template_ref (self) : NULL;
}

static void
mind_map_initialize (MindMap* self)
{
	MapModel* _tmp0_;
	DrawArea* _tmp1_;
	UndoBuffer* _tmp2_;
	UndoTextBuffer* _tmp3_;
	Selection* _tmp4_;
	GSettings* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_model;
	map_model_initialize (_tmp0_);
	_tmp1_ = self->priv->_canvas;
	draw_area_initialize (_tmp1_);
	_tmp2_ = self->priv->_undo_buffer;
	undo_buffer_clear (_tmp2_);
	_tmp3_ = self->priv->_undo_text;
	undo_buffer_clear ((UndoBuffer*) _tmp3_);
	_tmp4_ = self->priv->_selected;
	selection_clear (_tmp4_, TRUE, 1.0);
	_tmp5_ = self->priv->_settings;
	switch (g_settings_get_int (_tmp5_, "default-global-style")) {
		case 0:
		{
			Style* _tmp6_;
			Styles* _tmp7_;
			Style* _tmp8_;
			Style* _tmp9_;
			_tmp6_ = self->priv->_global_style;
			_tmp7_ = style_inspector_styles;
			_tmp8_ = styles_get_global_style (_tmp7_);
			_tmp9_ = _tmp8_;
			style_copy (_tmp6_, _tmp9_);
			_style_unref0 (_tmp9_);
			break;
		}
		case 1:
		{
			Style* _tmp10_;
			_tmp10_ = style_inspector_last_global_style;
			if (_tmp10_ != NULL) {
				Style* _tmp11_;
				Style* _tmp12_;
				_tmp11_ = self->priv->_global_style;
				_tmp12_ = style_inspector_last_global_style;
				style_copy (_tmp11_, _tmp12_);
			} else {
				Style* _tmp13_;
				Styles* _tmp14_;
				Style* _tmp15_;
				Style* _tmp16_;
				_tmp13_ = self->priv->_global_style;
				_tmp14_ = style_inspector_styles;
				_tmp15_ = styles_get_global_style (_tmp14_);
				_tmp16_ = _tmp15_;
				style_copy (_tmp13_, _tmp16_);
				_style_unref0 (_tmp16_);
			}
			break;
		}
		default:
		{
			Template* template = NULL;
			MainWindow* _tmp17_;
			Templates* _tmp18_;
			Templates* _tmp19_;
			GSettings* _tmp20_;
			gchar* _tmp21_;
			gchar* _tmp22_;
			Template* _tmp23_;
			Template* _tmp24_;
			Template* _tmp25_;
			_tmp17_ = self->priv->_win;
			_tmp18_ = main_window_get_templates (_tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = minder_settings;
			_tmp21_ = g_settings_get_string (_tmp20_, "default-global-style-name");
			_tmp22_ = _tmp21_;
			_tmp23_ = templates_get_template (_tmp19_, TEMPLATE_TYPE_STYLE_GENERAL, _tmp22_);
			_tmp24_ = _tmp23_;
			_g_free0 (_tmp22_);
			template = _tmp24_;
			_tmp25_ = template;
			if (_tmp25_ != NULL) {
				StyleTemplate* style_template = NULL;
				Template* _tmp26_;
				StyleTemplate* _tmp27_;
				Style* _tmp28_;
				StyleTemplate* _tmp29_;
				Style* _tmp30_;
				Style* _tmp31_;
				_tmp26_ = template;
				_tmp27_ = _template_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, TYPE_STYLE_TEMPLATE, StyleTemplate));
				style_template = _tmp27_;
				_tmp28_ = self->priv->_global_style;
				_tmp29_ = style_template;
				_tmp30_ = style_template_get_style (_tmp29_);
				_tmp31_ = _tmp30_;
				style_copy (_tmp28_, _tmp31_);
				_template_unref0 (style_template);
			} else {
				Style* _tmp32_;
				Styles* _tmp33_;
				Style* _tmp34_;
				Style* _tmp35_;
				_tmp32_ = self->priv->_global_style;
				_tmp33_ = style_inspector_styles;
				_tmp34_ = styles_get_global_style (_tmp33_);
				_tmp35_ = _tmp34_;
				style_copy (_tmp32_, _tmp35_);
				_style_unref0 (_tmp35_);
			}
			_template_unref0 (template);
			break;
		}
	}
}

void
mind_map_initialize_for_open (MindMap* self)
{
	gboolean _tmp0_ = FALSE;
	Document* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	DrawArea* _tmp12_;
	g_return_if_fail (self != NULL);
	mind_map_initialize (self);
	_tmp1_ = self->priv->_doc;
	_tmp2_ = document_get_load_version (_tmp1_);
	_tmp3_ = _tmp2_;
	if (utils_compare_versions (_tmp3_, "2.0") == -1) {
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp4_ = mind_map_get_editable (self);
		_tmp5_ = _tmp4_;
		_tmp0_ = !_tmp5_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		MapModel* _tmp6_;
		Tags* _tmp7_;
		Tags* _tmp8_;
		GSettings* _tmp9_;
		GVariant* _tmp10_;
		GVariant* _tmp11_;
		_tmp6_ = self->priv->_model;
		_tmp7_ = map_model_get_tags (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = minder_settings;
		_tmp10_ = g_settings_get_value (_tmp9_, "starting-tags");
		_tmp11_ = _tmp10_;
		tags_load_variant (_tmp8_, _tmp11_);
		_g_variant_unref0 (_tmp11_);
	}
	mind_map_set_current_node (self, NULL);
	_tmp12_ = self->priv->_canvas;
	gtk_widget_queue_draw ((GtkWidget*) _tmp12_);
}

static void
__lambda185_ (MindMap* self,
              gint w,
              gint h)
{
	Node* n = NULL;
	MapModel* _tmp0_;
	Node* _tmp1_;
	MapModel* _tmp2_;
	Document* _tmp3_;
	Document* _tmp4_;
	Document* _tmp5_;
	Document* _tmp6_;
	DrawArea* _tmp7_;
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_create_root_node (_tmp0_, _ ("Main Idea"));
	n = _tmp1_;
	mind_map_set_current_node (self, n);
	_tmp2_ = self->priv->_model;
	map_model_set_node_mode (_tmp2_, n, NODE_MODE_EDITABLE, FALSE);
	_tmp3_ = mind_map_get_doc (self);
	_tmp4_ = _tmp3_;
	document_save_xml (_tmp4_);
	_tmp5_ = mind_map_get_doc (self);
	_tmp6_ = _tmp5_;
	document_save (_tmp6_);
	_tmp7_ = self->priv->_canvas;
	gtk_widget_queue_draw ((GtkWidget*) _tmp7_);
	_g_object_unref0 (n);
}

static void
___lambda185__draw_area_size_ready (DrawArea* _sender,
                                    gint width,
                                    gint height,
                                    gpointer self)
{
	__lambda185_ ((MindMap*) self, width, height);
}

void
mind_map_initialize_for_new (MindMap* self)
{
	MapModel* _tmp0_;
	Tags* _tmp1_;
	Tags* _tmp2_;
	GSettings* _tmp3_;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	DrawArea* _tmp6_;
	g_return_if_fail (self != NULL);
	mind_map_initialize (self);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_tags (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = minder_settings;
	_tmp4_ = g_settings_get_value (_tmp3_, "starting-tags");
	_tmp5_ = _tmp4_;
	tags_load_variant (_tmp2_, _tmp5_);
	_g_variant_unref0 (_tmp5_);
	g_signal_emit (self, mind_map_signals[MIND_MAP_RELOAD_TAGS_SIGNAL], 0);
	_tmp6_ = self->priv->_canvas;
	g_signal_connect (_tmp6_, "size-ready", (GCallback) ___lambda185__draw_area_size_ready, self);
}

void
mind_map_update_enable_markdown (MindMap* self,
                                 gboolean enable)
{
	MarkdownParser* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_markdown_parser;
	_tmp1_ = text_parser_get_enable ((TextParser*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != enable) {
		MarkdownParser* _tmp3_;
		_tmp3_ = self->priv->_markdown_parser;
		text_parser_set_enable ((TextParser*) _tmp3_, enable);
		mind_map_queue_draw (self);
	}
}

CanvasText*
mind_map_get_current_text (MindMap* self)
{
	CanvasText* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (mind_map_is_node_editable (self)) {
		Node* _tmp0_;
		Node* _tmp1_;
		CanvasText* _tmp2_;
		CanvasText* _tmp3_;
		CanvasText* _tmp4_;
		CanvasText* _tmp5_;
		_tmp0_ = mind_map_get_current_node (self);
		_tmp1_ = _tmp0_;
		_tmp2_ = node_get_name (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp1_);
		result = _tmp5_;
		return result;
	} else {
		if (mind_map_is_connection_editable (self)) {
			Connection* _tmp6_;
			Connection* _tmp7_;
			CanvasText* _tmp8_;
			CanvasText* _tmp9_;
			CanvasText* _tmp10_;
			CanvasText* _tmp11_;
			_tmp6_ = mind_map_get_current_connection (self);
			_tmp7_ = _tmp6_;
			_tmp8_ = connection_get_title (_tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = _g_object_ref0 (_tmp9_);
			_tmp11_ = _tmp10_;
			_g_object_unref0 (_tmp7_);
			result = _tmp11_;
			return result;
		} else {
			if (mind_map_is_callout_editable (self)) {
				Callout* _tmp12_;
				Callout* _tmp13_;
				CanvasText* _tmp14_;
				CanvasText* _tmp15_;
				CanvasText* _tmp16_;
				CanvasText* _tmp17_;
				_tmp12_ = mind_map_get_current_callout (self);
				_tmp13_ = _tmp12_;
				_tmp14_ = callout_get_text (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = _g_object_ref0 (_tmp15_);
				_tmp17_ = _tmp16_;
				_g_object_unref0 (_tmp13_);
				result = _tmp17_;
				return result;
			} else {
				result = NULL;
				return result;
			}
		}
	}
}

void
mind_map_unedit_text (MindMap* self)
{
	g_return_if_fail (self != NULL);
	if (mind_map_is_node_editable (self)) {
		MapModel* _tmp0_;
		Node* _tmp1_;
		Node* _tmp2_;
		_tmp0_ = self->priv->_model;
		_tmp1_ = mind_map_get_current_node (self);
		_tmp2_ = _tmp1_;
		map_model_set_node_mode (_tmp0_, _tmp2_, NODE_MODE_CURRENT, TRUE);
		_g_object_unref0 (_tmp2_);
	} else {
		if (mind_map_is_connection_editable (self)) {
			MapModel* _tmp3_;
			Connection* _tmp4_;
			Connection* _tmp5_;
			_tmp3_ = self->priv->_model;
			_tmp4_ = mind_map_get_current_connection (self);
			_tmp5_ = _tmp4_;
			map_model_set_connection_mode (_tmp3_, _tmp5_, CONN_MODE_SELECTED, TRUE);
			_g_object_unref0 (_tmp5_);
		} else {
			if (mind_map_is_callout_editable (self)) {
				MapModel* _tmp6_;
				Callout* _tmp7_;
				Callout* _tmp8_;
				_tmp6_ = self->priv->_model;
				_tmp7_ = mind_map_get_current_callout (self);
				_tmp8_ = _tmp7_;
				map_model_set_callout_mode (_tmp6_, _tmp8_, CALLOUT_MODE_SELECTED, TRUE);
				_g_object_unref0 (_tmp8_);
			}
		}
	}
	mind_map_queue_draw (self);
}

Node*
mind_map_get_current_node (MindMap* self)
{
	Selection* _tmp0_;
	Node* _tmp1_;
	Node* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_node (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
mind_map_is_node_mode (MindMap* self,
                       NodeMode mode)
{
	Node* current = NULL;
	Node* _tmp0_;
	gboolean _tmp1_ = FALSE;
	Node* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = mind_map_get_current_node (self);
	current = _tmp0_;
	_tmp2_ = current;
	if (_tmp2_ != NULL) {
		Node* _tmp3_;
		NodeMode _tmp4_;
		NodeMode _tmp5_;
		_tmp3_ = current;
		_tmp4_ = node_get_mode (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ == mode;
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	_g_object_unref0 (current);
	return result;
}

gboolean
mind_map_is_node_selected (MindMap* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = mind_map_is_node_mode (self, NODE_MODE_CURRENT);
	return result;
}

gboolean
mind_map_is_node_editable (MindMap* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = mind_map_is_node_mode (self, NODE_MODE_EDITABLE);
	return result;
}

void
mind_map_set_current_node (MindMap* self,
                           Node* n)
{
	g_return_if_fail (self != NULL);
	if (n == NULL) {
		Selection* _tmp0_;
		_tmp0_ = self->priv->_selected;
		selection_clear_nodes (_tmp0_, TRUE, 1.0);
	} else {
		gboolean _tmp1_ = FALSE;
		Selection* _tmp2_;
		_tmp2_ = self->priv->_selected;
		if (selection_is_node_selected (_tmp2_, n)) {
			Selection* _tmp3_;
			_tmp3_ = self->priv->_selected;
			_tmp1_ = selection_num_nodes (_tmp3_) == 1;
		} else {
			_tmp1_ = FALSE;
		}
		if (_tmp1_) {
			MapModel* _tmp4_;
			Selection* _tmp5_;
			GArray* _tmp6_;
			GArray* _tmp7_;
			Node* _tmp8_;
			_tmp4_ = self->priv->_model;
			_tmp5_ = self->priv->_selected;
			_tmp6_ = selection_nodes (_tmp5_);
			_tmp7_ = _tmp6_;
			_tmp8_ = g_array_index (_tmp7_, Node*, (guint) 0);
			map_model_set_node_mode (_tmp4_, _tmp8_, NODE_MODE_CURRENT, TRUE);
			_g_array_unref0 (_tmp7_);
		} else {
			Selection* _tmp9_;
			Node* last_folded = NULL;
			Node* _tmp10_;
			Node* _tmp11_;
			Selection* _tmp16_;
			_tmp9_ = self->priv->_selected;
			selection_clear_nodes (_tmp9_, FALSE, 1.0);
			_tmp10_ = node_folded_ancestor (n);
			last_folded = _tmp10_;
			_tmp11_ = last_folded;
			if (_tmp11_ != NULL) {
				Node* _tmp12_;
				Node* _tmp13_;
				UndoNodeFolds* _tmp14_;
				UndoNodeFolds* _tmp15_;
				_tmp12_ = last_folded;
				node_set_fold_only (_tmp12_, FALSE);
				_tmp13_ = last_folded;
				_tmp14_ = undo_node_folds_new_single (_tmp13_);
				_tmp15_ = _tmp14_;
				mind_map_add_undo (self, (UndoItem*) _tmp15_);
				_g_object_unref0 (_tmp15_);
			}
			_tmp16_ = self->priv->_selected;
			selection_add_node (_tmp16_, n, FALSE, TRUE);
			_g_object_unref0 (last_folded);
		}
	}
}

gboolean
mind_map_select_node (MindMap* self,
                      Node* n,
                      gboolean animate)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (n != NULL) {
		Selection* _tmp0_;
		Node* _tmp1_;
		Node* _tmp2_;
		gboolean _tmp3_;
		DrawArea* _tmp16_;
		_tmp0_ = self->priv->_selected;
		_tmp1_ = selection_current_node (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = n != _tmp2_;
		_g_object_unref0 (_tmp2_);
		if (_tmp3_) {
			Node* folded = NULL;
			Node* _tmp4_;
			Node* _tmp5_;
			gdouble _tmp7_ = 0.0;
			Selection* _tmp8_;
			Node* _tmp9_;
			Node* _tmp10_;
			DrawArea* _tmp15_;
			_tmp4_ = node_folded_ancestor (n);
			folded = _tmp4_;
			_tmp5_ = folded;
			if (_tmp5_ != NULL) {
				Node* _tmp6_;
				_tmp6_ = folded;
				node_set_fold_only (_tmp6_, FALSE);
			}
			if (self->priv->_focus_mode) {
				_tmp7_ = self->priv->_focus_alpha;
			} else {
				_tmp7_ = 1.0;
			}
			_tmp8_ = self->priv->_selected;
			selection_set_current_node (_tmp8_, n, _tmp7_);
			_tmp9_ = node_get_parent (n);
			_tmp10_ = _tmp9_;
			if (_tmp10_ != NULL) {
				Node* _tmp11_;
				Node* _tmp12_;
				_tmp11_ = node_get_parent (n);
				_tmp12_ = _tmp11_;
				node_set_last_selected_child (_tmp12_, n);
			}
			if (node_is_summarized (n)) {
				SummaryNode* _tmp13_;
				SummaryNode* _tmp14_;
				_tmp13_ = node_summary_node (n);
				_tmp14_ = _tmp13_;
				summary_node_set_last_selected_node (_tmp14_, n);
				_g_object_unref0 (_tmp14_);
			}
			_tmp15_ = self->priv->_canvas;
			draw_area_see (_tmp15_, animate, (gdouble) 0, 100.0);
			_g_object_unref0 (folded);
		}
		_tmp16_ = self->priv->_canvas;
		gtk_widget_grab_focus ((GtkWidget*) _tmp16_);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

gboolean
mind_map_root_selectable (MindMap* self)
{
	Node* current_node = NULL;
	Selection* _tmp0_;
	Node* _tmp1_;
	Connection* current_conn = NULL;
	Selection* _tmp2_;
	Connection* _tmp3_;
	gboolean _tmp4_ = FALSE;
	Connection* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_node (_tmp0_);
	current_node = _tmp1_;
	_tmp2_ = self->priv->_selected;
	_tmp3_ = selection_current_connection (_tmp2_);
	current_conn = _tmp3_;
	_tmp5_ = current_conn;
	if (_tmp5_ == NULL) {
		gboolean _tmp6_ = FALSE;
		Node* _tmp7_;
		_tmp7_ = current_node;
		if (_tmp7_ == NULL) {
			MapModel* _tmp8_;
			GArray* _tmp9_;
			GArray* _tmp10_;
			_tmp8_ = self->priv->_model;
			_tmp9_ = map_model_get_nodes (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp6_ = _tmp10_->len > ((guint) 0);
			_g_array_unref0 (_tmp10_);
		} else {
			Node* _tmp11_;
			Node* _tmp12_;
			Node* _tmp13_;
			Node* _tmp14_;
			_tmp11_ = current_node;
			_tmp12_ = node_get_root (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = current_node;
			_tmp6_ = _tmp13_ != _tmp14_;
			_g_object_unref0 (_tmp13_);
		}
		_tmp4_ = _tmp6_;
	} else {
		_tmp4_ = FALSE;
	}
	result = _tmp4_;
	_g_object_unref0 (current_conn);
	_g_object_unref0 (current_node);
	return result;
}

void
mind_map_select_root_node (MindMap* self)
{
	Selection* _tmp0_;
	Connection* _tmp1_;
	Connection* _tmp2_;
	gboolean _tmp3_;
	Node* current = NULL;
	Node* _tmp4_;
	Node* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_connection (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_ != NULL;
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		return;
	}
	_tmp4_ = mind_map_get_current_node (self);
	current = _tmp4_;
	_tmp5_ = current;
	if (_tmp5_ == NULL) {
		MapModel* _tmp6_;
		GArray* _tmp7_;
		GArray* _tmp8_;
		gboolean _tmp9_;
		_tmp6_ = self->priv->_model;
		_tmp7_ = map_model_get_nodes (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_->len > ((guint) 0);
		_g_array_unref0 (_tmp8_);
		if (_tmp9_) {
			MapModel* _tmp10_;
			GArray* _tmp11_;
			GArray* _tmp12_;
			Node* _tmp13_;
			gboolean _tmp14_;
			_tmp10_ = self->priv->_model;
			_tmp11_ = map_model_get_nodes (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = g_array_index (_tmp12_, Node*, (guint) 0);
			_tmp14_ = mind_map_select_node (self, _tmp13_, TRUE);
			_g_array_unref0 (_tmp12_);
			if (_tmp14_) {
				mind_map_queue_draw (self);
			}
		}
	} else {
		Node* _tmp15_;
		Node* _tmp16_;
		Node* _tmp17_;
		gboolean _tmp18_;
		_tmp15_ = current;
		_tmp16_ = node_get_root (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = mind_map_select_node (self, _tmp17_, TRUE);
		_g_object_unref0 (_tmp17_);
		if (_tmp18_) {
			mind_map_queue_draw (self);
		}
	}
	_g_object_unref0 (current);
}

Node*
mind_map_next_node_to_select (MindMap* self)
{
	Node* current = NULL;
	Selection* _tmp0_;
	Node* _tmp1_;
	Node* _tmp2_;
	Node* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_node (_tmp0_);
	current = _tmp1_;
	_tmp2_ = current;
	if (_tmp2_ != NULL) {
		Node* _tmp3_;
		_tmp3_ = current;
		if (node_is_root (_tmp3_)) {
			GArray* nodes = NULL;
			MapModel* _tmp4_;
			GArray* _tmp5_;
			GArray* _tmp6_;
			_tmp4_ = self->priv->_model;
			_tmp5_ = map_model_get_nodes (_tmp4_);
			nodes = _tmp5_;
			_tmp6_ = nodes;
			if (_tmp6_->len > ((guint) 1)) {
				{
					gint i = 0;
					i = 0;
					{
						gboolean _tmp7_ = FALSE;
						_tmp7_ = TRUE;
						while (TRUE) {
							GArray* _tmp9_;
							GArray* _tmp10_;
							Node* _tmp11_;
							Node* _tmp12_;
							if (!_tmp7_) {
								gint _tmp8_;
								_tmp8_ = i;
								i = _tmp8_ + 1;
							}
							_tmp7_ = FALSE;
							_tmp9_ = nodes;
							if (!(((guint) i) < _tmp9_->len)) {
								break;
							}
							_tmp10_ = nodes;
							_tmp11_ = g_array_index (_tmp10_, Node*, (guint) i);
							_tmp12_ = current;
							if (_tmp11_ == _tmp12_) {
								if (i == 0) {
									GArray* _tmp13_;
									Node* _tmp14_;
									Node* _tmp15_;
									_tmp13_ = nodes;
									_tmp14_ = g_array_index (_tmp13_, Node*, (guint) 1);
									_tmp15_ = _g_object_ref0 (_tmp14_);
									result = _tmp15_;
									_g_array_unref0 (nodes);
									_g_object_unref0 (current);
									return result;
								} else {
									GArray* _tmp16_;
									_tmp16_ = nodes;
									if (((guint) (i + 1)) == _tmp16_->len) {
										GArray* _tmp17_;
										Node* _tmp18_;
										Node* _tmp19_;
										_tmp17_ = nodes;
										_tmp18_ = g_array_index (_tmp17_, Node*, (guint) (i - 1));
										_tmp19_ = _g_object_ref0 (_tmp18_);
										result = _tmp19_;
										_g_array_unref0 (nodes);
										_g_object_unref0 (current);
										return result;
									}
								}
								break;
							}
						}
					}
				}
			}
			_g_array_unref0 (nodes);
		} else {
			Node* next = NULL;
			Node* _tmp20_;
			Node* _tmp21_;
			Node* _tmp22_;
			Node* _tmp23_;
			Node* _tmp24_;
			Node* _tmp25_;
			_tmp20_ = current;
			_tmp21_ = node_get_parent (_tmp20_);
			_tmp22_ = _tmp21_;
			_tmp23_ = current;
			_tmp24_ = node_next_child (_tmp22_, _tmp23_, FALSE);
			next = _tmp24_;
			_tmp25_ = next;
			if (_tmp25_ == NULL) {
				Node* _tmp26_;
				Node* _tmp27_;
				Node* _tmp28_;
				Node* _tmp29_;
				Node* _tmp30_;
				Node* _tmp31_;
				_tmp26_ = current;
				_tmp27_ = node_get_parent (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = current;
				_tmp30_ = node_prev_child (_tmp28_, _tmp29_, FALSE);
				_g_object_unref0 (next);
				next = _tmp30_;
				_tmp31_ = next;
				if (_tmp31_ == NULL) {
					Node* _tmp32_;
					Node* _tmp33_;
					Node* _tmp34_;
					Node* _tmp35_;
					_tmp32_ = current;
					_tmp33_ = node_get_parent (_tmp32_);
					_tmp34_ = _tmp33_;
					_tmp35_ = _g_object_ref0 (_tmp34_);
					_g_object_unref0 (next);
					next = _tmp35_;
				}
			}
			result = next;
			_g_object_unref0 (current);
			return result;
		}
	}
	result = NULL;
	_g_object_unref0 (current);
	return result;
}

void
mind_map_select_sibling_node (MindMap* self,
                              gint dir)
{
	Node* current = NULL;
	Selection* _tmp0_;
	Node* _tmp1_;
	const gchar* _tmp2_ = NULL;
	gchar* str_dir = NULL;
	gchar* _tmp3_;
	MapModel* _tmp4_;
	Node* _tmp5_;
	const gchar* _tmp6_;
	Node* _tmp7_;
	Node* _tmp8_;
	gboolean _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_node (_tmp0_);
	current = _tmp1_;
	if (dir == 1) {
		_tmp2_ = "next";
	} else {
		_tmp2_ = "prev";
	}
	_tmp3_ = g_strdup (_tmp2_);
	str_dir = _tmp3_;
	_tmp4_ = self->priv->_model;
	_tmp5_ = current;
	_tmp6_ = str_dir;
	_tmp7_ = map_model_sibling_node (_tmp4_, _tmp5_, _tmp6_, TRUE);
	_tmp8_ = _tmp7_;
	_tmp9_ = mind_map_select_node (self, _tmp8_, TRUE);
	_g_object_unref0 (_tmp8_);
	if (_tmp9_) {
		mind_map_queue_draw (self);
	}
	_g_free0 (str_dir);
	_g_object_unref0 (current);
}

gboolean
mind_map_children_selectable (MindMap* self)
{
	GArray* nodes = NULL;
	Selection* _tmp0_;
	GArray* _tmp1_;
	gboolean selectable = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_nodes (_tmp0_);
	nodes = _tmp1_;
	selectable = FALSE;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GArray* _tmp4_;
				Node* node = NULL;
				GArray* _tmp5_;
				Node* _tmp6_;
				Node* _tmp7_;
				gboolean _tmp8_ = FALSE;
				Node* _tmp9_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = nodes;
				if (!(((guint) i) < _tmp4_->len)) {
					break;
				}
				_tmp5_ = nodes;
				_tmp6_ = g_array_index (_tmp5_, Node*, (guint) i);
				_tmp7_ = _g_object_ref0 (_tmp6_);
				node = _tmp7_;
				_tmp9_ = node;
				if (!node_is_leaf (_tmp9_)) {
					Node* _tmp10_;
					gboolean _tmp11_;
					gboolean _tmp12_;
					_tmp10_ = node;
					_tmp11_ = node_get_folded (_tmp10_);
					_tmp12_ = _tmp11_;
					_tmp8_ = !_tmp12_;
				} else {
					_tmp8_ = FALSE;
				}
				selectable |= _tmp8_;
				_g_object_unref0 (node);
			}
		}
	}
	result = selectable;
	_g_array_unref0 (nodes);
	return result;
}

void
mind_map_select_child_node (MindMap* self)
{
	Node* current = NULL;
	Node* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	Node* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_current_node (self);
	current = _tmp0_;
	_tmp3_ = current;
	if (_tmp3_ != NULL) {
		Node* _tmp4_;
		_tmp4_ = current;
		_tmp2_ = !node_is_leaf (_tmp4_);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		Node* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = current;
		_tmp6_ = node_get_folded (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp1_ = !_tmp7_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		Node* _tmp8_ = NULL;
		Node* _tmp9_;
		Node* _tmp10_;
		Node* _tmp11_;
		_tmp9_ = current;
		_tmp10_ = node_get_last_selected_child (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp8_ = _tmp11_;
		if (_tmp8_ == NULL) {
			Node* _tmp12_;
			GArray* _tmp13_;
			GArray* _tmp14_;
			Node* _tmp15_;
			_tmp12_ = current;
			_tmp13_ = node_children (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = g_array_index (_tmp14_, Node*, (guint) 0);
			_tmp8_ = _tmp15_;
			_g_array_unref0 (_tmp14_);
		}
		if (mind_map_select_node (self, _tmp8_, TRUE)) {
			mind_map_queue_draw (self);
		}
	}
	_g_object_unref0 (current);
}

void
mind_map_select_child_nodes (MindMap* self)
{
	GArray* nodes = NULL;
	Selection* _tmp0_;
	GArray* _tmp1_;
	gboolean changed = FALSE;
	Selection* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_nodes_copy (_tmp0_);
	nodes = _tmp1_;
	_tmp2_ = self->priv->_selected;
	changed = selection_clear_nodes (_tmp2_, FALSE, 1.0);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GArray* _tmp5_;
				Selection* _tmp6_;
				GArray* _tmp7_;
				Node* _tmp8_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp5_ = nodes;
				if (!(((guint) i) < _tmp5_->len)) {
					break;
				}
				_tmp6_ = self->priv->_selected;
				_tmp7_ = nodes;
				_tmp8_ = g_array_index (_tmp7_, Node*, (guint) i);
				changed |= selection_add_child_nodes (_tmp6_, _tmp8_, FALSE);
			}
		}
	}
	if (changed) {
		g_signal_emit (self, mind_map_signals[MIND_MAP_CURRENT_CHANGED_SIGNAL], 0, self);
	}
	mind_map_queue_draw (self);
	_g_array_unref0 (nodes);
}

void
mind_map_select_node_tree (MindMap* self)
{
	Node* current = NULL;
	Node* _tmp0_;
	Selection* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_current_node (self);
	current = _tmp0_;
	_tmp1_ = self->priv->_selected;
	selection_add_node_tree (_tmp1_, current, TRUE);
	mind_map_queue_draw (self);
	_g_object_unref0 (current);
}

gboolean
mind_map_parent_selectable (MindMap* self)
{
	GArray* nodes = NULL;
	Selection* _tmp0_;
	GArray* _tmp1_;
	gboolean selectable = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_nodes (_tmp0_);
	nodes = _tmp1_;
	selectable = FALSE;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				GArray* _tmp4_;
				GArray* _tmp5_;
				Node* _tmp6_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = nodes;
				if (!(((guint) i) < _tmp4_->len)) {
					break;
				}
				_tmp5_ = nodes;
				_tmp6_ = g_array_index (_tmp5_, Node*, (guint) i);
				selectable |= !node_is_root (_tmp6_);
			}
		}
	}
	result = selectable;
	_g_array_unref0 (nodes);
	return result;
}

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

static void
_vala_Node_free_function_content_of (gpointer data)
{
	Node* self;
	self = *((Node**) data);
	_g_object_unref0_ (self);
}

void
mind_map_select_parent_nodes (MindMap* self)
{
	GArray* child_nodes = NULL;
	Selection* _tmp0_;
	GArray* _tmp1_;
	GArray* parent_nodes = NULL;
	GArray* _tmp2_;
	GArray* _tmp23_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_nodes (_tmp0_);
	child_nodes = _tmp1_;
	_tmp2_ = g_array_new (TRUE, TRUE, sizeof (Node*));
	g_array_set_clear_func (_tmp2_, (GDestroyNotify) _vala_Node_free_function_content_of);
	parent_nodes = _tmp2_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GArray* _tmp5_;
				Node* node = NULL;
				GArray* _tmp6_;
				Node* _tmp7_;
				Node* _tmp8_;
				gboolean _tmp9_ = FALSE;
				Node* _tmp10_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp5_ = child_nodes;
				if (!(((guint) i) < _tmp5_->len)) {
					break;
				}
				_tmp6_ = child_nodes;
				_tmp7_ = g_array_index (_tmp6_, Node*, (guint) i);
				_tmp8_ = _g_object_ref0 (_tmp7_);
				node = _tmp8_;
				_tmp10_ = node;
				if (_tmp10_ != NULL) {
					Node* _tmp11_;
					_tmp11_ = node;
					_tmp9_ = !node_is_root (_tmp11_);
				} else {
					_tmp9_ = FALSE;
				}
				if (_tmp9_) {
					Node* _tmp12_;
					_tmp12_ = node;
					if (node_is_summary (_tmp12_)) {
						GArray* _tmp13_;
						Node* _tmp14_;
						Node* _tmp15_;
						Node* _tmp16_;
						Node* _tmp17_;
						_tmp13_ = parent_nodes;
						_tmp14_ = node;
						_tmp15_ = summary_node_get_last_selected_node (IS_SUMMARY_NODE (_tmp14_) ? ((SummaryNode*) _tmp14_) : NULL);
						_tmp16_ = _tmp15_;
						_tmp17_ = _g_object_ref0 (_tmp16_);
						g_array_append_val (_tmp13_, _tmp17_);
					} else {
						GArray* _tmp18_;
						Node* _tmp19_;
						Node* _tmp20_;
						Node* _tmp21_;
						Node* _tmp22_;
						_tmp18_ = parent_nodes;
						_tmp19_ = node;
						_tmp20_ = node_get_parent (_tmp19_);
						_tmp21_ = _tmp20_;
						_tmp22_ = _g_object_ref0 (_tmp21_);
						g_array_append_val (_tmp18_, _tmp22_);
					}
				}
				_g_object_unref0 (node);
			}
		}
	}
	_tmp23_ = parent_nodes;
	if (_tmp23_->len > ((guint) 0)) {
		Selection* _tmp24_;
		DrawArea* _tmp31_;
		_tmp24_ = self->priv->_selected;
		selection_clear_nodes (_tmp24_, TRUE, 1.0);
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp25_ = FALSE;
				_tmp25_ = TRUE;
				while (TRUE) {
					GArray* _tmp27_;
					Selection* _tmp28_;
					GArray* _tmp29_;
					Node* _tmp30_;
					if (!_tmp25_) {
						gint _tmp26_;
						_tmp26_ = i;
						i = _tmp26_ + 1;
					}
					_tmp25_ = FALSE;
					_tmp27_ = parent_nodes;
					if (!(((guint) i) < _tmp27_->len)) {
						break;
					}
					_tmp28_ = self->priv->_selected;
					_tmp29_ = parent_nodes;
					_tmp30_ = g_array_index (_tmp29_, Node*, (guint) i);
					selection_add_node (_tmp28_, _tmp30_, FALSE, TRUE);
				}
			}
		}
		_tmp31_ = self->priv->_canvas;
		draw_area_see (_tmp31_, TRUE, (gdouble) 0, 100.0);
		mind_map_queue_draw (self);
	}
	_g_array_unref0 (parent_nodes);
	_g_array_unref0 (child_nodes);
}

void
mind_map_select_callout (MindMap* self)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (mind_map_is_node_selected (self)) {
		Node* _tmp1_;
		Node* _tmp2_;
		Callout* _tmp3_;
		Callout* _tmp4_;
		_tmp1_ = mind_map_get_current_node (self);
		_tmp2_ = _tmp1_;
		_tmp3_ = node_get_callout (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ != NULL;
		_g_object_unref0 (_tmp2_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		Node* _tmp5_;
		Node* _tmp6_;
		Callout* _tmp7_;
		Callout* _tmp8_;
		_tmp5_ = mind_map_get_current_node (self);
		_tmp6_ = _tmp5_;
		_tmp7_ = node_get_callout (_tmp6_);
		_tmp8_ = _tmp7_;
		mind_map_set_current_callout (self, _tmp8_);
		_g_object_unref0 (_tmp6_);
	}
}

void
mind_map_select_linked_node (MindMap* self,
                             Node* node)
{
	Node* n = NULL;
	Node* _tmp0_;
	Node* _tmp1_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (node);
	n = _tmp0_;
	_tmp1_ = n;
	if (_tmp1_ == NULL) {
		Node* _tmp2_;
		_tmp2_ = mind_map_get_current_node (self);
		_g_object_unref0 (n);
		n = _tmp2_;
	}
	_tmp4_ = n;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		NodeLink* _tmp6_;
		NodeLink* _tmp7_;
		_tmp5_ = n;
		_tmp6_ = node_get_linked_node (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		Node* _tmp8_;
		NodeLink* _tmp9_;
		NodeLink* _tmp10_;
		_tmp8_ = n;
		_tmp9_ = node_get_linked_node (_tmp8_);
		_tmp10_ = _tmp9_;
		node_link_select (_tmp10_, self);
	}
	_g_object_unref0 (n);
}

GArray*
mind_map_get_selected_nodes (MindMap* self)
{
	Selection* _tmp0_;
	GArray* _tmp1_;
	GArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_nodes (_tmp0_);
	result = _tmp1_;
	return result;
}

void
mind_map_select_nodes_within_box (MindMap* self,
                                  SelectBox* select_box,
                                  gboolean shift)
{
	gdouble _tmp0_ = 0.0;
	SelectBox _tmp1_;
	gdouble _tmp5_ = 0.0;
	SelectBox _tmp6_;
	gdouble _tmp10_ = 0.0;
	SelectBox _tmp11_;
	gdouble _tmp14_ = 0.0;
	SelectBox _tmp15_;
	GdkRectangle box = {0};
	GdkRectangle _tmp18_ = {0};
	GArray* nodes = NULL;
	GArray* _tmp19_;
	MapModel* _tmp20_;
	GdkRectangle _tmp21_;
	GArray* _tmp22_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (select_box != NULL);
	_tmp1_ = *select_box;
	if (_tmp1_.w < ((gdouble) 0)) {
		SelectBox _tmp2_;
		SelectBox _tmp3_;
		_tmp2_ = *select_box;
		_tmp3_ = *select_box;
		_tmp0_ = _tmp2_.x + _tmp3_.w;
	} else {
		SelectBox _tmp4_;
		_tmp4_ = *select_box;
		_tmp0_ = _tmp4_.x;
	}
	_tmp6_ = *select_box;
	if (_tmp6_.h < ((gdouble) 0)) {
		SelectBox _tmp7_;
		SelectBox _tmp8_;
		_tmp7_ = *select_box;
		_tmp8_ = *select_box;
		_tmp5_ = _tmp7_.y + _tmp8_.h;
	} else {
		SelectBox _tmp9_;
		_tmp9_ = *select_box;
		_tmp5_ = _tmp9_.y;
	}
	_tmp11_ = *select_box;
	if (_tmp11_.w < ((gdouble) 0)) {
		SelectBox _tmp12_;
		_tmp12_ = *select_box;
		_tmp10_ = 0 - _tmp12_.w;
	} else {
		SelectBox _tmp13_;
		_tmp13_ = *select_box;
		_tmp10_ = _tmp13_.w;
	}
	_tmp15_ = *select_box;
	if (_tmp15_.h < ((gdouble) 0)) {
		SelectBox _tmp16_;
		_tmp16_ = *select_box;
		_tmp14_ = 0 - _tmp16_.h;
	} else {
		SelectBox _tmp17_;
		_tmp17_ = *select_box;
		_tmp14_ = _tmp17_.h;
	}
	_tmp18_.x = (gint) _tmp0_;
	_tmp18_.y = (gint) _tmp5_;
	_tmp18_.width = (gint) _tmp10_;
	_tmp18_.height = (gint) _tmp14_;
	box = _tmp18_;
	_tmp19_ = g_array_new (TRUE, TRUE, sizeof (Node*));
	g_array_set_clear_func (_tmp19_, (GDestroyNotify) _vala_Node_free_function_content_of);
	nodes = _tmp19_;
	_tmp20_ = self->priv->_model;
	_tmp21_ = box;
	_tmp22_ = nodes;
	map_model_get_nodes_within_rectangle (_tmp20_, &_tmp21_, _tmp22_);
	if (!shift) {
		Selection* _tmp23_;
		GArray* _tmp24_;
		_tmp23_ = self->priv->_selected;
		_tmp24_ = nodes;
		selection_change_nodes (_tmp23_, _tmp24_, TRUE);
	} else {
		Selection* _tmp25_;
		GArray* _tmp26_;
		_tmp25_ = self->priv->_selected;
		_tmp26_ = nodes;
		selection_add_nodes (_tmp25_, _tmp26_, TRUE);
	}
	_g_array_unref0 (nodes);
}

Connection*
mind_map_get_current_connection (MindMap* self)
{
	Selection* _tmp0_;
	Connection* _tmp1_;
	Connection* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_connection (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
mind_map_is_connection_mode (MindMap* self,
                             ConnMode mode)
{
	Connection* current = NULL;
	Connection* _tmp0_;
	gboolean _tmp1_ = FALSE;
	Connection* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = mind_map_get_current_connection (self);
	current = _tmp0_;
	_tmp2_ = current;
	if (_tmp2_ != NULL) {
		Connection* _tmp3_;
		ConnMode _tmp4_;
		ConnMode _tmp5_;
		_tmp3_ = current;
		_tmp4_ = connection_get_mode (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ == mode;
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	_g_object_unref0 (current);
	return result;
}

gboolean
mind_map_is_connection_connecting (MindMap* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = mind_map_is_connection_mode (self, CONN_MODE_CONNECTING);
	return result;
}

gboolean
mind_map_is_connection_editable (MindMap* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = mind_map_is_connection_mode (self, CONN_MODE_EDITABLE);
	return result;
}

gboolean
mind_map_is_connection_selected (MindMap* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = mind_map_is_connection_mode (self, CONN_MODE_SELECTED);
	return result;
}

void
mind_map_set_current_connection (MindMap* self,
                                 Connection* c)
{
	g_return_if_fail (self != NULL);
	if (c != NULL) {
		Selection* _tmp0_;
		Node* _tmp1_;
		Node* _tmp2_;
		Node* _tmp3_;
		Node* _tmp4_;
		_tmp0_ = self->priv->_selected;
		selection_set_current_connection (_tmp0_, c, 1.0);
		_tmp1_ = connection_get_from_node (c);
		_tmp2_ = _tmp1_;
		node_set_last_selected_connection (_tmp2_, c);
		_tmp3_ = connection_get_to_node (c);
		_tmp4_ = _tmp3_;
		if (_tmp4_ != NULL) {
			Node* _tmp5_;
			Node* _tmp6_;
			_tmp5_ = connection_get_to_node (c);
			_tmp6_ = _tmp5_;
			node_set_last_selected_connection (_tmp6_, c);
		}
	} else {
		Selection* _tmp7_;
		_tmp7_ = self->priv->_selected;
		selection_clear_connections (_tmp7_, TRUE, 1.0);
	}
}

void
mind_map_select_connection_node (MindMap* self,
                                 gboolean start)
{
	Connection* current = NULL;
	Connection* _tmp0_;
	Connection* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_current_connection (self);
	current = _tmp0_;
	_tmp1_ = current;
	if (_tmp1_ != NULL) {
		Node* _tmp2_ = NULL;
		if (start) {
			Connection* _tmp3_;
			Node* _tmp4_;
			Node* _tmp5_;
			_tmp3_ = current;
			_tmp4_ = connection_get_from_node (_tmp3_);
			_tmp5_ = _tmp4_;
			_tmp2_ = _tmp5_;
		} else {
			Connection* _tmp6_;
			Node* _tmp7_;
			Node* _tmp8_;
			_tmp6_ = current;
			_tmp7_ = connection_get_to_node (_tmp6_);
			_tmp8_ = _tmp7_;
			_tmp2_ = _tmp8_;
		}
		if (mind_map_select_node (self, _tmp2_, TRUE)) {
			DrawArea* _tmp9_;
			_tmp9_ = self->priv->_canvas;
			draw_area_clear_current_connection (_tmp9_, TRUE);
			mind_map_queue_draw (self);
		}
	}
	_g_object_unref0 (current);
}

void
mind_map_select_connection (MindMap* self,
                            gint dir)
{
	Connection* current = NULL;
	Connection* _tmp0_;
	Connection* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_current_connection (self);
	current = _tmp0_;
	_tmp1_ = current;
	if (_tmp1_ != NULL) {
		Connection* conn = NULL;
		MapModel* _tmp2_;
		Connections* _tmp3_;
		Connections* _tmp4_;
		Connection* _tmp5_;
		Connection* _tmp6_;
		Connection* _tmp7_;
		_tmp2_ = self->priv->_model;
		_tmp3_ = map_model_get_connections (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = current;
		_tmp6_ = connections_get_connection (_tmp4_, _tmp5_, dir);
		conn = _tmp6_;
		_tmp7_ = conn;
		if (_tmp7_ != NULL) {
			Connection* _tmp8_;
			DrawArea* _tmp9_;
			_tmp8_ = conn;
			mind_map_set_current_connection (self, _tmp8_);
			_tmp9_ = self->priv->_canvas;
			draw_area_see (_tmp9_, TRUE, (gdouble) 0, 100.0);
			mind_map_queue_draw (self);
		}
		_g_object_unref0 (conn);
	}
	_g_object_unref0 (current);
}

void
mind_map_select_attached_connection (MindMap* self)
{
	Node* current = NULL;
	Node* _tmp0_;
	Node* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_current_node (self);
	current = _tmp0_;
	_tmp1_ = current;
	if (_tmp1_ != NULL) {
		Node* _tmp2_;
		Connection* _tmp3_;
		Connection* _tmp4_;
		_tmp2_ = current;
		_tmp3_ = node_get_last_selected_connection (_tmp2_);
		_tmp4_ = _tmp3_;
		if (_tmp4_ != NULL) {
			Node* _tmp5_;
			Connection* _tmp6_;
			Connection* _tmp7_;
			DrawArea* _tmp8_;
			_tmp5_ = current;
			_tmp6_ = node_get_last_selected_connection (_tmp5_);
			_tmp7_ = _tmp6_;
			mind_map_set_current_connection (self, _tmp7_);
			_tmp8_ = self->priv->_canvas;
			draw_area_see (_tmp8_, TRUE, (gdouble) 0, 100.0);
			mind_map_queue_draw (self);
		} else {
			Connection* conn = NULL;
			MapModel* _tmp9_;
			Connections* _tmp10_;
			Connections* _tmp11_;
			Node* _tmp12_;
			Connection* _tmp13_;
			Connection* _tmp14_;
			_tmp9_ = self->priv->_model;
			_tmp10_ = map_model_get_connections (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = current;
			_tmp13_ = connections_get_attached_connection (_tmp11_, _tmp12_, 0);
			conn = _tmp13_;
			_tmp14_ = conn;
			if (_tmp14_ != NULL) {
				Connection* _tmp15_;
				DrawArea* _tmp16_;
				_tmp15_ = conn;
				mind_map_set_current_connection (self, _tmp15_);
				_tmp16_ = self->priv->_canvas;
				draw_area_see (_tmp16_, TRUE, (gdouble) 0, 100.0);
				mind_map_queue_draw (self);
			}
			_g_object_unref0 (conn);
		}
	}
	_g_object_unref0 (current);
}

GArray*
mind_map_get_selected_connections (MindMap* self)
{
	Selection* _tmp0_;
	GArray* _tmp1_;
	GArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_connections (_tmp0_);
	result = _tmp1_;
	return result;
}

void
mind_map_select_callout_node (MindMap* self)
{
	g_return_if_fail (self != NULL);
	if (mind_map_is_callout_selected (self)) {
		Callout* _tmp0_;
		Callout* _tmp1_;
		Node* _tmp2_;
		Node* _tmp3_;
		Selection* _tmp4_;
		_tmp0_ = mind_map_get_current_callout (self);
		_tmp1_ = _tmp0_;
		_tmp2_ = callout_get_node (_tmp1_);
		_tmp3_ = _tmp2_;
		mind_map_set_current_node (self, _tmp3_);
		_g_object_unref0 (_tmp1_);
		_tmp4_ = self->priv->_selected;
		selection_clear_callouts (_tmp4_, FALSE, 1.0);
	}
}

Callout*
mind_map_get_current_callout (MindMap* self)
{
	Selection* _tmp0_;
	Callout* _tmp1_;
	Callout* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_callout (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
mind_map_is_callout_mode (MindMap* self,
                          CalloutMode mode)
{
	Callout* current = NULL;
	Callout* _tmp0_;
	gboolean _tmp1_ = FALSE;
	Callout* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = mind_map_get_current_callout (self);
	current = _tmp0_;
	_tmp2_ = current;
	if (_tmp2_ != NULL) {
		Callout* _tmp3_;
		CalloutMode _tmp4_;
		CalloutMode _tmp5_;
		_tmp3_ = current;
		_tmp4_ = callout_get_mode (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ == mode;
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	_g_object_unref0 (current);
	return result;
}

gboolean
mind_map_is_callout_selected (MindMap* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = mind_map_is_callout_mode (self, CALLOUT_MODE_SELECTED);
	return result;
}

gboolean
mind_map_is_callout_editable (MindMap* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = mind_map_is_callout_mode (self, CALLOUT_MODE_EDITABLE);
	return result;
}

void
mind_map_set_current_callout (MindMap* self,
                              Callout* c)
{
	Selection* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_selected;
	selection_set_current_callout (_tmp0_, c, 1.0);
}

GArray*
mind_map_get_selected_callouts (MindMap* self)
{
	Selection* _tmp0_;
	GArray* _tmp1_;
	GArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_callouts (_tmp0_);
	result = _tmp1_;
	return result;
}

NodeGroup*
mind_map_get_current_group (MindMap* self)
{
	Selection* _tmp0_;
	NodeGroup* _tmp1_;
	NodeGroup* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_group (_tmp0_);
	result = _tmp1_;
	return result;
}

gboolean
mind_map_is_group_selected (MindMap* self)
{
	NodeGroup* _tmp0_;
	NodeGroup* _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = mind_map_get_current_group (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ != NULL;
	_g_object_unref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

void
mind_map_set_current_group (MindMap* self,
                            NodeGroup* g)
{
	Selection* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_selected;
	selection_set_current_group (_tmp0_, g, 1.0);
}

static gpointer
_g_array_ref0 (gpointer self)
{
	return self ? g_array_ref (self) : NULL;
}

void
mind_map_group_select_main (MindMap* self)
{
	GArray* groups = NULL;
	GArray* _tmp0_;
	Selection* _tmp16_;
	Selection* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_selected_groups (self);
	groups = _tmp0_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GArray* _tmp3_;
				GArray* nodes = NULL;
				GArray* _tmp4_;
				NodeGroup* _tmp5_;
				GArray* _tmp6_;
				GArray* _tmp7_;
				GArray* _tmp8_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = groups;
				if (!(((guint) i) < _tmp3_->len)) {
					break;
				}
				_tmp4_ = groups;
				_tmp5_ = g_array_index (_tmp4_, NodeGroup*, (guint) i);
				_tmp6_ = node_group_get_nodes (_tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = _g_array_ref0 (_tmp7_);
				nodes = _tmp8_;
				{
					gint j = 0;
					j = 0;
					{
						gboolean _tmp9_ = FALSE;
						_tmp9_ = TRUE;
						while (TRUE) {
							GArray* _tmp11_;
							Selection* _tmp12_;
							Selection* _tmp13_;
							GArray* _tmp14_;
							Node* _tmp15_;
							if (!_tmp9_) {
								gint _tmp10_;
								_tmp10_ = j;
								j = _tmp10_ + 1;
							}
							_tmp9_ = FALSE;
							_tmp11_ = nodes;
							if (!(((guint) j) < _tmp11_->len)) {
								break;
							}
							_tmp12_ = mind_map_get_selected (self);
							_tmp13_ = _tmp12_;
							_tmp14_ = nodes;
							_tmp15_ = g_array_index (_tmp14_, Node*, (guint) j);
							selection_add_node (_tmp13_, _tmp15_, FALSE, FALSE);
						}
					}
				}
				_g_array_unref0 (nodes);
			}
		}
	}
	_tmp16_ = mind_map_get_selected (self);
	_tmp17_ = _tmp16_;
	selection_clear_groups (_tmp17_, TRUE);
	_g_array_unref0 (groups);
}

void
mind_map_group_select_all (MindMap* self)
{
	GArray* groups = NULL;
	GArray* _tmp0_;
	Selection* _tmp16_;
	Selection* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_selected_groups (self);
	groups = _tmp0_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GArray* _tmp3_;
				GArray* nodes = NULL;
				GArray* _tmp4_;
				NodeGroup* _tmp5_;
				GArray* _tmp6_;
				GArray* _tmp7_;
				GArray* _tmp8_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = groups;
				if (!(((guint) i) < _tmp3_->len)) {
					break;
				}
				_tmp4_ = groups;
				_tmp5_ = g_array_index (_tmp4_, NodeGroup*, (guint) i);
				_tmp6_ = node_group_get_nodes (_tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = _g_array_ref0 (_tmp7_);
				nodes = _tmp8_;
				{
					gint j = 0;
					j = 0;
					{
						gboolean _tmp9_ = FALSE;
						_tmp9_ = TRUE;
						while (TRUE) {
							GArray* _tmp11_;
							Selection* _tmp12_;
							Selection* _tmp13_;
							GArray* _tmp14_;
							Node* _tmp15_;
							if (!_tmp9_) {
								gint _tmp10_;
								_tmp10_ = j;
								j = _tmp10_ + 1;
							}
							_tmp9_ = FALSE;
							_tmp11_ = nodes;
							if (!(((guint) j) < _tmp11_->len)) {
								break;
							}
							_tmp12_ = mind_map_get_selected (self);
							_tmp13_ = _tmp12_;
							_tmp14_ = nodes;
							_tmp15_ = g_array_index (_tmp14_, Node*, (guint) j);
							selection_add_node_tree (_tmp13_, _tmp15_, FALSE);
						}
					}
				}
				_g_array_unref0 (nodes);
			}
		}
	}
	_tmp16_ = mind_map_get_selected (self);
	_tmp17_ = _tmp16_;
	selection_clear_groups (_tmp17_, TRUE);
	_g_array_unref0 (groups);
}

GArray*
mind_map_get_selected_groups (MindMap* self)
{
	Selection* _tmp0_;
	GArray* _tmp1_;
	GArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_groups (_tmp0_);
	result = _tmp1_;
	return result;
}

Sticker*
mind_map_get_current_sticker (MindMap* self)
{
	Selection* _tmp0_;
	Sticker* _tmp1_;
	Sticker* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_sticker (_tmp0_);
	result = _tmp1_;
	return result;
}

gboolean
mind_map_is_sticker_selected (MindMap* self)
{
	Sticker* _tmp0_;
	Sticker* _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = mind_map_get_current_sticker (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ != NULL;
	_g_object_unref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

void
mind_map_set_current_sticker (MindMap* self,
                              Sticker* s)
{
	Selection* _tmp0_;
	MapModel* _tmp1_;
	Stickers* _tmp2_;
	Stickers* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_selected;
	selection_set_current_sticker (_tmp0_, s, 1.0);
	_tmp1_ = self->priv->_model;
	_tmp2_ = map_model_get_stickers (_tmp1_);
	_tmp3_ = _tmp2_;
	stickers_select_sticker (_tmp3_, s);
}

void
mind_map_select_all (MindMap* self)
{
	CanvasText* text = NULL;
	CanvasText* _tmp0_;
	CanvasText* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_current_text (self);
	text = _tmp0_;
	_tmp1_ = text;
	if (_tmp1_ != NULL) {
		CanvasText* _tmp2_;
		_tmp2_ = text;
		canvas_text_set_cursor_all (_tmp2_, FALSE);
		mind_map_queue_draw (self);
	}
	_g_object_unref0 (text);
}

void
mind_map_deselect_all (MindMap* self)
{
	CanvasText* text = NULL;
	CanvasText* _tmp0_;
	CanvasText* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_current_text (self);
	text = _tmp0_;
	_tmp1_ = text;
	if (_tmp1_ != NULL) {
		CanvasText* _tmp2_;
		_tmp2_ = text;
		canvas_text_clear_selection (_tmp2_, NULL);
		mind_map_queue_draw (self);
	}
	_g_object_unref0 (text);
}

UndoBuffer*
mind_map_current_undo_buffer (MindMap* self)
{
	Node* current = NULL;
	Selection* _tmp0_;
	Node* _tmp1_;
	gboolean _tmp2_ = FALSE;
	Node* _tmp3_;
	UndoBuffer* _tmp10_;
	UndoBuffer* _tmp11_;
	UndoBuffer* _tmp12_;
	UndoBuffer* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	_tmp1_ = selection_current_node (_tmp0_);
	current = _tmp1_;
	_tmp3_ = current;
	if (_tmp3_ != NULL) {
		Node* _tmp4_;
		NodeMode _tmp5_;
		NodeMode _tmp6_;
		_tmp4_ = current;
		_tmp5_ = node_get_mode (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp2_ = _tmp6_ == NODE_MODE_EDITABLE;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		UndoTextBuffer* _tmp7_;
		UndoTextBuffer* _tmp8_;
		UndoBuffer* _tmp9_;
		_tmp7_ = mind_map_get_undo_text (self);
		_tmp8_ = _tmp7_;
		_tmp9_ = _g_object_ref0 ((UndoBuffer*) _tmp8_);
		result = _tmp9_;
		_g_object_unref0 (current);
		return result;
	}
	_tmp10_ = mind_map_get_undo_buffer (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = _g_object_ref0 (_tmp11_);
	result = _tmp12_;
	_g_object_unref0 (current);
	return result;
}

void
mind_map_add_undo (MindMap* self,
                   UndoItem* item)
{
	UndoBuffer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->_undo_buffer;
	undo_buffer_add_item (_tmp0_, item);
}

void
mind_map_add_text_undo (MindMap* self,
                        UndoTextItem* item)
{
	UndoBuffer* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (item != NULL);
	_tmp0_ = self->priv->_undo_buffer;
	undo_buffer_add_item (_tmp0_, (UndoItem*) item);
}

void
mind_map_do_paste (MindMap* self,
                   gboolean shift)
{
	g_return_if_fail (self != NULL);
	minder_clipboard_paste (self, shift);
}

void
mind_map_do_paste_node_link (MindMap* self)
{
	g_return_if_fail (self != NULL);
	if (minder_clipboard_node_pasteable ()) {
		minder_clipboard_paste_node_link (self);
	}
}

GArray*
mind_map_get_nodes (MindMap* self)
{
	MapModel* _tmp0_;
	GArray* _tmp1_;
	GArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_nodes (_tmp0_);
	result = _tmp1_;
	return result;
}

Node*
mind_map_sibling_node (MindMap* self,
                       gint dir,
                       gboolean wrap)
{
	const gchar* _tmp0_ = NULL;
	gchar* str_dir = NULL;
	gchar* _tmp1_;
	MapModel* _tmp2_;
	Node* _tmp3_;
	Node* _tmp4_;
	Node* _tmp5_;
	Node* _tmp6_;
	Node* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (dir == 1) {
		_tmp0_ = "next";
	} else {
		_tmp0_ = "prev";
	}
	_tmp1_ = g_strdup (_tmp0_);
	str_dir = _tmp1_;
	_tmp2_ = self->priv->_model;
	_tmp3_ = mind_map_get_current_node (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = map_model_sibling_node (_tmp2_, _tmp4_, str_dir, wrap);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp4_);
	result = _tmp6_;
	_g_free0 (str_dir);
	return result;
}

static void
__lambda108_ (MindMap* self,
              GdkRGBA* color)
{
	MapModel* _tmp0_;
	GdkRGBA _tmp1_;
	g_return_if_fail (color != NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = *color;
	map_model_change_current_link_color (_tmp0_, &_tmp1_);
}

static void
___lambda108__gtk_color_chooser_color_activated (GtkColorChooser* _sender,
                                                 GdkRGBA* color,
                                                 gpointer self)
{
	__lambda108_ ((MindMap*) self, color);
}

void
mind_map_change_current_link_color (MindMap* self)
{
	GtkColorChooserDialog* color_picker = NULL;
	MainWindow* _tmp0_;
	GtkColorChooserDialog* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_win;
	_tmp1_ = (GtkColorChooserDialog*) gtk_color_chooser_dialog_new (_ ("Select a link color"), (GtkWindow*) _tmp0_);
	g_object_ref_sink (_tmp1_);
	color_picker = _tmp1_;
	g_signal_connect ((GtkColorChooser*) color_picker, "color-activated", (GCallback) ___lambda108__gtk_color_chooser_color_activated, self);
	gtk_window_present ((GtkWindow*) color_picker);
	_g_object_unref0 (color_picker);
}

void
mind_map_remove_tag (MindMap* self,
                     Tag* tag,
                     GArray* nodes)
{
	MapModel* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tag != NULL);
	g_return_if_fail (nodes != NULL);
	_tmp0_ = self->priv->_model;
	map_model_remove_tag (_tmp0_, tag, nodes);
}

void
mind_map_swap_nodes (MindMap* self,
                     Node* node,
                     Node* other)
{
	gboolean complete = FALSE;
	Node* _tmp0_;
	Node* _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	g_return_if_fail (other != NULL);
	complete = FALSE;
	_tmp0_ = node_previous_sibling (node, FALSE);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ == other;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		gint index = 0;
		SummaryNode* summary = NULL;
		SummaryNode* _tmp3_;
		Animator* _tmp4_;
		Animator* _tmp5_;
		GArray* _tmp6_;
		GArray* _tmp7_;
		NodeSide _tmp8_;
		NodeSide _tmp9_;
		SummaryNode* _tmp10_;
		UndoNodeMove* _tmp11_;
		UndoNodeMove* _tmp12_;
		index = node_index (node);
		_tmp3_ = node_summary_node (node);
		summary = _tmp3_;
		_tmp4_ = mind_map_get_animator (self);
		_tmp5_ = _tmp4_;
		_tmp6_ = mind_map_get_nodes (self);
		_tmp7_ = _tmp6_;
		animator_add_nodes (_tmp5_, _tmp7_, FALSE, "swap_with_previous_sibling");
		_g_array_unref0 (_tmp7_);
		node_swap_with_previous_sibling (node);
		_tmp8_ = node_get_side (node);
		_tmp9_ = _tmp8_;
		_tmp10_ = summary;
		_tmp11_ = undo_node_move_new (node, _tmp9_, index, _tmp10_);
		_tmp12_ = _tmp11_;
		mind_map_add_undo (self, (UndoItem*) _tmp12_);
		_g_object_unref0 (_tmp12_);
		complete = TRUE;
		_g_object_unref0 (summary);
	} else {
		Node* _tmp13_;
		Node* _tmp14_;
		gboolean _tmp15_;
		_tmp13_ = node_previous_sibling (other, FALSE);
		_tmp14_ = _tmp13_;
		_tmp15_ = _tmp14_ == node;
		_g_object_unref0 (_tmp14_);
		if (_tmp15_) {
			gint index = 0;
			SummaryNode* summary = NULL;
			SummaryNode* _tmp16_;
			Animator* _tmp17_;
			Animator* _tmp18_;
			GArray* _tmp19_;
			GArray* _tmp20_;
			NodeSide _tmp21_;
			NodeSide _tmp22_;
			SummaryNode* _tmp23_;
			UndoNodeMove* _tmp24_;
			UndoNodeMove* _tmp25_;
			index = node_index (other);
			_tmp16_ = node_summary_node (other);
			summary = _tmp16_;
			_tmp17_ = mind_map_get_animator (self);
			_tmp18_ = _tmp17_;
			_tmp19_ = mind_map_get_nodes (self);
			_tmp20_ = _tmp19_;
			animator_add_nodes (_tmp18_, _tmp20_, FALSE, "swap_with_next_sibling");
			_g_array_unref0 (_tmp20_);
			node_swap_with_previous_sibling (other);
			_tmp21_ = node_get_side (other);
			_tmp22_ = _tmp21_;
			_tmp23_ = summary;
			_tmp24_ = undo_node_move_new (other, _tmp22_, index, _tmp23_);
			_tmp25_ = _tmp24_;
			mind_map_add_undo (self, (UndoItem*) _tmp25_);
			_g_object_unref0 (_tmp25_);
			complete = TRUE;
			_g_object_unref0 (summary);
		} else {
			gboolean _tmp26_ = FALSE;
			Node* _tmp27_;
			Node* _tmp28_;
			_tmp27_ = node_get_parent (node);
			_tmp28_ = _tmp27_;
			if (other == _tmp28_) {
				Node* _tmp29_;
				Node* _tmp30_;
				_tmp29_ = node_get_parent (node);
				_tmp30_ = _tmp29_;
				_tmp26_ = !node_is_root (_tmp30_);
			} else {
				_tmp26_ = FALSE;
			}
			if (_tmp26_) {
				Animator* _tmp31_;
				Animator* _tmp32_;
				GArray* _tmp33_;
				GArray* _tmp34_;
				UndoNodeUnclify* _tmp35_;
				UndoNodeUnclify* _tmp36_;
				_tmp31_ = mind_map_get_animator (self);
				_tmp32_ = _tmp31_;
				_tmp33_ = mind_map_get_nodes (self);
				_tmp34_ = _tmp33_;
				animator_add_nodes (_tmp32_, _tmp34_, FALSE, "make_sibling_of_grandparent");
				_g_array_unref0 (_tmp34_);
				_tmp35_ = undo_node_unclify_new (node);
				_tmp36_ = _tmp35_;
				mind_map_add_undo (self, (UndoItem*) _tmp36_);
				_g_object_unref0 (_tmp36_);
				node_make_parent_sibling (node);
				complete = TRUE;
			} else {
				if (node_contains_node (node, other)) {
					gint idx = 0;
					gint num_children = 0;
					GArray* _tmp37_;
					GArray* _tmp38_;
					gint _tmp39_;
					Animator* _tmp40_;
					Animator* _tmp41_;
					GArray* _tmp42_;
					GArray* _tmp43_;
					UndoNodeReparent* _tmp44_;
					UndoNodeReparent* _tmp45_;
					idx = node_index (node);
					_tmp37_ = node_children (node);
					_tmp38_ = _tmp37_;
					_tmp39_ = (gint) _tmp38_->len;
					_g_array_unref0 (_tmp38_);
					num_children = _tmp39_;
					_tmp40_ = mind_map_get_animator (self);
					_tmp41_ = _tmp40_;
					_tmp42_ = mind_map_get_nodes (self);
					_tmp43_ = _tmp42_;
					animator_add_nodes (_tmp41_, _tmp43_, FALSE, "make_children_siblings");
					_g_array_unref0 (_tmp43_);
					node_make_children_siblings (node);
					_tmp44_ = undo_node_reparent_new (node, idx, idx + num_children);
					_tmp45_ = _tmp44_;
					mind_map_add_undo (self, (UndoItem*) _tmp45_);
					_g_object_unref0 (_tmp45_);
					complete = TRUE;
				}
			}
		}
	}
	if (complete) {
		Animator* _tmp46_;
		Animator* _tmp47_;
		_tmp46_ = mind_map_get_animator (self);
		_tmp47_ = _tmp46_;
		animator_animate (_tmp47_);
		mind_map_queue_draw (self);
		mind_map_auto_save (self);
	}
}

void
mind_map_attach_selected_nodes (MindMap* self)
{
	MapModel* _tmp0_;
	Node* _tmp1_;
	Node* _tmp2_;
	GArray* nodes = NULL;
	Selection* _tmp3_;
	GArray* _tmp4_;
	MapModel* _tmp5_;
	Node* _tmp6_;
	Node* _tmp7_;
	UndoNodesAttach* _tmp8_;
	UndoNodesAttach* _tmp9_;
	Animator* _tmp10_;
	Animator* _tmp11_;
	GArray* _tmp12_;
	GArray* _tmp13_;
	MapModel* _tmp14_;
	MapModel* _tmp15_;
	Node* _tmp16_;
	Node* _tmp17_;
	MapModel* _tmp18_;
	Animator* _tmp19_;
	Animator* _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_attach_node (_tmp0_);
	_tmp2_ = _tmp1_;
	_vala_assert (_tmp2_ != NULL, "_model.attach_node != null");
	_tmp3_ = self->priv->_selected;
	_tmp4_ = selection_ordered_nodes (_tmp3_);
	nodes = _tmp4_;
	_tmp5_ = self->priv->_model;
	_tmp6_ = map_model_get_attach_node (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = undo_nodes_attach_new (nodes, _tmp7_);
	_tmp9_ = _tmp8_;
	mind_map_add_undo (self, (UndoItem*) _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = mind_map_get_animator (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = mind_map_get_nodes (self);
	_tmp13_ = _tmp12_;
	animator_add_nodes (_tmp11_, _tmp13_, FALSE, "attach_selected_nodes");
	_g_array_unref0 (_tmp13_);
	_tmp14_ = self->priv->_model;
	_tmp15_ = self->priv->_model;
	_tmp16_ = map_model_get_attach_node (_tmp15_);
	_tmp17_ = _tmp16_;
	map_model_attach_nodes (_tmp14_, nodes, _tmp17_);
	_tmp18_ = self->priv->_model;
	map_model_set_attach_node (_tmp18_, NULL, NODE_MODE_ATTACHABLE);
	_tmp19_ = mind_map_get_animator (self);
	_tmp20_ = _tmp19_;
	animator_animate (_tmp20_);
	mind_map_auto_save (self);
	_g_array_unref0 (nodes);
}

void
mind_map_update_focus_mode (MindMap* self)
{
	GArray* selnodes = NULL;
	Selection* _tmp0_;
	Selection* _tmp1_;
	GArray* _tmp2_;
	GArray* selconns = NULL;
	Selection* _tmp3_;
	Selection* _tmp4_;
	GArray* _tmp5_;
	gdouble _tmp6_ = 0.0;
	gboolean _tmp7_ = FALSE;
	Tags* _tmp8_;
	gdouble alpha = 0.0;
	GArray* nodes = NULL;
	MapModel* _tmp13_;
	GArray* _tmp14_;
	Tags* _tmp20_;
	g_return_if_fail (self != NULL);
	_tmp0_ = mind_map_get_selected (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = selection_nodes (_tmp1_);
	selnodes = _tmp2_;
	_tmp3_ = mind_map_get_selected (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = selection_connections (_tmp4_);
	selconns = _tmp5_;
	_tmp8_ = self->priv->_highlighted;
	if (tags_size (_tmp8_) > 0) {
		_tmp7_ = TRUE;
	} else {
		gboolean _tmp9_ = FALSE;
		if (self->priv->_focus_mode) {
			gboolean _tmp10_ = FALSE;
			GArray* _tmp11_;
			_tmp11_ = selnodes;
			if (_tmp11_->len > ((guint) 0)) {
				_tmp10_ = TRUE;
			} else {
				GArray* _tmp12_;
				_tmp12_ = selconns;
				_tmp10_ = _tmp12_->len > ((guint) 0);
			}
			_tmp9_ = _tmp10_;
		} else {
			_tmp9_ = FALSE;
		}
		_tmp7_ = _tmp9_;
	}
	if (_tmp7_) {
		_tmp6_ = self->priv->_focus_alpha;
	} else {
		_tmp6_ = 1.0;
	}
	alpha = _tmp6_;
	_tmp13_ = self->priv->_model;
	_tmp14_ = map_model_get_nodes (_tmp13_);
	nodes = _tmp14_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp15_ = FALSE;
			_tmp15_ = TRUE;
			while (TRUE) {
				GArray* _tmp17_;
				GArray* _tmp18_;
				Node* _tmp19_;
				if (!_tmp15_) {
					gint _tmp16_;
					_tmp16_ = i;
					i = _tmp16_ + 1;
				}
				_tmp15_ = FALSE;
				_tmp17_ = nodes;
				if (!(((guint) i) < _tmp17_->len)) {
					break;
				}
				_tmp18_ = nodes;
				_tmp19_ = g_array_index (_tmp18_, Node*, (guint) i);
				node_set_alpha (_tmp19_, alpha);
			}
		}
	}
	_tmp20_ = self->priv->_highlighted;
	if (tags_size (_tmp20_) > 0) {
		MapModel* _tmp21_;
		Tags* _tmp22_;
		_tmp21_ = self->priv->_model;
		_tmp22_ = self->priv->_highlighted;
		map_model_highlight_tags (_tmp21_, _tmp22_, self->priv->_highlight_mode);
	} else {
		if (self->priv->_focus_mode) {
			MapModel* _tmp40_;
			Connections* _tmp41_;
			Connections* _tmp42_;
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp23_ = FALSE;
					_tmp23_ = TRUE;
					while (TRUE) {
						GArray* _tmp25_;
						Node* current = NULL;
						GArray* _tmp26_;
						Node* _tmp27_;
						Node* _tmp28_;
						Node* _tmp29_;
						Node* parent = NULL;
						Node* _tmp30_;
						Node* _tmp31_;
						Node* _tmp32_;
						Node* _tmp33_;
						if (!_tmp23_) {
							gint _tmp24_;
							_tmp24_ = i;
							i = _tmp24_ + 1;
						}
						_tmp23_ = FALSE;
						_tmp25_ = selnodes;
						if (!(((guint) i) < _tmp25_->len)) {
							break;
						}
						_tmp26_ = selnodes;
						_tmp27_ = g_array_index (_tmp26_, Node*, (guint) i);
						_tmp28_ = _g_object_ref0 (_tmp27_);
						current = _tmp28_;
						_tmp29_ = current;
						node_set_alpha (_tmp29_, 1.0);
						_tmp30_ = current;
						_tmp31_ = node_get_parent (_tmp30_);
						_tmp32_ = _tmp31_;
						_tmp33_ = _g_object_ref0 (_tmp32_);
						parent = _tmp33_;
						while (TRUE) {
							Node* _tmp34_;
							Node* _tmp35_;
							Node* _tmp36_;
							Node* _tmp37_;
							Node* _tmp38_;
							Node* _tmp39_;
							_tmp34_ = parent;
							if (!(_tmp34_ != NULL)) {
								break;
							}
							_tmp35_ = parent;
							node_set_alpha_only (_tmp35_, 1.0);
							_tmp36_ = parent;
							_tmp37_ = node_get_parent (_tmp36_);
							_tmp38_ = _tmp37_;
							_tmp39_ = _g_object_ref0 (_tmp38_);
							_g_object_unref0 (parent);
							parent = _tmp39_;
						}
						_g_object_unref0 (parent);
						_g_object_unref0 (current);
					}
				}
			}
			_tmp40_ = self->priv->_model;
			_tmp41_ = map_model_get_connections (_tmp40_);
			_tmp42_ = _tmp41_;
			connections_update_alpha (_tmp42_);
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp43_ = FALSE;
					_tmp43_ = TRUE;
					while (TRUE) {
						GArray* _tmp45_;
						GArray* _tmp46_;
						Connection* _tmp47_;
						if (!_tmp43_) {
							gint _tmp44_;
							_tmp44_ = i;
							i = _tmp44_ + 1;
						}
						_tmp43_ = FALSE;
						_tmp45_ = selconns;
						if (!(((guint) i) < _tmp45_->len)) {
							break;
						}
						_tmp46_ = selconns;
						_tmp47_ = g_array_index (_tmp46_, Connection*, (guint) i);
						connection_set_alpha (_tmp47_, 1.0);
					}
				}
			}
		}
	}
	mind_map_queue_draw (self);
	_g_array_unref0 (nodes);
	_g_array_unref0 (selconns);
	_g_array_unref0 (selnodes);
}

void
mind_map_update_focus_mode_alpha (MindMap* self)
{
	gchar* key = NULL;
	gchar* _tmp0_;
	gdouble alpha = 0.0;
	GSettings* _tmp1_;
	const gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup ("focus-mode-alpha");
	key = _tmp0_;
	_tmp1_ = self->priv->_settings;
	_tmp2_ = key;
	alpha = g_settings_get_double (_tmp1_, _tmp2_);
	if (alpha < ((gdouble) 0)) {
		_tmp3_ = TRUE;
	} else {
		_tmp3_ = alpha >= 1.0;
	}
	if (_tmp3_) {
		GSettings* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = self->priv->_settings;
		_tmp5_ = key;
		g_settings_set_double (_tmp4_, _tmp5_, self->priv->_focus_alpha);
	} else {
		if (self->priv->_focus_alpha != alpha) {
			GArray* nodes = NULL;
			MapModel* _tmp6_;
			GArray* _tmp7_;
			MapModel* _tmp13_;
			Connections* _tmp14_;
			Connections* _tmp15_;
			self->priv->_focus_alpha = alpha;
			_tmp6_ = self->priv->_model;
			_tmp7_ = map_model_get_nodes (_tmp6_);
			nodes = _tmp7_;
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp8_ = FALSE;
					_tmp8_ = TRUE;
					while (TRUE) {
						GArray* _tmp10_;
						GArray* _tmp11_;
						Node* _tmp12_;
						if (!_tmp8_) {
							gint _tmp9_;
							_tmp9_ = i;
							i = _tmp9_ + 1;
						}
						_tmp8_ = FALSE;
						_tmp10_ = nodes;
						if (!(((guint) i) < _tmp10_->len)) {
							break;
						}
						_tmp11_ = nodes;
						_tmp12_ = g_array_index (_tmp11_, Node*, (guint) i);
						node_update_alpha (_tmp12_, alpha);
					}
				}
			}
			_tmp13_ = self->priv->_model;
			_tmp14_ = map_model_get_connections (_tmp13_);
			_tmp15_ = _tmp14_;
			connections_update_alpha (_tmp15_);
			mind_map_queue_draw (self);
			_g_array_unref0 (nodes);
		}
	}
	_g_free0 (key);
}

void
mind_map_get_saved_dimensions (MindMap* self,
                               gint* width,
                               gint* height)
{
	gint _vala_width = 0;
	gint _vala_height = 0;
	gint _tmp0_ = 0;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	GSettings* _tmp4_;
	gint sidebar_width = 0;
	GSettings* _tmp9_;
	GSettings* _tmp10_;
	g_return_if_fail (self != NULL);
	_tmp4_ = self->priv->_settings;
	if (g_settings_get_boolean (_tmp4_, "current-properties-shown")) {
		_tmp3_ = TRUE;
	} else {
		GSettings* _tmp5_;
		_tmp5_ = self->priv->_settings;
		_tmp3_ = g_settings_get_boolean (_tmp5_, "map-properties-shown");
	}
	if (_tmp3_) {
		_tmp2_ = TRUE;
	} else {
		GSettings* _tmp6_;
		_tmp6_ = self->priv->_settings;
		_tmp2_ = g_settings_get_boolean (_tmp6_, "sticker-properties-shown");
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		GSettings* _tmp7_;
		_tmp7_ = self->priv->_settings;
		_tmp1_ = g_settings_get_boolean (_tmp7_, "style-properties-shown");
	}
	if (_tmp1_) {
		GSettings* _tmp8_;
		_tmp8_ = self->priv->_settings;
		_tmp0_ = g_settings_get_int (_tmp8_, "properties-width");
	} else {
		_tmp0_ = 0;
	}
	sidebar_width = _tmp0_;
	_tmp9_ = self->priv->_settings;
	_vala_width = g_settings_get_int (_tmp9_, "window-w") - sidebar_width;
	_tmp10_ = self->priv->_settings;
	_vala_height = g_settings_get_int (_tmp10_, "window-h");
	if (width) {
		*width = _vala_width;
	}
	if (height) {
		*height = _vala_height;
	}
}

void
mind_map_queue_draw (MindMap* self)
{
	DrawArea* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_canvas;
	gtk_widget_queue_draw ((GtkWidget*) _tmp0_);
}

void
mind_map_auto_save (MindMap* self)
{
	MapModel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_model;
	map_model_auto_save (_tmp0_);
}

Theme*
mind_map_get_theme (MindMap* self)
{
	MapModel* _tmp0_;
	Theme* _tmp1_;
	Theme* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_theme (_tmp0_);
	result = _tmp1_;
	return result;
}

MarkdownParser*
mind_map_get_markdown_parser (MindMap* self)
{
	MarkdownParser* result;
	MarkdownParser* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_markdown_parser;
	result = _tmp0_;
	return result;
}

static gpointer
_text_parser_ref0 (gpointer self)
{
	return self ? text_parser_ref (self) : NULL;
}

static void
mind_map_set_markdown_parser (MindMap* self,
                              MarkdownParser* value)
{
	MarkdownParser* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _text_parser_ref0 (value);
	_text_parser_unref0 (self->priv->_markdown_parser);
	self->priv->_markdown_parser = _tmp0_;
}

TaggerParser*
mind_map_get_tagger_parser (MindMap* self)
{
	TaggerParser* result;
	TaggerParser* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tagger_parser;
	result = _tmp0_;
	return result;
}

static void
mind_map_set_tagger_parser (MindMap* self,
                            TaggerParser* value)
{
	TaggerParser* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _text_parser_ref0 (value);
	_text_parser_unref0 (self->priv->_tagger_parser);
	self->priv->_tagger_parser = _tmp0_;
}

UrlParser*
mind_map_get_url_parser (MindMap* self)
{
	UrlParser* result;
	UrlParser* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url_parser;
	result = _tmp0_;
	return result;
}

static void
mind_map_set_url_parser (MindMap* self,
                         UrlParser* value)
{
	UrlParser* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _text_parser_ref0 (value);
	_text_parser_unref0 (self->priv->_url_parser);
	self->priv->_url_parser = _tmp0_;
}

UnicodeParser*
mind_map_get_unicode_parser (MindMap* self)
{
	UnicodeParser* result;
	UnicodeParser* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_unicode_parser;
	result = _tmp0_;
	return result;
}

static void
mind_map_set_unicode_parser (MindMap* self,
                             UnicodeParser* value)
{
	UnicodeParser* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _text_parser_ref0 (value);
	_text_parser_unref0 (self->priv->_unicode_parser);
	self->priv->_unicode_parser = _tmp0_;
}

MainWindow*
mind_map_get_win (MindMap* self)
{
	MainWindow* result;
	MainWindow* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_win;
	result = _tmp0_;
	return result;
}

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

MapModel*
mind_map_get_model (MindMap* self)
{
	MapModel* result;
	MapModel* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	result = _tmp0_;
	return result;
}

DrawArea*
mind_map_get_canvas (MindMap* self)
{
	DrawArea* result;
	DrawArea* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_canvas;
	result = _tmp0_;
	return result;
}

Document*
mind_map_get_doc (MindMap* self)
{
	Document* result;
	Document* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_doc;
	result = _tmp0_;
	return result;
}

Selection*
mind_map_get_selected (MindMap* self)
{
	Selection* result;
	Selection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_selected;
	result = _tmp0_;
	return result;
}

UndoBuffer*
mind_map_get_undo_buffer (MindMap* self)
{
	UndoBuffer* result;
	UndoBuffer* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_undo_buffer;
	result = _tmp0_;
	return result;
}

UndoTextBuffer*
mind_map_get_undo_text (MindMap* self)
{
	UndoTextBuffer* result;
	UndoTextBuffer* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_undo_text;
	result = _tmp0_;
	return result;
}

gboolean
mind_map_get_focus_mode (MindMap* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_focus_mode;
	return result;
}

void
mind_map_set_focus_mode (MindMap* self,
                         gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_focus_mode != value) {
		self->priv->_focus_mode = value;
		mind_map_update_focus_mode (self);
	}
}

gdouble
mind_map_get_focus_alpha (MindMap* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_focus_alpha;
	return result;
}

Tags*
mind_map_get_highlighted (MindMap* self)
{
	Tags* result;
	Tags* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_highlighted;
	result = _tmp0_;
	return result;
}

TagComboType
mind_map_get_highlight_mode (MindMap* self)
{
	TagComboType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_highlight_mode;
	return result;
}

void
mind_map_set_highlight_mode (MindMap* self,
                             TagComboType value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_highlight_mode != value) {
		self->priv->_highlight_mode = value;
		mind_map_update_focus_mode (self);
	}
}

Style*
mind_map_get_global_style (MindMap* self)
{
	Style* result;
	Style* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_global_style;
	result = _tmp0_;
	return result;
}

gdouble
mind_map_get_origin_x (MindMap* self)
{
	gdouble result;
	DrawArea* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	g_return_val_if_fail (self != NULL, -1.0);
	_tmp0_ = self->priv->_canvas;
	_tmp1_ = draw_area_get_origin_x (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

gdouble
mind_map_get_origin_y (MindMap* self)
{
	gdouble result;
	DrawArea* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	g_return_val_if_fail (self != NULL, -1.0);
	_tmp0_ = self->priv->_canvas;
	_tmp1_ = draw_area_get_origin_y (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

Animator*
mind_map_get_animator (MindMap* self)
{
	Animator* result;
	DrawArea* _tmp0_;
	Animator* _tmp1_;
	Animator* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_canvas;
	_tmp1_ = draw_area_get_animator (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

GArray*
mind_map_get_braindump (MindMap* self)
{
	GArray* result;
	MapModel* _tmp0_;
	GArray* _tmp1_;
	GArray* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_braindump (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

Connections*
mind_map_get_connections (MindMap* self)
{
	Connections* result;
	MapModel* _tmp0_;
	Connections* _tmp1_;
	Connections* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_connections (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

Stickers*
mind_map_get_stickers (MindMap* self)
{
	Stickers* result;
	MapModel* _tmp0_;
	Stickers* _tmp1_;
	Stickers* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_stickers (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

NodeGroups*
mind_map_get_groups (MindMap* self)
{
	NodeGroups* result;
	MapModel* _tmp0_;
	NodeGroups* _tmp1_;
	NodeGroups* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_groups (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

ImageManager*
mind_map_get_image_manager (MindMap* self)
{
	ImageManager* result;
	MapModel* _tmp0_;
	ImageManager* _tmp1_;
	ImageManager* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_image_manager (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

Layouts*
mind_map_get_layouts (MindMap* self)
{
	Layouts* result;
	MapModel* _tmp0_;
	Layouts* _tmp1_;
	Layouts* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_layouts (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

gint
mind_map_get_next_node_id (MindMap* self)
{
	gint result;
	MapModel* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = self->priv->_model;
	_tmp1_ = map_model_get_next_node_id (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
mind_map_set_next_node_id (MindMap* self,
                           gint value)
{
	MapModel* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_model;
	map_model_set_next_node_id (_tmp0_, value);
}

gboolean
mind_map_get_editable (MindMap* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	if (self->priv->_editable) {
		Document* _tmp1_;
		Document* _tmp2_;
		gboolean _tmp3_;
		gboolean _tmp4_;
		_tmp1_ = mind_map_get_doc (self);
		_tmp2_ = _tmp1_;
		_tmp3_ = document_get_read_only (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = !_tmp4_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

void
mind_map_set_editable (MindMap* self,
                       gboolean value)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_editable != value) {
		self->priv->_editable = value;
		g_signal_emit (self, mind_map_signals[MIND_MAP_EDITABLE_CHANGED_SIGNAL], 0, self);
	}
}

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

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

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

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

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

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

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

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

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

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

void
value_set_mind_map (GValue* value,
                    gpointer v_object)
{
	MindMap * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MIND_MAP));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MIND_MAP));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		mind_map_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		mind_map_unref (old);
	}
}

void
value_take_mind_map (GValue* value,
                     gpointer v_object)
{
	MindMap * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_MIND_MAP));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_MIND_MAP));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		mind_map_unref (old);
	}
}

static void
mind_map_class_init (MindMapClass * klass,
                     gpointer klass_data)
{
	mind_map_parent_class = g_type_class_peek_parent (klass);
	((MindMapClass *) klass)->finalize = mind_map_finalize;
	g_type_class_adjust_private_offset (klass, &MindMap_private_offset);
	mind_map_signals[MIND_MAP_CHANGED_SIGNAL] = g_signal_new ("changed", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	mind_map_signals[MIND_MAP_CURRENT_CHANGED_SIGNAL] = g_signal_new ("current-changed", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__MIND_MAP, G_TYPE_NONE, 1, TYPE_MIND_MAP);
	mind_map_signals[MIND_MAP_THEME_CHANGED_SIGNAL] = g_signal_new ("theme-changed", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__MIND_MAP, G_TYPE_NONE, 1, TYPE_MIND_MAP);
	mind_map_signals[MIND_MAP_LOADED_SIGNAL] = g_signal_new ("loaded", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	mind_map_signals[MIND_MAP_SCALE_CHANGED_SIGNAL] = g_signal_new ("scale-changed", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__DOUBLE, G_TYPE_NONE, 1, G_TYPE_DOUBLE);
	mind_map_signals[MIND_MAP_SCROLL_CHANGED_SIGNAL] = g_signal_new ("scroll-changed", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	mind_map_signals[MIND_MAP_SHOW_PROPERTIES_SIGNAL] = g_signal_new ("show-properties", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_ENUM, G_TYPE_NONE, 2, G_TYPE_STRING, TYPE_PROPERTY_GRAB);
	mind_map_signals[MIND_MAP_HIDE_PROPERTIES_SIGNAL] = g_signal_new ("hide-properties", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	mind_map_signals[MIND_MAP_UNDO_BUFFER_CHANGED_SIGNAL] = g_signal_new ("undo-buffer-changed", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, TYPE_UNDO_BUFFER);
	mind_map_signals[MIND_MAP_EDITABLE_CHANGED_SIGNAL] = g_signal_new ("editable-changed", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__MIND_MAP, G_TYPE_NONE, 1, TYPE_MIND_MAP);
	mind_map_signals[MIND_MAP_RELOAD_TAGS_SIGNAL] = g_signal_new ("reload-tags", TYPE_MIND_MAP, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
mind_map_instance_init (MindMap * self,
                        gpointer klass)
{
	self->priv = mind_map_get_instance_private (self);
	self->priv->_focus_mode = FALSE;
	self->priv->_focus_alpha = 0.05;
	self->priv->_highlight_mode = TAG_COMBO_TYPE_AND;
	self->priv->_editable = TRUE;
	self->ref_count = 1;
}

static void
mind_map_finalize (MindMap * obj)
{
	MindMap * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MIND_MAP, MindMap);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->_win);
	_g_object_unref0 (self->priv->_settings);
	_map_model_unref0 (self->priv->_model);
	_g_object_unref0 (self->priv->_canvas);
	_g_object_unref0 (self->priv->_doc);
	_g_object_unref0 (self->priv->_undo_buffer);
	_g_object_unref0 (self->priv->_undo_text);
	_selection_unref0 (self->priv->_selected);
	_tags_unref0 (self->priv->_highlighted);
	_style_unref0 (self->priv->_global_style);
	_text_parser_unref0 (self->priv->_markdown_parser);
	_text_parser_unref0 (self->priv->_tagger_parser);
	_text_parser_unref0 (self->priv->_url_parser);
	_text_parser_unref0 (self->priv->_unicode_parser);
}

static GType
mind_map_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { value_mind_map_init, value_mind_map_free_value, value_mind_map_copy_value, value_mind_map_peek_pointer, "p", value_mind_map_collect_value, "p", value_mind_map_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (MindMapClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) mind_map_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MindMap), 0, (GInstanceInitFunc) mind_map_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType mind_map_type_id;
	mind_map_type_id = g_type_register_fundamental (g_type_fundamental_next (), "MindMap", &g_define_type_info, &g_define_type_fundamental_info, 0);
	MindMap_private_offset = g_type_add_instance_private (mind_map_type_id, sizeof (MindMapPrivate));
	return mind_map_type_id;
}

GType
mind_map_get_type (void)
{
	static volatile gsize mind_map_type_id__once = 0;
	if (g_once_init_enter (&mind_map_type_id__once)) {
		GType mind_map_type_id;
		mind_map_type_id = mind_map_get_type_once ();
		g_once_init_leave (&mind_map_type_id__once, mind_map_type_id);
	}
	return mind_map_type_id__once;
}

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

void
mind_map_unref (gpointer instance)
{
	MindMap * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		MIND_MAP_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

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

