/* TagsBranch.c generated by valac 0.56.19, the Vala compiler
 * generated from TagsBranch.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.
 */

#include <glib-object.h>
#include <gee.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>

#define LIBRARY_WINDOW_TAG_PATH_MIME_TYPE "shotwell/tag-path"
#define RESOURCES_ICON_ONE_TAG "one-tag-symbolic"
#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_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 TAGS_TYPE_BRANCH (tags_branch_get_type ())
#define TAGS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TAGS_TYPE_BRANCH, TagsBranch))
#define TAGS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TAGS_TYPE_BRANCH, TagsBranchClass))
#define TAGS_IS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TAGS_TYPE_BRANCH))
#define TAGS_IS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TAGS_TYPE_BRANCH))
#define TAGS_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TAGS_TYPE_BRANCH, TagsBranchClass))

typedef struct _TagsBranch TagsBranch;
typedef struct _TagsBranchClass TagsBranchClass;
typedef struct _TagsBranchPrivate TagsBranchPrivate;

#define TYPE_DATA_OBJECT (data_object_get_type ())
#define DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_OBJECT, DataObject))
#define DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_OBJECT, DataObjectClass))
#define IS_DATA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_OBJECT))
#define IS_DATA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_OBJECT))
#define DATA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_OBJECT, DataObjectClass))

typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;

#define TYPE_DATA_SOURCE (data_source_get_type ())
#define DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_SOURCE, DataSource))
#define DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_SOURCE, DataSourceClass))
#define IS_DATA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_SOURCE))
#define IS_DATA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_SOURCE))
#define DATA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_SOURCE, DataSourceClass))

typedef struct _DataSource DataSource;
typedef struct _DataSourceClass DataSourceClass;

#define TYPE_TAG (tag_get_type ())
#define TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG, Tag))
#define TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG, TagClass))
#define IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG))
#define IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG))
#define TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG, TagClass))

typedef struct _Tag Tag;
typedef struct _TagClass TagClass;

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

#define TAGS_TYPE_SIDEBAR_ENTRY (tags_sidebar_entry_get_type ())
#define TAGS_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry))
#define TAGS_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntryClass))
#define TAGS_IS_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TAGS_TYPE_SIDEBAR_ENTRY))
#define TAGS_IS_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TAGS_TYPE_SIDEBAR_ENTRY))
#define TAGS_SIDEBAR_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntryClass))

typedef struct _TagsSidebarEntry TagsSidebarEntry;
typedef struct _TagsSidebarEntryClass TagsSidebarEntryClass;
enum  {
	TAGS_BRANCH_0_PROPERTY,
	TAGS_BRANCH_NUM_PROPERTIES
};
static GParamSpec* tags_branch_properties[TAGS_BRANCH_NUM_PROPERTIES];

#define TYPE_DATA_COLLECTION (data_collection_get_type ())
#define DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_COLLECTION, DataCollection))
#define DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_COLLECTION, DataCollectionClass))
#define IS_DATA_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_COLLECTION))
#define IS_DATA_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_COLLECTION))
#define DATA_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_COLLECTION, DataCollectionClass))

typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;

#define TYPE_SOURCE_COLLECTION (source_collection_get_type ())
#define SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_COLLECTION, SourceCollection))
#define SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_COLLECTION, SourceCollectionClass))
#define IS_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_COLLECTION))
#define IS_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_COLLECTION))
#define SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_COLLECTION, SourceCollectionClass))

typedef struct _SourceCollection SourceCollection;
typedef struct _SourceCollectionClass SourceCollectionClass;

#define TYPE_DATABASE_SOURCE_COLLECTION (database_source_collection_get_type ())
#define DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollection))
#define DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))
#define IS_DATABASE_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_SOURCE_COLLECTION))
#define IS_DATABASE_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_SOURCE_COLLECTION))
#define DATABASE_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_SOURCE_COLLECTION, DatabaseSourceCollectionClass))

typedef struct _DatabaseSourceCollection DatabaseSourceCollection;
typedef struct _DatabaseSourceCollectionClass DatabaseSourceCollectionClass;

#define TYPE_CONTAINER_SOURCE_COLLECTION (container_source_collection_get_type ())
#define CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollection))
#define CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))
#define IS_CONTAINER_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONTAINER_SOURCE_COLLECTION))
#define IS_CONTAINER_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONTAINER_SOURCE_COLLECTION))
#define CONTAINER_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONTAINER_SOURCE_COLLECTION, ContainerSourceCollectionClass))

typedef struct _ContainerSourceCollection ContainerSourceCollection;
typedef struct _ContainerSourceCollectionClass ContainerSourceCollectionClass;

#define TYPE_TAG_SOURCE_COLLECTION (tag_source_collection_get_type ())
#define TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollection))
#define TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))
#define IS_TAG_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_SOURCE_COLLECTION))
#define IS_TAG_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_SOURCE_COLLECTION))
#define TAG_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_SOURCE_COLLECTION, TagSourceCollectionClass))

typedef struct _TagSourceCollection TagSourceCollection;
typedef struct _TagSourceCollectionClass TagSourceCollectionClass;

#define TYPE_ALTERATION (alteration_get_type ())
#define ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALTERATION, Alteration))
#define ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALTERATION, AlterationClass))
#define IS_ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALTERATION))
#define IS_ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALTERATION))
#define ALTERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALTERATION, AlterationClass))

typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

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

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

#define TAGS_TYPE_HEADER (tags_header_get_type ())
#define TAGS_HEADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TAGS_TYPE_HEADER, TagsHeader))
#define TAGS_HEADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TAGS_TYPE_HEADER, TagsHeaderClass))
#define TAGS_IS_HEADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TAGS_TYPE_HEADER))
#define TAGS_IS_HEADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TAGS_TYPE_HEADER))
#define TAGS_HEADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TAGS_TYPE_HEADER, TagsHeaderClass))

typedef struct _TagsHeader TagsHeader;
typedef struct _TagsHeaderClass TagsHeaderClass;

#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;
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 _alteration_unref0(var) ((var == NULL) ? NULL : (var = (alteration_unref (var), NULL)))

#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 _g_free0(var) (var = (g_free (var), NULL))

#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;
typedef struct _SidebarGroupingPrivate SidebarGroupingPrivate;

#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;
typedef struct _SidebarHeaderPrivate SidebarHeaderPrivate;

#define SIDEBAR_TYPE_INTERNAL_DROP_TARGET_ENTRY (sidebar_internal_drop_target_entry_get_type ())
#define SIDEBAR_INTERNAL_DROP_TARGET_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_INTERNAL_DROP_TARGET_ENTRY, SidebarInternalDropTargetEntry))
#define SIDEBAR_IS_INTERNAL_DROP_TARGET_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_INTERNAL_DROP_TARGET_ENTRY))
#define SIDEBAR_INTERNAL_DROP_TARGET_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_INTERNAL_DROP_TARGET_ENTRY, SidebarInternalDropTargetEntryIface))

typedef struct _SidebarInternalDropTargetEntry SidebarInternalDropTargetEntry;
typedef struct _SidebarInternalDropTargetEntryIface SidebarInternalDropTargetEntryIface;

#define TYPE_THUMBNAIL_SOURCE (thumbnail_source_get_type ())
#define THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSource))
#define THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))
#define IS_THUMBNAIL_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_SOURCE))
#define IS_THUMBNAIL_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_SOURCE))
#define THUMBNAIL_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_SOURCE, ThumbnailSourceClass))

typedef struct _ThumbnailSource ThumbnailSource;
typedef struct _ThumbnailSourceClass ThumbnailSourceClass;

#define TYPE_MEDIA_SOURCE (media_source_get_type ())
#define MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE, MediaSource))
#define MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE, MediaSourceClass))
#define IS_MEDIA_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE))
#define IS_MEDIA_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE))
#define MEDIA_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE, MediaSourceClass))

typedef struct _MediaSource MediaSource;
typedef struct _MediaSourceClass MediaSourceClass;

#define SIDEBAR_TYPE_INTERNAL_DRAG_SOURCE_ENTRY (sidebar_internal_drag_source_entry_get_type ())
#define SIDEBAR_INTERNAL_DRAG_SOURCE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_INTERNAL_DRAG_SOURCE_ENTRY, SidebarInternalDragSourceEntry))
#define SIDEBAR_IS_INTERNAL_DRAG_SOURCE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_INTERNAL_DRAG_SOURCE_ENTRY))
#define SIDEBAR_INTERNAL_DRAG_SOURCE_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_INTERNAL_DRAG_SOURCE_ENTRY, SidebarInternalDragSourceEntryIface))

typedef struct _SidebarInternalDragSourceEntry SidebarInternalDragSourceEntry;
typedef struct _SidebarInternalDragSourceEntryIface SidebarInternalDragSourceEntryIface;

#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;
typedef struct _TagsHeaderPrivate TagsHeaderPrivate;
enum  {
	TAGS_HEADER_0_PROPERTY,
	TAGS_HEADER_NUM_PROPERTIES
};
static GParamSpec* tags_header_properties[TAGS_HEADER_NUM_PROPERTIES];

#define TYPE_APPLICATION (application_get_type ())
#define APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APPLICATION, Application))
#define APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APPLICATION, ApplicationClass))
#define IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APPLICATION))
#define IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APPLICATION))
#define APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APPLICATION, ApplicationClass))

typedef struct _Application Application;
typedef struct _ApplicationClass ApplicationClass;
#define _application_unref0(var) ((var == NULL) ? NULL : (var = (application_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_TEXT_ENTRY_DIALOG_MEDIATOR (text_entry_dialog_mediator_get_type ())
#define TEXT_ENTRY_DIALOG_MEDIATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR, TextEntryDialogMediator))
#define TEXT_ENTRY_DIALOG_MEDIATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR, TextEntryDialogMediatorClass))
#define IS_TEXT_ENTRY_DIALOG_MEDIATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR))
#define IS_TEXT_ENTRY_DIALOG_MEDIATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR))
#define TEXT_ENTRY_DIALOG_MEDIATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR, TextEntryDialogMediatorClass))

typedef struct _TextEntryDialogMediator TextEntryDialogMediator;
typedef struct _TextEntryDialogMediatorClass TextEntryDialogMediatorClass;

#define TYPE_TAGS_DIALOG (tags_dialog_get_type ())
#define TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAGS_DIALOG, TagsDialog))
#define TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAGS_DIALOG, TagsDialogClass))
#define IS_TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAGS_DIALOG))
#define IS_TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAGS_DIALOG))
#define TAGS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAGS_DIALOG, TagsDialogClass))

typedef struct _TagsDialog TagsDialog;
typedef struct _TagsDialogClass TagsDialogClass;

#define TYPE_ADD_TAGS_DIALOG (add_tags_dialog_get_type ())
#define ADD_TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADD_TAGS_DIALOG, AddTagsDialog))
#define ADD_TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ADD_TAGS_DIALOG, AddTagsDialogClass))
#define IS_ADD_TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADD_TAGS_DIALOG))
#define IS_ADD_TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ADD_TAGS_DIALOG))
#define ADD_TAGS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ADD_TAGS_DIALOG, AddTagsDialogClass))

typedef struct _AddTagsDialog AddTagsDialog;
typedef struct _AddTagsDialogClass AddTagsDialogClass;
#define _text_entry_dialog_mediator_unref0(var) ((var == NULL) ? NULL : (var = (text_entry_dialog_mediator_unref (var), NULL)))

#define TYPE_COMMAND_MANAGER (command_manager_get_type ())
#define COMMAND_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMMAND_MANAGER, CommandManager))
#define COMMAND_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMMAND_MANAGER, CommandManagerClass))
#define IS_COMMAND_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMMAND_MANAGER))
#define IS_COMMAND_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COMMAND_MANAGER))
#define COMMAND_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COMMAND_MANAGER, CommandManagerClass))

typedef struct _CommandManager CommandManager;
typedef struct _CommandManagerClass CommandManagerClass;

#define TYPE_COMMAND (command_get_type ())
#define COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMMAND, Command))
#define COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMMAND, CommandClass))
#define IS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMMAND))
#define IS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COMMAND))
#define COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COMMAND, CommandClass))

typedef struct _Command Command;
typedef struct _CommandClass CommandClass;

#define TYPE_PAGE_COMMAND (page_command_get_type ())
#define PAGE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_COMMAND, PageCommand))
#define PAGE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_COMMAND, PageCommandClass))
#define IS_PAGE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_COMMAND))
#define IS_PAGE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_COMMAND))
#define PAGE_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_COMMAND, PageCommandClass))

typedef struct _PageCommand PageCommand;
typedef struct _PageCommandClass PageCommandClass;

#define TYPE_ADD_TAGS_COMMAND (add_tags_command_get_type ())
#define ADD_TAGS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADD_TAGS_COMMAND, AddTagsCommand))
#define ADD_TAGS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ADD_TAGS_COMMAND, AddTagsCommandClass))
#define IS_ADD_TAGS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADD_TAGS_COMMAND))
#define IS_ADD_TAGS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ADD_TAGS_COMMAND))
#define ADD_TAGS_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ADD_TAGS_COMMAND, AddTagsCommandClass))

typedef struct _AddTagsCommand AddTagsCommand;
typedef struct _AddTagsCommandClass AddTagsCommandClass;
#define _command_manager_unref0(var) ((var == NULL) ? NULL : (var = (command_manager_unref (var), NULL)))

#define TYPE_REPARENT_TAG_COMMAND (reparent_tag_command_get_type ())
#define REPARENT_TAG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_REPARENT_TAG_COMMAND, ReparentTagCommand))
#define REPARENT_TAG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_REPARENT_TAG_COMMAND, ReparentTagCommandClass))
#define IS_REPARENT_TAG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_REPARENT_TAG_COMMAND))
#define IS_REPARENT_TAG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_REPARENT_TAG_COMMAND))
#define REPARENT_TAG_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_REPARENT_TAG_COMMAND, ReparentTagCommandClass))

typedef struct _ReparentTagCommand ReparentTagCommand;
typedef struct _ReparentTagCommandClass ReparentTagCommandClass;

#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;
typedef struct _SidebarSimplePageEntryPrivate SidebarSimplePageEntryPrivate;

#define SIDEBAR_TYPE_DESTROYABLE_ENTRY (sidebar_destroyable_entry_get_type ())
#define SIDEBAR_DESTROYABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SIDEBAR_TYPE_DESTROYABLE_ENTRY, SidebarDestroyableEntry))
#define SIDEBAR_IS_DESTROYABLE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SIDEBAR_TYPE_DESTROYABLE_ENTRY))
#define SIDEBAR_DESTROYABLE_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SIDEBAR_TYPE_DESTROYABLE_ENTRY, SidebarDestroyableEntryIface))

typedef struct _SidebarDestroyableEntry SidebarDestroyableEntry;
typedef struct _SidebarDestroyableEntryIface SidebarDestroyableEntryIface;
typedef struct _TagsSidebarEntryPrivate TagsSidebarEntryPrivate;
enum  {
	TAGS_SIDEBAR_ENTRY_0_PROPERTY,
	TAGS_SIDEBAR_ENTRY_NUM_PROPERTIES
};
static GParamSpec* tags_sidebar_entry_properties[TAGS_SIDEBAR_ENTRY_NUM_PROPERTIES];

#define TYPE_CHECKERBOARD_PAGE (checkerboard_page_get_type ())
#define CHECKERBOARD_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CHECKERBOARD_PAGE, CheckerboardPage))
#define CHECKERBOARD_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CHECKERBOARD_PAGE, CheckerboardPageClass))
#define IS_CHECKERBOARD_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CHECKERBOARD_PAGE))
#define IS_CHECKERBOARD_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CHECKERBOARD_PAGE))
#define CHECKERBOARD_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CHECKERBOARD_PAGE, CheckerboardPageClass))

typedef struct _CheckerboardPage CheckerboardPage;
typedef struct _CheckerboardPageClass CheckerboardPageClass;

#define TYPE_MEDIA_PAGE (media_page_get_type ())
#define MEDIA_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_PAGE, MediaPage))
#define MEDIA_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_PAGE, MediaPageClass))
#define IS_MEDIA_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_PAGE))
#define IS_MEDIA_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_PAGE))
#define MEDIA_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_PAGE, MediaPageClass))

typedef struct _MediaPage MediaPage;
typedef struct _MediaPageClass MediaPageClass;

#define TYPE_COLLECTION_PAGE (collection_page_get_type ())
#define COLLECTION_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COLLECTION_PAGE, CollectionPage))
#define COLLECTION_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COLLECTION_PAGE, CollectionPageClass))
#define IS_COLLECTION_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COLLECTION_PAGE))
#define IS_COLLECTION_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COLLECTION_PAGE))
#define COLLECTION_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COLLECTION_PAGE, CollectionPageClass))

typedef struct _CollectionPage CollectionPage;
typedef struct _CollectionPageClass CollectionPageClass;

#define TYPE_TAG_PAGE (tag_page_get_type ())
#define TAG_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_PAGE, TagPage))
#define TAG_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_PAGE, TagPageClass))
#define IS_TAG_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_PAGE))
#define IS_TAG_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_PAGE))
#define TAG_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_PAGE, TagPageClass))

typedef struct _TagPage TagPage;
typedef struct _TagPageClass TagPageClass;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define TYPE_SIMPLE_PROXYABLE_COMMAND (simple_proxyable_command_get_type ())
#define SIMPLE_PROXYABLE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SIMPLE_PROXYABLE_COMMAND, SimpleProxyableCommand))
#define SIMPLE_PROXYABLE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SIMPLE_PROXYABLE_COMMAND, SimpleProxyableCommandClass))
#define IS_SIMPLE_PROXYABLE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SIMPLE_PROXYABLE_COMMAND))
#define IS_SIMPLE_PROXYABLE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SIMPLE_PROXYABLE_COMMAND))
#define SIMPLE_PROXYABLE_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SIMPLE_PROXYABLE_COMMAND, SimpleProxyableCommandClass))

typedef struct _SimpleProxyableCommand SimpleProxyableCommand;
typedef struct _SimpleProxyableCommandClass SimpleProxyableCommandClass;

#define TYPE_RENAME_TAG_COMMAND (rename_tag_command_get_type ())
#define RENAME_TAG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_RENAME_TAG_COMMAND, RenameTagCommand))
#define RENAME_TAG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_RENAME_TAG_COMMAND, RenameTagCommandClass))
#define IS_RENAME_TAG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_RENAME_TAG_COMMAND))
#define IS_RENAME_TAG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_RENAME_TAG_COMMAND))
#define RENAME_TAG_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_RENAME_TAG_COMMAND, RenameTagCommandClass))

typedef struct _RenameTagCommand RenameTagCommand;
typedef struct _RenameTagCommandClass RenameTagCommandClass;

#define TYPE_DELETE_TAG_COMMAND (delete_tag_command_get_type ())
#define DELETE_TAG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DELETE_TAG_COMMAND, DeleteTagCommand))
#define DELETE_TAG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DELETE_TAG_COMMAND, DeleteTagCommandClass))
#define IS_DELETE_TAG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DELETE_TAG_COMMAND))
#define IS_DELETE_TAG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DELETE_TAG_COMMAND))
#define DELETE_TAG_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DELETE_TAG_COMMAND, DeleteTagCommandClass))

typedef struct _DeleteTagCommand DeleteTagCommand;
typedef struct _DeleteTagCommandClass DeleteTagCommandClass;

#define TYPE_TAG_UNTAG_PHOTOS_COMMAND (tag_untag_photos_command_get_type ())
#define TAG_UNTAG_PHOTOS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_UNTAG_PHOTOS_COMMAND, TagUntagPhotosCommand))
#define TAG_UNTAG_PHOTOS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_UNTAG_PHOTOS_COMMAND, TagUntagPhotosCommandClass))
#define IS_TAG_UNTAG_PHOTOS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_UNTAG_PHOTOS_COMMAND))
#define IS_TAG_UNTAG_PHOTOS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_UNTAG_PHOTOS_COMMAND))
#define TAG_UNTAG_PHOTOS_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_UNTAG_PHOTOS_COMMAND, TagUntagPhotosCommandClass))

typedef struct _TagUntagPhotosCommand TagUntagPhotosCommand;
typedef struct _TagUntagPhotosCommandClass TagUntagPhotosCommandClass;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

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

struct _SidebarBranchClass {
	GObjectClass parent_class;
};

struct _TagsBranch {
	SidebarBranch parent_instance;
	TagsBranchPrivate * priv;
};

struct _TagsBranchClass {
	SidebarBranchClass parent_class;
};

struct _TagsBranchPrivate {
	GeeHashMap* entry_map;
};

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 _SidebarRenameableEntryIface {
	GTypeInterface parent_iface;
	void (*rename) (SidebarRenameableEntry* self, const gchar* new_name);
	gboolean (*is_user_renameable) (SidebarRenameableEntry* self);
};

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

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

struct _SidebarGroupingClass {
	GObjectClass 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 _SidebarInternalDropTargetEntryIface {
	GTypeInterface parent_iface;
	gboolean (*internal_drop_received) (SidebarInternalDropTargetEntry* self, GeeList* sources);
	gboolean (*internal_drop_received_arbitrary) (SidebarInternalDropTargetEntry* self, GtkSelectionData* data);
};

struct _SidebarInternalDragSourceEntryIface {
	GTypeInterface parent_iface;
	void (*prepare_selection_data) (SidebarInternalDragSourceEntry* self, GtkSelectionData* data);
};

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

struct _TagsHeader {
	SidebarHeader parent_instance;
	TagsHeaderPrivate * priv;
};

struct _TagsHeaderClass {
	SidebarHeaderClass parent_class;
};

struct _TagsHeaderPrivate {
	GtkBuilder* builder;
	GtkMenu* context_menu;
};

struct _SidebarSelectableEntryIface {
	GTypeInterface parent_iface;
};

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

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 _SidebarDestroyableEntryIface {
	GTypeInterface parent_iface;
	void (*destroy_source) (SidebarDestroyableEntry* self);
};

struct _TagsSidebarEntry {
	SidebarSimplePageEntry parent_instance;
	TagsSidebarEntryPrivate * priv;
};

struct _TagsSidebarEntryClass {
	SidebarSimplePageEntryClass parent_class;
};

struct _TagsSidebarEntryPrivate {
	gchar* single_tag_icon;
	Tag* tag;
};

static gint TagsBranch_private_offset;
static gpointer tags_branch_parent_class = NULL;
VALA_EXTERN TagSourceCollection* tag_global;
static gint TagsHeader_private_offset;
static gpointer tags_header_parent_class = NULL;
static SidebarInternalDropTargetEntryIface * tags_header_sidebar_internal_drop_target_entry_parent_iface = NULL;
static SidebarInternalDragSourceEntryIface * tags_header_sidebar_internal_drag_source_entry_parent_iface = NULL;
static SidebarContextableIface * tags_header_sidebar_contextable_parent_iface = NULL;
static gint TagsSidebarEntry_private_offset;
static gpointer tags_sidebar_entry_parent_class = NULL;
static SidebarRenameableEntryIface * tags_sidebar_entry_sidebar_renameable_entry_parent_iface = NULL;
static SidebarDestroyableEntryIface * tags_sidebar_entry_sidebar_destroyable_entry_parent_iface = NULL;
static SidebarInternalDropTargetEntryIface * tags_sidebar_entry_sidebar_internal_drop_target_entry_parent_iface = NULL;
static SidebarExpandableEntryIface * tags_sidebar_entry_sidebar_expandable_entry_parent_iface = NULL;
static SidebarInternalDragSourceEntryIface * tags_sidebar_entry_sidebar_internal_drag_source_entry_parent_iface = NULL;

VALA_EXTERN GType sidebar_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarBranch, g_object_unref)
VALA_EXTERN GType tags_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagsBranch, g_object_unref)
VALA_EXTERN GType data_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataObject, g_object_unref)
VALA_EXTERN GType data_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataSource, g_object_unref)
VALA_EXTERN GType tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tag, 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 GType tags_sidebar_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagsSidebarEntry, g_object_unref)
VALA_EXTERN gpointer data_collection_ref (gpointer instance);
VALA_EXTERN void data_collection_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_data_collection (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_data_collection (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_data_collection (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_data_collection (const GValue* value);
VALA_EXTERN GType data_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataCollection, data_collection_unref)
VALA_EXTERN GType source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SourceCollection, data_collection_unref)
VALA_EXTERN GType database_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DatabaseSourceCollection, data_collection_unref)
VALA_EXTERN GType container_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ContainerSourceCollection, data_collection_unref)
VALA_EXTERN GType tag_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagSourceCollection, data_collection_unref)
static void tags_branch_on_tags_added_removed (TagsBranch* self,
                                        GeeIterable* added_raw,
                                        GeeIterable* removed);
static void _tags_branch_on_tags_added_removed_data_collection_contents_altered (DataCollection* _sender,
                                                                          GeeIterable* added,
                                                                          GeeIterable* removed,
                                                                          gpointer self);
VALA_EXTERN gpointer alteration_ref (gpointer instance);
VALA_EXTERN void alteration_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_alteration (const gchar* name,
                                   const gchar* nick,
                                   const gchar* blurb,
                                   GType object_type,
                                   GParamFlags flags);
VALA_EXTERN void value_set_alteration (GValue* value,
                           gpointer v_object);
VALA_EXTERN void value_take_alteration (GValue* value,
                            gpointer v_object);
VALA_EXTERN gpointer value_get_alteration (const GValue* value);
VALA_EXTERN GType alteration_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Alteration, alteration_unref)
static void tags_branch_on_tags_altered (TagsBranch* self,
                                  GeeMap* altered);
static void _tags_branch_on_tags_altered_data_collection_items_altered (DataCollection* _sender,
                                                                 GeeMap* items,
                                                                 gpointer self);
VALA_EXTERN TagsBranch* tags_branch_new (void);
VALA_EXTERN TagsBranch* tags_branch_construct (GType object_type);
VALA_EXTERN TagsHeader* tags_header_new (void);
VALA_EXTERN TagsHeader* tags_header_construct (GType object_type);
VALA_EXTERN GType sidebar_grouping_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarGrouping, g_object_unref)
VALA_EXTERN GType sidebar_header_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarHeader, g_object_unref)
VALA_EXTERN GType tags_header_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagsHeader, g_object_unref)
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_branch_options_get_type (void) G_GNUC_CONST ;
static gint tags_branch_comparator (SidebarEntry* a,
                             SidebarEntry* b);
static gint _tags_branch_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);
VALA_EXTERN GeeCollection* data_collection_get_all (DataCollection* self);
VALA_EXTERN TagsSidebarEntry* tags_branch_get_entry_for_tag (TagsBranch* self,
                                                 Tag* tag);
VALA_EXTERN gboolean tags_branch_is_user_renameable (TagsBranch* self);
VALA_EXTERN gint tag_compare_names (Tag* a,
                        Tag* b);
VALA_EXTERN Tag* tags_sidebar_entry_for_tag (TagsSidebarEntry* self);
static gint _tag_compare_names_gcompare_data_func (gconstpointer a,
                                            gconstpointer b,
                                            gpointer self);
VALA_EXTERN Tag* tag_get_hierarchical_parent (Tag* self);
VALA_EXTERN TagsSidebarEntry* tags_sidebar_entry_new (Tag* tag);
VALA_EXTERN TagsSidebarEntry* tags_sidebar_entry_construct (GType object_type,
                                                Tag* tag);
VALA_EXTERN void sidebar_branch_graft (SidebarBranch* self,
                           SidebarEntry* parent,
                           SidebarEntry* entry,
                           GCompareFunc comparator);
VALA_EXTERN SidebarEntry* sidebar_branch_get_root (SidebarBranch* self);
VALA_EXTERN void sidebar_branch_prune (SidebarBranch* self,
                           SidebarEntry* entry);
VALA_EXTERN gboolean alteration_has_detail (Alteration* self,
                                const gchar* subject,
                                const gchar* detail);
VALA_EXTERN GType sidebar_renameable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* tag_get_user_visible_name (Tag* self);
VALA_EXTERN void sidebar_branch_reorder (SidebarBranch* self,
                             SidebarEntry* entry);
static void tags_branch_finalize (GObject * obj);
static GType tags_branch_get_type_once (void);
VALA_EXTERN GType sidebar_expandable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sidebar_emphasizable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType thumbnail_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThumbnailSource, g_object_unref)
VALA_EXTERN GType media_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaSource, g_object_unref)
VALA_EXTERN GType sidebar_internal_drop_target_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sidebar_internal_drag_source_entry_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 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 void tags_header_setup_context_menu (TagsHeader* self);
VALA_EXTERN gchar* resources_get_ui (const gchar* filename);
VALA_EXTERN void app_window_error_message (const gchar* message,
                               GtkWindow* parent);
VALA_EXTERN gpointer application_ref (gpointer instance);
VALA_EXTERN void application_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_application (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_application (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_application (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_application (const GValue* value);
VALA_EXTERN GType application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Application, application_unref)
VALA_EXTERN Application* application_get_instance (void);
VALA_EXTERN void application_panic (Application* self);
static gboolean tags_header_real_internal_drop_received (SidebarInternalDropTargetEntry* base,
                                                  GeeList* media);
VALA_EXTERN gpointer text_entry_dialog_mediator_ref (gpointer instance);
VALA_EXTERN void text_entry_dialog_mediator_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_text_entry_dialog_mediator (const gchar* name,
                                                   const gchar* nick,
                                                   const gchar* blurb,
                                                   GType object_type,
                                                   GParamFlags flags);
VALA_EXTERN void value_set_text_entry_dialog_mediator (GValue* value,
                                           gpointer v_object);
VALA_EXTERN void value_take_text_entry_dialog_mediator (GValue* value,
                                            gpointer v_object);
VALA_EXTERN gpointer value_get_text_entry_dialog_mediator (const GValue* value);
VALA_EXTERN GType text_entry_dialog_mediator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TextEntryDialogMediator, text_entry_dialog_mediator_unref)
VALA_EXTERN GType tags_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagsDialog, text_entry_dialog_mediator_unref)
VALA_EXTERN GType add_tags_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AddTagsDialog, text_entry_dialog_mediator_unref)
VALA_EXTERN AddTagsDialog* add_tags_dialog_new (void);
VALA_EXTERN AddTagsDialog* add_tags_dialog_construct (GType object_type);
VALA_EXTERN gchar** add_tags_dialog_execute (AddTagsDialog* self,
                                 gint* result_length1);
VALA_EXTERN gpointer command_manager_ref (gpointer instance);
VALA_EXTERN void command_manager_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_command_manager (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_command_manager (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_command_manager (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_command_manager (const GValue* value);
VALA_EXTERN GType command_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CommandManager, command_manager_unref)
VALA_EXTERN CommandManager* app_window_get_command_manager (void);
VALA_EXTERN GType command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Command, g_object_unref)
VALA_EXTERN void command_manager_execute (CommandManager* self,
                              Command* command);
VALA_EXTERN AddTagsCommand* add_tags_command_new (gchar** paths,
                                      gint paths_length1,
                                      GeeCollection* sources);
VALA_EXTERN AddTagsCommand* add_tags_command_construct (GType object_type,
                                            gchar** paths,
                                            gint paths_length1,
                                            GeeCollection* sources);
VALA_EXTERN GType page_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageCommand, g_object_unref)
VALA_EXTERN GType add_tags_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AddTagsCommand, g_object_unref)
static gboolean tags_header_real_internal_drop_received_arbitrary (SidebarInternalDropTargetEntry* base,
                                                            GtkSelectionData* data);
VALA_EXTERN gboolean tag_source_collection_exists (TagSourceCollection* self,
                                       const gchar* name,
                                       gboolean treat_htags_as_root);
VALA_EXTERN GeeList* hierarchical_tag_utilities_enumerate_path_components (const gchar* in_path);
VALA_EXTERN Tag* tag_for_path (const gchar* name);
VALA_EXTERN ReparentTagCommand* reparent_tag_command_new (Tag* tag,
                                              const gchar* new_parent_path);
VALA_EXTERN ReparentTagCommand* reparent_tag_command_construct (GType object_type,
                                                    Tag* tag,
                                                    const gchar* new_parent_path);
VALA_EXTERN GType reparent_tag_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ReparentTagCommand, g_object_unref)
static void tags_header_real_prepare_selection_data (SidebarInternalDragSourceEntry* base,
                                              GtkSelectionData* data);
static GtkMenu* tags_header_real_get_sidebar_context_menu (SidebarContextable* base,
                                                    GdkEventButton* event);
VALA_EXTERN gboolean sidebar_internal_drop_target_entry_internal_drop_received (SidebarInternalDropTargetEntry* self,
                                                                    GeeList* sources);
VALA_EXTERN gboolean sidebar_internal_drop_target_entry_internal_drop_received_arbitrary (SidebarInternalDropTargetEntry* self,
                                                                              GtkSelectionData* data);
VALA_EXTERN void sidebar_internal_drag_source_entry_prepare_selection_data (SidebarInternalDragSourceEntry* self,
                                                                GtkSelectionData* data);
VALA_EXTERN GtkMenu* sidebar_contextable_get_sidebar_context_menu (SidebarContextable* self,
                                                       GdkEventButton* event);
static void tags_header_finalize (GObject * obj);
static GType tags_header_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_destroyable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* sidebar_simple_page_entry_get_sidebar_name (SidebarSimplePageEntry* self);
VALA_EXTERN gchar* sidebar_simple_page_entry_get_sidebar_icon (SidebarSimplePageEntry* self);
VALA_EXTERN Page* sidebar_simple_page_entry_create_page (SidebarSimplePageEntry* self);
VALA_EXTERN SidebarSimplePageEntry* sidebar_simple_page_entry_construct (GType object_type);
VALA_EXTERN void tags_sidebar_entry_init (void);
VALA_EXTERN void tags_sidebar_entry_terminate (void);
static gchar* tags_sidebar_entry_real_get_sidebar_name (SidebarSimplePageEntry* base);
static gchar* tags_sidebar_entry_real_get_sidebar_icon (SidebarSimplePageEntry* base);
static Page* tags_sidebar_entry_real_create_page (SidebarSimplePageEntry* base);
VALA_EXTERN TagPage* tag_page_new (Tag* tag);
VALA_EXTERN TagPage* tag_page_construct (GType object_type,
                             Tag* tag);
VALA_EXTERN GType checkerboard_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardPage, g_object_unref)
VALA_EXTERN GType media_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaPage, g_object_unref)
VALA_EXTERN GType collection_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CollectionPage, g_object_unref)
VALA_EXTERN GType tag_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagPage, g_object_unref)
static gboolean tags_sidebar_entry_real_is_user_renameable (SidebarRenameableEntry* base);
static void tags_sidebar_entry_real_rename (SidebarRenameableEntry* base,
                                     const gchar* new_name);
VALA_EXTERN gchar* tag_prep_tag_name (const gchar* name);
VALA_EXTERN RenameTagCommand* rename_tag_command_new (Tag* tag,
                                          const gchar* new_name);
VALA_EXTERN RenameTagCommand* rename_tag_command_construct (GType object_type,
                                                Tag* tag,
                                                const gchar* new_name);
VALA_EXTERN GType simple_proxyable_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SimpleProxyableCommand, g_object_unref)
VALA_EXTERN GType rename_tag_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (RenameTagCommand, g_object_unref)
static void tags_sidebar_entry_real_destroy_source (SidebarDestroyableEntry* base);
VALA_EXTERN gboolean dialogs_confirm_delete_tag (Tag* tag);
VALA_EXTERN DeleteTagCommand* delete_tag_command_new (Tag* tag);
VALA_EXTERN DeleteTagCommand* delete_tag_command_construct (GType object_type,
                                                Tag* tag);
VALA_EXTERN GType delete_tag_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DeleteTagCommand, g_object_unref)
static gboolean tags_sidebar_entry_real_internal_drop_received (SidebarInternalDropTargetEntry* base,
                                                         GeeList* media);
VALA_EXTERN TagUntagPhotosCommand* tag_untag_photos_command_new (Tag* tag,
                                                     GeeCollection* sources,
                                                     gint count,
                                                     gboolean attach);
VALA_EXTERN TagUntagPhotosCommand* tag_untag_photos_command_construct (GType object_type,
                                                           Tag* tag,
                                                           GeeCollection* sources,
                                                           gint count,
                                                           gboolean attach);
VALA_EXTERN GType tag_untag_photos_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagUntagPhotosCommand, g_object_unref)
static gboolean tags_sidebar_entry_real_internal_drop_received_arbitrary (SidebarInternalDropTargetEntry* base,
                                                                   GtkSelectionData* data);
VALA_EXTERN gchar* tag_get_path (Tag* self);
VALA_EXTERN GeeList* hierarchical_tag_utilities_enumerate_parent_paths (const gchar* in_path);
static gboolean tags_sidebar_entry_real_expand_on_select (SidebarExpandableEntry* base);
static void tags_sidebar_entry_real_prepare_selection_data (SidebarInternalDragSourceEntry* base,
                                                     GtkSelectionData* data);
VALA_EXTERN gboolean sidebar_renameable_entry_is_user_renameable (SidebarRenameableEntry* self);
VALA_EXTERN void sidebar_renameable_entry_rename (SidebarRenameableEntry* self,
                                      const gchar* new_name);
VALA_EXTERN void sidebar_destroyable_entry_destroy_source (SidebarDestroyableEntry* self);
VALA_EXTERN gboolean sidebar_expandable_entry_expand_on_select (SidebarExpandableEntry* self);
static void tags_sidebar_entry_finalize (GObject * obj);
static GType tags_sidebar_entry_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
tags_branch_get_instance_private (TagsBranch* self)
{
	return G_STRUCT_MEMBER_P (self, TagsBranch_private_offset);
}

static void
_tags_branch_on_tags_added_removed_data_collection_contents_altered (DataCollection* _sender,
                                                                     GeeIterable* added,
                                                                     GeeIterable* removed,
                                                                     gpointer self)
{
	tags_branch_on_tags_added_removed ((TagsBranch*) self, added, removed);
}

static void
_tags_branch_on_tags_altered_data_collection_items_altered (DataCollection* _sender,
                                                            GeeMap* items,
                                                            gpointer self)
{
	tags_branch_on_tags_altered ((TagsBranch*) self, items);
}

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

TagsBranch*
tags_branch_construct (GType object_type)
{
	TagsBranch * self = NULL;
	TagsHeader* _tmp0_;
	TagsHeader* _tmp1_;
	TagSourceCollection* _tmp2_;
	GeeCollection* _tmp3_;
	GeeCollection* _tmp4_;
	TagSourceCollection* _tmp5_;
	TagSourceCollection* _tmp6_;
	_tmp0_ = tags_header_new ();
	_tmp1_ = _tmp0_;
	self = (TagsBranch*) sidebar_branch_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SIDEBAR_TYPE_ENTRY, SidebarEntry), (SIDEBAR_BRANCH_OPTIONS_HIDE_IF_EMPTY | SIDEBAR_BRANCH_OPTIONS_AUTO_OPEN_ON_NEW_CHILD) | SIDEBAR_BRANCH_OPTIONS_STARTUP_OPEN_GROUPING, _tags_branch_comparator_gcompare_func, NULL);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = tag_global;
	_tmp3_ = data_collection_get_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_DATA_COLLECTION, DataCollection));
	_tmp4_ = _tmp3_;
	tags_branch_on_tags_added_removed (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ITERABLE, GeeIterable), NULL);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = tag_global;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_DATA_COLLECTION, DataCollection), "contents-altered", (GCallback) _tags_branch_on_tags_added_removed_data_collection_contents_altered, self, 0);
	_tmp6_ = tag_global;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_DATA_COLLECTION, DataCollection), "items-altered", (GCallback) _tags_branch_on_tags_altered_data_collection_items_altered, self, 0);
	return self;
}

TagsBranch*
tags_branch_new (void)
{
	return tags_branch_construct (TAGS_TYPE_BRANCH);
}

TagsSidebarEntry*
tags_branch_get_entry_for_tag (TagsBranch* self,
                               Tag* tag)
{
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	TagsSidebarEntry* result;
	g_return_val_if_fail (TAGS_IS_BRANCH (self), NULL);
	g_return_val_if_fail (IS_TAG (tag), NULL);
	_tmp0_ = self->priv->entry_map;
	_tmp1_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), tag);
	result = (TagsSidebarEntry*) _tmp1_;
	return result;
}

gboolean
tags_branch_is_user_renameable (TagsBranch* self)
{
	gboolean result;
	g_return_val_if_fail (TAGS_IS_BRANCH (self), FALSE);
	result = TRUE;
	return result;
}

static gint
tags_branch_comparator (SidebarEntry* a,
                        SidebarEntry* b)
{
	Tag* _tmp0_;
	Tag* _tmp1_;
	Tag* _tmp2_;
	Tag* _tmp3_;
	gint _tmp4_;
	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) {
		result = 0;
		return result;
	}
	_tmp0_ = tags_sidebar_entry_for_tag (G_TYPE_CHECK_INSTANCE_CAST (a, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry));
	_tmp1_ = _tmp0_;
	_tmp2_ = tags_sidebar_entry_for_tag (G_TYPE_CHECK_INSTANCE_CAST (b, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry));
	_tmp3_ = _tmp2_;
	_tmp4_ = tag_compare_names (_tmp1_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	result = _tmp4_;
	return result;
}

static gint
_tag_compare_names_gcompare_data_func (gconstpointer a,
                                       gconstpointer b,
                                       gpointer self)
{
	gint result;
	result = tag_compare_names ((Tag*) a, (Tag*) b);
	return result;
}

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

static void
tags_branch_on_tags_added_removed (TagsBranch* self,
                                   GeeIterable* added_raw,
                                   GeeIterable* removed)
{
	Tag* restore_point = NULL;
	g_return_if_fail (TAGS_IS_BRANCH (self));
	g_return_if_fail ((added_raw == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (added_raw, GEE_TYPE_ITERABLE));
	g_return_if_fail ((removed == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (removed, GEE_TYPE_ITERABLE));
	restore_point = NULL;
	if (added_raw != NULL) {
		GeeSortedSet* added = NULL;
		GeeTreeSet* _tmp0_;
		_tmp0_ = gee_tree_set_new (TYPE_TAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tag_compare_names_gcompare_data_func, NULL, NULL);
		added = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_SORTED_SET, GeeSortedSet);
		{
			GeeIterator* _object_it = NULL;
			GeeIterator* _tmp1_;
			_tmp1_ = gee_iterable_iterator (added_raw);
			_object_it = _tmp1_;
			while (TRUE) {
				GeeIterator* _tmp2_;
				DataObject* object = NULL;
				GeeIterator* _tmp3_;
				gpointer _tmp4_;
				Tag* tag = NULL;
				DataObject* _tmp5_;
				Tag* _tmp6_;
				GeeSortedSet* _tmp7_;
				Tag* _tmp8_;
				_tmp2_ = _object_it;
				if (!gee_iterator_next (_tmp2_)) {
					break;
				}
				_tmp3_ = _object_it;
				_tmp4_ = gee_iterator_get (_tmp3_);
				object = (DataObject*) _tmp4_;
				_tmp5_ = object;
				_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_TAG, Tag));
				tag = _tmp6_;
				_tmp7_ = added;
				_tmp8_ = tag;
				gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_COLLECTION, GeeCollection), _tmp8_);
				_g_object_unref0 (tag);
				_g_object_unref0 (object);
			}
			_g_object_unref0 (_object_it);
		}
		{
			GeeIterator* _tag_it = NULL;
			GeeSortedSet* _tmp9_;
			GeeIterator* _tmp10_;
			_tmp9_ = added;
			_tmp10_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ITERABLE, GeeIterable));
			_tag_it = _tmp10_;
			while (TRUE) {
				GeeIterator* _tmp11_;
				Tag* tag = NULL;
				GeeIterator* _tmp12_;
				gpointer _tmp13_;
				Tag* parent_tag = NULL;
				Tag* _tmp14_;
				Tag* _tmp15_;
				TagsSidebarEntry* entry = NULL;
				Tag* _tmp26_;
				TagsSidebarEntry* _tmp27_;
				GeeHashMap* _tmp28_;
				Tag* _tmp29_;
				TagsSidebarEntry* _tmp30_;
				Tag* _tmp31_;
				Tag* _tmp32_;
				Tag* _tmp33_;
				Tag* _tmp42_;
				Tag* _tmp43_;
				_tmp11_ = _tag_it;
				if (!gee_iterator_next (_tmp11_)) {
					break;
				}
				_tmp12_ = _tag_it;
				_tmp13_ = gee_iterator_get (_tmp12_);
				tag = (Tag*) _tmp13_;
				_tmp14_ = tag;
				_tmp15_ = tag_get_hierarchical_parent (_tmp14_);
				parent_tag = _tmp15_;
				while (TRUE) {
					Tag* _tmp16_;
					GeeHashMap* _tmp17_;
					Tag* _tmp18_;
					Tag* _tmp24_;
					Tag* _tmp25_;
					_tmp16_ = parent_tag;
					if (!(_tmp16_ != NULL)) {
						break;
					}
					_tmp17_ = self->priv->entry_map;
					_tmp18_ = parent_tag;
					if (!gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp18_)) {
						TagsSidebarEntry* parent_entry = NULL;
						Tag* _tmp19_;
						TagsSidebarEntry* _tmp20_;
						GeeHashMap* _tmp21_;
						Tag* _tmp22_;
						TagsSidebarEntry* _tmp23_;
						_tmp19_ = parent_tag;
						_tmp20_ = tags_sidebar_entry_new (_tmp19_);
						parent_entry = _tmp20_;
						_tmp21_ = self->priv->entry_map;
						_tmp22_ = parent_tag;
						_tmp23_ = parent_entry;
						gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp22_, _tmp23_);
						_g_object_unref0 (parent_entry);
					}
					_tmp24_ = parent_tag;
					_tmp25_ = tag_get_hierarchical_parent (_tmp24_);
					_g_object_unref0 (parent_tag);
					parent_tag = _tmp25_;
				}
				_tmp26_ = tag;
				_tmp27_ = tags_sidebar_entry_new (_tmp26_);
				entry = _tmp27_;
				_tmp28_ = self->priv->entry_map;
				_tmp29_ = tag;
				_tmp30_ = entry;
				gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp29_, _tmp30_);
				_tmp31_ = tag;
				_tmp32_ = tag_get_hierarchical_parent (_tmp31_);
				_g_object_unref0 (parent_tag);
				parent_tag = _tmp32_;
				_tmp33_ = parent_tag;
				if (_tmp33_ != NULL) {
					TagsSidebarEntry* parent_entry = NULL;
					GeeHashMap* _tmp34_;
					Tag* _tmp35_;
					gpointer _tmp36_;
					TagsSidebarEntry* _tmp37_;
					TagsSidebarEntry* _tmp38_;
					_tmp34_ = self->priv->entry_map;
					_tmp35_ = parent_tag;
					_tmp36_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp35_);
					parent_entry = (TagsSidebarEntry*) _tmp36_;
					_tmp37_ = parent_entry;
					_tmp38_ = entry;
					sidebar_branch_graft (G_TYPE_CHECK_INSTANCE_CAST (self, SIDEBAR_TYPE_BRANCH, SidebarBranch), G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, SIDEBAR_TYPE_ENTRY, SidebarEntry), G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, SIDEBAR_TYPE_ENTRY, SidebarEntry), NULL);
					_g_object_unref0 (parent_entry);
				} else {
					SidebarEntry* _tmp39_;
					SidebarEntry* _tmp40_;
					TagsSidebarEntry* _tmp41_;
					_tmp39_ = sidebar_branch_get_root (G_TYPE_CHECK_INSTANCE_CAST (self, SIDEBAR_TYPE_BRANCH, SidebarBranch));
					_tmp40_ = _tmp39_;
					_tmp41_ = entry;
					sidebar_branch_graft (G_TYPE_CHECK_INSTANCE_CAST (self, SIDEBAR_TYPE_BRANCH, SidebarBranch), _tmp40_, G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, SIDEBAR_TYPE_ENTRY, SidebarEntry), NULL);
					_g_object_unref0 (_tmp40_);
				}
				_tmp42_ = tag;
				_tmp43_ = _g_object_ref0 (_tmp42_);
				_g_object_unref0 (restore_point);
				restore_point = _tmp43_;
				_g_object_unref0 (entry);
				_g_object_unref0 (parent_tag);
				_g_object_unref0 (tag);
			}
			_g_object_unref0 (_tag_it);
		}
		_g_object_unref0 (added);
	}
	if (removed != NULL) {
		{
			GeeIterator* _object_it = NULL;
			GeeIterator* _tmp44_;
			_tmp44_ = gee_iterable_iterator (removed);
			_object_it = _tmp44_;
			while (TRUE) {
				GeeIterator* _tmp45_;
				DataObject* object = NULL;
				GeeIterator* _tmp46_;
				gpointer _tmp47_;
				Tag* tag = NULL;
				DataObject* _tmp48_;
				Tag* _tmp49_;
				TagsSidebarEntry* entry = NULL;
				GeeHashMap* _tmp50_;
				Tag* _tmp51_;
				gpointer _tmp52_;
				TagsSidebarEntry* _tmp53_;
				gboolean is_removed = FALSE;
				GeeHashMap* _tmp54_;
				Tag* _tmp55_;
				TagsSidebarEntry* _tmp56_;
				_tmp45_ = _object_it;
				if (!gee_iterator_next (_tmp45_)) {
					break;
				}
				_tmp46_ = _object_it;
				_tmp47_ = gee_iterator_get (_tmp46_);
				object = (DataObject*) _tmp47_;
				_tmp48_ = object;
				_tmp49_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, TYPE_TAG, Tag));
				tag = _tmp49_;
				_tmp50_ = self->priv->entry_map;
				_tmp51_ = tag;
				_tmp52_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp51_);
				entry = (TagsSidebarEntry*) _tmp52_;
				_tmp53_ = entry;
				_vala_assert (_tmp53_ != NULL, "entry != null");
				_tmp54_ = self->priv->entry_map;
				_tmp55_ = tag;
				is_removed = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp55_, NULL);
				_vala_assert (is_removed, "is_removed");
				_tmp56_ = entry;
				sidebar_branch_prune (G_TYPE_CHECK_INSTANCE_CAST (self, SIDEBAR_TYPE_BRANCH, SidebarBranch), G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, SIDEBAR_TYPE_ENTRY, SidebarEntry));
				_g_object_unref0 (entry);
				_g_object_unref0 (tag);
				_g_object_unref0 (object);
			}
			_g_object_unref0 (_object_it);
		}
	}
	_g_object_unref0 (restore_point);
}

static void
tags_branch_on_tags_altered (TagsBranch* self,
                             GeeMap* altered)
{
	g_return_if_fail (TAGS_IS_BRANCH (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (altered, GEE_TYPE_MAP));
	{
		GeeIterator* _object_it = NULL;
		GeeSet* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp0_ = gee_map_get_keys (altered);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ITERABLE, GeeIterable));
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		_object_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			DataObject* object = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			DataObject* _tmp8_;
			gpointer _tmp9_;
			Alteration* _tmp10_;
			gboolean _tmp11_;
			Tag* tag = NULL;
			DataObject* _tmp12_;
			Tag* _tmp13_;
			TagsSidebarEntry* entry = NULL;
			GeeHashMap* _tmp14_;
			Tag* _tmp15_;
			gpointer _tmp16_;
			TagsSidebarEntry* _tmp17_;
			TagsSidebarEntry* _tmp18_;
			Tag* _tmp19_;
			gchar* _tmp20_;
			gchar* _tmp21_;
			TagsSidebarEntry* _tmp22_;
			Tag* _tmp23_;
			gchar* _tmp24_;
			gchar* _tmp25_;
			TagsSidebarEntry* _tmp26_;
			_tmp5_ = _object_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = _object_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			object = (DataObject*) _tmp7_;
			_tmp8_ = object;
			_tmp9_ = gee_map_get (altered, _tmp8_);
			_tmp10_ = (Alteration*) _tmp9_;
			_tmp11_ = !alteration_has_detail (_tmp10_, "metadata", "name");
			_alteration_unref0 (_tmp10_);
			if (_tmp11_) {
				_g_object_unref0 (object);
				continue;
			}
			_tmp12_ = object;
			_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_TAG, Tag));
			tag = _tmp13_;
			_tmp14_ = self->priv->entry_map;
			_tmp15_ = tag;
			_tmp16_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp15_);
			entry = (TagsSidebarEntry*) _tmp16_;
			_tmp17_ = entry;
			_vala_assert (_tmp17_ != NULL, "entry != null");
			_tmp18_ = entry;
			_tmp19_ = tag;
			_tmp20_ = tag_get_user_visible_name (_tmp19_);
			_tmp21_ = _tmp20_;
			g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, SIDEBAR_TYPE_RENAMEABLE_ENTRY, SidebarRenameableEntry), "sidebar-name-changed", _tmp21_);
			_g_free0 (_tmp21_);
			_tmp22_ = entry;
			_tmp23_ = tag;
			_tmp24_ = tag_get_user_visible_name (_tmp23_);
			_tmp25_ = _tmp24_;
			g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, SIDEBAR_TYPE_ENTRY, SidebarEntry), "sidebar-tooltip-changed", _tmp25_);
			_g_free0 (_tmp25_);
			_tmp26_ = entry;
			sidebar_branch_reorder (G_TYPE_CHECK_INSTANCE_CAST (self, SIDEBAR_TYPE_BRANCH, SidebarBranch), G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, SIDEBAR_TYPE_ENTRY, SidebarEntry));
			_g_object_unref0 (entry);
			_g_object_unref0 (tag);
			_g_object_unref0 (object);
		}
		_g_object_unref0 (_object_it);
	}
}

static void
tags_branch_class_init (TagsBranchClass * klass,
                        gpointer klass_data)
{
	tags_branch_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TagsBranch_private_offset);
	G_OBJECT_CLASS (klass)->finalize = tags_branch_finalize;
}

static void
tags_branch_instance_init (TagsBranch * self,
                           gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = tags_branch_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (TYPE_TAG, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, TAGS_TYPE_SIDEBAR_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->entry_map = _tmp0_;
}

static void
tags_branch_finalize (GObject * obj)
{
	TagsBranch * self;
	TagSourceCollection* _tmp0_;
	guint _tmp1_;
	TagSourceCollection* _tmp2_;
	guint _tmp3_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TAGS_TYPE_BRANCH, TagsBranch);
	_tmp0_ = tag_global;
	g_signal_parse_name ("contents-altered", TYPE_DATA_COLLECTION, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _tags_branch_on_tags_added_removed_data_collection_contents_altered, self);
	_tmp2_ = tag_global;
	g_signal_parse_name ("items-altered", TYPE_DATA_COLLECTION, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _tags_branch_on_tags_altered_data_collection_items_altered, self);
	_g_object_unref0 (self->priv->entry_map);
	G_OBJECT_CLASS (tags_branch_parent_class)->finalize (obj);
}

static GType
tags_branch_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TagsBranchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tags_branch_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TagsBranch), 0, (GInstanceInitFunc) tags_branch_instance_init, NULL };
	GType tags_branch_type_id;
	tags_branch_type_id = g_type_register_static (SIDEBAR_TYPE_BRANCH, "TagsBranch", &g_define_type_info, 0);
	TagsBranch_private_offset = g_type_add_instance_private (tags_branch_type_id, sizeof (TagsBranchPrivate));
	return tags_branch_type_id;
}

GType
tags_branch_get_type (void)
{
	static volatile gsize tags_branch_type_id__once = 0;
	if (g_once_init_enter (&tags_branch_type_id__once)) {
		GType tags_branch_type_id;
		tags_branch_type_id = tags_branch_get_type_once ();
		g_once_init_leave (&tags_branch_type_id__once, tags_branch_type_id);
	}
	return tags_branch_type_id__once;
}

static inline gpointer
tags_header_get_instance_private (TagsHeader* self)
{
	return G_STRUCT_MEMBER_P (self, TagsHeader_private_offset);
}

TagsHeader*
tags_header_construct (GType object_type)
{
	TagsHeader * self = NULL;
	self = (TagsHeader*) sidebar_header_construct (object_type, _ ("Tags"), _ ("Organize and browse your photo’s tags"), TRUE);
	tags_header_setup_context_menu (self);
	return self;
}

TagsHeader*
tags_header_new (void)
{
	return tags_header_construct (TAGS_TYPE_HEADER);
}

static void
tags_header_setup_context_menu (TagsHeader* self)
{
	GtkBuilder* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (TAGS_IS_HEADER (self));
	_tmp0_ = gtk_builder_new ();
	_g_object_unref0 (self->priv->builder);
	self->priv->builder = _tmp0_;
	{
		GtkBuilder* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		GMenuModel* model = NULL;
		GtkBuilder* _tmp4_;
		GObject* _tmp5_;
		GMenuModel* _tmp6_;
		GMenuModel* _tmp7_;
		GtkMenu* _tmp8_;
		_tmp1_ = self->priv->builder;
		_tmp2_ = resources_get_ui ("tag_sidebar_context.ui");
		_tmp3_ = _tmp2_;
		gtk_builder_add_from_resource (_tmp1_, _tmp3_, &_inner_error0_);
		_g_free0 (_tmp3_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = self->priv->builder;
		_tmp5_ = gtk_builder_get_object (_tmp4_, "popup-menu");
		_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, g_menu_model_get_type ()) ? ((GMenuModel*) _tmp5_) : NULL);
		model = _tmp6_;
		_tmp7_ = model;
		_tmp8_ = (GtkMenu*) gtk_menu_new_from_model (_tmp7_);
		g_object_ref_sink (_tmp8_);
		_g_object_unref0 (self->priv->context_menu);
		self->priv->context_menu = _tmp8_;
		_g_object_unref0 (model);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		Application* _tmp13_;
		Application* _tmp14_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = _error_;
		_tmp10_ = _tmp9_->message;
		_tmp11_ = g_strdup_printf ("Error loading UI resource: %s", _tmp10_);
		_tmp12_ = _tmp11_;
		app_window_error_message (_tmp12_, NULL);
		_g_free0 (_tmp12_);
		_tmp13_ = application_get_instance ();
		_tmp14_ = _tmp13_;
		application_panic (_tmp14_);
		_application_unref0 (_tmp14_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static gboolean
tags_header_real_internal_drop_received (SidebarInternalDropTargetEntry* base,
                                         GeeList* media)
{
	TagsHeader * self;
	AddTagsDialog* dialog = NULL;
	AddTagsDialog* _tmp0_;
	gchar** names = NULL;
	AddTagsDialog* _tmp1_;
	gint _tmp2_ = 0;
	gchar** _tmp3_;
	gint names_length1;
	gint _names_size_;
	gboolean _tmp4_ = FALSE;
	gchar** _tmp5_;
	gint _tmp5__length1;
	CommandManager* _tmp7_;
	CommandManager* _tmp8_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	AddTagsCommand* _tmp10_;
	AddTagsCommand* _tmp11_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_HEADER, TagsHeader);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (media, GEE_TYPE_LIST), FALSE);
	_tmp0_ = add_tags_dialog_new ();
	dialog = _tmp0_;
	_tmp1_ = dialog;
	_tmp3_ = add_tags_dialog_execute (_tmp1_, &_tmp2_);
	names = _tmp3_;
	names_length1 = _tmp2_;
	_names_size_ = names_length1;
	_tmp5_ = names;
	_tmp5__length1 = names_length1;
	if (_tmp5_ == NULL) {
		_tmp4_ = TRUE;
	} else {
		gchar** _tmp6_;
		gint _tmp6__length1;
		_tmp6_ = names;
		_tmp6__length1 = names_length1;
		_tmp4_ = _tmp6__length1 == 0;
	}
	if (_tmp4_) {
		result = FALSE;
		names = (_vala_array_free (names, names_length1, (GDestroyNotify) g_free), NULL);
		_text_entry_dialog_mediator_unref0 (dialog);
		return result;
	}
	_tmp7_ = app_window_get_command_manager ();
	_tmp8_ = _tmp7_;
	_tmp9_ = names;
	_tmp9__length1 = names_length1;
	_tmp10_ = add_tags_command_new (_tmp9_, _tmp9__length1, G_TYPE_CHECK_INSTANCE_CAST (media, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp11_ = _tmp10_;
	command_manager_execute (_tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_COMMAND, Command));
	_g_object_unref0 (_tmp11_);
	_command_manager_unref0 (_tmp8_);
	result = TRUE;
	names = (_vala_array_free (names, names_length1, (GDestroyNotify) g_free), NULL);
	_text_entry_dialog_mediator_unref0 (dialog);
	return result;
}

static gboolean
tags_header_real_internal_drop_received_arbitrary (SidebarInternalDropTargetEntry* base,
                                                   GtkSelectionData* data)
{
	TagsHeader * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_HEADER, TagsHeader);
	g_return_val_if_fail (data != NULL, FALSE);
	_tmp0_ = gdk_atom_name (gtk_selection_data_get_data_type (data));
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strcmp0 (_tmp1_, LIBRARY_WINDOW_TAG_PATH_MIME_TYPE) == 0;
	_g_free0 (_tmp1_);
	if (_tmp2_) {
		gchar* old_tag_path = NULL;
		guint8* _tmp3_;
		gchar* _tmp4_;
		TagSourceCollection* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		GeeList* _tmp8_;
		GeeList* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		gboolean _tmp12_;
		CommandManager* _tmp13_;
		CommandManager* _tmp14_;
		const gchar* _tmp15_;
		Tag* _tmp16_;
		Tag* _tmp17_;
		ReparentTagCommand* _tmp18_;
		ReparentTagCommand* _tmp19_;
		_tmp3_ = gtk_selection_data_get_data (data);
		_tmp4_ = g_strdup ((const gchar*) _tmp3_);
		old_tag_path = _tmp4_;
		_tmp5_ = tag_global;
		_tmp6_ = old_tag_path;
		_vala_assert (tag_source_collection_exists (_tmp5_, _tmp6_, FALSE), "Tag.global.exists(old_tag_path)");
		_tmp7_ = old_tag_path;
		_tmp8_ = hierarchical_tag_utilities_enumerate_path_components (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp11_ = _tmp10_;
		_tmp12_ = _tmp11_ < 2;
		_g_object_unref0 (_tmp9_);
		if (_tmp12_) {
			result = TRUE;
			_g_free0 (old_tag_path);
			return result;
		}
		_tmp13_ = app_window_get_command_manager ();
		_tmp14_ = _tmp13_;
		_tmp15_ = old_tag_path;
		_tmp16_ = tag_for_path (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = reparent_tag_command_new (_tmp17_, "/");
		_tmp19_ = _tmp18_;
		command_manager_execute (_tmp14_, G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_COMMAND, Command));
		_g_object_unref0 (_tmp19_);
		_g_object_unref0 (_tmp17_);
		_command_manager_unref0 (_tmp14_);
		result = TRUE;
		_g_free0 (old_tag_path);
		return result;
	}
	result = FALSE;
	return result;
}

static void
tags_header_real_prepare_selection_data (SidebarInternalDragSourceEntry* base,
                                         GtkSelectionData* data)
{
	TagsHeader * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_HEADER, TagsHeader);
	g_return_if_fail (data != NULL);
}

static GtkMenu*
tags_header_real_get_sidebar_context_menu (SidebarContextable* base,
                                           GdkEventButton* event)
{
	TagsHeader * self;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp1_;
	GtkMenu* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_HEADER, TagsHeader);
	_tmp0_ = self->priv->context_menu;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
tags_header_class_init (TagsHeaderClass * klass,
                        gpointer klass_data)
{
	tags_header_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TagsHeader_private_offset);
	G_OBJECT_CLASS (klass)->finalize = tags_header_finalize;
}

static void
tags_header_sidebar_internal_drop_target_entry_interface_init (SidebarInternalDropTargetEntryIface * iface,
                                                               gpointer iface_data)
{
	tags_header_sidebar_internal_drop_target_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->internal_drop_received = (gboolean (*) (SidebarInternalDropTargetEntry*, GeeList*)) tags_header_real_internal_drop_received;
	iface->internal_drop_received_arbitrary = (gboolean (*) (SidebarInternalDropTargetEntry*, GtkSelectionData*)) tags_header_real_internal_drop_received_arbitrary;
}

static void
tags_header_sidebar_internal_drag_source_entry_interface_init (SidebarInternalDragSourceEntryIface * iface,
                                                               gpointer iface_data)
{
	tags_header_sidebar_internal_drag_source_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->prepare_selection_data = (void (*) (SidebarInternalDragSourceEntry*, GtkSelectionData*)) tags_header_real_prepare_selection_data;
}

static void
tags_header_sidebar_contextable_interface_init (SidebarContextableIface * iface,
                                                gpointer iface_data)
{
	tags_header_sidebar_contextable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_sidebar_context_menu = (GtkMenu* (*) (SidebarContextable*, GdkEventButton*)) tags_header_real_get_sidebar_context_menu;
}

static void
tags_header_instance_init (TagsHeader * self,
                           gpointer klass)
{
	self->priv = tags_header_get_instance_private (self);
	self->priv->context_menu = NULL;
}

static void
tags_header_finalize (GObject * obj)
{
	TagsHeader * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TAGS_TYPE_HEADER, TagsHeader);
	_g_object_unref0 (self->priv->builder);
	_g_object_unref0 (self->priv->context_menu);
	G_OBJECT_CLASS (tags_header_parent_class)->finalize (obj);
}

static GType
tags_header_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TagsHeaderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tags_header_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TagsHeader), 0, (GInstanceInitFunc) tags_header_instance_init, NULL };
	static const GInterfaceInfo sidebar_internal_drop_target_entry_info = { (GInterfaceInitFunc) tags_header_sidebar_internal_drop_target_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_internal_drag_source_entry_info = { (GInterfaceInitFunc) tags_header_sidebar_internal_drag_source_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_contextable_info = { (GInterfaceInitFunc) tags_header_sidebar_contextable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tags_header_type_id;
	tags_header_type_id = g_type_register_static (SIDEBAR_TYPE_HEADER, "TagsHeader", &g_define_type_info, 0);
	g_type_add_interface_static (tags_header_type_id, SIDEBAR_TYPE_INTERNAL_DROP_TARGET_ENTRY, &sidebar_internal_drop_target_entry_info);
	g_type_add_interface_static (tags_header_type_id, SIDEBAR_TYPE_INTERNAL_DRAG_SOURCE_ENTRY, &sidebar_internal_drag_source_entry_info);
	g_type_add_interface_static (tags_header_type_id, SIDEBAR_TYPE_CONTEXTABLE, &sidebar_contextable_info);
	TagsHeader_private_offset = g_type_add_instance_private (tags_header_type_id, sizeof (TagsHeaderPrivate));
	return tags_header_type_id;
}

GType
tags_header_get_type (void)
{
	static volatile gsize tags_header_type_id__once = 0;
	if (g_once_init_enter (&tags_header_type_id__once)) {
		GType tags_header_type_id;
		tags_header_type_id = tags_header_get_type_once ();
		g_once_init_leave (&tags_header_type_id__once, tags_header_type_id);
	}
	return tags_header_type_id__once;
}

static inline gpointer
tags_sidebar_entry_get_instance_private (TagsSidebarEntry* self)
{
	return G_STRUCT_MEMBER_P (self, TagsSidebarEntry_private_offset);
}

TagsSidebarEntry*
tags_sidebar_entry_construct (GType object_type,
                              Tag* tag)
{
	TagsSidebarEntry * self = NULL;
	Tag* _tmp0_;
	g_return_val_if_fail (IS_TAG (tag), NULL);
	self = (TagsSidebarEntry*) sidebar_simple_page_entry_construct (object_type);
	_tmp0_ = _g_object_ref0 (tag);
	_g_object_unref0 (self->priv->tag);
	self->priv->tag = _tmp0_;
	return self;
}

TagsSidebarEntry*
tags_sidebar_entry_new (Tag* tag)
{
	return tags_sidebar_entry_construct (TAGS_TYPE_SIDEBAR_ENTRY, tag);
}

void
tags_sidebar_entry_init (void)
{
}

void
tags_sidebar_entry_terminate (void)
{
}

Tag*
tags_sidebar_entry_for_tag (TagsSidebarEntry* self)
{
	Tag* _tmp0_;
	Tag* _tmp1_;
	Tag* result;
	g_return_val_if_fail (TAGS_IS_SIDEBAR_ENTRY (self), NULL);
	_tmp0_ = self->priv->tag;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
tags_sidebar_entry_real_get_sidebar_name (SidebarSimplePageEntry* base)
{
	TagsSidebarEntry * self;
	Tag* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	_tmp0_ = self->priv->tag;
	_tmp1_ = tag_get_user_visible_name (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
tags_sidebar_entry_real_get_sidebar_icon (SidebarSimplePageEntry* base)
{
	TagsSidebarEntry * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	_tmp0_ = self->priv->single_tag_icon;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static Page*
tags_sidebar_entry_real_create_page (SidebarSimplePageEntry* base)
{
	TagsSidebarEntry * self;
	Tag* _tmp0_;
	TagPage* _tmp1_;
	Page* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	_tmp0_ = self->priv->tag;
	_tmp1_ = tag_page_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PAGE, Page);
	return result;
}

static gboolean
tags_sidebar_entry_real_is_user_renameable (SidebarRenameableEntry* base)
{
	TagsSidebarEntry * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	result = TRUE;
	return result;
}

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

static void
tags_sidebar_entry_real_rename (SidebarRenameableEntry* base,
                                const gchar* new_name)
{
	TagsSidebarEntry * self;
	gchar* prepped = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	Tag* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gboolean _tmp8_;
	const gchar* _tmp9_;
	CommandManager* _tmp10_;
	CommandManager* _tmp11_;
	Tag* _tmp12_;
	const gchar* _tmp13_;
	RenameTagCommand* _tmp14_;
	RenameTagCommand* _tmp15_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	g_return_if_fail (new_name != NULL);
	_tmp0_ = tag_prep_tag_name (new_name);
	prepped = _tmp0_;
	_tmp1_ = prepped;
	if (_tmp1_ == NULL) {
		_g_free0 (prepped);
		return;
	}
	_tmp2_ = prepped;
	_tmp3_ = string_replace (_tmp2_, "/", "");
	_g_free0 (prepped);
	prepped = _tmp3_;
	_tmp4_ = prepped;
	_tmp5_ = self->priv->tag;
	_tmp6_ = tag_get_user_visible_name (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strcmp0 (_tmp4_, _tmp7_) == 0;
	_g_free0 (_tmp7_);
	if (_tmp8_) {
		_g_free0 (prepped);
		return;
	}
	_tmp9_ = prepped;
	if (g_strcmp0 (_tmp9_, "") == 0) {
		_g_free0 (prepped);
		return;
	}
	_tmp10_ = app_window_get_command_manager ();
	_tmp11_ = _tmp10_;
	_tmp12_ = self->priv->tag;
	_tmp13_ = prepped;
	_tmp14_ = rename_tag_command_new (_tmp12_, _tmp13_);
	_tmp15_ = _tmp14_;
	command_manager_execute (_tmp11_, G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_COMMAND, Command));
	_g_object_unref0 (_tmp15_);
	_command_manager_unref0 (_tmp11_);
	_g_free0 (prepped);
}

static void
tags_sidebar_entry_real_destroy_source (SidebarDestroyableEntry* base)
{
	TagsSidebarEntry * self;
	Tag* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	_tmp0_ = self->priv->tag;
	if (dialogs_confirm_delete_tag (_tmp0_)) {
		CommandManager* _tmp1_;
		CommandManager* _tmp2_;
		Tag* _tmp3_;
		DeleteTagCommand* _tmp4_;
		DeleteTagCommand* _tmp5_;
		_tmp1_ = app_window_get_command_manager ();
		_tmp2_ = _tmp1_;
		_tmp3_ = self->priv->tag;
		_tmp4_ = delete_tag_command_new (_tmp3_);
		_tmp5_ = _tmp4_;
		command_manager_execute (_tmp2_, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_COMMAND, Command));
		_g_object_unref0 (_tmp5_);
		_command_manager_unref0 (_tmp2_);
	}
}

static gboolean
tags_sidebar_entry_real_internal_drop_received (SidebarInternalDropTargetEntry* base,
                                                GeeList* media)
{
	TagsSidebarEntry * self;
	CommandManager* _tmp0_;
	CommandManager* _tmp1_;
	Tag* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	TagUntagPhotosCommand* _tmp5_;
	TagUntagPhotosCommand* _tmp6_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (media, GEE_TYPE_LIST), FALSE);
	_tmp0_ = app_window_get_command_manager ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->tag;
	_tmp3_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (media, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp4_ = _tmp3_;
	_tmp5_ = tag_untag_photos_command_new (_tmp2_, G_TYPE_CHECK_INSTANCE_CAST (media, GEE_TYPE_COLLECTION, GeeCollection), _tmp4_, TRUE);
	_tmp6_ = _tmp5_;
	command_manager_execute (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_COMMAND, Command));
	_g_object_unref0 (_tmp6_);
	_command_manager_unref0 (_tmp1_);
	result = TRUE;
	return result;
}

static gboolean
tags_sidebar_entry_real_internal_drop_received_arbitrary (SidebarInternalDropTargetEntry* base,
                                                          GtkSelectionData* data)
{
	TagsSidebarEntry * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	g_return_val_if_fail (data != NULL, FALSE);
	_tmp0_ = gdk_atom_name (gtk_selection_data_get_data_type (data));
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strcmp0 (_tmp1_, LIBRARY_WINDOW_TAG_PATH_MIME_TYPE) == 0;
	_g_free0 (_tmp1_);
	if (_tmp2_) {
		gchar* old_tag_path = NULL;
		guint8* _tmp3_;
		gchar* _tmp4_;
		const gchar* _tmp5_;
		Tag* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gboolean _tmp9_;
		TagSourceCollection* _tmp24_;
		const gchar* _tmp25_;
		Tag* old_tag = NULL;
		const gchar* _tmp26_;
		Tag* _tmp27_;
		Tag* old_tag_parent = NULL;
		Tag* _tmp28_;
		Tag* _tmp29_;
		gboolean _tmp30_ = FALSE;
		Tag* _tmp31_;
		CommandManager* _tmp38_;
		CommandManager* _tmp39_;
		Tag* _tmp40_;
		Tag* _tmp41_;
		gchar* _tmp42_;
		gchar* _tmp43_;
		ReparentTagCommand* _tmp44_;
		ReparentTagCommand* _tmp45_;
		_tmp3_ = gtk_selection_data_get_data (data);
		_tmp4_ = g_strdup ((const gchar*) _tmp3_);
		old_tag_path = _tmp4_;
		_tmp5_ = old_tag_path;
		_tmp6_ = self->priv->tag;
		_tmp7_ = tag_get_path (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = g_strcmp0 (_tmp5_, _tmp8_) == 0;
		_g_free0 (_tmp8_);
		if (_tmp9_) {
			result = TRUE;
			_g_free0 (old_tag_path);
			return result;
		}
		{
			GeeList* _parent_path_list = NULL;
			Tag* _tmp10_;
			gchar* _tmp11_;
			gchar* _tmp12_;
			GeeList* _tmp13_;
			GeeList* _tmp14_;
			gint _parent_path_size = 0;
			GeeList* _tmp15_;
			gint _tmp16_;
			gint _tmp17_;
			gint _parent_path_index = 0;
			_tmp10_ = self->priv->tag;
			_tmp11_ = tag_get_path (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = hierarchical_tag_utilities_enumerate_parent_paths (_tmp12_);
			_tmp14_ = _tmp13_;
			_g_free0 (_tmp12_);
			_parent_path_list = _tmp14_;
			_tmp15_ = _parent_path_list;
			_tmp16_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GEE_TYPE_COLLECTION, GeeCollection));
			_tmp17_ = _tmp16_;
			_parent_path_size = _tmp17_;
			_parent_path_index = -1;
			while (TRUE) {
				gint _tmp18_;
				gint _tmp19_;
				gchar* parent_path = NULL;
				GeeList* _tmp20_;
				gpointer _tmp21_;
				const gchar* _tmp22_;
				const gchar* _tmp23_;
				_parent_path_index = _parent_path_index + 1;
				_tmp18_ = _parent_path_index;
				_tmp19_ = _parent_path_size;
				if (!(_tmp18_ < _tmp19_)) {
					break;
				}
				_tmp20_ = _parent_path_list;
				_tmp21_ = gee_list_get (_tmp20_, _parent_path_index);
				parent_path = (gchar*) _tmp21_;
				_tmp22_ = parent_path;
				_tmp23_ = old_tag_path;
				if (g_strcmp0 (_tmp22_, _tmp23_) == 0) {
					result = TRUE;
					_g_free0 (parent_path);
					_g_object_unref0 (_parent_path_list);
					_g_free0 (old_tag_path);
					return result;
				}
				_g_free0 (parent_path);
			}
			_g_object_unref0 (_parent_path_list);
		}
		_tmp24_ = tag_global;
		_tmp25_ = old_tag_path;
		_vala_assert (tag_source_collection_exists (_tmp24_, _tmp25_, FALSE), "Tag.global.exists(old_tag_path)");
		_tmp26_ = old_tag_path;
		_tmp27_ = tag_for_path (_tmp26_);
		old_tag = _tmp27_;
		_tmp28_ = old_tag;
		_tmp29_ = tag_get_hierarchical_parent (_tmp28_);
		old_tag_parent = _tmp29_;
		_tmp31_ = old_tag_parent;
		if (_tmp31_ != NULL) {
			Tag* _tmp32_;
			gchar* _tmp33_;
			gchar* _tmp34_;
			Tag* _tmp35_;
			gchar* _tmp36_;
			gchar* _tmp37_;
			_tmp32_ = old_tag_parent;
			_tmp33_ = tag_get_path (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = self->priv->tag;
			_tmp36_ = tag_get_path (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp30_ = g_strcmp0 (_tmp34_, _tmp37_) == 0;
			_g_free0 (_tmp37_);
			_g_free0 (_tmp34_);
		} else {
			_tmp30_ = FALSE;
		}
		if (_tmp30_) {
			result = TRUE;
			_g_object_unref0 (old_tag_parent);
			_g_object_unref0 (old_tag);
			_g_free0 (old_tag_path);
			return result;
		}
		_tmp38_ = app_window_get_command_manager ();
		_tmp39_ = _tmp38_;
		_tmp40_ = old_tag;
		_tmp41_ = self->priv->tag;
		_tmp42_ = tag_get_path (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp44_ = reparent_tag_command_new (_tmp40_, _tmp43_);
		_tmp45_ = _tmp44_;
		command_manager_execute (_tmp39_, G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, TYPE_COMMAND, Command));
		_g_object_unref0 (_tmp45_);
		_g_free0 (_tmp43_);
		_command_manager_unref0 (_tmp39_);
		result = TRUE;
		_g_object_unref0 (old_tag_parent);
		_g_object_unref0 (old_tag);
		_g_free0 (old_tag_path);
		return result;
	}
	result = FALSE;
	return result;
}

static gboolean
tags_sidebar_entry_real_expand_on_select (SidebarExpandableEntry* base)
{
	TagsSidebarEntry * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	result = FALSE;
	return result;
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static void
tags_sidebar_entry_real_prepare_selection_data (SidebarInternalDragSourceEntry* base,
                                                GtkSelectionData* data)
{
	TagsSidebarEntry * self;
	Tag* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	guint8* _tmp3_;
	gint _tmp3__length1;
	gint _tmp4_ = 0;
	guint8* _tmp5_;
	gint _tmp5__length1;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	g_return_if_fail (data != NULL);
	_tmp0_ = self->priv->tag;
	_tmp1_ = tag_get_path (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_get_data (_tmp2_, &_tmp4_);
	_tmp3__length1 = _tmp4_;
	_tmp5_ = _tmp3_;
	_tmp5__length1 = _tmp3__length1;
	gtk_selection_data_set (data, gdk_atom_intern_static_string (LIBRARY_WINDOW_TAG_PATH_MIME_TYPE), 0, _tmp5_, (gint) _tmp5__length1);
	_g_free0 (_tmp2_);
}

static void
tags_sidebar_entry_class_init (TagsSidebarEntryClass * klass,
                               gpointer klass_data)
{
	tags_sidebar_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TagsSidebarEntry_private_offset);
	((SidebarSimplePageEntryClass *) klass)->get_sidebar_name = (gchar* (*) (SidebarSimplePageEntry*)) tags_sidebar_entry_real_get_sidebar_name;
	((SidebarSimplePageEntryClass *) klass)->get_sidebar_icon = (gchar* (*) (SidebarSimplePageEntry*)) tags_sidebar_entry_real_get_sidebar_icon;
	((SidebarSimplePageEntryClass *) klass)->create_page = (Page* (*) (SidebarSimplePageEntry*)) tags_sidebar_entry_real_create_page;
	G_OBJECT_CLASS (klass)->finalize = tags_sidebar_entry_finalize;
}

static void
tags_sidebar_entry_sidebar_renameable_entry_interface_init (SidebarRenameableEntryIface * iface,
                                                            gpointer iface_data)
{
	tags_sidebar_entry_sidebar_renameable_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->is_user_renameable = (gboolean (*) (SidebarRenameableEntry*)) tags_sidebar_entry_real_is_user_renameable;
	iface->rename = (void (*) (SidebarRenameableEntry*, const gchar*)) tags_sidebar_entry_real_rename;
}

static void
tags_sidebar_entry_sidebar_destroyable_entry_interface_init (SidebarDestroyableEntryIface * iface,
                                                             gpointer iface_data)
{
	tags_sidebar_entry_sidebar_destroyable_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->destroy_source = (void (*) (SidebarDestroyableEntry*)) tags_sidebar_entry_real_destroy_source;
}

static void
tags_sidebar_entry_sidebar_internal_drop_target_entry_interface_init (SidebarInternalDropTargetEntryIface * iface,
                                                                      gpointer iface_data)
{
	tags_sidebar_entry_sidebar_internal_drop_target_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->internal_drop_received = (gboolean (*) (SidebarInternalDropTargetEntry*, GeeList*)) tags_sidebar_entry_real_internal_drop_received;
	iface->internal_drop_received_arbitrary = (gboolean (*) (SidebarInternalDropTargetEntry*, GtkSelectionData*)) tags_sidebar_entry_real_internal_drop_received_arbitrary;
}

static void
tags_sidebar_entry_sidebar_expandable_entry_interface_init (SidebarExpandableEntryIface * iface,
                                                            gpointer iface_data)
{
	tags_sidebar_entry_sidebar_expandable_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->expand_on_select = (gboolean (*) (SidebarExpandableEntry*)) tags_sidebar_entry_real_expand_on_select;
}

static void
tags_sidebar_entry_sidebar_internal_drag_source_entry_interface_init (SidebarInternalDragSourceEntryIface * iface,
                                                                      gpointer iface_data)
{
	tags_sidebar_entry_sidebar_internal_drag_source_entry_parent_iface = g_type_interface_peek_parent (iface);
	iface->prepare_selection_data = (void (*) (SidebarInternalDragSourceEntry*, GtkSelectionData*)) tags_sidebar_entry_real_prepare_selection_data;
}

static void
tags_sidebar_entry_instance_init (TagsSidebarEntry * self,
                                  gpointer klass)
{
	gchar* _tmp0_;
	self->priv = tags_sidebar_entry_get_instance_private (self);
	_tmp0_ = g_strdup (RESOURCES_ICON_ONE_TAG);
	self->priv->single_tag_icon = _tmp0_;
}

static void
tags_sidebar_entry_finalize (GObject * obj)
{
	TagsSidebarEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TAGS_TYPE_SIDEBAR_ENTRY, TagsSidebarEntry);
	_g_free0 (self->priv->single_tag_icon);
	_g_object_unref0 (self->priv->tag);
	G_OBJECT_CLASS (tags_sidebar_entry_parent_class)->finalize (obj);
}

static GType
tags_sidebar_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TagsSidebarEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tags_sidebar_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TagsSidebarEntry), 0, (GInstanceInitFunc) tags_sidebar_entry_instance_init, NULL };
	static const GInterfaceInfo sidebar_renameable_entry_info = { (GInterfaceInitFunc) tags_sidebar_entry_sidebar_renameable_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_destroyable_entry_info = { (GInterfaceInitFunc) tags_sidebar_entry_sidebar_destroyable_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_internal_drop_target_entry_info = { (GInterfaceInitFunc) tags_sidebar_entry_sidebar_internal_drop_target_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_expandable_entry_info = { (GInterfaceInitFunc) tags_sidebar_entry_sidebar_expandable_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo sidebar_internal_drag_source_entry_info = { (GInterfaceInitFunc) tags_sidebar_entry_sidebar_internal_drag_source_entry_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tags_sidebar_entry_type_id;
	tags_sidebar_entry_type_id = g_type_register_static (SIDEBAR_TYPE_SIMPLE_PAGE_ENTRY, "TagsSidebarEntry", &g_define_type_info, 0);
	g_type_add_interface_static (tags_sidebar_entry_type_id, SIDEBAR_TYPE_RENAMEABLE_ENTRY, &sidebar_renameable_entry_info);
	g_type_add_interface_static (tags_sidebar_entry_type_id, SIDEBAR_TYPE_DESTROYABLE_ENTRY, &sidebar_destroyable_entry_info);
	g_type_add_interface_static (tags_sidebar_entry_type_id, SIDEBAR_TYPE_INTERNAL_DROP_TARGET_ENTRY, &sidebar_internal_drop_target_entry_info);
	g_type_add_interface_static (tags_sidebar_entry_type_id, SIDEBAR_TYPE_EXPANDABLE_ENTRY, &sidebar_expandable_entry_info);
	g_type_add_interface_static (tags_sidebar_entry_type_id, SIDEBAR_TYPE_INTERNAL_DRAG_SOURCE_ENTRY, &sidebar_internal_drag_source_entry_info);
	TagsSidebarEntry_private_offset = g_type_add_instance_private (tags_sidebar_entry_type_id, sizeof (TagsSidebarEntryPrivate));
	return tags_sidebar_entry_type_id;
}

GType
tags_sidebar_entry_get_type (void)
{
	static volatile gsize tags_sidebar_entry_type_id__once = 0;
	if (g_once_init_enter (&tags_sidebar_entry_type_id__once)) {
		GType tags_sidebar_entry_type_id;
		tags_sidebar_entry_type_id = tags_sidebar_entry_get_type_once ();
		g_once_init_leave (&tags_sidebar_entry_type_id__once, tags_sidebar_entry_type_id);
	}
	return tags_sidebar_entry_type_id__once;
}

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

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

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

