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

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

#include <glib-object.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gtk/gtkimmodule.h>
#include <stdlib.h>
#include <cairo-gobject.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>

#define DRAW_AREA_move_cursor "move"
#define DRAW_AREA_text_cursor "text"
#define DRAW_AREA_pointer_cursor "pointer"
#define DRAW_AREA_pan_cursor "grabbing"
#define DRAW_AREA_autopan_inner_edge ((gdouble) 20)
#define DRAW_AREA_autopan_outer_edge ((gdouble) 5)
#define DRAW_AREA_autopan_min_speed ((gdouble) 5)
#define DRAW_AREA_autopan_max_speed ((gdouble) 15)
#define DRAW_AREA_autopan_frame_rate ((guint) 20)
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

typedef enum  {
	DRAG_TYPES_URI,
	DRAG_TYPES_STICKER
} DragTypes;

#define TYPE_DRAG_TYPES (drag_types_get_type ())

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

#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;
typedef struct _DrawAreaPrivate DrawAreaPrivate;

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

typedef struct _MindMap MindMap;
typedef struct _MindMapClass MindMapClass;

#define TYPE_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;
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_NODE_INFO (node_info_get_type ())
typedef struct _NodeInfo NodeInfo;

#define TYPE_BASE_MENU (base_menu_get_type ())
#define BASE_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BASE_MENU, BaseMenu))
#define BASE_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BASE_MENU, BaseMenuClass))
#define IS_BASE_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BASE_MENU))
#define IS_BASE_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BASE_MENU))
#define BASE_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BASE_MENU, BaseMenuClass))

typedef struct _BaseMenu BaseMenu;
typedef struct _BaseMenuClass BaseMenuClass;

#define TYPE_NODE_MENU (node_menu_get_type ())
#define NODE_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_MENU, NodeMenu))
#define NODE_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_MENU, NodeMenuClass))
#define IS_NODE_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_MENU))
#define IS_NODE_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_MENU))
#define NODE_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_MENU, NodeMenuClass))

typedef struct _NodeMenu NodeMenu;
typedef struct _NodeMenuClass NodeMenuClass;

#define TYPE_CONNECTION_MENU (connection_menu_get_type ())
#define CONNECTION_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONNECTION_MENU, ConnectionMenu))
#define CONNECTION_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONNECTION_MENU, ConnectionMenuClass))
#define IS_CONNECTION_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONNECTION_MENU))
#define IS_CONNECTION_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONNECTION_MENU))
#define CONNECTION_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONNECTION_MENU, ConnectionMenuClass))

typedef struct _ConnectionMenu ConnectionMenu;
typedef struct _ConnectionMenuClass ConnectionMenuClass;

#define TYPE_CONNECTIONS_MENU (connections_menu_get_type ())
#define CONNECTIONS_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONNECTIONS_MENU, ConnectionsMenu))
#define CONNECTIONS_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONNECTIONS_MENU, ConnectionsMenuClass))
#define IS_CONNECTIONS_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONNECTIONS_MENU))
#define IS_CONNECTIONS_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONNECTIONS_MENU))
#define CONNECTIONS_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONNECTIONS_MENU, ConnectionsMenuClass))

typedef struct _ConnectionsMenu ConnectionsMenu;
typedef struct _ConnectionsMenuClass ConnectionsMenuClass;

#define TYPE_NODES_MENU (nodes_menu_get_type ())
#define NODES_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODES_MENU, NodesMenu))
#define NODES_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODES_MENU, NodesMenuClass))
#define IS_NODES_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODES_MENU))
#define IS_NODES_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODES_MENU))
#define NODES_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODES_MENU, NodesMenuClass))

typedef struct _NodesMenu NodesMenu;
typedef struct _NodesMenuClass NodesMenuClass;

#define TYPE_GROUPS_MENU (groups_menu_get_type ())
#define GROUPS_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GROUPS_MENU, GroupsMenu))
#define GROUPS_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GROUPS_MENU, GroupsMenuClass))
#define IS_GROUPS_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GROUPS_MENU))
#define IS_GROUPS_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GROUPS_MENU))
#define GROUPS_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GROUPS_MENU, GroupsMenuClass))

typedef struct _GroupsMenu GroupsMenu;
typedef struct _GroupsMenuClass GroupsMenuClass;

#define TYPE_CALLOUT_MENU (callout_menu_get_type ())
#define CALLOUT_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CALLOUT_MENU, CalloutMenu))
#define CALLOUT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CALLOUT_MENU, CalloutMenuClass))
#define IS_CALLOUT_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CALLOUT_MENU))
#define IS_CALLOUT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CALLOUT_MENU))
#define CALLOUT_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CALLOUT_MENU, CalloutMenuClass))

typedef struct _CalloutMenu CalloutMenu;
typedef struct _CalloutMenuClass CalloutMenuClass;

#define TYPE_EMPTY_MENU (empty_menu_get_type ())
#define EMPTY_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EMPTY_MENU, EmptyMenu))
#define EMPTY_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EMPTY_MENU, EmptyMenuClass))
#define IS_EMPTY_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EMPTY_MENU))
#define IS_EMPTY_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EMPTY_MENU))
#define EMPTY_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EMPTY_MENU, EmptyMenuClass))

typedef struct _EmptyMenu EmptyMenu;
typedef struct _EmptyMenuClass EmptyMenuClass;

#define TYPE_TEXT_MENU (text_menu_get_type ())
#define TEXT_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEXT_MENU, TextMenu))
#define TEXT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEXT_MENU, TextMenuClass))
#define IS_TEXT_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEXT_MENU))
#define IS_TEXT_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEXT_MENU))
#define TEXT_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEXT_MENU, TextMenuClass))

typedef struct _TextMenu TextMenu;
typedef struct _TextMenuClass TextMenuClass;

#define TYPE_IMAGE_EDITOR (image_editor_get_type ())
#define IMAGE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IMAGE_EDITOR, ImageEditor))
#define IMAGE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMAGE_EDITOR, ImageEditorClass))
#define IS_IMAGE_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IMAGE_EDITOR))
#define IS_IMAGE_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IMAGE_EDITOR))
#define IMAGE_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IMAGE_EDITOR, ImageEditorClass))

typedef struct _ImageEditor ImageEditor;
typedef struct _ImageEditorClass ImageEditorClass;

#define TYPE_URL_EDITOR (url_editor_get_type ())
#define URL_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_URL_EDITOR, UrlEditor))
#define URL_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_URL_EDITOR, UrlEditorClass))
#define IS_URL_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_URL_EDITOR))
#define IS_URL_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_URL_EDITOR))
#define URL_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_URL_EDITOR, UrlEditorClass))

typedef struct _UrlEditor UrlEditor;
typedef struct _UrlEditorClass UrlEditorClass;

#define TYPE_TAGGER (tagger_get_type ())
#define TAGGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAGGER, Tagger))
#define TAGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAGGER, TaggerClass))
#define IS_TAGGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAGGER))
#define IS_TAGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAGGER))
#define TAGGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAGGER, TaggerClass))

typedef struct _Tagger Tagger;
typedef struct _TaggerClass TaggerClass;

#define TYPE_TEXT_COMPLETION (text_completion_get_type ())
#define TEXT_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEXT_COMPLETION, TextCompletion))
#define TEXT_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEXT_COMPLETION, TextCompletionClass))
#define IS_TEXT_COMPLETION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEXT_COMPLETION))
#define IS_TEXT_COMPLETION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEXT_COMPLETION))
#define TEXT_COMPLETION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEXT_COMPLETION, TextCompletionClass))

typedef struct _TextCompletion TextCompletion;
typedef struct _TextCompletionClass TextCompletionClass;

#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_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;
enum  {
	DRAW_AREA_0_PROPERTY,
	DRAW_AREA_WIN_PROPERTY,
	DRAW_AREA_ANIMATOR_PROPERTY,
	DRAW_AREA_MAP_PROPERTY,
	DRAW_AREA_IM_CONTEXT_PROPERTY,
	DRAW_AREA_SCALED_X_PROPERTY,
	DRAW_AREA_SCALED_Y_PROPERTY,
	DRAW_AREA_PRESS_X_PROPERTY,
	DRAW_AREA_PRESS_Y_PROPERTY,
	DRAW_AREA_ORIGIN_X_PROPERTY,
	DRAW_AREA_ORIGIN_Y_PROPERTY,
	DRAW_AREA_SFACTOR_PROPERTY,
	DRAW_AREA_URL_EDITOR_PROPERTY,
	DRAW_AREA_IMAGE_EDITOR_PROPERTY,
	DRAW_AREA_TAGGER_PROPERTY,
	DRAW_AREA_COMPLETION_PROPERTY,
	DRAW_AREA_LAST_CONNECTION_PROPERTY,
	DRAW_AREA_ORIG_INFO_PROPERTY,
	DRAW_AREA_NUM_PROPERTIES
};
static GParamSpec* draw_area_properties[DRAW_AREA_NUM_PROPERTIES];
#define _mind_map_unref0(var) ((var == NULL) ? NULL : (var = (mind_map_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
#define _base_menu_unref0(var) ((var == NULL) ? NULL : (var = (base_menu_unref (var), NULL)))
#define _g_free0(var) ((var == NULL) ? NULL : (var = (g_free (var), NULL)))
#define _image_editor_unref0(var) ((var == NULL) ? NULL : (var = (image_editor_unref (var), NULL)))
#define _url_editor_unref0(var) ((var == NULL) ? NULL : (var = (url_editor_unref (var), NULL)))
#define _tagger_unref0(var) ((var == NULL) ? NULL : (var = (tagger_unref (var), NULL)))
#define _text_completion_unref0(var) ((var == NULL) ? NULL : (var = (text_completion_unref (var), NULL)))

#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_NODE_IMAGE (node_image_get_type ())
#define NODE_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_IMAGE, NodeImage))
#define NODE_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_IMAGE, NodeImageClass))
#define IS_NODE_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_IMAGE))
#define IS_NODE_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_IMAGE))
#define NODE_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_IMAGE, NodeImageClass))

typedef struct _NodeImage NodeImage;
typedef struct _NodeImageClass NodeImageClass;

#define TYPE_IDEA (idea_get_type ())
#define IDEA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IDEA, Idea))
#define IDEA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IDEA, IdeaClass))
#define IS_IDEA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IDEA))
#define IS_IDEA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IDEA))
#define IDEA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IDEA, IdeaClass))

typedef struct _Idea Idea;
typedef struct _IdeaClass IdeaClass;

#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_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_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;
typedef enum  {
	MAP_ITEM_COMPONENT_NONE,
	MAP_ITEM_COMPONENT_CURVE,
	MAP_ITEM_COMPONENT_TITLE_BOX,
	MAP_ITEM_COMPONENT_TITLE,
	MAP_ITEM_COMPONENT_NOTE,
	MAP_ITEM_COMPONENT_DRAG_HANDLE,
	MAP_ITEM_COMPONENT_FROM_HANDLE,
	MAP_ITEM_COMPONENT_TO_HANDLE,
	MAP_ITEM_COMPONENT_STICKER,
	MAP_ITEM_COMPONENT_NODE_LINK,
	MAP_ITEM_COMPONENT_IMAGE,
	MAP_ITEM_COMPONENT_LINK,
	MAP_ITEM_COMPONENT_TASK,
	MAP_ITEM_COMPONENT_FOLD,
	MAP_ITEM_COMPONENT_RESIZER,
	MAP_ITEM_COMPONENT_TAGS
} MapItemComponent;

#define TYPE_MAP_ITEM_COMPONENT (map_item_component_get_type ())
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 ())

#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  {
	FORMAT_TAG_BOLD = 0,
	FORMAT_TAG_ITALICS,
	FORMAT_TAG_UNDERLINE,
	FORMAT_TAG_STRIKETHRU,
	FORMAT_TAG_CODE,
	FORMAT_TAG_SUB,
	FORMAT_TAG_SUPER,
	FORMAT_TAG_HEADER,
	FORMAT_TAG_COLOR,
	FORMAT_TAG_HILITE,
	FORMAT_TAG_URL,
	FORMAT_TAG_SYNTAX,
	FORMAT_TAG_TAG,
	FORMAT_TAG_MATCH,
	FORMAT_TAG_SELECT,
	FORMAT_TAG_LENGTH
} FormatTag;

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

#define TYPE_PROPERTY_GRAB (property_grab_get_type ())
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_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_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;
typedef enum  {
	STICKER_MODE_NONE = 0,
	STICKER_MODE_SELECTED,
	STICKER_MODE_DROPPABLE
} StickerMode;

#define TYPE_STICKER_MODE (sticker_mode_get_type ())

#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_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  {
	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 TYPE_NODE_BOUNDS (node_bounds_get_type ())
#define NODE_BOUNDS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_BOUNDS, NodeBounds))
#define NODE_BOUNDS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_BOUNDS, NodeBoundsClass))
#define IS_NODE_BOUNDS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_BOUNDS))
#define IS_NODE_BOUNDS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_BOUNDS))
#define NODE_BOUNDS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_BOUNDS, NodeBoundsClass))

typedef struct _NodeBounds NodeBounds;
typedef struct _NodeBoundsClass NodeBoundsClass;
#define _node_bounds_unref0(var) ((var == NULL) ? NULL : (var = (node_bounds_unref (var), NULL)))

#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 __vala_GdkRGBA_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkRGBA_free (var), NULL)))

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

typedef struct _Layout Layout;
typedef struct _LayoutClass LayoutClass;

#define TYPE_NODE_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_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 struct _Block16Data Block16Data;
typedef struct _Block17Data Block17Data;
typedef struct _Block18Data Block18Data;
typedef struct _Block19Data Block19Data;

#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_STICKER_RESIZE (undo_sticker_resize_get_type ())
#define UNDO_STICKER_RESIZE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_STICKER_RESIZE, UndoStickerResize))
#define UNDO_STICKER_RESIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_STICKER_RESIZE, UndoStickerResizeClass))
#define IS_UNDO_STICKER_RESIZE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_STICKER_RESIZE))
#define IS_UNDO_STICKER_RESIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_STICKER_RESIZE))
#define UNDO_STICKER_RESIZE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_STICKER_RESIZE, UndoStickerResizeClass))

typedef struct _UndoStickerResize UndoStickerResize;
typedef struct _UndoStickerResizeClass UndoStickerResizeClass;

#define TYPE_UNDO_NODE_RESIZE (undo_node_resize_get_type ())
#define UNDO_NODE_RESIZE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_RESIZE, UndoNodeResize))
#define UNDO_NODE_RESIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_RESIZE, UndoNodeResizeClass))
#define IS_UNDO_NODE_RESIZE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_RESIZE))
#define IS_UNDO_NODE_RESIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_RESIZE))
#define UNDO_NODE_RESIZE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_RESIZE, UndoNodeResizeClass))

typedef struct _UndoNodeResize UndoNodeResize;
typedef struct _UndoNodeResizeClass UndoNodeResizeClass;

#define TYPE_UNDO_CALLOUT_RESIZE (undo_callout_resize_get_type ())
#define UNDO_CALLOUT_RESIZE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_CALLOUT_RESIZE, UndoCalloutResize))
#define UNDO_CALLOUT_RESIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_CALLOUT_RESIZE, UndoCalloutResizeClass))
#define IS_UNDO_CALLOUT_RESIZE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_CALLOUT_RESIZE))
#define IS_UNDO_CALLOUT_RESIZE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_CALLOUT_RESIZE))
#define UNDO_CALLOUT_RESIZE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_CALLOUT_RESIZE, UndoCalloutResizeClass))

typedef struct _UndoCalloutResize UndoCalloutResize;
typedef struct _UndoCalloutResizeClass UndoCalloutResizeClass;

#define TYPE_UNDO_CONNECTION_CHANGE (undo_connection_change_get_type ())
#define UNDO_CONNECTION_CHANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_CONNECTION_CHANGE, UndoConnectionChange))
#define UNDO_CONNECTION_CHANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_CONNECTION_CHANGE, UndoConnectionChangeClass))
#define IS_UNDO_CONNECTION_CHANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_CONNECTION_CHANGE))
#define IS_UNDO_CONNECTION_CHANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_CONNECTION_CHANGE))
#define UNDO_CONNECTION_CHANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_CONNECTION_CHANGE, UndoConnectionChangeClass))

typedef struct _UndoConnectionChange UndoConnectionChange;
typedef struct _UndoConnectionChangeClass UndoConnectionChangeClass;

#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_STICKER_MOVE (undo_sticker_move_get_type ())
#define UNDO_STICKER_MOVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_STICKER_MOVE, UndoStickerMove))
#define UNDO_STICKER_MOVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_STICKER_MOVE, UndoStickerMoveClass))
#define IS_UNDO_STICKER_MOVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_STICKER_MOVE))
#define IS_UNDO_STICKER_MOVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_STICKER_MOVE))
#define UNDO_STICKER_MOVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_STICKER_MOVE, UndoStickerMoveClass))

typedef struct _UndoStickerMove UndoStickerMove;
typedef struct _UndoStickerMoveClass UndoStickerMoveClass;
typedef struct _Block20Data Block20Data;

#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_FORMATTED_TEXT (formatted_text_get_type ())
#define FORMATTED_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORMATTED_TEXT, FormattedText))
#define FORMATTED_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORMATTED_TEXT, FormattedTextClass))
#define IS_FORMATTED_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORMATTED_TEXT))
#define IS_FORMATTED_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORMATTED_TEXT))
#define FORMATTED_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORMATTED_TEXT, FormattedTextClass))

typedef struct _FormattedText FormattedText;
typedef struct _FormattedTextClass FormattedTextClass;

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

typedef struct _Shortcuts Shortcuts;
typedef struct _ShortcutsClass ShortcutsClass;

#define TYPE_UNDO_NODE_INSERT (undo_node_insert_get_type ())
#define UNDO_NODE_INSERT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_INSERT, UndoNodeInsert))
#define UNDO_NODE_INSERT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_INSERT, UndoNodeInsertClass))
#define IS_UNDO_NODE_INSERT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_INSERT))
#define IS_UNDO_NODE_INSERT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_INSERT))
#define UNDO_NODE_INSERT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_INSERT, UndoNodeInsertClass))

typedef struct _UndoNodeInsert UndoNodeInsert;
typedef struct _UndoNodeInsertClass UndoNodeInsertClass;

#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 _node_image_unref0(var) ((var == NULL) ? NULL : (var = (node_image_unref (var), NULL)))

#define TYPE_UNDO_NODE_IMAGE (undo_node_image_get_type ())
#define UNDO_NODE_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_IMAGE, UndoNodeImage))
#define UNDO_NODE_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_IMAGE, UndoNodeImageClass))
#define IS_UNDO_NODE_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_IMAGE))
#define IS_UNDO_NODE_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_IMAGE))
#define UNDO_NODE_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_IMAGE, UndoNodeImageClass))

typedef struct _UndoNodeImage UndoNodeImage;
typedef struct _UndoNodeImageClass UndoNodeImageClass;

#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_STICKER_CHANGE (undo_sticker_change_get_type ())
#define UNDO_STICKER_CHANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_STICKER_CHANGE, UndoStickerChange))
#define UNDO_STICKER_CHANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_STICKER_CHANGE, UndoStickerChangeClass))
#define IS_UNDO_STICKER_CHANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_STICKER_CHANGE))
#define IS_UNDO_STICKER_CHANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_STICKER_CHANGE))
#define UNDO_STICKER_CHANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_STICKER_CHANGE, UndoStickerChangeClass))

typedef struct _UndoStickerChange UndoStickerChange;
typedef struct _UndoStickerChangeClass UndoStickerChangeClass;

#define TYPE_UNDO_STICKER_ADD (undo_sticker_add_get_type ())
#define UNDO_STICKER_ADD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_STICKER_ADD, UndoStickerAdd))
#define UNDO_STICKER_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_STICKER_ADD, UndoStickerAddClass))
#define IS_UNDO_STICKER_ADD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_STICKER_ADD))
#define IS_UNDO_STICKER_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_STICKER_ADD))
#define UNDO_STICKER_ADD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_STICKER_ADD, UndoStickerAddClass))

typedef struct _UndoStickerAdd UndoStickerAdd;
typedef struct _UndoStickerAddClass UndoStickerAddClass;

#define TYPE_UNDO_NODE_STICKER_ADD (undo_node_sticker_add_get_type ())
#define UNDO_NODE_STICKER_ADD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_STICKER_ADD, UndoNodeStickerAdd))
#define UNDO_NODE_STICKER_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_STICKER_ADD, UndoNodeStickerAddClass))
#define IS_UNDO_NODE_STICKER_ADD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_STICKER_ADD))
#define IS_UNDO_NODE_STICKER_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_STICKER_ADD))
#define UNDO_NODE_STICKER_ADD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_STICKER_ADD, UndoNodeStickerAddClass))

typedef struct _UndoNodeStickerAdd UndoNodeStickerAdd;
typedef struct _UndoNodeStickerAddClass UndoNodeStickerAddClass;

#define TYPE_UNDO_NODE_STICKER_CHANGE (undo_node_sticker_change_get_type ())
#define UNDO_NODE_STICKER_CHANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_STICKER_CHANGE, UndoNodeStickerChange))
#define UNDO_NODE_STICKER_CHANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_STICKER_CHANGE, UndoNodeStickerChangeClass))
#define IS_UNDO_NODE_STICKER_CHANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_STICKER_CHANGE))
#define IS_UNDO_NODE_STICKER_CHANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_STICKER_CHANGE))
#define UNDO_NODE_STICKER_CHANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_STICKER_CHANGE, UndoNodeStickerChangeClass))

typedef struct _UndoNodeStickerChange UndoNodeStickerChange;
typedef struct _UndoNodeStickerChangeClass UndoNodeStickerChangeClass;

#define TYPE_UNDO_CONNECTION_STICKER_ADD (undo_connection_sticker_add_get_type ())
#define UNDO_CONNECTION_STICKER_ADD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_CONNECTION_STICKER_ADD, UndoConnectionStickerAdd))
#define UNDO_CONNECTION_STICKER_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_CONNECTION_STICKER_ADD, UndoConnectionStickerAddClass))
#define IS_UNDO_CONNECTION_STICKER_ADD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_CONNECTION_STICKER_ADD))
#define IS_UNDO_CONNECTION_STICKER_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_CONNECTION_STICKER_ADD))
#define UNDO_CONNECTION_STICKER_ADD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_CONNECTION_STICKER_ADD, UndoConnectionStickerAddClass))

typedef struct _UndoConnectionStickerAdd UndoConnectionStickerAdd;
typedef struct _UndoConnectionStickerAddClass UndoConnectionStickerAddClass;

#define TYPE_UNDO_CONNECTION_STICKER_CHANGE (undo_connection_sticker_change_get_type ())
#define UNDO_CONNECTION_STICKER_CHANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_CONNECTION_STICKER_CHANGE, UndoConnectionStickerChange))
#define UNDO_CONNECTION_STICKER_CHANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_CONNECTION_STICKER_CHANGE, UndoConnectionStickerChangeClass))
#define IS_UNDO_CONNECTION_STICKER_CHANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_CONNECTION_STICKER_CHANGE))
#define IS_UNDO_CONNECTION_STICKER_CHANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_CONNECTION_STICKER_CHANGE))
#define UNDO_CONNECTION_STICKER_CHANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_CONNECTION_STICKER_CHANGE, UndoConnectionStickerChangeClass))

typedef struct _UndoConnectionStickerChange UndoConnectionStickerChange;
typedef struct _UndoConnectionStickerChangeClass UndoConnectionStickerChangeClass;

#define TYPE_UNDO_NODE_NAME (undo_node_name_get_type ())
#define UNDO_NODE_NAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNDO_NODE_NAME, UndoNodeName))
#define UNDO_NODE_NAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNDO_NODE_NAME, UndoNodeNameClass))
#define IS_UNDO_NODE_NAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNDO_NODE_NAME))
#define IS_UNDO_NODE_NAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNDO_NODE_NAME))
#define UNDO_NODE_NAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNDO_NODE_NAME, UndoNodeNameClass))

typedef struct _UndoNodeName UndoNodeName;
typedef struct _UndoNodeNameClass UndoNodeNameClass;

#define TYPE_TEXT_COMPLETION_ITEM (text_completion_item_get_type ())
#define TEXT_COMPLETION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEXT_COMPLETION_ITEM, TextCompletionItem))
#define TEXT_COMPLETION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEXT_COMPLETION_ITEM, TextCompletionItemClass))
#define IS_TEXT_COMPLETION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEXT_COMPLETION_ITEM))
#define IS_TEXT_COMPLETION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEXT_COMPLETION_ITEM))
#define TEXT_COMPLETION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEXT_COMPLETION_ITEM, TextCompletionItemClass))

typedef struct _TextCompletionItem TextCompletionItem;
typedef struct _TextCompletionItemClass TextCompletionItemClass;
enum  {
	DRAW_AREA_CURRENT_CHANGED_SIGNAL,
	DRAW_AREA_SCALE_CHANGED_SIGNAL,
	DRAW_AREA_SCROLL_CHANGED_SIGNAL,
	DRAW_AREA_SIZE_READY_SIGNAL,
	DRAW_AREA_SIZE_CHANGED_SIGNAL,
	DRAW_AREA_NUM_SIGNALS
};
static guint draw_area_signals[DRAW_AREA_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 _SelectBox {
	gdouble x;
	gdouble y;
	gdouble w;
	gdouble h;
	gboolean valid;
};

struct _DrawArea {
	GtkDrawingArea parent_instance;
	DrawAreaPrivate * priv;
};

struct _DrawAreaClass {
	GtkDrawingAreaClass parent_class;
};

struct _NodeInfo {
	gdouble posx;
	gdouble posy;
	NodeSide side;
	GdkRGBA color;
};

struct _DrawAreaPrivate {
	MindMap* _map;
	gdouble _motion_x;
	gdouble _motion_y;
	gdouble _press_x;
	gdouble _press_y;
	gdouble _scaled_x;
	gdouble _scaled_y;
	gdouble _origin_x;
	gdouble _origin_y;
	gdouble _scale_factor;
	gdouble _store_origin_x;
	gdouble _store_origin_y;
	gdouble _store_scale_factor;
	gboolean _control;
	gboolean _shift;
	gboolean _alt;
	gboolean _pressed;
	gint _press_num;
	gboolean _press_middle;
	gboolean _resize;
	gboolean _orig_resizable;
	gboolean _motion;
	Connection* _last_connection;
	NodeSide _orig_side;
	GArray* _orig_info;
	gint _orig_width;
	NodeMenu* _node_menu;
	ConnectionMenu* _conn_menu;
	ConnectionsMenu* _conns_menu;
	NodesMenu* _nodes_menu;
	GroupsMenu* _groups_menu;
	CalloutMenu* _callout_menu;
	EmptyMenu* _empty_menu;
	TextMenu* _text_menu;
	guint* _scroll_save_id;
	ImageEditor* _image_editor;
	UrlEditor* _url_editor;
	GtkIMContext* _im_context;
	gboolean _debug;
	SelectBox _select_box;
	Tagger* _tagger;
	TextCompletion* _completion;
	gdouble _sticker_posx;
	gdouble _sticker_posy;
	guint _select_hover_id;
	GtkEventControllerKey* _key_controller;
	GtkEventControllerScroll* _scroll;
	gchar* _node_link_tooltip;
	guint _autopan_id;
	gint _resized_count;
	MainWindow* _win;
	Animator* _animator;
};

struct _Block16Data {
	int _ref_count_;
	DrawArea* self;
	Node* node;
	gboolean shift;
};

struct _Block17Data {
	int _ref_count_;
	DrawArea* self;
	Connection* conn;
	gboolean shift;
};

struct _Block18Data {
	int _ref_count_;
	DrawArea* self;
	gboolean shift;
};

struct _Block19Data {
	int _ref_count_;
	Block18Data * _data18_;
	Sticker* sticker;
	NodeGroup* group;
};

struct _Block20Data {
	int _ref_count_;
	DrawArea* self;
	CanvasText* text;
};

static gint DrawArea_private_offset;
static gpointer draw_area_parent_class = NULL;

VALA_EXTERN GType drag_types_get_type (void) G_GNUC_CONST ;
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 GType draw_area_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DrawArea, g_object_unref)
VALA_EXTERN gpointer mind_map_ref (gpointer instance);
VALA_EXTERN void mind_map_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_mind_map (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags);
VALA_EXTERN void value_set_mind_map (GValue* value,
                         gpointer v_object);
VALA_EXTERN void value_take_mind_map (GValue* value,
                          gpointer v_object);
VALA_EXTERN gpointer value_get_mind_map (const GValue* value);
VALA_EXTERN GType mind_map_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MindMap, mind_map_unref)
VALA_EXTERN GType connection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Connection, g_object_unref)
VALA_EXTERN GType node_side_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType node_info_get_type (void) G_GNUC_CONST ;
VALA_EXTERN NodeInfo* node_info_dup (const NodeInfo* self);
VALA_EXTERN void node_info_free (NodeInfo* self);
VALA_EXTERN gpointer base_menu_ref (gpointer instance);
VALA_EXTERN void base_menu_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_base_menu (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_base_menu (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_base_menu (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_base_menu (const GValue* value);
VALA_EXTERN GType base_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BaseMenu, base_menu_unref)
VALA_EXTERN GType node_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeMenu, base_menu_unref)
VALA_EXTERN GType connection_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionMenu, base_menu_unref)
VALA_EXTERN GType connections_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConnectionsMenu, base_menu_unref)
VALA_EXTERN GType nodes_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodesMenu, base_menu_unref)
VALA_EXTERN GType groups_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GroupsMenu, base_menu_unref)
VALA_EXTERN GType callout_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CalloutMenu, base_menu_unref)
VALA_EXTERN GType empty_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EmptyMenu, base_menu_unref)
VALA_EXTERN GType text_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TextMenu, base_menu_unref)
VALA_EXTERN gpointer image_editor_ref (gpointer instance);
VALA_EXTERN void image_editor_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_image_editor (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags);
VALA_EXTERN void value_set_image_editor (GValue* value,
                             gpointer v_object);
VALA_EXTERN void value_take_image_editor (GValue* value,
                              gpointer v_object);
VALA_EXTERN gpointer value_get_image_editor (const GValue* value);
VALA_EXTERN GType image_editor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImageEditor, image_editor_unref)
VALA_EXTERN gpointer url_editor_ref (gpointer instance);
VALA_EXTERN void url_editor_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_url_editor (const gchar* name,
                                   const gchar* nick,
                                   const gchar* blurb,
                                   GType object_type,
                                   GParamFlags flags);
VALA_EXTERN void value_set_url_editor (GValue* value,
                           gpointer v_object);
VALA_EXTERN void value_take_url_editor (GValue* value,
                            gpointer v_object);
VALA_EXTERN gpointer value_get_url_editor (const GValue* value);
VALA_EXTERN GType url_editor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UrlEditor, url_editor_unref)
VALA_EXTERN gpointer tagger_ref (gpointer instance);
VALA_EXTERN void tagger_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_tagger (const gchar* name,
                               const gchar* nick,
                               const gchar* blurb,
                               GType object_type,
                               GParamFlags flags);
VALA_EXTERN void value_set_tagger (GValue* value,
                       gpointer v_object);
VALA_EXTERN void value_take_tagger (GValue* value,
                        gpointer v_object);
VALA_EXTERN gpointer value_get_tagger (const GValue* value);
VALA_EXTERN GType tagger_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tagger, tagger_unref)
VALA_EXTERN gpointer text_completion_ref (gpointer instance);
VALA_EXTERN void text_completion_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_text_completion (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_text_completion (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_text_completion (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_text_completion (const GValue* value);
VALA_EXTERN GType text_completion_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TextCompletion, text_completion_unref)
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
VALA_EXTERN GType animator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Animator, g_object_unref)
VALA_EXTERN DrawArea* draw_area_new (MindMap* map,
                         MainWindow* w);
VALA_EXTERN DrawArea* draw_area_construct (GType object_type,
                               MindMap* map,
                               MainWindow* w);
static void draw_area_set_win (DrawArea* self,
                        MainWindow* value);
VALA_EXTERN Animator* animator_new (DrawArea* da);
VALA_EXTERN Animator* animator_construct (GType object_type,
                              DrawArea* da);
VALA_EXTERN void draw_area_set_animator (DrawArea* self,
                             Animator* value);
VALA_EXTERN ImageEditor* image_editor_new (DrawArea* da);
VALA_EXTERN ImageEditor* image_editor_construct (GType object_type,
                                     DrawArea* da);
VALA_EXTERN gpointer map_model_ref (gpointer instance);
VALA_EXTERN void map_model_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_map_model (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_map_model (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_map_model (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_map_model (const GValue* value);
VALA_EXTERN GType map_model_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MapModel, map_model_unref)
VALA_EXTERN MapModel* mind_map_get_model (MindMap* self);
VALA_EXTERN gpointer node_image_ref (gpointer instance);
VALA_EXTERN void node_image_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_node_image (const gchar* name,
                                   const gchar* nick,
                                   const gchar* blurb,
                                   GType object_type,
                                   GParamFlags flags);
VALA_EXTERN void value_set_node_image (GValue* value,
                           gpointer v_object);
VALA_EXTERN void value_take_node_image (GValue* value,
                            gpointer v_object);
VALA_EXTERN gpointer value_get_node_image (const GValue* value);
VALA_EXTERN GType node_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeImage, node_image_unref)
VALA_EXTERN void map_model_current_image_edited (MapModel* self,
                                     NodeImage* orig_image);
static void _map_model_current_image_edited_image_editor_changed (ImageEditor* _sender,
                                                           NodeImage* orig_image,
                                                           gpointer self);
VALA_EXTERN UrlEditor* url_editor_new (DrawArea* da);
VALA_EXTERN UrlEditor* url_editor_construct (GType object_type,
                                 DrawArea* da);
VALA_EXTERN MainWindow* draw_area_get_win (DrawArea* self);
VALA_EXTERN NodeMenu* node_menu_new (GtkApplication* app,
                         DrawArea* da);
VALA_EXTERN NodeMenu* node_menu_construct (GType object_type,
                               GtkApplication* app,
                               DrawArea* da);
VALA_EXTERN ConnectionMenu* connection_menu_new (GtkApplication* app,
                                     DrawArea* da);
VALA_EXTERN ConnectionMenu* connection_menu_construct (GType object_type,
                                           GtkApplication* app,
                                           DrawArea* da);
VALA_EXTERN ConnectionsMenu* connections_menu_new (GtkApplication* app,
                                       DrawArea* da);
VALA_EXTERN ConnectionsMenu* connections_menu_construct (GType object_type,
                                             GtkApplication* app,
                                             DrawArea* da);
VALA_EXTERN EmptyMenu* empty_menu_new (GtkApplication* app,
                           DrawArea* da);
VALA_EXTERN EmptyMenu* empty_menu_construct (GType object_type,
                                 GtkApplication* app,
                                 DrawArea* da);
VALA_EXTERN NodesMenu* nodes_menu_new (GtkApplication* app,
                           DrawArea* da);
VALA_EXTERN NodesMenu* nodes_menu_construct (GType object_type,
                                 GtkApplication* app,
                                 DrawArea* da);
VALA_EXTERN GroupsMenu* groups_menu_new (GtkApplication* app,
                             DrawArea* da);
VALA_EXTERN GroupsMenu* groups_menu_construct (GType object_type,
                                   GtkApplication* app,
                                   DrawArea* da);
VALA_EXTERN CalloutMenu* callout_menu_new (GtkApplication* app,
                               DrawArea* da);
VALA_EXTERN CalloutMenu* callout_menu_construct (GType object_type,
                                     GtkApplication* app,
                                     DrawArea* da);
VALA_EXTERN TextMenu* text_menu_new (GtkApplication* app,
                         DrawArea* da);
VALA_EXTERN TextMenu* text_menu_construct (GType object_type,
                               GtkApplication* app,
                               DrawArea* da);
static void _node_info_free0_ (gpointer var);
static void _vala_NodeInfo_free_function_content_of (gpointer data);
VALA_EXTERN TextCompletion* text_completion_new (MindMap* map);
VALA_EXTERN TextCompletion* text_completion_construct (GType object_type,
                                           MindMap* map);
VALA_EXTERN void draw_area_on_draw (DrawArea* self,
                        GtkDrawingArea* da,
                        cairo_t* ctx,
                        gint width,
                        gint height);
static void _draw_area_on_draw_gtk_drawing_area_draw_func (GtkDrawingArea* drawing_area,
                                                    cairo_t* cr,
                                                    gint width,
                                                    gint height,
                                                    gpointer self);
static void __lambda232_ (DrawArea* self,
                   gint n_press,
                   gdouble x,
                   gdouble y);
static void draw_area_on_press (DrawArea* self,
                         gint n_press,
                         gdouble x,
                         gdouble y,
                         gint button);
static void ___lambda232__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                              gint n_press,
                                              gdouble x,
                                              gdouble y,
                                              gpointer self);
static void draw_area_on_release (DrawArea* self,
                           gint n_press,
                           gdouble x,
                           gdouble y);
static void _draw_area_on_release_gtk_gesture_click_released (GtkGestureClick* _sender,
                                                       gint n_press,
                                                       gdouble x,
                                                       gdouble y,
                                                       gpointer self);
static void __lambda233_ (DrawArea* self,
                   gint n_press,
                   gdouble x,
                   gdouble y);
static void ___lambda233__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                              gint n_press,
                                              gdouble x,
                                              gdouble y,
                                              gpointer self);
static void draw_area_on_right_press (DrawArea* self,
                               gint n_press,
                               gdouble x,
                               gdouble y);
static void _draw_area_on_right_press_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                          gint n_press,
                                                          gdouble x,
                                                          gdouble y,
                                                          gpointer self);
static void draw_area_on_motion (DrawArea* self,
                          gdouble x,
                          gdouble y);
static void _draw_area_on_motion_gtk_event_controller_motion_motion (GtkEventControllerMotion* _sender,
                                                              gdouble x,
                                                              gdouble y,
                                                              gpointer self);
static void draw_area_handle_cursor_leave (DrawArea* self);
static void _draw_area_handle_cursor_leave_gtk_event_controller_motion_leave (GtkEventControllerMotion* _sender,
                                                                       gpointer self);
static gboolean draw_area_on_keypress (DrawArea* self,
                                guint keyval,
                                guint keycode,
                                GdkModifierType state);
static gboolean _draw_area_on_keypress_gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                      guint keyval,
                                                                      guint keycode,
                                                                      GdkModifierType state,
                                                                      gpointer self);
static void draw_area_on_keyrelease (DrawArea* self,
                              guint keyval,
                              guint keycode,
                              GdkModifierType state);
static void _draw_area_on_keyrelease_gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                                     guint keyval,
                                                                     guint keycode,
                                                                     GdkModifierType state,
                                                                     gpointer self);
static void draw_area_on_focus_leave (DrawArea* self);
static void _draw_area_on_focus_leave_gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                                 gpointer self);
static gboolean draw_area_on_scroll (DrawArea* self,
                              gdouble delta_x,
                              gdouble delta_y);
static gboolean _draw_area_on_scroll_gtk_event_controller_scroll_scroll (GtkEventControllerScroll* _sender,
                                                                  gdouble dx,
                                                                  gdouble dy,
                                                                  gpointer self);
static GdkDragAction draw_area_handle_file_drag_motion (DrawArea* self,
                                                 gdouble x,
                                                 gdouble y);
static GdkDragAction _draw_area_handle_file_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                                         gdouble x,
                                                                         gdouble y,
                                                                         gpointer self);
static gboolean draw_area_handle_file_drop (DrawArea* self,
                                     GValue* val,
                                     gdouble x,
                                     gdouble y);
static gboolean _draw_area_handle_file_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                           GValue* value,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self);
static void _draw_area_handle_cursor_leave_gtk_drop_target_leave (GtkDropTarget* _sender,
                                                           gpointer self);
static GdkDragAction draw_area_handle_sticker_drag_motion (DrawArea* self,
                                                    gdouble x,
                                                    gdouble y);
static GdkDragAction _draw_area_handle_sticker_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                                            gdouble x,
                                                                            gdouble y,
                                                                            gpointer self);
static gboolean draw_area_handle_sticker_drop (DrawArea* self,
                                        GValue* val,
                                        gdouble x,
                                        gdouble y);
static gboolean _draw_area_handle_sticker_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                              GValue* value,
                                                              gdouble x,
                                                              gdouble y,
                                                              gpointer self);
static GdkDragAction draw_area_handle_text_drag_motion (DrawArea* self,
                                                 gdouble x,
                                                 gdouble y);
static GdkDragAction _draw_area_handle_text_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                                         gdouble x,
                                                                         gdouble y,
                                                                         gpointer self);
static gboolean draw_area_handle_text_drop (DrawArea* self,
                                     GValue* val,
                                     gdouble x,
                                     gdouble y);
static gboolean _draw_area_handle_text_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                           GValue* value,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self);
VALA_EXTERN GType idea_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Idea, g_object_unref)
static GdkDragAction draw_area_handle_idea_drag_motion (DrawArea* self,
                                                 gdouble x,
                                                 gdouble y);
static GdkDragAction _draw_area_handle_idea_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                                         gdouble x,
                                                                         gdouble y,
                                                                         gpointer self);
static gboolean draw_area_handle_idea_drop (DrawArea* self,
                                     GValue* val,
                                     gdouble x,
                                     gdouble y);
static gboolean _draw_area_handle_idea_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                           GValue* value,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self);
VALA_EXTERN GType tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tag, g_object_unref)
static GdkDragAction draw_area_handle_tag_drag_motion (DrawArea* self,
                                                gdouble x,
                                                gdouble y);
static GdkDragAction _draw_area_handle_tag_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                                        gdouble x,
                                                                        gdouble y,
                                                                        gpointer self);
static gboolean draw_area_handle_tag_drop (DrawArea* self,
                                    GValue* val,
                                    gdouble x,
                                    gdouble y);
static gboolean _draw_area_handle_tag_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                          GValue* value,
                                                          gdouble x,
                                                          gdouble y,
                                                          gpointer self);
static void draw_area_handle_im_commit (DrawArea* self,
                                 const gchar* str);
static void _draw_area_handle_im_commit_gtk_im_context_commit (GtkIMContext* _sender,
                                                        const gchar* str,
                                                        gpointer self);
static gboolean draw_area_handle_im_retrieve_surrounding (DrawArea* self);
static gboolean _draw_area_handle_im_retrieve_surrounding_gtk_im_context_retrieve_surrounding (GtkIMContext* _sender,
                                                                                        gpointer self);
static gboolean draw_area_handle_im_delete_surrounding (DrawArea* self,
                                                 gint offset,
                                                 gint nchars);
static gboolean _draw_area_handle_im_delete_surrounding_gtk_im_context_delete_surrounding (GtkIMContext* _sender,
                                                                                    gint offset,
                                                                                    gint n_chars,
                                                                                    gpointer self);
static void draw_area_real_size_allocate (GtkWidget* base,
                                   gint width,
                                   gint height,
                                   gint baseline);
VALA_EXTERN NodeSide draw_area_get_orig_side (DrawArea* self);
VALA_EXTERN void draw_area_get_window_ys (DrawArea* self,
                              gint* top,
                              gint* bottom);
VALA_EXTERN gdouble draw_area_get_origin_y (DrawArea* self);
VALA_EXTERN void draw_area_reset_cursor (DrawArea* self);
static void draw_area_set_cursor_name (DrawArea* self,
                                const gchar* name);
VALA_EXTERN void draw_area_set_text_cursor (DrawArea* self);
VALA_EXTERN void draw_area_initialize (DrawArea* self);
VALA_EXTERN void draw_area_set_origin_x (DrawArea* self,
                             gdouble value);
VALA_EXTERN void draw_area_set_origin_y (DrawArea* self,
                             gdouble value);
VALA_EXTERN void draw_area_set_sfactor (DrawArea* self,
                            gdouble value);
VALA_EXTERN GType canvas_text_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CanvasText, g_object_unref)
VALA_EXTERN void draw_area_update_im_cursor (DrawArea* self,
                                 CanvasText* ct);
VALA_EXTERN gdouble canvas_text_get_posx (CanvasText* self);
VALA_EXTERN gdouble draw_area_get_sfactor (DrawArea* self);
VALA_EXTERN gdouble canvas_text_get_posy (CanvasText* self);
VALA_EXTERN gdouble canvas_text_get_width (CanvasText* self);
VALA_EXTERN gdouble canvas_text_get_height (CanvasText* self);
VALA_EXTERN void draw_area_clear_current_connection (DrawArea* self,
                                         gboolean signal_change);
VALA_EXTERN gpointer selection_ref (gpointer instance);
VALA_EXTERN void selection_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_selection (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_selection (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_selection (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_selection (const GValue* value);
VALA_EXTERN GType selection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Selection, selection_unref)
VALA_EXTERN Selection* mind_map_get_selected (MindMap* self);
VALA_EXTERN gint selection_num_connections (Selection* self);
VALA_EXTERN gboolean selection_clear_connections (Selection* self,
                                      gboolean signal_change,
                                      gdouble alpha);
static void draw_area_clear_current_node (DrawArea* self,
                                   gboolean signal_change);
VALA_EXTERN gint selection_num_nodes (Selection* self);
VALA_EXTERN gboolean selection_clear_nodes (Selection* self,
                                gboolean signal_change,
                                gdouble alpha);
static void draw_area_clear_current_sticker (DrawArea* self,
                                      gboolean signal_change);
VALA_EXTERN gint selection_num_stickers (Selection* self);
VALA_EXTERN gboolean selection_clear_stickers (Selection* self,
                                   gboolean signal_change);
static void draw_area_clear_current_group (DrawArea* self,
                                    gboolean signal_change);
VALA_EXTERN gint selection_num_groups (Selection* self);
VALA_EXTERN gboolean selection_clear_groups (Selection* self,
                                 gboolean signal_change);
static void draw_area_clear_current_callout (DrawArea* self,
                                      gboolean signal_change);
VALA_EXTERN gint selection_num_callouts (Selection* self);
VALA_EXTERN gboolean selection_clear_callouts (Selection* self,
                                   gboolean signal_change,
                                   gdouble alpha);
VALA_EXTERN GType map_item_component_get_type (void) G_GNUC_CONST ;
static gboolean draw_area_set_current_connection_from_position (DrawArea* self,
                                                         Connection* conn,
                                                         MapItemComponent component,
                                                         gdouble scaled_x,
                                                         gdouble scaled_y);
VALA_EXTERN gboolean selection_is_current_connection (Selection* self,
                                          Connection* conn);
VALA_EXTERN GType conn_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ConnMode connection_get_mode (Connection* self);
VALA_EXTERN CanvasText* connection_get_title (Connection* self);
VALA_EXTERN void canvas_text_set_cursor_at_char (CanvasText* self,
                                     gdouble x,
                                     gdouble y,
                                     gboolean motion);
VALA_EXTERN void canvas_text_set_cursor_at_word (CanvasText* self,
                                     gdouble x,
                                     gdouble y,
                                     gboolean motion);
VALA_EXTERN void canvas_text_set_cursor_all (CanvasText* self,
                                 gboolean motion);
VALA_EXTERN gboolean mind_map_get_editable (MindMap* self);
VALA_EXTERN Connection* selection_current_connection (Selection* self);
VALA_EXTERN void connection_edit_title_begin (Connection* self,
                                  MindMap* map);
VALA_EXTERN void map_model_set_connection_mode (MapModel* self,
                                    Connection* conn,
                                    ConnMode mode,
                                    gboolean undoable);
VALA_EXTERN gboolean selection_add_connection (Selection* self,
                                   Connection* conn);
VALA_EXTERN void map_model_handle_connection_edit_on_creation (MapModel* self,
                                                   Connection* conn);
VALA_EXTERN void mind_map_set_current_connection (MindMap* self,
                                      Connection* c);
VALA_EXTERN GType node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Node, g_object_unref)
static gboolean draw_area_set_current_node_from_position (DrawArea* self,
                                                   Node* node,
                                                   MapItemComponent component,
                                                   gdouble scaled_x,
                                                   gdouble scaled_y);
VALA_EXTERN GType format_tag_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void map_model_toggle_task (MapModel* self,
                            Node* n);
VALA_EXTERN void mind_map_select_linked_node (MindMap* self,
                                  Node* node);
VALA_EXTERN void map_model_toggle_folds (MapModel* self,
                             gboolean deep);
VALA_EXTERN gboolean node_get_image_resizable (Node* self);
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 Style* node_get_style (Node* self);
VALA_EXTERN gint* style_get_node_width (Style* self);
VALA_EXTERN CanvasText* node_get_name (Node* self);
VALA_EXTERN gboolean canvas_text_is_within_clickable (CanvasText* self,
                                          gdouble x,
                                          gdouble y,
                                          FormatTag* tag,
                                          gchar** extra);
VALA_EXTERN void utils_open_url (const gchar* url);
VALA_EXTERN GType property_grab_get_type (void) G_GNUC_CONST ;
VALA_EXTERN NodeSide node_get_side (Node* self);
VALA_EXTERN void node_get_node_info (Node* self,
                         GArray** info);
VALA_EXTERN GType node_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN NodeMode node_get_mode (Node* self);
VALA_EXTERN void map_model_edit_current_image (MapModel* self);
VALA_EXTERN void map_model_set_node_mode (MapModel* self,
                              Node* node,
                              NodeMode mode,
                              gboolean undoable);
VALA_EXTERN gboolean selection_remove_nodes_at_level (Selection* self,
                                          Node* node,
                                          gdouble alpha);
VALA_EXTERN gboolean selection_add_nodes_at_level (Selection* self,
                                       Node* node,
                                       gboolean signal_change);
VALA_EXTERN gboolean selection_remove_node_tree (Selection* self,
                                     Node* node,
                                     gdouble alpha);
VALA_EXTERN gboolean selection_add_node_tree (Selection* self,
                                  Node* node,
                                  gboolean signal_change);
VALA_EXTERN gboolean selection_remove_child_nodes (Selection* self,
                                       Node* node,
                                       gdouble alpha);
VALA_EXTERN gboolean selection_add_child_nodes (Selection* self,
                                    Node* node,
                                    gboolean signal_change);
VALA_EXTERN gboolean selection_remove_node (Selection* self,
                                Node* node,
                                gdouble alpha,
                                gboolean signal_change);
VALA_EXTERN gboolean selection_add_node (Selection* self,
                             Node* node,
                             gboolean force_selected,
                             gboolean signal_change);
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_summary_extents (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 GType sticker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Sticker, g_object_unref)
VALA_EXTERN gboolean draw_area_set_current_sticker_from_position (DrawArea* self,
                                                      Sticker* sticker,
                                                      gdouble scaled_x,
                                                      gdouble scaled_y);
VALA_EXTERN GType sticker_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN StickerMode sticker_get_mode (Sticker* self);
VALA_EXTERN gboolean sticker_is_within_resizer (Sticker* self,
                                    gdouble x,
                                    gdouble y);
VALA_EXTERN gdouble sticker_get_width (Sticker* self);
VALA_EXTERN void mind_map_set_current_sticker (MindMap* self,
                                   Sticker* s);
VALA_EXTERN gdouble sticker_get_posx (Sticker* self);
VALA_EXTERN gdouble sticker_get_posy (Sticker* self);
VALA_EXTERN GType node_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeGroup, g_object_unref)
VALA_EXTERN gboolean draw_area_set_current_group_from_position (DrawArea* self,
                                                    NodeGroup* group,
                                                    gdouble scaled_x,
                                                    gdouble scaled_y);
VALA_EXTERN gboolean selection_add_group (Selection* self,
                              NodeGroup* group);
VALA_EXTERN void mind_map_set_current_group (MindMap* self,
                                 NodeGroup* g);
VALA_EXTERN GType callout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Callout, g_object_unref)
VALA_EXTERN gboolean draw_area_set_current_callout_from_position (DrawArea* self,
                                                      Callout* callout,
                                                      MapItemComponent component,
                                                      gdouble scaled_x,
                                                      gdouble scaled_y);
VALA_EXTERN gdouble callout_get_total_width (Callout* self);
VALA_EXTERN CanvasText* callout_get_text (Callout* self);
VALA_EXTERN GType callout_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN CalloutMode callout_get_mode (Callout* self);
VALA_EXTERN void map_model_set_callout_mode (MapModel* self,
                                 Callout* callout,
                                 CalloutMode mode,
                                 gboolean undoable);
VALA_EXTERN void mind_map_set_current_callout (MindMap* self,
                                   Callout* c);
static void draw_area_handle_right_click (DrawArea* self,
                                   gdouble x,
                                   gdouble y);
VALA_EXTERN gboolean map_model_select_connection_if_unselected (MapModel* self,
                                                    gdouble x,
                                                    gdouble y);
VALA_EXTERN gboolean map_model_select_node_if_unselected (MapModel* self,
                                              gdouble x,
                                              gdouble y);
static gboolean draw_area_set_current_at_position (DrawArea* self,
                                            gdouble scaled_x,
                                            gdouble scaled_y);
VALA_EXTERN Connection* map_model_get_connection_at_position (MapModel* self,
                                                  gdouble x,
                                                  gdouble y,
                                                  MapItemComponent* component);
VALA_EXTERN gboolean map_item_component_is_connection_handle (MapItemComponent self);
VALA_EXTERN Connection* connection_new_from_connection (MindMap* map,
                                            Connection* conn);
VALA_EXTERN Connection* connection_construct_from_connection (GType object_type,
                                                  MindMap* map,
                                                  Connection* conn);
VALA_EXTERN void connection_disconnect_from_node (Connection* self,
                                      gboolean from);
VALA_EXTERN Node* map_model_get_attach_node (MapModel* self);
VALA_EXTERN gboolean conn_mode_is_connecting (ConnMode self);
VALA_EXTERN Node* map_model_get_node_at_position (MapModel* self,
                                      gdouble x,
                                      gdouble y,
                                      MapItemComponent* component);
VALA_EXTERN Node* connection_get_from_node (Connection* self);
VALA_EXTERN Node* connection_get_to_node (Connection* self);
VALA_EXTERN Callout* map_model_get_callout_at_position (MapModel* self,
                                            gdouble x,
                                            gdouble y,
                                            MapItemComponent* component);
VALA_EXTERN Sticker* map_model_get_sticker_at_position (MapModel* self,
                                            gdouble x,
                                            gdouble y);
VALA_EXTERN NodeGroup* map_model_get_group_at_position (MapModel* self,
                                            gdouble x,
                                            gdouble y);
VALA_EXTERN Node* map_model_get_last_node (MapModel* self);
VALA_EXTERN gdouble* draw_area_get_scale_marks (gint* result_length1);
static gdouble draw_area_scale_value (DrawArea* self,
                               gdouble val);
VALA_EXTERN gboolean draw_area_set_scaling_factor (DrawArea* self,
                                       gdouble sf);
VALA_EXTERN gboolean draw_area_move_origin (DrawArea* self,
                                gdouble diff_x,
                                gdouble diff_y,
                                gdouble* next_scale);
VALA_EXTERN gboolean draw_area_set_scaling_factor_coord (DrawArea* self,
                                             gdouble sf,
                                             gdouble coord_x,
                                             gdouble coord_y);
static gdouble draw_area_get_scaling_factor (DrawArea* self,
                                      gdouble width,
                                      gdouble height);
VALA_EXTERN gboolean draw_area_zoom_in (DrawArea* self);
VALA_EXTERN gboolean draw_area_zoom_in_coords (DrawArea* self,
                                   gdouble zoom_x,
                                   gdouble zoom_y);
VALA_EXTERN Animator* draw_area_get_animator (DrawArea* self);
VALA_EXTERN void animator_add_scale_in_place (Animator* self,
                                  const gchar* name,
                                  gdouble ssx,
                                  gdouble ssy);
VALA_EXTERN void animator_animate (Animator* self);
VALA_EXTERN void animator_cancel_last_add (Animator* self);
VALA_EXTERN gboolean draw_area_zoom_out (DrawArea* self);
VALA_EXTERN gboolean draw_area_zoom_out_coords (DrawArea* self,
                                    gdouble zoom_x,
                                    gdouble zoom_y);
static void draw_area_position_box (DrawArea* self,
                             gdouble x,
                             gdouble y,
                             gdouble w,
                             gdouble h,
                             gdouble xpos,
                             gdouble ypos,
                             const gchar* msg);
VALA_EXTERN void draw_area_zoom_to_selected (DrawArea* self);
VALA_EXTERN Node* selection_current_node (Selection* self);
VALA_EXTERN void animator_add_pan_scale (Animator* self,
                             const gchar* name);
VALA_EXTERN gpointer node_bounds_ref (gpointer instance);
VALA_EXTERN void node_bounds_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_node_bounds (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_node_bounds (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_node_bounds (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_node_bounds (const GValue* value);
VALA_EXTERN GType node_bounds_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeBounds, node_bounds_unref)
VALA_EXTERN NodeBounds* node_get_tree_bbox (Node* self);
VALA_EXTERN gdouble node_bounds_get_x (NodeBounds* self);
VALA_EXTERN gdouble node_bounds_get_y (NodeBounds* self);
VALA_EXTERN gdouble node_bounds_get_width (NodeBounds* self);
VALA_EXTERN gdouble node_bounds_get_height (NodeBounds* self);
VALA_EXTERN void draw_area_zoom_to_fit (DrawArea* self);
VALA_EXTERN void map_model_document_rectangle (MapModel* self,
                                   gdouble* x,
                                   gdouble* y,
                                   gdouble* width,
                                   gdouble* height);
VALA_EXTERN void draw_area_zoom_actual (DrawArea* self);
VALA_EXTERN void draw_area_center_node (DrawArea* self,
                            Node* n);
VALA_EXTERN void node_bbox (Node* self,
                gdouble* x,
                gdouble* y,
                gdouble* w,
                gdouble* h);
VALA_EXTERN void animator_add_pan (Animator* self,
                       const gchar* name);
VALA_EXTERN void draw_area_center_current_node (DrawArea* self);
VALA_EXTERN void draw_area_see (DrawArea* self,
                    gboolean animate,
                    gdouble width_adjust,
                    gdouble pad);
VALA_EXTERN Callout* selection_current_callout (Selection* self);
VALA_EXTERN NodeGroup* selection_current_group (Selection* self);
VALA_EXTERN void connection_bbox (Connection* self,
                      gdouble* x,
                      gdouble* y,
                      gdouble* w,
                      gdouble* h);
VALA_EXTERN void callout_bbox (Callout* self,
                   gdouble* x,
                   gdouble* y,
                   gdouble* w,
                   gdouble* h);
VALA_EXTERN GArray* node_group_get_nodes (NodeGroup* self);
VALA_EXTERN void draw_area_get_origin (DrawArea* self,
                           gdouble* x,
                           gdouble* y);
VALA_EXTERN gdouble draw_area_get_origin_x (DrawArea* self);
VALA_EXTERN void draw_area_set_origin (DrawArea* self,
                           gdouble x,
                           gdouble y);
static gboolean draw_area_out_of_bounds (DrawArea* self,
                                  gdouble diff_x,
                                  gdouble diff_y,
                                  gdouble scale);
static gdouble* _double_dup (gdouble* self);
VALA_EXTERN void draw_area_draw_background (DrawArea* self,
                                cairo_t* ctx);
VALA_EXTERN void draw_area_draw_select_box (DrawArea* self,
                                cairo_t* ctx);
VALA_EXTERN void utils_set_context_color_with_alpha (cairo_t* ctx,
                                         GdkRGBA* color,
                                         gdouble alpha);
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 GdkRGBA* theme_get_color (Theme* self,
                          const gchar* name);
static void _vala_GdkRGBA_free (GdkRGBA* self);
VALA_EXTERN void map_model_draw_all (MapModel* self,
                         cairo_t* ctx,
                         gboolean exporting,
                         gboolean moving_node);
VALA_EXTERN void draw_area_show_contextual_menu (DrawArea* self,
                                     gdouble x,
                                     gdouble y);
VALA_EXTERN void base_menu_show (BaseMenu* self,
                     gdouble x,
                     gdouble y);
static void draw_area_start_autopan (DrawArea* self);
static gboolean draw_area_do_autopan (DrawArea* self);
static gboolean _draw_area_do_autopan_gsource_func (gpointer self);
static void draw_area_stop_autopan (DrawArea* self);
VALA_EXTERN void map_model_set_attach_summary (MapModel* self,
                                   SummaryNode* n);
VALA_EXTERN void map_model_set_attach_node (MapModel* self,
                                Node* n,
                                NodeMode mode);
VALA_EXTERN Node* mind_map_get_current_node (MindMap* self);
VALA_EXTERN Connection* mind_map_get_current_connection (MindMap* self);
VALA_EXTERN Sticker* mind_map_get_current_sticker (MindMap* self);
VALA_EXTERN Callout* mind_map_get_current_callout (MindMap* self);
VALA_EXTERN NodeGroup* mind_map_get_current_group (MindMap* self);
VALA_EXTERN gboolean selection_is_any_draggable_selected (Selection* self);
VALA_EXTERN gboolean utils_is_within_bounds (gdouble x,
                                 gdouble y,
                                 gdouble bx,
                                 gdouble by,
                                 gdouble bw,
                                 gdouble bh);
VALA_EXTERN void connection_move_drag_handle (Connection* self,
                                  gdouble x,
                                  gdouble y);
VALA_EXTERN void draw_area_update_connection (DrawArea* self,
                                  gdouble x,
                                  gdouble y);
VALA_EXTERN void node_set_image_resizable (Node* self,
                               gboolean value);
VALA_EXTERN void node_resize (Node* self,
                  gdouble diff);
VALA_EXTERN void mind_map_auto_save (MindMap* self);
VALA_EXTERN SummaryNode* map_model_attachable_summary_node (MapModel* self,
                                                gdouble x,
                                                gdouble y);
VALA_EXTERN SummaryNode* map_model_get_attach_summary (MapModel* self);
VALA_EXTERN Node* map_model_attachable_node (MapModel* self,
                                 gdouble x,
                                 gdouble y);
VALA_EXTERN gint summary_node_summarized_count (SummaryNode* self);
VALA_EXTERN gboolean node_side_vertical (NodeSide self);
VALA_EXTERN void node_set_posx_only (Node* self,
                         gdouble value);
VALA_EXTERN gdouble node_get_posx (Node* self);
VALA_EXTERN void node_set_posx (Node* self,
                    gdouble value);
VALA_EXTERN gboolean node_side_horizontal (NodeSide self);
VALA_EXTERN void node_set_posy_only (Node* self,
                         gdouble value);
VALA_EXTERN gdouble node_get_posy (Node* self);
VALA_EXTERN void node_set_posy (Node* self,
                    gdouble value);
VALA_EXTERN GType layout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Layout, g_object_unref)
VALA_EXTERN Layout* node_get_layout (Node* self);
VALA_EXTERN void layout_set_side (Layout* self,
                      Node* current);
VALA_EXTERN GArray* selection_nodes (Selection* self);
VALA_EXTERN void node_set_alpha_only (Node* self,
                          gdouble value);
VALA_EXTERN void sticker_resize (Sticker* self,
                     gdouble diff);
VALA_EXTERN void sticker_set_posx (Sticker* self,
                       gdouble value);
VALA_EXTERN void sticker_set_posy (Sticker* self,
                       gdouble value);
VALA_EXTERN void callout_resize (Callout* self,
                     gdouble diff);
VALA_EXTERN void mind_map_select_nodes_within_box (MindMap* self,
                                       SelectBox* select_box,
                                       gboolean shift);
VALA_EXTERN gboolean node_is_within_node (Node* self,
                              gdouble x,
                              gdouble y);
VALA_EXTERN void node_set_alpha (Node* self,
                     gdouble value);
VALA_EXTERN gboolean callout_is_within_resizer (Callout* self,
                                    gdouble x,
                                    gdouble y);
VALA_EXTERN gboolean connection_within_drag_handle (Connection* self,
                                        gdouble x,
                                        gdouble y);
VALA_EXTERN gboolean connection_within_from_handle (Connection* self,
                                        gdouble x,
                                        gdouble y);
VALA_EXTERN gboolean connection_within_to_handle (Connection* self,
                                      gdouble x,
                                      gdouble y);
VALA_EXTERN gboolean connection_within_note (Connection* self,
                                 gdouble x,
                                 gdouble y);
VALA_EXTERN gchar* utils_prepare_note_markup (const gchar* note);
VALA_EXTERN const gchar* connection_get_note (Connection* self);
static gboolean draw_area_select_connection_on_hover (DrawArea* self,
                                               Connection* conn,
                                               gboolean shift);
VALA_EXTERN gboolean map_model_update_last_match (MapModel* self,
                                      Node* match);
VALA_EXTERN gdouble node_task_completion_percentage (Node* self);
VALA_EXTERN const gchar* node_get_note (Node* self);
VALA_EXTERN gboolean node_get_folded (Node* self);
static gchar* draw_area_prepare_folded_count_markup (DrawArea* 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 gchar* node_link_get_tooltip (NodeLink* self,
                              MindMap* map);
VALA_EXTERN NodeImage* node_get_image (Node* self);
VALA_EXTERN gpointer tags_ref (gpointer instance);
VALA_EXTERN void tags_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_tags (const gchar* name,
                             const gchar* nick,
                             const gchar* blurb,
                             GType object_type,
                             GParamFlags flags);
VALA_EXTERN void value_set_tags (GValue* value,
                     gpointer v_object);
VALA_EXTERN void value_take_tags (GValue* value,
                      gpointer v_object);
VALA_EXTERN gpointer value_get_tags (const GValue* value);
VALA_EXTERN GType tags_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tags, tags_unref)
VALA_EXTERN Tags* node_get_tags (Node* self);
VALA_EXTERN gchar* tags_to_tooltip (Tags* self);
VALA_EXTERN void node_set_show_fold (Node* self,
                         gboolean value);
static gboolean draw_area_select_node_on_hover (DrawArea* self,
                                         Node* node,
                                         gboolean shift);
static gboolean draw_area_select_sticker_group_on_hover (DrawArea* self,
                                                  gboolean shift);
VALA_EXTERN void map_model_set_attach_connection (MapModel* self,
                                      Connection* c,
                                      ConnMode mode);
VALA_EXTERN void map_model_set_attach_sticker (MapModel* self,
                                   Sticker* s,
                                   StickerMode mode);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
VALA_EXTERN GSettings* mind_map_get_settings (MindMap* self);
static gboolean ___lambda235_ (Block16Data* _data16_);
static gboolean ____lambda235__gsource_func (gpointer self);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
static gboolean ___lambda234_ (Block17Data* _data17_);
VALA_EXTERN void selection_set_current_connection (Selection* self,
                                       Connection* conn,
                                       gdouble clear_alpha);
static gboolean ____lambda234__gsource_func (gpointer self);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
static gboolean ____lambda236_ (Block19Data* _data19_);
VALA_EXTERN void selection_set_current_sticker (Selection* self,
                                    Sticker* sticker,
                                    gdouble clear_alpha);
VALA_EXTERN gboolean selection_add_sticker (Selection* self,
                                Sticker* sticker);
static gboolean _____lambda236__gsource_func (gpointer self);
static gboolean ____lambda237_ (Block19Data* _data19_);
VALA_EXTERN void selection_set_current_group (Selection* self,
                                  NodeGroup* group,
                                  gdouble clear_alpha);
static gboolean _____lambda237__gsource_func (gpointer self);
VALA_EXTERN GArray* node_children (Node* self);
VALA_EXTERN gint node_descendant_count (Node* self);
VALA_EXTERN Sticker* selection_current_sticker (Selection* self);
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 UndoStickerResize* undo_sticker_resize_new (Sticker* sticker,
                                            gint orig_width);
VALA_EXTERN UndoStickerResize* undo_sticker_resize_construct (GType object_type,
                                                  Sticker* sticker,
                                                  gint orig_width);
VALA_EXTERN GType undo_sticker_resize_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoStickerResize, g_object_unref)
VALA_EXTERN UndoNodeResize* undo_node_resize_new (Node* n,
                                      gint old_width,
                                      gboolean old_resizable);
VALA_EXTERN UndoNodeResize* undo_node_resize_construct (GType object_type,
                                            Node* n,
                                            gint old_width,
                                            gboolean old_resizable);
VALA_EXTERN GType undo_node_resize_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeResize, g_object_unref)
VALA_EXTERN UndoCalloutResize* undo_callout_resize_new (Callout* c,
                                            gint old_width);
VALA_EXTERN UndoCalloutResize* undo_callout_resize_construct (GType object_type,
                                                  Callout* c,
                                                  gint old_width);
VALA_EXTERN GType undo_callout_resize_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoCalloutResize, g_object_unref)
VALA_EXTERN void map_model_end_link (MapModel* self,
                         Node* node);
VALA_EXTERN void map_model_end_connection (MapModel* self,
                               Node* n);
VALA_EXTERN UndoConnectionChange* undo_connection_change_new (const gchar* name,
                                                  Connection* old_connection,
                                                  Connection* new_connection);
VALA_EXTERN UndoConnectionChange* undo_connection_change_construct (GType object_type,
                                                        const gchar* name,
                                                        Connection* old_connection,
                                                        Connection* new_connection);
VALA_EXTERN GType undo_connection_change_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoConnectionChange, g_object_unref)
VALA_EXTERN void connection_copy (Connection* self,
                      MindMap* map,
                      Connection* conn);
VALA_EXTERN void map_model_attach_current_node (MapModel* self);
VALA_EXTERN gint node_index (Node* self);
VALA_EXTERN void animator_add_nodes (Animator* self,
                         GArray* n,
                         gboolean exclude_selected,
                         const gchar* name);
VALA_EXTERN GArray* mind_map_get_nodes (MindMap* self);
VALA_EXTERN void node_clear_summary_extents (Node* self);
VALA_EXTERN gboolean node_is_summary (Node* self);
VALA_EXTERN void summary_node_nodes_changed (SummaryNode* self,
                                 gdouble fx,
                                 gdouble fy,
                                 const gchar* msg);
VALA_EXTERN gboolean node_move_to_position (Node* self,
                                Node* child,
                                NodeSide side,
                                gdouble x,
                                gdouble y);
VALA_EXTERN void animator_clear_last_save (Animator* self);
VALA_EXTERN void summary_node_add_node (SummaryNode* self,
                            Node* node);
VALA_EXTERN void summary_node_remove_node (SummaryNode* self,
                               Node* node);
VALA_EXTERN void summary_node_node_moved (SummaryNode* self,
                              Node* node);
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 void mind_map_attach_selected_nodes (MindMap* self);
VALA_EXTERN gdouble draw_area_get_scaled_x (DrawArea* self);
VALA_EXTERN gdouble draw_area_get_scaled_y (DrawArea* self);
VALA_EXTERN gboolean mind_map_select_node (MindMap* self,
                               Node* n,
                               gboolean animate);
VALA_EXTERN gboolean layout_is_manual (Layout* self);
VALA_EXTERN void node_return_to_position (Node* self);
VALA_EXTERN UndoStickerMove* undo_sticker_move_new (Sticker* sticker,
                                        gdouble orig_posx,
                                        gdouble orig_posy);
VALA_EXTERN UndoStickerMove* undo_sticker_move_construct (GType object_type,
                                              Sticker* sticker,
                                              gdouble orig_posx,
                                              gdouble orig_posy);
VALA_EXTERN GType undo_sticker_move_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoStickerMove, g_object_unref)
VALA_EXTERN void draw_area_insert_emoji (DrawArea* self,
                             CanvasText* text);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
VALA_EXTERN void canvas_text_get_cursor_pos (CanvasText* self,
                                 gint* x,
                                 gint* ytop,
                                 gint* ybot);
static void __lambda120_ (Block20Data* _data20_,
                   const gchar* txt);
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 void canvas_text_insert (CanvasText* self,
                         const gchar* s,
                         UndoTextBuffer* undo_buffer);
VALA_EXTERN UndoTextBuffer* mind_map_get_undo_text (MindMap* self);
static void ___lambda120__gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                                   const gchar* text,
                                                   gpointer self);
static gboolean draw_area_insert_text (DrawArea* self,
                                const gchar* str);
VALA_EXTERN CanvasText* mind_map_get_current_text (MindMap* self);
static void draw_area_retrieve_surrounding_in_text (DrawArea* self,
                                             CanvasText* ct);
VALA_EXTERN gpointer formatted_text_ref (gpointer instance);
VALA_EXTERN void formatted_text_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_formatted_text (const gchar* name,
                                       const gchar* nick,
                                       const gchar* blurb,
                                       GType object_type,
                                       GParamFlags flags);
VALA_EXTERN void value_set_formatted_text (GValue* value,
                               gpointer v_object);
VALA_EXTERN void value_take_formatted_text (GValue* value,
                                gpointer v_object);
VALA_EXTERN gpointer value_get_formatted_text (const GValue* value);
VALA_EXTERN GType formatted_text_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FormattedText, formatted_text_unref)
VALA_EXTERN FormattedText* canvas_text_get_text (CanvasText* self);
VALA_EXTERN const gchar* formatted_text_get_text (FormattedText* self);
VALA_EXTERN void canvas_text_get_cursor_info (CanvasText* self,
                                  gint* cursor,
                                  gint* start,
                                  gint* end);
static void draw_area_delete_surrounding_in_text (DrawArea* self,
                                           CanvasText* ct,
                                           gint offset,
                                           gint chars);
VALA_EXTERN void canvas_text_delete_range (CanvasText* self,
                               gint startpos,
                               gint endpos,
                               UndoTextBuffer* undo_buffer);
VALA_EXTERN void animator_flush (Animator* self);
VALA_EXTERN void draw_area_handle_control (DrawArea* self,
                               gboolean pressed);
VALA_EXTERN gpointer shortcuts_ref (gpointer instance);
VALA_EXTERN void shortcuts_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_shortcuts (const gchar* name,
                                  const gchar* nick,
                                  const gchar* blurb,
                                  GType object_type,
                                  GParamFlags flags);
VALA_EXTERN void value_set_shortcuts (GValue* value,
                          gpointer v_object);
VALA_EXTERN void value_take_shortcuts (GValue* value,
                           gpointer v_object);
VALA_EXTERN gpointer value_get_shortcuts (const GValue* value);
VALA_EXTERN GType shortcuts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Shortcuts, shortcuts_unref)
VALA_EXTERN Shortcuts* main_window_get_shortcuts (MainWindow* self);
VALA_EXTERN gboolean shortcuts_execute (Shortcuts* self,
                            MindMap* map,
                            guint keyval,
                            guint keycode,
                            GdkModifierType mods);
VALA_EXTERN gboolean mind_map_is_node_editable (MindMap* self);
VALA_EXTERN gboolean mind_map_is_connection_editable (MindMap* self);
VALA_EXTERN gboolean mind_map_is_callout_editable (MindMap* self);
VALA_EXTERN void draw_area_scroll_save (DrawArea* self);
static gboolean draw_area_do_scroll_save (DrawArea* self);
static gboolean _draw_area_do_scroll_save_gsource_func (gpointer self);
static guint* _uint_dup (guint* self);
static gboolean draw_area_handle_drop_accept (DrawArea* self,
                                       GdkDrop* drop);
VALA_EXTERN Node* map_model_get_droppable_node (MapModel* self,
                                    gdouble x,
                                    gdouble y);
VALA_EXTERN gboolean utils_is_url (const gchar* str);
static gboolean draw_area_do_file_drop (DrawArea* self,
                                 const gchar* uri,
                                 gdouble x,
                                 gdouble y);
VALA_EXTERN Node* map_model_create_child_node (MapModel* self,
                                   Node* parent,
                                   const gchar* name);
VALA_EXTERN UndoNodeInsert* undo_node_insert_new (Node* n,
                                      gint index);
VALA_EXTERN UndoNodeInsert* undo_node_insert_construct (GType object_type,
                                            Node* n,
                                            gint index);
VALA_EXTERN GType undo_node_insert_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeInsert, g_object_unref)
VALA_EXTERN const gchar* idea_get_text (Idea* self);
VALA_EXTERN Node* map_model_create_root_node (MapModel* self,
                                  const gchar* name);
VALA_EXTERN Tags* map_model_get_tags (MapModel* self);
VALA_EXTERN Tag* tags_get_tag_from_name (Tags* self,
                             const gchar* name);
VALA_EXTERN const gchar* tag_get_name (Tag* self);
VALA_EXTERN gboolean node_add_tag (Node* self,
                       Tag* tag);
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 NodeImage* node_image_new_from_uri (ImageManager* im,
                                    const gchar* uri,
                                    gint width);
VALA_EXTERN NodeImage* node_image_construct_from_uri (GType object_type,
                                          ImageManager* im,
                                          const gchar* uri,
                                          gint width);
VALA_EXTERN gboolean node_image_get_valid (NodeImage* self);
VALA_EXTERN void node_set_image (Node* self,
                     ImageManager* im,
                     NodeImage* ni);
VALA_EXTERN ImageManager* map_model_get_image_manager (MapModel* self);
VALA_EXTERN UndoNodeImage* undo_node_image_new (Node* n,
                                    NodeImage* old_image);
VALA_EXTERN UndoNodeImage* undo_node_image_construct (GType object_type,
                                          Node* n,
                                          NodeImage* old_image);
VALA_EXTERN GType undo_node_image_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeImage, g_object_unref)
VALA_EXTERN void map_model_get_droppable (MapModel* self,
                              gdouble x,
                              gdouble y,
                              Node** node,
                              Connection** conn,
                              Sticker** sticker);
VALA_EXTERN Connection* map_model_get_attach_conn (MapModel* self);
VALA_EXTERN Sticker* map_model_get_attach_sticker (MapModel* self);
VALA_EXTERN Sticker* sticker_new (MindMap* map,
                      const gchar* n,
                      gdouble x,
                      gdouble y,
                      gint width);
VALA_EXTERN Sticker* sticker_construct (GType object_type,
                            MindMap* map,
                            const gchar* n,
                            gdouble x,
                            gdouble y,
                            gint width);
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* mind_map_get_stickers (MindMap* self);
VALA_EXTERN void stickers_remove_sticker (Stickers* self,
                              Sticker* sticker);
VALA_EXTERN void stickers_add_sticker (Stickers* self,
                           Sticker* sticker);
VALA_EXTERN UndoStickerChange* undo_sticker_change_new (Sticker* old_sticker,
                                            Sticker* new_sticker);
VALA_EXTERN UndoStickerChange* undo_sticker_change_construct (GType object_type,
                                                  Sticker* old_sticker,
                                                  Sticker* new_sticker);
VALA_EXTERN GType undo_sticker_change_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoStickerChange, g_object_unref)
VALA_EXTERN UndoStickerAdd* undo_sticker_add_new (Sticker* sticker);
VALA_EXTERN UndoStickerAdd* undo_sticker_add_construct (GType object_type,
                                            Sticker* sticker);
VALA_EXTERN GType undo_sticker_add_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoStickerAdd, g_object_unref)
VALA_EXTERN const gchar* node_get_sticker (Node* self);
VALA_EXTERN UndoNodeStickerAdd* undo_node_sticker_add_new (Node* node,
                                               const gchar* name);
VALA_EXTERN UndoNodeStickerAdd* undo_node_sticker_add_construct (GType object_type,
                                                     Node* node,
                                                     const gchar* name);
VALA_EXTERN GType undo_node_sticker_add_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeStickerAdd, g_object_unref)
VALA_EXTERN UndoNodeStickerChange* undo_node_sticker_change_new (Node* node,
                                                     const gchar* orig_name);
VALA_EXTERN UndoNodeStickerChange* undo_node_sticker_change_construct (GType object_type,
                                                           Node* node,
                                                           const gchar* orig_name);
VALA_EXTERN GType undo_node_sticker_change_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeStickerChange, g_object_unref)
VALA_EXTERN void node_set_sticker (Node* self,
                       const gchar* value);
VALA_EXTERN const gchar* connection_get_sticker (Connection* self);
VALA_EXTERN UndoConnectionStickerAdd* undo_connection_sticker_add_new (Connection* conn,
                                                           const gchar* name);
VALA_EXTERN UndoConnectionStickerAdd* undo_connection_sticker_add_construct (GType object_type,
                                                                 Connection* conn,
                                                                 const gchar* name);
VALA_EXTERN GType undo_connection_sticker_add_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoConnectionStickerAdd, g_object_unref)
VALA_EXTERN UndoConnectionStickerChange* undo_connection_sticker_change_new (Connection* conn,
                                                                 const gchar* orig_name);
VALA_EXTERN UndoConnectionStickerChange* undo_connection_sticker_change_construct (GType object_type,
                                                                       Connection* conn,
                                                                       const gchar* orig_name);
VALA_EXTERN GType undo_connection_sticker_change_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoConnectionStickerChange, g_object_unref)
VALA_EXTERN void connection_set_sticker (Connection* self,
                             const gchar* value);
VALA_EXTERN void connection_draw_to (Connection* self,
                         gdouble x,
                         gdouble y);
VALA_EXTERN void draw_area_add_tag (DrawArea* self,
                        const gchar* tag);
VALA_EXTERN CanvasText* canvas_text_new (MindMap* map);
VALA_EXTERN CanvasText* canvas_text_construct (GType object_type,
                                   MindMap* map);
VALA_EXTERN void canvas_text_copy (CanvasText* self,
                       CanvasText* ct);
VALA_EXTERN Tagger* draw_area_get_tagger (DrawArea* self);
VALA_EXTERN void tagger_preedit_load_tags (Tagger* self,
                               FormattedText* text);
VALA_EXTERN void formatted_text_insert_text (FormattedText* self,
                                 gint index,
                                 const gchar* str);
VALA_EXTERN void tagger_postedit_load_tags (Tagger* self,
                                FormattedText* text);
VALA_EXTERN UndoNodeName* undo_node_name_new (MindMap* map,
                                  Node* node,
                                  CanvasText* orig_text);
VALA_EXTERN UndoNodeName* undo_node_name_construct (GType object_type,
                                        MindMap* map,
                                        Node* node,
                                        CanvasText* orig_text);
VALA_EXTERN GType undo_node_name_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (UndoNodeName, g_object_unref)
VALA_EXTERN gpointer text_completion_item_ref (gpointer instance);
VALA_EXTERN void text_completion_item_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_text_completion_item (const gchar* name,
                                             const gchar* nick,
                                             const gchar* blurb,
                                             GType object_type,
                                             GParamFlags flags);
VALA_EXTERN void value_set_text_completion_item (GValue* value,
                                     gpointer v_object);
VALA_EXTERN void value_take_text_completion_item (GValue* value,
                                      gpointer v_object);
VALA_EXTERN gpointer value_get_text_completion_item (const GValue* value);
VALA_EXTERN GType text_completion_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TextCompletionItem, text_completion_item_unref)
VALA_EXTERN void draw_area_show_auto_completion (DrawArea* self,
                                     GList* values,
                                     gint start_pos,
                                     gint end_pos);
VALA_EXTERN void text_completion_show (TextCompletion* self,
                           CanvasText* ct,
                           GList* list,
                           gint start,
                           gint end);
VALA_EXTERN void text_completion_hide (TextCompletion* self);
VALA_EXTERN void draw_area_hide_auto_completion (DrawArea* self);
VALA_EXTERN MindMap* draw_area_get_map (DrawArea* self);
VALA_EXTERN GtkIMContext* draw_area_get_im_context (DrawArea* self);
VALA_EXTERN gdouble draw_area_get_press_x (DrawArea* self);
VALA_EXTERN gdouble draw_area_get_press_y (DrawArea* self);
VALA_EXTERN UrlEditor* draw_area_get_url_editor (DrawArea* self);
VALA_EXTERN ImageEditor* draw_area_get_image_editor (DrawArea* self);
VALA_EXTERN TextCompletion* draw_area_get_completion (DrawArea* self);
VALA_EXTERN Connection* draw_area_get_last_connection (DrawArea* self);
VALA_EXTERN void draw_area_set_last_connection (DrawArea* self,
                                    Connection* value);
VALA_EXTERN GArray* draw_area_get_orig_info (DrawArea* self);
static void g_cclosure_user_marshal_VOID__MIND_MAP (GClosure * closure,
                                             GValue * return_value,
                                             guint n_param_values,
                                             const GValue * param_values,
                                             gpointer invocation_hint,
                                             gpointer marshal_data);
static void g_cclosure_user_marshal_VOID__INT_INT (GClosure * closure,
                                            GValue * return_value,
                                            guint n_param_values,
                                            const GValue * param_values,
                                            gpointer invocation_hint,
                                            gpointer marshal_data);
static void draw_area_finalize (GObject * obj);
static GType draw_area_get_type_once (void);
static void _vala_draw_area_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec);
static void _vala_draw_area_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static GType
drag_types_get_type_once (void)
{
	static const GEnumValue values[] = {{DRAG_TYPES_URI, "DRAG_TYPES_URI", "uri"}, {DRAG_TYPES_STICKER, "DRAG_TYPES_STICKER", "sticker"}, {0, NULL, NULL}};
	GType drag_types_type_id;
	drag_types_type_id = g_enum_register_static ("DragTypes", values);
	return drag_types_type_id;
}

GType
drag_types_get_type (void)
{
	static volatile gsize drag_types_type_id__once = 0;
	if (g_once_init_enter (&drag_types_type_id__once)) {
		GType drag_types_type_id;
		drag_types_type_id = drag_types_get_type_once ();
		g_once_init_leave (&drag_types_type_id__once, drag_types_type_id);
	}
	return drag_types_type_id__once;
}

SelectBox*
select_box_dup (const SelectBox* self)
{
	SelectBox* dup;
	dup = g_new0 (SelectBox, 1);
	memcpy (dup, self, sizeof (SelectBox));
	return dup;
}

void
select_box_free (SelectBox* self)
{
	g_free (self);
}

static GType
select_box_get_type_once (void)
{
	GType select_box_type_id;
	select_box_type_id = g_boxed_type_register_static ("SelectBox", (GBoxedCopyFunc) select_box_dup, (GBoxedFreeFunc) select_box_free);
	return select_box_type_id;
}

GType
select_box_get_type (void)
{
	static volatile gsize select_box_type_id__once = 0;
	if (g_once_init_enter (&select_box_type_id__once)) {
		GType select_box_type_id;
		select_box_type_id = select_box_get_type_once ();
		g_once_init_leave (&select_box_type_id__once, select_box_type_id);
	}
	return select_box_type_id__once;
}

static inline gpointer
draw_area_get_instance_private (DrawArea* self)
{
	return G_STRUCT_MEMBER_P (self, DrawArea_private_offset);
}

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

static void
_map_model_current_image_edited_image_editor_changed (ImageEditor* _sender,
                                                      NodeImage* orig_image,
                                                      gpointer self)
{
	map_model_current_image_edited ((MapModel*) self, orig_image);
}

static void
_node_info_free0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (node_info_free (var), NULL));
}

static void
_vala_NodeInfo_free_function_content_of (gpointer data)
{
	NodeInfo* self;
	self = *((NodeInfo**) data);
	_node_info_free0_ (self);
}

static void
_draw_area_on_draw_gtk_drawing_area_draw_func (GtkDrawingArea* drawing_area,
                                               cairo_t* cr,
                                               gint width,
                                               gint height,
                                               gpointer self)
{
	draw_area_on_draw ((DrawArea*) self, drawing_area, cr, width, height);
}

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

static void
__lambda232_ (DrawArea* self,
              gint n_press,
              gdouble x,
              gdouble y)
{
	draw_area_on_press (self, n_press, x, y, GDK_BUTTON_PRIMARY);
}

static void
___lambda232__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                         gint n_press,
                                         gdouble x,
                                         gdouble y,
                                         gpointer self)
{
	__lambda232_ ((DrawArea*) self, n_press, x, y);
}

static void
_draw_area_on_release_gtk_gesture_click_released (GtkGestureClick* _sender,
                                                  gint n_press,
                                                  gdouble x,
                                                  gdouble y,
                                                  gpointer self)
{
	draw_area_on_release ((DrawArea*) self, n_press, x, y);
}

static void
__lambda233_ (DrawArea* self,
              gint n_press,
              gdouble x,
              gdouble y)
{
	draw_area_on_press (self, n_press, x, y, GDK_BUTTON_MIDDLE);
}

static void
___lambda233__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                         gint n_press,
                                         gdouble x,
                                         gdouble y,
                                         gpointer self)
{
	__lambda233_ ((DrawArea*) self, n_press, x, y);
}

static void
_draw_area_on_right_press_gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                     gint n_press,
                                                     gdouble x,
                                                     gdouble y,
                                                     gpointer self)
{
	draw_area_on_right_press ((DrawArea*) self, n_press, x, y);
}

static void
_draw_area_on_motion_gtk_event_controller_motion_motion (GtkEventControllerMotion* _sender,
                                                         gdouble x,
                                                         gdouble y,
                                                         gpointer self)
{
	draw_area_on_motion ((DrawArea*) self, x, y);
}

static void
_draw_area_handle_cursor_leave_gtk_event_controller_motion_leave (GtkEventControllerMotion* _sender,
                                                                  gpointer self)
{
	draw_area_handle_cursor_leave ((DrawArea*) self);
}

static gboolean
_draw_area_on_keypress_gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                             guint keyval,
                                                             guint keycode,
                                                             GdkModifierType state,
                                                             gpointer self)
{
	gboolean result;
	result = draw_area_on_keypress ((DrawArea*) self, keyval, keycode, state);
	return result;
}

static void
_draw_area_on_keyrelease_gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                                guint keyval,
                                                                guint keycode,
                                                                GdkModifierType state,
                                                                gpointer self)
{
	draw_area_on_keyrelease ((DrawArea*) self, keyval, keycode, state);
}

static void
_draw_area_on_focus_leave_gtk_event_controller_focus_leave (GtkEventControllerFocus* _sender,
                                                            gpointer self)
{
	draw_area_on_focus_leave ((DrawArea*) self);
}

static gboolean
_draw_area_on_scroll_gtk_event_controller_scroll_scroll (GtkEventControllerScroll* _sender,
                                                         gdouble dx,
                                                         gdouble dy,
                                                         gpointer self)
{
	gboolean result;
	result = draw_area_on_scroll ((DrawArea*) self, dx, dy);
	return result;
}

static GdkDragAction
_draw_area_handle_file_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self)
{
	GdkDragAction result;
	result = draw_area_handle_file_drag_motion ((DrawArea*) self, x, y);
	return result;
}

static gboolean
_draw_area_handle_file_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                  GValue* value,
                                                  gdouble x,
                                                  gdouble y,
                                                  gpointer self)
{
	gboolean result;
	result = draw_area_handle_file_drop ((DrawArea*) self, value, x, y);
	return result;
}

static void
_draw_area_handle_cursor_leave_gtk_drop_target_leave (GtkDropTarget* _sender,
                                                      gpointer self)
{
	draw_area_handle_cursor_leave ((DrawArea*) self);
}

static GdkDragAction
_draw_area_handle_sticker_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                              gdouble x,
                                                              gdouble y,
                                                              gpointer self)
{
	GdkDragAction result;
	result = draw_area_handle_sticker_drag_motion ((DrawArea*) self, x, y);
	return result;
}

static gboolean
_draw_area_handle_sticker_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                     GValue* value,
                                                     gdouble x,
                                                     gdouble y,
                                                     gpointer self)
{
	gboolean result;
	result = draw_area_handle_sticker_drop ((DrawArea*) self, value, x, y);
	return result;
}

static GdkDragAction
_draw_area_handle_text_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self)
{
	GdkDragAction result;
	result = draw_area_handle_text_drag_motion ((DrawArea*) self, x, y);
	return result;
}

static gboolean
_draw_area_handle_text_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                  GValue* value,
                                                  gdouble x,
                                                  gdouble y,
                                                  gpointer self)
{
	gboolean result;
	result = draw_area_handle_text_drop ((DrawArea*) self, value, x, y);
	return result;
}

static GdkDragAction
_draw_area_handle_idea_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                           gdouble x,
                                                           gdouble y,
                                                           gpointer self)
{
	GdkDragAction result;
	result = draw_area_handle_idea_drag_motion ((DrawArea*) self, x, y);
	return result;
}

static gboolean
_draw_area_handle_idea_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                  GValue* value,
                                                  gdouble x,
                                                  gdouble y,
                                                  gpointer self)
{
	gboolean result;
	result = draw_area_handle_idea_drop ((DrawArea*) self, value, x, y);
	return result;
}

static GdkDragAction
_draw_area_handle_tag_drag_motion_gtk_drop_target_motion (GtkDropTarget* _sender,
                                                          gdouble x,
                                                          gdouble y,
                                                          gpointer self)
{
	GdkDragAction result;
	result = draw_area_handle_tag_drag_motion ((DrawArea*) self, x, y);
	return result;
}

static gboolean
_draw_area_handle_tag_drop_gtk_drop_target_drop (GtkDropTarget* _sender,
                                                 GValue* value,
                                                 gdouble x,
                                                 gdouble y,
                                                 gpointer self)
{
	gboolean result;
	result = draw_area_handle_tag_drop ((DrawArea*) self, value, x, y);
	return result;
}

static void
_draw_area_handle_im_commit_gtk_im_context_commit (GtkIMContext* _sender,
                                                   const gchar* str,
                                                   gpointer self)
{
	draw_area_handle_im_commit ((DrawArea*) self, str);
}

static gboolean
_draw_area_handle_im_retrieve_surrounding_gtk_im_context_retrieve_surrounding (GtkIMContext* _sender,
                                                                               gpointer self)
{
	gboolean result;
	result = draw_area_handle_im_retrieve_surrounding ((DrawArea*) self);
	return result;
}

static gboolean
_draw_area_handle_im_delete_surrounding_gtk_im_context_delete_surrounding (GtkIMContext* _sender,
                                                                           gint offset,
                                                                           gint n_chars,
                                                                           gpointer self)
{
	gboolean result;
	result = draw_area_handle_im_delete_surrounding ((DrawArea*) self, offset, n_chars);
	return result;
}

DrawArea*
draw_area_construct (GType object_type,
                     MindMap* map,
                     MainWindow* w)
{
	DrawArea * self = NULL;
	MindMap* _tmp0_;
	Animator* _tmp1_;
	Animator* _tmp2_;
	ImageEditor* _tmp3_;
	ImageEditor* _tmp4_;
	MindMap* _tmp5_;
	MapModel* _tmp6_;
	MapModel* _tmp7_;
	UrlEditor* _tmp8_;
	SelectBox _tmp9_ = {0};
	MainWindow* _tmp10_;
	GtkApplication* _tmp11_;
	GtkApplication* _tmp12_;
	NodeMenu* _tmp13_;
	MainWindow* _tmp14_;
	GtkApplication* _tmp15_;
	GtkApplication* _tmp16_;
	ConnectionMenu* _tmp17_;
	MainWindow* _tmp18_;
	GtkApplication* _tmp19_;
	GtkApplication* _tmp20_;
	ConnectionsMenu* _tmp21_;
	MainWindow* _tmp22_;
	GtkApplication* _tmp23_;
	GtkApplication* _tmp24_;
	EmptyMenu* _tmp25_;
	MainWindow* _tmp26_;
	GtkApplication* _tmp27_;
	GtkApplication* _tmp28_;
	NodesMenu* _tmp29_;
	MainWindow* _tmp30_;
	GtkApplication* _tmp31_;
	GtkApplication* _tmp32_;
	GroupsMenu* _tmp33_;
	MainWindow* _tmp34_;
	GtkApplication* _tmp35_;
	GtkApplication* _tmp36_;
	CalloutMenu* _tmp37_;
	MainWindow* _tmp38_;
	GtkApplication* _tmp39_;
	GtkApplication* _tmp40_;
	TextMenu* _tmp41_;
	GArray* _tmp42_;
	MindMap* _tmp43_;
	TextCompletion* _tmp44_;
	GtkGestureClick* click = NULL;
	GtkGestureClick* _tmp45_ = NULL;
	GtkEventController* _tmp46_;
	GtkGestureClick* middle_click = NULL;
	GtkGestureClick* _tmp47_ = NULL;
	GtkEventController* _tmp48_;
	GtkGestureClick* right_click = NULL;
	GtkGestureClick* _tmp49_ = NULL;
	GtkEventController* _tmp50_;
	GtkEventControllerMotion* motion = NULL;
	GtkEventControllerMotion* _tmp51_;
	GtkEventController* _tmp52_;
	GtkEventControllerKey* _tmp53_;
	GtkEventControllerKey* _tmp54_;
	GtkEventController* _tmp55_;
	GtkEventControllerKey* _tmp56_;
	GtkEventControllerKey* _tmp57_;
	GtkEventControllerFocus* focus_controller = NULL;
	GtkEventControllerFocus* _tmp58_;
	GtkEventController* _tmp59_;
	GtkEventControllerScroll* _tmp60_;
	GtkEventControllerScroll* _tmp61_;
	GtkEventController* _tmp62_;
	GtkEventControllerScroll* _tmp63_;
	GtkDropTarget* file_drop = NULL;
	GtkDropTarget* _tmp64_;
	GtkEventController* _tmp65_;
	GtkDropTarget* sticker_drop = NULL;
	GtkDropTarget* _tmp66_;
	GtkEventController* _tmp67_;
	GtkDropTarget* text_drop = NULL;
	GtkDropTarget* _tmp68_;
	GtkEventController* _tmp69_;
	GtkDropTarget* idea_drop = NULL;
	GtkDropTarget* _tmp70_;
	GtkEventController* _tmp71_;
	GtkDropTarget* tag_drop = NULL;
	GtkDropTarget* _tmp72_;
	GtkEventController* _tmp73_;
	GtkStyleContext* _tmp74_;
	GtkIMMulticontext* _tmp75_;
	GtkIMContext* _tmp76_;
	GtkIMContext* _tmp77_;
	GtkIMContext* _tmp78_;
	GtkIMContext* _tmp79_;
	GtkIMContext* _tmp80_;
	g_return_val_if_fail (map != NULL, NULL);
	g_return_val_if_fail (w != NULL, NULL);
	self = (DrawArea*) g_object_new (object_type, NULL);
	_tmp0_ = _mind_map_ref0 (map);
	_mind_map_unref0 (self->priv->_map);
	self->priv->_map = _tmp0_;
	draw_area_set_win (self, w);
	_tmp1_ = animator_new (self);
	_tmp2_ = _tmp1_;
	draw_area_set_animator (self, _tmp2_);
	_g_object_unref0 (_tmp2_);
	_tmp3_ = image_editor_new (self);
	_image_editor_unref0 (self->priv->_image_editor);
	self->priv->_image_editor = _tmp3_;
	_tmp4_ = self->priv->_image_editor;
	_tmp5_ = self->priv->_map;
	_tmp6_ = mind_map_get_model (_tmp5_);
	_tmp7_ = _tmp6_;
	g_signal_connect (_tmp4_, "changed", (GCallback) _map_model_current_image_edited_image_editor_changed, _tmp7_);
	_tmp8_ = url_editor_new (self);
	_url_editor_unref0 (self->priv->_url_editor);
	self->priv->_url_editor = _tmp8_;
	_tmp9_.x = (gdouble) 0;
	_tmp9_.y = (gdouble) 0;
	_tmp9_.w = (gdouble) 0;
	_tmp9_.h = (gdouble) 0;
	_tmp9_.valid = FALSE;
	self->priv->_select_box = _tmp9_;
	_tmp10_ = self->priv->_win;
	_tmp11_ = gtk_window_get_application ((GtkWindow*) _tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = node_menu_new (_tmp12_, self);
	_base_menu_unref0 (self->priv->_node_menu);
	self->priv->_node_menu = _tmp13_;
	_tmp14_ = self->priv->_win;
	_tmp15_ = gtk_window_get_application ((GtkWindow*) _tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = connection_menu_new (_tmp16_, self);
	_base_menu_unref0 (self->priv->_conn_menu);
	self->priv->_conn_menu = _tmp17_;
	_tmp18_ = self->priv->_win;
	_tmp19_ = gtk_window_get_application ((GtkWindow*) _tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = connections_menu_new (_tmp20_, self);
	_base_menu_unref0 (self->priv->_conns_menu);
	self->priv->_conns_menu = _tmp21_;
	_tmp22_ = self->priv->_win;
	_tmp23_ = gtk_window_get_application ((GtkWindow*) _tmp22_);
	_tmp24_ = _tmp23_;
	_tmp25_ = empty_menu_new (_tmp24_, self);
	_base_menu_unref0 (self->priv->_empty_menu);
	self->priv->_empty_menu = _tmp25_;
	_tmp26_ = self->priv->_win;
	_tmp27_ = gtk_window_get_application ((GtkWindow*) _tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = nodes_menu_new (_tmp28_, self);
	_base_menu_unref0 (self->priv->_nodes_menu);
	self->priv->_nodes_menu = _tmp29_;
	_tmp30_ = self->priv->_win;
	_tmp31_ = gtk_window_get_application ((GtkWindow*) _tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = groups_menu_new (_tmp32_, self);
	_base_menu_unref0 (self->priv->_groups_menu);
	self->priv->_groups_menu = _tmp33_;
	_tmp34_ = self->priv->_win;
	_tmp35_ = gtk_window_get_application ((GtkWindow*) _tmp34_);
	_tmp36_ = _tmp35_;
	_tmp37_ = callout_menu_new (_tmp36_, self);
	_base_menu_unref0 (self->priv->_callout_menu);
	self->priv->_callout_menu = _tmp37_;
	_tmp38_ = self->priv->_win;
	_tmp39_ = gtk_window_get_application ((GtkWindow*) _tmp38_);
	_tmp40_ = _tmp39_;
	_tmp41_ = text_menu_new (_tmp40_, self);
	_base_menu_unref0 (self->priv->_text_menu);
	self->priv->_text_menu = _tmp41_;
	_tmp42_ = g_array_new (TRUE, TRUE, sizeof (NodeInfo*));
	g_array_set_clear_func (_tmp42_, (GDestroyNotify) _vala_NodeInfo_free_function_content_of);
	_g_array_unref0 (self->priv->_orig_info);
	self->priv->_orig_info = _tmp42_;
	_tmp43_ = self->priv->_map;
	_tmp44_ = text_completion_new (_tmp43_);
	_text_completion_unref0 (self->priv->_completion);
	self->priv->_completion = _tmp44_;
	gtk_drawing_area_set_draw_func ((GtkDrawingArea*) self, _draw_area_on_draw_gtk_drawing_area_draw_func, g_object_ref (self), g_object_unref);
	_tmp45_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp45_, (guint) GDK_BUTTON_PRIMARY);
	click = _tmp45_;
	_tmp46_ = _g_object_ref0 ((GtkEventController*) click);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp46_);
	g_signal_connect_object (click, "pressed", (GCallback) ___lambda232__gtk_gesture_click_pressed, self, 0);
	g_signal_connect_object (click, "released", (GCallback) _draw_area_on_release_gtk_gesture_click_released, self, 0);
	_tmp47_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp47_, (guint) GDK_BUTTON_MIDDLE);
	middle_click = _tmp47_;
	_tmp48_ = _g_object_ref0 ((GtkEventController*) middle_click);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp48_);
	g_signal_connect_object (middle_click, "pressed", (GCallback) ___lambda233__gtk_gesture_click_pressed, self, 0);
	g_signal_connect_object (middle_click, "released", (GCallback) _draw_area_on_release_gtk_gesture_click_released, self, 0);
	_tmp49_ = (GtkGestureClick*) gtk_gesture_click_new ();
	gtk_gesture_single_set_button ((GtkGestureSingle*) _tmp49_, (guint) GDK_BUTTON_SECONDARY);
	right_click = _tmp49_;
	_tmp50_ = _g_object_ref0 ((GtkEventController*) right_click);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp50_);
	g_signal_connect_object (right_click, "pressed", (GCallback) _draw_area_on_right_press_gtk_gesture_click_pressed, self, 0);
	_tmp51_ = (GtkEventControllerMotion*) gtk_event_controller_motion_new ();
	motion = _tmp51_;
	_tmp52_ = _g_object_ref0 ((GtkEventController*) motion);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp52_);
	g_signal_connect_object (motion, "motion", (GCallback) _draw_area_on_motion_gtk_event_controller_motion_motion, self, 0);
	g_signal_connect_object (motion, "leave", (GCallback) _draw_area_handle_cursor_leave_gtk_event_controller_motion_leave, self, 0);
	_tmp53_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	_g_object_unref0 (self->priv->_key_controller);
	self->priv->_key_controller = _tmp53_;
	_tmp54_ = self->priv->_key_controller;
	_tmp55_ = _g_object_ref0 ((GtkEventController*) _tmp54_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp55_);
	_tmp56_ = self->priv->_key_controller;
	g_signal_connect_object (_tmp56_, "key-pressed", (GCallback) _draw_area_on_keypress_gtk_event_controller_key_key_pressed, self, 0);
	_tmp57_ = self->priv->_key_controller;
	g_signal_connect_object (_tmp57_, "key-released", (GCallback) _draw_area_on_keyrelease_gtk_event_controller_key_key_released, self, 0);
	_tmp58_ = (GtkEventControllerFocus*) gtk_event_controller_focus_new ();
	focus_controller = _tmp58_;
	_tmp59_ = _g_object_ref0 ((GtkEventController*) focus_controller);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp59_);
	g_signal_connect_object (focus_controller, "leave", (GCallback) _draw_area_on_focus_leave_gtk_event_controller_focus_leave, self, 0);
	_tmp60_ = (GtkEventControllerScroll*) gtk_event_controller_scroll_new (GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES);
	_g_object_unref0 (self->priv->_scroll);
	self->priv->_scroll = _tmp60_;
	_tmp61_ = self->priv->_scroll;
	_tmp62_ = _g_object_ref0 ((GtkEventController*) _tmp61_);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp62_);
	_tmp63_ = self->priv->_scroll;
	g_signal_connect_object (_tmp63_, "scroll", (GCallback) _draw_area_on_scroll_gtk_event_controller_scroll_scroll, self, 0);
	_tmp64_ = gtk_drop_target_new (g_file_get_type (), GDK_ACTION_COPY);
	file_drop = _tmp64_;
	_tmp65_ = _g_object_ref0 ((GtkEventController*) file_drop);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp65_);
	g_signal_connect_object (file_drop, "motion", (GCallback) _draw_area_handle_file_drag_motion_gtk_drop_target_motion, self, 0);
	g_signal_connect_object (file_drop, "drop", (GCallback) _draw_area_handle_file_drop_gtk_drop_target_drop, self, 0);
	g_signal_connect_object (file_drop, "leave", (GCallback) _draw_area_handle_cursor_leave_gtk_drop_target_leave, self, 0);
	_tmp66_ = gtk_drop_target_new (gtk_picture_get_type (), GDK_ACTION_COPY);
	sticker_drop = _tmp66_;
	_tmp67_ = _g_object_ref0 ((GtkEventController*) sticker_drop);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp67_);
	g_signal_connect_object (sticker_drop, "motion", (GCallback) _draw_area_handle_sticker_drag_motion_gtk_drop_target_motion, self, 0);
	g_signal_connect_object (sticker_drop, "drop", (GCallback) _draw_area_handle_sticker_drop_gtk_drop_target_drop, self, 0);
	g_signal_connect_object (sticker_drop, "leave", (GCallback) _draw_area_handle_cursor_leave_gtk_drop_target_leave, self, 0);
	_tmp68_ = gtk_drop_target_new (G_TYPE_STRING, GDK_ACTION_COPY);
	text_drop = _tmp68_;
	_tmp69_ = _g_object_ref0 ((GtkEventController*) text_drop);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp69_);
	g_signal_connect_object (text_drop, "motion", (GCallback) _draw_area_handle_text_drag_motion_gtk_drop_target_motion, self, 0);
	g_signal_connect_object (text_drop, "drop", (GCallback) _draw_area_handle_text_drop_gtk_drop_target_drop, self, 0);
	g_signal_connect_object (text_drop, "leave", (GCallback) _draw_area_handle_cursor_leave_gtk_drop_target_leave, self, 0);
	_tmp70_ = gtk_drop_target_new (TYPE_IDEA, GDK_ACTION_MOVE);
	idea_drop = _tmp70_;
	_tmp71_ = _g_object_ref0 ((GtkEventController*) idea_drop);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp71_);
	g_signal_connect_object (idea_drop, "motion", (GCallback) _draw_area_handle_idea_drag_motion_gtk_drop_target_motion, self, 0);
	g_signal_connect_object (idea_drop, "drop", (GCallback) _draw_area_handle_idea_drop_gtk_drop_target_drop, self, 0);
	g_signal_connect_object (idea_drop, "leave", (GCallback) _draw_area_handle_cursor_leave_gtk_drop_target_leave, self, 0);
	_tmp72_ = gtk_drop_target_new (TYPE_TAG, GDK_ACTION_COPY);
	tag_drop = _tmp72_;
	_tmp73_ = _g_object_ref0 ((GtkEventController*) tag_drop);
	gtk_widget_add_controller ((GtkWidget*) self, _tmp73_);
	g_signal_connect_object (tag_drop, "motion", (GCallback) _draw_area_handle_tag_drag_motion_gtk_drop_target_motion, self, 0);
	g_signal_connect_object (tag_drop, "drop", (GCallback) _draw_area_handle_tag_drop_gtk_drop_target_drop, self, 0);
	g_signal_connect_object (tag_drop, "leave", (GCallback) _draw_area_handle_cursor_leave_gtk_drop_target_leave, self, 0);
	gtk_widget_set_can_focus ((GtkWidget*) self, TRUE);
	gtk_widget_set_focusable ((GtkWidget*) self, TRUE);
	_tmp74_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_style_context_add_class (_tmp74_, "canvas");
	_tmp75_ = (GtkIMMulticontext*) gtk_im_multicontext_new ();
	_g_object_unref0 (self->priv->_im_context);
	self->priv->_im_context = (GtkIMContext*) _tmp75_;
	_tmp76_ = self->priv->_im_context;
	gtk_im_context_set_client_widget (_tmp76_, (GtkWidget*) self);
	_tmp77_ = self->priv->_im_context;
	gtk_im_context_set_use_preedit (_tmp77_, FALSE);
	_tmp78_ = self->priv->_im_context;
	g_signal_connect_object (_tmp78_, "commit", (GCallback) _draw_area_handle_im_commit_gtk_im_context_commit, self, 0);
	_tmp79_ = self->priv->_im_context;
	g_signal_connect_object (_tmp79_, "retrieve-surrounding", (GCallback) _draw_area_handle_im_retrieve_surrounding_gtk_im_context_retrieve_surrounding, self, 0);
	_tmp80_ = self->priv->_im_context;
	g_signal_connect_object (_tmp80_, "delete-surrounding", (GCallback) _draw_area_handle_im_delete_surrounding_gtk_im_context_delete_surrounding, self, 0);
	_g_object_unref0 (tag_drop);
	_g_object_unref0 (idea_drop);
	_g_object_unref0 (text_drop);
	_g_object_unref0 (sticker_drop);
	_g_object_unref0 (file_drop);
	_g_object_unref0 (focus_controller);
	_g_object_unref0 (motion);
	_g_object_unref0 (right_click);
	_g_object_unref0 (middle_click);
	_g_object_unref0 (click);
	return self;
}

DrawArea*
draw_area_new (MindMap* map,
               MainWindow* w)
{
	return draw_area_construct (TYPE_DRAW_AREA, map, w);
}

static void
draw_area_real_size_allocate (GtkWidget* base,
                              gint width,
                              gint height,
                              gint baseline)
{
	DrawArea * self;
	gint _tmp0_;
	self = (DrawArea*) base;
	_tmp0_ = self->priv->_resized_count;
	self->priv->_resized_count = _tmp0_ + 1;
	if (_tmp0_ == 0) {
		g_signal_emit (self, draw_area_signals[DRAW_AREA_SIZE_READY_SIGNAL], 0, width, height);
	}
	g_signal_emit (self, draw_area_signals[DRAW_AREA_SIZE_CHANGED_SIGNAL], 0, width, height);
}

NodeSide
draw_area_get_orig_side (DrawArea* self)
{
	NodeSide result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_orig_side;
	return result;
}

void
draw_area_get_window_ys (DrawArea* self,
                         gint* top,
                         gint* bottom)
{
	gint _vala_top = 0;
	gint _vala_bottom = 0;
	gint vh = 0;
	gdouble _tmp0_;
	gdouble _tmp1_;
	g_return_if_fail (self != NULL);
	vh = gtk_widget_get_allocated_height ((GtkWidget*) self);
	_tmp0_ = draw_area_get_origin_y (self);
	_tmp1_ = _tmp0_;
	_vala_top = (gint) _tmp1_;
	_vala_bottom = _vala_top + vh;
	if (top) {
		*top = _vala_top;
	}
	if (bottom) {
		*bottom = _vala_bottom;
	}
}

void
draw_area_reset_cursor (DrawArea* self)
{
	g_return_if_fail (self != NULL);
	gtk_widget_set_cursor ((GtkWidget*) self, NULL);
}

static void
draw_area_set_cursor_name (DrawArea* self,
                           const gchar* name)
{
	GdkCursor* _tmp0_;
	GdkCursor* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = gdk_cursor_new_from_name (name, NULL);
	_tmp1_ = _tmp0_;
	gtk_widget_set_cursor ((GtkWidget*) self, _tmp1_);
	_g_object_unref0 (_tmp1_);
}

void
draw_area_set_text_cursor (DrawArea* self)
{
	g_return_if_fail (self != NULL);
	draw_area_set_cursor_name (self, DRAW_AREA_text_cursor);
}

void
draw_area_initialize (DrawArea* self)
{
	g_return_if_fail (self != NULL);
	draw_area_set_origin_x (self, 0.0);
	draw_area_set_origin_y (self, 0.0);
	draw_area_set_sfactor (self, 1.0);
	self->priv->_pressed = FALSE;
	self->priv->_press_num = 0;
	self->priv->_motion = FALSE;
	_g_object_unref0 (self->priv->_last_connection);
	self->priv->_last_connection = NULL;
}

void
draw_area_update_im_cursor (DrawArea* self,
                            CanvasText* ct)
{
	gint int_posx = 0;
	gdouble _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	gint int_posy = 0;
	gdouble _tmp4_;
	gdouble _tmp5_;
	gdouble _tmp6_;
	gdouble _tmp7_;
	gint int_width = 0;
	gdouble _tmp8_;
	gdouble _tmp9_;
	gdouble _tmp10_;
	gdouble _tmp11_;
	gint int_height = 0;
	gdouble _tmp12_;
	gdouble _tmp13_;
	gdouble _tmp14_;
	gdouble _tmp15_;
	GdkRectangle rect = {0};
	GdkRectangle _tmp16_ = {0};
	GtkIMContext* _tmp17_;
	GdkRectangle _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ct != NULL);
	_tmp0_ = canvas_text_get_posx (ct);
	_tmp1_ = _tmp0_;
	_tmp2_ = draw_area_get_sfactor (self);
	_tmp3_ = _tmp2_;
	int_posx = (gint) (_tmp1_ * _tmp3_);
	_tmp4_ = canvas_text_get_posy (ct);
	_tmp5_ = _tmp4_;
	_tmp6_ = draw_area_get_sfactor (self);
	_tmp7_ = _tmp6_;
	int_posy = (gint) (_tmp5_ * _tmp7_);
	_tmp8_ = canvas_text_get_width (ct);
	_tmp9_ = _tmp8_;
	_tmp10_ = draw_area_get_sfactor (self);
	_tmp11_ = _tmp10_;
	int_width = (gint) (_tmp9_ * _tmp11_);
	_tmp12_ = canvas_text_get_height (ct);
	_tmp13_ = _tmp12_;
	_tmp14_ = draw_area_get_sfactor (self);
	_tmp15_ = _tmp14_;
	int_height = (gint) (_tmp13_ * _tmp15_);
	_tmp16_.x = int_posx + int_width;
	_tmp16_.y = int_posy + int_height;
	_tmp16_.width = 0;
	_tmp16_.height = 0;
	rect = _tmp16_;
	_tmp17_ = self->priv->_im_context;
	_tmp18_ = rect;
	gtk_im_context_set_cursor_location (_tmp17_, &_tmp18_);
}

void
draw_area_clear_current_connection (DrawArea* self,
                                    gboolean signal_change)
{
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	if (selection_num_connections (_tmp2_) > 0) {
		MindMap* _tmp3_;
		Selection* _tmp4_;
		Selection* _tmp5_;
		_tmp3_ = self->priv->_map;
		_tmp4_ = mind_map_get_selected (_tmp3_);
		_tmp5_ = _tmp4_;
		selection_clear_connections (_tmp5_, signal_change, 1.0);
		_g_object_unref0 (self->priv->_last_connection);
		self->priv->_last_connection = NULL;
	}
}

static void
draw_area_clear_current_node (DrawArea* self,
                              gboolean signal_change)
{
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	if (selection_num_nodes (_tmp2_) > 0) {
		MindMap* _tmp3_;
		Selection* _tmp4_;
		Selection* _tmp5_;
		_tmp3_ = self->priv->_map;
		_tmp4_ = mind_map_get_selected (_tmp3_);
		_tmp5_ = _tmp4_;
		selection_clear_nodes (_tmp5_, signal_change, 1.0);
	}
}

static void
draw_area_clear_current_sticker (DrawArea* self,
                                 gboolean signal_change)
{
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	if (selection_num_stickers (_tmp2_) > 0) {
		MindMap* _tmp3_;
		Selection* _tmp4_;
		Selection* _tmp5_;
		_tmp3_ = self->priv->_map;
		_tmp4_ = mind_map_get_selected (_tmp3_);
		_tmp5_ = _tmp4_;
		selection_clear_stickers (_tmp5_, signal_change);
	}
}

static void
draw_area_clear_current_group (DrawArea* self,
                               gboolean signal_change)
{
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	if (selection_num_groups (_tmp2_) > 0) {
		MindMap* _tmp3_;
		Selection* _tmp4_;
		Selection* _tmp5_;
		_tmp3_ = self->priv->_map;
		_tmp4_ = mind_map_get_selected (_tmp3_);
		_tmp5_ = _tmp4_;
		selection_clear_groups (_tmp5_, signal_change);
	}
}

static void
draw_area_clear_current_callout (DrawArea* self,
                                 gboolean signal_change)
{
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	if (selection_num_callouts (_tmp2_) > 0) {
		MindMap* _tmp3_;
		Selection* _tmp4_;
		Selection* _tmp5_;
		_tmp3_ = self->priv->_map;
		_tmp4_ = mind_map_get_selected (_tmp3_);
		_tmp5_ = _tmp4_;
		selection_clear_callouts (_tmp5_, signal_change, 1.0);
	}
}

static gboolean
draw_area_set_current_connection_from_position (DrawArea* self,
                                                Connection* conn,
                                                MapItemComponent component,
                                                gdouble scaled_x,
                                                gdouble scaled_y)
{
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (conn != NULL, FALSE);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	if (selection_is_current_connection (_tmp2_, conn)) {
		ConnMode _tmp3_;
		ConnMode _tmp4_;
		_tmp3_ = connection_get_mode (conn);
		_tmp4_ = _tmp3_;
		if (_tmp4_ == CONN_MODE_EDITABLE) {
			switch (self->priv->_press_num) {
				case 1:
				{
					CanvasText* _tmp5_;
					CanvasText* _tmp6_;
					GtkIMContext* _tmp7_;
					_tmp5_ = connection_get_title (conn);
					_tmp6_ = _tmp5_;
					canvas_text_set_cursor_at_char (_tmp6_, scaled_x, scaled_y, self->priv->_shift);
					_tmp7_ = self->priv->_im_context;
					gtk_im_context_reset (_tmp7_);
					break;
				}
				case 2:
				{
					CanvasText* _tmp8_;
					CanvasText* _tmp9_;
					GtkIMContext* _tmp10_;
					_tmp8_ = connection_get_title (conn);
					_tmp9_ = _tmp8_;
					canvas_text_set_cursor_at_word (_tmp9_, scaled_x, scaled_y, self->priv->_shift);
					_tmp10_ = self->priv->_im_context;
					gtk_im_context_reset (_tmp10_);
					break;
				}
				case 3:
				{
					CanvasText* _tmp11_;
					CanvasText* _tmp12_;
					GtkIMContext* _tmp13_;
					_tmp11_ = connection_get_title (conn);
					_tmp12_ = _tmp11_;
					canvas_text_set_cursor_all (_tmp12_, FALSE);
					_tmp13_ = self->priv->_im_context;
					gtk_im_context_reset (_tmp13_);
					break;
				}
				default:
				break;
			}
		} else {
			gboolean _tmp14_ = FALSE;
			if (self->priv->_press_num == 2) {
				MindMap* _tmp15_;
				gboolean _tmp16_;
				gboolean _tmp17_;
				_tmp15_ = self->priv->_map;
				_tmp16_ = mind_map_get_editable (_tmp15_);
				_tmp17_ = _tmp16_;
				_tmp14_ = _tmp17_;
			} else {
				_tmp14_ = FALSE;
			}
			if (_tmp14_) {
				Connection* current = NULL;
				MindMap* _tmp18_;
				Selection* _tmp19_;
				Selection* _tmp20_;
				Connection* _tmp21_;
				Connection* _tmp22_;
				MindMap* _tmp23_;
				MindMap* _tmp24_;
				MapModel* _tmp25_;
				MapModel* _tmp26_;
				Connection* _tmp27_;
				_tmp18_ = self->priv->_map;
				_tmp19_ = mind_map_get_selected (_tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = selection_current_connection (_tmp20_);
				current = _tmp21_;
				_tmp22_ = current;
				_tmp23_ = self->priv->_map;
				connection_edit_title_begin (_tmp22_, _tmp23_);
				_tmp24_ = self->priv->_map;
				_tmp25_ = mind_map_get_model (_tmp24_);
				_tmp26_ = _tmp25_;
				_tmp27_ = current;
				map_model_set_connection_mode (_tmp26_, _tmp27_, CONN_MODE_EDITABLE, TRUE);
				_g_object_unref0 (current);
			}
		}
		result = TRUE;
		return result;
	} else {
		if (self->priv->_shift) {
			MindMap* _tmp28_;
			gboolean _tmp29_;
			gboolean _tmp30_;
			_tmp28_ = self->priv->_map;
			_tmp29_ = mind_map_get_editable (_tmp28_);
			_tmp30_ = _tmp29_;
			if (_tmp30_) {
				MindMap* _tmp31_;
				Selection* _tmp32_;
				Selection* _tmp33_;
				MindMap* _tmp34_;
				MapModel* _tmp35_;
				MapModel* _tmp36_;
				_tmp31_ = self->priv->_map;
				_tmp32_ = mind_map_get_selected (_tmp31_);
				_tmp33_ = _tmp32_;
				selection_add_connection (_tmp33_, conn);
				_tmp34_ = self->priv->_map;
				_tmp35_ = mind_map_get_model (_tmp34_);
				_tmp36_ = _tmp35_;
				map_model_handle_connection_edit_on_creation (_tmp36_, conn);
			}
		} else {
			MindMap* _tmp37_;
			_tmp37_ = self->priv->_map;
			mind_map_set_current_connection (_tmp37_, conn);
		}
	}
	result = FALSE;
	return result;
}

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

static gboolean
draw_area_set_current_node_from_position (DrawArea* self,
                                          Node* node,
                                          MapItemComponent component,
                                          gdouble scaled_x,
                                          gdouble scaled_y)
{
	gboolean dpress = FALSE;
	gboolean tpress = FALSE;
	FormatTag tag = 0;
	gchar* url = NULL;
	gchar* _tmp0_;
	gdouble left = 0.0;
	NodeSide _tmp31_;
	NodeSide _tmp32_;
	GArray* _tmp33_;
	GArray* _tmp34_;
	gint _tmp35_ = 0;
	gpointer* _tmp36_;
	NodeInfo** _tmp37_;
	gint _tmp37__length1;
	NodeMode _tmp38_;
	NodeMode _tmp39_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (node != NULL, FALSE);
	dpress = self->priv->_press_num == 2;
	tpress = self->priv->_press_num == 3;
	tag = FORMAT_TAG_LENGTH;
	_tmp0_ = g_strdup ("");
	url = _tmp0_;
	left = 0.0;
	gtk_widget_set_tooltip_markup ((GtkWidget*) self, NULL);
	switch (component) {
		case MAP_ITEM_COMPONENT_TASK:
		{
			MindMap* _tmp1_;
			gboolean _tmp2_;
			gboolean _tmp3_;
			_tmp1_ = self->priv->_map;
			_tmp2_ = mind_map_get_editable (_tmp1_);
			_tmp3_ = _tmp2_;
			if (_tmp3_) {
				MindMap* _tmp4_;
				MapModel* _tmp5_;
				MapModel* _tmp6_;
				MindMap* _tmp7_;
				_tmp4_ = self->priv->_map;
				_tmp5_ = mind_map_get_model (_tmp4_);
				_tmp6_ = _tmp5_;
				map_model_toggle_task (_tmp6_, node);
				_tmp7_ = self->priv->_map;
				g_signal_emit (self, draw_area_signals[DRAW_AREA_CURRENT_CHANGED_SIGNAL], 0, _tmp7_);
			}
			result = FALSE;
			_g_free0 (url);
			return result;
		}
		case MAP_ITEM_COMPONENT_NODE_LINK:
		{
			MindMap* _tmp8_;
			_tmp8_ = self->priv->_map;
			mind_map_select_linked_node (_tmp8_, node);
			result = FALSE;
			_g_free0 (url);
			return result;
		}
		case MAP_ITEM_COMPONENT_FOLD:
		{
			MindMap* _tmp9_;
			MapModel* _tmp10_;
			MapModel* _tmp11_;
			MindMap* _tmp12_;
			_tmp9_ = self->priv->_map;
			_tmp10_ = mind_map_get_model (_tmp9_);
			_tmp11_ = _tmp10_;
			map_model_toggle_folds (_tmp11_, self->priv->_shift);
			_tmp12_ = self->priv->_map;
			g_signal_emit (self, draw_area_signals[DRAW_AREA_CURRENT_CHANGED_SIGNAL], 0, _tmp12_);
			result = FALSE;
			_g_free0 (url);
			return result;
		}
		case MAP_ITEM_COMPONENT_RESIZER:
		{
			MindMap* _tmp13_;
			gboolean _tmp14_;
			gboolean _tmp15_;
			_tmp13_ = self->priv->_map;
			_tmp14_ = mind_map_get_editable (_tmp13_);
			_tmp15_ = _tmp14_;
			if (_tmp15_) {
				gboolean _tmp16_;
				gboolean _tmp17_;
				Style* _tmp18_;
				Style* _tmp19_;
				gint* _tmp20_;
				gint* _tmp21_;
				self->priv->_resize = TRUE;
				_tmp16_ = node_get_image_resizable (node);
				_tmp17_ = _tmp16_;
				self->priv->_orig_resizable = _tmp17_;
				_tmp18_ = node_get_style (node);
				_tmp19_ = _tmp18_;
				_tmp20_ = style_get_node_width (_tmp19_);
				_tmp21_ = _tmp20_;
				self->priv->_orig_width = *_tmp21_;
			}
			result = TRUE;
			_g_free0 (url);
			return result;
		}
		case MAP_ITEM_COMPONENT_TITLE:
		{
			gboolean _tmp22_ = FALSE;
			gboolean _tmp23_ = FALSE;
			if (!self->priv->_shift) {
				_tmp23_ = self->priv->_control;
			} else {
				_tmp23_ = FALSE;
			}
			if (_tmp23_) {
				CanvasText* _tmp24_;
				CanvasText* _tmp25_;
				FormatTag _tmp26_ = 0;
				gchar* _tmp27_ = NULL;
				gboolean _tmp28_;
				_tmp24_ = node_get_name (node);
				_tmp25_ = _tmp24_;
				_tmp28_ = canvas_text_is_within_clickable (_tmp25_, scaled_x, scaled_y, &_tmp26_, &_tmp27_);
				tag = _tmp26_;
				_g_free0 (url);
				url = _tmp27_;
				_tmp22_ = _tmp28_;
			} else {
				_tmp22_ = FALSE;
			}
			if (_tmp22_) {
				if (tag == FORMAT_TAG_URL) {
					const gchar* _tmp29_;
					_tmp29_ = url;
					utils_open_url (_tmp29_);
				}
				result = FALSE;
				_g_free0 (url);
				return result;
			}
			break;
		}
		case MAP_ITEM_COMPONENT_TAGS:
		{
			MindMap* _tmp30_;
			_tmp30_ = self->priv->_map;
			g_signal_emit_by_name (_tmp30_, "show-properties", "tag", PROPERTY_GRAB_FIRST);
			break;
		}
		default:
		break;
	}
	_tmp31_ = node_get_side (node);
	_tmp32_ = _tmp31_;
	self->priv->_orig_side = _tmp32_;
	_tmp33_ = self->priv->_orig_info;
	_tmp34_ = self->priv->_orig_info;
	_tmp36_ = vala_g_array_remove_range (_tmp33_, (guint) 0, _tmp34_->len, &_tmp35_);
	_tmp37_ = _tmp36_;
	_tmp37__length1 = _tmp35_;
	_tmp37_ = (_vala_array_free (_tmp37_, _tmp37__length1, (GDestroyNotify) node_info_free), NULL);
	node_get_node_info (node, &self->priv->_orig_info);
	_tmp38_ = node_get_mode (node);
	_tmp39_ = _tmp38_;
	if (_tmp39_ == NODE_MODE_EDITABLE) {
		switch (self->priv->_press_num) {
			case 1:
			{
				CanvasText* _tmp40_;
				CanvasText* _tmp41_;
				GtkIMContext* _tmp42_;
				_tmp40_ = node_get_name (node);
				_tmp41_ = _tmp40_;
				canvas_text_set_cursor_at_char (_tmp41_, scaled_x, scaled_y, self->priv->_shift);
				_tmp42_ = self->priv->_im_context;
				gtk_im_context_reset (_tmp42_);
				break;
			}
			case 2:
			{
				CanvasText* _tmp43_;
				CanvasText* _tmp44_;
				GtkIMContext* _tmp45_;
				_tmp43_ = node_get_name (node);
				_tmp44_ = _tmp43_;
				canvas_text_set_cursor_at_word (_tmp44_, scaled_x, scaled_y, self->priv->_shift);
				_tmp45_ = self->priv->_im_context;
				gtk_im_context_reset (_tmp45_);
				break;
			}
			case 3:
			{
				CanvasText* _tmp46_;
				CanvasText* _tmp47_;
				GtkIMContext* _tmp48_;
				_tmp46_ = node_get_name (node);
				_tmp47_ = _tmp46_;
				canvas_text_set_cursor_all (_tmp47_, FALSE);
				_tmp48_ = self->priv->_im_context;
				gtk_im_context_reset (_tmp48_);
				break;
			}
			default:
			break;
		}
		result = TRUE;
		_g_free0 (url);
		return result;
	} else {
		gboolean _tmp49_ = FALSE;
		gboolean _tmp50_ = FALSE;
		if (!self->priv->_control) {
			_tmp50_ = !self->priv->_shift;
		} else {
			_tmp50_ = FALSE;
		}
		if (_tmp50_) {
			_tmp49_ = self->priv->_press_num == 2;
		} else {
			_tmp49_ = FALSE;
		}
		if (_tmp49_) {
			MindMap* _tmp51_;
			gboolean _tmp52_;
			gboolean _tmp53_;
			_tmp51_ = self->priv->_map;
			_tmp52_ = mind_map_get_editable (_tmp51_);
			_tmp53_ = _tmp52_;
			if (_tmp53_) {
				if (component == MAP_ITEM_COMPONENT_IMAGE) {
					MindMap* _tmp54_;
					MapModel* _tmp55_;
					MapModel* _tmp56_;
					_tmp54_ = self->priv->_map;
					_tmp55_ = mind_map_get_model (_tmp54_);
					_tmp56_ = _tmp55_;
					map_model_edit_current_image (_tmp56_);
					result = FALSE;
					_g_free0 (url);
					return result;
				} else {
					MindMap* _tmp57_;
					MapModel* _tmp58_;
					MapModel* _tmp59_;
					_tmp57_ = self->priv->_map;
					_tmp58_ = mind_map_get_model (_tmp57_);
					_tmp59_ = _tmp58_;
					map_model_set_node_mode (_tmp59_, node, NODE_MODE_EDITABLE, TRUE);
				}
			}
			result = TRUE;
			_g_free0 (url);
			return result;
		} else {
			Node* _tmp105_;
			Node* _tmp106_;
			if (self->priv->_shift) {
				if (self->priv->_control) {
					if (tpress) {
						MindMap* _tmp60_;
						Selection* _tmp61_;
						Selection* _tmp62_;
						_tmp60_ = self->priv->_map;
						_tmp61_ = mind_map_get_selected (_tmp60_);
						_tmp62_ = _tmp61_;
						if (!selection_remove_nodes_at_level (_tmp62_, node, 1.0)) {
							MindMap* _tmp63_;
							Selection* _tmp64_;
							Selection* _tmp65_;
							_tmp63_ = self->priv->_map;
							_tmp64_ = mind_map_get_selected (_tmp63_);
							_tmp65_ = _tmp64_;
							selection_add_nodes_at_level (_tmp65_, node, TRUE);
						}
					} else {
						if (dpress) {
							MindMap* _tmp66_;
							Selection* _tmp67_;
							Selection* _tmp68_;
							_tmp66_ = self->priv->_map;
							_tmp67_ = mind_map_get_selected (_tmp66_);
							_tmp68_ = _tmp67_;
							if (!selection_remove_node_tree (_tmp68_, node, 1.0)) {
								MindMap* _tmp69_;
								Selection* _tmp70_;
								Selection* _tmp71_;
								_tmp69_ = self->priv->_map;
								_tmp70_ = mind_map_get_selected (_tmp69_);
								_tmp71_ = _tmp70_;
								selection_add_node_tree (_tmp71_, node, TRUE);
							}
						} else {
							MindMap* _tmp72_;
							Selection* _tmp73_;
							Selection* _tmp74_;
							_tmp72_ = self->priv->_map;
							_tmp73_ = mind_map_get_selected (_tmp72_);
							_tmp74_ = _tmp73_;
							if (!selection_remove_child_nodes (_tmp74_, node, 1.0)) {
								MindMap* _tmp75_;
								Selection* _tmp76_;
								Selection* _tmp77_;
								_tmp75_ = self->priv->_map;
								_tmp76_ = mind_map_get_selected (_tmp75_);
								_tmp77_ = _tmp76_;
								selection_add_child_nodes (_tmp77_, node, TRUE);
							}
						}
					}
				} else {
					MindMap* _tmp78_;
					Selection* _tmp79_;
					Selection* _tmp80_;
					_tmp78_ = self->priv->_map;
					_tmp79_ = mind_map_get_selected (_tmp78_);
					_tmp80_ = _tmp79_;
					if (!selection_remove_node (_tmp80_, node, 1.0, TRUE)) {
						MindMap* _tmp81_;
						Selection* _tmp82_;
						Selection* _tmp83_;
						_tmp81_ = self->priv->_map;
						_tmp82_ = mind_map_get_selected (_tmp81_);
						_tmp83_ = _tmp82_;
						selection_add_node (_tmp83_, node, FALSE, TRUE);
					}
				}
			} else {
				if (self->priv->_control) {
					MindMap* _tmp84_;
					Selection* _tmp85_;
					Selection* _tmp86_;
					_tmp84_ = self->priv->_map;
					_tmp85_ = mind_map_get_selected (_tmp84_);
					_tmp86_ = _tmp85_;
					selection_clear_nodes (_tmp86_, TRUE, 1.0);
					if (tpress) {
						MindMap* _tmp87_;
						Selection* _tmp88_;
						Selection* _tmp89_;
						_tmp87_ = self->priv->_map;
						_tmp88_ = mind_map_get_selected (_tmp87_);
						_tmp89_ = _tmp88_;
						selection_add_nodes_at_level (_tmp89_, node, TRUE);
					} else {
						if (dpress) {
							MindMap* _tmp90_;
							Selection* _tmp91_;
							Selection* _tmp92_;
							_tmp90_ = self->priv->_map;
							_tmp91_ = mind_map_get_selected (_tmp90_);
							_tmp92_ = _tmp91_;
							selection_add_node_tree (_tmp92_, node, TRUE);
						} else {
							MindMap* _tmp93_;
							Selection* _tmp94_;
							Selection* _tmp95_;
							_tmp93_ = self->priv->_map;
							_tmp94_ = mind_map_get_selected (_tmp93_);
							_tmp95_ = _tmp94_;
							selection_add_child_nodes (_tmp95_, node, TRUE);
						}
					}
				} else {
					NodeMode _tmp96_;
					NodeMode _tmp97_;
					_tmp96_ = node_get_mode (node);
					_tmp97_ = _tmp96_;
					if (_tmp97_ != NODE_MODE_SELECTED) {
						MindMap* _tmp98_;
						Selection* _tmp99_;
						Selection* _tmp100_;
						Node* _tmp101_;
						Node* _tmp102_;
						_tmp98_ = self->priv->_map;
						_tmp99_ = mind_map_get_selected (_tmp98_);
						_tmp100_ = _tmp99_;
						selection_set_current_node (_tmp100_, node, 1.0);
						_tmp101_ = node_get_parent (node);
						_tmp102_ = _tmp101_;
						if (_tmp102_ != NULL) {
							Node* _tmp103_;
							Node* _tmp104_;
							_tmp103_ = node_get_parent (node);
							_tmp104_ = _tmp103_;
							node_set_summary_extents (_tmp104_);
						}
					}
				}
			}
			_tmp105_ = node_get_parent (node);
			_tmp106_ = _tmp105_;
			if (_tmp106_ != NULL) {
				Node* _tmp107_;
				Node* _tmp108_;
				_tmp107_ = node_get_parent (node);
				_tmp108_ = _tmp107_;
				node_set_last_selected_child (_tmp108_, node);
			}
			if (node_is_summarized (node)) {
				SummaryNode* _tmp109_;
				SummaryNode* _tmp110_;
				_tmp109_ = node_summary_node (node);
				_tmp110_ = _tmp109_;
				summary_node_set_last_selected_node (_tmp110_, node);
				_g_object_unref0 (_tmp110_);
			}
			result = TRUE;
			_g_free0 (url);
			return result;
		}
	}
}

gboolean
draw_area_set_current_sticker_from_position (DrawArea* self,
                                             Sticker* sticker,
                                             gdouble scaled_x,
                                             gdouble scaled_y)
{
	StickerMode _tmp0_;
	StickerMode _tmp1_;
	gdouble _tmp8_;
	gdouble _tmp9_;
	gdouble _tmp10_;
	gdouble _tmp11_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (sticker != NULL, FALSE);
	_tmp0_ = sticker_get_mode (sticker);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == STICKER_MODE_SELECTED) {
		if (sticker_is_within_resizer (sticker, scaled_x, scaled_y)) {
			MindMap* _tmp2_;
			gboolean _tmp3_;
			gboolean _tmp4_;
			_tmp2_ = self->priv->_map;
			_tmp3_ = mind_map_get_editable (_tmp2_);
			_tmp4_ = _tmp3_;
			if (_tmp4_) {
				gdouble _tmp5_;
				gdouble _tmp6_;
				self->priv->_resize = TRUE;
				_tmp5_ = sticker_get_width (sticker);
				_tmp6_ = _tmp5_;
				self->priv->_orig_width = (gint) _tmp6_;
			}
			result = TRUE;
			return result;
		}
	} else {
		MindMap* _tmp7_;
		_tmp7_ = self->priv->_map;
		mind_map_set_current_sticker (_tmp7_, sticker);
	}
	_tmp8_ = sticker_get_posx (sticker);
	_tmp9_ = _tmp8_;
	self->priv->_sticker_posx = _tmp9_;
	_tmp10_ = sticker_get_posy (sticker);
	_tmp11_ = _tmp10_;
	self->priv->_sticker_posy = _tmp11_;
	result = TRUE;
	return result;
}

gboolean
draw_area_set_current_group_from_position (DrawArea* self,
                                           NodeGroup* group,
                                           gdouble scaled_x,
                                           gdouble scaled_y)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (group != NULL, FALSE);
	if (self->priv->_shift) {
		MindMap* _tmp0_;
		Selection* _tmp1_;
		Selection* _tmp2_;
		_tmp0_ = self->priv->_map;
		_tmp1_ = mind_map_get_selected (_tmp0_);
		_tmp2_ = _tmp1_;
		selection_add_group (_tmp2_, group);
	} else {
		MindMap* _tmp3_;
		_tmp3_ = self->priv->_map;
		mind_map_set_current_group (_tmp3_, group);
	}
	result = TRUE;
	return result;
}

gboolean
draw_area_set_current_callout_from_position (DrawArea* self,
                                             Callout* callout,
                                             MapItemComponent component,
                                             gdouble scaled_x,
                                             gdouble scaled_y)
{
	FormatTag tag = 0;
	gchar* url = NULL;
	gchar* _tmp0_;
	CalloutMode _tmp14_;
	CalloutMode _tmp15_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (callout != NULL, FALSE);
	tag = FORMAT_TAG_LENGTH;
	_tmp0_ = g_strdup ("");
	url = _tmp0_;
	switch (component) {
		case MAP_ITEM_COMPONENT_RESIZER:
		{
			MindMap* _tmp1_;
			gboolean _tmp2_;
			gboolean _tmp3_;
			_tmp1_ = self->priv->_map;
			_tmp2_ = mind_map_get_editable (_tmp1_);
			_tmp3_ = _tmp2_;
			if (_tmp3_) {
				gdouble _tmp4_;
				gdouble _tmp5_;
				self->priv->_resize = TRUE;
				_tmp4_ = callout_get_total_width (callout);
				_tmp5_ = _tmp4_;
				self->priv->_orig_width = (gint) _tmp5_;
			}
			result = TRUE;
			_g_free0 (url);
			return result;
		}
		case MAP_ITEM_COMPONENT_TITLE:
		{
			gboolean _tmp6_ = FALSE;
			gboolean _tmp7_ = FALSE;
			if (!self->priv->_shift) {
				_tmp7_ = self->priv->_control;
			} else {
				_tmp7_ = FALSE;
			}
			if (_tmp7_) {
				CanvasText* _tmp8_;
				CanvasText* _tmp9_;
				FormatTag _tmp10_ = 0;
				gchar* _tmp11_ = NULL;
				gboolean _tmp12_;
				_tmp8_ = callout_get_text (callout);
				_tmp9_ = _tmp8_;
				_tmp12_ = canvas_text_is_within_clickable (_tmp9_, scaled_x, scaled_y, &_tmp10_, &_tmp11_);
				tag = _tmp10_;
				_g_free0 (url);
				url = _tmp11_;
				_tmp6_ = _tmp12_;
			} else {
				_tmp6_ = FALSE;
			}
			if (_tmp6_) {
				if (tag == FORMAT_TAG_URL) {
					const gchar* _tmp13_;
					_tmp13_ = url;
					utils_open_url (_tmp13_);
				}
				result = FALSE;
				_g_free0 (url);
				return result;
			}
			break;
		}
		default:
		break;
	}
	_tmp14_ = callout_get_mode (callout);
	_tmp15_ = _tmp14_;
	if (_tmp15_ == CALLOUT_MODE_EDITABLE) {
		switch (self->priv->_press_num) {
			case 1:
			{
				CanvasText* _tmp16_;
				CanvasText* _tmp17_;
				GtkIMContext* _tmp18_;
				_tmp16_ = callout_get_text (callout);
				_tmp17_ = _tmp16_;
				canvas_text_set_cursor_at_char (_tmp17_, scaled_x, scaled_y, self->priv->_shift);
				_tmp18_ = self->priv->_im_context;
				gtk_im_context_reset (_tmp18_);
				break;
			}
			case 2:
			{
				CanvasText* _tmp19_;
				CanvasText* _tmp20_;
				GtkIMContext* _tmp21_;
				_tmp19_ = callout_get_text (callout);
				_tmp20_ = _tmp19_;
				canvas_text_set_cursor_at_word (_tmp20_, scaled_x, scaled_y, self->priv->_shift);
				_tmp21_ = self->priv->_im_context;
				gtk_im_context_reset (_tmp21_);
				break;
			}
			case 3:
			{
				CanvasText* _tmp22_;
				CanvasText* _tmp23_;
				GtkIMContext* _tmp24_;
				_tmp22_ = callout_get_text (callout);
				_tmp23_ = _tmp22_;
				canvas_text_set_cursor_all (_tmp23_, FALSE);
				_tmp24_ = self->priv->_im_context;
				gtk_im_context_reset (_tmp24_);
				break;
			}
			default:
			break;
		}
		result = TRUE;
		_g_free0 (url);
		return result;
	} else {
		gboolean _tmp25_ = FALSE;
		if (self->priv->_press_num == 2) {
			MindMap* _tmp26_;
			gboolean _tmp27_;
			gboolean _tmp28_;
			_tmp26_ = self->priv->_map;
			_tmp27_ = mind_map_get_editable (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp25_ = _tmp28_;
		} else {
			_tmp25_ = FALSE;
		}
		if (_tmp25_) {
			MindMap* _tmp29_;
			MapModel* _tmp30_;
			MapModel* _tmp31_;
			_tmp29_ = self->priv->_map;
			_tmp30_ = mind_map_get_model (_tmp29_);
			_tmp31_ = _tmp30_;
			map_model_set_callout_mode (_tmp31_, callout, CALLOUT_MODE_EDITABLE, TRUE);
			result = TRUE;
			_g_free0 (url);
			return result;
		} else {
			MindMap* _tmp32_;
			_tmp32_ = self->priv->_map;
			mind_map_set_current_callout (_tmp32_, callout);
		}
	}
	result = TRUE;
	_g_free0 (url);
	return result;
}

static void
draw_area_handle_right_click (DrawArea* self,
                              gdouble x,
                              gdouble y)
{
	gboolean _tmp0_ = FALSE;
	MindMap* _tmp1_;
	MapModel* _tmp2_;
	MapModel* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_model (_tmp1_);
	_tmp3_ = _tmp2_;
	if (map_model_select_connection_if_unselected (_tmp3_, x, y)) {
		_tmp0_ = TRUE;
	} else {
		MindMap* _tmp4_;
		MapModel* _tmp5_;
		MapModel* _tmp6_;
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_model (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp0_ = map_model_select_node_if_unselected (_tmp6_, x, y);
	}
	if (_tmp0_) {
	}
}

static gboolean
draw_area_set_current_at_position (DrawArea* self,
                                   gdouble scaled_x,
                                   gdouble scaled_y)
{
	gboolean _tmp0_ = FALSE;
	MapItemComponent component = 0;
	Connection* match_conn = NULL;
	MindMap* _tmp1_;
	MapModel* _tmp2_;
	MapModel* _tmp3_;
	MapItemComponent _tmp4_ = 0;
	Connection* _tmp5_;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_ = FALSE;
	Connection* _tmp8_;
	Connection* current_conn = NULL;
	MindMap* _tmp23_;
	Selection* _tmp24_;
	Selection* _tmp25_;
	Connection* _tmp26_;
	gboolean _tmp27_ = FALSE;
	gboolean _tmp28_ = FALSE;
	MindMap* _tmp29_;
	MapModel* _tmp30_;
	MapModel* _tmp31_;
	Node* _tmp32_;
	Node* _tmp33_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (self->priv->_press_middle) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = self->priv->_alt;
	}
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_model (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp5_ = map_model_get_connection_at_position (_tmp3_, scaled_x, scaled_y, &_tmp4_);
	component = _tmp4_;
	match_conn = _tmp5_;
	_tmp8_ = match_conn;
	if (_tmp8_ != NULL) {
		_tmp7_ = map_item_component_is_connection_handle (component);
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		Connection* _tmp9_;
		ConnMode _tmp10_;
		ConnMode _tmp11_;
		_tmp9_ = match_conn;
		_tmp10_ = connection_get_mode (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp6_ = _tmp11_ == CONN_MODE_SELECTED;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		MindMap* _tmp12_;
		gboolean _tmp13_;
		gboolean _tmp14_;
		_tmp12_ = self->priv->_map;
		_tmp13_ = mind_map_get_editable (_tmp12_);
		_tmp14_ = _tmp13_;
		if (_tmp14_) {
			if (component == MAP_ITEM_COMPONENT_DRAG_HANDLE) {
				MindMap* _tmp15_;
				MapModel* _tmp16_;
				MapModel* _tmp17_;
				Connection* _tmp18_;
				_tmp15_ = self->priv->_map;
				_tmp16_ = mind_map_get_model (_tmp15_);
				_tmp17_ = _tmp16_;
				_tmp18_ = match_conn;
				map_model_set_connection_mode (_tmp17_, _tmp18_, CONN_MODE_ADJUSTING, TRUE);
			} else {
				MindMap* _tmp19_;
				Connection* _tmp20_;
				Connection* _tmp21_;
				Connection* _tmp22_;
				_tmp19_ = self->priv->_map;
				_tmp20_ = match_conn;
				_tmp21_ = connection_new_from_connection (_tmp19_, _tmp20_);
				_g_object_unref0 (self->priv->_last_connection);
				self->priv->_last_connection = _tmp21_;
				_tmp22_ = match_conn;
				connection_disconnect_from_node (_tmp22_, component == MAP_ITEM_COMPONENT_FROM_HANDLE);
			}
		}
		result = TRUE;
		_g_object_unref0 (match_conn);
		return result;
	}
	_tmp23_ = self->priv->_map;
	_tmp24_ = mind_map_get_selected (_tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = selection_current_connection (_tmp25_);
	current_conn = _tmp26_;
	_tmp29_ = self->priv->_map;
	_tmp30_ = mind_map_get_model (_tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = map_model_get_attach_node (_tmp31_);
	_tmp33_ = _tmp32_;
	if (_tmp33_ == NULL) {
		_tmp28_ = TRUE;
	} else {
		Connection* _tmp34_;
		_tmp34_ = current_conn;
		_tmp28_ = _tmp34_ == NULL;
	}
	if (_tmp28_) {
		_tmp27_ = TRUE;
	} else {
		Connection* _tmp35_;
		ConnMode _tmp36_;
		ConnMode _tmp37_;
		_tmp35_ = current_conn;
		_tmp36_ = connection_get_mode (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp27_ = !conn_mode_is_connecting (_tmp37_);
	}
	if (_tmp27_) {
		Node* match_node = NULL;
		MindMap* _tmp38_;
		MapModel* _tmp39_;
		MapModel* _tmp40_;
		MapItemComponent _tmp41_ = 0;
		Node* _tmp42_;
		gboolean _tmp43_ = FALSE;
		gboolean _tmp44_ = FALSE;
		Connection* _tmp45_;
		Node* _tmp58_;
		Callout* match_callout = NULL;
		MindMap* _tmp60_;
		MapModel* _tmp61_;
		MapModel* _tmp62_;
		MapItemComponent _tmp63_ = 0;
		Callout* _tmp64_;
		Callout* _tmp65_;
		Sticker* match_sticker = NULL;
		MindMap* _tmp67_;
		MapModel* _tmp68_;
		MapModel* _tmp69_;
		Sticker* _tmp70_;
		Sticker* _tmp71_;
		NodeGroup* match_group = NULL;
		MindMap* _tmp73_;
		MapModel* _tmp74_;
		MapModel* _tmp75_;
		NodeGroup* _tmp76_;
		NodeGroup* _tmp77_;
		MindMap* _tmp79_;
		MapModel* _tmp80_;
		MapModel* _tmp81_;
		Node* _tmp82_;
		Node* _tmp83_;
		_tmp38_ = self->priv->_map;
		_tmp39_ = mind_map_get_model (_tmp38_);
		_tmp40_ = _tmp39_;
		_tmp42_ = map_model_get_node_at_position (_tmp40_, scaled_x, scaled_y, &_tmp41_);
		component = _tmp41_;
		match_node = _tmp42_;
		_tmp45_ = match_conn;
		if (_tmp45_ != NULL) {
			_tmp44_ = component != MAP_ITEM_COMPONENT_DRAG_HANDLE;
		} else {
			_tmp44_ = FALSE;
		}
		if (_tmp44_) {
			gboolean _tmp46_ = FALSE;
			Node* _tmp47_;
			_tmp47_ = match_node;
			if (_tmp47_ == NULL) {
				_tmp46_ = TRUE;
			} else {
				gboolean _tmp48_ = FALSE;
				Node* _tmp49_;
				Connection* _tmp50_;
				Node* _tmp51_;
				Node* _tmp52_;
				_tmp49_ = match_node;
				_tmp50_ = match_conn;
				_tmp51_ = connection_get_from_node (_tmp50_);
				_tmp52_ = _tmp51_;
				if (_tmp49_ != _tmp52_) {
					Node* _tmp53_;
					Connection* _tmp54_;
					Node* _tmp55_;
					Node* _tmp56_;
					_tmp53_ = match_node;
					_tmp54_ = match_conn;
					_tmp55_ = connection_get_to_node (_tmp54_);
					_tmp56_ = _tmp55_;
					_tmp48_ = _tmp53_ != _tmp56_;
				} else {
					_tmp48_ = FALSE;
				}
				_tmp46_ = _tmp48_;
			}
			_tmp43_ = _tmp46_;
		} else {
			_tmp43_ = FALSE;
		}
		if (_tmp43_) {
			Connection* _tmp57_;
			draw_area_clear_current_node (self, FALSE);
			draw_area_clear_current_sticker (self, FALSE);
			draw_area_clear_current_group (self, FALSE);
			draw_area_clear_current_callout (self, FALSE);
			_tmp57_ = match_conn;
			result = draw_area_set_current_connection_from_position (self, _tmp57_, component, scaled_x, scaled_y);
			_g_object_unref0 (match_node);
			_g_object_unref0 (current_conn);
			_g_object_unref0 (match_conn);
			return result;
		}
		_tmp58_ = match_node;
		if (_tmp58_ != NULL) {
			Node* _tmp59_;
			draw_area_clear_current_connection (self, FALSE);
			draw_area_clear_current_sticker (self, FALSE);
			draw_area_clear_current_group (self, FALSE);
			draw_area_clear_current_callout (self, FALSE);
			_tmp59_ = match_node;
			result = draw_area_set_current_node_from_position (self, _tmp59_, component, scaled_x, scaled_y);
			_g_object_unref0 (match_node);
			_g_object_unref0 (current_conn);
			_g_object_unref0 (match_conn);
			return result;
		}
		_tmp60_ = self->priv->_map;
		_tmp61_ = mind_map_get_model (_tmp60_);
		_tmp62_ = _tmp61_;
		_tmp64_ = map_model_get_callout_at_position (_tmp62_, scaled_x, scaled_y, &_tmp63_);
		component = _tmp63_;
		match_callout = _tmp64_;
		_tmp65_ = match_callout;
		if (_tmp65_ != NULL) {
			Callout* _tmp66_;
			draw_area_clear_current_node (self, FALSE);
			draw_area_clear_current_connection (self, FALSE);
			draw_area_clear_current_sticker (self, FALSE);
			draw_area_clear_current_group (self, FALSE);
			_tmp66_ = match_callout;
			result = draw_area_set_current_callout_from_position (self, _tmp66_, component, scaled_x, scaled_y);
			_g_object_unref0 (match_callout);
			_g_object_unref0 (match_node);
			_g_object_unref0 (current_conn);
			_g_object_unref0 (match_conn);
			return result;
		}
		_tmp67_ = self->priv->_map;
		_tmp68_ = mind_map_get_model (_tmp67_);
		_tmp69_ = _tmp68_;
		_tmp70_ = map_model_get_sticker_at_position (_tmp69_, scaled_x, scaled_y);
		match_sticker = _tmp70_;
		_tmp71_ = match_sticker;
		if (_tmp71_ != NULL) {
			Sticker* _tmp72_;
			draw_area_clear_current_node (self, FALSE);
			draw_area_clear_current_connection (self, FALSE);
			draw_area_clear_current_group (self, FALSE);
			draw_area_clear_current_callout (self, FALSE);
			_tmp72_ = match_sticker;
			result = draw_area_set_current_sticker_from_position (self, _tmp72_, scaled_x, scaled_y);
			_g_object_unref0 (match_sticker);
			_g_object_unref0 (match_callout);
			_g_object_unref0 (match_node);
			_g_object_unref0 (current_conn);
			_g_object_unref0 (match_conn);
			return result;
		}
		_tmp73_ = self->priv->_map;
		_tmp74_ = mind_map_get_model (_tmp73_);
		_tmp75_ = _tmp74_;
		_tmp76_ = map_model_get_group_at_position (_tmp75_, scaled_x, scaled_y);
		match_group = _tmp76_;
		_tmp77_ = match_group;
		if (_tmp77_ != NULL) {
			NodeGroup* _tmp78_;
			draw_area_clear_current_node (self, FALSE);
			draw_area_clear_current_connection (self, FALSE);
			draw_area_clear_current_sticker (self, FALSE);
			draw_area_clear_current_callout (self, FALSE);
			_tmp78_ = match_group;
			result = draw_area_set_current_group_from_position (self, _tmp78_, scaled_x, scaled_y);
			_g_object_unref0 (match_group);
			_g_object_unref0 (match_sticker);
			_g_object_unref0 (match_callout);
			_g_object_unref0 (match_node);
			_g_object_unref0 (current_conn);
			_g_object_unref0 (match_conn);
			return result;
		}
		self->priv->_select_box.x = scaled_x;
		self->priv->_select_box.y = scaled_y;
		self->priv->_select_box.valid = TRUE;
		if (!self->priv->_shift) {
			draw_area_clear_current_node (self, TRUE);
		}
		draw_area_clear_current_connection (self, TRUE);
		draw_area_clear_current_sticker (self, TRUE);
		draw_area_clear_current_group (self, TRUE);
		draw_area_clear_current_callout (self, TRUE);
		_tmp79_ = self->priv->_map;
		_tmp80_ = mind_map_get_model (_tmp79_);
		_tmp81_ = _tmp80_;
		_tmp82_ = map_model_get_last_node (_tmp81_);
		_tmp83_ = _tmp82_;
		if (_tmp83_ != NULL) {
			MindMap* _tmp84_;
			Selection* _tmp85_;
			Selection* _tmp86_;
			MindMap* _tmp87_;
			MapModel* _tmp88_;
			MapModel* _tmp89_;
			Node* _tmp90_;
			Node* _tmp91_;
			_tmp84_ = self->priv->_map;
			_tmp85_ = mind_map_get_selected (_tmp84_);
			_tmp86_ = _tmp85_;
			_tmp87_ = self->priv->_map;
			_tmp88_ = mind_map_get_model (_tmp87_);
			_tmp89_ = _tmp88_;
			_tmp90_ = map_model_get_last_node (_tmp89_);
			_tmp91_ = _tmp90_;
			selection_set_current_node (_tmp86_, _tmp91_, 1.0);
		}
		_g_object_unref0 (match_group);
		_g_object_unref0 (match_sticker);
		_g_object_unref0 (match_callout);
		_g_object_unref0 (match_node);
	}
	result = TRUE;
	_g_object_unref0 (current_conn);
	_g_object_unref0 (match_conn);
	return result;
}

gdouble*
draw_area_get_scale_marks (gint* result_length1)
{
	gdouble* marks = NULL;
	gdouble* _tmp0_;
	gint marks_length1;
	gint _marks_size_;
	gdouble* _tmp1_;
	gint _tmp1__length1;
	gdouble* result;
	_tmp0_ = g_new0 (gdouble, 11);
	_tmp0_[0] = (gdouble) 10;
	_tmp0_[1] = (gdouble) 25;
	_tmp0_[2] = (gdouble) 50;
	_tmp0_[3] = (gdouble) 75;
	_tmp0_[4] = (gdouble) 100;
	_tmp0_[5] = (gdouble) 150;
	_tmp0_[6] = (gdouble) 200;
	_tmp0_[7] = (gdouble) 250;
	_tmp0_[8] = (gdouble) 300;
	_tmp0_[9] = (gdouble) 350;
	_tmp0_[10] = (gdouble) 400;
	marks = _tmp0_;
	marks_length1 = 11;
	_marks_size_ = marks_length1;
	_tmp1_ = marks;
	_tmp1__length1 = marks_length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

static gdouble
draw_area_scale_value (DrawArea* self,
                       gdouble val)
{
	gdouble _tmp0_;
	gdouble _tmp1_;
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	_tmp0_ = draw_area_get_sfactor (self);
	_tmp1_ = _tmp0_;
	result = val / _tmp1_;
	return result;
}

gboolean
draw_area_set_scaling_factor (DrawArea* self,
                              gdouble sf)
{
	gdouble _tmp0_;
	gdouble _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = draw_area_get_sfactor (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != sf) {
		gint width = 0;
		gint height = 0;
		gdouble diff_x = 0.0;
		gdouble _tmp2_;
		gdouble _tmp3_;
		gdouble diff_y = 0.0;
		gdouble _tmp4_;
		gdouble _tmp5_;
		width = gtk_widget_get_allocated_width ((GtkWidget*) self) / 2;
		height = gtk_widget_get_allocated_height ((GtkWidget*) self) / 2;
		_tmp2_ = draw_area_get_sfactor (self);
		_tmp3_ = _tmp2_;
		diff_x = (width / sf) - (width / _tmp3_);
		_tmp4_ = draw_area_get_sfactor (self);
		_tmp5_ = _tmp4_;
		diff_y = (height / sf) - (height / _tmp5_);
		if (draw_area_move_origin (self, diff_x, diff_y, &sf)) {
			gdouble _tmp6_;
			gdouble _tmp7_;
			draw_area_set_sfactor (self, sf);
			_tmp6_ = draw_area_get_sfactor (self);
			_tmp7_ = _tmp6_;
			g_signal_emit (self, draw_area_signals[DRAW_AREA_SCALE_CHANGED_SIGNAL], 0, _tmp7_);
			result = TRUE;
			return result;
		}
	}
	result = FALSE;
	return result;
}

gboolean
draw_area_set_scaling_factor_coord (DrawArea* self,
                                    gdouble sf,
                                    gdouble coord_x,
                                    gdouble coord_y)
{
	gdouble _tmp0_;
	gdouble _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = draw_area_get_sfactor (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != sf) {
		gdouble diff_x = 0.0;
		gdouble _tmp2_;
		gdouble _tmp3_;
		gdouble diff_y = 0.0;
		gdouble _tmp4_;
		gdouble _tmp5_;
		_tmp2_ = draw_area_get_sfactor (self);
		_tmp3_ = _tmp2_;
		diff_x = (coord_x / sf) - (coord_x / _tmp3_);
		_tmp4_ = draw_area_get_sfactor (self);
		_tmp5_ = _tmp4_;
		diff_y = (coord_y / sf) - (coord_y / _tmp5_);
		if (draw_area_move_origin (self, diff_x, diff_y, &sf)) {
			gdouble _tmp6_;
			gdouble _tmp7_;
			draw_area_set_sfactor (self, sf);
			_tmp6_ = draw_area_get_sfactor (self);
			_tmp7_ = _tmp6_;
			g_signal_emit (self, draw_area_signals[DRAW_AREA_SCALE_CHANGED_SIGNAL], 0, _tmp7_);
			result = TRUE;
			return result;
		}
	}
	result = FALSE;
	return result;
}

static gdouble
draw_area_get_scaling_factor (DrawArea* self,
                              gdouble width,
                              gdouble height)
{
	gdouble w = 0.0;
	gdouble h = 0.0;
	gdouble _tmp0_ = 0.0;
	gdouble sf = 0.0;
	gdouble _tmp1_ = 0.0;
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	w = gtk_widget_get_allocated_width ((GtkWidget*) self) / width;
	h = gtk_widget_get_allocated_height ((GtkWidget*) self) / height;
	if (w < h) {
		_tmp0_ = w;
	} else {
		_tmp0_ = h;
	}
	sf = _tmp0_;
	if (sf > ((gdouble) 4)) {
		_tmp1_ = (gdouble) 4;
	} else {
		_tmp1_ = sf;
	}
	result = _tmp1_;
	return result;
}

gboolean
draw_area_zoom_in (DrawArea* self)
{
	gint s_x = 0;
	gint s_y = 0;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	s_x = gtk_widget_get_allocated_width ((GtkWidget*) self) / 2;
	s_y = gtk_widget_get_allocated_height ((GtkWidget*) self) / 2;
	result = draw_area_zoom_in_coords (self, (gdouble) s_x, (gdouble) s_y);
	return result;
}

gboolean
draw_area_zoom_in_coords (DrawArea* self,
                          gdouble zoom_x,
                          gdouble zoom_y)
{
	gdouble value = 0.0;
	gdouble _tmp0_;
	gdouble _tmp1_;
	gdouble* marks = NULL;
	gint _tmp2_ = 0;
	gdouble* _tmp3_;
	gint marks_length1;
	gint _marks_size_;
	gdouble last = 0.0;
	gdouble* _tmp4_;
	gint _tmp4__length1;
	gdouble _tmp5_;
	gdouble* _tmp6_;
	gint _tmp6__length1;
	gdouble _tmp7_;
	gdouble* _tmp10_;
	gint _tmp10__length1;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = draw_area_get_sfactor (self);
	_tmp1_ = _tmp0_;
	value = _tmp1_ * 100;
	_tmp3_ = draw_area_get_scale_marks (&_tmp2_);
	marks = _tmp3_;
	marks_length1 = _tmp2_;
	_marks_size_ = marks_length1;
	_tmp4_ = marks;
	_tmp4__length1 = marks_length1;
	_tmp5_ = _tmp4_[0];
	last = _tmp5_;
	_tmp6_ = marks;
	_tmp6__length1 = marks_length1;
	_tmp7_ = _tmp6_[0];
	if (value < _tmp7_) {
		gdouble* _tmp8_;
		gint _tmp8__length1;
		gdouble _tmp9_;
		_tmp8_ = marks;
		_tmp8__length1 = marks_length1;
		_tmp9_ = _tmp8_[0];
		value = _tmp9_;
	}
	_tmp10_ = marks;
	_tmp10__length1 = marks_length1;
	{
		gdouble* mark_collection = NULL;
		gint mark_collection_length1 = 0;
		gint _mark_collection_size_ = 0;
		gint mark_it = 0;
		mark_collection = _tmp10_;
		mark_collection_length1 = _tmp10__length1;
		for (mark_it = 0; mark_it < mark_collection_length1; mark_it = mark_it + 1) {
			gdouble mark = 0.0;
			mark = mark_collection[mark_it];
			{
				Animator* _tmp11_;
				if (mark <= value) {
					continue;
				}
				_tmp11_ = self->priv->_animator;
				animator_add_scale_in_place (_tmp11_, "zoom in place", zoom_x, zoom_y);
				if (draw_area_set_scaling_factor_coord (self, mark / 100, zoom_x, zoom_y)) {
					Animator* _tmp12_;
					_tmp12_ = self->priv->_animator;
					animator_animate (_tmp12_);
				} else {
					Animator* _tmp13_;
					_tmp13_ = self->priv->_animator;
					animator_cancel_last_add (_tmp13_);
				}
				result = TRUE;
				marks = (g_free (marks), NULL);
				return result;
			}
		}
	}
	result = FALSE;
	marks = (g_free (marks), NULL);
	return result;
}

gboolean
draw_area_zoom_out (DrawArea* self)
{
	gint s_x = 0;
	gint s_y = 0;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	s_x = gtk_widget_get_allocated_width ((GtkWidget*) self) / 2;
	s_y = gtk_widget_get_allocated_height ((GtkWidget*) self) / 2;
	result = draw_area_zoom_out_coords (self, (gdouble) s_x, (gdouble) s_y);
	return result;
}

gboolean
draw_area_zoom_out_coords (DrawArea* self,
                           gdouble zoom_x,
                           gdouble zoom_y)
{
	gdouble value = 0.0;
	gdouble _tmp0_;
	gdouble _tmp1_;
	gdouble* marks = NULL;
	gint _tmp2_ = 0;
	gdouble* _tmp3_;
	gint marks_length1;
	gint _marks_size_;
	gdouble last = 0.0;
	gdouble* _tmp4_;
	gint _tmp4__length1;
	gdouble _tmp5_;
	gdouble* _tmp6_;
	gint _tmp6__length1;
	gdouble* _tmp7_;
	gint _tmp7__length1;
	gdouble _tmp8_;
	gdouble* _tmp12_;
	gint _tmp12__length1;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = draw_area_get_sfactor (self);
	_tmp1_ = _tmp0_;
	value = _tmp1_ * 100;
	_tmp3_ = draw_area_get_scale_marks (&_tmp2_);
	marks = _tmp3_;
	marks_length1 = _tmp2_;
	_marks_size_ = marks_length1;
	_tmp4_ = marks;
	_tmp4__length1 = marks_length1;
	_tmp5_ = _tmp4_[0];
	last = _tmp5_;
	_tmp6_ = marks;
	_tmp6__length1 = marks_length1;
	_tmp7_ = marks;
	_tmp7__length1 = marks_length1;
	_tmp8_ = _tmp6_[_tmp7__length1 - 1];
	if (value > _tmp8_) {
		gdouble* _tmp9_;
		gint _tmp9__length1;
		gdouble* _tmp10_;
		gint _tmp10__length1;
		gdouble _tmp11_;
		_tmp9_ = marks;
		_tmp9__length1 = marks_length1;
		_tmp10_ = marks;
		_tmp10__length1 = marks_length1;
		_tmp11_ = _tmp9_[_tmp10__length1 - 1];
		value = _tmp11_;
	}
	_tmp12_ = marks;
	_tmp12__length1 = marks_length1;
	{
		gdouble* mark_collection = NULL;
		gint mark_collection_length1 = 0;
		gint _mark_collection_size_ = 0;
		gint mark_it = 0;
		mark_collection = _tmp12_;
		mark_collection_length1 = _tmp12__length1;
		for (mark_it = 0; mark_it < mark_collection_length1; mark_it = mark_it + 1) {
			gdouble mark = 0.0;
			mark = mark_collection[mark_it];
			{
				Animator* _tmp13_;
				if (value > mark) {
					last = mark;
					continue;
				}
				_tmp13_ = self->priv->_animator;
				animator_add_scale_in_place (_tmp13_, "zoom out in place", zoom_x, zoom_y);
				if (draw_area_set_scaling_factor_coord (self, last / 100, zoom_x, zoom_y)) {
					Animator* _tmp14_;
					_tmp14_ = self->priv->_animator;
					animator_animate (_tmp14_);
				} else {
					Animator* _tmp15_;
					_tmp15_ = self->priv->_animator;
					animator_cancel_last_add (_tmp15_);
				}
				result = TRUE;
				marks = (g_free (marks), NULL);
				return result;
			}
		}
	}
	result = FALSE;
	marks = (g_free (marks), NULL);
	return result;
}

static void
draw_area_position_box (DrawArea* self,
                        gdouble x,
                        gdouble y,
                        gdouble w,
                        gdouble h,
                        gdouble xpos,
                        gdouble ypos,
                        const gchar* msg)
{
	gdouble ccx = 0.0;
	gdouble ccy = 0.0;
	gdouble ncx = 0.0;
	gdouble ncy = 0.0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (msg != NULL);
	ccx = draw_area_scale_value (self, gtk_widget_get_allocated_width ((GtkWidget*) self) * xpos);
	ccy = draw_area_scale_value (self, gtk_widget_get_allocated_height ((GtkWidget*) self) * ypos);
	ncx = x + (w * xpos);
	ncy = y + (h * ypos);
	draw_area_move_origin (self, ccx - ncx, ccy - ncy, NULL);
}

static gpointer
_node_bounds_ref0 (gpointer self)
{
	return self ? node_bounds_ref (self) : NULL;
}

void
draw_area_zoom_to_selected (DrawArea* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	Node* _tmp3_;
	Node* _tmp4_;
	Animator* _tmp5_;
	NodeBounds* nb = NULL;
	Node* _tmp6_;
	NodeBounds* _tmp7_;
	NodeBounds* _tmp8_;
	NodeBounds* _tmp9_;
	NodeBounds* _tmp10_;
	gdouble _tmp11_;
	gdouble _tmp12_;
	NodeBounds* _tmp13_;
	gdouble _tmp14_;
	gdouble _tmp15_;
	NodeBounds* _tmp16_;
	gdouble _tmp17_;
	gdouble _tmp18_;
	NodeBounds* _tmp19_;
	gdouble _tmp20_;
	gdouble _tmp21_;
	NodeBounds* _tmp22_;
	gdouble _tmp23_;
	gdouble _tmp24_;
	NodeBounds* _tmp25_;
	gdouble _tmp26_;
	gdouble _tmp27_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = selection_current_node (_tmp2_);
	current = _tmp3_;
	_tmp4_ = current;
	if (_tmp4_ == NULL) {
		_g_object_unref0 (current);
		return;
	}
	_tmp5_ = self->priv->_animator;
	animator_add_pan_scale (_tmp5_, "zoom to selected");
	_tmp6_ = current;
	_tmp7_ = node_get_tree_bbox (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = _node_bounds_ref0 (_tmp8_);
	nb = _tmp9_;
	_tmp10_ = nb;
	_tmp11_ = node_bounds_get_x (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = nb;
	_tmp14_ = node_bounds_get_y (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = nb;
	_tmp17_ = node_bounds_get_width (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = nb;
	_tmp20_ = node_bounds_get_height (_tmp19_);
	_tmp21_ = _tmp20_;
	draw_area_position_box (self, _tmp12_, _tmp15_, _tmp18_, _tmp21_, 0.5, 0.5, "zoom_to_selected");
	_tmp22_ = nb;
	_tmp23_ = node_bounds_get_width (_tmp22_);
	_tmp24_ = _tmp23_;
	_tmp25_ = nb;
	_tmp26_ = node_bounds_get_height (_tmp25_);
	_tmp27_ = _tmp26_;
	if (draw_area_set_scaling_factor (self, draw_area_get_scaling_factor (self, _tmp24_, _tmp27_))) {
		Animator* _tmp28_;
		_tmp28_ = self->priv->_animator;
		animator_animate (_tmp28_);
	} else {
		Animator* _tmp29_;
		_tmp29_ = self->priv->_animator;
		animator_cancel_last_add (_tmp29_);
	}
	_node_bounds_unref0 (nb);
	_g_object_unref0 (current);
}

void
draw_area_zoom_to_fit (DrawArea* self)
{
	Animator* _tmp0_;
	gdouble x = 0.0;
	gdouble y = 0.0;
	gdouble w = 0.0;
	gdouble h = 0.0;
	MindMap* _tmp1_;
	MapModel* _tmp2_;
	MapModel* _tmp3_;
	gdouble _tmp4_ = 0.0;
	gdouble _tmp5_ = 0.0;
	gdouble _tmp6_ = 0.0;
	gdouble _tmp7_ = 0.0;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_animator;
	animator_add_pan_scale (_tmp0_, "zoom to fit");
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_model (_tmp1_);
	_tmp3_ = _tmp2_;
	map_model_document_rectangle (_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_, &_tmp7_);
	x = _tmp4_;
	y = _tmp5_;
	w = _tmp6_;
	h = _tmp7_;
	draw_area_position_box (self, x, y, w, h, 0.5, 0.5, "zoom_to_fit");
	if (draw_area_set_scaling_factor (self, draw_area_get_scaling_factor (self, w, h))) {
		Animator* _tmp8_;
		_tmp8_ = self->priv->_animator;
		animator_animate (_tmp8_);
	} else {
		Animator* _tmp9_;
		_tmp9_ = self->priv->_animator;
		animator_cancel_last_add (_tmp9_);
	}
}

void
draw_area_zoom_actual (DrawArea* self)
{
	Animator* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_animator;
	animator_add_pan_scale (_tmp0_, "action_zoom_actual");
	if (draw_area_set_scaling_factor (self, 1.0)) {
		Animator* _tmp1_;
		_tmp1_ = self->priv->_animator;
		animator_animate (_tmp1_);
	} else {
		Animator* _tmp2_;
		_tmp2_ = self->priv->_animator;
		animator_cancel_last_add (_tmp2_);
	}
}

void
draw_area_center_node (DrawArea* self,
                       Node* n)
{
	gdouble x = 0.0;
	gdouble y = 0.0;
	gdouble w = 0.0;
	gdouble h = 0.0;
	gdouble _tmp0_ = 0.0;
	gdouble _tmp1_ = 0.0;
	gdouble _tmp2_ = 0.0;
	gdouble _tmp3_ = 0.0;
	Animator* _tmp4_;
	Animator* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (n != NULL);
	node_bbox (n, &_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_);
	x = _tmp0_;
	y = _tmp1_;
	w = _tmp2_;
	h = _tmp3_;
	_tmp4_ = self->priv->_animator;
	animator_add_pan (_tmp4_, "center node");
	draw_area_position_box (self, x, y, w, h, 0.5, 0.5, "center_node");
	_tmp5_ = self->priv->_animator;
	animator_animate (_tmp5_);
}

void
draw_area_center_current_node (DrawArea* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	Node* _tmp3_;
	Node* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = selection_current_node (_tmp2_);
	current = _tmp3_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		_tmp5_ = current;
		draw_area_center_node (self, _tmp5_);
	}
	_g_object_unref0 (current);
}

void
draw_area_see (DrawArea* self,
               gboolean animate,
               gdouble width_adjust,
               gdouble pad)
{
	gdouble x = 0.0;
	gdouble y = 0.0;
	gdouble w = 0.0;
	gdouble h = 0.0;
	Connection* current_conn = NULL;
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	Connection* _tmp3_;
	Node* current_node = NULL;
	MindMap* _tmp4_;
	Selection* _tmp5_;
	Selection* _tmp6_;
	Node* _tmp7_;
	Callout* current_callout = NULL;
	MindMap* _tmp8_;
	Selection* _tmp9_;
	Selection* _tmp10_;
	Callout* _tmp11_;
	NodeGroup* current_group = NULL;
	MindMap* _tmp12_;
	Selection* _tmp13_;
	Selection* _tmp14_;
	NodeGroup* _tmp15_;
	Connection* _tmp16_;
	gdouble diff_x = 0.0;
	gdouble diff_y = 0.0;
	gdouble sw = 0.0;
	gdouble sh = 0.0;
	gdouble sf = 0.0;
	gboolean _tmp43_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = selection_current_connection (_tmp2_);
	current_conn = _tmp3_;
	_tmp4_ = self->priv->_map;
	_tmp5_ = mind_map_get_selected (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = selection_current_node (_tmp6_);
	current_node = _tmp7_;
	_tmp8_ = self->priv->_map;
	_tmp9_ = mind_map_get_selected (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = selection_current_callout (_tmp10_);
	current_callout = _tmp11_;
	_tmp12_ = self->priv->_map;
	_tmp13_ = mind_map_get_selected (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = selection_current_group (_tmp14_);
	current_group = _tmp15_;
	_tmp16_ = current_conn;
	if (_tmp16_ != NULL) {
		Connection* _tmp17_;
		gdouble _tmp18_ = 0.0;
		gdouble _tmp19_ = 0.0;
		gdouble _tmp20_ = 0.0;
		gdouble _tmp21_ = 0.0;
		_tmp17_ = current_conn;
		connection_bbox (_tmp17_, &_tmp18_, &_tmp19_, &_tmp20_, &_tmp21_);
		x = _tmp18_;
		y = _tmp19_;
		w = _tmp20_;
		h = _tmp21_;
	} else {
		Node* _tmp22_;
		_tmp22_ = current_node;
		if (_tmp22_ != NULL) {
			Node* _tmp23_;
			gdouble _tmp24_ = 0.0;
			gdouble _tmp25_ = 0.0;
			gdouble _tmp26_ = 0.0;
			gdouble _tmp27_ = 0.0;
			_tmp23_ = current_node;
			node_bbox (_tmp23_, &_tmp24_, &_tmp25_, &_tmp26_, &_tmp27_);
			x = _tmp24_;
			y = _tmp25_;
			w = _tmp26_;
			h = _tmp27_;
		} else {
			Callout* _tmp28_;
			_tmp28_ = current_callout;
			if (_tmp28_ != NULL) {
				Callout* _tmp29_;
				gdouble _tmp30_ = 0.0;
				gdouble _tmp31_ = 0.0;
				gdouble _tmp32_ = 0.0;
				gdouble _tmp33_ = 0.0;
				_tmp29_ = current_callout;
				callout_bbox (_tmp29_, &_tmp30_, &_tmp31_, &_tmp32_, &_tmp33_);
				x = _tmp30_;
				y = _tmp31_;
				w = _tmp32_;
				h = _tmp33_;
			} else {
				NodeGroup* _tmp34_;
				_tmp34_ = current_group;
				if (_tmp34_ != NULL) {
					NodeGroup* _tmp35_;
					GArray* _tmp36_;
					GArray* _tmp37_;
					Node* _tmp38_;
					gdouble _tmp39_ = 0.0;
					gdouble _tmp40_ = 0.0;
					gdouble _tmp41_ = 0.0;
					gdouble _tmp42_ = 0.0;
					_tmp35_ = current_group;
					_tmp36_ = node_group_get_nodes (_tmp35_);
					_tmp37_ = _tmp36_;
					_tmp38_ = g_array_index (_tmp37_, Node*, (guint) 0);
					node_bbox (_tmp38_, &_tmp39_, &_tmp40_, &_tmp41_, &_tmp42_);
					x = _tmp39_;
					y = _tmp40_;
					w = _tmp41_;
					h = _tmp42_;
				} else {
					_g_object_unref0 (current_group);
					_g_object_unref0 (current_callout);
					_g_object_unref0 (current_node);
					_g_object_unref0 (current_conn);
					return;
				}
			}
		}
	}
	diff_x = (gdouble) 0;
	diff_y = (gdouble) 0;
	sw = draw_area_scale_value (self, gtk_widget_get_allocated_width ((GtkWidget*) self) + width_adjust);
	sh = draw_area_scale_value (self, (gdouble) gtk_widget_get_allocated_height ((GtkWidget*) self));
	sf = draw_area_get_scaling_factor (self, w + (pad * 2), h + (pad * 2));
	if ((x - pad) < ((gdouble) 0)) {
		diff_x = 0 - (x - pad);
	} else {
		if ((x + w) > sw) {
			diff_x = sw - ((x + w) + pad);
		}
	}
	if ((y - pad) < ((gdouble) 0)) {
		diff_y = 0 - (y - pad);
	} else {
		if ((y + h) > sh) {
			diff_y = sh - ((y + h) + pad);
		}
	}
	if (diff_x != ((gdouble) 0)) {
		_tmp43_ = TRUE;
	} else {
		_tmp43_ = diff_y != ((gdouble) 0);
	}
	if (_tmp43_) {
		gdouble _tmp44_;
		gdouble _tmp45_;
		_tmp44_ = draw_area_get_sfactor (self);
		_tmp45_ = _tmp44_;
		if (sf >= _tmp45_) {
			if (animate) {
				Animator* _tmp46_;
				_tmp46_ = self->priv->_animator;
				animator_add_pan (_tmp46_, "see");
			}
			draw_area_move_origin (self, diff_x, diff_y, NULL);
		} else {
			gdouble _tmp48_;
			gdouble _tmp49_;
			if (animate) {
				Animator* _tmp47_;
				_tmp47_ = self->priv->_animator;
				animator_add_pan_scale (_tmp47_, "see");
			}
			draw_area_set_sfactor (self, sf);
			_tmp48_ = draw_area_get_sfactor (self);
			_tmp49_ = _tmp48_;
			g_signal_emit (self, draw_area_signals[DRAW_AREA_SCALE_CHANGED_SIGNAL], 0, _tmp49_);
			draw_area_move_origin (self, diff_x, diff_y, NULL);
		}
		if (animate) {
			Animator* _tmp50_;
			_tmp50_ = self->priv->_animator;
			animator_animate (_tmp50_);
		} else {
			gtk_widget_queue_draw ((GtkWidget*) self);
		}
	}
	_g_object_unref0 (current_group);
	_g_object_unref0 (current_callout);
	_g_object_unref0 (current_node);
	_g_object_unref0 (current_conn);
}

void
draw_area_get_origin (DrawArea* self,
                      gdouble* x,
                      gdouble* y)
{
	gdouble _vala_x = 0.0;
	gdouble _vala_y = 0.0;
	gdouble _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = draw_area_get_origin_x (self);
	_tmp1_ = _tmp0_;
	_vala_x = _tmp1_;
	_tmp2_ = draw_area_get_origin_y (self);
	_tmp3_ = _tmp2_;
	_vala_y = _tmp3_;
	if (x) {
		*x = _vala_x;
	}
	if (y) {
		*y = _vala_y;
	}
}

void
draw_area_set_origin (DrawArea* self,
                      gdouble x,
                      gdouble y)
{
	gdouble _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = draw_area_get_origin_x (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = draw_area_get_origin_y (self);
	_tmp3_ = _tmp2_;
	draw_area_move_origin (self, x - _tmp1_, y - _tmp3_, NULL);
}

static gboolean
draw_area_out_of_bounds (DrawArea* self,
                         gdouble diff_x,
                         gdouble diff_y,
                         gdouble scale)
{
	gdouble x = 0.0;
	gdouble y = 0.0;
	gdouble w = 0.0;
	gdouble h = 0.0;
	gdouble aw = 0.0;
	gdouble ah = 0.0;
	gdouble s = 0.0;
	MindMap* _tmp0_;
	MapModel* _tmp1_;
	MapModel* _tmp2_;
	gdouble _tmp3_ = 0.0;
	gdouble _tmp4_ = 0.0;
	gdouble _tmp5_ = 0.0;
	gdouble _tmp6_ = 0.0;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	aw = gtk_widget_get_allocated_width ((GtkWidget*) self) / scale;
	ah = gtk_widget_get_allocated_height ((GtkWidget*) self) / scale;
	s = 40 / scale;
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_model (_tmp0_);
	_tmp2_ = _tmp1_;
	map_model_document_rectangle (_tmp2_, &_tmp3_, &_tmp4_, &_tmp5_, &_tmp6_);
	x = _tmp3_;
	y = _tmp4_;
	w = _tmp5_;
	h = _tmp6_;
	x += diff_x;
	y += diff_y;
	if ((x + w) < s) {
		_tmp9_ = TRUE;
	} else {
		_tmp9_ = (y + h) < s;
	}
	if (_tmp9_) {
		_tmp8_ = TRUE;
	} else {
		_tmp8_ = (aw - x) < s;
	}
	if (_tmp8_) {
		_tmp7_ = TRUE;
	} else {
		_tmp7_ = (ah - y) < s;
	}
	result = _tmp7_;
	return result;
}

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

static gpointer
__double_dup0 (gpointer self)
{
	return self ? _double_dup (self) : NULL;
}

gboolean
draw_area_move_origin (DrawArea* self,
                       gdouble diff_x,
                       gdouble diff_y,
                       gdouble* next_scale)
{
	gdouble* _tmp0_ = NULL;
	gdouble* _tmp1_;
	gdouble _tmp5_;
	gdouble _tmp6_;
	gdouble _tmp7_;
	gdouble _tmp8_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = __double_dup0 (next_scale);
	_tmp0_ = _tmp1_;
	if (_tmp0_ == NULL) {
		gdouble _tmp2_;
		gdouble _tmp3_;
		gdouble* _tmp4_;
		_tmp2_ = draw_area_get_sfactor (self);
		_tmp3_ = _tmp2_;
		_tmp4_ = __double_dup0 (&_tmp3_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp4_;
	}
	if (draw_area_out_of_bounds (self, diff_x, diff_y, *_tmp0_)) {
		result = FALSE;
		_g_free0 (_tmp0_);
		return result;
	}
	_tmp5_ = draw_area_get_origin_x (self);
	_tmp6_ = _tmp5_;
	draw_area_set_origin_x (self, _tmp6_ + diff_x);
	_tmp7_ = draw_area_get_origin_y (self);
	_tmp8_ = _tmp7_;
	draw_area_set_origin_y (self, _tmp8_ + diff_y);
	result = TRUE;
	_g_free0 (_tmp0_);
	return result;
}

void
draw_area_draw_background (DrawArea* self,
                           cairo_t* ctx)
{
	GtkStyleContext* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ctx != NULL);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	gtk_render_background (_tmp0_, ctx, (gdouble) 0, (gdouble) 0, gtk_widget_get_allocated_width ((GtkWidget*) self) / self->priv->_scale_factor, gtk_widget_get_allocated_height ((GtkWidget*) self) / self->priv->_scale_factor);
}

static void
_vala_GdkRGBA_free (GdkRGBA* self)
{
	g_boxed_free (gdk_rgba_get_type (), self);
}

void
draw_area_draw_select_box (DrawArea* self,
                           cairo_t* ctx)
{
	SelectBox _tmp0_;
	MindMap* _tmp1_;
	Theme* _tmp2_;
	Theme* _tmp3_;
	GdkRGBA* _tmp4_;
	GdkRGBA* _tmp5_;
	GdkRGBA _tmp6_;
	SelectBox _tmp7_;
	SelectBox _tmp8_;
	SelectBox _tmp9_;
	SelectBox _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ctx != NULL);
	_tmp0_ = self->priv->_select_box;
	if (!_tmp0_.valid) {
		return;
	}
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_theme (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = theme_get_color (_tmp3_, "nodesel_background");
	_tmp5_ = _tmp4_;
	_tmp6_ = *_tmp5_;
	utils_set_context_color_with_alpha (ctx, &_tmp6_, 0.1);
	__vala_GdkRGBA_free0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_tmp7_ = self->priv->_select_box;
	_tmp8_ = self->priv->_select_box;
	_tmp9_ = self->priv->_select_box;
	_tmp10_ = self->priv->_select_box;
	cairo_rectangle (ctx, _tmp7_.x, _tmp8_.y, _tmp9_.w, _tmp10_.h);
	cairo_fill (ctx);
}

void
draw_area_on_draw (DrawArea* self,
                   GtkDrawingArea* da,
                   cairo_t* ctx,
                   gint width,
                   gint height)
{
	gdouble _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	MindMap* _tmp6_;
	MapModel* _tmp7_;
	MapModel* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (da != NULL);
	g_return_if_fail (ctx != NULL);
	_tmp0_ = draw_area_get_sfactor (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = draw_area_get_sfactor (self);
	_tmp3_ = _tmp2_;
	cairo_scale (ctx, _tmp1_, _tmp3_);
	draw_area_draw_background (self, ctx);
	if (self->priv->_pressed) {
		_tmp5_ = self->priv->_motion;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		_tmp4_ = !self->priv->_resize;
	} else {
		_tmp4_ = FALSE;
	}
	_tmp6_ = self->priv->_map;
	_tmp7_ = mind_map_get_model (_tmp6_);
	_tmp8_ = _tmp7_;
	map_model_draw_all (_tmp8_, ctx, FALSE, _tmp4_);
	draw_area_draw_select_box (self, ctx);
}

void
draw_area_show_contextual_menu (DrawArea* self,
                                gdouble x,
                                gdouble y)
{
	Node* current_node = NULL;
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	Node* _tmp3_;
	Connection* current_conn = NULL;
	MindMap* _tmp4_;
	Selection* _tmp5_;
	Selection* _tmp6_;
	Connection* _tmp7_;
	Callout* current_callout = NULL;
	MindMap* _tmp8_;
	Selection* _tmp9_;
	Selection* _tmp10_;
	Callout* _tmp11_;
	Node* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = selection_current_node (_tmp2_);
	current_node = _tmp3_;
	_tmp4_ = self->priv->_map;
	_tmp5_ = mind_map_get_selected (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = selection_current_connection (_tmp6_);
	current_conn = _tmp7_;
	_tmp8_ = self->priv->_map;
	_tmp9_ = mind_map_get_selected (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = selection_current_callout (_tmp10_);
	current_callout = _tmp11_;
	_tmp12_ = current_node;
	if (_tmp12_ != NULL) {
		Node* _tmp13_;
		NodeMode _tmp14_;
		NodeMode _tmp15_;
		_tmp13_ = current_node;
		_tmp14_ = node_get_mode (_tmp13_);
		_tmp15_ = _tmp14_;
		if (_tmp15_ == NODE_MODE_EDITABLE) {
			TextMenu* _tmp16_;
			_tmp16_ = self->priv->_text_menu;
			base_menu_show ((BaseMenu*) _tmp16_, x, y);
		} else {
			NodeMenu* _tmp17_;
			_tmp17_ = self->priv->_node_menu;
			base_menu_show ((BaseMenu*) _tmp17_, x, y);
		}
	} else {
		MindMap* _tmp18_;
		Selection* _tmp19_;
		Selection* _tmp20_;
		_tmp18_ = self->priv->_map;
		_tmp19_ = mind_map_get_selected (_tmp18_);
		_tmp20_ = _tmp19_;
		if (selection_num_nodes (_tmp20_) > 1) {
			NodesMenu* _tmp21_;
			_tmp21_ = self->priv->_nodes_menu;
			base_menu_show ((BaseMenu*) _tmp21_, x, y);
		} else {
			Connection* _tmp22_;
			_tmp22_ = current_conn;
			if (_tmp22_ != NULL) {
				Connection* _tmp23_;
				ConnMode _tmp24_;
				ConnMode _tmp25_;
				_tmp23_ = current_conn;
				_tmp24_ = connection_get_mode (_tmp23_);
				_tmp25_ = _tmp24_;
				if (_tmp25_ == CONN_MODE_EDITABLE) {
					TextMenu* _tmp26_;
					_tmp26_ = self->priv->_text_menu;
					base_menu_show ((BaseMenu*) _tmp26_, x, y);
				} else {
					ConnectionMenu* _tmp27_;
					_tmp27_ = self->priv->_conn_menu;
					base_menu_show ((BaseMenu*) _tmp27_, x, y);
				}
			} else {
				MindMap* _tmp28_;
				Selection* _tmp29_;
				Selection* _tmp30_;
				_tmp28_ = self->priv->_map;
				_tmp29_ = mind_map_get_selected (_tmp28_);
				_tmp30_ = _tmp29_;
				if (selection_num_connections (_tmp30_) > 1) {
					ConnectionsMenu* _tmp31_;
					_tmp31_ = self->priv->_conns_menu;
					base_menu_show ((BaseMenu*) _tmp31_, x, y);
				} else {
					Callout* _tmp32_;
					_tmp32_ = current_callout;
					if (_tmp32_ != NULL) {
						Callout* _tmp33_;
						CalloutMode _tmp34_;
						CalloutMode _tmp35_;
						_tmp33_ = current_callout;
						_tmp34_ = callout_get_mode (_tmp33_);
						_tmp35_ = _tmp34_;
						if (_tmp35_ == CALLOUT_MODE_EDITABLE) {
							TextMenu* _tmp36_;
							_tmp36_ = self->priv->_text_menu;
							base_menu_show ((BaseMenu*) _tmp36_, x, y);
						} else {
							CalloutMenu* _tmp37_;
							_tmp37_ = self->priv->_callout_menu;
							base_menu_show ((BaseMenu*) _tmp37_, x, y);
						}
					} else {
						MindMap* _tmp38_;
						Selection* _tmp39_;
						Selection* _tmp40_;
						_tmp38_ = self->priv->_map;
						_tmp39_ = mind_map_get_selected (_tmp38_);
						_tmp40_ = _tmp39_;
						if (selection_num_groups (_tmp40_) > 0) {
							GroupsMenu* _tmp41_;
							_tmp41_ = self->priv->_groups_menu;
							base_menu_show ((BaseMenu*) _tmp41_, x, y);
						} else {
							EmptyMenu* _tmp42_;
							_tmp42_ = self->priv->_empty_menu;
							base_menu_show ((BaseMenu*) _tmp42_, x, y);
						}
					}
				}
			}
		}
	}
	_g_object_unref0 (current_callout);
	_g_object_unref0 (current_conn);
	_g_object_unref0 (current_node);
}

static void
draw_area_on_press (DrawArea* self,
                    gint n_press,
                    gdouble x,
                    gdouble y,
                    gint button)
{
	gdouble scaled_x = 0.0;
	gdouble scaled_y = 0.0;
	g_return_if_fail (self != NULL);
	scaled_x = draw_area_scale_value (self, x);
	scaled_y = draw_area_scale_value (self, y);
	self->priv->_press_x = scaled_x;
	self->priv->_press_y = scaled_y;
	self->priv->_press_middle = button == GDK_BUTTON_MIDDLE;
	self->priv->_press_num = n_press;
	self->priv->_pressed = draw_area_set_current_at_position (self, self->priv->_press_x, self->priv->_press_y);
	self->priv->_motion = FALSE;
	gtk_widget_grab_focus ((GtkWidget*) self);
	gtk_widget_queue_draw ((GtkWidget*) self);
}

static void
draw_area_on_right_press (DrawArea* self,
                          gint n_press,
                          gdouble x,
                          gdouble y)
{
	gdouble scaled_x = 0.0;
	gdouble scaled_y = 0.0;
	g_return_if_fail (self != NULL);
	scaled_x = draw_area_scale_value (self, x);
	scaled_y = draw_area_scale_value (self, y);
	draw_area_handle_right_click (self, scaled_x, scaled_y);
	draw_area_show_contextual_menu (self, x, y);
}

static gboolean
_draw_area_do_autopan_gsource_func (gpointer self)
{
	gboolean result;
	result = draw_area_do_autopan ((DrawArea*) self);
	return result;
}

static void
draw_area_start_autopan (DrawArea* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_autopan_id == ((guint) 0)) {
		self->priv->_autopan_id = g_timeout_add_full (G_PRIORITY_DEFAULT, DRAW_AREA_autopan_frame_rate, _draw_area_do_autopan_gsource_func, g_object_ref (self), g_object_unref);
	}
}

static void
draw_area_stop_autopan (DrawArea* self)
{
	g_return_if_fail (self != NULL);
	if (self->priv->_autopan_id > ((guint) 0)) {
		g_source_remove (self->priv->_autopan_id);
		self->priv->_autopan_id = (guint) 0;
	}
}

static gboolean
draw_area_do_autopan (DrawArea* self)
{
	gdouble diffx = 0.0;
	gdouble diffy = 0.0;
	gint aw = 0;
	gint ah = 0;
	gdouble inner_edge = 0.0;
	gdouble outer_edge = 0.0;
	gdouble max_speed = 0.0;
	gdouble min_speed = 0.0;
	gboolean _tmp4_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	diffx = 0.0;
	diffy = 0.0;
	aw = gtk_widget_get_allocated_width ((GtkWidget*) self);
	ah = gtk_widget_get_allocated_height ((GtkWidget*) self);
	inner_edge = DRAW_AREA_autopan_inner_edge;
	outer_edge = DRAW_AREA_autopan_outer_edge;
	max_speed = DRAW_AREA_autopan_max_speed;
	min_speed = DRAW_AREA_autopan_min_speed;
	if (self->priv->_scaled_x < draw_area_scale_value (self, inner_edge)) {
		gdouble _tmp0_ = 0.0;
		if (self->priv->_scaled_x < draw_area_scale_value (self, outer_edge)) {
			_tmp0_ = max_speed;
		} else {
			_tmp0_ = min_speed;
		}
		diffx = draw_area_scale_value (self, _tmp0_);
	} else {
		if (self->priv->_scaled_x >= draw_area_scale_value (self, aw - inner_edge)) {
			gdouble _tmp1_ = 0.0;
			if (self->priv->_scaled_x >= draw_area_scale_value (self, aw - outer_edge)) {
				_tmp1_ = 0 - max_speed;
			} else {
				_tmp1_ = 0 - min_speed;
			}
			diffx = draw_area_scale_value (self, _tmp1_);
		}
	}
	if (self->priv->_scaled_y < draw_area_scale_value (self, inner_edge)) {
		gdouble _tmp2_ = 0.0;
		if (self->priv->_scaled_y < draw_area_scale_value (self, outer_edge)) {
			_tmp2_ = max_speed;
		} else {
			_tmp2_ = min_speed;
		}
		diffy = draw_area_scale_value (self, _tmp2_);
	} else {
		if (self->priv->_scaled_y >= draw_area_scale_value (self, ah - inner_edge)) {
			gdouble _tmp3_ = 0.0;
			if (self->priv->_scaled_y >= draw_area_scale_value (self, ah - outer_edge)) {
				_tmp3_ = 0 - max_speed;
			} else {
				_tmp3_ = 0 - min_speed;
			}
			diffy = draw_area_scale_value (self, _tmp3_);
		}
	}
	if (diffx != ((gdouble) 0)) {
		_tmp4_ = TRUE;
	} else {
		_tmp4_ = diffy != ((gdouble) 0);
	}
	if (_tmp4_) {
		if (draw_area_move_origin (self, diffx, diffy, NULL)) {
			gdouble _tmp5_;
			gdouble _tmp6_;
			gdouble _tmp7_;
			gdouble _tmp8_;
			self->priv->_press_x = self->priv->_press_x + diffx;
			self->priv->_press_y = self->priv->_press_y + diffy;
			_tmp5_ = draw_area_get_sfactor (self);
			_tmp6_ = _tmp5_;
			_tmp7_ = draw_area_get_sfactor (self);
			_tmp8_ = _tmp7_;
			draw_area_on_motion (self, self->priv->_scaled_x * _tmp6_, self->priv->_scaled_y * _tmp8_);
		}
	}
	result = TRUE;
	return result;
}

static void
draw_area_on_motion (DrawArea* self,
                     gdouble x,
                     gdouble y)
{
	MindMap* _tmp0_;
	MapModel* _tmp1_;
	MapModel* _tmp2_;
	MindMap* _tmp3_;
	MapModel* _tmp4_;
	MapModel* _tmp5_;
	gdouble last_x = 0.0;
	gdouble last_y = 0.0;
	Node* current_node = NULL;
	MindMap* _tmp6_;
	Node* _tmp7_;
	Connection* current_conn = NULL;
	MindMap* _tmp8_;
	Connection* _tmp9_;
	Sticker* current_sticker = NULL;
	MindMap* _tmp10_;
	Sticker* _tmp11_;
	Callout* current_callout = NULL;
	MindMap* _tmp12_;
	Callout* _tmp13_;
	NodeGroup* current_group = NULL;
	MindMap* _tmp14_;
	NodeGroup* _tmp15_;
	g_return_if_fail (self != NULL);
	self->priv->_motion_x = x;
	self->priv->_motion_y = y;
	if (self->priv->_select_hover_id > ((guint) 0)) {
		g_source_remove (self->priv->_select_hover_id);
		self->priv->_select_hover_id = (guint) 0;
	}
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_model (_tmp0_);
	_tmp2_ = _tmp1_;
	map_model_set_attach_summary (_tmp2_, NULL);
	_tmp3_ = self->priv->_map;
	_tmp4_ = mind_map_get_model (_tmp3_);
	_tmp5_ = _tmp4_;
	map_model_set_attach_node (_tmp5_, NULL, NODE_MODE_ATTACHABLE);
	last_x = self->priv->_scaled_x;
	last_y = self->priv->_scaled_y;
	self->priv->_scaled_x = draw_area_scale_value (self, x);
	self->priv->_scaled_y = draw_area_scale_value (self, y);
	_tmp6_ = self->priv->_map;
	_tmp7_ = mind_map_get_current_node (_tmp6_);
	current_node = _tmp7_;
	_tmp8_ = self->priv->_map;
	_tmp9_ = mind_map_get_current_connection (_tmp8_);
	current_conn = _tmp9_;
	_tmp10_ = self->priv->_map;
	_tmp11_ = mind_map_get_current_sticker (_tmp10_);
	current_sticker = _tmp11_;
	_tmp12_ = self->priv->_map;
	_tmp13_ = mind_map_get_current_callout (_tmp12_);
	current_callout = _tmp13_;
	_tmp14_ = self->priv->_map;
	_tmp15_ = mind_map_get_current_group (_tmp14_);
	current_group = _tmp15_;
	if (self->priv->_pressed) {
		gboolean _tmp16_ = FALSE;
		gboolean _tmp17_ = FALSE;
		MindMap* _tmp18_;
		Selection* _tmp19_;
		Selection* _tmp20_;
		Connection* _tmp22_;
		gboolean _tmp188_ = FALSE;
		gboolean _tmp189_ = FALSE;
		gboolean _tmp190_ = FALSE;
		gboolean _tmp191_ = FALSE;
		gboolean _tmp192_ = FALSE;
		gboolean _tmp193_ = FALSE;
		if (self->priv->_press_middle) {
			_tmp16_ = TRUE;
		} else {
			_tmp16_ = self->priv->_alt;
		}
		if (_tmp16_) {
			gdouble diff_x = 0.0;
			gdouble diff_y = 0.0;
			diff_x = self->priv->_scaled_x - last_x;
			diff_y = self->priv->_scaled_y - last_y;
			draw_area_move_origin (self, diff_x, diff_y, NULL);
			gtk_widget_queue_draw ((GtkWidget*) self);
			_g_object_unref0 (current_group);
			_g_object_unref0 (current_callout);
			_g_object_unref0 (current_sticker);
			_g_object_unref0 (current_conn);
			_g_object_unref0 (current_node);
			return;
		}
		_tmp18_ = self->priv->_map;
		_tmp19_ = mind_map_get_selected (_tmp18_);
		_tmp20_ = _tmp19_;
		if (selection_is_any_draggable_selected (_tmp20_)) {
			SelectBox _tmp21_;
			_tmp21_ = self->priv->_select_box;
			_tmp17_ = !_tmp21_.valid;
		} else {
			_tmp17_ = FALSE;
		}
		if (_tmp17_) {
			gdouble diff_x = 0.0;
			gdouble diff_y = 0.0;
			gdouble edge = 0.0;
			diff_x = self->priv->_scaled_x - last_x;
			diff_y = self->priv->_scaled_y - last_y;
			edge = DRAW_AREA_autopan_inner_edge;
			if (!utils_is_within_bounds (x, y, edge, edge, gtk_widget_get_allocated_width ((GtkWidget*) self) - (edge * 2), gtk_widget_get_allocated_height ((GtkWidget*) self) - (edge * 2))) {
				draw_area_start_autopan (self);
			} else {
				draw_area_stop_autopan (self);
			}
		}
		_tmp22_ = current_conn;
		if (_tmp22_ != NULL) {
			MapItemComponent component = 0;
			Connection* _tmp23_;
			ConnMode _tmp24_;
			ConnMode _tmp25_;
			_tmp23_ = current_conn;
			_tmp24_ = connection_get_mode (_tmp23_);
			_tmp25_ = _tmp24_;
			switch (_tmp25_) {
				case CONN_MODE_ADJUSTING:
				{
					Connection* _tmp26_;
					_tmp26_ = current_conn;
					connection_move_drag_handle (_tmp26_, self->priv->_scaled_x, self->priv->_scaled_y);
					gtk_widget_queue_draw ((GtkWidget*) self);
					break;
				}
				case CONN_MODE_CONNECTING:
				case CONN_MODE_LINKING:
				{
					Node* match = NULL;
					MindMap* _tmp27_;
					MapModel* _tmp28_;
					MapModel* _tmp29_;
					MapItemComponent _tmp30_ = 0;
					Node* _tmp31_;
					Node* _tmp32_;
					draw_area_update_connection (self, x, y);
					_tmp27_ = self->priv->_map;
					_tmp28_ = mind_map_get_model (_tmp27_);
					_tmp29_ = _tmp28_;
					_tmp31_ = map_model_get_node_at_position (_tmp29_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp30_);
					component = _tmp30_;
					match = _tmp31_;
					_tmp32_ = match;
					if (_tmp32_ != NULL) {
						MindMap* _tmp33_;
						MapModel* _tmp34_;
						MapModel* _tmp35_;
						Node* _tmp36_;
						_tmp33_ = self->priv->_map;
						_tmp34_ = mind_map_get_model (_tmp33_);
						_tmp35_ = _tmp34_;
						_tmp36_ = match;
						map_model_set_attach_node (_tmp35_, _tmp36_, NODE_MODE_ATTACHABLE);
					}
					_g_object_unref0 (match);
					break;
				}
				default:
				break;
			}
		} else {
			gboolean _tmp37_ = FALSE;
			Node* _tmp38_;
			_tmp38_ = current_node;
			if (_tmp38_ != NULL) {
				SelectBox _tmp39_;
				_tmp39_ = self->priv->_select_box;
				_tmp37_ = !_tmp39_.valid;
			} else {
				_tmp37_ = FALSE;
			}
			if (_tmp37_) {
				gdouble diffx = 0.0;
				gdouble diffy = 0.0;
				Node* _tmp40_;
				NodeMode _tmp41_;
				NodeMode _tmp42_;
				diffx = self->priv->_scaled_x - self->priv->_press_x;
				diffy = self->priv->_scaled_y - self->priv->_press_y;
				_tmp40_ = current_node;
				_tmp41_ = node_get_mode (_tmp40_);
				_tmp42_ = _tmp41_;
				if (_tmp42_ == NODE_MODE_CURRENT) {
					if (self->priv->_resize) {
						gboolean _tmp43_ = FALSE;
						Node* _tmp44_;
						Node* _tmp45_;
						MindMap* _tmp46_;
						if (self->priv->_control) {
							_tmp43_ = !self->priv->_orig_resizable;
						} else {
							_tmp43_ = self->priv->_orig_resizable;
						}
						_tmp44_ = current_node;
						node_set_image_resizable (_tmp44_, _tmp43_);
						_tmp45_ = current_node;
						node_resize (_tmp45_, diffx);
						_tmp46_ = self->priv->_map;
						mind_map_auto_save (_tmp46_);
					} else {
						MindMap* _tmp47_;
						gboolean _tmp48_;
						gboolean _tmp49_;
						_tmp47_ = self->priv->_map;
						_tmp48_ = mind_map_get_editable (_tmp47_);
						_tmp49_ = _tmp48_;
						if (_tmp49_) {
							SummaryNode* attach_summary = NULL;
							MindMap* _tmp50_;
							MapModel* _tmp51_;
							MapModel* _tmp52_;
							SummaryNode* _tmp53_;
							MindMap* _tmp54_;
							MapModel* _tmp55_;
							MapModel* _tmp56_;
							SummaryNode* _tmp57_;
							SummaryNode* _tmp58_;
							Node* attach_node = NULL;
							MindMap* _tmp67_;
							MapModel* _tmp68_;
							MapModel* _tmp69_;
							Node* _tmp70_;
							Node* _tmp71_;
							gboolean _tmp76_ = FALSE;
							Node* _tmp77_;
							gboolean summarized_moved = FALSE;
							gboolean _tmp81_ = FALSE;
							gboolean _tmp95_ = FALSE;
							Node* _tmp109_;
							Layout* _tmp110_;
							Layout* _tmp111_;
							Node* _tmp112_;
							_tmp50_ = self->priv->_map;
							_tmp51_ = mind_map_get_model (_tmp50_);
							_tmp52_ = _tmp51_;
							_tmp53_ = map_model_attachable_summary_node (_tmp52_, self->priv->_scaled_x, self->priv->_scaled_y);
							attach_summary = _tmp53_;
							_tmp54_ = self->priv->_map;
							_tmp55_ = mind_map_get_model (_tmp54_);
							_tmp56_ = _tmp55_;
							_tmp57_ = map_model_get_attach_summary (_tmp56_);
							_tmp58_ = _tmp57_;
							if (_tmp58_ != NULL) {
								MindMap* _tmp59_;
								MapModel* _tmp60_;
								MapModel* _tmp61_;
								MindMap* _tmp62_;
								MapModel* _tmp63_;
								MapModel* _tmp64_;
								SummaryNode* _tmp65_;
								SummaryNode* _tmp66_;
								_tmp59_ = self->priv->_map;
								_tmp60_ = mind_map_get_model (_tmp59_);
								_tmp61_ = _tmp60_;
								_tmp62_ = self->priv->_map;
								_tmp63_ = mind_map_get_model (_tmp62_);
								_tmp64_ = _tmp63_;
								_tmp65_ = map_model_get_attach_summary (_tmp64_);
								_tmp66_ = _tmp65_;
								map_model_set_attach_summary (_tmp61_, _tmp66_);
							}
							_tmp67_ = self->priv->_map;
							_tmp68_ = mind_map_get_model (_tmp67_);
							_tmp69_ = _tmp68_;
							_tmp70_ = map_model_attachable_node (_tmp69_, self->priv->_scaled_x, self->priv->_scaled_y);
							attach_node = _tmp70_;
							_tmp71_ = attach_node;
							if (_tmp71_ != NULL) {
								MindMap* _tmp72_;
								MapModel* _tmp73_;
								MapModel* _tmp74_;
								Node* _tmp75_;
								_tmp72_ = self->priv->_map;
								_tmp73_ = mind_map_get_model (_tmp72_);
								_tmp74_ = _tmp73_;
								_tmp75_ = attach_node;
								map_model_set_attach_node (_tmp74_, _tmp75_, NODE_MODE_ATTACHABLE);
							}
							_tmp77_ = current_node;
							if (node_is_summarized (_tmp77_)) {
								Node* _tmp78_;
								SummaryNode* _tmp79_;
								SummaryNode* _tmp80_;
								_tmp78_ = current_node;
								_tmp79_ = node_summary_node (_tmp78_);
								_tmp80_ = _tmp79_;
								_tmp76_ = summary_node_summarized_count (_tmp80_) > 1;
								_g_object_unref0 (_tmp80_);
							} else {
								_tmp76_ = FALSE;
							}
							summarized_moved = _tmp76_;
							if (summarized_moved) {
								Node* _tmp82_;
								NodeSide _tmp83_;
								NodeSide _tmp84_;
								_tmp82_ = current_node;
								_tmp83_ = node_get_side (_tmp82_);
								_tmp84_ = _tmp83_;
								_tmp81_ = node_side_vertical (_tmp84_);
							} else {
								_tmp81_ = FALSE;
							}
							if (_tmp81_) {
								Node* _tmp85_;
								Node* _tmp86_;
								gdouble _tmp87_;
								gdouble _tmp88_;
								gdouble _tmp89_;
								gdouble _tmp90_;
								_tmp85_ = current_node;
								_tmp86_ = current_node;
								_tmp87_ = node_get_posx (_tmp86_);
								_tmp88_ = _tmp87_;
								_tmp89_ = draw_area_get_origin_x (self);
								_tmp90_ = _tmp89_;
								node_set_posx_only (_tmp85_, (_tmp88_ - _tmp90_) + diffx);
							} else {
								Node* _tmp91_;
								Node* _tmp92_;
								gdouble _tmp93_;
								gdouble _tmp94_;
								_tmp91_ = current_node;
								_tmp92_ = current_node;
								_tmp93_ = node_get_posx (_tmp92_);
								_tmp94_ = _tmp93_;
								node_set_posx (_tmp92_, _tmp94_ + diffx);
							}
							if (summarized_moved) {
								Node* _tmp96_;
								NodeSide _tmp97_;
								NodeSide _tmp98_;
								_tmp96_ = current_node;
								_tmp97_ = node_get_side (_tmp96_);
								_tmp98_ = _tmp97_;
								_tmp95_ = node_side_horizontal (_tmp98_);
							} else {
								_tmp95_ = FALSE;
							}
							if (_tmp95_) {
								Node* _tmp99_;
								Node* _tmp100_;
								gdouble _tmp101_;
								gdouble _tmp102_;
								gdouble _tmp103_;
								gdouble _tmp104_;
								_tmp99_ = current_node;
								_tmp100_ = current_node;
								_tmp101_ = node_get_posy (_tmp100_);
								_tmp102_ = _tmp101_;
								_tmp103_ = draw_area_get_origin_y (self);
								_tmp104_ = _tmp103_;
								node_set_posy_only (_tmp99_, (_tmp102_ - _tmp104_) + diffy);
							} else {
								Node* _tmp105_;
								Node* _tmp106_;
								gdouble _tmp107_;
								gdouble _tmp108_;
								_tmp105_ = current_node;
								_tmp106_ = current_node;
								_tmp107_ = node_get_posy (_tmp106_);
								_tmp108_ = _tmp107_;
								node_set_posy (_tmp106_, _tmp108_ + diffy);
							}
							_tmp109_ = current_node;
							_tmp110_ = node_get_layout (_tmp109_);
							_tmp111_ = _tmp110_;
							_tmp112_ = current_node;
							layout_set_side (_tmp111_, _tmp112_);
							_g_object_unref0 (attach_node);
							_g_object_unref0 (attach_summary);
						}
					}
				} else {
					switch (self->priv->_press_num) {
						case 1:
						{
							Node* _tmp113_;
							CanvasText* _tmp114_;
							CanvasText* _tmp115_;
							_tmp113_ = current_node;
							_tmp114_ = node_get_name (_tmp113_);
							_tmp115_ = _tmp114_;
							canvas_text_set_cursor_at_char (_tmp115_, self->priv->_scaled_x, self->priv->_scaled_y, TRUE);
							break;
						}
						case 2:
						{
							Node* _tmp116_;
							CanvasText* _tmp117_;
							CanvasText* _tmp118_;
							_tmp116_ = current_node;
							_tmp117_ = node_get_name (_tmp116_);
							_tmp118_ = _tmp117_;
							canvas_text_set_cursor_at_word (_tmp118_, self->priv->_scaled_x, self->priv->_scaled_y, TRUE);
							break;
						}
						default:
						break;
					}
				}
				gtk_widget_queue_draw ((GtkWidget*) self);
			} else {
				gboolean _tmp119_ = FALSE;
				MindMap* _tmp120_;
				Selection* _tmp121_;
				Selection* _tmp122_;
				_tmp120_ = self->priv->_map;
				_tmp121_ = mind_map_get_selected (_tmp120_);
				_tmp122_ = _tmp121_;
				if (selection_num_nodes (_tmp122_) > 1) {
					SelectBox _tmp123_;
					_tmp123_ = self->priv->_select_box;
					_tmp119_ = !_tmp123_.valid;
				} else {
					_tmp119_ = FALSE;
				}
				if (_tmp119_) {
					gdouble diffx = 0.0;
					gdouble diffy = 0.0;
					MindMap* _tmp124_;
					gboolean _tmp125_;
					gboolean _tmp126_;
					diffx = self->priv->_scaled_x - self->priv->_press_x;
					diffy = self->priv->_scaled_y - self->priv->_press_y;
					_tmp124_ = self->priv->_map;
					_tmp125_ = mind_map_get_editable (_tmp124_);
					_tmp126_ = _tmp125_;
					if (_tmp126_) {
						Node* attach_node = NULL;
						MindMap* _tmp127_;
						MapModel* _tmp128_;
						MapModel* _tmp129_;
						Node* _tmp130_;
						Node* _tmp131_;
						GArray* nodes = NULL;
						MindMap* _tmp136_;
						Selection* _tmp137_;
						Selection* _tmp138_;
						GArray* _tmp139_;
						_tmp127_ = self->priv->_map;
						_tmp128_ = mind_map_get_model (_tmp127_);
						_tmp129_ = _tmp128_;
						_tmp130_ = map_model_attachable_node (_tmp129_, self->priv->_scaled_x, self->priv->_scaled_y);
						attach_node = _tmp130_;
						_tmp131_ = attach_node;
						if (_tmp131_ != NULL) {
							MindMap* _tmp132_;
							MapModel* _tmp133_;
							MapModel* _tmp134_;
							Node* _tmp135_;
							_tmp132_ = self->priv->_map;
							_tmp133_ = mind_map_get_model (_tmp132_);
							_tmp134_ = _tmp133_;
							_tmp135_ = attach_node;
							map_model_set_attach_node (_tmp134_, _tmp135_, NODE_MODE_ATTACHABLE);
						}
						_tmp136_ = self->priv->_map;
						_tmp137_ = mind_map_get_selected (_tmp136_);
						_tmp138_ = _tmp137_;
						_tmp139_ = selection_nodes (_tmp138_);
						nodes = _tmp139_;
						{
							gint i = 0;
							i = 0;
							{
								gboolean _tmp140_ = FALSE;
								_tmp140_ = TRUE;
								while (TRUE) {
									GArray* _tmp142_;
									Node* node = NULL;
									GArray* _tmp143_;
									Node* _tmp144_;
									Node* _tmp145_;
									Node* _tmp146_;
									Node* _tmp147_;
									gdouble _tmp148_;
									gdouble _tmp149_;
									gdouble _tmp150_;
									gdouble _tmp151_;
									Node* _tmp152_;
									Node* _tmp153_;
									gdouble _tmp154_;
									gdouble _tmp155_;
									gdouble _tmp156_;
									gdouble _tmp157_;
									Node* _tmp158_;
									if (!_tmp140_) {
										gint _tmp141_;
										_tmp141_ = i;
										i = _tmp141_ + 1;
									}
									_tmp140_ = FALSE;
									_tmp142_ = nodes;
									if (!(((guint) i) < _tmp142_->len)) {
										break;
									}
									_tmp143_ = nodes;
									_tmp144_ = g_array_index (_tmp143_, Node*, (guint) i);
									_tmp145_ = _g_object_ref0 (_tmp144_);
									node = _tmp145_;
									_tmp146_ = node;
									_tmp147_ = node;
									_tmp148_ = node_get_posx (_tmp147_);
									_tmp149_ = _tmp148_;
									_tmp150_ = draw_area_get_origin_x (self);
									_tmp151_ = _tmp150_;
									node_set_posx_only (_tmp146_, (_tmp149_ - _tmp151_) + diffx);
									_tmp152_ = node;
									_tmp153_ = node;
									_tmp154_ = node_get_posy (_tmp153_);
									_tmp155_ = _tmp154_;
									_tmp156_ = draw_area_get_origin_y (self);
									_tmp157_ = _tmp156_;
									node_set_posy_only (_tmp152_, (_tmp155_ - _tmp157_) + diffy);
									_tmp158_ = node;
									node_set_alpha_only (_tmp158_, 0.3);
									_g_object_unref0 (node);
								}
							}
						}
						gtk_widget_queue_draw ((GtkWidget*) self);
						_g_array_unref0 (nodes);
						_g_object_unref0 (attach_node);
					}
				} else {
					gboolean _tmp159_ = FALSE;
					Sticker* _tmp160_;
					_tmp160_ = current_sticker;
					if (_tmp160_ != NULL) {
						MindMap* _tmp161_;
						gboolean _tmp162_;
						gboolean _tmp163_;
						_tmp161_ = self->priv->_map;
						_tmp162_ = mind_map_get_editable (_tmp161_);
						_tmp163_ = _tmp162_;
						_tmp159_ = _tmp163_;
					} else {
						_tmp159_ = FALSE;
					}
					if (_tmp159_) {
						gdouble diffx = 0.0;
						gdouble diffy = 0.0;
						MindMap* _tmp173_;
						diffx = self->priv->_scaled_x - self->priv->_press_x;
						diffy = self->priv->_scaled_y - self->priv->_press_y;
						if (self->priv->_resize) {
							Sticker* _tmp164_;
							_tmp164_ = current_sticker;
							sticker_resize (_tmp164_, diffx);
						} else {
							Sticker* _tmp165_;
							Sticker* _tmp166_;
							gdouble _tmp167_;
							gdouble _tmp168_;
							Sticker* _tmp169_;
							Sticker* _tmp170_;
							gdouble _tmp171_;
							gdouble _tmp172_;
							_tmp165_ = current_sticker;
							_tmp166_ = current_sticker;
							_tmp167_ = sticker_get_posx (_tmp166_);
							_tmp168_ = _tmp167_;
							sticker_set_posx (_tmp166_, _tmp168_ + diffx);
							_tmp169_ = current_sticker;
							_tmp170_ = current_sticker;
							_tmp171_ = sticker_get_posy (_tmp170_);
							_tmp172_ = _tmp171_;
							sticker_set_posy (_tmp170_, _tmp172_ + diffy);
						}
						gtk_widget_queue_draw ((GtkWidget*) self);
						_tmp173_ = self->priv->_map;
						mind_map_auto_save (_tmp173_);
					} else {
						gboolean _tmp174_ = FALSE;
						Callout* _tmp175_;
						_tmp175_ = current_callout;
						if (_tmp175_ != NULL) {
							MindMap* _tmp176_;
							gboolean _tmp177_;
							gboolean _tmp178_;
							_tmp176_ = self->priv->_map;
							_tmp177_ = mind_map_get_editable (_tmp176_);
							_tmp178_ = _tmp177_;
							_tmp174_ = _tmp178_;
						} else {
							_tmp174_ = FALSE;
						}
						if (_tmp174_) {
							gdouble diffx = 0.0;
							diffx = self->priv->_scaled_x - self->priv->_press_x;
							if (self->priv->_resize) {
								Callout* _tmp179_;
								MindMap* _tmp180_;
								_tmp179_ = current_callout;
								callout_resize (_tmp179_, diffx);
								gtk_widget_queue_draw ((GtkWidget*) self);
								_tmp180_ = self->priv->_map;
								mind_map_auto_save (_tmp180_);
							}
						} else {
							gboolean _tmp181_ = FALSE;
							NodeGroup* _tmp182_;
							_tmp182_ = current_group;
							if (_tmp182_ == NULL) {
								SelectBox _tmp183_;
								_tmp183_ = self->priv->_select_box;
								_tmp181_ = _tmp183_.valid;
							} else {
								_tmp181_ = FALSE;
							}
							if (_tmp181_) {
								SelectBox _tmp184_;
								SelectBox _tmp185_;
								MindMap* _tmp186_;
								SelectBox _tmp187_;
								_tmp184_ = self->priv->_select_box;
								self->priv->_select_box.w = self->priv->_scaled_x - _tmp184_.x;
								_tmp185_ = self->priv->_select_box;
								self->priv->_select_box.h = self->priv->_scaled_y - _tmp185_.y;
								_tmp186_ = self->priv->_map;
								_tmp187_ = self->priv->_select_box;
								mind_map_select_nodes_within_box (_tmp186_, &_tmp187_, self->priv->_shift);
								gtk_widget_queue_draw ((GtkWidget*) self);
							}
						}
					}
				}
			}
		}
		if (self->priv->_motion) {
			_tmp193_ = !self->priv->_resize;
		} else {
			_tmp193_ = FALSE;
		}
		if (_tmp193_) {
			SelectBox _tmp194_;
			_tmp194_ = self->priv->_select_box;
			_tmp192_ = !_tmp194_.valid;
		} else {
			_tmp192_ = FALSE;
		}
		if (_tmp192_) {
			Node* _tmp195_;
			_tmp195_ = current_node;
			_tmp191_ = _tmp195_ != NULL;
		} else {
			_tmp191_ = FALSE;
		}
		if (_tmp191_) {
			Node* _tmp196_;
			NodeMode _tmp197_;
			NodeMode _tmp198_;
			_tmp196_ = current_node;
			_tmp197_ = node_get_mode (_tmp196_);
			_tmp198_ = _tmp197_;
			_tmp190_ = _tmp198_ != NODE_MODE_EDITABLE;
		} else {
			_tmp190_ = FALSE;
		}
		if (_tmp190_) {
			Node* _tmp199_;
			_tmp199_ = current_node;
			_tmp189_ = node_is_within_node (_tmp199_, self->priv->_scaled_x, self->priv->_scaled_y);
		} else {
			_tmp189_ = FALSE;
		}
		if (_tmp189_) {
			MindMap* _tmp200_;
			gboolean _tmp201_;
			gboolean _tmp202_;
			_tmp200_ = self->priv->_map;
			_tmp201_ = mind_map_get_editable (_tmp200_);
			_tmp202_ = _tmp201_;
			_tmp188_ = _tmp202_;
		} else {
			_tmp188_ = FALSE;
		}
		if (_tmp188_) {
			gboolean _tmp203_ = FALSE;
			Node* _tmp204_;
			_tmp204_ = current_node;
			if (node_is_summarized (_tmp204_)) {
				Node* _tmp205_;
				SummaryNode* _tmp206_;
				SummaryNode* _tmp207_;
				_tmp205_ = current_node;
				_tmp206_ = node_summary_node (_tmp205_);
				_tmp207_ = _tmp206_;
				_tmp203_ = summary_node_summarized_count (_tmp207_) > 1;
				_g_object_unref0 (_tmp207_);
			} else {
				_tmp203_ = FALSE;
			}
			if (_tmp203_) {
				Node* _tmp208_;
				_tmp208_ = current_node;
				node_set_alpha_only (_tmp208_, 0.3);
			} else {
				Node* _tmp209_;
				_tmp209_ = current_node;
				node_set_alpha (_tmp209_, 0.3);
			}
		}
		self->priv->_press_x = self->priv->_scaled_x;
		self->priv->_press_y = self->priv->_scaled_y;
		self->priv->_motion = TRUE;
	} else {
		MapItemComponent component = 0;
		FormatTag tag = 0;
		gchar* url = NULL;
		gchar* _tmp210_;
		gboolean _tmp211_ = FALSE;
		Sticker* _tmp212_;
		gboolean _tmp217_ = FALSE;
		Callout* _tmp218_;
		Connection* _tmp223_;
		Node* match_node = NULL;
		MindMap* _tmp265_;
		MapModel* _tmp266_;
		MapModel* _tmp267_;
		MapItemComponent _tmp268_ = 0;
		Node* _tmp269_;
		Node* _tmp270_;
		Callout* callout = NULL;
		MindMap* _tmp341_;
		MapModel* _tmp342_;
		MapModel* _tmp343_;
		MapItemComponent _tmp344_ = 0;
		Callout* _tmp345_;
		Callout* _tmp346_;
		MindMap* _tmp358_;
		MapModel* _tmp359_;
		MapModel* _tmp360_;
		tag = FORMAT_TAG_LENGTH;
		_tmp210_ = g_strdup ("");
		url = _tmp210_;
		_tmp212_ = current_sticker;
		if (_tmp212_ != NULL) {
			MindMap* _tmp213_;
			gboolean _tmp214_;
			gboolean _tmp215_;
			_tmp213_ = self->priv->_map;
			_tmp214_ = mind_map_get_editable (_tmp213_);
			_tmp215_ = _tmp214_;
			_tmp211_ = _tmp215_;
		} else {
			_tmp211_ = FALSE;
		}
		if (_tmp211_) {
			Sticker* _tmp216_;
			_tmp216_ = current_sticker;
			if (sticker_is_within_resizer (_tmp216_, self->priv->_scaled_x, self->priv->_scaled_y)) {
				draw_area_set_cursor_name (self, "ew-resize");
				_g_free0 (url);
				_g_object_unref0 (current_group);
				_g_object_unref0 (current_callout);
				_g_object_unref0 (current_sticker);
				_g_object_unref0 (current_conn);
				_g_object_unref0 (current_node);
				return;
			}
		}
		_tmp218_ = current_callout;
		if (_tmp218_ != NULL) {
			MindMap* _tmp219_;
			gboolean _tmp220_;
			gboolean _tmp221_;
			_tmp219_ = self->priv->_map;
			_tmp220_ = mind_map_get_editable (_tmp219_);
			_tmp221_ = _tmp220_;
			_tmp217_ = _tmp221_;
		} else {
			_tmp217_ = FALSE;
		}
		if (_tmp217_) {
			Callout* _tmp222_;
			_tmp222_ = current_callout;
			if (callout_is_within_resizer (_tmp222_, self->priv->_scaled_x, self->priv->_scaled_y)) {
				draw_area_set_cursor_name (self, "ew-resize");
				_g_free0 (url);
				_g_object_unref0 (current_group);
				_g_object_unref0 (current_callout);
				_g_object_unref0 (current_sticker);
				_g_object_unref0 (current_conn);
				_g_object_unref0 (current_node);
				return;
			}
		}
		_tmp223_ = current_conn;
		if (_tmp223_ != NULL) {
			gboolean _tmp224_ = FALSE;
			Connection* _tmp225_;
			ConnMode _tmp226_;
			ConnMode _tmp227_;
			gboolean _tmp231_ = FALSE;
			gboolean _tmp232_ = FALSE;
			Connection* _tmp233_;
			_tmp225_ = current_conn;
			_tmp226_ = connection_get_mode (_tmp225_);
			_tmp227_ = _tmp226_;
			if (_tmp227_ == CONN_MODE_CONNECTING) {
				_tmp224_ = TRUE;
			} else {
				Connection* _tmp228_;
				ConnMode _tmp229_;
				ConnMode _tmp230_;
				_tmp228_ = current_conn;
				_tmp229_ = connection_get_mode (_tmp228_);
				_tmp230_ = _tmp229_;
				_tmp224_ = _tmp230_ == CONN_MODE_LINKING;
			}
			if (_tmp224_) {
				draw_area_update_connection (self, x, y);
			}
			_tmp233_ = current_conn;
			if (connection_within_drag_handle (_tmp233_, self->priv->_scaled_x, self->priv->_scaled_y)) {
				_tmp232_ = TRUE;
			} else {
				Connection* _tmp234_;
				_tmp234_ = current_conn;
				_tmp232_ = connection_within_from_handle (_tmp234_, self->priv->_scaled_x, self->priv->_scaled_y);
			}
			if (_tmp232_) {
				_tmp231_ = TRUE;
			} else {
				Connection* _tmp235_;
				_tmp235_ = current_conn;
				_tmp231_ = connection_within_to_handle (_tmp235_, self->priv->_scaled_x, self->priv->_scaled_y);
			}
			if (_tmp231_) {
				MindMap* _tmp236_;
				gboolean _tmp237_;
				gboolean _tmp238_;
				_tmp236_ = self->priv->_map;
				_tmp237_ = mind_map_get_editable (_tmp236_);
				_tmp238_ = _tmp237_;
				if (_tmp238_) {
					draw_area_set_cursor_name (self, DRAW_AREA_move_cursor);
				}
				_g_free0 (url);
				_g_object_unref0 (current_group);
				_g_object_unref0 (current_callout);
				_g_object_unref0 (current_sticker);
				_g_object_unref0 (current_conn);
				_g_object_unref0 (current_node);
				return;
			} else {
				Connection* _tmp239_;
				_tmp239_ = current_conn;
				if (connection_within_note (_tmp239_, self->priv->_scaled_x, self->priv->_scaled_y)) {
					Connection* _tmp240_;
					const gchar* _tmp241_;
					const gchar* _tmp242_;
					gchar* _tmp243_;
					gchar* _tmp244_;
					_tmp240_ = current_conn;
					_tmp241_ = connection_get_note (_tmp240_);
					_tmp242_ = _tmp241_;
					_tmp243_ = utils_prepare_note_markup (_tmp242_);
					_tmp244_ = _tmp243_;
					gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp244_);
					_g_free0 (_tmp244_);
					_g_free0 (url);
					_g_object_unref0 (current_group);
					_g_object_unref0 (current_callout);
					_g_object_unref0 (current_sticker);
					_g_object_unref0 (current_conn);
					_g_object_unref0 (current_node);
					return;
				} else {
					Connection* match_conn = NULL;
					MindMap* _tmp245_;
					MapModel* _tmp246_;
					MapModel* _tmp247_;
					MapItemComponent _tmp248_ = 0;
					Connection* _tmp249_;
					gboolean _tmp250_ = FALSE;
					Connection* _tmp251_;
					_tmp245_ = self->priv->_map;
					_tmp246_ = mind_map_get_model (_tmp245_);
					_tmp247_ = _tmp246_;
					_tmp249_ = map_model_get_connection_at_position (_tmp247_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp248_);
					component = _tmp248_;
					match_conn = _tmp249_;
					_tmp251_ = match_conn;
					if (_tmp251_ != NULL) {
						Connection* _tmp252_;
						_tmp252_ = match_conn;
						_tmp250_ = draw_area_select_connection_on_hover (self, _tmp252_, self->priv->_shift);
					} else {
						_tmp250_ = FALSE;
					}
					if (_tmp250_) {
						_g_object_unref0 (match_conn);
						_g_free0 (url);
						_g_object_unref0 (current_group);
						_g_object_unref0 (current_callout);
						_g_object_unref0 (current_sticker);
						_g_object_unref0 (current_conn);
						_g_object_unref0 (current_node);
						return;
					}
					_g_object_unref0 (match_conn);
				}
			}
		} else {
			Connection* match_conn = NULL;
			MindMap* _tmp253_;
			MapModel* _tmp254_;
			MapModel* _tmp255_;
			MapItemComponent _tmp256_ = 0;
			Connection* _tmp257_;
			Connection* _tmp258_;
			_tmp253_ = self->priv->_map;
			_tmp254_ = mind_map_get_model (_tmp253_);
			_tmp255_ = _tmp254_;
			_tmp257_ = map_model_get_connection_at_position (_tmp255_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp256_);
			component = _tmp256_;
			match_conn = _tmp257_;
			_tmp258_ = match_conn;
			if (_tmp258_ != NULL) {
				if (component == MAP_ITEM_COMPONENT_NOTE) {
					Connection* _tmp259_;
					const gchar* _tmp260_;
					const gchar* _tmp261_;
					gchar* _tmp262_;
					gchar* _tmp263_;
					_tmp259_ = match_conn;
					_tmp260_ = connection_get_note (_tmp259_);
					_tmp261_ = _tmp260_;
					_tmp262_ = utils_prepare_note_markup (_tmp261_);
					_tmp263_ = _tmp262_;
					gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp263_);
					_g_free0 (_tmp263_);
					_g_object_unref0 (match_conn);
					_g_free0 (url);
					_g_object_unref0 (current_group);
					_g_object_unref0 (current_callout);
					_g_object_unref0 (current_sticker);
					_g_object_unref0 (current_conn);
					_g_object_unref0 (current_node);
					return;
				} else {
					Connection* _tmp264_;
					_tmp264_ = match_conn;
					if (draw_area_select_connection_on_hover (self, _tmp264_, self->priv->_shift)) {
						_g_object_unref0 (match_conn);
						_g_free0 (url);
						_g_object_unref0 (current_group);
						_g_object_unref0 (current_callout);
						_g_object_unref0 (current_sticker);
						_g_object_unref0 (current_conn);
						_g_object_unref0 (current_node);
						return;
					}
				}
			}
			_g_object_unref0 (match_conn);
		}
		_tmp265_ = self->priv->_map;
		_tmp266_ = mind_map_get_model (_tmp265_);
		_tmp267_ = _tmp266_;
		_tmp269_ = map_model_get_node_at_position (_tmp267_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp268_);
		component = _tmp268_;
		match_node = _tmp269_;
		_tmp270_ = match_node;
		if (_tmp270_ != NULL) {
			MindMap* _tmp271_;
			MapModel* _tmp272_;
			MapModel* _tmp273_;
			Node* _tmp274_;
			gboolean _tmp275_ = FALSE;
			Connection* _tmp276_;
			_tmp271_ = self->priv->_map;
			_tmp272_ = mind_map_get_model (_tmp271_);
			_tmp273_ = _tmp272_;
			_tmp274_ = match_node;
			if (map_model_update_last_match (_tmp273_, _tmp274_)) {
				_g_free0 (self->priv->_node_link_tooltip);
				self->priv->_node_link_tooltip = NULL;
			}
			_tmp276_ = current_conn;
			if (_tmp276_ != NULL) {
				gboolean _tmp277_ = FALSE;
				Connection* _tmp278_;
				ConnMode _tmp279_;
				ConnMode _tmp280_;
				_tmp278_ = current_conn;
				_tmp279_ = connection_get_mode (_tmp278_);
				_tmp280_ = _tmp279_;
				if (_tmp280_ == CONN_MODE_CONNECTING) {
					_tmp277_ = TRUE;
				} else {
					Connection* _tmp281_;
					ConnMode _tmp282_;
					ConnMode _tmp283_;
					_tmp281_ = current_conn;
					_tmp282_ = connection_get_mode (_tmp281_);
					_tmp283_ = _tmp282_;
					_tmp277_ = _tmp283_ == CONN_MODE_LINKING;
				}
				_tmp275_ = _tmp277_;
			} else {
				_tmp275_ = FALSE;
			}
			if (_tmp275_) {
				MindMap* _tmp284_;
				MapModel* _tmp285_;
				MapModel* _tmp286_;
				Node* _tmp287_;
				_tmp284_ = self->priv->_map;
				_tmp285_ = mind_map_get_model (_tmp284_);
				_tmp286_ = _tmp285_;
				_tmp287_ = match_node;
				map_model_set_attach_node (_tmp286_, _tmp287_, NODE_MODE_ATTACHABLE);
			} else {
				if (component == MAP_ITEM_COMPONENT_TASK) {
					MindMap* _tmp288_;
					gboolean _tmp289_;
					gboolean _tmp290_;
					Node* _tmp291_;
					gchar* _tmp292_;
					gchar* _tmp293_;
					_tmp288_ = self->priv->_map;
					_tmp289_ = mind_map_get_editable (_tmp288_);
					_tmp290_ = _tmp289_;
					if (_tmp290_) {
						draw_area_set_cursor_name (self, DRAW_AREA_pointer_cursor);
					}
					_tmp291_ = match_node;
					_tmp292_ = g_strdup_printf (_ ("%0.3g%% complete"), node_task_completion_percentage (_tmp291_));
					_tmp293_ = _tmp292_;
					gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp293_);
					_g_free0 (_tmp293_);
				} else {
					if (component == MAP_ITEM_COMPONENT_NOTE) {
						Node* _tmp294_;
						const gchar* _tmp295_;
						const gchar* _tmp296_;
						gchar* _tmp297_;
						gchar* _tmp298_;
						_tmp294_ = match_node;
						_tmp295_ = node_get_note (_tmp294_);
						_tmp296_ = _tmp295_;
						_tmp297_ = utils_prepare_note_markup (_tmp296_);
						_tmp298_ = _tmp297_;
						gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp298_);
						_g_free0 (_tmp298_);
					} else {
						if (component == MAP_ITEM_COMPONENT_FOLD) {
							Node* _tmp299_;
							gboolean _tmp300_;
							gboolean _tmp301_;
							draw_area_set_cursor_name (self, DRAW_AREA_pointer_cursor);
							_tmp299_ = match_node;
							_tmp300_ = node_get_folded (_tmp299_);
							_tmp301_ = _tmp300_;
							if (_tmp301_) {
								Node* _tmp302_;
								gchar* _tmp303_;
								gchar* _tmp304_;
								_tmp302_ = match_node;
								_tmp303_ = draw_area_prepare_folded_count_markup (self, _tmp302_);
								_tmp304_ = _tmp303_;
								gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp304_);
								_g_free0 (_tmp304_);
							}
						} else {
							if (component == MAP_ITEM_COMPONENT_NODE_LINK) {
								const gchar* _tmp305_;
								const gchar* _tmp313_;
								_tmp305_ = self->priv->_node_link_tooltip;
								if (_tmp305_ == NULL) {
									Node* _tmp306_;
									NodeLink* _tmp307_;
									NodeLink* _tmp308_;
									MindMap* _tmp309_;
									gchar* _tmp310_;
									gchar* _tmp311_;
									gchar* _tmp312_;
									_tmp306_ = match_node;
									_tmp307_ = node_get_linked_node (_tmp306_);
									_tmp308_ = _tmp307_;
									_tmp309_ = self->priv->_map;
									_tmp310_ = node_link_get_tooltip (_tmp308_, _tmp309_);
									_tmp311_ = _tmp310_;
									_tmp312_ = utils_prepare_note_markup (_tmp311_);
									_g_free0 (self->priv->_node_link_tooltip);
									self->priv->_node_link_tooltip = _tmp312_;
									_g_free0 (_tmp311_);
								}
								draw_area_set_cursor_name (self, DRAW_AREA_pointer_cursor);
								_tmp313_ = self->priv->_node_link_tooltip;
								gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp313_);
							} else {
								if (component == MAP_ITEM_COMPONENT_RESIZER) {
									MindMap* _tmp314_;
									gboolean _tmp315_;
									gboolean _tmp316_;
									_tmp314_ = self->priv->_map;
									_tmp315_ = mind_map_get_editable (_tmp314_);
									_tmp316_ = _tmp315_;
									if (_tmp316_) {
										Node* _tmp317_;
										NodeImage* _tmp318_;
										NodeImage* _tmp319_;
										draw_area_set_cursor_name (self, "ew-resize");
										_tmp317_ = match_node;
										_tmp318_ = node_get_image (_tmp317_);
										_tmp319_ = _tmp318_;
										if (_tmp319_ == NULL) {
											gtk_widget_set_tooltip_markup ((GtkWidget*) self, _ ("Drag to resize node"));
										} else {
											gtk_widget_set_tooltip_markup ((GtkWidget*) self, _ ("Drag to resize node and image.\nControl-drag to resize only node."));
										}
									}
								} else {
									if (component == MAP_ITEM_COMPONENT_TAGS) {
										Node* _tmp320_;
										Tags* _tmp321_;
										Tags* _tmp322_;
										gchar* _tmp323_;
										gchar* _tmp324_;
										draw_area_set_cursor_name (self, DRAW_AREA_pointer_cursor);
										_tmp320_ = match_node;
										_tmp321_ = node_get_tags (_tmp320_);
										_tmp322_ = _tmp321_;
										_tmp323_ = tags_to_tooltip (_tmp322_);
										_tmp324_ = _tmp323_;
										gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp324_);
										_g_free0 (_tmp324_);
									} else {
										gboolean _tmp325_ = FALSE;
										if (self->priv->_control) {
											Node* _tmp326_;
											CanvasText* _tmp327_;
											CanvasText* _tmp328_;
											FormatTag _tmp329_ = 0;
											gchar* _tmp330_ = NULL;
											gboolean _tmp331_;
											_tmp326_ = match_node;
											_tmp327_ = node_get_name (_tmp326_);
											_tmp328_ = _tmp327_;
											_tmp331_ = canvas_text_is_within_clickable (_tmp328_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp329_, &_tmp330_);
											tag = _tmp329_;
											_g_free0 (url);
											url = _tmp330_;
											_tmp325_ = _tmp331_;
										} else {
											_tmp325_ = FALSE;
										}
										if (_tmp325_) {
											if (tag == FORMAT_TAG_URL) {
												const gchar* _tmp332_;
												draw_area_set_cursor_name (self, DRAW_AREA_pointer_cursor);
												_tmp332_ = url;
												gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp332_);
											}
										} else {
											Node* _tmp333_;
											NodeMode _tmp334_;
											NodeMode _tmp335_;
											_tmp333_ = match_node;
											_tmp334_ = node_get_mode (_tmp333_);
											_tmp335_ = _tmp334_;
											if (_tmp335_ == NODE_MODE_EDITABLE) {
												draw_area_set_cursor_name (self, DRAW_AREA_text_cursor);
												gtk_widget_set_tooltip_markup ((GtkWidget*) self, NULL);
											} else {
												Node* _tmp336_;
												gboolean _tmp337_;
												gboolean _tmp338_;
												Node* _tmp340_;
												_tmp336_ = match_node;
												_tmp337_ = node_get_folded (_tmp336_);
												_tmp338_ = _tmp337_;
												if (!_tmp338_) {
													Node* _tmp339_;
													_tmp339_ = match_node;
													node_set_show_fold (_tmp339_, TRUE);
													gtk_widget_queue_draw ((GtkWidget*) self);
												}
												draw_area_reset_cursor (self);
												gtk_widget_set_tooltip_markup ((GtkWidget*) self, NULL);
												_tmp340_ = match_node;
												draw_area_select_node_on_hover (self, _tmp340_, self->priv->_shift);
											}
										}
									}
								}
							}
						}
					}
				}
			}
			_g_object_unref0 (match_node);
			_g_free0 (url);
			_g_object_unref0 (current_group);
			_g_object_unref0 (current_callout);
			_g_object_unref0 (current_sticker);
			_g_object_unref0 (current_conn);
			_g_object_unref0 (current_node);
			return;
		}
		_tmp341_ = self->priv->_map;
		_tmp342_ = mind_map_get_model (_tmp341_);
		_tmp343_ = _tmp342_;
		_tmp345_ = map_model_get_callout_at_position (_tmp343_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp344_);
		component = _tmp344_;
		callout = _tmp345_;
		_tmp346_ = callout;
		if (_tmp346_ != NULL) {
			gboolean _tmp347_ = FALSE;
			if (self->priv->_control) {
				Callout* _tmp348_;
				CanvasText* _tmp349_;
				CanvasText* _tmp350_;
				FormatTag _tmp351_ = 0;
				gchar* _tmp352_ = NULL;
				gboolean _tmp353_;
				_tmp348_ = callout;
				_tmp349_ = callout_get_text (_tmp348_);
				_tmp350_ = _tmp349_;
				_tmp353_ = canvas_text_is_within_clickable (_tmp350_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp351_, &_tmp352_);
				tag = _tmp351_;
				_g_free0 (url);
				url = _tmp352_;
				_tmp347_ = _tmp353_;
			} else {
				_tmp347_ = FALSE;
			}
			if (_tmp347_) {
				if (tag == FORMAT_TAG_URL) {
					const gchar* _tmp354_;
					draw_area_set_cursor_name (self, DRAW_AREA_pointer_cursor);
					_tmp354_ = url;
					gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp354_);
				}
			} else {
				Callout* _tmp355_;
				CalloutMode _tmp356_;
				CalloutMode _tmp357_;
				_tmp355_ = callout;
				_tmp356_ = callout_get_mode (_tmp355_);
				_tmp357_ = _tmp356_;
				if (_tmp357_ == CALLOUT_MODE_EDITABLE) {
					draw_area_set_cursor_name (self, DRAW_AREA_text_cursor);
					gtk_widget_set_tooltip_markup ((GtkWidget*) self, NULL);
				} else {
					draw_area_reset_cursor (self);
					gtk_widget_set_tooltip_markup ((GtkWidget*) self, NULL);
				}
			}
			_g_object_unref0 (callout);
			_g_object_unref0 (match_node);
			_g_free0 (url);
			_g_object_unref0 (current_group);
			_g_object_unref0 (current_callout);
			_g_object_unref0 (current_sticker);
			_g_object_unref0 (current_conn);
			_g_object_unref0 (current_node);
			return;
		}
		_tmp358_ = self->priv->_map;
		_tmp359_ = mind_map_get_model (_tmp358_);
		_tmp360_ = _tmp359_;
		map_model_update_last_match (_tmp360_, NULL);
		draw_area_reset_cursor (self);
		gtk_widget_set_tooltip_markup ((GtkWidget*) self, NULL);
		draw_area_select_sticker_group_on_hover (self, self->priv->_shift);
		_g_object_unref0 (callout);
		_g_object_unref0 (match_node);
		_g_free0 (url);
	}
	_g_object_unref0 (current_group);
	_g_object_unref0 (current_callout);
	_g_object_unref0 (current_sticker);
	_g_object_unref0 (current_conn);
	_g_object_unref0 (current_node);
}

static void
draw_area_handle_cursor_leave (DrawArea* self)
{
	MindMap* _tmp0_;
	MapModel* _tmp1_;
	MapModel* _tmp2_;
	MindMap* _tmp3_;
	MapModel* _tmp4_;
	MapModel* _tmp5_;
	MindMap* _tmp6_;
	MapModel* _tmp7_;
	MapModel* _tmp8_;
	MindMap* _tmp9_;
	MapModel* _tmp10_;
	MapModel* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_model (_tmp0_);
	_tmp2_ = _tmp1_;
	map_model_set_attach_summary (_tmp2_, NULL);
	_tmp3_ = self->priv->_map;
	_tmp4_ = mind_map_get_model (_tmp3_);
	_tmp5_ = _tmp4_;
	map_model_set_attach_node (_tmp5_, NULL, NODE_MODE_ATTACHABLE);
	_tmp6_ = self->priv->_map;
	_tmp7_ = mind_map_get_model (_tmp6_);
	_tmp8_ = _tmp7_;
	map_model_set_attach_connection (_tmp8_, NULL, CONN_MODE_DROPPABLE);
	_tmp9_ = self->priv->_map;
	_tmp10_ = mind_map_get_model (_tmp9_);
	_tmp11_ = _tmp10_;
	map_model_set_attach_sticker (_tmp11_, NULL, STICKER_MODE_DROPPABLE);
}

static Block16Data*
block16_data_ref (Block16Data* _data16_)
{
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}

static void
block16_data_unref (void * _userdata_)
{
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		DrawArea* self;
		self = _data16_->self;
		_g_object_unref0 (_data16_->node);
		_g_object_unref0 (self);
		g_slice_free (Block16Data, _data16_);
	}
}

static gboolean
___lambda235_ (Block16Data* _data16_)
{
	DrawArea* self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = _data16_->self;
	self->priv->_select_hover_id = (guint) 0;
	if (!_data16_->shift) {
		_tmp0_ = TRUE;
	} else {
		MindMap* _tmp1_;
		Selection* _tmp2_;
		Selection* _tmp3_;
		_tmp1_ = self->priv->_map;
		_tmp2_ = mind_map_get_selected (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = selection_num_nodes (_tmp3_) == 0;
	}
	if (_tmp0_) {
		MindMap* _tmp4_;
		Selection* _tmp5_;
		Selection* _tmp6_;
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_selected (_tmp4_);
		_tmp6_ = _tmp5_;
		selection_set_current_node (_tmp6_, _data16_->node, 1.0);
	} else {
		MindMap* _tmp7_;
		Selection* _tmp8_;
		Selection* _tmp9_;
		_tmp7_ = self->priv->_map;
		_tmp8_ = mind_map_get_selected (_tmp7_);
		_tmp9_ = _tmp8_;
		selection_add_node (_tmp9_, _data16_->node, FALSE, TRUE);
	}
	gtk_widget_queue_draw ((GtkWidget*) self);
	result = FALSE;
	return result;
}

static gboolean
____lambda235__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda235_ (self);
	return result;
}

static gboolean
draw_area_select_node_on_hover (DrawArea* self,
                                Node* node,
                                gboolean shift)
{
	Block16Data* _data16_;
	Node* _tmp0_;
	MindMap* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (node != NULL, FALSE);
	_data16_ = g_slice_new0 (Block16Data);
	_data16_->_ref_count_ = 1;
	_data16_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (node);
	_g_object_unref0 (_data16_->node);
	_data16_->node = _tmp0_;
	_data16_->shift = shift;
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_settings (_tmp1_);
	_tmp3_ = _tmp2_;
	if (g_settings_get_boolean (_tmp3_, "select-on-hover")) {
		gint timeout = 0;
		MindMap* _tmp4_;
		GSettings* _tmp5_;
		GSettings* _tmp6_;
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_settings (_tmp4_);
		_tmp6_ = _tmp5_;
		timeout = g_settings_get_int (_tmp6_, "select-on-hover-timeout");
		self->priv->_select_hover_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) timeout, ____lambda235__gsource_func, block16_data_ref (_data16_), block16_data_unref);
		result = TRUE;
		block16_data_unref (_data16_);
		_data16_ = NULL;
		return result;
	}
	result = FALSE;
	block16_data_unref (_data16_);
	_data16_ = NULL;
	return result;
}

static Block17Data*
block17_data_ref (Block17Data* _data17_)
{
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}

static void
block17_data_unref (void * _userdata_)
{
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		DrawArea* self;
		self = _data17_->self;
		_g_object_unref0 (_data17_->conn);
		_g_object_unref0 (self);
		g_slice_free (Block17Data, _data17_);
	}
}

static gboolean
___lambda234_ (Block17Data* _data17_)
{
	DrawArea* self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = _data17_->self;
	self->priv->_select_hover_id = (guint) 0;
	if (!_data17_->shift) {
		_tmp0_ = TRUE;
	} else {
		MindMap* _tmp1_;
		Selection* _tmp2_;
		Selection* _tmp3_;
		_tmp1_ = self->priv->_map;
		_tmp2_ = mind_map_get_selected (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = selection_num_connections (_tmp3_) == 0;
	}
	if (_tmp0_) {
		MindMap* _tmp4_;
		Selection* _tmp5_;
		Selection* _tmp6_;
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_selected (_tmp4_);
		_tmp6_ = _tmp5_;
		selection_set_current_connection (_tmp6_, _data17_->conn, 1.0);
	} else {
		MindMap* _tmp7_;
		Selection* _tmp8_;
		Selection* _tmp9_;
		_tmp7_ = self->priv->_map;
		_tmp8_ = mind_map_get_selected (_tmp7_);
		_tmp9_ = _tmp8_;
		selection_add_connection (_tmp9_, _data17_->conn);
	}
	gtk_widget_queue_draw ((GtkWidget*) self);
	result = FALSE;
	return result;
}

static gboolean
____lambda234__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda234_ (self);
	return result;
}

static gboolean
draw_area_select_connection_on_hover (DrawArea* self,
                                      Connection* conn,
                                      gboolean shift)
{
	Block17Data* _data17_;
	Connection* _tmp0_;
	MindMap* _tmp1_;
	GSettings* _tmp2_;
	GSettings* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (conn != NULL, FALSE);
	_data17_ = g_slice_new0 (Block17Data);
	_data17_->_ref_count_ = 1;
	_data17_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (conn);
	_g_object_unref0 (_data17_->conn);
	_data17_->conn = _tmp0_;
	_data17_->shift = shift;
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_settings (_tmp1_);
	_tmp3_ = _tmp2_;
	if (g_settings_get_boolean (_tmp3_, "select-on-hover")) {
		gint timeout = 0;
		MindMap* _tmp4_;
		GSettings* _tmp5_;
		GSettings* _tmp6_;
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_settings (_tmp4_);
		_tmp6_ = _tmp5_;
		timeout = g_settings_get_int (_tmp6_, "select-on-hover-timeout");
		self->priv->_select_hover_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) timeout, ____lambda234__gsource_func, block17_data_ref (_data17_), block17_data_unref);
		result = TRUE;
		block17_data_unref (_data17_);
		_data17_ = NULL;
		return result;
	}
	result = FALSE;
	block17_data_unref (_data17_);
	_data17_ = NULL;
	return result;
}

static Block18Data*
block18_data_ref (Block18Data* _data18_)
{
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}

static void
block18_data_unref (void * _userdata_)
{
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		DrawArea* self;
		self = _data18_->self;
		_g_object_unref0 (self);
		g_slice_free (Block18Data, _data18_);
	}
}

static Block19Data*
block19_data_ref (Block19Data* _data19_)
{
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}

static void
block19_data_unref (void * _userdata_)
{
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		DrawArea* self;
		self = _data19_->_data18_->self;
		_g_object_unref0 (_data19_->group);
		_g_object_unref0 (_data19_->sticker);
		block18_data_unref (_data19_->_data18_);
		_data19_->_data18_ = NULL;
		g_slice_free (Block19Data, _data19_);
	}
}

static gboolean
____lambda236_ (Block19Data* _data19_)
{
	Block18Data* _data18_;
	DrawArea* self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	_data18_ = _data19_->_data18_;
	self = _data18_->self;
	self->priv->_select_hover_id = (guint) 0;
	if (!_data18_->shift) {
		_tmp0_ = TRUE;
	} else {
		MindMap* _tmp1_;
		Selection* _tmp2_;
		Selection* _tmp3_;
		_tmp1_ = self->priv->_map;
		_tmp2_ = mind_map_get_selected (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = selection_num_stickers (_tmp3_) == 0;
	}
	if (_tmp0_) {
		MindMap* _tmp4_;
		Selection* _tmp5_;
		Selection* _tmp6_;
		Sticker* _tmp7_;
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_selected (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = _data19_->sticker;
		selection_set_current_sticker (_tmp6_, _tmp7_, 1.0);
	} else {
		MindMap* _tmp8_;
		Selection* _tmp9_;
		Selection* _tmp10_;
		Sticker* _tmp11_;
		_tmp8_ = self->priv->_map;
		_tmp9_ = mind_map_get_selected (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = _data19_->sticker;
		selection_add_sticker (_tmp10_, _tmp11_);
	}
	gtk_widget_queue_draw ((GtkWidget*) self);
	result = FALSE;
	return result;
}

static gboolean
_____lambda236__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda236_ (self);
	return result;
}

static gboolean
____lambda237_ (Block19Data* _data19_)
{
	Block18Data* _data18_;
	DrawArea* self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	_data18_ = _data19_->_data18_;
	self = _data18_->self;
	self->priv->_select_hover_id = (guint) 0;
	if (!_data18_->shift) {
		_tmp0_ = TRUE;
	} else {
		MindMap* _tmp1_;
		Selection* _tmp2_;
		Selection* _tmp3_;
		_tmp1_ = self->priv->_map;
		_tmp2_ = mind_map_get_selected (_tmp1_);
		_tmp3_ = _tmp2_;
		_tmp0_ = selection_num_groups (_tmp3_) == 0;
	}
	if (_tmp0_) {
		MindMap* _tmp4_;
		Selection* _tmp5_;
		Selection* _tmp6_;
		NodeGroup* _tmp7_;
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_selected (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = _data19_->group;
		selection_set_current_group (_tmp6_, _tmp7_, 1.0);
	} else {
		MindMap* _tmp8_;
		Selection* _tmp9_;
		Selection* _tmp10_;
		NodeGroup* _tmp11_;
		_tmp8_ = self->priv->_map;
		_tmp9_ = mind_map_get_selected (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = _data19_->group;
		selection_add_group (_tmp10_, _tmp11_);
	}
	gtk_widget_queue_draw ((GtkWidget*) self);
	result = FALSE;
	return result;
}

static gboolean
_____lambda237__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda237_ (self);
	return result;
}

static gboolean
draw_area_select_sticker_group_on_hover (DrawArea* self,
                                         gboolean shift)
{
	Block18Data* _data18_;
	MindMap* _tmp0_;
	GSettings* _tmp1_;
	GSettings* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_data18_ = g_slice_new0 (Block18Data);
	_data18_->_ref_count_ = 1;
	_data18_->self = g_object_ref (self);
	_data18_->shift = shift;
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_settings (_tmp0_);
	_tmp2_ = _tmp1_;
	if (g_settings_get_boolean (_tmp2_, "select-on-hover")) {
		Block19Data* _data19_;
		gint timeout = 0;
		MindMap* _tmp3_;
		GSettings* _tmp4_;
		GSettings* _tmp5_;
		MindMap* _tmp6_;
		MapModel* _tmp7_;
		MapModel* _tmp8_;
		Sticker* _tmp9_;
		Sticker* _tmp10_;
		MindMap* _tmp11_;
		MapModel* _tmp12_;
		MapModel* _tmp13_;
		NodeGroup* _tmp14_;
		NodeGroup* _tmp15_;
		_data19_ = g_slice_new0 (Block19Data);
		_data19_->_ref_count_ = 1;
		_data19_->_data18_ = block18_data_ref (_data18_);
		_tmp3_ = self->priv->_map;
		_tmp4_ = mind_map_get_settings (_tmp3_);
		_tmp5_ = _tmp4_;
		timeout = g_settings_get_int (_tmp5_, "select-on-hover-timeout");
		_tmp6_ = self->priv->_map;
		_tmp7_ = mind_map_get_model (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = map_model_get_sticker_at_position (_tmp8_, self->priv->_scaled_x, self->priv->_scaled_y);
		_data19_->sticker = _tmp9_;
		_tmp10_ = _data19_->sticker;
		if (_tmp10_ != NULL) {
			self->priv->_select_hover_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) timeout, _____lambda236__gsource_func, block19_data_ref (_data19_), block19_data_unref);
			result = TRUE;
			block19_data_unref (_data19_);
			_data19_ = NULL;
			block18_data_unref (_data18_);
			_data18_ = NULL;
			return result;
		}
		_tmp11_ = self->priv->_map;
		_tmp12_ = mind_map_get_model (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = map_model_get_group_at_position (_tmp13_, self->priv->_scaled_x, self->priv->_scaled_y);
		_data19_->group = _tmp14_;
		_tmp15_ = _data19_->group;
		if (_tmp15_ != NULL) {
			self->priv->_select_hover_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) timeout, _____lambda237__gsource_func, block19_data_ref (_data19_), block19_data_unref);
			result = TRUE;
			block19_data_unref (_data19_);
			_data19_ = NULL;
			block18_data_unref (_data18_);
			_data18_ = NULL;
			return result;
		}
		block19_data_unref (_data19_);
		_data19_ = NULL;
	}
	result = FALSE;
	block18_data_unref (_data18_);
	_data18_ = NULL;
	return result;
}

static gchar*
draw_area_prepare_folded_count_markup (DrawArea* self,
                                       Node* node)
{
	gchar* tooltip = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	GArray* _tmp2_;
	GArray* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (node != NULL, NULL);
	_tmp0_ = g_strdup ("");
	tooltip = _tmp0_;
	_tmp1_ = tooltip;
	_tmp2_ = node_children (node);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf (_ ("Children: %u\n"), _tmp3_->len);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strconcat (_tmp1_, _tmp5_, NULL);
	_g_free0 (tooltip);
	tooltip = _tmp6_;
	_g_free0 (_tmp5_);
	_g_array_unref0 (_tmp3_);
	_tmp7_ = tooltip;
	_tmp8_ = g_strdup_printf (_ ("Total: %d"), node_descendant_count (node));
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strconcat (_tmp7_, _tmp9_, NULL);
	_g_free0 (tooltip);
	tooltip = _tmp10_;
	_g_free0 (_tmp9_);
	result = tooltip;
	return result;
}

static void
draw_area_on_release (DrawArea* self,
                      gint n_press,
                      gdouble x,
                      gdouble y)
{
	Node* current_node = NULL;
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	Node* _tmp3_;
	Connection* current_conn = NULL;
	MindMap* _tmp4_;
	Selection* _tmp5_;
	Selection* _tmp6_;
	Connection* _tmp7_;
	Sticker* current_sticker = NULL;
	MindMap* _tmp8_;
	Selection* _tmp9_;
	Selection* _tmp10_;
	Sticker* _tmp11_;
	Callout* current_callout = NULL;
	MindMap* _tmp12_;
	Selection* _tmp13_;
	Selection* _tmp14_;
	Callout* _tmp15_;
	SelectBox _tmp16_;
	Connection* _tmp35_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = selection_current_node (_tmp2_);
	current_node = _tmp3_;
	_tmp4_ = self->priv->_map;
	_tmp5_ = mind_map_get_selected (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = selection_current_connection (_tmp6_);
	current_conn = _tmp7_;
	_tmp8_ = self->priv->_map;
	_tmp9_ = mind_map_get_selected (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = selection_current_sticker (_tmp10_);
	current_sticker = _tmp11_;
	_tmp12_ = self->priv->_map;
	_tmp13_ = mind_map_get_selected (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = selection_current_callout (_tmp14_);
	current_callout = _tmp15_;
	draw_area_stop_autopan (self);
	self->priv->_pressed = FALSE;
	_tmp16_ = self->priv->_select_box;
	if (_tmp16_.valid) {
		SelectBox _tmp17_ = {0};
		_tmp17_.x = (gdouble) 0;
		_tmp17_.y = (gdouble) 0;
		_tmp17_.w = (gdouble) 0;
		_tmp17_.h = (gdouble) 0;
		_tmp17_.valid = FALSE;
		self->priv->_select_box = _tmp17_;
		gtk_widget_queue_draw ((GtkWidget*) self);
		_g_object_unref0 (current_callout);
		_g_object_unref0 (current_sticker);
		_g_object_unref0 (current_conn);
		_g_object_unref0 (current_node);
		return;
	}
	if (self->priv->_motion) {
		draw_area_reset_cursor (self);
	}
	if (self->priv->_resize) {
		Sticker* _tmp18_;
		MindMap* _tmp34_;
		self->priv->_resize = FALSE;
		_tmp18_ = current_sticker;
		if (_tmp18_ != NULL) {
			MindMap* _tmp19_;
			Sticker* _tmp20_;
			UndoStickerResize* _tmp21_;
			UndoStickerResize* _tmp22_;
			_tmp19_ = self->priv->_map;
			_tmp20_ = current_sticker;
			_tmp21_ = undo_sticker_resize_new (_tmp20_, self->priv->_orig_width);
			_tmp22_ = _tmp21_;
			mind_map_add_undo (_tmp19_, (UndoItem*) _tmp22_);
			_g_object_unref0 (_tmp22_);
		} else {
			Node* _tmp23_;
			_tmp23_ = current_node;
			if (_tmp23_ != NULL) {
				MindMap* _tmp24_;
				Node* _tmp25_;
				UndoNodeResize* _tmp26_;
				UndoNodeResize* _tmp27_;
				Node* _tmp28_;
				_tmp24_ = self->priv->_map;
				_tmp25_ = current_node;
				_tmp26_ = undo_node_resize_new (_tmp25_, self->priv->_orig_width, self->priv->_orig_resizable);
				_tmp27_ = _tmp26_;
				mind_map_add_undo (_tmp24_, (UndoItem*) _tmp27_);
				_g_object_unref0 (_tmp27_);
				_tmp28_ = current_node;
				node_set_image_resizable (_tmp28_, self->priv->_orig_resizable);
			} else {
				Callout* _tmp29_;
				_tmp29_ = current_callout;
				if (_tmp29_ != NULL) {
					MindMap* _tmp30_;
					Callout* _tmp31_;
					UndoCalloutResize* _tmp32_;
					UndoCalloutResize* _tmp33_;
					_tmp30_ = self->priv->_map;
					_tmp31_ = current_callout;
					_tmp32_ = undo_callout_resize_new (_tmp31_, self->priv->_orig_width);
					_tmp33_ = _tmp32_;
					mind_map_add_undo (_tmp30_, (UndoItem*) _tmp33_);
					_g_object_unref0 (_tmp33_);
				}
			}
		}
		_tmp34_ = self->priv->_map;
		mind_map_auto_save (_tmp34_);
		_g_object_unref0 (current_callout);
		_g_object_unref0 (current_sticker);
		_g_object_unref0 (current_conn);
		_g_object_unref0 (current_node);
		return;
	}
	_tmp35_ = current_conn;
	if (_tmp35_ != NULL) {
		MindMap* _tmp36_;
		MapModel* _tmp37_;
		MapModel* _tmp38_;
		Node* _tmp39_;
		Node* _tmp40_;
		_tmp36_ = self->priv->_map;
		_tmp37_ = mind_map_get_model (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = map_model_get_attach_node (_tmp38_);
		_tmp40_ = _tmp39_;
		if (_tmp40_ != NULL) {
			Connection* _tmp41_;
			ConnMode _tmp42_;
			ConnMode _tmp43_;
			_tmp41_ = current_conn;
			_tmp42_ = connection_get_mode (_tmp41_);
			_tmp43_ = _tmp42_;
			if (_tmp43_ == CONN_MODE_LINKING) {
				MindMap* _tmp44_;
				MapModel* _tmp45_;
				MapModel* _tmp46_;
				MindMap* _tmp47_;
				MapModel* _tmp48_;
				MapModel* _tmp49_;
				Node* _tmp50_;
				Node* _tmp51_;
				_tmp44_ = self->priv->_map;
				_tmp45_ = mind_map_get_model (_tmp44_);
				_tmp46_ = _tmp45_;
				_tmp47_ = self->priv->_map;
				_tmp48_ = mind_map_get_model (_tmp47_);
				_tmp49_ = _tmp48_;
				_tmp50_ = map_model_get_attach_node (_tmp49_);
				_tmp51_ = _tmp50_;
				map_model_end_link (_tmp46_, _tmp51_);
			} else {
				MindMap* _tmp52_;
				MapModel* _tmp53_;
				MapModel* _tmp54_;
				MindMap* _tmp55_;
				MapModel* _tmp56_;
				MapModel* _tmp57_;
				Node* _tmp58_;
				Node* _tmp59_;
				Connection* _tmp60_;
				_tmp52_ = self->priv->_map;
				_tmp53_ = mind_map_get_model (_tmp52_);
				_tmp54_ = _tmp53_;
				_tmp55_ = self->priv->_map;
				_tmp56_ = mind_map_get_model (_tmp55_);
				_tmp57_ = _tmp56_;
				_tmp58_ = map_model_get_attach_node (_tmp57_);
				_tmp59_ = _tmp58_;
				map_model_end_connection (_tmp54_, _tmp59_);
				_tmp60_ = self->priv->_last_connection;
				if (_tmp60_ != NULL) {
					MindMap* _tmp61_;
					Connection* _tmp62_;
					Connection* _tmp63_;
					UndoConnectionChange* _tmp64_;
					UndoConnectionChange* _tmp65_;
					_tmp61_ = self->priv->_map;
					_tmp62_ = self->priv->_last_connection;
					_tmp63_ = current_conn;
					_tmp64_ = undo_connection_change_new (_ ("connection endpoint change"), _tmp62_, _tmp63_);
					_tmp65_ = _tmp64_;
					mind_map_add_undo (_tmp61_, (UndoItem*) _tmp65_);
					_g_object_unref0 (_tmp65_);
				}
			}
			_g_object_unref0 (self->priv->_last_connection);
			self->priv->_last_connection = NULL;
		} else {
			Connection* _tmp66_;
			ConnMode _tmp67_;
			ConnMode _tmp68_;
			_tmp66_ = current_conn;
			_tmp67_ = connection_get_mode (_tmp66_);
			_tmp68_ = _tmp67_;
			if (_tmp68_ == CONN_MODE_ADJUSTING) {
				MindMap* _tmp69_;
				Connection* _tmp70_;
				Connection* _tmp71_;
				UndoConnectionChange* _tmp72_;
				UndoConnectionChange* _tmp73_;
				MindMap* _tmp74_;
				Selection* _tmp75_;
				Selection* _tmp76_;
				Connection* _tmp77_;
				MindMap* _tmp78_;
				_tmp69_ = self->priv->_map;
				_tmp70_ = self->priv->_last_connection;
				_tmp71_ = current_conn;
				_tmp72_ = undo_connection_change_new (_ ("connection drag"), _tmp70_, _tmp71_);
				_tmp73_ = _tmp72_;
				mind_map_add_undo (_tmp69_, (UndoItem*) _tmp73_);
				_g_object_unref0 (_tmp73_);
				_tmp74_ = self->priv->_map;
				_tmp75_ = mind_map_get_selected (_tmp74_);
				_tmp76_ = _tmp75_;
				_tmp77_ = current_conn;
				selection_set_current_connection (_tmp76_, _tmp77_, 1.0);
				_tmp78_ = self->priv->_map;
				mind_map_auto_save (_tmp78_);
			} else {
				Connection* _tmp79_;
				_tmp79_ = self->priv->_last_connection;
				if (_tmp79_ != NULL) {
					Connection* _tmp80_;
					MindMap* _tmp81_;
					Connection* _tmp82_;
					_tmp80_ = current_conn;
					_tmp81_ = self->priv->_map;
					_tmp82_ = self->priv->_last_connection;
					connection_copy (_tmp80_, _tmp81_, _tmp82_);
					_g_object_unref0 (self->priv->_last_connection);
					self->priv->_last_connection = NULL;
				}
			}
		}
		gtk_widget_queue_draw ((GtkWidget*) self);
	} else {
		Node* _tmp83_;
		_tmp83_ = current_node;
		if (_tmp83_ != NULL) {
			Node* _tmp84_;
			NodeMode _tmp85_;
			NodeMode _tmp86_;
			_tmp84_ = current_node;
			_tmp85_ = node_get_mode (_tmp84_);
			_tmp86_ = _tmp85_;
			if (_tmp86_ == NODE_MODE_CURRENT) {
				MindMap* _tmp87_;
				MapModel* _tmp88_;
				MapModel* _tmp89_;
				Node* _tmp90_;
				Node* _tmp91_;
				_tmp87_ = self->priv->_map;
				_tmp88_ = mind_map_get_model (_tmp87_);
				_tmp89_ = _tmp88_;
				_tmp90_ = map_model_get_attach_node (_tmp89_);
				_tmp91_ = _tmp90_;
				if (_tmp91_ != NULL) {
					MindMap* _tmp92_;
					MapModel* _tmp93_;
					MapModel* _tmp94_;
					_tmp92_ = self->priv->_map;
					_tmp93_ = mind_map_get_model (_tmp92_);
					_tmp94_ = _tmp93_;
					map_model_attach_current_node (_tmp94_);
				} else {
					if (self->priv->_motion) {
						gboolean _tmp95_ = FALSE;
						Node* _tmp96_;
						Node* _tmp97_;
						Node* _tmp98_;
						_tmp96_ = current_node;
						_tmp97_ = node_get_parent (_tmp96_);
						_tmp98_ = _tmp97_;
						if (_tmp98_ != NULL) {
							MindMap* _tmp99_;
							gboolean _tmp100_;
							gboolean _tmp101_;
							_tmp99_ = self->priv->_map;
							_tmp100_ = mind_map_get_editable (_tmp99_);
							_tmp101_ = _tmp100_;
							_tmp95_ = _tmp101_;
						} else {
							_tmp95_ = FALSE;
						}
						if (_tmp95_) {
							gint orig_index = 0;
							Node* _tmp102_;
							SummaryNode* orig_summary = NULL;
							Node* _tmp103_;
							SummaryNode* _tmp104_;
							gboolean moved = FALSE;
							Animator* _tmp105_;
							MindMap* _tmp106_;
							GArray* _tmp107_;
							GArray* _tmp108_;
							Node* _tmp109_;
							Node* _tmp110_;
							Node* _tmp111_;
							Node* _tmp115_;
							gboolean _tmp122_ = FALSE;
							Node* _tmp123_;
							Animator* _tmp160_;
							MindMap* _tmp161_;
							MapModel* _tmp162_;
							MapModel* _tmp163_;
							_tmp102_ = current_node;
							orig_index = node_index (_tmp102_);
							_tmp103_ = current_node;
							_tmp104_ = node_summary_node (_tmp103_);
							orig_summary = _tmp104_;
							moved = FALSE;
							_tmp105_ = self->priv->_animator;
							_tmp106_ = self->priv->_map;
							_tmp107_ = mind_map_get_nodes (_tmp106_);
							_tmp108_ = _tmp107_;
							animator_add_nodes (_tmp105_, _tmp108_, FALSE, "move to position");
							_g_array_unref0 (_tmp108_);
							_tmp109_ = current_node;
							_tmp110_ = node_get_parent (_tmp109_);
							_tmp111_ = _tmp110_;
							if (_tmp111_ != NULL) {
								Node* _tmp112_;
								Node* _tmp113_;
								Node* _tmp114_;
								_tmp112_ = current_node;
								_tmp113_ = node_get_parent (_tmp112_);
								_tmp114_ = _tmp113_;
								node_clear_summary_extents (_tmp114_);
							}
							_tmp115_ = current_node;
							if (node_is_summary (_tmp115_)) {
								Node* _tmp116_;
								_tmp116_ = current_node;
								summary_node_nodes_changed (IS_SUMMARY_NODE (_tmp116_) ? ((SummaryNode*) _tmp116_) : NULL, (gdouble) 1, (gdouble) 1, "");
							} else {
								Node* _tmp117_;
								Node* _tmp118_;
								Node* _tmp119_;
								Node* _tmp120_;
								_tmp117_ = current_node;
								_tmp118_ = node_get_parent (_tmp117_);
								_tmp119_ = _tmp118_;
								_tmp120_ = current_node;
								moved = node_move_to_position (_tmp119_, _tmp120_, self->priv->_orig_side, draw_area_scale_value (self, x), draw_area_scale_value (self, y));
								if (!moved) {
									Animator* _tmp121_;
									_tmp121_ = self->priv->_animator;
									animator_clear_last_save (_tmp121_);
								}
							}
							_tmp123_ = current_node;
							if (!node_is_summarized (_tmp123_)) {
								MindMap* _tmp124_;
								MapModel* _tmp125_;
								MapModel* _tmp126_;
								SummaryNode* _tmp127_;
								SummaryNode* _tmp128_;
								_tmp124_ = self->priv->_map;
								_tmp125_ = mind_map_get_model (_tmp124_);
								_tmp126_ = _tmp125_;
								_tmp127_ = map_model_get_attach_summary (_tmp126_);
								_tmp128_ = _tmp127_;
								_tmp122_ = _tmp128_ != NULL;
							} else {
								_tmp122_ = FALSE;
							}
							if (_tmp122_) {
								MindMap* _tmp129_;
								MapModel* _tmp130_;
								MapModel* _tmp131_;
								SummaryNode* _tmp132_;
								SummaryNode* _tmp133_;
								Node* _tmp134_;
								_tmp129_ = self->priv->_map;
								_tmp130_ = mind_map_get_model (_tmp129_);
								_tmp131_ = _tmp130_;
								_tmp132_ = map_model_get_attach_summary (_tmp131_);
								_tmp133_ = _tmp132_;
								_tmp134_ = current_node;
								summary_node_add_node (_tmp133_, _tmp134_);
							} else {
								gboolean _tmp135_ = FALSE;
								gboolean _tmp136_ = FALSE;
								Node* _tmp137_;
								_tmp137_ = current_node;
								if (node_is_summarized (_tmp137_)) {
									Node* _tmp138_;
									SummaryNode* _tmp139_;
									SummaryNode* _tmp140_;
									_tmp138_ = current_node;
									_tmp139_ = node_summary_node (_tmp138_);
									_tmp140_ = _tmp139_;
									_tmp136_ = summary_node_summarized_count (_tmp140_) > 1;
									_g_object_unref0 (_tmp140_);
								} else {
									_tmp136_ = FALSE;
								}
								if (_tmp136_) {
									MindMap* _tmp141_;
									MapModel* _tmp142_;
									MapModel* _tmp143_;
									SummaryNode* _tmp144_;
									SummaryNode* _tmp145_;
									_tmp141_ = self->priv->_map;
									_tmp142_ = mind_map_get_model (_tmp141_);
									_tmp143_ = _tmp142_;
									_tmp144_ = map_model_get_attach_summary (_tmp143_);
									_tmp145_ = _tmp144_;
									_tmp135_ = _tmp145_ == NULL;
								} else {
									_tmp135_ = FALSE;
								}
								if (_tmp135_) {
									Node* _tmp146_;
									SummaryNode* _tmp147_;
									SummaryNode* _tmp148_;
									Node* _tmp149_;
									_tmp146_ = current_node;
									_tmp147_ = node_summary_node (_tmp146_);
									_tmp148_ = _tmp147_;
									_tmp149_ = current_node;
									summary_node_remove_node (_tmp148_, _tmp149_);
									_g_object_unref0 (_tmp148_);
								} else {
									Node* _tmp150_;
									_tmp150_ = current_node;
									if (node_is_summarized (_tmp150_)) {
										Node* _tmp151_;
										SummaryNode* _tmp152_;
										SummaryNode* _tmp153_;
										Node* _tmp154_;
										_tmp151_ = current_node;
										_tmp152_ = node_summary_node (_tmp151_);
										_tmp153_ = _tmp152_;
										_tmp154_ = current_node;
										summary_node_node_moved (_tmp153_, _tmp154_);
										_g_object_unref0 (_tmp153_);
									}
								}
							}
							if (moved) {
								MindMap* _tmp155_;
								Node* _tmp156_;
								SummaryNode* _tmp157_;
								UndoNodeMove* _tmp158_;
								UndoNodeMove* _tmp159_;
								_tmp155_ = self->priv->_map;
								_tmp156_ = current_node;
								_tmp157_ = orig_summary;
								_tmp158_ = undo_node_move_new (_tmp156_, self->priv->_orig_side, orig_index, _tmp157_);
								_tmp159_ = _tmp158_;
								mind_map_add_undo (_tmp155_, (UndoItem*) _tmp159_);
								_g_object_unref0 (_tmp159_);
							}
							_tmp160_ = self->priv->_animator;
							animator_animate (_tmp160_);
							_tmp161_ = self->priv->_map;
							_tmp162_ = mind_map_get_model (_tmp161_);
							_tmp163_ = _tmp162_;
							map_model_set_attach_summary (_tmp163_, NULL);
							_g_object_unref0 (orig_summary);
						} else {
							gtk_widget_queue_draw ((GtkWidget*) self);
						}
					}
				}
			}
		} else {
			MindMap* _tmp164_;
			Selection* _tmp165_;
			Selection* _tmp166_;
			_tmp164_ = self->priv->_map;
			_tmp165_ = mind_map_get_selected (_tmp164_);
			_tmp166_ = _tmp165_;
			if (selection_num_nodes (_tmp166_) > 1) {
				GArray* nodes = NULL;
				MindMap* _tmp167_;
				Selection* _tmp168_;
				Selection* _tmp169_;
				GArray* _tmp170_;
				MindMap* _tmp171_;
				MapModel* _tmp172_;
				MapModel* _tmp173_;
				Node* _tmp174_;
				Node* _tmp175_;
				_tmp167_ = self->priv->_map;
				_tmp168_ = mind_map_get_selected (_tmp167_);
				_tmp169_ = _tmp168_;
				_tmp170_ = selection_nodes (_tmp169_);
				nodes = _tmp170_;
				_tmp171_ = self->priv->_map;
				_tmp172_ = mind_map_get_model (_tmp171_);
				_tmp173_ = _tmp172_;
				_tmp174_ = map_model_get_attach_node (_tmp173_);
				_tmp175_ = _tmp174_;
				if (_tmp175_ != NULL) {
					MindMap* _tmp176_;
					_tmp176_ = self->priv->_map;
					mind_map_attach_selected_nodes (_tmp176_);
				} else {
					gboolean _tmp177_ = FALSE;
					if (!self->priv->_motion) {
						_tmp177_ = !self->priv->_shift;
					} else {
						_tmp177_ = FALSE;
					}
					if (_tmp177_) {
						MapItemComponent component = 0;
						Node* match_node = NULL;
						MindMap* _tmp178_;
						MapModel* _tmp179_;
						MapModel* _tmp180_;
						gdouble _tmp181_;
						gdouble _tmp182_;
						gdouble _tmp183_;
						gdouble _tmp184_;
						MapItemComponent _tmp185_ = 0;
						Node* _tmp186_;
						MindMap* _tmp187_;
						Node* _tmp188_;
						_tmp178_ = self->priv->_map;
						_tmp179_ = mind_map_get_model (_tmp178_);
						_tmp180_ = _tmp179_;
						_tmp181_ = draw_area_get_scaled_x (self);
						_tmp182_ = _tmp181_;
						_tmp183_ = draw_area_get_scaled_y (self);
						_tmp184_ = _tmp183_;
						_tmp186_ = map_model_get_node_at_position (_tmp180_, _tmp182_, _tmp184_, &_tmp185_);
						component = _tmp185_;
						match_node = _tmp186_;
						_tmp187_ = self->priv->_map;
						_tmp188_ = match_node;
						if (mind_map_select_node (_tmp187_, _tmp188_, TRUE)) {
							MindMap* _tmp189_;
							gtk_widget_queue_draw ((GtkWidget*) self);
							draw_area_see (self, TRUE, (gdouble) 0, 100.0);
							_tmp189_ = self->priv->_map;
							mind_map_auto_save (_tmp189_);
						}
						_g_object_unref0 (match_node);
					} else {
						gboolean _tmp190_ = FALSE;
						if (self->priv->_motion) {
							gboolean _tmp191_ = FALSE;
							GArray* _tmp192_;
							Node* _tmp193_;
							Layout* _tmp194_;
							Layout* _tmp195_;
							_tmp192_ = nodes;
							_tmp193_ = g_array_index (_tmp192_, Node*, (guint) 0);
							_tmp194_ = node_get_layout (_tmp193_);
							_tmp195_ = _tmp194_;
							if (_tmp195_ == NULL) {
								_tmp191_ = TRUE;
							} else {
								GArray* _tmp196_;
								Node* _tmp197_;
								Layout* _tmp198_;
								Layout* _tmp199_;
								_tmp196_ = nodes;
								_tmp197_ = g_array_index (_tmp196_, Node*, (guint) 0);
								_tmp198_ = node_get_layout (_tmp197_);
								_tmp199_ = _tmp198_;
								_tmp191_ = !layout_is_manual (_tmp199_);
							}
							_tmp190_ = _tmp191_;
						} else {
							_tmp190_ = FALSE;
						}
						if (_tmp190_) {
							Animator* _tmp200_;
							MindMap* _tmp201_;
							GArray* _tmp202_;
							GArray* _tmp203_;
							Animator* _tmp209_;
							_tmp200_ = self->priv->_animator;
							_tmp201_ = self->priv->_map;
							_tmp202_ = mind_map_get_nodes (_tmp201_);
							_tmp203_ = _tmp202_;
							animator_add_nodes (_tmp200_, _tmp203_, FALSE, "return nodes");
							_g_array_unref0 (_tmp203_);
							{
								gint i = 0;
								i = 0;
								{
									gboolean _tmp204_ = FALSE;
									_tmp204_ = TRUE;
									while (TRUE) {
										GArray* _tmp206_;
										GArray* _tmp207_;
										Node* _tmp208_;
										if (!_tmp204_) {
											gint _tmp205_;
											_tmp205_ = i;
											i = _tmp205_ + 1;
										}
										_tmp204_ = FALSE;
										_tmp206_ = nodes;
										if (!(((guint) i) < _tmp206_->len)) {
											break;
										}
										_tmp207_ = nodes;
										_tmp208_ = g_array_index (_tmp207_, Node*, (guint) i);
										node_return_to_position (_tmp208_);
									}
								}
							}
							_tmp209_ = self->priv->_animator;
							animator_animate (_tmp209_);
						}
					}
				}
				{
					gint i = 0;
					i = 0;
					{
						gboolean _tmp210_ = FALSE;
						_tmp210_ = TRUE;
						while (TRUE) {
							GArray* _tmp212_;
							GArray* _tmp213_;
							Node* _tmp214_;
							if (!_tmp210_) {
								gint _tmp211_;
								_tmp211_ = i;
								i = _tmp211_ + 1;
							}
							_tmp210_ = FALSE;
							_tmp212_ = nodes;
							if (!(((guint) i) < _tmp212_->len)) {
								break;
							}
							_tmp213_ = nodes;
							_tmp214_ = g_array_index (_tmp213_, Node*, (guint) i);
							node_set_alpha_only (_tmp214_, 1.0);
						}
					}
				}
				_g_array_unref0 (nodes);
			} else {
				gboolean _tmp215_ = FALSE;
				Sticker* _tmp216_;
				_tmp216_ = current_sticker;
				if (_tmp216_ != NULL) {
					MindMap* _tmp217_;
					gboolean _tmp218_;
					gboolean _tmp219_;
					_tmp217_ = self->priv->_map;
					_tmp218_ = mind_map_get_editable (_tmp217_);
					_tmp219_ = _tmp218_;
					_tmp215_ = _tmp219_;
				} else {
					_tmp215_ = FALSE;
				}
				if (_tmp215_) {
					Sticker* _tmp220_;
					StickerMode _tmp221_;
					StickerMode _tmp222_;
					_tmp220_ = current_sticker;
					_tmp221_ = sticker_get_mode (_tmp220_);
					_tmp222_ = _tmp221_;
					if (_tmp222_ == STICKER_MODE_SELECTED) {
						MindMap* _tmp223_;
						Sticker* _tmp224_;
						UndoStickerMove* _tmp225_;
						UndoStickerMove* _tmp226_;
						_tmp223_ = self->priv->_map;
						_tmp224_ = current_sticker;
						_tmp225_ = undo_sticker_move_new (_tmp224_, self->priv->_sticker_posx, self->priv->_sticker_posy);
						_tmp226_ = _tmp225_;
						mind_map_add_undo (_tmp223_, (UndoItem*) _tmp226_);
						_g_object_unref0 (_tmp226_);
					}
				}
			}
		}
	}
	if (self->priv->_motion) {
		Node* _tmp227_;
		_tmp227_ = current_node;
		if (_tmp227_ != NULL) {
			Node* _tmp228_;
			_tmp228_ = current_node;
			node_set_alpha (_tmp228_, 1.0);
		}
		self->priv->_motion = FALSE;
	}
	_g_object_unref0 (current_callout);
	_g_object_unref0 (current_sticker);
	_g_object_unref0 (current_conn);
	_g_object_unref0 (current_node);
}

static Block20Data*
block20_data_ref (Block20Data* _data20_)
{
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}

static void
block20_data_unref (void * _userdata_)
{
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		DrawArea* self;
		self = _data20_->self;
		_g_object_unref0 (_data20_->text);
		_g_object_unref0 (self);
		g_slice_free (Block20Data, _data20_);
	}
}

static void
__lambda120_ (Block20Data* _data20_,
              const gchar* txt)
{
	DrawArea* self;
	MindMap* _tmp0_;
	UndoTextBuffer* _tmp1_;
	UndoTextBuffer* _tmp2_;
	self = _data20_->self;
	g_return_if_fail (txt != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_undo_text (_tmp0_);
	_tmp2_ = _tmp1_;
	canvas_text_insert (_data20_->text, txt, _tmp2_);
	gtk_widget_grab_focus ((GtkWidget*) self);
	gtk_widget_queue_draw ((GtkWidget*) self);
}

static void
___lambda120__gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                              const gchar* text,
                                              gpointer self)
{
	__lambda120_ (self, text);
}

void
draw_area_insert_emoji (DrawArea* self,
                        CanvasText* text)
{
	Block20Data* _data20_;
	CanvasText* _tmp0_;
	gint x = 0;
	gint ytop = 0;
	gint ybot = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint _tmp3_ = 0;
	GdkRectangle rect = {0};
	GdkRectangle _tmp4_ = {0};
	GtkEmojiChooser* emoji = NULL;
	GdkRectangle _tmp5_;
	GtkEmojiChooser* _tmp6_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_data20_ = g_slice_new0 (Block20Data);
	_data20_->_ref_count_ = 1;
	_data20_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (text);
	_g_object_unref0 (_data20_->text);
	_data20_->text = _tmp0_;
	canvas_text_get_cursor_pos (_data20_->text, &_tmp1_, &_tmp2_, &_tmp3_);
	x = _tmp1_;
	ytop = _tmp2_;
	ybot = _tmp3_;
	_tmp4_.x = x;
	_tmp4_.y = ytop + ((ybot - ytop) / 2);
	_tmp4_.width = 1;
	_tmp4_.height = 1;
	rect = _tmp4_;
	_tmp5_ = rect;
	_tmp6_ = (GtkEmojiChooser*) gtk_emoji_chooser_new ();
	g_object_set ((GtkPopover*) _tmp6_, "pointing-to", &_tmp5_, NULL);
	g_object_ref_sink (_tmp6_);
	emoji = _tmp6_;
	gtk_widget_set_parent ((GtkWidget*) emoji, (GtkWidget*) self);
	gtk_popover_popup ((GtkPopover*) emoji);
	g_signal_connect_data (emoji, "emoji-picked", (GCallback) ___lambda120__gtk_emoji_chooser_emoji_picked, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
	_g_object_unref0 (emoji);
	block20_data_unref (_data20_);
	_data20_ = NULL;
}

static void
draw_area_handle_im_commit (DrawArea* self,
                            const gchar* str)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (str != NULL);
	draw_area_insert_text (self, str);
}

static gunichar
string_get_char (const gchar* self,
                 glong index)
{
	gunichar result;
	g_return_val_if_fail (self != NULL, 0U);
	result = g_utf8_get_char (((gchar*) self) + index);
	return result;
}

static gboolean
draw_area_insert_text (DrawArea* self,
                       const gchar* str)
{
	CanvasText* text = NULL;
	MindMap* _tmp0_;
	CanvasText* _tmp1_;
	CanvasText* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (str != NULL, FALSE);
	if (!g_unichar_isprint (string_get_char (str, (glong) 0))) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_current_text (_tmp0_);
	text = _tmp1_;
	_tmp2_ = text;
	if (_tmp2_ != NULL) {
		CanvasText* _tmp3_;
		MindMap* _tmp4_;
		UndoTextBuffer* _tmp5_;
		UndoTextBuffer* _tmp6_;
		_tmp3_ = text;
		_tmp4_ = self->priv->_map;
		_tmp5_ = mind_map_get_undo_text (_tmp4_);
		_tmp6_ = _tmp5_;
		canvas_text_insert (_tmp3_, str, _tmp6_);
		draw_area_see (self, TRUE, (gdouble) 0, 100.0);
		gtk_widget_queue_draw ((GtkWidget*) self);
		result = TRUE;
		_g_object_unref0 (text);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (text);
	return result;
}

static gint
string_index_of_nth_char (const gchar* self,
                          glong c)
{
	gchar* _tmp0_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = g_utf8_offset_to_pointer (self, c);
	result = (gint) (_tmp0_ - ((gchar*) self));
	return result;
}

static void
draw_area_retrieve_surrounding_in_text (DrawArea* self,
                                        CanvasText* ct)
{
	gint cursor = 0;
	gint selstart = 0;
	gint selend = 0;
	gchar* text = NULL;
	FormattedText* _tmp0_;
	FormattedText* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gint _tmp5_ = 0;
	gint _tmp6_ = 0;
	gint _tmp7_ = 0;
	GtkIMContext* _tmp8_;
	gint _tmp9_;
	gint _tmp10_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ct != NULL);
	_tmp0_ = canvas_text_get_text (ct);
	_tmp1_ = _tmp0_;
	_tmp2_ = formatted_text_get_text (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup (_tmp3_);
	text = _tmp4_;
	canvas_text_get_cursor_info (ct, &_tmp5_, &_tmp6_, &_tmp7_);
	cursor = _tmp5_;
	selstart = _tmp6_;
	selend = _tmp7_;
	_tmp8_ = self->priv->_im_context;
	_tmp9_ = strlen (text);
	_tmp10_ = _tmp9_;
	gtk_im_context_set_surrounding (_tmp8_, text, _tmp10_, string_index_of_nth_char (text, (glong) cursor));
	_g_free0 (text);
}

static gboolean
draw_area_handle_im_retrieve_surrounding (DrawArea* self)
{
	CanvasText* text = NULL;
	MindMap* _tmp0_;
	CanvasText* _tmp1_;
	CanvasText* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_current_text (_tmp0_);
	text = _tmp1_;
	_tmp2_ = text;
	if (_tmp2_ != NULL) {
		CanvasText* _tmp3_;
		_tmp3_ = text;
		draw_area_retrieve_surrounding_in_text (self, _tmp3_);
		result = TRUE;
		_g_object_unref0 (text);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (text);
	return result;
}

static void
draw_area_delete_surrounding_in_text (DrawArea* self,
                                      CanvasText* ct,
                                      gint offset,
                                      gint chars)
{
	gint cursor = 0;
	gint selstart = 0;
	gint selend = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	gint _tmp2_ = 0;
	gint startpos = 0;
	gint endpos = 0;
	MindMap* _tmp3_;
	UndoTextBuffer* _tmp4_;
	UndoTextBuffer* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ct != NULL);
	canvas_text_get_cursor_info (ct, &_tmp0_, &_tmp1_, &_tmp2_);
	cursor = _tmp0_;
	selstart = _tmp1_;
	selend = _tmp2_;
	startpos = cursor - offset;
	endpos = startpos + chars;
	_tmp3_ = self->priv->_map;
	_tmp4_ = mind_map_get_undo_text (_tmp3_);
	_tmp5_ = _tmp4_;
	canvas_text_delete_range (ct, startpos, endpos, _tmp5_);
}

static gboolean
draw_area_handle_im_delete_surrounding (DrawArea* self,
                                        gint offset,
                                        gint nchars)
{
	CanvasText* text = NULL;
	MindMap* _tmp0_;
	CanvasText* _tmp1_;
	CanvasText* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_current_text (_tmp0_);
	text = _tmp1_;
	_tmp2_ = text;
	if (_tmp2_ != NULL) {
		CanvasText* _tmp3_;
		_tmp3_ = text;
		draw_area_delete_surrounding_in_text (self, _tmp3_, offset, nchars);
		result = TRUE;
		_g_object_unref0 (text);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (text);
	return result;
}

static gboolean
draw_area_on_keypress (DrawArea* self,
                       guint keyval,
                       guint keycode,
                       GdkModifierType state)
{
	Animator* _tmp0_;
	MainWindow* _tmp1_;
	Shortcuts* _tmp2_;
	Shortcuts* _tmp3_;
	MindMap* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (self->priv->_pressed) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->_animator;
	animator_flush (_tmp0_);
	switch (keyval) {
		case GDK_KEY_Control_L:
		case GDK_KEY_Control_R:
		{
			self->priv->_control = TRUE;
			draw_area_handle_control (self, TRUE);
			break;
		}
		case GDK_KEY_Shift_L:
		case GDK_KEY_Shift_R:
		{
			self->priv->_shift = TRUE;
			break;
		}
		case GDK_KEY_Alt_L:
		case GDK_KEY_Alt_R:
		{
			self->priv->_alt = TRUE;
			break;
		}
		default:
		break;
	}
	_tmp1_ = self->priv->_win;
	_tmp2_ = main_window_get_shortcuts (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->_map;
	if (shortcuts_execute (_tmp3_, _tmp4_, keyval, keycode, state)) {
		result = TRUE;
		return result;
	} else {
		gboolean _tmp5_ = FALSE;
		gboolean _tmp6_ = FALSE;
		MindMap* _tmp7_;
		_tmp7_ = self->priv->_map;
		if (mind_map_is_node_editable (_tmp7_)) {
			_tmp6_ = TRUE;
		} else {
			MindMap* _tmp8_;
			_tmp8_ = self->priv->_map;
			_tmp6_ = mind_map_is_connection_editable (_tmp8_);
		}
		if (_tmp6_) {
			_tmp5_ = TRUE;
		} else {
			MindMap* _tmp9_;
			_tmp9_ = self->priv->_map;
			_tmp5_ = mind_map_is_callout_editable (_tmp9_);
		}
		if (_tmp5_) {
			GtkIMContext* _tmp10_;
			GtkEventControllerKey* _tmp11_;
			GdkEvent* _tmp12_;
			_tmp10_ = self->priv->_im_context;
			_tmp11_ = self->priv->_key_controller;
			_tmp12_ = gtk_event_controller_get_current_event ((GtkEventController*) _tmp11_);
			gtk_im_context_filter_keypress (_tmp10_, _tmp12_);
			result = FALSE;
			return result;
		}
	}
	result = TRUE;
	return result;
}

static void
draw_area_on_keyrelease (DrawArea* self,
                         guint keyval,
                         guint keycode,
                         GdkModifierType state)
{
	g_return_if_fail (self != NULL);
	switch (keyval) {
		case GDK_KEY_Control_L:
		case GDK_KEY_Control_R:
		{
			self->priv->_control = FALSE;
			draw_area_handle_control (self, FALSE);
			break;
		}
		case GDK_KEY_Shift_L:
		case GDK_KEY_Shift_R:
		{
			self->priv->_shift = FALSE;
			break;
		}
		case GDK_KEY_Alt_L:
		case GDK_KEY_Alt_R:
		{
			self->priv->_alt = FALSE;
			break;
		}
		default:
		break;
	}
}

static void
draw_area_on_focus_leave (DrawArea* self)
{
	g_return_if_fail (self != NULL);
	self->priv->_control = FALSE;
	self->priv->_shift = FALSE;
	self->priv->_alt = FALSE;
}

void
draw_area_handle_control (DrawArea* self,
                          gboolean pressed)
{
	FormatTag tag = 0;
	gchar* url = NULL;
	gchar* _tmp0_;
	MapItemComponent component = 0;
	Node* match = NULL;
	MindMap* _tmp1_;
	MapModel* _tmp2_;
	MapModel* _tmp3_;
	MapItemComponent _tmp4_ = 0;
	Node* _tmp5_;
	gboolean _tmp6_ = FALSE;
	Node* _tmp7_;
	Callout* callout = NULL;
	MindMap* _tmp15_;
	MapModel* _tmp16_;
	MapModel* _tmp17_;
	MapItemComponent _tmp18_ = 0;
	Callout* _tmp19_;
	gboolean _tmp20_ = FALSE;
	Callout* _tmp21_;
	g_return_if_fail (self != NULL);
	tag = FORMAT_TAG_LENGTH;
	_tmp0_ = g_strdup ("");
	url = _tmp0_;
	_tmp1_ = self->priv->_map;
	_tmp2_ = mind_map_get_model (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp5_ = map_model_get_node_at_position (_tmp3_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp4_);
	component = _tmp4_;
	match = _tmp5_;
	_tmp7_ = match;
	if (_tmp7_ != NULL) {
		Node* _tmp8_;
		CanvasText* _tmp9_;
		CanvasText* _tmp10_;
		FormatTag _tmp11_ = 0;
		gchar* _tmp12_ = NULL;
		gboolean _tmp13_;
		_tmp8_ = match;
		_tmp9_ = node_get_name (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp13_ = canvas_text_is_within_clickable (_tmp10_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp11_, &_tmp12_);
		tag = _tmp11_;
		_g_free0 (url);
		url = _tmp12_;
		_tmp6_ = _tmp13_;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		if (tag == FORMAT_TAG_URL) {
			if (pressed) {
				const gchar* _tmp14_;
				draw_area_set_cursor_name (self, DRAW_AREA_pointer_cursor);
				_tmp14_ = url;
				gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp14_);
			} else {
				draw_area_reset_cursor (self);
				gtk_widget_set_tooltip_markup ((GtkWidget*) self, NULL);
			}
		}
		_g_object_unref0 (match);
		_g_free0 (url);
		return;
	}
	_tmp15_ = self->priv->_map;
	_tmp16_ = mind_map_get_model (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp19_ = map_model_get_callout_at_position (_tmp17_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp18_);
	component = _tmp18_;
	callout = _tmp19_;
	_tmp21_ = callout;
	if (_tmp21_ != NULL) {
		Callout* _tmp22_;
		CanvasText* _tmp23_;
		CanvasText* _tmp24_;
		FormatTag _tmp25_ = 0;
		gchar* _tmp26_ = NULL;
		gboolean _tmp27_;
		_tmp22_ = callout;
		_tmp23_ = callout_get_text (_tmp22_);
		_tmp24_ = _tmp23_;
		_tmp27_ = canvas_text_is_within_clickable (_tmp24_, self->priv->_scaled_x, self->priv->_scaled_y, &_tmp25_, &_tmp26_);
		tag = _tmp25_;
		_g_free0 (url);
		url = _tmp26_;
		_tmp20_ = _tmp27_;
	} else {
		_tmp20_ = FALSE;
	}
	if (_tmp20_) {
		if (tag == FORMAT_TAG_URL) {
			if (pressed) {
				const gchar* _tmp28_;
				draw_area_set_cursor_name (self, DRAW_AREA_pointer_cursor);
				_tmp28_ = url;
				gtk_widget_set_tooltip_markup ((GtkWidget*) self, _tmp28_);
			} else {
				draw_area_reset_cursor (self);
				gtk_widget_set_tooltip_markup ((GtkWidget*) self, NULL);
			}
		}
	}
	_g_object_unref0 (callout);
	_g_object_unref0 (match);
	_g_free0 (url);
}

static gboolean
draw_area_on_scroll (DrawArea* self,
                     gdouble delta_x,
                     gdouble delta_y)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (self->priv->_shift) {
		_tmp0_ = !self->priv->_control;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gdouble tmp = 0.0;
		tmp = delta_x;
		delta_x = delta_y;
		delta_y = tmp;
	} else {
		if (self->priv->_control) {
			if (delta_y < ((gdouble) 0)) {
				draw_area_zoom_in_coords (self, self->priv->_motion_x, self->priv->_motion_y);
			} else {
				if (delta_y > ((gdouble) 0)) {
					draw_area_zoom_out_coords (self, self->priv->_motion_x, self->priv->_motion_y);
				}
			}
			result = FALSE;
			return result;
		}
	}
	draw_area_move_origin (self, (0 - delta_x) * 120, (0 - delta_y) * 120, NULL);
	gtk_widget_queue_draw ((GtkWidget*) self);
	draw_area_scroll_save (self);
	result = FALSE;
	return result;
}

static gboolean
_draw_area_do_scroll_save_gsource_func (gpointer self)
{
	gboolean result;
	result = draw_area_do_scroll_save ((DrawArea*) self);
	return result;
}

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

static gpointer
__uint_dup0 (gpointer self)
{
	return self ? _uint_dup (self) : NULL;
}

void
draw_area_scroll_save (DrawArea* self)
{
	guint* _tmp0_;
	guint _tmp2_;
	guint* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_scroll_save_id;
	if (_tmp0_ != NULL) {
		guint* _tmp1_;
		_tmp1_ = self->priv->_scroll_save_id;
		g_source_remove (*_tmp1_);
	}
	_tmp2_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, _draw_area_do_scroll_save_gsource_func, g_object_ref (self), g_object_unref);
	_tmp3_ = __uint_dup0 (&_tmp2_);
	_g_free0 (self->priv->_scroll_save_id);
	self->priv->_scroll_save_id = _tmp3_;
}

static gboolean
draw_area_do_scroll_save (DrawArea* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_g_free0 (self->priv->_scroll_save_id);
	self->priv->_scroll_save_id = NULL;
	g_signal_emit (self, draw_area_signals[DRAW_AREA_SCROLL_CHANGED_SIGNAL], 0);
	result = FALSE;
	return result;
}

static gboolean
draw_area_handle_drop_accept (DrawArea* self,
                              GdkDrop* drop)
{
	MindMap* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (drop != NULL, FALSE);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_editable (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static GdkDragAction
draw_area_handle_text_drag_motion (DrawArea* self,
                                   gdouble x,
                                   gdouble y)
{
	gdouble scaled_x = 0.0;
	gdouble scaled_y = 0.0;
	Node* node = NULL;
	MindMap* _tmp0_;
	MapModel* _tmp1_;
	MapModel* _tmp2_;
	Node* _tmp3_;
	MindMap* _tmp4_;
	MapModel* _tmp5_;
	MapModel* _tmp6_;
	GdkDragAction result;
	g_return_val_if_fail (self != NULL, 0U);
	scaled_x = draw_area_scale_value (self, x);
	scaled_y = draw_area_scale_value (self, y);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_model (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = map_model_get_droppable_node (_tmp2_, scaled_x, scaled_y);
	node = _tmp3_;
	_tmp4_ = self->priv->_map;
	_tmp5_ = mind_map_get_model (_tmp4_);
	_tmp6_ = _tmp5_;
	map_model_set_attach_node (_tmp6_, node, NODE_MODE_DROPPABLE);
	result = GDK_ACTION_COPY;
	_g_object_unref0 (node);
	return result;
}

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

static gboolean
draw_area_handle_text_drop (DrawArea* self,
                            GValue* val,
                            gdouble x,
                            gdouble y)
{
	MindMap* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	Node* node = NULL;
	gchar* text = NULL;
	GValue _tmp3_;
	gchar* _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp15_ = FALSE;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gboolean _tmp19_;
	gboolean _tmp23_ = FALSE;
	MindMap* _tmp24_;
	MapModel* _tmp25_;
	MapModel* _tmp26_;
	Node* _tmp27_;
	Node* _tmp28_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (val != NULL, FALSE);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_editable (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		result = FALSE;
		return result;
	}
	_tmp3_ = *val;
	_tmp4_ = g_strdup (g_value_get_string (&_tmp3_));
	text = _tmp4_;
	_tmp7_ = text;
	_tmp8_ = string_chomp (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_file_test (_tmp9_, G_FILE_TEST_EXISTS);
	_g_free0 (_tmp9_);
	if (_tmp10_) {
		const gchar* _tmp11_;
		_tmp11_ = text;
		_tmp6_ = g_str_has_prefix (_tmp11_, "/");
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		const gchar* _tmp12_;
		_tmp12_ = text;
		_tmp5_ = !g_str_has_prefix (_tmp12_, "file://");
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		const gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp13_ = text;
		_tmp14_ = g_strdup_printf ("file://%s", _tmp13_);
		_g_free0 (text);
		text = _tmp14_;
	}
	_tmp16_ = text;
	_tmp17_ = string_chomp (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = utils_is_url (_tmp18_);
	_g_free0 (_tmp18_);
	if (_tmp19_) {
		const gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		_tmp20_ = text;
		_tmp21_ = string_chomp (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp15_ = draw_area_do_file_drop (self, _tmp22_, x, y);
		_g_free0 (_tmp22_);
	} else {
		_tmp15_ = FALSE;
	}
	if (_tmp15_) {
		result = TRUE;
		_g_free0 (text);
		_g_object_unref0 (node);
		return result;
	}
	_tmp24_ = self->priv->_map;
	_tmp25_ = mind_map_get_model (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = map_model_get_attach_node (_tmp26_);
	_tmp28_ = _tmp27_;
	if (_tmp28_ != NULL) {
		MindMap* _tmp29_;
		MapModel* _tmp30_;
		MapModel* _tmp31_;
		Node* _tmp32_;
		Node* _tmp33_;
		NodeMode _tmp34_;
		NodeMode _tmp35_;
		_tmp29_ = self->priv->_map;
		_tmp30_ = mind_map_get_model (_tmp29_);
		_tmp31_ = _tmp30_;
		_tmp32_ = map_model_get_attach_node (_tmp31_);
		_tmp33_ = _tmp32_;
		_tmp34_ = node_get_mode (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp23_ = _tmp35_ == NODE_MODE_DROPPABLE;
	} else {
		_tmp23_ = FALSE;
	}
	if (_tmp23_) {
		MindMap* _tmp36_;
		MapModel* _tmp37_;
		MapModel* _tmp38_;
		MindMap* _tmp39_;
		MapModel* _tmp40_;
		MapModel* _tmp41_;
		Node* _tmp42_;
		Node* _tmp43_;
		const gchar* _tmp44_;
		Node* _tmp45_;
		MindMap* _tmp46_;
		Node* _tmp47_;
		Node* _tmp48_;
		UndoNodeInsert* _tmp49_;
		UndoNodeInsert* _tmp50_;
		MindMap* _tmp51_;
		Node* _tmp52_;
		_tmp36_ = self->priv->_map;
		_tmp37_ = mind_map_get_model (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = self->priv->_map;
		_tmp40_ = mind_map_get_model (_tmp39_);
		_tmp41_ = _tmp40_;
		_tmp42_ = map_model_get_attach_node (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp44_ = text;
		_tmp45_ = map_model_create_child_node (_tmp38_, _tmp43_, _tmp44_);
		_g_object_unref0 (node);
		node = _tmp45_;
		_tmp46_ = self->priv->_map;
		_tmp47_ = node;
		_tmp48_ = node;
		_tmp49_ = undo_node_insert_new (_tmp47_, node_index (_tmp48_));
		_tmp50_ = _tmp49_;
		mind_map_add_undo (_tmp46_, (UndoItem*) _tmp50_);
		_g_object_unref0 (_tmp50_);
		_tmp51_ = self->priv->_map;
		_tmp52_ = node;
		if (mind_map_select_node (_tmp51_, _tmp52_, TRUE)) {
			MindMap* _tmp53_;
			gtk_widget_queue_draw ((GtkWidget*) self);
			draw_area_see (self, TRUE, (gdouble) 0, 100.0);
			_tmp53_ = self->priv->_map;
			mind_map_auto_save (_tmp53_);
		}
		result = TRUE;
		_g_free0 (text);
		_g_object_unref0 (node);
		return result;
	}
	result = FALSE;
	_g_free0 (text);
	_g_object_unref0 (node);
	return result;
}

static GdkDragAction
draw_area_handle_idea_drag_motion (DrawArea* self,
                                   gdouble x,
                                   gdouble y)
{
	gdouble scaled_x = 0.0;
	gdouble scaled_y = 0.0;
	Node* node = NULL;
	MindMap* _tmp0_;
	MapModel* _tmp1_;
	MapModel* _tmp2_;
	Node* _tmp3_;
	MindMap* _tmp4_;
	MapModel* _tmp5_;
	MapModel* _tmp6_;
	GdkDragAction result;
	g_return_val_if_fail (self != NULL, 0U);
	scaled_x = draw_area_scale_value (self, x);
	scaled_y = draw_area_scale_value (self, y);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_model (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = map_model_get_droppable_node (_tmp2_, scaled_x, scaled_y);
	node = _tmp3_;
	_tmp4_ = self->priv->_map;
	_tmp5_ = mind_map_get_model (_tmp4_);
	_tmp6_ = _tmp5_;
	map_model_set_attach_node (_tmp6_, node, NODE_MODE_DROPPABLE);
	result = GDK_ACTION_MOVE;
	_g_object_unref0 (node);
	return result;
}

static gboolean
draw_area_handle_idea_drop (DrawArea* self,
                            GValue* val,
                            gdouble x,
                            gdouble y)
{
	MindMap* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	Node* node = NULL;
	gint index = 0;
	Idea* idea = NULL;
	GValue _tmp3_;
	Idea* _tmp4_;
	gboolean _tmp5_ = FALSE;
	MindMap* _tmp6_;
	MapModel* _tmp7_;
	MapModel* _tmp8_;
	Node* _tmp9_;
	Node* _tmp10_;
	MindMap* _tmp43_;
	Node* _tmp44_;
	UndoNodeInsert* _tmp45_;
	UndoNodeInsert* _tmp46_;
	MindMap* _tmp47_;
	Node* _tmp48_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (val != NULL, FALSE);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_editable (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		result = FALSE;
		return result;
	}
	_tmp3_ = *val;
	_tmp4_ = _g_object_ref0 (g_value_get_object (&_tmp3_));
	idea = _tmp4_;
	_tmp6_ = self->priv->_map;
	_tmp7_ = mind_map_get_model (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = map_model_get_attach_node (_tmp8_);
	_tmp10_ = _tmp9_;
	if (_tmp10_ != NULL) {
		MindMap* _tmp11_;
		MapModel* _tmp12_;
		MapModel* _tmp13_;
		Node* _tmp14_;
		Node* _tmp15_;
		NodeMode _tmp16_;
		NodeMode _tmp17_;
		_tmp11_ = self->priv->_map;
		_tmp12_ = mind_map_get_model (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = map_model_get_attach_node (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = node_get_mode (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp5_ = _tmp17_ == NODE_MODE_DROPPABLE;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		MindMap* _tmp18_;
		MapModel* _tmp19_;
		MapModel* _tmp20_;
		MindMap* _tmp21_;
		MapModel* _tmp22_;
		MapModel* _tmp23_;
		Node* _tmp24_;
		Node* _tmp25_;
		Idea* _tmp26_;
		const gchar* _tmp27_;
		const gchar* _tmp28_;
		Node* _tmp29_;
		Node* _tmp30_;
		_tmp18_ = self->priv->_map;
		_tmp19_ = mind_map_get_model (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = self->priv->_map;
		_tmp22_ = mind_map_get_model (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = map_model_get_attach_node (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = idea;
		_tmp27_ = idea_get_text (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp29_ = map_model_create_child_node (_tmp20_, _tmp25_, _tmp28_);
		_g_object_unref0 (node);
		node = _tmp29_;
		_tmp30_ = node;
		index = node_index (_tmp30_);
	} else {
		MindMap* _tmp31_;
		MapModel* _tmp32_;
		MapModel* _tmp33_;
		Idea* _tmp34_;
		const gchar* _tmp35_;
		const gchar* _tmp36_;
		Node* _tmp37_;
		Node* _tmp38_;
		Node* _tmp39_;
		MindMap* _tmp40_;
		GArray* _tmp41_;
		GArray* _tmp42_;
		_tmp31_ = self->priv->_map;
		_tmp32_ = mind_map_get_model (_tmp31_);
		_tmp33_ = _tmp32_;
		_tmp34_ = idea;
		_tmp35_ = idea_get_text (_tmp34_);
		_tmp36_ = _tmp35_;
		_tmp37_ = map_model_create_root_node (_tmp33_, _tmp36_);
		_g_object_unref0 (node);
		node = _tmp37_;
		_tmp38_ = node;
		node_set_posx (_tmp38_, draw_area_scale_value (self, x));
		_tmp39_ = node;
		node_set_posy (_tmp39_, draw_area_scale_value (self, y));
		_tmp40_ = self->priv->_map;
		_tmp41_ = mind_map_get_nodes (_tmp40_);
		_tmp42_ = _tmp41_;
		index = (gint) (_tmp42_->len - 1);
		_g_array_unref0 (_tmp42_);
	}
	_tmp43_ = self->priv->_map;
	_tmp44_ = node;
	_tmp45_ = undo_node_insert_new (_tmp44_, index);
	_tmp46_ = _tmp45_;
	mind_map_add_undo (_tmp43_, (UndoItem*) _tmp46_);
	_g_object_unref0 (_tmp46_);
	_tmp47_ = self->priv->_map;
	_tmp48_ = node;
	if (mind_map_select_node (_tmp47_, _tmp48_, TRUE)) {
		MindMap* _tmp49_;
		gtk_widget_queue_draw ((GtkWidget*) self);
		draw_area_see (self, TRUE, (gdouble) 0, 100.0);
		_tmp49_ = self->priv->_map;
		mind_map_auto_save (_tmp49_);
	}
	result = TRUE;
	_g_object_unref0 (idea);
	_g_object_unref0 (node);
	return result;
}

static GdkDragAction
draw_area_handle_tag_drag_motion (DrawArea* self,
                                  gdouble x,
                                  gdouble y)
{
	gdouble scaled_x = 0.0;
	gdouble scaled_y = 0.0;
	Node* node = NULL;
	MindMap* _tmp0_;
	MapModel* _tmp1_;
	MapModel* _tmp2_;
	Node* _tmp3_;
	MindMap* _tmp4_;
	MapModel* _tmp5_;
	MapModel* _tmp6_;
	GdkDragAction result;
	g_return_val_if_fail (self != NULL, 0U);
	scaled_x = draw_area_scale_value (self, x);
	scaled_y = draw_area_scale_value (self, y);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_model (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = map_model_get_droppable_node (_tmp2_, scaled_x, scaled_y);
	node = _tmp3_;
	_tmp4_ = self->priv->_map;
	_tmp5_ = mind_map_get_model (_tmp4_);
	_tmp6_ = _tmp5_;
	map_model_set_attach_node (_tmp6_, node, NODE_MODE_DROPPABLE);
	result = GDK_ACTION_COPY;
	_g_object_unref0 (node);
	return result;
}

static gboolean
draw_area_handle_tag_drop (DrawArea* self,
                           GValue* val,
                           gdouble x,
                           gdouble y)
{
	MindMap* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	Node* node = NULL;
	MindMap* _tmp3_;
	MapModel* _tmp4_;
	MapModel* _tmp5_;
	Node* _tmp6_;
	Node* _tmp7_;
	Node* _tmp8_;
	Tag* tag = NULL;
	GValue _tmp9_;
	Tag* _tmp10_;
	Tag* found = NULL;
	MindMap* _tmp11_;
	MapModel* _tmp12_;
	MapModel* _tmp13_;
	Tags* _tmp14_;
	Tags* _tmp15_;
	Tag* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	Tag* _tmp19_;
	gboolean _tmp20_ = FALSE;
	gboolean _tmp21_ = FALSE;
	Node* _tmp22_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (val != NULL, FALSE);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_editable (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->_map;
	_tmp4_ = mind_map_get_model (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = map_model_get_attach_node (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	node = _tmp8_;
	_tmp9_ = *val;
	_tmp10_ = _g_object_ref0 (g_value_get_object (&_tmp9_));
	tag = _tmp10_;
	_tmp11_ = self->priv->_map;
	_tmp12_ = mind_map_get_model (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = map_model_get_tags (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = tag;
	_tmp17_ = tag_get_name (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = tags_get_tag_from_name (_tmp15_, _tmp18_);
	found = _tmp19_;
	_tmp22_ = node;
	if (_tmp22_ != NULL) {
		Node* _tmp23_;
		NodeMode _tmp24_;
		NodeMode _tmp25_;
		_tmp23_ = node;
		_tmp24_ = node_get_mode (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp21_ = _tmp25_ == NODE_MODE_DROPPABLE;
	} else {
		_tmp21_ = FALSE;
	}
	if (_tmp21_) {
		Tag* _tmp26_;
		_tmp26_ = found;
		_tmp20_ = _tmp26_ != NULL;
	} else {
		_tmp20_ = FALSE;
	}
	if (_tmp20_) {
		Node* _tmp27_;
		Tag* _tmp28_;
		MindMap* _tmp29_;
		Node* _tmp30_;
		_tmp27_ = node;
		_tmp28_ = found;
		node_add_tag (_tmp27_, _tmp28_);
		_tmp29_ = self->priv->_map;
		_tmp30_ = node;
		if (mind_map_select_node (_tmp29_, _tmp30_, TRUE)) {
			MindMap* _tmp31_;
			gtk_widget_queue_draw ((GtkWidget*) self);
			_tmp31_ = self->priv->_map;
			mind_map_auto_save (_tmp31_);
		}
	}
	result = TRUE;
	_g_object_unref0 (found);
	_g_object_unref0 (tag);
	_g_object_unref0 (node);
	return result;
}

static GdkDragAction
draw_area_handle_file_drag_motion (DrawArea* self,
                                   gdouble x,
                                   gdouble y)
{
	gdouble scaled_x = 0.0;
	gdouble scaled_y = 0.0;
	Node* node = NULL;
	MindMap* _tmp0_;
	MapModel* _tmp1_;
	MapModel* _tmp2_;
	Node* _tmp3_;
	MindMap* _tmp4_;
	MapModel* _tmp5_;
	MapModel* _tmp6_;
	GdkDragAction result;
	g_return_val_if_fail (self != NULL, 0U);
	scaled_x = draw_area_scale_value (self, x);
	scaled_y = draw_area_scale_value (self, y);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_model (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = map_model_get_droppable_node (_tmp2_, scaled_x, scaled_y);
	node = _tmp3_;
	_tmp4_ = self->priv->_map;
	_tmp5_ = mind_map_get_model (_tmp4_);
	_tmp6_ = _tmp5_;
	map_model_set_attach_node (_tmp6_, node, NODE_MODE_DROPPABLE);
	result = GDK_ACTION_COPY;
	_g_object_unref0 (node);
	return result;
}

static gboolean
draw_area_handle_file_drop (DrawArea* self,
                            GValue* val,
                            gdouble x,
                            gdouble y)
{
	GFile* file = NULL;
	GValue _tmp0_;
	GFile* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (val != NULL, FALSE);
	_tmp0_ = *val;
	_tmp1_ = _g_object_ref0 (g_value_get_object (&_tmp0_));
	file = _tmp1_;
	_tmp2_ = g_file_get_uri (file);
	_tmp3_ = _tmp2_;
	_tmp4_ = draw_area_do_file_drop (self, _tmp3_, x, y);
	_g_free0 (_tmp3_);
	result = _tmp4_;
	_g_object_unref0 (file);
	return result;
}

static gpointer
_node_image_ref0 (gpointer self)
{
	return self ? node_image_ref (self) : NULL;
}

static gboolean
draw_area_do_file_drop (DrawArea* self,
                        const gchar* uri,
                        gdouble x,
                        gdouble y)
{
	MindMap* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_ = FALSE;
	MindMap* _tmp4_;
	MapModel* _tmp5_;
	MapModel* _tmp6_;
	Node* _tmp7_;
	Node* _tmp8_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (uri != NULL, FALSE);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_editable (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		result = FALSE;
		return result;
	}
	_tmp4_ = self->priv->_map;
	_tmp5_ = mind_map_get_model (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = map_model_get_attach_node (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_ == NULL) {
		_tmp3_ = TRUE;
	} else {
		MindMap* _tmp9_;
		MapModel* _tmp10_;
		MapModel* _tmp11_;
		Node* _tmp12_;
		Node* _tmp13_;
		NodeMode _tmp14_;
		NodeMode _tmp15_;
		_tmp9_ = self->priv->_map;
		_tmp10_ = mind_map_get_model (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = map_model_get_attach_node (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = node_get_mode (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp3_ = _tmp15_ != NODE_MODE_DROPPABLE;
	}
	if (_tmp3_) {
		NodeImage* image = NULL;
		MindMap* _tmp16_;
		ImageManager* _tmp17_;
		ImageManager* _tmp18_;
		NodeImage* _tmp19_;
		NodeImage* _tmp20_;
		gboolean _tmp21_;
		gboolean _tmp22_;
		_tmp16_ = self->priv->_map;
		_tmp17_ = mind_map_get_image_manager (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = node_image_new_from_uri (_tmp18_, uri, 200);
		image = _tmp19_;
		_tmp20_ = image;
		_tmp21_ = node_image_get_valid (_tmp20_);
		_tmp22_ = _tmp21_;
		if (_tmp22_) {
			Node* node = NULL;
			MindMap* _tmp23_;
			MapModel* _tmp24_;
			MapModel* _tmp25_;
			Node* _tmp26_;
			Node* _tmp27_;
			MindMap* _tmp28_;
			MapModel* _tmp29_;
			MapModel* _tmp30_;
			ImageManager* _tmp31_;
			ImageManager* _tmp32_;
			NodeImage* _tmp33_;
			MindMap* _tmp34_;
			Node* _tmp35_;
			_tmp23_ = self->priv->_map;
			_tmp24_ = mind_map_get_model (_tmp23_);
			_tmp25_ = _tmp24_;
			_tmp26_ = map_model_create_root_node (_tmp25_, _ ("Another Idea"));
			node = _tmp26_;
			_tmp27_ = node;
			_tmp28_ = self->priv->_map;
			_tmp29_ = mind_map_get_model (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = map_model_get_image_manager (_tmp30_);
			_tmp32_ = _tmp31_;
			_tmp33_ = image;
			node_set_image (_tmp27_, _tmp32_, _tmp33_);
			_tmp34_ = self->priv->_map;
			_tmp35_ = node;
			if (mind_map_select_node (_tmp34_, _tmp35_, TRUE)) {
				MindMap* _tmp36_;
				MapModel* _tmp37_;
				MapModel* _tmp38_;
				Node* _tmp39_;
				MindMap* _tmp40_;
				_tmp36_ = self->priv->_map;
				_tmp37_ = mind_map_get_model (_tmp36_);
				_tmp38_ = _tmp37_;
				_tmp39_ = node;
				map_model_set_node_mode (_tmp38_, _tmp39_, NODE_MODE_EDITABLE, FALSE);
				gtk_widget_queue_draw ((GtkWidget*) self);
				_tmp40_ = self->priv->_map;
				mind_map_auto_save (_tmp40_);
			}
			result = TRUE;
			_g_object_unref0 (node);
			_node_image_unref0 (image);
			return result;
		}
		_node_image_unref0 (image);
	} else {
		NodeImage* image = NULL;
		MindMap* _tmp41_;
		ImageManager* _tmp42_;
		ImageManager* _tmp43_;
		MindMap* _tmp44_;
		MapModel* _tmp45_;
		MapModel* _tmp46_;
		Node* _tmp47_;
		Node* _tmp48_;
		Style* _tmp49_;
		Style* _tmp50_;
		gint* _tmp51_;
		gint* _tmp52_;
		NodeImage* _tmp53_;
		NodeImage* _tmp54_;
		gboolean _tmp55_;
		gboolean _tmp56_;
		_tmp41_ = self->priv->_map;
		_tmp42_ = mind_map_get_image_manager (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp44_ = self->priv->_map;
		_tmp45_ = mind_map_get_model (_tmp44_);
		_tmp46_ = _tmp45_;
		_tmp47_ = map_model_get_attach_node (_tmp46_);
		_tmp48_ = _tmp47_;
		_tmp49_ = node_get_style (_tmp48_);
		_tmp50_ = _tmp49_;
		_tmp51_ = style_get_node_width (_tmp50_);
		_tmp52_ = _tmp51_;
		_tmp53_ = node_image_new_from_uri (_tmp43_, uri, *_tmp52_);
		image = _tmp53_;
		_tmp54_ = image;
		_tmp55_ = node_image_get_valid (_tmp54_);
		_tmp56_ = _tmp55_;
		if (_tmp56_) {
			NodeImage* orig_image = NULL;
			MindMap* _tmp57_;
			MapModel* _tmp58_;
			MapModel* _tmp59_;
			Node* _tmp60_;
			Node* _tmp61_;
			NodeImage* _tmp62_;
			NodeImage* _tmp63_;
			NodeImage* _tmp64_;
			MindMap* _tmp65_;
			MapModel* _tmp66_;
			MapModel* _tmp67_;
			Node* _tmp68_;
			Node* _tmp69_;
			MindMap* _tmp70_;
			MapModel* _tmp71_;
			MapModel* _tmp72_;
			ImageManager* _tmp73_;
			ImageManager* _tmp74_;
			NodeImage* _tmp75_;
			MindMap* _tmp76_;
			MindMap* _tmp77_;
			MapModel* _tmp78_;
			MapModel* _tmp79_;
			Node* _tmp80_;
			Node* _tmp81_;
			NodeImage* _tmp82_;
			UndoNodeImage* _tmp83_;
			UndoNodeImage* _tmp84_;
			MindMap* _tmp85_;
			MapModel* _tmp86_;
			MapModel* _tmp87_;
			MindMap* _tmp88_;
			MindMap* _tmp89_;
			_tmp57_ = self->priv->_map;
			_tmp58_ = mind_map_get_model (_tmp57_);
			_tmp59_ = _tmp58_;
			_tmp60_ = map_model_get_attach_node (_tmp59_);
			_tmp61_ = _tmp60_;
			_tmp62_ = node_get_image (_tmp61_);
			_tmp63_ = _tmp62_;
			_tmp64_ = _node_image_ref0 (_tmp63_);
			orig_image = _tmp64_;
			_tmp65_ = self->priv->_map;
			_tmp66_ = mind_map_get_model (_tmp65_);
			_tmp67_ = _tmp66_;
			_tmp68_ = map_model_get_attach_node (_tmp67_);
			_tmp69_ = _tmp68_;
			_tmp70_ = self->priv->_map;
			_tmp71_ = mind_map_get_model (_tmp70_);
			_tmp72_ = _tmp71_;
			_tmp73_ = map_model_get_image_manager (_tmp72_);
			_tmp74_ = _tmp73_;
			_tmp75_ = image;
			node_set_image (_tmp69_, _tmp74_, _tmp75_);
			_tmp76_ = self->priv->_map;
			_tmp77_ = self->priv->_map;
			_tmp78_ = mind_map_get_model (_tmp77_);
			_tmp79_ = _tmp78_;
			_tmp80_ = map_model_get_attach_node (_tmp79_);
			_tmp81_ = _tmp80_;
			_tmp82_ = orig_image;
			_tmp83_ = undo_node_image_new (_tmp81_, _tmp82_);
			_tmp84_ = _tmp83_;
			mind_map_add_undo (_tmp76_, (UndoItem*) _tmp84_);
			_g_object_unref0 (_tmp84_);
			_tmp85_ = self->priv->_map;
			_tmp86_ = mind_map_get_model (_tmp85_);
			_tmp87_ = _tmp86_;
			map_model_set_attach_node (_tmp87_, NULL, NODE_MODE_ATTACHABLE);
			gtk_widget_queue_draw ((GtkWidget*) self);
			_tmp88_ = self->priv->_map;
			g_signal_emit (self, draw_area_signals[DRAW_AREA_CURRENT_CHANGED_SIGNAL], 0, _tmp88_);
			_tmp89_ = self->priv->_map;
			mind_map_auto_save (_tmp89_);
			result = TRUE;
			_node_image_unref0 (orig_image);
			_node_image_unref0 (image);
			return result;
		}
		_node_image_unref0 (image);
	}
	result = FALSE;
	return result;
}

static GdkDragAction
draw_area_handle_sticker_drag_motion (DrawArea* self,
                                      gdouble x,
                                      gdouble y)
{
	Node* attach_node = NULL;
	Connection* attach_conn = NULL;
	Sticker* attach_sticker = NULL;
	gdouble scaled_x = 0.0;
	gdouble scaled_y = 0.0;
	MindMap* _tmp0_;
	MapModel* _tmp1_;
	MapModel* _tmp2_;
	Node* _tmp3_ = NULL;
	Connection* _tmp4_ = NULL;
	Sticker* _tmp5_ = NULL;
	MindMap* _tmp6_;
	MapModel* _tmp7_;
	MapModel* _tmp8_;
	MindMap* _tmp9_;
	MapModel* _tmp10_;
	MapModel* _tmp11_;
	MindMap* _tmp12_;
	MapModel* _tmp13_;
	MapModel* _tmp14_;
	GdkDragAction result;
	g_return_val_if_fail (self != NULL, 0U);
	scaled_x = draw_area_scale_value (self, x);
	scaled_y = draw_area_scale_value (self, y);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_model (_tmp0_);
	_tmp2_ = _tmp1_;
	map_model_get_droppable (_tmp2_, scaled_x, scaled_y, &_tmp3_, &_tmp4_, &_tmp5_);
	_g_object_unref0 (attach_node);
	attach_node = _tmp3_;
	_g_object_unref0 (attach_conn);
	attach_conn = _tmp4_;
	_g_object_unref0 (attach_sticker);
	attach_sticker = _tmp5_;
	_tmp6_ = self->priv->_map;
	_tmp7_ = mind_map_get_model (_tmp6_);
	_tmp8_ = _tmp7_;
	map_model_set_attach_node (_tmp8_, attach_node, NODE_MODE_DROPPABLE);
	_tmp9_ = self->priv->_map;
	_tmp10_ = mind_map_get_model (_tmp9_);
	_tmp11_ = _tmp10_;
	map_model_set_attach_connection (_tmp11_, attach_conn, CONN_MODE_DROPPABLE);
	_tmp12_ = self->priv->_map;
	_tmp13_ = mind_map_get_model (_tmp12_);
	_tmp14_ = _tmp13_;
	map_model_set_attach_sticker (_tmp14_, attach_sticker, STICKER_MODE_DROPPABLE);
	result = GDK_ACTION_COPY;
	_g_object_unref0 (attach_sticker);
	_g_object_unref0 (attach_conn);
	_g_object_unref0 (attach_node);
	return result;
}

static gboolean
draw_area_handle_sticker_drop (DrawArea* self,
                               GValue* val,
                               gdouble x,
                               gdouble y)
{
	MindMap* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GtkPicture* drop_sticker = NULL;
	GValue _tmp3_;
	GtkPicture* _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	MindMap* _tmp7_;
	MapModel* _tmp8_;
	MapModel* _tmp9_;
	Node* _tmp10_;
	Node* _tmp11_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (val != NULL, FALSE);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_editable (_tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		result = FALSE;
		return result;
	}
	_tmp3_ = *val;
	_tmp4_ = _g_object_ref0 (g_value_get_object (&_tmp3_));
	drop_sticker = _tmp4_;
	_tmp7_ = self->priv->_map;
	_tmp8_ = mind_map_get_model (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = map_model_get_attach_node (_tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_ == NULL) {
		_tmp6_ = TRUE;
	} else {
		MindMap* _tmp12_;
		MapModel* _tmp13_;
		MapModel* _tmp14_;
		Node* _tmp15_;
		Node* _tmp16_;
		NodeMode _tmp17_;
		NodeMode _tmp18_;
		_tmp12_ = self->priv->_map;
		_tmp13_ = mind_map_get_model (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = map_model_get_attach_node (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = node_get_mode (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp6_ = _tmp18_ != NODE_MODE_DROPPABLE;
	}
	if (_tmp6_) {
		gboolean _tmp19_ = FALSE;
		MindMap* _tmp20_;
		MapModel* _tmp21_;
		MapModel* _tmp22_;
		Connection* _tmp23_;
		Connection* _tmp24_;
		_tmp20_ = self->priv->_map;
		_tmp21_ = mind_map_get_model (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = map_model_get_attach_conn (_tmp22_);
		_tmp24_ = _tmp23_;
		if (_tmp24_ == NULL) {
			_tmp19_ = TRUE;
		} else {
			MindMap* _tmp25_;
			MapModel* _tmp26_;
			MapModel* _tmp27_;
			Connection* _tmp28_;
			Connection* _tmp29_;
			ConnMode _tmp30_;
			ConnMode _tmp31_;
			_tmp25_ = self->priv->_map;
			_tmp26_ = mind_map_get_model (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp28_ = map_model_get_attach_conn (_tmp27_);
			_tmp29_ = _tmp28_;
			_tmp30_ = connection_get_mode (_tmp29_);
			_tmp31_ = _tmp30_;
			_tmp19_ = _tmp31_ != CONN_MODE_DROPPABLE;
		}
		_tmp5_ = _tmp19_;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		MindMap* _tmp32_;
		MapModel* _tmp33_;
		MapModel* _tmp34_;
		Sticker* _tmp35_;
		Sticker* _tmp36_;
		MindMap* _tmp108_;
		MindMap* _tmp109_;
		_tmp32_ = self->priv->_map;
		_tmp33_ = mind_map_get_model (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp35_ = map_model_get_attach_sticker (_tmp34_);
		_tmp36_ = _tmp35_;
		if (_tmp36_ != NULL) {
			Sticker* sticker = NULL;
			MindMap* _tmp37_;
			GtkPicture* _tmp38_;
			const gchar* _tmp39_;
			const gchar* _tmp40_;
			MindMap* _tmp41_;
			MapModel* _tmp42_;
			MapModel* _tmp43_;
			Sticker* _tmp44_;
			Sticker* _tmp45_;
			gdouble _tmp46_;
			gdouble _tmp47_;
			MindMap* _tmp48_;
			MapModel* _tmp49_;
			MapModel* _tmp50_;
			Sticker* _tmp51_;
			Sticker* _tmp52_;
			gdouble _tmp53_;
			gdouble _tmp54_;
			MindMap* _tmp55_;
			MapModel* _tmp56_;
			MapModel* _tmp57_;
			Sticker* _tmp58_;
			Sticker* _tmp59_;
			gdouble _tmp60_;
			gdouble _tmp61_;
			Sticker* _tmp62_;
			MindMap* _tmp63_;
			Stickers* _tmp64_;
			Stickers* _tmp65_;
			MindMap* _tmp66_;
			MapModel* _tmp67_;
			MapModel* _tmp68_;
			Sticker* _tmp69_;
			Sticker* _tmp70_;
			MindMap* _tmp71_;
			Stickers* _tmp72_;
			Stickers* _tmp73_;
			Sticker* _tmp74_;
			MindMap* _tmp75_;
			Selection* _tmp76_;
			Selection* _tmp77_;
			Sticker* _tmp78_;
			MindMap* _tmp79_;
			MindMap* _tmp80_;
			MapModel* _tmp81_;
			MapModel* _tmp82_;
			Sticker* _tmp83_;
			Sticker* _tmp84_;
			Sticker* _tmp85_;
			UndoStickerChange* _tmp86_;
			UndoStickerChange* _tmp87_;
			MindMap* _tmp88_;
			MapModel* _tmp89_;
			MapModel* _tmp90_;
			_tmp37_ = self->priv->_map;
			_tmp38_ = drop_sticker;
			_tmp39_ = gtk_widget_get_name ((GtkWidget*) _tmp38_);
			_tmp40_ = _tmp39_;
			_tmp41_ = self->priv->_map;
			_tmp42_ = mind_map_get_model (_tmp41_);
			_tmp43_ = _tmp42_;
			_tmp44_ = map_model_get_attach_sticker (_tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = sticker_get_posx (_tmp45_);
			_tmp47_ = _tmp46_;
			_tmp48_ = self->priv->_map;
			_tmp49_ = mind_map_get_model (_tmp48_);
			_tmp50_ = _tmp49_;
			_tmp51_ = map_model_get_attach_sticker (_tmp50_);
			_tmp52_ = _tmp51_;
			_tmp53_ = sticker_get_posy (_tmp52_);
			_tmp54_ = _tmp53_;
			_tmp55_ = self->priv->_map;
			_tmp56_ = mind_map_get_model (_tmp55_);
			_tmp57_ = _tmp56_;
			_tmp58_ = map_model_get_attach_sticker (_tmp57_);
			_tmp59_ = _tmp58_;
			_tmp60_ = sticker_get_width (_tmp59_);
			_tmp61_ = _tmp60_;
			_tmp62_ = sticker_new (_tmp37_, _tmp40_, _tmp47_, _tmp54_, (gint) _tmp61_);
			sticker = _tmp62_;
			_tmp63_ = self->priv->_map;
			_tmp64_ = mind_map_get_stickers (_tmp63_);
			_tmp65_ = _tmp64_;
			_tmp66_ = self->priv->_map;
			_tmp67_ = mind_map_get_model (_tmp66_);
			_tmp68_ = _tmp67_;
			_tmp69_ = map_model_get_attach_sticker (_tmp68_);
			_tmp70_ = _tmp69_;
			stickers_remove_sticker (_tmp65_, _tmp70_);
			_tmp71_ = self->priv->_map;
			_tmp72_ = mind_map_get_stickers (_tmp71_);
			_tmp73_ = _tmp72_;
			_tmp74_ = sticker;
			stickers_add_sticker (_tmp73_, _tmp74_);
			_tmp75_ = self->priv->_map;
			_tmp76_ = mind_map_get_selected (_tmp75_);
			_tmp77_ = _tmp76_;
			_tmp78_ = sticker;
			selection_set_current_sticker (_tmp77_, _tmp78_, 1.0);
			_tmp79_ = self->priv->_map;
			_tmp80_ = self->priv->_map;
			_tmp81_ = mind_map_get_model (_tmp80_);
			_tmp82_ = _tmp81_;
			_tmp83_ = map_model_get_attach_sticker (_tmp82_);
			_tmp84_ = _tmp83_;
			_tmp85_ = sticker;
			_tmp86_ = undo_sticker_change_new (_tmp84_, _tmp85_);
			_tmp87_ = _tmp86_;
			mind_map_add_undo (_tmp79_, (UndoItem*) _tmp87_);
			_g_object_unref0 (_tmp87_);
			_tmp88_ = self->priv->_map;
			_tmp89_ = mind_map_get_model (_tmp88_);
			_tmp90_ = _tmp89_;
			map_model_set_attach_sticker (_tmp90_, NULL, STICKER_MODE_DROPPABLE);
			_g_object_unref0 (sticker);
		} else {
			Sticker* sticker = NULL;
			MindMap* _tmp91_;
			GtkPicture* _tmp92_;
			const gchar* _tmp93_;
			const gchar* _tmp94_;
			Sticker* _tmp95_;
			MindMap* _tmp96_;
			Stickers* _tmp97_;
			Stickers* _tmp98_;
			Sticker* _tmp99_;
			MindMap* _tmp100_;
			Selection* _tmp101_;
			Selection* _tmp102_;
			Sticker* _tmp103_;
			MindMap* _tmp104_;
			Sticker* _tmp105_;
			UndoStickerAdd* _tmp106_;
			UndoStickerAdd* _tmp107_;
			_tmp91_ = self->priv->_map;
			_tmp92_ = drop_sticker;
			_tmp93_ = gtk_widget_get_name ((GtkWidget*) _tmp92_);
			_tmp94_ = _tmp93_;
			_tmp95_ = sticker_new (_tmp91_, _tmp94_, draw_area_scale_value (self, x), draw_area_scale_value (self, y), -1);
			sticker = _tmp95_;
			_tmp96_ = self->priv->_map;
			_tmp97_ = mind_map_get_stickers (_tmp96_);
			_tmp98_ = _tmp97_;
			_tmp99_ = sticker;
			stickers_add_sticker (_tmp98_, _tmp99_);
			_tmp100_ = self->priv->_map;
			_tmp101_ = mind_map_get_selected (_tmp100_);
			_tmp102_ = _tmp101_;
			_tmp103_ = sticker;
			selection_set_current_sticker (_tmp102_, _tmp103_, 1.0);
			_tmp104_ = self->priv->_map;
			_tmp105_ = sticker;
			_tmp106_ = undo_sticker_add_new (_tmp105_);
			_tmp107_ = _tmp106_;
			mind_map_add_undo (_tmp104_, (UndoItem*) _tmp107_);
			_g_object_unref0 (_tmp107_);
			_g_object_unref0 (sticker);
		}
		gtk_widget_grab_focus ((GtkWidget*) self);
		draw_area_see (self, TRUE, (gdouble) 0, 100.0);
		gtk_widget_queue_draw ((GtkWidget*) self);
		_tmp108_ = self->priv->_map;
		g_signal_emit (self, draw_area_signals[DRAW_AREA_CURRENT_CHANGED_SIGNAL], 0, _tmp108_);
		_tmp109_ = self->priv->_map;
		mind_map_auto_save (_tmp109_);
	} else {
		MindMap* _tmp110_;
		MapModel* _tmp111_;
		MapModel* _tmp112_;
		Node* _tmp113_;
		Node* _tmp114_;
		MindMap* _tmp208_;
		MindMap* _tmp209_;
		_tmp110_ = self->priv->_map;
		_tmp111_ = mind_map_get_model (_tmp110_);
		_tmp112_ = _tmp111_;
		_tmp113_ = map_model_get_attach_node (_tmp112_);
		_tmp114_ = _tmp113_;
		if (_tmp114_ != NULL) {
			MindMap* _tmp115_;
			MapModel* _tmp116_;
			MapModel* _tmp117_;
			Node* _tmp118_;
			Node* _tmp119_;
			const gchar* _tmp120_;
			const gchar* _tmp121_;
			MindMap* _tmp148_;
			MapModel* _tmp149_;
			MapModel* _tmp150_;
			Node* _tmp151_;
			Node* _tmp152_;
			GtkPicture* _tmp153_;
			const gchar* _tmp154_;
			const gchar* _tmp155_;
			MindMap* _tmp156_;
			MapModel* _tmp157_;
			MapModel* _tmp158_;
			_tmp115_ = self->priv->_map;
			_tmp116_ = mind_map_get_model (_tmp115_);
			_tmp117_ = _tmp116_;
			_tmp118_ = map_model_get_attach_node (_tmp117_);
			_tmp119_ = _tmp118_;
			_tmp120_ = node_get_sticker (_tmp119_);
			_tmp121_ = _tmp120_;
			if (_tmp121_ == NULL) {
				MindMap* _tmp122_;
				MindMap* _tmp123_;
				MapModel* _tmp124_;
				MapModel* _tmp125_;
				Node* _tmp126_;
				Node* _tmp127_;
				GtkPicture* _tmp128_;
				const gchar* _tmp129_;
				const gchar* _tmp130_;
				UndoNodeStickerAdd* _tmp131_;
				UndoNodeStickerAdd* _tmp132_;
				_tmp122_ = self->priv->_map;
				_tmp123_ = self->priv->_map;
				_tmp124_ = mind_map_get_model (_tmp123_);
				_tmp125_ = _tmp124_;
				_tmp126_ = map_model_get_attach_node (_tmp125_);
				_tmp127_ = _tmp126_;
				_tmp128_ = drop_sticker;
				_tmp129_ = gtk_widget_get_name ((GtkWidget*) _tmp128_);
				_tmp130_ = _tmp129_;
				_tmp131_ = undo_node_sticker_add_new (_tmp127_, _tmp130_);
				_tmp132_ = _tmp131_;
				mind_map_add_undo (_tmp122_, (UndoItem*) _tmp132_);
				_g_object_unref0 (_tmp132_);
			} else {
				MindMap* _tmp133_;
				MindMap* _tmp134_;
				MapModel* _tmp135_;
				MapModel* _tmp136_;
				Node* _tmp137_;
				Node* _tmp138_;
				MindMap* _tmp139_;
				MapModel* _tmp140_;
				MapModel* _tmp141_;
				Node* _tmp142_;
				Node* _tmp143_;
				const gchar* _tmp144_;
				const gchar* _tmp145_;
				UndoNodeStickerChange* _tmp146_;
				UndoNodeStickerChange* _tmp147_;
				_tmp133_ = self->priv->_map;
				_tmp134_ = self->priv->_map;
				_tmp135_ = mind_map_get_model (_tmp134_);
				_tmp136_ = _tmp135_;
				_tmp137_ = map_model_get_attach_node (_tmp136_);
				_tmp138_ = _tmp137_;
				_tmp139_ = self->priv->_map;
				_tmp140_ = mind_map_get_model (_tmp139_);
				_tmp141_ = _tmp140_;
				_tmp142_ = map_model_get_attach_node (_tmp141_);
				_tmp143_ = _tmp142_;
				_tmp144_ = node_get_sticker (_tmp143_);
				_tmp145_ = _tmp144_;
				_tmp146_ = undo_node_sticker_change_new (_tmp138_, _tmp145_);
				_tmp147_ = _tmp146_;
				mind_map_add_undo (_tmp133_, (UndoItem*) _tmp147_);
				_g_object_unref0 (_tmp147_);
			}
			_tmp148_ = self->priv->_map;
			_tmp149_ = mind_map_get_model (_tmp148_);
			_tmp150_ = _tmp149_;
			_tmp151_ = map_model_get_attach_node (_tmp150_);
			_tmp152_ = _tmp151_;
			_tmp153_ = drop_sticker;
			_tmp154_ = gtk_widget_get_name ((GtkWidget*) _tmp153_);
			_tmp155_ = _tmp154_;
			node_set_sticker (_tmp152_, _tmp155_);
			_tmp156_ = self->priv->_map;
			_tmp157_ = mind_map_get_model (_tmp156_);
			_tmp158_ = _tmp157_;
			map_model_set_attach_node (_tmp158_, NULL, NODE_MODE_ATTACHABLE);
		} else {
			MindMap* _tmp159_;
			MapModel* _tmp160_;
			MapModel* _tmp161_;
			Connection* _tmp162_;
			Connection* _tmp163_;
			_tmp159_ = self->priv->_map;
			_tmp160_ = mind_map_get_model (_tmp159_);
			_tmp161_ = _tmp160_;
			_tmp162_ = map_model_get_attach_conn (_tmp161_);
			_tmp163_ = _tmp162_;
			if (_tmp163_ != NULL) {
				MindMap* _tmp164_;
				MapModel* _tmp165_;
				MapModel* _tmp166_;
				Connection* _tmp167_;
				Connection* _tmp168_;
				const gchar* _tmp169_;
				const gchar* _tmp170_;
				MindMap* _tmp197_;
				MapModel* _tmp198_;
				MapModel* _tmp199_;
				Connection* _tmp200_;
				Connection* _tmp201_;
				GtkPicture* _tmp202_;
				const gchar* _tmp203_;
				const gchar* _tmp204_;
				MindMap* _tmp205_;
				MapModel* _tmp206_;
				MapModel* _tmp207_;
				_tmp164_ = self->priv->_map;
				_tmp165_ = mind_map_get_model (_tmp164_);
				_tmp166_ = _tmp165_;
				_tmp167_ = map_model_get_attach_conn (_tmp166_);
				_tmp168_ = _tmp167_;
				_tmp169_ = connection_get_sticker (_tmp168_);
				_tmp170_ = _tmp169_;
				if (_tmp170_ == NULL) {
					MindMap* _tmp171_;
					MindMap* _tmp172_;
					MapModel* _tmp173_;
					MapModel* _tmp174_;
					Connection* _tmp175_;
					Connection* _tmp176_;
					GtkPicture* _tmp177_;
					const gchar* _tmp178_;
					const gchar* _tmp179_;
					UndoConnectionStickerAdd* _tmp180_;
					UndoConnectionStickerAdd* _tmp181_;
					_tmp171_ = self->priv->_map;
					_tmp172_ = self->priv->_map;
					_tmp173_ = mind_map_get_model (_tmp172_);
					_tmp174_ = _tmp173_;
					_tmp175_ = map_model_get_attach_conn (_tmp174_);
					_tmp176_ = _tmp175_;
					_tmp177_ = drop_sticker;
					_tmp178_ = gtk_widget_get_name ((GtkWidget*) _tmp177_);
					_tmp179_ = _tmp178_;
					_tmp180_ = undo_connection_sticker_add_new (_tmp176_, _tmp179_);
					_tmp181_ = _tmp180_;
					mind_map_add_undo (_tmp171_, (UndoItem*) _tmp181_);
					_g_object_unref0 (_tmp181_);
				} else {
					MindMap* _tmp182_;
					MindMap* _tmp183_;
					MapModel* _tmp184_;
					MapModel* _tmp185_;
					Connection* _tmp186_;
					Connection* _tmp187_;
					MindMap* _tmp188_;
					MapModel* _tmp189_;
					MapModel* _tmp190_;
					Connection* _tmp191_;
					Connection* _tmp192_;
					const gchar* _tmp193_;
					const gchar* _tmp194_;
					UndoConnectionStickerChange* _tmp195_;
					UndoConnectionStickerChange* _tmp196_;
					_tmp182_ = self->priv->_map;
					_tmp183_ = self->priv->_map;
					_tmp184_ = mind_map_get_model (_tmp183_);
					_tmp185_ = _tmp184_;
					_tmp186_ = map_model_get_attach_conn (_tmp185_);
					_tmp187_ = _tmp186_;
					_tmp188_ = self->priv->_map;
					_tmp189_ = mind_map_get_model (_tmp188_);
					_tmp190_ = _tmp189_;
					_tmp191_ = map_model_get_attach_conn (_tmp190_);
					_tmp192_ = _tmp191_;
					_tmp193_ = connection_get_sticker (_tmp192_);
					_tmp194_ = _tmp193_;
					_tmp195_ = undo_connection_sticker_change_new (_tmp187_, _tmp194_);
					_tmp196_ = _tmp195_;
					mind_map_add_undo (_tmp182_, (UndoItem*) _tmp196_);
					_g_object_unref0 (_tmp196_);
				}
				_tmp197_ = self->priv->_map;
				_tmp198_ = mind_map_get_model (_tmp197_);
				_tmp199_ = _tmp198_;
				_tmp200_ = map_model_get_attach_conn (_tmp199_);
				_tmp201_ = _tmp200_;
				_tmp202_ = drop_sticker;
				_tmp203_ = gtk_widget_get_name ((GtkWidget*) _tmp202_);
				_tmp204_ = _tmp203_;
				connection_set_sticker (_tmp201_, _tmp204_);
				_tmp205_ = self->priv->_map;
				_tmp206_ = mind_map_get_model (_tmp205_);
				_tmp207_ = _tmp206_;
				map_model_set_attach_connection (_tmp207_, NULL, CONN_MODE_DROPPABLE);
			}
		}
		gtk_widget_queue_draw ((GtkWidget*) self);
		_tmp208_ = self->priv->_map;
		g_signal_emit (self, draw_area_signals[DRAW_AREA_CURRENT_CHANGED_SIGNAL], 0, _tmp208_);
		_tmp209_ = self->priv->_map;
		mind_map_auto_save (_tmp209_);
	}
	result = TRUE;
	_g_object_unref0 (drop_sticker);
	return result;
}

void
draw_area_update_connection (DrawArea* self,
                             gdouble x,
                             gdouble y)
{
	Connection* current = NULL;
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	Connection* _tmp3_;
	Connection* _tmp4_;
	Connection* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = selection_current_connection (_tmp2_);
	current = _tmp3_;
	_tmp4_ = current;
	if (_tmp4_ == NULL) {
		_g_object_unref0 (current);
		return;
	}
	_tmp5_ = current;
	connection_draw_to (_tmp5_, draw_area_scale_value (self, x), draw_area_scale_value (self, y));
	gtk_widget_queue_draw ((GtkWidget*) self);
	_g_object_unref0 (current);
}

void
draw_area_add_tag (DrawArea* self,
                   const gchar* tag)
{
	Node* node = NULL;
	MindMap* _tmp0_;
	Selection* _tmp1_;
	Selection* _tmp2_;
	Node* _tmp3_;
	Node* _tmp4_;
	CanvasText* name = NULL;
	Node* _tmp5_;
	CanvasText* _tmp6_;
	CanvasText* _tmp7_;
	CanvasText* _tmp8_;
	CanvasText* orig_text = NULL;
	MindMap* _tmp9_;
	CanvasText* _tmp10_;
	CanvasText* _tmp11_;
	CanvasText* _tmp12_;
	Tagger* _tmp13_;
	Tagger* _tmp14_;
	CanvasText* _tmp15_;
	FormattedText* _tmp16_;
	FormattedText* _tmp17_;
	CanvasText* _tmp18_;
	FormattedText* _tmp19_;
	FormattedText* _tmp20_;
	CanvasText* _tmp21_;
	FormattedText* _tmp22_;
	FormattedText* _tmp23_;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	gint _tmp26_;
	gint _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	CanvasText* _tmp30_;
	FormattedText* _tmp31_;
	FormattedText* _tmp32_;
	Tagger* _tmp33_;
	Tagger* _tmp34_;
	CanvasText* _tmp35_;
	FormattedText* _tmp36_;
	FormattedText* _tmp37_;
	MindMap* _tmp38_;
	MindMap* _tmp39_;
	Node* _tmp40_;
	CanvasText* _tmp41_;
	UndoNodeName* _tmp42_;
	UndoNodeName* _tmp43_;
	MindMap* _tmp44_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tag != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = selection_current_node (_tmp2_);
	node = _tmp3_;
	_tmp4_ = node;
	if (_tmp4_ == NULL) {
		_g_object_unref0 (node);
		return;
	}
	_tmp5_ = node;
	_tmp6_ = node_get_name (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	name = _tmp8_;
	_tmp9_ = self->priv->_map;
	_tmp10_ = canvas_text_new (_tmp9_);
	orig_text = _tmp10_;
	_tmp11_ = orig_text;
	_tmp12_ = name;
	canvas_text_copy (_tmp11_, _tmp12_);
	_tmp13_ = draw_area_get_tagger (self);
	_tmp14_ = _tmp13_;
	_tmp15_ = name;
	_tmp16_ = canvas_text_get_text (_tmp15_);
	_tmp17_ = _tmp16_;
	tagger_preedit_load_tags (_tmp14_, _tmp17_);
	_tmp18_ = name;
	_tmp19_ = canvas_text_get_text (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = name;
	_tmp22_ = canvas_text_get_text (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = formatted_text_get_text (_tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = strlen (_tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = g_strconcat (" @", tag, NULL);
	_tmp29_ = _tmp28_;
	formatted_text_insert_text (_tmp20_, _tmp27_, _tmp29_);
	_g_free0 (_tmp29_);
	_tmp30_ = name;
	_tmp31_ = canvas_text_get_text (_tmp30_);
	_tmp32_ = _tmp31_;
	g_signal_emit_by_name (_tmp32_, "changed");
	_tmp33_ = draw_area_get_tagger (self);
	_tmp34_ = _tmp33_;
	_tmp35_ = name;
	_tmp36_ = canvas_text_get_text (_tmp35_);
	_tmp37_ = _tmp36_;
	tagger_postedit_load_tags (_tmp34_, _tmp37_);
	_tmp38_ = self->priv->_map;
	_tmp39_ = self->priv->_map;
	_tmp40_ = node;
	_tmp41_ = orig_text;
	_tmp42_ = undo_node_name_new (_tmp39_, _tmp40_, _tmp41_);
	_tmp43_ = _tmp42_;
	mind_map_add_undo (_tmp38_, (UndoItem*) _tmp43_);
	_g_object_unref0 (_tmp43_);
	_tmp44_ = self->priv->_map;
	mind_map_auto_save (_tmp44_);
	_g_object_unref0 (orig_text);
	_g_object_unref0 (name);
	_g_object_unref0 (node);
}

void
draw_area_show_auto_completion (DrawArea* self,
                                GList* values,
                                gint start_pos,
                                gint end_pos)
{
	CanvasText* ct = NULL;
	MindMap* _tmp0_;
	CanvasText* _tmp1_;
	CanvasText* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_map;
	_tmp1_ = mind_map_get_current_text (_tmp0_);
	ct = _tmp1_;
	_tmp2_ = ct;
	if (_tmp2_ != NULL) {
		TextCompletion* _tmp3_;
		CanvasText* _tmp4_;
		_tmp3_ = self->priv->_completion;
		_tmp4_ = ct;
		text_completion_show (_tmp3_, _tmp4_, values, start_pos, end_pos);
	} else {
		TextCompletion* _tmp5_;
		_tmp5_ = self->priv->_completion;
		text_completion_hide (_tmp5_);
	}
	_g_object_unref0 (ct);
}

void
draw_area_hide_auto_completion (DrawArea* self)
{
	TextCompletion* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_completion;
	text_completion_hide (_tmp0_);
}

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

static void
draw_area_set_win (DrawArea* self,
                   MainWindow* value)
{
	MainWindow* old_value;
	g_return_if_fail (self != NULL);
	old_value = draw_area_get_win (self);
	if (old_value != value) {
		MainWindow* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_win);
		self->priv->_win = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, draw_area_properties[DRAW_AREA_WIN_PROPERTY]);
	}
}

Animator*
draw_area_get_animator (DrawArea* self)
{
	Animator* result;
	Animator* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_animator;
	result = _tmp0_;
	return result;
}

void
draw_area_set_animator (DrawArea* self,
                        Animator* value)
{
	Animator* old_value;
	g_return_if_fail (self != NULL);
	old_value = draw_area_get_animator (self);
	if (old_value != value) {
		Animator* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_animator);
		self->priv->_animator = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, draw_area_properties[DRAW_AREA_ANIMATOR_PROPERTY]);
	}
}

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

GtkIMContext*
draw_area_get_im_context (DrawArea* self)
{
	GtkIMContext* result;
	GtkIMContext* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_im_context;
	result = _tmp0_;
	return result;
}

gdouble
draw_area_get_scaled_x (DrawArea* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_scaled_x;
	return result;
}

gdouble
draw_area_get_scaled_y (DrawArea* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_scaled_y;
	return result;
}

gdouble
draw_area_get_press_x (DrawArea* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_press_x;
	return result;
}

gdouble
draw_area_get_press_y (DrawArea* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_press_y;
	return result;
}

gdouble
draw_area_get_origin_x (DrawArea* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_origin_x;
	return result;
}

void
draw_area_set_origin_x (DrawArea* self,
                        gdouble value)
{
	g_return_if_fail (self != NULL);
	self->priv->_origin_x = value;
	self->priv->_store_origin_x = self->priv->_origin_x;
	g_object_notify_by_pspec ((GObject *) self, draw_area_properties[DRAW_AREA_ORIGIN_X_PROPERTY]);
}

gdouble
draw_area_get_origin_y (DrawArea* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_origin_y;
	return result;
}

void
draw_area_set_origin_y (DrawArea* self,
                        gdouble value)
{
	g_return_if_fail (self != NULL);
	self->priv->_origin_y = value;
	self->priv->_store_origin_y = self->priv->_origin_y;
	g_object_notify_by_pspec ((GObject *) self, draw_area_properties[DRAW_AREA_ORIGIN_Y_PROPERTY]);
}

gdouble
draw_area_get_sfactor (DrawArea* self)
{
	gdouble result;
	g_return_val_if_fail (self != NULL, -1.0);
	result = self->priv->_scale_factor;
	return result;
}

void
draw_area_set_sfactor (DrawArea* self,
                       gdouble value)
{
	g_return_if_fail (self != NULL);
	self->priv->_scale_factor = value;
	self->priv->_store_scale_factor = self->priv->_scale_factor;
	g_object_notify_by_pspec ((GObject *) self, draw_area_properties[DRAW_AREA_SFACTOR_PROPERTY]);
}

UrlEditor*
draw_area_get_url_editor (DrawArea* self)
{
	UrlEditor* result;
	UrlEditor* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url_editor;
	result = _tmp0_;
	return result;
}

ImageEditor*
draw_area_get_image_editor (DrawArea* self)
{
	ImageEditor* result;
	ImageEditor* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_image_editor;
	result = _tmp0_;
	return result;
}

Tagger*
draw_area_get_tagger (DrawArea* self)
{
	Tagger* result;
	Tagger* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tagger;
	result = _tmp0_;
	return result;
}

TextCompletion*
draw_area_get_completion (DrawArea* self)
{
	TextCompletion* result;
	TextCompletion* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_completion;
	result = _tmp0_;
	return result;
}

Connection*
draw_area_get_last_connection (DrawArea* self)
{
	Connection* result;
	Connection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_last_connection;
	result = _tmp0_;
	return result;
}

void
draw_area_set_last_connection (DrawArea* self,
                               Connection* value)
{
	Connection* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_last_connection);
	self->priv->_last_connection = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, draw_area_properties[DRAW_AREA_LAST_CONNECTION_PROPERTY]);
}

GArray*
draw_area_get_orig_info (DrawArea* self)
{
	GArray* result;
	GArray* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_orig_info;
	result = _tmp0_;
	return result;
}

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

static void
g_cclosure_user_marshal_VOID__INT_INT (GClosure * closure,
                                       GValue * return_value,
                                       guint n_param_values,
                                       const GValue * param_values,
                                       gpointer invocation_hint,
                                       gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1, gint arg_1, gint arg_2, gpointer data2);
	register GMarshalFunc_VOID__INT_INT 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__INT_INT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_int (param_values + 1), g_value_get_int (param_values + 2), data2);
}

static void
draw_area_class_init (DrawAreaClass * klass,
                      gpointer klass_data)
{
	draw_area_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DrawArea_private_offset);
	((GtkWidgetClass *) klass)->size_allocate = (void (*) (GtkWidget*, gint, gint, gint)) draw_area_real_size_allocate;
	G_OBJECT_CLASS (klass)->get_property = _vala_draw_area_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_draw_area_set_property;
	G_OBJECT_CLASS (klass)->finalize = draw_area_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_WIN_PROPERTY, draw_area_properties[DRAW_AREA_WIN_PROPERTY] = g_param_spec_object ("win", "win", "win", TYPE_MAIN_WINDOW, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_ANIMATOR_PROPERTY, draw_area_properties[DRAW_AREA_ANIMATOR_PROPERTY] = g_param_spec_object ("animator", "animator", "animator", TYPE_ANIMATOR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_MAP_PROPERTY, draw_area_properties[DRAW_AREA_MAP_PROPERTY] = param_spec_mind_map ("map", "map", "map", TYPE_MIND_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_IM_CONTEXT_PROPERTY, draw_area_properties[DRAW_AREA_IM_CONTEXT_PROPERTY] = g_param_spec_object ("im-context", "im-context", "im-context", gtk_im_context_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_SCALED_X_PROPERTY, draw_area_properties[DRAW_AREA_SCALED_X_PROPERTY] = g_param_spec_double ("scaled-x", "scaled-x", "scaled-x", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_SCALED_Y_PROPERTY, draw_area_properties[DRAW_AREA_SCALED_Y_PROPERTY] = g_param_spec_double ("scaled-y", "scaled-y", "scaled-y", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_PRESS_X_PROPERTY, draw_area_properties[DRAW_AREA_PRESS_X_PROPERTY] = g_param_spec_double ("press-x", "press-x", "press-x", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_PRESS_Y_PROPERTY, draw_area_properties[DRAW_AREA_PRESS_Y_PROPERTY] = g_param_spec_double ("press-y", "press-y", "press-y", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_ORIGIN_X_PROPERTY, draw_area_properties[DRAW_AREA_ORIGIN_X_PROPERTY] = g_param_spec_double ("origin-x", "origin-x", "origin-x", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_ORIGIN_Y_PROPERTY, draw_area_properties[DRAW_AREA_ORIGIN_Y_PROPERTY] = g_param_spec_double ("origin-y", "origin-y", "origin-y", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_SFACTOR_PROPERTY, draw_area_properties[DRAW_AREA_SFACTOR_PROPERTY] = g_param_spec_double ("sfactor", "sfactor", "sfactor", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_URL_EDITOR_PROPERTY, draw_area_properties[DRAW_AREA_URL_EDITOR_PROPERTY] = param_spec_url_editor ("url-editor", "url-editor", "url-editor", TYPE_URL_EDITOR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_IMAGE_EDITOR_PROPERTY, draw_area_properties[DRAW_AREA_IMAGE_EDITOR_PROPERTY] = param_spec_image_editor ("image-editor", "image-editor", "image-editor", TYPE_IMAGE_EDITOR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_TAGGER_PROPERTY, draw_area_properties[DRAW_AREA_TAGGER_PROPERTY] = param_spec_tagger ("tagger", "tagger", "tagger", TYPE_TAGGER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_COMPLETION_PROPERTY, draw_area_properties[DRAW_AREA_COMPLETION_PROPERTY] = param_spec_text_completion ("completion", "completion", "completion", TYPE_TEXT_COMPLETION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_LAST_CONNECTION_PROPERTY, draw_area_properties[DRAW_AREA_LAST_CONNECTION_PROPERTY] = g_param_spec_object ("last-connection", "last-connection", "last-connection", TYPE_CONNECTION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DRAW_AREA_ORIG_INFO_PROPERTY, draw_area_properties[DRAW_AREA_ORIG_INFO_PROPERTY] = g_param_spec_boxed ("orig-info", "orig-info", "orig-info", G_TYPE_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	draw_area_signals[DRAW_AREA_CURRENT_CHANGED_SIGNAL] = g_signal_new ("current-changed", TYPE_DRAW_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__MIND_MAP, G_TYPE_NONE, 1, TYPE_MIND_MAP);
	draw_area_signals[DRAW_AREA_SCALE_CHANGED_SIGNAL] = g_signal_new ("scale-changed", TYPE_DRAW_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__DOUBLE, G_TYPE_NONE, 1, G_TYPE_DOUBLE);
	draw_area_signals[DRAW_AREA_SCROLL_CHANGED_SIGNAL] = g_signal_new ("scroll-changed", TYPE_DRAW_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	draw_area_signals[DRAW_AREA_SIZE_READY_SIGNAL] = g_signal_new ("size-ready", TYPE_DRAW_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
	draw_area_signals[DRAW_AREA_SIZE_CHANGED_SIGNAL] = g_signal_new ("size-changed", TYPE_DRAW_AREA, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
}

static void
draw_area_instance_init (DrawArea * self,
                         gpointer klass)
{
	self->priv = draw_area_get_instance_private (self);
	self->priv->_control = FALSE;
	self->priv->_shift = FALSE;
	self->priv->_alt = FALSE;
	self->priv->_pressed = FALSE;
	self->priv->_press_num = 0;
	self->priv->_press_middle = FALSE;
	self->priv->_resize = FALSE;
	self->priv->_orig_resizable = FALSE;
	self->priv->_motion = FALSE;
	self->priv->_last_connection = NULL;
	self->priv->_orig_side = NODE_SIDE_LEFT;
	self->priv->_scroll_save_id = NULL;
	self->priv->_debug = TRUE;
	self->priv->_select_hover_id = (guint) 0;
	self->priv->_node_link_tooltip = NULL;
	self->priv->_autopan_id = (guint) 0;
	self->priv->_resized_count = 0;
}

static void
draw_area_finalize (GObject * obj)
{
	DrawArea * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_DRAW_AREA, DrawArea);
	_mind_map_unref0 (self->priv->_map);
	_g_object_unref0 (self->priv->_last_connection);
	_g_array_unref0 (self->priv->_orig_info);
	_base_menu_unref0 (self->priv->_node_menu);
	_base_menu_unref0 (self->priv->_conn_menu);
	_base_menu_unref0 (self->priv->_conns_menu);
	_base_menu_unref0 (self->priv->_nodes_menu);
	_base_menu_unref0 (self->priv->_groups_menu);
	_base_menu_unref0 (self->priv->_callout_menu);
	_base_menu_unref0 (self->priv->_empty_menu);
	_base_menu_unref0 (self->priv->_text_menu);
	_g_free0 (self->priv->_scroll_save_id);
	_image_editor_unref0 (self->priv->_image_editor);
	_url_editor_unref0 (self->priv->_url_editor);
	_g_object_unref0 (self->priv->_im_context);
	_tagger_unref0 (self->priv->_tagger);
	_text_completion_unref0 (self->priv->_completion);
	_g_object_unref0 (self->priv->_key_controller);
	_g_object_unref0 (self->priv->_scroll);
	_g_free0 (self->priv->_node_link_tooltip);
	_g_object_unref0 (self->priv->_win);
	_g_object_unref0 (self->priv->_animator);
	G_OBJECT_CLASS (draw_area_parent_class)->finalize (obj);
}

static GType
draw_area_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DrawAreaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) draw_area_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DrawArea), 0, (GInstanceInitFunc) draw_area_instance_init, NULL };
	GType draw_area_type_id;
	draw_area_type_id = g_type_register_static (gtk_drawing_area_get_type (), "DrawArea", &g_define_type_info, 0);
	DrawArea_private_offset = g_type_add_instance_private (draw_area_type_id, sizeof (DrawAreaPrivate));
	return draw_area_type_id;
}

GType
draw_area_get_type (void)
{
	static volatile gsize draw_area_type_id__once = 0;
	if (g_once_init_enter (&draw_area_type_id__once)) {
		GType draw_area_type_id;
		draw_area_type_id = draw_area_get_type_once ();
		g_once_init_leave (&draw_area_type_id__once, draw_area_type_id);
	}
	return draw_area_type_id__once;
}

static void
_vala_draw_area_get_property (GObject * object,
                              guint property_id,
                              GValue * value,
                              GParamSpec * pspec)
{
	DrawArea * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_DRAW_AREA, DrawArea);
	switch (property_id) {
		case DRAW_AREA_WIN_PROPERTY:
		g_value_set_object (value, draw_area_get_win (self));
		break;
		case DRAW_AREA_ANIMATOR_PROPERTY:
		g_value_set_object (value, draw_area_get_animator (self));
		break;
		case DRAW_AREA_MAP_PROPERTY:
		value_set_mind_map (value, draw_area_get_map (self));
		break;
		case DRAW_AREA_IM_CONTEXT_PROPERTY:
		g_value_set_object (value, draw_area_get_im_context (self));
		break;
		case DRAW_AREA_SCALED_X_PROPERTY:
		g_value_set_double (value, draw_area_get_scaled_x (self));
		break;
		case DRAW_AREA_SCALED_Y_PROPERTY:
		g_value_set_double (value, draw_area_get_scaled_y (self));
		break;
		case DRAW_AREA_PRESS_X_PROPERTY:
		g_value_set_double (value, draw_area_get_press_x (self));
		break;
		case DRAW_AREA_PRESS_Y_PROPERTY:
		g_value_set_double (value, draw_area_get_press_y (self));
		break;
		case DRAW_AREA_ORIGIN_X_PROPERTY:
		g_value_set_double (value, draw_area_get_origin_x (self));
		break;
		case DRAW_AREA_ORIGIN_Y_PROPERTY:
		g_value_set_double (value, draw_area_get_origin_y (self));
		break;
		case DRAW_AREA_SFACTOR_PROPERTY:
		g_value_set_double (value, draw_area_get_sfactor (self));
		break;
		case DRAW_AREA_URL_EDITOR_PROPERTY:
		value_set_url_editor (value, draw_area_get_url_editor (self));
		break;
		case DRAW_AREA_IMAGE_EDITOR_PROPERTY:
		value_set_image_editor (value, draw_area_get_image_editor (self));
		break;
		case DRAW_AREA_TAGGER_PROPERTY:
		value_set_tagger (value, draw_area_get_tagger (self));
		break;
		case DRAW_AREA_COMPLETION_PROPERTY:
		value_set_text_completion (value, draw_area_get_completion (self));
		break;
		case DRAW_AREA_LAST_CONNECTION_PROPERTY:
		g_value_set_object (value, draw_area_get_last_connection (self));
		break;
		case DRAW_AREA_ORIG_INFO_PROPERTY:
		g_value_set_boxed (value, draw_area_get_orig_info (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_draw_area_set_property (GObject * object,
                              guint property_id,
                              const GValue * value,
                              GParamSpec * pspec)
{
	DrawArea * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_DRAW_AREA, DrawArea);
	switch (property_id) {
		case DRAW_AREA_WIN_PROPERTY:
		draw_area_set_win (self, g_value_get_object (value));
		break;
		case DRAW_AREA_ANIMATOR_PROPERTY:
		draw_area_set_animator (self, g_value_get_object (value));
		break;
		case DRAW_AREA_ORIGIN_X_PROPERTY:
		draw_area_set_origin_x (self, g_value_get_double (value));
		break;
		case DRAW_AREA_ORIGIN_Y_PROPERTY:
		draw_area_set_origin_y (self, g_value_get_double (value));
		break;
		case DRAW_AREA_SFACTOR_PROPERTY:
		draw_area_set_sfactor (self, g_value_get_double (value));
		break;
		case DRAW_AREA_LAST_CONNECTION_PROPERTY:
		draw_area_set_last_connection (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

