/* LibraryWindow.c generated by valac 0.56.19, the Vala compiler
 * generated from LibraryWindow.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 <gtk/gtk.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <gdk/gdk.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <gphoto2/gphoto2-camera.h>
#include <shotwell-gphoto-helper.h>
#include <float.h>
#include <math.h>
#include <cairo-gobject.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

#define LIBRARY_WINDOW_SIDEBAR_MIN_WIDTH 120
#define LIBRARY_WINDOW_EXTENDED_INFO_MIN_WIDTH 360
#define LIBRARY_WINDOW_SORT_EVENTS_ORDER_ASCENDING "ascending"
#define LIBRARY_WINDOW_SORT_EVENTS_ORDER_DESCENDING "descending"
#define LIBRARY_WINDOW_MIN_PROGRESS_BAR_FILES 1
#define LIBRARY_WINDOW_TAG_PATH_MIME_TYPE "shotwell/tag-path"
#define LIBRARY_WINDOW_MEDIA_LIST_MIME_TYPE "shotwell/media-id-atom"
#define RESOURCES_APP_LIBRARY_ROLE _ ("Photo Manager")
#define RESOURCES_OK_LABEL _ ("_OK")
#define RESOURCES_CANCEL_LABEL _ ("_Cancel")
#define CHECKERBOARD_LAYOUT_COLUMN_GUTTER_PADDING 24
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_PAGE_WINDOW (page_window_get_type ())
#define PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_WINDOW, PageWindow))
#define PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_WINDOW, PageWindowClass))
#define IS_PAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_WINDOW))
#define IS_PAGE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_WINDOW))
#define PAGE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_WINDOW, PageWindowClass))

typedef struct _PageWindow PageWindow;
typedef struct _PageWindowClass PageWindowClass;
typedef struct _PageWindowPrivate PageWindowPrivate;

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

typedef struct _Page Page;
typedef struct _PageClass PageClass;

#define TYPE_APP_WINDOW (app_window_get_type ())
#define APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APP_WINDOW, AppWindow))
#define APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APP_WINDOW, AppWindowClass))
#define IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APP_WINDOW))
#define IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APP_WINDOW))
#define APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APP_WINDOW, AppWindowClass))

typedef struct _AppWindow AppWindow;
typedef struct _AppWindowClass AppWindowClass;
typedef struct _AppWindowPrivate AppWindowPrivate;

#define TYPE_DIMENSIONS (dimensions_get_type ())
typedef struct _Dimensions Dimensions;

#define TYPE_LIBRARY_WINDOW (library_window_get_type ())
#define LIBRARY_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_WINDOW, LibraryWindow))
#define LIBRARY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_WINDOW, LibraryWindowClass))
#define IS_LIBRARY_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_WINDOW))
#define IS_LIBRARY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_WINDOW))
#define LIBRARY_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_WINDOW, LibraryWindowClass))

typedef struct _LibraryWindow LibraryWindow;
typedef struct _LibraryWindowClass LibraryWindowClass;
typedef struct _LibraryWindowPrivate LibraryWindowPrivate;

#define TYPE_ONE_SHOT_SCHEDULER (one_shot_scheduler_get_type ())
#define ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotScheduler))
#define ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass))
#define IS_ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ONE_SHOT_SCHEDULER))
#define IS_ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ONE_SHOT_SCHEDULER))
#define ONE_SHOT_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass))

typedef struct _OneShotScheduler OneShotScheduler;
typedef struct _OneShotSchedulerClass OneShotSchedulerClass;

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

typedef struct _SidebarTree SidebarTree;
typedef struct _SidebarTreeClass SidebarTreeClass;

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

#define LIBRARY_TYPE_BRANCH (library_branch_get_type ())
#define LIBRARY_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBRARY_TYPE_BRANCH, LibraryBranch))
#define LIBRARY_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIBRARY_TYPE_BRANCH, LibraryBranchClass))
#define LIBRARY_IS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBRARY_TYPE_BRANCH))
#define LIBRARY_IS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBRARY_TYPE_BRANCH))
#define LIBRARY_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIBRARY_TYPE_BRANCH, LibraryBranchClass))

typedef struct _LibraryBranch LibraryBranch;
typedef struct _LibraryBranchClass LibraryBranchClass;

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

#define FOLDERS_TYPE_BRANCH (folders_branch_get_type ())
#define FOLDERS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOLDERS_TYPE_BRANCH, FoldersBranch))
#define FOLDERS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FOLDERS_TYPE_BRANCH, FoldersBranchClass))
#define FOLDERS_IS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOLDERS_TYPE_BRANCH))
#define FOLDERS_IS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FOLDERS_TYPE_BRANCH))
#define FOLDERS_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FOLDERS_TYPE_BRANCH, FoldersBranchClass))

typedef struct _FoldersBranch FoldersBranch;
typedef struct _FoldersBranchClass FoldersBranchClass;

#define FACES_TYPE_BRANCH (faces_branch_get_type ())
#define FACES_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FACES_TYPE_BRANCH, FacesBranch))
#define FACES_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FACES_TYPE_BRANCH, FacesBranchClass))
#define FACES_IS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FACES_TYPE_BRANCH))
#define FACES_IS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FACES_TYPE_BRANCH))
#define FACES_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FACES_TYPE_BRANCH, FacesBranchClass))

typedef struct _FacesBranch FacesBranch;
typedef struct _FacesBranchClass FacesBranchClass;

#define EVENTS_TYPE_BRANCH (events_branch_get_type ())
#define EVENTS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVENTS_TYPE_BRANCH, EventsBranch))
#define EVENTS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVENTS_TYPE_BRANCH, EventsBranchClass))
#define EVENTS_IS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVENTS_TYPE_BRANCH))
#define EVENTS_IS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EVENTS_TYPE_BRANCH))
#define EVENTS_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EVENTS_TYPE_BRANCH, EventsBranchClass))

typedef struct _EventsBranch EventsBranch;
typedef struct _EventsBranchClass EventsBranchClass;

#define CAMERA_TYPE_BRANCH (camera_branch_get_type ())
#define CAMERA_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAMERA_TYPE_BRANCH, CameraBranch))
#define CAMERA_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CAMERA_TYPE_BRANCH, CameraBranchClass))
#define CAMERA_IS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAMERA_TYPE_BRANCH))
#define CAMERA_IS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CAMERA_TYPE_BRANCH))
#define CAMERA_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CAMERA_TYPE_BRANCH, CameraBranchClass))

typedef struct _CameraBranch CameraBranch;
typedef struct _CameraBranchClass CameraBranchClass;

#define SEARCHES_TYPE_BRANCH (searches_branch_get_type ())
#define SEARCHES_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEARCHES_TYPE_BRANCH, SearchesBranch))
#define SEARCHES_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEARCHES_TYPE_BRANCH, SearchesBranchClass))
#define SEARCHES_IS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEARCHES_TYPE_BRANCH))
#define SEARCHES_IS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEARCHES_TYPE_BRANCH))
#define SEARCHES_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEARCHES_TYPE_BRANCH, SearchesBranchClass))

typedef struct _SearchesBranch SearchesBranch;
typedef struct _SearchesBranchClass SearchesBranchClass;

#define IMPORT_ROLL_TYPE_BRANCH (import_roll_branch_get_type ())
#define IMPORT_ROLL_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IMPORT_ROLL_TYPE_BRANCH, ImportRollBranch))
#define IMPORT_ROLL_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IMPORT_ROLL_TYPE_BRANCH, ImportRollBranchClass))
#define IMPORT_ROLL_IS_BRANCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IMPORT_ROLL_TYPE_BRANCH))
#define IMPORT_ROLL_IS_BRANCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IMPORT_ROLL_TYPE_BRANCH))
#define IMPORT_ROLL_BRANCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IMPORT_ROLL_TYPE_BRANCH, ImportRollBranchClass))

typedef struct _ImportRollBranch ImportRollBranch;
typedef struct _ImportRollBranchClass ImportRollBranchClass;

#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 TYPE_SINGLE_PHOTO_PAGE (single_photo_page_get_type ())
#define SINGLE_PHOTO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage))
#define SINGLE_PHOTO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPageClass))
#define IS_SINGLE_PHOTO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SINGLE_PHOTO_PAGE))
#define IS_SINGLE_PHOTO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SINGLE_PHOTO_PAGE))
#define SINGLE_PHOTO_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPageClass))

typedef struct _SinglePhotoPage SinglePhotoPage;
typedef struct _SinglePhotoPageClass SinglePhotoPageClass;

#define TYPE_EDITING_HOST_PAGE (editing_host_page_get_type ())
#define EDITING_HOST_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EDITING_HOST_PAGE, EditingHostPage))
#define EDITING_HOST_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EDITING_HOST_PAGE, EditingHostPageClass))
#define IS_EDITING_HOST_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EDITING_HOST_PAGE))
#define IS_EDITING_HOST_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EDITING_HOST_PAGE))
#define EDITING_HOST_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EDITING_HOST_PAGE, EditingHostPageClass))

typedef struct _EditingHostPage EditingHostPage;
typedef struct _EditingHostPageClass EditingHostPageClass;

#define TYPE_LIBRARY_PHOTO_PAGE (library_photo_page_get_type ())
#define LIBRARY_PHOTO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO_PAGE, LibraryPhotoPage))
#define LIBRARY_PHOTO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO_PAGE, LibraryPhotoPageClass))
#define IS_LIBRARY_PHOTO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO_PAGE))
#define IS_LIBRARY_PHOTO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO_PAGE))
#define LIBRARY_PHOTO_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO_PAGE, LibraryPhotoPageClass))

typedef struct _LibraryPhotoPage LibraryPhotoPage;
typedef struct _LibraryPhotoPageClass LibraryPhotoPageClass;

#define TYPE_SEARCH_FILTER_ACTIONS (search_filter_actions_get_type ())
#define SEARCH_FILTER_ACTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEARCH_FILTER_ACTIONS, SearchFilterActions))
#define SEARCH_FILTER_ACTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEARCH_FILTER_ACTIONS, SearchFilterActionsClass))
#define IS_SEARCH_FILTER_ACTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEARCH_FILTER_ACTIONS))
#define IS_SEARCH_FILTER_ACTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEARCH_FILTER_ACTIONS))
#define SEARCH_FILTER_ACTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEARCH_FILTER_ACTIONS, SearchFilterActionsClass))

typedef struct _SearchFilterActions SearchFilterActions;
typedef struct _SearchFilterActionsClass SearchFilterActionsClass;

#define TYPE_SEARCH_FILTER_TOOLBAR (search_filter_toolbar_get_type ())
#define SEARCH_FILTER_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEARCH_FILTER_TOOLBAR, SearchFilterToolbar))
#define SEARCH_FILTER_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEARCH_FILTER_TOOLBAR, SearchFilterToolbarClass))
#define IS_SEARCH_FILTER_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEARCH_FILTER_TOOLBAR))
#define IS_SEARCH_FILTER_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEARCH_FILTER_TOOLBAR))
#define SEARCH_FILTER_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEARCH_FILTER_TOOLBAR, SearchFilterToolbarClass))

typedef struct _SearchFilterToolbar SearchFilterToolbar;
typedef struct _SearchFilterToolbarClass SearchFilterToolbarClass;

#define TYPE_BACKGROUND_PROGRESS_BAR (background_progress_bar_get_type ())
#define BACKGROUND_PROGRESS_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKGROUND_PROGRESS_BAR, BackgroundProgressBar))
#define BACKGROUND_PROGRESS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKGROUND_PROGRESS_BAR, BackgroundProgressBarClass))
#define IS_BACKGROUND_PROGRESS_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKGROUND_PROGRESS_BAR))
#define IS_BACKGROUND_PROGRESS_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKGROUND_PROGRESS_BAR))
#define BACKGROUND_PROGRESS_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKGROUND_PROGRESS_BAR, BackgroundProgressBarClass))

typedef struct _BackgroundProgressBar BackgroundProgressBar;
typedef struct _BackgroundProgressBarClass BackgroundProgressBarClass;

#define TYPE_PROPERTIES (properties_get_type ())
#define PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROPERTIES, Properties))
#define PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROPERTIES, PropertiesClass))
#define IS_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROPERTIES))
#define IS_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROPERTIES))
#define PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROPERTIES, PropertiesClass))

typedef struct _Properties Properties;
typedef struct _PropertiesClass PropertiesClass;

#define TYPE_BASIC_PROPERTIES (basic_properties_get_type ())
#define BASIC_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BASIC_PROPERTIES, BasicProperties))
#define BASIC_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BASIC_PROPERTIES, BasicPropertiesClass))
#define IS_BASIC_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BASIC_PROPERTIES))
#define IS_BASIC_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BASIC_PROPERTIES))
#define BASIC_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BASIC_PROPERTIES, BasicPropertiesClass))

typedef struct _BasicProperties BasicProperties;
typedef struct _BasicPropertiesClass BasicPropertiesClass;

#define TYPE_EXTENDED_PROPERTIES (extended_properties_get_type ())
#define EXTENDED_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EXTENDED_PROPERTIES, ExtendedProperties))
#define EXTENDED_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EXTENDED_PROPERTIES, ExtendedPropertiesClass))
#define IS_EXTENDED_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EXTENDED_PROPERTIES))
#define IS_EXTENDED_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EXTENDED_PROPERTIES))
#define EXTENDED_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EXTENDED_PROPERTIES, ExtendedPropertiesClass))

typedef struct _ExtendedProperties ExtendedProperties;
typedef struct _ExtendedPropertiesClass ExtendedPropertiesClass;
enum  {
	LIBRARY_WINDOW_0_PROPERTY,
	LIBRARY_WINDOW_NUM_PROPERTIES
};
static GParamSpec* library_window_properties[LIBRARY_WINDOW_NUM_PROPERTIES];

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

#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_MEDIA_SOURCE_COLLECTION (media_source_collection_get_type ())
#define MEDIA_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection))
#define MEDIA_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollectionClass))
#define IS_MEDIA_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE_COLLECTION))
#define IS_MEDIA_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE_COLLECTION))
#define MEDIA_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollectionClass))

typedef struct _MediaSourceCollection MediaSourceCollection;
typedef struct _MediaSourceCollectionClass MediaSourceCollectionClass;

#define TYPE_MEDIA_COLLECTION_REGISTRY (media_collection_registry_get_type ())
#define MEDIA_COLLECTION_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_COLLECTION_REGISTRY, MediaCollectionRegistry))
#define MEDIA_COLLECTION_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_COLLECTION_REGISTRY, MediaCollectionRegistryClass))
#define IS_MEDIA_COLLECTION_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_COLLECTION_REGISTRY))
#define IS_MEDIA_COLLECTION_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_COLLECTION_REGISTRY))
#define MEDIA_COLLECTION_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_COLLECTION_REGISTRY, MediaCollectionRegistryClass))

typedef struct _MediaCollectionRegistry MediaCollectionRegistry;
typedef struct _MediaCollectionRegistryClass MediaCollectionRegistryClass;
#define _media_collection_registry_unref0(var) ((var == NULL) ? NULL : (var = (media_collection_registry_unref (var), NULL)))

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

#define TYPE_METADATA_WRITER (metadata_writer_get_type ())
#define METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_WRITER, MetadataWriter))
#define METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_WRITER, MetadataWriterClass))
#define IS_METADATA_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_WRITER))
#define IS_METADATA_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_WRITER))
#define METADATA_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_WRITER, MetadataWriterClass))

typedef struct _MetadataWriter MetadataWriter;
typedef struct _MetadataWriterClass MetadataWriterClass;

#define TYPE_DIRECTORY_MONITOR (directory_monitor_get_type ())
#define DIRECTORY_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DIRECTORY_MONITOR, DirectoryMonitor))
#define DIRECTORY_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DIRECTORY_MONITOR, DirectoryMonitorClass))
#define IS_DIRECTORY_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DIRECTORY_MONITOR))
#define IS_DIRECTORY_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DIRECTORY_MONITOR))
#define DIRECTORY_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DIRECTORY_MONITOR, DirectoryMonitorClass))

typedef struct _DirectoryMonitor DirectoryMonitor;
typedef struct _DirectoryMonitorClass DirectoryMonitorClass;

#define TYPE_LIBRARY_MONITOR (library_monitor_get_type ())
#define LIBRARY_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_MONITOR, LibraryMonitor))
#define LIBRARY_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_MONITOR, LibraryMonitorClass))
#define IS_LIBRARY_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_MONITOR))
#define IS_LIBRARY_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_MONITOR))
#define LIBRARY_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_MONITOR, LibraryMonitorClass))

typedef struct _LibraryMonitor LibraryMonitor;
typedef struct _LibraryMonitorClass LibraryMonitorClass;

#define TYPE_LIBRARY_MONITOR_POOL (library_monitor_pool_get_type ())
#define LIBRARY_MONITOR_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_MONITOR_POOL, LibraryMonitorPool))
#define LIBRARY_MONITOR_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_MONITOR_POOL, LibraryMonitorPoolClass))
#define IS_LIBRARY_MONITOR_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_MONITOR_POOL))
#define IS_LIBRARY_MONITOR_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_MONITOR_POOL))
#define LIBRARY_MONITOR_POOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_MONITOR_POOL, LibraryMonitorPoolClass))

typedef struct _LibraryMonitorPool LibraryMonitorPool;
typedef struct _LibraryMonitorPoolClass LibraryMonitorPoolClass;
#define _library_monitor_pool_unref0(var) ((var == NULL) ? NULL : (var = (library_monitor_pool_unref (var), NULL)))

#define TYPE_CAMERA_TABLE (camera_table_get_type ())
#define CAMERA_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CAMERA_TABLE, CameraTable))
#define CAMERA_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CAMERA_TABLE, CameraTableClass))
#define IS_CAMERA_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CAMERA_TABLE))
#define IS_CAMERA_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CAMERA_TABLE))
#define CAMERA_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CAMERA_TABLE, CameraTableClass))

typedef struct _CameraTable CameraTable;
typedef struct _CameraTableClass CameraTableClass;

#define TYPE_DISCOVERED_CAMERA (discovered_camera_get_type ())
#define DISCOVERED_CAMERA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DISCOVERED_CAMERA, DiscoveredCamera))
#define DISCOVERED_CAMERA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DISCOVERED_CAMERA, DiscoveredCameraClass))
#define IS_DISCOVERED_CAMERA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DISCOVERED_CAMERA))
#define IS_DISCOVERED_CAMERA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DISCOVERED_CAMERA))
#define DISCOVERED_CAMERA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DISCOVERED_CAMERA, DiscoveredCameraClass))

typedef struct _DiscoveredCamera DiscoveredCamera;
typedef struct _DiscoveredCameraClass DiscoveredCameraClass;
#define _camera_table_unref0(var) ((var == NULL) ? NULL : (var = (camera_table_unref (var), NULL)))
typedef enum  {
	LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_LIBRARY,
	LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_CAMERAS,
	LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_SAVED_SEARCH,
	LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_EVENTS,
	LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_IMPORT_ROLL,
	LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_FOLDERS,
	LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_FACES,
	LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_TAGS
} LibraryWindowSidebarRootPosition;

#define LIBRARY_WINDOW_TYPE_SIDEBAR_ROOT_POSITION (library_window_sidebar_root_position_get_type ())
typedef enum  {
	LIBRARY_WINDOW_TARGET_TYPE_URI_LIST,
	LIBRARY_WINDOW_TARGET_TYPE_MEDIA_LIST,
	LIBRARY_WINDOW_TARGET_TYPE_TAG_PATH
} LibraryWindowTargetType;

#define LIBRARY_WINDOW_TYPE_TARGET_TYPE (library_window_target_type_get_type ())
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);
typedef void (*GSimpleActionChangeStateCallback) (GSimpleAction* action, GVariant* value, gpointer user_data);
#define _g_free0(var) (var = (g_free (var), NULL))
#define _one_shot_scheduler_unref0(var) ((var == NULL) ? NULL : (var = (one_shot_scheduler_unref (var), NULL)))
#define _search_filter_actions_unref0(var) ((var == NULL) ? NULL : (var = (search_filter_actions_unref (var), NULL)))
typedef gboolean (*ProgressMonitor) (guint64 current, guint64 total, gboolean do_event_loop, gpointer user_data);
typedef void (*SidebarTreeExternalDropHandler) (GdkDragContext* context, SidebarEntry* entry, GtkSelectionData* data, guint info, guint time, gpointer user_data);
typedef void (*OneShotCallback) (gpointer user_data);

#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 LIBRARY_TYPE_PHOTOS_ENTRY (library_photos_entry_get_type ())
#define LIBRARY_PHOTOS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBRARY_TYPE_PHOTOS_ENTRY, LibraryPhotosEntry))
#define LIBRARY_PHOTOS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIBRARY_TYPE_PHOTOS_ENTRY, LibraryPhotosEntryClass))
#define LIBRARY_IS_PHOTOS_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBRARY_TYPE_PHOTOS_ENTRY))
#define LIBRARY_IS_PHOTOS_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBRARY_TYPE_PHOTOS_ENTRY))
#define LIBRARY_PHOTOS_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIBRARY_TYPE_PHOTOS_ENTRY, LibraryPhotosEntryClass))

typedef struct _LibraryPhotosEntry LibraryPhotosEntry;
typedef struct _LibraryPhotosEntryClass LibraryPhotosEntryClass;

#define TYPE_CONFIGURATION_FACADE (configuration_facade_get_type ())
#define CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacade))
#define CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))
#define IS_CONFIGURATION_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CONFIGURATION_FACADE))
#define IS_CONFIGURATION_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CONFIGURATION_FACADE))
#define CONFIGURATION_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CONFIGURATION_FACADE, ConfigurationFacadeClass))

typedef struct _ConfigurationFacade ConfigurationFacade;
typedef struct _ConfigurationFacadeClass ConfigurationFacadeClass;

#define CONFIG_TYPE_FACADE (config_facade_get_type ())
#define CONFIG_FACADE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONFIG_TYPE_FACADE, ConfigFacade))
#define CONFIG_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONFIG_TYPE_FACADE, ConfigFacadeClass))
#define CONFIG_IS_FACADE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONFIG_TYPE_FACADE))
#define CONFIG_IS_FACADE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONFIG_TYPE_FACADE))
#define CONFIG_FACADE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONFIG_TYPE_FACADE, ConfigFacadeClass))

typedef struct _ConfigFacade ConfigFacade;
typedef struct _ConfigFacadeClass ConfigFacadeClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#define TYPE_VIEW_COLLECTION (view_collection_get_type ())
#define VIEW_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIEW_COLLECTION, ViewCollection))
#define VIEW_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIEW_COLLECTION, ViewCollectionClass))
#define IS_VIEW_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIEW_COLLECTION))
#define IS_VIEW_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIEW_COLLECTION))
#define VIEW_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIEW_COLLECTION, ViewCollectionClass))

typedef struct _ViewCollection ViewCollection;
typedef struct _ViewCollectionClass ViewCollectionClass;

#define TYPE_VIEW_FILTER (view_filter_get_type ())
#define VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIEW_FILTER, ViewFilter))
#define VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIEW_FILTER, ViewFilterClass))
#define IS_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIEW_FILTER))
#define IS_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIEW_FILTER))
#define VIEW_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIEW_FILTER, ViewFilterClass))

typedef struct _ViewFilter ViewFilter;
typedef struct _ViewFilterClass ViewFilterClass;

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

#define TYPE_EVENT_SOURCE (event_source_get_type ())
#define EVENT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EVENT_SOURCE, EventSource))
#define EVENT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EVENT_SOURCE, EventSourceClass))
#define IS_EVENT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EVENT_SOURCE))
#define IS_EVENT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EVENT_SOURCE))
#define EVENT_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EVENT_SOURCE, EventSourceClass))

typedef struct _EventSource EventSource;
typedef struct _EventSourceClass EventSourceClass;

#define TYPE_EVENT (event_get_type ())
#define EVENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EVENT, Event))
#define EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EVENT, EventClass))
#define IS_EVENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EVENT))
#define IS_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EVENT))
#define EVENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EVENT, EventClass))

typedef struct _Event Event;
typedef struct _EventClass EventClass;

#define EVENTS_TYPE_EVENT_ENTRY (events_event_entry_get_type ())
#define EVENTS_EVENT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVENTS_TYPE_EVENT_ENTRY, EventsEventEntry))
#define EVENTS_EVENT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVENTS_TYPE_EVENT_ENTRY, EventsEventEntryClass))
#define EVENTS_IS_EVENT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVENTS_TYPE_EVENT_ENTRY))
#define EVENTS_IS_EVENT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EVENTS_TYPE_EVENT_ENTRY))
#define EVENTS_EVENT_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EVENTS_TYPE_EVENT_ENTRY, EventsEventEntryClass))

typedef struct _EventsEventEntry EventsEventEntry;
typedef struct _EventsEventEntryClass EventsEventEntryClass;

#define TYPE_SAVED_SEARCH (saved_search_get_type ())
#define SAVED_SEARCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SAVED_SEARCH, SavedSearch))
#define SAVED_SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SAVED_SEARCH, SavedSearchClass))
#define IS_SAVED_SEARCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SAVED_SEARCH))
#define IS_SAVED_SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SAVED_SEARCH))
#define SAVED_SEARCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SAVED_SEARCH, SavedSearchClass))

typedef struct _SavedSearch SavedSearch;
typedef struct _SavedSearchClass SavedSearchClass;

#define SEARCHES_TYPE_SIDEBAR_ENTRY (searches_sidebar_entry_get_type ())
#define SEARCHES_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEARCHES_TYPE_SIDEBAR_ENTRY, SearchesSidebarEntry))
#define SEARCHES_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEARCHES_TYPE_SIDEBAR_ENTRY, SearchesSidebarEntryClass))
#define SEARCHES_IS_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEARCHES_TYPE_SIDEBAR_ENTRY))
#define SEARCHES_IS_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEARCHES_TYPE_SIDEBAR_ENTRY))
#define SEARCHES_SIDEBAR_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEARCHES_TYPE_SIDEBAR_ENTRY, SearchesSidebarEntryClass))

typedef struct _SearchesSidebarEntry SearchesSidebarEntry;
typedef struct _SearchesSidebarEntryClass SearchesSidebarEntryClass;

#define TYPE_FACE (face_get_type ())
#define FACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FACE, Face))
#define FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FACE, FaceClass))
#define IS_FACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FACE))
#define IS_FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FACE))
#define FACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FACE, FaceClass))

typedef struct _Face Face;
typedef struct _FaceClass FaceClass;

#define FACES_TYPE_SIDEBAR_ENTRY (faces_sidebar_entry_get_type ())
#define FACES_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FACES_TYPE_SIDEBAR_ENTRY, FacesSidebarEntry))
#define FACES_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), FACES_TYPE_SIDEBAR_ENTRY, FacesSidebarEntryClass))
#define FACES_IS_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FACES_TYPE_SIDEBAR_ENTRY))
#define FACES_IS_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), FACES_TYPE_SIDEBAR_ENTRY))
#define FACES_SIDEBAR_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), FACES_TYPE_SIDEBAR_ENTRY, FacesSidebarEntryClass))

typedef struct _FacesSidebarEntry FacesSidebarEntry;
typedef struct _FacesSidebarEntryClass FacesSidebarEntryClass;

#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_PHOTO_SOURCE (photo_source_get_type ())
#define PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_SOURCE, PhotoSource))
#define PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_SOURCE, PhotoSourceClass))
#define IS_PHOTO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_SOURCE))
#define IS_PHOTO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_SOURCE))
#define PHOTO_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_SOURCE, PhotoSourceClass))

typedef struct _PhotoSource PhotoSource;
typedef struct _PhotoSourceClass PhotoSourceClass;

#define TYPE_PHOTO (photo_get_type ())
#define PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO, Photo))
#define PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO, PhotoClass))
#define IS_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO))
#define IS_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO))
#define PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO, PhotoClass))

typedef struct _Photo Photo;
typedef struct _PhotoClass PhotoClass;

#define TYPE_LIBRARY_PHOTO (library_photo_get_type ())
#define LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO, LibraryPhoto))
#define LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))
#define IS_LIBRARY_PHOTO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO))
#define IS_LIBRARY_PHOTO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO))
#define LIBRARY_PHOTO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO, LibraryPhotoClass))

typedef struct _LibraryPhoto LibraryPhoto;
typedef struct _LibraryPhotoClass LibraryPhotoClass;

#define TYPE_EVENTS_DIRECTORY_PAGE (events_directory_page_get_type ())
#define EVENTS_DIRECTORY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EVENTS_DIRECTORY_PAGE, EventsDirectoryPage))
#define EVENTS_DIRECTORY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EVENTS_DIRECTORY_PAGE, EventsDirectoryPageClass))
#define IS_EVENTS_DIRECTORY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EVENTS_DIRECTORY_PAGE))
#define IS_EVENTS_DIRECTORY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EVENTS_DIRECTORY_PAGE))
#define EVENTS_DIRECTORY_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EVENTS_DIRECTORY_PAGE, EventsDirectoryPageClass))

typedef struct _EventsDirectoryPage EventsDirectoryPage;
typedef struct _EventsDirectoryPageClass EventsDirectoryPageClass;

#define TYPE_DATA_VIEW (data_view_get_type ())
#define DATA_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_VIEW, DataView))
#define DATA_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_VIEW, DataViewClass))
#define IS_DATA_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_VIEW))
#define IS_DATA_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_VIEW))
#define DATA_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_VIEW, DataViewClass))

typedef struct _DataView DataView;
typedef struct _DataViewClass DataViewClass;

#define TYPE_EVENT_PAGE (event_page_get_type ())
#define EVENT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EVENT_PAGE, EventPage))
#define EVENT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EVENT_PAGE, EventPageClass))
#define IS_EVENT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EVENT_PAGE))
#define IS_EVENT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EVENT_PAGE))
#define EVENT_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EVENT_PAGE, EventPageClass))

typedef struct _EventPage EventPage;
typedef struct _EventPageClass EventPageClass;

#define LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE (library_window_fullscreen_photo_page_get_type ())
#define LIBRARY_WINDOW_FULLSCREEN_PHOTO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE, LibraryWindowFullscreenPhotoPage))
#define LIBRARY_WINDOW_FULLSCREEN_PHOTO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE, LibraryWindowFullscreenPhotoPageClass))
#define LIBRARY_WINDOW_IS_FULLSCREEN_PHOTO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE))
#define LIBRARY_WINDOW_IS_FULLSCREEN_PHOTO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE))
#define LIBRARY_WINDOW_FULLSCREEN_PHOTO_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE, LibraryWindowFullscreenPhotoPageClass))

typedef struct _LibraryWindowFullscreenPhotoPage LibraryWindowFullscreenPhotoPage;
typedef struct _LibraryWindowFullscreenPhotoPageClass LibraryWindowFullscreenPhotoPageClass;

#define DATA_IMPORTS_UI_TYPE_DATA_IMPORTS_DIALOG (data_imports_ui_data_imports_dialog_get_type ())
#define DATA_IMPORTS_UI_DATA_IMPORTS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DATA_IMPORTS_UI_TYPE_DATA_IMPORTS_DIALOG, DataImportsUIDataImportsDialog))
#define DATA_IMPORTS_UI_DATA_IMPORTS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DATA_IMPORTS_UI_TYPE_DATA_IMPORTS_DIALOG, DataImportsUIDataImportsDialogClass))
#define DATA_IMPORTS_UI_IS_DATA_IMPORTS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DATA_IMPORTS_UI_TYPE_DATA_IMPORTS_DIALOG))
#define DATA_IMPORTS_UI_IS_DATA_IMPORTS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DATA_IMPORTS_UI_TYPE_DATA_IMPORTS_DIALOG))
#define DATA_IMPORTS_UI_DATA_IMPORTS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DATA_IMPORTS_UI_TYPE_DATA_IMPORTS_DIALOG, DataImportsUIDataImportsDialogClass))

typedef struct _DataImportsUIDataImportsDialog DataImportsUIDataImportsDialog;
typedef struct _DataImportsUIDataImportsDialogClass DataImportsUIDataImportsDialogClass;

#define TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION (library_photo_source_collection_get_type ())
#define LIBRARY_PHOTO_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollection))
#define LIBRARY_PHOTO_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollectionClass))
#define IS_LIBRARY_PHOTO_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION))
#define IS_LIBRARY_PHOTO_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION))
#define LIBRARY_PHOTO_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIBRARY_PHOTO_SOURCE_COLLECTION, LibraryPhotoSourceCollectionClass))

typedef struct _LibraryPhotoSourceCollection LibraryPhotoSourceCollection;
typedef struct _LibraryPhotoSourceCollectionClass LibraryPhotoSourceCollectionClass;

#define TYPE_VIDEO_SOURCE_COLLECTION (video_source_collection_get_type ())
#define VIDEO_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO_SOURCE_COLLECTION, VideoSourceCollection))
#define VIDEO_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO_SOURCE_COLLECTION, VideoSourceCollectionClass))
#define IS_VIDEO_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO_SOURCE_COLLECTION))
#define IS_VIDEO_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO_SOURCE_COLLECTION))
#define VIDEO_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO_SOURCE_COLLECTION, VideoSourceCollectionClass))

typedef struct _VideoSourceCollection VideoSourceCollection;
typedef struct _VideoSourceCollectionClass VideoSourceCollectionClass;

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

#define TYPE_SAVED_SEARCH_DIALOG (saved_search_dialog_get_type ())
#define SAVED_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SAVED_SEARCH_DIALOG, SavedSearchDialog))
#define SAVED_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SAVED_SEARCH_DIALOG, SavedSearchDialogClass))
#define IS_SAVED_SEARCH_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SAVED_SEARCH_DIALOG))
#define IS_SAVED_SEARCH_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SAVED_SEARCH_DIALOG))
#define SAVED_SEARCH_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SAVED_SEARCH_DIALOG, SavedSearchDialogClass))

typedef struct _SavedSearchDialog SavedSearchDialog;
typedef struct _SavedSearchDialogClass SavedSearchDialogClass;

#define TYPE_BATCH_IMPORT (batch_import_get_type ())
#define BATCH_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BATCH_IMPORT, BatchImport))
#define BATCH_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BATCH_IMPORT, BatchImportClass))
#define IS_BATCH_IMPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BATCH_IMPORT))
#define IS_BATCH_IMPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BATCH_IMPORT))
#define BATCH_IMPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BATCH_IMPORT, BatchImportClass))

typedef struct _BatchImport BatchImport;
typedef struct _BatchImportClass BatchImportClass;

#define LIBRARY_TYPE_HIDEABLE_PAGE_ENTRY (library_hideable_page_entry_get_type ())
#define LIBRARY_HIDEABLE_PAGE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBRARY_TYPE_HIDEABLE_PAGE_ENTRY, LibraryHideablePageEntry))
#define LIBRARY_HIDEABLE_PAGE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIBRARY_TYPE_HIDEABLE_PAGE_ENTRY, LibraryHideablePageEntryClass))
#define LIBRARY_IS_HIDEABLE_PAGE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBRARY_TYPE_HIDEABLE_PAGE_ENTRY))
#define LIBRARY_IS_HIDEABLE_PAGE_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBRARY_TYPE_HIDEABLE_PAGE_ENTRY))
#define LIBRARY_HIDEABLE_PAGE_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIBRARY_TYPE_HIDEABLE_PAGE_ENTRY, LibraryHideablePageEntryClass))

typedef struct _LibraryHideablePageEntry LibraryHideablePageEntry;
typedef struct _LibraryHideablePageEntryClass LibraryHideablePageEntryClass;

#define LIBRARY_TYPE_IMPORT_QUEUE_SIDEBAR_ENTRY (library_import_queue_sidebar_entry_get_type ())
#define LIBRARY_IMPORT_QUEUE_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBRARY_TYPE_IMPORT_QUEUE_SIDEBAR_ENTRY, LibraryImportQueueSidebarEntry))
#define LIBRARY_IMPORT_QUEUE_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIBRARY_TYPE_IMPORT_QUEUE_SIDEBAR_ENTRY, LibraryImportQueueSidebarEntryClass))
#define LIBRARY_IS_IMPORT_QUEUE_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBRARY_TYPE_IMPORT_QUEUE_SIDEBAR_ENTRY))
#define LIBRARY_IS_IMPORT_QUEUE_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBRARY_TYPE_IMPORT_QUEUE_SIDEBAR_ENTRY))
#define LIBRARY_IMPORT_QUEUE_SIDEBAR_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIBRARY_TYPE_IMPORT_QUEUE_SIDEBAR_ENTRY, LibraryImportQueueSidebarEntryClass))

typedef struct _LibraryImportQueueSidebarEntry LibraryImportQueueSidebarEntry;
typedef struct _LibraryImportQueueSidebarEntryClass LibraryImportQueueSidebarEntryClass;

#define TYPE_IMPORT_MANIFEST (import_manifest_get_type ())
#define IMPORT_MANIFEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IMPORT_MANIFEST, ImportManifest))
#define IMPORT_MANIFEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMPORT_MANIFEST, ImportManifestClass))
#define IS_IMPORT_MANIFEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IMPORT_MANIFEST))
#define IS_IMPORT_MANIFEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IMPORT_MANIFEST))
#define IMPORT_MANIFEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IMPORT_MANIFEST, ImportManifestClass))

typedef struct _ImportManifest ImportManifest;
typedef struct _ImportManifestClass ImportManifestClass;

#define IMPORT_UI_TYPE_QUESTION_PARAMS (import_ui_question_params_get_type ())
#define IMPORT_UI_QUESTION_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IMPORT_UI_TYPE_QUESTION_PARAMS, ImportUIQuestionParams))
#define IMPORT_UI_QUESTION_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IMPORT_UI_TYPE_QUESTION_PARAMS, ImportUIQuestionParamsClass))
#define IMPORT_UI_IS_QUESTION_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IMPORT_UI_TYPE_QUESTION_PARAMS))
#define IMPORT_UI_IS_QUESTION_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IMPORT_UI_TYPE_QUESTION_PARAMS))
#define IMPORT_UI_QUESTION_PARAMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IMPORT_UI_TYPE_QUESTION_PARAMS, ImportUIQuestionParamsClass))

typedef struct _ImportUIQuestionParams ImportUIQuestionParams;
typedef struct _ImportUIQuestionParamsClass ImportUIQuestionParamsClass;

#define TYPE_BATCH_IMPORT_JOB (batch_import_job_get_type ())
#define BATCH_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BATCH_IMPORT_JOB, BatchImportJob))
#define BATCH_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BATCH_IMPORT_JOB, BatchImportJobClass))
#define IS_BATCH_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BATCH_IMPORT_JOB))
#define IS_BATCH_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BATCH_IMPORT_JOB))
#define BATCH_IMPORT_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BATCH_IMPORT_JOB, BatchImportJobClass))

typedef struct _BatchImportJob BatchImportJob;
typedef struct _BatchImportJobClass BatchImportJobClass;

#define TYPE_FILE_IMPORT_JOB (file_import_job_get_type ())
#define FILE_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FILE_IMPORT_JOB, FileImportJob))
#define FILE_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FILE_IMPORT_JOB, FileImportJobClass))
#define IS_FILE_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FILE_IMPORT_JOB))
#define IS_FILE_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FILE_IMPORT_JOB))
#define FILE_IMPORT_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FILE_IMPORT_JOB, FileImportJobClass))

typedef struct _FileImportJob FileImportJob;
typedef struct _FileImportJobClass FileImportJobClass;
#define _batch_import_job_unref0(var) ((var == NULL) ? NULL : (var = (batch_import_job_unref (var), NULL)))

#define TYPE_BATCH_IMPORT_ROLL (batch_import_roll_get_type ())
#define BATCH_IMPORT_ROLL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BATCH_IMPORT_ROLL, BatchImportRoll))
#define BATCH_IMPORT_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BATCH_IMPORT_ROLL, BatchImportRollClass))
#define IS_BATCH_IMPORT_ROLL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BATCH_IMPORT_ROLL))
#define IS_BATCH_IMPORT_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BATCH_IMPORT_ROLL))
#define BATCH_IMPORT_ROLL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BATCH_IMPORT_ROLL, BatchImportRollClass))

typedef struct _BatchImportRoll BatchImportRoll;
typedef struct _BatchImportRollClass BatchImportRollClass;
typedef void (*BatchImportImportReporter) (ImportManifest* manifest, BatchImportRoll* import_roll, gpointer user_data);

#define CAMERA_TYPE_SIDEBAR_ENTRY (camera_sidebar_entry_get_type ())
#define CAMERA_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAMERA_TYPE_SIDEBAR_ENTRY, CameraSidebarEntry))
#define CAMERA_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CAMERA_TYPE_SIDEBAR_ENTRY, CameraSidebarEntryClass))
#define CAMERA_IS_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAMERA_TYPE_SIDEBAR_ENTRY))
#define CAMERA_IS_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CAMERA_TYPE_SIDEBAR_ENTRY))
#define CAMERA_SIDEBAR_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CAMERA_TYPE_SIDEBAR_ENTRY, CameraSidebarEntryClass))

typedef struct _CameraSidebarEntry CameraSidebarEntry;
typedef struct _CameraSidebarEntryClass CameraSidebarEntryClass;

#define TYPE_IMPORT_PAGE (import_page_get_type ())
#define IMPORT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IMPORT_PAGE, ImportPage))
#define IMPORT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMPORT_PAGE, ImportPageClass))
#define IS_IMPORT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IMPORT_PAGE))
#define IS_IMPORT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IMPORT_PAGE))
#define IMPORT_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IMPORT_PAGE, ImportPageClass))

typedef struct _ImportPage ImportPage;
typedef struct _ImportPageClass ImportPageClass;
typedef struct _DiscoveredCameraPrivate DiscoveredCameraPrivate;
typedef enum  {
	BACKGROUND_PROGRESS_BAR_PRIORITY_NONE = 0,
	BACKGROUND_PROGRESS_BAR_PRIORITY_STARTUP_SCAN = 35,
	BACKGROUND_PROGRESS_BAR_PRIORITY_REALTIME_UPDATE = 40,
	BACKGROUND_PROGRESS_BAR_PRIORITY_REALTIME_IMPORT = 50,
	BACKGROUND_PROGRESS_BAR_PRIORITY_METADATA_WRITER = 30
} BackgroundProgressBarPriority;

#define BACKGROUND_PROGRESS_BAR_TYPE_PRIORITY (background_progress_bar_priority_get_type ())

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

typedef struct _SidebarExpandableEntry SidebarExpandableEntry;
typedef struct _SidebarExpandableEntryIface SidebarExpandableEntryIface;

#define TYPE_SEARCH_VIEW_FILTER (search_view_filter_get_type ())
#define SEARCH_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEARCH_VIEW_FILTER, SearchViewFilter))
#define SEARCH_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEARCH_VIEW_FILTER, SearchViewFilterClass))
#define IS_SEARCH_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEARCH_VIEW_FILTER))
#define IS_SEARCH_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEARCH_VIEW_FILTER))
#define SEARCH_VIEW_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEARCH_VIEW_FILTER, SearchViewFilterClass))

typedef struct _SearchViewFilter SearchViewFilter;
typedef struct _SearchViewFilterClass SearchViewFilterClass;
#define _view_filter_unref0(var) ((var == NULL) ? NULL : (var = (view_filter_unref (var), NULL)))

#define TYPE_DISABLED_VIEW_FILTER (disabled_view_filter_get_type ())
#define DISABLED_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DISABLED_VIEW_FILTER, DisabledViewFilter))
#define DISABLED_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DISABLED_VIEW_FILTER, DisabledViewFilterClass))
#define IS_DISABLED_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DISABLED_VIEW_FILTER))
#define IS_DISABLED_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DISABLED_VIEW_FILTER))
#define DISABLED_VIEW_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DISABLED_VIEW_FILTER, DisabledViewFilterClass))

typedef struct _DisabledViewFilter DisabledViewFilter;
typedef struct _DisabledViewFilterClass DisabledViewFilterClass;

#define LIBRARY_TYPE_LAST_IMPORT_SIDEBAR_ENTRY (library_last_import_sidebar_entry_get_type ())
#define LIBRARY_LAST_IMPORT_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBRARY_TYPE_LAST_IMPORT_SIDEBAR_ENTRY, LibraryLastImportSidebarEntry))
#define LIBRARY_LAST_IMPORT_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIBRARY_TYPE_LAST_IMPORT_SIDEBAR_ENTRY, LibraryLastImportSidebarEntryClass))
#define LIBRARY_IS_LAST_IMPORT_SIDEBAR_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBRARY_TYPE_LAST_IMPORT_SIDEBAR_ENTRY))
#define LIBRARY_IS_LAST_IMPORT_SIDEBAR_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBRARY_TYPE_LAST_IMPORT_SIDEBAR_ENTRY))
#define LIBRARY_LAST_IMPORT_SIDEBAR_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIBRARY_TYPE_LAST_IMPORT_SIDEBAR_ENTRY, LibraryLastImportSidebarEntryClass))

typedef struct _LibraryLastImportSidebarEntry LibraryLastImportSidebarEntry;
typedef struct _LibraryLastImportSidebarEntryClass LibraryLastImportSidebarEntryClass;

#define EVENTS_TYPE_DIRECTORY_ENTRY (events_directory_entry_get_type ())
#define EVENTS_DIRECTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVENTS_TYPE_DIRECTORY_ENTRY, EventsDirectoryEntry))
#define EVENTS_DIRECTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVENTS_TYPE_DIRECTORY_ENTRY, EventsDirectoryEntryClass))
#define EVENTS_IS_DIRECTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVENTS_TYPE_DIRECTORY_ENTRY))
#define EVENTS_IS_DIRECTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EVENTS_TYPE_DIRECTORY_ENTRY))
#define EVENTS_DIRECTORY_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EVENTS_TYPE_DIRECTORY_ENTRY, EventsDirectoryEntryClass))

typedef struct _EventsDirectoryEntry EventsDirectoryEntry;
typedef struct _EventsDirectoryEntryClass EventsDirectoryEntryClass;

#define EVENTS_TYPE_MASTER_DIRECTORY_ENTRY (events_master_directory_entry_get_type ())
#define EVENTS_MASTER_DIRECTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVENTS_TYPE_MASTER_DIRECTORY_ENTRY, EventsMasterDirectoryEntry))
#define EVENTS_MASTER_DIRECTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVENTS_TYPE_MASTER_DIRECTORY_ENTRY, EventsMasterDirectoryEntryClass))
#define EVENTS_IS_MASTER_DIRECTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVENTS_TYPE_MASTER_DIRECTORY_ENTRY))
#define EVENTS_IS_MASTER_DIRECTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EVENTS_TYPE_MASTER_DIRECTORY_ENTRY))
#define EVENTS_MASTER_DIRECTORY_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EVENTS_TYPE_MASTER_DIRECTORY_ENTRY, EventsMasterDirectoryEntryClass))

typedef struct _EventsMasterDirectoryEntry EventsMasterDirectoryEntry;
typedef struct _EventsMasterDirectoryEntryClass EventsMasterDirectoryEntryClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _PagePrivate PagePrivate;

#define TYPE_FULLSCREEN_WINDOW (fullscreen_window_get_type ())
#define FULLSCREEN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FULLSCREEN_WINDOW, FullscreenWindow))
#define FULLSCREEN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FULLSCREEN_WINDOW, FullscreenWindowClass))
#define IS_FULLSCREEN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FULLSCREEN_WINDOW))
#define IS_FULLSCREEN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FULLSCREEN_WINDOW))
#define FULLSCREEN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FULLSCREEN_WINDOW, FullscreenWindowClass))

typedef struct _FullscreenWindow FullscreenWindow;
typedef struct _FullscreenWindowClass FullscreenWindowClass;

#define TYPE_INJECTION_GROUP (injection_group_get_type ())
#define INJECTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_INJECTION_GROUP, InjectionGroup))
#define INJECTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_INJECTION_GROUP, InjectionGroupClass))
#define IS_INJECTION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_INJECTION_GROUP))
#define IS_INJECTION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_INJECTION_GROUP))
#define INJECTION_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_INJECTION_GROUP, InjectionGroupClass))

typedef struct _InjectionGroup InjectionGroup;
typedef struct _InjectionGroupClass InjectionGroupClass;
typedef struct _SinglePhotoPagePrivate SinglePhotoPagePrivate;

#define TYPE_ZOOM_BUFFER (zoom_buffer_get_type ())
#define ZOOM_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ZOOM_BUFFER, ZoomBuffer))
#define ZOOM_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ZOOM_BUFFER, ZoomBufferClass))
#define IS_ZOOM_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ZOOM_BUFFER))
#define IS_ZOOM_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ZOOM_BUFFER))
#define ZOOM_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ZOOM_BUFFER, ZoomBufferClass))

typedef struct _ZoomBuffer ZoomBuffer;
typedef struct _ZoomBufferClass ZoomBufferClass;
typedef enum  {
	SINGLE_PHOTO_PAGE_UPDATE_REASON_NEW_PIXBUF,
	SINGLE_PHOTO_PAGE_UPDATE_REASON_QUALITY_IMPROVEMENT,
	SINGLE_PHOTO_PAGE_UPDATE_REASON_RESIZED_CANVAS
} SinglePhotoPageUpdateReason;

#define SINGLE_PHOTO_PAGE_TYPE_UPDATE_REASON (single_photo_page_update_reason_get_type ())
typedef struct _EditingHostPagePrivate EditingHostPagePrivate;
typedef struct _LibraryPhotoPagePrivate LibraryPhotoPagePrivate;
typedef enum  {
	RAW_DEVELOPER_SHOTWELL = 0,
	RAW_DEVELOPER_CAMERA,
	RAW_DEVELOPER_EMBEDDED
} RawDeveloper;

#define TYPE_RAW_DEVELOPER (raw_developer_get_type ())
typedef struct _LibraryWindowFullscreenPhotoPagePrivate LibraryWindowFullscreenPhotoPagePrivate;
enum  {
	LIBRARY_WINDOW_FULLSCREEN_PHOTO_PAGE_0_PROPERTY,
	LIBRARY_WINDOW_FULLSCREEN_PHOTO_PAGE_NUM_PROPERTIES
};
static GParamSpec* library_window_fullscreen_photo_page_properties[LIBRARY_WINDOW_FULLSCREEN_PHOTO_PAGE_NUM_PROPERTIES];
#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 _PageWindow {
	GtkApplicationWindow parent_instance;
	PageWindowPrivate * priv;
};

struct _PageWindowClass {
	GtkApplicationWindowClass parent_class;
	void (*switched_pages) (PageWindow* self, Page* old_page, Page* new_page);
	void (*set_current_page) (PageWindow* self, Page* page);
	void (*clear_current_page) (PageWindow* self);
};

struct _Dimensions {
	gint width;
	gint height;
};

struct _AppWindow {
	PageWindow parent_instance;
	AppWindowPrivate * priv;
	gboolean maximized;
	Dimensions dimensions;
};

struct _AppWindowClass {
	PageWindowClass parent_class;
	void (*on_fullscreen) (AppWindow* self);
	gchar* (*get_app_role) (AppWindow* self);
	void (*on_quit) (AppWindow* self);
	void (*add_actions) (AppWindow* self);
	void (*update_common_action_availability) (AppWindow* self, Page* old_page, Page* new_page);
	void (*update_common_actions) (AppWindow* self, Page* page, gint selected_count, gint count);
};

struct _LibraryWindow {
	AppWindow parent_instance;
	LibraryWindowPrivate * priv;
};

struct _LibraryWindowClass {
	AppWindowClass parent_class;
};

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 _LibraryWindowPrivate {
	gchar* import_dir;
	gboolean import_recursive;
	GtkPaned* sidebar_paned;
	GtkPaned* client_paned;
	GtkFrame* bottom_frame;
	OneShotScheduler* properties_scheduler;
	gboolean notify_library_is_home_dir;
	SidebarTree* sidebar_tree;
	LibraryBranch* library_branch;
	TagsBranch* tags_branch;
	FoldersBranch* folders_branch;
	FacesBranch* faces_branch;
	EventsBranch* events_branch;
	CameraBranch* camera_branch;
	SearchesBranch* saved_search_branch;
	ImportRollBranch* import_roll_branch;
	gboolean page_switching_enabled;
	GeeHashMap* page_map;
	LibraryPhotoPage* photo_page;
	gboolean is_search_toolbar_visible;
	SearchFilterActions* search_actions;
	SearchFilterToolbar* search_toolbar;
	GtkBox* top_section;
	GtkRevealer* background_progress_frame;
	BackgroundProgressBar* background_progress_bar;
	BasicProperties* basic_properties;
	ExtendedProperties* extended_properties;
	GtkRevealer* extended_properties_revealer;
	GtkStack* stack;
	GtkBox* layout;
	GtkBox* right_vbox;
	GtkRevealer* toolbar_revealer;
};

struct _SidebarSelectableEntryIface {
	GTypeInterface parent_iface;
};

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

struct _DiscoveredCamera {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DiscoveredCameraPrivate * priv;
	Camera* gcamera;
	gchar* uri;
	gchar* display_name;
	gchar* icon;
};

struct _DiscoveredCameraClass {
	GTypeClass parent_class;
	void (*finalize) (DiscoveredCamera *self);
};

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

struct _Page {
	GtkScrolledWindow parent_instance;
	PagePrivate * priv;
	GtkBuilder* builder;
	GtkToolbar* toolbar;
	gboolean in_view;
	gdouble wheel_factor;
	gdouble modified_wheel_factor;
};

struct _PageClass {
	GtkScrolledWindowClass parent_class;
	void (*set_page_name) (Page* self, const gchar* page_name);
	void (*set_container) (Page* self, GtkWindow* container);
	void (*clear_container) (Page* self);
	GtkToolbar* (*get_toolbar) (Page* self);
	GtkMenu* (*get_page_context_menu) (Page* self);
	void (*switching_from) (Page* self);
	void (*switched_to) (Page* self);
	void (*ready) (Page* self);
	void (*switching_to_fullscreen) (Page* self, FullscreenWindow* fsw);
	void (*returning_from_fullscreen) (Page* self, FullscreenWindow* fsw);
	void (*add_actions) (Page* self, GActionMap* map);
	void (*remove_actions) (Page* self, GActionMap* map);
	void (*init_collect_ui_filenames) (Page* self, GeeList* ui_filenames);
	InjectionGroup** (*init_collect_injection_groups) (Page* self, gint* result_length1);
	void (*init_actions) (Page* self, gint selected_count, gint count);
	void (*update_actions) (Page* self, gint selected_count, gint count);
	gboolean (*on_left_click) (Page* self, GdkEventButton* event);
	gboolean (*on_middle_click) (Page* self, GdkEventButton* event);
	gboolean (*on_right_click) (Page* self, GdkEventButton* event);
	gboolean (*on_left_released) (Page* self, GdkEventButton* event);
	gboolean (*on_middle_released) (Page* self, GdkEventButton* event);
	gboolean (*on_right_released) (Page* self, GdkEventButton* event);
	gboolean (*on_ctrl_pressed) (Page* self, GdkEventKey* event);
	gboolean (*on_ctrl_released) (Page* self, GdkEventKey* event);
	gboolean (*on_alt_pressed) (Page* self, GdkEventKey* event);
	gboolean (*on_alt_released) (Page* self, GdkEventKey* event);
	gboolean (*on_shift_pressed) (Page* self, GdkEventKey* event);
	gboolean (*on_shift_released) (Page* self, GdkEventKey* event);
	gboolean (*on_super_pressed) (Page* self, GdkEventKey* event);
	gboolean (*on_super_released) (Page* self, GdkEventKey* event);
	gboolean (*on_app_key_pressed) (Page* self, GdkEventKey* event);
	gboolean (*on_app_key_released) (Page* self, GdkEventKey* event);
	void (*on_move) (Page* self, GdkRectangle* rect);
	void (*on_move_start) (Page* self, GdkRectangle* rect);
	void (*on_move_finished) (Page* self, GdkRectangle* rect);
	void (*on_resize) (Page* self, GdkRectangle* rect);
	void (*on_resize_start) (Page* self, GdkRectangle* rect);
	void (*on_resize_finished) (Page* self, GdkRectangle* rect);
	gboolean (*on_configure) (Page* self, GdkEventConfigure* event, GdkRectangle* rect);
	gboolean (*on_motion) (Page* self, GdkEventMotion* event, gint x, gint y, GdkModifierType mask);
	gboolean (*on_leave_notify_event) (Page* self);
	gboolean (*on_mousewheel_up) (Page* self, GdkEventScroll* event);
	gboolean (*on_mousewheel_down) (Page* self, GdkEventScroll* event);
	gboolean (*on_mousewheel_left) (Page* self, GdkEventScroll* event);
	gboolean (*on_mousewheel_right) (Page* self, GdkEventScroll* event);
	gboolean (*on_context_keypress) (Page* self);
	gboolean (*on_context_buttonpress) (Page* self, GdkEventButton* event);
	gboolean (*on_context_invoked) (Page* self);
	void (*set_page_cursor) (Page* self, GdkCursorType cursor_type);
};

struct _SinglePhotoPage {
	Page parent_instance;
	SinglePhotoPagePrivate * priv;
	GtkDrawingArea* canvas;
	GtkViewport* viewport;
};

struct _SinglePhotoPageClass {
	PageClass parent_class;
	gboolean (*is_zoom_supported) (SinglePhotoPage* self);
	void (*cancel_zoom) (SinglePhotoPage* self);
	void (*save_zoom_state) (SinglePhotoPage* self);
	void (*restore_zoom_state) (SinglePhotoPage* self);
	ZoomBuffer* (*get_zoom_buffer) (SinglePhotoPage* self);
	void (*new_surface) (SinglePhotoPage* self, cairo_t* ctx, Dimensions* ctx_dim);
	void (*updated_pixbuf) (SinglePhotoPage* self, GdkPixbuf* pixbuf, SinglePhotoPageUpdateReason reason, Dimensions* old_dim);
	void (*paint) (SinglePhotoPage* self, cairo_t* ctx, Dimensions* ctx_dim);
	void (*on_previous_photo) (SinglePhotoPage* self);
	void (*on_next_photo) (SinglePhotoPage* self);
};

struct _EditingHostPage {
	SinglePhotoPage parent_instance;
	EditingHostPagePrivate * priv;
};

struct _EditingHostPageClass {
	SinglePhotoPageClass parent_class;
	gboolean (*on_zoom_slider_key_press) (EditingHostPage* self, GdkEventKey* event);
	void (*on_increase_size) (EditingHostPage* self);
	void (*on_decrease_size) (EditingHostPage* self);
	void (*photo_changing) (EditingHostPage* self, Photo* new_photo);
	DataView* (*create_photo_view) (EditingHostPage* self, DataSource* source);
	void (*update_ui) (EditingHostPage* self, gboolean missing);
	void (*notify_photo_backing_missing) (EditingHostPage* self, Photo* photo, gboolean missing);
	gboolean (*confirm_replace_photo) (EditingHostPage* self, Photo* old_photo, Photo* new_photo);
	gboolean (*on_double_click) (EditingHostPage* self, GdkEventButton* event);
	GdkPixbuf* (*get_bottom_left_trinket) (EditingHostPage* self, gint scale);
	GdkPixbuf* (*get_top_left_trinket) (EditingHostPage* self, gint scale);
	GdkPixbuf* (*get_top_right_trinket) (EditingHostPage* self, gint scale);
	GdkPixbuf* (*get_bottom_right_trinket) (EditingHostPage* self, gint scale);
	void (*insert_faces_button) (EditingHostPage* self, GtkToolbar* toolbar);
};

struct _LibraryPhotoPage {
	EditingHostPage parent_instance;
	LibraryPhotoPagePrivate * priv;
};

struct _LibraryPhotoPageClass {
	EditingHostPageClass parent_class;
	void (*developer_changed) (LibraryPhotoPage* self, RawDeveloper rd);
};

struct _LibraryWindowFullscreenPhotoPage {
	LibraryPhotoPage parent_instance;
	LibraryWindowFullscreenPhotoPagePrivate * priv;
};

struct _LibraryWindowFullscreenPhotoPageClass {
	LibraryPhotoPageClass parent_class;
};

struct _LibraryWindowFullscreenPhotoPagePrivate {
	CollectionPage* collection;
	Photo* start;
	ViewCollection* view;
};

static gint LibraryWindow_private_offset;
static gpointer library_window_parent_class = NULL;
static GeeHashSet* library_window_initial_camera_uris;
static GeeHashSet* library_window_initial_camera_uris = NULL;
VALA_EXTERN AppWindow* app_window_instance;
VALA_EXTERN LibraryPhotoSourceCollection* library_photo_global;
VALA_EXTERN VideoSourceCollection* video_global;
static gint LibraryWindowFullscreenPhotoPage_private_offset;
static gpointer library_window_fullscreen_photo_page_parent_class = NULL;

VALA_EXTERN GType page_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageWindow, g_object_unref)
VALA_EXTERN GType page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Page, g_object_unref)
VALA_EXTERN GType app_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AppWindow, g_object_unref)
VALA_EXTERN GType dimensions_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Dimensions* dimensions_dup (const Dimensions* self);
VALA_EXTERN void dimensions_free (Dimensions* self);
VALA_EXTERN GType library_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryWindow, g_object_unref)
VALA_EXTERN gpointer one_shot_scheduler_ref (gpointer instance);
VALA_EXTERN void one_shot_scheduler_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_one_shot_scheduler (const gchar* name,
                                           const gchar* nick,
                                           const gchar* blurb,
                                           GType object_type,
                                           GParamFlags flags);
VALA_EXTERN void value_set_one_shot_scheduler (GValue* value,
                                   gpointer v_object);
VALA_EXTERN void value_take_one_shot_scheduler (GValue* value,
                                    gpointer v_object);
VALA_EXTERN gpointer value_get_one_shot_scheduler (const GValue* value);
VALA_EXTERN GType one_shot_scheduler_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OneShotScheduler, one_shot_scheduler_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_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SidebarBranch, g_object_unref)
VALA_EXTERN GType library_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryBranch, 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 folders_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FoldersBranch, g_object_unref)
VALA_EXTERN GType faces_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FacesBranch, g_object_unref)
VALA_EXTERN GType events_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EventsBranch, g_object_unref)
VALA_EXTERN GType camera_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CameraBranch, g_object_unref)
VALA_EXTERN GType searches_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SearchesBranch, g_object_unref)
VALA_EXTERN GType import_roll_branch_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportRollBranch, 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 single_photo_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SinglePhotoPage, g_object_unref)
VALA_EXTERN GType editing_host_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EditingHostPage, g_object_unref)
VALA_EXTERN GType library_photo_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryPhotoPage, g_object_unref)
VALA_EXTERN gpointer search_filter_actions_ref (gpointer instance);
VALA_EXTERN void search_filter_actions_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_search_filter_actions (const gchar* name,
                                              const gchar* nick,
                                              const gchar* blurb,
                                              GType object_type,
                                              GParamFlags flags);
VALA_EXTERN void value_set_search_filter_actions (GValue* value,
                                      gpointer v_object);
VALA_EXTERN void value_take_search_filter_actions (GValue* value,
                                       gpointer v_object);
VALA_EXTERN gpointer value_get_search_filter_actions (const GValue* value);
VALA_EXTERN GType search_filter_actions_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SearchFilterActions, search_filter_actions_unref)
VALA_EXTERN GType search_filter_toolbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SearchFilterToolbar, g_object_unref)
VALA_EXTERN GType background_progress_bar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BackgroundProgressBar, g_object_unref)
VALA_EXTERN GType properties_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Properties, g_object_unref)
VALA_EXTERN GType basic_properties_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BasicProperties, g_object_unref)
VALA_EXTERN GType extended_properties_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ExtendedProperties, g_object_unref)
VALA_EXTERN void app_window_add_actions (AppWindow* self);
VALA_EXTERN void page_window_switched_pages (PageWindow* self,
                                 Page* old_page,
                                 Page* new_page);
VALA_EXTERN gchar* app_window_get_app_role (AppWindow* self);
VALA_EXTERN void app_window_on_quit (AppWindow* self);
VALA_EXTERN void app_window_on_fullscreen (AppWindow* self);
VALA_EXTERN void app_window_update_common_action_availability (AppWindow* self,
                                                   Page* old_page,
                                                   Page* new_page);
VALA_EXTERN void app_window_update_common_actions (AppWindow* self,
                                       Page* page,
                                       gint selected_count,
                                       gint count);
VALA_EXTERN void page_window_set_current_page (PageWindow* self,
                                   Page* page);
VALA_EXTERN GType sidebar_selectable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType sidebar_page_representative_get_type (void) G_GNUC_CONST ;
static void library_window_on_page_created (LibraryWindow* self,
                                     SidebarPageRepresentative* entry,
                                     Page* page);
static void _library_window_on_page_created_sidebar_tree_page_created (SidebarTree* _sender,
                                                                SidebarPageRepresentative* entry,
                                                                Page* page,
                                                                gpointer self);
static void library_window_on_destroying_page (LibraryWindow* self,
                                        SidebarPageRepresentative* entry,
                                        Page* page);
static void _library_window_on_destroying_page_sidebar_tree_destroying_page (SidebarTree* _sender,
                                                                      SidebarPageRepresentative* entry,
                                                                      Page* page,
                                                                      gpointer self);
static void library_window_on_sidebar_entry_selected (LibraryWindow* self,
                                               SidebarSelectableEntry* selectable);
static void _library_window_on_sidebar_entry_selected_sidebar_tree_entry_selected (SidebarTree* _sender,
                                                                            SidebarSelectableEntry* selectable,
                                                                            gpointer self);
static void library_window_on_sidebar_selected_entry_removed (LibraryWindow* self,
                                                       SidebarSelectableEntry* selectable);
static void _library_window_on_sidebar_selected_entry_removed_sidebar_tree_selected_entry_removed (SidebarTree* _sender,
                                                                                            SidebarSelectableEntry* removed,
                                                                                            gpointer self);
static void library_window_unsubscribe_from_basic_information (LibraryWindow* self,
                                                        Page* page);
VALA_EXTERN Page* page_window_get_current_page (PageWindow* self);
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 media_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaSourceCollection, data_collection_unref)
VALA_EXTERN gpointer media_collection_registry_ref (gpointer instance);
VALA_EXTERN void media_collection_registry_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_media_collection_registry (const gchar* name,
                                                  const gchar* nick,
                                                  const gchar* blurb,
                                                  GType object_type,
                                                  GParamFlags flags);
VALA_EXTERN void value_set_media_collection_registry (GValue* value,
                                          gpointer v_object);
VALA_EXTERN void value_take_media_collection_registry (GValue* value,
                                           gpointer v_object);
VALA_EXTERN gpointer value_get_media_collection_registry (const GValue* value);
VALA_EXTERN GType media_collection_registry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaCollectionRegistry, media_collection_registry_unref)
VALA_EXTERN MediaCollectionRegistry* media_collection_registry_get_instance (void);
VALA_EXTERN GeeCollection* media_collection_registry_get_all (MediaCollectionRegistry* self);
static void library_window_on_trashcan_contents_altered (LibraryWindow* self);
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 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)
static void _library_window_on_trashcan_contents_altered_media_source_collection_trashcan_contents_altered (MediaSourceCollection* _sender,
                                                                                                     GeeCollection* added,
                                                                                                     GeeCollection* removed,
                                                                                                     gpointer self);
static void library_window_on_media_altered (LibraryWindow* 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 _library_window_on_media_altered_data_collection_items_altered (DataCollection* _sender,
                                                                     GeeMap* items,
                                                                     gpointer self);
VALA_EXTERN GType metadata_writer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MetadataWriter, g_object_unref)
VALA_EXTERN MetadataWriter* metadata_writer_get_instance (void);
static void library_window_on_metadata_writer_progress (LibraryWindow* self,
                                                 guint completed,
                                                 guint total);
static void _library_window_on_metadata_writer_progress_metadata_writer_progress (MetadataWriter* _sender,
                                                                           guint completed,
                                                                           guint total,
                                                                           gpointer self);
VALA_EXTERN GType directory_monitor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DirectoryMonitor, g_object_unref)
VALA_EXTERN GType library_monitor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryMonitor, g_object_unref)
VALA_EXTERN gpointer library_monitor_pool_ref (gpointer instance);
VALA_EXTERN void library_monitor_pool_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_library_monitor_pool (const gchar* name,
                                             const gchar* nick,
                                             const gchar* blurb,
                                             GType object_type,
                                             GParamFlags flags);
VALA_EXTERN void value_set_library_monitor_pool (GValue* value,
                                     gpointer v_object);
VALA_EXTERN void value_take_library_monitor_pool (GValue* value,
                                      gpointer v_object);
VALA_EXTERN gpointer value_get_library_monitor_pool (const GValue* value);
VALA_EXTERN GType library_monitor_pool_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryMonitorPool, library_monitor_pool_unref)
VALA_EXTERN LibraryMonitorPool* library_monitor_pool_get_instance (void);
VALA_EXTERN LibraryMonitor* library_monitor_pool_get_monitor (LibraryMonitorPool* self);
static void library_window_on_library_monitor_destroyed (LibraryWindow* self,
                                                  LibraryMonitor* monitor);
static void library_window_on_library_monitor_installed (LibraryWindow* self,
                                                  LibraryMonitor* monitor);
static void _library_window_on_library_monitor_installed_library_monitor_pool_monitor_installed (LibraryMonitorPool* _sender,
                                                                                          LibraryMonitor* monitor,
                                                                                          gpointer self);
static void _library_window_on_library_monitor_destroyed_library_monitor_pool_monitor_destroyed (LibraryMonitorPool* _sender,
                                                                                          LibraryMonitor* monitor,
                                                                                          gpointer self);
VALA_EXTERN gpointer camera_table_ref (gpointer instance);
VALA_EXTERN void camera_table_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_camera_table (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags);
VALA_EXTERN void value_set_camera_table (GValue* value,
                             gpointer v_object);
VALA_EXTERN void value_take_camera_table (GValue* value,
                              gpointer v_object);
VALA_EXTERN gpointer value_get_camera_table (const GValue* value);
VALA_EXTERN GType camera_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CameraTable, camera_table_unref)
VALA_EXTERN CameraTable* camera_table_get_instance (void);
VALA_EXTERN gpointer discovered_camera_ref (gpointer instance);
VALA_EXTERN void discovered_camera_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_discovered_camera (const gchar* name,
                                          const gchar* nick,
                                          const gchar* blurb,
                                          GType object_type,
                                          GParamFlags flags);
VALA_EXTERN void value_set_discovered_camera (GValue* value,
                                  gpointer v_object);
VALA_EXTERN void value_take_discovered_camera (GValue* value,
                                   gpointer v_object);
VALA_EXTERN gpointer value_get_discovered_camera (const GValue* value);
VALA_EXTERN GType discovered_camera_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DiscoveredCamera, discovered_camera_unref)
static void library_window_on_camera_added (LibraryWindow* self,
                                     DiscoveredCamera* camera);
static void _library_window_on_camera_added_camera_table_camera_added (CameraTable* _sender,
                                                                DiscoveredCamera* camera,
                                                                gpointer self);
static GType library_window_sidebar_root_position_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN GType library_window_target_type_get_type (void) G_GNUC_CONST ;
static void library_window_on_file_import (LibraryWindow* self);
static void _library_window_on_file_import_gsimple_action_activate_callback (GSimpleAction* action,
                                                                      GVariant* parameter,
                                                                      gpointer self);
static void library_window_on_external_library_import (LibraryWindow* self);
static void _library_window_on_external_library_import_gsimple_action_activate_callback (GSimpleAction* action,
                                                                                  GVariant* parameter,
                                                                                  gpointer self);
static void library_window_on_preferences (LibraryWindow* self);
static void _library_window_on_preferences_gsimple_action_activate_callback (GSimpleAction* action,
                                                                      GVariant* parameter,
                                                                      gpointer self);
static void library_window_on_empty_trash (LibraryWindow* self);
static void _library_window_on_empty_trash_gsimple_action_activate_callback (GSimpleAction* action,
                                                                      GVariant* parameter,
                                                                      gpointer self);
static void library_window_on_jump_to_event (LibraryWindow* self);
static void _library_window_on_jump_to_event_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self);
static void library_window_on_find (LibraryWindow* self);
static void _library_window_on_find_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self);
static void library_window_on_new_search (LibraryWindow* self);
static void _library_window_on_new_search_gsimple_action_activate_callback (GSimpleAction* action,
                                                                     GVariant* parameter,
                                                                     gpointer self);
static void library_window_on_action_toggle (LibraryWindow* self,
                                      GAction* action,
                                      GVariant* value);
static void _library_window_on_action_toggle_gsimple_action_activate_callback (GSimpleAction* action,
                                                                        GVariant* parameter,
                                                                        gpointer self);
static void library_window_on_display_basic_properties (LibraryWindow* self,
                                                 GSimpleAction* action,
                                                 GVariant* value);
static void _library_window_on_display_basic_properties_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                                       GVariant* value,
                                                                                       gpointer self);
static void library_window_on_display_extended_properties (LibraryWindow* self,
                                                    GSimpleAction* action,
                                                    GVariant* value);
static void _library_window_on_display_extended_properties_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                                          GVariant* value,
                                                                                          gpointer self);
static void library_window_on_display_searchbar (LibraryWindow* self,
                                          GSimpleAction* action,
                                          GVariant* value);
static void _library_window_on_display_searchbar_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                                GVariant* value,
                                                                                gpointer self);
static void library_window_on_display_sidebar (LibraryWindow* self,
                                        GSimpleAction* action,
                                        GVariant* variant);
static void _library_window_on_display_sidebar_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                              GVariant* value,
                                                                              gpointer self);
static void library_window_on_display_toolbar (LibraryWindow* self,
                                        GSimpleAction* action,
                                        GVariant* variant);
static void _library_window_on_display_toolbar_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                              GVariant* value,
                                                                              gpointer self);
static void library_window_on_action_radio (LibraryWindow* self,
                                     GAction* action,
                                     GVariant* value);
static void _library_window_on_action_radio_gsimple_action_activate_callback (GSimpleAction* action,
                                                                       GVariant* parameter,
                                                                       gpointer self);
static void library_window_on_events_sort_changed (LibraryWindow* self,
                                            GSimpleAction* action,
                                            GVariant* value);
static void _library_window_on_events_sort_changed_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                                  GVariant* value,
                                                                                  gpointer self);
VALA_EXTERN LibraryBranch* library_branch_new (void);
VALA_EXTERN LibraryBranch* library_branch_construct (GType object_type);
VALA_EXTERN TagsBranch* tags_branch_new (void);
VALA_EXTERN TagsBranch* tags_branch_construct (GType object_type);
VALA_EXTERN FoldersBranch* folders_branch_new (void);
VALA_EXTERN FoldersBranch* folders_branch_construct (GType object_type);
VALA_EXTERN FacesBranch* faces_branch_new (void);
VALA_EXTERN FacesBranch* faces_branch_construct (GType object_type);
VALA_EXTERN EventsBranch* events_branch_new (void);
VALA_EXTERN EventsBranch* events_branch_construct (GType object_type);
VALA_EXTERN CameraBranch* camera_branch_new (void);
VALA_EXTERN CameraBranch* camera_branch_construct (GType object_type);
VALA_EXTERN SearchesBranch* searches_branch_new (void);
VALA_EXTERN SearchesBranch* searches_branch_construct (GType object_type);
VALA_EXTERN ImportRollBranch* import_roll_branch_new (void);
VALA_EXTERN ImportRollBranch* import_roll_branch_construct (GType object_type);
VALA_EXTERN SearchFilterActions* search_filter_actions_new (void);
VALA_EXTERN SearchFilterActions* search_filter_actions_construct (GType object_type);
VALA_EXTERN BackgroundProgressBar* background_progress_bar_new (void);
VALA_EXTERN BackgroundProgressBar* background_progress_bar_construct (GType object_type);
VALA_EXTERN ExtendedProperties* extended_properties_new (void);
VALA_EXTERN ExtendedProperties* extended_properties_construct (GType object_type);
VALA_EXTERN LibraryWindow* library_window_new (ProgressMonitor progress_monitor,
                                   gpointer progress_monitor_target);
VALA_EXTERN LibraryWindow* library_window_construct (GType object_type,
                                         ProgressMonitor progress_monitor,
                                         gpointer progress_monitor_target);
VALA_EXTERN AppWindow* app_window_construct (GType object_type);
static void library_window_external_drop_handler (LibraryWindow* self,
                                           GdkDragContext* context,
                                           SidebarEntry* entry,
                                           GtkSelectionData* data,
                                           guint info,
                                           guint time);
static void _library_window_external_drop_handler_sidebar_tree_external_drop_handler (GdkDragContext* context,
                                                                               SidebarEntry* entry,
                                                                               GtkSelectionData* data,
                                                                               guint info,
                                                                               guint time,
                                                                               gpointer self);
VALA_EXTERN SidebarTree* sidebar_tree_new (GtkTargetEntry* target_entries,
                               gint target_entries_length1,
                               GdkDragAction actions,
                               SidebarTreeExternalDropHandler drop_handler,
                               gpointer drop_handler_target);
VALA_EXTERN SidebarTree* sidebar_tree_construct (GType object_type,
                                     GtkTargetEntry* target_entries,
                                     gint target_entries_length1,
                                     GdkDragAction actions,
                                     SidebarTreeExternalDropHandler drop_handler,
                                     gpointer drop_handler_target);
VALA_EXTERN void sidebar_tree_graft (SidebarTree* self,
                         SidebarBranch* branch,
                         gint position);
VALA_EXTERN void sidebar_tree_finish (SidebarTree* self);
static void library_window_on_update_properties_now (LibraryWindow* self);
static void _library_window_on_update_properties_now_one_shot_callback (gpointer self);
VALA_EXTERN OneShotScheduler* one_shot_scheduler_new (const gchar* name,
                                          OneShotCallback callback,
                                          gpointer callback_target);
VALA_EXTERN OneShotScheduler* one_shot_scheduler_construct (GType object_type,
                                                const gchar* name,
                                                OneShotCallback callback,
                                                gpointer callback_target);
VALA_EXTERN SearchFilterToolbar* search_filter_toolbar_new (SearchFilterActions* actions);
VALA_EXTERN SearchFilterToolbar* search_filter_toolbar_construct (GType object_type,
                                                      SearchFilterActions* actions);
VALA_EXTERN BasicProperties* basic_properties_new (void);
VALA_EXTERN BasicProperties* basic_properties_construct (GType object_type);
static void library_window_create_layout (LibraryWindow* self,
                                   Page* start_page);
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 library_photos_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryPhotosEntry, g_object_unref)
VALA_EXTERN LibraryPhotosEntry* library_branch_get_photos_entry (LibraryBranch* self);
VALA_EXTERN Page* sidebar_page_representative_get_page (SidebarPageRepresentative* self);
static void library_window_load_configuration (LibraryWindow* self);
VALA_EXTERN void application_set_accels_for_action (const gchar* action,
                                        gchar** accel,
                                        gint accel_length1);
VALA_EXTERN GFile* directory_monitor_get_root (DirectoryMonitor* self);
static void library_window_on_library_monitor_discovery_started (LibraryWindow* self);
static void _library_window_on_library_monitor_discovery_started_directory_monitor_discovery_started (DirectoryMonitor* _sender,
                                                                                               gpointer self);
static void library_window_on_library_monitor_discovery_completed (LibraryWindow* self);
static void _library_window_on_library_monitor_discovery_completed_directory_monitor_discovery_completed (DirectoryMonitor* _sender,
                                                                                                   gpointer self);
static void _library_window_on_library_monitor_discovery_completed_directory_monitor_closed (DirectoryMonitor* _sender,
                                                                                      gpointer self);
static void library_window_on_library_monitor_auto_update_progress (LibraryWindow* self,
                                                             gint completed_files,
                                                             gint total_files);
static void _library_window_on_library_monitor_auto_update_progress_library_monitor_auto_update_progress (LibraryMonitor* _sender,
                                                                                                   gint completed_files,
                                                                                                   gint total_files,
                                                                                                   gpointer self);
static void library_window_on_library_monitor_auto_import_preparing (LibraryWindow* self);
static void _library_window_on_library_monitor_auto_import_preparing_library_monitor_auto_import_preparing (LibraryMonitor* _sender,
                                                                                                     gpointer self);
static void library_window_on_library_monitor_auto_import_progress (LibraryWindow* self,
                                                             guint64 completed_bytes,
                                                             guint64 total_bytes);
static void _library_window_on_library_monitor_auto_import_progress_library_monitor_auto_import_progress (LibraryMonitor* _sender,
                                                                                                   guint64 completed_bytes,
                                                                                                   guint64 total_bytes,
                                                                                                   gpointer self);
static void library_window_real_add_actions (AppWindow* base);
VALA_EXTERN GActionEntry* search_filter_actions_get_actions (SearchFilterActions* self,
                                                 gint* result_length1);
VALA_EXTERN GType configuration_facade_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigurationFacade, g_object_unref)
VALA_EXTERN GType config_facade_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigFacade, g_object_unref)
VALA_EXTERN ConfigFacade* config_facade_get_instance (void);
VALA_EXTERN gboolean configuration_facade_get_display_search_bar (ConfigurationFacade* self);
static GVariant* _variant_new1 (gboolean value);
static gboolean library_window_is_sidebar_visible (LibraryWindow* self);
static GVariant* _variant_new2 (gboolean value);
static gboolean library_window_is_toolbar_visible (LibraryWindow* self);
static GVariant* _variant_new3 (gboolean value);
static void library_window_real_switched_pages (PageWindow* base,
                                         Page* old_page,
                                         Page* new_page);
VALA_EXTERN GType view_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewCollection, data_collection_unref)
VALA_EXTERN ViewCollection* page_get_view (Page* self);
VALA_EXTERN gpointer view_filter_ref (gpointer instance);
VALA_EXTERN void view_filter_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_view_filter (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_view_filter (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_view_filter (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_view_filter (const GValue* value);
VALA_EXTERN GType view_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewFilter, view_filter_unref)
static void library_window_on_view_filter_installed (LibraryWindow* self,
                                              ViewFilter* filter);
static void _library_window_on_view_filter_installed_view_collection_view_filter_installed (ViewCollection* _sender,
                                                                                     ViewFilter* filer,
                                                                                     gpointer self);
static void library_window_on_view_filter_removed (LibraryWindow* self,
                                            ViewFilter* filter);
static void _library_window_on_view_filter_removed_view_collection_view_filter_removed (ViewCollection* _sender,
                                                                                 ViewFilter* filer,
                                                                                 gpointer self);
VALA_EXTERN void search_filter_actions_monitor_page_contents (SearchFilterActions* self,
                                                  Page* old_page,
                                                  Page* new_page);
static void library_window_on_view_filter_refreshed (LibraryWindow* self);
static void _library_window_on_view_filter_refreshed_view_filter_refresh (ViewFilter* _sender,
                                                                   gpointer self);
VALA_EXTERN gboolean view_collection_are_items_filtered_out (ViewCollection* self);
static GVariant* _variant_new4 (gboolean value);
static void library_window_real_show_all (GtkWidget* base);
VALA_EXTERN GAction* page_get_common_action (Page* self,
                                 const gchar* name,
                                 gboolean log_warning);
VALA_EXTERN GType checkerboard_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardPage, g_object_unref)
static void library_window_init_view_filter (LibraryWindow* self,
                                      CheckerboardPage* page);
static void library_window_toggle_search_bar (LibraryWindow* self,
                                       gboolean show,
                                       CheckerboardPage* page);
static gboolean library_window_should_show_search_bar (LibraryWindow* self);
static void library_window_set_sidebar_visible (LibraryWindow* self,
                                         gboolean visible);
VALA_EXTERN LibraryWindow* library_window_get_app (void);
VALA_EXTERN gboolean library_window_is_mount_uri_supported (const gchar* uri);
static gchar* library_window_real_get_app_role (AppWindow* base);
VALA_EXTERN GType tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tag, g_object_unref)
VALA_EXTERN void library_window_rename_tag_in_sidebar (LibraryWindow* self,
                                           Tag* tag);
VALA_EXTERN GType tags_sidebar_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagsSidebarEntry, g_object_unref)
VALA_EXTERN TagsSidebarEntry* tags_branch_get_entry_for_tag (TagsBranch* self,
                                                 Tag* tag);
VALA_EXTERN gboolean sidebar_tree_rename_entry_in_place (SidebarTree* self,
                                             SidebarEntry* entry);
VALA_EXTERN GType event_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EventSource, g_object_unref)
VALA_EXTERN GType event_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Event, g_object_unref)
VALA_EXTERN void library_window_rename_event_in_sidebar (LibraryWindow* self,
                                             Event* event);
VALA_EXTERN GType events_event_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EventsEventEntry, g_object_unref)
VALA_EXTERN EventsEventEntry* events_branch_get_entry_for_event (EventsBranch* self,
                                                     Event* event);
VALA_EXTERN GType saved_search_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SavedSearch, g_object_unref)
VALA_EXTERN void library_window_rename_search_in_sidebar (LibraryWindow* self,
                                              SavedSearch* search);
VALA_EXTERN GType searches_sidebar_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SearchesSidebarEntry, g_object_unref)
VALA_EXTERN SearchesSidebarEntry* searches_branch_get_entry_for_saved_search (SearchesBranch* self,
                                                                  SavedSearch* search);
VALA_EXTERN GType face_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Face, g_object_unref)
VALA_EXTERN void library_window_rename_face_in_sidebar (LibraryWindow* self,
                                            Face* face);
VALA_EXTERN GType faces_sidebar_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FacesSidebarEntry, g_object_unref)
VALA_EXTERN FacesSidebarEntry* faces_branch_get_entry_for_face (FacesBranch* self,
                                                    Face* face);
static void library_window_real_on_quit (AppWindow* base);
VALA_EXTERN void configuration_facade_set_library_window_state (ConfigurationFacade* self,
                                                    gboolean maximize,
                                                    Dimensions* dimensions);
VALA_EXTERN void configuration_facade_set_sidebar_position (ConfigurationFacade* self,
                                                gint position);
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 photo_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotoSource, g_object_unref)
VALA_EXTERN GType photo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Photo, g_object_unref)
static Photo* library_window_get_start_fullscreen_photo (LibraryWindow* self,
                                                  CollectionPage* page);
VALA_EXTERN gint view_collection_get_selected_count (ViewCollection* self);
VALA_EXTERN GeeList* view_collection_get_selected_sources_of_type (ViewCollection* self,
                                                       GType t);
VALA_EXTERN GType library_photo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryPhoto, g_object_unref)
VALA_EXTERN GeeList* view_collection_get_sources_of_type (ViewCollection* self,
                                              GType t);
static gboolean library_window_get_fullscreen_photo (LibraryWindow* self,
                                              Page* page,
                                              CollectionPage** collection,
                                              Photo** start,
                                              ViewCollection** view_collection);
VALA_EXTERN GType events_directory_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EventsDirectoryPage, g_object_unref)
VALA_EXTERN gint data_collection_get_count (DataCollection* self);
VALA_EXTERN DataObject* data_collection_get_at (DataCollection* self,
                                    gint index);
VALA_EXTERN GType data_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataView, g_object_unref)
VALA_EXTERN DataSource* data_view_get_source (DataView* self);
VALA_EXTERN GType event_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EventPage, g_object_unref)
VALA_EXTERN CollectionPage* library_photo_page_get_controller_page (LibraryPhotoPage* self);
VALA_EXTERN gboolean editing_host_page_has_photo (EditingHostPage* self);
VALA_EXTERN Photo* editing_host_page_get_photo (EditingHostPage* self);
static void library_window_real_on_fullscreen (AppWindow* base);
static GType library_window_fullscreen_photo_page_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryWindowFullscreenPhotoPage, g_object_unref)
static LibraryWindowFullscreenPhotoPage* library_window_fullscreen_photo_page_new (CollectionPage* collection,
                                                                            Photo* start,
                                                                            ViewCollection* view);
static LibraryWindowFullscreenPhotoPage* library_window_fullscreen_photo_page_construct (GType object_type,
                                                                                  CollectionPage* collection,
                                                                                  Photo* start,
                                                                                  ViewCollection* view);
VALA_EXTERN void app_window_go_fullscreen (AppWindow* self,
                               Page* page);
VALA_EXTERN gboolean app_dirs_is_in_import_dir (GFile* file);
VALA_EXTERN GtkResponseType copy_files_dialog (void);
static void library_window_dispatch_import_jobs (LibraryWindow* self,
                                          GSList* uris,
                                          const gchar* job_name,
                                          gboolean copy_to_library,
                                          gboolean recurse);
static void _g_free0_ (gpointer var);
static inline void _g_slist_free__g_free0_ (GSList* self);
VALA_EXTERN GType data_imports_ui_data_imports_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataImportsUIDataImportsDialog, g_object_unref)
VALA_EXTERN DataImportsUIDataImportsDialog* data_imports_ui_data_imports_dialog_get_or_create_instance (void);
static void library_window_real_update_common_action_availability (AppWindow* base,
                                                            Page* old_page,
                                                            Page* new_page);
VALA_EXTERN void app_window_set_common_action_sensitive (AppWindow* self,
                                             const gchar* name,
                                             gboolean sensitive);
static void library_window_real_update_common_actions (AppWindow* base,
                                                Page* page,
                                                gint selected_count,
                                                gint count);
static gboolean library_window_can_empty_trash (LibraryWindow* self);
VALA_EXTERN void app_window_set_common_action_visible (AppWindow* self,
                                           const gchar* name,
                                           gboolean visible);
static gboolean library_window_can_jump_to_event (LibraryWindow* self);
VALA_EXTERN GType library_photo_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryPhotoSourceCollection, data_collection_unref)
VALA_EXTERN gint media_source_collection_get_trashcan_count (MediaSourceCollection* self);
VALA_EXTERN GType video_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VideoSourceCollection, data_collection_unref)
VALA_EXTERN GeeCollection* media_source_collection_get_trashcan_contents (MediaSourceCollection* self);
VALA_EXTERN void remove_from_app (GeeCollection* sources,
                      const gchar* dialog_title,
                      const gchar* progress_dialog_text);
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 void command_manager_reset (CommandManager* self);
VALA_EXTERN SavedSearchDialog* saved_search_dialog_new (void);
VALA_EXTERN SavedSearchDialog* saved_search_dialog_construct (GType object_type);
VALA_EXTERN GType saved_search_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SavedSearchDialog, g_object_unref)
VALA_EXTERN void saved_search_dialog_show (SavedSearchDialog* self);
VALA_EXTERN DataSource* view_collection_get_selected_source_at (ViewCollection* self,
                                                    gint index);
VALA_EXTERN Event* media_source_get_event (MediaSource* self);
VALA_EXTERN void library_window_switch_to_event (LibraryWindow* self,
                                     Event* event);
static GVariant* _variant_new5 (gboolean value);
VALA_EXTERN void search_filter_toolbar_take_focus (SearchFilterToolbar* self);
static void library_window_on_clear_search (LibraryWindow* self);
VALA_EXTERN void search_filter_actions_reset (SearchFilterActions* self);
VALA_EXTERN gint library_window_get_events_sort (LibraryWindow* self);
VALA_EXTERN void configuration_facade_set_events_sort_ascending (ConfigurationFacade* self,
                                                     gboolean sort);
VALA_EXTERN void preferences_dialog_show_preferences (void);
VALA_EXTERN void properties_update_properties (Properties* self,
                                   Page* page);
VALA_EXTERN void configuration_facade_set_display_basic_properties (ConfigurationFacade* self,
                                                        gboolean display);
static gboolean _variant_get1 (GVariant* value);
static GVariant* _variant_new6 (gboolean value);
VALA_EXTERN void configuration_facade_set_display_extended_properties (ConfigurationFacade* self,
                                                           gboolean display);
VALA_EXTERN void configuration_facade_set_display_search_bar (ConfigurationFacade* self,
                                                  gboolean display);
VALA_EXTERN void library_window_show_search_bar (LibraryWindow* self,
                                     gboolean display);
static GVariant* _variant_new7 (gboolean value);
VALA_EXTERN void configuration_facade_set_display_sidebar (ConfigurationFacade* self,
                                               gboolean display);
VALA_EXTERN gboolean configuration_facade_get_display_sidebar (ConfigurationFacade* self);
static void library_window_set_toolbar_visible (LibraryWindow* self,
                                         gboolean visible);
VALA_EXTERN GtkToolbar* page_get_toolbar (Page* self);
VALA_EXTERN void configuration_facade_set_display_toolbar (ConfigurationFacade* self,
                                               gboolean display);
VALA_EXTERN gboolean configuration_facade_get_display_toolbar (ConfigurationFacade* self);
VALA_EXTERN GType batch_import_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BatchImport, g_object_unref)
VALA_EXTERN void library_window_enqueue_batch_import (LibraryWindow* self,
                                          BatchImport* batch_import,
                                          gboolean allow_user_cancel);
VALA_EXTERN GType library_hideable_page_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryHideablePageEntry, g_object_unref)
VALA_EXTERN GType library_import_queue_sidebar_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryImportQueueSidebarEntry, g_object_unref)
VALA_EXTERN LibraryImportQueueSidebarEntry* library_branch_get_import_queue_entry (LibraryBranch* self);
VALA_EXTERN void library_import_queue_sidebar_entry_enqueue_and_schedule (LibraryImportQueueSidebarEntry* self,
                                                              BatchImport* batch_import,
                                                              gboolean allow_user_cancel);
VALA_EXTERN gpointer import_manifest_ref (gpointer instance);
VALA_EXTERN void import_manifest_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_import_manifest (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_import_manifest (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_import_manifest (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_import_manifest (const GValue* value);
VALA_EXTERN GType import_manifest_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportManifest, import_manifest_unref)
static void library_window_import_reporter (LibraryWindow* self,
                                     ImportManifest* manifest);
VALA_EXTERN gpointer import_ui_question_params_ref (gpointer instance);
VALA_EXTERN void import_ui_question_params_unref (gpointer instance);
VALA_EXTERN GParamSpec* import_ui_param_spec_question_params (const gchar* name,
                                                  const gchar* nick,
                                                  const gchar* blurb,
                                                  GType object_type,
                                                  GParamFlags flags);
VALA_EXTERN void import_ui_value_set_question_params (GValue* value,
                                          gpointer v_object);
VALA_EXTERN void import_ui_value_take_question_params (GValue* value,
                                           gpointer v_object);
VALA_EXTERN gpointer import_ui_value_get_question_params (const GValue* value);
VALA_EXTERN GType import_ui_question_params_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportUIQuestionParams, import_ui_question_params_unref)
VALA_EXTERN gboolean import_ui_report_manifest (ImportManifest* manifest,
                                    gboolean show_dest_id,
                                    ImportUIQuestionParams* question);
VALA_EXTERN GFile* app_dirs_get_import_dir (void);
VALA_EXTERN GtkResponseType app_window_affirm_cancel_question (const gchar* message,
                                                   const gchar* affirmative,
                                                   const gchar* title,
                                                   GtkWindow* parent);
VALA_EXTERN AppWindow* app_window_get_instance (void);
VALA_EXTERN gpointer batch_import_job_ref (gpointer instance);
VALA_EXTERN void batch_import_job_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_batch_import_job (const gchar* name,
                                         const gchar* nick,
                                         const gchar* blurb,
                                         GType object_type,
                                         GParamFlags flags);
VALA_EXTERN void value_set_batch_import_job (GValue* value,
                                 gpointer v_object);
VALA_EXTERN void value_take_batch_import_job (GValue* value,
                                  gpointer v_object);
VALA_EXTERN gpointer value_get_batch_import_job (const GValue* value);
VALA_EXTERN GType batch_import_job_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BatchImportJob, batch_import_job_unref)
VALA_EXTERN GType file_import_job_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FileImportJob, batch_import_job_unref)
VALA_EXTERN FileImportJob* file_import_job_new (GFile* file_or_dir,
                                    gboolean copy_to_library,
                                    gboolean recurse);
VALA_EXTERN FileImportJob* file_import_job_construct (GType object_type,
                                          GFile* file_or_dir,
                                          gboolean copy_to_library,
                                          gboolean recurse);
VALA_EXTERN void app_window_error_message (const gchar* message,
                               GtkWindow* parent);
VALA_EXTERN gpointer batch_import_roll_ref (gpointer instance);
VALA_EXTERN void batch_import_roll_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_batch_import_roll (const gchar* name,
                                          const gchar* nick,
                                          const gchar* blurb,
                                          GType object_type,
                                          GParamFlags flags);
VALA_EXTERN void value_set_batch_import_roll (GValue* value,
                                  gpointer v_object);
VALA_EXTERN void value_take_batch_import_roll (GValue* value,
                                   gpointer v_object);
VALA_EXTERN gpointer value_get_batch_import_roll (const GValue* value);
VALA_EXTERN GType batch_import_roll_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BatchImportRoll, batch_import_roll_unref)
static void _library_window_import_reporter_batch_import_import_reporter (ImportManifest* manifest,
                                                                   BatchImportRoll* import_roll,
                                                                   gpointer self);
VALA_EXTERN BatchImport* batch_import_new (GeeIterable* jobs,
                               const gchar* name,
                               BatchImportImportReporter reporter,
                               gpointer reporter_target,
                               GeeArrayList* prefailed,
                               GeeArrayList* pre_already_imported,
                               GCancellable* cancellable,
                               BatchImportRoll* import_roll,
                               ImportManifest* skip_manifest);
VALA_EXTERN BatchImport* batch_import_construct (GType object_type,
                                     GeeIterable* jobs,
                                     const gchar* name,
                                     BatchImportImportReporter reporter,
                                     gpointer reporter_target,
                                     GeeArrayList* prefailed,
                                     GeeArrayList* pre_already_imported,
                                     GCancellable* cancellable,
                                     BatchImportRoll* import_roll,
                                     ImportManifest* skip_manifest);
VALA_EXTERN void library_window_switch_to_import_queue_page (LibraryWindow* self);
static GdkDragAction library_window_get_drag_action (LibraryWindow* self);
static gboolean library_window_real_drag_motion (GtkWidget* base,
                                          GdkDragContext* context,
                                          gint x,
                                          gint y,
                                          guint time);
static void library_window_real_drag_data_received (GtkWidget* base,
                                             GdkDragContext* context,
                                             gint x,
                                             gint y,
                                             GtkSelectionData* selection_data,
                                             guint info,
                                             guint time);
VALA_EXTERN void library_window_switch_to_library_page (LibraryWindow* self);
VALA_EXTERN void library_window_switch_to_page (LibraryWindow* self,
                                    Page* page);
VALA_EXTERN void library_window_switch_to_tag (LibraryWindow* self,
                                   Tag* tag);
VALA_EXTERN void library_window_switch_to_saved_search (LibraryWindow* self,
                                            SavedSearch* search);
VALA_EXTERN void library_window_switch_to_photo_page (LibraryWindow* self,
                                          CollectionPage* controller,
                                          Photo* current);
VALA_EXTERN DataView* view_collection_get_view_for_source (ViewCollection* self,
                                               DataSource* source);
VALA_EXTERN LibraryPhotoPage* library_photo_page_new (void);
VALA_EXTERN LibraryPhotoPage* library_photo_page_construct (GType object_type);
VALA_EXTERN void library_window_add_to_stack (LibraryWindow* self,
                                  Page* page);
VALA_EXTERN void spin_event_loop (void);
VALA_EXTERN void library_photo_page_display_for_collection (LibraryPhotoPage* self,
                                                CollectionPage* return_page,
                                                Photo* photo,
                                                ViewCollection* view);
VALA_EXTERN GType camera_sidebar_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CameraSidebarEntry, g_object_unref)
VALA_EXTERN CameraSidebarEntry* camera_branch_get_entry_for_camera (CameraBranch* self,
                                                        DiscoveredCamera* camera);
VALA_EXTERN GType import_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportPage, g_object_unref)
VALA_EXTERN GMount* discovered_camera_get_mount (DiscoveredCamera* self);
VALA_EXTERN gboolean import_page_unmount_camera (ImportPage* self,
                                     GMount* mount);
static void library_window_remove_from_stack (LibraryWindow* self,
                                       Page* page);
VALA_EXTERN gboolean configuration_facade_get_display_basic_properties (ConfigurationFacade* self);
static GVariant* _variant_new8 (gboolean value);
VALA_EXTERN gboolean configuration_facade_get_display_extended_properties (ConfigurationFacade* self);
static GVariant* _variant_new9 (gboolean value);
static GVariant* _variant_new10 (gboolean value);
VALA_EXTERN gboolean configuration_facade_get_events_sort_ascending (ConfigurationFacade* self);
static GVariant* _variant_new11 (const gchar* value);
VALA_EXTERN GType background_progress_bar_priority_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void background_progress_bar_start (BackgroundProgressBar* self,
                                    const gchar* label,
                                    BackgroundProgressBarPriority priority);
VALA_EXTERN void background_progress_bar_stop (BackgroundProgressBar* self,
                                   BackgroundProgressBarPriority priority,
                                   gboolean clear);
VALA_EXTERN void background_progress_bar_clear (BackgroundProgressBar* self,
                                    BackgroundProgressBarPriority priority);
VALA_EXTERN gboolean background_progress_bar_update (BackgroundProgressBar* self,
                                         const gchar* label,
                                         BackgroundProgressBarPriority priority,
                                         gdouble count,
                                         gdouble total);
VALA_EXTERN gint configuration_facade_get_sidebar_position (ConfigurationFacade* self);
VALA_EXTERN gint library_window_get_PAGE_MIN_WIDTH (void);
static void library_window_real_set_current_page (PageWindow* base,
                                           Page* page);
VALA_EXTERN void library_window_set_page_switching_enabled (LibraryWindow* self,
                                                gboolean should_enable);
VALA_EXTERN void application_set_menubar (GMenuModel* model);
VALA_EXTERN void page_switching_from (Page* self);
VALA_EXTERN void sidebar_tree_enable_editing (SidebarTree* self);
VALA_EXTERN void sidebar_tree_disable_editing (SidebarTree* self);
VALA_EXTERN GType sidebar_expandable_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gboolean sidebar_expandable_entry_expand_on_select (SidebarExpandableEntry* self);
VALA_EXTERN gboolean sidebar_tree_expand_to_entry (SidebarTree* self,
                                       SidebarEntry* entry);
VALA_EXTERN gboolean sidebar_tree_place_cursor (SidebarTree* self,
                                    SidebarEntry* entry,
                                    gboolean mask_signal);
static void library_window_on_update_properties (LibraryWindow* self);
static void library_window_subscribe_for_basic_information (LibraryWindow* self,
                                                     Page* page);
VALA_EXTERN void page_switched_to (Page* self);
VALA_EXTERN GMenuModel* page_get_menubar (Page* self);
VALA_EXTERN void page_ready (Page* self);
VALA_EXTERN GType search_view_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SearchViewFilter, view_filter_unref)
VALA_EXTERN void search_filter_toolbar_set_view_filter (SearchFilterToolbar* self,
                                            SearchViewFilter* search_filter);
VALA_EXTERN SearchViewFilter* checkerboard_page_get_search_view_filter (CheckerboardPage* self);
VALA_EXTERN void view_collection_install_view_filter (ViewCollection* self,
                                          ViewFilter* f);
VALA_EXTERN DisabledViewFilter* disabled_view_filter_new (void);
VALA_EXTERN DisabledViewFilter* disabled_view_filter_construct (GType object_type);
VALA_EXTERN GType disabled_view_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DisabledViewFilter, view_filter_unref)
VALA_EXTERN GType library_last_import_sidebar_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryLastImportSidebarEntry, g_object_unref)
VALA_EXTERN LibraryLastImportSidebarEntry* library_branch_get_last_imported_entry (LibraryBranch* self);
VALA_EXTERN gboolean library_hideable_page_entry_get_visible (LibraryHideablePageEntry* self);
VALA_EXTERN gboolean sidebar_branch_get_show_branch (SidebarBranch* self);
VALA_EXTERN GType events_directory_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EventsDirectoryEntry, g_object_unref)
VALA_EXTERN GType events_master_directory_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EventsMasterDirectoryEntry, g_object_unref)
VALA_EXTERN EventsMasterDirectoryEntry* events_branch_get_master_entry (EventsBranch* self);
static void _library_window_on_update_properties_view_collection_items_state_changed (ViewCollection* _sender,
                                                                               GeeIterable* changed,
                                                                               gpointer self);
static void _library_window_on_update_properties_data_collection_items_altered (DataCollection* _sender,
                                                                         GeeMap* items,
                                                                         gpointer self);
static void _library_window_on_update_properties_data_collection_contents_altered (DataCollection* _sender,
                                                                            GeeIterable* added,
                                                                            GeeIterable* removed,
                                                                            gpointer self);
static void _library_window_on_update_properties_view_collection_items_visibility_changed (ViewCollection* _sender,
                                                                                    GeeCollection* changed,
                                                                                    gpointer self);
VALA_EXTERN void one_shot_scheduler_at_idle (OneShotScheduler* self);
VALA_EXTERN void library_window_mounted_camera_shell_notification (LibraryWindow* self,
                                                       const gchar* uri,
                                                       gboolean at_startup);
VALA_EXTERN gchar* camera_table_get_port_uri (const gchar* port);
VALA_EXTERN gboolean is_string_empty (const gchar* s);
static gboolean library_window_real_key_press_event (GtkWidget* base,
                                              GdkEventKey* event);
VALA_EXTERN gboolean sidebar_tree_is_keypress_interpreted (SidebarTree* self,
                                               GdkEventKey* event);
VALA_EXTERN gint thumbnail_get_MAX_SCALE (void);
VALA_EXTERN GType fullscreen_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FullscreenWindow, g_object_unref)
VALA_EXTERN gpointer injection_group_ref (gpointer instance);
VALA_EXTERN void injection_group_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_injection_group (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_injection_group (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_injection_group (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_injection_group (const GValue* value);
VALA_EXTERN GType injection_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (InjectionGroup, injection_group_unref)
VALA_EXTERN GType zoom_buffer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ZoomBuffer, g_object_unref)
VALA_EXTERN GType single_photo_page_update_reason_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType raw_developer_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void page_init_collect_ui_filenames (Page* self,
                                     GeeList* ui_filenames);
static void library_window_fullscreen_photo_page_real_switched_to (Page* base);
static void library_window_fullscreen_photo_page_real_switching_from (Page* base);
static void library_window_fullscreen_photo_page_real_init_collect_ui_filenames (Page* base,
                                                                          GeeList* ui_filenames);
static void library_window_fullscreen_photo_page_finalize (GObject * obj);
static GType library_window_fullscreen_photo_page_get_type_once (void);
static void library_window_finalize (GObject * obj);
static GType library_window_get_type_once (void);
static void _vala_library_window_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const gchar* LIBRARY_WINDOW_SUPPORTED_MOUNT_SCHEMES[4] = {"gphoto2:", "disk:", "file:", "mtp:"};
const GtkTargetEntry LIBRARY_WINDOW_DND_TARGET_ENTRIES[3] = {{"text/uri-list", (guint) GTK_TARGET_OTHER_APP, (guint) LIBRARY_WINDOW_TARGET_TYPE_URI_LIST}, {LIBRARY_WINDOW_MEDIA_LIST_MIME_TYPE, (guint) GTK_TARGET_SAME_APP, (guint) LIBRARY_WINDOW_TARGET_TYPE_MEDIA_LIST}, {LIBRARY_WINDOW_TAG_PATH_MIME_TYPE, (guint) GTK_TARGET_SAME_WIDGET, (guint) LIBRARY_WINDOW_TARGET_TYPE_TAG_PATH}};
static const GActionEntry LIBRARY_WINDOW_common_actions[13] = {{"CommonFileImport", _library_window_on_file_import_gsimple_action_activate_callback}, {"ExternalLibraryImport", _library_window_on_external_library_import_gsimple_action_activate_callback}, {"CommonPreferences", _library_window_on_preferences_gsimple_action_activate_callback}, {"CommonEmptyTrash", _library_window_on_empty_trash_gsimple_action_activate_callback}, {"CommonJumpToEvent", _library_window_on_jump_to_event_gsimple_action_activate_callback}, {"CommonFind", _library_window_on_find_gsimple_action_activate_callback}, {"CommonNewSearch", _library_window_on_new_search_gsimple_action_activate_callback}, {"CommonDisplayBasicProperties", _library_window_on_action_toggle_gsimple_action_activate_callback, NULL, "false", _library_window_on_display_basic_properties_gsimple_action_change_state_callback}, {"CommonDisplayExtendedProperties", _library_window_on_action_toggle_gsimple_action_activate_callback, NULL, "false", _library_window_on_display_extended_properties_gsimple_action_change_state_callback}, {"CommonDisplaySearchbar", NULL, NULL, "false", _library_window_on_display_searchbar_gsimple_action_change_state_callback}, {"CommonDisplaySidebar", _library_window_on_action_toggle_gsimple_action_activate_callback, NULL, "true", _library_window_on_display_sidebar_gsimple_action_change_state_callback}, {"CommonDisplayToolbar", NULL, NULL, "true", _library_window_on_display_toolbar_gsimple_action_change_state_callback}, {"CommonSortEvents", _library_window_on_action_radio_gsimple_action_activate_callback, "s", "'ascending'", _library_window_on_events_sort_changed_gsimple_action_change_state_callback}};

static inline gpointer
library_window_get_instance_private (LibraryWindow* self)
{
	return G_STRUCT_MEMBER_P (self, LibraryWindow_private_offset);
}

static void
_library_window_on_page_created_sidebar_tree_page_created (SidebarTree* _sender,
                                                           SidebarPageRepresentative* entry,
                                                           Page* page,
                                                           gpointer self)
{
	library_window_on_page_created ((LibraryWindow*) self, entry, page);
}

static void
_library_window_on_destroying_page_sidebar_tree_destroying_page (SidebarTree* _sender,
                                                                 SidebarPageRepresentative* entry,
                                                                 Page* page,
                                                                 gpointer self)
{
	library_window_on_destroying_page ((LibraryWindow*) self, entry, page);
}

static void
_library_window_on_sidebar_entry_selected_sidebar_tree_entry_selected (SidebarTree* _sender,
                                                                       SidebarSelectableEntry* selectable,
                                                                       gpointer self)
{
	library_window_on_sidebar_entry_selected ((LibraryWindow*) self, selectable);
}

static void
_library_window_on_sidebar_selected_entry_removed_sidebar_tree_selected_entry_removed (SidebarTree* _sender,
                                                                                       SidebarSelectableEntry* removed,
                                                                                       gpointer self)
{
	library_window_on_sidebar_selected_entry_removed ((LibraryWindow*) self, removed);
}

static void
_library_window_on_trashcan_contents_altered_media_source_collection_trashcan_contents_altered (MediaSourceCollection* _sender,
                                                                                                GeeCollection* added,
                                                                                                GeeCollection* removed,
                                                                                                gpointer self)
{
	library_window_on_trashcan_contents_altered ((LibraryWindow*) self);
}

static void
_library_window_on_media_altered_data_collection_items_altered (DataCollection* _sender,
                                                                GeeMap* items,
                                                                gpointer self)
{
	library_window_on_media_altered ((LibraryWindow*) self);
}

static void
_library_window_on_metadata_writer_progress_metadata_writer_progress (MetadataWriter* _sender,
                                                                      guint completed,
                                                                      guint total,
                                                                      gpointer self)
{
	library_window_on_metadata_writer_progress ((LibraryWindow*) self, completed, total);
}

static void
_library_window_on_library_monitor_installed_library_monitor_pool_monitor_installed (LibraryMonitorPool* _sender,
                                                                                     LibraryMonitor* monitor,
                                                                                     gpointer self)
{
	library_window_on_library_monitor_installed ((LibraryWindow*) self, monitor);
}

static void
_library_window_on_library_monitor_destroyed_library_monitor_pool_monitor_destroyed (LibraryMonitorPool* _sender,
                                                                                     LibraryMonitor* monitor,
                                                                                     gpointer self)
{
	library_window_on_library_monitor_destroyed ((LibraryWindow*) self, monitor);
}

static void
_library_window_on_camera_added_camera_table_camera_added (CameraTable* _sender,
                                                           DiscoveredCamera* camera,
                                                           gpointer self)
{
	library_window_on_camera_added ((LibraryWindow*) self, camera);
}

static GType
library_window_sidebar_root_position_get_type_once (void)
{
	static const GEnumValue values[] = {{LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_LIBRARY, "LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_LIBRARY", "library"}, {LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_CAMERAS, "LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_CAMERAS", "cameras"}, {LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_SAVED_SEARCH, "LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_SAVED_SEARCH", "saved-search"}, {LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_EVENTS, "LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_EVENTS", "events"}, {LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_IMPORT_ROLL, "LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_IMPORT_ROLL", "import-roll"}, {LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_FOLDERS, "LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_FOLDERS", "folders"}, {LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_FACES, "LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_FACES", "faces"}, {LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_TAGS, "LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_TAGS", "tags"}, {0, NULL, NULL}};
	GType library_window_sidebar_root_position_type_id;
	library_window_sidebar_root_position_type_id = g_enum_register_static ("LibraryWindowSidebarRootPosition", values);
	return library_window_sidebar_root_position_type_id;
}

static GType
library_window_sidebar_root_position_get_type (void)
{
	static volatile gsize library_window_sidebar_root_position_type_id__once = 0;
	if (g_once_init_enter (&library_window_sidebar_root_position_type_id__once)) {
		GType library_window_sidebar_root_position_type_id;
		library_window_sidebar_root_position_type_id = library_window_sidebar_root_position_get_type_once ();
		g_once_init_leave (&library_window_sidebar_root_position_type_id__once, library_window_sidebar_root_position_type_id);
	}
	return library_window_sidebar_root_position_type_id__once;
}

static GType
library_window_target_type_get_type_once (void)
{
	static const GEnumValue values[] = {{LIBRARY_WINDOW_TARGET_TYPE_URI_LIST, "LIBRARY_WINDOW_TARGET_TYPE_URI_LIST", "uri-list"}, {LIBRARY_WINDOW_TARGET_TYPE_MEDIA_LIST, "LIBRARY_WINDOW_TARGET_TYPE_MEDIA_LIST", "media-list"}, {LIBRARY_WINDOW_TARGET_TYPE_TAG_PATH, "LIBRARY_WINDOW_TARGET_TYPE_TAG_PATH", "tag-path"}, {0, NULL, NULL}};
	GType library_window_target_type_type_id;
	library_window_target_type_type_id = g_enum_register_static ("LibraryWindowTargetType", values);
	return library_window_target_type_type_id;
}

GType
library_window_target_type_get_type (void)
{
	static volatile gsize library_window_target_type_type_id__once = 0;
	if (g_once_init_enter (&library_window_target_type_type_id__once)) {
		GType library_window_target_type_type_id;
		library_window_target_type_type_id = library_window_target_type_get_type_once ();
		g_once_init_leave (&library_window_target_type_type_id__once, library_window_target_type_type_id);
	}
	return library_window_target_type_type_id__once;
}

static void
_library_window_on_file_import_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self)
{
	library_window_on_file_import ((LibraryWindow*) self);
}

static void
_library_window_on_external_library_import_gsimple_action_activate_callback (GSimpleAction* action,
                                                                             GVariant* parameter,
                                                                             gpointer self)
{
	library_window_on_external_library_import ((LibraryWindow*) self);
}

static void
_library_window_on_preferences_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self)
{
	library_window_on_preferences ((LibraryWindow*) self);
}

static void
_library_window_on_empty_trash_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self)
{
	library_window_on_empty_trash ((LibraryWindow*) self);
}

static void
_library_window_on_jump_to_event_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self)
{
	library_window_on_jump_to_event ((LibraryWindow*) self);
}

static void
_library_window_on_find_gsimple_action_activate_callback (GSimpleAction* action,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	library_window_on_find ((LibraryWindow*) self);
}

static void
_library_window_on_new_search_gsimple_action_activate_callback (GSimpleAction* action,
                                                                GVariant* parameter,
                                                                gpointer self)
{
	library_window_on_new_search ((LibraryWindow*) self);
}

static void
_library_window_on_action_toggle_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self)
{
	library_window_on_action_toggle ((LibraryWindow*) self, action, parameter);
}

static void
_library_window_on_display_basic_properties_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                                  GVariant* value,
                                                                                  gpointer self)
{
	library_window_on_display_basic_properties ((LibraryWindow*) self, action, value);
}

static void
_library_window_on_display_extended_properties_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                                     GVariant* value,
                                                                                     gpointer self)
{
	library_window_on_display_extended_properties ((LibraryWindow*) self, action, value);
}

static void
_library_window_on_display_searchbar_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                           GVariant* value,
                                                                           gpointer self)
{
	library_window_on_display_searchbar ((LibraryWindow*) self, action, value);
}

static void
_library_window_on_display_sidebar_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                         GVariant* value,
                                                                         gpointer self)
{
	library_window_on_display_sidebar ((LibraryWindow*) self, action, value);
}

static void
_library_window_on_display_toolbar_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                         GVariant* value,
                                                                         gpointer self)
{
	library_window_on_display_toolbar ((LibraryWindow*) self, action, value);
}

static void
_library_window_on_action_radio_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self)
{
	library_window_on_action_radio ((LibraryWindow*) self, action, parameter);
}

static void
_library_window_on_events_sort_changed_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                             GVariant* value,
                                                                             gpointer self)
{
	library_window_on_events_sort_changed ((LibraryWindow*) self, action, value);
}

static void
_library_window_external_drop_handler_sidebar_tree_external_drop_handler (GdkDragContext* context,
                                                                          SidebarEntry* entry,
                                                                          GtkSelectionData* data,
                                                                          guint info,
                                                                          guint time,
                                                                          gpointer self)
{
	library_window_external_drop_handler ((LibraryWindow*) self, context, entry, data, info, time);
}

static void
_library_window_on_update_properties_now_one_shot_callback (gpointer self)
{
	library_window_on_update_properties_now ((LibraryWindow*) self);
}

LibraryWindow*
library_window_construct (GType object_type,
                          ProgressMonitor progress_monitor,
                          gpointer progress_monitor_target)
{
	LibraryWindow * self = NULL;
	SidebarTree* _tmp0_;
	SidebarTree* _tmp1_;
	SidebarTree* _tmp2_;
	SidebarTree* _tmp3_;
	SidebarTree* _tmp4_;
	SidebarTree* _tmp5_;
	LibraryBranch* _tmp6_;
	SidebarTree* _tmp7_;
	CameraBranch* _tmp8_;
	SidebarTree* _tmp9_;
	SearchesBranch* _tmp10_;
	SidebarTree* _tmp11_;
	EventsBranch* _tmp12_;
	SidebarTree* _tmp13_;
	ImportRollBranch* _tmp14_;
	SidebarTree* _tmp15_;
	FoldersBranch* _tmp16_;
	SidebarTree* _tmp17_;
	FacesBranch* _tmp18_;
	SidebarTree* _tmp19_;
	TagsBranch* _tmp20_;
	SidebarTree* _tmp21_;
	OneShotScheduler* _tmp22_;
	SearchFilterActions* _tmp23_;
	SearchFilterToolbar* _tmp24_;
	BasicProperties* _tmp25_;
	LibraryBranch* _tmp26_;
	LibraryPhotosEntry* _tmp27_;
	LibraryPhotosEntry* _tmp28_;
	Page* _tmp29_;
	Page* _tmp30_;
	GtkTargetEntry* main_window_dnd_targets = NULL;
	GtkTargetEntry _tmp42_;
	GtkTargetEntry _tmp43_;
	GtkTargetEntry* _tmp44_;
	gint main_window_dnd_targets_length1;
	gint _main_window_dnd_targets_size_;
	GtkTargetEntry* _tmp45_;
	gint _tmp45__length1;
	MetadataWriter* _tmp46_;
	MetadataWriter* _tmp47_;
	LibraryMonitor* monitor = NULL;
	LibraryMonitorPool* _tmp48_;
	LibraryMonitorPool* _tmp49_;
	LibraryMonitor* _tmp50_;
	LibraryMonitor* _tmp51_;
	LibraryMonitor* _tmp52_;
	LibraryMonitorPool* _tmp54_;
	LibraryMonitorPool* _tmp55_;
	LibraryMonitorPool* _tmp56_;
	LibraryMonitorPool* _tmp57_;
	CameraTable* _tmp58_;
	CameraTable* _tmp59_;
	static const gchar* accels[3] = {"<Primary>f", "F8", NULL};
	self = (LibraryWindow*) app_window_construct (object_type);
	_tmp0_ = sidebar_tree_new (LIBRARY_WINDOW_DND_TARGET_ENTRIES, G_N_ELEMENTS (LIBRARY_WINDOW_DND_TARGET_ENTRIES), GDK_ACTION_ASK, _library_window_external_drop_handler_sidebar_tree_external_drop_handler, self);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->sidebar_tree);
	self->priv->sidebar_tree = _tmp0_;
	_tmp1_ = self->priv->sidebar_tree;
	g_signal_connect_object (_tmp1_, "page-created", (GCallback) _library_window_on_page_created_sidebar_tree_page_created, self, 0);
	_tmp2_ = self->priv->sidebar_tree;
	g_signal_connect_object (_tmp2_, "destroying-page", (GCallback) _library_window_on_destroying_page_sidebar_tree_destroying_page, self, 0);
	_tmp3_ = self->priv->sidebar_tree;
	g_signal_connect_object (_tmp3_, "entry-selected", (GCallback) _library_window_on_sidebar_entry_selected_sidebar_tree_entry_selected, self, 0);
	_tmp4_ = self->priv->sidebar_tree;
	g_signal_connect_object (_tmp4_, "selected-entry-removed", (GCallback) _library_window_on_sidebar_selected_entry_removed_sidebar_tree_selected_entry_removed, self, 0);
	_tmp5_ = self->priv->sidebar_tree;
	_tmp6_ = self->priv->library_branch;
	sidebar_tree_graft (_tmp5_, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, SIDEBAR_TYPE_BRANCH, SidebarBranch), (gint) LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_LIBRARY);
	_tmp7_ = self->priv->sidebar_tree;
	_tmp8_ = self->priv->camera_branch;
	sidebar_tree_graft (_tmp7_, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, SIDEBAR_TYPE_BRANCH, SidebarBranch), (gint) LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_CAMERAS);
	_tmp9_ = self->priv->sidebar_tree;
	_tmp10_ = self->priv->saved_search_branch;
	sidebar_tree_graft (_tmp9_, G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, SIDEBAR_TYPE_BRANCH, SidebarBranch), (gint) LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_SAVED_SEARCH);
	_tmp11_ = self->priv->sidebar_tree;
	_tmp12_ = self->priv->events_branch;
	sidebar_tree_graft (_tmp11_, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, SIDEBAR_TYPE_BRANCH, SidebarBranch), (gint) LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_EVENTS);
	_tmp13_ = self->priv->sidebar_tree;
	_tmp14_ = self->priv->import_roll_branch;
	sidebar_tree_graft (_tmp13_, G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, SIDEBAR_TYPE_BRANCH, SidebarBranch), (gint) LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_IMPORT_ROLL);
	_tmp15_ = self->priv->sidebar_tree;
	_tmp16_ = self->priv->folders_branch;
	sidebar_tree_graft (_tmp15_, G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, SIDEBAR_TYPE_BRANCH, SidebarBranch), (gint) LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_FOLDERS);
	_tmp17_ = self->priv->sidebar_tree;
	_tmp18_ = self->priv->faces_branch;
	sidebar_tree_graft (_tmp17_, G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, SIDEBAR_TYPE_BRANCH, SidebarBranch), (gint) LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_FACES);
	_tmp19_ = self->priv->sidebar_tree;
	_tmp20_ = self->priv->tags_branch;
	sidebar_tree_graft (_tmp19_, G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, SIDEBAR_TYPE_BRANCH, SidebarBranch), (gint) LIBRARY_WINDOW_SIDEBAR_ROOT_POSITION_TAGS);
	_tmp21_ = self->priv->sidebar_tree;
	sidebar_tree_finish (_tmp21_);
	_tmp22_ = one_shot_scheduler_new ("LibraryWindow properties", _library_window_on_update_properties_now_one_shot_callback, self);
	_one_shot_scheduler_unref0 (self->priv->properties_scheduler);
	self->priv->properties_scheduler = _tmp22_;
	_tmp23_ = self->priv->search_actions;
	_tmp24_ = search_filter_toolbar_new (_tmp23_);
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->search_toolbar);
	self->priv->search_toolbar = _tmp24_;
	_tmp25_ = basic_properties_new ();
	g_object_ref_sink (_tmp25_);
	_g_object_unref0 (self->priv->basic_properties);
	self->priv->basic_properties = _tmp25_;
	_tmp26_ = self->priv->library_branch;
	_tmp27_ = library_branch_get_photos_entry (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
	_tmp30_ = _tmp29_;
	library_window_create_layout (self, _tmp30_);
	_g_object_unref0 (_tmp30_);
	library_window_load_configuration (self);
	{
		GeeIterator* _media_sources_it = NULL;
		MediaCollectionRegistry* _tmp31_;
		MediaCollectionRegistry* _tmp32_;
		GeeCollection* _tmp33_;
		GeeCollection* _tmp34_;
		GeeIterator* _tmp35_;
		GeeIterator* _tmp36_;
		_tmp31_ = media_collection_registry_get_instance ();
		_tmp32_ = _tmp31_;
		_tmp33_ = media_collection_registry_get_all (_tmp32_);
		_tmp34_ = _tmp33_;
		_tmp35_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, GEE_TYPE_ITERABLE, GeeIterable));
		_tmp36_ = _tmp35_;
		_g_object_unref0 (_tmp34_);
		_media_collection_registry_unref0 (_tmp32_);
		_media_sources_it = _tmp36_;
		while (TRUE) {
			GeeIterator* _tmp37_;
			MediaSourceCollection* media_sources = NULL;
			GeeIterator* _tmp38_;
			gpointer _tmp39_;
			MediaSourceCollection* _tmp40_;
			MediaSourceCollection* _tmp41_;
			_tmp37_ = _media_sources_it;
			if (!gee_iterator_next (_tmp37_)) {
				break;
			}
			_tmp38_ = _media_sources_it;
			_tmp39_ = gee_iterator_get (_tmp38_);
			media_sources = (MediaSourceCollection*) _tmp39_;
			_tmp40_ = media_sources;
			g_signal_connect_object (_tmp40_, "trashcan-contents-altered", (GCallback) _library_window_on_trashcan_contents_altered_media_source_collection_trashcan_contents_altered, self, 0);
			_tmp41_ = media_sources;
			g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, TYPE_DATA_COLLECTION, DataCollection), "items-altered", (GCallback) _library_window_on_media_altered_data_collection_items_altered, self, 0);
			_data_collection_unref0 (media_sources);
		}
		_g_object_unref0 (_media_sources_it);
	}
	_tmp42_ = LIBRARY_WINDOW_DND_TARGET_ENTRIES[LIBRARY_WINDOW_TARGET_TYPE_URI_LIST];
	_tmp43_ = LIBRARY_WINDOW_DND_TARGET_ENTRIES[LIBRARY_WINDOW_TARGET_TYPE_MEDIA_LIST];
	_tmp44_ = g_new0 (GtkTargetEntry, 2);
	_tmp44_[0] = _tmp42_;
	_tmp44_[1] = _tmp43_;
	main_window_dnd_targets = _tmp44_;
	main_window_dnd_targets_length1 = 2;
	_main_window_dnd_targets_size_ = main_window_dnd_targets_length1;
	_tmp45_ = main_window_dnd_targets;
	_tmp45__length1 = main_window_dnd_targets_length1;
	gtk_drag_dest_set (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), GTK_DEST_DEFAULT_ALL, _tmp45_, (gint) _tmp45__length1, (GDK_ACTION_COPY | GDK_ACTION_LINK) | GDK_ACTION_ASK);
	_tmp46_ = metadata_writer_get_instance ();
	_tmp47_ = _tmp46_;
	g_signal_connect_object (_tmp47_, "progress", (GCallback) _library_window_on_metadata_writer_progress_metadata_writer_progress, self, 0);
	_g_object_unref0 (_tmp47_);
	_tmp48_ = library_monitor_pool_get_instance ();
	_tmp49_ = _tmp48_;
	_tmp50_ = library_monitor_pool_get_monitor (_tmp49_);
	_tmp51_ = _tmp50_;
	_library_monitor_pool_unref0 (_tmp49_);
	monitor = _tmp51_;
	_tmp52_ = monitor;
	if (_tmp52_ != NULL) {
		LibraryMonitor* _tmp53_;
		_tmp53_ = monitor;
		library_window_on_library_monitor_installed (self, _tmp53_);
	}
	_tmp54_ = library_monitor_pool_get_instance ();
	_tmp55_ = _tmp54_;
	g_signal_connect_object (_tmp55_, "monitor-installed", (GCallback) _library_window_on_library_monitor_installed_library_monitor_pool_monitor_installed, self, 0);
	_library_monitor_pool_unref0 (_tmp55_);
	_tmp56_ = library_monitor_pool_get_instance ();
	_tmp57_ = _tmp56_;
	g_signal_connect_object (_tmp57_, "monitor-destroyed", (GCallback) _library_window_on_library_monitor_destroyed_library_monitor_pool_monitor_destroyed, self, 0);
	_library_monitor_pool_unref0 (_tmp57_);
	_tmp58_ = camera_table_get_instance ();
	_tmp59_ = _tmp58_;
	g_signal_connect_object (_tmp59_, "camera-added", (GCallback) _library_window_on_camera_added_camera_table_camera_added, self, 0);
	_camera_table_unref0 (_tmp59_);
	application_set_accels_for_action ("win.CommonDisplaySearchbar", accels, (gint) G_N_ELEMENTS (accels));
	_g_object_unref0 (monitor);
	main_window_dnd_targets = (g_free (main_window_dnd_targets), NULL);
	return self;
}

LibraryWindow*
library_window_new (ProgressMonitor progress_monitor,
                    gpointer progress_monitor_target)
{
	return library_window_construct (TYPE_LIBRARY_WINDOW, progress_monitor, progress_monitor_target);
}

static void
_library_window_on_library_monitor_discovery_started_directory_monitor_discovery_started (DirectoryMonitor* _sender,
                                                                                          gpointer self)
{
	library_window_on_library_monitor_discovery_started ((LibraryWindow*) self);
}

static void
_library_window_on_library_monitor_discovery_completed_directory_monitor_discovery_completed (DirectoryMonitor* _sender,
                                                                                              gpointer self)
{
	library_window_on_library_monitor_discovery_completed ((LibraryWindow*) self);
}

static void
_library_window_on_library_monitor_discovery_completed_directory_monitor_closed (DirectoryMonitor* _sender,
                                                                                 gpointer self)
{
	library_window_on_library_monitor_discovery_completed ((LibraryWindow*) self);
}

static void
_library_window_on_library_monitor_auto_update_progress_library_monitor_auto_update_progress (LibraryMonitor* _sender,
                                                                                              gint completed_files,
                                                                                              gint total_files,
                                                                                              gpointer self)
{
	library_window_on_library_monitor_auto_update_progress ((LibraryWindow*) self, completed_files, total_files);
}

static void
_library_window_on_library_monitor_auto_import_preparing_library_monitor_auto_import_preparing (LibraryMonitor* _sender,
                                                                                                gpointer self)
{
	library_window_on_library_monitor_auto_import_preparing ((LibraryWindow*) self);
}

static void
_library_window_on_library_monitor_auto_import_progress_library_monitor_auto_import_progress (LibraryMonitor* _sender,
                                                                                              guint64 completed_bytes,
                                                                                              guint64 total_bytes,
                                                                                              gpointer self)
{
	library_window_on_library_monitor_auto_import_progress ((LibraryWindow*) self, completed_bytes, total_bytes);
}

static void
library_window_on_library_monitor_installed (LibraryWindow* self,
                                             LibraryMonitor* monitor)
{
	GFile* _tmp0_;
	GFile* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_LIBRARY_MONITOR (monitor));
	_tmp0_ = directory_monitor_get_root (G_TYPE_CHECK_INSTANCE_CAST (monitor, TYPE_DIRECTORY_MONITOR, DirectoryMonitor));
	_tmp1_ = _tmp0_;
	_tmp2_ = g_file_get_path (_tmp1_);
	_tmp3_ = _tmp2_;
	g_debug ("LibraryWindow.vala:239: on_library_monitor_installed: %s", _tmp3_);
	_g_free0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (monitor, TYPE_DIRECTORY_MONITOR, DirectoryMonitor), "discovery-started", (GCallback) _library_window_on_library_monitor_discovery_started_directory_monitor_discovery_started, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (monitor, TYPE_DIRECTORY_MONITOR, DirectoryMonitor), "discovery-completed", (GCallback) _library_window_on_library_monitor_discovery_completed_directory_monitor_discovery_completed, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (monitor, TYPE_DIRECTORY_MONITOR, DirectoryMonitor), "closed", (GCallback) _library_window_on_library_monitor_discovery_completed_directory_monitor_closed, self, 0);
	g_signal_connect_object (monitor, "auto-update-progress", (GCallback) _library_window_on_library_monitor_auto_update_progress_library_monitor_auto_update_progress, self, 0);
	g_signal_connect_object (monitor, "auto-import-preparing", (GCallback) _library_window_on_library_monitor_auto_import_preparing_library_monitor_auto_import_preparing, self, 0);
	g_signal_connect_object (monitor, "auto-import-progress", (GCallback) _library_window_on_library_monitor_auto_import_progress_library_monitor_auto_import_progress, self, 0);
}

static void
library_window_on_library_monitor_destroyed (LibraryWindow* self,
                                             LibraryMonitor* monitor)
{
	GFile* _tmp0_;
	GFile* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	guint _tmp4_;
	guint _tmp5_;
	guint _tmp6_;
	guint _tmp7_;
	guint _tmp8_;
	guint _tmp9_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_LIBRARY_MONITOR (monitor));
	_tmp0_ = directory_monitor_get_root (G_TYPE_CHECK_INSTANCE_CAST (monitor, TYPE_DIRECTORY_MONITOR, DirectoryMonitor));
	_tmp1_ = _tmp0_;
	_tmp2_ = g_file_get_path (_tmp1_);
	_tmp3_ = _tmp2_;
	g_debug ("LibraryWindow.vala:250: on_library_monitor_destroyed: %s", _tmp3_);
	_g_free0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	g_signal_parse_name ("discovery-started", TYPE_DIRECTORY_MONITOR, &_tmp4_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (monitor, TYPE_DIRECTORY_MONITOR, DirectoryMonitor), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _library_window_on_library_monitor_discovery_started_directory_monitor_discovery_started, self);
	g_signal_parse_name ("discovery-completed", TYPE_DIRECTORY_MONITOR, &_tmp5_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (monitor, TYPE_DIRECTORY_MONITOR, DirectoryMonitor), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _library_window_on_library_monitor_discovery_completed_directory_monitor_discovery_completed, self);
	g_signal_parse_name ("closed", TYPE_DIRECTORY_MONITOR, &_tmp6_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (monitor, TYPE_DIRECTORY_MONITOR, DirectoryMonitor), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _library_window_on_library_monitor_discovery_completed_directory_monitor_closed, self);
	g_signal_parse_name ("auto-update-progress", TYPE_LIBRARY_MONITOR, &_tmp7_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (monitor, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, 0, NULL, (GCallback) _library_window_on_library_monitor_auto_update_progress_library_monitor_auto_update_progress, self);
	g_signal_parse_name ("auto-import-preparing", TYPE_LIBRARY_MONITOR, &_tmp8_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (monitor, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp8_, 0, NULL, (GCallback) _library_window_on_library_monitor_auto_import_preparing_library_monitor_auto_import_preparing, self);
	g_signal_parse_name ("auto-import-progress", TYPE_LIBRARY_MONITOR, &_tmp9_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (monitor, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp9_, 0, NULL, (GCallback) _library_window_on_library_monitor_auto_import_progress_library_monitor_auto_import_progress, self);
}

static GVariant*
_variant_new1 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static GVariant*
_variant_new2 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static GVariant*
_variant_new3 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static void
library_window_real_add_actions (AppWindow* base)
{
	LibraryWindow * self;
	SearchFilterActions* _tmp0_;
	gint _tmp1_ = 0;
	GActionEntry* _tmp2_;
	SearchFilterActions* _tmp3_;
	GAction* _tmp4_;
	ConfigFacade* _tmp5_;
	ConfigFacade* _tmp6_;
	GVariant* _tmp7_;
	GAction* _tmp8_;
	GVariant* _tmp9_;
	GAction* _tmp10_;
	GVariant* _tmp11_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	APP_WINDOW_CLASS (library_window_parent_class)->add_actions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow));
	g_action_map_add_action_entries (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), LIBRARY_WINDOW_common_actions, (gint) G_N_ELEMENTS (LIBRARY_WINDOW_common_actions), self);
	_tmp0_ = self->priv->search_actions;
	_tmp2_ = search_filter_actions_get_actions (_tmp0_, &_tmp1_);
	_tmp3_ = self->priv->search_actions;
	g_action_map_add_action_entries (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), _tmp2_, (gint) _tmp1_, _tmp3_);
	_tmp4_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonDisplaySearchbar");
	_tmp5_ = config_facade_get_instance ();
	_tmp6_ = _tmp5_;
	_tmp7_ = _variant_new1 (configuration_facade_get_display_search_bar (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	g_action_change_state (_tmp4_, _tmp7_);
	_g_variant_unref0 (_tmp7_);
	_g_object_unref0 (_tmp6_);
	_tmp8_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonDisplaySidebar");
	_tmp9_ = _variant_new2 (library_window_is_sidebar_visible (self));
	g_action_change_state (_tmp8_, _tmp9_);
	_g_variant_unref0 (_tmp9_);
	_tmp10_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonDisplayToolbar");
	_tmp11_ = _variant_new3 (library_window_is_toolbar_visible (self));
	g_action_change_state (_tmp10_, _tmp11_);
	_g_variant_unref0 (_tmp11_);
}

static void
_library_window_on_view_filter_installed_view_collection_view_filter_installed (ViewCollection* _sender,
                                                                                ViewFilter* filer,
                                                                                gpointer self)
{
	library_window_on_view_filter_installed ((LibraryWindow*) self, filer);
}

static void
_library_window_on_view_filter_removed_view_collection_view_filter_removed (ViewCollection* _sender,
                                                                            ViewFilter* filer,
                                                                            gpointer self)
{
	library_window_on_view_filter_removed ((LibraryWindow*) self, filer);
}

static void
library_window_real_switched_pages (PageWindow* base,
                                    Page* old_page,
                                    Page* new_page)
{
	LibraryWindow * self;
	SearchFilterActions* _tmp10_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	g_return_if_fail ((old_page == NULL) || IS_PAGE (old_page));
	g_return_if_fail ((new_page == NULL) || IS_PAGE (new_page));
	PAGE_WINDOW_CLASS (library_window_parent_class)->switched_pages (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), TYPE_PAGE_WINDOW, PageWindow), old_page, new_page);
	if (old_page != NULL) {
		ViewCollection* _tmp0_;
		ViewCollection* _tmp1_;
		guint _tmp2_;
		ViewCollection* _tmp3_;
		ViewCollection* _tmp4_;
		guint _tmp5_;
		_tmp0_ = page_get_view (old_page);
		_tmp1_ = _tmp0_;
		g_signal_parse_name ("view-filter-installed", TYPE_VIEW_COLLECTION, &_tmp2_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _library_window_on_view_filter_installed_view_collection_view_filter_installed, self);
		_data_collection_unref0 (_tmp1_);
		_tmp3_ = page_get_view (old_page);
		_tmp4_ = _tmp3_;
		g_signal_parse_name ("view-filter-removed", TYPE_VIEW_COLLECTION, &_tmp5_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _library_window_on_view_filter_removed_view_collection_view_filter_removed, self);
		_data_collection_unref0 (_tmp4_);
	}
	if (new_page != NULL) {
		ViewCollection* _tmp6_;
		ViewCollection* _tmp7_;
		ViewCollection* _tmp8_;
		ViewCollection* _tmp9_;
		_tmp6_ = page_get_view (new_page);
		_tmp7_ = _tmp6_;
		g_signal_connect_object (_tmp7_, "view-filter-installed", (GCallback) _library_window_on_view_filter_installed_view_collection_view_filter_installed, self, 0);
		_data_collection_unref0 (_tmp7_);
		_tmp8_ = page_get_view (new_page);
		_tmp9_ = _tmp8_;
		g_signal_connect_object (_tmp9_, "view-filter-removed", (GCallback) _library_window_on_view_filter_removed_view_collection_view_filter_removed, self, 0);
		_data_collection_unref0 (_tmp9_);
	}
	_tmp10_ = self->priv->search_actions;
	search_filter_actions_monitor_page_contents (_tmp10_, old_page, new_page);
}

static void
_library_window_on_view_filter_refreshed_view_filter_refresh (ViewFilter* _sender,
                                                              gpointer self)
{
	library_window_on_view_filter_refreshed ((LibraryWindow*) self);
}

static void
library_window_on_view_filter_installed (LibraryWindow* self,
                                         ViewFilter* filter)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_VIEW_FILTER (filter));
	g_signal_connect_object (filter, "refresh", (GCallback) _library_window_on_view_filter_refreshed_view_filter_refresh, self, 0);
}

static void
library_window_on_view_filter_removed (LibraryWindow* self,
                                       ViewFilter* filter)
{
	guint _tmp0_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_VIEW_FILTER (filter));
	g_signal_parse_name ("refresh", TYPE_VIEW_FILTER, &_tmp0_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (filter, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp0_, 0, NULL, (GCallback) _library_window_on_view_filter_refreshed_view_filter_refresh, self);
}

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

static GVariant*
_variant_new4 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static void
library_window_on_view_filter_refreshed (LibraryWindow* self)
{
	Page* _tmp0_;
	Page* _tmp1_;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	gboolean _tmp4_;
	GAction* action = NULL;
	GAction* _tmp5_;
	GAction* _tmp6_;
	GAction* _tmp7_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp1_ = _tmp0_;
	_tmp2_ = page_get_view (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = !view_collection_are_items_filtered_out (_tmp3_);
	_data_collection_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	if (_tmp4_) {
		return;
	}
	_tmp5_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonDisplaySearchbar");
	_tmp6_ = _g_object_ref0 (_tmp5_);
	action = _tmp6_;
	_tmp7_ = action;
	if (_tmp7_ != NULL) {
		GAction* _tmp8_;
		GVariant* _tmp9_;
		_tmp8_ = action;
		_tmp9_ = _variant_new4 (TRUE);
		g_action_change_state (_tmp8_, _tmp9_);
		_g_variant_unref0 (_tmp9_);
	}
	_g_object_unref0 (action);
}

static void
library_window_real_show_all (GtkWidget* base)
{
	LibraryWindow * self;
	GAction* basic_properties_action = NULL;
	Page* _tmp0_;
	Page* _tmp1_;
	GAction* _tmp2_;
	GAction* _tmp3_;
	GAction* _tmp4_;
	GAction* _tmp5_;
	GVariant* _tmp6_;
	GVariant* _tmp7_;
	gboolean _tmp8_;
	CheckerboardPage* current_page = NULL;
	Page* _tmp10_;
	CheckerboardPage* _tmp11_;
	CheckerboardPage* _tmp12_;
	CheckerboardPage* _tmp14_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	GTK_WIDGET_CLASS (library_window_parent_class)->show_all (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), gtk_widget_get_type (), GtkWidget));
	_tmp0_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp1_ = _tmp0_;
	_tmp2_ = page_get_common_action (_tmp1_, "CommonDisplayBasicProperties", TRUE);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	basic_properties_action = _tmp3_;
	_tmp4_ = basic_properties_action;
	_vala_assert (_tmp4_ != NULL, "basic_properties_action != null");
	_tmp5_ = basic_properties_action;
	_tmp6_ = g_action_get_state (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = !g_variant_get_boolean (_tmp7_);
	_g_variant_unref0 (_tmp7_);
	if (_tmp8_) {
		GtkFrame* _tmp9_;
		_tmp9_ = self->priv->bottom_frame;
		gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
	}
	_tmp10_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp11_ = IS_CHECKERBOARD_PAGE (_tmp10_) ? ((CheckerboardPage*) _tmp10_) : NULL;
	if (_tmp11_ == NULL) {
		_g_object_unref0 (_tmp10_);
	}
	current_page = _tmp11_;
	_tmp12_ = current_page;
	if (_tmp12_ != NULL) {
		CheckerboardPage* _tmp13_;
		_tmp13_ = current_page;
		library_window_init_view_filter (self, _tmp13_);
	}
	_tmp14_ = current_page;
	library_window_toggle_search_bar (self, library_window_should_show_search_bar (self), _tmp14_);
	library_window_set_sidebar_visible (self, library_window_is_sidebar_visible (self));
	_g_object_unref0 (current_page);
	_g_object_unref0 (basic_properties_action);
}

LibraryWindow*
library_window_get_app (void)
{
	AppWindow* _tmp0_;
	AppWindow* _tmp1_;
	LibraryWindow* _tmp2_;
	LibraryWindow* result;
	_tmp0_ = app_window_instance;
	_vala_assert (IS_LIBRARY_WINDOW (_tmp0_), "instance is LibraryWindow");
	_tmp1_ = app_window_instance;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_LIBRARY_WINDOW, LibraryWindow));
	result = _tmp2_;
	return result;
}

gboolean
library_window_is_mount_uri_supported (const gchar* uri)
{
	gboolean result;
	g_return_val_if_fail (uri != NULL, FALSE);
	{
		const gchar** scheme_collection = NULL;
		gint scheme_collection_length1 = 0;
		gint _scheme_collection_size_ = 0;
		gint scheme_it = 0;
		scheme_collection = LIBRARY_WINDOW_SUPPORTED_MOUNT_SCHEMES;
		scheme_collection_length1 = G_N_ELEMENTS (LIBRARY_WINDOW_SUPPORTED_MOUNT_SCHEMES);
		for (scheme_it = 0; scheme_it < scheme_collection_length1; scheme_it = scheme_it + 1) {
			gchar* _tmp0_;
			gchar* scheme = NULL;
			_tmp0_ = g_strdup (scheme_collection[scheme_it]);
			scheme = _tmp0_;
			{
				const gchar* _tmp1_;
				_tmp1_ = scheme;
				if (g_str_has_prefix (uri, _tmp1_)) {
					result = TRUE;
					_g_free0 (scheme);
					return result;
				}
				_g_free0 (scheme);
			}
		}
	}
	result = FALSE;
	return result;
}

static gchar*
library_window_real_get_app_role (AppWindow* base)
{
	LibraryWindow * self;
	gchar* _tmp0_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	_tmp0_ = g_strdup (RESOURCES_APP_LIBRARY_ROLE);
	result = _tmp0_;
	return result;
}

void
library_window_rename_tag_in_sidebar (LibraryWindow* self,
                                      Tag* tag)
{
	TagsSidebarEntry* entry = NULL;
	TagsBranch* _tmp0_;
	TagsSidebarEntry* _tmp1_;
	TagsSidebarEntry* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_TAG (tag));
	_tmp0_ = self->priv->tags_branch;
	_tmp1_ = tags_branch_get_entry_for_tag (_tmp0_, tag);
	entry = _tmp1_;
	_tmp2_ = entry;
	if (_tmp2_ != NULL) {
		SidebarTree* _tmp3_;
		TagsSidebarEntry* _tmp4_;
		_tmp3_ = self->priv->sidebar_tree;
		_tmp4_ = entry;
		sidebar_tree_rename_entry_in_place (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, SIDEBAR_TYPE_ENTRY, SidebarEntry));
	} else {
		g_debug ("LibraryWindow.vala:376: No tag entry found for rename");
	}
	_g_object_unref0 (entry);
}

void
library_window_rename_event_in_sidebar (LibraryWindow* self,
                                        Event* event)
{
	EventsEventEntry* entry = NULL;
	EventsBranch* _tmp0_;
	EventsEventEntry* _tmp1_;
	EventsEventEntry* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_EVENT (event));
	_tmp0_ = self->priv->events_branch;
	_tmp1_ = events_branch_get_entry_for_event (_tmp0_, event);
	entry = _tmp1_;
	_tmp2_ = entry;
	if (_tmp2_ != NULL) {
		SidebarTree* _tmp3_;
		EventsEventEntry* _tmp4_;
		_tmp3_ = self->priv->sidebar_tree;
		_tmp4_ = entry;
		sidebar_tree_rename_entry_in_place (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, SIDEBAR_TYPE_ENTRY, SidebarEntry));
	} else {
		g_debug ("LibraryWindow.vala:384: No event entry found for rename");
	}
	_g_object_unref0 (entry);
}

void
library_window_rename_search_in_sidebar (LibraryWindow* self,
                                         SavedSearch* search)
{
	SearchesSidebarEntry* entry = NULL;
	SearchesBranch* _tmp0_;
	SearchesSidebarEntry* _tmp1_;
	SearchesSidebarEntry* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_SAVED_SEARCH (search));
	_tmp0_ = self->priv->saved_search_branch;
	_tmp1_ = searches_branch_get_entry_for_saved_search (_tmp0_, search);
	entry = _tmp1_;
	_tmp2_ = entry;
	if (_tmp2_ != NULL) {
		SidebarTree* _tmp3_;
		SearchesSidebarEntry* _tmp4_;
		_tmp3_ = self->priv->sidebar_tree;
		_tmp4_ = entry;
		sidebar_tree_rename_entry_in_place (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, SIDEBAR_TYPE_ENTRY, SidebarEntry));
	} else {
		g_debug ("LibraryWindow.vala:392: No search entry found for rename");
	}
	_g_object_unref0 (entry);
}

void
library_window_rename_face_in_sidebar (LibraryWindow* self,
                                       Face* face)
{
	FacesSidebarEntry* entry = NULL;
	FacesBranch* _tmp0_;
	FacesSidebarEntry* _tmp1_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_FACE (face));
	_tmp0_ = self->priv->faces_branch;
	_tmp1_ = faces_branch_get_entry_for_face (_tmp0_, face);
	entry = _tmp1_;
	if (entry != NULL) {
		SidebarTree* _tmp2_;
		_tmp2_ = self->priv->sidebar_tree;
		sidebar_tree_rename_entry_in_place (_tmp2_, G_TYPE_CHECK_INSTANCE_CAST (entry, SIDEBAR_TYPE_ENTRY, SidebarEntry));
	} else {
		g_assert_not_reached ();
	}
	_g_object_unref0 (entry);
}

static void
library_window_real_on_quit (AppWindow* base)
{
	LibraryWindow * self;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	Dimensions _tmp2_;
	ConfigFacade* _tmp3_;
	ConfigFacade* _tmp4_;
	GtkPaned* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow)->dimensions;
	configuration_facade_set_library_window_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow)->maximized, &_tmp2_);
	_g_object_unref0 (_tmp1_);
	_tmp3_ = config_facade_get_instance ();
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->client_paned;
	_tmp6_ = gtk_paned_get_position (_tmp5_);
	_tmp7_ = _tmp6_;
	configuration_facade_set_sidebar_position (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp7_);
	_g_object_unref0 (_tmp4_);
	APP_WINDOW_CLASS (library_window_parent_class)->on_quit (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow));
}

static Photo*
library_window_get_start_fullscreen_photo (LibraryWindow* self,
                                           CollectionPage* page)
{
	ViewCollection* view = NULL;
	ViewCollection* _tmp0_;
	GeeList* _tmp1_ = NULL;
	ViewCollection* _tmp2_;
	GeeList* sources = NULL;
	GeeList* _tmp7_;
	Photo* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	GeeList* _tmp10_;
	Photo* _tmp16_;
	Photo* result;
	g_return_val_if_fail (IS_LIBRARY_WINDOW (self), NULL);
	g_return_val_if_fail (IS_COLLECTION_PAGE (page), NULL);
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (page, TYPE_PAGE, Page));
	view = _tmp0_;
	_tmp2_ = view;
	if (view_collection_get_selected_count (_tmp2_) > 0) {
		ViewCollection* _tmp3_;
		GeeList* _tmp4_;
		_tmp3_ = view;
		_tmp4_ = view_collection_get_selected_sources_of_type (_tmp3_, TYPE_LIBRARY_PHOTO);
		_g_object_unref0 (_tmp1_);
		_tmp1_ = _tmp4_;
	} else {
		ViewCollection* _tmp5_;
		GeeList* _tmp6_;
		_tmp5_ = view;
		_tmp6_ = view_collection_get_sources_of_type (_tmp5_, TYPE_LIBRARY_PHOTO);
		_g_object_unref0 (_tmp1_);
		_tmp1_ = _tmp6_;
	}
	_tmp7_ = _tmp1_;
	_tmp1_ = NULL;
	sources = _tmp7_;
	_tmp10_ = sources;
	if (_tmp10_ != NULL) {
		GeeList* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		_tmp11_ = sources;
		_tmp12_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp13_ = _tmp12_;
		_tmp9_ = _tmp13_ != 0;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		GeeList* _tmp14_;
		gpointer _tmp15_;
		_tmp14_ = sources;
		_tmp15_ = gee_list_get (_tmp14_, 0);
		_g_object_unref0 (_tmp8_);
		_tmp8_ = G_TYPE_CHECK_INSTANCE_CAST ((DataSource*) _tmp15_, TYPE_PHOTO, Photo);
	} else {
		_g_object_unref0 (_tmp8_);
		_tmp8_ = NULL;
	}
	_tmp16_ = _tmp8_;
	_tmp8_ = NULL;
	result = _tmp16_;
	_g_object_unref0 (_tmp8_);
	_g_object_unref0 (sources);
	_g_object_unref0 (_tmp1_);
	_data_collection_unref0 (view);
	return result;
}

static gboolean
library_window_get_fullscreen_photo (LibraryWindow* self,
                                     Page* page,
                                     CollectionPage** collection,
                                     Photo** start,
                                     ViewCollection** view_collection)
{
	CollectionPage* _vala_collection = NULL;
	Photo* _vala_start = NULL;
	ViewCollection* _vala_view_collection = NULL;
	gboolean result;
	g_return_val_if_fail (IS_LIBRARY_WINDOW (self), FALSE);
	g_return_val_if_fail (IS_PAGE (page), FALSE);
	_g_object_unref0 (_vala_collection);
	_vala_collection = NULL;
	_g_object_unref0 (_vala_start);
	_vala_start = NULL;
	_data_collection_unref0 (_vala_view_collection);
	_vala_view_collection = NULL;
	if (IS_COLLECTION_PAGE (page)) {
		CollectionPage* _tmp0_;
		Photo* photo = NULL;
		CollectionPage* _tmp1_;
		Photo* _tmp2_;
		Photo* _tmp3_;
		Photo* _tmp4_;
		Photo* _tmp5_;
		_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (page, TYPE_COLLECTION_PAGE, CollectionPage));
		_g_object_unref0 (_vala_collection);
		_vala_collection = _tmp0_;
		_tmp1_ = _vala_collection;
		_tmp2_ = library_window_get_start_fullscreen_photo (self, _tmp1_);
		photo = _tmp2_;
		_tmp3_ = photo;
		if (_tmp3_ == NULL) {
			result = FALSE;
			_g_object_unref0 (photo);
			if (collection) {
				*collection = _vala_collection;
			} else {
				_g_object_unref0 (_vala_collection);
			}
			if (start) {
				*start = _vala_start;
			} else {
				_g_object_unref0 (_vala_start);
			}
			if (view_collection) {
				*view_collection = _vala_view_collection;
			} else {
				_data_collection_unref0 (_vala_view_collection);
			}
			return result;
		}
		_tmp4_ = photo;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_g_object_unref0 (_vala_start);
		_vala_start = _tmp5_;
		_data_collection_unref0 (_vala_view_collection);
		_vala_view_collection = NULL;
		result = TRUE;
		_g_object_unref0 (photo);
		if (collection) {
			*collection = _vala_collection;
		} else {
			_g_object_unref0 (_vala_collection);
		}
		if (start) {
			*start = _vala_start;
		} else {
			_g_object_unref0 (_vala_start);
		}
		if (view_collection) {
			*view_collection = _vala_view_collection;
		} else {
			_data_collection_unref0 (_vala_view_collection);
		}
		return result;
	}
	if (IS_EVENTS_DIRECTORY_PAGE (page)) {
		ViewCollection* view = NULL;
		ViewCollection* _tmp6_;
		ViewCollection* _tmp7_;
		Event* event = NULL;
		ViewCollection* _tmp8_;
		DataObject* _tmp9_;
		DataView* _tmp10_;
		DataSource* _tmp11_;
		Event* _tmp12_;
		Event* _tmp13_;
		EventsEventEntry* entry = NULL;
		EventsBranch* _tmp14_;
		Event* _tmp15_;
		EventsEventEntry* _tmp16_;
		EventsEventEntry* _tmp17_;
		EventsEventEntry* _tmp18_;
		Page* _tmp19_;
		Photo* photo = NULL;
		CollectionPage* _tmp20_;
		Photo* _tmp21_;
		Photo* _tmp22_;
		Photo* _tmp23_;
		Photo* _tmp24_;
		_tmp6_ = page_get_view (page);
		view = _tmp6_;
		_tmp7_ = view;
		if (data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_DATA_COLLECTION, DataCollection)) == 0) {
			result = FALSE;
			_data_collection_unref0 (view);
			if (collection) {
				*collection = _vala_collection;
			} else {
				_g_object_unref0 (_vala_collection);
			}
			if (start) {
				*start = _vala_start;
			} else {
				_g_object_unref0 (_vala_start);
			}
			if (view_collection) {
				*view_collection = _vala_view_collection;
			} else {
				_data_collection_unref0 (_vala_view_collection);
			}
			return result;
		}
		_tmp8_ = view;
		_tmp9_ = data_collection_get_at (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_DATA_COLLECTION, DataCollection), 0);
		_tmp10_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_DATA_VIEW, DataView);
		_tmp11_ = data_view_get_source (_tmp10_);
		_tmp12_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_EVENT, Event);
		_g_object_unref0 (_tmp10_);
		event = _tmp12_;
		_tmp13_ = event;
		if (_tmp13_ == NULL) {
			result = FALSE;
			_g_object_unref0 (event);
			_data_collection_unref0 (view);
			if (collection) {
				*collection = _vala_collection;
			} else {
				_g_object_unref0 (_vala_collection);
			}
			if (start) {
				*start = _vala_start;
			} else {
				_g_object_unref0 (_vala_start);
			}
			if (view_collection) {
				*view_collection = _vala_view_collection;
			} else {
				_data_collection_unref0 (_vala_view_collection);
			}
			return result;
		}
		_tmp14_ = self->priv->events_branch;
		_tmp15_ = event;
		_tmp16_ = events_branch_get_entry_for_event (_tmp14_, _tmp15_);
		entry = _tmp16_;
		_tmp17_ = entry;
		if (_tmp17_ == NULL) {
			result = FALSE;
			_g_object_unref0 (entry);
			_g_object_unref0 (event);
			_data_collection_unref0 (view);
			if (collection) {
				*collection = _vala_collection;
			} else {
				_g_object_unref0 (_vala_collection);
			}
			if (start) {
				*start = _vala_start;
			} else {
				_g_object_unref0 (_vala_start);
			}
			if (view_collection) {
				*view_collection = _vala_view_collection;
			} else {
				_data_collection_unref0 (_vala_view_collection);
			}
			return result;
		}
		_tmp18_ = entry;
		_tmp19_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
		_g_object_unref0 (_vala_collection);
		_vala_collection = G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_EVENT_PAGE, EventPage), TYPE_COLLECTION_PAGE, CollectionPage);
		_tmp20_ = _vala_collection;
		_tmp21_ = library_window_get_start_fullscreen_photo (self, _tmp20_);
		photo = _tmp21_;
		_tmp22_ = photo;
		if (_tmp22_ == NULL) {
			result = FALSE;
			_g_object_unref0 (photo);
			_g_object_unref0 (entry);
			_g_object_unref0 (event);
			_data_collection_unref0 (view);
			if (collection) {
				*collection = _vala_collection;
			} else {
				_g_object_unref0 (_vala_collection);
			}
			if (start) {
				*start = _vala_start;
			} else {
				_g_object_unref0 (_vala_start);
			}
			if (view_collection) {
				*view_collection = _vala_view_collection;
			} else {
				_data_collection_unref0 (_vala_view_collection);
			}
			return result;
		}
		_tmp23_ = photo;
		_tmp24_ = _g_object_ref0 (_tmp23_);
		_g_object_unref0 (_vala_start);
		_vala_start = _tmp24_;
		_data_collection_unref0 (_vala_view_collection);
		_vala_view_collection = NULL;
		result = TRUE;
		_g_object_unref0 (photo);
		_g_object_unref0 (entry);
		_g_object_unref0 (event);
		_data_collection_unref0 (view);
		if (collection) {
			*collection = _vala_collection;
		} else {
			_g_object_unref0 (_vala_collection);
		}
		if (start) {
			*start = _vala_start;
		} else {
			_g_object_unref0 (_vala_start);
		}
		if (view_collection) {
			*view_collection = _vala_view_collection;
		} else {
			_data_collection_unref0 (_vala_view_collection);
		}
		return result;
	}
	if (IS_LIBRARY_PHOTO_PAGE (page)) {
		LibraryPhotoPage* photo_page = NULL;
		LibraryPhotoPage* _tmp25_;
		CollectionPage* controller = NULL;
		LibraryPhotoPage* _tmp26_;
		CollectionPage* _tmp27_;
		CollectionPage* _tmp28_;
		LibraryPhotoPage* _tmp29_;
		CollectionPage* _tmp30_;
		CollectionPage* _tmp31_;
		LibraryPhotoPage* _tmp32_;
		Photo* _tmp33_;
		LibraryPhotoPage* _tmp34_;
		ViewCollection* _tmp35_;
		_tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (page, TYPE_LIBRARY_PHOTO_PAGE, LibraryPhotoPage));
		photo_page = _tmp25_;
		_tmp26_ = photo_page;
		_tmp27_ = library_photo_page_get_controller_page (_tmp26_);
		controller = _tmp27_;
		_tmp28_ = controller;
		if (_tmp28_ == NULL) {
			result = FALSE;
			_g_object_unref0 (controller);
			_g_object_unref0 (photo_page);
			if (collection) {
				*collection = _vala_collection;
			} else {
				_g_object_unref0 (_vala_collection);
			}
			if (start) {
				*start = _vala_start;
			} else {
				_g_object_unref0 (_vala_start);
			}
			if (view_collection) {
				*view_collection = _vala_view_collection;
			} else {
				_data_collection_unref0 (_vala_view_collection);
			}
			return result;
		}
		_tmp29_ = photo_page;
		if (!editing_host_page_has_photo (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, TYPE_EDITING_HOST_PAGE, EditingHostPage))) {
			result = FALSE;
			_g_object_unref0 (controller);
			_g_object_unref0 (photo_page);
			if (collection) {
				*collection = _vala_collection;
			} else {
				_g_object_unref0 (_vala_collection);
			}
			if (start) {
				*start = _vala_start;
			} else {
				_g_object_unref0 (_vala_start);
			}
			if (view_collection) {
				*view_collection = _vala_view_collection;
			} else {
				_data_collection_unref0 (_vala_view_collection);
			}
			return result;
		}
		_tmp30_ = controller;
		_tmp31_ = _g_object_ref0 (_tmp30_);
		_g_object_unref0 (_vala_collection);
		_vala_collection = _tmp31_;
		_tmp32_ = photo_page;
		_tmp33_ = editing_host_page_get_photo (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, TYPE_EDITING_HOST_PAGE, EditingHostPage));
		_g_object_unref0 (_vala_start);
		_vala_start = _tmp33_;
		_tmp34_ = photo_page;
		_tmp35_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, TYPE_PAGE, Page));
		_data_collection_unref0 (_vala_view_collection);
		_vala_view_collection = _tmp35_;
		result = TRUE;
		_g_object_unref0 (controller);
		_g_object_unref0 (photo_page);
		if (collection) {
			*collection = _vala_collection;
		} else {
			_g_object_unref0 (_vala_collection);
		}
		if (start) {
			*start = _vala_start;
		} else {
			_g_object_unref0 (_vala_start);
		}
		if (view_collection) {
			*view_collection = _vala_view_collection;
		} else {
			_data_collection_unref0 (_vala_view_collection);
		}
		return result;
	}
	result = FALSE;
	if (collection) {
		*collection = _vala_collection;
	} else {
		_g_object_unref0 (_vala_collection);
	}
	if (start) {
		*start = _vala_start;
	} else {
		_g_object_unref0 (_vala_start);
	}
	if (view_collection) {
		*view_collection = _vala_view_collection;
	} else {
		_data_collection_unref0 (_vala_view_collection);
	}
	return result;
}

static void
library_window_real_on_fullscreen (AppWindow* base)
{
	LibraryWindow * self;
	Page* current_page = NULL;
	Page* _tmp0_;
	Page* _tmp1_;
	CollectionPage* collection = NULL;
	Photo* start = NULL;
	ViewCollection* view = NULL;
	Page* _tmp2_;
	CollectionPage* _tmp3_ = NULL;
	Photo* _tmp4_ = NULL;
	ViewCollection* _tmp5_ = NULL;
	gboolean _tmp6_;
	LibraryWindowFullscreenPhotoPage* fs_photo = NULL;
	CollectionPage* _tmp7_;
	Photo* _tmp8_;
	ViewCollection* _tmp9_;
	LibraryWindowFullscreenPhotoPage* _tmp10_;
	LibraryWindowFullscreenPhotoPage* _tmp11_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	_tmp0_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	current_page = _tmp0_;
	_tmp1_ = current_page;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (current_page);
		return;
	}
	view = NULL;
	_tmp2_ = current_page;
	_tmp6_ = library_window_get_fullscreen_photo (self, _tmp2_, &_tmp3_, &_tmp4_, &_tmp5_);
	_g_object_unref0 (collection);
	collection = _tmp3_;
	_g_object_unref0 (start);
	start = _tmp4_;
	_data_collection_unref0 (view);
	view = _tmp5_;
	if (!_tmp6_) {
		_data_collection_unref0 (view);
		_g_object_unref0 (start);
		_g_object_unref0 (collection);
		_g_object_unref0 (current_page);
		return;
	}
	_tmp7_ = collection;
	_tmp8_ = start;
	_tmp9_ = view;
	_tmp10_ = library_window_fullscreen_photo_page_new (_tmp7_, _tmp8_, _tmp9_);
	g_object_ref_sink (_tmp10_);
	fs_photo = _tmp10_;
	_tmp11_ = fs_photo;
	app_window_go_fullscreen (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_PAGE, Page));
	_g_object_unref0 (fs_photo);
	_data_collection_unref0 (view);
	_g_object_unref0 (start);
	_g_object_unref0 (collection);
	_g_object_unref0 (current_page);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static inline void
_g_slist_free__g_free0_ (GSList* self)
{
	g_slist_free_full (self, (GDestroyNotify) _g_free0_);
}

static void
library_window_on_file_import (LibraryWindow* self)
{
	GtkFileChooserNative* import_dialog = NULL;
	GtkFileChooserNative* _tmp0_;
	GtkFileChooserNative* _tmp1_;
	GtkFileChooserNative* _tmp2_;
	GtkFileChooserNative* _tmp3_;
	const gchar* _tmp4_;
	GtkCheckButton* recursive = NULL;
	GtkCheckButton* _tmp5_;
	GtkCheckButton* _tmp6_;
	GtkFileChooserNative* _tmp7_;
	GtkCheckButton* _tmp8_;
	gint response = 0;
	GtkFileChooserNative* _tmp9_;
	GtkFileChooserNative* _tmp24_;
	gchar* _tmp25_;
	GtkCheckButton* _tmp26_;
	gboolean _tmp27_;
	gboolean _tmp28_;
	GtkFileChooserNative* _tmp29_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = gtk_file_chooser_native_new (_ ("Import From Folder"), NULL, GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, RESOURCES_OK_LABEL, RESOURCES_CANCEL_LABEL);
	import_dialog = _tmp0_;
	_tmp1_ = import_dialog;
	gtk_file_chooser_set_local_only (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_file_chooser_get_type (), GtkFileChooser), FALSE);
	_tmp2_ = import_dialog;
	gtk_file_chooser_set_select_multiple (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_file_chooser_get_type (), GtkFileChooser), TRUE);
	_tmp3_ = import_dialog;
	_tmp4_ = self->priv->import_dir;
	gtk_file_chooser_set_current_folder (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_file_chooser_get_type (), GtkFileChooser), _tmp4_);
	_tmp5_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Recurse Into Subfolders"));
	g_object_ref_sink (_tmp5_);
	recursive = _tmp5_;
	_tmp6_ = recursive;
	gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_toggle_button_get_type (), GtkToggleButton), self->priv->import_recursive);
	_tmp7_ = import_dialog;
	_tmp8_ = recursive;
	gtk_file_chooser_set_extra_widget (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_file_chooser_get_type (), GtkFileChooser), G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget));
	_tmp9_ = import_dialog;
	response = gtk_native_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_native_dialog_get_type (), GtkNativeDialog));
	if (response == ((gint) GTK_RESPONSE_ACCEPT)) {
		GtkFileChooserNative* _tmp10_;
		GtkResponseType _tmp11_ = 0;
		GtkFileChooserNative* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		GFile* _tmp15_;
		GFile* _tmp16_;
		gboolean _tmp17_;
		GtkResponseType copy_files_response = 0;
		_tmp10_ = import_dialog;
		gtk_native_dialog_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_native_dialog_get_type (), GtkNativeDialog));
		_tmp12_ = import_dialog;
		_tmp13_ = gtk_file_chooser_get_uri (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_file_chooser_get_type (), GtkFileChooser));
		_tmp14_ = _tmp13_;
		_tmp15_ = g_file_new_for_uri (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = app_dirs_is_in_import_dir (_tmp16_);
		_g_object_unref0 (_tmp16_);
		_g_free0 (_tmp14_);
		if (_tmp17_) {
			_tmp11_ = GTK_RESPONSE_REJECT;
		} else {
			_tmp11_ = copy_files_dialog ();
		}
		copy_files_response = _tmp11_;
		if (copy_files_response != GTK_RESPONSE_CANCEL) {
			GtkFileChooserNative* _tmp18_;
			GSList* _tmp19_;
			GSList* _tmp20_;
			GtkCheckButton* _tmp21_;
			gboolean _tmp22_;
			gboolean _tmp23_;
			_tmp18_ = import_dialog;
			_tmp19_ = gtk_file_chooser_get_uris (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_file_chooser_get_type (), GtkFileChooser));
			_tmp20_ = _tmp19_;
			_tmp21_ = recursive;
			_tmp22_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_toggle_button_get_type (), GtkToggleButton));
			_tmp23_ = _tmp22_;
			library_window_dispatch_import_jobs (self, _tmp20_, "folders", copy_files_response == GTK_RESPONSE_ACCEPT, _tmp23_);
			(_tmp20_ == NULL) ? NULL : (_tmp20_ = (_g_slist_free__g_free0_ (_tmp20_), NULL));
		}
	}
	_tmp24_ = import_dialog;
	_tmp25_ = gtk_file_chooser_get_current_folder (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_file_chooser_get_type (), GtkFileChooser));
	_g_free0 (self->priv->import_dir);
	self->priv->import_dir = _tmp25_;
	_tmp26_ = recursive;
	_tmp27_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, gtk_toggle_button_get_type (), GtkToggleButton));
	_tmp28_ = _tmp27_;
	self->priv->import_recursive = _tmp28_;
	_tmp29_ = import_dialog;
	gtk_native_dialog_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, gtk_native_dialog_get_type (), GtkNativeDialog));
	_g_object_unref0 (recursive);
	_g_object_unref0 (import_dialog);
}

static void
library_window_on_external_library_import (LibraryWindow* self)
{
	GtkDialog* import_dialog = NULL;
	DataImportsUIDataImportsDialog* _tmp0_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = data_imports_ui_data_imports_dialog_get_or_create_instance ();
	import_dialog = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_dialog_get_type (), GtkDialog);
	gtk_dialog_run (import_dialog);
	_g_object_unref0 (import_dialog);
}

static void
library_window_real_update_common_action_availability (AppWindow* base,
                                                       Page* old_page,
                                                       Page* new_page)
{
	LibraryWindow * self;
	gboolean is_checkerboard = FALSE;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	g_return_if_fail ((old_page == NULL) || IS_PAGE (old_page));
	g_return_if_fail ((new_page == NULL) || IS_PAGE (new_page));
	APP_WINDOW_CLASS (library_window_parent_class)->update_common_action_availability (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), old_page, new_page);
	is_checkerboard = IS_CHECKERBOARD_PAGE (new_page);
	app_window_set_common_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), "CommonDisplaySearchbar", is_checkerboard);
	app_window_set_common_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), "CommonFind", is_checkerboard);
}

static void
library_window_real_update_common_actions (AppWindow* base,
                                           Page* page,
                                           gint selected_count,
                                           gint count)
{
	LibraryWindow * self;
	CollectionPage* collection = NULL;
	Photo* start = NULL;
	gboolean can_fullscreen = FALSE;
	CollectionPage* _tmp0_ = NULL;
	Photo* _tmp1_ = NULL;
	gboolean _tmp2_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	g_return_if_fail (IS_PAGE (page));
	_tmp2_ = library_window_get_fullscreen_photo (self, page, &_tmp0_, &_tmp1_, NULL);
	_g_object_unref0 (collection);
	collection = _tmp0_;
	_g_object_unref0 (start);
	start = _tmp1_;
	can_fullscreen = _tmp2_;
	app_window_set_common_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), "CommonEmptyTrash", library_window_can_empty_trash (self));
	app_window_set_common_action_visible (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), "CommonJumpToEvent", TRUE);
	app_window_set_common_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), "CommonJumpToEvent", library_window_can_jump_to_event (self));
	app_window_set_common_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), "CommonFullscreen", can_fullscreen);
	APP_WINDOW_CLASS (library_window_parent_class)->update_common_actions (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), page, selected_count, count);
	_g_object_unref0 (start);
	_g_object_unref0 (collection);
}

static void
library_window_on_trashcan_contents_altered (LibraryWindow* self)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	app_window_set_common_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), "CommonEmptyTrash", library_window_can_empty_trash (self));
}

static gboolean
library_window_can_empty_trash (LibraryWindow* self)
{
	gboolean _tmp0_ = FALSE;
	LibraryPhotoSourceCollection* _tmp1_;
	gboolean result;
	g_return_val_if_fail (IS_LIBRARY_WINDOW (self), FALSE);
	_tmp1_ = library_photo_global;
	if (media_source_collection_get_trashcan_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection)) > 0) {
		_tmp0_ = TRUE;
	} else {
		VideoSourceCollection* _tmp2_;
		_tmp2_ = video_global;
		_tmp0_ = media_source_collection_get_trashcan_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection)) > 0;
	}
	result = _tmp0_;
	return result;
}

static void
library_window_on_empty_trash (LibraryWindow* self)
{
	GeeArrayList* to_remove = NULL;
	GeeArrayList* _tmp0_;
	LibraryPhotoSourceCollection* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	VideoSourceCollection* _tmp4_;
	GeeCollection* _tmp5_;
	GeeCollection* _tmp6_;
	CommandManager* _tmp7_;
	CommandManager* _tmp8_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = gee_array_list_new (TYPE_MEDIA_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	to_remove = _tmp0_;
	_tmp1_ = library_photo_global;
	_tmp2_ = media_source_collection_get_trashcan_contents (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
	_tmp3_ = _tmp2_;
	gee_array_list_add_all (to_remove, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = video_global;
	_tmp5_ = media_source_collection_get_trashcan_contents (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
	_tmp6_ = _tmp5_;
	gee_array_list_add_all (to_remove, _tmp6_);
	_g_object_unref0 (_tmp6_);
	remove_from_app (G_TYPE_CHECK_INSTANCE_CAST (to_remove, GEE_TYPE_COLLECTION, GeeCollection), _ ("Empty Trash"), _ ("Emptying Trash…"));
	_tmp7_ = app_window_get_command_manager ();
	_tmp8_ = _tmp7_;
	command_manager_reset (_tmp8_);
	_command_manager_unref0 (_tmp8_);
	_g_object_unref0 (to_remove);
}

static void
library_window_on_new_search (LibraryWindow* self)
{
	SavedSearchDialog* _tmp0_;
	SavedSearchDialog* _tmp1_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = saved_search_dialog_new ();
	g_object_ref_sink (_tmp0_);
	_tmp1_ = _tmp0_;
	saved_search_dialog_show (_tmp1_);
	_g_object_unref0 (_tmp1_);
}

static gboolean
library_window_can_jump_to_event (LibraryWindow* self)
{
	ViewCollection* view = NULL;
	Page* _tmp0_;
	Page* _tmp1_;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	gboolean result;
	g_return_val_if_fail (IS_LIBRARY_WINDOW (self), FALSE);
	_tmp0_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp1_ = _tmp0_;
	_tmp2_ = page_get_view (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	view = _tmp3_;
	_tmp4_ = view;
	if (view_collection_get_selected_count (_tmp4_) == 1) {
		DataSource* selected_source = NULL;
		ViewCollection* _tmp5_;
		DataSource* _tmp6_;
		DataSource* _tmp7_;
		_tmp5_ = view;
		_tmp6_ = view_collection_get_selected_source_at (_tmp5_, 0);
		selected_source = _tmp6_;
		_tmp7_ = selected_source;
		if (IS_EVENT (_tmp7_)) {
			result = TRUE;
			_g_object_unref0 (selected_source);
			_data_collection_unref0 (view);
			return result;
		} else {
			DataSource* _tmp8_;
			_tmp8_ = selected_source;
			if (IS_MEDIA_SOURCE (_tmp8_)) {
				ViewCollection* _tmp9_;
				DataSource* _tmp10_;
				MediaSource* _tmp11_;
				Event* _tmp12_;
				Event* _tmp13_;
				gboolean _tmp14_;
				_tmp9_ = view;
				_tmp10_ = view_collection_get_selected_source_at (_tmp9_, 0);
				_tmp11_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_MEDIA_SOURCE, MediaSource);
				_tmp12_ = media_source_get_event (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = _tmp13_ != NULL;
				_g_object_unref0 (_tmp13_);
				_g_object_unref0 (_tmp11_);
				result = _tmp14_;
				_g_object_unref0 (selected_source);
				_data_collection_unref0 (view);
				return result;
			} else {
				result = FALSE;
				_g_object_unref0 (selected_source);
				_data_collection_unref0 (view);
				return result;
			}
		}
		_g_object_unref0 (selected_source);
	} else {
		result = FALSE;
		_data_collection_unref0 (view);
		return result;
	}
}

static void
library_window_on_jump_to_event (LibraryWindow* self)
{
	ViewCollection* view = NULL;
	Page* _tmp0_;
	Page* _tmp1_;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	MediaSource* media = NULL;
	ViewCollection* _tmp5_;
	DataSource* _tmp6_;
	MediaSource* _tmp7_;
	MediaSource* _tmp8_;
	MediaSource* _tmp9_;
	Event* _tmp10_;
	Event* _tmp11_;
	gboolean _tmp12_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp1_ = _tmp0_;
	_tmp2_ = page_get_view (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	view = _tmp3_;
	_tmp4_ = view;
	if (view_collection_get_selected_count (_tmp4_) != 1) {
		_data_collection_unref0 (view);
		return;
	}
	_tmp5_ = view;
	_tmp6_ = view_collection_get_selected_source_at (_tmp5_, 0);
	_tmp7_ = IS_MEDIA_SOURCE (_tmp6_) ? ((MediaSource*) _tmp6_) : NULL;
	if (_tmp7_ == NULL) {
		_g_object_unref0 (_tmp6_);
	}
	media = _tmp7_;
	_tmp8_ = media;
	if (_tmp8_ == NULL) {
		_g_object_unref0 (media);
		_data_collection_unref0 (view);
		return;
	}
	_tmp9_ = media;
	_tmp10_ = media_source_get_event (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = _tmp11_ != NULL;
	_g_object_unref0 (_tmp11_);
	if (_tmp12_) {
		MediaSource* _tmp13_;
		Event* _tmp14_;
		Event* _tmp15_;
		_tmp13_ = media;
		_tmp14_ = media_source_get_event (_tmp13_);
		_tmp15_ = _tmp14_;
		library_window_switch_to_event (self, _tmp15_);
		_g_object_unref0 (_tmp15_);
	}
	_g_object_unref0 (media);
	_data_collection_unref0 (view);
}

static GVariant*
_variant_new5 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static void
library_window_on_find (LibraryWindow* self)
{
	GAction* action = NULL;
	GAction* _tmp0_;
	GAction* _tmp1_;
	GVariant* _tmp2_;
	SearchFilterToolbar* _tmp3_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonDisplaySearchbar");
	_tmp1_ = _g_object_ref0 (_tmp0_);
	action = _tmp1_;
	_tmp2_ = _variant_new5 (TRUE);
	g_action_change_state (action, _tmp2_);
	_g_variant_unref0 (_tmp2_);
	_tmp3_ = self->priv->search_toolbar;
	search_filter_toolbar_take_focus (_tmp3_);
	_g_object_unref0 (action);
}

static void
library_window_on_media_altered (LibraryWindow* self)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	app_window_set_common_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), "CommonJumpToEvent", library_window_can_jump_to_event (self));
}

static void
library_window_on_clear_search (LibraryWindow* self)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	if (self->priv->is_search_toolbar_visible) {
		SearchFilterActions* _tmp0_;
		_tmp0_ = self->priv->search_actions;
		search_filter_actions_reset (_tmp0_);
	}
}

gint
library_window_get_events_sort (LibraryWindow* self)
{
	GSimpleAction* action = NULL;
	GAction* _tmp0_;
	GSimpleAction* _tmp1_;
	gint _tmp2_ = 0;
	GSimpleAction* _tmp3_;
	gint result;
	g_return_val_if_fail (IS_LIBRARY_WINDOW (self), -1);
	_tmp0_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonSortEvents");
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp0_) : NULL);
	action = _tmp1_;
	_tmp3_ = action;
	if (_tmp3_ != NULL) {
		gint _tmp4_ = 0;
		GSimpleAction* _tmp5_;
		GVariant* _tmp6_;
		GVariant* _tmp7_;
		GVariant* _tmp8_;
		const gchar* _tmp9_;
		gboolean _tmp10_;
		_tmp5_ = action;
		_tmp6_ = g_action_get_state (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, g_action_get_type (), GAction));
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp9_ = g_variant_get_string (_tmp8_, NULL);
		_tmp10_ = g_strcmp0 (_tmp9_, LIBRARY_WINDOW_SORT_EVENTS_ORDER_ASCENDING) == 0;
		_g_variant_unref0 (_tmp8_);
		if (_tmp10_) {
			_tmp4_ = 0;
		} else {
			_tmp4_ = 1;
		}
		_tmp2_ = _tmp4_;
	} else {
		_tmp2_ = 1;
	}
	result = _tmp2_;
	_g_object_unref0 (action);
	return result;
}

static void
library_window_on_events_sort_changed (LibraryWindow* self,
                                       GSimpleAction* action,
                                       GVariant* value)
{
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_variant_get_string (value, NULL);
	configuration_facade_set_events_sort_ascending (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), g_strcmp0 (_tmp2_, LIBRARY_WINDOW_SORT_EVENTS_ORDER_ASCENDING) == 0);
	_g_object_unref0 (_tmp1_);
	g_simple_action_set_state (action, value);
}

static void
library_window_on_preferences (LibraryWindow* self)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	preferences_dialog_show_preferences ();
}

static void
library_window_on_display_basic_properties (LibraryWindow* self,
                                            GSimpleAction* action,
                                            GVariant* value)
{
	gboolean display = FALSE;
	ConfigFacade* _tmp7_;
	ConfigFacade* _tmp8_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	display = g_variant_get_boolean (value);
	if (display) {
		BasicProperties* _tmp0_;
		Page* _tmp1_;
		Page* _tmp2_;
		GtkFrame* _tmp3_;
		_tmp0_ = self->priv->basic_properties;
		_tmp1_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
		_tmp2_ = _tmp1_;
		properties_update_properties (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_PROPERTIES, Properties), _tmp2_);
		_g_object_unref0 (_tmp2_);
		_tmp3_ = self->priv->bottom_frame;
		gtk_widget_show (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
	} else {
		GtkPaned* _tmp4_;
		GtkWidget* _tmp5_;
		_tmp4_ = self->priv->sidebar_paned;
		_tmp5_ = gtk_paned_get_child2 (_tmp4_);
		if (_tmp5_ != NULL) {
			GtkFrame* _tmp6_;
			_tmp6_ = self->priv->bottom_frame;
			gtk_widget_hide (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget));
		}
	}
	_tmp7_ = config_facade_get_instance ();
	_tmp8_ = _tmp7_;
	configuration_facade_set_display_basic_properties (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), display);
	_g_object_unref0 (_tmp8_);
	g_simple_action_set_state (action, value);
}

static gboolean
_variant_get1 (GVariant* value)
{
	return g_variant_get_boolean (value);
}

static GVariant*
_variant_new6 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static void
library_window_on_action_toggle (LibraryWindow* self,
                                 GAction* action,
                                 GVariant* value)
{
	GVariant* new_state = NULL;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	gboolean _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_action_get_type ()));
	_tmp0_ = g_action_get_state (action);
	_tmp1_ = _tmp0_;
	_tmp2_ = _variant_get1 (_tmp1_);
	_tmp3_ = _variant_new6 (!_tmp2_);
	_tmp4_ = _tmp3_;
	_g_variant_unref0 (_tmp1_);
	new_state = _tmp4_;
	g_action_change_state (action, new_state);
	_g_variant_unref0 (new_state);
}

static void
library_window_on_action_radio (LibraryWindow* self,
                                GAction* action,
                                GVariant* value)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_action_get_type ()));
	g_action_change_state (action, value);
}

static void
library_window_on_display_extended_properties (LibraryWindow* self,
                                               GSimpleAction* action,
                                               GVariant* value)
{
	gboolean display = FALSE;
	GtkRevealer* _tmp3_;
	ConfigFacade* _tmp4_;
	ConfigFacade* _tmp5_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	display = g_variant_get_boolean (value);
	if (display) {
		ExtendedProperties* _tmp0_;
		Page* _tmp1_;
		Page* _tmp2_;
		_tmp0_ = self->priv->extended_properties;
		_tmp1_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
		_tmp2_ = _tmp1_;
		properties_update_properties (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_PROPERTIES, Properties), _tmp2_);
		_g_object_unref0 (_tmp2_);
	}
	_tmp3_ = self->priv->extended_properties_revealer;
	gtk_revealer_set_reveal_child (_tmp3_, display);
	g_simple_action_set_state (action, value);
	_tmp4_ = config_facade_get_instance ();
	_tmp5_ = _tmp4_;
	configuration_facade_set_display_extended_properties (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), display);
	_g_object_unref0 (_tmp5_);
}

static GVariant*
_variant_new7 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static void
library_window_on_display_searchbar (LibraryWindow* self,
                                     GSimpleAction* action,
                                     GVariant* value)
{
	gboolean is_shown = FALSE;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	GVariant* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	is_shown = g_variant_get_boolean (value);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	configuration_facade_set_display_search_bar (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), is_shown);
	_g_object_unref0 (_tmp1_);
	library_window_show_search_bar (self, is_shown);
	_tmp2_ = _variant_new7 (is_shown);
	g_simple_action_set_state (action, _tmp2_);
	_g_variant_unref0 (_tmp2_);
}

void
library_window_show_search_bar (LibraryWindow* self,
                                gboolean display)
{
	Page* _tmp0_;
	Page* _tmp1_;
	gboolean _tmp2_;
	Page* _tmp3_;
	CheckerboardPage* _tmp4_;
	CheckerboardPage* _tmp5_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp1_ = _tmp0_;
	_tmp2_ = !IS_CHECKERBOARD_PAGE (_tmp1_);
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	self->priv->is_search_toolbar_visible = display;
	_tmp3_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp4_ = IS_CHECKERBOARD_PAGE (_tmp3_) ? ((CheckerboardPage*) _tmp3_) : NULL;
	if (_tmp4_ == NULL) {
		_g_object_unref0 (_tmp3_);
	}
	_tmp5_ = _tmp4_;
	library_window_toggle_search_bar (self, library_window_should_show_search_bar (self), _tmp5_);
	_g_object_unref0 (_tmp5_);
	if (!display) {
		SearchFilterActions* _tmp6_;
		_tmp6_ = self->priv->search_actions;
		search_filter_actions_reset (_tmp6_);
	}
}

static void
library_window_on_display_sidebar (LibraryWindow* self,
                                   GSimpleAction* action,
                                   GVariant* variant)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	library_window_set_sidebar_visible (self, g_variant_get_boolean (variant));
	g_simple_action_set_state (action, variant);
}

static void
library_window_set_sidebar_visible (LibraryWindow* self,
                                    gboolean visible)
{
	GtkPaned* _tmp0_;
	ConfigFacade* _tmp1_;
	ConfigFacade* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = self->priv->sidebar_paned;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), visible);
	_tmp1_ = config_facade_get_instance ();
	_tmp2_ = _tmp1_;
	configuration_facade_set_display_sidebar (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), visible);
	_g_object_unref0 (_tmp2_);
}

static gboolean
library_window_is_sidebar_visible (LibraryWindow* self)
{
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (IS_LIBRARY_WINDOW (self), FALSE);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = configuration_facade_get_display_sidebar (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

static void
library_window_on_display_toolbar (LibraryWindow* self,
                                   GSimpleAction* action,
                                   GVariant* variant)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	library_window_set_toolbar_visible (self, g_variant_get_boolean (variant));
	g_simple_action_set_state (action, variant);
}

static void
library_window_set_toolbar_visible (LibraryWindow* self,
                                    gboolean visible)
{
	Page* _tmp0_;
	Page* _tmp1_;
	gboolean _tmp2_;
	GtkToolbar* toolbar = NULL;
	Page* _tmp3_;
	Page* _tmp4_;
	GtkToolbar* _tmp5_;
	GtkToolbar* _tmp6_;
	GtkToolbar* _tmp7_;
	ConfigFacade* _tmp9_;
	ConfigFacade* _tmp10_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ == NULL;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp4_ = _tmp3_;
	_tmp5_ = page_get_toolbar (_tmp4_);
	_tmp6_ = _tmp5_;
	_g_object_unref0 (_tmp4_);
	toolbar = _tmp6_;
	_tmp7_ = toolbar;
	if (_tmp7_ != NULL) {
		GtkRevealer* _tmp8_;
		_tmp8_ = self->priv->toolbar_revealer;
		gtk_revealer_set_reveal_child (_tmp8_, visible);
	}
	_tmp9_ = config_facade_get_instance ();
	_tmp10_ = _tmp9_;
	configuration_facade_set_display_toolbar (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), visible);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (toolbar);
}

static gboolean
library_window_is_toolbar_visible (LibraryWindow* self)
{
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (IS_LIBRARY_WINDOW (self), FALSE);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = configuration_facade_get_display_toolbar (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

void
library_window_enqueue_batch_import (LibraryWindow* self,
                                     BatchImport* batch_import,
                                     gboolean allow_user_cancel)
{
	LibraryBranch* _tmp0_;
	LibraryImportQueueSidebarEntry* _tmp1_;
	LibraryImportQueueSidebarEntry* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_BATCH_IMPORT (batch_import));
	_tmp0_ = self->priv->library_branch;
	_tmp1_ = library_branch_get_import_queue_entry (_tmp0_);
	_tmp2_ = _tmp1_;
	library_import_queue_sidebar_entry_enqueue_and_schedule (_tmp2_, batch_import, allow_user_cancel);
}

static void
library_window_import_reporter (LibraryWindow* self,
                                ImportManifest* manifest)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_IMPORT_MANIFEST (manifest));
	import_ui_report_manifest (manifest, TRUE, NULL);
}

static void
_library_window_import_reporter_batch_import_import_reporter (ImportManifest* manifest,
                                                              BatchImportRoll* import_roll,
                                                              gpointer self)
{
	library_window_import_reporter ((LibraryWindow*) self, manifest);
}

static void
library_window_dispatch_import_jobs (LibraryWindow* self,
                                     GSList* uris,
                                     const gchar* job_name,
                                     gboolean copy_to_library,
                                     gboolean recurse)
{
	gboolean _tmp0_ = FALSE;
	GFile* _tmp1_;
	GFile* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gboolean _tmp6_;
	GeeArrayList* jobs = NULL;
	GeeArrayList* _tmp12_;
	GeeArrayList* rejected = NULL;
	GeeArrayList* _tmp13_;
	GeeArrayList* _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	GeeArrayList* _tmp43_;
	gint _tmp44_;
	gint _tmp45_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (job_name != NULL);
	_tmp1_ = app_dirs_get_import_dir ();
	_tmp2_ = _tmp1_;
	_tmp3_ = g_file_get_path (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_get_home_dir ();
	_tmp6_ = g_strcmp0 (_tmp4_, _tmp5_) == 0;
	_g_free0 (_tmp4_);
	_g_object_unref0 (_tmp2_);
	if (_tmp6_) {
		_tmp0_ = self->priv->notify_library_is_home_dir;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkResponseType response = 0;
		gchar* _tmp7_;
		gchar* _tmp8_;
		AppWindow* _tmp9_;
		AppWindow* _tmp10_;
		GtkResponseType _tmp11_;
		_tmp7_ = g_strdup_printf (_ ("Shotwell is configured to import photos to your home directory.\n" "We recommend changing this in Edit %s Preferences.\n" "Do you want to continue importing photos?"), "▸");
		_tmp8_ = _tmp7_;
		_tmp9_ = app_window_get_instance ();
		_tmp10_ = _tmp9_;
		_tmp11_ = app_window_affirm_cancel_question (_tmp8_, _ ("_Import"), _ ("Library Location"), G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_window_get_type (), GtkWindow));
		_g_object_unref0 (_tmp10_);
		_g_free0 (_tmp8_);
		response = _tmp11_;
		if (response == GTK_RESPONSE_CANCEL) {
			return;
		}
		self->priv->notify_library_is_home_dir = FALSE;
	}
	_tmp12_ = gee_array_list_new (TYPE_FILE_IMPORT_JOB, (GBoxedCopyFunc) batch_import_job_ref, (GDestroyNotify) batch_import_job_unref, NULL, NULL, NULL);
	jobs = _tmp12_;
	_tmp13_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	rejected = _tmp13_;
	{
		GSList* uri_collection = NULL;
		GSList* uri_it = NULL;
		uri_collection = uris;
		for (uri_it = uri_collection; uri_it != NULL; uri_it = uri_it->next) {
			gchar* _tmp14_;
			gchar* uri = NULL;
			_tmp14_ = g_strdup ((const gchar*) uri_it->data);
			uri = _tmp14_;
			{
				GFile* file_or_dir = NULL;
				const gchar* _tmp15_;
				GFile* _tmp16_;
				GFile* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
				gboolean _tmp20_;
				GeeArrayList* _tmp23_;
				GFile* _tmp24_;
				FileImportJob* _tmp25_;
				FileImportJob* _tmp26_;
				_tmp15_ = uri;
				_tmp16_ = g_file_new_for_uri (_tmp15_);
				file_or_dir = _tmp16_;
				_tmp17_ = file_or_dir;
				_tmp18_ = g_file_get_path (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = _tmp19_ == NULL;
				_g_free0 (_tmp19_);
				if (_tmp20_) {
					GeeArrayList* _tmp21_;
					const gchar* _tmp22_;
					_tmp21_ = rejected;
					_tmp22_ = uri;
					gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp22_);
					_g_object_unref0 (file_or_dir);
					_g_free0 (uri);
					continue;
				}
				_tmp23_ = jobs;
				_tmp24_ = file_or_dir;
				_tmp25_ = file_import_job_new (_tmp24_, copy_to_library, recurse);
				_tmp26_ = _tmp25_;
				gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp26_);
				_batch_import_job_unref0 (_tmp26_);
				_g_object_unref0 (file_or_dir);
				_g_free0 (uri);
			}
		}
	}
	_tmp27_ = rejected;
	_tmp28_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
	_tmp29_ = _tmp28_;
	if (_tmp29_ > 0) {
		gchar* message = NULL;
		gchar* _tmp30_;
		const gchar* _tmp42_;
		_tmp30_ = g_strdup (_ ("Photos cannot be imported from this directory."));
		message = _tmp30_;
		{
			GeeArrayList* _uri_list = NULL;
			GeeArrayList* _tmp31_;
			gint _uri_size = 0;
			GeeArrayList* _tmp32_;
			gint _tmp33_;
			gint _tmp34_;
			gint _uri_index = 0;
			_tmp31_ = rejected;
			_uri_list = _tmp31_;
			_tmp32_ = _uri_list;
			_tmp33_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
			_tmp34_ = _tmp33_;
			_uri_size = _tmp34_;
			_uri_index = -1;
			while (TRUE) {
				gint _tmp35_;
				gint _tmp36_;
				gchar* uri = NULL;
				GeeArrayList* _tmp37_;
				gpointer _tmp38_;
				const gchar* _tmp39_;
				const gchar* _tmp40_;
				gchar* _tmp41_;
				_uri_index = _uri_index + 1;
				_tmp35_ = _uri_index;
				_tmp36_ = _uri_size;
				if (!(_tmp35_ < _tmp36_)) {
					break;
				}
				_tmp37_ = _uri_list;
				_tmp38_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _uri_index);
				uri = (gchar*) _tmp38_;
				_tmp39_ = message;
				_tmp40_ = uri;
				_tmp41_ = g_strconcat (_tmp39_, _tmp40_, NULL);
				_g_free0 (message);
				message = _tmp41_;
				_g_free0 (uri);
			}
		}
		_tmp42_ = message;
		app_window_error_message (_tmp42_, NULL);
		_g_free0 (message);
	}
	_tmp43_ = jobs;
	_tmp44_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
	_tmp45_ = _tmp44_;
	if (_tmp45_ > 0) {
		BatchImport* batch_import = NULL;
		GeeArrayList* _tmp46_;
		BatchImport* _tmp47_;
		BatchImport* _tmp48_;
		_tmp46_ = jobs;
		_tmp47_ = batch_import_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, GEE_TYPE_ITERABLE, GeeIterable), job_name, _library_window_import_reporter_batch_import_import_reporter, self, NULL, NULL, NULL, NULL, NULL);
		batch_import = _tmp47_;
		_tmp48_ = batch_import;
		library_window_enqueue_batch_import (self, _tmp48_, TRUE);
		library_window_switch_to_import_queue_page (self);
		_g_object_unref0 (batch_import);
	}
	_g_object_unref0 (rejected);
	_g_object_unref0 (jobs);
}

static GdkDragAction
library_window_get_drag_action (LibraryWindow* self)
{
	GdkModifierType mask = 0U;
	GdkSeat* seat = NULL;
	GdkDisplay* _tmp0_;
	GdkSeat* _tmp1_;
	GdkSeat* _tmp2_;
	GdkWindow* _tmp3_;
	GdkSeat* _tmp4_;
	GdkDevice* _tmp5_;
	GdkModifierType _tmp6_ = 0U;
	gboolean ctrl = FALSE;
	gboolean alt = FALSE;
	gboolean shift = FALSE;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp8_ = FALSE;
	GdkDragAction result;
	g_return_val_if_fail (IS_LIBRARY_WINDOW (self), 0U);
	_tmp0_ = gdk_display_get_default ();
	_tmp1_ = gdk_display_get_default_seat (_tmp0_);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	seat = _tmp2_;
	_tmp3_ = gtk_widget_get_window (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp4_ = seat;
	_tmp5_ = gdk_seat_get_pointer (_tmp4_);
	gdk_window_get_device_position (_tmp3_, _tmp5_, NULL, NULL, &_tmp6_);
	mask = _tmp6_;
	ctrl = (mask & GDK_CONTROL_MASK) != 0;
	alt = (mask & GDK_MOD1_MASK) != 0;
	shift = (mask & GDK_SHIFT_MASK) != 0;
	if (ctrl) {
		_tmp8_ = !alt;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		_tmp7_ = !shift;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		result = GDK_ACTION_COPY;
		_g_object_unref0 (seat);
		return result;
	} else {
		gboolean _tmp9_ = FALSE;
		gboolean _tmp10_ = FALSE;
		if (!ctrl) {
			_tmp10_ = alt;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			_tmp9_ = !shift;
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			result = GDK_ACTION_ASK;
			_g_object_unref0 (seat);
			return result;
		} else {
			gboolean _tmp11_ = FALSE;
			gboolean _tmp12_ = FALSE;
			if (ctrl) {
				_tmp12_ = !alt;
			} else {
				_tmp12_ = FALSE;
			}
			if (_tmp12_) {
				_tmp11_ = shift;
			} else {
				_tmp11_ = FALSE;
			}
			if (_tmp11_) {
				result = GDK_ACTION_LINK;
				_g_object_unref0 (seat);
				return result;
			} else {
				result = GDK_ACTION_DEFAULT;
				_g_object_unref0 (seat);
				return result;
			}
		}
	}
}

static gboolean
library_window_real_drag_motion (GtkWidget* base,
                                 GdkDragContext* context,
                                 gint x,
                                 gint y,
                                 guint time)
{
	LibraryWindow * self;
	GdkAtom target = (GdkAtom) 0U;
	GtkTargetList* _tmp0_;
	GtkWidget* _tmp1_;
	GdkDragAction drag_action = 0U;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (context, gdk_drag_context_get_type ()), FALSE);
	_tmp0_ = gtk_drag_dest_get_target_list (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	target = gtk_drag_dest_find_target (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), context, _tmp0_);
	if (target == GDK_NONE) {
		g_debug ("LibraryWindow.vala:821: drag target is GDK_NONE");
		gdk_drag_status (context, 0, (guint32) time);
		result = TRUE;
		return result;
	}
	_tmp1_ = gtk_drag_get_source_widget (context);
	if (_tmp1_ != NULL) {
		gdk_drag_status (context, GDK_ACTION_PRIVATE, (guint32) time);
		result = TRUE;
		return result;
	}
	drag_action = library_window_get_drag_action (self);
	if (drag_action == GDK_ACTION_DEFAULT) {
		drag_action = GDK_ACTION_ASK;
	}
	gdk_drag_status (context, drag_action, (guint32) time);
	result = TRUE;
	return result;
}

static void
library_window_real_drag_data_received (GtkWidget* base,
                                        GdkDragContext* context,
                                        gint x,
                                        gint y,
                                        GtkSelectionData* selection_data,
                                        guint info,
                                        guint time)
{
	LibraryWindow * self;
	guint8* _tmp0_;
	GtkWidget* _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (context, gdk_drag_context_get_type ()));
	g_return_if_fail (selection_data != NULL);
	_tmp0_ = gtk_selection_data_get_data (selection_data);
	if (-1 < 0) {
		g_debug ("LibraryWindow.vala:848: failed to retrieve SelectionData");
	}
	_tmp1_ = gtk_drag_get_source_widget (context);
	if (_tmp1_ == NULL) {
		library_window_external_drop_handler (self, context, NULL, selection_data, info, time);
	} else {
		gtk_drag_finish (context, FALSE, FALSE, (guint32) time);
	}
}

static void
library_window_external_drop_handler (LibraryWindow* self,
                                      GdkDragContext* context,
                                      SidebarEntry* entry,
                                      GtkSelectionData* data,
                                      guint info,
                                      guint time)
{
	gchar** uris_array = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint uris_array_length1;
	gint _uris_array_size_;
	GSList* uris = NULL;
	gchar** _tmp2_;
	gint _tmp2__length1;
	GdkDragAction selected_action = 0U;
	GSList* _tmp12_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (context, gdk_drag_context_get_type ()));
	g_return_if_fail ((entry == NULL) || SIDEBAR_IS_ENTRY (entry));
	g_return_if_fail (data != NULL);
	_tmp1_ = _tmp0_ = gtk_selection_data_get_uris (data);
	uris_array = _tmp1_;
	uris_array_length1 = _vala_array_length (_tmp0_);
	_uris_array_size_ = uris_array_length1;
	uris = NULL;
	_tmp2_ = uris_array;
	_tmp2__length1 = uris_array_length1;
	{
		gchar** uri_collection = NULL;
		gint uri_collection_length1 = 0;
		gint _uri_collection_size_ = 0;
		gint uri_it = 0;
		uri_collection = _tmp2_;
		uri_collection_length1 = _tmp2__length1;
		for (uri_it = 0; uri_it < uri_collection_length1; uri_it = uri_it + 1) {
			gchar* _tmp3_;
			gchar* uri = NULL;
			_tmp3_ = g_strdup (uri_collection[uri_it]);
			uri = _tmp3_;
			{
				const gchar* _tmp4_;
				gchar* _tmp5_;
				_tmp4_ = uri;
				_tmp5_ = g_strdup (_tmp4_);
				uris = g_slist_append (uris, _tmp5_);
				_g_free0 (uri);
			}
		}
	}
	selected_action = gdk_drag_context_get_selected_action (context);
	if (selected_action == GDK_ACTION_ASK) {
		GtkResponseType _result_ = 0;
		GSList* _tmp6_;
		_result_ = GTK_RESPONSE_REJECT;
		_tmp6_ = uris;
		{
			GSList* uri_collection = NULL;
			GSList* uri_it = NULL;
			uri_collection = _tmp6_;
			for (uri_it = uri_collection; uri_it != NULL; uri_it = uri_it->next) {
				gchar* _tmp7_;
				gchar* uri = NULL;
				_tmp7_ = g_strdup ((const gchar*) uri_it->data);
				uri = _tmp7_;
				{
					const gchar* _tmp8_;
					GFile* _tmp9_;
					GFile* _tmp10_;
					gboolean _tmp11_;
					_tmp8_ = uri;
					_tmp9_ = g_file_new_for_uri (_tmp8_);
					_tmp10_ = _tmp9_;
					_tmp11_ = !app_dirs_is_in_import_dir (_tmp10_);
					_g_object_unref0 (_tmp10_);
					if (_tmp11_) {
						_result_ = copy_files_dialog ();
						_g_free0 (uri);
						break;
					}
					_g_free0 (uri);
				}
			}
		}
		switch (_result_) {
			case GTK_RESPONSE_ACCEPT:
			{
				selected_action = GDK_ACTION_COPY;
				break;
			}
			case GTK_RESPONSE_REJECT:
			{
				selected_action = GDK_ACTION_LINK;
				break;
			}
			default:
			{
				gtk_drag_finish (context, FALSE, FALSE, (guint32) time);
				(uris == NULL) ? NULL : (uris = (_g_slist_free__g_free0_ (uris), NULL));
				uris_array = (_vala_array_free (uris_array, uris_array_length1, (GDestroyNotify) g_free), NULL);
				return;
			}
		}
	}
	_tmp12_ = uris;
	library_window_dispatch_import_jobs (self, _tmp12_, "drag-and-drop", selected_action == GDK_ACTION_COPY, TRUE);
	gtk_drag_finish (context, TRUE, FALSE, (guint32) time);
	(uris == NULL) ? NULL : (uris = (_g_slist_free__g_free0_ (uris), NULL));
	uris_array = (_vala_array_free (uris_array, uris_array_length1, (GDestroyNotify) g_free), NULL);
}

void
library_window_switch_to_library_page (LibraryWindow* self)
{
	LibraryBranch* _tmp0_;
	LibraryPhotosEntry* _tmp1_;
	LibraryPhotosEntry* _tmp2_;
	Page* _tmp3_;
	Page* _tmp4_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = self->priv->library_branch;
	_tmp1_ = library_branch_get_photos_entry (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
	_tmp4_ = _tmp3_;
	library_window_switch_to_page (self, _tmp4_);
	_g_object_unref0 (_tmp4_);
}

void
library_window_switch_to_event (LibraryWindow* self,
                                Event* event)
{
	EventsEventEntry* entry = NULL;
	EventsBranch* _tmp0_;
	EventsEventEntry* _tmp1_;
	EventsEventEntry* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_EVENT (event));
	_tmp0_ = self->priv->events_branch;
	_tmp1_ = events_branch_get_entry_for_event (_tmp0_, event);
	entry = _tmp1_;
	_tmp2_ = entry;
	if (_tmp2_ != NULL) {
		EventsEventEntry* _tmp3_;
		Page* _tmp4_;
		Page* _tmp5_;
		_tmp3_ = entry;
		_tmp4_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
		_tmp5_ = _tmp4_;
		library_window_switch_to_page (self, _tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	_g_object_unref0 (entry);
}

void
library_window_switch_to_tag (LibraryWindow* self,
                              Tag* tag)
{
	TagsSidebarEntry* entry = NULL;
	TagsBranch* _tmp0_;
	TagsSidebarEntry* _tmp1_;
	TagsSidebarEntry* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_TAG (tag));
	_tmp0_ = self->priv->tags_branch;
	_tmp1_ = tags_branch_get_entry_for_tag (_tmp0_, tag);
	entry = _tmp1_;
	_tmp2_ = entry;
	if (_tmp2_ != NULL) {
		TagsSidebarEntry* _tmp3_;
		Page* _tmp4_;
		Page* _tmp5_;
		_tmp3_ = entry;
		_tmp4_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
		_tmp5_ = _tmp4_;
		library_window_switch_to_page (self, _tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	_g_object_unref0 (entry);
}

void
library_window_switch_to_saved_search (LibraryWindow* self,
                                       SavedSearch* search)
{
	SearchesSidebarEntry* entry = NULL;
	SearchesBranch* _tmp0_;
	SearchesSidebarEntry* _tmp1_;
	SearchesSidebarEntry* _tmp2_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_SAVED_SEARCH (search));
	_tmp0_ = self->priv->saved_search_branch;
	_tmp1_ = searches_branch_get_entry_for_saved_search (_tmp0_, search);
	entry = _tmp1_;
	_tmp2_ = entry;
	if (_tmp2_ != NULL) {
		SearchesSidebarEntry* _tmp3_;
		Page* _tmp4_;
		Page* _tmp5_;
		_tmp3_ = entry;
		_tmp4_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
		_tmp5_ = _tmp4_;
		library_window_switch_to_page (self, _tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	_g_object_unref0 (entry);
}

void
library_window_switch_to_photo_page (LibraryWindow* self,
                                     CollectionPage* controller,
                                     Photo* current)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	DataView* _tmp2_;
	DataView* _tmp3_;
	LibraryPhotoPage* _tmp4_;
	LibraryPhotoPage* _tmp7_;
	LibraryPhotoPage* _tmp8_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_COLLECTION_PAGE (controller));
	g_return_if_fail (IS_PHOTO (current));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (controller, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_view_for_source (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (current, TYPE_DATA_SOURCE, DataSource));
	_tmp3_ = _tmp2_;
	_vala_assert (_tmp3_ != NULL, "controller.get_view().get_view_for_source(current) != null");
	_g_object_unref0 (_tmp3_);
	_data_collection_unref0 (_tmp1_);
	_tmp4_ = self->priv->photo_page;
	if (_tmp4_ == NULL) {
		LibraryPhotoPage* _tmp5_;
		LibraryPhotoPage* _tmp6_;
		_tmp5_ = library_photo_page_new ();
		g_object_ref_sink (_tmp5_);
		_g_object_unref0 (self->priv->photo_page);
		self->priv->photo_page = _tmp5_;
		_tmp6_ = self->priv->photo_page;
		library_window_add_to_stack (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_PAGE, Page));
		spin_event_loop ();
	}
	_tmp7_ = self->priv->photo_page;
	library_photo_page_display_for_collection (_tmp7_, controller, current, NULL);
	_tmp8_ = self->priv->photo_page;
	library_window_switch_to_page (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_PAGE, Page));
}

void
library_window_switch_to_import_queue_page (LibraryWindow* self)
{
	LibraryBranch* _tmp0_;
	LibraryImportQueueSidebarEntry* _tmp1_;
	LibraryImportQueueSidebarEntry* _tmp2_;
	Page* _tmp3_;
	Page* _tmp4_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = self->priv->library_branch;
	_tmp1_ = library_branch_get_import_queue_entry (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
	_tmp4_ = _tmp3_;
	library_window_switch_to_page (self, _tmp4_);
	_g_object_unref0 (_tmp4_);
}

static void
library_window_on_camera_added (LibraryWindow* self,
                                DiscoveredCamera* camera)
{
	CameraSidebarEntry* entry = NULL;
	CameraBranch* _tmp0_;
	CameraSidebarEntry* _tmp1_;
	CameraSidebarEntry* _tmp2_;
	ImportPage* page = NULL;
	CameraSidebarEntry* _tmp3_;
	Page* _tmp4_;
	GMount* mount = NULL;
	GMount* _tmp5_;
	gboolean _tmp6_ = FALSE;
	GMount* _tmp7_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_DISCOVERED_CAMERA (camera));
	_tmp0_ = self->priv->camera_branch;
	_tmp1_ = camera_branch_get_entry_for_camera (_tmp0_, camera);
	entry = _tmp1_;
	_tmp2_ = entry;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (entry);
		return;
	}
	_tmp3_ = entry;
	_tmp4_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
	page = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_IMPORT_PAGE, ImportPage);
	_tmp5_ = discovered_camera_get_mount (camera);
	mount = _tmp5_;
	_tmp7_ = mount;
	if (_tmp7_ != NULL) {
		const gchar* _tmp8_;
		_tmp8_ = camera->uri;
		_tmp6_ = !g_str_has_prefix (_tmp8_, "file://");
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		ImportPage* _tmp9_;
		GMount* _tmp10_;
		_tmp9_ = page;
		_tmp10_ = mount;
		if (import_page_unmount_camera (_tmp9_, _tmp10_)) {
			ImportPage* _tmp11_;
			_tmp11_ = page;
			library_window_switch_to_page (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_PAGE, Page));
		} else {
			app_window_error_message ("Unable to unmount the camera at this time.", NULL);
		}
	} else {
		ImportPage* _tmp12_;
		_tmp12_ = page;
		library_window_switch_to_page (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_PAGE, Page));
	}
	_g_object_unref0 (mount);
	_g_object_unref0 (page);
	_g_object_unref0 (entry);
}

void
library_window_add_to_stack (LibraryWindow* self,
                             Page* page)
{
	GtkStack* _tmp0_;
	GtkStack* _tmp1_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_PAGE (page));
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (page, gtk_widget_get_type (), GtkWidget));
	_tmp0_ = self->priv->stack;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (page, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = self->priv->stack;
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
}

static void
library_window_remove_from_stack (LibraryWindow* self,
                                  Page* page)
{
	GtkStack* _tmp0_;
	GtkStack* _tmp1_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_PAGE (page));
	_tmp0_ = self->priv->stack;
	gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (page, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = self->priv->stack;
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
}

static GVariant*
_variant_new8 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static GVariant*
_variant_new9 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static GVariant*
_variant_new10 (gboolean value)
{
	return g_variant_ref_sink (g_variant_new_boolean (value));
}

static GVariant*
_variant_new11 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static void
library_window_load_configuration (LibraryWindow* self)
{
	GAction* basic_display_action = NULL;
	GAction* _tmp0_;
	GAction* _tmp1_;
	GAction* _tmp2_;
	GAction* _tmp3_;
	ConfigFacade* _tmp4_;
	ConfigFacade* _tmp5_;
	GVariant* _tmp6_;
	GAction* extended_display_action = NULL;
	GAction* _tmp7_;
	GAction* _tmp8_;
	GAction* _tmp9_;
	GAction* _tmp10_;
	ConfigFacade* _tmp11_;
	ConfigFacade* _tmp12_;
	GVariant* _tmp13_;
	GAction* search_bar_display_action = NULL;
	GAction* _tmp14_;
	GAction* _tmp15_;
	GAction* _tmp16_;
	GAction* _tmp17_;
	ConfigFacade* _tmp18_;
	ConfigFacade* _tmp19_;
	GVariant* _tmp20_;
	GAction* sort_events_action = NULL;
	GAction* _tmp21_;
	GAction* _tmp22_;
	GAction* _tmp23_;
	const gchar* _tmp24_ = NULL;
	ConfigFacade* _tmp25_;
	ConfigFacade* _tmp26_;
	gboolean _tmp27_;
	gchar* event_sort_val = NULL;
	gchar* _tmp28_;
	GAction* _tmp29_;
	GVariant* _tmp30_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonDisplayBasicProperties");
	_tmp1_ = _g_object_ref0 (_tmp0_);
	basic_display_action = _tmp1_;
	_tmp2_ = basic_display_action;
	_vala_assert (_tmp2_ != NULL, "basic_display_action != null");
	_tmp3_ = basic_display_action;
	_tmp4_ = config_facade_get_instance ();
	_tmp5_ = _tmp4_;
	_tmp6_ = _variant_new8 (configuration_facade_get_display_basic_properties (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	g_action_change_state (_tmp3_, _tmp6_);
	_g_variant_unref0 (_tmp6_);
	_g_object_unref0 (_tmp5_);
	_tmp7_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonDisplayExtendedProperties");
	_tmp8_ = _g_object_ref0 (_tmp7_);
	extended_display_action = _tmp8_;
	_tmp9_ = extended_display_action;
	_vala_assert (_tmp9_ != NULL, "extended_display_action != null");
	_tmp10_ = extended_display_action;
	_tmp11_ = config_facade_get_instance ();
	_tmp12_ = _tmp11_;
	_tmp13_ = _variant_new9 (configuration_facade_get_display_extended_properties (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	g_action_change_state (_tmp10_, _tmp13_);
	_g_variant_unref0 (_tmp13_);
	_g_object_unref0 (_tmp12_);
	_tmp14_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonDisplaySearchbar");
	_tmp15_ = _g_object_ref0 (_tmp14_);
	search_bar_display_action = _tmp15_;
	_tmp16_ = search_bar_display_action;
	_vala_assert (_tmp16_ != NULL, "search_bar_display_action != null");
	_tmp17_ = search_bar_display_action;
	_tmp18_ = config_facade_get_instance ();
	_tmp19_ = _tmp18_;
	_tmp20_ = _variant_new10 (configuration_facade_get_display_search_bar (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	g_action_change_state (_tmp17_, _tmp20_);
	_g_variant_unref0 (_tmp20_);
	_g_object_unref0 (_tmp19_);
	_tmp21_ = g_action_map_lookup_action (G_TYPE_CHECK_INSTANCE_CAST (self, g_action_map_get_type (), GActionMap), "CommonSortEvents");
	_tmp22_ = _g_object_ref0 (_tmp21_);
	sort_events_action = _tmp22_;
	_tmp23_ = sort_events_action;
	_vala_assert (_tmp23_ != NULL, "sort_events_action != null");
	_tmp25_ = config_facade_get_instance ();
	_tmp26_ = _tmp25_;
	_tmp27_ = configuration_facade_get_events_sort_ascending (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp26_);
	if (_tmp27_) {
		_tmp24_ = LIBRARY_WINDOW_SORT_EVENTS_ORDER_ASCENDING;
	} else {
		_tmp24_ = LIBRARY_WINDOW_SORT_EVENTS_ORDER_DESCENDING;
	}
	_tmp28_ = g_strdup (_tmp24_);
	event_sort_val = _tmp28_;
	_tmp29_ = sort_events_action;
	_tmp30_ = _variant_new11 (event_sort_val);
	g_action_change_state (_tmp29_, _tmp30_);
	_g_variant_unref0 (_tmp30_);
	_g_free0 (event_sort_val);
	_g_object_unref0 (sort_events_action);
	_g_object_unref0 (search_bar_display_action);
	_g_object_unref0 (extended_display_action);
	_g_object_unref0 (basic_display_action);
}

static void
library_window_on_library_monitor_discovery_started (LibraryWindow* self)
{
	BackgroundProgressBar* _tmp0_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = self->priv->background_progress_bar;
	background_progress_bar_start (_tmp0_, _ ("Updating library…"), BACKGROUND_PROGRESS_BAR_PRIORITY_STARTUP_SCAN);
}

static void
library_window_on_library_monitor_discovery_completed (LibraryWindow* self)
{
	BackgroundProgressBar* _tmp0_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = self->priv->background_progress_bar;
	background_progress_bar_stop (_tmp0_, BACKGROUND_PROGRESS_BAR_PRIORITY_STARTUP_SCAN, TRUE);
}

static void
library_window_on_library_monitor_auto_update_progress (LibraryWindow* self,
                                                        gint completed_files,
                                                        gint total_files)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	if (total_files < LIBRARY_WINDOW_MIN_PROGRESS_BAR_FILES) {
		BackgroundProgressBar* _tmp0_;
		_tmp0_ = self->priv->background_progress_bar;
		background_progress_bar_clear (_tmp0_, BACKGROUND_PROGRESS_BAR_PRIORITY_REALTIME_UPDATE);
	} else {
		BackgroundProgressBar* _tmp1_;
		_tmp1_ = self->priv->background_progress_bar;
		background_progress_bar_update (_tmp1_, _ ("Updating library…"), BACKGROUND_PROGRESS_BAR_PRIORITY_REALTIME_UPDATE, (gdouble) completed_files, (gdouble) total_files);
	}
}

static void
library_window_on_library_monitor_auto_import_preparing (LibraryWindow* self)
{
	BackgroundProgressBar* _tmp0_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = self->priv->background_progress_bar;
	background_progress_bar_start (_tmp0_, _ ("Preparing to auto-import photos…"), BACKGROUND_PROGRESS_BAR_PRIORITY_REALTIME_UPDATE);
}

static void
library_window_on_library_monitor_auto_import_progress (LibraryWindow* self,
                                                        guint64 completed_bytes,
                                                        guint64 total_bytes)
{
	BackgroundProgressBar* _tmp0_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = self->priv->background_progress_bar;
	background_progress_bar_update (_tmp0_, _ ("Auto-importing photos…"), BACKGROUND_PROGRESS_BAR_PRIORITY_REALTIME_UPDATE, (gdouble) completed_bytes, (gdouble) total_bytes);
}

static void
library_window_on_metadata_writer_progress (LibraryWindow* self,
                                            guint completed,
                                            guint total)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	if (total < ((guint) LIBRARY_WINDOW_MIN_PROGRESS_BAR_FILES)) {
		BackgroundProgressBar* _tmp0_;
		_tmp0_ = self->priv->background_progress_bar;
		background_progress_bar_clear (_tmp0_, BACKGROUND_PROGRESS_BAR_PRIORITY_METADATA_WRITER);
	} else {
		BackgroundProgressBar* _tmp1_;
		_tmp1_ = self->priv->background_progress_bar;
		background_progress_bar_update (_tmp1_, _ ("Writing metadata to files…"), BACKGROUND_PROGRESS_BAR_PRIORITY_METADATA_WRITER, (gdouble) completed, (gdouble) total);
	}
}

static void
library_window_create_layout (LibraryWindow* self,
                              Page* start_page)
{
	GtkScrolledWindow* scrolled_sidebar = NULL;
	GtkScrolledWindow* _tmp0_;
	GtkScrolledWindow* _tmp1_;
	GtkScrolledWindow* _tmp2_;
	SidebarTree* _tmp3_;
	GtkRevealer* _tmp4_;
	GtkRevealer* _tmp5_;
	BackgroundProgressBar* _tmp6_;
	GtkRevealer* _tmp7_;
	GtkRevealer* _tmp8_;
	GtkRevealer* _tmp9_;
	GtkRevealer* _tmp10_;
	GtkRevealer* _tmp11_;
	BackgroundProgressBar* _tmp12_;
	GtkRevealer* _tmp13_;
	BasicProperties* _tmp14_;
	BasicProperties* _tmp15_;
	BasicProperties* _tmp16_;
	BasicProperties* _tmp17_;
	BasicProperties* _tmp18_;
	BasicProperties* _tmp19_;
	BasicProperties* _tmp20_;
	BasicProperties* _tmp21_;
	GtkFrame* _tmp22_;
	BasicProperties* _tmp23_;
	GtkFrame* _tmp24_;
	GtkStyleContext* _tmp25_;
	GtkBox* _tmp26_;
	GtkScrolledWindow* _tmp27_;
	GtkBox* _tmp28_;
	GtkRevealer* _tmp29_;
	GtkPaned* _tmp30_;
	GtkBox* _tmp31_;
	GtkPaned* _tmp32_;
	GtkFrame* _tmp33_;
	GtkPaned* _tmp34_;
	GtkBox* _tmp35_;
	GtkBox* _tmp36_;
	SearchFilterToolbar* _tmp37_;
	GtkBox* stack_box = NULL;
	GtkBox* _tmp38_;
	GtkBox* _tmp39_;
	GtkStack* _tmp40_;
	GtkBox* _tmp41_;
	GtkBox* _tmp42_;
	GtkBox* _tmp43_;
	GtkRevealer* _tmp44_;
	GtkPaned* _tmp45_;
	GtkPaned* _tmp46_;
	GtkPaned* _tmp47_;
	SidebarTree* _tmp48_;
	GtkPaned* _tmp49_;
	GtkBox* _tmp50_;
	GtkPaned* _tmp51_;
	ConfigFacade* _tmp52_;
	ConfigFacade* _tmp53_;
	GtkStack* _tmp54_;
	gint _tmp55_;
	gint _tmp56_;
	GtkScrolledWindow* scrolled = NULL;
	GtkScrolledWindow* _tmp57_;
	GtkScrolledWindow* _tmp58_;
	GtkScrolledWindow* _tmp59_;
	ExtendedProperties* _tmp60_;
	GtkRevealer* _tmp61_;
	GtkScrolledWindow* _tmp62_;
	GtkRevealer* _tmp63_;
	GtkRevealer* _tmp64_;
	GtkRevealer* _tmp65_;
	ExtendedProperties* _tmp66_;
	ExtendedProperties* _tmp67_;
	ExtendedProperties* _tmp68_;
	ExtendedProperties* _tmp69_;
	ExtendedProperties* _tmp70_;
	GtkScrolledWindow* _tmp71_;
	GtkBox* _tmp72_;
	GtkRevealer* _tmp73_;
	GtkRevealer* _tmp74_;
	GtkRevealer* _tmp75_;
	ConfigFacade* _tmp76_;
	ConfigFacade* _tmp77_;
	gboolean _tmp78_;
	GtkBox* _tmp81_;
	GtkPaned* _tmp82_;
	GtkBox* _tmp83_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_PAGE (start_page));
	_tmp0_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	scrolled_sidebar = _tmp0_;
	_tmp1_ = scrolled_sidebar;
	gtk_scrolled_window_set_policy (_tmp1_, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	_tmp2_ = scrolled_sidebar;
	_tmp3_ = self->priv->sidebar_tree;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, gtk_widget_get_type (), GtkWidget));
	_tmp4_ = self->priv->background_progress_frame;
	gtk_container_set_border_width (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_container_get_type (), GtkContainer), (guint) 2);
	_tmp5_ = self->priv->background_progress_frame;
	_tmp6_ = self->priv->background_progress_bar;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget));
	_tmp7_ = self->priv->background_progress_frame;
	gtk_revealer_set_transition_type (_tmp7_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP);
	_tmp8_ = self->priv->background_progress_frame;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_FILL);
	_tmp9_ = self->priv->background_progress_frame;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	_tmp10_ = self->priv->background_progress_frame;
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp11_ = self->priv->background_progress_frame;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp12_ = self->priv->background_progress_bar;
	_tmp13_ = self->priv->background_progress_frame;
	g_object_bind_property_with_closures (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, G_TYPE_OBJECT, GObject), "should-be-visible", G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, G_TYPE_OBJECT, GObject), "reveal-child", G_BINDING_DEFAULT, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp14_ = self->priv->basic_properties;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_FILL);
	_tmp15_ = self->priv->basic_properties;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_CENTER);
	_tmp16_ = self->priv->basic_properties;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp17_ = self->priv->basic_properties;
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp18_ = self->priv->basic_properties;
	gtk_widget_set_margin_top (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, gtk_widget_get_type (), GtkWidget), 10);
	_tmp19_ = self->priv->basic_properties;
	gtk_widget_set_margin_bottom (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_widget_get_type (), GtkWidget), 10);
	_tmp20_ = self->priv->basic_properties;
	gtk_widget_set_margin_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget), 6);
	_tmp21_ = self->priv->basic_properties;
	gtk_widget_set_margin_end (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_widget_get_type (), GtkWidget), 6);
	_tmp22_ = self->priv->bottom_frame;
	_tmp23_ = self->priv->basic_properties;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_widget_get_type (), GtkWidget));
	_tmp24_ = self->priv->bottom_frame;
	_tmp25_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_widget_get_type (), GtkWidget));
	gtk_style_context_remove_class (_tmp25_, "frame");
	_tmp26_ = self->priv->top_section;
	_tmp27_ = scrolled_sidebar;
	gtk_box_pack_start (_tmp26_, G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_tmp28_ = self->priv->top_section;
	_tmp29_ = self->priv->background_progress_frame;
	gtk_box_pack_end (_tmp28_, G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
	_tmp30_ = self->priv->sidebar_paned;
	_tmp31_ = self->priv->top_section;
	gtk_paned_pack1 (_tmp30_, G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE);
	_tmp32_ = self->priv->sidebar_paned;
	_tmp33_ = self->priv->bottom_frame;
	gtk_paned_pack2 (_tmp32_, G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE);
	_tmp34_ = self->priv->sidebar_paned;
	gtk_paned_set_position (_tmp34_, 1000);
	_tmp35_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->priv->right_vbox);
	self->priv->right_vbox = _tmp35_;
	_tmp36_ = self->priv->right_vbox;
	_tmp37_ = self->priv->search_toolbar;
	gtk_box_pack_start (_tmp36_, G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
	_tmp38_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp38_);
	stack_box = _tmp38_;
	_tmp39_ = stack_box;
	_tmp40_ = self->priv->stack;
	gtk_box_pack_start (_tmp39_, G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_tmp41_ = self->priv->right_vbox;
	_tmp42_ = stack_box;
	gtk_box_pack_start (_tmp41_, G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_tmp43_ = self->priv->right_vbox;
	_tmp44_ = self->priv->toolbar_revealer;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, gtk_widget_get_type (), GtkWidget));
	_tmp45_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp45_);
	_g_object_unref0 (self->priv->client_paned);
	self->priv->client_paned = _tmp45_;
	_tmp46_ = self->priv->client_paned;
	_tmp47_ = self->priv->sidebar_paned;
	gtk_paned_pack1 (_tmp46_, G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE);
	_tmp48_ = self->priv->sidebar_tree;
	gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, gtk_widget_get_type (), GtkWidget), LIBRARY_WINDOW_SIDEBAR_MIN_WIDTH, -1);
	_tmp49_ = self->priv->client_paned;
	_tmp50_ = self->priv->right_vbox;
	gtk_paned_pack2 (_tmp49_, G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, gtk_widget_get_type (), GtkWidget), TRUE, FALSE);
	_tmp51_ = self->priv->client_paned;
	_tmp52_ = config_facade_get_instance ();
	_tmp53_ = _tmp52_;
	gtk_paned_set_position (_tmp51_, configuration_facade_get_sidebar_position (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	_g_object_unref0 (_tmp53_);
	_tmp54_ = self->priv->stack;
	_tmp55_ = library_window_get_PAGE_MIN_WIDTH ();
	_tmp56_ = _tmp55_;
	gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (_tmp54_, gtk_widget_get_type (), GtkWidget), _tmp56_, -1);
	_tmp57_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp57_);
	scrolled = _tmp57_;
	_tmp58_ = scrolled;
	gtk_scrolled_window_set_policy (_tmp58_, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
	_tmp59_ = scrolled;
	_tmp60_ = self->priv->extended_properties;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp59_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, gtk_widget_get_type (), GtkWidget));
	_tmp61_ = self->priv->extended_properties_revealer;
	_tmp62_ = scrolled;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp61_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp62_, gtk_widget_get_type (), GtkWidget));
	_tmp63_ = self->priv->extended_properties_revealer;
	gtk_revealer_set_transition_type (_tmp63_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT);
	_tmp64_ = self->priv->extended_properties_revealer;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp64_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	_tmp65_ = self->priv->extended_properties_revealer;
	gtk_widget_set_valign (G_TYPE_CHECK_INSTANCE_CAST (_tmp65_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_FILL);
	_tmp66_ = self->priv->extended_properties;
	gtk_widget_set_vexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp66_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp67_ = self->priv->extended_properties;
	gtk_widget_set_margin_top (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, gtk_widget_get_type (), GtkWidget), 9);
	_tmp68_ = self->priv->extended_properties;
	gtk_widget_set_margin_bottom (G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, gtk_widget_get_type (), GtkWidget), 9);
	_tmp69_ = self->priv->extended_properties;
	gtk_widget_set_margin_start (G_TYPE_CHECK_INSTANCE_CAST (_tmp69_, gtk_widget_get_type (), GtkWidget), 9);
	_tmp70_ = self->priv->extended_properties;
	gtk_widget_set_margin_end (G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, gtk_widget_get_type (), GtkWidget), 9);
	_tmp71_ = scrolled;
	gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, gtk_widget_get_type (), GtkWidget), LIBRARY_WINDOW_EXTENDED_INFO_MIN_WIDTH, -1);
	_tmp72_ = stack_box;
	_tmp73_ = self->priv->extended_properties_revealer;
	gtk_box_pack_end (_tmp72_, G_TYPE_CHECK_INSTANCE_CAST (_tmp73_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
	_tmp74_ = self->priv->extended_properties_revealer;
	gtk_widget_set_halign (G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, gtk_widget_get_type (), GtkWidget), GTK_ALIGN_END);
	_tmp75_ = self->priv->extended_properties_revealer;
	gtk_widget_set_hexpand (G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp76_ = config_facade_get_instance ();
	_tmp77_ = _tmp76_;
	_tmp78_ = configuration_facade_get_display_extended_properties (G_TYPE_CHECK_INSTANCE_CAST (_tmp77_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp77_);
	if (_tmp78_) {
		GtkRevealer* _tmp79_;
		_tmp79_ = self->priv->extended_properties_revealer;
		gtk_revealer_set_reveal_child (_tmp79_, TRUE);
	} else {
		GtkRevealer* _tmp80_;
		_tmp80_ = self->priv->extended_properties_revealer;
		gtk_revealer_set_reveal_child (_tmp80_, FALSE);
	}
	_tmp81_ = self->priv->layout;
	_tmp82_ = self->priv->client_paned;
	gtk_box_pack_end (_tmp81_, G_TYPE_CHECK_INSTANCE_CAST (_tmp82_, gtk_widget_get_type (), GtkWidget), TRUE, TRUE, (guint) 0);
	_tmp83_ = self->priv->layout;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp83_, gtk_widget_get_type (), GtkWidget));
	library_window_switch_to_page (self, start_page);
	gtk_widget_grab_focus (G_TYPE_CHECK_INSTANCE_CAST (start_page, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (scrolled);
	_g_object_unref0 (stack_box);
	_g_object_unref0 (scrolled_sidebar);
}

static void
library_window_real_set_current_page (PageWindow* base,
                                      Page* page)
{
	LibraryWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	g_return_if_fail (IS_PAGE (page));
	library_window_switch_to_page (self, page);
}

void
library_window_set_page_switching_enabled (LibraryWindow* self,
                                           gboolean should_enable)
{
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	self->priv->page_switching_enabled = should_enable;
}

void
library_window_switch_to_page (LibraryWindow* self,
                               Page* page)
{
	Page* _tmp0_;
	Page* _tmp1_;
	gboolean _tmp2_;
	Page* current_page = NULL;
	Page* _tmp3_;
	Page* _tmp4_;
	GtkStack* _tmp14_;
	SidebarEntry* entry = NULL;
	GeeHashMap* _tmp16_;
	gpointer _tmp17_;
	SidebarEntry* _tmp18_;
	Page* _tmp28_;
	Page* _tmp29_;
	GMenuModel* _tmp30_;
	GMenuModel* _tmp31_;
	gboolean old = FALSE;
	GtkSettings* _tmp32_;
	gboolean _tmp33_;
	gboolean _tmp34_;
	GtkSettings* _tmp35_;
	GtkSettings* _tmp36_;
	GtkToolbar* toolbar = NULL;
	GtkToolbar* _tmp37_;
	GtkToolbar* _tmp38_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_PAGE (page));
	if (!self->priv->page_switching_enabled) {
		return;
	}
	_tmp0_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp1_ = _tmp0_;
	_tmp2_ = page == _tmp1_;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	current_page = _tmp3_;
	_tmp4_ = current_page;
	if (_tmp4_ != NULL) {
		GtkToolbar* toolbar = NULL;
		Page* _tmp5_;
		GtkToolbar* _tmp6_;
		GtkToolbar* _tmp7_;
		Page* _tmp10_;
		Page* _tmp11_;
		Page* _tmp13_;
		gtk_application_window_set_show_menubar (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow), FALSE);
		application_set_menubar (NULL);
		_tmp5_ = current_page;
		_tmp6_ = page_get_toolbar (_tmp5_);
		toolbar = _tmp6_;
		_tmp7_ = toolbar;
		if (_tmp7_ != NULL) {
			GtkRevealer* _tmp8_;
			GtkToolbar* _tmp9_;
			_tmp8_ = self->priv->toolbar_revealer;
			_tmp9_ = toolbar;
			gtk_container_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
		}
		_tmp10_ = current_page;
		page_switching_from (_tmp10_);
		_tmp11_ = current_page;
		if (IS_LIBRARY_PHOTO_PAGE (_tmp11_)) {
			SidebarTree* _tmp12_;
			_tmp12_ = self->priv->sidebar_tree;
			sidebar_tree_enable_editing (_tmp12_);
		}
		_tmp13_ = current_page;
		library_window_unsubscribe_from_basic_information (self, _tmp13_);
		_g_object_unref0 (toolbar);
	}
	_tmp14_ = self->priv->stack;
	gtk_stack_set_visible_child (_tmp14_, G_TYPE_CHECK_INSTANCE_CAST (page, gtk_widget_get_type (), GtkWidget));
	PAGE_WINDOW_CLASS (library_window_parent_class)->set_current_page (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), TYPE_PAGE_WINDOW, PageWindow), page);
	if (IS_LIBRARY_PHOTO_PAGE (page)) {
		SidebarTree* _tmp15_;
		_tmp15_ = self->priv->sidebar_tree;
		sidebar_tree_disable_editing (_tmp15_);
	}
	library_window_toggle_search_bar (self, library_window_should_show_search_bar (self), IS_CHECKERBOARD_PAGE (page) ? ((CheckerboardPage*) page) : NULL);
	_tmp16_ = self->priv->page_map;
	_tmp17_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), page);
	entry = (SidebarEntry*) _tmp17_;
	_tmp18_ = entry;
	if (_tmp18_ != NULL) {
		SidebarExpandableEntry* expandable_entry = NULL;
		SidebarEntry* _tmp19_;
		SidebarExpandableEntry* _tmp20_;
		gboolean _tmp21_ = FALSE;
		SidebarExpandableEntry* _tmp22_;
		SidebarTree* _tmp26_;
		SidebarEntry* _tmp27_;
		_tmp19_ = entry;
		_tmp20_ = _g_object_ref0 (SIDEBAR_IS_EXPANDABLE_ENTRY (_tmp19_) ? ((SidebarExpandableEntry*) _tmp19_) : NULL);
		expandable_entry = _tmp20_;
		_tmp22_ = expandable_entry;
		if (_tmp22_ != NULL) {
			SidebarExpandableEntry* _tmp23_;
			_tmp23_ = expandable_entry;
			_tmp21_ = sidebar_expandable_entry_expand_on_select (_tmp23_);
		} else {
			_tmp21_ = FALSE;
		}
		if (_tmp21_) {
			SidebarTree* _tmp24_;
			SidebarEntry* _tmp25_;
			_tmp24_ = self->priv->sidebar_tree;
			_tmp25_ = entry;
			sidebar_tree_expand_to_entry (_tmp24_, _tmp25_);
		}
		_tmp26_ = self->priv->sidebar_tree;
		_tmp27_ = entry;
		sidebar_tree_place_cursor (_tmp26_, _tmp27_, TRUE);
		_g_object_unref0 (expandable_entry);
	}
	library_window_on_update_properties (self);
	if (IS_CHECKERBOARD_PAGE (page)) {
		library_window_init_view_filter (self, G_TYPE_CHECK_INSTANCE_CAST (page, TYPE_CHECKERBOARD_PAGE, CheckerboardPage));
	}
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (page, gtk_widget_get_type (), GtkWidget));
	_tmp28_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp29_ = _tmp28_;
	library_window_subscribe_for_basic_information (self, _tmp29_);
	_g_object_unref0 (_tmp29_);
	page_switched_to (page);
	_tmp30_ = page_get_menubar (page);
	_tmp31_ = _tmp30_;
	application_set_menubar (_tmp31_);
	_g_object_unref0 (_tmp31_);
	gtk_application_window_set_show_menubar (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_application_window_get_type (), GtkApplicationWindow), TRUE);
	_tmp32_ = gtk_widget_get_settings (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	g_object_get (_tmp32_, "gtk-shell-shows-menubar", &_tmp33_, NULL);
	_tmp34_ = _tmp33_;
	old = _tmp34_;
	_tmp35_ = gtk_widget_get_settings (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	g_object_set (_tmp35_, "gtk-shell-shows-menubar", !old, NULL);
	_tmp36_ = gtk_widget_get_settings (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	g_object_set (_tmp36_, "gtk-shell-shows-menubar", old, NULL);
	_tmp37_ = page_get_toolbar (page);
	toolbar = _tmp37_;
	_tmp38_ = toolbar;
	if (_tmp38_ != NULL) {
		GtkRevealer* _tmp39_;
		GtkToolbar* _tmp40_;
		GtkToolbar* _tmp41_;
		GtkRevealer* _tmp42_;
		_tmp39_ = self->priv->toolbar_revealer;
		_tmp40_ = toolbar;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, gtk_widget_get_type (), GtkWidget));
		_tmp41_ = toolbar;
		gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, gtk_widget_get_type (), GtkWidget));
		_tmp42_ = self->priv->toolbar_revealer;
		gtk_revealer_set_reveal_child (_tmp42_, library_window_is_toolbar_visible (self));
	}
	page_ready (page);
	_g_object_unref0 (toolbar);
	_g_object_unref0 (entry);
	_g_object_unref0 (current_page);
}

static void
library_window_init_view_filter (LibraryWindow* self,
                                 CheckerboardPage* page)
{
	SearchFilterToolbar* _tmp0_;
	SearchViewFilter* _tmp1_;
	SearchViewFilter* _tmp2_;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	SearchViewFilter* _tmp5_;
	SearchViewFilter* _tmp6_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_CHECKERBOARD_PAGE (page));
	_tmp0_ = self->priv->search_toolbar;
	_tmp1_ = checkerboard_page_get_search_view_filter (page);
	_tmp2_ = _tmp1_;
	search_filter_toolbar_set_view_filter (_tmp0_, _tmp2_);
	_view_filter_unref0 (_tmp2_);
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (page, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = checkerboard_page_get_search_view_filter (page);
	_tmp6_ = _tmp5_;
	view_collection_install_view_filter (_tmp4_, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_VIEW_FILTER, ViewFilter));
	_view_filter_unref0 (_tmp6_);
	_data_collection_unref0 (_tmp4_);
}

static gboolean
library_window_should_show_search_bar (LibraryWindow* self)
{
	gboolean _tmp0_ = FALSE;
	Page* _tmp1_;
	Page* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	g_return_val_if_fail (IS_LIBRARY_WINDOW (self), FALSE);
	_tmp1_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp2_ = _tmp1_;
	_tmp3_ = IS_CHECKERBOARD_PAGE (_tmp2_);
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		_tmp0_ = self->priv->is_search_toolbar_visible;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static void
library_window_toggle_search_bar (LibraryWindow* self,
                                  gboolean show,
                                  CheckerboardPage* page)
{
	SearchFilterToolbar* _tmp0_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail ((page == NULL) || IS_CHECKERBOARD_PAGE (page));
	_tmp0_ = self->priv->search_toolbar;
	gtk_revealer_set_reveal_child (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_revealer_get_type (), GtkRevealer), show);
	if (show) {
		SearchFilterToolbar* _tmp1_;
		SearchViewFilter* _tmp2_;
		SearchViewFilter* _tmp3_;
		ViewCollection* _tmp4_;
		ViewCollection* _tmp5_;
		SearchViewFilter* _tmp6_;
		SearchViewFilter* _tmp7_;
		_vala_assert (NULL != page, "null != page");
		_tmp1_ = self->priv->search_toolbar;
		_tmp2_ = checkerboard_page_get_search_view_filter (page);
		_tmp3_ = _tmp2_;
		search_filter_toolbar_set_view_filter (_tmp1_, _tmp3_);
		_view_filter_unref0 (_tmp3_);
		_tmp4_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (page, TYPE_PAGE, Page));
		_tmp5_ = _tmp4_;
		_tmp6_ = checkerboard_page_get_search_view_filter (page);
		_tmp7_ = _tmp6_;
		view_collection_install_view_filter (_tmp5_, G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_VIEW_FILTER, ViewFilter));
		_view_filter_unref0 (_tmp7_);
		_data_collection_unref0 (_tmp5_);
	} else {
		if (page != NULL) {
			ViewCollection* _tmp8_;
			ViewCollection* _tmp9_;
			DisabledViewFilter* _tmp10_;
			DisabledViewFilter* _tmp11_;
			_tmp8_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (page, TYPE_PAGE, Page));
			_tmp9_ = _tmp8_;
			_tmp10_ = disabled_view_filter_new ();
			_tmp11_ = _tmp10_;
			view_collection_install_view_filter (_tmp9_, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_VIEW_FILTER, ViewFilter));
			_view_filter_unref0 (_tmp11_);
			_data_collection_unref0 (_tmp9_);
		}
	}
}

static void
library_window_on_page_created (LibraryWindow* self,
                                SidebarPageRepresentative* entry,
                                Page* page)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (SIDEBAR_IS_PAGE_REPRESENTATIVE (entry));
	g_return_if_fail (IS_PAGE (page));
	_tmp0_ = self->priv->page_map;
	_vala_assert (!gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), page), "!page_map.has_key(page)");
	_tmp1_ = self->priv->page_map;
	gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), page, G_TYPE_CHECK_INSTANCE_CAST (entry, SIDEBAR_TYPE_ENTRY, SidebarEntry));
	library_window_add_to_stack (self, page);
}

static void
library_window_on_destroying_page (LibraryWindow* self,
                                   SidebarPageRepresentative* entry,
                                   Page* page)
{
	Page* _tmp0_;
	Page* _tmp1_;
	gboolean _tmp2_;
	gboolean removed = FALSE;
	GeeHashMap* _tmp8_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (SIDEBAR_IS_PAGE_REPRESENTATIVE (entry));
	g_return_if_fail (IS_PAGE (page));
	_tmp0_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp1_ = _tmp0_;
	_tmp2_ = page == _tmp1_;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		LibraryBranch* _tmp3_;
		LibraryPhotosEntry* _tmp4_;
		LibraryPhotosEntry* _tmp5_;
		Page* _tmp6_;
		Page* _tmp7_;
		_tmp3_ = self->priv->library_branch;
		_tmp4_ = library_branch_get_photos_entry (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
		_tmp7_ = _tmp6_;
		library_window_switch_to_page (self, _tmp7_);
		_g_object_unref0 (_tmp7_);
	}
	library_window_remove_from_stack (self, page);
	_tmp8_ = self->priv->page_map;
	removed = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), page, NULL);
	_vala_assert (removed, "removed");
}

static void
library_window_on_sidebar_entry_selected (LibraryWindow* self,
                                          SidebarSelectableEntry* selectable)
{
	SidebarPageRepresentative* page_rep = NULL;
	SidebarPageRepresentative* _tmp0_;
	SidebarPageRepresentative* _tmp1_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (SIDEBAR_IS_SELECTABLE_ENTRY (selectable));
	_tmp0_ = _g_object_ref0 (SIDEBAR_IS_PAGE_REPRESENTATIVE (selectable) ? ((SidebarPageRepresentative*) selectable) : NULL);
	page_rep = _tmp0_;
	_tmp1_ = page_rep;
	if (_tmp1_ != NULL) {
		SidebarPageRepresentative* _tmp2_;
		Page* _tmp3_;
		Page* _tmp4_;
		_tmp2_ = page_rep;
		_tmp3_ = sidebar_page_representative_get_page (_tmp2_);
		_tmp4_ = _tmp3_;
		library_window_switch_to_page (self, _tmp4_);
		_g_object_unref0 (_tmp4_);
	}
	_g_object_unref0 (page_rep);
}

static void
library_window_on_sidebar_selected_entry_removed (LibraryWindow* self,
                                                  SidebarSelectableEntry* selectable)
{
	LibraryLastImportSidebarEntry* last_import_entry = NULL;
	LibraryBranch* _tmp0_;
	LibraryLastImportSidebarEntry* _tmp1_;
	LibraryLastImportSidebarEntry* _tmp2_;
	LibraryLastImportSidebarEntry* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp11_ = FALSE;
	gboolean _tmp18_ = FALSE;
	LibraryBranch* _tmp25_;
	LibraryPhotosEntry* _tmp26_;
	LibraryPhotosEntry* _tmp27_;
	Page* _tmp28_;
	Page* _tmp29_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (SIDEBAR_IS_SELECTABLE_ENTRY (selectable));
	_tmp0_ = self->priv->library_branch;
	_tmp1_ = library_branch_get_last_imported_entry (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	last_import_entry = _tmp3_;
	if (LIBRARY_IS_IMPORT_QUEUE_SIDEBAR_ENTRY (selectable)) {
		LibraryLastImportSidebarEntry* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = last_import_entry;
		_tmp6_ = library_hideable_page_entry_get_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, LIBRARY_TYPE_HIDEABLE_PAGE_ENTRY, LibraryHideablePageEntry));
		_tmp7_ = _tmp6_;
		_tmp4_ = _tmp7_;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		LibraryLastImportSidebarEntry* _tmp8_;
		Page* _tmp9_;
		Page* _tmp10_;
		_tmp8_ = last_import_entry;
		_tmp9_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
		_tmp10_ = _tmp9_;
		library_window_switch_to_page (self, _tmp10_);
		_g_object_unref0 (_tmp10_);
		_g_object_unref0 (last_import_entry);
		return;
	}
	if (EVENTS_IS_EVENT_ENTRY (selectable)) {
		EventsBranch* _tmp12_;
		_tmp12_ = self->priv->events_branch;
		_tmp11_ = sidebar_branch_get_show_branch (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, SIDEBAR_TYPE_BRANCH, SidebarBranch));
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		EventsBranch* _tmp13_;
		EventsMasterDirectoryEntry* _tmp14_;
		EventsMasterDirectoryEntry* _tmp15_;
		Page* _tmp16_;
		Page* _tmp17_;
		_tmp13_ = self->priv->events_branch;
		_tmp14_ = events_branch_get_master_entry (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
		_tmp17_ = _tmp16_;
		library_window_switch_to_page (self, _tmp17_);
		_g_object_unref0 (_tmp17_);
		_g_object_unref0 (_tmp15_);
		_g_object_unref0 (last_import_entry);
		return;
	}
	if (EVENTS_IS_DIRECTORY_ENTRY (selectable)) {
		EventsBranch* _tmp19_;
		_tmp19_ = self->priv->events_branch;
		_tmp18_ = sidebar_branch_get_show_branch (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, SIDEBAR_TYPE_BRANCH, SidebarBranch));
	} else {
		_tmp18_ = FALSE;
	}
	if (_tmp18_) {
		EventsBranch* _tmp20_;
		EventsMasterDirectoryEntry* _tmp21_;
		EventsMasterDirectoryEntry* _tmp22_;
		Page* _tmp23_;
		Page* _tmp24_;
		_tmp20_ = self->priv->events_branch;
		_tmp21_ = events_branch_get_master_entry (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
		_tmp24_ = _tmp23_;
		library_window_switch_to_page (self, _tmp24_);
		_g_object_unref0 (_tmp24_);
		_g_object_unref0 (_tmp22_);
		_g_object_unref0 (last_import_entry);
		return;
	}
	_tmp25_ = self->priv->library_branch;
	_tmp26_ = library_branch_get_photos_entry (_tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = sidebar_page_representative_get_page (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, SIDEBAR_TYPE_PAGE_REPRESENTATIVE, SidebarPageRepresentative));
	_tmp29_ = _tmp28_;
	library_window_switch_to_page (self, _tmp29_);
	_g_object_unref0 (_tmp29_);
	_g_object_unref0 (last_import_entry);
}

static void
_library_window_on_update_properties_view_collection_items_state_changed (ViewCollection* _sender,
                                                                          GeeIterable* changed,
                                                                          gpointer self)
{
	library_window_on_update_properties ((LibraryWindow*) self);
}

static void
_library_window_on_update_properties_data_collection_items_altered (DataCollection* _sender,
                                                                    GeeMap* items,
                                                                    gpointer self)
{
	library_window_on_update_properties ((LibraryWindow*) self);
}

static void
_library_window_on_update_properties_data_collection_contents_altered (DataCollection* _sender,
                                                                       GeeIterable* added,
                                                                       GeeIterable* removed,
                                                                       gpointer self)
{
	library_window_on_update_properties ((LibraryWindow*) self);
}

static void
_library_window_on_update_properties_view_collection_items_visibility_changed (ViewCollection* _sender,
                                                                               GeeCollection* changed,
                                                                               gpointer self)
{
	library_window_on_update_properties ((LibraryWindow*) self);
}

static void
library_window_subscribe_for_basic_information (LibraryWindow* self,
                                                Page* page)
{
	ViewCollection* view = NULL;
	ViewCollection* _tmp0_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_PAGE (page));
	_tmp0_ = page_get_view (page);
	view = _tmp0_;
	g_signal_connect_object (view, "items-state-changed", (GCallback) _library_window_on_update_properties_view_collection_items_state_changed, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (view, TYPE_DATA_COLLECTION, DataCollection), "items-altered", (GCallback) _library_window_on_update_properties_data_collection_items_altered, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (view, TYPE_DATA_COLLECTION, DataCollection), "contents-altered", (GCallback) _library_window_on_update_properties_data_collection_contents_altered, self, 0);
	g_signal_connect_object (view, "items-visibility-changed", (GCallback) _library_window_on_update_properties_view_collection_items_visibility_changed, self, 0);
	_data_collection_unref0 (view);
}

static void
library_window_unsubscribe_from_basic_information (LibraryWindow* self,
                                                   Page* page)
{
	ViewCollection* view = NULL;
	ViewCollection* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	guint _tmp3_;
	guint _tmp4_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (IS_PAGE (page));
	_tmp0_ = page_get_view (page);
	view = _tmp0_;
	g_signal_parse_name ("items-state-changed", TYPE_VIEW_COLLECTION, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (view, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _library_window_on_update_properties_view_collection_items_state_changed, self);
	g_signal_parse_name ("items-altered", TYPE_DATA_COLLECTION, &_tmp2_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (view, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _library_window_on_update_properties_data_collection_items_altered, self);
	g_signal_parse_name ("contents-altered", TYPE_DATA_COLLECTION, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (view, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _library_window_on_update_properties_data_collection_contents_altered, self);
	g_signal_parse_name ("items-visibility-changed", TYPE_VIEW_COLLECTION, &_tmp4_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (view, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _library_window_on_update_properties_view_collection_items_visibility_changed, self);
	_data_collection_unref0 (view);
}

static void
library_window_on_update_properties (LibraryWindow* self)
{
	OneShotScheduler* _tmp0_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = self->priv->properties_scheduler;
	one_shot_scheduler_at_idle (_tmp0_);
}

static void
library_window_on_update_properties_now (LibraryWindow* self)
{
	GtkFrame* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	ExtendedProperties* _tmp6_;
	gboolean _tmp7_;
	gboolean _tmp8_;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	_tmp0_ = self->priv->bottom_frame;
	_tmp1_ = gtk_widget_get_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget));
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		BasicProperties* _tmp3_;
		Page* _tmp4_;
		Page* _tmp5_;
		_tmp3_ = self->priv->basic_properties;
		_tmp4_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
		_tmp5_ = _tmp4_;
		properties_update_properties (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_PROPERTIES, Properties), _tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	_tmp6_ = self->priv->extended_properties;
	_tmp7_ = gtk_widget_get_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget));
	_tmp8_ = _tmp7_;
	if (_tmp8_) {
		ExtendedProperties* _tmp9_;
		Page* _tmp10_;
		Page* _tmp11_;
		_tmp9_ = self->priv->extended_properties;
		_tmp10_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
		_tmp11_ = _tmp10_;
		properties_update_properties (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_PROPERTIES, Properties), _tmp11_);
		_g_object_unref0 (_tmp11_);
	}
}

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

void
library_window_mounted_camera_shell_notification (LibraryWindow* self,
                                                  const gchar* uri,
                                                  gboolean at_startup)
{
	GFile* uri_file = NULL;
	GFile* _tmp0_;
	GMount* mount = NULL;
	gchar* alt_uri = NULL;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (IS_LIBRARY_WINDOW (self));
	g_return_if_fail (uri != NULL);
	g_debug ("LibraryWindow.vala:1325: mount point reported: %s", uri);
	if (!library_window_is_mount_uri_supported (uri)) {
		g_debug ("LibraryWindow.vala:1329: Unsupported mount scheme: %s", uri);
		return;
	}
	_tmp0_ = g_file_new_for_uri (uri);
	uri_file = _tmp0_;
	mount = NULL;
	{
		GMount* _tmp1_ = NULL;
		GFile* _tmp2_;
		GMount* _tmp3_;
		GMount* _tmp4_;
		_tmp2_ = uri_file;
		_tmp3_ = g_file_find_enclosing_mount (_tmp2_, NULL, &_inner_error0_);
		_tmp1_ = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (mount);
		mount = _tmp4_;
		_g_object_unref0 (_tmp1_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = err;
		_tmp6_ = _tmp5_->message;
		g_debug ("LibraryWindow.vala:1341: %s", _tmp6_);
		_g_error_free0 (err);
		_g_object_unref0 (mount);
		_g_object_unref0 (uri_file);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (mount);
		_g_object_unref0 (uri_file);
		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;
	}
	alt_uri = NULL;
	if (g_str_has_prefix (uri, "file://")) {
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp7_ = string_replace (uri, "file://", "disk:");
		_tmp8_ = _tmp7_;
		_tmp9_ = camera_table_get_port_uri (_tmp8_);
		_g_free0 (alt_uri);
		alt_uri = _tmp9_;
		_g_free0 (_tmp8_);
	}
	if (at_startup) {
		const gchar* _tmp11_;
		if (!is_string_empty (uri)) {
			GeeHashSet* _tmp10_;
			_tmp10_ = library_window_initial_camera_uris;
			gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), uri);
		}
		_tmp11_ = alt_uri;
		if (!is_string_empty (_tmp11_)) {
			GeeHashSet* _tmp12_;
			const gchar* _tmp13_;
			_tmp12_ = library_window_initial_camera_uris;
			_tmp13_ = alt_uri;
			gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp13_);
		}
	}
	_g_free0 (alt_uri);
	_g_object_unref0 (mount);
	_g_object_unref0 (uri_file);
}

static gboolean
library_window_real_key_press_event (GtkWidget* base,
                                     GdkEventKey* event)
{
	LibraryWindow * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	SidebarTree* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	const gchar* _tmp8_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_LIBRARY_WINDOW, LibraryWindow);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp2_ = self->priv->sidebar_tree;
	g_object_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), "has-focus", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	if (_tmp4_) {
		SidebarTree* _tmp5_;
		_tmp5_ = self->priv->sidebar_tree;
		_tmp1_ = sidebar_tree_is_keypress_interpreted (_tmp5_, event);
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		SidebarTree* _tmp6_;
		gboolean _tmp7_ = FALSE;
		_tmp6_ = self->priv->sidebar_tree;
		g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), "key-press-event", event, &_tmp7_);
		_tmp0_ = _tmp7_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	if (GTK_WIDGET_CLASS (library_window_parent_class)->key_press_event (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_APP_WINDOW, AppWindow), gtk_widget_get_type (), GtkWidget), event)) {
		result = TRUE;
		return result;
	}
	_tmp8_ = gdk_keyval_name (event->keyval);
	if (g_strcmp0 (_tmp8_, "Escape") == 0) {
		library_window_on_clear_search (self);
		result = TRUE;
		return result;
	}
	result = FALSE;
	return result;
}

gint
library_window_get_PAGE_MIN_WIDTH (void)
{
	gint result;
	gint _tmp0_;
	gint _tmp1_;
	_tmp0_ = thumbnail_get_MAX_SCALE ();
	_tmp1_ = _tmp0_;
	result = _tmp1_ + (CHECKERBOARD_LAYOUT_COLUMN_GUTTER_PADDING * 2);
	return result;
}

static inline gpointer
library_window_fullscreen_photo_page_get_instance_private (LibraryWindowFullscreenPhotoPage* self)
{
	return G_STRUCT_MEMBER_P (self, LibraryWindowFullscreenPhotoPage_private_offset);
}

static gpointer
_data_collection_ref0 (gpointer self)
{
	return self ? data_collection_ref (self) : NULL;
}

static LibraryWindowFullscreenPhotoPage*
library_window_fullscreen_photo_page_construct (GType object_type,
                                                CollectionPage* collection,
                                                Photo* start,
                                                ViewCollection* view)
{
	LibraryWindowFullscreenPhotoPage * self = NULL;
	CollectionPage* _tmp0_;
	Photo* _tmp1_;
	ViewCollection* _tmp2_;
	g_return_val_if_fail (IS_COLLECTION_PAGE (collection), NULL);
	g_return_val_if_fail (IS_PHOTO (start), NULL);
	g_return_val_if_fail ((view == NULL) || IS_VIEW_COLLECTION (view), NULL);
	self = (LibraryWindowFullscreenPhotoPage*) library_photo_page_construct (object_type);
	_tmp0_ = _g_object_ref0 (collection);
	_g_object_unref0 (self->priv->collection);
	self->priv->collection = _tmp0_;
	_tmp1_ = _g_object_ref0 (start);
	_g_object_unref0 (self->priv->start);
	self->priv->start = _tmp1_;
	_tmp2_ = _data_collection_ref0 (view);
	_data_collection_unref0 (self->priv->view);
	self->priv->view = _tmp2_;
	return self;
}

static LibraryWindowFullscreenPhotoPage*
library_window_fullscreen_photo_page_new (CollectionPage* collection,
                                          Photo* start,
                                          ViewCollection* view)
{
	return library_window_fullscreen_photo_page_construct (LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE, collection, start, view);
}

static void
library_window_fullscreen_photo_page_real_switched_to (Page* base)
{
	LibraryWindowFullscreenPhotoPage * self;
	CollectionPage* _tmp0_;
	Photo* _tmp1_;
	ViewCollection* _tmp2_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE, LibraryWindowFullscreenPhotoPage);
	_tmp0_ = self->priv->collection;
	_tmp1_ = self->priv->start;
	_tmp2_ = self->priv->view;
	library_photo_page_display_for_collection (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_LIBRARY_PHOTO_PAGE, LibraryPhotoPage), _tmp0_, _tmp1_, _tmp2_);
	PAGE_CLASS (library_window_fullscreen_photo_page_parent_class)->switched_to (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_LIBRARY_PHOTO_PAGE, LibraryPhotoPage), TYPE_PAGE, Page));
}

static void
library_window_fullscreen_photo_page_real_switching_from (Page* base)
{
	LibraryWindowFullscreenPhotoPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE, LibraryWindowFullscreenPhotoPage);
}

static void
library_window_fullscreen_photo_page_real_init_collect_ui_filenames (Page* base,
                                                                     GeeList* ui_filenames)
{
	LibraryWindowFullscreenPhotoPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE, LibraryWindowFullscreenPhotoPage);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (ui_filenames, GEE_TYPE_LIST));
	gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (ui_filenames, GEE_TYPE_COLLECTION, GeeCollection), "photo_context.ui");
}

static void
library_window_fullscreen_photo_page_class_init (LibraryWindowFullscreenPhotoPageClass * klass,
                                                 gpointer klass_data)
{
	library_window_fullscreen_photo_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LibraryWindowFullscreenPhotoPage_private_offset);
	((PageClass *) klass)->switched_to = (void (*) (Page*)) library_window_fullscreen_photo_page_real_switched_to;
	((PageClass *) klass)->switching_from = (void (*) (Page*)) library_window_fullscreen_photo_page_real_switching_from;
	((PageClass *) klass)->init_collect_ui_filenames = (void (*) (Page*, GeeList*)) library_window_fullscreen_photo_page_real_init_collect_ui_filenames;
	G_OBJECT_CLASS (klass)->finalize = library_window_fullscreen_photo_page_finalize;
}

static void
library_window_fullscreen_photo_page_instance_init (LibraryWindowFullscreenPhotoPage * self,
                                                    gpointer klass)
{
	self->priv = library_window_fullscreen_photo_page_get_instance_private (self);
}

static void
library_window_fullscreen_photo_page_finalize (GObject * obj)
{
	LibraryWindowFullscreenPhotoPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LIBRARY_WINDOW_TYPE_FULLSCREEN_PHOTO_PAGE, LibraryWindowFullscreenPhotoPage);
	_g_object_unref0 (self->priv->collection);
	_g_object_unref0 (self->priv->start);
	_data_collection_unref0 (self->priv->view);
	G_OBJECT_CLASS (library_window_fullscreen_photo_page_parent_class)->finalize (obj);
}

static GType
library_window_fullscreen_photo_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LibraryWindowFullscreenPhotoPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_window_fullscreen_photo_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryWindowFullscreenPhotoPage), 0, (GInstanceInitFunc) library_window_fullscreen_photo_page_instance_init, NULL };
	GType library_window_fullscreen_photo_page_type_id;
	library_window_fullscreen_photo_page_type_id = g_type_register_static (TYPE_LIBRARY_PHOTO_PAGE, "LibraryWindowFullscreenPhotoPage", &g_define_type_info, 0);
	LibraryWindowFullscreenPhotoPage_private_offset = g_type_add_instance_private (library_window_fullscreen_photo_page_type_id, sizeof (LibraryWindowFullscreenPhotoPagePrivate));
	return library_window_fullscreen_photo_page_type_id;
}

static GType
library_window_fullscreen_photo_page_get_type (void)
{
	static volatile gsize library_window_fullscreen_photo_page_type_id__once = 0;
	if (g_once_init_enter (&library_window_fullscreen_photo_page_type_id__once)) {
		GType library_window_fullscreen_photo_page_type_id;
		library_window_fullscreen_photo_page_type_id = library_window_fullscreen_photo_page_get_type_once ();
		g_once_init_leave (&library_window_fullscreen_photo_page_type_id__once, library_window_fullscreen_photo_page_type_id);
	}
	return library_window_fullscreen_photo_page_type_id__once;
}

static void
library_window_class_init (LibraryWindowClass * klass,
                           gpointer klass_data)
{
	GeeHashSet* _tmp0_;
	library_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LibraryWindow_private_offset);
	((AppWindowClass *) klass)->add_actions = (void (*) (AppWindow*)) library_window_real_add_actions;
	((PageWindowClass *) klass)->switched_pages = (void (*) (PageWindow*, Page*, Page*)) library_window_real_switched_pages;
	((GtkWidgetClass *) klass)->show_all = (void (*) (GtkWidget*)) library_window_real_show_all;
	((AppWindowClass *) klass)->get_app_role = (gchar* (*) (AppWindow*)) library_window_real_get_app_role;
	((AppWindowClass *) klass)->on_quit = (void (*) (AppWindow*)) library_window_real_on_quit;
	((AppWindowClass *) klass)->on_fullscreen = (void (*) (AppWindow*)) library_window_real_on_fullscreen;
	((AppWindowClass *) klass)->update_common_action_availability = (void (*) (AppWindow*, Page*, Page*)) library_window_real_update_common_action_availability;
	((AppWindowClass *) klass)->update_common_actions = (void (*) (AppWindow*, Page*, gint, gint)) library_window_real_update_common_actions;
	((GtkWidgetClass *) klass)->drag_motion = (gboolean (*) (GtkWidget*, GdkDragContext*, gint, gint, guint)) library_window_real_drag_motion;
	((GtkWidgetClass *) klass)->drag_data_received = (void (*) (GtkWidget*, GdkDragContext*, gint, gint, GtkSelectionData*, guint, guint)) library_window_real_drag_data_received;
	((PageWindowClass *) klass)->set_current_page = (void (*) (PageWindow*, Page*)) library_window_real_set_current_page;
	((GtkWidgetClass *) klass)->key_press_event = (gboolean (*) (GtkWidget*, GdkEventKey*)) library_window_real_key_press_event;
	G_OBJECT_CLASS (klass)->get_property = _vala_library_window_get_property;
	G_OBJECT_CLASS (klass)->finalize = library_window_finalize;
	_tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL);
	library_window_initial_camera_uris = _tmp0_;
}

static void
library_window_instance_init (LibraryWindow * self,
                              gpointer klass)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	GtkPaned* _tmp2_;
	GtkPaned* _tmp3_;
	GtkFrame* _tmp4_;
	LibraryBranch* _tmp5_;
	TagsBranch* _tmp6_;
	FoldersBranch* _tmp7_;
	FacesBranch* _tmp8_;
	EventsBranch* _tmp9_;
	CameraBranch* _tmp10_;
	SearchesBranch* _tmp11_;
	ImportRollBranch* _tmp12_;
	GeeHashMap* _tmp13_;
	SearchFilterActions* _tmp14_;
	GtkBox* _tmp15_;
	GtkRevealer* _tmp16_;
	BackgroundProgressBar* _tmp17_;
	ExtendedProperties* _tmp18_;
	GtkRevealer* _tmp19_;
	GtkStack* _tmp20_;
	GtkBox* _tmp21_;
	GtkRevealer* _tmp22_;
	self->priv = library_window_get_instance_private (self);
	_tmp0_ = g_get_home_dir ();
	_tmp1_ = g_strdup (_tmp0_);
	self->priv->import_dir = _tmp1_;
	self->priv->import_recursive = TRUE;
	_tmp2_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp2_);
	self->priv->sidebar_paned = _tmp2_;
	_tmp3_ = (GtkPaned*) gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
	g_object_ref_sink (_tmp3_);
	self->priv->client_paned = _tmp3_;
	_tmp4_ = (GtkFrame*) gtk_frame_new (NULL);
	g_object_ref_sink (_tmp4_);
	self->priv->bottom_frame = _tmp4_;
	self->priv->properties_scheduler = NULL;
	self->priv->notify_library_is_home_dir = TRUE;
	_tmp5_ = library_branch_new ();
	self->priv->library_branch = _tmp5_;
	_tmp6_ = tags_branch_new ();
	self->priv->tags_branch = _tmp6_;
	_tmp7_ = folders_branch_new ();
	self->priv->folders_branch = _tmp7_;
	_tmp8_ = faces_branch_new ();
	self->priv->faces_branch = _tmp8_;
	_tmp9_ = events_branch_new ();
	self->priv->events_branch = _tmp9_;
	_tmp10_ = camera_branch_new ();
	self->priv->camera_branch = _tmp10_;
	_tmp11_ = searches_branch_new ();
	self->priv->saved_search_branch = _tmp11_;
	_tmp12_ = import_roll_branch_new ();
	self->priv->import_roll_branch = _tmp12_;
	self->priv->page_switching_enabled = TRUE;
	_tmp13_ = gee_hash_map_new (TYPE_PAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, SIDEBAR_TYPE_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->page_map = _tmp13_;
	self->priv->photo_page = NULL;
	self->priv->is_search_toolbar_visible = FALSE;
	_tmp14_ = search_filter_actions_new ();
	self->priv->search_actions = _tmp14_;
	_tmp15_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp15_);
	self->priv->top_section = _tmp15_;
	_tmp16_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp16_);
	self->priv->background_progress_frame = _tmp16_;
	_tmp17_ = background_progress_bar_new ();
	g_object_ref_sink (_tmp17_);
	self->priv->background_progress_bar = _tmp17_;
	_tmp18_ = extended_properties_new ();
	g_object_ref_sink (_tmp18_);
	self->priv->extended_properties = _tmp18_;
	_tmp19_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp19_);
	self->priv->extended_properties_revealer = _tmp19_;
	_tmp20_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp20_);
	self->priv->stack = _tmp20_;
	_tmp21_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp21_);
	self->priv->layout = _tmp21_;
	_tmp22_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp22_);
	self->priv->toolbar_revealer = _tmp22_;
}

static void
library_window_finalize (GObject * obj)
{
	LibraryWindow * self;
	SidebarTree* _tmp0_;
	guint _tmp1_;
	SidebarTree* _tmp2_;
	guint _tmp3_;
	SidebarTree* _tmp4_;
	guint _tmp5_;
	SidebarTree* _tmp6_;
	guint _tmp7_;
	Page* _tmp8_;
	Page* _tmp9_;
	MetadataWriter* _tmp23_;
	MetadataWriter* _tmp24_;
	guint _tmp25_;
	LibraryMonitor* monitor = NULL;
	LibraryMonitorPool* _tmp26_;
	LibraryMonitorPool* _tmp27_;
	LibraryMonitor* _tmp28_;
	LibraryMonitor* _tmp29_;
	LibraryMonitor* _tmp30_;
	LibraryMonitorPool* _tmp32_;
	LibraryMonitorPool* _tmp33_;
	guint _tmp34_;
	LibraryMonitorPool* _tmp35_;
	LibraryMonitorPool* _tmp36_;
	guint _tmp37_;
	CameraTable* _tmp38_;
	CameraTable* _tmp39_;
	guint _tmp40_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LIBRARY_WINDOW, LibraryWindow);
	_tmp0_ = self->priv->sidebar_tree;
	g_signal_parse_name ("page-created", SIDEBAR_TYPE_TREE, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _library_window_on_page_created_sidebar_tree_page_created, self);
	_tmp2_ = self->priv->sidebar_tree;
	g_signal_parse_name ("destroying-page", SIDEBAR_TYPE_TREE, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _library_window_on_destroying_page_sidebar_tree_destroying_page, self);
	_tmp4_ = self->priv->sidebar_tree;
	g_signal_parse_name ("entry-selected", SIDEBAR_TYPE_TREE, &_tmp5_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _library_window_on_sidebar_entry_selected_sidebar_tree_entry_selected, self);
	_tmp6_ = self->priv->sidebar_tree;
	g_signal_parse_name ("selected-entry-removed", SIDEBAR_TYPE_TREE, &_tmp7_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp6_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp7_, 0, NULL, (GCallback) _library_window_on_sidebar_selected_entry_removed_sidebar_tree_selected_entry_removed, self);
	_tmp8_ = page_window_get_current_page (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE_WINDOW, PageWindow));
	_tmp9_ = _tmp8_;
	library_window_unsubscribe_from_basic_information (self, _tmp9_);
	_g_object_unref0 (_tmp9_);
	{
		GeeIterator* _media_sources_it = NULL;
		MediaCollectionRegistry* _tmp10_;
		MediaCollectionRegistry* _tmp11_;
		GeeCollection* _tmp12_;
		GeeCollection* _tmp13_;
		GeeIterator* _tmp14_;
		GeeIterator* _tmp15_;
		_tmp10_ = media_collection_registry_get_instance ();
		_tmp11_ = _tmp10_;
		_tmp12_ = media_collection_registry_get_all (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, GEE_TYPE_ITERABLE, GeeIterable));
		_tmp15_ = _tmp14_;
		_g_object_unref0 (_tmp13_);
		_media_collection_registry_unref0 (_tmp11_);
		_media_sources_it = _tmp15_;
		while (TRUE) {
			GeeIterator* _tmp16_;
			MediaSourceCollection* media_sources = NULL;
			GeeIterator* _tmp17_;
			gpointer _tmp18_;
			MediaSourceCollection* _tmp19_;
			guint _tmp20_;
			MediaSourceCollection* _tmp21_;
			guint _tmp22_;
			_tmp16_ = _media_sources_it;
			if (!gee_iterator_next (_tmp16_)) {
				break;
			}
			_tmp17_ = _media_sources_it;
			_tmp18_ = gee_iterator_get (_tmp17_);
			media_sources = (MediaSourceCollection*) _tmp18_;
			_tmp19_ = media_sources;
			g_signal_parse_name ("trashcan-contents-altered", TYPE_MEDIA_SOURCE_COLLECTION, &_tmp20_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (_tmp19_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp20_, 0, NULL, (GCallback) _library_window_on_trashcan_contents_altered_media_source_collection_trashcan_contents_altered, self);
			_tmp21_ = media_sources;
			g_signal_parse_name ("items-altered", TYPE_DATA_COLLECTION, &_tmp22_, NULL, FALSE);
			g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp22_, 0, NULL, (GCallback) _library_window_on_media_altered_data_collection_items_altered, self);
			_data_collection_unref0 (media_sources);
		}
		_g_object_unref0 (_media_sources_it);
	}
	_tmp23_ = metadata_writer_get_instance ();
	_tmp24_ = _tmp23_;
	g_signal_parse_name ("progress", TYPE_METADATA_WRITER, &_tmp25_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp24_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp25_, 0, NULL, (GCallback) _library_window_on_metadata_writer_progress_metadata_writer_progress, self);
	_g_object_unref0 (_tmp24_);
	_tmp26_ = library_monitor_pool_get_instance ();
	_tmp27_ = _tmp26_;
	_tmp28_ = library_monitor_pool_get_monitor (_tmp27_);
	_tmp29_ = _tmp28_;
	_library_monitor_pool_unref0 (_tmp27_);
	monitor = _tmp29_;
	_tmp30_ = monitor;
	if (_tmp30_ != NULL) {
		LibraryMonitor* _tmp31_;
		_tmp31_ = monitor;
		library_window_on_library_monitor_destroyed (self, _tmp31_);
	}
	_tmp32_ = library_monitor_pool_get_instance ();
	_tmp33_ = _tmp32_;
	g_signal_parse_name ("monitor-installed", TYPE_LIBRARY_MONITOR_POOL, &_tmp34_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp33_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp34_, 0, NULL, (GCallback) _library_window_on_library_monitor_installed_library_monitor_pool_monitor_installed, self);
	_library_monitor_pool_unref0 (_tmp33_);
	_tmp35_ = library_monitor_pool_get_instance ();
	_tmp36_ = _tmp35_;
	g_signal_parse_name ("monitor-destroyed", TYPE_LIBRARY_MONITOR_POOL, &_tmp37_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp36_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp37_, 0, NULL, (GCallback) _library_window_on_library_monitor_destroyed_library_monitor_pool_monitor_destroyed, self);
	_library_monitor_pool_unref0 (_tmp36_);
	_tmp38_ = camera_table_get_instance ();
	_tmp39_ = _tmp38_;
	g_signal_parse_name ("camera-added", TYPE_CAMERA_TABLE, &_tmp40_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp39_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp40_, 0, NULL, (GCallback) _library_window_on_camera_added_camera_table_camera_added, self);
	_camera_table_unref0 (_tmp39_);
	_g_object_unref0 (monitor);
	_g_free0 (self->priv->import_dir);
	_g_object_unref0 (self->priv->sidebar_paned);
	_g_object_unref0 (self->priv->client_paned);
	_g_object_unref0 (self->priv->bottom_frame);
	_one_shot_scheduler_unref0 (self->priv->properties_scheduler);
	_g_object_unref0 (self->priv->sidebar_tree);
	_g_object_unref0 (self->priv->library_branch);
	_g_object_unref0 (self->priv->tags_branch);
	_g_object_unref0 (self->priv->folders_branch);
	_g_object_unref0 (self->priv->faces_branch);
	_g_object_unref0 (self->priv->events_branch);
	_g_object_unref0 (self->priv->camera_branch);
	_g_object_unref0 (self->priv->saved_search_branch);
	_g_object_unref0 (self->priv->import_roll_branch);
	_g_object_unref0 (self->priv->page_map);
	_g_object_unref0 (self->priv->photo_page);
	_search_filter_actions_unref0 (self->priv->search_actions);
	_g_object_unref0 (self->priv->search_toolbar);
	_g_object_unref0 (self->priv->top_section);
	_g_object_unref0 (self->priv->background_progress_frame);
	_g_object_unref0 (self->priv->background_progress_bar);
	_g_object_unref0 (self->priv->basic_properties);
	_g_object_unref0 (self->priv->extended_properties);
	_g_object_unref0 (self->priv->extended_properties_revealer);
	_g_object_unref0 (self->priv->stack);
	_g_object_unref0 (self->priv->layout);
	_g_object_unref0 (self->priv->right_vbox);
	_g_object_unref0 (self->priv->toolbar_revealer);
	G_OBJECT_CLASS (library_window_parent_class)->finalize (obj);
}

static GType
library_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LibraryWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryWindow), 0, (GInstanceInitFunc) library_window_instance_init, NULL };
	GType library_window_type_id;
	library_window_type_id = g_type_register_static (TYPE_APP_WINDOW, "LibraryWindow", &g_define_type_info, 0);
	LibraryWindow_private_offset = g_type_add_instance_private (library_window_type_id, sizeof (LibraryWindowPrivate));
	return library_window_type_id;
}

GType
library_window_get_type (void)
{
	static volatile gsize library_window_type_id__once = 0;
	if (g_once_init_enter (&library_window_type_id__once)) {
		GType library_window_type_id;
		library_window_type_id = library_window_get_type_once ();
		g_once_init_leave (&library_window_type_id__once, library_window_type_id);
	}
	return library_window_type_id__once;
}

static void
_vala_library_window_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	LibraryWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_LIBRARY_WINDOW, LibraryWindow);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

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

