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

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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.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_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;
typedef struct _NodesMenuPrivate NodesMenuPrivate;

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

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

typedef struct _Node Node;
typedef struct _NodeClass NodeClass;

#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 _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_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;

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 _NodesMenu {
	BaseMenu parent_instance;
	NodesMenuPrivate * priv;
};

struct _NodesMenuClass {
	BaseMenuClass parent_class;
};

static gpointer nodes_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 nodes_menu_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodesMenu, 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 NodesMenu* nodes_menu_new (GtkApplication* app,
                           DrawArea* da);
VALA_EXTERN NodesMenu* nodes_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 void nodes_menu_nodes_foldable_status (NodesMenu* self,
                                       gboolean* foldable,
                                       gboolean* unfoldable);
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 GArray* mind_map_get_selected_nodes (MindMap* self);
VALA_EXTERN gboolean node_is_leaf (Node* self);
VALA_EXTERN gboolean node_get_folded (Node* self);
static gboolean nodes_menu_link_colors_parentable (NodesMenu* self);
VALA_EXTERN gboolean node_get_link_color_root (Node* self);
static void nodes_menu_real_on_popup (BaseMenu* base);
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_nodes_summarizable (MapModel* self);
VALA_EXTERN gboolean map_model_nodes_alignable (MapModel* self);
VALA_EXTERN void base_menu_set_enabled (BaseMenu* self,
                            KeyCommand command,
                            gboolean enable);
VALA_EXTERN gboolean mind_map_get_editable (MindMap* self);
VALA_EXTERN gboolean map_model_sequences_togglable (MapModel* self);
VALA_EXTERN gboolean mind_map_parent_selectable (MindMap* self);
VALA_EXTERN gboolean mind_map_children_selectable (MindMap* self);
static GType nodes_menu_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

NodesMenu*
nodes_menu_construct (GType object_type,
                      GtkApplication* app,
                      DrawArea* da)
{
	NodesMenu* self = NULL;
	GMenu* edit_menu = NULL;
	GMenu* _tmp0_;
	GMenu* color_menu = NULL;
	GMenu* _tmp1_;
	GMenu* change_menu = NULL;
	GMenu* _tmp2_;
	GMenu* link_menu = NULL;
	GMenu* _tmp3_;
	GMenu* sel_submenu = NULL;
	GMenu* _tmp4_;
	GMenu* sel_menu = NULL;
	GMenu* _tmp5_;
	GMenu* align_vert_menu = NULL;
	GMenu* _tmp6_;
	GMenu* align_horz_menu = NULL;
	GMenu* _tmp7_;
	GMenu* align_submenu = NULL;
	GMenu* _tmp8_;
	GMenu* align_menu = NULL;
	GMenu* _tmp9_;
	GMenu* _tmp10_;
	GMenu* _tmp11_;
	GMenu* _tmp12_;
	GMenu* _tmp13_;
	GMenu* _tmp14_;
	GMenu* _tmp15_;
	GMenu* _tmp16_;
	GMenu* _tmp17_;
	GMenu* _tmp18_;
	GMenu* _tmp19_;
	g_return_val_if_fail (app != NULL, NULL);
	g_return_val_if_fail (da != NULL, NULL);
	self = (NodesMenu*) base_menu_construct (object_type, app, da, "nodes");
	_tmp0_ = g_menu_new ();
	edit_menu = _tmp0_;
	base_menu_append_menu_item ((BaseMenu*) self, edit_menu, KEY_COMMAND_EDIT_COPY, _ ("Copy"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, edit_menu, KEY_COMMAND_EDIT_CUT, _ ("Cut"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, edit_menu, KEY_COMMAND_NODE_REMOVE, _ ("Delete"), TRUE);
	_tmp1_ = g_menu_new ();
	color_menu = _tmp1_;
	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 Colors"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, color_menu, KEY_COMMAND_NODE_REPARENT_LINK_COLOR, _ ("Use Parent Color"), TRUE);
	_tmp2_ = g_menu_new ();
	change_menu = _tmp2_;
	base_menu_append_menu_item ((BaseMenu*) self, change_menu, KEY_COMMAND_SHOW_TAG_SIDEBAR, _ ("Edit Tags"), FALSE);
	g_menu_append_submenu (change_menu, _ ("Link Colors"), (GMenuModel*) color_menu);
	base_menu_append_menu_item ((BaseMenu*) self, change_menu, KEY_COMMAND_NODE_CHANGE_TASK, _ ("Toggle Tasks"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, change_menu, KEY_COMMAND_NODE_TOGGLE_FOLDS_SHALLOW, _ ("Toggle Folds"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, change_menu, KEY_COMMAND_NODE_TOGGLE_SEQUENCE, _ ("Toggle Sequences"), TRUE);
	_tmp3_ = g_menu_new ();
	link_menu = _tmp3_;
	base_menu_append_menu_item ((BaseMenu*) self, link_menu, KEY_COMMAND_NODE_ADD_CONNECTION, _ ("Connect"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, link_menu, KEY_COMMAND_NODE_TOGGLE_LINKS, _ ("Link Nodes"), TRUE);
	_tmp4_ = g_menu_new ();
	sel_submenu = _tmp4_;
	base_menu_append_menu_item ((BaseMenu*) self, sel_submenu, KEY_COMMAND_NODE_SELECT_PARENT, _ ("Parent Nodes"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, sel_submenu, KEY_COMMAND_NODE_SELECT_CHILDREN, _ ("Child Nodes"), TRUE);
	_tmp5_ = g_menu_new ();
	sel_menu = _tmp5_;
	g_menu_append_submenu (sel_menu, _ ("Select"), (GMenuModel*) sel_submenu);
	_tmp6_ = g_menu_new ();
	align_vert_menu = _tmp6_;
	base_menu_append_menu_item ((BaseMenu*) self, align_vert_menu, KEY_COMMAND_NODE_ALIGN_TOP, _ ("Align Top"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, align_vert_menu, KEY_COMMAND_NODE_ALIGN_HCENTER, _ ("Align Center Horizontally"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, align_vert_menu, KEY_COMMAND_NODE_ALIGN_BOTTOM, _ ("Align Bottom"), TRUE);
	_tmp7_ = g_menu_new ();
	align_horz_menu = _tmp7_;
	base_menu_append_menu_item ((BaseMenu*) self, align_horz_menu, KEY_COMMAND_NODE_ALIGN_LEFT, _ ("Align Left"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, align_horz_menu, KEY_COMMAND_NODE_ALIGN_VCENTER, _ ("Align Center Vertically"), TRUE);
	base_menu_append_menu_item ((BaseMenu*) self, align_horz_menu, KEY_COMMAND_NODE_ALIGN_RIGHT, _ ("Align Right"), TRUE);
	_tmp8_ = g_menu_new ();
	align_submenu = _tmp8_;
	g_menu_append_section (align_submenu, NULL, (GMenuModel*) align_vert_menu);
	g_menu_append_section (align_submenu, NULL, (GMenuModel*) align_horz_menu);
	_tmp9_ = g_menu_new ();
	align_menu = _tmp9_;
	g_menu_append_submenu (align_menu, _ ("Align"), (GMenuModel*) align_submenu);
	_tmp10_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp11_ = _tmp10_;
	g_menu_append_section (_tmp11_, NULL, (GMenuModel*) edit_menu);
	_tmp12_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp13_ = _tmp12_;
	g_menu_append_section (_tmp13_, NULL, (GMenuModel*) change_menu);
	_tmp14_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp15_ = _tmp14_;
	g_menu_append_section (_tmp15_, NULL, (GMenuModel*) link_menu);
	_tmp16_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp17_ = _tmp16_;
	g_menu_append_section (_tmp17_, NULL, (GMenuModel*) sel_menu);
	_tmp18_ = base_menu_get_menu ((BaseMenu*) self);
	_tmp19_ = _tmp18_;
	g_menu_append_section (_tmp19_, NULL, (GMenuModel*) align_menu);
	_g_object_unref0 (align_menu);
	_g_object_unref0 (align_submenu);
	_g_object_unref0 (align_horz_menu);
	_g_object_unref0 (align_vert_menu);
	_g_object_unref0 (sel_menu);
	_g_object_unref0 (sel_submenu);
	_g_object_unref0 (link_menu);
	_g_object_unref0 (change_menu);
	_g_object_unref0 (color_menu);
	_g_object_unref0 (edit_menu);
	return self;
}

NodesMenu*
nodes_menu_new (GtkApplication* app,
                DrawArea* da)
{
	return nodes_menu_construct (TYPE_NODES_MENU, app, da);
}

static void
nodes_menu_nodes_foldable_status (NodesMenu* self,
                                  gboolean* foldable,
                                  gboolean* unfoldable)
{
	gboolean _vala_foldable = FALSE;
	gboolean _vala_unfoldable = FALSE;
	GArray* nodes = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	GArray* _tmp2_;
	g_return_if_fail (self != NULL);
	_vala_unfoldable = FALSE;
	_vala_foldable = _vala_unfoldable;
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_selected_nodes (_tmp1_);
	nodes = _tmp2_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GArray* _tmp5_;
				GArray* _tmp6_;
				Node* _tmp7_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp5_ = nodes;
				if (!(((guint) i) < _tmp5_->len)) {
					break;
				}
				_tmp6_ = nodes;
				_tmp7_ = g_array_index (_tmp6_, Node*, (guint) i);
				if (!node_is_leaf (_tmp7_)) {
					GArray* _tmp8_;
					Node* _tmp9_;
					gboolean _tmp10_;
					gboolean _tmp11_;
					GArray* _tmp12_;
					Node* _tmp13_;
					gboolean _tmp14_;
					gboolean _tmp15_;
					_tmp8_ = nodes;
					_tmp9_ = g_array_index (_tmp8_, Node*, (guint) i);
					_tmp10_ = node_get_folded (_tmp9_);
					_tmp11_ = _tmp10_;
					_vala_foldable = _vala_foldable | (!_tmp11_);
					_tmp12_ = nodes;
					_tmp13_ = g_array_index (_tmp12_, Node*, (guint) i);
					_tmp14_ = node_get_folded (_tmp13_);
					_tmp15_ = _tmp14_;
					_vala_unfoldable = _vala_unfoldable | _tmp15_;
				}
			}
		}
	}
	_g_array_unref0 (nodes);
	if (foldable) {
		*foldable = _vala_foldable;
	}
	if (unfoldable) {
		*unfoldable = _vala_unfoldable;
	}
}

static gboolean
nodes_menu_link_colors_parentable (NodesMenu* self)
{
	GArray* nodes = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	GArray* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_selected_nodes (_tmp1_);
	nodes = _tmp2_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GArray* _tmp5_;
				GArray* _tmp6_;
				Node* _tmp7_;
				gboolean _tmp8_;
				gboolean _tmp9_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp5_ = nodes;
				if (!(((guint) i) < _tmp5_->len)) {
					break;
				}
				_tmp6_ = nodes;
				_tmp7_ = g_array_index (_tmp6_, Node*, (guint) i);
				_tmp8_ = node_get_link_color_root (_tmp7_);
				_tmp9_ = _tmp8_;
				if (_tmp9_) {
					result = TRUE;
					_g_array_unref0 (nodes);
					return result;
				}
			}
		}
	}
	result = FALSE;
	_g_array_unref0 (nodes);
	return result;
}

static void
nodes_menu_real_on_popup (BaseMenu* base)
{
	NodesMenu * self;
	GArray* nodes = NULL;
	MindMap* _tmp0_;
	MindMap* _tmp1_;
	GArray* _tmp2_;
	guint node_num = 0U;
	GArray* _tmp3_;
	gboolean summarizable = FALSE;
	MindMap* _tmp4_;
	MindMap* _tmp5_;
	MapModel* _tmp6_;
	MapModel* _tmp7_;
	gboolean alignable = FALSE;
	MindMap* _tmp8_;
	MindMap* _tmp9_;
	MapModel* _tmp10_;
	MapModel* _tmp11_;
	gboolean foldable = FALSE;
	gboolean unfoldable = FALSE;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp13_ = FALSE;
	MindMap* _tmp14_;
	MindMap* _tmp15_;
	gboolean _tmp16_;
	gboolean _tmp17_;
	MindMap* _tmp18_;
	MindMap* _tmp19_;
	gboolean _tmp20_;
	gboolean _tmp21_;
	MindMap* _tmp22_;
	MindMap* _tmp23_;
	gboolean _tmp24_;
	gboolean _tmp25_;
	MindMap* _tmp26_;
	MindMap* _tmp27_;
	gboolean _tmp28_;
	gboolean _tmp29_;
	MindMap* _tmp30_;
	MindMap* _tmp31_;
	gboolean _tmp32_;
	gboolean _tmp33_;
	MindMap* _tmp34_;
	MindMap* _tmp35_;
	gboolean _tmp36_;
	gboolean _tmp37_;
	gboolean _tmp38_ = FALSE;
	gboolean _tmp39_ = FALSE;
	gboolean _tmp44_ = FALSE;
	MindMap* _tmp45_;
	MindMap* _tmp46_;
	MapModel* _tmp47_;
	MapModel* _tmp48_;
	MindMap* _tmp53_;
	MindMap* _tmp54_;
	gboolean _tmp55_;
	gboolean _tmp56_;
	gboolean _tmp57_ = FALSE;
	gboolean _tmp62_ = FALSE;
	gboolean _tmp67_ = FALSE;
	gboolean _tmp72_ = FALSE;
	gboolean _tmp77_ = FALSE;
	gboolean _tmp82_ = FALSE;
	gboolean _tmp87_ = FALSE;
	gboolean _tmp92_ = FALSE;
	MindMap* _tmp97_;
	MindMap* _tmp98_;
	MindMap* _tmp99_;
	MindMap* _tmp100_;
	self = (NodesMenu*) base;
	_tmp0_ = base_menu_get_map ((BaseMenu*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = mind_map_get_selected_nodes (_tmp1_);
	nodes = _tmp2_;
	_tmp3_ = nodes;
	node_num = _tmp3_->len;
	_tmp4_ = base_menu_get_map ((BaseMenu*) self);
	_tmp5_ = _tmp4_;
	_tmp6_ = mind_map_get_model (_tmp5_);
	_tmp7_ = _tmp6_;
	summarizable = map_model_nodes_summarizable (_tmp7_);
	_tmp8_ = base_menu_get_map ((BaseMenu*) self);
	_tmp9_ = _tmp8_;
	_tmp10_ = mind_map_get_model (_tmp9_);
	_tmp11_ = _tmp10_;
	alignable = map_model_nodes_alignable (_tmp11_);
	nodes_menu_nodes_foldable_status (self, &_tmp12_, &_tmp13_);
	foldable = _tmp12_;
	unfoldable = _tmp13_;
	_tmp14_ = base_menu_get_map ((BaseMenu*) self);
	_tmp15_ = _tmp14_;
	_tmp16_ = mind_map_get_editable (_tmp15_);
	_tmp17_ = _tmp16_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_EDIT_CUT, _tmp17_);
	_tmp18_ = base_menu_get_map ((BaseMenu*) self);
	_tmp19_ = _tmp18_;
	_tmp20_ = mind_map_get_editable (_tmp19_);
	_tmp21_ = _tmp20_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_REMOVE, _tmp21_);
	_tmp22_ = base_menu_get_map ((BaseMenu*) self);
	_tmp23_ = _tmp22_;
	_tmp24_ = mind_map_get_editable (_tmp23_);
	_tmp25_ = _tmp24_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_CHANGE_LINK_COLOR, _tmp25_);
	_tmp26_ = base_menu_get_map ((BaseMenu*) self);
	_tmp27_ = _tmp26_;
	_tmp28_ = mind_map_get_editable (_tmp27_);
	_tmp29_ = _tmp28_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_RANDOMIZE_LINK_COLOR, _tmp29_);
	_tmp30_ = base_menu_get_map ((BaseMenu*) self);
	_tmp31_ = _tmp30_;
	_tmp32_ = mind_map_get_editable (_tmp31_);
	_tmp33_ = _tmp32_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_REPARENT_LINK_COLOR, _tmp33_);
	_tmp34_ = base_menu_get_map ((BaseMenu*) self);
	_tmp35_ = _tmp34_;
	_tmp36_ = mind_map_get_editable (_tmp35_);
	_tmp37_ = _tmp36_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_CHANGE_TASK, _tmp37_);
	if (foldable) {
		_tmp39_ = TRUE;
	} else {
		_tmp39_ = unfoldable;
	}
	if (_tmp39_) {
		MindMap* _tmp40_;
		MindMap* _tmp41_;
		gboolean _tmp42_;
		gboolean _tmp43_;
		_tmp40_ = base_menu_get_map ((BaseMenu*) self);
		_tmp41_ = _tmp40_;
		_tmp42_ = mind_map_get_editable (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp38_ = _tmp43_;
	} else {
		_tmp38_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_TOGGLE_FOLDS_SHALLOW, _tmp38_);
	_tmp45_ = base_menu_get_map ((BaseMenu*) self);
	_tmp46_ = _tmp45_;
	_tmp47_ = mind_map_get_model (_tmp46_);
	_tmp48_ = _tmp47_;
	if (map_model_sequences_togglable (_tmp48_)) {
		MindMap* _tmp49_;
		MindMap* _tmp50_;
		gboolean _tmp51_;
		gboolean _tmp52_;
		_tmp49_ = base_menu_get_map ((BaseMenu*) self);
		_tmp50_ = _tmp49_;
		_tmp51_ = mind_map_get_editable (_tmp50_);
		_tmp52_ = _tmp51_;
		_tmp44_ = _tmp52_;
	} else {
		_tmp44_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_TOGGLE_SEQUENCE, _tmp44_);
	_tmp53_ = base_menu_get_map ((BaseMenu*) self);
	_tmp54_ = _tmp53_;
	_tmp55_ = mind_map_get_editable (_tmp54_);
	_tmp56_ = _tmp55_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_TOGGLE_LINKS, _tmp56_);
	if (node_num == ((guint) 2)) {
		MindMap* _tmp58_;
		MindMap* _tmp59_;
		gboolean _tmp60_;
		gboolean _tmp61_;
		_tmp58_ = base_menu_get_map ((BaseMenu*) self);
		_tmp59_ = _tmp58_;
		_tmp60_ = mind_map_get_editable (_tmp59_);
		_tmp61_ = _tmp60_;
		_tmp57_ = _tmp61_;
	} else {
		_tmp57_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ADD_CONNECTION, _tmp57_);
	if (nodes_menu_link_colors_parentable (self)) {
		MindMap* _tmp63_;
		MindMap* _tmp64_;
		gboolean _tmp65_;
		gboolean _tmp66_;
		_tmp63_ = base_menu_get_map ((BaseMenu*) self);
		_tmp64_ = _tmp63_;
		_tmp65_ = mind_map_get_editable (_tmp64_);
		_tmp66_ = _tmp65_;
		_tmp62_ = _tmp66_;
	} else {
		_tmp62_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_REPARENT_LINK_COLOR, _tmp62_);
	if (alignable) {
		MindMap* _tmp68_;
		MindMap* _tmp69_;
		gboolean _tmp70_;
		gboolean _tmp71_;
		_tmp68_ = base_menu_get_map ((BaseMenu*) self);
		_tmp69_ = _tmp68_;
		_tmp70_ = mind_map_get_editable (_tmp69_);
		_tmp71_ = _tmp70_;
		_tmp67_ = _tmp71_;
	} else {
		_tmp67_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ALIGN_TOP, _tmp67_);
	if (alignable) {
		MindMap* _tmp73_;
		MindMap* _tmp74_;
		gboolean _tmp75_;
		gboolean _tmp76_;
		_tmp73_ = base_menu_get_map ((BaseMenu*) self);
		_tmp74_ = _tmp73_;
		_tmp75_ = mind_map_get_editable (_tmp74_);
		_tmp76_ = _tmp75_;
		_tmp72_ = _tmp76_;
	} else {
		_tmp72_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ALIGN_HCENTER, _tmp72_);
	if (alignable) {
		MindMap* _tmp78_;
		MindMap* _tmp79_;
		gboolean _tmp80_;
		gboolean _tmp81_;
		_tmp78_ = base_menu_get_map ((BaseMenu*) self);
		_tmp79_ = _tmp78_;
		_tmp80_ = mind_map_get_editable (_tmp79_);
		_tmp81_ = _tmp80_;
		_tmp77_ = _tmp81_;
	} else {
		_tmp77_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ALIGN_BOTTOM, _tmp77_);
	if (alignable) {
		MindMap* _tmp83_;
		MindMap* _tmp84_;
		gboolean _tmp85_;
		gboolean _tmp86_;
		_tmp83_ = base_menu_get_map ((BaseMenu*) self);
		_tmp84_ = _tmp83_;
		_tmp85_ = mind_map_get_editable (_tmp84_);
		_tmp86_ = _tmp85_;
		_tmp82_ = _tmp86_;
	} else {
		_tmp82_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ALIGN_LEFT, _tmp82_);
	if (alignable) {
		MindMap* _tmp88_;
		MindMap* _tmp89_;
		gboolean _tmp90_;
		gboolean _tmp91_;
		_tmp88_ = base_menu_get_map ((BaseMenu*) self);
		_tmp89_ = _tmp88_;
		_tmp90_ = mind_map_get_editable (_tmp89_);
		_tmp91_ = _tmp90_;
		_tmp87_ = _tmp91_;
	} else {
		_tmp87_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ALIGN_VCENTER, _tmp87_);
	if (alignable) {
		MindMap* _tmp93_;
		MindMap* _tmp94_;
		gboolean _tmp95_;
		gboolean _tmp96_;
		_tmp93_ = base_menu_get_map ((BaseMenu*) self);
		_tmp94_ = _tmp93_;
		_tmp95_ = mind_map_get_editable (_tmp94_);
		_tmp96_ = _tmp95_;
		_tmp92_ = _tmp96_;
	} else {
		_tmp92_ = FALSE;
	}
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_ALIGN_RIGHT, _tmp92_);
	_tmp97_ = base_menu_get_map ((BaseMenu*) self);
	_tmp98_ = _tmp97_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_PARENT, mind_map_parent_selectable (_tmp98_));
	_tmp99_ = base_menu_get_map ((BaseMenu*) self);
	_tmp100_ = _tmp99_;
	base_menu_set_enabled ((BaseMenu*) self, KEY_COMMAND_NODE_SELECT_CHILDREN, mind_map_children_selectable (_tmp100_));
	_g_array_unref0 (nodes);
}

static void
nodes_menu_class_init (NodesMenuClass * klass,
                       gpointer klass_data)
{
	nodes_menu_parent_class = g_type_class_peek_parent (klass);
	((BaseMenuClass *) klass)->on_popup = (void (*) (BaseMenu*)) nodes_menu_real_on_popup;
}

static void
nodes_menu_instance_init (NodesMenu * self,
                          gpointer klass)
{
}

static GType
nodes_menu_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (NodesMenuClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) nodes_menu_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (NodesMenu), 0, (GInstanceInitFunc) nodes_menu_instance_init, NULL };
	GType nodes_menu_type_id;
	nodes_menu_type_id = g_type_register_static (TYPE_BASE_MENU, "NodesMenu", &g_define_type_info, 0);
	return nodes_menu_type_id;
}

GType
nodes_menu_get_type (void)
{
	static volatile gsize nodes_menu_type_id__once = 0;
	if (g_once_init_enter (&nodes_menu_type_id__once)) {
		GType nodes_menu_type_id;
		nodes_menu_type_id = nodes_menu_get_type_once ();
		g_once_init_leave (&nodes_menu_type_id__once, nodes_menu_type_id);
	}
	return nodes_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;
}

