/* ExportXMind8.c generated by valac 0.56.19, the Vala compiler
 * generated from ExportXMind8.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 <libxml/parser.h>
#include <float.h>
#include <math.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <cairo-gobject.h>
#include <archive.h>
#include <archive_entry.h>
#include <gee.h>
#include <stdio.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_XMIND8 (export_xmind8_get_type ())
#define EXPORT_XMIND8(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXPORT_XMIND8, ExportXMind8))
#define EXPORT_XMIND8_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXPORT_XMIND8, ExportXMind8Class))
#define IS_EXPORT_XMIND8(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXPORT_XMIND8))
#define IS_EXPORT_XMIND8_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXPORT_XMIND8))
#define EXPORT_XMIND8_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXPORT_XMIND8, ExportXMind8Class))

typedef struct _ExportXMind8 ExportXMind8;
typedef struct _ExportXMind8Class ExportXMind8Class;
typedef struct _ExportXMind8Private ExportXMind8Private;
typedef enum  {
	EXPORT_XMIND8_ID_OBJECT_TYPE_NODE = 0,
	EXPORT_XMIND8_ID_OBJECT_TYPE_CONNECTION,
	EXPORT_XMIND8_ID_OBJECT_TYPE_BOUNDARY
} ExportXMind8IdObjectType;

#define EXPORT_XMIND8_TYPE_ID_OBJECT_TYPE (export_xmind8_id_object_type_get_type ())

#define EXPORT_XMIND8_TYPE_FILE_ITEMS (export_xmind8_file_items_get_type ())
#define EXPORT_XMIND8_FILE_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXPORT_XMIND8_TYPE_FILE_ITEMS, ExportXMind8FileItems))
#define EXPORT_XMIND8_FILE_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXPORT_XMIND8_TYPE_FILE_ITEMS, ExportXMind8FileItemsClass))
#define EXPORT_XMIND8_IS_FILE_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXPORT_XMIND8_TYPE_FILE_ITEMS))
#define EXPORT_XMIND8_IS_FILE_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXPORT_XMIND8_TYPE_FILE_ITEMS))
#define EXPORT_XMIND8_FILE_ITEMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXPORT_XMIND8_TYPE_FILE_ITEMS, ExportXMind8FileItemsClass))

typedef struct _ExportXMind8FileItems ExportXMind8FileItems;
typedef struct _ExportXMind8FileItemsClass ExportXMind8FileItemsClass;
#define _export_xmind8_file_items_unref0(var) ((var == NULL) ? NULL : (var = (export_xmind8_file_items_unref (var), NULL)))
#define _g_array_unref0(var) ((var == NULL) ? NULL : (var = (g_array_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _ExportXMind8FileItemsPrivate ExportXMind8FileItemsPrivate;

#define EXPORT_XMIND8_TYPE_FILE_ITEM (export_xmind8_file_item_get_type ())
#define EXPORT_XMIND8_FILE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXPORT_XMIND8_TYPE_FILE_ITEM, ExportXMind8FileItem))
#define EXPORT_XMIND8_FILE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXPORT_XMIND8_TYPE_FILE_ITEM, ExportXMind8FileItemClass))
#define EXPORT_XMIND8_IS_FILE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXPORT_XMIND8_TYPE_FILE_ITEM))
#define EXPORT_XMIND8_IS_FILE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXPORT_XMIND8_TYPE_FILE_ITEM))
#define EXPORT_XMIND8_FILE_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXPORT_XMIND8_TYPE_FILE_ITEM, ExportXMind8FileItemClass))

typedef struct _ExportXMind8FileItem ExportXMind8FileItem;
typedef struct _ExportXMind8FileItemClass ExportXMind8FileItemClass;
typedef struct _ExportXMind8FileItemPrivate ExportXMind8FileItemPrivate;
#define _export_xmind8_file_item_unref0(var) ((var == NULL) ? NULL : (var = (export_xmind8_file_item_unref (var), NULL)))
#define _xmlFreeDoc0(var) ((var == NULL) ? NULL : (var = (xmlFreeDoc (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_time_zone_unref0(var) ((var == NULL) ? NULL : (var = (g_time_zone_unref (var), NULL)))

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

typedef struct _Node Node;
typedef struct _NodeClass NodeClass;

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

#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_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 _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

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

typedef struct _Theme Theme;
typedef struct _ThemeClass ThemeClass;
#define __vala_GdkRGBA_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkRGBA_free (var), NULL)))

#define TYPE_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 _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_XMIND8_TYPE_ID_OBJECT (export_xmind8_id_object_get_type ())
#define EXPORT_XMIND8_ID_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXPORT_XMIND8_TYPE_ID_OBJECT, ExportXMind8IdObject))
#define EXPORT_XMIND8_ID_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EXPORT_XMIND8_TYPE_ID_OBJECT, ExportXMind8IdObjectClass))
#define EXPORT_XMIND8_IS_ID_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXPORT_XMIND8_TYPE_ID_OBJECT))
#define EXPORT_XMIND8_IS_ID_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EXPORT_XMIND8_TYPE_ID_OBJECT))
#define EXPORT_XMIND8_ID_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EXPORT_XMIND8_TYPE_ID_OBJECT, ExportXMind8IdObjectClass))

typedef struct _ExportXMind8IdObject ExportXMind8IdObject;
typedef struct _ExportXMind8IdObjectClass ExportXMind8IdObjectClass;

#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 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 _export_xmind8_id_object_unref0(var) ((var == NULL) ? NULL : (var = (export_xmind8_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 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 _archive_read_free0(var) ((var == NULL) ? NULL : (var = (archive_read_free (var), NULL)))
typedef struct _ExportXMind8IdObjectPrivate ExportXMind8IdObjectPrivate;
typedef struct _ExportXMind8ParamSpecIdObject ExportXMind8ParamSpecIdObject;
typedef struct _ExportXMind8ParamSpecFileItem ExportXMind8ParamSpecFileItem;
typedef struct _ExportXMind8ParamSpecFileItems ExportXMind8ParamSpecFileItems;

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 _ExportXMind8 {
	Export parent_instance;
	ExportXMind8Private * priv;
};

struct _ExportXMind8Class {
	ExportClass parent_class;
};

struct _ExportXMind8Private {
	gint ids;
};

struct _ExportXMind8FileItems {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ExportXMind8FileItemsPrivate * priv;
	GArray* items;
};

struct _ExportXMind8FileItemsClass {
	GTypeClass parent_class;
	void (*finalize) (ExportXMind8FileItems *self);
};

struct _ExportXMind8FileItem {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ExportXMind8FileItemPrivate * priv;
	gchar* name;
	gchar* type;
};

struct _ExportXMind8FileItemClass {
	GTypeClass parent_class;
	void (*finalize) (ExportXMind8FileItem *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 _ExportXMind8IdObject {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ExportXMind8IdObjectPrivate * priv;
};

struct _ExportXMind8IdObjectClass {
	GTypeClass parent_class;
	void (*finalize) (ExportXMind8IdObject *self);
};

struct _ExportXMind8IdObjectPrivate {
	ExportXMind8IdObjectType _typ;
	Node* _node;
	Connection* _conn;
	NodeGroup* _group;
};

struct _ExportXMind8ParamSpecIdObject {
	GParamSpec parent_instance;
};

struct _ExportXMind8ParamSpecFileItem {
	GParamSpec parent_instance;
};

struct _ExportXMind8ParamSpecFileItems {
	GParamSpec parent_instance;
};

static gint ExportXMind8_private_offset;
static gpointer export_xmind8_parent_class = NULL;
VALA_EXTERN gchar* minder_version;
VALA_EXTERN Styles* style_inspector_styles;
static gint ExportXMind8IdObject_private_offset;
static gpointer export_xmind8_id_object_parent_class = NULL;
static gpointer export_xmind8_file_item_parent_class = NULL;
static gpointer export_xmind8_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_xmind8_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExportXMind8, 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_xmind8_id_object_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ExportXMind8* export_xmind8_new (void);
VALA_EXTERN ExportXMind8* export_xmind8_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_xmind8_real_export (Export* base,
                                    const gchar* fname,
                                    MindMap* map);
VALA_EXTERN gpointer export_xmind8_file_items_ref (gpointer instance);
VALA_EXTERN void export_xmind8_file_items_unref (gpointer instance);
VALA_EXTERN GParamSpec* export_xmind8_param_spec_file_items (const gchar* name,
                                                 const gchar* nick,
                                                 const gchar* blurb,
                                                 GType object_type,
                                                 GParamFlags flags);
VALA_EXTERN void export_xmind8_value_set_file_items (GValue* value,
                                         gpointer v_object);
VALA_EXTERN void export_xmind8_value_take_file_items (GValue* value,
                                          gpointer v_object);
VALA_EXTERN gpointer export_xmind8_value_get_file_items (const GValue* value);
VALA_EXTERN GType export_xmind8_file_items_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExportXMind8FileItems, export_xmind8_file_items_unref)
VALA_EXTERN ExportXMind8FileItems* export_xmind8_file_items_new (void);
VALA_EXTERN ExportXMind8FileItems* export_xmind8_file_items_construct (GType object_type);
static void export_xmind8_export_meta (ExportXMind8* self,
                                MindMap* map,
                                const gchar* dir,
                                ExportXMind8FileItems* file_list);
static gboolean export_xmind8_export_content (ExportXMind8* self,
                                       MindMap* map,
                                       const gchar* dir,
                                       ExportXMind8FileItems* file_list,
                                       GArray* styles);
static void export_xmind8_export_styles (ExportXMind8* self,
                                  const gchar* dir,
                                  ExportXMind8FileItems* file_list,
                                  GArray* nodes);
static gboolean export_xmind8_export_manifest (ExportXMind8* self,
                                        const gchar* dir,
                                        ExportXMind8FileItems* file_list);
static void export_xmind8_archive_contents (ExportXMind8* self,
                                     const gchar* dir,
                                     const gchar* outname,
                                     ExportXMind8FileItems* files);
static xmlNode* export_xmind8_manifest_file_entry (ExportXMind8* self,
                                            const gchar* path,
                                            const gchar* type);
VALA_EXTERN gpointer export_xmind8_file_item_ref (gpointer instance);
VALA_EXTERN void export_xmind8_file_item_unref (gpointer instance);
VALA_EXTERN GParamSpec* export_xmind8_param_spec_file_item (const gchar* name,
                                                const gchar* nick,
                                                const gchar* blurb,
                                                GType object_type,
                                                GParamFlags flags);
VALA_EXTERN void export_xmind8_value_set_file_item (GValue* value,
                                        gpointer v_object);
VALA_EXTERN void export_xmind8_value_take_file_item (GValue* value,
                                         gpointer v_object);
VALA_EXTERN gpointer export_xmind8_value_get_file_item (const GValue* value);
VALA_EXTERN GType export_xmind8_file_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExportXMind8FileItem, export_xmind8_file_item_unref)
VALA_EXTERN void export_xmind8_file_items_add (ExportXMind8FileItems* self,
                                   const gchar* name,
                                   const gchar* type);
static void export_xmind8_export_map (ExportXMind8* self,
                               MindMap* map,
                               xmlNode* sheet,
                               const gchar* timestamp,
                               const gchar* dir,
                               ExportXMind8FileItems* file_list,
                               GArray* styles);
VALA_EXTERN GType node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Node, g_object_unref)
VALA_EXTERN GArray* mind_map_get_nodes (MindMap* 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);
static xmlNode* export_xmind8_export_node (ExportXMind8* self,
                                    MindMap* map,
                                    Node* node,
                                    const gchar* timestamp,
                                    gboolean top,
                                    const gchar* dir,
                                    ExportXMind8FileItems* file_list,
                                    GArray* styles);
VALA_EXTERN gdouble node_get_posx (Node* self);
VALA_EXTERN gdouble node_get_posy (Node* self);
static void export_xmind8_export_connections (ExportXMind8* self,
                                       MindMap* map,
                                       xmlNode* sheet,
                                       const gchar* timestamp,
                                       GArray* styles);
VALA_EXTERN gint node_id (Node* self);
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 xmlNode* export_xmind8_export_node_note (ExportXMind8* self,
                                         Node* node,
                                         GArray* styles);
static void export_xmind8_export_node_style (ExportXMind8* self,
                                      Node* node,
                                      xmlNode* n);
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 void export_xmind8_export_image (ExportXMind8* self,
                                 MindMap* map,
                                 Node* node,
                                 const gchar* dir,
                                 ExportXMind8FileItems* file_list,
                                 xmlNode* topic);
VALA_EXTERN GArray* node_children (Node* self);
VALA_EXTERN gboolean node_get_group (Node* self);
VALA_EXTERN gchar* utils_color_from_rgba (GdkRGBA* rgba);
VALA_EXTERN GdkRGBA* node_get_link_color (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 gint node_image_get_height (NodeImage* self);
VALA_EXTERN gint node_image_get_width (NodeImage* self);
VALA_EXTERN gpointer style_ref (gpointer instance);
VALA_EXTERN void style_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_style (const gchar* name,
                              const gchar* nick,
                              const gchar* blurb,
                              GType object_type,
                              GParamFlags flags);
VALA_EXTERN void value_set_style (GValue* value,
                      gpointer v_object);
VALA_EXTERN void value_take_style (GValue* value,
                       gpointer v_object);
VALA_EXTERN gpointer value_get_style (const GValue* value);
VALA_EXTERN GType style_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Style, style_unref)
VALA_EXTERN Style* node_get_style (Node* self);
VALA_EXTERN 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);
static gchar* export_xmind8_replace_formatting (ExportXMind8* self,
                                         const gchar* str,
                                         GArray* styles);
VALA_EXTERN gchar* utils_markdown_to_html (const gchar* md,
                               const gchar* tag);
VALA_EXTERN GdkRGBA* connection_get_color (Connection* 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 GdkRGBA* theme_get_color (Theme* self,
                          const gchar* name);
static void _vala_GdkRGBA_free (GdkRGBA* self);
static GdkRGBA* _vala_GdkRGBA_copy (GdkRGBA* self);
VALA_EXTERN Style* connection_get_style (Connection* 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 Node* connection_get_from_node (Connection* self);
VALA_EXTERN Node* connection_get_to_node (Connection* self);
VALA_EXTERN CanvasText* connection_get_title (Connection* self);
VALA_EXTERN const gchar* style_get_connection_arrow (Style* self);
VALA_EXTERN gint* style_get_connection_line_width (Style* self);
static gboolean export_xmind8_real_import (Export* base,
                                    const gchar* fname,
                                    MindMap* map);
static void export_xmind8_unarchive_contents (ExportXMind8* self,
                                       const gchar* fname,
                                       const gchar* dir);
VALA_EXTERN gpointer export_xmind8_id_object_ref (gpointer instance);
VALA_EXTERN void export_xmind8_id_object_unref (gpointer instance);
VALA_EXTERN GParamSpec* export_xmind8_param_spec_id_object (const gchar* name,
                                                const gchar* nick,
                                                const gchar* blurb,
                                                GType object_type,
                                                GParamFlags flags);
VALA_EXTERN void export_xmind8_value_set_id_object (GValue* value,
                                        gpointer v_object);
VALA_EXTERN void export_xmind8_value_take_id_object (GValue* value,
                                         gpointer v_object);
VALA_EXTERN gpointer export_xmind8_value_get_id_object (const GValue* value);
VALA_EXTERN GType export_xmind8_id_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExportXMind8IdObject, export_xmind8_id_object_unref)
static gboolean export_xmind8_import_content (ExportXMind8* self,
                                       MindMap* map,
                                       const gchar* fname,
                                       const gchar* dir,
                                       GeeHashMap* id_map);
static gboolean export_xmind8_import_styles (ExportXMind8* self,
                                      MindMap* map,
                                      const gchar* fname,
                                      GeeHashMap* id_map);
VALA_EXTERN void mind_map_queue_draw (MindMap* self);
VALA_EXTERN void mind_map_auto_save (MindMap* self);
static void export_xmind8_import_map (ExportXMind8* self,
                               MindMap* map,
                               xmlNode* n,
                               const gchar* dir,
                               GeeHashMap* id_map);
static void export_xmind8_import_sheet (ExportXMind8* self,
                                 MindMap* map,
                                 xmlNode* n,
                                 const gchar* dir,
                                 GeeHashMap* id_map);
static void export_xmind8_import_topic (ExportXMind8* self,
                                 MindMap* map,
                                 Node* parent,
                                 xmlNode* n,
                                 gboolean attached,
                                 const gchar* dir,
                                 GeeHashMap* id_map);
static void export_xmind8_import_relationships (ExportXMind8* self,
                                         MindMap* map,
                                         xmlNode* n,
                                         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 GType layout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Layout, g_object_unref)
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 ExportXMind8IdObject* export_xmind8_id_object_new_for_node (Node* n);
VALA_EXTERN ExportXMind8IdObject* export_xmind8_id_object_construct_for_node (GType object_type,
                                                                  Node* n);
static void export_xmind8_import_node_name (ExportXMind8* self,
                                     Node* node,
                                     xmlNode* n);
static void export_xmind8_import_node_notes (ExportXMind8* self,
                                      Node* node,
                                      xmlNode* n);
static void export_xmind8_import_image (ExportXMind8* self,
                                 MindMap* map,
                                 Node* node,
                                 xmlNode* n,
                                 const gchar* dir,
                                 GeeHashMap* id_map);
static void export_xmind8_import_children (ExportXMind8* self,
                                    MindMap* map,
                                    Node* node,
                                    xmlNode* n,
                                    const gchar* dir,
                                    GeeHashMap* id_map);
static void export_xmind8_import_boundaries (ExportXMind8* self,
                                      MindMap* map,
                                      Node* node,
                                      xmlNode* n,
                                      GeeHashMap* id_map);
static gchar* export_xmind8_get_title (ExportXMind8* self,
                                xmlNode* n);
VALA_EXTERN void formatted_text_insert_text (FormattedText* self,
                                 gint index,
                                 const gchar* str);
static void export_xmind8_import_note_plain (ExportXMind8* self,
                                      Node* node,
                                      xmlNode* n);
VALA_EXTERN void node_set_note (Node* self,
                    const gchar* value);
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 ExportXMind8IdObject* export_xmind8_id_object_new_for_boundary (NodeGroup* g);
VALA_EXTERN ExportXMind8IdObject* export_xmind8_id_object_construct_for_boundary (GType object_type,
                                                                      NodeGroup* g);
VALA_EXTERN ExportXMind8IdObjectType export_xmind8_id_object_get_typ (ExportXMind8IdObject* self);
VALA_EXTERN Node* export_xmind8_id_object_get_node (ExportXMind8IdObject* 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 ExportXMind8IdObject* export_xmind8_id_object_new_for_connection (Connection* c);
VALA_EXTERN ExportXMind8IdObject* export_xmind8_id_object_construct_for_connection (GType object_type,
                                                                        Connection* c);
static void export_xmind8_import_styles_content (ExportXMind8* self,
                                          MindMap* map,
                                          xmlNode* n,
                                          GeeHashMap* id_map);
static void export_xmind8_import_styles_style (ExportXMind8* self,
                                        MindMap* map,
                                        xmlNode* n,
                                        GeeHashMap* id_map);
static void export_xmind8_import_styles_topic (ExportXMind8* self,
                                        MindMap* map,
                                        xmlNode* n,
                                        Node* node);
static void export_xmind8_import_styles_connection (ExportXMind8* self,
                                             MindMap* map,
                                             xmlNode* n,
                                             Connection* conn);
VALA_EXTERN Connection* export_xmind8_id_object_get_conn (ExportXMind8IdObject* self);
static void export_xmind8_import_styles_boundary (ExportXMind8* self,
                                           MindMap* map,
                                           xmlNode* n,
                                           NodeGroup* group);
VALA_EXTERN NodeGroup* export_xmind8_id_object_get_group (ExportXMind8IdObject* self);
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 NodeBorder* styles_get_node_border (Styles* self,
                                    const gchar* name);
VALA_EXTERN void style_set_node_border (Style* self,
                            NodeBorder* value);
VALA_EXTERN void node_set_link_color (Node* self,
                          GdkRGBA* value);
VALA_EXTERN void style_set_node_borderwidth (Style* self,
                                 gint* value);
VALA_EXTERN void style_set_node_fill (Style* self,
                          gboolean* value);
VALA_EXTERN void style_set_link_width (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_connection_arrow (Style* self,
                                 const gchar* value);
VALA_EXTERN void connection_set_color (Connection* self,
                           GdkRGBA* value);
VALA_EXTERN LinkDash* styles_get_link_dash (Styles* self,
                                const gchar* name);
VALA_EXTERN void style_set_connection_dash (Style* self,
                                LinkDash* value);
VALA_EXTERN void style_set_connection_line_width (Style* self,
                                      gint* value);
VALA_EXTERN void node_group_set_color (NodeGroup* self,
                           GdkRGBA * value);
static guint8* _vala_array_dup7 (guint8* self,
                          gssize length);
VALA_EXTERN void export_xmind8_id_object_set_typ (ExportXMind8IdObject* self,
                                      ExportXMind8IdObjectType value);
VALA_EXTERN void export_xmind8_id_object_set_node (ExportXMind8IdObject* self,
                                       Node* value);
VALA_EXTERN void export_xmind8_id_object_set_conn (ExportXMind8IdObject* self,
                                       Connection* value);
VALA_EXTERN void export_xmind8_id_object_set_group (ExportXMind8IdObject* self,
                                        NodeGroup* value);
VALA_EXTERN ExportXMind8IdObject* export_xmind8_id_object_new (void);
VALA_EXTERN ExportXMind8IdObject* export_xmind8_id_object_construct (GType object_type);
static void export_xmind8_id_object_finalize (ExportXMind8IdObject * obj);
static GType export_xmind8_id_object_get_type_once (void);
VALA_EXTERN ExportXMind8FileItem* export_xmind8_file_item_new (const gchar* n,
                                                   const gchar* t);
VALA_EXTERN ExportXMind8FileItem* export_xmind8_file_item_construct (GType object_type,
                                                         const gchar* n,
                                                         const gchar* t);
static void export_xmind8_file_item_finalize (ExportXMind8FileItem * obj);
static GType export_xmind8_file_item_get_type_once (void);
static void _export_xmind8_file_item_unref0_ (gpointer var);
static void _vala_ExportXMind8FileItem_free_function_content_of (gpointer data);
static void export_xmind8_file_items_finalize (ExportXMind8FileItems * obj);
static GType export_xmind8_file_items_get_type_once (void);
static void export_xmind8_finalize (Export * obj);
static GType export_xmind8_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_xmind8_get_instance_private (ExportXMind8* self)
{
	return G_STRUCT_MEMBER_P (self, ExportXMind8_private_offset);
}

static GType
export_xmind8_id_object_type_get_type_once (void)
{
	static const GEnumValue values[] = {{EXPORT_XMIND8_ID_OBJECT_TYPE_NODE, "EXPORT_XMIND8_ID_OBJECT_TYPE_NODE", "node"}, {EXPORT_XMIND8_ID_OBJECT_TYPE_CONNECTION, "EXPORT_XMIND8_ID_OBJECT_TYPE_CONNECTION", "connection"}, {EXPORT_XMIND8_ID_OBJECT_TYPE_BOUNDARY, "EXPORT_XMIND8_ID_OBJECT_TYPE_BOUNDARY", "boundary"}, {0, NULL, NULL}};
	GType export_xmind8_id_object_type_type_id;
	export_xmind8_id_object_type_type_id = g_enum_register_static ("ExportXMind8IdObjectType", values);
	return export_xmind8_id_object_type_type_id;
}

GType
export_xmind8_id_object_type_get_type (void)
{
	static volatile gsize export_xmind8_id_object_type_type_id__once = 0;
	if (g_once_init_enter (&export_xmind8_id_object_type_type_id__once)) {
		GType export_xmind8_id_object_type_type_id;
		export_xmind8_id_object_type_type_id = export_xmind8_id_object_type_get_type_once ();
		g_once_init_leave (&export_xmind8_id_object_type_type_id__once, export_xmind8_id_object_type_type_id);
	}
	return export_xmind8_id_object_type_type_id__once;
}

ExportXMind8*
export_xmind8_construct (GType object_type)
{
	ExportXMind8* 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 = (ExportXMind8*) export_construct (object_type, "xmind-8", _ ("XMind 8"), _tmp2_, (gint) 1, TRUE, TRUE, FALSE, FALSE);
	_tmp2_ = (_vala_array_free (_tmp2_, _tmp2__length1, (GDestroyNotify) g_free), NULL);
	return self;
}

ExportXMind8*
export_xmind8_new (void)
{
	return export_xmind8_construct (TYPE_EXPORT_XMIND8);
}

static gboolean
export_xmind8_real_export (Export* base,
                           const gchar* fname,
                           MindMap* map)
{
	ExportXMind8 * self;
	gchar* dir = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	GArray* styles = NULL;
	GArray* _tmp2_;
	ExportXMind8FileItems* file_list = NULL;
	ExportXMind8FileItems* _tmp3_;
	const gchar* _tmp4_;
	ExportXMind8FileItems* _tmp5_;
	const gchar* _tmp6_;
	ExportXMind8FileItems* _tmp7_;
	GArray* _tmp8_;
	GArray* _tmp9_;
	const gchar* _tmp13_;
	ExportXMind8FileItems* _tmp14_;
	const gchar* _tmp15_;
	ExportXMind8FileItems* _tmp16_;
	gboolean result;
	self = (ExportXMind8*) 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_ = g_array_new (TRUE, TRUE, sizeof (xmlNode*));
	styles = _tmp2_;
	_tmp3_ = export_xmind8_file_items_new ();
	file_list = _tmp3_;
	_tmp4_ = dir;
	_tmp5_ = file_list;
	export_xmind8_export_meta (self, map, _tmp4_, _tmp5_);
	_tmp6_ = dir;
	_tmp7_ = file_list;
	_tmp8_ = styles;
	export_xmind8_export_content (self, map, _tmp6_, _tmp7_, _tmp8_);
	_tmp9_ = styles;
	if (_tmp9_->len > ((guint) 0)) {
		const gchar* _tmp10_;
		ExportXMind8FileItems* _tmp11_;
		GArray* _tmp12_;
		_tmp10_ = dir;
		_tmp11_ = file_list;
		_tmp12_ = styles;
		export_xmind8_export_styles (self, _tmp10_, _tmp11_, _tmp12_);
	}
	_tmp13_ = dir;
	_tmp14_ = file_list;
	export_xmind8_export_manifest (self, _tmp13_, _tmp14_);
	_tmp15_ = dir;
	_tmp16_ = file_list;
	export_xmind8_archive_contents (self, _tmp15_, fname, _tmp16_);
	result = TRUE;
	_export_xmind8_file_items_unref0 (file_list);
	_g_array_unref0 (styles);
	_g_free0 (dir);
	return result;
}

static gpointer
_export_xmind8_file_item_ref0 (gpointer self)
{
	return self ? export_xmind8_file_item_ref (self) : NULL;
}

static gboolean
export_xmind8_export_manifest (ExportXMind8* self,
                               const gchar* dir,
                               ExportXMind8FileItems* file_list)
{
	xmlDoc* doc = NULL;
	xmlDoc* _tmp0_;
	xmlNode* manifest = NULL;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	xmlNode* _tmp4_;
	xmlNode* _tmp5_;
	xmlNode* _tmp6_;
	xmlNode* _tmp7_;
	xmlDoc* _tmp20_;
	xmlNode* _tmp21_;
	gchar* meta_dir = NULL;
	gchar* _tmp22_;
	xmlDoc* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	xmlDoc* _tmp28_;
	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_ = xmlNewDoc ((xmlChar*) "1.0");
	doc = _tmp0_;
	_tmp1_ = xmlNewNode (NULL, (xmlChar*) "manifest");
	manifest = _tmp1_;
	_tmp2_ = manifest;
	xmlSetProp (_tmp2_, (xmlChar*) "xmlns", (xmlChar*) "urn:xmind:xmap:xmlns:manifest:1.0");
	_tmp3_ = manifest;
	xmlSetProp (_tmp3_, (xmlChar*) "password-hint", (xmlChar*) "");
	_tmp4_ = manifest;
	_tmp5_ = export_xmind8_manifest_file_entry (self, "META-INF", "");
	xmlAddChild (_tmp4_, _tmp5_);
	_tmp6_ = manifest;
	_tmp7_ = export_xmind8_manifest_file_entry (self, "META-INF/manifest.xml", "text/xml");
	xmlAddChild (_tmp6_, _tmp7_);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp8_ = FALSE;
			_tmp8_ = TRUE;
			while (TRUE) {
				GArray* _tmp10_;
				ExportXMind8FileItem* mfile = NULL;
				GArray* _tmp11_;
				ExportXMind8FileItem* _tmp12_;
				ExportXMind8FileItem* _tmp13_;
				xmlNode* _tmp14_;
				ExportXMind8FileItem* _tmp15_;
				const gchar* _tmp16_;
				ExportXMind8FileItem* _tmp17_;
				const gchar* _tmp18_;
				xmlNode* _tmp19_;
				if (!_tmp8_) {
					gint _tmp9_;
					_tmp9_ = i;
					i = _tmp9_ + 1;
				}
				_tmp8_ = FALSE;
				_tmp10_ = file_list->items;
				if (!(((guint) i) < _tmp10_->len)) {
					break;
				}
				_tmp11_ = file_list->items;
				_tmp12_ = g_array_index (_tmp11_, ExportXMind8FileItem*, (guint) i);
				_tmp13_ = _export_xmind8_file_item_ref0 (_tmp12_);
				mfile = _tmp13_;
				_tmp14_ = manifest;
				_tmp15_ = mfile;
				_tmp16_ = _tmp15_->name;
				_tmp17_ = mfile;
				_tmp18_ = _tmp17_->type;
				_tmp19_ = export_xmind8_manifest_file_entry (self, _tmp16_, _tmp18_);
				xmlAddChild (_tmp14_, _tmp19_);
				_export_xmind8_file_item_unref0 (mfile);
			}
		}
	}
	_tmp20_ = doc;
	_tmp21_ = manifest;
	xmlDocSetRootElement (_tmp20_, _tmp21_);
	_tmp22_ = g_build_filename (dir, "META-INF", NULL);
	meta_dir = _tmp22_;
	g_mkdir (meta_dir, 0755);
	_tmp23_ = doc;
	_tmp24_ = g_build_filename (meta_dir, "manifest.xml", NULL);
	_tmp25_ = _tmp24_;
	xmlSaveFormatFile (_tmp25_, _tmp23_, 1);
	_g_free0 (_tmp25_);
	export_xmind8_file_items_add (file_list, "META-INF", "");
	_tmp26_ = g_build_filename ("META-INF", "manifest.xml", NULL);
	_tmp27_ = _tmp26_;
	export_xmind8_file_items_add (file_list, _tmp27_, "text/xml");
	_g_free0 (_tmp27_);
	_tmp28_ = doc;
	_xmlFreeDoc0 (_tmp28_);
	result = FALSE;
	_g_free0 (meta_dir);
	return result;
}

static xmlNode*
export_xmind8_manifest_file_entry (ExportXMind8* self,
                                   const gchar* path,
                                   const gchar* type)
{
	xmlNode* n = NULL;
	xmlNode* _tmp0_;
	xmlNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	g_return_val_if_fail (type != NULL, NULL);
	_tmp0_ = xmlNewNode (NULL, (xmlChar*) "file-entry");
	n = _tmp0_;
	xmlSetProp (n, (xmlChar*) "full-path", (xmlChar*) path);
	xmlSetProp (n, (xmlChar*) "media-type", (xmlChar*) type);
	result = n;
	return result;
}

static gboolean
export_xmind8_export_content (ExportXMind8* self,
                              MindMap* map,
                              const gchar* dir,
                              ExportXMind8FileItems* file_list,
                              GArray* styles)
{
	xmlDoc* doc = NULL;
	xmlDoc* _tmp0_;
	xmlNode* xmap = NULL;
	xmlNode* _tmp1_;
	xmlNode* sheet = NULL;
	xmlNode* _tmp2_;
	xmlNode* title = NULL;
	xmlNode* _tmp3_;
	gchar* timestamp = NULL;
	GTimeZone* _tmp4_;
	GTimeZone* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	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);
	g_return_val_if_fail (styles != NULL, FALSE);
	_tmp0_ = xmlNewDoc ((xmlChar*) "1.0");
	doc = _tmp0_;
	_tmp1_ = xmlNewNode (NULL, (xmlChar*) "xmap-content");
	xmap = _tmp1_;
	_tmp2_ = xmlNewNode (NULL, (xmlChar*) "sheet");
	sheet = _tmp2_;
	_tmp3_ = xmlNewNode (NULL, (xmlChar*) "title");
	title = _tmp3_;
	_tmp4_ = g_time_zone_new_local ();
	_tmp5_ = _tmp4_;
	_tmp6_ = g_date_time_new_now (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf ("%" G_GINT64_FORMAT, g_date_time_to_unix (_tmp7_));
	_tmp9_ = _tmp8_;
	_g_date_time_unref0 (_tmp7_);
	_g_time_zone_unref0 (_tmp5_);
	timestamp = _tmp9_;
	xmlSetProp (xmap, (xmlChar*) "xmlns", (xmlChar*) "urn:xmind:xmap:xmlns:content:2.0");
	xmlSetProp (xmap, (xmlChar*) "xmlns:fo", (xmlChar*) "http://www.w3.org/1999/XSL/Format");
	xmlSetProp (xmap, (xmlChar*) "xmlns:svg", (xmlChar*) "http://www.w3.org/2000/svg");
	xmlSetProp (xmap, (xmlChar*) "xmlns:xhtml", (xmlChar*) "http://www.w3.org/1999/xhtml");
	xmlSetProp (xmap, (xmlChar*) "xmlns:xlink", (xmlChar*) "http://www.w3.org/1999/xlink");
	xmlSetProp (xmap, (xmlChar*) "timestamp", (xmlChar*) timestamp);
	xmlSetProp (xmap, (xmlChar*) "version", (xmlChar*) "2.0");
	xmlSetProp (sheet, (xmlChar*) "id", (xmlChar*) "1");
	xmlSetProp (sheet, (xmlChar*) "timestamp", (xmlChar*) timestamp);
	export_xmind8_export_map (self, map, sheet, timestamp, dir, file_list, styles);
	xmlNodeAddContent (title, (xmlChar*) "Sheet 1");
	xmlAddChild (sheet, title);
	xmlAddChild (xmap, sheet);
	xmlDocSetRootElement (doc, xmap);
	_tmp10_ = g_build_filename (dir, "content.xml", NULL);
	_tmp11_ = _tmp10_;
	xmlSaveFormatFile (_tmp11_, doc, 1);
	_g_free0 (_tmp11_);
	export_xmind8_file_items_add (file_list, "content.xml", "text/xml");
	_xmlFreeDoc0 (doc);
	result = FALSE;
	_g_free0 (timestamp);
	return result;
}

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

static void
export_xmind8_export_map (ExportXMind8* self,
                          MindMap* map,
                          xmlNode* sheet,
                          const gchar* timestamp,
                          const gchar* dir,
                          ExportXMind8FileItems* file_list,
                          GArray* styles)
{
	GArray* nodes = NULL;
	GArray* _tmp0_;
	GArray* conns = NULL;
	Connections* _tmp1_;
	Connections* _tmp2_;
	GArray* _tmp3_;
	GArray* _tmp4_;
	GArray* _tmp5_;
	xmlNode* top = NULL;
	GArray* _tmp6_;
	Node* _tmp7_;
	xmlNode* _tmp8_;
	GArray* _tmp9_;
	xmlNode* _tmp57_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (timestamp != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (file_list != NULL);
	g_return_if_fail (styles != NULL);
	_tmp0_ = mind_map_get_nodes (map);
	nodes = _tmp0_;
	_tmp1_ = mind_map_get_connections (map);
	_tmp2_ = _tmp1_;
	_tmp3_ = connections_get_connections (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_array_ref0 (_tmp4_);
	conns = _tmp5_;
	_tmp6_ = nodes;
	_tmp7_ = g_array_index (_tmp6_, Node*, (guint) 0);
	_tmp8_ = export_xmind8_export_node (self, map, _tmp7_, timestamp, TRUE, dir, file_list, styles);
	top = _tmp8_;
	_tmp9_ = nodes;
	if (_tmp9_->len > ((guint) 1)) {
		{
			xmlNode* it = NULL;
			xmlNode* _tmp10_;
			xmlNode* _tmp11_;
			_tmp10_ = top;
			_tmp11_ = _tmp10_->children;
			it = _tmp11_;
			{
				gboolean _tmp12_ = FALSE;
				_tmp12_ = TRUE;
				while (TRUE) {
					xmlNode* _tmp15_;
					gboolean _tmp16_ = FALSE;
					xmlNode* _tmp17_;
					if (!_tmp12_) {
						xmlNode* _tmp13_;
						xmlNode* _tmp14_;
						_tmp13_ = it;
						_tmp14_ = _tmp13_->next;
						it = _tmp14_;
					}
					_tmp12_ = FALSE;
					_tmp15_ = it;
					if (!(_tmp15_ != NULL)) {
						break;
					}
					_tmp17_ = it;
					if (_tmp17_->type == XML_ELEMENT_NODE) {
						xmlNode* _tmp18_;
						const gchar* _tmp19_;
						_tmp18_ = it;
						_tmp19_ = _tmp18_->name;
						_tmp16_ = g_strcmp0 (_tmp19_, "children") == 0;
					} else {
						_tmp16_ = FALSE;
					}
					if (_tmp16_) {
						xmlNode* topics = NULL;
						xmlNode* _tmp20_;
						xmlNode* _tmp21_;
						xmlNode* _tmp55_;
						xmlNode* _tmp56_;
						_tmp20_ = xmlNewNode (NULL, (xmlChar*) "topics");
						topics = _tmp20_;
						_tmp21_ = topics;
						xmlSetProp (_tmp21_, (xmlChar*) "type", (xmlChar*) "detached");
						{
							gint i = 0;
							i = 1;
							{
								gboolean _tmp22_ = FALSE;
								_tmp22_ = TRUE;
								while (TRUE) {
									GArray* _tmp24_;
									xmlNode* topic = NULL;
									GArray* _tmp25_;
									Node* _tmp26_;
									xmlNode* _tmp27_;
									xmlNode* pos = NULL;
									xmlNode* _tmp28_;
									gint x = 0;
									GArray* _tmp29_;
									Node* _tmp30_;
									gdouble _tmp31_;
									gdouble _tmp32_;
									GArray* _tmp33_;
									Node* _tmp34_;
									gdouble _tmp35_;
									gdouble _tmp36_;
									gint y = 0;
									GArray* _tmp37_;
									Node* _tmp38_;
									gdouble _tmp39_;
									gdouble _tmp40_;
									GArray* _tmp41_;
									Node* _tmp42_;
									gdouble _tmp43_;
									gdouble _tmp44_;
									xmlNode* _tmp45_;
									gchar* _tmp46_;
									gchar* _tmp47_;
									xmlNode* _tmp48_;
									gchar* _tmp49_;
									gchar* _tmp50_;
									xmlNode* _tmp51_;
									xmlNode* _tmp52_;
									xmlNode* _tmp53_;
									xmlNode* _tmp54_;
									if (!_tmp22_) {
										gint _tmp23_;
										_tmp23_ = i;
										i = _tmp23_ + 1;
									}
									_tmp22_ = FALSE;
									_tmp24_ = nodes;
									if (!(((guint) i) < _tmp24_->len)) {
										break;
									}
									_tmp25_ = nodes;
									_tmp26_ = g_array_index (_tmp25_, Node*, (guint) i);
									_tmp27_ = export_xmind8_export_node (self, map, _tmp26_, timestamp, FALSE, dir, file_list, styles);
									topic = _tmp27_;
									_tmp28_ = xmlNewNode (NULL, (xmlChar*) "position");
									pos = _tmp28_;
									_tmp29_ = nodes;
									_tmp30_ = g_array_index (_tmp29_, Node*, (guint) i);
									_tmp31_ = node_get_posx (_tmp30_);
									_tmp32_ = _tmp31_;
									_tmp33_ = nodes;
									_tmp34_ = g_array_index (_tmp33_, Node*, (guint) 0);
									_tmp35_ = node_get_posx (_tmp34_);
									_tmp36_ = _tmp35_;
									x = (gint) (_tmp32_ - _tmp36_);
									_tmp37_ = nodes;
									_tmp38_ = g_array_index (_tmp37_, Node*, (guint) i);
									_tmp39_ = node_get_posy (_tmp38_);
									_tmp40_ = _tmp39_;
									_tmp41_ = nodes;
									_tmp42_ = g_array_index (_tmp41_, Node*, (guint) 0);
									_tmp43_ = node_get_posy (_tmp42_);
									_tmp44_ = _tmp43_;
									y = (gint) (_tmp40_ - _tmp44_);
									_tmp45_ = pos;
									_tmp46_ = g_strdup_printf ("%i", x);
									_tmp47_ = _tmp46_;
									xmlSetProp (_tmp45_, (xmlChar*) "svg:x", (xmlChar*) _tmp47_);
									_g_free0 (_tmp47_);
									_tmp48_ = pos;
									_tmp49_ = g_strdup_printf ("%i", y);
									_tmp50_ = _tmp49_;
									xmlSetProp (_tmp48_, (xmlChar*) "svg:y", (xmlChar*) _tmp50_);
									_g_free0 (_tmp50_);
									_tmp51_ = topic;
									_tmp52_ = pos;
									xmlAddChild (_tmp51_, _tmp52_);
									_tmp53_ = topics;
									_tmp54_ = topic;
									xmlAddChild (_tmp53_, _tmp54_);
								}
							}
						}
						_tmp55_ = it;
						_tmp56_ = topics;
						xmlAddChild (_tmp55_, _tmp56_);
					}
				}
			}
		}
	}
	_tmp57_ = top;
	xmlAddChild (sheet, _tmp57_);
	export_xmind8_export_connections (self, map, sheet, timestamp, styles);
	_g_array_unref0 (conns);
	_g_array_unref0 (nodes);
}

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

static xmlNode*
export_xmind8_export_node (ExportXMind8* self,
                           MindMap* map,
                           Node* node,
                           const gchar* timestamp,
                           gboolean top,
                           const gchar* dir,
                           ExportXMind8FileItems* file_list,
                           GArray* styles)
{
	xmlNode* topic = NULL;
	xmlNode* _tmp0_;
	xmlNode* title = NULL;
	xmlNode* _tmp1_;
	gint sid = 0;
	gint _tmp2_;
	xmlNode* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	xmlNode* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	xmlNode* _tmp9_;
	xmlNode* _tmp11_;
	CanvasText* _tmp12_;
	CanvasText* _tmp13_;
	FormattedText* _tmp14_;
	FormattedText* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	xmlNode* _tmp18_;
	xmlNode* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	xmlNode* nstyle = NULL;
	xmlNode* _tmp24_;
	xmlNode* nprops = NULL;
	xmlNode* _tmp25_;
	xmlNode* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	xmlNode* _tmp29_;
	xmlNode* _tmp30_;
	xmlNode* _tmp31_;
	xmlNode* _tmp32_;
	xmlNode* _tmp33_;
	NodeImage* _tmp34_;
	NodeImage* _tmp35_;
	GArray* _tmp37_;
	GArray* _tmp38_;
	gboolean _tmp39_;
	xmlNode* _tmp108_;
	xmlNode* 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 (timestamp != NULL, NULL);
	g_return_val_if_fail (dir != NULL, NULL);
	g_return_val_if_fail (file_list != NULL, NULL);
	g_return_val_if_fail (styles != NULL, NULL);
	_tmp0_ = xmlNewNode (NULL, (xmlChar*) "topic");
	topic = _tmp0_;
	_tmp1_ = xmlNewNode (NULL, (xmlChar*) "title");
	title = _tmp1_;
	_tmp2_ = self->priv->ids;
	self->priv->ids = _tmp2_ + 1;
	sid = _tmp2_;
	_tmp3_ = topic;
	_tmp4_ = g_strdup_printf ("%i", node_id (node));
	_tmp5_ = _tmp4_;
	xmlSetProp (_tmp3_, (xmlChar*) "id", (xmlChar*) _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = topic;
	_tmp7_ = g_strdup_printf ("%i", sid);
	_tmp8_ = _tmp7_;
	xmlSetProp (_tmp6_, (xmlChar*) "style-id", (xmlChar*) _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = topic;
	xmlSetProp (_tmp9_, (xmlChar*) "timestamp", (xmlChar*) timestamp);
	if (top) {
		xmlNode* _tmp10_;
		_tmp10_ = topic;
		xmlSetProp (_tmp10_, (xmlChar*) "structure-class", (xmlChar*) "org.xmind.ui.map.unbalanced");
	}
	_tmp11_ = title;
	_tmp12_ = node_get_name (node);
	_tmp13_ = _tmp12_;
	_tmp14_ = canvas_text_get_text (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = formatted_text_get_text (_tmp15_);
	_tmp17_ = _tmp16_;
	xmlNodeAddContent (_tmp11_, (xmlChar*) _tmp17_);
	_tmp18_ = topic;
	_tmp19_ = title;
	xmlAddChild (_tmp18_, _tmp19_);
	_tmp20_ = node_get_note (node);
	_tmp21_ = _tmp20_;
	if (g_strcmp0 (_tmp21_, "") != 0) {
		xmlNode* _tmp22_;
		xmlNode* _tmp23_;
		_tmp22_ = topic;
		_tmp23_ = export_xmind8_export_node_note (self, node, styles);
		xmlAddChild (_tmp22_, _tmp23_);
	}
	_tmp24_ = xmlNewNode (NULL, (xmlChar*) "style");
	nstyle = _tmp24_;
	_tmp25_ = xmlNewNode (NULL, (xmlChar*) "topic-properties");
	nprops = _tmp25_;
	_tmp26_ = nstyle;
	_tmp27_ = g_strdup_printf ("%i", sid);
	_tmp28_ = _tmp27_;
	xmlSetProp (_tmp26_, (xmlChar*) "id", (xmlChar*) _tmp28_);
	_g_free0 (_tmp28_);
	_tmp29_ = nstyle;
	xmlSetProp (_tmp29_, (xmlChar*) "type", (xmlChar*) "topic");
	_tmp30_ = nprops;
	export_xmind8_export_node_style (self, node, _tmp30_);
	_tmp31_ = nstyle;
	_tmp32_ = nprops;
	xmlAddChild (_tmp31_, _tmp32_);
	_tmp33_ = nstyle;
	g_array_append_val (styles, _tmp33_);
	_tmp34_ = node_get_image (node);
	_tmp35_ = _tmp34_;
	if (_tmp35_ != NULL) {
		xmlNode* _tmp36_;
		_tmp36_ = topic;
		export_xmind8_export_image (self, map, node, dir, file_list, _tmp36_);
	}
	_tmp37_ = node_children (node);
	_tmp38_ = _tmp37_;
	_tmp39_ = _tmp38_->len > ((guint) 0);
	_g_array_unref0 (_tmp38_);
	if (_tmp39_) {
		GArray* groups = NULL;
		GArray* _tmp40_;
		xmlNode* children = NULL;
		xmlNode* _tmp41_;
		xmlNode* topics = NULL;
		xmlNode* _tmp42_;
		xmlNode* _tmp43_;
		xmlNode* _tmp61_;
		xmlNode* _tmp62_;
		xmlNode* _tmp63_;
		xmlNode* _tmp64_;
		GArray* _tmp65_;
		_tmp40_ = g_array_new (TRUE, TRUE, sizeof (gint));
		groups = _tmp40_;
		_tmp41_ = xmlNewNode (NULL, (xmlChar*) "children");
		children = _tmp41_;
		_tmp42_ = xmlNewNode (NULL, (xmlChar*) "topics");
		topics = _tmp42_;
		_tmp43_ = topics;
		xmlSetProp (_tmp43_, (xmlChar*) "type", (xmlChar*) "attached");
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp44_ = FALSE;
				_tmp44_ = TRUE;
				while (TRUE) {
					GArray* _tmp46_;
					GArray* _tmp47_;
					gboolean _tmp48_;
					Node* child = NULL;
					GArray* _tmp49_;
					GArray* _tmp50_;
					Node* _tmp51_;
					Node* _tmp52_;
					Node* _tmp53_;
					xmlNode* _tmp54_;
					Node* _tmp55_;
					xmlNode* _tmp56_;
					Node* _tmp57_;
					gboolean _tmp58_;
					gboolean _tmp59_;
					if (!_tmp44_) {
						gint _tmp45_;
						_tmp45_ = i;
						i = _tmp45_ + 1;
					}
					_tmp44_ = FALSE;
					_tmp46_ = node_children (node);
					_tmp47_ = _tmp46_;
					_tmp48_ = !(((guint) i) < _tmp47_->len);
					_g_array_unref0 (_tmp47_);
					if (_tmp48_) {
						break;
					}
					_tmp49_ = node_children (node);
					_tmp50_ = _tmp49_;
					_tmp51_ = g_array_index (_tmp50_, Node*, (guint) i);
					_tmp52_ = _g_object_ref0 (_tmp51_);
					_tmp53_ = _tmp52_;
					_g_array_unref0 (_tmp50_);
					child = _tmp53_;
					_tmp54_ = topics;
					_tmp55_ = child;
					_tmp56_ = export_xmind8_export_node (self, map, _tmp55_, timestamp, FALSE, dir, file_list, styles);
					xmlAddChild (_tmp54_, _tmp56_);
					_tmp57_ = child;
					_tmp58_ = node_get_group (_tmp57_);
					_tmp59_ = _tmp58_;
					if (_tmp59_) {
						GArray* _tmp60_;
						_tmp60_ = groups;
						g_array_append_val (_tmp60_, i);
					}
					_g_object_unref0 (child);
				}
			}
		}
		_tmp61_ = children;
		_tmp62_ = topics;
		xmlAddChild (_tmp61_, _tmp62_);
		_tmp63_ = topic;
		_tmp64_ = children;
		xmlAddChild (_tmp63_, _tmp64_);
		_tmp65_ = groups;
		if (_tmp65_->len > ((guint) 0)) {
			xmlNode* boundaries = NULL;
			xmlNode* _tmp66_;
			xmlNode* _tmp106_;
			xmlNode* _tmp107_;
			_tmp66_ = xmlNewNode (NULL, (xmlChar*) "boundaries");
			boundaries = _tmp66_;
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp67_ = FALSE;
					_tmp67_ = TRUE;
					while (TRUE) {
						GArray* _tmp69_;
						xmlNode* boundary = NULL;
						xmlNode* _tmp70_;
						xmlNode* style = NULL;
						xmlNode* _tmp71_;
						xmlNode* props = NULL;
						xmlNode* _tmp72_;
						gint id = 0;
						gint _tmp73_;
						gint stid = 0;
						gint _tmp74_;
						xmlNode* _tmp75_;
						gchar* _tmp76_;
						gchar* _tmp77_;
						xmlNode* _tmp78_;
						gchar* _tmp79_;
						gchar* _tmp80_;
						xmlNode* _tmp81_;
						GArray* _tmp82_;
						GArray* _tmp83_;
						gchar* _tmp84_;
						gchar* _tmp85_;
						xmlNode* _tmp86_;
						xmlNode* _tmp87_;
						xmlNode* _tmp88_;
						xmlNode* _tmp89_;
						gchar* _tmp90_;
						gchar* _tmp91_;
						xmlNode* _tmp92_;
						xmlNode* _tmp93_;
						GArray* _tmp94_;
						GArray* _tmp95_;
						GArray* _tmp96_;
						Node* _tmp97_;
						GdkRGBA* _tmp98_;
						GdkRGBA* _tmp99_;
						GdkRGBA _tmp100_;
						gchar* _tmp101_;
						gchar* _tmp102_;
						xmlNode* _tmp103_;
						xmlNode* _tmp104_;
						xmlNode* _tmp105_;
						if (!_tmp67_) {
							gint _tmp68_;
							_tmp68_ = i;
							i = _tmp68_ + 1;
						}
						_tmp67_ = FALSE;
						_tmp69_ = groups;
						if (!(((guint) i) < _tmp69_->len)) {
							break;
						}
						_tmp70_ = xmlNewNode (NULL, (xmlChar*) "boundary");
						boundary = _tmp70_;
						_tmp71_ = xmlNewNode (NULL, (xmlChar*) "style");
						style = _tmp71_;
						_tmp72_ = xmlNewNode (NULL, (xmlChar*) "boundary-properties");
						props = _tmp72_;
						_tmp73_ = self->priv->ids;
						self->priv->ids = _tmp73_ + 1;
						id = _tmp73_;
						_tmp74_ = self->priv->ids;
						self->priv->ids = _tmp74_ + 1;
						stid = _tmp74_;
						_tmp75_ = boundary;
						_tmp76_ = g_strdup_printf ("%i", id);
						_tmp77_ = _tmp76_;
						xmlSetProp (_tmp75_, (xmlChar*) "id", (xmlChar*) _tmp77_);
						_g_free0 (_tmp77_);
						_tmp78_ = boundary;
						_tmp79_ = g_strdup_printf ("%i", stid);
						_tmp80_ = _tmp79_;
						xmlSetProp (_tmp78_, (xmlChar*) "style-id", (xmlChar*) _tmp80_);
						_g_free0 (_tmp80_);
						_tmp81_ = boundary;
						_tmp82_ = groups;
						_tmp83_ = groups;
						_tmp84_ = g_strdup_printf ("(%d,%d)", g_array_index (_tmp82_, gint, (guint) i), g_array_index (_tmp83_, gint, (guint) i));
						_tmp85_ = _tmp84_;
						xmlSetProp (_tmp81_, (xmlChar*) "range", (xmlChar*) _tmp85_);
						_g_free0 (_tmp85_);
						_tmp86_ = boundary;
						xmlSetProp (_tmp86_, (xmlChar*) "timestamp", (xmlChar*) timestamp);
						_tmp87_ = boundaries;
						_tmp88_ = boundary;
						xmlAddChild (_tmp87_, _tmp88_);
						_tmp89_ = style;
						_tmp90_ = g_strdup_printf ("%i", stid);
						_tmp91_ = _tmp90_;
						xmlSetProp (_tmp89_, (xmlChar*) "id", (xmlChar*) _tmp91_);
						_g_free0 (_tmp91_);
						_tmp92_ = style;
						xmlSetProp (_tmp92_, (xmlChar*) "type", (xmlChar*) "boundary");
						_tmp93_ = props;
						_tmp94_ = node_children (node);
						_tmp95_ = _tmp94_;
						_tmp96_ = groups;
						_tmp97_ = g_array_index (_tmp95_, Node*, (guint) g_array_index (_tmp96_, gint, (guint) i));
						_tmp98_ = node_get_link_color (_tmp97_);
						_tmp99_ = _tmp98_;
						_tmp100_ = *_tmp99_;
						_tmp101_ = utils_color_from_rgba (&_tmp100_);
						_tmp102_ = _tmp101_;
						xmlSetProp (_tmp93_, (xmlChar*) "svg:fill", (xmlChar*) _tmp102_);
						_g_free0 (_tmp102_);
						_g_array_unref0 (_tmp95_);
						_tmp103_ = style;
						_tmp104_ = props;
						xmlAddChild (_tmp103_, _tmp104_);
						_tmp105_ = style;
						g_array_append_val (styles, _tmp105_);
					}
				}
			}
			_tmp106_ = topic;
			_tmp107_ = boundaries;
			xmlAddChild (_tmp106_, _tmp107_);
		}
		_g_array_unref0 (groups);
	}
	_tmp108_ = topic;
	result = _tmp108_;
	return result;
}

static void
export_xmind8_export_image (ExportXMind8* self,
                            MindMap* map,
                            Node* node,
                            const gchar* dir,
                            ExportXMind8FileItems* file_list,
                            xmlNode* topic)
{
	gchar* img_name = NULL;
	ImageManager* _tmp0_;
	ImageManager* _tmp1_;
	NodeImage* _tmp2_;
	NodeImage* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gchar* _tmp6_;
	gchar* mime_type = NULL;
	ImageManager* _tmp7_;
	ImageManager* _tmp8_;
	NodeImage* _tmp9_;
	NodeImage* _tmp10_;
	gint _tmp11_;
	gint _tmp12_;
	gchar* _tmp13_;
	gchar* src = NULL;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar** parts = NULL;
	const gchar* _tmp19_;
	gchar** _tmp20_;
	gchar** _tmp21_;
	gint parts_length1;
	gint _parts_size_;
	xmlNode* img = NULL;
	xmlNode* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	GFile* lfile = NULL;
	const gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	GFile* _tmp29_;
	GFile* _tmp30_;
	GFile* rfile = NULL;
	const gchar* _tmp31_;
	GFile* _tmp32_;
	xmlNode* _tmp35_;
	gint _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	xmlNode* _tmp39_;
	NodeImage* _tmp40_;
	NodeImage* _tmp41_;
	gint _tmp42_;
	gint _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	xmlNode* _tmp46_;
	NodeImage* _tmp47_;
	NodeImage* _tmp48_;
	gint _tmp49_;
	gint _tmp50_;
	gchar* _tmp51_;
	gchar* _tmp52_;
	xmlNode* _tmp53_;
	const gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* _tmp56_;
	xmlNode* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (node != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (file_list != NULL);
	_tmp0_ = mind_map_get_image_manager (map);
	_tmp1_ = _tmp0_;
	_tmp2_ = node_get_image (node);
	_tmp3_ = _tmp2_;
	_tmp4_ = node_image_get_id (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = image_manager_get_file (_tmp1_, _tmp5_);
	img_name = _tmp6_;
	_tmp7_ = mind_map_get_image_manager (map);
	_tmp8_ = _tmp7_;
	_tmp9_ = node_get_image (node);
	_tmp10_ = _tmp9_;
	_tmp11_ = node_image_get_id (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = image_manager_get_mime_type (_tmp8_, _tmp12_);
	mime_type = _tmp13_;
	_tmp14_ = img_name;
	_tmp15_ = g_filename_display_basename (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_build_filename ("attachments", _tmp16_, NULL);
	_tmp18_ = _tmp17_;
	_g_free0 (_tmp16_);
	src = _tmp18_;
	_tmp19_ = src;
	_tmp21_ = _tmp20_ = g_strsplit (_tmp19_, ".", 0);
	parts = _tmp21_;
	parts_length1 = _vala_array_length (_tmp20_);
	_parts_size_ = parts_length1;
	_tmp22_ = xmlNewNode (NULL, (xmlChar*) "xhtml:img");
	img = _tmp22_;
	_tmp23_ = mime_type;
	if (g_strcmp0 (_tmp23_, "image/svg") == 0) {
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		_g_free0 (src);
		_g_free0 (mime_type);
		_g_free0 (img_name);
		return;
	}
	_tmp24_ = g_build_filename (dir, "attachments", NULL);
	_tmp25_ = _tmp24_;
	g_mkdir (_tmp25_, 0755);
	_g_free0 (_tmp25_);
	_tmp26_ = src;
	_tmp27_ = g_build_filename (dir, _tmp26_, NULL);
	_tmp28_ = _tmp27_;
	_tmp29_ = g_file_new_for_path (_tmp28_);
	_tmp30_ = _tmp29_;
	_g_free0 (_tmp28_);
	lfile = _tmp30_;
	_tmp31_ = img_name;
	_tmp32_ = g_file_new_for_path (_tmp31_);
	rfile = _tmp32_;
	{
		GFile* _tmp33_;
		GFile* _tmp34_;
		_tmp33_ = rfile;
		_tmp34_ = lfile;
		g_file_copy (_tmp33_, _tmp34_, 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_);
		_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;
	}
	__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);
		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;
	}
	_tmp35_ = img;
	_tmp36_ = self->priv->ids;
	self->priv->ids = _tmp36_ + 1;
	_tmp37_ = g_strdup_printf ("%i", _tmp36_);
	_tmp38_ = _tmp37_;
	xmlSetProp (_tmp35_, (xmlChar*) "style-id", (xmlChar*) _tmp38_);
	_g_free0 (_tmp38_);
	_tmp39_ = img;
	_tmp40_ = node_get_image (node);
	_tmp41_ = _tmp40_;
	_tmp42_ = node_image_get_height (_tmp41_);
	_tmp43_ = _tmp42_;
	_tmp44_ = g_strdup_printf ("%i", _tmp43_);
	_tmp45_ = _tmp44_;
	xmlSetProp (_tmp39_, (xmlChar*) "svg:height", (xmlChar*) _tmp45_);
	_g_free0 (_tmp45_);
	_tmp46_ = img;
	_tmp47_ = node_get_image (node);
	_tmp48_ = _tmp47_;
	_tmp49_ = node_image_get_width (_tmp48_);
	_tmp50_ = _tmp49_;
	_tmp51_ = g_strdup_printf ("%i", _tmp50_);
	_tmp52_ = _tmp51_;
	xmlSetProp (_tmp46_, (xmlChar*) "svg:width", (xmlChar*) _tmp52_);
	_g_free0 (_tmp52_);
	_tmp53_ = img;
	_tmp54_ = src;
	_tmp55_ = g_strdup_printf ("xap:%s", _tmp54_);
	_tmp56_ = _tmp55_;
	xmlSetProp (_tmp53_, (xmlChar*) "xhtml:src", (xmlChar*) _tmp56_);
	_g_free0 (_tmp56_);
	_tmp57_ = img;
	xmlAddChild (topic, _tmp57_);
	export_xmind8_file_items_add (file_list, "attachments", "");
	_tmp58_ = src;
	_tmp59_ = mime_type;
	export_xmind8_file_items_add (file_list, _tmp58_, _tmp59_);
	_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);
}

static void
export_xmind8_export_node_style (ExportXMind8* self,
                                 Node* node,
                                 xmlNode* n)
{
	Style* _tmp0_;
	Style* _tmp1_;
	NodeBorder* _tmp2_;
	NodeBorder* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GQuark _tmp7_ = 0U;
	static GQuark _tmp6_label0 = 0;
	static GQuark _tmp6_label1 = 0;
	GdkRGBA* _tmp8_;
	GdkRGBA* _tmp9_;
	Style* _tmp20_;
	Style* _tmp21_;
	gint* _tmp22_;
	gint* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	Style* _tmp26_;
	Style* _tmp27_;
	gint* _tmp28_;
	gint* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	Style* _tmp32_;
	Style* _tmp33_;
	gboolean* _tmp34_;
	gboolean* _tmp35_;
	Style* _tmp41_;
	Style* _tmp42_;
	LinkType* _tmp43_;
	LinkType* _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_;
	GQuark _tmp48_ = 0U;
	static GQuark _tmp47_label0 = 0;
	static GQuark _tmp47_label1 = 0;
	static GQuark _tmp47_label2 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = node_get_style (node);
	_tmp1_ = _tmp0_;
	_tmp2_ = style_get_node_border (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = node_border_name (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
	g_free (_tmp5_);
	if (_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("rounded")))) {
		switch (0) {
			default:
			{
				xmlSetProp (n, (xmlChar*) "shape-class", (xmlChar*) "org.xmind.topicShape.roundedRect");
				break;
			}
		}
	} else if (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("underlined")))) {
		switch (0) {
			default:
			{
				xmlSetProp (n, (xmlChar*) "shape-class", (xmlChar*) "org.xmind.topicShape.underline");
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				xmlSetProp (n, (xmlChar*) "shape-class", (xmlChar*) "org.xmind.topicShape.rect");
				break;
			}
		}
	}
	_tmp8_ = node_get_link_color (node);
	_tmp9_ = _tmp8_;
	if (_tmp9_ != NULL) {
		GdkRGBA* _tmp10_;
		GdkRGBA* _tmp11_;
		GdkRGBA _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		GdkRGBA* _tmp15_;
		GdkRGBA* _tmp16_;
		GdkRGBA _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		_tmp10_ = node_get_link_color (node);
		_tmp11_ = _tmp10_;
		_tmp12_ = *_tmp11_;
		_tmp13_ = utils_color_from_rgba (&_tmp12_);
		_tmp14_ = _tmp13_;
		xmlSetProp (n, (xmlChar*) "border-line-color", (xmlChar*) _tmp14_);
		_g_free0 (_tmp14_);
		_tmp15_ = node_get_link_color (node);
		_tmp16_ = _tmp15_;
		_tmp17_ = *_tmp16_;
		_tmp18_ = utils_color_from_rgba (&_tmp17_);
		_tmp19_ = _tmp18_;
		xmlSetProp (n, (xmlChar*) "line-color", (xmlChar*) _tmp19_);
		_g_free0 (_tmp19_);
	}
	_tmp20_ = node_get_style (node);
	_tmp21_ = _tmp20_;
	_tmp22_ = style_get_node_borderwidth (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = g_strdup_printf ("%dpt", *_tmp23_);
	_tmp25_ = _tmp24_;
	xmlSetProp (n, (xmlChar*) "border-line-width", (xmlChar*) _tmp25_);
	_g_free0 (_tmp25_);
	_tmp26_ = node_get_style (node);
	_tmp27_ = _tmp26_;
	_tmp28_ = style_get_link_width (_tmp27_);
	_tmp29_ = _tmp28_;
	_tmp30_ = g_strdup_printf ("%dpt", *_tmp29_);
	_tmp31_ = _tmp30_;
	xmlSetProp (n, (xmlChar*) "line-width", (xmlChar*) _tmp31_);
	_g_free0 (_tmp31_);
	_tmp32_ = node_get_style (node);
	_tmp33_ = _tmp32_;
	_tmp34_ = style_get_node_fill (_tmp33_);
	_tmp35_ = _tmp34_;
	if (*_tmp35_) {
		GdkRGBA* _tmp36_;
		GdkRGBA* _tmp37_;
		GdkRGBA _tmp38_;
		gchar* _tmp39_;
		gchar* _tmp40_;
		_tmp36_ = node_get_link_color (node);
		_tmp37_ = _tmp36_;
		_tmp38_ = *_tmp37_;
		_tmp39_ = utils_color_from_rgba (&_tmp38_);
		_tmp40_ = _tmp39_;
		xmlSetProp (n, (xmlChar*) "svg:fill", (xmlChar*) _tmp40_);
		_g_free0 (_tmp40_);
	}
	_tmp41_ = node_get_style (node);
	_tmp42_ = _tmp41_;
	_tmp43_ = style_get_link_type (_tmp42_);
	_tmp44_ = _tmp43_;
	_tmp45_ = link_type_name (_tmp44_);
	_tmp46_ = _tmp45_;
	_tmp48_ = (NULL == _tmp46_) ? 0 : g_quark_from_string (_tmp46_);
	g_free (_tmp46_);
	if (_tmp48_ == ((0 != _tmp47_label0) ? _tmp47_label0 : (_tmp47_label0 = g_quark_from_static_string ("curved")))) {
		switch (0) {
			default:
			{
				const gchar* _tmp49_ = NULL;
				Style* _tmp50_;
				Style* _tmp51_;
				gboolean* _tmp52_;
				gboolean* _tmp53_;
				gchar* _tmp54_;
				gchar* _tmp55_;
				_tmp50_ = node_get_style (node);
				_tmp51_ = _tmp50_;
				_tmp52_ = style_get_link_arrow (_tmp51_);
				_tmp53_ = _tmp52_;
				if (*_tmp53_) {
					_tmp49_ = "arrowedCurve";
				} else {
					_tmp49_ = "curve";
				}
				_tmp54_ = g_strdup_printf ("org.xmind.branchConnection.%s", _tmp49_);
				_tmp55_ = _tmp54_;
				xmlSetProp (n, (xmlChar*) "line-class", (xmlChar*) _tmp55_);
				_g_free0 (_tmp55_);
				break;
			}
		}
	} else if (_tmp48_ == ((0 != _tmp47_label1) ? _tmp47_label1 : (_tmp47_label1 = g_quark_from_static_string ("straight")))) {
		switch (0) {
			default:
			{
				xmlSetProp (n, (xmlChar*) "line-class", (xmlChar*) "org.xmind.branchConnection.straight");
				break;
			}
		}
	} else if (_tmp48_ == ((0 != _tmp47_label2) ? _tmp47_label2 : (_tmp47_label2 = g_quark_from_static_string ("squared")))) {
		switch (0) {
			default:
			{
				xmlSetProp (n, (xmlChar*) "line-class", (xmlChar*) "org.xmind.branchConnection.elbow");
				break;
			}
		}
	}
}

static xmlNode*
export_xmind8_export_node_note (ExportXMind8* self,
                                Node* node,
                                GArray* styles)
{
	xmlNode* note = NULL;
	xmlNode* _tmp0_;
	xmlNode* plain = NULL;
	xmlNode* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* note_html = NULL;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	xmlDoc* note_doc = NULL;
	gint _tmp10_;
	gint _tmp11_;
	xmlDoc* _tmp12_;
	xmlNode* html = NULL;
	xmlNode* _tmp13_;
	xmlNode* _tmp14_;
	xmlNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (node != NULL, NULL);
	g_return_val_if_fail (styles != NULL, NULL);
	_tmp0_ = xmlNewNode (NULL, (xmlChar*) "notes");
	note = _tmp0_;
	_tmp1_ = xmlNewNode (NULL, (xmlChar*) "plain");
	plain = _tmp1_;
	_tmp2_ = node_get_note (node);
	_tmp3_ = _tmp2_;
	xmlNodeAddContent (plain, (xmlChar*) _tmp3_);
	_tmp4_ = node_get_note (node);
	_tmp5_ = _tmp4_;
	_tmp6_ = utils_markdown_to_html (_tmp5_, "html");
	_tmp7_ = _tmp6_;
	_tmp8_ = export_xmind8_replace_formatting (self, _tmp7_, styles);
	_tmp9_ = _tmp8_;
	_g_free0 (_tmp7_);
	note_html = _tmp9_;
	_tmp10_ = strlen (note_html);
	_tmp11_ = _tmp10_;
	_tmp12_ = xmlParseMemory (note_html, _tmp11_);
	note_doc = _tmp12_;
	_tmp13_ = xmlDocGetRootElement (note_doc);
	_tmp14_ = xmlCopyNode (_tmp13_, 1);
	html = _tmp14_;
	xmlAddChild (note, plain);
	xmlAddChild (note, html);
	result = note;
	_g_free0 (note_html);
	return result;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	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;
}

static gchar*
export_xmind8_replace_formatting (ExportXMind8* self,
                                  const gchar* str,
                                  GArray* styles)
{
	gint bold_id = 0;
	gint _tmp0_;
	gint em_id = 0;
	gint _tmp1_;
	xmlNode* bold_style = NULL;
	xmlNode* _tmp2_;
	xmlNode* em_style = NULL;
	xmlNode* _tmp3_;
	xmlNode* bold_props = NULL;
	xmlNode* _tmp4_;
	xmlNode* em_props = NULL;
	xmlNode* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (str != NULL, NULL);
	g_return_val_if_fail (styles != NULL, NULL);
	_tmp0_ = self->priv->ids;
	self->priv->ids = _tmp0_ + 1;
	bold_id = _tmp0_;
	_tmp1_ = self->priv->ids;
	self->priv->ids = _tmp1_ + 1;
	em_id = _tmp1_;
	_tmp2_ = xmlNewNode (NULL, (xmlChar*) "style");
	bold_style = _tmp2_;
	_tmp3_ = xmlNewNode (NULL, (xmlChar*) "style");
	em_style = _tmp3_;
	_tmp4_ = xmlNewNode (NULL, (xmlChar*) "text-properties");
	bold_props = _tmp4_;
	_tmp5_ = xmlNewNode (NULL, (xmlChar*) "text-properties");
	em_props = _tmp5_;
	_tmp6_ = g_strdup_printf ("%i", bold_id);
	_tmp7_ = _tmp6_;
	xmlSetProp (bold_props, (xmlChar*) "id", (xmlChar*) _tmp7_);
	_g_free0 (_tmp7_);
	xmlSetProp (bold_props, (xmlChar*) "fo:font-weight", (xmlChar*) "bold");
	xmlAddChild (bold_style, bold_props);
	_tmp8_ = g_strdup_printf ("%i", em_id);
	_tmp9_ = _tmp8_;
	xmlSetProp (em_props, (xmlChar*) "id", (xmlChar*) _tmp9_);
	_g_free0 (_tmp9_);
	xmlSetProp (em_props, (xmlChar*) "fo:font-style", (xmlChar*) "italic");
	xmlAddChild (em_style, em_props);
	g_array_append_val (styles, bold_style);
	g_array_append_val (styles, em_style);
	_tmp10_ = string_replace (str, "<p>", "<xhtml:p>");
	_tmp11_ = _tmp10_;
	_tmp12_ = string_replace (_tmp11_, "</p>", "</xhtml:p>");
	_tmp13_ = _tmp12_;
	_tmp14_ = string_replace (_tmp13_, "<a href", "<xhtml:a xlink:href");
	_tmp15_ = _tmp14_;
	_tmp16_ = string_replace (_tmp15_, "</a>", "</xhtml:a>");
	_tmp17_ = _tmp16_;
	_tmp18_ = g_strdup_printf ("<xhtml:span style-id=\"%d\">", bold_id);
	_tmp19_ = _tmp18_;
	_tmp20_ = string_replace (_tmp17_, "<strong>", _tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = string_replace (_tmp21_, "</strong>", "</xhtml:span>");
	_tmp23_ = _tmp22_;
	_tmp24_ = g_strdup_printf ("<xhtml:span style-id=\"%d\">", em_id);
	_tmp25_ = _tmp24_;
	_tmp26_ = string_replace (_tmp23_, "<em>", _tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = string_replace (_tmp27_, "</em>", "</xhtml:span>");
	_tmp29_ = _tmp28_;
	_g_free0 (_tmp27_);
	_g_free0 (_tmp25_);
	_g_free0 (_tmp23_);
	_g_free0 (_tmp21_);
	_g_free0 (_tmp19_);
	_g_free0 (_tmp17_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp11_);
	result = _tmp29_;
	return result;
}

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

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 void
export_xmind8_export_connections (ExportXMind8* self,
                                  MindMap* map,
                                  xmlNode* sheet,
                                  const gchar* timestamp,
                                  GArray* styles)
{
	GArray* conns = NULL;
	Connections* _tmp0_;
	Connections* _tmp1_;
	GArray* _tmp2_;
	GArray* _tmp3_;
	GArray* _tmp4_;
	GArray* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (timestamp != NULL);
	g_return_if_fail (styles != NULL);
	_tmp0_ = mind_map_get_connections (map);
	_tmp1_ = _tmp0_;
	_tmp2_ = connections_get_connections (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_array_ref0 (_tmp3_);
	conns = _tmp4_;
	_tmp5_ = conns;
	if (_tmp5_->len > ((guint) 0)) {
		xmlNode* relations = NULL;
		xmlNode* _tmp6_;
		xmlNode* _tmp126_;
		_tmp6_ = xmlNewNode (NULL, (xmlChar*) "relationships");
		relations = _tmp6_;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp7_ = FALSE;
				_tmp7_ = TRUE;
				while (TRUE) {
					GArray* _tmp9_;
					Connection* conn = NULL;
					GArray* _tmp10_;
					Connection* _tmp11_;
					Connection* _tmp12_;
					gint conn_id = 0;
					gint _tmp13_;
					gint style_id = 0;
					gint _tmp14_;
					GdkRGBA* _tmp15_ = NULL;
					Connection* _tmp16_;
					GdkRGBA* _tmp17_;
					GdkRGBA* _tmp18_;
					GdkRGBA* color = NULL;
					GdkRGBA* _tmp26_;
					gchar* dash = NULL;
					gchar* _tmp27_;
					Connection* _tmp28_;
					Style* _tmp29_;
					Style* _tmp30_;
					LinkDash* _tmp31_;
					LinkDash* _tmp32_;
					const gchar* _tmp33_;
					const gchar* _tmp34_;
					GQuark _tmp36_ = 0U;
					static GQuark _tmp35_label0 = 0;
					static GQuark _tmp35_label1 = 0;
					xmlNode* relation = NULL;
					xmlNode* _tmp39_;
					xmlNode* _tmp40_;
					Connection* _tmp41_;
					Node* _tmp42_;
					Node* _tmp43_;
					gchar* _tmp44_;
					gchar* _tmp45_;
					xmlNode* _tmp46_;
					Connection* _tmp47_;
					Node* _tmp48_;
					Node* _tmp49_;
					gchar* _tmp50_;
					gchar* _tmp51_;
					xmlNode* _tmp52_;
					gchar* _tmp53_;
					gchar* _tmp54_;
					xmlNode* _tmp55_;
					gchar* _tmp56_;
					gchar* _tmp57_;
					xmlNode* _tmp58_;
					Connection* _tmp59_;
					CanvasText* _tmp60_;
					CanvasText* _tmp61_;
					xmlNode* _tmp73_;
					xmlNode* _tmp74_;
					xmlNode* style = NULL;
					xmlNode* _tmp75_;
					xmlNode* props = NULL;
					xmlNode* _tmp76_;
					gboolean _tmp77_ = FALSE;
					Connection* _tmp78_;
					Style* _tmp79_;
					Style* _tmp80_;
					const gchar* _tmp81_;
					const gchar* _tmp82_;
					gboolean from_arrow = FALSE;
					gboolean _tmp88_ = FALSE;
					Connection* _tmp89_;
					Style* _tmp90_;
					Style* _tmp91_;
					const gchar* _tmp92_;
					const gchar* _tmp93_;
					gboolean to_arrow = FALSE;
					const gchar* _tmp99_ = NULL;
					xmlNode* _tmp100_;
					gchar* _tmp101_;
					gchar* _tmp102_;
					const gchar* _tmp103_ = NULL;
					xmlNode* _tmp104_;
					gchar* _tmp105_;
					gchar* _tmp106_;
					xmlNode* _tmp107_;
					GdkRGBA* _tmp108_;
					GdkRGBA _tmp109_;
					gchar* _tmp110_;
					gchar* _tmp111_;
					xmlNode* _tmp112_;
					const gchar* _tmp113_;
					xmlNode* _tmp114_;
					Connection* _tmp115_;
					Style* _tmp116_;
					Style* _tmp117_;
					gint* _tmp118_;
					gint* _tmp119_;
					gchar* _tmp120_;
					gchar* _tmp121_;
					xmlNode* _tmp122_;
					xmlNode* _tmp123_;
					xmlNode* _tmp124_;
					xmlNode* _tmp125_;
					if (!_tmp7_) {
						gint _tmp8_;
						_tmp8_ = i;
						i = _tmp8_ + 1;
					}
					_tmp7_ = FALSE;
					_tmp9_ = conns;
					if (!(((guint) i) < _tmp9_->len)) {
						break;
					}
					_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_;
					_tmp14_ = self->priv->ids;
					self->priv->ids = _tmp14_ + 1;
					style_id = _tmp14_;
					_tmp16_ = conn;
					_tmp17_ = connection_get_color (_tmp16_);
					_tmp18_ = _tmp17_;
					if (_tmp18_ == NULL) {
						Theme* _tmp19_;
						Theme* _tmp20_;
						GdkRGBA* _tmp21_;
						_tmp19_ = mind_map_get_theme (map);
						_tmp20_ = _tmp19_;
						_tmp21_ = theme_get_color (_tmp20_, "connection_background");
						__vala_GdkRGBA_free0 (_tmp15_);
						_tmp15_ = _tmp21_;
						_g_object_unref0 (_tmp20_);
					} else {
						Connection* _tmp22_;
						GdkRGBA* _tmp23_;
						GdkRGBA* _tmp24_;
						GdkRGBA* _tmp25_;
						_tmp22_ = conn;
						_tmp23_ = connection_get_color (_tmp22_);
						_tmp24_ = _tmp23_;
						_tmp25_ = __vala_GdkRGBA_copy0 (_tmp24_);
						__vala_GdkRGBA_free0 (_tmp15_);
						_tmp15_ = _tmp25_;
					}
					_tmp26_ = _tmp15_;
					_tmp15_ = NULL;
					color = _tmp26_;
					_tmp27_ = g_strdup ("dash");
					dash = _tmp27_;
					_tmp28_ = conn;
					_tmp29_ = connection_get_style (_tmp28_);
					_tmp30_ = _tmp29_;
					_tmp31_ = style_get_connection_dash (_tmp30_);
					_tmp32_ = _tmp31_;
					_tmp33_ = _tmp32_->name;
					_tmp34_ = _tmp33_;
					_tmp36_ = (NULL == _tmp34_) ? 0 : g_quark_from_string (_tmp34_);
					if (_tmp36_ == ((0 != _tmp35_label0) ? _tmp35_label0 : (_tmp35_label0 = g_quark_from_static_string ("solid")))) {
						switch (0) {
							default:
							{
								gchar* _tmp37_;
								_tmp37_ = g_strdup ("solid");
								_g_free0 (dash);
								dash = _tmp37_;
								break;
							}
						}
					} else if (_tmp36_ == ((0 != _tmp35_label1) ? _tmp35_label1 : (_tmp35_label1 = g_quark_from_static_string ("dotted")))) {
						switch (0) {
							default:
							{
								gchar* _tmp38_;
								_tmp38_ = g_strdup ("dot");
								_g_free0 (dash);
								dash = _tmp38_;
								break;
							}
						}
					}
					_tmp39_ = xmlNewNode (NULL, (xmlChar*) "relationship");
					relation = _tmp39_;
					_tmp40_ = relation;
					_tmp41_ = conn;
					_tmp42_ = connection_get_from_node (_tmp41_);
					_tmp43_ = _tmp42_;
					_tmp44_ = g_strdup_printf ("%i", node_id (_tmp43_));
					_tmp45_ = _tmp44_;
					xmlSetProp (_tmp40_, (xmlChar*) "end1", (xmlChar*) _tmp45_);
					_g_free0 (_tmp45_);
					_tmp46_ = relation;
					_tmp47_ = conn;
					_tmp48_ = connection_get_to_node (_tmp47_);
					_tmp49_ = _tmp48_;
					_tmp50_ = g_strdup_printf ("%i", node_id (_tmp49_));
					_tmp51_ = _tmp50_;
					xmlSetProp (_tmp46_, (xmlChar*) "end2", (xmlChar*) _tmp51_);
					_g_free0 (_tmp51_);
					_tmp52_ = relation;
					_tmp53_ = g_strdup_printf ("%i", conn_id);
					_tmp54_ = _tmp53_;
					xmlSetProp (_tmp52_, (xmlChar*) "id", (xmlChar*) _tmp54_);
					_g_free0 (_tmp54_);
					_tmp55_ = relation;
					_tmp56_ = g_strdup_printf ("%i", style_id);
					_tmp57_ = _tmp56_;
					xmlSetProp (_tmp55_, (xmlChar*) "style-id", (xmlChar*) _tmp57_);
					_g_free0 (_tmp57_);
					_tmp58_ = relation;
					xmlSetProp (_tmp58_, (xmlChar*) "timestamp", (xmlChar*) timestamp);
					_tmp59_ = conn;
					_tmp60_ = connection_get_title (_tmp59_);
					_tmp61_ = _tmp60_;
					if (_tmp61_ != NULL) {
						xmlNode* title = NULL;
						xmlNode* _tmp62_;
						xmlNode* _tmp63_;
						Connection* _tmp64_;
						CanvasText* _tmp65_;
						CanvasText* _tmp66_;
						FormattedText* _tmp67_;
						FormattedText* _tmp68_;
						const gchar* _tmp69_;
						const gchar* _tmp70_;
						xmlNode* _tmp71_;
						xmlNode* _tmp72_;
						_tmp62_ = xmlNewNode (NULL, (xmlChar*) "title");
						title = _tmp62_;
						_tmp63_ = title;
						_tmp64_ = conn;
						_tmp65_ = connection_get_title (_tmp64_);
						_tmp66_ = _tmp65_;
						_tmp67_ = canvas_text_get_text (_tmp66_);
						_tmp68_ = _tmp67_;
						_tmp69_ = formatted_text_get_text (_tmp68_);
						_tmp70_ = _tmp69_;
						xmlNodeAddContent (_tmp63_, (xmlChar*) _tmp70_);
						_tmp71_ = relation;
						_tmp72_ = title;
						xmlAddChild (_tmp71_, _tmp72_);
					}
					_tmp73_ = relations;
					_tmp74_ = relation;
					xmlAddChild (_tmp73_, _tmp74_);
					_tmp75_ = xmlNewNode (NULL, (xmlChar*) "style");
					style = _tmp75_;
					_tmp76_ = xmlNewNode (NULL, (xmlChar*) "relationship-properties");
					props = _tmp76_;
					_tmp78_ = conn;
					_tmp79_ = connection_get_style (_tmp78_);
					_tmp80_ = _tmp79_;
					_tmp81_ = style_get_connection_arrow (_tmp80_);
					_tmp82_ = _tmp81_;
					if (g_strcmp0 (_tmp82_, "tofrom") == 0) {
						_tmp77_ = TRUE;
					} else {
						Connection* _tmp83_;
						Style* _tmp84_;
						Style* _tmp85_;
						const gchar* _tmp86_;
						const gchar* _tmp87_;
						_tmp83_ = conn;
						_tmp84_ = connection_get_style (_tmp83_);
						_tmp85_ = _tmp84_;
						_tmp86_ = style_get_connection_arrow (_tmp85_);
						_tmp87_ = _tmp86_;
						_tmp77_ = g_strcmp0 (_tmp87_, "both") == 0;
					}
					from_arrow = _tmp77_;
					_tmp89_ = conn;
					_tmp90_ = connection_get_style (_tmp89_);
					_tmp91_ = _tmp90_;
					_tmp92_ = style_get_connection_arrow (_tmp91_);
					_tmp93_ = _tmp92_;
					if (g_strcmp0 (_tmp93_, "fromto") == 0) {
						_tmp88_ = TRUE;
					} else {
						Connection* _tmp94_;
						Style* _tmp95_;
						Style* _tmp96_;
						const gchar* _tmp97_;
						const gchar* _tmp98_;
						_tmp94_ = conn;
						_tmp95_ = connection_get_style (_tmp94_);
						_tmp96_ = _tmp95_;
						_tmp97_ = style_get_connection_arrow (_tmp96_);
						_tmp98_ = _tmp97_;
						_tmp88_ = g_strcmp0 (_tmp98_, "both") == 0;
					}
					to_arrow = _tmp88_;
					if (from_arrow) {
						_tmp99_ = "triangle";
					} else {
						_tmp99_ = "none";
					}
					_tmp100_ = props;
					_tmp101_ = g_strdup_printf ("org.xmind.arrowShape.%s", _tmp99_);
					_tmp102_ = _tmp101_;
					xmlSetProp (_tmp100_, (xmlChar*) "arrow-begin-class", (xmlChar*) _tmp102_);
					_g_free0 (_tmp102_);
					if (to_arrow) {
						_tmp103_ = "triangle";
					} else {
						_tmp103_ = "none";
					}
					_tmp104_ = props;
					_tmp105_ = g_strdup_printf ("org.xmind.arrowShape.%s", _tmp103_);
					_tmp106_ = _tmp105_;
					xmlSetProp (_tmp104_, (xmlChar*) "arrow-end-class", (xmlChar*) _tmp106_);
					_g_free0 (_tmp106_);
					_tmp107_ = props;
					_tmp108_ = color;
					_tmp109_ = *_tmp108_;
					_tmp110_ = utils_color_from_rgba (&_tmp109_);
					_tmp111_ = _tmp110_;
					xmlSetProp (_tmp107_, (xmlChar*) "line-color", (xmlChar*) _tmp111_);
					_g_free0 (_tmp111_);
					_tmp112_ = props;
					_tmp113_ = dash;
					xmlSetProp (_tmp112_, (xmlChar*) "line-pattern", (xmlChar*) _tmp113_);
					_tmp114_ = props;
					_tmp115_ = conn;
					_tmp116_ = connection_get_style (_tmp115_);
					_tmp117_ = _tmp116_;
					_tmp118_ = style_get_connection_line_width (_tmp117_);
					_tmp119_ = _tmp118_;
					_tmp120_ = g_strdup_printf ("%dpt", *_tmp119_);
					_tmp121_ = _tmp120_;
					xmlSetProp (_tmp114_, (xmlChar*) "line-width", (xmlChar*) _tmp121_);
					_g_free0 (_tmp121_);
					_tmp122_ = props;
					xmlSetProp (_tmp122_, (xmlChar*) "shape-class", (xmlChar*) "org.xmind.relationshipShape.curved");
					_tmp123_ = style;
					_tmp124_ = props;
					xmlAddChild (_tmp123_, _tmp124_);
					_tmp125_ = style;
					g_array_append_val (styles, _tmp125_);
					_g_free0 (dash);
					__vala_GdkRGBA_free0 (color);
					__vala_GdkRGBA_free0 (_tmp15_);
					_g_object_unref0 (conn);
				}
			}
		}
		_tmp126_ = relations;
		xmlAddChild (sheet, _tmp126_);
	}
	_g_array_unref0 (conns);
}

static void
export_xmind8_export_styles (ExportXMind8* self,
                             const gchar* dir,
                             ExportXMind8FileItems* file_list,
                             GArray* nodes)
{
	xmlDoc* doc = NULL;
	xmlDoc* _tmp0_;
	xmlNode* xmap = NULL;
	xmlNode* _tmp1_;
	xmlNode* styles = NULL;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	xmlNode* _tmp4_;
	xmlNode* _tmp5_;
	xmlNode* _tmp6_;
	xmlNode* _tmp11_;
	xmlNode* _tmp12_;
	xmlDoc* _tmp13_;
	xmlNode* _tmp14_;
	xmlDoc* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	xmlDoc* _tmp18_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (file_list != NULL);
	g_return_if_fail (nodes != NULL);
	_tmp0_ = xmlNewDoc ((xmlChar*) "1.0");
	doc = _tmp0_;
	_tmp1_ = xmlNewNode (NULL, (xmlChar*) "xmap-styles");
	xmap = _tmp1_;
	_tmp2_ = xmlNewNode (NULL, (xmlChar*) "styles");
	styles = _tmp2_;
	_tmp3_ = xmap;
	xmlSetProp (_tmp3_, (xmlChar*) "xmlns", (xmlChar*) "urn:xmind:xmap:xmlns:content:2.0");
	_tmp4_ = xmap;
	xmlSetProp (_tmp4_, (xmlChar*) "xmlns:fo", (xmlChar*) "http://www.w3.org/1999/XSL/Format");
	_tmp5_ = xmap;
	xmlSetProp (_tmp5_, (xmlChar*) "xmlns:svg", (xmlChar*) "http://www.w3.org/2000/svg");
	_tmp6_ = xmap;
	xmlSetProp (_tmp6_, (xmlChar*) "version", (xmlChar*) "2.0");
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp7_ = FALSE;
			_tmp7_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp9_;
				xmlNode* _tmp10_;
				if (!_tmp7_) {
					gint _tmp8_;
					_tmp8_ = i;
					i = _tmp8_ + 1;
				}
				_tmp7_ = FALSE;
				if (!(((guint) i) < nodes->len)) {
					break;
				}
				_tmp9_ = styles;
				_tmp10_ = g_array_index (nodes, xmlNode*, (guint) i);
				xmlAddChild (_tmp9_, _tmp10_);
			}
		}
	}
	_tmp11_ = xmap;
	_tmp12_ = styles;
	xmlAddChild (_tmp11_, _tmp12_);
	_tmp13_ = doc;
	_tmp14_ = xmap;
	xmlDocSetRootElement (_tmp13_, _tmp14_);
	_tmp15_ = doc;
	_tmp16_ = g_build_filename (dir, "styles.xml", NULL);
	_tmp17_ = _tmp16_;
	xmlSaveFormatFile (_tmp17_, _tmp15_, 1);
	_g_free0 (_tmp17_);
	export_xmind8_file_items_add (file_list, "styles.xml", "text/xml");
	_tmp18_ = doc;
	_xmlFreeDoc0 (_tmp18_);
}

static gchar*
g_date_time_to_string (GDateTime* self)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_date_time_format (self, "%FT%H:%M:%S%z");
	result = _tmp0_;
	return result;
}

static void
export_xmind8_export_meta (ExportXMind8* self,
                           MindMap* map,
                           const gchar* dir,
                           ExportXMind8FileItems* file_list)
{
	xmlDoc* doc = NULL;
	xmlDoc* _tmp0_;
	xmlNode* meta = NULL;
	xmlNode* _tmp1_;
	xmlNode* create = NULL;
	xmlNode* _tmp2_;
	xmlNode* time = NULL;
	xmlNode* _tmp3_;
	xmlNode* creator = NULL;
	xmlNode* _tmp4_;
	xmlNode* name = NULL;
	xmlNode* _tmp5_;
	xmlNode* version = NULL;
	xmlNode* _tmp6_;
	gchar* timestamp = NULL;
	GTimeZone* _tmp7_;
	GTimeZone* _tmp8_;
	GDateTime* _tmp9_;
	GDateTime* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (file_list != NULL);
	_tmp0_ = xmlNewDoc ((xmlChar*) "1.0");
	doc = _tmp0_;
	_tmp1_ = xmlNewNode (NULL, (xmlChar*) "meta");
	meta = _tmp1_;
	_tmp2_ = xmlNewNode (NULL, (xmlChar*) "Create");
	create = _tmp2_;
	_tmp3_ = xmlNewNode (NULL, (xmlChar*) "Time");
	time = _tmp3_;
	_tmp4_ = xmlNewNode (NULL, (xmlChar*) "Creator");
	creator = _tmp4_;
	_tmp5_ = xmlNewNode (NULL, (xmlChar*) "Name");
	name = _tmp5_;
	_tmp6_ = xmlNewNode (NULL, (xmlChar*) "Version");
	version = _tmp6_;
	_tmp7_ = g_time_zone_new_local ();
	_tmp8_ = _tmp7_;
	_tmp9_ = g_date_time_new_now (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_date_time_to_string (_tmp10_);
	_tmp12_ = _tmp11_;
	_g_date_time_unref0 (_tmp10_);
	_g_time_zone_unref0 (_tmp8_);
	timestamp = _tmp12_;
	xmlSetProp (meta, (xmlChar*) "xmlns", (xmlChar*) "urn:xmind:xmap:xmlns:meta:2.0");
	xmlSetProp (meta, (xmlChar*) "version", (xmlChar*) "2.0");
	xmlNodeSetContent (time, (xmlChar*) timestamp);
	xmlNodeSetContent (name, (xmlChar*) "Minder");
	_tmp13_ = minder_version;
	xmlNodeSetContent (version, (xmlChar*) _tmp13_);
	xmlAddChild (create, time);
	xmlAddChild (meta, create);
	xmlAddChild (creator, name);
	xmlAddChild (creator, version);
	xmlAddChild (meta, creator);
	xmlDocSetRootElement (doc, meta);
	_tmp14_ = g_build_filename (dir, "meta.xml", NULL);
	_tmp15_ = _tmp14_;
	xmlSaveFormatFile (_tmp15_, doc, 1);
	_g_free0 (_tmp15_);
	export_xmind8_file_items_add (file_list, "meta.xml", "text/xml");
	_xmlFreeDoc0 (doc);
	_g_free0 (timestamp);
}

static void
export_xmind8_archive_contents (ExportXMind8* self,
                                const gchar* dir,
                                const gchar* outname,
                                ExportXMind8FileItems* 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_;
				ExportXMind8FileItem* _tmp9_;
				const gchar* _tmp10_;
				GFile* file = NULL;
				GArray* _tmp11_;
				ExportXMind8FileItem* _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_, ExportXMind8FileItem*, (guint) i);
				_tmp10_ = _tmp9_->type;
				if (g_strcmp0 (_tmp10_, "") == 0) {
					continue;
				}
				_tmp11_ = files->items;
				_tmp12_ = g_array_index (_tmp11_, ExportXMind8FileItem*, (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 ("ExportXMind8.vala:585: 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 ("ExportXMind8.vala:599: %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 ("ExportXMind8.vala:604: Error : %s (%d)", _tmp54_, archive_errno (_tmp55_));
	}
	_archive_write_free0 (archive);
	_g_object_unref0 (pwd);
}

static gboolean
export_xmind8_real_import (Export* base,
                           const gchar* fname,
                           MindMap* map)
{
	ExportXMind8 * self;
	gchar* dir = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	GeeHashMap* id_map = NULL;
	GeeHashMap* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_;
	gchar* styles = NULL;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* content = NULL;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	GeeHashMap* _tmp14_;
	const gchar* _tmp15_;
	GeeHashMap* _tmp16_;
	gboolean result;
	self = (ExportXMind8*) 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_ = dir;
	export_xmind8_unarchive_contents (self, fname, _tmp2_);
	_tmp3_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, EXPORT_XMIND8_TYPE_ID_OBJECT, (GBoxedCopyFunc) export_xmind8_id_object_ref, (GDestroyNotify) export_xmind8_id_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	id_map = _tmp3_;
	_tmp4_ = dir;
	_tmp5_ = g_build_filename (_tmp4_, "content.json", NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_file_test (_tmp6_, G_FILE_TEST_EXISTS);
	_g_free0 (_tmp6_);
	if (_tmp7_) {
		result = FALSE;
		_g_object_unref0 (id_map);
		_g_free0 (dir);
		return result;
	}
	_tmp8_ = dir;
	_tmp9_ = g_build_filename (_tmp8_, "styles.xml", NULL);
	styles = _tmp9_;
	_tmp10_ = dir;
	_tmp11_ = g_build_filename (_tmp10_, "content.xml", NULL);
	content = _tmp11_;
	_tmp12_ = content;
	_tmp13_ = dir;
	_tmp14_ = id_map;
	export_xmind8_import_content (self, map, _tmp12_, _tmp13_, _tmp14_);
	_tmp15_ = styles;
	_tmp16_ = id_map;
	export_xmind8_import_styles (self, map, _tmp15_, _tmp16_);
	mind_map_queue_draw (map);
	mind_map_auto_save (map);
	result = TRUE;
	_g_free0 (content);
	_g_free0 (styles);
	_g_object_unref0 (id_map);
	_g_free0 (dir);
	return result;
}

static gboolean
export_xmind8_import_content (ExportXMind8* self,
                              MindMap* map,
                              const gchar* fname,
                              const gchar* dir,
                              GeeHashMap* id_map)
{
	xmlDoc* doc = NULL;
	xmlDoc* _tmp0_;
	xmlDoc* _tmp1_;
	xmlDoc* _tmp2_;
	xmlNode* _tmp3_;
	xmlDoc* _tmp4_;
	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_ = xmlReadFile (fname, NULL, (gint) XML_PARSE_HUGE);
	doc = _tmp0_;
	_tmp1_ = doc;
	if (_tmp1_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp2_ = doc;
	_tmp3_ = xmlDocGetRootElement (_tmp2_);
	export_xmind8_import_map (self, map, _tmp3_, dir, id_map);
	_tmp4_ = doc;
	_xmlFreeDoc0 (_tmp4_);
	result = TRUE;
	return result;
}

static void
export_xmind8_import_map (ExportXMind8* self,
                          MindMap* map,
                          xmlNode* n,
                          const gchar* dir,
                          GeeHashMap* id_map)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (id_map != NULL);
	{
		xmlNode* it = NULL;
		xmlNode* _tmp0_;
		_tmp0_ = n->children;
		it = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp4_;
				gboolean _tmp5_ = FALSE;
				xmlNode* _tmp6_;
				if (!_tmp1_) {
					xmlNode* _tmp2_;
					xmlNode* _tmp3_;
					_tmp2_ = it;
					_tmp3_ = _tmp2_->next;
					it = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = it;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp6_ = it;
				if (_tmp6_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp7_;
					const gchar* _tmp8_;
					_tmp7_ = it;
					_tmp8_ = _tmp7_->name;
					_tmp5_ = g_strcmp0 (_tmp8_, "sheet") == 0;
				} else {
					_tmp5_ = FALSE;
				}
				if (_tmp5_) {
					xmlNode* _tmp9_;
					_tmp9_ = it;
					export_xmind8_import_sheet (self, map, _tmp9_, dir, id_map);
					return;
				}
			}
		}
	}
}

static void
export_xmind8_import_sheet (ExportXMind8* self,
                            MindMap* map,
                            xmlNode* n,
                            const gchar* dir,
                            GeeHashMap* id_map)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (id_map != NULL);
	{
		xmlNode* it = NULL;
		xmlNode* _tmp0_;
		_tmp0_ = n->children;
		it = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp4_;
				xmlNode* _tmp5_;
				if (!_tmp1_) {
					xmlNode* _tmp2_;
					xmlNode* _tmp3_;
					_tmp2_ = it;
					_tmp3_ = _tmp2_->next;
					it = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = it;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp5_ = it;
				if (_tmp5_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp6_;
					const gchar* _tmp7_;
					const gchar* _tmp8_;
					GQuark _tmp10_ = 0U;
					static GQuark _tmp9_label0 = 0;
					static GQuark _tmp9_label1 = 0;
					_tmp6_ = it;
					_tmp7_ = _tmp6_->name;
					_tmp8_ = _tmp7_;
					_tmp10_ = (NULL == _tmp8_) ? 0 : g_quark_from_string (_tmp8_);
					if (_tmp10_ == ((0 != _tmp9_label0) ? _tmp9_label0 : (_tmp9_label0 = g_quark_from_static_string ("topic")))) {
						switch (0) {
							default:
							{
								xmlNode* _tmp11_;
								_tmp11_ = it;
								export_xmind8_import_topic (self, map, NULL, _tmp11_, FALSE, dir, id_map);
								break;
							}
						}
					} else if (_tmp10_ == ((0 != _tmp9_label1) ? _tmp9_label1 : (_tmp9_label1 = g_quark_from_static_string ("relationships")))) {
						switch (0) {
							default:
							{
								xmlNode* _tmp12_;
								_tmp12_ = it;
								export_xmind8_import_relationships (self, map, _tmp12_, id_map);
								break;
							}
						}
					}
				}
			}
		}
	}
}

static void
export_xmind8_import_topic (ExportXMind8* self,
                            MindMap* map,
                            Node* parent,
                            xmlNode* n,
                            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_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (id_map != NULL);
	_tmp0_ = (gchar*) xmlGetProp (n, (xmlChar*) "structure-class");
	sclass = _tmp0_;
	_tmp1_ = sclass;
	if (_tmp1_ != NULL) {
		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_ = (gchar*) xmlGetProp (n, (xmlChar*) "id");
	id = _tmp22_;
	_tmp23_ = id;
	if (_tmp23_ != NULL) {
		const gchar* _tmp24_;
		Node* _tmp25_;
		ExportXMind8IdObject* _tmp26_;
		ExportXMind8IdObject* _tmp27_;
		_tmp24_ = id;
		_tmp25_ = node;
		_tmp26_ = export_xmind8_id_object_new_for_node (_tmp25_);
		_tmp27_ = _tmp26_;
		gee_abstract_map_set ((GeeAbstractMap*) id_map, _tmp24_, _tmp27_);
		_export_xmind8_id_object_unref0 (_tmp27_);
	}
	_tmp28_ = (gchar*) xmlGetProp (n, (xmlChar*) "style-id");
	sid = _tmp28_;
	_tmp29_ = sid;
	if (_tmp29_ != NULL) {
		const gchar* _tmp30_;
		Node* _tmp31_;
		ExportXMind8IdObject* _tmp32_;
		ExportXMind8IdObject* _tmp33_;
		_tmp30_ = sid;
		_tmp31_ = node;
		_tmp32_ = export_xmind8_id_object_new_for_node (_tmp31_);
		_tmp33_ = _tmp32_;
		gee_abstract_map_set ((GeeAbstractMap*) id_map, _tmp30_, _tmp33_);
		_export_xmind8_id_object_unref0 (_tmp33_);
	}
	{
		xmlNode* it = NULL;
		xmlNode* _tmp34_;
		_tmp34_ = n->children;
		it = _tmp34_;
		{
			gboolean _tmp35_ = FALSE;
			_tmp35_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp38_;
				xmlNode* _tmp39_;
				if (!_tmp35_) {
					xmlNode* _tmp36_;
					xmlNode* _tmp37_;
					_tmp36_ = it;
					_tmp37_ = _tmp36_->next;
					it = _tmp37_;
				}
				_tmp35_ = FALSE;
				_tmp38_ = it;
				if (!(_tmp38_ != NULL)) {
					break;
				}
				_tmp39_ = it;
				if (_tmp39_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp40_;
					const gchar* _tmp41_;
					const gchar* _tmp42_;
					GQuark _tmp44_ = 0U;
					static GQuark _tmp43_label0 = 0;
					static GQuark _tmp43_label1 = 0;
					static GQuark _tmp43_label2 = 0;
					static GQuark _tmp43_label3 = 0;
					static GQuark _tmp43_label4 = 0;
					_tmp40_ = it;
					_tmp41_ = _tmp40_->name;
					_tmp42_ = _tmp41_;
					_tmp44_ = (NULL == _tmp42_) ? 0 : g_quark_from_string (_tmp42_);
					if (_tmp44_ == ((0 != _tmp43_label0) ? _tmp43_label0 : (_tmp43_label0 = g_quark_from_static_string ("title")))) {
						switch (0) {
							default:
							{
								Node* _tmp45_;
								xmlNode* _tmp46_;
								_tmp45_ = node;
								_tmp46_ = it;
								export_xmind8_import_node_name (self, _tmp45_, _tmp46_);
								break;
							}
						}
					} else if (_tmp44_ == ((0 != _tmp43_label1) ? _tmp43_label1 : (_tmp43_label1 = g_quark_from_static_string ("notes")))) {
						switch (0) {
							default:
							{
								Node* _tmp47_;
								xmlNode* _tmp48_;
								_tmp47_ = node;
								_tmp48_ = it;
								export_xmind8_import_node_notes (self, _tmp47_, _tmp48_);
								break;
							}
						}
					} else if (_tmp44_ == ((0 != _tmp43_label2) ? _tmp43_label2 : (_tmp43_label2 = g_quark_from_static_string ("img")))) {
						switch (0) {
							default:
							{
								Node* _tmp49_;
								xmlNode* _tmp50_;
								_tmp49_ = node;
								_tmp50_ = it;
								export_xmind8_import_image (self, map, _tmp49_, _tmp50_, dir, id_map);
								break;
							}
						}
					} else if (_tmp44_ == ((0 != _tmp43_label3) ? _tmp43_label3 : (_tmp43_label3 = g_quark_from_static_string ("children")))) {
						switch (0) {
							default:
							{
								Node* _tmp51_;
								xmlNode* _tmp52_;
								_tmp51_ = node;
								_tmp52_ = it;
								export_xmind8_import_children (self, map, _tmp51_, _tmp52_, dir, id_map);
								break;
							}
						}
					} else if (_tmp44_ == ((0 != _tmp43_label4) ? _tmp43_label4 : (_tmp43_label4 = g_quark_from_static_string ("boundaries")))) {
						switch (0) {
							default:
							{
								Node* _tmp53_;
								xmlNode* _tmp54_;
								_tmp53_ = node;
								_tmp54_ = it;
								export_xmind8_import_boundaries (self, map, _tmp53_, _tmp54_, id_map);
								break;
							}
						}
					}
				}
			}
		}
	}
	_g_free0 (sid);
	_g_free0 (id);
	_g_free0 (sclass);
	_g_object_unref0 (node);
}

static gchar*
export_xmind8_get_title (ExportXMind8* self,
                         xmlNode* n)
{
	gchar* _tmp9_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	{
		xmlNode* it = NULL;
		xmlNode* _tmp0_;
		_tmp0_ = n->children;
		it = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp4_;
				xmlNode* _tmp5_;
				if (!_tmp1_) {
					xmlNode* _tmp2_;
					xmlNode* _tmp3_;
					_tmp2_ = it;
					_tmp3_ = _tmp2_->next;
					it = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = it;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp5_ = it;
				if (_tmp5_->type == XML_TEXT_NODE) {
					xmlNode* _tmp6_;
					const gchar* _tmp7_;
					gchar* _tmp8_;
					_tmp6_ = it;
					_tmp7_ = _tmp6_->content;
					_tmp8_ = g_strdup (_tmp7_);
					result = _tmp8_;
					return result;
				}
			}
		}
	}
	_tmp9_ = g_strdup ("");
	result = _tmp9_;
	return result;
}

static void
export_xmind8_import_node_name (ExportXMind8* self,
                                Node* node,
                                xmlNode* n)
{
	CanvasText* _tmp0_;
	CanvasText* _tmp1_;
	FormattedText* _tmp2_;
	FormattedText* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = node_get_name (node);
	_tmp1_ = _tmp0_;
	_tmp2_ = canvas_text_get_text (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = export_xmind8_get_title (self, n);
	_tmp5_ = _tmp4_;
	formatted_text_insert_text (_tmp3_, 0, _tmp5_);
	_g_free0 (_tmp5_);
}

static void
export_xmind8_import_node_notes (ExportXMind8* self,
                                 Node* node,
                                 xmlNode* n)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	{
		xmlNode* it = NULL;
		xmlNode* _tmp0_;
		_tmp0_ = n->children;
		it = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp4_;
				xmlNode* _tmp5_;
				if (!_tmp1_) {
					xmlNode* _tmp2_;
					xmlNode* _tmp3_;
					_tmp2_ = it;
					_tmp3_ = _tmp2_->next;
					it = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = it;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp5_ = it;
				if (_tmp5_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp6_;
					const gchar* _tmp7_;
					const gchar* _tmp8_;
					GQuark _tmp10_ = 0U;
					static GQuark _tmp9_label0 = 0;
					_tmp6_ = it;
					_tmp7_ = _tmp6_->name;
					_tmp8_ = _tmp7_;
					_tmp10_ = (NULL == _tmp8_) ? 0 : g_quark_from_string (_tmp8_);
					if (_tmp10_ == ((0 != _tmp9_label0) ? _tmp9_label0 : (_tmp9_label0 = g_quark_from_static_string ("plain")))) {
						switch (0) {
							default:
							{
								xmlNode* _tmp11_;
								_tmp11_ = it;
								export_xmind8_import_note_plain (self, node, _tmp11_);
								break;
							}
						}
					}
				}
			}
		}
	}
}

static void
export_xmind8_import_note_plain (ExportXMind8* self,
                                 Node* node,
                                 xmlNode* n)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = export_xmind8_get_title (self, n);
	_tmp1_ = _tmp0_;
	node_set_note (node, _tmp1_);
	_g_free0 (_tmp1_);
}

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_xmind8_import_image (ExportXMind8* self,
                            MindMap* map,
                            Node* node,
                            xmlNode* n,
                            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 (dir != NULL);
	g_return_if_fail (id_map != NULL);
	height = 1;
	width = 1;
	_tmp0_ = (gchar*) xmlGetProp (n, (xmlChar*) "style-id");
	sid = _tmp0_;
	_tmp1_ = sid;
	if (_tmp1_ != NULL) {
	}
	_tmp2_ = (gchar*) xmlGetProp (n, (xmlChar*) "height");
	h = _tmp2_;
	_tmp3_ = h;
	if (_tmp3_ != NULL) {
		const gchar* _tmp4_;
		_tmp4_ = h;
		height = atoi (_tmp4_);
	}
	_tmp5_ = (gchar*) xmlGetProp (n, (xmlChar*) "width");
	w = _tmp5_;
	_tmp6_ = w;
	if (_tmp6_ != NULL) {
		const gchar* _tmp7_;
		_tmp7_ = w;
		width = atoi (_tmp7_);
	}
	_tmp8_ = (gchar*) xmlGetProp (n, (xmlChar*) "src");
	src = _tmp8_;
	_tmp9_ = src;
	if (_tmp9_ != NULL) {
		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_xmind8_import_children (ExportXMind8* self,
                               MindMap* map,
                               Node* node,
                               xmlNode* n,
                               const gchar* dir,
                               GeeHashMap* id_map)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (node != NULL);
	g_return_if_fail (dir != NULL);
	g_return_if_fail (id_map != NULL);
	{
		xmlNode* it = NULL;
		xmlNode* _tmp0_;
		_tmp0_ = n->children;
		it = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp4_;
				gboolean _tmp5_ = FALSE;
				xmlNode* _tmp6_;
				if (!_tmp1_) {
					xmlNode* _tmp2_;
					xmlNode* _tmp3_;
					_tmp2_ = it;
					_tmp3_ = _tmp2_->next;
					it = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = it;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp6_ = it;
				if (_tmp6_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp7_;
					const gchar* _tmp8_;
					_tmp7_ = it;
					_tmp8_ = _tmp7_->name;
					_tmp5_ = g_strcmp0 (_tmp8_, "topics") == 0;
				} else {
					_tmp5_ = FALSE;
				}
				if (_tmp5_) {
					gchar* t = NULL;
					xmlNode* _tmp9_;
					gchar* _tmp10_;
					gboolean _tmp11_ = FALSE;
					const gchar* _tmp12_;
					gboolean attached = FALSE;
					_tmp9_ = it;
					_tmp10_ = (gchar*) xmlGetProp (_tmp9_, (xmlChar*) "type");
					t = _tmp10_;
					_tmp12_ = t;
					if (_tmp12_ != NULL) {
						const gchar* _tmp13_;
						_tmp13_ = t;
						_tmp11_ = g_strcmp0 (_tmp13_, "attached") == 0;
					} else {
						_tmp11_ = FALSE;
					}
					attached = _tmp11_;
					{
						xmlNode* it2 = NULL;
						xmlNode* _tmp14_;
						xmlNode* _tmp15_;
						_tmp14_ = it;
						_tmp15_ = _tmp14_->children;
						it2 = _tmp15_;
						{
							gboolean _tmp16_ = FALSE;
							_tmp16_ = TRUE;
							while (TRUE) {
								xmlNode* _tmp19_;
								gboolean _tmp20_ = FALSE;
								xmlNode* _tmp21_;
								if (!_tmp16_) {
									xmlNode* _tmp17_;
									xmlNode* _tmp18_;
									_tmp17_ = it2;
									_tmp18_ = _tmp17_->next;
									it2 = _tmp18_;
								}
								_tmp16_ = FALSE;
								_tmp19_ = it2;
								if (!(_tmp19_ != NULL)) {
									break;
								}
								_tmp21_ = it2;
								if (_tmp21_->type == XML_ELEMENT_NODE) {
									xmlNode* _tmp22_;
									const gchar* _tmp23_;
									_tmp22_ = it2;
									_tmp23_ = _tmp22_->name;
									_tmp20_ = g_strcmp0 (_tmp23_, "topic") == 0;
								} else {
									_tmp20_ = FALSE;
								}
								if (_tmp20_) {
									xmlNode* _tmp24_;
									_tmp24_ = it2;
									export_xmind8_import_topic (self, map, node, _tmp24_, attached, dir, id_map);
								}
							}
						}
					}
					_g_free0 (t);
				}
			}
		}
	}
}

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_xmind8_import_boundaries (ExportXMind8* self,
                                 MindMap* map,
                                 Node* node,
                                 xmlNode* n,
                                 GeeHashMap* id_map)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (node != NULL);
	g_return_if_fail (id_map != NULL);
	{
		xmlNode* it = NULL;
		xmlNode* _tmp0_;
		_tmp0_ = n->children;
		it = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp4_;
				gboolean _tmp5_ = FALSE;
				xmlNode* _tmp6_;
				if (!_tmp1_) {
					xmlNode* _tmp2_;
					xmlNode* _tmp3_;
					_tmp2_ = it;
					_tmp3_ = _tmp2_->next;
					it = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = it;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp6_ = it;
				if (_tmp6_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp7_;
					const gchar* _tmp8_;
					_tmp7_ = it;
					_tmp8_ = _tmp7_->name;
					_tmp5_ = g_strcmp0 (_tmp8_, "boundary") == 0;
				} else {
					_tmp5_ = FALSE;
				}
				if (_tmp5_) {
					gchar* sid = NULL;
					xmlNode* _tmp9_;
					gchar* _tmp10_;
					gchar* r = NULL;
					xmlNode* _tmp11_;
					gchar* _tmp12_;
					const gchar* _tmp13_;
					_tmp9_ = it;
					_tmp10_ = (gchar*) xmlGetProp (_tmp9_, (xmlChar*) "style-id");
					sid = _tmp10_;
					_tmp11_ = it;
					_tmp12_ = (gchar*) xmlGetProp (_tmp11_, (xmlChar*) "range");
					r = _tmp12_;
					_tmp13_ = r;
					if (_tmp13_ != NULL) {
						gint start = 0;
						gint end = 0;
						const gchar* _tmp14_;
						start = -1;
						end = -1;
						_tmp14_ = r;
						if (sscanf (_tmp14_, "(%d,%d)", &start, &end) == 2) {
							GArray* nodes = NULL;
							GArray* _tmp15_;
							NodeGroup* group = NULL;
							GArray* _tmp26_;
							NodeGroup* _tmp27_;
							NodeGroups* _tmp28_;
							NodeGroups* _tmp29_;
							NodeGroup* _tmp30_;
							const gchar* _tmp31_;
							_tmp15_ = g_array_new (TRUE, TRUE, sizeof (Node*));
							g_array_set_clear_func (_tmp15_, (GDestroyNotify) _vala_Node_free_function_content_of);
							nodes = _tmp15_;
							{
								gint i = 0;
								i = start;
								{
									gboolean _tmp16_ = FALSE;
									_tmp16_ = TRUE;
									while (TRUE) {
										Node* child = NULL;
										GArray* _tmp18_;
										GArray* _tmp19_;
										Node* _tmp20_;
										Node* _tmp21_;
										Node* _tmp22_;
										GArray* _tmp23_;
										Node* _tmp24_;
										Node* _tmp25_;
										if (!_tmp16_) {
											gint _tmp17_;
											_tmp17_ = i;
											i = _tmp17_ + 1;
										}
										_tmp16_ = FALSE;
										if (!(i <= end)) {
											break;
										}
										_tmp18_ = node_children (node);
										_tmp19_ = _tmp18_;
										_tmp20_ = g_array_index (_tmp19_, Node*, (guint) i);
										_tmp21_ = _g_object_ref0 (_tmp20_);
										_tmp22_ = _tmp21_;
										_g_array_unref0 (_tmp19_);
										child = _tmp22_;
										_tmp23_ = nodes;
										_tmp24_ = child;
										_tmp25_ = _g_object_ref0 (_tmp24_);
										g_array_append_val (_tmp23_, _tmp25_);
										_g_object_unref0 (child);
									}
								}
							}
							_tmp26_ = nodes;
							_tmp27_ = node_group_new_array (map, _tmp26_);
							group = _tmp27_;
							_tmp28_ = mind_map_get_groups (map);
							_tmp29_ = _tmp28_;
							_tmp30_ = group;
							node_groups_add_group (_tmp29_, _tmp30_);
							_tmp31_ = sid;
							if (_tmp31_ != NULL) {
								const gchar* _tmp32_;
								NodeGroup* _tmp33_;
								ExportXMind8IdObject* _tmp34_;
								ExportXMind8IdObject* _tmp35_;
								_tmp32_ = sid;
								_tmp33_ = group;
								_tmp34_ = export_xmind8_id_object_new_for_boundary (_tmp33_);
								_tmp35_ = _tmp34_;
								gee_abstract_map_set ((GeeAbstractMap*) id_map, _tmp32_, _tmp35_);
								_export_xmind8_id_object_unref0 (_tmp35_);
							}
							_g_object_unref0 (group);
							_g_array_unref0 (nodes);
						}
					}
					_g_free0 (r);
					_g_free0 (sid);
				}
			}
		}
	}
}

static void
export_xmind8_import_relationships (ExportXMind8* self,
                                    MindMap* map,
                                    xmlNode* n,
                                    GeeHashMap* id_map)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (id_map != NULL);
	{
		xmlNode* it = NULL;
		xmlNode* _tmp0_;
		_tmp0_ = n->children;
		it = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp4_;
				gboolean _tmp5_ = FALSE;
				xmlNode* _tmp6_;
				if (!_tmp1_) {
					xmlNode* _tmp2_;
					xmlNode* _tmp3_;
					_tmp2_ = it;
					_tmp3_ = _tmp2_->next;
					it = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = it;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp6_ = it;
				if (_tmp6_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp7_;
					const gchar* _tmp8_;
					_tmp7_ = it;
					_tmp8_ = _tmp7_->name;
					_tmp5_ = g_strcmp0 (_tmp8_, "relationship") == 0;
				} else {
					_tmp5_ = FALSE;
				}
				if (_tmp5_) {
					Node* from_node = NULL;
					Node* to_node = NULL;
					gchar* sid = NULL;
					xmlNode* _tmp9_;
					gchar* _tmp10_;
					gchar* sp = NULL;
					xmlNode* _tmp11_;
					gchar* _tmp12_;
					const gchar* _tmp13_;
					gchar* ep = NULL;
					xmlNode* _tmp23_;
					gchar* _tmp24_;
					const gchar* _tmp25_;
					gchar* title = NULL;
					gchar* _tmp35_;
					gboolean _tmp48_ = FALSE;
					Node* _tmp49_;
					from_node = NULL;
					to_node = NULL;
					_tmp9_ = it;
					_tmp10_ = (gchar*) xmlGetProp (_tmp9_, (xmlChar*) "style-id");
					sid = _tmp10_;
					_tmp11_ = it;
					_tmp12_ = (gchar*) xmlGetProp (_tmp11_, (xmlChar*) "end1");
					sp = _tmp12_;
					_tmp13_ = sp;
					if (_tmp13_ != NULL) {
						ExportXMind8IdObject* obj = NULL;
						const gchar* _tmp14_;
						gpointer _tmp15_;
						ExportXMind8IdObject* _tmp16_;
						ExportXMind8IdObjectType _tmp17_;
						ExportXMind8IdObjectType _tmp18_;
						_tmp14_ = sp;
						_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) id_map, _tmp14_);
						obj = (ExportXMind8IdObject*) _tmp15_;
						_tmp16_ = obj;
						_tmp17_ = export_xmind8_id_object_get_typ (_tmp16_);
						_tmp18_ = _tmp17_;
						if (_tmp18_ == EXPORT_XMIND8_ID_OBJECT_TYPE_NODE) {
							ExportXMind8IdObject* _tmp19_;
							Node* _tmp20_;
							Node* _tmp21_;
							Node* _tmp22_;
							_tmp19_ = obj;
							_tmp20_ = export_xmind8_id_object_get_node (_tmp19_);
							_tmp21_ = _tmp20_;
							_tmp22_ = _g_object_ref0 (_tmp21_);
							_g_object_unref0 (from_node);
							from_node = _tmp22_;
						}
						_export_xmind8_id_object_unref0 (obj);
					}
					_tmp23_ = it;
					_tmp24_ = (gchar*) xmlGetProp (_tmp23_, (xmlChar*) "end2");
					ep = _tmp24_;
					_tmp25_ = ep;
					if (_tmp25_ != NULL) {
						ExportXMind8IdObject* obj = NULL;
						const gchar* _tmp26_;
						gpointer _tmp27_;
						ExportXMind8IdObject* _tmp28_;
						ExportXMind8IdObjectType _tmp29_;
						ExportXMind8IdObjectType _tmp30_;
						_tmp26_ = ep;
						_tmp27_ = gee_abstract_map_get ((GeeAbstractMap*) id_map, _tmp26_);
						obj = (ExportXMind8IdObject*) _tmp27_;
						_tmp28_ = obj;
						_tmp29_ = export_xmind8_id_object_get_typ (_tmp28_);
						_tmp30_ = _tmp29_;
						if (_tmp30_ == EXPORT_XMIND8_ID_OBJECT_TYPE_NODE) {
							ExportXMind8IdObject* _tmp31_;
							Node* _tmp32_;
							Node* _tmp33_;
							Node* _tmp34_;
							_tmp31_ = obj;
							_tmp32_ = export_xmind8_id_object_get_node (_tmp31_);
							_tmp33_ = _tmp32_;
							_tmp34_ = _g_object_ref0 (_tmp33_);
							_g_object_unref0 (to_node);
							to_node = _tmp34_;
						}
						_export_xmind8_id_object_unref0 (obj);
					}
					_tmp35_ = g_strdup ("");
					title = _tmp35_;
					{
						xmlNode* it2 = NULL;
						xmlNode* _tmp36_;
						xmlNode* _tmp37_;
						_tmp36_ = it;
						_tmp37_ = _tmp36_->children;
						it2 = _tmp37_;
						{
							gboolean _tmp38_ = FALSE;
							_tmp38_ = TRUE;
							while (TRUE) {
								xmlNode* _tmp41_;
								gboolean _tmp42_ = FALSE;
								xmlNode* _tmp43_;
								if (!_tmp38_) {
									xmlNode* _tmp39_;
									xmlNode* _tmp40_;
									_tmp39_ = it2;
									_tmp40_ = _tmp39_->next;
									it2 = _tmp40_;
								}
								_tmp38_ = FALSE;
								_tmp41_ = it2;
								if (!(_tmp41_ != NULL)) {
									break;
								}
								_tmp43_ = it2;
								if (_tmp43_->type == XML_ELEMENT_NODE) {
									xmlNode* _tmp44_;
									const gchar* _tmp45_;
									_tmp44_ = it2;
									_tmp45_ = _tmp44_->name;
									_tmp42_ = g_strcmp0 (_tmp45_, "title") == 0;
								} else {
									_tmp42_ = FALSE;
								}
								if (_tmp42_) {
									xmlNode* _tmp46_;
									gchar* _tmp47_;
									_tmp46_ = it2;
									_tmp47_ = export_xmind8_get_title (self, _tmp46_);
									_g_free0 (title);
									title = _tmp47_;
								}
							}
						}
					}
					_tmp49_ = from_node;
					if (_tmp49_ != NULL) {
						Node* _tmp50_;
						_tmp50_ = to_node;
						_tmp48_ = _tmp50_ != NULL;
					} else {
						_tmp48_ = FALSE;
					}
					if (_tmp48_) {
						Connection* conn = NULL;
						Node* _tmp51_;
						Connection* _tmp52_;
						Connection* _tmp53_;
						const gchar* _tmp54_;
						Connection* _tmp55_;
						Node* _tmp56_;
						Connections* _tmp57_;
						Connections* _tmp58_;
						Connection* _tmp59_;
						const gchar* _tmp60_;
						_tmp51_ = from_node;
						_tmp52_ = connection_new (map, _tmp51_);
						conn = _tmp52_;
						_tmp53_ = conn;
						_tmp54_ = title;
						connection_change_title (_tmp53_, map, _tmp54_, FALSE);
						_tmp55_ = conn;
						_tmp56_ = to_node;
						connection_connect_to (_tmp55_, _tmp56_);
						_tmp57_ = mind_map_get_connections (map);
						_tmp58_ = _tmp57_;
						_tmp59_ = conn;
						connections_add_connection (_tmp58_, _tmp59_);
						_tmp60_ = sid;
						if (_tmp60_ != NULL) {
							const gchar* _tmp61_;
							Connection* _tmp62_;
							ExportXMind8IdObject* _tmp63_;
							ExportXMind8IdObject* _tmp64_;
							_tmp61_ = sid;
							_tmp62_ = conn;
							_tmp63_ = export_xmind8_id_object_new_for_connection (_tmp62_);
							_tmp64_ = _tmp63_;
							gee_abstract_map_set ((GeeAbstractMap*) id_map, _tmp61_, _tmp64_);
							_export_xmind8_id_object_unref0 (_tmp64_);
						}
						_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);
				}
			}
		}
	}
}

static gboolean
export_xmind8_import_styles (ExportXMind8* self,
                             MindMap* map,
                             const gchar* fname,
                             GeeHashMap* id_map)
{
	xmlDoc* doc = NULL;
	xmlDoc* _tmp0_;
	xmlDoc* _tmp1_;
	xmlDoc* _tmp2_;
	xmlNode* _tmp3_;
	xmlDoc* _tmp4_;
	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 (id_map != NULL, FALSE);
	_tmp0_ = xmlReadFile (fname, NULL, (gint) XML_PARSE_HUGE);
	doc = _tmp0_;
	_tmp1_ = doc;
	if (_tmp1_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp2_ = doc;
	_tmp3_ = xmlDocGetRootElement (_tmp2_);
	export_xmind8_import_styles_content (self, map, _tmp3_, id_map);
	mind_map_queue_draw (map);
	_tmp4_ = doc;
	_xmlFreeDoc0 (_tmp4_);
	result = TRUE;
	return result;
}

static void
export_xmind8_import_styles_content (ExportXMind8* self,
                                     MindMap* map,
                                     xmlNode* n,
                                     GeeHashMap* id_map)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (id_map != NULL);
	{
		xmlNode* it = NULL;
		xmlNode* _tmp0_;
		_tmp0_ = n->children;
		it = _tmp0_;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp4_;
				gboolean _tmp5_ = FALSE;
				xmlNode* _tmp6_;
				if (!_tmp1_) {
					xmlNode* _tmp2_;
					xmlNode* _tmp3_;
					_tmp2_ = it;
					_tmp3_ = _tmp2_->next;
					it = _tmp3_;
				}
				_tmp1_ = FALSE;
				_tmp4_ = it;
				if (!(_tmp4_ != NULL)) {
					break;
				}
				_tmp6_ = it;
				if (_tmp6_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp7_;
					const gchar* _tmp8_;
					_tmp7_ = it;
					_tmp8_ = _tmp7_->name;
					_tmp5_ = g_strcmp0 (_tmp8_, "styles") == 0;
				} else {
					_tmp5_ = FALSE;
				}
				if (_tmp5_) {
					{
						xmlNode* it2 = NULL;
						xmlNode* _tmp9_;
						xmlNode* _tmp10_;
						_tmp9_ = it;
						_tmp10_ = _tmp9_->children;
						it2 = _tmp10_;
						{
							gboolean _tmp11_ = FALSE;
							_tmp11_ = TRUE;
							while (TRUE) {
								xmlNode* _tmp14_;
								gboolean _tmp15_ = FALSE;
								xmlNode* _tmp16_;
								if (!_tmp11_) {
									xmlNode* _tmp12_;
									xmlNode* _tmp13_;
									_tmp12_ = it2;
									_tmp13_ = _tmp12_->next;
									it2 = _tmp13_;
								}
								_tmp11_ = FALSE;
								_tmp14_ = it2;
								if (!(_tmp14_ != NULL)) {
									break;
								}
								_tmp16_ = it;
								if (_tmp16_->type == XML_ELEMENT_NODE) {
									xmlNode* _tmp17_;
									const gchar* _tmp18_;
									_tmp17_ = it2;
									_tmp18_ = _tmp17_->name;
									_tmp15_ = g_strcmp0 (_tmp18_, "style") == 0;
								} else {
									_tmp15_ = FALSE;
								}
								if (_tmp15_) {
									xmlNode* _tmp19_;
									_tmp19_ = it2;
									export_xmind8_import_styles_style (self, map, _tmp19_, id_map);
								}
							}
						}
					}
				}
			}
		}
	}
}

static void
export_xmind8_import_styles_style (ExportXMind8* self,
                                   MindMap* map,
                                   xmlNode* n,
                                   GeeHashMap* id_map)
{
	gchar* id = NULL;
	gchar* _tmp0_;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (id_map != NULL);
	_tmp0_ = (gchar*) xmlGetProp (n, (xmlChar*) "id");
	id = _tmp0_;
	_tmp2_ = id;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		const gchar* _tmp3_;
		_tmp3_ = id;
		_tmp1_ = !gee_abstract_map_has_key ((GeeAbstractMap*) id_map, _tmp3_);
	}
	if (_tmp1_) {
		_g_free0 (id);
		return;
	}
	{
		xmlNode* it = NULL;
		xmlNode* _tmp4_;
		_tmp4_ = n->children;
		it = _tmp4_;
		{
			gboolean _tmp5_ = FALSE;
			_tmp5_ = TRUE;
			while (TRUE) {
				xmlNode* _tmp8_;
				xmlNode* _tmp9_;
				if (!_tmp5_) {
					xmlNode* _tmp6_;
					xmlNode* _tmp7_;
					_tmp6_ = it;
					_tmp7_ = _tmp6_->next;
					it = _tmp7_;
				}
				_tmp5_ = FALSE;
				_tmp8_ = it;
				if (!(_tmp8_ != NULL)) {
					break;
				}
				_tmp9_ = it;
				if (_tmp9_->type == XML_ELEMENT_NODE) {
					xmlNode* _tmp10_;
					const gchar* _tmp11_;
					const gchar* _tmp12_;
					GQuark _tmp14_ = 0U;
					static GQuark _tmp13_label0 = 0;
					static GQuark _tmp13_label1 = 0;
					static GQuark _tmp13_label2 = 0;
					_tmp10_ = it;
					_tmp11_ = _tmp10_->name;
					_tmp12_ = _tmp11_;
					_tmp14_ = (NULL == _tmp12_) ? 0 : g_quark_from_string (_tmp12_);
					if (_tmp14_ == ((0 != _tmp13_label0) ? _tmp13_label0 : (_tmp13_label0 = g_quark_from_static_string ("topic-properties")))) {
						switch (0) {
							default:
							{
								xmlNode* _tmp15_;
								const gchar* _tmp16_;
								gpointer _tmp17_;
								ExportXMind8IdObject* _tmp18_;
								Node* _tmp19_;
								Node* _tmp20_;
								_tmp15_ = it;
								_tmp16_ = id;
								_tmp17_ = gee_abstract_map_get ((GeeAbstractMap*) id_map, _tmp16_);
								_tmp18_ = (ExportXMind8IdObject*) _tmp17_;
								_tmp19_ = export_xmind8_id_object_get_node (_tmp18_);
								_tmp20_ = _tmp19_;
								export_xmind8_import_styles_topic (self, map, _tmp15_, _tmp20_);
								_export_xmind8_id_object_unref0 (_tmp18_);
								break;
							}
						}
					} else if (_tmp14_ == ((0 != _tmp13_label1) ? _tmp13_label1 : (_tmp13_label1 = g_quark_from_static_string ("relationship-properties")))) {
						switch (0) {
							default:
							{
								xmlNode* _tmp21_;
								const gchar* _tmp22_;
								gpointer _tmp23_;
								ExportXMind8IdObject* _tmp24_;
								Connection* _tmp25_;
								Connection* _tmp26_;
								_tmp21_ = it;
								_tmp22_ = id;
								_tmp23_ = gee_abstract_map_get ((GeeAbstractMap*) id_map, _tmp22_);
								_tmp24_ = (ExportXMind8IdObject*) _tmp23_;
								_tmp25_ = export_xmind8_id_object_get_conn (_tmp24_);
								_tmp26_ = _tmp25_;
								export_xmind8_import_styles_connection (self, map, _tmp21_, _tmp26_);
								_export_xmind8_id_object_unref0 (_tmp24_);
								break;
							}
						}
					} else if (_tmp14_ == ((0 != _tmp13_label2) ? _tmp13_label2 : (_tmp13_label2 = g_quark_from_static_string ("boundary-properties")))) {
						switch (0) {
							default:
							{
								xmlNode* _tmp27_;
								const gchar* _tmp28_;
								gpointer _tmp29_;
								ExportXMind8IdObject* _tmp30_;
								NodeGroup* _tmp31_;
								NodeGroup* _tmp32_;
								_tmp27_ = it;
								_tmp28_ = id;
								_tmp29_ = gee_abstract_map_get ((GeeAbstractMap*) id_map, _tmp28_);
								_tmp30_ = (ExportXMind8IdObject*) _tmp29_;
								_tmp31_ = export_xmind8_id_object_get_group (_tmp30_);
								_tmp32_ = _tmp31_;
								export_xmind8_import_styles_boundary (self, map, _tmp27_, _tmp32_);
								_export_xmind8_id_object_unref0 (_tmp30_);
								break;
							}
						}
					}
				}
			}
		}
	}
	_g_free0 (id);
}

static void
export_xmind8_import_styles_topic (ExportXMind8* self,
                                   MindMap* map,
                                   xmlNode* n,
                                   Node* node)
{
	gchar* sc = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* blc = NULL;
	gchar* _tmp16_;
	const gchar* _tmp17_;
	gchar* blw = NULL;
	gchar* _tmp21_;
	const gchar* _tmp22_;
	gchar* f = NULL;
	gchar* _tmp26_;
	const gchar* _tmp27_;
	gchar* lc = NULL;
	gchar* _tmp34_;
	const gchar* _tmp35_;
	gchar* lw = NULL;
	gchar* _tmp39_;
	const gchar* _tmp40_;
	gchar* lcl = NULL;
	gchar* _tmp44_;
	const gchar* _tmp45_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (node != NULL);
	_tmp0_ = (gchar*) xmlGetProp (n, (xmlChar*) "shape-class");
	sc = _tmp0_;
	_tmp1_ = sc;
	if (_tmp1_ != NULL) {
		gchar* border = NULL;
		gchar* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		GQuark _tmp6_ = 0U;
		static GQuark _tmp5_label0 = 0;
		static GQuark _tmp5_label1 = 0;
		static GQuark _tmp5_label2 = 0;
		Style* _tmp10_;
		Style* _tmp11_;
		Styles* _tmp12_;
		const gchar* _tmp13_;
		NodeBorder* _tmp14_;
		NodeBorder* _tmp15_;
		_tmp2_ = g_strdup ("squared");
		border = _tmp2_;
		_tmp3_ = sc;
		_tmp4_ = _tmp3_;
		_tmp6_ = (NULL == _tmp4_) ? 0 : g_quark_from_string (_tmp4_);
		if (_tmp6_ == ((0 != _tmp5_label0) ? _tmp5_label0 : (_tmp5_label0 = g_quark_from_static_string ("org.xmind.topicShape.roundedRect")))) {
			switch (0) {
				default:
				{
					gchar* _tmp7_;
					_tmp7_ = g_strdup ("rounded");
					_g_free0 (border);
					border = _tmp7_;
					break;
				}
			}
		} else if (_tmp6_ == ((0 != _tmp5_label1) ? _tmp5_label1 : (_tmp5_label1 = g_quark_from_static_string ("org.xmind.topicShape.rect")))) {
			switch (0) {
				default:
				{
					gchar* _tmp8_;
					_tmp8_ = g_strdup ("squared");
					_g_free0 (border);
					border = _tmp8_;
					break;
				}
			}
		} else if (_tmp6_ == ((0 != _tmp5_label2) ? _tmp5_label2 : (_tmp5_label2 = g_quark_from_static_string ("org.xmind.topicShape.underline")))) {
			switch (0) {
				default:
				{
					gchar* _tmp9_;
					_tmp9_ = g_strdup ("underlined");
					_g_free0 (border);
					border = _tmp9_;
					break;
				}
			}
		}
		_tmp10_ = node_get_style (node);
		_tmp11_ = _tmp10_;
		_tmp12_ = style_inspector_styles;
		_tmp13_ = border;
		_tmp14_ = styles_get_node_border (_tmp12_, _tmp13_);
		_tmp15_ = _tmp14_;
		style_set_node_border (_tmp11_, _tmp15_);
		_g_object_unref0 (_tmp15_);
		_g_free0 (border);
	}
	_tmp16_ = (gchar*) xmlGetProp (n, (xmlChar*) "border-line-color");
	blc = _tmp16_;
	_tmp17_ = blc;
	if (_tmp17_ != NULL) {
		GdkRGBA c = {0};
		GdkRGBA _tmp18_ = {0};
		const gchar* _tmp19_;
		GdkRGBA _tmp20_;
		_tmp18_.red = (gfloat) 1.0;
		_tmp18_.green = (gfloat) 1.0;
		_tmp18_.blue = (gfloat) 1.0;
		_tmp18_.alpha = (gfloat) 1.0;
		c = _tmp18_;
		_tmp19_ = blc;
		gdk_rgba_parse (&c, _tmp19_);
		_tmp20_ = c;
		node_set_link_color (node, &_tmp20_);
	}
	_tmp21_ = (gchar*) xmlGetProp (n, (xmlChar*) "border-line-width");
	blw = _tmp21_;
	_tmp22_ = blw;
	if (_tmp22_ != NULL) {
		gint width = 0;
		const gchar* _tmp23_;
		width = 1;
		_tmp23_ = blw;
		if (sscanf (_tmp23_, "%dpt", &width) == 1) {
			Style* _tmp24_;
			Style* _tmp25_;
			_tmp24_ = node_get_style (node);
			_tmp25_ = _tmp24_;
			style_set_node_borderwidth (_tmp25_, &width);
		}
	}
	_tmp26_ = (gchar*) xmlGetProp (n, (xmlChar*) "fill");
	f = _tmp26_;
	_tmp27_ = f;
	if (_tmp27_ != NULL) {
		GdkRGBA c = {0};
		GdkRGBA _tmp28_ = {0};
		const gchar* _tmp29_;
		GdkRGBA _tmp30_;
		Style* _tmp31_;
		Style* _tmp32_;
		gboolean _tmp33_;
		_tmp28_.red = (gfloat) 1.0;
		_tmp28_.green = (gfloat) 1.0;
		_tmp28_.blue = (gfloat) 1.0;
		_tmp28_.alpha = (gfloat) 1.0;
		c = _tmp28_;
		_tmp29_ = f;
		gdk_rgba_parse (&c, _tmp29_);
		_tmp30_ = c;
		node_set_link_color (node, &_tmp30_);
		_tmp31_ = node_get_style (node);
		_tmp32_ = _tmp31_;
		_tmp33_ = TRUE;
		style_set_node_fill (_tmp32_, &_tmp33_);
	}
	_tmp34_ = (gchar*) xmlGetProp (n, (xmlChar*) "line-color");
	lc = _tmp34_;
	_tmp35_ = lc;
	if (_tmp35_ != NULL) {
		GdkRGBA c = {0};
		GdkRGBA _tmp36_ = {0};
		const gchar* _tmp37_;
		GdkRGBA _tmp38_;
		_tmp36_.red = (gfloat) 1.0;
		_tmp36_.green = (gfloat) 1.0;
		_tmp36_.blue = (gfloat) 1.0;
		_tmp36_.alpha = (gfloat) 1.0;
		c = _tmp36_;
		_tmp37_ = lc;
		gdk_rgba_parse (&c, _tmp37_);
		_tmp38_ = c;
		node_set_link_color (node, &_tmp38_);
	}
	_tmp39_ = (gchar*) xmlGetProp (n, (xmlChar*) "line-width");
	lw = _tmp39_;
	_tmp40_ = lw;
	if (_tmp40_ != NULL) {
		gint width = 0;
		const gchar* _tmp41_;
		width = 1;
		_tmp41_ = lw;
		if (sscanf (_tmp41_, "^dpt", &width) == 1) {
			Style* _tmp42_;
			Style* _tmp43_;
			_tmp42_ = node_get_style (node);
			_tmp43_ = _tmp42_;
			style_set_link_width (_tmp43_, &width);
		}
	}
	_tmp44_ = (gchar*) xmlGetProp (n, (xmlChar*) "line-class");
	lcl = _tmp44_;
	_tmp45_ = lcl;
	if (_tmp45_ != NULL) {
		gchar* type = NULL;
		gchar* _tmp46_;
		const gchar* _tmp47_;
		const gchar* _tmp48_;
		GQuark _tmp50_ = 0U;
		static GQuark _tmp49_label0 = 0;
		static GQuark _tmp49_label1 = 0;
		static GQuark _tmp49_label2 = 0;
		static GQuark _tmp49_label3 = 0;
		static GQuark _tmp49_label4 = 0;
		Style* _tmp58_;
		Style* _tmp59_;
		Styles* _tmp60_;
		const gchar* _tmp61_;
		LinkType* _tmp62_;
		LinkType* _tmp63_;
		_tmp46_ = g_strdup ("straight");
		type = _tmp46_;
		_tmp47_ = lcl;
		_tmp48_ = _tmp47_;
		_tmp50_ = (NULL == _tmp48_) ? 0 : g_quark_from_string (_tmp48_);
		if (_tmp50_ == ((0 != _tmp49_label0) ? _tmp49_label0 : (_tmp49_label0 = g_quark_from_static_string ("org.xmind.branchConnection.curve")))) {
			switch (0) {
				default:
				{
					gchar* _tmp51_;
					_tmp51_ = g_strdup ("curved");
					_g_free0 (type);
					type = _tmp51_;
					break;
				}
			}
		} else if (_tmp50_ == ((0 != _tmp49_label1) ? _tmp49_label1 : (_tmp49_label1 = g_quark_from_static_string ("org.xmind.branchConnection.straight")))) {
			switch (0) {
				default:
				{
					gchar* _tmp52_;
					_tmp52_ = g_strdup ("straight");
					_g_free0 (type);
					type = _tmp52_;
					break;
				}
			}
		} else if ((_tmp50_ == ((0 != _tmp49_label2) ? _tmp49_label2 : (_tmp49_label2 = g_quark_from_static_string ("org.xmind.branchConnection.elbow")))) || (_tmp50_ == ((0 != _tmp49_label3) ? _tmp49_label3 : (_tmp49_label3 = g_quark_from_static_string ("org.xmind.branchConnection.roundedElbow"))))) {
			switch (0) {
				default:
				{
					gchar* _tmp53_;
					_tmp53_ = g_strdup ("squared");
					_g_free0 (type);
					type = _tmp53_;
					break;
				}
			}
		} else if (_tmp50_ == ((0 != _tmp49_label4) ? _tmp49_label4 : (_tmp49_label4 = g_quark_from_static_string ("org.xmind.branchConnection.arrowedCurve")))) {
			switch (0) {
				default:
				{
					gchar* _tmp54_;
					Style* _tmp55_;
					Style* _tmp56_;
					gboolean _tmp57_;
					_tmp54_ = g_strdup ("curved");
					_g_free0 (type);
					type = _tmp54_;
					_tmp55_ = node_get_style (node);
					_tmp56_ = _tmp55_;
					_tmp57_ = TRUE;
					style_set_link_arrow (_tmp56_, &_tmp57_);
					break;
				}
			}
		}
		_tmp58_ = node_get_style (node);
		_tmp59_ = _tmp58_;
		_tmp60_ = style_inspector_styles;
		_tmp61_ = type;
		_tmp62_ = styles_get_link_type (_tmp60_, _tmp61_);
		_tmp63_ = _tmp62_;
		style_set_link_type (_tmp59_, _tmp63_);
		_g_object_unref0 (_tmp63_);
		_g_free0 (type);
	}
	_g_free0 (lcl);
	_g_free0 (lw);
	_g_free0 (lc);
	_g_free0 (f);
	_g_free0 (blw);
	_g_free0 (blc);
	_g_free0 (sc);
}

static void
export_xmind8_import_styles_connection (ExportXMind8* self,
                                        MindMap* map,
                                        xmlNode* n,
                                        Connection* conn)
{
	gchar* arrow_start = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* arrow_end = NULL;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* lc = NULL;
	gchar* _tmp23_;
	const gchar* _tmp24_;
	gchar* lp = NULL;
	gchar* _tmp28_;
	const gchar* _tmp29_;
	gchar* lw = NULL;
	gchar* _tmp49_;
	const gchar* _tmp50_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (conn != NULL);
	_tmp0_ = (gchar*) xmlGetProp (n, (xmlChar*) "arrow-begin-class");
	arrow_start = _tmp0_;
	_tmp1_ = arrow_start;
	if (_tmp1_ != NULL) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		GQuark _tmp5_ = 0U;
		static GQuark _tmp4_label0 = 0;
		static GQuark _tmp4_label1 = 0;
		_tmp2_ = arrow_start;
		_tmp3_ = _tmp2_;
		_tmp5_ = (NULL == _tmp3_) ? 0 : g_quark_from_string (_tmp3_);
		if ((_tmp5_ == ((0 != _tmp4_label0) ? _tmp4_label0 : (_tmp4_label0 = g_quark_from_static_string ("org.xmind.arrowShape.triangle")))) || (_tmp5_ == ((0 != _tmp4_label1) ? _tmp4_label1 : (_tmp4_label1 = g_quark_from_static_string ("org.xmind.arrowShape.spearhead"))))) {
			switch (0) {
				default:
				{
					Style* _tmp6_;
					Style* _tmp7_;
					_tmp6_ = connection_get_style (conn);
					_tmp7_ = _tmp6_;
					style_set_connection_arrow (_tmp7_, "tofrom");
					break;
				}
			}
		} else {
			switch (0) {
				default:
				{
					Style* _tmp8_;
					Style* _tmp9_;
					_tmp8_ = connection_get_style (conn);
					_tmp9_ = _tmp8_;
					style_set_connection_arrow (_tmp9_, "none");
					break;
				}
			}
		}
	}
	_tmp10_ = (gchar*) xmlGetProp (n, (xmlChar*) "arrow-end-class");
	arrow_end = _tmp10_;
	_tmp11_ = arrow_end;
	if (_tmp11_ != NULL) {
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		GQuark _tmp15_ = 0U;
		static GQuark _tmp14_label0 = 0;
		static GQuark _tmp14_label1 = 0;
		_tmp12_ = arrow_end;
		_tmp13_ = _tmp12_;
		_tmp15_ = (NULL == _tmp13_) ? 0 : g_quark_from_string (_tmp13_);
		if ((_tmp15_ == ((0 != _tmp14_label0) ? _tmp14_label0 : (_tmp14_label0 = g_quark_from_static_string ("org.xmind.arrowShape.triangle")))) || (_tmp15_ == ((0 != _tmp14_label1) ? _tmp14_label1 : (_tmp14_label1 = g_quark_from_static_string ("org.xmind.arrowShape.spearhead"))))) {
			switch (0) {
				default:
				{
					const gchar* _tmp16_ = NULL;
					Style* _tmp17_;
					Style* _tmp18_;
					const gchar* _tmp19_;
					const gchar* _tmp20_;
					Style* _tmp21_;
					Style* _tmp22_;
					_tmp17_ = connection_get_style (conn);
					_tmp18_ = _tmp17_;
					_tmp19_ = style_get_connection_arrow (_tmp18_);
					_tmp20_ = _tmp19_;
					if (g_strcmp0 (_tmp20_, "tofrom") == 0) {
						_tmp16_ = "both";
					} else {
						_tmp16_ = "fromto";
					}
					_tmp21_ = connection_get_style (conn);
					_tmp22_ = _tmp21_;
					style_set_connection_arrow (_tmp22_, _tmp16_);
					break;
				}
			}
		}
	}
	_tmp23_ = (gchar*) xmlGetProp (n, (xmlChar*) "line-color");
	lc = _tmp23_;
	_tmp24_ = lc;
	if (_tmp24_ != NULL) {
		GdkRGBA c = {0};
		GdkRGBA _tmp25_ = {0};
		const gchar* _tmp26_;
		GdkRGBA _tmp27_;
		_tmp25_.red = (gfloat) 1.0;
		_tmp25_.green = (gfloat) 1.0;
		_tmp25_.blue = (gfloat) 1.0;
		_tmp25_.alpha = (gfloat) 1.0;
		c = _tmp25_;
		_tmp26_ = lc;
		gdk_rgba_parse (&c, _tmp26_);
		_tmp27_ = c;
		connection_set_color (conn, &_tmp27_);
	}
	_tmp28_ = (gchar*) xmlGetProp (n, (xmlChar*) "line-pattern");
	lp = _tmp28_;
	_tmp29_ = lp;
	if (_tmp29_ != NULL) {
		const gchar* _tmp30_;
		const gchar* _tmp31_;
		GQuark _tmp33_ = 0U;
		static GQuark _tmp32_label0 = 0;
		static GQuark _tmp32_label1 = 0;
		_tmp30_ = lp;
		_tmp31_ = _tmp30_;
		_tmp33_ = (NULL == _tmp31_) ? 0 : g_quark_from_string (_tmp31_);
		if (_tmp33_ == ((0 != _tmp32_label0) ? _tmp32_label0 : (_tmp32_label0 = g_quark_from_static_string ("solid")))) {
			switch (0) {
				default:
				{
					Style* _tmp34_;
					Style* _tmp35_;
					Styles* _tmp36_;
					LinkDash* _tmp37_;
					LinkDash* _tmp38_;
					_tmp34_ = connection_get_style (conn);
					_tmp35_ = _tmp34_;
					_tmp36_ = style_inspector_styles;
					_tmp37_ = styles_get_link_dash (_tmp36_, "solid");
					_tmp38_ = _tmp37_;
					style_set_connection_dash (_tmp35_, _tmp38_);
					_g_object_unref0 (_tmp38_);
					break;
				}
			}
		} else if (_tmp33_ == ((0 != _tmp32_label1) ? _tmp32_label1 : (_tmp32_label1 = g_quark_from_static_string ("dot")))) {
			switch (0) {
				default:
				{
					Style* _tmp39_;
					Style* _tmp40_;
					Styles* _tmp41_;
					LinkDash* _tmp42_;
					LinkDash* _tmp43_;
					_tmp39_ = connection_get_style (conn);
					_tmp40_ = _tmp39_;
					_tmp41_ = style_inspector_styles;
					_tmp42_ = styles_get_link_dash (_tmp41_, "dotted");
					_tmp43_ = _tmp42_;
					style_set_connection_dash (_tmp40_, _tmp43_);
					_g_object_unref0 (_tmp43_);
					break;
				}
			}
		} else {
			switch (0) {
				default:
				{
					Style* _tmp44_;
					Style* _tmp45_;
					Styles* _tmp46_;
					LinkDash* _tmp47_;
					LinkDash* _tmp48_;
					_tmp44_ = connection_get_style (conn);
					_tmp45_ = _tmp44_;
					_tmp46_ = style_inspector_styles;
					_tmp47_ = styles_get_link_dash (_tmp46_, "dash");
					_tmp48_ = _tmp47_;
					style_set_connection_dash (_tmp45_, _tmp48_);
					_g_object_unref0 (_tmp48_);
					break;
				}
			}
		}
	}
	_tmp49_ = (gchar*) xmlGetProp (n, (xmlChar*) "line-width");
	lw = _tmp49_;
	_tmp50_ = lw;
	if (_tmp50_ != NULL) {
		gint width = 0;
		const gchar* _tmp51_;
		width = 1;
		_tmp51_ = lw;
		if (sscanf (_tmp51_, "%dpt", &width) == 1) {
			Style* _tmp52_;
			Style* _tmp53_;
			_tmp52_ = connection_get_style (conn);
			_tmp53_ = _tmp52_;
			style_set_connection_line_width (_tmp53_, &width);
		}
	}
	_g_free0 (lw);
	_g_free0 (lp);
	_g_free0 (lc);
	_g_free0 (arrow_end);
	_g_free0 (arrow_start);
}

static void
export_xmind8_import_styles_boundary (ExportXMind8* self,
                                      MindMap* map,
                                      xmlNode* n,
                                      NodeGroup* group)
{
	gchar* f = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	g_return_if_fail (group != NULL);
	_tmp0_ = (gchar*) xmlGetProp (n, (xmlChar*) "fill");
	f = _tmp0_;
	_tmp1_ = f;
	if (_tmp1_ != NULL) {
		GdkRGBA c = {0};
		GdkRGBA _tmp2_ = {0};
		const gchar* _tmp3_;
		GdkRGBA _tmp4_;
		_tmp2_.red = (gfloat) 1.0;
		_tmp2_.green = (gfloat) 1.0;
		_tmp2_.blue = (gfloat) 1.0;
		_tmp2_.alpha = (gfloat) 1.0;
		c = _tmp2_;
		_tmp3_ = f;
		gdk_rgba_parse (&c, _tmp3_);
		_tmp4_ = c;
		node_group_set_color (group, &_tmp4_);
	}
	_g_free0 (f);
}

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

static void
export_xmind8_unarchive_contents (ExportXMind8* 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 ("ExportXMind8.vala:1104: 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_dup7 (_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 ("ExportXMind8.vala:1132: Error: %s (%d)", _tmp22_, archive_errno (archive));
	}
	_archive_write_free0 (extractor);
	_archive_read_free0 (archive);
}

static inline gpointer
export_xmind8_id_object_get_instance_private (ExportXMind8IdObject* self)
{
	return G_STRUCT_MEMBER_P (self, ExportXMind8IdObject_private_offset);
}

ExportXMind8IdObject*
export_xmind8_id_object_construct_for_node (GType object_type,
                                            Node* n)
{
	ExportXMind8IdObject* self = NULL;
	g_return_val_if_fail (n != NULL, NULL);
	self = (ExportXMind8IdObject*) g_type_create_instance (object_type);
	export_xmind8_id_object_set_typ (self, EXPORT_XMIND8_ID_OBJECT_TYPE_NODE);
	export_xmind8_id_object_set_node (self, n);
	return self;
}

ExportXMind8IdObject*
export_xmind8_id_object_new_for_node (Node* n)
{
	return export_xmind8_id_object_construct_for_node (EXPORT_XMIND8_TYPE_ID_OBJECT, n);
}

ExportXMind8IdObject*
export_xmind8_id_object_construct_for_connection (GType object_type,
                                                  Connection* c)
{
	ExportXMind8IdObject* self = NULL;
	g_return_val_if_fail (c != NULL, NULL);
	self = (ExportXMind8IdObject*) g_type_create_instance (object_type);
	export_xmind8_id_object_set_typ (self, EXPORT_XMIND8_ID_OBJECT_TYPE_CONNECTION);
	export_xmind8_id_object_set_conn (self, c);
	return self;
}

ExportXMind8IdObject*
export_xmind8_id_object_new_for_connection (Connection* c)
{
	return export_xmind8_id_object_construct_for_connection (EXPORT_XMIND8_TYPE_ID_OBJECT, c);
}

ExportXMind8IdObject*
export_xmind8_id_object_construct_for_boundary (GType object_type,
                                                NodeGroup* g)
{
	ExportXMind8IdObject* self = NULL;
	g_return_val_if_fail (g != NULL, NULL);
	self = (ExportXMind8IdObject*) g_type_create_instance (object_type);
	export_xmind8_id_object_set_typ (self, EXPORT_XMIND8_ID_OBJECT_TYPE_BOUNDARY);
	export_xmind8_id_object_set_group (self, g);
	return self;
}

ExportXMind8IdObject*
export_xmind8_id_object_new_for_boundary (NodeGroup* g)
{
	return export_xmind8_id_object_construct_for_boundary (EXPORT_XMIND8_TYPE_ID_OBJECT, g);
}

ExportXMind8IdObject*
export_xmind8_id_object_construct (GType object_type)
{
	ExportXMind8IdObject* self = NULL;
	self = (ExportXMind8IdObject*) g_type_create_instance (object_type);
	return self;
}

ExportXMind8IdObject*
export_xmind8_id_object_new (void)
{
	return export_xmind8_id_object_construct (EXPORT_XMIND8_TYPE_ID_OBJECT);
}

ExportXMind8IdObjectType
export_xmind8_id_object_get_typ (ExportXMind8IdObject* self)
{
	ExportXMind8IdObjectType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_typ;
	return result;
}

void
export_xmind8_id_object_set_typ (ExportXMind8IdObject* self,
                                 ExportXMind8IdObjectType value)
{
	g_return_if_fail (self != NULL);
	self->priv->_typ = value;
}

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

void
export_xmind8_id_object_set_node (ExportXMind8IdObject* 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_xmind8_id_object_get_conn (ExportXMind8IdObject* self)
{
	Connection* result;
	Connection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_conn;
	result = _tmp0_;
	return result;
}

void
export_xmind8_id_object_set_conn (ExportXMind8IdObject* 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_xmind8_id_object_get_group (ExportXMind8IdObject* self)
{
	NodeGroup* result;
	NodeGroup* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_group;
	result = _tmp0_;
	return result;
}

void
export_xmind8_id_object_set_group (ExportXMind8IdObject* 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_xmind8_value_id_object_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

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

static void
export_xmind8_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_xmind8_id_object_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

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

static gchar*
export_xmind8_value_id_object_collect_value (GValue* value,
                                             guint n_collect_values,
                                             GTypeCValue* collect_values,
                                             guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		ExportXMind8IdObject * 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_xmind8_id_object_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
export_xmind8_value_id_object_lcopy_value (const GValue* value,
                                           guint n_collect_values,
                                           GTypeCValue* collect_values,
                                           guint collect_flags)
{
	ExportXMind8IdObject ** 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_xmind8_id_object_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
export_xmind8_param_spec_id_object (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags)
{
	ExportXMind8ParamSpecIdObject* spec;
	g_return_val_if_fail (g_type_is_a (object_type, EXPORT_XMIND8_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_xmind8_value_get_id_object (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND8_TYPE_ID_OBJECT), NULL);
	return value->data[0].v_pointer;
}

void
export_xmind8_value_set_id_object (GValue* value,
                                   gpointer v_object)
{
	ExportXMind8IdObject * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND8_TYPE_ID_OBJECT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND8_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_xmind8_id_object_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		export_xmind8_id_object_unref (old);
	}
}

void
export_xmind8_value_take_id_object (GValue* value,
                                    gpointer v_object)
{
	ExportXMind8IdObject * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND8_TYPE_ID_OBJECT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND8_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_xmind8_id_object_unref (old);
	}
}

static void
export_xmind8_id_object_class_init (ExportXMind8IdObjectClass * klass,
                                    gpointer klass_data)
{
	export_xmind8_id_object_parent_class = g_type_class_peek_parent (klass);
	((ExportXMind8IdObjectClass *) klass)->finalize = export_xmind8_id_object_finalize;
	g_type_class_adjust_private_offset (klass, &ExportXMind8IdObject_private_offset);
}

static void
export_xmind8_id_object_instance_init (ExportXMind8IdObject * self,
                                       gpointer klass)
{
	self->priv = export_xmind8_id_object_get_instance_private (self);
	self->priv->_typ = EXPORT_XMIND8_ID_OBJECT_TYPE_NODE;
	self->priv->_node = NULL;
	self->priv->_conn = NULL;
	self->priv->_group = NULL;
	self->ref_count = 1;
}

static void
export_xmind8_id_object_finalize (ExportXMind8IdObject * obj)
{
	ExportXMind8IdObject * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EXPORT_XMIND8_TYPE_ID_OBJECT, ExportXMind8IdObject);
	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_xmind8_id_object_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { export_xmind8_value_id_object_init, export_xmind8_value_id_object_free_value, export_xmind8_value_id_object_copy_value, export_xmind8_value_id_object_peek_pointer, "p", export_xmind8_value_id_object_collect_value, "p", export_xmind8_value_id_object_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ExportXMind8IdObjectClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) export_xmind8_id_object_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ExportXMind8IdObject), 0, (GInstanceInitFunc) export_xmind8_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_xmind8_id_object_type_id;
	export_xmind8_id_object_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ExportXMind8IdObject", &g_define_type_info, &g_define_type_fundamental_info, 0);
	ExportXMind8IdObject_private_offset = g_type_add_instance_private (export_xmind8_id_object_type_id, sizeof (ExportXMind8IdObjectPrivate));
	return export_xmind8_id_object_type_id;
}

GType
export_xmind8_id_object_get_type (void)
{
	static volatile gsize export_xmind8_id_object_type_id__once = 0;
	if (g_once_init_enter (&export_xmind8_id_object_type_id__once)) {
		GType export_xmind8_id_object_type_id;
		export_xmind8_id_object_type_id = export_xmind8_id_object_get_type_once ();
		g_once_init_leave (&export_xmind8_id_object_type_id__once, export_xmind8_id_object_type_id);
	}
	return export_xmind8_id_object_type_id__once;
}

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

void
export_xmind8_id_object_unref (gpointer instance)
{
	ExportXMind8IdObject * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		EXPORT_XMIND8_ID_OBJECT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

ExportXMind8FileItem*
export_xmind8_file_item_construct (GType object_type,
                                   const gchar* n,
                                   const gchar* t)
{
	ExportXMind8FileItem* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (n != NULL, NULL);
	g_return_val_if_fail (t != NULL, NULL);
	self = (ExportXMind8FileItem*) 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;
}

ExportXMind8FileItem*
export_xmind8_file_item_new (const gchar* n,
                             const gchar* t)
{
	return export_xmind8_file_item_construct (EXPORT_XMIND8_TYPE_FILE_ITEM, n, t);
}

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

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

static void
export_xmind8_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_xmind8_file_item_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

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

static gchar*
export_xmind8_value_file_item_collect_value (GValue* value,
                                             guint n_collect_values,
                                             GTypeCValue* collect_values,
                                             guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		ExportXMind8FileItem * 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_xmind8_file_item_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
export_xmind8_value_file_item_lcopy_value (const GValue* value,
                                           guint n_collect_values,
                                           GTypeCValue* collect_values,
                                           guint collect_flags)
{
	ExportXMind8FileItem ** 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_xmind8_file_item_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
export_xmind8_param_spec_file_item (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags)
{
	ExportXMind8ParamSpecFileItem* spec;
	g_return_val_if_fail (g_type_is_a (object_type, EXPORT_XMIND8_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_xmind8_value_get_file_item (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND8_TYPE_FILE_ITEM), NULL);
	return value->data[0].v_pointer;
}

void
export_xmind8_value_set_file_item (GValue* value,
                                   gpointer v_object)
{
	ExportXMind8FileItem * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND8_TYPE_FILE_ITEM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND8_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_xmind8_file_item_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		export_xmind8_file_item_unref (old);
	}
}

void
export_xmind8_value_take_file_item (GValue* value,
                                    gpointer v_object)
{
	ExportXMind8FileItem * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND8_TYPE_FILE_ITEM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND8_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_xmind8_file_item_unref (old);
	}
}

static void
export_xmind8_file_item_class_init (ExportXMind8FileItemClass * klass,
                                    gpointer klass_data)
{
	export_xmind8_file_item_parent_class = g_type_class_peek_parent (klass);
	((ExportXMind8FileItemClass *) klass)->finalize = export_xmind8_file_item_finalize;
}

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

static void
export_xmind8_file_item_finalize (ExportXMind8FileItem * obj)
{
	ExportXMind8FileItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EXPORT_XMIND8_TYPE_FILE_ITEM, ExportXMind8FileItem);
	g_signal_handlers_destroy (self);
	_g_free0 (self->name);
	_g_free0 (self->type);
}

static GType
export_xmind8_file_item_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { export_xmind8_value_file_item_init, export_xmind8_value_file_item_free_value, export_xmind8_value_file_item_copy_value, export_xmind8_value_file_item_peek_pointer, "p", export_xmind8_value_file_item_collect_value, "p", export_xmind8_value_file_item_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ExportXMind8FileItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) export_xmind8_file_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ExportXMind8FileItem), 0, (GInstanceInitFunc) export_xmind8_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_xmind8_file_item_type_id;
	export_xmind8_file_item_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ExportXMind8FileItem", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return export_xmind8_file_item_type_id;
}

GType
export_xmind8_file_item_get_type (void)
{
	static volatile gsize export_xmind8_file_item_type_id__once = 0;
	if (g_once_init_enter (&export_xmind8_file_item_type_id__once)) {
		GType export_xmind8_file_item_type_id;
		export_xmind8_file_item_type_id = export_xmind8_file_item_get_type_once ();
		g_once_init_leave (&export_xmind8_file_item_type_id__once, export_xmind8_file_item_type_id);
	}
	return export_xmind8_file_item_type_id__once;
}

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

void
export_xmind8_file_item_unref (gpointer instance)
{
	ExportXMind8FileItem * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		EXPORT_XMIND8_FILE_ITEM_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
_export_xmind8_file_item_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (export_xmind8_file_item_unref (var), NULL));
}

static void
_vala_ExportXMind8FileItem_free_function_content_of (gpointer data)
{
	ExportXMind8FileItem* self;
	self = *((ExportXMind8FileItem**) data);
	_export_xmind8_file_item_unref0_ (self);
}

ExportXMind8FileItems*
export_xmind8_file_items_construct (GType object_type)
{
	ExportXMind8FileItems* self = NULL;
	GArray* _tmp0_;
	self = (ExportXMind8FileItems*) g_type_create_instance (object_type);
	_tmp0_ = g_array_new (TRUE, TRUE, sizeof (ExportXMind8FileItem*));
	g_array_set_clear_func (_tmp0_, (GDestroyNotify) _vala_ExportXMind8FileItem_free_function_content_of);
	_g_array_unref0 (self->items);
	self->items = _tmp0_;
	return self;
}

ExportXMind8FileItems*
export_xmind8_file_items_new (void)
{
	return export_xmind8_file_items_construct (EXPORT_XMIND8_TYPE_FILE_ITEMS);
}

void
export_xmind8_file_items_add (ExportXMind8FileItems* self,
                              const gchar* name,
                              const gchar* type)
{
	GArray* _tmp6_;
	ExportXMind8FileItem* _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_;
				ExportXMind8FileItem* _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_, ExportXMind8FileItem*, (guint) i);
				_tmp5_ = _tmp4_->name;
				if (g_strcmp0 (_tmp5_, name) == 0) {
					return;
				}
			}
		}
	}
	_tmp6_ = self->items;
	_tmp7_ = export_xmind8_file_item_new (name, type);
	g_array_append_val (_tmp6_, _tmp7_);
}

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

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

static void
export_xmind8_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_xmind8_file_items_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

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

static gchar*
export_xmind8_value_file_items_collect_value (GValue* value,
                                              guint n_collect_values,
                                              GTypeCValue* collect_values,
                                              guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		ExportXMind8FileItems * 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_xmind8_file_items_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
export_xmind8_value_file_items_lcopy_value (const GValue* value,
                                            guint n_collect_values,
                                            GTypeCValue* collect_values,
                                            guint collect_flags)
{
	ExportXMind8FileItems ** 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_xmind8_file_items_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
export_xmind8_param_spec_file_items (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags)
{
	ExportXMind8ParamSpecFileItems* spec;
	g_return_val_if_fail (g_type_is_a (object_type, EXPORT_XMIND8_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_xmind8_value_get_file_items (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND8_TYPE_FILE_ITEMS), NULL);
	return value->data[0].v_pointer;
}

void
export_xmind8_value_set_file_items (GValue* value,
                                    gpointer v_object)
{
	ExportXMind8FileItems * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND8_TYPE_FILE_ITEMS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND8_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_xmind8_file_items_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		export_xmind8_file_items_unref (old);
	}
}

void
export_xmind8_value_take_file_items (GValue* value,
                                     gpointer v_object)
{
	ExportXMind8FileItems * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, EXPORT_XMIND8_TYPE_FILE_ITEMS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, EXPORT_XMIND8_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_xmind8_file_items_unref (old);
	}
}

static void
export_xmind8_file_items_class_init (ExportXMind8FileItemsClass * klass,
                                     gpointer klass_data)
{
	export_xmind8_file_items_parent_class = g_type_class_peek_parent (klass);
	((ExportXMind8FileItemsClass *) klass)->finalize = export_xmind8_file_items_finalize;
}

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

static void
export_xmind8_file_items_finalize (ExportXMind8FileItems * obj)
{
	ExportXMind8FileItems * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, EXPORT_XMIND8_TYPE_FILE_ITEMS, ExportXMind8FileItems);
	g_signal_handlers_destroy (self);
	_g_array_unref0 (self->items);
}

static GType
export_xmind8_file_items_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { export_xmind8_value_file_items_init, export_xmind8_value_file_items_free_value, export_xmind8_value_file_items_copy_value, export_xmind8_value_file_items_peek_pointer, "p", export_xmind8_value_file_items_collect_value, "p", export_xmind8_value_file_items_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (ExportXMind8FileItemsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) export_xmind8_file_items_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ExportXMind8FileItems), 0, (GInstanceInitFunc) export_xmind8_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_xmind8_file_items_type_id;
	export_xmind8_file_items_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ExportXMind8FileItems", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return export_xmind8_file_items_type_id;
}

GType
export_xmind8_file_items_get_type (void)
{
	static volatile gsize export_xmind8_file_items_type_id__once = 0;
	if (g_once_init_enter (&export_xmind8_file_items_type_id__once)) {
		GType export_xmind8_file_items_type_id;
		export_xmind8_file_items_type_id = export_xmind8_file_items_get_type_once ();
		g_once_init_leave (&export_xmind8_file_items_type_id__once, export_xmind8_file_items_type_id);
	}
	return export_xmind8_file_items_type_id__once;
}

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

void
export_xmind8_file_items_unref (gpointer instance)
{
	ExportXMind8FileItems * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		EXPORT_XMIND8_FILE_ITEMS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
export_xmind8_class_init (ExportXMind8Class * klass,
                          gpointer klass_data)
{
	export_xmind8_parent_class = g_type_class_peek_parent (klass);
	((ExportClass *) klass)->finalize = export_xmind8_finalize;
	g_type_class_adjust_private_offset (klass, &ExportXMind8_private_offset);
	((ExportClass *) klass)->export = (gboolean (*) (Export*, const gchar*, MindMap*)) export_xmind8_real_export;
	((ExportClass *) klass)->import = (gboolean (*) (Export*, const gchar*, MindMap*)) export_xmind8_real_import;
}

static void
export_xmind8_instance_init (ExportXMind8 * self,
                             gpointer klass)
{
	self->priv = export_xmind8_get_instance_private (self);
	self->priv->ids = 10000000;
}

static void
export_xmind8_finalize (Export * obj)
{
	ExportXMind8 * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_EXPORT_XMIND8, ExportXMind8);
	EXPORT_CLASS (export_xmind8_parent_class)->finalize (obj);
}

static GType
export_xmind8_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ExportXMind8Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) export_xmind8_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ExportXMind8), 0, (GInstanceInitFunc) export_xmind8_instance_init, NULL };
	GType export_xmind8_type_id;
	export_xmind8_type_id = g_type_register_static (TYPE_EXPORT, "ExportXMind8", &g_define_type_info, 0);
	ExportXMind8_private_offset = g_type_add_instance_private (export_xmind8_type_id, sizeof (ExportXMind8Private));
	return export_xmind8_type_id;
}

GType
export_xmind8_get_type (void)
{
	static volatile gsize export_xmind8_type_id__once = 0;
	if (g_once_init_enter (&export_xmind8_type_id__once)) {
		GType export_xmind8_type_id;
		export_xmind8_type_id = export_xmind8_get_type_once ();
		g_once_init_leave (&export_xmind8_type_id__once, export_xmind8_type_id);
	}
	return export_xmind8_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;
}

