/* ExportXMind2021.c generated by valac 0.56.19, the Vala compiler
 * generated from ExportXMind2021.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 <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <libxml/tree.h>
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
#include <json-glib/json-glib.h>
#include <gio/gio.h>
#include <cairo-gobject.h>
#include <float.h>
#include <math.h>
#include <pango/pango.h>
#include <gdk/gdk.h>
#include <archive.h>
#include <archive_entry.h>
#include <stdio.h>
#include <gee.h>
#include <gobject/gvaluecollector.h>

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

#define TYPE_EXPORT (export_get_type ())
#define EXPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXPORT, Export))
#define EXPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXPORT, ExportClass))
#define IS_EXPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXPORT))
#define IS_EXPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXPORT))
#define EXPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXPORT, ExportClass))

typedef struct _Export Export;
typedef struct _ExportClass ExportClass;
typedef struct _ExportPrivate ExportPrivate;

#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_EXPORT_XMIND2021 (export_xmind2021_get_type ())
#define EXPORT_XMIND2021(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXPORT_XMIND2021, ExportXMind2021))
#define EXPORT_XMIND2021_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXPORT_XMIND2021, ExportXMind2021Class))
#define IS_EXPORT_XMIND2021(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXPORT_XMIND2021))
#define IS_EXPORT_XMIND2021_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXPORT_XMIND2021))
#define EXPORT_XMIND2021_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXPORT_XMIND2021, ExportXMind2021Class))

typedef struct _ExportXMind2021 ExportXMind2021;
typedef struct _ExportXMind2021Class ExportXMind2021Class;
typedef struct _ExportXMind2021Private ExportXMind2021Private;
typedef enum  {
	EXPORT_XMIND2021_ID_OBJECT_TYPE_NODE = 0,
	EXPORT_XMIND2021_ID_OBJECT_TYPE_CONNECTION,
	EXPORT_XMIND2021_ID_OBJECT_TYPE_BOUNDARY
} ExportXMind2021IdObjectType;

#define EXPORT_XMIND2021_TYPE_ID_OBJECT_TYPE (export_xmind2021_id_object_type_get_type ())

#define EXPORT_XMIND2021_TYPE_FILE_ITEMS (export_xmind2021_file_items_get_type ())
#define EXPORT_XMIND2021_FILE_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXPORT_XMIND2021_TYPE_FILE_ITEMS, ExportXMind2021FileItems))
#define EXPORT_XMIND2021_FILE_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXPORT_XMIND2021_TYPE_FILE_ITEMS, ExportXMind2021FileItemsClass))
#define EXPORT_XMIND2021_IS_FILE_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXPORT_XMIND2021_TYPE_FILE_ITEMS))
#define EXPORT_XMIND2021_IS_FILE_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXPORT_XMIND2021_TYPE_FILE_ITEMS))
#define EXPORT_XMIND2021_FILE_ITEMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXPORT_XMIND2021_TYPE_FILE_ITEMS, ExportXMind2021FileItemsClass))

typedef struct _ExportXMind2021FileItems ExportXMind2021FileItems;
typedef struct _ExportXMind2021FileItemsClass ExportXMind2021FileItemsClass;
#define _export_xmind2021_file_items_unref0(var) ((var == NULL) ? NULL : (var = (export_xmind2021_file_items_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ExportXMind2021FileItemsPrivate ExportXMind2021FileItemsPrivate;

#define EXPORT_XMIND2021_TYPE_FILE_ITEM (export_xmind2021_file_item_get_type ())
#define EXPORT_XMIND2021_FILE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXPORT_XMIND2021_TYPE_FILE_ITEM, ExportXMind2021FileItem))
#define EXPORT_XMIND2021_FILE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXPORT_XMIND2021_TYPE_FILE_ITEM, ExportXMind2021FileItemClass))
#define EXPORT_XMIND2021_IS_FILE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXPORT_XMIND2021_TYPE_FILE_ITEM))
#define EXPORT_XMIND2021_IS_FILE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXPORT_XMIND2021_TYPE_FILE_ITEM))
#define EXPORT_XMIND2021_FILE_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXPORT_XMIND2021_TYPE_FILE_ITEM, ExportXMind2021FileItemClass))

typedef struct _ExportXMind2021FileItem ExportXMind2021FileItem;
typedef struct _ExportXMind2021FileItemClass ExportXMind2021FileItemClass;
typedef struct _ExportXMind2021FileItemPrivate ExportXMind2021FileItemPrivate;
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (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 _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))

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

typedef struct _CanvasText CanvasText;
typedef struct _CanvasTextClass CanvasTextClass;

#define TYPE_FORMATTED_TEXT (formatted_text_get_type ())
#define FORMATTED_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FORMATTED_TEXT, FormattedText))
#define FORMATTED_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FORMATTED_TEXT, FormattedTextClass))
#define IS_FORMATTED_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FORMATTED_TEXT))
#define IS_FORMATTED_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FORMATTED_TEXT))
#define FORMATTED_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FORMATTED_TEXT, FormattedTextClass))

typedef struct _FormattedText FormattedText;
typedef struct _FormattedTextClass FormattedTextClass;

#define TYPE_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_IMAGE_MANAGER (image_manager_get_type ())
#define IMAGE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IMAGE_MANAGER, ImageManager))
#define IMAGE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMAGE_MANAGER, ImageManagerClass))
#define IS_IMAGE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IMAGE_MANAGER))
#define IS_IMAGE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IMAGE_MANAGER))
#define IMAGE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IMAGE_MANAGER, ImageManagerClass))

typedef struct _ImageManager ImageManager;
typedef struct _ImageManagerClass ImageManagerClass;

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

typedef struct _Style Style;
typedef struct _StyleClass StyleClass;

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

typedef struct _Styles Styles;
typedef struct _StylesClass StylesClass;

#define TYPE_NODE_BORDER (node_border_get_type ())
#define NODE_BORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_BORDER, NodeBorder))
#define IS_NODE_BORDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_BORDER))
#define NODE_BORDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_NODE_BORDER, NodeBorderIface))

typedef struct _NodeBorder NodeBorder;
typedef struct _NodeBorderIface NodeBorderIface;
typedef enum  {
	NODE_SIDE_LEFT = 1,
	NODE_SIDE_TOP = 2,
	NODE_SIDE_RIGHT = 4,
	NODE_SIDE_BOTTOM = 8
} NodeSide;

#define TYPE_NODE_SIDE (node_side_get_type ())

#define TYPE_LINK_TYPE (link_type_get_type ())
#define LINK_TYPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LINK_TYPE, LinkType))
#define IS_LINK_TYPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LINK_TYPE))
#define LINK_TYPE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_LINK_TYPE, LinkTypeIface))

typedef struct _LinkType LinkType;
typedef struct _LinkTypeIface LinkTypeIface;
#define _style_unref0(var) ((var == NULL) ? NULL : (var = (style_unref (var), NULL)))

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

typedef struct _Theme Theme;
typedef struct _ThemeClass ThemeClass;

#define TYPE_LINK_DASH (link_dash_get_type ())
#define LINK_DASH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LINK_DASH, LinkDash))
#define LINK_DASH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LINK_DASH, LinkDashClass))
#define IS_LINK_DASH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LINK_DASH))
#define IS_LINK_DASH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LINK_DASH))
#define LINK_DASH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LINK_DASH, LinkDashClass))

typedef struct _LinkDash LinkDash;
typedef struct _LinkDashClass LinkDashClass;
typedef struct _LinkDashPrivate LinkDashPrivate;
#define __vala_GdkRGBA_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkRGBA_free (var), NULL)))

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

typedef struct _Layout Layout;
typedef struct _LayoutClass LayoutClass;

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

typedef struct _Connection Connection;
typedef struct _ConnectionClass ConnectionClass;

#define TYPE_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 _archive_entry_free0(var) ((var == NULL) ? NULL : (var = (archive_entry_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _archive_write_free0(var) ((var == NULL) ? NULL : (var = (archive_write_free (var), NULL)))

#define EXPORT_XMIND2021_TYPE_ID_OBJECT (export_xmind2021_id_object_get_type ())
#define EXPORT_XMIND2021_ID_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXPORT_XMIND2021_TYPE_ID_OBJECT, ExportXMind2021IdObject))
#define EXPORT_XMIND2021_ID_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXPORT_XMIND2021_TYPE_ID_OBJECT, ExportXMind2021IdObjectClass))
#define EXPORT_XMIND2021_IS_ID_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXPORT_XMIND2021_TYPE_ID_OBJECT))
#define EXPORT_XMIND2021_IS_ID_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXPORT_XMIND2021_TYPE_ID_OBJECT))
#define EXPORT_XMIND2021_ID_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXPORT_XMIND2021_TYPE_ID_OBJECT, ExportXMind2021IdObjectClass))

typedef struct _ExportXMind2021IdObject ExportXMind2021IdObject;
typedef struct _ExportXMind2021IdObjectClass ExportXMind2021IdObjectClass;

#define TYPE_MAP_MODEL (map_model_get_type ())
#define MAP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAP_MODEL, MapModel))
#define MAP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAP_MODEL, MapModelClass))
#define IS_MAP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAP_MODEL))
#define IS_MAP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAP_MODEL))
#define MAP_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAP_MODEL, MapModelClass))

typedef struct _MapModel MapModel;
typedef struct _MapModelClass MapModelClass;

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

typedef struct _Layouts Layouts;
typedef struct _LayoutsClass LayoutsClass;
#define _export_xmind2021_id_object_unref0(var) ((var == NULL) ? NULL : (var = (export_xmind2021_id_object_unref (var), NULL)))
#define _node_image_unref0(var) ((var == NULL) ? NULL : (var = (node_image_unref (var), NULL)))

#define TYPE_NODE_GROUP (node_group_get_type ())
#define NODE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_GROUP, NodeGroup))
#define NODE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_GROUP, NodeGroupClass))
#define IS_NODE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_GROUP))
#define IS_NODE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_GROUP))
#define NODE_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_GROUP, NodeGroupClass))

typedef struct _NodeGroup NodeGroup;
typedef struct _NodeGroupClass NodeGroupClass;

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

typedef struct _NodeGroups NodeGroups;
typedef struct _NodeGroupsClass NodeGroupsClass;
#define _archive_read_free0(var) ((var == NULL) ? NULL : (var = (archive_read_free (var), NULL)))
typedef struct _ExportXMind2021IdObjectPrivate ExportXMind2021IdObjectPrivate;
typedef struct _ExportXMind2021ParamSpecIdObject ExportXMind2021ParamSpecIdObject;
typedef struct _ExportXMind2021ParamSpecFileItem ExportXMind2021ParamSpecFileItem;
typedef struct _ExportXMind2021ParamSpecFileItems ExportXMind2021ParamSpecFileItems;

struct _Export {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ExportPrivate * priv;
};

struct _ExportClass {
	GTypeClass parent_class;
	void (*finalize) (Export *self);
	gboolean (*export) (Export* self, const gchar* fname, MindMap* map);
	gboolean (*import) (Export* self, const gchar* fname, MindMap* map);
	void (*add_settings) (Export* self, GtkGrid* grid);
	void (*save_settings) (Export* self, xmlNode* node);
	void (*load_settings) (Export* self, xmlNode* node);
};

struct _ExportXMind2021 {
	Export parent_instance;
	ExportXMind2021Private * priv;
};

struct _ExportXMind2021Class {
	ExportClass parent_class;
};

struct _ExportXMind2021Private {
	gint ids;
};

struct _ExportXMind2021FileItems {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ExportXMind2021FileItemsPrivate * priv;
	GArray* items;
};

struct _ExportXMind2021FileItemsClass {
	GTypeClass parent_class;
	void (*finalize) (ExportXMind2021FileItems *self);
};

struct _ExportXMind2021FileItem {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ExportXMind2021FileItemPrivate * priv;
	gchar* name;
	gchar* type;
};

struct _ExportXMind2021FileItemClass {
	GTypeClass parent_class;
	void (*finalize) (ExportXMind2021FileItem *self);
};

struct _NodeBorderIface {
	GTypeInterface parent_iface;
	gchar* (*name) (NodeBorder* self);
	gchar* (*display_name) (NodeBorder* self);
	gchar* (*light_icon_name) (NodeBorder* self);
	gchar* (*dark_icon_name) (NodeBorder* self);
	gboolean (*is_fillable) (NodeBorder* self);
	void (*draw_border) (NodeBorder* self, cairo_t* ctx, gdouble x, gdouble y, gdouble w, gdouble h, NodeSide s, gint padding);
	void (*draw_fill) (NodeBorder* self, cairo_t* ctx, gdouble x, gdouble y, gdouble w, gdouble h, NodeSide s, gint padding);
};

struct _LinkTypeIface {
	GTypeInterface parent_iface;
	gchar* (*name) (LinkType* self);
	gchar* (*display_name) (LinkType* self);
	gchar* (*light_icon_name) (LinkType* self);
	gchar* (*dark_icon_name) (LinkType* self);
	void (*draw) (LinkType* self, cairo_t* ctx, Node* from_node, Node* to_node, gdouble from_x, gdouble from_y, gdouble to_x, gdouble to_y, gdouble* fx, gdouble* fy, gdouble* tx, gdouble* ty);
};

struct _LinkDash {
	GObject parent_instance;
	LinkDashPrivate * priv;
	gchar* name;
	gchar* display_name;
	gdouble* pattern;
	gint pattern_length1;
};

struct _LinkDashClass {
	GObjectClass parent_class;
};

struct _ExportXMind2021IdObject {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ExportXMind2021IdObjectPrivate * priv;
};

struct _ExportXMind2021IdObjectClass {
	GTypeClass parent_class;
	void (*finalize) (ExportXMind2021IdObject *self);
};

struct _ExportXMind2021IdObjectPrivate {
	ExportXMind2021IdObjectType _typ;
	Node* _node;
	Connection* _conn;
	NodeGroup* _group;
};

struct _ExportXMind2021ParamSpecIdObject {
	GParamSpec parent_instance;
};

struct _ExportXMind2021ParamSpecFileItem {
	GParamSpec parent_instance;
};

struct _ExportXMind2021ParamSpecFileItems {
	GParamSpec parent_instance;
};

static gint ExportXMind2021_private_offset;
static gpointer export_xmind2021_parent_class = NULL;
VALA_EXTERN Styles* style_inspector_styles;
VALA_EXTERN gchar* minder_version;
static gint ExportXMind2021IdObject_private_offset;
static gpointer export_xmind2021_id_object_parent_class = NULL;
static gpointer export_xmind2021_file_item_parent_class = NULL;
static gpointer export_xmind2021_file_items_parent_class = NULL;

VALA_EXTERN gpointer export_ref (gpointer instance);
VALA_EXTERN void export_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_export (const gchar* name,
                               const gchar* nick,
                               const gchar* blurb,
                               GType object_type,
                               GParamFlags flags);
VALA_EXTERN void value_set_export (GValue* value,
                       gpointer v_object);
VALA_EXTERN void value_take_export (GValue* value,
                        gpointer v_object);
VALA_EXTERN gpointer value_get_export (const GValue* value);
VALA_EXTERN GType export_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Export, export_unref)
VALA_EXTERN gpointer mind_map_ref (gpointer instance);
VALA_EXTERN void mind_map_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_mind_map (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags);
VALA_EXTERN void value_set_mind_map (GValue* value,
                         gpointer v_object);
VALA_EXTERN void value_take_mind_map (GValue* value,
                          gpointer v_object);
VALA_EXTERN gpointer value_get_mind_map (const GValue* value);
VALA_EXTERN GType mind_map_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MindMap, mind_map_unref)
VALA_EXTERN GType export_xmind2021_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExportXMind2021, export_unref)
VALA_EXTERN gboolean export_export (Export* self,
                        const gchar* fname,
                        MindMap* map);
VALA_EXTERN gboolean export_import (Export* self,
                        const gchar* fname,
                        MindMap* map);
VALA_EXTERN GType export_xmind2021_id_object_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ExportXMind2021* export_xmind2021_new (void);
VALA_EXTERN ExportXMind2021* export_xmind2021_construct (GType object_type);
VALA_EXTERN Export* export_new (const gchar* name,
                    const gchar* label,
                    gchar** extensions,
                    gint extensions_length1,
                    gboolean exportable,
                    gboolean importable,
                    gboolean dir,
                    gboolean clippable);
VALA_EXTERN Export* export_construct (GType object_type,
                          const gchar* name,
                          const gchar* label,
                          gchar** extensions,
                          gint extensions_length1,
                          gboolean exportable,
                          gboolean importable,
                          gboolean dir,
                          gboolean clippable);
static gboolean export_xmind2021_real_export (Export* base,
                                       const gchar* fname,
                                       MindMap* map);
VALA_EXTERN gpointer export_xmind2021_file_items_ref (gpointer instance);
VALA_EXTERN void export_xmind2021_file_items_unref (gpointer instance);
VALA_EXTERN GParamSpec* export_xmind2021_param_spec_file_items (const gchar* name,
                                                    const gchar* nick,
                                                    const gchar* blurb,
                                                    GType object_type,
                                                    GParamFlags flags);
VALA_EXTERN void export_xmind2021_value_set_file_items (GValue* value,
                                            gpointer v_object);
VALA_EXTERN void export_xmind2021_value_take_file_items (GValue* value,
                                             gpointer v_object);
VALA_EXTERN gpointer export_xmind2021_value_get_file_items (const GValue* value);
VALA_EXTERN GType export_xmind2021_file_items_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExportXMind2021FileItems, export_xmind2021_file_items_unref)
VALA_EXTERN ExportXMind2021FileItems* export_xmind2021_file_items_new (void);
VALA_EXTERN ExportXMind2021FileItems* export_xmind2021_file_items_construct (GType object_type);
static gboolean export_xmind2021_export_meta (ExportXMind2021* self,
                                       MindMap* map,
                                       const gchar* dir,
                                       ExportXMind2021FileItems* file_list);
static gboolean export_xmind2021_export_content (ExportXMind2021* self,
                                          MindMap* map,
                                          const gchar* dir,
                                          ExportXMind2021FileItems* file_list);
static gboolean export_xmind2021_export_manifest (ExportXMind2021* self,
                                           const gchar* dir,
                                           ExportXMind2021FileItems* file_list);
static void export_xmind2021_archive_contents (ExportXMind2021* self,
                                        const gchar* dir,
                                        const gchar* outname,
                                        ExportXMind2021FileItems* files);
VALA_EXTERN gpointer export_xmind2021_file_item_ref (gpointer instance);
VALA_EXTERN void export_xmind2021_file_item_unref (gpointer instance);
VALA_EXTERN GParamSpec* export_xmind2021_param_spec_file_item (const gchar* name,
                                                   const gchar* nick,
                                                   const gchar* blurb,
                                                   GType object_type,
                                                   GParamFlags flags);
VALA_EXTERN void export_xmind2021_value_set_file_item (GValue* value,
                                           gpointer v_object);
VALA_EXTERN void export_xmind2021_value_take_file_item (GValue* value,
                                            gpointer v_object);
VALA_EXTERN gpointer export_xmind2021_value_get_file_item (const GValue* value);
VALA_EXTERN GType export_xmind2021_file_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExportXMind2021FileItem, export_xmind2021_file_item_unref)
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN void export_xmind2021_file_items_add (ExportXMind2021FileItems* self,
                                      const gchar* name,
                                      const gchar* type);
VALA_EXTERN GType node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Node, g_object_unref)
static JsonObject* export_xmind2021_export_node (ExportXMind2021* self,
                                          MindMap* map,
                                          Node* node,
                                          gboolean top,
                                          const gchar* dir,
                                          ExportXMind2021FileItems* file_list);
VALA_EXTERN GArray* mind_map_get_nodes (MindMap* self);
static JsonObject* export_xmind2021_export_theme (ExportXMind2021* self,
                                           MindMap* map);
static JsonArray* export_xmind2021_export_extensions (ExportXMind2021* self,
                                               MindMap* map);
static JsonArray* export_xmind2021_export_relationships (ExportXMind2021* self,
                                                  MindMap* map);
VALA_EXTERN GType canvas_text_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CanvasText, g_object_unref)
VALA_EXTERN CanvasText* node_get_name (Node* self);
VALA_EXTERN gpointer formatted_text_ref (gpointer instance);
VALA_EXTERN void formatted_text_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_formatted_text (const gchar* name,
                                       const gchar* nick,
                                       const gchar* blurb,
                                       GType object_type,
                                       GParamFlags flags);
VALA_EXTERN void value_set_formatted_text (GValue* value,
                               gpointer v_object);
VALA_EXTERN void value_take_formatted_text (GValue* value,
                                gpointer v_object);
VALA_EXTERN gpointer value_get_formatted_text (const GValue* value);
VALA_EXTERN GType formatted_text_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FormattedText, formatted_text_unref)
VALA_EXTERN FormattedText* canvas_text_get_text (CanvasText* self);
VALA_EXTERN const gchar* formatted_text_get_text (FormattedText* self);
VALA_EXTERN const gchar* node_get_note (Node* self);
static JsonObject* export_xmind2021_export_node_note (ExportXMind2021* self,
                                               Node* node);
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 JsonObject* export_xmind2021_export_node_image (ExportXMind2021* self,
                                                MindMap* map,
                                                Node* node,
                                                const gchar* dir,
                                                ExportXMind2021FileItems* file_list);
VALA_EXTERN GArray* node_children (Node* self);
VALA_EXTERN gboolean node_get_group (Node* self);
VALA_EXTERN gpointer image_manager_ref (gpointer instance);
VALA_EXTERN void image_manager_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_image_manager (const gchar* name,
                                      const gchar* nick,
                                      const gchar* blurb,
                                      GType object_type,
                                      GParamFlags flags);
VALA_EXTERN void value_set_image_manager (GValue* value,
                              gpointer v_object);
VALA_EXTERN void value_take_image_manager (GValue* value,
                               gpointer v_object);
VALA_EXTERN gpointer value_get_image_manager (const GValue* value);
VALA_EXTERN GType image_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImageManager, image_manager_unref)
VALA_EXTERN ImageManager* mind_map_get_image_manager (MindMap* self);
VALA_EXTERN gchar* image_manager_get_file (ImageManager* self,
                               gint id);
VALA_EXTERN gint node_image_get_id (NodeImage* self);
VALA_EXTERN gchar* image_manager_get_mime_type (ImageManager* self,
                                    gint id);
VALA_EXTERN gchar* utils_markdown_to_html (const gchar* md,
                               const gchar* tag);
static JsonObject* export_xmind2021_export_node_content_note (ExportXMind2021* self,
                                                       const gchar* str);
static JsonObject* export_xmind2021_export_node_style (ExportXMind2021* self,
                                                gint level);
static JsonObject* export_xmind2021_export_boundary_style (ExportXMind2021* self,
                                                    MindMap* map);
static JsonObject* export_xmind2021_export_relationship_style (ExportXMind2021* self,
                                                        MindMap* map);
static JsonObject* export_xmind2021_export_map_style (ExportXMind2021* self,
                                               MindMap* map);
VALA_EXTERN gpointer style_ref (gpointer instance);
VALA_EXTERN void style_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_style (const gchar* name,
                              const gchar* nick,
                              const gchar* blurb,
                              GType object_type,
                              GParamFlags flags);
VALA_EXTERN void value_set_style (GValue* value,
                      gpointer v_object);
VALA_EXTERN void value_take_style (GValue* value,
                       gpointer v_object);
VALA_EXTERN gpointer value_get_style (const GValue* value);
VALA_EXTERN GType style_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Style, style_unref)
VALA_EXTERN gpointer styles_ref (gpointer instance);
VALA_EXTERN void styles_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_styles (const gchar* name,
                               const gchar* nick,
                               const gchar* blurb,
                               GType object_type,
                               GParamFlags flags);
VALA_EXTERN void value_set_styles (GValue* value,
                       gpointer v_object);
VALA_EXTERN void value_take_styles (GValue* value,
                        gpointer v_object);
VALA_EXTERN gpointer value_get_styles (const GValue* value);
VALA_EXTERN GType styles_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Styles, styles_unref)
VALA_EXTERN Style* styles_get_style_for_level (Styles* self,
                                   guint level,
                                   Style* alternative);
VALA_EXTERN GType node_side_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType node_border_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeBorder, g_object_unref)
VALA_EXTERN NodeBorder* style_get_node_border (Style* self);
VALA_EXTERN gchar* node_border_name (NodeBorder* self);
VALA_EXTERN gint* style_get_node_borderwidth (Style* self);
VALA_EXTERN gint* style_get_link_width (Style* self);
VALA_EXTERN gboolean* style_get_node_fill (Style* self);
VALA_EXTERN GType link_type_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LinkType, g_object_unref)
VALA_EXTERN LinkType* style_get_link_type (Style* self);
VALA_EXTERN gchar* link_type_name (LinkType* self);
VALA_EXTERN gboolean* style_get_link_arrow (Style* self);
VALA_EXTERN GType theme_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Theme, g_object_unref)
VALA_EXTERN Theme* mind_map_get_theme (MindMap* self);
VALA_EXTERN Style* mind_map_get_global_style (MindMap* self);
VALA_EXTERN gint* style_get_connection_line_width (Style* self);
VALA_EXTERN GType link_dash_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LinkDash, g_object_unref)
VALA_EXTERN LinkDash* style_get_connection_dash (Style* self);
VALA_EXTERN PangoFontDescription* style_get_connection_font (Style* self);
VALA_EXTERN gchar* utils_color_from_rgba (GdkRGBA* rgba);
VALA_EXTERN GdkRGBA* theme_get_color (Theme* self,
                          const gchar* name);
static void _vala_GdkRGBA_free (GdkRGBA* self);
VALA_EXTERN GType layout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Layout, g_object_unref)
VALA_EXTERN Layout* node_get_layout (Node* self);
VALA_EXTERN gboolean layout_get_balanceable (Layout* self);
VALA_EXTERN NodeSide node_get_side (Node* self);
VALA_EXTERN gchar* node_side_to_string (NodeSide self);
VALA_EXTERN GType connection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Connection, g_object_unref)
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* mind_map_get_connections (MindMap* self);
VALA_EXTERN GArray* connections_get_connections (Connections* self);
VALA_EXTERN GdkRGBA* connection_get_color (Connection* self);
static GdkRGBA* _vala_GdkRGBA_copy (GdkRGBA* self);
VALA_EXTERN Node* connection_get_from_node (Connection* self);
VALA_EXTERN gint node_id (Node* self);
VALA_EXTERN Node* connection_get_to_node (Connection* self);
VALA_EXTERN CanvasText* connection_get_title (Connection* self);
static gboolean export_xmind2021_real_import (Export* base,
                                       const gchar* fname,
                                       MindMap* map);
static void export_xmind2021_unarchive_contents (ExportXMind2021* self,
                                          const gchar* fname,
                                          const gchar* dir);
VALA_EXTERN gpointer export_xmind2021_id_object_ref (gpointer instance);
VALA_EXTERN void export_xmind2021_id_object_unref (gpointer instance);
VALA_EXTERN GParamSpec* export_xmind2021_param_spec_id_object (const gchar* name,
                                                   const gchar* nick,
                                                   const gchar* blurb,
                                                   GType object_type,
                                                   GParamFlags flags);
VALA_EXTERN void export_xmind2021_value_set_id_object (GValue* value,
                                           gpointer v_object);
VALA_EXTERN void export_xmind2021_value_take_id_object (GValue* value,
                                            gpointer v_object);
VALA_EXTERN gpointer export_xmind2021_value_get_id_object (const GValue* value);
VALA_EXTERN GType export_xmind2021_id_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExportXMind2021IdObject, export_xmind2021_id_object_unref)
static gboolean export_xmind2021_import_content (ExportXMind2021* self,
                                          MindMap* map,
                                          const gchar* fname,
                                          const gchar* dir,
                                          GeeHashMap* id_map);
VALA_EXTERN void mind_map_queue_draw (MindMap* self);
VALA_EXTERN void mind_map_auto_save (MindMap* self);
static void export_xmind2021_import_map (ExportXMind2021* self,
                                  MindMap* map,
                                  JsonNode* n,
                                  const gchar* dir,
                                  GeeHashMap* id_map);
static gchar* export_xmind2021_get_json_string (ExportXMind2021* self,
                                         JsonObject* obj,
                                         const gchar* prop);
static JsonObject* export_xmind2021_get_json_object (ExportXMind2021* self,
                                              JsonObject* obj,
                                              const gchar* prop);
static JsonArray* export_xmind2021_get_json_array (ExportXMind2021* self,
                                            JsonObject* obj,
                                            const gchar* prop);
static void export_xmind2021_import_sheet (ExportXMind2021* self,
                                    MindMap* map,
                                    JsonObject* obj,
                                    const gchar* dir,
                                    GeeHashMap* id_map);
static void export_xmind2021_import_theme (ExportXMind2021* self,
                                    MindMap* map,
                                    JsonObject* obj,
                                    GeeHashMap* id_map);
static void export_xmind2021_import_topic (ExportXMind2021* self,
                                    MindMap* map,
                                    Node* parent,
                                    JsonObject* obj,
                                    gboolean attached,
                                    const gchar* dir,
                                    GeeHashMap* id_map);
static void export_xmind2021_import_relationships (ExportXMind2021* self,
                                            MindMap* map,
                                            JsonArray* arr,
                                            GeeHashMap* id_map);
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 Node* map_model_create_root_node (MapModel* self,
                                  const gchar* name);
VALA_EXTERN GType layouts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Layouts, g_object_unref)
VALA_EXTERN Layouts* mind_map_get_layouts (MindMap* self);
VALA_EXTERN Layout* layouts_get_layout (Layouts* self,
                            const gchar* name);
VALA_EXTERN void node_set_layout (Node* self,
                      Layout* value);
VALA_EXTERN Node* map_model_create_child_node (MapModel* self,
                                   Node* parent,
                                   const gchar* name);
VALA_EXTERN ExportXMind2021IdObject* export_xmind2021_id_object_new_for_node (Node* n);
VALA_EXTERN ExportXMind2021IdObject* export_xmind2021_id_object_construct_for_node (GType object_type,
                                                                        Node* n);
VALA_EXTERN void formatted_text_insert_text (FormattedText* self,
                                 gint index,
                                 const gchar* str);
static void export_xmind2021_import_node_notes (ExportXMind2021* self,
                                         Node* node,
                                         JsonObject* obj);
VALA_EXTERN void node_set_note (Node* self,
                    const gchar* value);
static void export_xmind2021_import_image (ExportXMind2021* self,
                                    MindMap* map,
                                    Node* node,
                                    JsonObject* obj,
                                    const gchar* dir,
                                    GeeHashMap* id_map);
static void export_xmind2021_import_children (ExportXMind2021* self,
                                       MindMap* map,
                                       Node* node,
                                       JsonObject* obj,
                                       const gchar* dir,
                                       GeeHashMap* id_map);
static void export_xmind2021_import_boundaries (ExportXMind2021* self,
                                         MindMap* map,
                                         Node* node,
                                         JsonArray* arr,
                                         GeeHashMap* id_map);
VALA_EXTERN void node_set_image (Node* self,
                     ImageManager* im,
                     NodeImage* ni);
VALA_EXTERN NodeImage* node_image_new_from_uri (ImageManager* im,
                                    const gchar* uri,
                                    gint width);
VALA_EXTERN NodeImage* node_image_construct_from_uri (GType object_type,
                                          ImageManager* im,
                                          const gchar* uri,
                                          gint width);
static void _g_object_unref0_ (gpointer var);
static void _vala_Node_free_function_content_of (gpointer data);
VALA_EXTERN GType node_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeGroup, g_object_unref)
VALA_EXTERN NodeGroup* node_group_new_array (MindMap* map,
                                 GArray* nodes);
VALA_EXTERN NodeGroup* node_group_construct_array (GType object_type,
                                       MindMap* map,
                                       GArray* nodes);
VALA_EXTERN gpointer node_groups_ref (gpointer instance);
VALA_EXTERN void node_groups_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_node_groups (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_node_groups (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_node_groups (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_node_groups (const GValue* value);
VALA_EXTERN GType node_groups_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeGroups, node_groups_unref)
VALA_EXTERN NodeGroups* mind_map_get_groups (MindMap* self);
VALA_EXTERN void node_groups_add_group (NodeGroups* self,
                            NodeGroup* group);
VALA_EXTERN ExportXMind2021IdObject* export_xmind2021_id_object_new_for_boundary (NodeGroup* g);
VALA_EXTERN ExportXMind2021IdObject* export_xmind2021_id_object_construct_for_boundary (GType object_type,
                                                                            NodeGroup* g);
VALA_EXTERN ExportXMind2021IdObjectType export_xmind2021_id_object_get_typ (ExportXMind2021IdObject* self);
VALA_EXTERN Node* export_xmind2021_id_object_get_node (ExportXMind2021IdObject* self);
VALA_EXTERN Connection* connection_new (MindMap* map,
                            Node* from_node);
VALA_EXTERN Connection* connection_construct (GType object_type,
                                  MindMap* map,
                                  Node* from_node);
VALA_EXTERN void connection_change_title (Connection* self,
                              MindMap* map,
                              const gchar* title,
                              gboolean allow_empty);
VALA_EXTERN void connection_connect_to (Connection* self,
                            Node* node);
VALA_EXTERN void connections_add_connection (Connections* self,
                                 Connection* conn);
VALA_EXTERN ExportXMind2021IdObject* export_xmind2021_id_object_new_for_connection (Connection* c);
VALA_EXTERN ExportXMind2021IdObject* export_xmind2021_id_object_construct_for_connection (GType object_type,
                                                                              Connection* c);
static void export_xmind2021_import_theme_node (ExportXMind2021* self,
                                         MindMap* map,
                                         JsonObject* obj,
                                         gint level,
                                         GeeHashMap* id_map);
VALA_EXTERN NodeBorder* styles_get_node_border (Styles* self,
                                    const gchar* name);
VALA_EXTERN void style_set_node_border (Style* self,
                            NodeBorder* value);
VALA_EXTERN void style_set_node_borderwidth (Style* self,
                                 gint* value);
VALA_EXTERN void style_set_link_arrow (Style* self,
                           gboolean* value);
VALA_EXTERN LinkType* styles_get_link_type (Styles* self,
                                const gchar* name);
VALA_EXTERN void style_set_link_type (Style* self,
                          LinkType* value);
VALA_EXTERN void style_set_link_width (Style* self,
                           gint* value);
VALA_EXTERN void style_set_node_fill (Style* self,
                          gboolean* value);
static void _style_unref0_ (gpointer var);
static inline void _g_slist_free__style_unref0_ (GSList* self);
static guint8* _vala_array_dup8 (guint8* self,
                          gssize length);
VALA_EXTERN void export_xmind2021_id_object_set_typ (ExportXMind2021IdObject* self,
                                         ExportXMind2021IdObjectType value);
VALA_EXTERN void export_xmind2021_id_object_set_node (ExportXMind2021IdObject* self,
                                          Node* value);
VALA_EXTERN void export_xmind2021_id_object_set_conn (ExportXMind2021IdObject* self,
                                          Connection* value);
VALA_EXTERN void export_xmind2021_id_object_set_group (ExportXMind2021IdObject* self,
                                           NodeGroup* value);
VALA_EXTERN ExportXMind2021IdObject* export_xmind2021_id_object_new (void);
VALA_EXTERN ExportXMind2021IdObject* export_xmind2021_id_object_construct (GType object_type);
VALA_EXTERN Connection* export_xmind2021_id_object_get_conn (ExportXMind2021IdObject* self);
VALA_EXTERN NodeGroup* export_xmind2021_id_object_get_group (ExportXMind2021IdObject* self);
static void export_xmind2021_id_object_finalize (ExportXMind2021IdObject * obj);
static GType export_xmind2021_id_object_get_type_once (void);
VALA_EXTERN ExportXMind2021FileItem* export_xmind2021_file_item_new (const gchar* n,
                                                         const gchar* t);
VALA_EXTERN ExportXMind2021FileItem* export_xmind2021_file_item_construct (GType object_type,
                                                               const gchar* n,
                                                               const gchar* t);
static void export_xmind2021_file_item_finalize (ExportXMind2021FileItem * obj);
static GType export_xmind2021_file_item_get_type_once (void);
static void _export_xmind2021_file_item_unref0_ (gpointer var);
static void _vala_ExportXMind2021FileItem_free_function_content_of (gpointer data);
static void export_xmind2021_file_items_finalize (ExportXMind2021FileItems * obj);
static GType export_xmind2021_file_items_get_type_once (void);
static void export_xmind2021_finalize (Export * obj);
static GType export_xmind2021_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
export_xmind2021_get_instance_private (ExportXMind2021* self)
{
	return G_STRUCT_MEMBER_P (self, ExportXMind2021_private_offset);
}

static GType
export_xmind2021_id_object_type_get_type_once (void)
{
	static const GEnumValue values[] = {{EXPORT_XMIND2021_ID_OBJECT_TYPE_NODE, "EXPORT_XMIND2021_ID_OBJECT_TYPE_NODE", "node"}, {EXPORT_XMIND2021_ID_OBJECT_TYPE_CONNECTION, "EXPORT_XMIND2021_ID_OBJECT_TYPE_CONNECTION", "connection"}, {EXPORT_XMIND2021_ID_OBJECT_TYPE_BOUNDARY, "EXPORT_XMIND2021_ID_OBJECT_TYPE_BOUNDARY", "boundary"}, {0, NULL, NULL}};
	GType export_xmind2021_id_object_type_type_id;
	export_xmind2021_id_object_type_type_id = g_enum_register_static ("ExportXMind2021IdObjectType", values);
	return export_xmind2021_id_object_type_type_id;
}

GType
export_xmind2021_id_object_type_get_type (void)
{
	static volatile gsize export_xmind2021_id_object_type_type_id__once = 0;
	if (g_once_init_enter (&export_xmind2021_id_object_type_type_id__once)) {
		GType export_xmind2021_id_object_type_type_id;
		export_xmind2021_id_object_type_type_id = export_xmind2021_id_object_type_get_type_once ();
		g_once_init_leave (&export_xmind2021_id_object_type_type_id__once, export_xmind2021_id_object_type_type_id);
	}
	return export_xmind2021_id_object_type_type_id__once;
}

ExportXMind2021*
export_xmind2021_construct (GType object_type)
{
	ExportXMind2021* self = NULL;
	gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	_tmp0_ = g_strdup (".xmind");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = 1;
	self = (ExportXMind2021*) export_construct (object_type, "xmind-2021", _ ("XMind 2021"), _tmp2_, (gint) 1, FALSE, TRUE, FALSE, FALSE);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	return self;
}

ExportXMind2021*
export_xmind2021_new (void)
{
	return export_xmind2021_construct (TYPE_EXPORT_XMIND2021);
}

static gboolean
export_xmind2021_real_export (Export* base,
                              const gchar* fname,
                              MindMap* map)
{
	ExportXMind2021 * self;
	gchar* dir = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	ExportXMind2021FileItems* file_list = NULL;
	ExportXMind2021FileItems* _tmp2_;
	gboolean result;
	self = (ExportXMind2021*) base;
	g_return_val_if_fail (fname != NULL, FALSE);
	g_return_val_if_fail (map != NULL, FALSE);
	_tmp0_ = g_strdup ("minderXXXXXX");
	_tmp1_ = mkdtemp (_tmp0_);
	dir = _tmp1_;
	_tmp2_ = export_xmind2021_file_items_new ();
	file_list = _tmp2_;
	export_xmind2021_export_meta (self, map, dir, file_list);
	export_xmind2021_export_content (self, map, dir, file_list);
	export_xmind2021_export_manifest (self, dir, file_list);
	export_xmind2021_archive_contents (self, dir, fname, file_list);
	result = TRUE;
	_export_xmind2021_file_items_unref0 (file_list);
	_g_free0 (dir);
	return result;
}

static gpointer
_json_object_ref0 (gpointer self)
{
	return self ? json_object_ref (self) : NULL;
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static gboolean
export_xmind2021_export_manifest (ExportXMind2021* self,
                                  const gchar* dir,
                                  ExportXMind2021FileItems* file_list)
{
	JsonNode* root = NULL;
	JsonNode* _tmp0_;
	JsonObject* top = NULL;
	JsonObject* _tmp1_;
	JsonObject* entries = NULL;
	JsonObject* _tmp2_;
	JsonNode* _tmp3_;
	JsonObject* _tmp4_;
	JsonObject* _tmp5_;
	JsonObject* _tmp6_;
	JsonObject* _tmp7_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp18_;
	JsonGenerator* _tmp19_;
	JsonNode* _tmp20_;
	JsonGenerator* _tmp21_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (dir != NULL, FALSE);
	g_return_val_if_fail (file_list != NULL, FALSE);
	_tmp0_ = json_node_new (JSON_NODE_OBJECT);
	root = _tmp0_;
	_tmp1_ = json_object_new ();
	top = _tmp1_;
	_tmp2_ = json_object_new ();
	entries = _tmp2_;
	_tmp3_ = root;
	_tmp4_ = top;
	json_node_set_object (_tmp3_, _tmp4_);
	_tmp5_ = top;
	_tmp6_ = entries;
	_tmp7_ = _json_object_ref0 (_tmp6_);
	json_object_set_object_member (_tmp5_, "file-entries", _tmp7_);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp8_ = FALSE;
			_tmp8_ = TRUE;
			while (TRUE) {
				GArray* _tmp10_;
				JsonObject* obj = NULL;
				JsonObject* _tmp11_;
				JsonObject* _tmp12_;
				GArray* _tmp13_;
				ExportXMind2021FileItem* _tmp14_;
				const gchar* _tmp15_;
				JsonObject* _tmp16_;
				JsonObject* _tmp17_;
				if (!_tmp8_) {
					gint _tmp9_;
					_tmp9_ = i;
					i = _tmp9_ + 1;
				}
				_tmp8_ = FALSE;
				_tmp10_ = file_list->items;
				if (!(((guint) i) < _tmp10_->len)) {
					break;
				}
				_tmp11_ = json_object_new ();
				obj = _tmp11_;
				_tmp12_ = entries;
				_tmp13_ = file_list->items;
				_tmp14_ = g_array_index (_tmp13_, ExportXMind2021FileItem*, (guint) i);
				_tmp15_ = _tmp14_->name;
				_tmp16_ = obj;
				_tmp17_ = _json_object_ref0 (_tmp16_);
				json_object_set_object_member (_tmp12_, _tmp15_, _tmp17_);
				_json_object_unref0 (obj);
			}
		}
	}
	_tmp18_ = json_generator_new ();
	generator = _tmp18_;
	_tmp19_ = generator;
	_tmp20_ = root;
	json_generator_set_root (_tmp19_, _tmp20_);
	_tmp21_ = generator;
	json_generator_set_pretty (_tmp21_, TRUE);
	{
		JsonGenerator* _tmp22_;
		gchar* _tmp23_;
		gchar* _tmp24_;
		_tmp22_ = generator;
		_tmp23_ = g_build_filename (dir, "manifest.json", NULL);
		_tmp24_ = _tmp23_;
		json_generator_to_file (_tmp22_, _tmp24_, &_inner_error0_);
		_g_free0 (_tmp24_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = FALSE;
		_g_object_unref0 (generator);
		_json_object_unref0 (entries);
		_json_object_unref0 (top);
		__vala_JsonNode_free0 (root);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp25_ = FALSE;
		_g_object_unref0 (generator);
		_json_object_unref0 (entries);
		_json_object_unref0 (top);
		__vala_JsonNode_free0 (root);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp25_;
	}
	export_xmind2021_file_items_add (file_list, "manifest.json", "text/json");
	result = TRUE;
	_g_object_unref0 (generator);
	_json_object_unref0 (entries);
	_json_object_unref0 (top);
	__vala_JsonNode_free0 (root);
	return result;
}

static gboolean
export_xmind2021_export_content (ExportXMind2021* self,
                                 MindMap* map,
                                 const gchar* dir,
                                 ExportXMind2021FileItems* file_list)
{
	JsonNode* root = NULL;
	JsonNode* _tmp0_;
	JsonArray* top = NULL;
	JsonArray* _tmp1_;
	JsonObject* sheet = NULL;
	JsonObject* _tmp2_;
	JsonNode* _tmp3_;
	JsonArray* _tmp4_;
	JsonObject* _tmp5_;
	JsonObject* _tmp6_;
	JsonObject* _tmp7_;
	GArray* _tmp8_;
	GArray* _tmp9_;
	Node* _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	JsonObject* _tmp13_;
	JsonObject* _tmp14_;
	JsonArray* _tmp15_;
	JsonObject* _tmp16_;
	JsonObject* _tmp17_;
	JsonArray* _tmp18_;
	JsonArray* _tmp19_;
	JsonObject* _tmp20_;
	JsonObject* _tmp21_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp22_;
	JsonGenerator* _tmp23_;
	JsonNode* _tmp24_;
	JsonGenerator* _tmp25_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (map != NULL, FALSE);
	g_return_val_if_fail (dir != NULL, FALSE);
	g_return_val_if_fail (file_list != NULL, FALSE);
	_tmp0_ = json_node_new (JSON_NODE_ARRAY);
	root = _tmp0_;
	_tmp1_ = json_array_new ();
	top = _tmp1_;
	_tmp2_ = json_object_new ();
	sheet = _tmp2_;
	_tmp3_ = root;
	_tmp4_ = top;
	json_node_set_array (_tmp3_, _tmp4_);
	_tmp5_ = sheet;
	json_object_set_string_member (_tmp5_, "class", "sheet");
	_tmp6_ = sheet;
	json_object_set_string_member (_tmp6_, "title", "Map");
	_tmp7_ = sheet;
	_tmp8_ = mind_map_get_nodes (map);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_array_index (_tmp9_, Node*, (guint) 0);
	_tmp11_ = export_xmind2021_export_node (self, map, _tmp10_, TRUE, dir, file_list);
	json_object_set_object_member (_tmp7_, "rootTopic", _tmp11_);
	_g_array_unref0 (_tmp9_);
	_tmp12_ = sheet;
	_tmp13_ = export_xmind2021_export_theme (self, map);
	json_object_set_object_member (_tmp12_, "theme", _tmp13_);
	_tmp14_ = sheet;
	_tmp15_ = export_xmind2021_export_extensions (self, map);
	json_object_set_array_member (_tmp14_, "extensions", _tmp15_);
	_tmp16_ = sheet;
	json_object_set_string_member (_tmp16_, "topicPositioning", "fixed");
	_tmp17_ = sheet;
	_tmp18_ = export_xmind2021_export_relationships (self, map);
	json_object_set_array_member (_tmp17_, "relationships", _tmp18_);
	_tmp19_ = top;
	_tmp20_ = sheet;
	_tmp21_ = _json_object_ref0 (_tmp20_);
	json_array_add_object_element (_tmp19_, _tmp21_);
	_tmp22_ = json_generator_new ();
	generator = _tmp22_;
	_tmp23_ = generator;
	_tmp24_ = root;
	json_generator_set_root (_tmp23_, _tmp24_);
	_tmp25_ = generator;
	json_generator_set_pretty (_tmp25_, TRUE);
	{
		JsonGenerator* _tmp26_;
		gchar* _tmp27_;
		gchar* _tmp28_;
		_tmp26_ = generator;
		_tmp27_ = g_build_filename (dir, "content.json", NULL);
		_tmp28_ = _tmp27_;
		json_generator_to_file (_tmp26_, _tmp28_, &_inner_error0_);
		_g_free0 (_tmp28_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = FALSE;
		_g_object_unref0 (generator);
		_json_object_unref0 (sheet);
		_json_array_unref0 (top);
		__vala_JsonNode_free0 (root);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp29_ = FALSE;
		_g_object_unref0 (generator);
		_json_object_unref0 (sheet);
		_json_array_unref0 (top);
		__vala_JsonNode_free0 (root);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp29_;
	}
	export_xmind2021_file_items_add (file_list, "content.json", "text/json");
	result = TRUE;
	_g_object_unref0 (generator);
	_json_object_unref0 (sheet);
	_json_array_unref0 (top);
	__vala_JsonNode_free0 (root);
	return result;
}

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

static gpointer
_json_array_ref0 (gpointer self)
{
	return self ? json_array_ref (self) : NULL;
}

static JsonObject*
export_xmind2021_export_node (ExportXMind2021* self,
                              MindMap* map,
                              Node* node,
                              gboolean top,
                              const gchar* dir,
                              ExportXMind2021FileItems* file_list)
{
	JsonObject* topic = NULL;
	JsonObject* _tmp0_;
	GArray* groups = NULL;
	GArray* _tmp1_;
	JsonObject* _tmp2_;
	JsonObject* _tmp3_;
	CanvasText* _tmp4_;
	CanvasText* _tmp5_;
	FormattedText* _tmp6_;
	FormattedText* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	JsonObject* _tmp10_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	NodeImage* _tmp16_;
	NodeImage* _tmp17_;
	GArray* _tmp23_;
	GArray* _tmp24_;
	gboolean _tmp25_;
	GArray* _tmp47_;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (map != NULL, NULL);
	g_return_val_if_fail (node != NULL, NULL);
	g_return_val_if_fail (dir != NULL, NULL);
	g_return_val_if_fail (file_list != NULL, NULL);
	_tmp0_ = json_object_new ();
	topic = _tmp0_;
	_tmp1_ = g_array_new (TRUE, TRUE, sizeof (gint));
	groups = _tmp1_;
	_tmp2_ = topic;
	json_object_set_string_member (_tmp2_, "class", "topic");
	_tmp3_ = topic;
	_tmp4_ = node_get_name (node);
	_tmp5_ = _tmp4_;
	_tmp6_ = canvas_text_get_text (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = formatted_text_get_text (_tmp7_);
	_tmp9_ = _tmp8_;
	json_object_set_string_member (_tmp3_, "title", _tmp9_);
	_tmp10_ = topic;
	json_object_set_boolean_member (_tmp10_, "titleUnedited", FALSE);
	if (top) {
		JsonObject* _tmp11_;
		_tmp11_ = topic;
		json_object_set_string_member (_tmp11_, "structureClass", "org.xmind.ui.map.unbalanced");
	}
	_tmp12_ = node_get_note (node);
	_tmp13_ = _tmp12_;
	if (g_strcmp0 (_tmp13_, "") != 0) {
		JsonObject* _tmp14_;
		JsonObject* _tmp15_;
		_tmp14_ = topic;
		_tmp15_ = export_xmind2021_export_node_note (self, node);
		json_object_set_object_member (_tmp14_, "notes", _tmp15_);
	}
	_tmp16_ = node_get_image (node);
	_tmp17_ = _tmp16_;
	if (_tmp17_ != NULL) {
		JsonObject* image = NULL;
		JsonObject* _tmp18_;
		JsonObject* _tmp19_;
		_tmp18_ = export_xmind2021_export_node_image (self, map, node, dir, file_list);
		image = _tmp18_;
		_tmp19_ = image;
		if (_tmp19_ != NULL) {
			JsonObject* _tmp20_;
			JsonObject* _tmp21_;
			JsonObject* _tmp22_;
			_tmp20_ = topic;
			_tmp21_ = image;
			_tmp22_ = _json_object_ref0 (_tmp21_);
			json_object_set_object_member (_tmp20_, "image", _tmp22_);
		}
		_json_object_unref0 (image);
	}
	_tmp23_ = node_children (node);
	_tmp24_ = _tmp23_;
	_tmp25_ = _tmp24_->len > ((guint) 0);
	_g_array_unref0 (_tmp24_);
	if (_tmp25_) {
		JsonArray* attached = NULL;
		JsonArray* _tmp26_;
		JsonObject* _tmp44_;
		JsonArray* _tmp45_;
		JsonArray* _tmp46_;
		_tmp26_ = json_array_new ();
		attached = _tmp26_;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp27_ = FALSE;
				_tmp27_ = TRUE;
				while (TRUE) {
					GArray* _tmp29_;
					GArray* _tmp30_;
					gboolean _tmp31_;
					Node* child = NULL;
					GArray* _tmp32_;
					GArray* _tmp33_;
					Node* _tmp34_;
					Node* _tmp35_;
					Node* _tmp36_;
					JsonArray* _tmp37_;
					Node* _tmp38_;
					JsonObject* _tmp39_;
					Node* _tmp40_;
					gboolean _tmp41_;
					gboolean _tmp42_;
					if (!_tmp27_) {
						gint _tmp28_;
						_tmp28_ = i;
						i = _tmp28_ + 1;
					}
					_tmp27_ = FALSE;
					_tmp29_ = node_children (node);
					_tmp30_ = _tmp29_;
					_tmp31_ = !(((guint) i) < _tmp30_->len);
					_g_array_unref0 (_tmp30_);
					if (_tmp31_) {
						break;
					}
					_tmp32_ = node_children (node);
					_tmp33_ = _tmp32_;
					_tmp34_ = g_array_index (_tmp33_, Node*, (guint) i);
					_tmp35_ = _g_object_ref0 (_tmp34_);
					_tmp36_ = _tmp35_;
					_g_array_unref0 (_tmp33_);
					child = _tmp36_;
					_tmp37_ = attached;
					_tmp38_ = child;
					_tmp39_ = export_xmind2021_export_node (self, map, _tmp38_, FALSE, dir, file_list);
					json_array_add_object_element (_tmp37_, _tmp39_);
					_tmp40_ = child;
					_tmp41_ = node_get_group (_tmp40_);
					_tmp42_ = _tmp41_;
					if (_tmp42_) {
						GArray* _tmp43_;
						_tmp43_ = groups;
						g_array_append_val (_tmp43_, i);
					}
					_g_object_unref0 (child);
				}
			}
		}
		_tmp44_ = topic;
		_tmp45_ = attached;
		_tmp46_ = _json_array_ref0 (_tmp45_);
		json_object_set_array_member (_tmp44_, "children", _tmp46_);
		_json_array_unref0 (attached);
	}
	_tmp47_ = groups;
	if (_tmp47_->len > ((guint) 0)) {
		JsonArray* boundaries = NULL;
		JsonArray* _tmp48_;
		JsonObject* _tmp63_;
		JsonArray* _tmp64_;
		JsonArray* _tmp65_;
		_tmp48_ = json_array_new ();
		boundaries = _tmp48_;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp49_ = FALSE;
				_tmp49_ = TRUE;
				while (TRUE) {
					GArray* _tmp51_;
					JsonObject* boundary = NULL;
					JsonObject* _tmp52_;
					JsonObject* _tmp53_;
					GArray* _tmp54_;
					GArray* _tmp55_;
					gchar* _tmp56_;
					gchar* _tmp57_;
					JsonObject* _tmp58_;
					JsonObject* _tmp59_;
					JsonArray* _tmp60_;
					JsonObject* _tmp61_;
					JsonObject* _tmp62_;
					if (!_tmp49_) {
						gint _tmp50_;
						_tmp50_ = i;
						i = _tmp50_ + 1;
					}
					_tmp49_ = FALSE;
					_tmp51_ = groups;
					if (!(((guint) i) < _tmp51_->len)) {
						break;
					}
					_tmp52_ = json_object_new ();
					boundary = _tmp52_;
					_tmp53_ = boundary;
					_tmp54_ = groups;
					_tmp55_ = groups;
					_tmp56_ = g_strdup_printf ("(%d,%d)", g_array_index (_tmp54_, gint, (guint) i), g_array_index (_tmp55_, gint, (guint) i));
					_tmp57_ = _tmp56_;
					json_object_set_string_member (_tmp53_, "range", _tmp57_);
					_g_free0 (_tmp57_);
					_tmp58_ = boundary;
					json_object_set_string_member (_tmp58_, "title", "");
					_tmp59_ = boundary;
					json_object_set_boolean_member (_tmp59_, "titleUnedited", TRUE);
					_tmp60_ = boundaries;
					_tmp61_ = boundary;
					_tmp62_ = _json_object_ref0 (_tmp61_);
					json_array_add_object_element (_tmp60_, _tmp62_);
					_json_object_unref0 (boundary);
				}
			}
		}
		_tmp63_ = topic;
		_tmp64_ = boundaries;
		_tmp65_ = _json_array_ref0 (_tmp64_);
		json_object_set_array_member (_tmp63_, "boundaries", _tmp65_);
		_json_array_unref0 (boundaries);
	}
	result = topic;
	_g_array_unref0 (groups);
	return result;
}

static JsonObject*
export_xmind2021_export_node_image (ExportXMind2021* self,
                                    MindMap* map,
                                    Node* node,
                                    const gchar* dir,
                                    ExportXMind2021FileItems* file_list)
{
	JsonObject* image = NULL;
	JsonObject* _tmp0_;
	gchar* img_name = NULL;
	ImageManager* _tmp1_;
	ImageManager* _tmp2_;
	NodeImage* _tmp3_;
	NodeImage* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gchar* _tmp7_;
	gchar* mime_type = NULL;
	ImageManager* _tmp8_;
	ImageManager* _tmp9_;
	NodeImage* _tmp10_;
	NodeImage* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gchar* _tmp14_;
	gchar* src = NULL;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar** parts = NULL;
	const gchar* _tmp20_;
	gchar** _tmp21_;
	gchar** _tmp22_;
	gint parts_length1;
	gint _parts_size_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	GFile* lfile = NULL;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	GFile* _tmp28_;
	GFile* _tmp29_;
	GFile* rfile = NULL;
	const gchar* _tmp30_;
	GFile* _tmp31_;
	JsonObject* _tmp34_;
	const gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	GError* _inner_error0_ = NULL;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (map != NULL, NULL);
	g_return_val_if_fail (node != NULL, NULL);
	g_return_val_if_fail (dir != NULL, NULL);
	g_return_val_if_fail (file_list != NULL, NULL);
	_tmp0_ = json_object_new ();
	image = _tmp0_;
	_tmp1_ = mind_map_get_image_manager (map);
	_tmp2_ = _tmp1_;
	_tmp3_ = node_get_image (node);
	_tmp4_ = _tmp3_;
	_tmp5_ = node_image_get_id (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = image_manager_get_file (_tmp2_, _tmp6_);
	img_name = _tmp7_;
	_tmp8_ = mind_map_get_image_manager (map);
	_tmp9_ = _tmp8_;
	_tmp10_ = node_get_image (node);
	_tmp11_ = _tmp10_;
	_tmp12_ = node_image_get_id (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = image_manager_get_mime_type (_tmp9_, _tmp13_);
	mime_type = _tmp14_;
	_tmp15_ = img_name;
	_tmp16_ = g_filename_display_basename (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_build_filename ("resources", _tmp17_, NULL);
	_tmp19_ = _tmp18_;
	_g_free0 (_tmp17_);
	src = _tmp19_;
	_tmp20_ = src;
	_tmp22_ = _tmp21_ = g_strsplit (_tmp20_, ".", 0);
	parts = _tmp22_;
	parts_length1 = _vala_array_length (_tmp21_);
	_parts_size_ = parts_length1;
	_tmp23_ = g_build_filename (dir, "resources", NULL);
	_tmp24_ = _tmp23_;
	g_mkdir (_tmp24_, 0755);
	_g_free0 (_tmp24_);
	_tmp25_ = src;
	_tmp26_ = g_build_filename (dir, _tmp25_, NULL);
	_tmp27_ = _tmp26_;
	_tmp28_ = g_file_new_for_path (_tmp27_);
	_tmp29_ = _tmp28_;
	_g_free0 (_tmp27_);
	lfile = _tmp29_;
	_tmp30_ = img_name;
	_tmp31_ = g_file_new_for_path (_tmp30_);
	rfile = _tmp31_;
	{
		GFile* _tmp32_;
		GFile* _tmp33_;
		_tmp32_ = rfile;
		_tmp33_ = lfile;
		g_file_copy (_tmp32_, _tmp33_, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = NULL;
		_g_object_unref0 (rfile);
		_g_object_unref0 (lfile);
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (src);
		_g_free0 (mime_type);
		_g_free0 (img_name);
		_json_object_unref0 (image);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (rfile);
		_g_object_unref0 (lfile);
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (src);
		_g_free0 (mime_type);
		_g_free0 (img_name);
		_json_object_unref0 (image);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp34_ = image;
	_tmp35_ = src;
	_tmp36_ = g_strdup_printf ("xap:%s", _tmp35_);
	_tmp37_ = _tmp36_;
	json_object_set_string_member (_tmp34_, "src", _tmp37_);
	_g_free0 (_tmp37_);
	export_xmind2021_file_items_add (file_list, "resources", "");
	_tmp38_ = src;
	_tmp39_ = mime_type;
	export_xmind2021_file_items_add (file_list, _tmp38_, _tmp39_);
	result = image;
	_g_object_unref0 (rfile);
	_g_object_unref0 (lfile);
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (src);
	_g_free0 (mime_type);
	_g_free0 (img_name);
	return result;
}

static JsonObject*
export_xmind2021_export_node_note (ExportXMind2021* self,
                                   Node* node)
{
	JsonObject* note = NULL;
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (node != NULL, NULL);
	_tmp0_ = json_object_new ();
	note = _tmp0_;
	_tmp1_ = node_get_note (node);
	_tmp2_ = _tmp1_;
	_tmp3_ = utils_markdown_to_html (_tmp2_, "html");
	_tmp4_ = _tmp3_;
	json_object_set_string_member (note, "realHTML", _tmp4_);
	_g_free0 (_tmp4_);
	_tmp5_ = node_get_note (node);
	_tmp6_ = _tmp5_;
	json_object_set_string_member (note, "plain", _tmp6_);
	result = note;
	return result;
}

static JsonObject*
export_xmind2021_export_node_content_note (ExportXMind2021* self,
                                           const gchar* str)
{
	JsonObject* content = NULL;
	JsonObject* _tmp0_;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (str != NULL, NULL);
	_tmp0_ = json_object_new ();
	content = _tmp0_;
	json_object_set_string_member (content, "content", str);
	result = content;
	return result;
}

static JsonObject*
export_xmind2021_export_theme (ExportXMind2021* self,
                               MindMap* map)
{
	JsonObject* theme = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	JsonObject* _tmp2_;
	JsonObject* _tmp3_;
	JsonObject* _tmp4_;
	JsonObject* _tmp5_;
	JsonObject* _tmp6_;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (map != NULL, NULL);
	_tmp0_ = json_object_new ();
	theme = _tmp0_;
	_tmp1_ = export_xmind2021_export_node_style (self, 0);
	json_object_set_object_member (theme, "centralTopic", _tmp1_);
	_tmp2_ = export_xmind2021_export_node_style (self, 1);
	json_object_set_object_member (theme, "mainTopic", _tmp2_);
	_tmp3_ = export_xmind2021_export_node_style (self, 2);
	json_object_set_object_member (theme, "subTopic", _tmp3_);
	_tmp4_ = export_xmind2021_export_boundary_style (self, map);
	json_object_set_object_member (theme, "boundary", _tmp4_);
	_tmp5_ = export_xmind2021_export_relationship_style (self, map);
	json_object_set_object_member (theme, "relationship", _tmp5_);
	_tmp6_ = export_xmind2021_export_map_style (self, map);
	json_object_set_object_member (theme, "map", _tmp6_);
	result = theme;
	return result;
}

static JsonObject*
export_xmind2021_export_node_style (ExportXMind2021* self,
                                    gint level)
{
	Style* style = NULL;
	Styles* _tmp0_;
	Style* _tmp1_;
	JsonObject* topic = NULL;
	JsonObject* _tmp2_;
	JsonObject* props = NULL;
	JsonObject* _tmp3_;
	JsonObject* _tmp4_;
	JsonObject* _tmp5_;
	JsonObject* _tmp6_;
	Style* _tmp7_;
	NodeBorder* _tmp8_;
	NodeBorder* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GQuark _tmp13_ = 0U;
	static GQuark _tmp12_label0 = 0;
	static GQuark _tmp12_label1 = 0;
	JsonObject* _tmp17_;
	Style* _tmp18_;
	gint* _tmp19_;
	gint* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	JsonObject* _tmp23_;
	Style* _tmp24_;
	gint* _tmp25_;
	gint* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	Style* _tmp29_;
	gboolean* _tmp30_;
	gboolean* _tmp31_;
	Style* _tmp33_;
	LinkType* _tmp34_;
	LinkType* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	GQuark _tmp39_ = 0U;
	static GQuark _tmp38_label0 = 0;
	static GQuark _tmp38_label1 = 0;
	static GQuark _tmp38_label2 = 0;
	static GQuark _tmp38_label3 = 0;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = style_inspector_styles;
	_tmp1_ = styles_get_style_for_level (_tmp0_, (guint) level, NULL);
	style = _tmp1_;
	_tmp2_ = json_object_new ();
	topic = _tmp2_;
	_tmp3_ = json_object_new ();
	props = _tmp3_;
	_tmp4_ = topic;
	_tmp5_ = props;
	_tmp6_ = _json_object_ref0 (_tmp5_);
	json_object_set_object_member (_tmp4_, "properties", _tmp6_);
	_tmp7_ = style;
	_tmp8_ = style_get_node_border (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = node_border_name (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp13_ = (NULL == _tmp11_) ? 0 : g_quark_from_string (_tmp11_);
	g_free (_tmp11_);
	if (_tmp13_ == ((0 != _tmp12_label0) ? _tmp12_label0 : (_tmp12_label0 = g_quark_from_static_string ("rounded")))) {
		switch (0) {
			default:
			{
				JsonObject* _tmp14_;
				_tmp14_ = props;
				json_object_set_string_member (_tmp14_, "shape-class", "org.xmind.topicShape.roundedRect");
				break;
			}
		}
	} else if (_tmp13_ == ((0 != _tmp12_label1) ? _tmp12_label1 : (_tmp12_label1 = g_quark_from_static_string ("underlined")))) {
		switch (0) {
			default:
			{
				JsonObject* _tmp15_;
				_tmp15_ = props;
				json_object_set_string_member (_tmp15_, "shape-class", "org.xmind.topicShape.underline");
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				JsonObject* _tmp16_;
				_tmp16_ = props;
				json_object_set_string_member (_tmp16_, "shape-class", "org.xmind.topicShape.rect");
				break;
			}
		}
	}
	_tmp17_ = props;
	_tmp18_ = style;
	_tmp19_ = style_get_node_borderwidth (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = g_strdup_printf ("%dpt", *_tmp20_);
	_tmp22_ = _tmp21_;
	json_object_set_string_member (_tmp17_, "border-line-width", _tmp22_);
	_g_free0 (_tmp22_);
	_tmp23_ = props;
	_tmp24_ = style;
	_tmp25_ = style_get_link_width (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = g_strdup_printf ("%dpt", *_tmp26_);
	_tmp28_ = _tmp27_;
	json_object_set_string_member (_tmp23_, "line-width", _tmp28_);
	_g_free0 (_tmp28_);
	_tmp29_ = style;
	_tmp30_ = style_get_node_fill (_tmp29_);
	_tmp31_ = _tmp30_;
	if (*_tmp31_) {
		JsonObject* _tmp32_;
		_tmp32_ = props;
		json_object_set_string_member (_tmp32_, "svg:fill", "#888888");
	}
	_tmp33_ = style;
	_tmp34_ = style_get_link_type (_tmp33_);
	_tmp35_ = _tmp34_;
	_tmp36_ = link_type_name (_tmp35_);
	_tmp37_ = _tmp36_;
	_tmp39_ = (NULL == _tmp37_) ? 0 : g_quark_from_string (_tmp37_);
	g_free (_tmp37_);
	if (_tmp39_ == ((0 != _tmp38_label0) ? _tmp38_label0 : (_tmp38_label0 = g_quark_from_static_string ("curved")))) {
		switch (0) {
			default:
			{
				const gchar* _tmp40_ = NULL;
				Style* _tmp41_;
				gboolean* _tmp42_;
				gboolean* _tmp43_;
				JsonObject* _tmp44_;
				gchar* _tmp45_;
				gchar* _tmp46_;
				_tmp41_ = style;
				_tmp42_ = style_get_link_arrow (_tmp41_);
				_tmp43_ = _tmp42_;
				if (*_tmp43_) {
					_tmp40_ = "arrowedCurve";
				} else {
					_tmp40_ = "curve";
				}
				_tmp44_ = props;
				_tmp45_ = g_strdup_printf ("org.xmind.branchConnection.%s", _tmp40_);
				_tmp46_ = _tmp45_;
				json_object_set_string_member (_tmp44_, "line-class", _tmp46_);
				_g_free0 (_tmp46_);
				break;
			}
		}
	} else if (_tmp39_ == ((0 != _tmp38_label1) ? _tmp38_label1 : (_tmp38_label1 = g_quark_from_static_string ("straight")))) {
		switch (0) {
			default:
			{
				JsonObject* _tmp47_;
				_tmp47_ = props;
				json_object_set_string_member (_tmp47_, "line-class", "org.xmind.branchConnection.straight");
				break;
			}
		}
	} else if (_tmp39_ == ((0 != _tmp38_label2) ? _tmp38_label2 : (_tmp38_label2 = g_quark_from_static_string ("squared")))) {
		switch (0) {
			default:
			{
				JsonObject* _tmp48_;
				_tmp48_ = props;
				json_object_set_string_member (_tmp48_, "line-class", "org.xmind.branchConnection.elbow");
				break;
			}
		}
	} else if (_tmp39_ == ((0 != _tmp38_label3) ? _tmp38_label3 : (_tmp38_label3 = g_quark_from_static_string ("rounded")))) {
		switch (0) {
			default:
			{
				JsonObject* _tmp49_;
				_tmp49_ = props;
				json_object_set_string_member (_tmp49_, "line-class", "org.xmind.branchConnection.roundedElbow");
				break;
			}
		}
	}
	result = topic;
	_json_object_unref0 (props);
	_style_unref0 (style);
	return result;
}

static JsonObject*
export_xmind2021_export_boundary_style (ExportXMind2021* self,
                                        MindMap* map)
{
	Theme* theme = NULL;
	Theme* _tmp0_;
	JsonObject* node = NULL;
	JsonObject* _tmp1_;
	JsonObject* props = NULL;
	JsonObject* _tmp2_;
	JsonObject* _tmp3_;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (map != NULL, NULL);
	_tmp0_ = mind_map_get_theme (map);
	theme = _tmp0_;
	_tmp1_ = json_object_new ();
	node = _tmp1_;
	_tmp2_ = json_object_new ();
	props = _tmp2_;
	_tmp3_ = _json_object_ref0 (props);
	json_object_set_object_member (node, "properties", _tmp3_);
	json_object_set_string_member (props, "shape-class", "org.xmind.boundaryShape.roundedRect");
	json_object_set_int_member (props, "line-width", (gint64) 2);
	json_object_set_string_member (props, "line-pattern", "dash");
	json_object_set_string_member (props, "svg:fill", "#00897B");
	json_object_set_string_member (props, "line-color", "#00897B");
	json_object_set_string_member (props, "fo:color", "#ffffff");
	result = node;
	_json_object_unref0 (props);
	_g_object_unref0 (theme);
	return result;
}

static gpointer
_style_ref0 (gpointer self)
{
	return self ? style_ref (self) : NULL;
}

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

static JsonObject*
export_xmind2021_export_relationship_style (ExportXMind2021* self,
                                            MindMap* map)
{
	Theme* theme = NULL;
	Theme* _tmp0_;
	Style* style = NULL;
	Style* _tmp1_;
	Style* _tmp2_;
	Style* _tmp3_;
	JsonObject* node = NULL;
	JsonObject* _tmp4_;
	JsonObject* props = NULL;
	JsonObject* _tmp5_;
	JsonObject* _tmp6_;
	JsonObject* _tmp7_;
	JsonObject* _tmp8_;
	JsonObject* _tmp9_;
	JsonObject* _tmp10_;
	Style* _tmp11_;
	gint* _tmp12_;
	gint* _tmp13_;
	JsonObject* _tmp14_;
	JsonObject* _tmp15_;
	Style* _tmp16_;
	LinkDash* _tmp17_;
	LinkDash* _tmp18_;
	const gchar* _tmp19_;
	JsonObject* _tmp22_;
	JsonObject* _tmp23_;
	Style* _tmp24_;
	PangoFontDescription* _tmp25_;
	PangoFontDescription* _tmp26_;
	const gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	JsonObject* _tmp30_;
	Style* _tmp31_;
	PangoFontDescription* _tmp32_;
	PangoFontDescription* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	JsonObject* _tmp36_;
	Theme* _tmp37_;
	GdkRGBA* _tmp38_;
	GdkRGBA* _tmp39_;
	GdkRGBA _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	JsonObject* _tmp43_;
	Theme* _tmp44_;
	GdkRGBA* _tmp45_;
	GdkRGBA* _tmp46_;
	GdkRGBA _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (map != NULL, NULL);
	_tmp0_ = mind_map_get_theme (map);
	theme = _tmp0_;
	_tmp1_ = mind_map_get_global_style (map);
	_tmp2_ = _tmp1_;
	_tmp3_ = _style_ref0 (_tmp2_);
	style = _tmp3_;
	_tmp4_ = json_object_new ();
	node = _tmp4_;
	_tmp5_ = json_object_new ();
	props = _tmp5_;
	_tmp6_ = node;
	_tmp7_ = props;
	_tmp8_ = _json_object_ref0 (_tmp7_);
	json_object_set_object_member (_tmp6_, "properties", _tmp8_);
	_tmp9_ = props;
	json_object_set_string_member (_tmp9_, "shape-class", "org.xmind.relationshipShape.curved");
	_tmp10_ = props;
	_tmp11_ = style;
	_tmp12_ = style_get_connection_line_width (_tmp11_);
	_tmp13_ = _tmp12_;
	json_object_set_int_member (_tmp10_, "line-width", *_tmp13_);
	_tmp14_ = props;
	json_object_set_string_member (_tmp14_, "arrow-begin-class", "org.xmind.arrowShape.none");
	_tmp15_ = props;
	json_object_set_string_member (_tmp15_, "arrow-end-class", "org.xmind.arrowShape.triangle");
	_tmp16_ = style;
	_tmp17_ = style_get_connection_dash (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = _tmp18_->name;
	if (g_strcmp0 (_tmp19_, "solid") == 0) {
		JsonObject* _tmp20_;
		_tmp20_ = props;
		json_object_set_string_member (_tmp20_, "line-pattern", "solid");
	} else {
		JsonObject* _tmp21_;
		_tmp21_ = props;
		json_object_set_string_member (_tmp21_, "line-pattern", "dash");
	}
	_tmp22_ = props;
	json_object_set_string_member (_tmp22_, "fo:text-align", "center");
	_tmp23_ = props;
	_tmp24_ = style;
	_tmp25_ = style_get_connection_font (_tmp24_);
	_tmp26_ = _tmp25_;
	_tmp27_ = pango_font_description_get_family (_tmp26_);
	_tmp28_ = g_strdup_printf ("'%s',sans-serif", _tmp27_);
	_tmp29_ = _tmp28_;
	json_object_set_string_member (_tmp23_, "fo:font-family", _tmp29_);
	_g_free0 (_tmp29_);
	_tmp30_ = props;
	_tmp31_ = style;
	_tmp32_ = style_get_connection_font (_tmp31_);
	_tmp33_ = _tmp32_;
	_tmp34_ = g_strdup_printf ("%dpt", pango_font_description_get_size (_tmp33_));
	_tmp35_ = _tmp34_;
	json_object_set_string_member (_tmp30_, "fo:font-size", _tmp35_);
	_g_free0 (_tmp35_);
	_tmp36_ = props;
	_tmp37_ = theme;
	_tmp38_ = theme_get_color (_tmp37_, "connection_background");
	_tmp39_ = _tmp38_;
	_tmp40_ = *_tmp39_;
	_tmp41_ = utils_color_from_rgba (&_tmp40_);
	_tmp42_ = _tmp41_;
	json_object_set_string_member (_tmp36_, "line-color", _tmp42_);
	_g_free0 (_tmp42_);
	__vala_GdkRGBA_free0 (_tmp39_);
	_tmp43_ = props;
	_tmp44_ = theme;
	_tmp45_ = theme_get_color (_tmp44_, "connection_foreground");
	_tmp46_ = _tmp45_;
	_tmp47_ = *_tmp46_;
	_tmp48_ = utils_color_from_rgba (&_tmp47_);
	_tmp49_ = _tmp48_;
	json_object_set_string_member (_tmp43_, "fo:color", _tmp49_);
	_g_free0 (_tmp49_);
	__vala_GdkRGBA_free0 (_tmp46_);
	result = node;
	_json_object_unref0 (props);
	_style_unref0 (style);
	_g_object_unref0 (theme);
	return result;
}

static JsonObject*
export_xmind2021_export_map_style (ExportXMind2021* self,
                                   MindMap* map)
{
	Theme* theme = NULL;
	Theme* _tmp0_;
	JsonObject* node = NULL;
	JsonObject* _tmp1_;
	JsonObject* props = NULL;
	JsonObject* _tmp2_;
	JsonObject* _tmp3_;
	GdkRGBA* _tmp4_;
	GdkRGBA* _tmp5_;
	GdkRGBA _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (map != NULL, NULL);
	_tmp0_ = mind_map_get_theme (map);
	theme = _tmp0_;
	_tmp1_ = json_object_new ();
	node = _tmp1_;
	_tmp2_ = json_object_new ();
	props = _tmp2_;
	_tmp3_ = _json_object_ref0 (props);
	json_object_set_object_member (node, "properties", _tmp3_);
	json_object_set_string_member (props, "line-tapered", "none");
	_tmp4_ = theme_get_color (theme, "background");
	_tmp5_ = _tmp4_;
	_tmp6_ = *_tmp5_;
	_tmp7_ = utils_color_from_rgba (&_tmp6_);
	_tmp8_ = _tmp7_;
	json_object_set_string_member (props, "svg:fill", _tmp8_);
	_g_free0 (_tmp8_);
	__vala_GdkRGBA_free0 (_tmp5_);
	json_object_set_string_member (props, "multi-line-colors", "");
	result = node;
	_json_object_unref0 (props);
	_g_object_unref0 (theme);
	return result;
}

static JsonArray*
export_xmind2021_export_extensions (ExportXMind2021* self,
                                    MindMap* map)
{
	Node* root = NULL;
	GArray* _tmp0_;
	GArray* _tmp1_;
	Node* _tmp2_;
	Node* _tmp3_;
	Node* _tmp4_;
	Layout* layout = NULL;
	Node* _tmp5_;
	Layout* _tmp6_;
	Layout* _tmp7_;
	Layout* _tmp8_;
	JsonArray* exts = NULL;
	JsonArray* _tmp9_;
	JsonObject* node = NULL;
	JsonObject* _tmp10_;
	JsonObject* content = NULL;
	JsonObject* _tmp11_;
	gchar* side = NULL;
	gchar* _tmp12_;
	JsonArray* _tmp13_;
	JsonObject* _tmp14_;
	JsonObject* _tmp15_;
	JsonObject* _tmp16_;
	JsonObject* _tmp17_;
	JsonObject* _tmp18_;
	JsonObject* _tmp19_;
	const gchar* _tmp20_ = NULL;
	Layout* _tmp21_;
	gboolean _tmp22_;
	gboolean _tmp23_;
	JsonObject* _tmp24_;
	Node* _tmp25_;
	GArray* _tmp26_;
	GArray* _tmp27_;
	gboolean _tmp28_;
	JsonObject* _tmp36_;
	const gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	JsonArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (map != NULL, NULL);
	_tmp0_ = mind_map_get_nodes (map);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_array_index (_tmp1_, Node*, (guint) 0);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = _tmp3_;
	_g_array_unref0 (_tmp1_);
	root = _tmp4_;
	_tmp5_ = root;
	_tmp6_ = node_get_layout (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	layout = _tmp8_;
	_tmp9_ = json_array_new ();
	exts = _tmp9_;
	_tmp10_ = json_object_new ();
	node = _tmp10_;
	_tmp11_ = json_object_new ();
	content = _tmp11_;
	_tmp12_ = g_strdup ("right");
	side = _tmp12_;
	_tmp13_ = exts;
	_tmp14_ = node;
	_tmp15_ = _json_object_ref0 (_tmp14_);
	json_array_add_object_element (_tmp13_, _tmp15_);
	_tmp16_ = node;
	json_object_set_string_member (_tmp16_, "provider", "org.xmind.ui.skeleton.structure.style");
	_tmp17_ = node;
	_tmp18_ = content;
	_tmp19_ = _json_object_ref0 (_tmp18_);
	json_object_set_object_member (_tmp17_, "content", _tmp19_);
	_tmp21_ = layout;
	_tmp22_ = layout_get_balanceable (_tmp21_);
	_tmp23_ = _tmp22_;
	if (_tmp23_) {
		_tmp20_ = "org.xmind.ui.map.balanced";
	} else {
		_tmp20_ = "org.xmind.ui.map_unbalanced";
	}
	_tmp24_ = content;
	json_object_set_string_member (_tmp24_, "centralTopic", _tmp20_);
	_tmp25_ = root;
	_tmp26_ = node_children (_tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = _tmp27_->len > ((guint) 0);
	_g_array_unref0 (_tmp27_);
	if (_tmp28_) {
		Node* _tmp29_;
		GArray* _tmp30_;
		GArray* _tmp31_;
		Node* _tmp32_;
		NodeSide _tmp33_;
		NodeSide _tmp34_;
		gchar* _tmp35_;
		_tmp29_ = root;
		_tmp30_ = node_children (_tmp29_);
		_tmp31_ = _tmp30_;
		_tmp32_ = g_array_index (_tmp31_, Node*, (guint) 0);
		_tmp33_ = node_get_side (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp35_ = node_side_to_string (_tmp34_);
		_g_free0 (side);
		side = _tmp35_;
		_g_array_unref0 (_tmp31_);
	}
	_tmp36_ = content;
	_tmp37_ = side;
	_tmp38_ = g_strdup_printf ("org.xmind.ui.logic.%s", _tmp37_);
	_tmp39_ = _tmp38_;
	json_object_set_string_member (_tmp36_, "mainTopic", _tmp39_);
	_g_free0 (_tmp39_);
	result = exts;
	_g_free0 (side);
	_json_object_unref0 (content);
	_json_object_unref0 (node);
	_g_object_unref0 (layout);
	_g_object_unref0 (root);
	return result;
}

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

static GdkRGBA*
_vala_GdkRGBA_copy (GdkRGBA* self)
{
	return g_boxed_copy (gdk_rgba_get_type (), self);
}

static gpointer
__vala_GdkRGBA_copy0 (gpointer self)
{
	return self ? _vala_GdkRGBA_copy (self) : NULL;
}

static JsonArray*
export_xmind2021_export_relationships (ExportXMind2021* self,
                                       MindMap* map)
{
	JsonArray* rels = NULL;
	JsonArray* _tmp0_;
	GArray* conns = NULL;
	Connections* _tmp1_;
	Connections* _tmp2_;
	GArray* _tmp3_;
	GArray* _tmp4_;
	GArray* _tmp5_;
	JsonArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (map != NULL, NULL);
	_tmp0_ = json_array_new ();
	rels = _tmp0_;
	_tmp1_ = mind_map_get_connections (map);
	_tmp2_ = _tmp1_;
	_tmp3_ = connections_get_connections (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_array_ref0 (_tmp4_);
	conns = _tmp5_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp6_ = FALSE;
			_tmp6_ = TRUE;
			while (TRUE) {
				GArray* _tmp8_;
				JsonObject* node = NULL;
				JsonObject* _tmp9_;
				Connection* conn = NULL;
				GArray* _tmp10_;
				Connection* _tmp11_;
				Connection* _tmp12_;
				gint conn_id = 0;
				gint _tmp13_;
				GdkRGBA* _tmp14_ = NULL;
				Connection* _tmp15_;
				GdkRGBA* _tmp16_;
				GdkRGBA* _tmp17_;
				GdkRGBA* color = NULL;
				GdkRGBA* _tmp25_;
				gchar* dash = NULL;
				gchar* _tmp26_;
				JsonObject* _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				JsonObject* _tmp30_;
				Connection* _tmp31_;
				Node* _tmp32_;
				Node* _tmp33_;
				gchar* _tmp34_;
				gchar* _tmp35_;
				JsonObject* _tmp36_;
				Connection* _tmp37_;
				Node* _tmp38_;
				Node* _tmp39_;
				gchar* _tmp40_;
				gchar* _tmp41_;
				Connection* _tmp42_;
				CanvasText* _tmp43_;
				CanvasText* _tmp44_;
				JsonArray* _tmp53_;
				JsonObject* _tmp54_;
				JsonObject* _tmp55_;
				if (!_tmp6_) {
					gint _tmp7_;
					_tmp7_ = i;
					i = _tmp7_ + 1;
				}
				_tmp6_ = FALSE;
				_tmp8_ = conns;
				if (!(((guint) i) < _tmp8_->len)) {
					break;
				}
				_tmp9_ = json_object_new ();
				node = _tmp9_;
				_tmp10_ = conns;
				_tmp11_ = g_array_index (_tmp10_, Connection*, (guint) i);
				_tmp12_ = _g_object_ref0 (_tmp11_);
				conn = _tmp12_;
				_tmp13_ = self->priv->ids;
				self->priv->ids = _tmp13_ + 1;
				conn_id = _tmp13_;
				_tmp15_ = conn;
				_tmp16_ = connection_get_color (_tmp15_);
				_tmp17_ = _tmp16_;
				if (_tmp17_ == NULL) {
					Theme* _tmp18_;
					Theme* _tmp19_;
					GdkRGBA* _tmp20_;
					_tmp18_ = mind_map_get_theme (map);
					_tmp19_ = _tmp18_;
					_tmp20_ = theme_get_color (_tmp19_, "connection_background");
					__vala_GdkRGBA_free0 (_tmp14_);
					_tmp14_ = _tmp20_;
					_g_object_unref0 (_tmp19_);
				} else {
					Connection* _tmp21_;
					GdkRGBA* _tmp22_;
					GdkRGBA* _tmp23_;
					GdkRGBA* _tmp24_;
					_tmp21_ = conn;
					_tmp22_ = connection_get_color (_tmp21_);
					_tmp23_ = _tmp22_;
					_tmp24_ = __vala_GdkRGBA_copy0 (_tmp23_);
					__vala_GdkRGBA_free0 (_tmp14_);
					_tmp14_ = _tmp24_;
				}
				_tmp25_ = _tmp14_;
				_tmp14_ = NULL;
				color = _tmp25_;
				_tmp26_ = g_strdup ("dash");
				dash = _tmp26_;
				_tmp27_ = node;
				_tmp28_ = g_strdup_printf ("%i", conn_id);
				_tmp29_ = _tmp28_;
				json_object_set_string_member (_tmp27_, "id", _tmp29_);
				_g_free0 (_tmp29_);
				_tmp30_ = node;
				_tmp31_ = conn;
				_tmp32_ = connection_get_from_node (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = g_strdup_printf ("%i", node_id (_tmp33_));
				_tmp35_ = _tmp34_;
				json_object_set_string_member (_tmp30_, "end1", _tmp35_);
				_g_free0 (_tmp35_);
				_tmp36_ = node;
				_tmp37_ = conn;
				_tmp38_ = connection_get_to_node (_tmp37_);
				_tmp39_ = _tmp38_;
				_tmp40_ = g_strdup_printf ("%i", node_id (_tmp39_));
				_tmp41_ = _tmp40_;
				json_object_set_string_member (_tmp36_, "end2", _tmp41_);
				_g_free0 (_tmp41_);
				_tmp42_ = conn;
				_tmp43_ = connection_get_title (_tmp42_);
				_tmp44_ = _tmp43_;
				if (_tmp44_ != NULL) {
					JsonObject* _tmp45_;
					Connection* _tmp46_;
					CanvasText* _tmp47_;
					CanvasText* _tmp48_;
					FormattedText* _tmp49_;
					FormattedText* _tmp50_;
					const gchar* _tmp51_;
					const gchar* _tmp52_;
					_tmp45_ = node;
					_tmp46_ = conn;
					_tmp47_ = connection_get_title (_tmp46_);
					_tmp48_ = _tmp47_;
					_tmp49_ = canvas_text_get_text (_tmp48_);
					_tmp50_ = _tmp49_;
					_tmp51_ = formatted_text_get_text (_tmp50_);
					_tmp52_ = _tmp51_;
					json_object_set_string_member (_tmp45_, "title", _tmp52_);
				}
				_tmp53_ = rels;
				_tmp54_ = node;
				_tmp55_ = _json_object_ref0 (_tmp54_);
				json_array_add_object_element (_tmp53_, _tmp55_);
				_g_free0 (dash);
				__vala_GdkRGBA_free0 (color);
				__vala_GdkRGBA_free0 (_tmp14_);
				_g_object_unref0 (conn);
				_json_object_unref0 (node);
			}
		}
	}
	result = rels;
	_g_array_unref0 (conns);
	return result;
}

static gboolean
export_xmind2021_export_meta (ExportXMind2021* self,
                              MindMap* map,
                              const gchar* dir,
                              ExportXMind2021FileItems* file_list)
{
	JsonNode* root = NULL;
	JsonNode* _tmp0_;
	JsonObject* top = NULL;
	JsonObject* _tmp1_;
	JsonObject* creator = NULL;
	JsonObject* _tmp2_;
	JsonNode* _tmp3_;
	JsonObject* _tmp4_;
	JsonObject* _tmp5_;
	JsonObject* _tmp6_;
	JsonObject* _tmp7_;
	JsonObject* _tmp8_;
	JsonObject* _tmp9_;
	const gchar* _tmp10_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp11_;
	JsonGenerator* _tmp12_;
	JsonNode* _tmp13_;
	JsonGenerator* _tmp14_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (map != NULL, FALSE);
	g_return_val_if_fail (dir != NULL, FALSE);
	g_return_val_if_fail (file_list != NULL, FALSE);
	_tmp0_ = json_node_new (JSON_NODE_OBJECT);
	root = _tmp0_;
	_tmp1_ = json_object_new ();
	top = _tmp1_;
	_tmp2_ = json_object_new ();
	creator = _tmp2_;
	_tmp3_ = root;
	_tmp4_ = top;
	json_node_set_object (_tmp3_, _tmp4_);
	_tmp5_ = top;
	_tmp6_ = creator;
	_tmp7_ = _json_object_ref0 (_tmp6_);
	json_object_set_object_member (_tmp5_, "creator", _tmp7_);
	_tmp8_ = creator;
	json_object_set_string_member (_tmp8_, "name", "Minder");
	_tmp9_ = creator;
	_tmp10_ = minder_version;
	json_object_set_string_member (_tmp9_, "version", _tmp10_);
	_tmp11_ = json_generator_new ();
	generator = _tmp11_;
	_tmp12_ = generator;
	_tmp13_ = root;
	json_generator_set_root (_tmp12_, _tmp13_);
	_tmp14_ = generator;
	json_generator_set_pretty (_tmp14_, TRUE);
	{
		JsonGenerator* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		_tmp15_ = generator;
		_tmp16_ = g_build_filename (dir, "metadata.json", NULL);
		_tmp17_ = _tmp16_;
		json_generator_to_file (_tmp15_, _tmp17_, &_inner_error0_);
		_g_free0 (_tmp17_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = FALSE;
		_g_object_unref0 (generator);
		_json_object_unref0 (creator);
		_json_object_unref0 (top);
		__vala_JsonNode_free0 (root);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp18_ = FALSE;
		_g_object_unref0 (generator);
		_json_object_unref0 (creator);
		_json_object_unref0 (top);
		__vala_JsonNode_free0 (root);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp18_;
	}
	export_xmind2021_file_items_add (file_list, "metadata.json", "text/json");
	result = TRUE;
	_g_object_unref0 (generator);
	_json_object_unref0 (creator);
	_json_object_unref0 (top);
	__vala_JsonNode_free0 (root);
	return result;
}

static void
export_xmind2021_archive_contents (ExportXMind2021* self,
                                   const gchar* dir,
                                   const gchar* outname,
                                   ExportXMind2021FileItems* files)
{
	GFile* pwd = NULL;
	GFile* _tmp0_;
	struct archive* archive = NULL;
	struct archive* _tmp1_;
	struct archive* _tmp2_;
	struct archive* _tmp3_;
	struct archive* _tmp4_;
	struct archive* _tmp52_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (outname != NULL);
	g_return_if_fail (files != NULL);
	_tmp0_ = g_file_new_for_path (dir);
	pwd = _tmp0_;
	_tmp1_ = archive_write_new ();
	archive = _tmp1_;
	_tmp2_ = archive;
	archive_write_add_filter_none (_tmp2_);
	_tmp3_ = archive;
	archive_write_set_format_zip (_tmp3_);
	_tmp4_ = archive;
	archive_write_open_filename (_tmp4_, outname);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				GArray* _tmp7_;
				GArray* _tmp8_;
				ExportXMind2021FileItem* _tmp9_;
				const gchar* _tmp10_;
				GFile* file = NULL;
				GArray* _tmp11_;
				ExportXMind2021FileItem* _tmp12_;
				const gchar* _tmp13_;
				gchar* _tmp14_;
				gchar* _tmp15_;
				GFile* _tmp16_;
				GFile* _tmp17_;
				if (!_tmp5_) {
					gint _tmp6_;
					_tmp6_ = i;
					i = _tmp6_ + 1;
				}
				_tmp5_ = FALSE;
				_tmp7_ = files->items;
				if (!(((guint) i) < _tmp7_->len)) {
					break;
				}
				_tmp8_ = files->items;
				_tmp9_ = g_array_index (_tmp8_, ExportXMind2021FileItem*, (guint) i);
				_tmp10_ = _tmp9_->type;
				if (g_strcmp0 (_tmp10_, "") == 0) {
					continue;
				}
				_tmp11_ = files->items;
				_tmp12_ = g_array_index (_tmp11_, ExportXMind2021FileItem*, (guint) i);
				_tmp13_ = _tmp12_->name;
				_tmp14_ = g_build_filename (dir, _tmp13_, NULL);
				_tmp15_ = _tmp14_;
				_tmp16_ = g_file_new_for_path (_tmp15_);
				_tmp17_ = _tmp16_;
				_g_free0 (_tmp15_);
				file = _tmp17_;
				{
					GFileInfo* file_info = NULL;
					GFile* _tmp18_;
					GFileInfo* _tmp19_;
					GFileInputStream* input_stream = NULL;
					GFile* _tmp20_;
					GFileInputStream* _tmp21_;
					GDataInputStream* data_input_stream = NULL;
					GFileInputStream* _tmp22_;
					GDataInputStream* _tmp23_;
					struct archive_entry* entry = NULL;
					struct archive_entry* _tmp24_;
					struct archive_entry* _tmp25_;
					GFile* _tmp26_;
					GFile* _tmp27_;
					gchar* _tmp28_;
					gchar* _tmp29_;
					struct archive_entry* _tmp30_;
					GFileInfo* _tmp31_;
					struct archive_entry* _tmp32_;
					struct archive_entry* _tmp33_;
					struct archive* _tmp34_;
					struct archive_entry* _tmp35_;
					gsize bytes_read = 0UL;
					guint8* buffer = NULL;
					guint8* _tmp42_;
					gint buffer_length1;
					gint _buffer_size_;
					_tmp18_ = file;
					_tmp19_ = g_file_query_info (_tmp18_, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
					file_info = _tmp19_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
					_tmp20_ = file;
					_tmp21_ = g_file_read (_tmp20_, NULL, &_inner_error0_);
					input_stream = _tmp21_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (file_info);
						goto __catch0_g_error;
					}
					_tmp22_ = input_stream;
					_tmp23_ = g_data_input_stream_new ((GInputStream*) _tmp22_);
					data_input_stream = _tmp23_;
					_tmp24_ = archive_entry_new2 (NULL);
					entry = _tmp24_;
					_tmp25_ = entry;
					_tmp26_ = pwd;
					_tmp27_ = file;
					_tmp28_ = g_file_get_relative_path (_tmp26_, _tmp27_);
					_tmp29_ = _tmp28_;
					archive_entry_set_pathname (_tmp25_, _tmp29_);
					_g_free0 (_tmp29_);
					_tmp30_ = entry;
					_tmp31_ = file_info;
					archive_entry_set_size (_tmp30_, (la_int64_t) g_file_info_get_size (_tmp31_));
					_tmp32_ = entry;
					archive_entry_set_filetype (_tmp32_, AE_IFREG);
					_tmp33_ = entry;
					archive_entry_set_perm (_tmp33_, (__LA_MODE_T) 0644);
					_tmp34_ = archive;
					_tmp35_ = entry;
					if (archive_write_header (_tmp34_, _tmp35_) != ARCHIVE_OK) {
						GFile* _tmp36_;
						gchar* _tmp37_;
						gchar* _tmp38_;
						struct archive* _tmp39_;
						const gchar* _tmp40_;
						struct archive* _tmp41_;
						_tmp36_ = file;
						_tmp37_ = g_file_get_path (_tmp36_);
						_tmp38_ = _tmp37_;
						_tmp39_ = archive;
						_tmp40_ = archive_error_string (_tmp39_);
						_tmp41_ = archive;
						g_critical ("ExportXMind2021.vala:541: Error writing '%s': %s (%d)", _tmp38_, _tmp40_, archive_errno (_tmp41_));
						_g_free0 (_tmp38_);
						_archive_entry_free0 (entry);
						_g_object_unref0 (data_input_stream);
						_g_object_unref0 (input_stream);
						_g_object_unref0 (file_info);
						_g_object_unref0 (file);
						continue;
					}
					_tmp42_ = g_new0 (guint8, 64);
					buffer = _tmp42_;
					buffer_length1 = 64;
					_buffer_size_ = buffer_length1;
					while (TRUE) {
						gboolean _tmp43_ = FALSE;
						GDataInputStream* _tmp44_;
						guint8* _tmp45_;
						gint _tmp45__length1;
						gsize _tmp46_ = 0UL;
						gboolean _tmp47_;
						struct archive* _tmp48_;
						guint8* _tmp49_;
						gint _tmp49__length1;
						_tmp44_ = data_input_stream;
						_tmp45_ = buffer;
						_tmp45__length1 = buffer_length1;
						_tmp47_ = g_input_stream_read_all ((GInputStream*) _tmp44_, _tmp45_, (gsize) _tmp45__length1, &_tmp46_, NULL, &_inner_error0_);
						bytes_read = _tmp46_;
						_tmp43_ = _tmp47_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							buffer = (g_free (buffer), NULL);
							_archive_entry_free0 (entry);
							_g_object_unref0 (data_input_stream);
							_g_object_unref0 (input_stream);
							_g_object_unref0 (file_info);
							goto __catch0_g_error;
						}
						if (!_tmp43_) {
							break;
						}
						if (bytes_read <= ((gsize) 0)) {
							break;
						}
						_tmp48_ = archive;
						_tmp49_ = buffer;
						_tmp49__length1 = buffer_length1;
						archive_write_data (_tmp48_, _tmp49_, (size_t) _tmp49__length1);
					}
					buffer = (g_free (buffer), NULL);
					_archive_entry_free0 (entry);
					_g_object_unref0 (data_input_stream);
					_g_object_unref0 (input_stream);
					_g_object_unref0 (file_info);
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* e = NULL;
					GError* _tmp50_;
					const gchar* _tmp51_;
					e = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp50_ = e;
					_tmp51_ = _tmp50_->message;
					g_critical ("ExportXMind2021.vala:555: %s", _tmp51_);
					_g_error_free0 (e);
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (file);
					_archive_write_free0 (archive);
					_g_object_unref0 (pwd);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return;
				}
				_g_object_unref0 (file);
			}
		}
	}
	_tmp52_ = archive;
	if (archive_write_close (_tmp52_) != ARCHIVE_OK) {
		struct archive* _tmp53_;
		const gchar* _tmp54_;
		struct archive* _tmp55_;
		_tmp53_ = archive;
		_tmp54_ = archive_error_string (_tmp53_);
		_tmp55_ = archive;
		g_error ("ExportXMind2021.vala:560: Error : %s (%d)", _tmp54_, archive_errno (_tmp55_));
	}
	_archive_write_free0 (archive);
	_g_object_unref0 (pwd);
}

static gboolean
export_xmind2021_real_import (Export* base,
                              const gchar* fname,
                              MindMap* map)
{
	ExportXMind2021 * self;
	FILE* _tmp0_;
	gchar* dir = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	FILE* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	FILE* _tmp6_;
	const gchar* _tmp7_;
	gchar* content = NULL;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GeeHashMap* id_map = NULL;
	GeeHashMap* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	GeeHashMap* _tmp14_;
	gboolean result;
	self = (ExportXMind2021*) base;
	g_return_val_if_fail (fname != NULL, FALSE);
	g_return_val_if_fail (map != NULL, FALSE);
	_tmp0_ = stdout;
	fprintf (_tmp0_, "In XMind 2021 import\n");
	_tmp1_ = g_strdup ("minderXXXXXX");
	_tmp2_ = mkdtemp (_tmp1_);
	dir = _tmp2_;
	_tmp3_ = stdout;
	_tmp4_ = dir;
	fprintf (_tmp3_, "In XMind2021 import, dir: %s\n", _tmp4_);
	_tmp5_ = dir;
	export_xmind2021_unarchive_contents (self, fname, _tmp5_);
	_tmp6_ = stdout;
	_tmp7_ = dir;
	fprintf (_tmp6_, "After unarchiving contents, dir: %s\n", _tmp7_);
	_tmp8_ = dir;
	_tmp9_ = g_build_filename (_tmp8_, "content.json", NULL);
	content = _tmp9_;
	_tmp10_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, EXPORT_XMIND2021_TYPE_ID_OBJECT, (GBoxedCopyFunc) export_xmind2021_id_object_ref, (GDestroyNotify) export_xmind2021_id_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	id_map = _tmp10_;
	_tmp11_ = content;
	if (!g_file_test (_tmp11_, G_FILE_TEST_EXISTS)) {
		result = FALSE;
		_g_object_unref0 (id_map);
		_g_free0 (content);
		_g_free0 (dir);
		return result;
	}
	_tmp12_ = content;
	_tmp13_ = dir;
	_tmp14_ = id_map;
	export_xmind2021_import_content (self, map, _tmp12_, _tmp13_, _tmp14_);
	mind_map_queue_draw (map);
	mind_map_auto_save (map);
	result = TRUE;
	_g_object_unref0 (id_map);
	_g_free0 (content);
	_g_free0 (dir);
	return result;
}

static gboolean
export_xmind2021_import_content (ExportXMind2021* self,
                                 MindMap* map,
                                 const gchar* fname,
                                 const gchar* dir,
                                 GeeHashMap* id_map)
{
	JsonParser* parser = NULL;
	JsonParser* _tmp0_;
	JsonParser* _tmp3_;
	JsonNode* _tmp4_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (map != NULL, FALSE);
	g_return_val_if_fail (fname != NULL, FALSE);
	g_return_val_if_fail (dir != NULL, FALSE);
	g_return_val_if_fail (id_map != NULL, FALSE);
	_tmp0_ = json_parser_new ();
	parser = _tmp0_;
	{
		JsonParser* _tmp1_;
		_tmp1_ = parser;
		json_parser_load_from_file (_tmp1_, fname, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		result = FALSE;
		_g_object_unref0 (parser);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp2_ = FALSE;
		_g_object_unref0 (parser);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return _tmp2_;
	}
	_tmp3_ = parser;
	_tmp4_ = json_parser_get_root (_tmp3_);
	export_xmind2021_import_map (self, map, _tmp4_, dir, id_map);
	result = TRUE;
	_g_object_unref0 (parser);
	return result;
}

static gchar*
export_xmind2021_get_json_string (ExportXMind2021* self,
                                  JsonObject* obj,
                                  const gchar* prop)
{
	JsonNode* node = NULL;
	JsonNode* _tmp0_;
	gboolean _tmp1_ = FALSE;
	JsonNode* _tmp2_;
	gchar* _tmp7_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (obj != NULL, NULL);
	g_return_val_if_fail (prop != NULL, NULL);
	_tmp0_ = json_object_get_member (obj, prop);
	node = _tmp0_;
	_tmp2_ = node;
	if (_tmp2_ != NULL) {
		JsonNode* _tmp3_;
		_tmp3_ = node;
		_tmp1_ = json_node_get_node_type (_tmp3_) == JSON_NODE_VALUE;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		JsonNode* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp4_ = node;
		_tmp5_ = json_node_get_string (_tmp4_);
		_tmp6_ = g_strdup (_tmp5_);
		result = _tmp6_;
		return result;
	}
	_tmp7_ = g_strdup ("");
	result = _tmp7_;
	return result;
}

static JsonObject*
export_xmind2021_get_json_object (ExportXMind2021* self,
                                  JsonObject* obj,
                                  const gchar* prop)
{
	JsonNode* node = NULL;
	JsonNode* _tmp0_;
	gboolean _tmp1_ = FALSE;
	JsonNode* _tmp2_;
	JsonObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (obj != NULL, NULL);
	g_return_val_if_fail (prop != NULL, NULL);
	_tmp0_ = json_object_get_member (obj, prop);
	node = _tmp0_;
	_tmp2_ = node;
	if (_tmp2_ != NULL) {
		JsonNode* _tmp3_;
		_tmp3_ = node;
		_tmp1_ = json_node_get_node_type (_tmp3_) == JSON_NODE_OBJECT;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		JsonNode* _tmp4_;
		JsonObject* _tmp5_;
		_tmp4_ = node;
		_tmp5_ = json_node_get_object (_tmp4_);
		result = _tmp5_;
		return result;
	}
	result = NULL;
	return result;
}

static JsonArray*
export_xmind2021_get_json_array (ExportXMind2021* self,
                                 JsonObject* obj,
                                 const gchar* prop)
{
	JsonNode* node = NULL;
	JsonNode* _tmp0_;
	gboolean _tmp1_ = FALSE;
	JsonNode* _tmp2_;
	JsonArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (obj != NULL, NULL);
	g_return_val_if_fail (prop != NULL, NULL);
	_tmp0_ = json_object_get_member (obj, prop);
	node = _tmp0_;
	_tmp2_ = node;
	if (_tmp2_ != NULL) {
		JsonNode* _tmp3_;
		_tmp3_ = node;
		_tmp1_ = json_node_get_node_type (_tmp3_) == JSON_NODE_ARRAY;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		JsonNode* _tmp4_;
		JsonArray* _tmp5_;
		_tmp4_ = node;
		_tmp5_ = json_node_get_array (_tmp4_);
		result = _tmp5_;
		return result;
	}
	result = NULL;
	return result;
}

static void
export_xmind2021_import_map (ExportXMind2021* self,
                             MindMap* map,
                             JsonNode* n,
                             const gchar* dir,
                             GeeHashMap* id_map)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (n != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (id_map != NULL);
	if (json_node_get_node_type (n) == JSON_NODE_ARRAY) {
		JsonArray* _tmp0_;
		GList* _tmp1_;
		_tmp0_ = json_node_get_array (n);
		_tmp1_ = json_array_get_elements (_tmp0_);
		{
			GList* node_collection = NULL;
			GList* node_it = NULL;
			node_collection = _tmp1_;
			for (node_it = node_collection; node_it != NULL; node_it = node_it->next) {
				JsonNode* node = NULL;
				node = (JsonNode*) node_it->data;
				{
					JsonObject* obj = NULL;
					JsonNode* _tmp2_;
					JsonObject* _tmp3_;
					JsonObject* _tmp4_;
					gchar* _tmp5_;
					gchar* _tmp6_;
					gboolean _tmp7_;
					_tmp2_ = node;
					_tmp3_ = json_node_get_object (_tmp2_);
					obj = _tmp3_;
					_tmp4_ = obj;
					_tmp5_ = export_xmind2021_get_json_string (self, _tmp4_, "class");
					_tmp6_ = _tmp5_;
					_tmp7_ = g_strcmp0 (_tmp6_, "sheet") == 0;
					_g_free0 (_tmp6_);
					if (_tmp7_) {
						JsonObject* _tmp8_;
						_tmp8_ = obj;
						export_xmind2021_import_sheet (self, map, _tmp8_, dir, id_map);
					}
				}
			}
			(node_collection == NULL) ? NULL : (node_collection = (g_list_free (node_collection), NULL));
		}
	}
}

static void
export_xmind2021_import_sheet (ExportXMind2021* self,
                               MindMap* map,
                               JsonObject* obj,
                               const gchar* dir,
                               GeeHashMap* id_map)
{
	JsonObject* theme = NULL;
	JsonObject* _tmp0_;
	JsonObject* root = NULL;
	JsonObject* _tmp1_;
	JsonArray* rels = NULL;
	JsonArray* _tmp2_;
	JsonObject* _tmp3_;
	JsonObject* _tmp5_;
	JsonArray* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (obj != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (id_map != NULL);
	_tmp0_ = export_xmind2021_get_json_object (self, obj, "theme");
	theme = _tmp0_;
	_tmp1_ = export_xmind2021_get_json_object (self, obj, "rootTopic");
	root = _tmp1_;
	_tmp2_ = export_xmind2021_get_json_array (self, obj, "relationships");
	rels = _tmp2_;
	_tmp3_ = theme;
	if (_tmp3_ != NULL) {
		JsonObject* _tmp4_;
		_tmp4_ = theme;
		export_xmind2021_import_theme (self, map, _tmp4_, id_map);
	}
	_tmp5_ = root;
	if (_tmp5_ != NULL) {
		JsonObject* _tmp6_;
		_tmp6_ = root;
		export_xmind2021_import_topic (self, map, NULL, _tmp6_, FALSE, dir, id_map);
	}
	_tmp7_ = rels;
	if (_tmp7_ != NULL) {
		JsonArray* _tmp8_;
		_tmp8_ = rels;
		export_xmind2021_import_relationships (self, map, _tmp8_, id_map);
	}
}

static void
export_xmind2021_import_topic (ExportXMind2021* self,
                               MindMap* map,
                               Node* parent,
                               JsonObject* obj,
                               gboolean attached,
                               const gchar* dir,
                               GeeHashMap* id_map)
{
	Node* node = NULL;
	gchar* sclass = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* id = NULL;
	gchar* _tmp22_;
	const gchar* _tmp23_;
	gchar* sid = NULL;
	gchar* _tmp28_;
	const gchar* _tmp29_;
	gchar* title = NULL;
	gchar* _tmp34_;
	const gchar* _tmp35_;
	JsonObject* notes = NULL;
	JsonObject* _tmp42_;
	JsonObject* _tmp43_;
	gchar* href = NULL;
	gchar* _tmp46_;
	const gchar* _tmp47_;
	JsonObject* img = NULL;
	JsonObject* _tmp64_;
	JsonObject* _tmp65_;
	JsonObject* children = NULL;
	JsonObject* _tmp68_;
	JsonObject* _tmp69_;
	JsonArray* bound = NULL;
	JsonArray* _tmp72_;
	JsonArray* _tmp73_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (obj != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (id_map != NULL);
	_tmp0_ = export_xmind2021_get_json_string (self, obj, "structureClass");
	sclass = _tmp0_;
	_tmp1_ = sclass;
	if (g_strcmp0 (_tmp1_, "") != 0) {
		MapModel* _tmp2_;
		MapModel* _tmp3_;
		Node* _tmp4_;
		const gchar* _tmp5_;
		_tmp2_ = mind_map_get_model (map);
		_tmp3_ = _tmp2_;
		_tmp4_ = map_model_create_root_node (_tmp3_, "");
		_g_object_unref0 (node);
		node = _tmp4_;
		_tmp5_ = sclass;
		if (g_strcmp0 (_tmp5_, "org.xmind.ui.map.unbalanced") == 0) {
			Node* _tmp6_;
			Layouts* _tmp7_;
			Layouts* _tmp8_;
			Layout* _tmp9_;
			Layout* _tmp10_;
			_tmp6_ = node;
			_tmp7_ = mind_map_get_layouts (map);
			_tmp8_ = _tmp7_;
			_tmp9_ = layouts_get_layout (_tmp8_, _ ("Horizontal"));
			_tmp10_ = _tmp9_;
			node_set_layout (_tmp6_, _tmp10_);
			_g_object_unref0 (_tmp10_);
		} else {
			Node* _tmp11_;
			Layouts* _tmp12_;
			Layouts* _tmp13_;
			Layout* _tmp14_;
			Layout* _tmp15_;
			_tmp11_ = node;
			_tmp12_ = mind_map_get_layouts (map);
			_tmp13_ = _tmp12_;
			_tmp14_ = layouts_get_layout (_tmp13_, _ ("To right"));
			_tmp15_ = _tmp14_;
			node_set_layout (_tmp11_, _tmp15_);
			_g_object_unref0 (_tmp15_);
		}
	} else {
		if (!attached) {
			MapModel* _tmp16_;
			MapModel* _tmp17_;
			Node* _tmp18_;
			_tmp16_ = mind_map_get_model (map);
			_tmp17_ = _tmp16_;
			_tmp18_ = map_model_create_root_node (_tmp17_, "");
			_g_object_unref0 (node);
			node = _tmp18_;
		} else {
			MapModel* _tmp19_;
			MapModel* _tmp20_;
			Node* _tmp21_;
			_tmp19_ = mind_map_get_model (map);
			_tmp20_ = _tmp19_;
			_tmp21_ = map_model_create_child_node (_tmp20_, parent, "");
			_g_object_unref0 (node);
			node = _tmp21_;
		}
	}
	_tmp22_ = export_xmind2021_get_json_string (self, obj, "id");
	id = _tmp22_;
	_tmp23_ = id;
	if (g_strcmp0 (_tmp23_, "") != 0) {
		const gchar* _tmp24_;
		Node* _tmp25_;
		ExportXMind2021IdObject* _tmp26_;
		ExportXMind2021IdObject* _tmp27_;
		_tmp24_ = id;
		_tmp25_ = node;
		_tmp26_ = export_xmind2021_id_object_new_for_node (_tmp25_);
		_tmp27_ = _tmp26_;
		gee_abstract_map_set ((GeeAbstractMap*) id_map, _tmp24_, _tmp27_);
		_export_xmind2021_id_object_unref0 (_tmp27_);
	}
	_tmp28_ = export_xmind2021_get_json_string (self, obj, "styleId");
	sid = _tmp28_;
	_tmp29_ = sid;
	if (g_strcmp0 (_tmp29_, "") != 0) {
		const gchar* _tmp30_;
		Node* _tmp31_;
		ExportXMind2021IdObject* _tmp32_;
		ExportXMind2021IdObject* _tmp33_;
		_tmp30_ = sid;
		_tmp31_ = node;
		_tmp32_ = export_xmind2021_id_object_new_for_node (_tmp31_);
		_tmp33_ = _tmp32_;
		gee_abstract_map_set ((GeeAbstractMap*) id_map, _tmp30_, _tmp33_);
		_export_xmind2021_id_object_unref0 (_tmp33_);
	}
	_tmp34_ = export_xmind2021_get_json_string (self, obj, "title");
	title = _tmp34_;
	_tmp35_ = title;
	if (g_strcmp0 (_tmp35_, "") != 0) {
		Node* _tmp36_;
		CanvasText* _tmp37_;
		CanvasText* _tmp38_;
		FormattedText* _tmp39_;
		FormattedText* _tmp40_;
		const gchar* _tmp41_;
		_tmp36_ = node;
		_tmp37_ = node_get_name (_tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = canvas_text_get_text (_tmp38_);
		_tmp40_ = _tmp39_;
		_tmp41_ = title;
		formatted_text_insert_text (_tmp40_, 0, _tmp41_);
	}
	_tmp42_ = export_xmind2021_get_json_object (self, obj, "notes");
	notes = _tmp42_;
	_tmp43_ = notes;
	if (_tmp43_ != NULL) {
		Node* _tmp44_;
		JsonObject* _tmp45_;
		_tmp44_ = node;
		_tmp45_ = notes;
		export_xmind2021_import_node_notes (self, _tmp44_, _tmp45_);
	}
	_tmp46_ = export_xmind2021_get_json_string (self, obj, "href");
	href = _tmp46_;
	_tmp47_ = href;
	if (g_strcmp0 (_tmp47_, "") != 0) {
		Node* _tmp48_;
		const gchar* _tmp49_;
		const gchar* _tmp50_;
		Node* _tmp57_;
		Node* _tmp58_;
		const gchar* _tmp59_;
		const gchar* _tmp60_;
		const gchar* _tmp61_;
		gchar* _tmp62_;
		gchar* _tmp63_;
		_tmp48_ = node;
		_tmp49_ = node_get_note (_tmp48_);
		_tmp50_ = _tmp49_;
		if (g_strcmp0 (_tmp50_, "") != 0) {
			Node* _tmp51_;
			Node* _tmp52_;
			const gchar* _tmp53_;
			const gchar* _tmp54_;
			gchar* _tmp55_;
			gchar* _tmp56_;
			_tmp51_ = node;
			_tmp52_ = node;
			_tmp53_ = node_get_note (_tmp52_);
			_tmp54_ = _tmp53_;
			_tmp55_ = g_strconcat (_tmp54_, "\n", NULL);
			_tmp56_ = _tmp55_;
			node_set_note (_tmp52_, _tmp56_);
			_g_free0 (_tmp56_);
		}
		_tmp57_ = node;
		_tmp58_ = node;
		_tmp59_ = node_get_note (_tmp58_);
		_tmp60_ = _tmp59_;
		_tmp61_ = href;
		_tmp62_ = g_strconcat (_tmp60_, _tmp61_, NULL);
		_tmp63_ = _tmp62_;
		node_set_note (_tmp58_, _tmp63_);
		_g_free0 (_tmp63_);
	}
	_tmp64_ = export_xmind2021_get_json_object (self, obj, "image");
	img = _tmp64_;
	_tmp65_ = img;
	if (_tmp65_ != NULL) {
		Node* _tmp66_;
		JsonObject* _tmp67_;
		_tmp66_ = node;
		_tmp67_ = img;
		export_xmind2021_import_image (self, map, _tmp66_, _tmp67_, dir, id_map);
	}
	_tmp68_ = export_xmind2021_get_json_object (self, obj, "children");
	children = _tmp68_;
	_tmp69_ = children;
	if (_tmp69_ != NULL) {
		Node* _tmp70_;
		JsonObject* _tmp71_;
		_tmp70_ = node;
		_tmp71_ = children;
		export_xmind2021_import_children (self, map, _tmp70_, _tmp71_, dir, id_map);
	}
	_tmp72_ = export_xmind2021_get_json_array (self, obj, "boundaries");
	bound = _tmp72_;
	_tmp73_ = bound;
	if (_tmp73_ != NULL) {
		Node* _tmp74_;
		JsonArray* _tmp75_;
		_tmp74_ = node;
		_tmp75_ = bound;
		export_xmind2021_import_boundaries (self, map, _tmp74_, _tmp75_, id_map);
	}
	_g_free0 (href);
	_g_free0 (title);
	_g_free0 (sid);
	_g_free0 (id);
	_g_free0 (sclass);
	_g_object_unref0 (node);
}

static void
export_xmind2021_import_node_notes (ExportXMind2021* self,
                                    Node* node,
                                    JsonObject* obj)
{
	JsonObject* plain = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	g_return_if_fail (obj != NULL);
	_tmp0_ = export_xmind2021_get_json_object (self, obj, "plain");
	plain = _tmp0_;
	_tmp1_ = plain;
	if (_tmp1_ != NULL) {
		JsonObject* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = plain;
		_tmp3_ = export_xmind2021_get_json_string (self, _tmp2_, "content");
		_tmp4_ = _tmp3_;
		node_set_note (node, _tmp4_);
		_g_free0 (_tmp4_);
	}
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static void
export_xmind2021_import_image (ExportXMind2021* self,
                               MindMap* map,
                               Node* node,
                               JsonObject* obj,
                               const gchar* dir,
                               GeeHashMap* id_map)
{
	gint height = 0;
	gint width = 0;
	gchar* sid = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* h = NULL;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* w = NULL;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	gchar* src = NULL;
	gchar* _tmp8_;
	const gchar* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (node != NULL);
	g_return_if_fail (obj != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (id_map != NULL);
	height = 100;
	width = 100;
	_tmp0_ = export_xmind2021_get_json_string (self, obj, "styleId");
	sid = _tmp0_;
	_tmp1_ = sid;
	if (_tmp1_ != NULL) {
	}
	_tmp2_ = export_xmind2021_get_json_string (self, obj, "height");
	h = _tmp2_;
	_tmp3_ = h;
	if (g_strcmp0 (_tmp3_, "") != 0) {
		const gchar* _tmp4_;
		_tmp4_ = h;
		height = atoi (_tmp4_);
	}
	_tmp5_ = export_xmind2021_get_json_string (self, obj, "width");
	w = _tmp5_;
	_tmp6_ = w;
	if (g_strcmp0 (_tmp6_, "") != 0) {
		const gchar* _tmp7_;
		_tmp7_ = w;
		width = atoi (_tmp7_);
	}
	_tmp8_ = export_xmind2021_get_json_string (self, obj, "src");
	src = _tmp8_;
	_tmp9_ = src;
	if (g_strcmp0 (_tmp9_, "") != 0) {
		GFile* img_file = NULL;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		GFile* _tmp15_;
		GFile* _tmp16_;
		ImageManager* _tmp17_;
		ImageManager* _tmp18_;
		ImageManager* _tmp19_;
		ImageManager* _tmp20_;
		GFile* _tmp21_;
		gchar* _tmp22_;
		gchar* _tmp23_;
		NodeImage* _tmp24_;
		NodeImage* _tmp25_;
		_tmp10_ = src;
		_tmp11_ = string_substring (_tmp10_, (glong) 4, (glong) -1);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_build_filename (dir, _tmp12_, NULL);
		_tmp14_ = _tmp13_;
		_tmp15_ = g_file_new_for_path (_tmp14_);
		_tmp16_ = _tmp15_;
		_g_free0 (_tmp14_);
		_g_free0 (_tmp12_);
		img_file = _tmp16_;
		_tmp17_ = mind_map_get_image_manager (map);
		_tmp18_ = _tmp17_;
		_tmp19_ = mind_map_get_image_manager (map);
		_tmp20_ = _tmp19_;
		_tmp21_ = img_file;
		_tmp22_ = g_file_get_uri (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = node_image_new_from_uri (_tmp20_, _tmp23_, width);
		_tmp25_ = _tmp24_;
		node_set_image (node, _tmp18_, _tmp25_);
		_node_image_unref0 (_tmp25_);
		_g_free0 (_tmp23_);
		_g_object_unref0 (img_file);
	}
	_g_free0 (src);
	_g_free0 (w);
	_g_free0 (h);
	_g_free0 (sid);
}

static void
export_xmind2021_import_children (ExportXMind2021* self,
                                  MindMap* map,
                                  Node* node,
                                  JsonObject* obj,
                                  const gchar* dir,
                                  GeeHashMap* id_map)
{
	JsonArray* attached = NULL;
	JsonArray* _tmp0_;
	JsonArray* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (node != NULL);
	g_return_if_fail (obj != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (id_map != NULL);
	_tmp0_ = export_xmind2021_get_json_array (self, obj, "attached");
	attached = _tmp0_;
	_tmp1_ = attached;
	if (_tmp1_ != NULL) {
		JsonArray* _tmp2_;
		GList* _tmp3_;
		_tmp2_ = attached;
		_tmp3_ = json_array_get_elements (_tmp2_);
		{
			GList* n_collection = NULL;
			GList* n_it = NULL;
			n_collection = _tmp3_;
			for (n_it = n_collection; n_it != NULL; n_it = n_it->next) {
				JsonNode* n = NULL;
				n = (JsonNode*) n_it->data;
				{
					JsonObject* o = NULL;
					JsonNode* _tmp4_;
					JsonObject* _tmp5_;
					JsonObject* _tmp6_;
					_tmp4_ = n;
					_tmp5_ = json_node_get_object (_tmp4_);
					o = _tmp5_;
					_tmp6_ = o;
					export_xmind2021_import_topic (self, map, node, _tmp6_, TRUE, dir, id_map);
				}
			}
			(n_collection == NULL) ? NULL : (n_collection = (g_list_free (n_collection), NULL));
		}
	}
}

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

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

static void
export_xmind2021_import_boundaries (ExportXMind2021* self,
                                    MindMap* map,
                                    Node* node,
                                    JsonArray* arr,
                                    GeeHashMap* id_map)
{
	GList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (node != NULL);
	g_return_if_fail (arr != NULL);
	g_return_if_fail (id_map != NULL);
	_tmp0_ = json_array_get_elements (arr);
	{
		GList* n_collection = NULL;
		GList* n_it = NULL;
		n_collection = _tmp0_;
		for (n_it = n_collection; n_it != NULL; n_it = n_it->next) {
			JsonNode* n = NULL;
			n = (JsonNode*) n_it->data;
			{
				JsonObject* obj = NULL;
				JsonNode* _tmp1_;
				JsonObject* _tmp2_;
				gchar* sid = NULL;
				JsonObject* _tmp3_;
				gchar* _tmp4_;
				gchar* r = NULL;
				JsonObject* _tmp5_;
				gchar* _tmp6_;
				const gchar* _tmp7_;
				_tmp1_ = n;
				_tmp2_ = json_node_get_object (_tmp1_);
				obj = _tmp2_;
				_tmp3_ = obj;
				_tmp4_ = export_xmind2021_get_json_string (self, _tmp3_, "styleId");
				sid = _tmp4_;
				_tmp5_ = obj;
				_tmp6_ = export_xmind2021_get_json_string (self, _tmp5_, "range");
				r = _tmp6_;
				_tmp7_ = r;
				if (g_strcmp0 (_tmp7_, "") != 0) {
					gint start = 0;
					gint end = 0;
					const gchar* _tmp8_;
					start = -1;
					end = -1;
					_tmp8_ = r;
					if (sscanf (_tmp8_, "(%d,%d)", &start, &end) == 2) {
						GArray* nodes = NULL;
						GArray* _tmp9_;
						NodeGroup* group = NULL;
						GArray* _tmp20_;
						NodeGroup* _tmp21_;
						NodeGroups* _tmp22_;
						NodeGroups* _tmp23_;
						NodeGroup* _tmp24_;
						const gchar* _tmp25_;
						_tmp9_ = g_array_new (TRUE, TRUE, sizeof (Node*));
						g_array_set_clear_func (_tmp9_, (GDestroyNotify) _vala_Node_free_function_content_of);
						nodes = _tmp9_;
						{
							gint i = 0;
							i = start;
							{
								gboolean _tmp10_ = FALSE;
								_tmp10_ = TRUE;
								while (TRUE) {
									Node* child = NULL;
									GArray* _tmp12_;
									GArray* _tmp13_;
									Node* _tmp14_;
									Node* _tmp15_;
									Node* _tmp16_;
									GArray* _tmp17_;
									Node* _tmp18_;
									Node* _tmp19_;
									if (!_tmp10_) {
										gint _tmp11_;
										_tmp11_ = i;
										i = _tmp11_ + 1;
									}
									_tmp10_ = FALSE;
									if (!(i <= end)) {
										break;
									}
									_tmp12_ = node_children (node);
									_tmp13_ = _tmp12_;
									_tmp14_ = g_array_index (_tmp13_, Node*, (guint) i);
									_tmp15_ = _g_object_ref0 (_tmp14_);
									_tmp16_ = _tmp15_;
									_g_array_unref0 (_tmp13_);
									child = _tmp16_;
									_tmp17_ = nodes;
									_tmp18_ = child;
									_tmp19_ = _g_object_ref0 (_tmp18_);
									g_array_append_val (_tmp17_, _tmp19_);
									_g_object_unref0 (child);
								}
							}
						}
						_tmp20_ = nodes;
						_tmp21_ = node_group_new_array (map, _tmp20_);
						group = _tmp21_;
						_tmp22_ = mind_map_get_groups (map);
						_tmp23_ = _tmp22_;
						_tmp24_ = group;
						node_groups_add_group (_tmp23_, _tmp24_);
						_tmp25_ = sid;
						if (_tmp25_ != NULL) {
							const gchar* _tmp26_;
							NodeGroup* _tmp27_;
							ExportXMind2021IdObject* _tmp28_;
							ExportXMind2021IdObject* _tmp29_;
							_tmp26_ = sid;
							_tmp27_ = group;
							_tmp28_ = export_xmind2021_id_object_new_for_boundary (_tmp27_);
							_tmp29_ = _tmp28_;
							gee_abstract_map_set ((GeeAbstractMap*) id_map, _tmp26_, _tmp29_);
							_export_xmind2021_id_object_unref0 (_tmp29_);
						}
						_g_object_unref0 (group);
						_g_array_unref0 (nodes);
					}
				}
				_g_free0 (r);
				_g_free0 (sid);
			}
		}
		(n_collection == NULL) ? NULL : (n_collection = (g_list_free (n_collection), NULL));
	}
}

static void
export_xmind2021_import_relationships (ExportXMind2021* self,
                                       MindMap* map,
                                       JsonArray* arr,
                                       GeeHashMap* id_map)
{
	GList* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (arr != NULL);
	g_return_if_fail (id_map != NULL);
	_tmp0_ = json_array_get_elements (arr);
	{
		GList* node_collection = NULL;
		GList* node_it = NULL;
		node_collection = _tmp0_;
		for (node_it = node_collection; node_it != NULL; node_it = node_it->next) {
			JsonNode* node = NULL;
			node = (JsonNode*) node_it->data;
			{
				JsonObject* o = NULL;
				JsonNode* _tmp1_;
				JsonObject* _tmp2_;
				Node* from_node = NULL;
				Node* to_node = NULL;
				gchar* sid = NULL;
				JsonObject* _tmp3_;
				gchar* _tmp4_;
				gchar* sp = NULL;
				JsonObject* _tmp5_;
				gchar* _tmp6_;
				gchar* ep = NULL;
				JsonObject* _tmp7_;
				gchar* _tmp8_;
				gchar* title = NULL;
				JsonObject* _tmp9_;
				gchar* _tmp10_;
				const gchar* _tmp11_;
				const gchar* _tmp21_;
				gboolean _tmp31_ = FALSE;
				Node* _tmp32_;
				_tmp1_ = node;
				_tmp2_ = json_node_get_object (_tmp1_);
				o = _tmp2_;
				from_node = NULL;
				to_node = NULL;
				_tmp3_ = o;
				_tmp4_ = export_xmind2021_get_json_string (self, _tmp3_, "styleId");
				sid = _tmp4_;
				_tmp5_ = o;
				_tmp6_ = export_xmind2021_get_json_string (self, _tmp5_, "end1Id");
				sp = _tmp6_;
				_tmp7_ = o;
				_tmp8_ = export_xmind2021_get_json_string (self, _tmp7_, "end2Id");
				ep = _tmp8_;
				_tmp9_ = o;
				_tmp10_ = export_xmind2021_get_json_string (self, _tmp9_, "title");
				title = _tmp10_;
				_tmp11_ = sp;
				if (g_strcmp0 (_tmp11_, "") != 0) {
					ExportXMind2021IdObject* obj = NULL;
					const gchar* _tmp12_;
					gpointer _tmp13_;
					ExportXMind2021IdObject* _tmp14_;
					ExportXMind2021IdObjectType _tmp15_;
					ExportXMind2021IdObjectType _tmp16_;
					_tmp12_ = sp;
					_tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) id_map, _tmp12_);
					obj = (ExportXMind2021IdObject*) _tmp13_;
					_tmp14_ = obj;
					_tmp15_ = export_xmind2021_id_object_get_typ (_tmp14_);
					_tmp16_ = _tmp15_;
					if (_tmp16_ == EXPORT_XMIND2021_ID_OBJECT_TYPE_NODE) {
						ExportXMind2021IdObject* _tmp17_;
						Node* _tmp18_;
						Node* _tmp19_;
						Node* _tmp20_;
						_tmp17_ = obj;
						_tmp18_ = export_xmind2021_id_object_get_node (_tmp17_);
						_tmp19_ = _tmp18_;
						_tmp20_ = _g_object_ref0 (_tmp19_);
						_g_object_unref0 (from_node);
						from_node = _tmp20_;
					}
					_export_xmind2021_id_object_unref0 (obj);
				}
				_tmp21_ = ep;
				if (g_strcmp0 (_tmp21_, "") != 0) {
					ExportXMind2021IdObject* obj = NULL;
					const gchar* _tmp22_;
					gpointer _tmp23_;
					ExportXMind2021IdObject* _tmp24_;
					ExportXMind2021IdObjectType _tmp25_;
					ExportXMind2021IdObjectType _tmp26_;
					_tmp22_ = ep;
					_tmp23_ = gee_abstract_map_get ((GeeAbstractMap*) id_map, _tmp22_);
					obj = (ExportXMind2021IdObject*) _tmp23_;
					_tmp24_ = obj;
					_tmp25_ = export_xmind2021_id_object_get_typ (_tmp24_);
					_tmp26_ = _tmp25_;
					if (_tmp26_ == EXPORT_XMIND2021_ID_OBJECT_TYPE_NODE) {
						ExportXMind2021IdObject* _tmp27_;
						Node* _tmp28_;
						Node* _tmp29_;
						Node* _tmp30_;
						_tmp27_ = obj;
						_tmp28_ = export_xmind2021_id_object_get_node (_tmp27_);
						_tmp29_ = _tmp28_;
						_tmp30_ = _g_object_ref0 (_tmp29_);
						_g_object_unref0 (to_node);
						to_node = _tmp30_;
					}
					_export_xmind2021_id_object_unref0 (obj);
				}
				_tmp32_ = from_node;
				if (_tmp32_ != NULL) {
					Node* _tmp33_;
					_tmp33_ = to_node;
					_tmp31_ = _tmp33_ != NULL;
				} else {
					_tmp31_ = FALSE;
				}
				if (_tmp31_) {
					Connection* conn = NULL;
					Node* _tmp34_;
					Connection* _tmp35_;
					Connection* _tmp36_;
					const gchar* _tmp37_;
					Connection* _tmp38_;
					Node* _tmp39_;
					Connections* _tmp40_;
					Connections* _tmp41_;
					Connection* _tmp42_;
					const gchar* _tmp43_;
					_tmp34_ = from_node;
					_tmp35_ = connection_new (map, _tmp34_);
					conn = _tmp35_;
					_tmp36_ = conn;
					_tmp37_ = title;
					connection_change_title (_tmp36_, map, _tmp37_, FALSE);
					_tmp38_ = conn;
					_tmp39_ = to_node;
					connection_connect_to (_tmp38_, _tmp39_);
					_tmp40_ = mind_map_get_connections (map);
					_tmp41_ = _tmp40_;
					_tmp42_ = conn;
					connections_add_connection (_tmp41_, _tmp42_);
					_tmp43_ = sid;
					if (_tmp43_ != NULL) {
						const gchar* _tmp44_;
						Connection* _tmp45_;
						ExportXMind2021IdObject* _tmp46_;
						ExportXMind2021IdObject* _tmp47_;
						_tmp44_ = sid;
						_tmp45_ = conn;
						_tmp46_ = export_xmind2021_id_object_new_for_connection (_tmp45_);
						_tmp47_ = _tmp46_;
						gee_abstract_map_set ((GeeAbstractMap*) id_map, _tmp44_, _tmp47_);
						_export_xmind2021_id_object_unref0 (_tmp47_);
					}
					_g_object_unref0 (conn);
				}
				_g_free0 (title);
				_g_free0 (ep);
				_g_free0 (sp);
				_g_free0 (sid);
				_g_object_unref0 (to_node);
				_g_object_unref0 (from_node);
			}
		}
		(node_collection == NULL) ? NULL : (node_collection = (g_list_free (node_collection), NULL));
	}
}

static void
export_xmind2021_import_theme (ExportXMind2021* self,
                               MindMap* map,
                               JsonObject* obj,
                               GeeHashMap* id_map)
{
	JsonObject* root = NULL;
	JsonObject* _tmp0_;
	JsonObject* main = NULL;
	JsonObject* _tmp1_;
	JsonObject* sub = NULL;
	JsonObject* _tmp2_;
	JsonObject* boundary = NULL;
	JsonObject* _tmp3_;
	JsonObject* rel = NULL;
	JsonObject* _tmp4_;
	JsonObject* _tmp5_;
	JsonObject* _tmp7_;
	JsonObject* _tmp9_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (obj != NULL);
	g_return_if_fail (id_map != NULL);
	_tmp0_ = export_xmind2021_get_json_object (self, obj, "centralTopic");
	root = _tmp0_;
	_tmp1_ = export_xmind2021_get_json_object (self, obj, "mainTopic");
	main = _tmp1_;
	_tmp2_ = export_xmind2021_get_json_object (self, obj, "subTopic");
	sub = _tmp2_;
	_tmp3_ = export_xmind2021_get_json_object (self, obj, "boundary");
	boundary = _tmp3_;
	_tmp4_ = export_xmind2021_get_json_object (self, obj, "relationship");
	rel = _tmp4_;
	_tmp5_ = root;
	if (_tmp5_ != NULL) {
		JsonObject* _tmp6_;
		_tmp6_ = root;
		export_xmind2021_import_theme_node (self, map, _tmp6_, 0, id_map);
	}
	_tmp7_ = main;
	if (_tmp7_ != NULL) {
		JsonObject* _tmp8_;
		_tmp8_ = main;
		export_xmind2021_import_theme_node (self, map, _tmp8_, 1, id_map);
	}
	_tmp9_ = sub;
	if (_tmp9_ != NULL) {
		JsonObject* _tmp10_;
		_tmp10_ = sub;
		export_xmind2021_import_theme_node (self, map, _tmp10_, 10, id_map);
	}
	_tmp11_ = boundary;
	if (_tmp11_ != NULL) {
	}
	_tmp12_ = rel;
	if (_tmp12_ != NULL) {
	}
}

static void
_style_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (style_unref (var), NULL));
}

static inline void
_g_slist_free__style_unref0_ (GSList* self)
{
	g_slist_free_full (self, (GDestroyNotify) _style_unref0_);
}

static void
export_xmind2021_import_theme_node (ExportXMind2021* self,
                                    MindMap* map,
                                    JsonObject* obj,
                                    gint level,
                                    GeeHashMap* id_map)
{
	JsonObject* props = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (obj != NULL);
	g_return_if_fail (id_map != NULL);
	_tmp0_ = export_xmind2021_get_json_object (self, obj, "properties");
	props = _tmp0_;
	_tmp1_ = props;
	if (_tmp1_ != NULL) {
		GSList* styles = NULL;
		gchar* shape = NULL;
		JsonObject* _tmp8_;
		gchar* _tmp9_;
		gchar* bwidth = NULL;
		JsonObject* _tmp10_;
		gchar* _tmp11_;
		gchar* line = NULL;
		JsonObject* _tmp12_;
		gchar* _tmp13_;
		gchar* lwidth = NULL;
		JsonObject* _tmp14_;
		gchar* _tmp15_;
		gchar* fill = NULL;
		JsonObject* _tmp16_;
		gchar* _tmp17_;
		const gchar* _tmp18_;
		const gchar* _tmp34_;
		const gchar* _tmp40_;
		const gchar* _tmp62_;
		const gchar* _tmp68_;
		styles = NULL;
		if (level == 10) {
			{
				gint i = 0;
				i = 2;
				{
					gboolean _tmp2_ = FALSE;
					_tmp2_ = TRUE;
					while (TRUE) {
						Styles* _tmp4_;
						Style* _tmp5_;
						if (!_tmp2_) {
							gint _tmp3_;
							_tmp3_ = i;
							i = _tmp3_ + 1;
						}
						_tmp2_ = FALSE;
						if (!(i < 10)) {
							break;
						}
						_tmp4_ = style_inspector_styles;
						_tmp5_ = styles_get_style_for_level (_tmp4_, (guint) i, NULL);
						styles = g_slist_append (styles, _tmp5_);
					}
				}
			}
		} else {
			Styles* _tmp6_;
			Style* _tmp7_;
			_tmp6_ = style_inspector_styles;
			_tmp7_ = styles_get_style_for_level (_tmp6_, (guint) level, NULL);
			styles = g_slist_append (styles, _tmp7_);
		}
		_tmp8_ = props;
		_tmp9_ = export_xmind2021_get_json_string (self, _tmp8_, "shape-class");
		shape = _tmp9_;
		_tmp10_ = props;
		_tmp11_ = export_xmind2021_get_json_string (self, _tmp10_, "border-line-width");
		bwidth = _tmp11_;
		_tmp12_ = props;
		_tmp13_ = export_xmind2021_get_json_string (self, _tmp12_, "line-class");
		line = _tmp13_;
		_tmp14_ = props;
		_tmp15_ = export_xmind2021_get_json_string (self, _tmp14_, "line-width");
		lwidth = _tmp15_;
		_tmp16_ = props;
		_tmp17_ = export_xmind2021_get_json_string (self, _tmp16_, "svg:file");
		fill = _tmp17_;
		_tmp18_ = shape;
		if (g_strcmp0 (_tmp18_, "") != 0) {
			gchar* border = NULL;
			gchar* _tmp19_;
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			GQuark _tmp23_ = 0U;
			static GQuark _tmp22_label0 = 0;
			static GQuark _tmp22_label1 = 0;
			static GQuark _tmp22_label2 = 0;
			GSList* _tmp27_;
			_tmp19_ = g_strdup ("squared");
			border = _tmp19_;
			_tmp20_ = shape;
			_tmp21_ = _tmp20_;
			_tmp23_ = (NULL == _tmp21_) ? 0 : g_quark_from_string (_tmp21_);
			if (_tmp23_ == ((0 != _tmp22_label0) ? _tmp22_label0 : (_tmp22_label0 = g_quark_from_static_string ("org.xmind.topicShape.roundedRect")))) {
				switch (0) {
					default:
					{
						gchar* _tmp24_;
						_tmp24_ = g_strdup ("rounded");
						_g_free0 (border);
						border = _tmp24_;
						break;
					}
				}
			} else if (_tmp23_ == ((0 != _tmp22_label1) ? _tmp22_label1 : (_tmp22_label1 = g_quark_from_static_string ("org.xmind.topicShape.rect")))) {
				switch (0) {
					default:
					{
						gchar* _tmp25_;
						_tmp25_ = g_strdup ("squared");
						_g_free0 (border);
						border = _tmp25_;
						break;
					}
				}
			} else if (_tmp23_ == ((0 != _tmp22_label2) ? _tmp22_label2 : (_tmp22_label2 = g_quark_from_static_string ("org.xmind.topicShape.underline")))) {
				switch (0) {
					default:
					{
						gchar* _tmp26_;
						_tmp26_ = g_strdup ("underlined");
						_g_free0 (border);
						border = _tmp26_;
						break;
					}
				}
			}
			_tmp27_ = styles;
			{
				GSList* style_collection = NULL;
				GSList* style_it = NULL;
				style_collection = _tmp27_;
				for (style_it = style_collection; style_it != NULL; style_it = style_it->next) {
					Style* _tmp28_;
					Style* style = NULL;
					_tmp28_ = _style_ref0 ((Style*) style_it->data);
					style = _tmp28_;
					{
						Style* _tmp29_;
						Styles* _tmp30_;
						const gchar* _tmp31_;
						NodeBorder* _tmp32_;
						NodeBorder* _tmp33_;
						_tmp29_ = style;
						_tmp30_ = style_inspector_styles;
						_tmp31_ = border;
						_tmp32_ = styles_get_node_border (_tmp30_, _tmp31_);
						_tmp33_ = _tmp32_;
						style_set_node_border (_tmp29_, _tmp33_);
						_g_object_unref0 (_tmp33_);
						_style_unref0 (style);
					}
				}
			}
			_g_free0 (border);
		}
		_tmp34_ = bwidth;
		if (g_strcmp0 (_tmp34_, "") != 0) {
			gint width = 0;
			const gchar* _tmp35_;
			width = 1;
			_tmp35_ = bwidth;
			if (sscanf (_tmp35_, "%dpt", &width) == 1) {
				GSList* _tmp36_;
				_tmp36_ = styles;
				{
					GSList* style_collection = NULL;
					GSList* style_it = NULL;
					style_collection = _tmp36_;
					for (style_it = style_collection; style_it != NULL; style_it = style_it->next) {
						Style* _tmp37_;
						Style* style = NULL;
						_tmp37_ = _style_ref0 ((Style*) style_it->data);
						style = _tmp37_;
						{
							gint _tmp38_ = 0;
							Style* _tmp39_;
							if (width < 2) {
								_tmp38_ = 2;
							} else {
								_tmp38_ = width;
							}
							_tmp39_ = style;
							style_set_node_borderwidth (_tmp39_, &_tmp38_);
							_style_unref0 (style);
						}
					}
				}
			}
		}
		_tmp40_ = line;
		if (g_strcmp0 (_tmp40_, "") != 0) {
			gchar* type = NULL;
			gchar* _tmp41_;
			const gchar* _tmp42_;
			const gchar* _tmp43_;
			GQuark _tmp45_ = 0U;
			static GQuark _tmp44_label0 = 0;
			static GQuark _tmp44_label1 = 0;
			static GQuark _tmp44_label2 = 0;
			static GQuark _tmp44_label3 = 0;
			static GQuark _tmp44_label4 = 0;
			GSList* _tmp55_;
			_tmp41_ = g_strdup ("straight");
			type = _tmp41_;
			_tmp42_ = line;
			_tmp43_ = _tmp42_;
			_tmp45_ = (NULL == _tmp43_) ? 0 : g_quark_from_string (_tmp43_);
			if (_tmp45_ == ((0 != _tmp44_label0) ? _tmp44_label0 : (_tmp44_label0 = g_quark_from_static_string ("org.xmind.branchConnection.curve")))) {
				switch (0) {
					default:
					{
						gchar* _tmp46_;
						_tmp46_ = g_strdup ("curved");
						_g_free0 (type);
						type = _tmp46_;
						break;
					}
				}
			} else if (_tmp45_ == ((0 != _tmp44_label1) ? _tmp44_label1 : (_tmp44_label1 = g_quark_from_static_string ("org.xmind.branchConnection.straight")))) {
				switch (0) {
					default:
					{
						gchar* _tmp47_;
						_tmp47_ = g_strdup ("straight");
						_g_free0 (type);
						type = _tmp47_;
						break;
					}
				}
			} else if (_tmp45_ == ((0 != _tmp44_label2) ? _tmp44_label2 : (_tmp44_label2 = g_quark_from_static_string ("org.xmind.branchConnection.elbow")))) {
				switch (0) {
					default:
					{
						gchar* _tmp48_;
						_tmp48_ = g_strdup ("squared");
						_g_free0 (type);
						type = _tmp48_;
						break;
					}
				}
			} else if (_tmp45_ == ((0 != _tmp44_label3) ? _tmp44_label3 : (_tmp44_label3 = g_quark_from_static_string ("org.xmind.branchConnection.roundedElbow")))) {
				switch (0) {
					default:
					{
						gchar* _tmp49_;
						_tmp49_ = g_strdup ("rounded");
						_g_free0 (type);
						type = _tmp49_;
						break;
					}
				}
			} else if (_tmp45_ == ((0 != _tmp44_label4) ? _tmp44_label4 : (_tmp44_label4 = g_quark_from_static_string ("org.xmind.branchConnection.arrowedCurve")))) {
				switch (0) {
					default:
					{
						gchar* _tmp50_;
						GSList* _tmp51_;
						_tmp50_ = g_strdup ("curved");
						_g_free0 (type);
						type = _tmp50_;
						_tmp51_ = styles;
						{
							GSList* style_collection = NULL;
							GSList* style_it = NULL;
							style_collection = _tmp51_;
							for (style_it = style_collection; style_it != NULL; style_it = style_it->next) {
								Style* _tmp52_;
								Style* style = NULL;
								_tmp52_ = _style_ref0 ((Style*) style_it->data);
								style = _tmp52_;
								{
									Style* _tmp53_;
									gboolean _tmp54_;
									_tmp53_ = style;
									_tmp54_ = TRUE;
									style_set_link_arrow (_tmp53_, &_tmp54_);
									_style_unref0 (style);
								}
							}
						}
						break;
					}
				}
			}
			_tmp55_ = styles;
			{
				GSList* style_collection = NULL;
				GSList* style_it = NULL;
				style_collection = _tmp55_;
				for (style_it = style_collection; style_it != NULL; style_it = style_it->next) {
					Style* _tmp56_;
					Style* style = NULL;
					_tmp56_ = _style_ref0 ((Style*) style_it->data);
					style = _tmp56_;
					{
						Style* _tmp57_;
						Styles* _tmp58_;
						const gchar* _tmp59_;
						LinkType* _tmp60_;
						LinkType* _tmp61_;
						_tmp57_ = style;
						_tmp58_ = style_inspector_styles;
						_tmp59_ = type;
						_tmp60_ = styles_get_link_type (_tmp58_, _tmp59_);
						_tmp61_ = _tmp60_;
						style_set_link_type (_tmp57_, _tmp61_);
						_g_object_unref0 (_tmp61_);
						_style_unref0 (style);
					}
				}
			}
			_g_free0 (type);
		}
		_tmp62_ = lwidth;
		if (g_strcmp0 (_tmp62_, "") != 0) {
			gint width = 0;
			const gchar* _tmp63_;
			width = 1;
			_tmp63_ = lwidth;
			if (sscanf (_tmp63_, "%dpt", &width) == 1) {
				GSList* _tmp64_;
				_tmp64_ = styles;
				{
					GSList* style_collection = NULL;
					GSList* style_it = NULL;
					style_collection = _tmp64_;
					for (style_it = style_collection; style_it != NULL; style_it = style_it->next) {
						Style* _tmp65_;
						Style* style = NULL;
						_tmp65_ = _style_ref0 ((Style*) style_it->data);
						style = _tmp65_;
						{
							gint _tmp66_ = 0;
							Style* _tmp67_;
							if (width < 2) {
								_tmp66_ = 2;
							} else {
								_tmp66_ = width;
							}
							_tmp67_ = style;
							style_set_link_width (_tmp67_, &_tmp66_);
							_style_unref0 (style);
						}
					}
				}
			}
		}
		_tmp68_ = fill;
		if (g_strcmp0 (_tmp68_, "") != 0) {
			GSList* _tmp69_;
			_tmp69_ = styles;
			{
				GSList* style_collection = NULL;
				GSList* style_it = NULL;
				style_collection = _tmp69_;
				for (style_it = style_collection; style_it != NULL; style_it = style_it->next) {
					Style* _tmp70_;
					Style* style = NULL;
					_tmp70_ = _style_ref0 ((Style*) style_it->data);
					style = _tmp70_;
					{
						Style* _tmp71_;
						gboolean _tmp72_;
						_tmp71_ = style;
						_tmp72_ = TRUE;
						style_set_node_fill (_tmp71_, &_tmp72_);
						_style_unref0 (style);
					}
				}
			}
		}
		_g_free0 (fill);
		_g_free0 (lwidth);
		_g_free0 (line);
		_g_free0 (bwidth);
		_g_free0 (shape);
		(styles == NULL) ? NULL : (styles = (_g_slist_free__style_unref0_ (styles), NULL));
	}
}

static guint8*
_vala_array_dup8 (guint8* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

static void
export_xmind2021_unarchive_contents (ExportXMind2021* self,
                                     const gchar* fname,
                                     const gchar* dir)
{
	struct archive* archive = NULL;
	struct archive* _tmp0_;
	int flags = 0;
	struct archive* extractor = NULL;
	struct archive* _tmp1_;
	struct archive_entry* entry = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (fname != NULL);
	g_return_if_fail (dir != NULL);
	_tmp0_ = archive_read_new ();
	archive = _tmp0_;
	archive_read_support_filter_none (archive);
	archive_read_support_format_zip (archive);
	flags = ARCHIVE_EXTRACT_TIME;
	flags |= ARCHIVE_EXTRACT_PERM;
	flags |= ARCHIVE_EXTRACT_ACL;
	flags |= ARCHIVE_EXTRACT_FFLAGS;
	_tmp1_ = archive_write_disk_new ();
	extractor = _tmp1_;
	archive_write_disk_set_options (extractor, flags);
	archive_write_disk_set_standard_lookup (extractor);
	if (archive_read_open_filename (archive, fname, (gsize) 16384) != ARCHIVE_OK) {
		const gchar* _tmp2_;
		_tmp2_ = archive_error_string (archive);
		g_error ("ExportXMind2021.vala:984: Error: %s (%d)", _tmp2_, archive_errno (archive));
	}
	while (TRUE) {
		struct archive_entry* _tmp3_ = NULL;
		int _tmp4_;
		GFile* file = NULL;
		struct archive_entry* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		GFile* _tmp9_;
		GFile* _tmp10_;
		struct archive_entry* _tmp11_;
		GFile* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		struct archive_entry* _tmp15_;
		guint8* buffer = NULL;
		gint buffer_length1 = 0;
		gint _buffer_size_ = 0;
		la_int64_t offset = {0};
		_tmp4_ = archive_read_next_header (archive, &_tmp3_);
		entry = _tmp3_;
		if (!(_tmp4_ == ARCHIVE_OK)) {
			break;
		}
		_tmp5_ = entry;
		_tmp6_ = archive_entry_pathname (_tmp5_);
		_tmp7_ = g_build_filename (dir, _tmp6_, NULL);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_file_new_for_path (_tmp8_);
		_tmp10_ = _tmp9_;
		_g_free0 (_tmp8_);
		file = _tmp10_;
		_tmp11_ = entry;
		_tmp12_ = file;
		_tmp13_ = g_file_get_path (_tmp12_);
		_tmp14_ = _tmp13_;
		archive_entry_set_pathname (_tmp11_, _tmp14_);
		_g_free0 (_tmp14_);
		_tmp15_ = entry;
		if (archive_write_header (extractor, _tmp15_) != ARCHIVE_OK) {
			_g_object_unref0 (file);
			continue;
		}
		while (TRUE) {
			guint8* _tmp16_ = NULL;
			size_t _tmp17_ = 0;
			la_int64_t _tmp18_ = {0};
			int _tmp19_;
			guint8* _tmp20_;
			gint _tmp20__length1;
			guint8* _tmp21_;
			gint _tmp21__length1;
			_tmp19_ = archive_read_data_block (archive, &_tmp16_, &_tmp17_, &_tmp18_);
			buffer = (g_free (buffer), NULL);
			_tmp20_ = (_tmp16_ != NULL) ? _vala_array_dup8 (_tmp16_, _tmp17_) : _tmp16_;
			_tmp20__length1 = _tmp17_;
			buffer = _tmp20_;
			buffer_length1 = _tmp20__length1;
			_buffer_size_ = buffer_length1;
			offset = _tmp18_;
			if (!(_tmp19_ == ARCHIVE_OK)) {
				break;
			}
			_tmp21_ = buffer;
			_tmp21__length1 = buffer_length1;
			if (archive_write_data_block (extractor, _tmp21_, (size_t) _tmp21__length1, offset) != ((gssize) ARCHIVE_OK)) {
				break;
			}
		}
		buffer = (g_free (buffer), NULL);
		_g_object_unref0 (file);
	}
	if (archive_read_close (archive) != ARCHIVE_OK) {
		const gchar* _tmp22_;
		_tmp22_ = archive_error_string (archive);
		g_error ("ExportXMind2021.vala:1012: Error: %s (%d)", _tmp22_, archive_errno (archive));
	}
	_archive_write_free0 (extractor);
	_archive_read_free0 (archive);
}

static inline gpointer
export_xmind2021_id_object_get_instance_private (ExportXMind2021IdObject* self)
{
	return G_STRUCT_MEMBER_P (self, ExportXMind2021IdObject_private_offset);
}

ExportXMind2021IdObject*
export_xmind2021_id_object_construct_for_node (GType object_type,
                                               Node* n)
{
	ExportXMind2021IdObject* self = NULL;
	g_return_val_if_fail (n != NULL, NULL);
	self = (ExportXMind2021IdObject*) g_type_create_instance (object_type);
	export_xmind2021_id_object_set_typ (self, EXPORT_XMIND2021_ID_OBJECT_TYPE_NODE);
	export_xmind2021_id_object_set_node (self, n);
	return self;
}

ExportXMind2021IdObject*
export_xmind2021_id_object_new_for_node (Node* n)
{
	return export_xmind2021_id_object_construct_for_node (EXPORT_XMIND2021_TYPE_ID_OBJECT, n);
}

ExportXMind2021IdObject*
export_xmind2021_id_object_construct_for_connection (GType object_type,
                                                     Connection* c)
{
	ExportXMind2021IdObject* self = NULL;
	g_return_val_if_fail (c != NULL, NULL);
	self = (ExportXMind2021IdObject*) g_type_create_instance (object_type);
	export_xmind2021_id_object_set_typ (self, EXPORT_XMIND2021_ID_OBJECT_TYPE_CONNECTION);
	export_xmind2021_id_object_set_conn (self, c);
	return self;
}

ExportXMind2021IdObject*
export_xmind2021_id_object_new_for_connection (Connection* c)
{
	return export_xmind2021_id_object_construct_for_connection (EXPORT_XMIND2021_TYPE_ID_OBJECT, c);
}

ExportXMind2021IdObject*
export_xmind2021_id_object_construct_for_boundary (GType object_type,
                                                   NodeGroup* g)
{
	ExportXMind2021IdObject* self = NULL;
	g_return_val_if_fail (g != NULL, NULL);
	self = (ExportXMind2021IdObject*) g_type_create_instance (object_type);
	export_xmind2021_id_object_set_typ (self, EXPORT_XMIND2021_ID_OBJECT_TYPE_BOUNDARY);
	export_xmind2021_id_object_set_group (self, g);
	return self;
}

ExportXMind2021IdObject*
export_xmind2021_id_object_new_for_boundary (NodeGroup* g)
{
	return export_xmind2021_id_object_construct_for_boundary (EXPORT_XMIND2021_TYPE_ID_OBJECT, g);
}

ExportXMind2021IdObject*
export_xmind2021_id_object_construct (GType object_type)
{
	ExportXMind2021IdObject* self = NULL;
	self = (ExportXMind2021IdObject*) g_type_create_instance (object_type);
	return self;
}

ExportXMind2021IdObject*
export_xmind2021_id_object_new (void)
{
	return export_xmind2021_id_object_construct (EXPORT_XMIND2021_TYPE_ID_OBJECT);
}

ExportXMind2021IdObjectType
export_xmind2021_id_object_get_typ (ExportXMind2021IdObject* self)
{
	ExportXMind2021IdObjectType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_typ;
	return result;
}

void
export_xmind2021_id_object_set_typ (ExportXMind2021IdObject* self,
                                    ExportXMind2021IdObjectType value)
{
	g_return_if_fail (self != NULL);
	self->priv->_typ = value;
}

Node*
export_xmind2021_id_object_get_node (ExportXMind2021IdObject* self)
{
	Node* result;
	Node* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_node;
	result = _tmp0_;
	return result;
}

void
export_xmind2021_id_object_set_node (ExportXMind2021IdObject* self,
                                     Node* value)
{
	Node* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_node);
	self->priv->_node = _tmp0_;
}

Connection*
export_xmind2021_id_object_get_conn (ExportXMind2021IdObject* self)
{
	Connection* result;
	Connection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_conn;
	result = _tmp0_;
	return result;
}

void
export_xmind2021_id_object_set_conn (ExportXMind2021IdObject* self,
                                     Connection* value)
{
	Connection* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_conn);
	self->priv->_conn = _tmp0_;
}

NodeGroup*
export_xmind2021_id_object_get_group (ExportXMind2021IdObject* self)
{
	NodeGroup* result;
	NodeGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group;
	result = _tmp0_;
	return result;
}

void
export_xmind2021_id_object_set_group (ExportXMind2021IdObject* self,
                                      NodeGroup* value)
{
	NodeGroup* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_group);
	self->priv->_group = _tmp0_;
}

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

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

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

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

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

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

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

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

void
export_xmind2021_value_set_id_object (GValue* value,
                                      gpointer v_object)
{
	ExportXMind2021IdObject * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND2021_TYPE_ID_OBJECT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND2021_TYPE_ID_OBJECT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		export_xmind2021_id_object_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		export_xmind2021_id_object_unref (old);
	}
}

void
export_xmind2021_value_take_id_object (GValue* value,
                                       gpointer v_object)
{
	ExportXMind2021IdObject * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND2021_TYPE_ID_OBJECT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND2021_TYPE_ID_OBJECT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		export_xmind2021_id_object_unref (old);
	}
}

static void
export_xmind2021_id_object_class_init (ExportXMind2021IdObjectClass * klass,
                                       gpointer klass_data)
{
	export_xmind2021_id_object_parent_class = g_type_class_peek_parent (klass);
	((ExportXMind2021IdObjectClass *) klass)->finalize = export_xmind2021_id_object_finalize;
	g_type_class_adjust_private_offset (klass, &ExportXMind2021IdObject_private_offset);
}

static void
export_xmind2021_id_object_instance_init (ExportXMind2021IdObject * self,
                                          gpointer klass)
{
	self->priv = export_xmind2021_id_object_get_instance_private (self);
	self->priv->_typ = EXPORT_XMIND2021_ID_OBJECT_TYPE_NODE;
	self->priv->_node = NULL;
	self->priv->_conn = NULL;
	self->priv->_group = NULL;
	self->ref_count = 1;
}

static void
export_xmind2021_id_object_finalize (ExportXMind2021IdObject * obj)
{
	ExportXMind2021IdObject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EXPORT_XMIND2021_TYPE_ID_OBJECT, ExportXMind2021IdObject);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->_node);
	_g_object_unref0 (self->priv->_conn);
	_g_object_unref0 (self->priv->_group);
}

static GType
export_xmind2021_id_object_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { export_xmind2021_value_id_object_init, export_xmind2021_value_id_object_free_value, export_xmind2021_value_id_object_copy_value, export_xmind2021_value_id_object_peek_pointer, "p", export_xmind2021_value_id_object_collect_value, "p", export_xmind2021_value_id_object_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ExportXMind2021IdObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) export_xmind2021_id_object_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ExportXMind2021IdObject), 0, (GInstanceInitFunc) export_xmind2021_id_object_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType export_xmind2021_id_object_type_id;
	export_xmind2021_id_object_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ExportXMind2021IdObject", &g_define_type_info, &g_define_type_fundamental_info, 0);
	ExportXMind2021IdObject_private_offset = g_type_add_instance_private (export_xmind2021_id_object_type_id, sizeof (ExportXMind2021IdObjectPrivate));
	return export_xmind2021_id_object_type_id;
}

GType
export_xmind2021_id_object_get_type (void)
{
	static volatile gsize export_xmind2021_id_object_type_id__once = 0;
	if (g_once_init_enter (&export_xmind2021_id_object_type_id__once)) {
		GType export_xmind2021_id_object_type_id;
		export_xmind2021_id_object_type_id = export_xmind2021_id_object_get_type_once ();
		g_once_init_leave (&export_xmind2021_id_object_type_id__once, export_xmind2021_id_object_type_id);
	}
	return export_xmind2021_id_object_type_id__once;
}

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

void
export_xmind2021_id_object_unref (gpointer instance)
{
	ExportXMind2021IdObject * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		EXPORT_XMIND2021_ID_OBJECT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

ExportXMind2021FileItem*
export_xmind2021_file_item_construct (GType object_type,
                                      const gchar* n,
                                      const gchar* t)
{
	ExportXMind2021FileItem* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (n != NULL, NULL);
	g_return_val_if_fail (t != NULL, NULL);
	self = (ExportXMind2021FileItem*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup (n);
	_g_free0 (self->name);
	self->name = _tmp0_;
	_tmp1_ = g_strdup (t);
	_g_free0 (self->type);
	self->type = _tmp1_;
	return self;
}

ExportXMind2021FileItem*
export_xmind2021_file_item_new (const gchar* n,
                                const gchar* t)
{
	return export_xmind2021_file_item_construct (EXPORT_XMIND2021_TYPE_FILE_ITEM, n, t);
}

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

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

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

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

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

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

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

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

void
export_xmind2021_value_set_file_item (GValue* value,
                                      gpointer v_object)
{
	ExportXMind2021FileItem * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND2021_TYPE_FILE_ITEM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND2021_TYPE_FILE_ITEM));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		export_xmind2021_file_item_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		export_xmind2021_file_item_unref (old);
	}
}

void
export_xmind2021_value_take_file_item (GValue* value,
                                       gpointer v_object)
{
	ExportXMind2021FileItem * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND2021_TYPE_FILE_ITEM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND2021_TYPE_FILE_ITEM));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		export_xmind2021_file_item_unref (old);
	}
}

static void
export_xmind2021_file_item_class_init (ExportXMind2021FileItemClass * klass,
                                       gpointer klass_data)
{
	export_xmind2021_file_item_parent_class = g_type_class_peek_parent (klass);
	((ExportXMind2021FileItemClass *) klass)->finalize = export_xmind2021_file_item_finalize;
}

static void
export_xmind2021_file_item_instance_init (ExportXMind2021FileItem * self,
                                          gpointer klass)
{
	self->ref_count = 1;
}

static void
export_xmind2021_file_item_finalize (ExportXMind2021FileItem * obj)
{
	ExportXMind2021FileItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EXPORT_XMIND2021_TYPE_FILE_ITEM, ExportXMind2021FileItem);
	g_signal_handlers_destroy (self);
	_g_free0 (self->name);
	_g_free0 (self->type);
}

static GType
export_xmind2021_file_item_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { export_xmind2021_value_file_item_init, export_xmind2021_value_file_item_free_value, export_xmind2021_value_file_item_copy_value, export_xmind2021_value_file_item_peek_pointer, "p", export_xmind2021_value_file_item_collect_value, "p", export_xmind2021_value_file_item_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ExportXMind2021FileItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) export_xmind2021_file_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ExportXMind2021FileItem), 0, (GInstanceInitFunc) export_xmind2021_file_item_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType export_xmind2021_file_item_type_id;
	export_xmind2021_file_item_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ExportXMind2021FileItem", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return export_xmind2021_file_item_type_id;
}

GType
export_xmind2021_file_item_get_type (void)
{
	static volatile gsize export_xmind2021_file_item_type_id__once = 0;
	if (g_once_init_enter (&export_xmind2021_file_item_type_id__once)) {
		GType export_xmind2021_file_item_type_id;
		export_xmind2021_file_item_type_id = export_xmind2021_file_item_get_type_once ();
		g_once_init_leave (&export_xmind2021_file_item_type_id__once, export_xmind2021_file_item_type_id);
	}
	return export_xmind2021_file_item_type_id__once;
}

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

void
export_xmind2021_file_item_unref (gpointer instance)
{
	ExportXMind2021FileItem * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		EXPORT_XMIND2021_FILE_ITEM_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
_export_xmind2021_file_item_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (export_xmind2021_file_item_unref (var), NULL));
}

static void
_vala_ExportXMind2021FileItem_free_function_content_of (gpointer data)
{
	ExportXMind2021FileItem* self;
	self = *((ExportXMind2021FileItem**) data);
	_export_xmind2021_file_item_unref0_ (self);
}

ExportXMind2021FileItems*
export_xmind2021_file_items_construct (GType object_type)
{
	ExportXMind2021FileItems* self = NULL;
	GArray* _tmp0_;
	self = (ExportXMind2021FileItems*) g_type_create_instance (object_type);
	_tmp0_ = g_array_new (TRUE, TRUE, sizeof (ExportXMind2021FileItem*));
	g_array_set_clear_func (_tmp0_, (GDestroyNotify) _vala_ExportXMind2021FileItem_free_function_content_of);
	_g_array_unref0 (self->items);
	self->items = _tmp0_;
	return self;
}

ExportXMind2021FileItems*
export_xmind2021_file_items_new (void)
{
	return export_xmind2021_file_items_construct (EXPORT_XMIND2021_TYPE_FILE_ITEMS);
}

void
export_xmind2021_file_items_add (ExportXMind2021FileItems* self,
                                 const gchar* name,
                                 const gchar* type)
{
	GArray* _tmp6_;
	ExportXMind2021FileItem* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (type != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GArray* _tmp2_;
				GArray* _tmp3_;
				ExportXMind2021FileItem* _tmp4_;
				const gchar* _tmp5_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->items;
				if (!(((guint) i) < _tmp2_->len)) {
					break;
				}
				_tmp3_ = self->items;
				_tmp4_ = g_array_index (_tmp3_, ExportXMind2021FileItem*, (guint) i);
				_tmp5_ = _tmp4_->name;
				if (g_strcmp0 (_tmp5_, name) == 0) {
					return;
				}
			}
		}
	}
	_tmp6_ = self->items;
	_tmp7_ = export_xmind2021_file_item_new (name, type);
	g_array_append_val (_tmp6_, _tmp7_);
}

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

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

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

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

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

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

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

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

void
export_xmind2021_value_set_file_items (GValue* value,
                                       gpointer v_object)
{
	ExportXMind2021FileItems * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND2021_TYPE_FILE_ITEMS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND2021_TYPE_FILE_ITEMS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		export_xmind2021_file_items_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		export_xmind2021_file_items_unref (old);
	}
}

void
export_xmind2021_value_take_file_items (GValue* value,
                                        gpointer v_object)
{
	ExportXMind2021FileItems * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND2021_TYPE_FILE_ITEMS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND2021_TYPE_FILE_ITEMS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		export_xmind2021_file_items_unref (old);
	}
}

static void
export_xmind2021_file_items_class_init (ExportXMind2021FileItemsClass * klass,
                                        gpointer klass_data)
{
	export_xmind2021_file_items_parent_class = g_type_class_peek_parent (klass);
	((ExportXMind2021FileItemsClass *) klass)->finalize = export_xmind2021_file_items_finalize;
}

static void
export_xmind2021_file_items_instance_init (ExportXMind2021FileItems * self,
                                           gpointer klass)
{
	self->ref_count = 1;
}

static void
export_xmind2021_file_items_finalize (ExportXMind2021FileItems * obj)
{
	ExportXMind2021FileItems * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EXPORT_XMIND2021_TYPE_FILE_ITEMS, ExportXMind2021FileItems);
	g_signal_handlers_destroy (self);
	_g_array_unref0 (self->items);
}

static GType
export_xmind2021_file_items_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { export_xmind2021_value_file_items_init, export_xmind2021_value_file_items_free_value, export_xmind2021_value_file_items_copy_value, export_xmind2021_value_file_items_peek_pointer, "p", export_xmind2021_value_file_items_collect_value, "p", export_xmind2021_value_file_items_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ExportXMind2021FileItemsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) export_xmind2021_file_items_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ExportXMind2021FileItems), 0, (GInstanceInitFunc) export_xmind2021_file_items_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType export_xmind2021_file_items_type_id;
	export_xmind2021_file_items_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ExportXMind2021FileItems", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return export_xmind2021_file_items_type_id;
}

GType
export_xmind2021_file_items_get_type (void)
{
	static volatile gsize export_xmind2021_file_items_type_id__once = 0;
	if (g_once_init_enter (&export_xmind2021_file_items_type_id__once)) {
		GType export_xmind2021_file_items_type_id;
		export_xmind2021_file_items_type_id = export_xmind2021_file_items_get_type_once ();
		g_once_init_leave (&export_xmind2021_file_items_type_id__once, export_xmind2021_file_items_type_id);
	}
	return export_xmind2021_file_items_type_id__once;
}

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

void
export_xmind2021_file_items_unref (gpointer instance)
{
	ExportXMind2021FileItems * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		EXPORT_XMIND2021_FILE_ITEMS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
export_xmind2021_class_init (ExportXMind2021Class * klass,
                             gpointer klass_data)
{
	export_xmind2021_parent_class = g_type_class_peek_parent (klass);
	((ExportClass *) klass)->finalize = export_xmind2021_finalize;
	g_type_class_adjust_private_offset (klass, &ExportXMind2021_private_offset);
	((ExportClass *) klass)->export = (gboolean (*) (Export*, const gchar*, MindMap*)) export_xmind2021_real_export;
	((ExportClass *) klass)->import = (gboolean (*) (Export*, const gchar*, MindMap*)) export_xmind2021_real_import;
}

static void
export_xmind2021_instance_init (ExportXMind2021 * self,
                                gpointer klass)
{
	self->priv = export_xmind2021_get_instance_private (self);
	self->priv->ids = 10000000;
}

static void
export_xmind2021_finalize (Export * obj)
{
	ExportXMind2021 * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_EXPORT_XMIND2021, ExportXMind2021);
	EXPORT_CLASS (export_xmind2021_parent_class)->finalize (obj);
}

static GType
export_xmind2021_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ExportXMind2021Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) export_xmind2021_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ExportXMind2021), 0, (GInstanceInitFunc) export_xmind2021_instance_init, NULL };
	GType export_xmind2021_type_id;
	export_xmind2021_type_id = g_type_register_static (TYPE_EXPORT, "ExportXMind2021", &g_define_type_info, 0);
	ExportXMind2021_private_offset = g_type_add_instance_private (export_xmind2021_type_id, sizeof (ExportXMind2021Private));
	return export_xmind2021_type_id;
}

GType
export_xmind2021_get_type (void)
{
	static volatile gsize export_xmind2021_type_id__once = 0;
	if (g_once_init_enter (&export_xmind2021_type_id__once)) {
		GType export_xmind2021_type_id;
		export_xmind2021_type_id = export_xmind2021_get_type_once ();
		g_once_init_leave (&export_xmind2021_type_id__once, export_xmind2021_type_id);
	}
	return export_xmind2021_type_id__once;
}

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

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

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

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

