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

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

#define TYPE_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;
typedef struct _BaseMenuPrivate BaseMenuPrivate;

#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;
typedef struct _NodeMenuPrivate NodeMenuPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

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

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

#define TYPE_KEY_COMMAND (key_command_get_type ())

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

typedef struct _Node Node;
typedef struct _NodeClass NodeClass;

#define TYPE_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_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_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_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 _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))

#define TYPE_CONNECTIONS (connections_get_type ())
#define CONNECTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONNECTIONS, Connections))
#define CONNECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONNECTIONS, ConnectionsClass))
#define IS_CONNECTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONNECTIONS))
#define IS_CONNECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONNECTIONS))
#define CONNECTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONNECTIONS, ConnectionsClass))

typedef struct _Connections Connections;
typedef struct _ConnectionsClass ConnectionsClass;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _BaseMenu {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BaseMenuPrivate * priv;
};

struct _BaseMenuClass {
	GTypeClass parent_class;
	void (*finalize) (BaseMenu *self);
	void (*on_popup) (BaseMenu* self);
	void (*on_popdown) (BaseMenu* self);
};

struct _NodeMenu {
	BaseMenu parent_instance;
	NodeMenuPrivate * priv;
};

struct _NodeMenuClass {
	BaseMenuClass parent_class;
};

struct _NodeMenuPrivate {
	GMenu* _edit_menu;
	GMenu* _change_submenu;
};

static gint NodeMenu_private_offset;
static gpointer node_menu_parent_class = NULL;

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 void base_menu_on_popup (BaseMenu* self);
VALA_EXTERN GType draw_area_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DrawArea, g_object_unref)
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 BaseMenu* base_menu_new (GtkApplication* app,
                         DrawArea* canvas,
                         const gchar* group);
VALA_EXTERN BaseMenu* base_menu_construct (GType object_type,
                               GtkApplication* app,
                               DrawArea* canvas,
                               const gchar* group);
VALA_EXTERN GType key_command_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void base_menu_append_menu_item (BaseMenu* self,
                                 GMenu* menu,
                                 KeyCommand command,
                                 const gchar* label,
                                 gboolean grab_canvas);
VALA_EXTERN GMenu* base_menu_get_menu (BaseMenu* self);
static gboolean node_menu_node_is_task (NodeMenu* self);
VALA_EXTERN GType node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Node, 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 MindMap* base_menu_get_map (BaseMenu* self);
VALA_EXTERN Node* mind_map_get_current_node (MindMap* self);
VALA_EXTERN gboolean node_task_enabled (Node* self);
static gboolean node_menu_node_task_is_done (NodeMenu* self);
VALA_EXTERN gboolean node_task_done (Node* self);
static gboolean node_menu_node_has_note (NodeMenu* self);
VALA_EXTERN const gchar* node_get_note (Node* self);
static gboolean node_menu_node_has_image (NodeMenu* 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 NodeImage* node_get_image (Node* self);
static gboolean node_menu_node_has_link (NodeMenu* self);
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);
static gboolean node_menu_node_has_callout (NodeMenu* self);
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 gboolean map_model_node_has_callout (MapModel* self);
static gboolean node_menu_node_foldable (NodeMenu* self);
VALA_EXTERN gboolean node_is_leaf (Node* self);
static gboolean node_menu_node_linkable (NodeMenu* self);
VALA_EXTERN gboolean node_is_root (Node* self);
VALA_EXTERN GArray* mind_map_get_nodes (MindMap* self);
static gboolean node_menu_node_parentable (NodeMenu* self);
static gboolean node_menu_node_sortable (NodeMenu* self);
VALA_EXTERN GArray* node_children (Node* self);
static gboolean node_menu_node_is_folded (NodeMenu* self);
VALA_EXTERN gboolean node_get_folded (Node* self);
static void node_menu_change_menu (NodeMenu* self,
                            GMenu* menu,
                            gint pos,
                            const gchar* new_name,
                            const gchar* action);
static void node_menu_real_on_popup (BaseMenu* base);
VALA_EXTERN void base_menu_change_menu_item_label (BaseMenu* self,
                                       GMenu* menu,
                                       KeyCommand command,
                                       const gchar* label);
VALA_EXTERN gboolean minder_clipboard_node_pasteable (void);
VALA_EXTERN gboolean minder_clipboard_image_pasteable (void);
VALA_EXTERN gboolean minder_clipboard_text_pasteable (void);
VALA_EXTERN void base_menu_set_enabled (BaseMenu* self,
                            KeyCommand command,
                            gboolean enable);
VALA_EXTERN gboolean mind_map_get_editable (MindMap* self);
VALA_EXTERN gpointer connections_ref (gpointer instance);
VALA_EXTERN void connections_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_connections (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_connections (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_connections (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_connections (const GValue* value);
VALA_EXTERN GType connections_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Connections, connections_unref)
VALA_EXTERN Connections* map_model_get_connections (MapModel* self);
VALA_EXTERN gboolean connections_get_hide (Connections* self);
VALA_EXTERN gboolean node_main_branch (Node* self);
VALA_EXTERN gboolean node_get_link_color_root (Node* self);
VALA_EXTERN gboolean map_model_sequences_togglable (MapModel* self);
VALA_EXTERN gboolean map_model_detachable (MapModel* self);
VALA_EXTERN gboolean mind_map_root_selectable (MindMap* self);
VALA_EXTERN gboolean map_model_sibling_exists (MapModel* self,
                                   Node* node);
VALA_EXTERN gboolean mind_map_children_selectable (MindMap* self);
VALA_EXTERN gboolean mind_map_parent_selectable (MindMap* self);
VALA_EXTERN const gchar* node_get_sticker (Node* self);
VALA_EXTERN gboolean node_is_summary (Node* self);
static void node_menu_finalize (BaseMenu * obj);
static GType node_menu_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
node_menu_get_instance_private (NodeMenu* self)
{
	return G_STRUCT_MEMBER_P (self, NodeMenu_private_offset);
}

NodeMenu*
node_menu_construct (GType object_type,
                     GtkApplication* app,
                     DrawArea* da)
{
	NodeMenu* self = NULL;
	GMenu* _tmp0_;
	GMenu* _tmp1_;
	GMenu* _tmp2_;
	GMenu* _tmp3_;
	GMenu* _tmp4_;
	GMenu* _tmp5_;
	GMenu* _tmp6_;
	GMenu* color_menu = NULL;
	GMenu* _tmp7_;
	GMenu* fold_menu = NULL;
	GMenu* _tmp8_;
	GMenu* _tmp9_;
	GMenu* _tmp10_;
	GMenu* _tmp11_;
	GMenu* _tmp12_;
	GMenu* _tmp13_;
	GMenu* _tmp14_;
	GMenu* _tmp15_;
	GMenu* _tmp16_;
	GMenu* _tmp17_;
	GMenu* _tmp18_;
	GMenu* _tmp19_;
	GMenu* _tmp20_;
	GMenu* _tmp21_;
	GMenu* _tmp22_;
	GMenu* change_menu = NULL;
	GMenu* _tmp23_;
	GMenu* _tmp24_;
	GMenu* add_submenu = NULL;
	GMenu* _tmp25_;
	GMenu* quick_menu = NULL;
	GMenu* _tmp26_;
	GMenu* add_menu = NULL;
	GMenu* _tmp27_;
	GMenu* sel_node_menu = NULL;
	GMenu* _tmp28_;
	GMenu* sel_other_menu = NULL;
	GMenu* _tmp29_;
	GMenu* sel_submenu = NULL;
	GMenu* _tmp30_;
	GMenu* sel_menu = NULL;
	GMenu* _tmp31_;
	GMenu* sort_submenu = NULL;
	GMenu* _tmp32_;
	GMenu* sort_menu = NULL;
	GMenu* _tmp33_;
	GMenu* detach_menu = NULL;
	GMenu* _tmp34_;
	GMenu* _tmp35_;
	GMenu* _tmp36_;
	GMenu* _tmp37_;
	GMenu* _tmp38_;
	GMenu* _tmp39_;
	GMenu* _tmp40_;
	GMenu* _tmp41_;
	GMenu* _tmp42_;
	GMenu* _tmp43_;
	GMenu* _tmp44_;
	GMenu* _tmp45_;
	GMenu* _tmp46_;
	GMenu* _tmp47_;
	g_return_val_if_fail (app != NULL, NULL);
	g_return_val_if_fail (da != NULL, NULL);
	self = (NodeMenu*) base_menu_construct (object_type, app, da, "node");
	_tmp0_ = g_menu_new ();
	_g_object_unref0 (self->priv->_edit_menu);
	self->priv->_edit_menu = _tmp0_;
	_tmp1_ = self->priv->_edit_menu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp1_, KEY_COMMAND_EDIT_COPY, _ ("Copy"), TRUE);
	_tmp2_ = self->priv->_edit_menu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp2_, KEY_COMMAND_EDIT_CUT, _ ("Cut"), TRUE);
	_tmp3_ = self->priv->_edit_menu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp3_, KEY_COMMAND_EDIT_PASTE, _ ("Paste"), TRUE);
	_tmp4_ = self->priv->_edit_menu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp4_, KEY_COMMAND_NODE_PASTE_REPLACE, _ ("Paste and Replace Node"), TRUE);
	_tmp5_ = self->priv->_edit_menu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp5_, KEY_COMMAND_NODE_REMOVE, _ ("Delete"), TRUE);
	_tmp6_ = self->priv->_edit_menu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp6_, KEY_COMMAND_NODE_REMOVE_ONLY, _ ("Delete Single Node"), TRUE);
	_tmp7_ = g_menu_new ();
	color_menu = _tmp7_;
	base_menu_append_menu_item ((BaseMenu*) self, color_menu, KEY_COMMAND_NODE_CHANGE_LINK_COLOR, _ ("Set to color…"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, color_menu, KEY_COMMAND_NODE_RANDOMIZE_LINK_COLOR, _ ("Randomize color"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, color_menu, KEY_COMMAND_NODE_REPARENT_LINK_COLOR, _ ("Use parent color"), TRUE);
	_tmp8_ = g_menu_new ();
	fold_menu = _tmp8_;
	base_menu_append_menu_item ((BaseMenu*) self, fold_menu, KEY_COMMAND_NODE_TOGGLE_FOLDS_SHALLOW, _ ("One Level"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, fold_menu, KEY_COMMAND_NODE_TOGGLE_FOLDS_DEEP, _ ("All Levels"), TRUE);
	_tmp9_ = g_menu_new ();
	_g_object_unref0 (self->priv->_change_submenu);
	self->priv->_change_submenu = _tmp9_;
	_tmp10_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp10_, KEY_COMMAND_EDIT_SELECTED, _ ("Edit Text…"), TRUE);
	_tmp11_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp11_, KEY_COMMAND_EDIT_NOTE, _ ("Edit Note"), FALSE);
	_tmp12_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp12_, KEY_COMMAND_SHOW_TAG_SIDEBAR, _ ("Edit Tags"), FALSE);
	_tmp13_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp13_, KEY_COMMAND_NODE_CHANGE_TASK, _ ("Add Task"), TRUE);
	_tmp14_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp14_, KEY_COMMAND_NODE_CHANGE_IMAGE, _ ("Add Image"), TRUE);
	_tmp15_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp15_, KEY_COMMAND_REMOVE_STICKER_SELECTED, _ ("Remove Sticker"), TRUE);
	_tmp16_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp16_, KEY_COMMAND_NODE_TOGGLE_LINKS, _ ("Add Node Link"), TRUE);
	_tmp17_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp17_, KEY_COMMAND_NODE_ADD_CONNECTION, _ ("Add Connection"), TRUE);
	_tmp18_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp18_, KEY_COMMAND_NODE_ADD_GROUP, _ ("Add Group"), TRUE);
	_tmp19_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp19_, KEY_COMMAND_NODE_TOGGLE_CALLOUT, _ ("Add Callout"), TRUE);
	_tmp20_ = self->priv->_change_submenu;
	g_menu_append_submenu (_tmp20_, _ ("Link Color"), (GMenuModel*) color_menu);
	_tmp21_ = self->priv->_change_submenu;
	g_menu_append_submenu (_tmp21_, _ ("Toggle Folding"), (GMenuModel*) fold_menu);
	_tmp22_ = self->priv->_change_submenu;
	base_menu_append_menu_item ((BaseMenu*) self, _tmp22_, KEY_COMMAND_NODE_TOGGLE_SEQUENCE, _ ("Toggle Sequence"), TRUE);
	_tmp23_ = g_menu_new ();
	change_menu = _tmp23_;
	_tmp24_ = self->priv->_change_submenu;
	g_menu_append_submenu (change_menu, _ ("Change Node"), (GMenuModel*) _tmp24_);
	_tmp25_ = g_menu_new ();
	add_submenu = _tmp25_;
	base_menu_append_menu_item ((BaseMenu*) self, add_submenu, KEY_COMMAND_NODE_ADD_ROOT, _ ("Add Root Node"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, add_submenu, KEY_COMMAND_NODE_ADD_PARENT, _ ("Add Parent Node"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, add_submenu, KEY_COMMAND_NODE_ADD_CHILD, _ ("Add Child Node"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, add_submenu, KEY_COMMAND_NODE_ADD_SIBLING_AFTER, _ ("Add Sibling Node"), TRUE);
	_tmp26_ = g_menu_new ();
	quick_menu = _tmp26_;
	base_menu_append_menu_item ((BaseMenu*) self, quick_menu, KEY_COMMAND_NODE_QUICK_ENTRY_INSERT, _ ("Insert Nodes"), FALSE);
	base_menu_append_menu_item ((BaseMenu*) self, quick_menu, KEY_COMMAND_NODE_QUICK_ENTRY_REPLACE, _ ("Replace Nodes"), FALSE);
	_tmp27_ = g_menu_new ();
	add_menu = _tmp27_;
	g_menu_append_submenu (add_menu, _ ("Add Node"), (GMenuModel*) add_submenu);
	g_menu_append_submenu (add_menu, _ ("Quick Entry"), (GMenuModel*) quick_menu);
	_tmp28_ = g_menu_new ();
	sel_node_menu = _tmp28_;
	base_menu_append_menu_item ((BaseMenu*) self, sel_node_menu, KEY_COMMAND_NODE_SELECT_ROOT, _ ("Root Node"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sel_node_menu, KEY_COMMAND_NODE_SELECT_SIBLING_NEXT, _ ("Next Sibling Node"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sel_node_menu, KEY_COMMAND_NODE_SELECT_SIBLING_PREV, _ ("Previous Sibling Node"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sel_node_menu, KEY_COMMAND_NODE_SELECT_CHILD, _ ("Child Node"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sel_node_menu, KEY_COMMAND_NODE_SELECT_CHILDREN, _ ("Child Nodes"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sel_node_menu, KEY_COMMAND_NODE_SELECT_TREE, _ ("Subtree"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sel_node_menu, KEY_COMMAND_NODE_SELECT_PARENT, _ ("Parent Node"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sel_node_menu, KEY_COMMAND_NODE_SELECT_LINKED, _ ("Linked Node"), TRUE);
	_tmp29_ = g_menu_new ();
	sel_other_menu = _tmp29_;
	base_menu_append_menu_item ((BaseMenu*) self, sel_other_menu, KEY_COMMAND_NODE_SELECT_CONNECTION, _ ("Connection"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sel_other_menu, KEY_COMMAND_NODE_SELECT_CALLOUT, _ ("Callout"), TRUE);
	_tmp30_ = g_menu_new ();
	sel_submenu = _tmp30_;
	g_menu_append_section (sel_submenu, NULL, (GMenuModel*) sel_node_menu);
	g_menu_append_section (sel_submenu, NULL, (GMenuModel*) sel_other_menu);
	_tmp31_ = g_menu_new ();
	sel_menu = _tmp31_;
	g_menu_append_submenu (sel_menu, _ ("Select"), (GMenuModel*) sel_submenu);
	base_menu_append_menu_item ((BaseMenu*) self, sel_menu, KEY_COMMAND_NODE_CENTER, _ ("Center Current Node"), TRUE);
	_tmp32_ = g_menu_new ();
	sort_submenu = _tmp32_;
	base_menu_append_menu_item ((BaseMenu*) self, sort_submenu, KEY_COMMAND_NODE_SORT_ALPHABETICALLY, _ ("Alphabetically"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sort_submenu, KEY_COMMAND_NODE_SORT_RANDOMLY, _ ("Randomly"), TRUE);
	_tmp33_ = g_menu_new ();
	sort_menu = _tmp33_;
	g_menu_append_submenu (sort_menu, _ ("Sort Children"), (GMenuModel*) sort_submenu);
	_tmp34_ = g_menu_new ();
	detach_menu = _tmp34_;
	base_menu_append_menu_item ((BaseMenu*) self, detach_menu, KEY_COMMAND_NODE_DETACH, _ ("Detach"), TRUE);
	_tmp35_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp36_ = _tmp35_;
	_tmp37_ = self->priv->_edit_menu;
	g_menu_append_section (_tmp36_, NULL, (GMenuModel*) _tmp37_);
	_tmp38_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp39_ = _tmp38_;
	g_menu_append_section (_tmp39_, NULL, (GMenuModel*) change_menu);
	_tmp40_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp41_ = _tmp40_;
	g_menu_append_section (_tmp41_, NULL, (GMenuModel*) add_menu);
	_tmp42_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp43_ = _tmp42_;
	g_menu_append_section (_tmp43_, NULL, (GMenuModel*) sel_menu);
	_tmp44_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp45_ = _tmp44_;
	g_menu_append_section (_tmp45_, NULL, (GMenuModel*) sort_menu);
	_tmp46_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp47_ = _tmp46_;
	g_menu_append_section (_tmp47_, NULL, (GMenuModel*) detach_menu);
	_g_object_unref0 (detach_menu);
	_g_object_unref0 (sort_menu);
	_g_object_unref0 (sort_submenu);
	_g_object_unref0 (sel_menu);
	_g_object_unref0 (sel_submenu);
	_g_object_unref0 (sel_other_menu);
	_g_object_unref0 (sel_node_menu);
	_g_object_unref0 (add_menu);
	_g_object_unref0 (quick_menu);
	_g_object_unref0 (add_submenu);
	_g_object_unref0 (change_menu);
	_g_object_unref0 (fold_menu);
	_g_object_unref0 (color_menu);
	return self;
}

NodeMenu*
node_menu_new (GtkApplication* app,
               DrawArea* da)
{
	return node_menu_construct (TYPE_NODE_MENU, app, da);
}

static gboolean
node_menu_node_is_task (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		_tmp5_ = current;
		_tmp3_ = node_task_enabled (_tmp5_);
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
node_menu_node_task_is_done (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	if (node_menu_node_is_task (self)) {
		Node* _tmp4_;
		_tmp4_ = current;
		_tmp3_ = node_task_done (_tmp4_);
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
node_menu_node_has_note (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp5_ = current;
		_tmp6_ = node_get_note (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp3_ = g_strcmp0 (_tmp7_, "") != 0;
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
node_menu_node_has_image (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		NodeImage* _tmp6_;
		NodeImage* _tmp7_;
		_tmp5_ = current;
		_tmp6_ = node_get_image (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
node_menu_node_has_link (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		NodeLink* _tmp6_;
		NodeLink* _tmp7_;
		_tmp5_ = current;
		_tmp6_ = node_get_linked_node (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_ != NULL;
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
node_menu_node_has_callout (NodeMenu* self)
{
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	MapModel* _tmp2_;
	MapModel* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_model (_tmp1_);
	_tmp3_ = _tmp2_;
	result = map_model_node_has_callout (_tmp3_);
	return result;
}

static gboolean
node_menu_node_foldable (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		_tmp5_ = current;
		_tmp3_ = !node_is_leaf (_tmp5_);
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
node_menu_node_linkable (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		gboolean _tmp5_ = FALSE;
		Node* _tmp6_;
		_tmp6_ = current;
		if (!node_is_root (_tmp6_)) {
			_tmp5_ = TRUE;
		} else {
			MindMap* _tmp7_;
			MindMap* _tmp8_;
			GArray* _tmp9_;
			GArray* _tmp10_;
			_tmp7_ = base_menu_get_map ((BaseMenu*) self);
			_tmp8_ = _tmp7_;
			_tmp9_ = mind_map_get_nodes (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp5_ = _tmp10_->len > ((guint) 1);
			_g_array_unref0 (_tmp10_);
		}
		_tmp3_ = _tmp5_;
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
node_menu_node_parentable (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		_tmp5_ = current;
		_tmp3_ = !node_is_root (_tmp5_);
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
node_menu_node_sortable (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		GArray* _tmp6_;
		GArray* _tmp7_;
		_tmp5_ = current;
		_tmp6_ = node_children (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_->len > ((guint) 1);
		_g_array_unref0 (_tmp7_);
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static gboolean
node_menu_node_is_folded (NodeMenu* self)
{
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	gboolean _tmp3_ = FALSE;
	Node* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	_tmp4_ = current;
	if (_tmp4_ != NULL) {
		Node* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = current;
		_tmp6_ = node_get_folded (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp3_ = _tmp7_;
	} else {
		_tmp3_ = FALSE;
	}
	result = _tmp3_;
	_g_object_unref0 (current);
	return result;
}

static void
node_menu_change_menu (NodeMenu* self,
                       GMenu* menu,
                       gint pos,
                       const gchar* new_name,
                       const gchar* action)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (menu != NULL);
	g_return_if_fail (new_name != NULL);
	g_return_if_fail (action != NULL);
	g_menu_remove (menu, pos);
	g_menu_insert (menu, pos, new_name, action);
}

static void
node_menu_real_on_popup (BaseMenu* base)
{
	NodeMenu * self;
	Node* current = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	Node* _tmp2_;
	const gchar* _tmp3_ = NULL;
	gchar* task_lbl = NULL;
	gchar* _tmp5_;
	const gchar* _tmp6_ = NULL;
	gchar* link_lbl = NULL;
	gchar* _tmp7_;
	const gchar* _tmp8_ = NULL;
	gchar* fold_lbl = NULL;
	gchar* _tmp9_;
	const gchar* _tmp10_ = NULL;
	gchar* callout_lbl = NULL;
	gchar* _tmp11_;
	const gchar* _tmp12_ = NULL;
	gchar* img_lbl = NULL;
	gchar* _tmp13_;
	GMenu* _tmp14_;
	const gchar* _tmp15_;
	GMenu* _tmp16_;
	const gchar* _tmp17_;
	GMenu* _tmp18_;
	const gchar* _tmp19_;
	GMenu* _tmp20_;
	const gchar* _tmp21_;
	GMenu* _tmp22_;
	const gchar* _tmp23_;
	gboolean node_pasteable = FALSE;
	MindMap* _tmp32_;
	MindMap* _tmp33_;
	gboolean _tmp34_;
	gboolean _tmp35_;
	gboolean _tmp36_ = FALSE;
	gboolean _tmp41_ = FALSE;
	MindMap* _tmp46_;
	MindMap* _tmp47_;
	gboolean _tmp48_;
	gboolean _tmp49_;
	MindMap* _tmp50_;
	MindMap* _tmp51_;
	gboolean _tmp52_;
	gboolean _tmp53_;
	MindMap* _tmp54_;
	MindMap* _tmp55_;
	gboolean _tmp56_;
	gboolean _tmp57_;
	MindMap* _tmp58_;
	MindMap* _tmp59_;
	gboolean _tmp60_;
	gboolean _tmp61_;
	MindMap* _tmp62_;
	MindMap* _tmp63_;
	gboolean _tmp64_;
	gboolean _tmp65_;
	MindMap* _tmp66_;
	MindMap* _tmp67_;
	gboolean _tmp68_;
	gboolean _tmp69_;
	gboolean _tmp70_ = FALSE;
	MindMap* _tmp71_;
	MindMap* _tmp72_;
	MapModel* _tmp73_;
	MapModel* _tmp74_;
	Connections* _tmp75_;
	Connections* _tmp76_;
	gboolean _tmp77_;
	gboolean _tmp78_;
	gboolean _tmp83_ = FALSE;
	MindMap* _tmp88_;
	MindMap* _tmp89_;
	gboolean _tmp90_;
	gboolean _tmp91_;
	MindMap* _tmp92_;
	MindMap* _tmp93_;
	gboolean _tmp94_;
	gboolean _tmp95_;
	MindMap* _tmp96_;
	MindMap* _tmp97_;
	gboolean _tmp98_;
	gboolean _tmp99_;
	MindMap* _tmp100_;
	MindMap* _tmp101_;
	gboolean _tmp102_;
	gboolean _tmp103_;
	MindMap* _tmp104_;
	MindMap* _tmp105_;
	gboolean _tmp106_;
	gboolean _tmp107_;
	gboolean _tmp108_ = FALSE;
	Node* _tmp109_;
	gboolean _tmp114_ = FALSE;
	Node* _tmp115_;
	gboolean _tmp120_ = FALSE;
	gboolean _tmp121_ = FALSE;
	gboolean _tmp122_ = FALSE;
	Node* _tmp123_;
	gboolean _tmp132_ = FALSE;
	gboolean _tmp137_ = FALSE;
	MindMap* _tmp138_;
	MindMap* _tmp139_;
	MapModel* _tmp140_;
	MapModel* _tmp141_;
	gboolean _tmp146_ = FALSE;
	MindMap* _tmp151_;
	MindMap* _tmp152_;
	gboolean _tmp153_;
	gboolean _tmp154_;
	gboolean _tmp155_ = FALSE;
	MindMap* _tmp156_;
	MindMap* _tmp157_;
	MapModel* _tmp158_;
	MapModel* _tmp159_;
	gboolean _tmp164_ = FALSE;
	gboolean _tmp169_ = FALSE;
	MindMap* _tmp174_;
	MindMap* _tmp175_;
	MindMap* _tmp176_;
	MindMap* _tmp177_;
	MapModel* _tmp178_;
	MapModel* _tmp179_;
	Node* _tmp180_;
	MindMap* _tmp181_;
	MindMap* _tmp182_;
	MapModel* _tmp183_;
	MapModel* _tmp184_;
	Node* _tmp185_;
	MindMap* _tmp186_;
	MindMap* _tmp187_;
	MindMap* _tmp188_;
	MindMap* _tmp189_;
	MindMap* _tmp190_;
	MindMap* _tmp191_;
	MindMap* _tmp192_;
	MindMap* _tmp193_;
	gboolean _tmp194_;
	gboolean _tmp195_;
	MindMap* _tmp196_;
	MindMap* _tmp197_;
	gboolean _tmp198_;
	gboolean _tmp199_;
	gboolean _tmp200_ = FALSE;
	Node* _tmp201_;
	const gchar* _tmp202_;
	const gchar* _tmp203_;
	gboolean _tmp208_ = FALSE;
	Node* _tmp209_;
	self = (NodeMenu*) base;
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_current_node (_tmp1_);
	current = _tmp2_;
	if (node_menu_node_is_task (self)) {
		const gchar* _tmp4_ = NULL;
		if (node_menu_node_task_is_done (self)) {
			_tmp4_ = _ ("Remove Task");
		} else {
			_tmp4_ = _ ("Mark Task As Done");
		}
		_tmp3_ = _tmp4_;
	} else {
		_tmp3_ = _ ("Add Task");
	}
	_tmp5_ = g_strdup (_tmp3_);
	task_lbl = _tmp5_;
	if (node_menu_node_has_link (self)) {
		_tmp6_ = _ ("Remove Node Link");
	} else {
		_tmp6_ = _ ("Add Node Link");
	}
	_tmp7_ = g_strdup (_tmp6_);
	link_lbl = _tmp7_;
	if (node_menu_node_is_folded (self)) {
		_tmp8_ = _ ("Unfold Children");
	} else {
		_tmp8_ = _ ("Fold Children");
	}
	_tmp9_ = g_strdup (_tmp8_);
	fold_lbl = _tmp9_;
	if (node_menu_node_has_callout (self)) {
		_tmp10_ = _ ("Remove Callout");
	} else {
		_tmp10_ = _ ("Add Callout");
	}
	_tmp11_ = g_strdup (_tmp10_);
	callout_lbl = _tmp11_;
	if (node_menu_node_has_image (self)) {
		_tmp12_ = _ ("Remove Image");
	} else {
		_tmp12_ = _ ("Add Image");
	}
	_tmp13_ = g_strdup (_tmp12_);
	img_lbl = _tmp13_;
	_tmp14_ = self->priv->_change_submenu;
	_tmp15_ = task_lbl;
	base_menu_change_menu_item_label ((BaseMenu*) self, _tmp14_, KEY_COMMAND_NODE_CHANGE_TASK, _tmp15_);
	_tmp16_ = self->priv->_change_submenu;
	_tmp17_ = img_lbl;
	base_menu_change_menu_item_label ((BaseMenu*) self, _tmp16_, KEY_COMMAND_NODE_CHANGE_IMAGE, _tmp17_);
	_tmp18_ = self->priv->_change_submenu;
	_tmp19_ = link_lbl;
	base_menu_change_menu_item_label ((BaseMenu*) self, _tmp18_, KEY_COMMAND_NODE_TOGGLE_LINKS, _tmp19_);
	_tmp20_ = self->priv->_change_submenu;
	_tmp21_ = callout_lbl;
	base_menu_change_menu_item_label ((BaseMenu*) self, _tmp20_, KEY_COMMAND_NODE_TOGGLE_CALLOUT, _tmp21_);
	_tmp22_ = self->priv->_change_submenu;
	_tmp23_ = fold_lbl;
	base_menu_change_menu_item_label ((BaseMenu*) self, _tmp22_, KEY_COMMAND_NODE_TOGGLE_FOLDS_SHALLOW, _tmp23_);
	if (minder_clipboard_node_pasteable ()) {
		GMenu* _tmp24_;
		GMenu* _tmp25_;
		_tmp24_ = self->priv->_edit_menu;
		base_menu_change_menu_item_label ((BaseMenu*) self, _tmp24_, KEY_COMMAND_EDIT_PASTE, _ ("Paste Node As Child"));
		_tmp25_ = self->priv->_edit_menu;
		base_menu_change_menu_item_label ((BaseMenu*) self, _tmp25_, KEY_COMMAND_NODE_PASTE_REPLACE, _ ("Paste and Replace Node"));
	} else {
		if (minder_clipboard_image_pasteable ()) {
			GMenu* _tmp26_;
			GMenu* _tmp27_;
			_tmp26_ = self->priv->_edit_menu;
			base_menu_change_menu_item_label ((BaseMenu*) self, _tmp26_, KEY_COMMAND_EDIT_PASTE, _ ("Paste Image As Child Node"));
			_tmp27_ = self->priv->_edit_menu;
			base_menu_change_menu_item_label ((BaseMenu*) self, _tmp27_, KEY_COMMAND_NODE_PASTE_REPLACE, _ ("Paste and Replace Node Image"));
		} else {
			if (minder_clipboard_text_pasteable ()) {
				GMenu* _tmp28_;
				GMenu* _tmp29_;
				_tmp28_ = self->priv->_edit_menu;
				base_menu_change_menu_item_label ((BaseMenu*) self, _tmp28_, KEY_COMMAND_EDIT_PASTE, _ ("Paste Text As Child Node"));
				_tmp29_ = self->priv->_edit_menu;
				base_menu_change_menu_item_label ((BaseMenu*) self, _tmp29_, KEY_COMMAND_NODE_PASTE_REPLACE, _ ("Paste and Replace Node Text"));
			} else {
				GMenu* _tmp30_;
				GMenu* _tmp31_;
				_tmp30_ = self->priv->_edit_menu;
				base_menu_change_menu_item_label ((BaseMenu*) self, _tmp30_, KEY_COMMAND_EDIT_PASTE, _ ("Paste"));
				_tmp31_ = self->priv->_edit_menu;
				base_menu_change_menu_item_label ((BaseMenu*) self, _tmp31_, KEY_COMMAND_NODE_PASTE_REPLACE, _ ("Paste and Replace Node"));
				base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_EDIT_PASTE, FALSE);
				base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_PASTE_REPLACE, FALSE);
			}
		}
	}
	node_pasteable = minder_clipboard_node_pasteable ();
	_tmp32_ = base_menu_get_map ((BaseMenu*) self);
	_tmp33_ = _tmp32_;
	_tmp34_ = mind_map_get_editable (_tmp33_);
	_tmp35_ = _tmp34_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_EDIT_CUT, _tmp35_);
	if (node_pasteable) {
		MindMap* _tmp37_;
		MindMap* _tmp38_;
		gboolean _tmp39_;
		gboolean _tmp40_;
		_tmp37_ = base_menu_get_map ((BaseMenu*) self);
		_tmp38_ = _tmp37_;
		_tmp39_ = mind_map_get_editable (_tmp38_);
		_tmp40_ = _tmp39_;
		_tmp36_ = _tmp40_;
	} else {
		_tmp36_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_EDIT_PASTE, _tmp36_);
	if (node_pasteable) {
		MindMap* _tmp42_;
		MindMap* _tmp43_;
		gboolean _tmp44_;
		gboolean _tmp45_;
		_tmp42_ = base_menu_get_map ((BaseMenu*) self);
		_tmp43_ = _tmp42_;
		_tmp44_ = mind_map_get_editable (_tmp43_);
		_tmp45_ = _tmp44_;
		_tmp41_ = _tmp45_;
	} else {
		_tmp41_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_PASTE_REPLACE, _tmp41_);
	_tmp46_ = base_menu_get_map ((BaseMenu*) self);
	_tmp47_ = _tmp46_;
	_tmp48_ = mind_map_get_editable (_tmp47_);
	_tmp49_ = _tmp48_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_REMOVE, _tmp49_);
	_tmp50_ = base_menu_get_map ((BaseMenu*) self);
	_tmp51_ = _tmp50_;
	_tmp52_ = mind_map_get_editable (_tmp51_);
	_tmp53_ = _tmp52_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_REMOVE_ONLY, _tmp53_);
	_tmp54_ = base_menu_get_map ((BaseMenu*) self);
	_tmp55_ = _tmp54_;
	_tmp56_ = mind_map_get_editable (_tmp55_);
	_tmp57_ = _tmp56_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_EDIT_SELECTED, _tmp57_);
	_tmp58_ = base_menu_get_map ((BaseMenu*) self);
	_tmp59_ = _tmp58_;
	_tmp60_ = mind_map_get_editable (_tmp59_);
	_tmp61_ = _tmp60_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_EDIT_NOTE, _tmp61_);
	_tmp62_ = base_menu_get_map ((BaseMenu*) self);
	_tmp63_ = _tmp62_;
	_tmp64_ = mind_map_get_editable (_tmp63_);
	_tmp65_ = _tmp64_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_CHANGE_TASK, _tmp65_);
	_tmp66_ = base_menu_get_map ((BaseMenu*) self);
	_tmp67_ = _tmp66_;
	_tmp68_ = mind_map_get_editable (_tmp67_);
	_tmp69_ = _tmp68_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_CHANGE_IMAGE, _tmp69_);
	_tmp71_ = base_menu_get_map ((BaseMenu*) self);
	_tmp72_ = _tmp71_;
	_tmp73_ = mind_map_get_model (_tmp72_);
	_tmp74_ = _tmp73_;
	_tmp75_ = map_model_get_connections (_tmp74_);
	_tmp76_ = _tmp75_;
	_tmp77_ = connections_get_hide (_tmp76_);
	_tmp78_ = _tmp77_;
	if (!_tmp78_) {
		MindMap* _tmp79_;
		MindMap* _tmp80_;
		gboolean _tmp81_;
		gboolean _tmp82_;
		_tmp79_ = base_menu_get_map ((BaseMenu*) self);
		_tmp80_ = _tmp79_;
		_tmp81_ = mind_map_get_editable (_tmp80_);
		_tmp82_ = _tmp81_;
		_tmp70_ = _tmp82_;
	} else {
		_tmp70_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ADD_CONNECTION, _tmp70_);
	if (node_menu_node_parentable (self)) {
		MindMap* _tmp84_;
		MindMap* _tmp85_;
		gboolean _tmp86_;
		gboolean _tmp87_;
		_tmp84_ = base_menu_get_map ((BaseMenu*) self);
		_tmp85_ = _tmp84_;
		_tmp86_ = mind_map_get_editable (_tmp85_);
		_tmp87_ = _tmp86_;
		_tmp83_ = _tmp87_;
	} else {
		_tmp83_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ADD_PARENT, _tmp83_);
	_tmp88_ = base_menu_get_map ((BaseMenu*) self);
	_tmp89_ = _tmp88_;
	_tmp90_ = mind_map_get_editable (_tmp89_);
	_tmp91_ = _tmp90_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ADD_GROUP, _tmp91_);
	_tmp92_ = base_menu_get_map ((BaseMenu*) self);
	_tmp93_ = _tmp92_;
	_tmp94_ = mind_map_get_editable (_tmp93_);
	_tmp95_ = _tmp94_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ADD_ROOT, _tmp95_);
	_tmp96_ = base_menu_get_map ((BaseMenu*) self);
	_tmp97_ = _tmp96_;
	_tmp98_ = mind_map_get_editable (_tmp97_);
	_tmp99_ = _tmp98_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ADD_CHILD, _tmp99_);
	_tmp100_ = base_menu_get_map ((BaseMenu*) self);
	_tmp101_ = _tmp100_;
	_tmp102_ = mind_map_get_editable (_tmp101_);
	_tmp103_ = _tmp102_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_QUICK_ENTRY_INSERT, _tmp103_);
	_tmp104_ = base_menu_get_map ((BaseMenu*) self);
	_tmp105_ = _tmp104_;
	_tmp106_ = mind_map_get_editable (_tmp105_);
	_tmp107_ = _tmp106_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_QUICK_ENTRY_REPLACE, _tmp107_);
	_tmp109_ = current;
	if (!node_is_root (_tmp109_)) {
		MindMap* _tmp110_;
		MindMap* _tmp111_;
		gboolean _tmp112_;
		gboolean _tmp113_;
		_tmp110_ = base_menu_get_map ((BaseMenu*) self);
		_tmp111_ = _tmp110_;
		_tmp112_ = mind_map_get_editable (_tmp111_);
		_tmp113_ = _tmp112_;
		_tmp108_ = _tmp113_;
	} else {
		_tmp108_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_CHANGE_LINK_COLOR, _tmp108_);
	_tmp115_ = current;
	if (!node_is_root (_tmp115_)) {
		MindMap* _tmp116_;
		MindMap* _tmp117_;
		gboolean _tmp118_;
		gboolean _tmp119_;
		_tmp116_ = base_menu_get_map ((BaseMenu*) self);
		_tmp117_ = _tmp116_;
		_tmp118_ = mind_map_get_editable (_tmp117_);
		_tmp119_ = _tmp118_;
		_tmp114_ = _tmp119_;
	} else {
		_tmp114_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_RANDOMIZE_LINK_COLOR, _tmp114_);
	_tmp123_ = current;
	if (!node_is_root (_tmp123_)) {
		Node* _tmp124_;
		_tmp124_ = current;
		_tmp122_ = !node_main_branch (_tmp124_);
	} else {
		_tmp122_ = FALSE;
	}
	if (_tmp122_) {
		Node* _tmp125_;
		gboolean _tmp126_;
		gboolean _tmp127_;
		_tmp125_ = current;
		_tmp126_ = node_get_link_color_root (_tmp125_);
		_tmp127_ = _tmp126_;
		_tmp121_ = _tmp127_;
	} else {
		_tmp121_ = FALSE;
	}
	if (_tmp121_) {
		MindMap* _tmp128_;
		MindMap* _tmp129_;
		gboolean _tmp130_;
		gboolean _tmp131_;
		_tmp128_ = base_menu_get_map ((BaseMenu*) self);
		_tmp129_ = _tmp128_;
		_tmp130_ = mind_map_get_editable (_tmp129_);
		_tmp131_ = _tmp130_;
		_tmp120_ = _tmp131_;
	} else {
		_tmp120_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_REPARENT_LINK_COLOR, _tmp120_);
	if (node_menu_node_foldable (self)) {
		MindMap* _tmp133_;
		MindMap* _tmp134_;
		gboolean _tmp135_;
		gboolean _tmp136_;
		_tmp133_ = base_menu_get_map ((BaseMenu*) self);
		_tmp134_ = _tmp133_;
		_tmp135_ = mind_map_get_editable (_tmp134_);
		_tmp136_ = _tmp135_;
		_tmp132_ = _tmp136_;
	} else {
		_tmp132_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_TOGGLE_FOLDS_SHALLOW, _tmp132_);
	_tmp138_ = base_menu_get_map ((BaseMenu*) self);
	_tmp139_ = _tmp138_;
	_tmp140_ = mind_map_get_model (_tmp139_);
	_tmp141_ = _tmp140_;
	if (map_model_sequences_togglable (_tmp141_)) {
		MindMap* _tmp142_;
		MindMap* _tmp143_;
		gboolean _tmp144_;
		gboolean _tmp145_;
		_tmp142_ = base_menu_get_map ((BaseMenu*) self);
		_tmp143_ = _tmp142_;
		_tmp144_ = mind_map_get_editable (_tmp143_);
		_tmp145_ = _tmp144_;
		_tmp137_ = _tmp145_;
	} else {
		_tmp137_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_TOGGLE_SEQUENCE, _tmp137_);
	if (node_menu_node_linkable (self)) {
		MindMap* _tmp147_;
		MindMap* _tmp148_;
		gboolean _tmp149_;
		gboolean _tmp150_;
		_tmp147_ = base_menu_get_map ((BaseMenu*) self);
		_tmp148_ = _tmp147_;
		_tmp149_ = mind_map_get_editable (_tmp148_);
		_tmp150_ = _tmp149_;
		_tmp146_ = _tmp150_;
	} else {
		_tmp146_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_TOGGLE_LINKS, _tmp146_);
	_tmp151_ = base_menu_get_map ((BaseMenu*) self);
	_tmp152_ = _tmp151_;
	_tmp153_ = mind_map_get_editable (_tmp152_);
	_tmp154_ = _tmp153_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_TOGGLE_CALLOUT, _tmp154_);
	_tmp156_ = base_menu_get_map ((BaseMenu*) self);
	_tmp157_ = _tmp156_;
	_tmp158_ = mind_map_get_model (_tmp157_);
	_tmp159_ = _tmp158_;
	if (map_model_detachable (_tmp159_)) {
		MindMap* _tmp160_;
		MindMap* _tmp161_;
		gboolean _tmp162_;
		gboolean _tmp163_;
		_tmp160_ = base_menu_get_map ((BaseMenu*) self);
		_tmp161_ = _tmp160_;
		_tmp162_ = mind_map_get_editable (_tmp161_);
		_tmp163_ = _tmp162_;
		_tmp155_ = _tmp163_;
	} else {
		_tmp155_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_DETACH, _tmp155_);
	if (node_menu_node_sortable (self)) {
		MindMap* _tmp165_;
		MindMap* _tmp166_;
		gboolean _tmp167_;
		gboolean _tmp168_;
		_tmp165_ = base_menu_get_map ((BaseMenu*) self);
		_tmp166_ = _tmp165_;
		_tmp167_ = mind_map_get_editable (_tmp166_);
		_tmp168_ = _tmp167_;
		_tmp164_ = _tmp168_;
	} else {
		_tmp164_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SORT_ALPHABETICALLY, _tmp164_);
	if (node_menu_node_sortable (self)) {
		MindMap* _tmp170_;
		MindMap* _tmp171_;
		gboolean _tmp172_;
		gboolean _tmp173_;
		_tmp170_ = base_menu_get_map ((BaseMenu*) self);
		_tmp171_ = _tmp170_;
		_tmp172_ = mind_map_get_editable (_tmp171_);
		_tmp173_ = _tmp172_;
		_tmp169_ = _tmp173_;
	} else {
		_tmp169_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SORT_RANDOMLY, _tmp169_);
	_tmp174_ = base_menu_get_map ((BaseMenu*) self);
	_tmp175_ = _tmp174_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_ROOT, mind_map_root_selectable (_tmp175_));
	_tmp176_ = base_menu_get_map ((BaseMenu*) self);
	_tmp177_ = _tmp176_;
	_tmp178_ = mind_map_get_model (_tmp177_);
	_tmp179_ = _tmp178_;
	_tmp180_ = current;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_SIBLING_NEXT, map_model_sibling_exists (_tmp179_, _tmp180_));
	_tmp181_ = base_menu_get_map ((BaseMenu*) self);
	_tmp182_ = _tmp181_;
	_tmp183_ = mind_map_get_model (_tmp182_);
	_tmp184_ = _tmp183_;
	_tmp185_ = current;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_SIBLING_PREV, map_model_sibling_exists (_tmp184_, _tmp185_));
	_tmp186_ = base_menu_get_map ((BaseMenu*) self);
	_tmp187_ = _tmp186_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_CHILD, mind_map_children_selectable (_tmp187_));
	_tmp188_ = base_menu_get_map ((BaseMenu*) self);
	_tmp189_ = _tmp188_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_CHILDREN, mind_map_children_selectable (_tmp189_));
	_tmp190_ = base_menu_get_map ((BaseMenu*) self);
	_tmp191_ = _tmp190_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_PARENT, mind_map_parent_selectable (_tmp191_));
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_LINKED, node_menu_node_has_link (self));
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_CALLOUT, node_menu_node_has_callout (self));
	_tmp192_ = base_menu_get_map ((BaseMenu*) self);
	_tmp193_ = _tmp192_;
	_tmp194_ = mind_map_get_editable (_tmp193_);
	_tmp195_ = _tmp194_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_CONNECTION, _tmp195_);
	_tmp196_ = base_menu_get_map ((BaseMenu*) self);
	_tmp197_ = _tmp196_;
	_tmp198_ = mind_map_get_editable (_tmp197_);
	_tmp199_ = _tmp198_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_CALLOUT, _tmp199_);
	_tmp201_ = current;
	_tmp202_ = node_get_sticker (_tmp201_);
	_tmp203_ = _tmp202_;
	if (_tmp203_ != NULL) {
		MindMap* _tmp204_;
		MindMap* _tmp205_;
		gboolean _tmp206_;
		gboolean _tmp207_;
		_tmp204_ = base_menu_get_map ((BaseMenu*) self);
		_tmp205_ = _tmp204_;
		_tmp206_ = mind_map_get_editable (_tmp205_);
		_tmp207_ = _tmp206_;
		_tmp200_ = _tmp207_;
	} else {
		_tmp200_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_REMOVE_STICKER_SELECTED, _tmp200_);
	_tmp209_ = current;
	if (!node_is_summary (_tmp209_)) {
		MindMap* _tmp210_;
		MindMap* _tmp211_;
		gboolean _tmp212_;
		gboolean _tmp213_;
		_tmp210_ = base_menu_get_map ((BaseMenu*) self);
		_tmp211_ = _tmp210_;
		_tmp212_ = mind_map_get_editable (_tmp211_);
		_tmp213_ = _tmp212_;
		_tmp208_ = _tmp213_;
	} else {
		_tmp208_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ADD_SIBLING_AFTER, _tmp208_);
	_g_free0 (img_lbl);
	_g_free0 (callout_lbl);
	_g_free0 (fold_lbl);
	_g_free0 (link_lbl);
	_g_free0 (task_lbl);
	_g_object_unref0 (current);
}

static void
node_menu_class_init (NodeMenuClass * klass,
                      gpointer klass_data)
{
	node_menu_parent_class = g_type_class_peek_parent (klass);
	((BaseMenuClass *) klass)->finalize = node_menu_finalize;
	g_type_class_adjust_private_offset (klass, &NodeMenu_private_offset);
	((BaseMenuClass *) klass)->on_popup = (void (*) (BaseMenu*)) node_menu_real_on_popup;
}

static void
node_menu_instance_init (NodeMenu * self,
                         gpointer klass)
{
	self->priv = node_menu_get_instance_private (self);
}

static void
node_menu_finalize (BaseMenu * obj)
{
	NodeMenu * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_NODE_MENU, NodeMenu);
	_g_object_unref0 (self->priv->_edit_menu);
	_g_object_unref0 (self->priv->_change_submenu);
	BASE_MENU_CLASS (node_menu_parent_class)->finalize (obj);
}

static GType
node_menu_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (NodeMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) node_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (NodeMenu), 0, (GInstanceInitFunc) node_menu_instance_init, NULL };
	GType node_menu_type_id;
	node_menu_type_id = g_type_register_static (TYPE_BASE_MENU, "NodeMenu", &g_define_type_info, 0);
	NodeMenu_private_offset = g_type_add_instance_private (node_menu_type_id, sizeof (NodeMenuPrivate));
	return node_menu_type_id;
}

GType
node_menu_get_type (void)
{
	static volatile gsize node_menu_type_id__once = 0;
	if (g_once_init_enter (&node_menu_type_id__once)) {
		GType node_menu_type_id;
		node_menu_type_id = node_menu_get_type_once ();
		g_once_init_leave (&node_menu_type_id__once, node_menu_type_id);
	}
	return node_menu_type_id__once;
}

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

