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

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */
/* A simple grouping Entry that is only expandable*/

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.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 SIDEBAR_TYPE_ENTRY (sidebar_entry_get_type ())
#define SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_ENTRY, SidebarEntry))
#define SIDEBAR_IS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_ENTRY))
#define SIDEBAR_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_ENTRY, SidebarEntryIface))

typedef struct _SidebarEntry SidebarEntry;
typedef struct _SidebarEntryIface SidebarEntryIface;

#define SIDEBAR_TYPE_TREE (sidebar_tree_get_type ())
#define SIDEBAR_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_TREE, SidebarTree))
#define SIDEBAR_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SIDEBAR_TYPE_TREE, SidebarTreeClass))
#define SIDEBAR_IS_TREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_TREE))
#define SIDEBAR_IS_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIDEBAR_TYPE_TREE))
#define SIDEBAR_TREE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIDEBAR_TYPE_TREE, SidebarTreeClass))

typedef struct _SidebarTree SidebarTree;
typedef struct _SidebarTreeClass SidebarTreeClass;

#define SIDEBAR_TYPE_EXPANDABLE_ENTRY (sidebar_expandable_entry_get_type ())
#define SIDEBAR_EXPANDABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_EXPANDABLE_ENTRY, SidebarExpandableEntry))
#define SIDEBAR_IS_EXPANDABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_EXPANDABLE_ENTRY))
#define SIDEBAR_EXPANDABLE_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_EXPANDABLE_ENTRY, SidebarExpandableEntryIface))

typedef struct _SidebarExpandableEntry SidebarExpandableEntry;
typedef struct _SidebarExpandableEntryIface SidebarExpandableEntryIface;

#define SIDEBAR_TYPE_RENAMEABLE_ENTRY (sidebar_renameable_entry_get_type ())
#define SIDEBAR_RENAMEABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_RENAMEABLE_ENTRY, SidebarRenameableEntry))
#define SIDEBAR_IS_RENAMEABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_RENAMEABLE_ENTRY))
#define SIDEBAR_RENAMEABLE_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_RENAMEABLE_ENTRY, SidebarRenameableEntryIface))

typedef struct _SidebarRenameableEntry SidebarRenameableEntry;
typedef struct _SidebarRenameableEntryIface SidebarRenameableEntryIface;

#define SIDEBAR_TYPE_GROUPING (sidebar_grouping_get_type ())
#define SIDEBAR_GROUPING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_GROUPING, SidebarGrouping))
#define SIDEBAR_GROUPING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SIDEBAR_TYPE_GROUPING, SidebarGroupingClass))
#define SIDEBAR_IS_GROUPING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_GROUPING))
#define SIDEBAR_IS_GROUPING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIDEBAR_TYPE_GROUPING))
#define SIDEBAR_GROUPING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIDEBAR_TYPE_GROUPING, SidebarGroupingClass))

typedef struct _SidebarGrouping SidebarGrouping;
typedef struct _SidebarGroupingClass SidebarGroupingClass;
typedef struct _SidebarGroupingPrivate SidebarGroupingPrivate;
enum  {
	SIDEBAR_GROUPING_0_PROPERTY,
	SIDEBAR_GROUPING_NUM_PROPERTIES
};
static GParamSpec* sidebar_grouping_properties[SIDEBAR_GROUPING_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define SIDEBAR_TYPE_SELECTABLE_ENTRY (sidebar_selectable_entry_get_type ())
#define SIDEBAR_SELECTABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_SELECTABLE_ENTRY, SidebarSelectableEntry))
#define SIDEBAR_IS_SELECTABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_SELECTABLE_ENTRY))
#define SIDEBAR_SELECTABLE_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_SELECTABLE_ENTRY, SidebarSelectableEntryIface))

typedef struct _SidebarSelectableEntry SidebarSelectableEntry;
typedef struct _SidebarSelectableEntryIface SidebarSelectableEntryIface;

#define SIDEBAR_TYPE_PAGE_REPRESENTATIVE (sidebar_page_representative_get_type ())
#define SIDEBAR_PAGE_REPRESENTATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative))
#define SIDEBAR_IS_PAGE_REPRESENTATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_PAGE_REPRESENTATIVE))
#define SIDEBAR_PAGE_REPRESENTATIVE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentativeIface))

typedef struct _SidebarPageRepresentative SidebarPageRepresentative;
typedef struct _SidebarPageRepresentativeIface SidebarPageRepresentativeIface;

#define TYPE_PAGE (page_get_type ())
#define PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE, Page))
#define PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE, PageClass))
#define IS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE))
#define IS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE))
#define PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE, PageClass))

typedef struct _Page Page;
typedef struct _PageClass PageClass;

#define SIDEBAR_TYPE_CONTEXTABLE (sidebar_contextable_get_type ())
#define SIDEBAR_CONTEXTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_CONTEXTABLE, SidebarContextable))
#define SIDEBAR_IS_CONTEXTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_CONTEXTABLE))
#define SIDEBAR_CONTEXTABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_CONTEXTABLE, SidebarContextableIface))

typedef struct _SidebarContextable SidebarContextable;
typedef struct _SidebarContextableIface SidebarContextableIface;

#define SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY (sidebar_simple_page_entry_get_type ())
#define SIDEBAR_SIMPLE_PAGE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, SidebarSimplePageEntry))
#define SIDEBAR_SIMPLE_PAGE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, SidebarSimplePageEntryClass))
#define SIDEBAR_IS_SIMPLE_PAGE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY))
#define SIDEBAR_IS_SIMPLE_PAGE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY))
#define SIDEBAR_SIMPLE_PAGE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, SidebarSimplePageEntryClass))

typedef struct _SidebarSimplePageEntry SidebarSimplePageEntry;
typedef struct _SidebarSimplePageEntryClass SidebarSimplePageEntryClass;
typedef struct _SidebarSimplePageEntryPrivate SidebarSimplePageEntryPrivate;
enum  {
	SIDEBAR_SIMPLE_PAGE_ENTRY_0_PROPERTY,
	SIDEBAR_SIMPLE_PAGE_ENTRY_NUM_PROPERTIES
};
static GParamSpec* sidebar_simple_page_entry_properties[SIDEBAR_SIMPLE_PAGE_ENTRY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define SIDEBAR_TYPE_BRANCH (sidebar_branch_get_type ())
#define SIDEBAR_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_BRANCH, SidebarBranch))
#define SIDEBAR_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SIDEBAR_TYPE_BRANCH, SidebarBranchClass))
#define SIDEBAR_IS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_BRANCH))
#define SIDEBAR_IS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIDEBAR_TYPE_BRANCH))
#define SIDEBAR_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIDEBAR_TYPE_BRANCH, SidebarBranchClass))

typedef struct _SidebarBranch SidebarBranch;
typedef struct _SidebarBranchClass SidebarBranchClass;
typedef struct _SidebarBranchPrivate SidebarBranchPrivate;

#define SIDEBAR_TYPE_ROOT_ONLY_BRANCH (sidebar_root_only_branch_get_type ())
#define SIDEBAR_ROOT_ONLY_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_ROOT_ONLY_BRANCH, SidebarRootOnlyBranch))
#define SIDEBAR_ROOT_ONLY_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SIDEBAR_TYPE_ROOT_ONLY_BRANCH, SidebarRootOnlyBranchClass))
#define SIDEBAR_IS_ROOT_ONLY_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_ROOT_ONLY_BRANCH))
#define SIDEBAR_IS_ROOT_ONLY_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIDEBAR_TYPE_ROOT_ONLY_BRANCH))
#define SIDEBAR_ROOT_ONLY_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIDEBAR_TYPE_ROOT_ONLY_BRANCH, SidebarRootOnlyBranchClass))

typedef struct _SidebarRootOnlyBranch SidebarRootOnlyBranch;
typedef struct _SidebarRootOnlyBranchClass SidebarRootOnlyBranchClass;
typedef struct _SidebarRootOnlyBranchPrivate SidebarRootOnlyBranchPrivate;
enum  {
	SIDEBAR_ROOT_ONLY_BRANCH_0_PROPERTY,
	SIDEBAR_ROOT_ONLY_BRANCH_NUM_PROPERTIES
};
static GParamSpec* sidebar_root_only_branch_properties[SIDEBAR_ROOT_ONLY_BRANCH_NUM_PROPERTIES];
typedef enum  {
	SIDEBAR_BRANCH_OPTIONS_NONE = 0,
	SIDEBAR_BRANCH_OPTIONS_HIDE_IF_EMPTY = 1 << 0,
	SIDEBAR_BRANCH_OPTIONS_AUTO_OPEN_ON_NEW_CHILD = 1 << 1,
	SIDEBAR_BRANCH_OPTIONS_STARTUP_EXPAND_TO_FIRST_CHILD = 1 << 2,
	SIDEBAR_BRANCH_OPTIONS_STARTUP_OPEN_GROUPING = 1 << 3
} SidebarBranchOptions;

#define SIDEBAR_BRANCH_TYPE_OPTIONS (sidebar_branch_options_get_type ())

#define SIDEBAR_TYPE_EMPHASIZABLE_ENTRY (sidebar_emphasizable_entry_get_type ())
#define SIDEBAR_EMPHASIZABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_EMPHASIZABLE_ENTRY, SidebarEmphasizableEntry))
#define SIDEBAR_IS_EMPHASIZABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_EMPHASIZABLE_ENTRY))
#define SIDEBAR_EMPHASIZABLE_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_EMPHASIZABLE_ENTRY, SidebarEmphasizableEntryIface))

typedef struct _SidebarEmphasizableEntry SidebarEmphasizableEntry;
typedef struct _SidebarEmphasizableEntryIface SidebarEmphasizableEntryIface;

#define SIDEBAR_TYPE_HEADER (sidebar_header_get_type ())
#define SIDEBAR_HEADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_HEADER, SidebarHeader))
#define SIDEBAR_HEADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SIDEBAR_TYPE_HEADER, SidebarHeaderClass))
#define SIDEBAR_IS_HEADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_HEADER))
#define SIDEBAR_IS_HEADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SIDEBAR_TYPE_HEADER))
#define SIDEBAR_HEADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SIDEBAR_TYPE_HEADER, SidebarHeaderClass))

typedef struct _SidebarHeader SidebarHeader;
typedef struct _SidebarHeaderClass SidebarHeaderClass;
typedef struct _SidebarHeaderPrivate SidebarHeaderPrivate;
enum  {
	SIDEBAR_HEADER_0_PROPERTY,
	SIDEBAR_HEADER_NUM_PROPERTIES
};
static GParamSpec* sidebar_header_properties[SIDEBAR_HEADER_NUM_PROPERTIES];

struct _SidebarEntryIface {
	GTypeInterface parent_iface;
	gchar* (*get_sidebar_name) (SidebarEntry* self);
	gchar* (*get_sidebar_tooltip) (SidebarEntry* self);
	gchar* (*get_sidebar_icon) (SidebarEntry* self);
	gchar* (*to_string) (SidebarEntry* self);
	void (*grafted) (SidebarEntry* self, SidebarTree* tree);
	void (*pruned) (SidebarEntry* self, SidebarTree* tree);
};

struct _SidebarExpandableEntryIface {
	GTypeInterface parent_iface;
	gboolean (*expand_on_select) (SidebarExpandableEntry* self);
};

struct _SidebarRenameableEntryIface {
	GTypeInterface parent_iface;
	void (*rename) (SidebarRenameableEntry* self, const gchar* new_name);
	gboolean (*is_user_renameable) (SidebarRenameableEntry* self);
};

struct _SidebarGrouping {
	GObject parent_instance;
	SidebarGroupingPrivate * priv;
};

struct _SidebarGroupingClass {
	GObjectClass parent_class;
};

struct _SidebarGroupingPrivate {
	gchar* name;
	gchar* tooltip;
	gchar* icon;
};

struct _SidebarSelectableEntryIface {
	GTypeInterface parent_iface;
};

struct _SidebarPageRepresentativeIface {
	GTypeInterface parent_iface;
	gboolean (*has_page) (SidebarPageRepresentative* self);
	Page* (*get_page) (SidebarPageRepresentative* self);
};

struct _SidebarContextableIface {
	GTypeInterface parent_iface;
	GtkMenu* (*get_sidebar_context_menu) (SidebarContextable* self, GdkEventButton* event);
};

struct _SidebarSimplePageEntry {
	GObject parent_instance;
	SidebarSimplePageEntryPrivate * priv;
};

struct _SidebarSimplePageEntryClass {
	GObjectClass parent_class;
	gchar* (*get_sidebar_name) (SidebarSimplePageEntry* self);
	gchar* (*get_sidebar_tooltip) (SidebarSimplePageEntry* self);
	gchar* (*get_sidebar_icon) (SidebarSimplePageEntry* self);
	gchar* (*to_string) (SidebarSimplePageEntry* self);
	Page* (*create_page) (SidebarSimplePageEntry* self);
};

struct _SidebarSimplePageEntryPrivate {
	Page* page;
};

struct _SidebarBranch {
	GObject parent_instance;
	SidebarBranchPrivate * priv;
};

struct _SidebarBranchClass {
	GObjectClass parent_class;
};

struct _SidebarRootOnlyBranch {
	SidebarBranch parent_instance;
	SidebarRootOnlyBranchPrivate * priv;
};

struct _SidebarRootOnlyBranchClass {
	SidebarBranchClass parent_class;
};

struct _SidebarEmphasizableEntryIface {
	GTypeInterface parent_iface;
	gboolean (*is_emphasized) (SidebarEmphasizableEntry* self);
};

struct _SidebarHeader {
	SidebarGrouping parent_instance;
	SidebarHeaderPrivate * priv;
};

struct _SidebarHeaderClass {
	SidebarGroupingClass parent_class;
};

struct _SidebarHeaderPrivate {
	gboolean emphasized;
};

static gint SidebarGrouping_private_offset;
static gpointer sidebar_grouping_parent_class = NULL;
static SidebarEntryIface * sidebar_grouping_sidebar_entry_parent_iface = NULL;
static SidebarExpandableEntryIface * sidebar_grouping_sidebar_expandable_entry_parent_iface = NULL;
static SidebarRenameableEntryIface * sidebar_grouping_sidebar_renameable_entry_parent_iface = NULL;
static gint SidebarSimplePageEntry_private_offset;
static gpointer sidebar_simple_page_entry_parent_class = NULL;
static SidebarEntryIface * sidebar_simple_page_entry_sidebar_entry_parent_iface = NULL;
static SidebarSelectableEntryIface * sidebar_simple_page_entry_sidebar_selectable_entry_parent_iface = NULL;
static SidebarPageRepresentativeIface * sidebar_simple_page_entry_sidebar_page_representative_parent_iface = NULL;
static SidebarContextableIface * sidebar_simple_page_entry_sidebar_contextable_parent_iface = NULL;
static gpointer sidebar_root_only_branch_parent_class = NULL;
static gint SidebarHeader_private_offset;
static gpointer sidebar_header_parent_class = NULL;
static SidebarEmphasizableEntryIface * sidebar_header_sidebar_emphasizable_entry_parent_iface = NULL;

VALA_EXTERN GType sidebar_tree_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarTree, g_object_unref)
VALA_EXTERN GType sidebar_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarEntry, g_object_unref)
VALA_EXTERN GType sidebar_expandable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sidebar_renameable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sidebar_grouping_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarGrouping, g_object_unref)
VALA_EXTERN SidebarGrouping* sidebar_grouping_new (const gchar* name,
                                       const gchar* icon,
                                       const gchar* tooltip);
VALA_EXTERN SidebarGrouping* sidebar_grouping_construct (GType object_type,
                                             const gchar* name,
                                             const gchar* icon,
                                             const gchar* tooltip);
static void sidebar_grouping_real_rename (SidebarRenameableEntry* base,
                                   const gchar* name);
static gboolean sidebar_grouping_real_is_user_renameable (SidebarRenameableEntry* base);
static gchar* sidebar_grouping_real_get_sidebar_name (SidebarEntry* base);
static gchar* sidebar_grouping_real_get_sidebar_tooltip (SidebarEntry* base);
static gchar* sidebar_grouping_real_get_sidebar_icon (SidebarEntry* base);
static gchar* sidebar_grouping_real_to_string (SidebarEntry* base);
static gboolean sidebar_grouping_real_expand_on_select (SidebarExpandableEntry* base);
VALA_EXTERN gchar* sidebar_entry_get_sidebar_name (SidebarEntry* self);
VALA_EXTERN gchar* sidebar_entry_get_sidebar_tooltip (SidebarEntry* self);
VALA_EXTERN gchar* sidebar_entry_get_sidebar_icon (SidebarEntry* self);
VALA_EXTERN gchar* sidebar_entry_to_string (SidebarEntry* self);
VALA_EXTERN gboolean sidebar_expandable_entry_expand_on_select (SidebarExpandableEntry* self);
VALA_EXTERN void sidebar_renameable_entry_rename (SidebarRenameableEntry* self,
                                      const gchar* new_name);
VALA_EXTERN gboolean sidebar_renameable_entry_is_user_renameable (SidebarRenameableEntry* self);
static void sidebar_grouping_finalize (GObject * obj);
static GType sidebar_grouping_get_type_once (void);
VALA_EXTERN GType sidebar_selectable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Page, g_object_unref)
VALA_EXTERN GType sidebar_page_representative_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sidebar_contextable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarContextable, g_object_unref)
VALA_EXTERN GType sidebar_simple_page_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarSimplePageEntry, g_object_unref)
VALA_EXTERN gchar* sidebar_simple_page_entry_get_sidebar_name (SidebarSimplePageEntry* self);
VALA_EXTERN gchar* sidebar_simple_page_entry_get_sidebar_tooltip (SidebarSimplePageEntry* self);
VALA_EXTERN gchar* sidebar_simple_page_entry_get_sidebar_icon (SidebarSimplePageEntry* self);
VALA_EXTERN gchar* sidebar_simple_page_entry_to_string (SidebarSimplePageEntry* self);
VALA_EXTERN Page* sidebar_simple_page_entry_create_page (SidebarSimplePageEntry* self);
static gchar* sidebar_simple_page_entry_real_get_sidebar_name (SidebarSimplePageEntry* self);
static gchar* sidebar_simple_page_entry_real_get_sidebar_tooltip (SidebarSimplePageEntry* self);
static gchar* sidebar_simple_page_entry_real_get_sidebar_icon (SidebarSimplePageEntry* self);
static gchar* sidebar_simple_page_entry_real_to_string (SidebarSimplePageEntry* self);
static Page* sidebar_simple_page_entry_real_create_page (SidebarSimplePageEntry* self);
static gboolean sidebar_simple_page_entry_real_has_page (SidebarPageRepresentative* base);
static Page* sidebar_simple_page_entry_real_get_page (SidebarPageRepresentative* base);
static void sidebar_simple_page_entry_real_pruned (SidebarEntry* base,
                                            SidebarTree* tree);
static GtkMenu* sidebar_simple_page_entry_real_get_sidebar_context_menu (SidebarContextable* base,
                                                                  GdkEventButton* event);
VALA_EXTERN Page* sidebar_page_representative_get_page (SidebarPageRepresentative* self);
VALA_EXTERN GtkMenu* page_get_page_context_menu (Page* self);
VALA_EXTERN SidebarSimplePageEntry* sidebar_simple_page_entry_construct (GType object_type);
VALA_EXTERN void sidebar_entry_pruned (SidebarEntry* self,
                           SidebarTree* tree);
VALA_EXTERN gboolean sidebar_page_representative_has_page (SidebarPageRepresentative* self);
VALA_EXTERN GtkMenu* sidebar_contextable_get_sidebar_context_menu (SidebarContextable* self,
                                                       GdkEventButton* event);
static void sidebar_simple_page_entry_finalize (GObject * obj);
static GType sidebar_simple_page_entry_get_type_once (void);
VALA_EXTERN GType sidebar_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarBranch, g_object_unref)
VALA_EXTERN GType sidebar_root_only_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarRootOnlyBranch, g_object_unref)
VALA_EXTERN SidebarRootOnlyBranch* sidebar_root_only_branch_new (SidebarEntry* root);
VALA_EXTERN SidebarRootOnlyBranch* sidebar_root_only_branch_construct (GType object_type,
                                                           SidebarEntry* root);
VALA_EXTERN GType sidebar_branch_options_get_type (void) G_GNUC_CONST ;
static gint sidebar_root_only_branch_null_comparator (SidebarEntry* a,
                                               SidebarEntry* b);
static gint _sidebar_root_only_branch_null_comparator_gcompare_func (gconstpointer a,
                                                              gconstpointer b);
VALA_EXTERN SidebarBranch* sidebar_branch_new (SidebarEntry* root,
                                   SidebarBranchOptions options,
                                   GCompareFunc default_comparator,
                                   GCompareFunc root_comparator);
VALA_EXTERN SidebarBranch* sidebar_branch_construct (GType object_type,
                                         SidebarEntry* root,
                                         SidebarBranchOptions options,
                                         GCompareFunc default_comparator,
                                         GCompareFunc root_comparator);
static GType sidebar_root_only_branch_get_type_once (void);
VALA_EXTERN GType sidebar_emphasizable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sidebar_header_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarHeader, g_object_unref)
VALA_EXTERN SidebarHeader* sidebar_header_new (const gchar* name,
                                   const gchar* tooltip,
                                   gboolean emphasized);
VALA_EXTERN SidebarHeader* sidebar_header_construct (GType object_type,
                                         const gchar* name,
                                         const gchar* tooltip,
                                         gboolean emphasized);
static gboolean sidebar_header_real_is_emphasized (SidebarEmphasizableEntry* base);
VALA_EXTERN gboolean sidebar_emphasizable_entry_is_emphasized (SidebarEmphasizableEntry* self);
static void sidebar_header_finalize (GObject * obj);
static GType sidebar_header_get_type_once (void);
static GType sidebar_contextable_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
sidebar_grouping_get_instance_private (SidebarGrouping* self)
{
	return G_STRUCT_MEMBER_P (self, SidebarGrouping_private_offset);
}

SidebarGrouping*
sidebar_grouping_construct (GType object_type,
                            const gchar* name,
                            const gchar* icon,
                            const gchar* tooltip)
{
	SidebarGrouping * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_val_if_fail (name != NULL, NULL);
	self = (SidebarGrouping*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (name);
	_g_free0 (self->priv->name);
	self->priv->name = _tmp0_;
	_tmp1_ = g_strdup (icon);
	_g_free0 (self->priv->icon);
	self->priv->icon = _tmp1_;
	_tmp2_ = g_strdup (tooltip);
	_g_free0 (self->priv->tooltip);
	self->priv->tooltip = _tmp2_;
	return self;
}

SidebarGrouping*
sidebar_grouping_new (const gchar* name,
                      const gchar* icon,
                      const gchar* tooltip)
{
	return sidebar_grouping_construct (SIDEBAR_TYPE_GROUPING, name, icon, tooltip);
}

static void
sidebar_grouping_real_rename (SidebarRenameableEntry* base,
                              const gchar* name)
{
	SidebarGrouping * self;
	gchar* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_GROUPING, SidebarGrouping);
	g_return_if_fail (name != NULL);
	_tmp0_ = g_strdup (name);
	_g_free0 (self->priv->name);
	self->priv->name = _tmp0_;
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SIDEBAR_TYPE_RENAMEABLE_ENTRY, SidebarRenameableEntry), "sidebar-name-changed", name);
}

static gboolean
sidebar_grouping_real_is_user_renameable (SidebarRenameableEntry* base)
{
	SidebarGrouping * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_GROUPING, SidebarGrouping);
	result = FALSE;
	return result;
}

static gchar*
sidebar_grouping_real_get_sidebar_name (SidebarEntry* base)
{
	SidebarGrouping * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_GROUPING, SidebarGrouping);
	_tmp0_ = self->priv->name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
sidebar_grouping_real_get_sidebar_tooltip (SidebarEntry* base)
{
	SidebarGrouping * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_GROUPING, SidebarGrouping);
	_tmp0_ = self->priv->tooltip;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
sidebar_grouping_real_get_sidebar_icon (SidebarEntry* base)
{
	SidebarGrouping * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_GROUPING, SidebarGrouping);
	_tmp0_ = self->priv->icon;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
sidebar_grouping_real_to_string (SidebarEntry* base)
{
	SidebarGrouping * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_GROUPING, SidebarGrouping);
	_tmp0_ = self->priv->name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
sidebar_grouping_real_expand_on_select (SidebarExpandableEntry* base)
{
	SidebarGrouping * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_GROUPING, SidebarGrouping);
	result = TRUE;
	return result;
}

static void
sidebar_grouping_class_init (SidebarGroupingClass * klass,
                             gpointer klass_data)
{
	sidebar_grouping_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SidebarGrouping_private_offset);
	G_OBJECT_CLASS (klass)->finalize = sidebar_grouping_finalize;
}

static void
sidebar_grouping_sidebar_entry_interface_init (SidebarEntryIface * iface,
                                               gpointer iface_data)
{
	sidebar_grouping_sidebar_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_sidebar_name = (gchar* (*) (SidebarEntry*)) sidebar_grouping_real_get_sidebar_name;
	iface->get_sidebar_tooltip = (gchar* (*) (SidebarEntry*)) sidebar_grouping_real_get_sidebar_tooltip;
	iface->get_sidebar_icon = (gchar* (*) (SidebarEntry*)) sidebar_grouping_real_get_sidebar_icon;
	iface->to_string = (gchar* (*) (SidebarEntry*)) sidebar_grouping_real_to_string;
}

static void
sidebar_grouping_sidebar_expandable_entry_interface_init (SidebarExpandableEntryIface * iface,
                                                          gpointer iface_data)
{
	sidebar_grouping_sidebar_expandable_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->expand_on_select = (gboolean (*) (SidebarExpandableEntry*)) sidebar_grouping_real_expand_on_select;
}

static void
sidebar_grouping_sidebar_renameable_entry_interface_init (SidebarRenameableEntryIface * iface,
                                                          gpointer iface_data)
{
	sidebar_grouping_sidebar_renameable_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->rename = (void (*) (SidebarRenameableEntry*, const gchar*)) sidebar_grouping_real_rename;
	iface->is_user_renameable = (gboolean (*) (SidebarRenameableEntry*)) sidebar_grouping_real_is_user_renameable;
}

static void
sidebar_grouping_instance_init (SidebarGrouping * self,
                                gpointer klass)
{
	self->priv = sidebar_grouping_get_instance_private (self);
}

static void
sidebar_grouping_finalize (GObject * obj)
{
	SidebarGrouping * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SIDEBAR_TYPE_GROUPING, SidebarGrouping);
	_g_free0 (self->priv->name);
	_g_free0 (self->priv->tooltip);
	_g_free0 (self->priv->icon);
	G_OBJECT_CLASS (sidebar_grouping_parent_class)->finalize (obj);
}

static GType
sidebar_grouping_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SidebarGroupingClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sidebar_grouping_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SidebarGrouping), 0, (GInstanceInitFunc) sidebar_grouping_instance_init, NULL };
	static const GInterfaceInfo sidebar_entry_info = { (GInterfaceInitFunc) sidebar_grouping_sidebar_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_expandable_entry_info = { (GInterfaceInitFunc) sidebar_grouping_sidebar_expandable_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_renameable_entry_info = { (GInterfaceInitFunc) sidebar_grouping_sidebar_renameable_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType sidebar_grouping_type_id;
	sidebar_grouping_type_id = g_type_register_static (G_TYPE_OBJECT, "SidebarGrouping", &g_define_type_info, 0);
	g_type_add_interface_static (sidebar_grouping_type_id, SIDEBAR_TYPE_ENTRY, &sidebar_entry_info);
	g_type_add_interface_static (sidebar_grouping_type_id, SIDEBAR_TYPE_EXPANDABLE_ENTRY, &sidebar_expandable_entry_info);
	g_type_add_interface_static (sidebar_grouping_type_id, SIDEBAR_TYPE_RENAMEABLE_ENTRY, &sidebar_renameable_entry_info);
	SidebarGrouping_private_offset = g_type_add_instance_private (sidebar_grouping_type_id, sizeof (SidebarGroupingPrivate));
	return sidebar_grouping_type_id;
}

GType
sidebar_grouping_get_type (void)
{
	static volatile gsize sidebar_grouping_type_id__once = 0;
	if (g_once_init_enter (&sidebar_grouping_type_id__once)) {
		GType sidebar_grouping_type_id;
		sidebar_grouping_type_id = sidebar_grouping_get_type_once ();
		g_once_init_leave (&sidebar_grouping_type_id__once, sidebar_grouping_type_id);
	}
	return sidebar_grouping_type_id__once;
}

static inline gpointer
sidebar_simple_page_entry_get_instance_private (SidebarSimplePageEntry* self)
{
	return G_STRUCT_MEMBER_P (self, SidebarSimplePageEntry_private_offset);
}

static gchar*
sidebar_simple_page_entry_real_get_sidebar_name (SidebarSimplePageEntry* self)
{
	g_critical ("Type `%s' does not implement abstract method `sidebar_simple_page_entry_get_sidebar_name'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
sidebar_simple_page_entry_get_sidebar_name (SidebarSimplePageEntry* self)
{
	SidebarSimplePageEntryClass* _klass_;
	g_return_val_if_fail (SIDEBAR_IS_SIMPLE_PAGE_ENTRY (self), NULL);
	_klass_ = SIDEBAR_SIMPLE_PAGE_ENTRY_GET_CLASS (self);
	if (_klass_->get_sidebar_name) {
		return _klass_->get_sidebar_name (self);
	}
	return NULL;
}

static gchar*
sidebar_simple_page_entry_real_get_sidebar_tooltip (SidebarSimplePageEntry* self)
{
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = sidebar_simple_page_entry_get_sidebar_name (self);
	result = _tmp0_;
	return result;
}

gchar*
sidebar_simple_page_entry_get_sidebar_tooltip (SidebarSimplePageEntry* self)
{
	SidebarSimplePageEntryClass* _klass_;
	g_return_val_if_fail (SIDEBAR_IS_SIMPLE_PAGE_ENTRY (self), NULL);
	_klass_ = SIDEBAR_SIMPLE_PAGE_ENTRY_GET_CLASS (self);
	if (_klass_->get_sidebar_tooltip) {
		return _klass_->get_sidebar_tooltip (self);
	}
	return NULL;
}

static gchar*
sidebar_simple_page_entry_real_get_sidebar_icon (SidebarSimplePageEntry* self)
{
	g_critical ("Type `%s' does not implement abstract method `sidebar_simple_page_entry_get_sidebar_icon'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
sidebar_simple_page_entry_get_sidebar_icon (SidebarSimplePageEntry* self)
{
	SidebarSimplePageEntryClass* _klass_;
	g_return_val_if_fail (SIDEBAR_IS_SIMPLE_PAGE_ENTRY (self), NULL);
	_klass_ = SIDEBAR_SIMPLE_PAGE_ENTRY_GET_CLASS (self);
	if (_klass_->get_sidebar_icon) {
		return _klass_->get_sidebar_icon (self);
	}
	return NULL;
}

static gchar*
sidebar_simple_page_entry_real_to_string (SidebarSimplePageEntry* self)
{
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = sidebar_simple_page_entry_get_sidebar_name (self);
	result = _tmp0_;
	return result;
}

gchar*
sidebar_simple_page_entry_to_string (SidebarSimplePageEntry* self)
{
	SidebarSimplePageEntryClass* _klass_;
	g_return_val_if_fail (SIDEBAR_IS_SIMPLE_PAGE_ENTRY (self), NULL);
	_klass_ = SIDEBAR_SIMPLE_PAGE_ENTRY_GET_CLASS (self);
	if (_klass_->to_string) {
		return _klass_->to_string (self);
	}
	return NULL;
}

static Page*
sidebar_simple_page_entry_real_create_page (SidebarSimplePageEntry* self)
{
	g_critical ("Type `%s' does not implement abstract method `sidebar_simple_page_entry_create_page'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

Page*
sidebar_simple_page_entry_create_page (SidebarSimplePageEntry* self)
{
	SidebarSimplePageEntryClass* _klass_;
	g_return_val_if_fail (SIDEBAR_IS_SIMPLE_PAGE_ENTRY (self), NULL);
	_klass_ = SIDEBAR_SIMPLE_PAGE_ENTRY_GET_CLASS (self);
	if (_klass_->create_page) {
		return _klass_->create_page (self);
	}
	return NULL;
}

static gboolean
sidebar_simple_page_entry_real_has_page (SidebarPageRepresentative* base)
{
	SidebarSimplePageEntry * self;
	Page* _tmp0_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, SidebarSimplePageEntry);
	_tmp0_ = self->priv->page;
	result = _tmp0_ != NULL;
	return result;
}

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

static Page*
sidebar_simple_page_entry_real_get_page (SidebarPageRepresentative* base)
{
	SidebarSimplePageEntry * self;
	Page* _tmp0_;
	Page* _tmp3_;
	Page* _tmp4_;
	Page* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, SidebarSimplePageEntry);
	_tmp0_ = self->priv->page;
	if (_tmp0_ == NULL) {
		Page* _tmp1_;
		Page* _tmp2_;
		_tmp1_ = sidebar_simple_page_entry_create_page (self);
		_g_object_unref0 (self->priv->page);
		self->priv->page = _tmp1_;
		_tmp2_ = self->priv->page;
		g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative), "page-created", _tmp2_);
	}
	_tmp3_ = self->priv->page;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	result = _tmp4_;
	return result;
}

static void
sidebar_simple_page_entry_real_pruned (SidebarEntry* base,
                                       SidebarTree* tree)
{
	SidebarSimplePageEntry * self;
	Page* _tmp0_;
	Page* _tmp1_;
	Page* _tmp2_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, SidebarSimplePageEntry);
	g_return_if_fail (SIDEBAR_IS_TREE (tree));
	_tmp0_ = self->priv->page;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->page;
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative), "destroying-page", _tmp1_);
	_tmp2_ = self->priv->page;
	gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (self->priv->page);
	self->priv->page = NULL;
}

static GtkMenu*
sidebar_simple_page_entry_real_get_sidebar_context_menu (SidebarContextable* base,
                                                         GdkEventButton* event)
{
	SidebarSimplePageEntry * self;
	Page* _tmp0_;
	Page* _tmp1_;
	GtkMenu* _tmp2_;
	GtkMenu* _tmp3_;
	GtkMenu* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, SidebarSimplePageEntry);
	_tmp0_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (self, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
	_tmp1_ = _tmp0_;
	_tmp2_ = page_get_page_context_menu (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	result = _tmp3_;
	return result;
}

SidebarSimplePageEntry*
sidebar_simple_page_entry_construct (GType object_type)
{
	SidebarSimplePageEntry * self = NULL;
	self = (SidebarSimplePageEntry*) g_object_new (object_type, NULL);
	return self;
}

static void
sidebar_simple_page_entry_class_init (SidebarSimplePageEntryClass * klass,
                                      gpointer klass_data)
{
	sidebar_simple_page_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SidebarSimplePageEntry_private_offset);
	((SidebarSimplePageEntryClass *) klass)->get_sidebar_name = (gchar* (*) (SidebarSimplePageEntry*)) sidebar_simple_page_entry_real_get_sidebar_name;
	((SidebarSimplePageEntryClass *) klass)->get_sidebar_tooltip = (gchar* (*) (SidebarSimplePageEntry*)) sidebar_simple_page_entry_real_get_sidebar_tooltip;
	((SidebarSimplePageEntryClass *) klass)->get_sidebar_icon = (gchar* (*) (SidebarSimplePageEntry*)) sidebar_simple_page_entry_real_get_sidebar_icon;
	((SidebarSimplePageEntryClass *) klass)->to_string = (gchar* (*) (SidebarSimplePageEntry*)) sidebar_simple_page_entry_real_to_string;
	((SidebarSimplePageEntryClass *) klass)->create_page = (Page* (*) (SidebarSimplePageEntry*)) sidebar_simple_page_entry_real_create_page;
	G_OBJECT_CLASS (klass)->finalize = sidebar_simple_page_entry_finalize;
}

static void
sidebar_simple_page_entry_sidebar_entry_interface_init (SidebarEntryIface * iface,
                                                        gpointer iface_data)
{
	sidebar_simple_page_entry_sidebar_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_sidebar_name = (gchar* (*) (SidebarEntry*)) sidebar_simple_page_entry_get_sidebar_name;
	iface->get_sidebar_tooltip = (gchar* (*) (SidebarEntry*)) sidebar_simple_page_entry_get_sidebar_tooltip;
	iface->get_sidebar_icon = (gchar* (*) (SidebarEntry*)) sidebar_simple_page_entry_get_sidebar_icon;
	iface->to_string = (gchar* (*) (SidebarEntry*)) sidebar_simple_page_entry_to_string;
	iface->pruned = (void (*) (SidebarEntry*, SidebarTree*)) sidebar_simple_page_entry_real_pruned;
}

static void
sidebar_simple_page_entry_sidebar_selectable_entry_interface_init (SidebarSelectableEntryIface * iface,
                                                                   gpointer iface_data)
{
	sidebar_simple_page_entry_sidebar_selectable_entry_parent_iface = g_type_interface_peek_parent (iface);
}

static void
sidebar_simple_page_entry_sidebar_page_representative_interface_init (SidebarPageRepresentativeIface * iface,
                                                                      gpointer iface_data)
{
	sidebar_simple_page_entry_sidebar_page_representative_parent_iface = g_type_interface_peek_parent (iface);
	iface->has_page = (gboolean (*) (SidebarPageRepresentative*)) sidebar_simple_page_entry_real_has_page;
	iface->get_page = (Page* (*) (SidebarPageRepresentative*)) sidebar_simple_page_entry_real_get_page;
}

static void
sidebar_simple_page_entry_sidebar_contextable_interface_init (SidebarContextableIface * iface,
                                                              gpointer iface_data)
{
	sidebar_simple_page_entry_sidebar_contextable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_sidebar_context_menu = (GtkMenu* (*) (SidebarContextable*, GdkEventButton*)) sidebar_simple_page_entry_real_get_sidebar_context_menu;
}

static void
sidebar_simple_page_entry_instance_init (SidebarSimplePageEntry * self,
                                         gpointer klass)
{
	self->priv = sidebar_simple_page_entry_get_instance_private (self);
	self->priv->page = NULL;
}

static void
sidebar_simple_page_entry_finalize (GObject * obj)
{
	SidebarSimplePageEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, SidebarSimplePageEntry);
	_g_object_unref0 (self->priv->page);
	G_OBJECT_CLASS (sidebar_simple_page_entry_parent_class)->finalize (obj);
}

static GType
sidebar_simple_page_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SidebarSimplePageEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sidebar_simple_page_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SidebarSimplePageEntry), 0, (GInstanceInitFunc) sidebar_simple_page_entry_instance_init, NULL };
	static const GInterfaceInfo sidebar_entry_info = { (GInterfaceInitFunc) sidebar_simple_page_entry_sidebar_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_selectable_entry_info = { (GInterfaceInitFunc) sidebar_simple_page_entry_sidebar_selectable_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_page_representative_info = { (GInterfaceInitFunc) sidebar_simple_page_entry_sidebar_page_representative_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_contextable_info = { (GInterfaceInitFunc) sidebar_simple_page_entry_sidebar_contextable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType sidebar_simple_page_entry_type_id;
	sidebar_simple_page_entry_type_id = g_type_register_static (G_TYPE_OBJECT, "SidebarSimplePageEntry", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	g_type_add_interface_static (sidebar_simple_page_entry_type_id, SIDEBAR_TYPE_ENTRY, &sidebar_entry_info);
	g_type_add_interface_static (sidebar_simple_page_entry_type_id, SIDEBAR_TYPE_SELECTABLE_ENTRY, &sidebar_selectable_entry_info);
	g_type_add_interface_static (sidebar_simple_page_entry_type_id, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, &sidebar_page_representative_info);
	g_type_add_interface_static (sidebar_simple_page_entry_type_id, SIDEBAR_TYPE_CONTEXTABLE, &sidebar_contextable_info);
	SidebarSimplePageEntry_private_offset = g_type_add_instance_private (sidebar_simple_page_entry_type_id, sizeof (SidebarSimplePageEntryPrivate));
	return sidebar_simple_page_entry_type_id;
}

GType
sidebar_simple_page_entry_get_type (void)
{
	static volatile gsize sidebar_simple_page_entry_type_id__once = 0;
	if (g_once_init_enter (&sidebar_simple_page_entry_type_id__once)) {
		GType sidebar_simple_page_entry_type_id;
		sidebar_simple_page_entry_type_id = sidebar_simple_page_entry_get_type_once ();
		g_once_init_leave (&sidebar_simple_page_entry_type_id__once, sidebar_simple_page_entry_type_id);
	}
	return sidebar_simple_page_entry_type_id__once;
}

static gint
_sidebar_root_only_branch_null_comparator_gcompare_func (gconstpointer a,
                                                         gconstpointer b)
{
	gint result;
	result = sidebar_root_only_branch_null_comparator ((SidebarEntry*) a, (SidebarEntry*) b);
	return result;
}

SidebarRootOnlyBranch*
sidebar_root_only_branch_construct (GType object_type,
                                    SidebarEntry* root)
{
	SidebarRootOnlyBranch * self = NULL;
	g_return_val_if_fail (SIDEBAR_IS_ENTRY (root), NULL);
	self = (SidebarRootOnlyBranch*) sidebar_branch_construct (object_type, root, SIDEBAR_BRANCH_OPTIONS_NONE, _sidebar_root_only_branch_null_comparator_gcompare_func, NULL);
	return self;
}

SidebarRootOnlyBranch*
sidebar_root_only_branch_new (SidebarEntry* root)
{
	return sidebar_root_only_branch_construct (SIDEBAR_TYPE_ROOT_ONLY_BRANCH, root);
}

static gint
sidebar_root_only_branch_null_comparator (SidebarEntry* a,
                                          SidebarEntry* b)
{
	gint _tmp0_ = 0;
	gint result;
	g_return_val_if_fail (SIDEBAR_IS_ENTRY (a), -1);
	g_return_val_if_fail (SIDEBAR_IS_ENTRY (b), -1);
	if (a != b) {
		_tmp0_ = -1;
	} else {
		_tmp0_ = 0;
	}
	result = _tmp0_;
	return result;
}

static void
sidebar_root_only_branch_class_init (SidebarRootOnlyBranchClass * klass,
                                     gpointer klass_data)
{
	sidebar_root_only_branch_parent_class = g_type_class_peek_parent (klass);
}

static void
sidebar_root_only_branch_instance_init (SidebarRootOnlyBranch * self,
                                        gpointer klass)
{
}

static GType
sidebar_root_only_branch_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SidebarRootOnlyBranchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sidebar_root_only_branch_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SidebarRootOnlyBranch), 0, (GInstanceInitFunc) sidebar_root_only_branch_instance_init, NULL };
	GType sidebar_root_only_branch_type_id;
	sidebar_root_only_branch_type_id = g_type_register_static (SIDEBAR_TYPE_BRANCH, "SidebarRootOnlyBranch", &g_define_type_info, 0);
	return sidebar_root_only_branch_type_id;
}

GType
sidebar_root_only_branch_get_type (void)
{
	static volatile gsize sidebar_root_only_branch_type_id__once = 0;
	if (g_once_init_enter (&sidebar_root_only_branch_type_id__once)) {
		GType sidebar_root_only_branch_type_id;
		sidebar_root_only_branch_type_id = sidebar_root_only_branch_get_type_once ();
		g_once_init_leave (&sidebar_root_only_branch_type_id__once, sidebar_root_only_branch_type_id);
	}
	return sidebar_root_only_branch_type_id__once;
}

static inline gpointer
sidebar_header_get_instance_private (SidebarHeader* self)
{
	return G_STRUCT_MEMBER_P (self, SidebarHeader_private_offset);
}

SidebarHeader*
sidebar_header_construct (GType object_type,
                          const gchar* name,
                          const gchar* tooltip,
                          gboolean emphasized)
{
	SidebarHeader * self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	self = (SidebarHeader*) sidebar_grouping_construct (object_type, name, NULL, tooltip);
	self->priv->emphasized = emphasized;
	return self;
}

SidebarHeader*
sidebar_header_new (const gchar* name,
                    const gchar* tooltip,
                    gboolean emphasized)
{
	return sidebar_header_construct (SIDEBAR_TYPE_HEADER, name, tooltip, emphasized);
}

static gboolean
sidebar_header_real_is_emphasized (SidebarEmphasizableEntry* base)
{
	SidebarHeader * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, SIDEBAR_TYPE_HEADER, SidebarHeader);
	result = self->priv->emphasized;
	return result;
}

static void
sidebar_header_class_init (SidebarHeaderClass * klass,
                           gpointer klass_data)
{
	sidebar_header_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SidebarHeader_private_offset);
	G_OBJECT_CLASS (klass)->finalize = sidebar_header_finalize;
}

static void
sidebar_header_sidebar_emphasizable_entry_interface_init (SidebarEmphasizableEntryIface * iface,
                                                          gpointer iface_data)
{
	sidebar_header_sidebar_emphasizable_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->is_emphasized = (gboolean (*) (SidebarEmphasizableEntry*)) sidebar_header_real_is_emphasized;
}

static void
sidebar_header_instance_init (SidebarHeader * self,
                              gpointer klass)
{
	self->priv = sidebar_header_get_instance_private (self);
}

static void
sidebar_header_finalize (GObject * obj)
{
	SidebarHeader * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SIDEBAR_TYPE_HEADER, SidebarHeader);
	G_OBJECT_CLASS (sidebar_header_parent_class)->finalize (obj);
}

/**
 * A header is an entry that is visually distinguished from its children. Bug 6397 recommends
 * headers to appear bolded and without any icons. To prevent the icons from rendering, we set the
 * icons to null in the base class @see Sidebar.Grouping. But we also go a step further by
 * using a custom cell_data_function (@see Sidebar.Tree::icon_renderer_function) which ensures that
 * header icons won't be rendered. This approach avoids the blank icon spacing issues.
 */
static GType
sidebar_header_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SidebarHeaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sidebar_header_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SidebarHeader), 0, (GInstanceInitFunc) sidebar_header_instance_init, NULL };
	static const GInterfaceInfo sidebar_emphasizable_entry_info = { (GInterfaceInitFunc) sidebar_header_sidebar_emphasizable_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType sidebar_header_type_id;
	sidebar_header_type_id = g_type_register_static (SIDEBAR_TYPE_GROUPING, "SidebarHeader", &g_define_type_info, 0);
	g_type_add_interface_static (sidebar_header_type_id, SIDEBAR_TYPE_EMPHASIZABLE_ENTRY, &sidebar_emphasizable_entry_info);
	SidebarHeader_private_offset = g_type_add_instance_private (sidebar_header_type_id, sizeof (SidebarHeaderPrivate));
	return sidebar_header_type_id;
}

GType
sidebar_header_get_type (void)
{
	static volatile gsize sidebar_header_type_id__once = 0;
	if (g_once_init_enter (&sidebar_header_type_id__once)) {
		GType sidebar_header_type_id;
		sidebar_header_type_id = sidebar_header_get_type_once ();
		g_once_init_leave (&sidebar_header_type_id__once, sidebar_header_type_id);
	}
	return sidebar_header_type_id__once;
}

GtkMenu*
sidebar_contextable_get_sidebar_context_menu (SidebarContextable* self,
                                              GdkEventButton* event)
{
	SidebarContextableIface* _iface_;
	g_return_val_if_fail (SIDEBAR_IS_CONTEXTABLE (self), NULL);
	_iface_ = SIDEBAR_CONTEXTABLE_GET_INTERFACE (self);
	if (_iface_->get_sidebar_context_menu) {
		return _iface_->get_sidebar_context_menu (self, event);
	}
	return NULL;
}

static void
sidebar_contextable_default_init (SidebarContextableIface * iface,
                                  gpointer iface_data)
{
}

static GType
sidebar_contextable_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SidebarContextableIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sidebar_contextable_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType sidebar_contextable_type_id;
	sidebar_contextable_type_id = g_type_register_static (G_TYPE_INTERFACE, "SidebarContextable", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (sidebar_contextable_type_id, G_TYPE_OBJECT);
	return sidebar_contextable_type_id;
}

GType
sidebar_contextable_get_type (void)
{
	static volatile gsize sidebar_contextable_type_id__once = 0;
	if (g_once_init_enter (&sidebar_contextable_type_id__once)) {
		GType sidebar_contextable_type_id;
		sidebar_contextable_type_id = sidebar_contextable_get_type_once ();
		g_once_init_leave (&sidebar_contextable_type_id__once, sidebar_contextable_type_id);
	}
	return sidebar_contextable_type_id__once;
}

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

