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

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

#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <cairo-gobject.h>
#include <float.h>
#include <math.h>
#include <gtk/gtk.h>
#include <pango/pango.h>
#include <glib/gi18n-lib.h>
#include <libxml/tree.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_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;
typedef struct _StylesPrivate StylesPrivate;

#define STYLES_TYPE_STYLE_LEVEL (styles_style_level_get_type ())
#define STYLES_STYLE_LEVEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STYLES_TYPE_STYLE_LEVEL, StylesStyleLevel))
#define STYLES_STYLE_LEVEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STYLES_TYPE_STYLE_LEVEL, StylesStyleLevelClass))
#define STYLES_IS_STYLE_LEVEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STYLES_TYPE_STYLE_LEVEL))
#define STYLES_IS_STYLE_LEVEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), STYLES_TYPE_STYLE_LEVEL))
#define STYLES_STYLE_LEVEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STYLES_TYPE_STYLE_LEVEL, StylesStyleLevelClass))

typedef struct _StylesStyleLevel StylesStyleLevel;
typedef struct _StylesStyleLevelClass StylesStyleLevelClass;

#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 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_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;

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

#define TYPE_LINK_TYPE_STRAIGHT (link_type_straight_get_type ())
#define LINK_TYPE_STRAIGHT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LINK_TYPE_STRAIGHT, LinkTypeStraight))
#define LINK_TYPE_STRAIGHT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LINK_TYPE_STRAIGHT, LinkTypeStraightClass))
#define IS_LINK_TYPE_STRAIGHT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LINK_TYPE_STRAIGHT))
#define IS_LINK_TYPE_STRAIGHT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LINK_TYPE_STRAIGHT))
#define LINK_TYPE_STRAIGHT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LINK_TYPE_STRAIGHT, LinkTypeStraightClass))

typedef struct _LinkTypeStraight LinkTypeStraight;
typedef struct _LinkTypeStraightClass LinkTypeStraightClass;

#define TYPE_LINK_TYPE_SQUARED (link_type_squared_get_type ())
#define LINK_TYPE_SQUARED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LINK_TYPE_SQUARED, LinkTypeSquared))
#define LINK_TYPE_SQUARED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LINK_TYPE_SQUARED, LinkTypeSquaredClass))
#define IS_LINK_TYPE_SQUARED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LINK_TYPE_SQUARED))
#define IS_LINK_TYPE_SQUARED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LINK_TYPE_SQUARED))
#define LINK_TYPE_SQUARED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LINK_TYPE_SQUARED, LinkTypeSquaredClass))

typedef struct _LinkTypeSquared LinkTypeSquared;
typedef struct _LinkTypeSquaredClass LinkTypeSquaredClass;

#define TYPE_LINK_TYPE_ROUNDED (link_type_rounded_get_type ())
#define LINK_TYPE_ROUNDED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LINK_TYPE_ROUNDED, LinkTypeRounded))
#define LINK_TYPE_ROUNDED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LINK_TYPE_ROUNDED, LinkTypeRoundedClass))
#define IS_LINK_TYPE_ROUNDED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LINK_TYPE_ROUNDED))
#define IS_LINK_TYPE_ROUNDED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LINK_TYPE_ROUNDED))
#define LINK_TYPE_ROUNDED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LINK_TYPE_ROUNDED, LinkTypeRoundedClass))

typedef struct _LinkTypeRounded LinkTypeRounded;
typedef struct _LinkTypeRoundedClass LinkTypeRoundedClass;

#define TYPE_LINK_TYPE_CURVED (link_type_curved_get_type ())
#define LINK_TYPE_CURVED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LINK_TYPE_CURVED, LinkTypeCurved))
#define LINK_TYPE_CURVED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LINK_TYPE_CURVED, LinkTypeCurvedClass))
#define IS_LINK_TYPE_CURVED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LINK_TYPE_CURVED))
#define IS_LINK_TYPE_CURVED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LINK_TYPE_CURVED))
#define LINK_TYPE_CURVED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LINK_TYPE_CURVED, LinkTypeCurvedClass))

typedef struct _LinkTypeCurved LinkTypeCurved;
typedef struct _LinkTypeCurvedClass LinkTypeCurvedClass;

#define TYPE_NODE_BORDER_NONE (node_border_none_get_type ())
#define NODE_BORDER_NONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_BORDER_NONE, NodeBorderNone))
#define NODE_BORDER_NONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_BORDER_NONE, NodeBorderNoneClass))
#define IS_NODE_BORDER_NONE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_BORDER_NONE))
#define IS_NODE_BORDER_NONE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_BORDER_NONE))
#define NODE_BORDER_NONE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_BORDER_NONE, NodeBorderNoneClass))

typedef struct _NodeBorderNone NodeBorderNone;
typedef struct _NodeBorderNoneClass NodeBorderNoneClass;

#define TYPE_NODE_BORDER_UNDERLINED (node_border_underlined_get_type ())
#define NODE_BORDER_UNDERLINED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_BORDER_UNDERLINED, NodeBorderUnderlined))
#define NODE_BORDER_UNDERLINED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_BORDER_UNDERLINED, NodeBorderUnderlinedClass))
#define IS_NODE_BORDER_UNDERLINED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_BORDER_UNDERLINED))
#define IS_NODE_BORDER_UNDERLINED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_BORDER_UNDERLINED))
#define NODE_BORDER_UNDERLINED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_BORDER_UNDERLINED, NodeBorderUnderlinedClass))

typedef struct _NodeBorderUnderlined NodeBorderUnderlined;
typedef struct _NodeBorderUnderlinedClass NodeBorderUnderlinedClass;

#define TYPE_NODE_BORDER_BRACKET (node_border_bracket_get_type ())
#define NODE_BORDER_BRACKET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_BORDER_BRACKET, NodeBorderBracket))
#define NODE_BORDER_BRACKET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_BORDER_BRACKET, NodeBorderBracketClass))
#define IS_NODE_BORDER_BRACKET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_BORDER_BRACKET))
#define IS_NODE_BORDER_BRACKET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_BORDER_BRACKET))
#define NODE_BORDER_BRACKET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_BORDER_BRACKET, NodeBorderBracketClass))

typedef struct _NodeBorderBracket NodeBorderBracket;
typedef struct _NodeBorderBracketClass NodeBorderBracketClass;

#define TYPE_NODE_BORDER_SQUARED (node_border_squared_get_type ())
#define NODE_BORDER_SQUARED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_BORDER_SQUARED, NodeBorderSquared))
#define NODE_BORDER_SQUARED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_BORDER_SQUARED, NodeBorderSquaredClass))
#define IS_NODE_BORDER_SQUARED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_BORDER_SQUARED))
#define IS_NODE_BORDER_SQUARED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_BORDER_SQUARED))
#define NODE_BORDER_SQUARED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_BORDER_SQUARED, NodeBorderSquaredClass))

typedef struct _NodeBorderSquared NodeBorderSquared;
typedef struct _NodeBorderSquaredClass NodeBorderSquaredClass;

#define TYPE_NODE_BORDER_ROUNDED (node_border_rounded_get_type ())
#define NODE_BORDER_ROUNDED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_BORDER_ROUNDED, NodeBorderRounded))
#define NODE_BORDER_ROUNDED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_BORDER_ROUNDED, NodeBorderRoundedClass))
#define IS_NODE_BORDER_ROUNDED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_BORDER_ROUNDED))
#define IS_NODE_BORDER_ROUNDED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_BORDER_ROUNDED))
#define NODE_BORDER_ROUNDED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_BORDER_ROUNDED, NodeBorderRoundedClass))

typedef struct _NodeBorderRounded NodeBorderRounded;
typedef struct _NodeBorderRoundedClass NodeBorderRoundedClass;

#define TYPE_NODE_BORDER_PILL (node_border_pill_get_type ())
#define NODE_BORDER_PILL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NODE_BORDER_PILL, NodeBorderPill))
#define NODE_BORDER_PILL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NODE_BORDER_PILL, NodeBorderPillClass))
#define IS_NODE_BORDER_PILL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NODE_BORDER_PILL))
#define IS_NODE_BORDER_PILL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NODE_BORDER_PILL))
#define NODE_BORDER_PILL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NODE_BORDER_PILL, NodeBorderPillClass))

typedef struct _NodeBorderPill NodeBorderPill;
typedef struct _NodeBorderPillClass NodeBorderPillClass;

#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 _styles_style_level_unref0(var) ((var == NULL) ? NULL : (var = (styles_style_level_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _LinkDashPrivate LinkDashPrivate;
typedef struct _StylesStyleLevelPrivate StylesStyleLevelPrivate;
#define _style_unref0(var) ((var == NULL) ? NULL : (var = (style_unref (var), NULL)))
typedef struct _StylesParamSpecStyleLevel StylesParamSpecStyleLevel;
typedef struct _ParamSpecStyles ParamSpecStyles;

struct _Styles {
	GTypeInstance parent_instance;
	volatile int ref_count;
	StylesPrivate * priv;
};

struct _StylesClass {
	GTypeClass parent_class;
	void (*finalize) (Styles *self);
};

struct _StylesPrivate {
	GArray* _styles;
};

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 _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 _LinkDash {
	GObject parent_instance;
	LinkDashPrivate * priv;
	gchar* name;
	gchar* display_name;
	gdouble* pattern;
	gint pattern_length1;
};

struct _LinkDashClass {
	GObjectClass parent_class;
};

struct _StylesStyleLevel {
	GTypeInstance parent_instance;
	volatile int ref_count;
	StylesStyleLevelPrivate * priv;
};

struct _StylesStyleLevelClass {
	GTypeClass parent_class;
	void (*finalize) (StylesStyleLevel *self);
};

struct _StylesStyleLevelPrivate {
	Style* _style;
	gboolean _isset;
};

struct _StylesParamSpecStyleLevel {
	GParamSpec parent_instance;
};

struct _ParamSpecStyles {
	GParamSpec parent_instance;
};

static gint Styles_private_offset;
static gpointer styles_parent_class = NULL;
static GArray* styles__link_types;
static GArray* styles__link_types = NULL;
static GArray* styles__link_dashes;
static GArray* styles__link_dashes = NULL;
static GArray* styles__node_borders;
static GArray* styles__node_borders = NULL;
static gint StylesStyleLevel_private_offset;
static gpointer styles_style_level_parent_class = NULL;

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)
static gpointer styles_style_level_ref (gpointer instance);
static void styles_style_level_unref (gpointer instance);
static GParamSpec* styles_param_spec_style_level (const gchar* name,
                                           const gchar* nick,
                                           const gchar* blurb,
                                           GType object_type,
                                           GParamFlags flags) G_GNUC_UNUSED ;
static void styles_value_set_style_level (GValue* value,
                                   gpointer v_object) G_GNUC_UNUSED ;
static void styles_value_take_style_level (GValue* value,
                                    gpointer v_object) G_GNUC_UNUSED ;
static gpointer styles_value_get_style_level (const GValue* value) G_GNUC_UNUSED ;
static GType styles_style_level_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (StylesStyleLevel, styles_style_level_unref)
VALA_EXTERN GType node_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Node, g_object_unref)
VALA_EXTERN GType link_type_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LinkType, g_object_unref)
VALA_EXTERN GType link_dash_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LinkDash, g_object_unref)
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 Styles* styles_new (void);
VALA_EXTERN Styles* styles_construct (GType object_type);
VALA_EXTERN GType link_type_straight_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LinkTypeStraight, g_object_unref)
VALA_EXTERN LinkTypeStraight* link_type_straight_new (void);
VALA_EXTERN LinkTypeStraight* link_type_straight_construct (GType object_type);
VALA_EXTERN GType link_type_squared_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LinkTypeSquared, g_object_unref)
VALA_EXTERN LinkTypeSquared* link_type_squared_new (void);
VALA_EXTERN LinkTypeSquared* link_type_squared_construct (GType object_type);
VALA_EXTERN GType link_type_rounded_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LinkTypeRounded, g_object_unref)
VALA_EXTERN LinkTypeRounded* link_type_rounded_new (void);
VALA_EXTERN LinkTypeRounded* link_type_rounded_construct (GType object_type);
VALA_EXTERN GType link_type_curved_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LinkTypeCurved, g_object_unref)
VALA_EXTERN LinkTypeCurved* link_type_curved_new (void);
VALA_EXTERN LinkTypeCurved* link_type_curved_construct (GType object_type);
static void _g_object_unref0_ (gpointer var);
static void _vala_LinkType_free_function_content_of (gpointer data);
VALA_EXTERN LinkDash* link_dash_new (const gchar* name,
                         const gchar* display_name,
                         gdouble* pattern,
                         gint pattern_length1);
VALA_EXTERN LinkDash* link_dash_construct (GType object_type,
                               const gchar* name,
                               const gchar* display_name,
                               gdouble* pattern,
                               gint pattern_length1);
static void _vala_LinkDash_free_function_content_of (gpointer data);
VALA_EXTERN GType node_border_none_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeBorderNone, g_object_unref)
VALA_EXTERN NodeBorderNone* node_border_none_new (void);
VALA_EXTERN NodeBorderNone* node_border_none_construct (GType object_type);
VALA_EXTERN GType node_border_underlined_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeBorderUnderlined, g_object_unref)
VALA_EXTERN NodeBorderUnderlined* node_border_underlined_new (void);
VALA_EXTERN NodeBorderUnderlined* node_border_underlined_construct (GType object_type);
VALA_EXTERN GType node_border_bracket_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeBorderBracket, g_object_unref)
VALA_EXTERN NodeBorderBracket* node_border_bracket_new (void);
VALA_EXTERN NodeBorderBracket* node_border_bracket_construct (GType object_type);
VALA_EXTERN GType node_border_squared_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeBorderSquared, g_object_unref)
VALA_EXTERN NodeBorderSquared* node_border_squared_new (void);
VALA_EXTERN NodeBorderSquared* node_border_squared_construct (GType object_type);
VALA_EXTERN GType node_border_rounded_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeBorderRounded, g_object_unref)
VALA_EXTERN NodeBorderRounded* node_border_rounded_new (void);
VALA_EXTERN NodeBorderRounded* node_border_rounded_construct (GType object_type);
VALA_EXTERN GType node_border_pill_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NodeBorderPill, g_object_unref)
VALA_EXTERN NodeBorderPill* node_border_pill_new (void);
VALA_EXTERN NodeBorderPill* node_border_pill_construct (GType object_type);
static void _vala_NodeBorder_free_function_content_of (gpointer data);
static void _styles_style_level_unref0_ (gpointer var);
static void _vala_StylesStyleLevel_free_function_content_of (gpointer data);
static StylesStyleLevel* styles_style_level_new (void);
static StylesStyleLevel* styles_style_level_construct (GType object_type);
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)
static Style* styles_style_level_get_style (StylesStyleLevel* self);
VALA_EXTERN void style_set_branch_margin (Style* self,
                              gint* value);
VALA_EXTERN void style_set_branch_radius (Style* self,
                              gint* value);
VALA_EXTERN void style_set_link_type (Style* self,
                          LinkType* value);
VALA_EXTERN void style_set_link_width (Style* self,
                           gint* value);
VALA_EXTERN void style_set_link_arrow (Style* self,
                           gboolean* value);
VALA_EXTERN void style_set_link_arrow_size (Style* self,
                                gint* value);
VALA_EXTERN void style_set_link_dash (Style* self,
                          LinkDash* value);
VALA_EXTERN void style_set_node_border (Style* self,
                            NodeBorder* value);
VALA_EXTERN void style_set_node_margin (Style* self,
                            gint value);
VALA_EXTERN void style_set_node_padding (Style* self,
                             gint value);
VALA_EXTERN void style_set_node_text_align (Style* self,
                                PangoAlignment* value);
VALA_EXTERN void style_set_node_width (Style* self,
                           gint* 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_node_markup (Style* self,
                            gboolean* value);
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 style_set_connection_arrow (Style* self,
                                 const gchar* value);
VALA_EXTERN void style_set_connection_arrow_size (Style* self,
                                      gint* value);
VALA_EXTERN void style_set_connection_padding (Style* self,
                                   gint* value);
VALA_EXTERN void style_set_connection_title_width (Style* self,
                                       gint* value);
VALA_EXTERN void style_set_connection_text_align (Style* self,
                                      PangoAlignment* value);
VALA_EXTERN void style_set_callout_padding (Style* self,
                                gint* value);
VALA_EXTERN void style_set_callout_ptr_width (Style* self,
                                  gint* value);
VALA_EXTERN void style_set_callout_ptr_length (Style* self,
                                   gint* value);
VALA_EXTERN void style_set_callout_text_align (Style* self,
                                   PangoAlignment* value);
VALA_EXTERN void styles_load (Styles* self,
                  xmlNode* n);
VALA_EXTERN void style_load_node (Style* self,
                      xmlNode* node);
VALA_EXTERN void style_load_connection (Style* self,
                            xmlNode* node);
VALA_EXTERN void style_load_callout (Style* self,
                         xmlNode* node);
static void styles_style_level_set_isset (StylesStyleLevel* self,
                                   gboolean value);
VALA_EXTERN void styles_save (Styles* self,
                  xmlNode* parent);
static gboolean styles_style_level_get_isset (StylesStyleLevel* self);
VALA_EXTERN void style_save_node_in_node (Style* self,
                              xmlNode* n);
VALA_EXTERN void style_save_connection_in_node (Style* self,
                                    xmlNode* n);
VALA_EXTERN void style_save_callout_in_node (Style* self,
                                 xmlNode* n);
VALA_EXTERN void styles_set_all_to_style (Styles* self,
                              Style* style);
VALA_EXTERN gboolean style_copy (Style* self,
                     Style* s);
VALA_EXTERN void styles_set_levels_to_style (Styles* self,
                                 gint levels,
                                 Style* style);
VALA_EXTERN LinkType* styles_get_link_type (Styles* self,
                                const gchar* name);
VALA_EXTERN gchar* link_type_name (LinkType* self);
VALA_EXTERN GArray* styles_get_link_types (Styles* self);
VALA_EXTERN LinkDash* styles_get_link_dash (Styles* self,
                                const gchar* name);
VALA_EXTERN GArray* styles_get_link_dashes (Styles* self);
VALA_EXTERN NodeBorder* styles_get_node_border (Styles* self,
                                    const gchar* name);
VALA_EXTERN gchar* node_border_name (NodeBorder* self);
VALA_EXTERN GArray* styles_get_node_borders (Styles* self);
VALA_EXTERN Style* styles_get_style_for_level (Styles* self,
                                   guint level,
                                   Style* alternative);
VALA_EXTERN Style* styles_get_global_style (Styles* self);
VALA_EXTERN Style* style_new (void);
VALA_EXTERN Style* style_construct (GType object_type);
static void styles_style_level_set_style (StylesStyleLevel* self,
                                   Style* value);
static void styles_style_level_finalize (StylesStyleLevel * obj);
static GType styles_style_level_get_type_once (void);
static void styles_finalize (Styles * obj);
static GType styles_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
styles_get_instance_private (Styles* self)
{
	return G_STRUCT_MEMBER_P (self, Styles_private_offset);
}

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

static void
_vala_LinkType_free_function_content_of (gpointer data)
{
	LinkType* self;
	self = *((LinkType**) data);
	_g_object_unref0_ (self);
}

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

static void
_vala_LinkDash_free_function_content_of (gpointer data)
{
	LinkDash* self;
	self = *((LinkDash**) data);
	_g_object_unref0_ (self);
}

static void
_vala_NodeBorder_free_function_content_of (gpointer data)
{
	NodeBorder* self;
	self = *((NodeBorder**) data);
	_g_object_unref0_ (self);
}

static void
_styles_style_level_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (styles_style_level_unref (var), NULL));
}

static void
_vala_StylesStyleLevel_free_function_content_of (gpointer data)
{
	StylesStyleLevel* self;
	self = *((StylesStyleLevel**) data);
	_styles_style_level_unref0_ (self);
}

static gpointer
_styles_style_level_ref0 (gpointer self)
{
	return self ? styles_style_level_ref (self) : NULL;
}

Styles*
styles_construct (GType object_type)
{
	Styles* self = NULL;
	gboolean rtl = FALSE;
	PangoAlignment _tmp0_ = 0;
	PangoAlignment text_align = 0;
	LinkTypeStraight* lt_straight = NULL;
	LinkTypeStraight* _tmp1_;
	LinkTypeSquared* lt_squared = NULL;
	LinkTypeSquared* _tmp2_;
	LinkTypeRounded* lt_rounded = NULL;
	LinkTypeRounded* _tmp3_;
	LinkTypeCurved* lt_curved = NULL;
	LinkTypeCurved* _tmp4_;
	GArray* _tmp5_;
	GArray* _tmp6_;
	LinkTypeStraight* _tmp7_;
	LinkType* _tmp8_;
	GArray* _tmp9_;
	LinkTypeSquared* _tmp10_;
	LinkType* _tmp11_;
	GArray* _tmp12_;
	LinkTypeRounded* _tmp13_;
	LinkType* _tmp14_;
	GArray* _tmp15_;
	LinkTypeCurved* _tmp16_;
	LinkType* _tmp17_;
	LinkDash* ld_solid = NULL;
	gdouble* _tmp18_;
	gdouble* _tmp19_;
	gint _tmp19__length1;
	LinkDash* _tmp20_;
	LinkDash* _tmp21_;
	LinkDash* ld_dotted = NULL;
	gdouble* _tmp22_;
	gdouble* _tmp23_;
	gint _tmp23__length1;
	LinkDash* _tmp24_;
	LinkDash* _tmp25_;
	LinkDash* ld_sdash = NULL;
	gdouble* _tmp26_;
	gdouble* _tmp27_;
	gint _tmp27__length1;
	LinkDash* _tmp28_;
	LinkDash* _tmp29_;
	LinkDash* ld_ldash = NULL;
	gdouble* _tmp30_;
	gdouble* _tmp31_;
	gint _tmp31__length1;
	LinkDash* _tmp32_;
	LinkDash* _tmp33_;
	GArray* _tmp34_;
	GArray* _tmp35_;
	LinkDash* _tmp36_;
	LinkDash* _tmp37_;
	GArray* _tmp38_;
	LinkDash* _tmp39_;
	LinkDash* _tmp40_;
	GArray* _tmp41_;
	LinkDash* _tmp42_;
	LinkDash* _tmp43_;
	GArray* _tmp44_;
	LinkDash* _tmp45_;
	LinkDash* _tmp46_;
	NodeBorderNone* nb_none = NULL;
	NodeBorderNone* _tmp47_;
	NodeBorderUnderlined* nb_underlined = NULL;
	NodeBorderUnderlined* _tmp48_;
	NodeBorderBracket* nb_bracketed = NULL;
	NodeBorderBracket* _tmp49_;
	NodeBorderSquared* nb_squared = NULL;
	NodeBorderSquared* _tmp50_;
	NodeBorderRounded* nb_rounded = NULL;
	NodeBorderRounded* _tmp51_;
	NodeBorderPill* nb_pilled = NULL;
	NodeBorderPill* _tmp52_;
	GArray* _tmp53_;
	GArray* _tmp54_;
	NodeBorderNone* _tmp55_;
	NodeBorder* _tmp56_;
	GArray* _tmp57_;
	NodeBorderUnderlined* _tmp58_;
	NodeBorder* _tmp59_;
	GArray* _tmp60_;
	NodeBorderBracket* _tmp61_;
	NodeBorder* _tmp62_;
	GArray* _tmp63_;
	NodeBorderSquared* _tmp64_;
	NodeBorder* _tmp65_;
	GArray* _tmp66_;
	NodeBorderRounded* _tmp67_;
	NodeBorder* _tmp68_;
	GArray* _tmp69_;
	NodeBorderPill* _tmp70_;
	NodeBorder* _tmp71_;
	GArray* _tmp72_;
	self = (Styles*) g_type_create_instance (object_type);
	rtl = gtk_get_locale_direction () == GTK_TEXT_DIR_RTL;
	if (rtl) {
		_tmp0_ = PANGO_ALIGN_RIGHT;
	} else {
		_tmp0_ = PANGO_ALIGN_LEFT;
	}
	text_align = _tmp0_;
	_tmp1_ = link_type_straight_new ();
	lt_straight = _tmp1_;
	_tmp2_ = link_type_squared_new ();
	lt_squared = _tmp2_;
	_tmp3_ = link_type_rounded_new ();
	lt_rounded = _tmp3_;
	_tmp4_ = link_type_curved_new ();
	lt_curved = _tmp4_;
	_tmp5_ = g_array_new (TRUE, TRUE, sizeof (LinkType*));
	g_array_set_clear_func (_tmp5_, (GDestroyNotify) _vala_LinkType_free_function_content_of);
	_g_array_unref0 (styles__link_types);
	styles__link_types = _tmp5_;
	_tmp6_ = styles__link_types;
	_tmp7_ = lt_straight;
	_tmp8_ = _g_object_ref0 ((LinkType*) _tmp7_);
	g_array_append_val (_tmp6_, _tmp8_);
	_tmp9_ = styles__link_types;
	_tmp10_ = lt_squared;
	_tmp11_ = _g_object_ref0 ((LinkType*) _tmp10_);
	g_array_append_val (_tmp9_, _tmp11_);
	_tmp12_ = styles__link_types;
	_tmp13_ = lt_rounded;
	_tmp14_ = _g_object_ref0 ((LinkType*) _tmp13_);
	g_array_append_val (_tmp12_, _tmp14_);
	_tmp15_ = styles__link_types;
	_tmp16_ = lt_curved;
	_tmp17_ = _g_object_ref0 ((LinkType*) _tmp16_);
	g_array_append_val (_tmp15_, _tmp17_);
	_tmp18_ = g_new0 (gdouble, 0);
	_tmp19_ = _tmp18_;
	_tmp19__length1 = 0;
	_tmp20_ = link_dash_new ("solid", _ ("Solid"), _tmp19_, 0);
	_tmp21_ = _tmp20_;
	_tmp19_ = (g_free (_tmp19_), NULL);
	ld_solid = _tmp21_;
	_tmp22_ = g_new0 (gdouble, 2);
	_tmp22_[0] = (gdouble) 2;
	_tmp22_[1] = (gdouble) 6;
	_tmp23_ = _tmp22_;
	_tmp23__length1 = 2;
	_tmp24_ = link_dash_new ("dotted", _ ("Dotted"), _tmp23_, 2);
	_tmp25_ = _tmp24_;
	_tmp23_ = (g_free (_tmp23_), NULL);
	ld_dotted = _tmp25_;
	_tmp26_ = g_new0 (gdouble, 2);
	_tmp26_[0] = (gdouble) 6;
	_tmp26_[1] = (gdouble) 6;
	_tmp27_ = _tmp26_;
	_tmp27__length1 = 2;
	_tmp28_ = link_dash_new ("shortdash", _ ("Short Dash"), _tmp27_, 2);
	_tmp29_ = _tmp28_;
	_tmp27_ = (g_free (_tmp27_), NULL);
	ld_sdash = _tmp29_;
	_tmp30_ = g_new0 (gdouble, 2);
	_tmp30_[0] = (gdouble) 20;
	_tmp30_[1] = (gdouble) 6;
	_tmp31_ = _tmp30_;
	_tmp31__length1 = 2;
	_tmp32_ = link_dash_new ("longdash", _ ("Long Dash"), _tmp31_, 2);
	_tmp33_ = _tmp32_;
	_tmp31_ = (g_free (_tmp31_), NULL);
	ld_ldash = _tmp33_;
	_tmp34_ = g_array_new (TRUE, TRUE, sizeof (LinkDash*));
	g_array_set_clear_func (_tmp34_, (GDestroyNotify) _vala_LinkDash_free_function_content_of);
	_g_array_unref0 (styles__link_dashes);
	styles__link_dashes = _tmp34_;
	_tmp35_ = styles__link_dashes;
	_tmp36_ = ld_solid;
	_tmp37_ = _g_object_ref0 (_tmp36_);
	g_array_append_val (_tmp35_, _tmp37_);
	_tmp38_ = styles__link_dashes;
	_tmp39_ = ld_dotted;
	_tmp40_ = _g_object_ref0 (_tmp39_);
	g_array_append_val (_tmp38_, _tmp40_);
	_tmp41_ = styles__link_dashes;
	_tmp42_ = ld_sdash;
	_tmp43_ = _g_object_ref0 (_tmp42_);
	g_array_append_val (_tmp41_, _tmp43_);
	_tmp44_ = styles__link_dashes;
	_tmp45_ = ld_ldash;
	_tmp46_ = _g_object_ref0 (_tmp45_);
	g_array_append_val (_tmp44_, _tmp46_);
	_tmp47_ = node_border_none_new ();
	nb_none = _tmp47_;
	_tmp48_ = node_border_underlined_new ();
	nb_underlined = _tmp48_;
	_tmp49_ = node_border_bracket_new ();
	nb_bracketed = _tmp49_;
	_tmp50_ = node_border_squared_new ();
	nb_squared = _tmp50_;
	_tmp51_ = node_border_rounded_new ();
	nb_rounded = _tmp51_;
	_tmp52_ = node_border_pill_new ();
	nb_pilled = _tmp52_;
	_tmp53_ = g_array_new (TRUE, TRUE, sizeof (NodeBorder*));
	g_array_set_clear_func (_tmp53_, (GDestroyNotify) _vala_NodeBorder_free_function_content_of);
	_g_array_unref0 (styles__node_borders);
	styles__node_borders = _tmp53_;
	_tmp54_ = styles__node_borders;
	_tmp55_ = nb_none;
	_tmp56_ = _g_object_ref0 ((NodeBorder*) _tmp55_);
	g_array_append_val (_tmp54_, _tmp56_);
	_tmp57_ = styles__node_borders;
	_tmp58_ = nb_underlined;
	_tmp59_ = _g_object_ref0 ((NodeBorder*) _tmp58_);
	g_array_append_val (_tmp57_, _tmp59_);
	_tmp60_ = styles__node_borders;
	_tmp61_ = nb_bracketed;
	_tmp62_ = _g_object_ref0 ((NodeBorder*) _tmp61_);
	g_array_append_val (_tmp60_, _tmp62_);
	_tmp63_ = styles__node_borders;
	_tmp64_ = nb_squared;
	_tmp65_ = _g_object_ref0 ((NodeBorder*) _tmp64_);
	g_array_append_val (_tmp63_, _tmp65_);
	_tmp66_ = styles__node_borders;
	_tmp67_ = nb_rounded;
	_tmp68_ = _g_object_ref0 ((NodeBorder*) _tmp67_);
	g_array_append_val (_tmp66_, _tmp68_);
	_tmp69_ = styles__node_borders;
	_tmp70_ = nb_pilled;
	_tmp71_ = _g_object_ref0 ((NodeBorder*) _tmp70_);
	g_array_append_val (_tmp69_, _tmp71_);
	_tmp72_ = g_array_new (TRUE, TRUE, sizeof (StylesStyleLevel*));
	g_array_set_clear_func (_tmp72_, (GDestroyNotify) _vala_StylesStyleLevel_free_function_content_of);
	_g_array_unref0 (self->priv->_styles);
	self->priv->_styles = _tmp72_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp73_ = FALSE;
			_tmp73_ = TRUE;
			while (TRUE) {
				StylesStyleLevel* level = NULL;
				StylesStyleLevel* _tmp75_;
				StylesStyleLevel* _tmp76_;
				Style* _tmp77_;
				Style* _tmp78_;
				gint _tmp79_;
				StylesStyleLevel* _tmp80_;
				Style* _tmp81_;
				Style* _tmp82_;
				gint _tmp83_;
				StylesStyleLevel* _tmp84_;
				Style* _tmp85_;
				Style* _tmp86_;
				LinkTypeCurved* _tmp87_;
				StylesStyleLevel* _tmp88_;
				Style* _tmp89_;
				Style* _tmp90_;
				gint _tmp91_;
				StylesStyleLevel* _tmp92_;
				Style* _tmp93_;
				Style* _tmp94_;
				gboolean _tmp95_;
				StylesStyleLevel* _tmp96_;
				Style* _tmp97_;
				Style* _tmp98_;
				gint _tmp99_;
				StylesStyleLevel* _tmp100_;
				Style* _tmp101_;
				Style* _tmp102_;
				LinkDash* _tmp103_;
				StylesStyleLevel* _tmp124_;
				Style* _tmp125_;
				Style* _tmp126_;
				StylesStyleLevel* _tmp127_;
				Style* _tmp128_;
				Style* _tmp129_;
				gint _tmp130_;
				StylesStyleLevel* _tmp131_;
				Style* _tmp132_;
				Style* _tmp133_;
				gint _tmp134_;
				StylesStyleLevel* _tmp135_;
				Style* _tmp136_;
				Style* _tmp137_;
				gboolean _tmp138_;
				StylesStyleLevel* _tmp139_;
				Style* _tmp140_;
				Style* _tmp141_;
				gboolean _tmp142_;
				StylesStyleLevel* _tmp143_;
				Style* _tmp144_;
				Style* _tmp145_;
				LinkDash* _tmp146_;
				StylesStyleLevel* _tmp147_;
				Style* _tmp148_;
				Style* _tmp149_;
				gint _tmp150_;
				StylesStyleLevel* _tmp151_;
				Style* _tmp152_;
				Style* _tmp153_;
				StylesStyleLevel* _tmp154_;
				Style* _tmp155_;
				Style* _tmp156_;
				gint _tmp157_;
				StylesStyleLevel* _tmp158_;
				Style* _tmp159_;
				Style* _tmp160_;
				gint _tmp161_;
				StylesStyleLevel* _tmp162_;
				Style* _tmp163_;
				Style* _tmp164_;
				gint _tmp165_;
				StylesStyleLevel* _tmp166_;
				Style* _tmp167_;
				Style* _tmp168_;
				StylesStyleLevel* _tmp169_;
				Style* _tmp170_;
				Style* _tmp171_;
				gint _tmp172_;
				StylesStyleLevel* _tmp173_;
				Style* _tmp174_;
				Style* _tmp175_;
				gint _tmp176_;
				StylesStyleLevel* _tmp177_;
				Style* _tmp178_;
				Style* _tmp179_;
				gint _tmp180_;
				StylesStyleLevel* _tmp181_;
				Style* _tmp182_;
				Style* _tmp183_;
				GArray* _tmp184_;
				StylesStyleLevel* _tmp185_;
				StylesStyleLevel* _tmp186_;
				if (!_tmp73_) {
					gint _tmp74_;
					_tmp74_ = i;
					i = _tmp74_ + 1;
				}
				_tmp73_ = FALSE;
				if (!(i <= 10)) {
					break;
				}
				_tmp75_ = styles_style_level_new ();
				level = _tmp75_;
				_tmp76_ = level;
				_tmp77_ = styles_style_level_get_style (_tmp76_);
				_tmp78_ = _tmp77_;
				_tmp79_ = 100;
				style_set_branch_margin (_tmp78_, &_tmp79_);
				_tmp80_ = level;
				_tmp81_ = styles_style_level_get_style (_tmp80_);
				_tmp82_ = _tmp81_;
				_tmp83_ = 25;
				style_set_branch_radius (_tmp82_, &_tmp83_);
				_tmp84_ = level;
				_tmp85_ = styles_style_level_get_style (_tmp84_);
				_tmp86_ = _tmp85_;
				_tmp87_ = lt_curved;
				style_set_link_type (_tmp86_, (LinkType*) _tmp87_);
				_tmp88_ = level;
				_tmp89_ = styles_style_level_get_style (_tmp88_);
				_tmp90_ = _tmp89_;
				_tmp91_ = 4;
				style_set_link_width (_tmp90_, &_tmp91_);
				_tmp92_ = level;
				_tmp93_ = styles_style_level_get_style (_tmp92_);
				_tmp94_ = _tmp93_;
				_tmp95_ = FALSE;
				style_set_link_arrow (_tmp94_, &_tmp95_);
				_tmp96_ = level;
				_tmp97_ = styles_style_level_get_style (_tmp96_);
				_tmp98_ = _tmp97_;
				_tmp99_ = 2;
				style_set_link_arrow_size (_tmp98_, &_tmp99_);
				_tmp100_ = level;
				_tmp101_ = styles_style_level_get_style (_tmp100_);
				_tmp102_ = _tmp101_;
				_tmp103_ = ld_solid;
				style_set_link_dash (_tmp102_, _tmp103_);
				if (i == 0) {
					StylesStyleLevel* _tmp104_;
					Style* _tmp105_;
					Style* _tmp106_;
					NodeBorderRounded* _tmp107_;
					StylesStyleLevel* _tmp108_;
					Style* _tmp109_;
					Style* _tmp110_;
					StylesStyleLevel* _tmp111_;
					Style* _tmp112_;
					Style* _tmp113_;
					_tmp104_ = level;
					_tmp105_ = styles_style_level_get_style (_tmp104_);
					_tmp106_ = _tmp105_;
					_tmp107_ = nb_rounded;
					style_set_node_border (_tmp106_, (NodeBorder*) _tmp107_);
					_tmp108_ = level;
					_tmp109_ = styles_style_level_get_style (_tmp108_);
					_tmp110_ = _tmp109_;
					style_set_node_margin (_tmp110_, 10);
					_tmp111_ = level;
					_tmp112_ = styles_style_level_get_style (_tmp111_);
					_tmp113_ = _tmp112_;
					style_set_node_padding (_tmp113_, 10);
				} else {
					StylesStyleLevel* _tmp114_;
					Style* _tmp115_;
					Style* _tmp116_;
					NodeBorderUnderlined* _tmp117_;
					StylesStyleLevel* _tmp118_;
					Style* _tmp119_;
					Style* _tmp120_;
					StylesStyleLevel* _tmp121_;
					Style* _tmp122_;
					Style* _tmp123_;
					_tmp114_ = level;
					_tmp115_ = styles_style_level_get_style (_tmp114_);
					_tmp116_ = _tmp115_;
					_tmp117_ = nb_underlined;
					style_set_node_border (_tmp116_, (NodeBorder*) _tmp117_);
					_tmp118_ = level;
					_tmp119_ = styles_style_level_get_style (_tmp118_);
					_tmp120_ = _tmp119_;
					style_set_node_margin (_tmp120_, 8);
					_tmp121_ = level;
					_tmp122_ = styles_style_level_get_style (_tmp121_);
					_tmp123_ = _tmp122_;
					style_set_node_padding (_tmp123_, 6);
				}
				_tmp124_ = level;
				_tmp125_ = styles_style_level_get_style (_tmp124_);
				_tmp126_ = _tmp125_;
				style_set_node_text_align (_tmp126_, &text_align);
				_tmp127_ = level;
				_tmp128_ = styles_style_level_get_style (_tmp127_);
				_tmp129_ = _tmp128_;
				_tmp130_ = 200;
				style_set_node_width (_tmp129_, &_tmp130_);
				_tmp131_ = level;
				_tmp132_ = styles_style_level_get_style (_tmp131_);
				_tmp133_ = _tmp132_;
				_tmp134_ = 4;
				style_set_node_borderwidth (_tmp133_, &_tmp134_);
				_tmp135_ = level;
				_tmp136_ = styles_style_level_get_style (_tmp135_);
				_tmp137_ = _tmp136_;
				_tmp138_ = FALSE;
				style_set_node_fill (_tmp137_, &_tmp138_);
				_tmp139_ = level;
				_tmp140_ = styles_style_level_get_style (_tmp139_);
				_tmp141_ = _tmp140_;
				_tmp142_ = TRUE;
				style_set_node_markup (_tmp141_, &_tmp142_);
				_tmp143_ = level;
				_tmp144_ = styles_style_level_get_style (_tmp143_);
				_tmp145_ = _tmp144_;
				_tmp146_ = ld_dotted;
				style_set_connection_dash (_tmp145_, _tmp146_);
				_tmp147_ = level;
				_tmp148_ = styles_style_level_get_style (_tmp147_);
				_tmp149_ = _tmp148_;
				_tmp150_ = 2;
				style_set_connection_line_width (_tmp149_, &_tmp150_);
				_tmp151_ = level;
				_tmp152_ = styles_style_level_get_style (_tmp151_);
				_tmp153_ = _tmp152_;
				style_set_connection_arrow (_tmp153_, "fromto");
				_tmp154_ = level;
				_tmp155_ = styles_style_level_get_style (_tmp154_);
				_tmp156_ = _tmp155_;
				_tmp157_ = 0;
				style_set_connection_arrow_size (_tmp156_, &_tmp157_);
				_tmp158_ = level;
				_tmp159_ = styles_style_level_get_style (_tmp158_);
				_tmp160_ = _tmp159_;
				_tmp161_ = 3;
				style_set_connection_padding (_tmp160_, &_tmp161_);
				_tmp162_ = level;
				_tmp163_ = styles_style_level_get_style (_tmp162_);
				_tmp164_ = _tmp163_;
				_tmp165_ = 100;
				style_set_connection_title_width (_tmp164_, &_tmp165_);
				_tmp166_ = level;
				_tmp167_ = styles_style_level_get_style (_tmp166_);
				_tmp168_ = _tmp167_;
				style_set_connection_text_align (_tmp168_, &text_align);
				_tmp169_ = level;
				_tmp170_ = styles_style_level_get_style (_tmp169_);
				_tmp171_ = _tmp170_;
				_tmp172_ = 5;
				style_set_callout_padding (_tmp171_, &_tmp172_);
				_tmp173_ = level;
				_tmp174_ = styles_style_level_get_style (_tmp173_);
				_tmp175_ = _tmp174_;
				_tmp176_ = 20;
				style_set_callout_ptr_width (_tmp175_, &_tmp176_);
				_tmp177_ = level;
				_tmp178_ = styles_style_level_get_style (_tmp177_);
				_tmp179_ = _tmp178_;
				_tmp180_ = 20;
				style_set_callout_ptr_length (_tmp179_, &_tmp180_);
				_tmp181_ = level;
				_tmp182_ = styles_style_level_get_style (_tmp181_);
				_tmp183_ = _tmp182_;
				style_set_callout_text_align (_tmp183_, &text_align);
				_tmp184_ = self->priv->_styles;
				_tmp185_ = level;
				_tmp186_ = _styles_style_level_ref0 (_tmp185_);
				g_array_append_val (_tmp184_, _tmp186_);
				_styles_style_level_unref0 (level);
			}
		}
	}
	_g_object_unref0 (nb_pilled);
	_g_object_unref0 (nb_rounded);
	_g_object_unref0 (nb_squared);
	_g_object_unref0 (nb_bracketed);
	_g_object_unref0 (nb_underlined);
	_g_object_unref0 (nb_none);
	_g_object_unref0 (ld_ldash);
	_g_object_unref0 (ld_sdash);
	_g_object_unref0 (ld_dotted);
	_g_object_unref0 (ld_solid);
	_g_object_unref0 (lt_curved);
	_g_object_unref0 (lt_rounded);
	_g_object_unref0 (lt_squared);
	_g_object_unref0 (lt_straight);
	return self;
}

Styles*
styles_new (void)
{
	return styles_construct (TYPE_STYLES);
}

static gboolean
bool_parse (const gchar* str)
{
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	if (g_strcmp0 (str, "true") == 0) {
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

void
styles_load (Styles* self,
             xmlNode* n)
{
	g_return_if_fail (self != 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_;
					_tmp6_ = it;
					_tmp7_ = _tmp6_->name;
					if (g_strcmp0 (_tmp7_, "style") == 0) {
						gchar* l = NULL;
						xmlNode* _tmp8_;
						gchar* _tmp9_;
						gchar* s = NULL;
						xmlNode* _tmp10_;
						gchar* _tmp11_;
						const gchar* _tmp12_;
						_tmp8_ = it;
						_tmp9_ = (gchar*) xmlGetProp (_tmp8_, (xmlChar*) "level");
						l = _tmp9_;
						_tmp10_ = it;
						_tmp11_ = (gchar*) xmlGetProp (_tmp10_, (xmlChar*) "isset");
						s = _tmp11_;
						_tmp12_ = l;
						if (_tmp12_ != NULL) {
							gint level = 0;
							const gchar* _tmp13_;
							GArray* _tmp14_;
							StylesStyleLevel* _tmp15_;
							Style* _tmp16_;
							Style* _tmp17_;
							xmlNode* _tmp18_;
							GArray* _tmp19_;
							StylesStyleLevel* _tmp20_;
							Style* _tmp21_;
							Style* _tmp22_;
							xmlNode* _tmp23_;
							GArray* _tmp24_;
							StylesStyleLevel* _tmp25_;
							Style* _tmp26_;
							Style* _tmp27_;
							xmlNode* _tmp28_;
							gboolean _tmp29_ = FALSE;
							const gchar* _tmp30_;
							GArray* _tmp32_;
							StylesStyleLevel* _tmp33_;
							_tmp13_ = l;
							level = atoi (_tmp13_);
							_tmp14_ = self->priv->_styles;
							_tmp15_ = g_array_index (_tmp14_, StylesStyleLevel*, (guint) level);
							_tmp16_ = styles_style_level_get_style (_tmp15_);
							_tmp17_ = _tmp16_;
							_tmp18_ = it;
							style_load_node (_tmp17_, _tmp18_);
							_tmp19_ = self->priv->_styles;
							_tmp20_ = g_array_index (_tmp19_, StylesStyleLevel*, (guint) level);
							_tmp21_ = styles_style_level_get_style (_tmp20_);
							_tmp22_ = _tmp21_;
							_tmp23_ = it;
							style_load_connection (_tmp22_, _tmp23_);
							_tmp24_ = self->priv->_styles;
							_tmp25_ = g_array_index (_tmp24_, StylesStyleLevel*, (guint) level);
							_tmp26_ = styles_style_level_get_style (_tmp25_);
							_tmp27_ = _tmp26_;
							_tmp28_ = it;
							style_load_callout (_tmp27_, _tmp28_);
							_tmp30_ = s;
							if (_tmp30_ != NULL) {
								const gchar* _tmp31_;
								_tmp31_ = s;
								_tmp29_ = bool_parse (_tmp31_);
							} else {
								_tmp29_ = FALSE;
							}
							_tmp32_ = self->priv->_styles;
							_tmp33_ = g_array_index (_tmp32_, StylesStyleLevel*, (guint) level);
							styles_style_level_set_isset (_tmp33_, _tmp29_);
						}
						_g_free0 (s);
						_g_free0 (l);
					}
				}
			}
		}
	}
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

void
styles_save (Styles* self,
             xmlNode* parent)
{
	xmlNode* node = NULL;
	xmlNode* _tmp0_;
	xmlNode* _tmp32_;
	g_return_if_fail (self != NULL);
	_tmp0_ = xmlNewNode (NULL, (xmlChar*) "styles");
	node = _tmp0_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp1_ = FALSE;
			_tmp1_ = TRUE;
			while (TRUE) {
				GArray* _tmp3_;
				xmlNode* n = NULL;
				xmlNode* _tmp4_;
				xmlNode* _tmp5_;
				gchar* _tmp6_;
				gchar* _tmp7_;
				xmlNode* _tmp8_;
				GArray* _tmp9_;
				StylesStyleLevel* _tmp10_;
				gboolean _tmp11_;
				gboolean _tmp12_;
				gchar* _tmp13_;
				gchar* _tmp14_;
				GArray* _tmp15_;
				StylesStyleLevel* _tmp16_;
				Style* _tmp17_;
				Style* _tmp18_;
				xmlNode* _tmp19_;
				GArray* _tmp20_;
				StylesStyleLevel* _tmp21_;
				Style* _tmp22_;
				Style* _tmp23_;
				xmlNode* _tmp24_;
				GArray* _tmp25_;
				StylesStyleLevel* _tmp26_;
				Style* _tmp27_;
				Style* _tmp28_;
				xmlNode* _tmp29_;
				xmlNode* _tmp30_;
				xmlNode* _tmp31_;
				if (!_tmp1_) {
					gint _tmp2_;
					_tmp2_ = i;
					i = _tmp2_ + 1;
				}
				_tmp1_ = FALSE;
				_tmp3_ = self->priv->_styles;
				if (!(((guint) i) < _tmp3_->len)) {
					break;
				}
				_tmp4_ = xmlNewNode (NULL, (xmlChar*) "style");
				n = _tmp4_;
				_tmp5_ = n;
				_tmp6_ = g_strdup_printf ("%i", i);
				_tmp7_ = _tmp6_;
				xmlSetProp (_tmp5_, (xmlChar*) "level", (xmlChar*) _tmp7_);
				_g_free0 (_tmp7_);
				_tmp8_ = n;
				_tmp9_ = self->priv->_styles;
				_tmp10_ = g_array_index (_tmp9_, StylesStyleLevel*, (guint) i);
				_tmp11_ = styles_style_level_get_isset (_tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = bool_to_string (_tmp12_);
				_tmp14_ = _tmp13_;
				xmlSetProp (_tmp8_, (xmlChar*) "isset", (xmlChar*) _tmp14_);
				_g_free0 (_tmp14_);
				_tmp15_ = self->priv->_styles;
				_tmp16_ = g_array_index (_tmp15_, StylesStyleLevel*, (guint) i);
				_tmp17_ = styles_style_level_get_style (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = n;
				style_save_node_in_node (_tmp18_, _tmp19_);
				_tmp20_ = self->priv->_styles;
				_tmp21_ = g_array_index (_tmp20_, StylesStyleLevel*, (guint) i);
				_tmp22_ = styles_style_level_get_style (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = n;
				style_save_connection_in_node (_tmp23_, _tmp24_);
				_tmp25_ = self->priv->_styles;
				_tmp26_ = g_array_index (_tmp25_, StylesStyleLevel*, (guint) i);
				_tmp27_ = styles_style_level_get_style (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = n;
				style_save_callout_in_node (_tmp28_, _tmp29_);
				_tmp30_ = node;
				_tmp31_ = n;
				xmlAddChild (_tmp30_, _tmp31_);
			}
		}
	}
	_tmp32_ = node;
	xmlAddChild (parent, _tmp32_);
}

void
styles_set_all_to_style (Styles* self,
                         Style* style)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (style != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GArray* _tmp2_;
				StylesStyleLevel* _tmp3_;
				Style* _tmp4_;
				Style* _tmp5_;
				GArray* _tmp6_;
				StylesStyleLevel* _tmp7_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i <= 10)) {
					break;
				}
				_tmp2_ = self->priv->_styles;
				_tmp3_ = g_array_index (_tmp2_, StylesStyleLevel*, (guint) i);
				_tmp4_ = styles_style_level_get_style (_tmp3_);
				_tmp5_ = _tmp4_;
				style_copy (_tmp5_, style);
				_tmp6_ = self->priv->_styles;
				_tmp7_ = g_array_index (_tmp6_, StylesStyleLevel*, (guint) i);
				styles_style_level_set_isset (_tmp7_, TRUE);
			}
		}
	}
}

void
styles_set_levels_to_style (Styles* self,
                            gint levels,
                            Style* style)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (style != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (!(i < 10)) {
					break;
				}
				if ((levels & (1 << i)) != 0) {
					GArray* _tmp2_;
					StylesStyleLevel* _tmp3_;
					Style* _tmp4_;
					Style* _tmp5_;
					GArray* _tmp6_;
					StylesStyleLevel* _tmp7_;
					_tmp2_ = self->priv->_styles;
					_tmp3_ = g_array_index (_tmp2_, StylesStyleLevel*, (guint) i);
					_tmp4_ = styles_style_level_get_style (_tmp3_);
					_tmp5_ = _tmp4_;
					style_copy (_tmp5_, style);
					_tmp6_ = self->priv->_styles;
					_tmp7_ = g_array_index (_tmp6_, StylesStyleLevel*, (guint) i);
					styles_style_level_set_isset (_tmp7_, TRUE);
				}
			}
		}
	}
}

LinkType*
styles_get_link_type (Styles* self,
                      const gchar* name)
{
	LinkType* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GArray* _tmp2_;
				LinkType* link_type = NULL;
				GArray* _tmp3_;
				LinkType* _tmp4_;
				LinkType* _tmp5_;
				LinkType* _tmp6_;
				gchar* _tmp7_;
				gchar* _tmp8_;
				gboolean _tmp9_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = styles__link_types;
				if (!(((guint) i) < _tmp2_->len)) {
					break;
				}
				_tmp3_ = styles__link_types;
				_tmp4_ = g_array_index (_tmp3_, LinkType*, (guint) i);
				_tmp5_ = _g_object_ref0 (_tmp4_);
				link_type = _tmp5_;
				_tmp6_ = link_type;
				_tmp7_ = link_type_name (_tmp6_);
				_tmp8_ = _tmp7_;
				_tmp9_ = g_strcmp0 (_tmp8_, name) == 0;
				_g_free0 (_tmp8_);
				if (_tmp9_) {
					result = link_type;
					return result;
				}
				_g_object_unref0 (link_type);
			}
		}
	}
	result = NULL;
	return result;
}

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

GArray*
styles_get_link_types (Styles* self)
{
	GArray* _tmp0_;
	GArray* _tmp1_;
	GArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = styles__link_types;
	_tmp1_ = _g_array_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

LinkDash*
styles_get_link_dash (Styles* self,
                      const gchar* name)
{
	LinkDash* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GArray* _tmp2_;
				LinkDash* link_dash = NULL;
				GArray* _tmp3_;
				LinkDash* _tmp4_;
				LinkDash* _tmp5_;
				LinkDash* _tmp6_;
				const gchar* _tmp7_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = styles__link_dashes;
				if (!(((guint) i) < _tmp2_->len)) {
					break;
				}
				_tmp3_ = styles__link_dashes;
				_tmp4_ = g_array_index (_tmp3_, LinkDash*, (guint) i);
				_tmp5_ = _g_object_ref0 (_tmp4_);
				link_dash = _tmp5_;
				_tmp6_ = link_dash;
				_tmp7_ = _tmp6_->name;
				if (g_strcmp0 (_tmp7_, name) == 0) {
					result = link_dash;
					return result;
				}
				_g_object_unref0 (link_dash);
			}
		}
	}
	result = NULL;
	return result;
}

GArray*
styles_get_link_dashes (Styles* self)
{
	GArray* _tmp0_;
	GArray* _tmp1_;
	GArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = styles__link_dashes;
	_tmp1_ = _g_array_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

NodeBorder*
styles_get_node_border (Styles* self,
                        const gchar* name)
{
	NodeBorder* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GArray* _tmp2_;
				NodeBorder* node_border = NULL;
				GArray* _tmp3_;
				NodeBorder* _tmp4_;
				NodeBorder* _tmp5_;
				NodeBorder* _tmp6_;
				gchar* _tmp7_;
				gchar* _tmp8_;
				gboolean _tmp9_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = styles__node_borders;
				if (!(((guint) i) < _tmp2_->len)) {
					break;
				}
				_tmp3_ = styles__node_borders;
				_tmp4_ = g_array_index (_tmp3_, NodeBorder*, (guint) i);
				_tmp5_ = _g_object_ref0 (_tmp4_);
				node_border = _tmp5_;
				_tmp6_ = node_border;
				_tmp7_ = node_border_name (_tmp6_);
				_tmp8_ = _tmp7_;
				_tmp9_ = g_strcmp0 (_tmp8_, name) == 0;
				_g_free0 (_tmp8_);
				if (_tmp9_) {
					result = node_border;
					return result;
				}
				_g_object_unref0 (node_border);
			}
		}
	}
	result = NULL;
	return result;
}

GArray*
styles_get_node_borders (Styles* self)
{
	GArray* _tmp0_;
	GArray* _tmp1_;
	GArray* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = styles__node_borders;
	_tmp1_ = _g_array_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

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

Style*
styles_get_style_for_level (Styles* self,
                            guint level,
                            Style* alternative)
{
	guint _tmp0_ = 0U;
	StylesStyleLevel* slevel = NULL;
	GArray* _tmp1_;
	StylesStyleLevel* _tmp2_;
	StylesStyleLevel* _tmp3_;
	Style* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	StylesStyleLevel* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	Style* _tmp12_;
	Style* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (level > ((guint) 9)) {
		_tmp0_ = (guint) 9;
	} else {
		_tmp0_ = level;
	}
	_tmp1_ = self->priv->_styles;
	_tmp2_ = g_array_index (_tmp1_, StylesStyleLevel*, _tmp0_);
	_tmp3_ = _styles_style_level_ref0 (_tmp2_);
	slevel = _tmp3_;
	_tmp6_ = slevel;
	_tmp7_ = styles_style_level_get_isset (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		_tmp5_ = TRUE;
	} else {
		_tmp5_ = alternative == NULL;
	}
	if (_tmp5_) {
		StylesStyleLevel* _tmp9_;
		Style* _tmp10_;
		Style* _tmp11_;
		_tmp9_ = slevel;
		_tmp10_ = styles_style_level_get_style (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp4_ = _tmp11_;
	} else {
		_tmp4_ = alternative;
	}
	_tmp12_ = _style_ref0 (_tmp4_);
	result = _tmp12_;
	_styles_style_level_unref0 (slevel);
	return result;
}

Style*
styles_get_global_style (Styles* self)
{
	GArray* _tmp0_;
	StylesStyleLevel* _tmp1_;
	Style* _tmp2_;
	Style* _tmp3_;
	Style* _tmp4_;
	Style* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_styles;
	_tmp1_ = g_array_index (_tmp0_, StylesStyleLevel*, (guint) 10);
	_tmp2_ = styles_style_level_get_style (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _style_ref0 (_tmp3_);
	result = _tmp4_;
	return result;
}

static inline gpointer
styles_style_level_get_instance_private (StylesStyleLevel* self)
{
	return G_STRUCT_MEMBER_P (self, StylesStyleLevel_private_offset);
}

static StylesStyleLevel*
styles_style_level_construct (GType object_type)
{
	StylesStyleLevel* self = NULL;
	self = (StylesStyleLevel*) g_type_create_instance (object_type);
	return self;
}

static StylesStyleLevel*
styles_style_level_new (void)
{
	return styles_style_level_construct (STYLES_TYPE_STYLE_LEVEL);
}

static Style*
styles_style_level_get_style (StylesStyleLevel* self)
{
	Style* result;
	Style* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_style;
	result = _tmp0_;
	return result;
}

static void
styles_style_level_set_style (StylesStyleLevel* self,
                              Style* value)
{
	Style* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _style_ref0 (value);
	_style_unref0 (self->priv->_style);
	self->priv->_style = _tmp0_;
}

static gboolean
styles_style_level_get_isset (StylesStyleLevel* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_isset;
	return result;
}

static void
styles_style_level_set_isset (StylesStyleLevel* self,
                              gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_isset = value;
}

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

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

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

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

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

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

static GParamSpec*
styles_param_spec_style_level (const gchar* name,
                               const gchar* nick,
                               const gchar* blurb,
                               GType object_type,
                               GParamFlags flags)
{
	StylesParamSpecStyleLevel* spec;
	g_return_val_if_fail (g_type_is_a (object_type, STYLES_TYPE_STYLE_LEVEL), 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);
}

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

static void
styles_value_set_style_level (GValue* value,
                              gpointer v_object)
{
	StylesStyleLevel * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, STYLES_TYPE_STYLE_LEVEL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, STYLES_TYPE_STYLE_LEVEL));
		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;
		styles_style_level_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		styles_style_level_unref (old);
	}
}

static void
styles_value_take_style_level (GValue* value,
                               gpointer v_object)
{
	StylesStyleLevel * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, STYLES_TYPE_STYLE_LEVEL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, STYLES_TYPE_STYLE_LEVEL));
		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) {
		styles_style_level_unref (old);
	}
}

static void
styles_style_level_class_init (StylesStyleLevelClass * klass,
                               gpointer klass_data)
{
	styles_style_level_parent_class = g_type_class_peek_parent (klass);
	((StylesStyleLevelClass *) klass)->finalize = styles_style_level_finalize;
	g_type_class_adjust_private_offset (klass, &StylesStyleLevel_private_offset);
}

static void
styles_style_level_instance_init (StylesStyleLevel * self,
                                  gpointer klass)
{
	Style* _tmp0_;
	self->priv = styles_style_level_get_instance_private (self);
	_tmp0_ = style_new ();
	self->priv->_style = _tmp0_;
	self->priv->_isset = FALSE;
	self->ref_count = 1;
}

static void
styles_style_level_finalize (StylesStyleLevel * obj)
{
	StylesStyleLevel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, STYLES_TYPE_STYLE_LEVEL, StylesStyleLevel);
	g_signal_handlers_destroy (self);
	_style_unref0 (self->priv->_style);
}

static GType
styles_style_level_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { styles_value_style_level_init, styles_value_style_level_free_value, styles_value_style_level_copy_value, styles_value_style_level_peek_pointer, "p", styles_value_style_level_collect_value, "p", styles_value_style_level_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (StylesStyleLevelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) styles_style_level_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (StylesStyleLevel), 0, (GInstanceInitFunc) styles_style_level_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 styles_style_level_type_id;
	styles_style_level_type_id = g_type_register_fundamental (g_type_fundamental_next (), "StylesStyleLevel", &g_define_type_info, &g_define_type_fundamental_info, 0);
	StylesStyleLevel_private_offset = g_type_add_instance_private (styles_style_level_type_id, sizeof (StylesStyleLevelPrivate));
	return styles_style_level_type_id;
}

static GType
styles_style_level_get_type (void)
{
	static volatile gsize styles_style_level_type_id__once = 0;
	if (g_once_init_enter (&styles_style_level_type_id__once)) {
		GType styles_style_level_type_id;
		styles_style_level_type_id = styles_style_level_get_type_once ();
		g_once_init_leave (&styles_style_level_type_id__once, styles_style_level_type_id);
	}
	return styles_style_level_type_id__once;
}

static gpointer
styles_style_level_ref (gpointer instance)
{
	StylesStyleLevel * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
styles_style_level_unref (gpointer instance)
{
	StylesStyleLevel * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		STYLES_STYLE_LEVEL_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

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

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

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

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

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

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

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

void
value_set_styles (GValue* value,
                  gpointer v_object)
{
	Styles * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_STYLES));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_STYLES));
		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;
		styles_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		styles_unref (old);
	}
}

void
value_take_styles (GValue* value,
                   gpointer v_object)
{
	Styles * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_STYLES));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_STYLES));
		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) {
		styles_unref (old);
	}
}

static void
styles_class_init (StylesClass * klass,
                   gpointer klass_data)
{
	styles_parent_class = g_type_class_peek_parent (klass);
	((StylesClass *) klass)->finalize = styles_finalize;
	g_type_class_adjust_private_offset (klass, &Styles_private_offset);
}

static void
styles_instance_init (Styles * self,
                      gpointer klass)
{
	self->priv = styles_get_instance_private (self);
	self->ref_count = 1;
}

static void
styles_finalize (Styles * obj)
{
	Styles * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_STYLES, Styles);
	g_signal_handlers_destroy (self);
	_g_array_unref0 (self->priv->_styles);
}

static GType
styles_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { value_styles_init, value_styles_free_value, value_styles_copy_value, value_styles_peek_pointer, "p", value_styles_collect_value, "p", value_styles_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (StylesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) styles_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Styles), 0, (GInstanceInitFunc) styles_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 styles_type_id;
	styles_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Styles", &g_define_type_info, &g_define_type_fundamental_info, 0);
	Styles_private_offset = g_type_add_instance_private (styles_type_id, sizeof (StylesPrivate));
	return styles_type_id;
}

GType
styles_get_type (void)
{
	static volatile gsize styles_type_id__once = 0;
	if (g_once_init_enter (&styles_type_id__once)) {
		GType styles_type_id;
		styles_type_id = styles_get_type_once ();
		g_once_init_leave (&styles_type_id__once, styles_type_id);
	}
	return styles_type_id__once;
}

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

void
styles_unref (gpointer instance)
{
	Styles * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		STYLES_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

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

