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

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution.
 */

#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <config.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gexiv2/gexiv2.h>
#include <gee.h>
#include <stdio.h>
#include <version.h>
#include <unistd.h>

#define RESOURCES_APP_VERSION _VERSION
#define DATABASE_TABLE_SCHEMA_VERSION 24
#define RESOURCES_HOME_URL "https://shotwell-project.org"
#define RESOURCES_APP_TITLE "Shotwell"
#define RESOURCES_PIXBUF_LOADER_PATH _PIXBUF_LOADER_PATH
#define RESOURCES_APP_GETTEXT_PACKAGE GETTEXT_PACKAGE
#define SHOTWELL_PROFILE_SYSTEM "__shotwell_default_system"
#define RESOURCES_GIT_VERSION _GIT_VERSION
#define DEBUG_LIBRARY_PREFIX "L"
#define DEBUG_VIEWER_PREFIX "V"
#define RESOURCES_APP_LIBRARY_ROLE _ ("Photo Manager")
#define RESOURCES_APP_DIRECT_ROLE _ ("Photo Viewer")
#define INTERNATIONAL_SUPPORT_SYSTEM_LOCALE ""
#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

typedef enum  {
	SHOTWELL_COMMAND_MOUNTED_CAMERA = 1
} ShotwellCommand;

#define TYPE_SHOTWELL_COMMAND (shotwell_command_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef enum  {
	DB_VERIFY_RESULT_OK,
	DB_VERIFY_RESULT_FUTURE_VERSION,
	DB_VERIFY_RESULT_UPGRADE_ERROR,
	DB_VERIFY_RESULT_NO_UPGRADE_AVAILABLE
} DbVerifyResult;

#define DB_TYPE_VERIFY_RESULT (db_verify_result_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))

#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 TYPE_PROGRESS_DIALOG (progress_dialog_get_type ())
#define PROGRESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROGRESS_DIALOG, ProgressDialog))
#define PROGRESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROGRESS_DIALOG, ProgressDialogClass))
#define IS_PROGRESS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROGRESS_DIALOG))
#define IS_PROGRESS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROGRESS_DIALOG))
#define PROGRESS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROGRESS_DIALOG, ProgressDialogClass))

typedef struct _ProgressDialog ProgressDialog;
typedef struct _ProgressDialogClass ProgressDialogClass;

#define TYPE_AGGREGATE_PROGRESS_MONITOR (aggregate_progress_monitor_get_type ())
#define AGGREGATE_PROGRESS_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AGGREGATE_PROGRESS_MONITOR, AggregateProgressMonitor))
#define AGGREGATE_PROGRESS_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AGGREGATE_PROGRESS_MONITOR, AggregateProgressMonitorClass))
#define IS_AGGREGATE_PROGRESS_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AGGREGATE_PROGRESS_MONITOR))
#define IS_AGGREGATE_PROGRESS_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AGGREGATE_PROGRESS_MONITOR))
#define AGGREGATE_PROGRESS_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AGGREGATE_PROGRESS_MONITOR, AggregateProgressMonitorClass))

typedef struct _AggregateProgressMonitor AggregateProgressMonitor;
typedef struct _AggregateProgressMonitorClass AggregateProgressMonitorClass;
typedef gboolean (*ProgressMonitor) (guint64 current, guint64 total, gboolean do_event_loop, gpointer user_data);

#define TYPE_DATABASE_TABLE (database_table_get_type ())
#define DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATABASE_TABLE, DatabaseTable))
#define DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATABASE_TABLE, DatabaseTableClass))
#define IS_DATABASE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATABASE_TABLE))
#define IS_DATABASE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATABASE_TABLE))
#define DATABASE_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATABASE_TABLE, DatabaseTableClass))

typedef struct _DatabaseTable DatabaseTable;
typedef struct _DatabaseTableClass DatabaseTableClass;

#define TYPE_PHOTO_TABLE (photo_table_get_type ())
#define PHOTO_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_TABLE, PhotoTable))
#define PHOTO_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_TABLE, PhotoTableClass))
#define IS_PHOTO_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_TABLE))
#define IS_PHOTO_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_TABLE))
#define PHOTO_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_TABLE, PhotoTableClass))

typedef struct _PhotoTable PhotoTable;
typedef struct _PhotoTableClass PhotoTableClass;

#define TYPE_EVENT_TABLE (event_table_get_type ())
#define EVENT_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EVENT_TABLE, EventTable))
#define EVENT_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EVENT_TABLE, EventTableClass))
#define IS_EVENT_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EVENT_TABLE))
#define IS_EVENT_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EVENT_TABLE))
#define EVENT_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EVENT_TABLE, EventTableClass))

typedef struct _EventTable EventTable;
typedef struct _EventTableClass EventTableClass;

#define TYPE_TAG_TABLE (tag_table_get_type ())
#define TAG_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG_TABLE, TagTable))
#define TAG_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG_TABLE, TagTableClass))
#define IS_TAG_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG_TABLE))
#define IS_TAG_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG_TABLE))
#define TAG_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG_TABLE, TagTableClass))

typedef struct _TagTable TagTable;
typedef struct _TagTableClass TagTableClass;

#define TYPE_VIDEO_TABLE (video_table_get_type ())
#define VIDEO_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO_TABLE, VideoTable))
#define VIDEO_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO_TABLE, VideoTableClass))
#define IS_VIDEO_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO_TABLE))
#define IS_VIDEO_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO_TABLE))
#define VIDEO_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO_TABLE, VideoTableClass))

typedef struct _VideoTable VideoTable;
typedef struct _VideoTableClass VideoTableClass;

#define TYPE_FACE_TABLE (face_table_get_type ())
#define FACE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FACE_TABLE, FaceTable))
#define FACE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FACE_TABLE, FaceTableClass))
#define IS_FACE_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FACE_TABLE))
#define IS_FACE_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FACE_TABLE))
#define FACE_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FACE_TABLE, FaceTableClass))

typedef struct _FaceTable FaceTable;
typedef struct _FaceTableClass FaceTableClass;

#define TYPE_FACE_LOCATION_TABLE (face_location_table_get_type ())
#define FACE_LOCATION_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FACE_LOCATION_TABLE, FaceLocationTable))
#define FACE_LOCATION_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FACE_LOCATION_TABLE, FaceLocationTableClass))
#define IS_FACE_LOCATION_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FACE_LOCATION_TABLE))
#define IS_FACE_LOCATION_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FACE_LOCATION_TABLE))
#define FACE_LOCATION_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FACE_LOCATION_TABLE, FaceLocationTableClass))

typedef struct _FaceLocationTable FaceLocationTable;
typedef struct _FaceLocationTableClass FaceLocationTableClass;

#define TYPE_UPGRADES (upgrades_get_type ())
#define UPGRADES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UPGRADES, Upgrades))
#define UPGRADES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UPGRADES, UpgradesClass))
#define IS_UPGRADES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UPGRADES))
#define IS_UPGRADES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UPGRADES))
#define UPGRADES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UPGRADES, UpgradesClass))

typedef struct _Upgrades Upgrades;
typedef struct _UpgradesClass UpgradesClass;
#define _upgrades_unref0(var) ((var == NULL) ? NULL : (var = (upgrades_unref (var), NULL)))
#define _database_table_unref0(var) ((var == NULL) ? NULL : (var = (database_table_unref (var), NULL)))
#define _aggregate_progress_monitor_unref0(var) ((var == NULL) ? NULL : (var = (aggregate_progress_monitor_unref (var), NULL)))

#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 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_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_APPLICATION (application_get_type ())
#define APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APPLICATION, Application))
#define APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APPLICATION, ApplicationClass))
#define IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APPLICATION))
#define IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APPLICATION))
#define APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APPLICATION, ApplicationClass))

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

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

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

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

#define TYPE_WELCOME_SERVICE_ENTRY (welcome_service_entry_get_type ())
#define WELCOME_SERVICE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WELCOME_SERVICE_ENTRY, WelcomeServiceEntry))
#define IS_WELCOME_SERVICE_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WELCOME_SERVICE_ENTRY))
#define WELCOME_SERVICE_ENTRY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_WELCOME_SERVICE_ENTRY, WelcomeServiceEntryIface))

typedef struct _WelcomeServiceEntry WelcomeServiceEntry;
typedef struct _WelcomeServiceEntryIface WelcomeServiceEntryIface;

#define TYPE_WELCOME_DIALOG (welcome_dialog_get_type ())
#define WELCOME_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WELCOME_DIALOG, WelcomeDialog))
#define WELCOME_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WELCOME_DIALOG, WelcomeDialogClass))
#define IS_WELCOME_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WELCOME_DIALOG))
#define IS_WELCOME_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WELCOME_DIALOG))
#define WELCOME_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WELCOME_DIALOG, WelcomeDialogClass))

typedef struct _WelcomeDialog WelcomeDialog;
typedef struct _WelcomeDialogClass WelcomeDialogClass;

#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 _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))
#define _media_collection_registry_unref0(var) ((var == NULL) ? NULL : (var = (media_collection_registry_unref (var), NULL)))

#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 (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 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);
typedef struct _ImportManifestPrivate ImportManifestPrivate;

#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_BATCH_IMPORT_RESULT (batch_import_result_get_type ())
#define BATCH_IMPORT_RESULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BATCH_IMPORT_RESULT, BatchImportResult))
#define BATCH_IMPORT_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BATCH_IMPORT_RESULT, BatchImportResultClass))
#define IS_BATCH_IMPORT_RESULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BATCH_IMPORT_RESULT))
#define IS_BATCH_IMPORT_RESULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BATCH_IMPORT_RESULT))
#define BATCH_IMPORT_RESULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BATCH_IMPORT_RESULT, BatchImportResultClass))

typedef struct _BatchImportResult BatchImportResult;
typedef struct _BatchImportResultClass BatchImportResultClass;

#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_DIRECT_WINDOW (direct_window_get_type ())
#define DIRECT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DIRECT_WINDOW, DirectWindow))
#define DIRECT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DIRECT_WINDOW, DirectWindowClass))
#define IS_DIRECT_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DIRECT_WINDOW))
#define IS_DIRECT_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DIRECT_WINDOW))
#define DIRECT_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DIRECT_WINDOW, DirectWindowClass))

typedef struct _DirectWindow DirectWindow;
typedef struct _DirectWindowClass DirectWindowClass;
#define _g_time_zone_unref0(var) ((var == NULL) ? NULL : (var = (g_time_zone_unref (var), NULL)))

#define TYPE_DISMISSABLE_TEXT_VIEW (dismissable_text_view_get_type ())
#define DISMISSABLE_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DISMISSABLE_TEXT_VIEW, DismissableTextView))
#define DISMISSABLE_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DISMISSABLE_TEXT_VIEW, DismissableTextViewClass))
#define IS_DISMISSABLE_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DISMISSABLE_TEXT_VIEW))
#define IS_DISMISSABLE_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DISMISSABLE_TEXT_VIEW))
#define DISMISSABLE_TEXT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DISMISSABLE_TEXT_VIEW, DismissableTextViewClass))

typedef struct _DismissableTextView DismissableTextView;
typedef struct _DismissableTextViewClass DismissableTextViewClass;
typedef struct _Block14Data Block14Data;

#define SHOTWELL_TYPE_PROFILE_BROWSER (shotwell_profile_browser_get_type ())
#define SHOTWELL_PROFILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOTWELL_TYPE_PROFILE_BROWSER, ShotwellProfileBrowser))
#define SHOTWELL_PROFILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOTWELL_TYPE_PROFILE_BROWSER, ShotwellProfileBrowserClass))
#define SHOTWELL_IS_PROFILE_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOTWELL_TYPE_PROFILE_BROWSER))
#define SHOTWELL_IS_PROFILE_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOTWELL_TYPE_PROFILE_BROWSER))
#define SHOTWELL_PROFILE_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOTWELL_TYPE_PROFILE_BROWSER, ShotwellProfileBrowserClass))

typedef struct _ShotwellProfileBrowser ShotwellProfileBrowser;
typedef struct _ShotwellProfileBrowserClass ShotwellProfileBrowserClass;

#define SHOTWELL_TYPE_PROFILE (shotwell_profile_get_type ())
#define SHOTWELL_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOTWELL_TYPE_PROFILE, ShotwellProfile))
#define SHOTWELL_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOTWELL_TYPE_PROFILE, ShotwellProfileClass))
#define SHOTWELL_IS_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOTWELL_TYPE_PROFILE))
#define SHOTWELL_IS_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOTWELL_TYPE_PROFILE))
#define SHOTWELL_PROFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOTWELL_TYPE_PROFILE, ShotwellProfileClass))

typedef struct _ShotwellProfile ShotwellProfile;
typedef struct _ShotwellProfileClass ShotwellProfileClass;

#define SHOTWELL_TYPE_PROFILE_MANAGER (shotwell_profile_manager_get_type ())
#define SHOTWELL_PROFILE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHOTWELL_TYPE_PROFILE_MANAGER, ShotwellProfileManager))
#define SHOTWELL_PROFILE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHOTWELL_TYPE_PROFILE_MANAGER, ShotwellProfileManagerClass))
#define SHOTWELL_IS_PROFILE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHOTWELL_TYPE_PROFILE_MANAGER))
#define SHOTWELL_IS_PROFILE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHOTWELL_TYPE_PROFILE_MANAGER))
#define SHOTWELL_PROFILE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHOTWELL_TYPE_PROFILE_MANAGER, ShotwellProfileManagerClass))

typedef struct _ShotwellProfileManager ShotwellProfileManager;
typedef struct _ShotwellProfileManagerClass ShotwellProfileManagerClass;
typedef enum  {
	APP_DIRS_RUNTIME_NATIVE,
	APP_DIRS_RUNTIME_FLATPAK,
	APP_DIRS_RUNTIME_SNAP,
	APP_DIRS_RUNTIME_UNKNOWN
} AppDirsRuntime;

#define APP_DIRS_TYPE_RUNTIME (app_dirs_runtime_get_type ())
#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))

struct _WelcomeServiceEntryIface {
	GTypeInterface parent_iface;
	gchar* (*get_service_name) (WelcomeServiceEntry* self);
	void (*execute) (WelcomeServiceEntry* self);
};

struct _ImportManifest {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ImportManifestPrivate * priv;
	GeeList* imported;
	GeeList* success;
	GeeList* camera_failed;
	GeeList* failed;
	GeeList* write_failed;
	GeeList* skipped_photos;
	GeeList* skipped_files;
	GeeList* aborted;
	GeeList* already_imported;
	GeeList* corrupt_files;
	GeeList* all;
	GTimer* timer;
};

struct _ImportManifestClass {
	GTypeClass parent_class;
	void (*finalize) (ImportManifest *self);
};

struct _Block14Data {
	int _ref_count_;
	GtkDialog* window;
};

VALA_EXTERN GTimer* startup_timer;
GTimer* startup_timer = NULL;
VALA_EXTERN gboolean was_already_running;
gboolean was_already_running = FALSE;
VALA_EXTERN gboolean commandline_options_no_startup_progress;
VALA_EXTERN LibraryPhotoSourceCollection* library_photo_global;
VALA_EXTERN VideoSourceCollection* video_global;
VALA_EXTERN gboolean do_system_pictures_import;
VALA_EXTERN gboolean do_external_import;
gboolean do_system_pictures_import = FALSE;
gboolean do_external_import = FALSE;
gboolean commandline_options_no_startup_progress = FALSE;
VALA_EXTERN gchar* commandline_options_data_dir;
gchar* commandline_options_data_dir = NULL;
VALA_EXTERN gboolean commandline_options_show_version;
gboolean commandline_options_show_version = FALSE;
VALA_EXTERN gboolean commandline_options_no_runtime_monitoring;
gboolean commandline_options_no_runtime_monitoring = FALSE;
VALA_EXTERN gboolean commandline_options_fullscreen;
gboolean commandline_options_fullscreen = FALSE;
VALA_EXTERN gboolean commandline_options_show_metadata;
gboolean commandline_options_show_metadata = FALSE;
VALA_EXTERN gchar* commandline_options_profile;
gchar* commandline_options_profile = NULL;
VALA_EXTERN gboolean commandline_options_create_profile;
gboolean commandline_options_create_profile = FALSE;
VALA_EXTERN gboolean commandline_options_list_profiles;
gboolean commandline_options_list_profiles = FALSE;
VALA_EXTERN gboolean commandline_options_browse_profiles;
gboolean commandline_options_browse_profiles = FALSE;
VALA_EXTERN GTimeZone* application_timezone;

VALA_EXTERN GType shotwell_command_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void library_exec (gchar** mounts,
                   gint mounts_length1);
VALA_EXTERN gboolean application_get_is_remote (void);
VALA_EXTERN void application_present_primary_instance (void);
VALA_EXTERN void application_send_to_primary_instance (gchar** argv,
                                           gint argv_length1);
VALA_EXTERN void db_preconfigure (GFile* db_file);
VALA_EXTERN GFile* app_dirs_get_data_subdir (const gchar* name,
                                 const gchar* subname);
VALA_EXTERN void library_app_init (GError** error);
VALA_EXTERN void app_window_panic (const gchar* msg);
VALA_EXTERN GType db_verify_result_get_type (void) G_GNUC_CONST ;
VALA_EXTERN DbVerifyResult db_verify_database (gchar** app_version,
                                   gint* schema_version);
VALA_EXTERN GFile* app_dirs_get_data_dir (void);
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_gtk_theme_variant (ConfigurationFacade* self);
VALA_EXTERN void database_table_terminate (void);
VALA_EXTERN void upgrades_init (void);
VALA_EXTERN GType progress_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProgressDialog, g_object_unref)
VALA_EXTERN gpointer aggregate_progress_monitor_ref (gpointer instance);
VALA_EXTERN void aggregate_progress_monitor_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_aggregate_progress_monitor (const gchar* name,
                                                   const gchar* nick,
                                                   const gchar* blurb,
                                                   GType object_type,
                                                   GParamFlags flags);
VALA_EXTERN void value_set_aggregate_progress_monitor (GValue* value,
                                           gpointer v_object);
VALA_EXTERN void value_take_aggregate_progress_monitor (GValue* value,
                                            gpointer v_object);
VALA_EXTERN gpointer value_get_aggregate_progress_monitor (const GValue* value);
VALA_EXTERN GType aggregate_progress_monitor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AggregateProgressMonitor, aggregate_progress_monitor_unref)
VALA_EXTERN gpointer database_table_ref (gpointer instance);
VALA_EXTERN void database_table_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_database_table (const gchar* name,
                                       const gchar* nick,
                                       const gchar* blurb,
                                       GType object_type,
                                       GParamFlags flags);
VALA_EXTERN void value_set_database_table (GValue* value,
                               gpointer v_object);
VALA_EXTERN void value_take_database_table (GValue* value,
                                gpointer v_object);
VALA_EXTERN gpointer value_get_database_table (const GValue* value);
VALA_EXTERN GType database_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DatabaseTable, database_table_unref)
VALA_EXTERN GType photo_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotoTable, database_table_unref)
VALA_EXTERN PhotoTable* photo_table_get_instance (void);
VALA_EXTERN gint database_table_get_row_count (DatabaseTable* self);
VALA_EXTERN GType event_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EventTable, database_table_unref)
VALA_EXTERN EventTable* event_table_get_instance (void);
VALA_EXTERN GType tag_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagTable, database_table_unref)
VALA_EXTERN TagTable* tag_table_get_instance (void);
VALA_EXTERN GType video_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VideoTable, database_table_unref)
VALA_EXTERN VideoTable* video_table_get_instance (void);
VALA_EXTERN GType face_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FaceTable, database_table_unref)
VALA_EXTERN FaceTable* face_table_get_instance (void);
VALA_EXTERN GType face_location_table_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FaceLocationTable, database_table_unref)
VALA_EXTERN FaceLocationTable* face_location_table_get_instance (void);
VALA_EXTERN gpointer upgrades_ref (gpointer instance);
VALA_EXTERN void upgrades_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_upgrades (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags);
VALA_EXTERN void value_set_upgrades (GValue* value,
                         gpointer v_object);
VALA_EXTERN void value_take_upgrades (GValue* value,
                          gpointer v_object);
VALA_EXTERN gpointer value_get_upgrades (const GValue* value);
VALA_EXTERN GType upgrades_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Upgrades, upgrades_unref)
VALA_EXTERN Upgrades* upgrades_get_instance (void);
VALA_EXTERN guint64 upgrades_get_step_count (Upgrades* self);
VALA_EXTERN ProgressDialog* progress_dialog_new (GtkWindow* owner,
                                     const gchar* text,
                                     GCancellable* cancellable);
VALA_EXTERN ProgressDialog* progress_dialog_construct (GType object_type,
                                           GtkWindow* owner,
                                           const gchar* text,
                                           GCancellable* cancellable);
VALA_EXTERN void progress_dialog_update_display_every (ProgressDialog* self,
                                           gint update_every);
VALA_EXTERN void progress_dialog_set_minimum_on_screen_time_msec (ProgressDialog* self,
                                                      gint minimum_on_screen_time_msec);
VALA_EXTERN gboolean progress_dialog_monitor (ProgressDialog* self,
                                  guint64 count,
                                  guint64 total,
                                  gboolean do_event_loop);
static gboolean _progress_dialog_monitor_progress_monitor (guint64 current,
                                                    guint64 total,
                                                    gboolean do_event_loop,
                                                    gpointer self);
VALA_EXTERN AggregateProgressMonitor* aggregate_progress_monitor_new (guint64 grand_total,
                                                          ProgressMonitor wrapped_monitor,
                                                          gpointer wrapped_monitor_target);
VALA_EXTERN AggregateProgressMonitor* aggregate_progress_monitor_construct (GType object_type,
                                                                guint64 grand_total,
                                                                ProgressMonitor wrapped_monitor,
                                                                gpointer wrapped_monitor_target);
VALA_EXTERN gboolean aggregate_progress_monitor_monitor (AggregateProgressMonitor* self,
                                             guint64 count,
                                             guint64 total);
static gboolean _aggregate_progress_monitor_monitor_progress_monitor (guint64 current,
                                                               guint64 total,
                                                               gboolean do_event_loop,
                                                               gpointer self);
VALA_EXTERN void thumbnail_cache_init (void);
VALA_EXTERN void tombstone_init (void);
VALA_EXTERN void library_files_select_copy_function (void);
VALA_EXTERN void aggregate_progress_monitor_next_step (AggregateProgressMonitor* self,
                                           const gchar* name);
VALA_EXTERN void library_photo_init (ProgressMonitor monitor,
                         gpointer monitor_target);
VALA_EXTERN void video_init (ProgressMonitor monitor,
                 gpointer monitor_target);
VALA_EXTERN void upgrades_execute (Upgrades* self,
                       ProgressMonitor monitor,
                       gpointer monitor_target);
VALA_EXTERN void library_monitor_pool_init (void);
VALA_EXTERN void media_collection_registry_init (void);
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 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 void media_collection_registry_register_collection (MediaCollectionRegistry* self,
                                                    MediaSourceCollection* collection);
VALA_EXTERN GType library_photo_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryPhotoSourceCollection, data_collection_unref)
VALA_EXTERN GType video_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VideoSourceCollection, data_collection_unref)
VALA_EXTERN void event_init (ProgressMonitor monitor,
                 gpointer monitor_target);
VALA_EXTERN void tag_init (ProgressMonitor monitor,
               gpointer monitor_target);
VALA_EXTERN void face_location_init (ProgressMonitor monitor,
                         gpointer monitor_target);
VALA_EXTERN void face_init (ProgressMonitor monitor,
                gpointer monitor_target);
VALA_EXTERN void metadata_writer_init (void);
VALA_EXTERN void desktop_integration_init (void);
VALA_EXTERN gpointer application_ref (gpointer instance);
VALA_EXTERN void application_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_application (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_application (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_application (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_application (const GValue* value);
VALA_EXTERN GType application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Application, application_unref)
VALA_EXTERN Application* application_get_instance (void);
VALA_EXTERN GType page_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageWindow, 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 library_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryWindow, g_object_unref)
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 void library_window_mounted_camera_shell_notification (LibraryWindow* self,
                                                       const gchar* uri,
                                                       gboolean at_startup);
VALA_EXTERN GType welcome_service_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WelcomeServiceEntry, g_object_unref)
VALA_EXTERN gboolean configuration_facade_get_show_welcome_dialog (ConfigurationFacade* self);
VALA_EXTERN gint data_collection_get_count (DataCollection* self);
VALA_EXTERN GType welcome_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WelcomeDialog, g_object_unref)
VALA_EXTERN WelcomeDialog* welcome_dialog_new (GtkWindow* owner);
VALA_EXTERN WelcomeDialog* welcome_dialog_construct (GType object_type,
                                         GtkWindow* owner);
VALA_EXTERN void configuration_facade_set_show_welcome_dialog (ConfigurationFacade* self,
                                                   gboolean show);
VALA_EXTERN gboolean welcome_dialog_execute (WelcomeDialog* self,
                                 WelcomeServiceEntry*** selected_import_entries,
                                 gint* selected_import_entries_length1,
                                 gboolean* do_system_pictures_import);
VALA_EXTERN void welcome_service_entry_execute (WelcomeServiceEntry* self);
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)
VALA_EXTERN void run_system_pictures_import (ImportManifest* external_exclusion_manifest);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
VALA_EXTERN void application_start (Application* self,
                        gchar** argv,
                        gint argv_length1);
VALA_EXTERN void desktop_integration_terminate (void);
VALA_EXTERN void metadata_writer_terminate (void);
VALA_EXTERN void tag_terminate (void);
VALA_EXTERN void event_terminate (void);
VALA_EXTERN void library_photo_terminate (void);
VALA_EXTERN void media_collection_registry_terminate (void);
VALA_EXTERN void library_monitor_pool_terminate (void);
VALA_EXTERN void tombstone_terminate (void);
VALA_EXTERN void thumbnail_cache_terminate (void);
VALA_EXTERN void video_terminate (void);
VALA_EXTERN void face_terminate (void);
VALA_EXTERN void face_location_terminate (void);
VALA_EXTERN void library_app_terminate (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 GFile* app_dirs_get_import_dir (void);
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 AppWindow* app_window_get_instance (void);
VALA_EXTERN GType batch_import_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BatchImport, g_object_unref)
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)
VALA_EXTERN void report_system_pictures_import (ImportManifest* manifest,
                                    BatchImportRoll* import_roll);
static void _report_system_pictures_import_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_enqueue_batch_import (LibraryWindow* self,
                                          BatchImport* batch_import,
                                          gboolean allow_user_cancel);
VALA_EXTERN void library_window_switch_to_import_queue_page (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)
VALA_EXTERN gpointer batch_import_result_ref (gpointer instance);
VALA_EXTERN void batch_import_result_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_batch_import_result (const gchar* name,
                                            const gchar* nick,
                                            const gchar* blurb,
                                            GType object_type,
                                            GParamFlags flags);
VALA_EXTERN void value_set_batch_import_result (GValue* value,
                                    gpointer v_object);
VALA_EXTERN void value_take_batch_import_result (GValue* value,
                                     gpointer v_object);
VALA_EXTERN gpointer value_get_batch_import_result (const GValue* value);
VALA_EXTERN GType batch_import_result_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BatchImportResult, batch_import_result_unref)
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 void dump_tags (GExiv2Metadata* metadata,
                gchar** tags,
                gint tags_length1,
                GError** error);
VALA_EXTERN void dump_metadata (const gchar* filename);
VALA_EXTERN void editing_exec (const gchar* filename,
                   gboolean fullscreen);
VALA_EXTERN void direct_preconfigure (GFile* initial_file);
VALA_EXTERN void direct_app_init (GError** error);
VALA_EXTERN GType direct_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DirectWindow, g_object_unref)
VALA_EXTERN DirectWindow* direct_window_new (GFile* file);
VALA_EXTERN DirectWindow* direct_window_construct (GType object_type,
                                       GFile* file);
VALA_EXTERN GAction* app_window_get_common_action (AppWindow* self,
                                       const gchar* name);
VALA_EXTERN void direct_app_terminate (void);
static void _vala_main (gchar** args,
                 gint args_length1);
VALA_EXTERN void app_dirs_init (const gchar* arg0);
VALA_EXTERN GFile* app_dirs_get_install_dir (void);
VALA_EXTERN GFile* app_dirs_get_lib_dir (void);
VALA_EXTERN void app_dirs_terminate (void);
VALA_EXTERN GType dismissable_text_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DismissableTextView, g_object_unref)
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
VALA_EXTERN GType shotwell_profile_browser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShotwellProfileBrowser, g_object_unref)
VALA_EXTERN ShotwellProfileBrowser* shotwell_profile_browser_new (void);
VALA_EXTERN ShotwellProfileBrowser* shotwell_profile_browser_construct (GType object_type);
VALA_EXTERN GType shotwell_profile_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShotwellProfile, g_object_unref)
static void ___lambda42_ (Block14Data* _data14_,
                   ShotwellProfile* profile);
VALA_EXTERN const gchar* shotwell_profile_get_id (ShotwellProfile* self);
VALA_EXTERN const gchar* shotwell_profile_get_name (ShotwellProfile* self);
VALA_EXTERN const gchar* shotwell_profile_get_data_dir (ShotwellProfile* self);
static void ____lambda42__shotwell_profile_browser_profile_activated (ShotwellProfileBrowser* _sender,
                                                               ShotwellProfile* profile,
                                                               gpointer self);
VALA_EXTERN GType shotwell_profile_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ShotwellProfileManager, g_object_unref)
VALA_EXTERN ShotwellProfileManager* shotwell_profile_manager_get_instance (void);
VALA_EXTERN gboolean shotwell_profile_manager_has_profile (ShotwellProfileManager* self,
                                               const gchar* profile,
                                               gchar** group_name);
VALA_EXTERN void shotwell_profile_manager_set_profile (ShotwellProfileManager* self,
                                           const gchar* profile);
VALA_EXTERN gchar* shotwell_profile_manager_derive_data_dir (ShotwellProfileManager* self,
                                                 const gchar* data_dir);
VALA_EXTERN void shotwell_profile_manager_print_profiles (ShotwellProfileManager* self);
VALA_EXTERN gboolean library_window_is_mount_uri_supported (const gchar* uri);
static void _vala_array_add73 (gchar** * array,
                        gint* length,
                        gint* size,
                        gchar* value);
VALA_EXTERN gboolean is_string_empty (const gchar* s);
VALA_EXTERN void debug_init (const gchar* app_version_prefix);
VALA_EXTERN GType app_dirs_runtime_get_type (void) G_GNUC_CONST ;
VALA_EXTERN AppDirsRuntime app_dirs_get_runtime (void);
VALA_EXTERN void application_init (gboolean is_direct);
VALA_EXTERN void app_window_error_message (const gchar* message,
                               GtkWindow* parent);
VALA_EXTERN void app_dirs_set_data_dir (const gchar* user_data_dir);
VALA_EXTERN void app_dirs_try_migrate_data (void);
VALA_EXTERN void app_dirs_verify_data_dir (void);
VALA_EXTERN void app_dirs_verify_cache_dir (void);
VALA_EXTERN void international_support_init (const gchar* package_name,
                                 gchar** args,
                                 gint args_length1,
                                 const gchar* locale);
VALA_EXTERN void resources_init (void);
VALA_EXTERN void resources_terminate (void);
VALA_EXTERN void application_terminate (void);
VALA_EXTERN void debug_terminate (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

const GOptionEntry COMMANDLINE_OPTIONS_entries[11] = {{"datadir", 'd', (gint) 0, G_OPTION_ARG_FILENAME, &commandline_options_data_dir, N_ ("Path to Shotwell’s private data"), N_ ("DIRECTORY")}, {"no-runtime-monitoring", (gchar) 0, (gint) 0, G_OPTION_ARG_NONE, &commandline_options_no_runtime_monitoring, N_ ("Do not monitor library directory at runtime for changes"), NULL}, {"no-startup-progress", (gchar) 0, (gint) 0, G_OPTION_ARG_NONE, &commandline_options_no_startup_progress, N_ ("Don’t display startup progress meter"), NULL}, {"version", 'V', (gint) 0, G_OPTION_ARG_NONE, &commandline_options_show_version, N_ ("Show the application’s version")}, {"fullscreen", 'f', (gint) 0, G_OPTION_ARG_NONE, &commandline_options_fullscreen, N_ ("Start the application in fullscreen mode"), NULL}, {"show-metadata", 'p', (gint) 0, G_OPTION_ARG_NONE, &commandline_options_show_metadata, N_ ("Print the metadata of the image file"), NULL}, {"profile", 'i', (gint) 0, G_OPTION_ARG_STRING, &commandline_options_profile, N_ ("Name for a custom profile"), N_ ("PROFILE")}, {"profile-browser", 'b', (gint) 0, G_OPTION_ARG_NONE, &commandline_options_browse_profiles, N_ ("Start with a browser of available profiles"), NULL}, {"create", 'c', (gint) 0, G_OPTION_ARG_NONE, &commandline_options_create_profile, N_ ("If PROFILE given with --profile does not exist, create it"), NULL}, {"list-profiles", 'l', (gint) 0, G_OPTION_ARG_NONE, &commandline_options_list_profiles, N_ ("Show available profiles"), NULL}, {NULL, (gchar) 0, (gint) 0, 0, NULL, NULL, NULL}};

static GType
shotwell_command_get_type_once (void)
{
	static const GEnumValue values[] = {{SHOTWELL_COMMAND_MOUNTED_CAMERA, "SHOTWELL_COMMAND_MOUNTED_CAMERA", "mounted-camera"}, {0, NULL, NULL}};
	GType shotwell_command_type_id;
	shotwell_command_type_id = g_enum_register_static ("ShotwellCommand", values);
	return shotwell_command_type_id;
}

GType
shotwell_command_get_type (void)
{
	static volatile gsize shotwell_command_type_id__once = 0;
	if (g_once_init_enter (&shotwell_command_type_id__once)) {
		GType shotwell_command_type_id;
		shotwell_command_type_id = shotwell_command_get_type_once ();
		g_once_init_leave (&shotwell_command_type_id__once, shotwell_command_type_id);
	}
	return shotwell_command_type_id__once;
}

static gboolean
_progress_dialog_monitor_progress_monitor (guint64 current,
                                           guint64 total,
                                           gboolean do_event_loop,
                                           gpointer self)
{
	gboolean result;
	result = progress_dialog_monitor ((ProgressDialog*) self, current, total, do_event_loop);
	return result;
}

static gboolean
_aggregate_progress_monitor_monitor_progress_monitor (guint64 current,
                                                      guint64 total,
                                                      gboolean do_event_loop,
                                                      gpointer self)
{
	gboolean result;
	result = aggregate_progress_monitor_monitor ((AggregateProgressMonitor*) self, current, total);
	return result;
}

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

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

void
library_exec (gchar** mounts,
              gint mounts_length1)
{
	GFile* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	gchar* errormsg = NULL;
	gchar* app_version = NULL;
	gint schema_version = 0;
	DbVerifyResult _result_ = 0;
	gchar* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	DbVerifyResult _tmp8_;
	gboolean use_dark = FALSE;
	ConfigFacade* _tmp21_;
	ConfigFacade* _tmp22_;
	gboolean _tmp23_;
	GtkSettings* _tmp24_;
	const gchar* _tmp25_;
	ProgressDialog* progress_dialog = NULL;
	AggregateProgressMonitor* aggregate_monitor = NULL;
	ProgressMonitor monitor = NULL;
	gpointer monitor_target;
	GDestroyNotify monitor_target_destroy_notify;
	AggregateProgressMonitor* _tmp57_;
	ProgressMonitor _tmp59_;
	gpointer _tmp59__target;
	AggregateProgressMonitor* _tmp60_;
	ProgressMonitor _tmp62_;
	gpointer _tmp62__target;
	AggregateProgressMonitor* _tmp63_;
	Upgrades* _tmp65_;
	Upgrades* _tmp66_;
	MediaCollectionRegistry* registry = NULL;
	MediaCollectionRegistry* _tmp67_;
	MediaCollectionRegistry* _tmp68_;
	LibraryPhotoSourceCollection* _tmp69_;
	MediaCollectionRegistry* _tmp70_;
	VideoSourceCollection* _tmp71_;
	AggregateProgressMonitor* _tmp72_;
	ProgressMonitor _tmp74_;
	gpointer _tmp74__target;
	AggregateProgressMonitor* _tmp75_;
	ProgressMonitor _tmp77_;
	gpointer _tmp77__target;
	AggregateProgressMonitor* _tmp78_;
	ProgressMonitor _tmp80_;
	gpointer _tmp80__target;
	AggregateProgressMonitor* _tmp81_;
	ProgressMonitor _tmp83_;
	gpointer _tmp83__target;
	Application* _tmp84_;
	Application* _tmp85_;
	AggregateProgressMonitor* _tmp86_;
	LibraryWindow* library_window = NULL;
	ProgressMonitor _tmp88_;
	gpointer _tmp88__target;
	LibraryWindow* _tmp89_;
	AggregateProgressMonitor* _tmp90_;
	ProgressDialog* _tmp92_;
	LibraryWindow* _tmp97_;
	WelcomeServiceEntry** selected_import_entries = NULL;
	WelcomeServiceEntry** _tmp98_;
	gint selected_import_entries_length1;
	gint _selected_import_entries_size_;
	gboolean _tmp99_ = FALSE;
	ConfigFacade* _tmp100_;
	ConfigFacade* _tmp101_;
	gboolean _tmp102_;
	WelcomeServiceEntry** _tmp115_;
	gint _tmp115__length1;
	gboolean heif = FALSE;
	gboolean jxl = FALSE;
	gboolean png = FALSE;
	gboolean tiff = FALSE;
	gboolean avif = FALSE;
	gboolean bmp = FALSE;
	gboolean gif = FALSE;
	GSList* formats = NULL;
	GSList* _tmp119_;
	GSList* _tmp120_;
	gboolean can_read_bmff = FALSE;
	GBytes* b = NULL;
	const gchar* _tmp165_ = NULL;
	const gchar* _tmp166_ = NULL;
	const gchar* _tmp167_ = NULL;
	const gchar* _tmp168_ = NULL;
	const gchar* _tmp169_ = NULL;
	const gchar* _tmp170_ = NULL;
	const gchar* _tmp171_ = NULL;
	const gchar* _tmp172_ = NULL;
	const gchar* _tmp173_ = NULL;
	const gchar* _tmp174_ = NULL;
	GTimer* _tmp175_;
	Application* _tmp176_;
	Application* _tmp177_;
	GError* _inner_error0_ = NULL;
	was_already_running = application_get_is_remote ();
	if (was_already_running) {
		application_present_primary_instance ();
		application_send_to_primary_instance (mounts, (gint) mounts_length1);
		return;
	}
	_tmp0_ = app_dirs_get_data_subdir ("data", NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_file_get_child (_tmp1_, "photo.db");
	_tmp3_ = _tmp2_;
	db_preconfigure (_tmp3_);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	{
		library_app_init (&_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = err;
		_tmp5_ = _tmp4_->message;
		app_window_panic (_tmp5_);
		_g_error_free0 (err);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	g_message ("main.vala:43: Verifying database…");
	errormsg = NULL;
	_tmp8_ = db_verify_database (&_tmp6_, &_tmp7_);
	_g_free0 (app_version);
	app_version = _tmp6_;
	schema_version = _tmp7_;
	_result_ = _tmp8_;
	switch (_result_) {
		case DB_VERIFY_RESULT_OK:
		{
			break;
		}
		case DB_VERIFY_RESULT_FUTURE_VERSION:
		{
			const gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp9_ = app_version;
			_tmp10_ = g_strdup_printf (_ ("Your photo library is not compatible with this version of Shotwell. It" \
" appears it was created by Shotwell %s (schema %d). This version is %s" \
" (schema %d). Please use the latest version of Shotwell."), _tmp9_, schema_version, RESOURCES_APP_VERSION, DATABASE_TABLE_SCHEMA_VERSION);
			_g_free0 (errormsg);
			errormsg = _tmp10_;
			break;
		}
		case DB_VERIFY_RESULT_UPGRADE_ERROR:
		{
			const gchar* _tmp11_;
			gchar* _tmp12_;
			_tmp11_ = app_version;
			_tmp12_ = g_strdup_printf (_ ("Shotwell was unable to upgrade your photo library from version %s (sch" \
"ema %d) to %s (schema %d). For more information please check the Shotw" \
"ell Wiki at %s"), _tmp11_, schema_version, RESOURCES_APP_VERSION, DATABASE_TABLE_SCHEMA_VERSION, RESOURCES_HOME_URL);
			_g_free0 (errormsg);
			errormsg = _tmp12_;
			break;
		}
		case DB_VERIFY_RESULT_NO_UPGRADE_AVAILABLE:
		{
			const gchar* _tmp13_;
			GFile* _tmp14_;
			GFile* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			gchar* _tmp18_;
			_tmp13_ = app_version;
			_tmp14_ = app_dirs_get_data_dir ();
			_tmp15_ = _tmp14_;
			_tmp16_ = g_file_get_path (_tmp15_);
			_tmp17_ = _tmp16_;
			_tmp18_ = g_strdup_printf (_ ("Your photo library is not compatible with this version of Shotwell. It" \
" appears it was created by Shotwell %s (schema %d). This version is %s" \
" (schema %d). Please clear your library by deleting %s and re-import y" \
"our photos."), _tmp13_, schema_version, RESOURCES_APP_VERSION, DATABASE_TABLE_SCHEMA_VERSION, _tmp17_);
			_g_free0 (errormsg);
			errormsg = _tmp18_;
			_g_free0 (_tmp17_);
			_g_object_unref0 (_tmp15_);
			break;
		}
		default:
		{
			GEnumValue* _tmp19_;
			gchar* _tmp20_;
			_tmp19_ = g_enum_get_value (g_type_class_ref (DB_TYPE_VERIFY_RESULT), _result_);
			_tmp20_ = g_strdup_printf (_ ("Unknown error attempting to verify Shotwell’s database: %s"), (_tmp19_ != NULL) ? _tmp19_->value_name : NULL);
			_g_free0 (errormsg);
			errormsg = _tmp20_;
			break;
		}
	}
	_tmp21_ = config_facade_get_instance ();
	_tmp22_ = _tmp21_;
	_tmp23_ = configuration_facade_get_gtk_theme_variant (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp22_);
	use_dark = _tmp23_;
	_tmp24_ = gtk_settings_get_default ();
	g_object_set (_tmp24_, "gtk-application-prefer-dark-theme", use_dark, NULL);
	_tmp25_ = errormsg;
	if (_tmp25_ != NULL) {
		GtkMessageDialog* dialog = NULL;
		const gchar* _tmp26_;
		GtkMessageDialog* _tmp27_;
		GtkMessageDialog* _tmp28_;
		GtkMessageDialog* _tmp29_;
		GtkMessageDialog* _tmp30_;
		_tmp26_ = errormsg;
		_tmp27_ = (GtkMessageDialog*) gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", _tmp26_);
		g_object_ref_sink (_tmp27_);
		dialog = _tmp27_;
		_tmp28_ = dialog;
		gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, gtk_window_get_type (), GtkWindow), RESOURCES_APP_TITLE);
		_tmp29_ = dialog;
		gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, gtk_dialog_get_type (), GtkDialog));
		_tmp30_ = dialog;
		gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_widget_get_type (), GtkWidget));
		database_table_terminate ();
		_g_object_unref0 (dialog);
		_g_free0 (app_version);
		_g_free0 (errormsg);
		return;
	}
	upgrades_init ();
	progress_dialog = NULL;
	aggregate_monitor = NULL;
	monitor = NULL;
	monitor_target = NULL;
	monitor_target_destroy_notify = NULL;
	if (!commandline_options_no_startup_progress) {
		guint64 grand_total = 0ULL;
		PhotoTable* _tmp31_;
		PhotoTable* _tmp32_;
		EventTable* _tmp33_;
		EventTable* _tmp34_;
		TagTable* _tmp35_;
		TagTable* _tmp36_;
		VideoTable* _tmp37_;
		VideoTable* _tmp38_;
		FaceTable* _tmp39_;
		FaceTable* _tmp40_;
		FaceLocationTable* _tmp41_;
		FaceLocationTable* _tmp42_;
		Upgrades* _tmp43_;
		Upgrades* _tmp44_;
		guint64 _tmp45_;
		_tmp31_ = photo_table_get_instance ();
		_tmp32_ = _tmp31_;
		_tmp33_ = event_table_get_instance ();
		_tmp34_ = _tmp33_;
		_tmp35_ = tag_table_get_instance ();
		_tmp36_ = _tmp35_;
		_tmp37_ = video_table_get_instance ();
		_tmp38_ = _tmp37_;
		_tmp39_ = face_table_get_instance ();
		_tmp40_ = _tmp39_;
		_tmp41_ = face_location_table_get_instance ();
		_tmp42_ = _tmp41_;
		_tmp43_ = upgrades_get_instance ();
		_tmp44_ = _tmp43_;
		_tmp45_ = (((((database_table_get_row_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, TYPE_DATABASE_TABLE, DatabaseTable)) + database_table_get_row_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, TYPE_DATABASE_TABLE, DatabaseTable))) + database_table_get_row_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, TYPE_DATABASE_TABLE, DatabaseTable))) + database_table_get_row_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, TYPE_DATABASE_TABLE, DatabaseTable))) + database_table_get_row_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, TYPE_DATABASE_TABLE, DatabaseTable))) + database_table_get_row_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, TYPE_DATABASE_TABLE, DatabaseTable))) + upgrades_get_step_count (_tmp44_);
		_upgrades_unref0 (_tmp44_);
		_database_table_unref0 (_tmp42_);
		_database_table_unref0 (_tmp40_);
		_database_table_unref0 (_tmp38_);
		_database_table_unref0 (_tmp36_);
		_database_table_unref0 (_tmp34_);
		_database_table_unref0 (_tmp32_);
		grand_total = _tmp45_;
		if (grand_total > ((guint64) 5000)) {
			ProgressDialog* _tmp46_;
			ProgressDialog* _tmp47_;
			ProgressDialog* _tmp48_;
			ProgressDialog* _tmp54_;
			AggregateProgressMonitor* _tmp55_;
			AggregateProgressMonitor* _tmp56_;
			_tmp46_ = progress_dialog_new (NULL, _ ("Loading Shotwell"), NULL);
			g_object_ref_sink (_tmp46_);
			_g_object_unref0 (progress_dialog);
			progress_dialog = _tmp46_;
			_tmp47_ = progress_dialog;
			progress_dialog_update_display_every (_tmp47_, 100);
			_tmp48_ = progress_dialog;
			progress_dialog_set_minimum_on_screen_time_msec (_tmp48_, 250);
			{
				GdkPixbuf* _tmp49_ = NULL;
				GdkPixbuf* _tmp50_;
				ProgressDialog* _tmp51_;
				_tmp50_ = gdk_pixbuf_new_from_resource ("/org/gnome/Shotwell/icons/hicolor/scalable/org.gnome.Shotwell.svg", &_inner_error0_);
				_tmp49_ = _tmp50_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch1_g_error;
				}
				_tmp51_ = progress_dialog;
				gtk_window_set_icon (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, gtk_window_get_type (), GtkWindow), _tmp49_);
				_g_object_unref0 (_tmp49_);
			}
			goto __finally1;
			__catch1_g_error:
			{
				GError* err = NULL;
				GError* _tmp52_;
				const gchar* _tmp53_;
				err = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp52_ = err;
				_tmp53_ = _tmp52_->message;
				g_debug ("main.vala:116: Warning - could not load application icon for loading w" \
"indow: %s", _tmp53_);
				_g_error_free0 (err);
			}
			__finally1:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				(monitor_target_destroy_notify == NULL) ? NULL : (monitor_target_destroy_notify (monitor_target), NULL);
				monitor = NULL;
				monitor_target = NULL;
				monitor_target_destroy_notify = NULL;
				_aggregate_progress_monitor_unref0 (aggregate_monitor);
				_g_object_unref0 (progress_dialog);
				_g_free0 (app_version);
				_g_free0 (errormsg);
				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;
			}
			_tmp54_ = progress_dialog;
			_tmp55_ = aggregate_progress_monitor_new (grand_total, _progress_dialog_monitor_progress_monitor, _tmp54_);
			_aggregate_progress_monitor_unref0 (aggregate_monitor);
			aggregate_monitor = _tmp55_;
			_tmp56_ = aggregate_monitor;
			(monitor_target_destroy_notify == NULL) ? NULL : (monitor_target_destroy_notify (monitor_target), NULL);
			monitor = NULL;
			monitor_target = NULL;
			monitor_target_destroy_notify = NULL;
			monitor = _aggregate_progress_monitor_monitor_progress_monitor;
			monitor_target = aggregate_progress_monitor_ref (_tmp56_);
			monitor_target_destroy_notify = aggregate_progress_monitor_unref;
		}
	}
	thumbnail_cache_init ();
	tombstone_init ();
	library_files_select_copy_function ();
	_tmp57_ = aggregate_monitor;
	if (_tmp57_ != NULL) {
		AggregateProgressMonitor* _tmp58_;
		_tmp58_ = aggregate_monitor;
		aggregate_progress_monitor_next_step (_tmp58_, "LibraryPhoto.init");
	}
	_tmp59_ = monitor;
	_tmp59__target = monitor_target;
	library_photo_init (_tmp59_, _tmp59__target);
	_tmp60_ = aggregate_monitor;
	if (_tmp60_ != NULL) {
		AggregateProgressMonitor* _tmp61_;
		_tmp61_ = aggregate_monitor;
		aggregate_progress_monitor_next_step (_tmp61_, "Video.init");
	}
	_tmp62_ = monitor;
	_tmp62__target = monitor_target;
	video_init (_tmp62_, _tmp62__target);
	_tmp63_ = aggregate_monitor;
	if (_tmp63_ != NULL) {
		AggregateProgressMonitor* _tmp64_;
		_tmp64_ = aggregate_monitor;
		aggregate_progress_monitor_next_step (_tmp64_, "Upgrades.execute");
	}
	_tmp65_ = upgrades_get_instance ();
	_tmp66_ = _tmp65_;
	upgrades_execute (_tmp66_, NULL, NULL);
	_upgrades_unref0 (_tmp66_);
	library_monitor_pool_init ();
	media_collection_registry_init ();
	_tmp67_ = media_collection_registry_get_instance ();
	registry = _tmp67_;
	_tmp68_ = registry;
	_tmp69_ = library_photo_global;
	media_collection_registry_register_collection (_tmp68_, G_TYPE_CHECK_INSTANCE_CAST (_tmp69_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
	_tmp70_ = registry;
	_tmp71_ = video_global;
	media_collection_registry_register_collection (_tmp70_, G_TYPE_CHECK_INSTANCE_CAST (_tmp71_, TYPE_MEDIA_SOURCE_COLLECTION, MediaSourceCollection));
	_tmp72_ = aggregate_monitor;
	if (_tmp72_ != NULL) {
		AggregateProgressMonitor* _tmp73_;
		_tmp73_ = aggregate_monitor;
		aggregate_progress_monitor_next_step (_tmp73_, "Event.init");
	}
	_tmp74_ = monitor;
	_tmp74__target = monitor_target;
	event_init (_tmp74_, _tmp74__target);
	_tmp75_ = aggregate_monitor;
	if (_tmp75_ != NULL) {
		AggregateProgressMonitor* _tmp76_;
		_tmp76_ = aggregate_monitor;
		aggregate_progress_monitor_next_step (_tmp76_, "Tag.init");
	}
	_tmp77_ = monitor;
	_tmp77__target = monitor_target;
	tag_init (_tmp77_, _tmp77__target);
	_tmp78_ = aggregate_monitor;
	if (_tmp78_ != NULL) {
		AggregateProgressMonitor* _tmp79_;
		_tmp79_ = aggregate_monitor;
		aggregate_progress_monitor_next_step (_tmp79_, "FaceLocation.init");
	}
	_tmp80_ = monitor;
	_tmp80__target = monitor_target;
	face_location_init (_tmp80_, _tmp80__target);
	_tmp81_ = aggregate_monitor;
	if (_tmp81_ != NULL) {
		AggregateProgressMonitor* _tmp82_;
		_tmp82_ = aggregate_monitor;
		aggregate_progress_monitor_next_step (_tmp82_, "Face.init");
	}
	_tmp83_ = monitor;
	_tmp83__target = monitor_target;
	face_init (_tmp83_, _tmp83__target);
	metadata_writer_init ();
	desktop_integration_init ();
	_tmp84_ = application_get_instance ();
	_tmp85_ = _tmp84_;
	g_signal_emit_by_name (_tmp85_, "init-done");
	_application_unref0 (_tmp85_);
	_tmp86_ = aggregate_monitor;
	if (_tmp86_ != NULL) {
		AggregateProgressMonitor* _tmp87_;
		_tmp87_ = aggregate_monitor;
		aggregate_progress_monitor_next_step (_tmp87_, "LibraryWindow");
	}
	_tmp88_ = monitor;
	_tmp88__target = monitor_target;
	_tmp89_ = library_window_new (_tmp88_, _tmp88__target);
	g_object_ref_sink (_tmp89_);
	library_window = _tmp89_;
	_tmp90_ = aggregate_monitor;
	if (_tmp90_ != NULL) {
		AggregateProgressMonitor* _tmp91_;
		_tmp91_ = aggregate_monitor;
		aggregate_progress_monitor_next_step (_tmp91_, "done");
	}
	(monitor_target_destroy_notify == NULL) ? NULL : (monitor_target_destroy_notify (monitor_target), NULL);
	monitor = NULL;
	monitor_target = NULL;
	monitor_target_destroy_notify = NULL;
	monitor = NULL;
	monitor_target = NULL;
	monitor_target_destroy_notify = NULL;
	_aggregate_progress_monitor_unref0 (aggregate_monitor);
	aggregate_monitor = NULL;
	_tmp92_ = progress_dialog;
	if (_tmp92_ != NULL) {
		ProgressDialog* _tmp93_;
		_tmp93_ = progress_dialog;
		gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp93_, gtk_widget_get_type (), GtkWidget));
	}
	_g_object_unref0 (progress_dialog);
	progress_dialog = NULL;
	{
		gchar** mount_collection = NULL;
		gint mount_collection_length1 = 0;
		gint _mount_collection_size_ = 0;
		gint mount_it = 0;
		mount_collection = mounts;
		mount_collection_length1 = mounts_length1;
		for (mount_it = 0; mount_it < mount_collection_length1; mount_it = mount_it + 1) {
			gchar* _tmp94_;
			gchar* mount = NULL;
			_tmp94_ = g_strdup (mount_collection[mount_it]);
			mount = _tmp94_;
			{
				LibraryWindow* _tmp95_;
				const gchar* _tmp96_;
				_tmp95_ = library_window;
				_tmp96_ = mount;
				library_window_mounted_camera_shell_notification (_tmp95_, _tmp96_, TRUE);
				_g_free0 (mount);
			}
		}
	}
	_tmp97_ = library_window;
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp97_, gtk_widget_get_type (), GtkWidget));
	_tmp98_ = g_new0 (WelcomeServiceEntry*, 0 + 1);
	selected_import_entries = _tmp98_;
	selected_import_entries_length1 = 0;
	_selected_import_entries_size_ = selected_import_entries_length1;
	_tmp100_ = config_facade_get_instance ();
	_tmp101_ = _tmp100_;
	_tmp102_ = configuration_facade_get_show_welcome_dialog (G_TYPE_CHECK_INSTANCE_CAST (_tmp101_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp101_);
	if (_tmp102_) {
		LibraryPhotoSourceCollection* _tmp103_;
		_tmp103_ = library_photo_global;
		_tmp99_ = data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp103_, TYPE_DATA_COLLECTION, DataCollection)) == 0;
	} else {
		_tmp99_ = FALSE;
	}
	if (_tmp99_) {
		WelcomeDialog* welcome = NULL;
		LibraryWindow* _tmp104_;
		WelcomeDialog* _tmp105_;
		ConfigFacade* _tmp106_;
		ConfigFacade* _tmp107_;
		WelcomeDialog* _tmp108_;
		WelcomeServiceEntry** _tmp109_ = NULL;
		gint _tmp110_ = 0;
		gboolean _tmp111_ = FALSE;
		gboolean _tmp112_;
		_tmp104_ = library_window;
		_tmp105_ = welcome_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp104_, gtk_window_get_type (), GtkWindow));
		g_object_ref_sink (_tmp105_);
		welcome = _tmp105_;
		_tmp106_ = config_facade_get_instance ();
		_tmp107_ = _tmp106_;
		_tmp108_ = welcome;
		_tmp112_ = welcome_dialog_execute (_tmp108_, &_tmp109_, &_tmp110_, &_tmp111_);
		selected_import_entries = (_vala_array_free (selected_import_entries, selected_import_entries_length1, (GDestroyNotify) g_object_unref), NULL);
		selected_import_entries = _tmp109_;
		selected_import_entries_length1 = _tmp110_;
		_selected_import_entries_size_ = selected_import_entries_length1;
		do_system_pictures_import = _tmp111_;
		configuration_facade_set_show_welcome_dialog (G_TYPE_CHECK_INSTANCE_CAST (_tmp107_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp112_);
		_g_object_unref0 (_tmp107_);
		_g_object_unref0 (welcome);
	} else {
		ConfigFacade* _tmp113_;
		ConfigFacade* _tmp114_;
		_tmp113_ = config_facade_get_instance ();
		_tmp114_ = _tmp113_;
		configuration_facade_set_show_welcome_dialog (G_TYPE_CHECK_INSTANCE_CAST (_tmp114_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), FALSE);
		_g_object_unref0 (_tmp114_);
	}
	_tmp115_ = selected_import_entries;
	_tmp115__length1 = selected_import_entries_length1;
	if (_tmp115__length1 > 0) {
		WelcomeServiceEntry** _tmp116_;
		gint _tmp116__length1;
		do_external_import = TRUE;
		_tmp116_ = selected_import_entries;
		_tmp116__length1 = selected_import_entries_length1;
		{
			WelcomeServiceEntry** entry_collection = NULL;
			gint entry_collection_length1 = 0;
			gint _entry_collection_size_ = 0;
			gint entry_it = 0;
			entry_collection = _tmp116_;
			entry_collection_length1 = _tmp116__length1;
			for (entry_it = 0; entry_it < entry_collection_length1; entry_it = entry_it + 1) {
				WelcomeServiceEntry* _tmp117_;
				WelcomeServiceEntry* entry = NULL;
				_tmp117_ = _g_object_ref0 (entry_collection[entry_it]);
				entry = _tmp117_;
				{
					WelcomeServiceEntry* _tmp118_;
					_tmp118_ = entry;
					welcome_service_entry_execute (_tmp118_);
					_g_object_unref0 (entry);
				}
			}
		}
	}
	if (do_system_pictures_import) {
		run_system_pictures_import (NULL);
	}
	heif = FALSE;
	jxl = FALSE;
	png = FALSE;
	tiff = FALSE;
	avif = FALSE;
	bmp = FALSE;
	gif = FALSE;
	_tmp119_ = gdk_pixbuf_get_formats ();
	formats = _tmp119_;
	_tmp120_ = formats;
	{
		GSList* format_collection = NULL;
		GSList* format_it = NULL;
		format_collection = _tmp120_;
		for (format_it = format_collection; format_it != NULL; format_it = format_it->next) {
			GdkPixbufFormat* format = NULL;
			format = (GdkPixbufFormat*) format_it->data;
			{
				GdkPixbufFormat* _tmp121_;
				gchar** _tmp122_;
				gchar** _tmp123_;
				gchar** _tmp124_;
				gint _tmp124__length1;
				gboolean _tmp125_;
				GdkPixbufFormat* _tmp126_;
				gchar** _tmp127_;
				gchar** _tmp128_;
				gchar** _tmp129_;
				gint _tmp129__length1;
				gboolean _tmp130_;
				GdkPixbufFormat* _tmp131_;
				gchar** _tmp132_;
				gchar** _tmp133_;
				gchar** _tmp134_;
				gint _tmp134__length1;
				gboolean _tmp135_;
				GdkPixbufFormat* _tmp136_;
				gchar** _tmp137_;
				gchar** _tmp138_;
				gchar** _tmp139_;
				gint _tmp139__length1;
				gboolean _tmp140_;
				GdkPixbufFormat* _tmp141_;
				gchar** _tmp142_;
				gchar** _tmp143_;
				gchar** _tmp144_;
				gint _tmp144__length1;
				gboolean _tmp145_;
				GdkPixbufFormat* _tmp146_;
				gchar** _tmp147_;
				gchar** _tmp148_;
				gchar** _tmp149_;
				gint _tmp149__length1;
				gboolean _tmp150_;
				GdkPixbufFormat* _tmp151_;
				gchar** _tmp152_;
				gchar** _tmp153_;
				gchar** _tmp154_;
				gint _tmp154__length1;
				gboolean _tmp155_;
				_tmp121_ = format;
				_tmp123_ = _tmp122_ = gdk_pixbuf_format_get_mime_types (_tmp121_);
				_tmp124_ = _tmp123_;
				_tmp124__length1 = _vala_array_length (_tmp122_);
				_tmp125_ = _vala_string_array_contains (_tmp124_, _vala_array_length (_tmp122_), "image/heif");
				_tmp124_ = (_vala_array_free (_tmp124_, _tmp124__length1, (GDestroyNotify) g_free), NULL);
				if (_tmp125_) {
					heif = TRUE;
				}
				_tmp126_ = format;
				_tmp128_ = _tmp127_ = gdk_pixbuf_format_get_mime_types (_tmp126_);
				_tmp129_ = _tmp128_;
				_tmp129__length1 = _vala_array_length (_tmp127_);
				_tmp130_ = _vala_string_array_contains (_tmp129_, _vala_array_length (_tmp127_), "image/jxl");
				_tmp129_ = (_vala_array_free (_tmp129_, _tmp129__length1, (GDestroyNotify) g_free), NULL);
				if (_tmp130_) {
					jxl = TRUE;
				}
				_tmp131_ = format;
				_tmp133_ = _tmp132_ = gdk_pixbuf_format_get_mime_types (_tmp131_);
				_tmp134_ = _tmp133_;
				_tmp134__length1 = _vala_array_length (_tmp132_);
				_tmp135_ = _vala_string_array_contains (_tmp134_, _vala_array_length (_tmp132_), "image/png");
				_tmp134_ = (_vala_array_free (_tmp134_, _tmp134__length1, (GDestroyNotify) g_free), NULL);
				if (_tmp135_) {
					png = TRUE;
				}
				_tmp136_ = format;
				_tmp138_ = _tmp137_ = gdk_pixbuf_format_get_mime_types (_tmp136_);
				_tmp139_ = _tmp138_;
				_tmp139__length1 = _vala_array_length (_tmp137_);
				_tmp140_ = _vala_string_array_contains (_tmp139_, _vala_array_length (_tmp137_), "image/tiff");
				_tmp139_ = (_vala_array_free (_tmp139_, _tmp139__length1, (GDestroyNotify) g_free), NULL);
				if (_tmp140_) {
					tiff = TRUE;
				}
				_tmp141_ = format;
				_tmp143_ = _tmp142_ = gdk_pixbuf_format_get_mime_types (_tmp141_);
				_tmp144_ = _tmp143_;
				_tmp144__length1 = _vala_array_length (_tmp142_);
				_tmp145_ = _vala_string_array_contains (_tmp144_, _vala_array_length (_tmp142_), "image/avif");
				_tmp144_ = (_vala_array_free (_tmp144_, _tmp144__length1, (GDestroyNotify) g_free), NULL);
				if (_tmp145_) {
					avif = TRUE;
				}
				_tmp146_ = format;
				_tmp148_ = _tmp147_ = gdk_pixbuf_format_get_mime_types (_tmp146_);
				_tmp149_ = _tmp148_;
				_tmp149__length1 = _vala_array_length (_tmp147_);
				_tmp150_ = _vala_string_array_contains (_tmp149_, _vala_array_length (_tmp147_), "image/bmp");
				_tmp149_ = (_vala_array_free (_tmp149_, _tmp149__length1, (GDestroyNotify) g_free), NULL);
				if (_tmp150_) {
					bmp = TRUE;
				}
				_tmp151_ = format;
				_tmp153_ = _tmp152_ = gdk_pixbuf_format_get_mime_types (_tmp151_);
				_tmp154_ = _tmp153_;
				_tmp154__length1 = _vala_array_length (_tmp152_);
				_tmp155_ = _vala_string_array_contains (_tmp154_, _vala_array_length (_tmp152_), "image/gif");
				_tmp154_ = (_vala_array_free (_tmp154_, _tmp154__length1, (GDestroyNotify) g_free), NULL);
				if (_tmp155_) {
					gif = TRUE;
				}
			}
		}
	}
	can_read_bmff = FALSE;
	b = NULL;
	{
		GBytes* _tmp156_ = NULL;
		GBytes* _tmp157_;
		GBytes* _tmp158_;
		_tmp157_ = g_resources_lookup_data ("/org/gnome/Shotwell/misc/canary.avif", G_RESOURCE_LOOKUP_FLAGS_NONE, &_inner_error0_);
		_tmp156_ = _tmp157_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch2_g_error;
		}
		_tmp158_ = _tmp156_;
		_tmp156_ = NULL;
		_g_bytes_unref0 (b);
		b = _tmp158_;
		_g_bytes_unref0 (_tmp156_);
	}
	goto __finally2;
	__catch2_g_error:
	{
		GError* err = NULL;
		const gchar* _tmp159_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp159_ = err->message;
		g_error ("main.vala:246: Failed to look up mandatory resource: %s", _tmp159_);
		_g_error_free0 (err);
	}
	__finally2:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_bytes_unref0 (b);
		(formats == NULL) ? NULL : (formats = (g_slist_free (formats), NULL));
		selected_import_entries = (_vala_array_free (selected_import_entries, selected_import_entries_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (library_window);
		_media_collection_registry_unref0 (registry);
		(monitor_target_destroy_notify == NULL) ? NULL : (monitor_target_destroy_notify (monitor_target), NULL);
		monitor = NULL;
		monitor_target = NULL;
		monitor_target_destroy_notify = NULL;
		_aggregate_progress_monitor_unref0 (aggregate_monitor);
		_g_object_unref0 (progress_dialog);
		_g_free0 (app_version);
		_g_free0 (errormsg);
		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;
	}
	{
		GExiv2Metadata* m = NULL;
		GExiv2Metadata* _tmp160_;
		GExiv2Metadata* _tmp161_;
		GBytes* _tmp162_;
		gsize _tmp163_ = 0;
		guint8* _tmp164_;
		_tmp160_ = gexiv2_metadata_new ();
		m = _tmp160_;
		_tmp161_ = m;
		_tmp162_ = b;
		_tmp164_ = g_bytes_get_data (_tmp162_, &_tmp163_);
		gexiv2_metadata_open_buf (_tmp161_, _tmp164_, (glong) _tmp163_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (m);
			goto __catch3_g_error;
		}
		can_read_bmff = TRUE;
		_g_object_unref0 (m);
	}
	goto __finally3;
	__catch3_g_error:
	{
		g_clear_error (&_inner_error0_);
	}
	__finally3:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_bytes_unref0 (b);
		(formats == NULL) ? NULL : (formats = (g_slist_free (formats), NULL));
		selected_import_entries = (_vala_array_free (selected_import_entries, selected_import_entries_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (library_window);
		_media_collection_registry_unref0 (registry);
		(monitor_target_destroy_notify == NULL) ? NULL : (monitor_target_destroy_notify (monitor_target), NULL);
		monitor = NULL;
		monitor_target = NULL;
		monitor_target_destroy_notify = NULL;
		_aggregate_progress_monitor_unref0 (aggregate_monitor);
		_g_object_unref0 (progress_dialog);
		_g_free0 (app_version);
		_g_free0 (errormsg);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	g_message ("main.vala:257: Supported codecs....");
	g_message ("main.vala:258:   WEBP   : yes, builtin");
	g_message ("main.vala:259:   RAW    : yes, builtin");
	if (can_read_bmff) {
		_tmp165_ = "yes";
	} else {
		_tmp165_ = "no";
	}
	g_message ("main.vala:260:   CR3    : %s", _tmp165_);
	g_message ("main.vala:261:   JPEG   : yes, gdk-pixbuf");
	if (png) {
		_tmp166_ = "yes";
	} else {
		_tmp166_ = "no";
	}
	g_message ("main.vala:262:   PNG    : %s, gdk-pixbuf", _tmp166_);
	if (gif) {
		_tmp167_ = "yes";
	} else {
		_tmp167_ = "no";
	}
	g_message ("main.vala:263:   GIF    : %s, gdk-pixbuf", _tmp167_);
	if (tiff) {
		_tmp168_ = "yes";
	} else {
		_tmp168_ = "no";
	}
	g_message ("main.vala:264:   TIFF   : %s, gdk-pixbuf", _tmp168_);
	if (jxl) {
		_tmp169_ = "yes";
	} else {
		_tmp169_ = "no";
	}
	if (can_read_bmff) {
		_tmp170_ = "read";
	} else {
		_tmp170_ = "no";
	}
	g_message ("main.vala:265:   JPEG XL: %s, gdk-pixbuf, %s meta-data", _tmp169_, _tmp170_);
	if (avif) {
		_tmp171_ = "yes";
	} else {
		_tmp171_ = "no";
	}
	if (can_read_bmff) {
		_tmp172_ = "read";
	} else {
		_tmp172_ = "no";
	}
	g_message ("main.vala:266:   AVIF   : %s, gdk-pixbuf, %s meta-data", _tmp171_, _tmp172_);
	if (heif) {
		_tmp173_ = "yes";
	} else {
		_tmp173_ = "no";
	}
	if (can_read_bmff) {
		_tmp174_ = "read";
	} else {
		_tmp174_ = "no";
	}
	g_message ("main.vala:267:   HEIF   : %s, gdk-pixbuf, %s meta-data", _tmp173_, _tmp174_);
	_tmp175_ = startup_timer;
	g_debug ("main.vala:269: %lf seconds to Gtk.main()", g_timer_elapsed (_tmp175_, NULL));
	_tmp176_ = application_get_instance ();
	_tmp177_ = _tmp176_;
	application_start (_tmp177_, NULL, (gint) 0);
	_application_unref0 (_tmp177_);
	desktop_integration_terminate ();
	metadata_writer_terminate ();
	tag_terminate ();
	event_terminate ();
	library_photo_terminate ();
	media_collection_registry_terminate ();
	library_monitor_pool_terminate ();
	tombstone_terminate ();
	thumbnail_cache_terminate ();
	video_terminate ();
	face_terminate ();
	face_location_terminate ();
	library_app_terminate ();
	_g_bytes_unref0 (b);
	(formats == NULL) ? NULL : (formats = (g_slist_free (formats), NULL));
	selected_import_entries = (_vala_array_free (selected_import_entries, selected_import_entries_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (library_window);
	_media_collection_registry_unref0 (registry);
	(monitor_target_destroy_notify == NULL) ? NULL : (monitor_target_destroy_notify (monitor_target), NULL);
	monitor = NULL;
	monitor_target = NULL;
	monitor_target_destroy_notify = NULL;
	_aggregate_progress_monitor_unref0 (aggregate_monitor);
	_g_object_unref0 (progress_dialog);
	_g_free0 (app_version);
	_g_free0 (errormsg);
}

static void
_report_system_pictures_import_batch_import_import_reporter (ImportManifest* manifest,
                                                             BatchImportRoll* import_roll,
                                                             gpointer self)
{
	report_system_pictures_import (manifest, import_roll);
}

void
run_system_pictures_import (ImportManifest* external_exclusion_manifest)
{
	GeeArrayList* jobs = NULL;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp1_;
	GFile* _tmp2_;
	GFile* _tmp3_;
	FileImportJob* _tmp4_;
	FileImportJob* _tmp5_;
	LibraryWindow* library_window = NULL;
	AppWindow* _tmp6_;
	BatchImport* batch_import = NULL;
	GeeArrayList* _tmp7_;
	BatchImport* _tmp8_;
	LibraryWindow* _tmp9_;
	BatchImport* _tmp10_;
	LibraryWindow* _tmp11_;
	g_return_if_fail ((external_exclusion_manifest == NULL) || IS_IMPORT_MANIFEST (external_exclusion_manifest));
	if (!do_system_pictures_import) {
		return;
	}
	_tmp0_ = gee_array_list_new (TYPE_FILE_IMPORT_JOB, (GBoxedCopyFunc) batch_import_job_ref, (GDestroyNotify) batch_import_job_unref, NULL, NULL, NULL);
	jobs = _tmp0_;
	_tmp1_ = jobs;
	_tmp2_ = app_dirs_get_import_dir ();
	_tmp3_ = _tmp2_;
	_tmp4_ = file_import_job_new (_tmp3_, FALSE, TRUE);
	_tmp5_ = _tmp4_;
	gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp5_);
	_batch_import_job_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_tmp6_ = app_window_get_instance ();
	library_window = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_LIBRARY_WINDOW, LibraryWindow);
	_tmp7_ = jobs;
	_tmp8_ = batch_import_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ITERABLE, GeeIterable), "startup_import", _report_system_pictures_import_batch_import_import_reporter, NULL, NULL, NULL, NULL, NULL, external_exclusion_manifest);
	batch_import = _tmp8_;
	_tmp9_ = library_window;
	_tmp10_ = batch_import;
	library_window_enqueue_batch_import (_tmp9_, _tmp10_, TRUE);
	_tmp11_ = library_window;
	library_window_switch_to_import_queue_page (_tmp11_);
	_g_object_unref0 (batch_import);
	_g_object_unref0 (library_window);
	_g_object_unref0 (jobs);
}

void
report_system_pictures_import (ImportManifest* manifest,
                               BatchImportRoll* import_roll)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (IS_IMPORT_MANIFEST (manifest));
	g_return_if_fail (IS_BATCH_IMPORT_ROLL (import_roll));
	if (do_external_import) {
		GeeList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		_tmp1_ = manifest->all;
		_tmp2_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp3_ = _tmp2_;
		_tmp0_ = _tmp3_ == 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	import_ui_report_manifest (manifest, TRUE, NULL);
}

void
dump_tags (GExiv2Metadata* metadata,
           gchar** tags,
           gint tags_length1,
           GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (metadata, gexiv2_metadata_get_type ()));
	{
		gchar** tag_collection = NULL;
		gint tag_collection_length1 = 0;
		gint _tag_collection_size_ = 0;
		gint tag_it = 0;
		tag_collection = tags;
		tag_collection_length1 = tags_length1;
		for (tag_it = 0; tag_it < tag_collection_length1; tag_it = tag_it + 1) {
			gchar* _tmp0_;
			gchar* tag = NULL;
			_tmp0_ = g_strdup (tag_collection[tag_it]);
			tag = _tmp0_;
			{
				{
					gchar* _tmp1_ = NULL;
					const gchar* _tmp2_;
					gchar* _tmp3_;
					const gchar* _tmp4_;
					_tmp2_ = tag;
					_tmp3_ = gexiv2_metadata_try_get_tag_interpreted_string (metadata, _tmp2_, &_inner_error0_);
					_tmp1_ = _tmp3_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
					_tmp4_ = tag;
					g_print ("%-64s%s\n", _tmp4_, _tmp1_);
					_g_free0 (_tmp1_);
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* err = NULL;
					const gchar* _tmp5_;
					GError* _tmp6_;
					const gchar* _tmp7_;
					err = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp5_ = tag;
					_tmp6_ = err;
					_tmp7_ = _tmp6_->message;
					g_print ("Failed to get tag %s: %s\n", _tmp5_, _tmp7_);
					_g_error_free0 (err);
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_free0 (tag);
					return;
				}
				_g_free0 (tag);
			}
		}
	}
}

void
dump_metadata (const gchar* filename)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (filename != NULL);
	{
		GExiv2Metadata* metadata = NULL;
		GExiv2Metadata* _tmp0_;
		GFile* file = NULL;
		GFile* _tmp1_;
		GFileInputStream* _tmp2_ = NULL;
		GFile* _tmp3_;
		GFileInputStream* _tmp4_;
		GExiv2Metadata* _tmp5_;
		GExiv2Metadata* _tmp6_;
		GExiv2Metadata* _tmp7_;
		gchar** _tmp8_;
		gchar** _tmp9_;
		gchar** _tmp10_;
		gint _tmp10__length1;
		GExiv2Metadata* _tmp11_;
		GExiv2Metadata* _tmp12_;
		gchar** _tmp13_;
		gchar** _tmp14_;
		gchar** _tmp15_;
		gint _tmp15__length1;
		GExiv2Metadata* _tmp16_;
		GExiv2Metadata* _tmp17_;
		gchar** _tmp18_;
		gchar** _tmp19_;
		gchar** _tmp20_;
		gint _tmp20__length1;
		_tmp0_ = gexiv2_metadata_new ();
		metadata = _tmp0_;
		_tmp1_ = g_file_new_for_commandline_arg (filename);
		file = _tmp1_;
		_tmp3_ = file;
		_tmp4_ = g_file_read (_tmp3_, NULL, &_inner_error0_);
		_tmp2_ = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (file);
			_g_object_unref0 (metadata);
			goto __catch0_g_error;
		}
		_tmp5_ = metadata;
		gexiv2_metadata_from_stream (_tmp5_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, g_input_stream_get_type (), GInputStream), &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (_tmp2_);
			_g_object_unref0 (file);
			_g_object_unref0 (metadata);
			goto __catch0_g_error;
		}
		_tmp6_ = metadata;
		_tmp7_ = metadata;
		_tmp9_ = _tmp8_ = gexiv2_metadata_get_exif_tags (_tmp7_);
		_tmp10_ = _tmp9_;
		_tmp10__length1 = _vala_array_length (_tmp8_);
		dump_tags (_tmp6_, _tmp10_, (gint) _vala_array_length (_tmp8_), &_inner_error0_);
		_tmp10_ = (_vala_array_free (_tmp10_, _tmp10__length1, (GDestroyNotify) g_free), NULL);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (_tmp2_);
			_g_object_unref0 (file);
			_g_object_unref0 (metadata);
			goto __catch0_g_error;
		}
		_tmp11_ = metadata;
		_tmp12_ = metadata;
		_tmp14_ = _tmp13_ = gexiv2_metadata_get_iptc_tags (_tmp12_);
		_tmp15_ = _tmp14_;
		_tmp15__length1 = _vala_array_length (_tmp13_);
		dump_tags (_tmp11_, _tmp15_, (gint) _vala_array_length (_tmp13_), &_inner_error0_);
		_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (_tmp2_);
			_g_object_unref0 (file);
			_g_object_unref0 (metadata);
			goto __catch0_g_error;
		}
		_tmp16_ = metadata;
		_tmp17_ = metadata;
		_tmp19_ = _tmp18_ = gexiv2_metadata_get_xmp_tags (_tmp17_);
		_tmp20_ = _tmp19_;
		_tmp20__length1 = _vala_array_length (_tmp18_);
		dump_tags (_tmp16_, _tmp20_, (gint) _vala_array_length (_tmp18_), &_inner_error0_);
		_tmp20_ = (_vala_array_free (_tmp20_, _tmp20__length1, (GDestroyNotify) g_free), NULL);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (_tmp2_);
			_g_object_unref0 (file);
			_g_object_unref0 (metadata);
			goto __catch0_g_error;
		}
		_g_object_unref0 (_tmp2_);
		_g_object_unref0 (file);
		_g_object_unref0 (metadata);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		FILE* _tmp21_;
		GError* _tmp22_;
		const gchar* _tmp23_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp21_ = stderr;
		_tmp22_ = err;
		_tmp23_ = _tmp22_->message;
		fprintf (_tmp21_, "Unable to dump metadata for %s: %s\n", filename, _tmp23_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

void
editing_exec (const gchar* filename,
              gboolean fullscreen)
{
	GFile* initial_file = NULL;
	GFile* _tmp0_;
	GFile* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	GFile* _tmp19_;
	gboolean use_dark = FALSE;
	ConfigFacade* _tmp20_;
	ConfigFacade* _tmp21_;
	gboolean _tmp22_;
	GtkSettings* _tmp23_;
	DirectWindow* direct_window = NULL;
	GFile* _tmp26_;
	DirectWindow* _tmp27_;
	DirectWindow* _tmp28_;
	GTimer* _tmp29_;
	Application* _tmp34_;
	Application* _tmp35_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (filename != NULL);
	_tmp0_ = g_file_new_for_commandline_arg (filename);
	initial_file = _tmp0_;
	_tmp1_ = initial_file;
	_tmp2_ = g_file_get_uri (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = !g_str_has_prefix (_tmp3_, "file://");
	_g_free0 (_tmp3_);
	if (_tmp4_) {
		GFile* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gboolean _tmp8_;
		_tmp5_ = initial_file;
		_tmp6_ = g_file_get_uri (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = !g_str_has_prefix (_tmp7_, "trash://");
		_g_free0 (_tmp7_);
		if (_tmp8_) {
			GFile* _tmp9_;
			gchar* _tmp10_;
			gchar* _tmp11_;
			GFile* _tmp12_;
			_tmp9_ = initial_file;
			_tmp10_ = g_file_get_path (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = g_file_new_for_path (_tmp11_);
			_g_object_unref0 (initial_file);
			initial_file = _tmp12_;
			_g_free0 (_tmp11_);
		} else {
			GFileInfo* info = NULL;
			GFile* _tmp13_;
			GFileInfo* _tmp14_;
			GFileInfo* _tmp15_;
			gchar* _tmp16_;
			gchar* _tmp17_;
			GFile* _tmp18_;
			_tmp13_ = initial_file;
			_tmp14_ = g_file_query_info (_tmp13_, "standard::target-uri", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error0_);
			info = _tmp14_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (initial_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;
			}
			_tmp15_ = info;
			_tmp16_ = g_file_info_get_attribute_as_string (_tmp15_, "standard::target-uri");
			_tmp17_ = _tmp16_;
			_tmp18_ = g_file_new_for_uri (_tmp17_);
			_g_object_unref0 (initial_file);
			initial_file = _tmp18_;
			_g_free0 (_tmp17_);
			_g_object_unref0 (info);
		}
	}
	_tmp19_ = initial_file;
	direct_preconfigure (_tmp19_);
	db_preconfigure (NULL);
	_tmp20_ = config_facade_get_instance ();
	_tmp21_ = _tmp20_;
	_tmp22_ = configuration_facade_get_gtk_theme_variant (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp21_);
	use_dark = _tmp22_;
	_tmp23_ = gtk_settings_get_default ();
	g_object_set (_tmp23_, "gtk-application-prefer-dark-theme", use_dark, NULL);
	{
		direct_app_init (&_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp24_;
		const gchar* _tmp25_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp24_ = err;
		_tmp25_ = _tmp24_->message;
		app_window_panic (_tmp25_);
		_g_error_free0 (err);
		_g_object_unref0 (initial_file);
		return;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (initial_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;
	}
	desktop_integration_init ();
	_tmp26_ = initial_file;
	_tmp27_ = direct_window_new (_tmp26_);
	g_object_ref_sink (_tmp27_);
	direct_window = _tmp27_;
	_tmp28_ = direct_window;
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, gtk_widget_get_type (), GtkWidget));
	_tmp29_ = startup_timer;
	g_debug ("main.vala:386: %lf seconds to Gtk.main()", g_timer_elapsed (_tmp29_, NULL));
	if (fullscreen) {
		GAction* action = NULL;
		DirectWindow* _tmp30_;
		GAction* _tmp31_;
		GAction* _tmp32_;
		_tmp30_ = direct_window;
		_tmp31_ = app_window_get_common_action (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, TYPE_APP_WINDOW, AppWindow), "CommonFullscreen");
		action = _tmp31_;
		_tmp32_ = action;
		if (_tmp32_ != NULL) {
			GAction* _tmp33_;
			_tmp33_ = action;
			g_action_activate (_tmp33_, NULL);
		}
		_g_object_unref0 (action);
	}
	_tmp34_ = application_get_instance ();
	_tmp35_ = _tmp34_;
	application_start (_tmp35_, NULL, (gint) 0);
	_application_unref0 (_tmp35_);
	desktop_integration_terminate ();
	direct_app_terminate ();
	_g_object_unref0 (direct_window);
	_g_object_unref0 (initial_file);
}

static Block14Data*
block14_data_ref (Block14Data* _data14_)
{
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}

static void
block14_data_unref (void * _userdata_)
{
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		_g_object_unref0 (_data14_->window);
		g_slice_free (Block14Data, _data14_);
	}
}

static void
___lambda42_ (Block14Data* _data14_,
              ShotwellProfile* profile)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GtkDialog* _tmp8_;
	g_return_if_fail (SHOTWELL_IS_PROFILE (profile));
	_tmp0_ = shotwell_profile_get_id (profile);
	_tmp1_ = _tmp0_;
	if (g_strcmp0 (_tmp1_, SHOTWELL_PROFILE_SYSTEM) != 0) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp2_ = shotwell_profile_get_name (profile);
		_tmp3_ = _tmp2_;
		_tmp4_ = g_strdup (_tmp3_);
		_g_free0 (commandline_options_profile);
		commandline_options_profile = _tmp4_;
		_tmp5_ = shotwell_profile_get_data_dir (profile);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_strdup (_tmp6_);
		_g_free0 (commandline_options_data_dir);
		commandline_options_data_dir = _tmp7_;
	} else {
		_g_free0 (commandline_options_profile);
		commandline_options_profile = NULL;
	}
	_tmp8_ = _data14_->window;
	gtk_dialog_response (_tmp8_, (gint) GTK_RESPONSE_OK);
}

static void
____lambda42__shotwell_profile_browser_profile_activated (ShotwellProfileBrowser* _sender,
                                                          ShotwellProfile* profile,
                                                          gpointer self)
{
	___lambda42_ (self, profile);
}

static void
_vala_array_add73 (gchar** * array,
                   gint* length,
                   gint* size,
                   gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_main (gchar** args,
            gint args_length1)
{
	GTimeZone* _tmp0_;
	const gchar* _tmp1_;
	GFile* _tmp4_;
	GFile* _tmp5_;
	gboolean _tmp6_;
	const gchar* _tmp28_;
	gchar** mounts = NULL;
	gchar** _tmp40_;
	gint mounts_length1;
	gint _mounts_size_;
	gchar* filename = NULL;
	const gchar* _tmp49_ = NULL;
	const gchar* _tmp50_;
	GTimeZone* _tmp55_;
	const gchar* _tmp56_;
	GEnumValue* _tmp57_;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	GTimer* _tmp62_;
	GTimer* _tmp63_;
	const gchar* _tmp64_;
	gboolean _tmp67_ = FALSE;
	const gchar* _tmp68_;
	GError* _inner_error0_ = NULL;
	_tmp0_ = g_time_zone_new_local ();
	_g_time_zone_unref0 (application_timezone);
	application_timezone = _tmp0_;
	_tmp1_ = args[0];
	app_dirs_init (_tmp1_);
	gexiv2_initialize ();
	gexiv2_log_use_glib_logging ();
	gexiv2_log_set_level (GEXIV2_LOG_LEVEL_DEBUG);
	if (g_strcmp0 (RESOURCES_PIXBUF_LOADER_PATH, "") != 0) {
		g_debug ("main.vala:450: Trying to set module path to %s", RESOURCES_PIXBUF_LOADER_PATH);
		{
			gdk_pixbuf_init_modules (RESOURCES_PIXBUF_LOADER_PATH, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* err = NULL;
			GError* _tmp2_;
			const gchar* _tmp3_;
			err = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp2_ = err;
			_tmp3_ = _tmp2_->message;
			g_message ("main.vala:454: Failed to set additional pixbuf loader path: %s", _tmp3_);
			_g_error_free0 (err);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
	_tmp4_ = app_dirs_get_install_dir ();
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_ == NULL;
	_g_object_unref0 (_tmp5_);
	if (_tmp6_) {
		GFile* _tmp7_;
		GFile* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		_tmp7_ = app_dirs_get_lib_dir ();
		_tmp8_ = _tmp7_;
		_tmp9_ = g_file_get_path (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = g_strconcat (_tmp10_, "/data/gsettings", NULL);
		_tmp12_ = _tmp11_;
		g_setenv ("GSETTINGS_SCHEMA_DIR", _tmp12_, TRUE);
		_g_free0 (_tmp12_);
		_g_free0 (_tmp10_);
		_g_object_unref0 (_tmp8_);
	}
	{
		gtk_init_with_args ((gint*) (&args_length1), &args, _ ("[FILE]"), COMMANDLINE_OPTIONS_entries, RESOURCES_APP_GETTEXT_PACKAGE, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		GError* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		const gchar* _tmp17_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp13_ = e;
		_tmp14_ = _tmp13_->message;
		_tmp15_ = g_strconcat (_tmp14_, "\n", NULL);
		_tmp16_ = _tmp15_;
		g_print ("%s", _tmp16_);
		_g_free0 (_tmp16_);
		_tmp17_ = args[0];
		g_print (_ ("Run “%s --help” to see a full list of available command line options.\n"), _tmp17_);
		app_dirs_terminate ();
		_g_error_free0 (e);
		return;
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	g_type_ensure (TYPE_DISMISSABLE_TEXT_VIEW);
	if (commandline_options_browse_profiles) {
		Block14Data* _data14_;
		GtkDialog* _tmp18_;
		GtkDialog* _tmp19_;
		ShotwellProfileBrowser* browser = NULL;
		ShotwellProfileBrowser* _tmp20_;
		ShotwellProfileBrowser* _tmp21_;
		GtkDialog* _tmp22_;
		GtkBox* _tmp23_;
		ShotwellProfileBrowser* _tmp24_;
		GtkDialog* _tmp25_;
		gint response = 0;
		GtkDialog* _tmp26_;
		GtkDialog* _tmp27_;
		_data14_ = g_slice_new0 (Block14Data);
		_data14_->_ref_count_ = 1;
		_tmp18_ = (GtkDialog*) gtk_dialog_new ();
		g_object_ref_sink (_tmp18_);
		_data14_->window = _tmp18_;
		_tmp19_ = _data14_->window;
		gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_window_get_type (), GtkWindow), _ ("Choose Shotwell's profile"));
		_tmp20_ = shotwell_profile_browser_new ();
		g_object_ref_sink (_tmp20_);
		browser = _tmp20_;
		_tmp21_ = browser;
		g_signal_connect_data (_tmp21_, "profile-activated", (GCallback) ____lambda42__shotwell_profile_browser_profile_activated, block14_data_ref (_data14_), (GClosureNotify) block14_data_unref, 0);
		_tmp22_ = _data14_->window;
		_tmp23_ = gtk_dialog_get_content_area (_tmp22_);
		_tmp24_ = browser;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_widget_get_type (), GtkWidget));
		_tmp25_ = _data14_->window;
		gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget), 430, 560);
		_tmp26_ = _data14_->window;
		response = gtk_dialog_run (_tmp26_);
		_tmp27_ = _data14_->window;
		gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, gtk_widget_get_type (), GtkWidget));
		if (response != ((gint) GTK_RESPONSE_OK)) {
			_g_object_unref0 (browser);
			block14_data_unref (_data14_);
			_data14_ = NULL;
			return;
		}
		_g_object_unref0 (browser);
		block14_data_unref (_data14_);
		_data14_ = NULL;
	}
	_tmp28_ = commandline_options_profile;
	if (_tmp28_ != NULL) {
		ShotwellProfileManager* manager = NULL;
		ShotwellProfileManager* _tmp29_;
		ShotwellProfileManager* _tmp30_;
		const gchar* _tmp31_;
		ShotwellProfileManager* _tmp33_;
		const gchar* _tmp34_;
		ShotwellProfileManager* _tmp35_;
		const gchar* _tmp36_;
		gchar* _tmp37_;
		_tmp29_ = shotwell_profile_manager_get_instance ();
		manager = _tmp29_;
		_tmp30_ = manager;
		_tmp31_ = commandline_options_profile;
		if (!shotwell_profile_manager_has_profile (_tmp30_, _tmp31_, NULL)) {
			if (!commandline_options_create_profile) {
				const gchar* _tmp32_;
				_tmp32_ = commandline_options_profile;
				g_print (_ ("Profile %s does not exist. Did you mean to pass --create as well?"), _tmp32_);
				app_dirs_terminate ();
				_g_object_unref0 (manager);
				return;
			}
		}
		_tmp33_ = manager;
		_tmp34_ = commandline_options_profile;
		shotwell_profile_manager_set_profile (_tmp33_, _tmp34_);
		_tmp35_ = manager;
		_tmp36_ = commandline_options_data_dir;
		_tmp37_ = shotwell_profile_manager_derive_data_dir (_tmp35_, _tmp36_);
		_g_free0 (commandline_options_data_dir);
		commandline_options_data_dir = _tmp37_;
		_g_object_unref0 (manager);
	} else {
		g_message ("main.vala:518: Starting session with system profile");
	}
	if (commandline_options_show_version) {
		if (g_strcmp0 (RESOURCES_GIT_VERSION, "") != 0) {
			g_print ("%s %s (%s)\n", RESOURCES_APP_TITLE, RESOURCES_APP_VERSION, RESOURCES_GIT_VERSION);
		} else {
			g_print ("%s %s\n", RESOURCES_APP_TITLE, RESOURCES_APP_VERSION);
		}
		app_dirs_terminate ();
		return;
	}
	if (commandline_options_list_profiles) {
		ShotwellProfileManager* manager = NULL;
		ShotwellProfileManager* _tmp38_;
		ShotwellProfileManager* _tmp39_;
		_tmp38_ = shotwell_profile_manager_get_instance ();
		manager = _tmp38_;
		_tmp39_ = manager;
		shotwell_profile_manager_print_profiles (_tmp39_);
		app_dirs_terminate ();
		_g_object_unref0 (manager);
		return;
	}
	_tmp40_ = g_new0 (gchar*, 0 + 1);
	mounts = _tmp40_;
	mounts_length1 = 0;
	_mounts_size_ = mounts_length1;
	filename = NULL;
	{
		gchar** arg_collection = NULL;
		gint arg_collection_length1 = 0;
		gint _arg_collection_size_ = 0;
		gint arg_it = 0;
		arg_collection = args + 1;
		arg_collection_length1 = args_length1 - 1;
		for (arg_it = 0; arg_it < arg_collection_length1; arg_it = arg_it + 1) {
			gchar* _tmp41_;
			gchar* arg = NULL;
			_tmp41_ = g_strdup (arg_collection[arg_it]);
			arg = _tmp41_;
			{
				const gchar* _tmp42_;
				_tmp42_ = arg;
				if (library_window_is_mount_uri_supported (_tmp42_)) {
					const gchar* _tmp43_;
					gchar* _tmp44_;
					_tmp43_ = arg;
					_tmp44_ = g_strdup (_tmp43_);
					_vala_array_add73 (&mounts, &mounts_length1, &_mounts_size_, _tmp44_);
				} else {
					const gchar* _tmp45_;
					_tmp45_ = filename;
					if (is_string_empty (_tmp45_)) {
						const gchar* _tmp46_;
						gchar* _tmp47_;
						_tmp46_ = arg;
						_tmp47_ = g_strdup (_tmp46_);
						_g_free0 (filename);
						filename = _tmp47_;
					}
				}
				_g_free0 (arg);
			}
		}
	}
	if (commandline_options_show_metadata) {
		const gchar* _tmp48_;
		_tmp48_ = filename;
		dump_metadata (_tmp48_);
		app_dirs_terminate ();
		_g_free0 (filename);
		mounts = (_vala_array_free (mounts, mounts_length1, (GDestroyNotify) g_free), NULL);
		return;
	}
	_tmp50_ = filename;
	if (is_string_empty (_tmp50_)) {
		_tmp49_ = DEBUG_LIBRARY_PREFIX;
	} else {
		_tmp49_ = DEBUG_VIEWER_PREFIX;
	}
	debug_init (_tmp49_);
	if (g_strcmp0 (RESOURCES_GIT_VERSION, "") != 0) {
		const gchar* _tmp51_ = NULL;
		const gchar* _tmp52_;
		_tmp52_ = filename;
		if (is_string_empty (_tmp52_)) {
			_tmp51_ = RESOURCES_APP_LIBRARY_ROLE;
		} else {
			_tmp51_ = RESOURCES_APP_DIRECT_ROLE;
		}
		g_message ("main.vala:570: Shotwell %s %s (%s)", _tmp51_, RESOURCES_APP_VERSION, RESOURCES_GIT_VERSION);
	} else {
		const gchar* _tmp53_ = NULL;
		const gchar* _tmp54_;
		_tmp54_ = filename;
		if (is_string_empty (_tmp54_)) {
			_tmp53_ = RESOURCES_APP_LIBRARY_ROLE;
		} else {
			_tmp53_ = RESOURCES_APP_DIRECT_ROLE;
		}
		g_message ("main.vala:574: Shotwell %s %s", _tmp53_, RESOURCES_APP_VERSION);
	}
	_tmp55_ = application_timezone;
	_tmp56_ = g_time_zone_get_identifier (_tmp55_);
	g_debug ("main.vala:578: Shotwell is running in timezone %s", _tmp56_);
	_tmp57_ = g_enum_get_value (g_type_class_ref (APP_DIRS_TYPE_RUNTIME), app_dirs_get_runtime ());
	g_message ("main.vala:579: Shotwell is runing inside %s", (_tmp57_ != NULL) ? _tmp57_->value_name : NULL);
	_tmp58_ = filename;
	application_init (!is_string_empty (_tmp58_));
	_tmp59_ = commandline_options_data_dir;
	if (_tmp59_ != NULL) {
		const gchar* _tmp60_;
		const gchar* _tmp61_;
		_tmp60_ = commandline_options_profile;
		if (_tmp60_ == NULL) {
			app_window_error_message ("Using the --datadir option without passing --profile and --create is d" \
"eprecated\n" \
". Plesae migrate to a proper profile instead.", NULL);
		}
		_tmp61_ = commandline_options_data_dir;
		app_dirs_set_data_dir (_tmp61_);
	} else {
		app_dirs_try_migrate_data ();
	}
	app_dirs_verify_data_dir ();
	app_dirs_verify_cache_dir ();
	international_support_init (RESOURCES_APP_GETTEXT_PACKAGE, args, (gint) args_length1, INTERNATIONAL_SUPPORT_SYSTEM_LOCALE);
	_tmp62_ = g_timer_new ();
	_g_timer_destroy0 (startup_timer);
	startup_timer = _tmp62_;
	_tmp63_ = startup_timer;
	g_timer_start (_tmp63_);
	g_set_application_name (RESOURCES_APP_TITLE);
	g_set_prgname ("org.gnome.Shotwell");
	resources_init ();
	_tmp64_ = filename;
	if (is_string_empty (_tmp64_)) {
		gchar** _tmp65_;
		gint _tmp65__length1;
		_tmp65_ = mounts;
		_tmp65__length1 = mounts_length1;
		library_exec (_tmp65_, (gint) _tmp65__length1);
	} else {
		const gchar* _tmp66_;
		_tmp66_ = filename;
		editing_exec (_tmp66_, commandline_options_fullscreen);
	}
	resources_terminate ();
	application_terminate ();
	debug_terminate ();
	app_dirs_terminate ();
	_tmp68_ = filename;
	if (is_string_empty (_tmp68_)) {
		_tmp67_ = !was_already_running;
	} else {
		_tmp67_ = FALSE;
	}
	if (_tmp67_) {
		gchar* orig_path = NULL;
		GFile* _tmp69_;
		GFile* _tmp70_;
		GFile* _tmp71_;
		GFile* _tmp72_;
		gchar* _tmp73_;
		gchar* _tmp74_;
		gchar* backup_path = NULL;
		const gchar* _tmp75_;
		gchar* _tmp76_;
		_tmp69_ = app_dirs_get_data_subdir ("data", NULL);
		_tmp70_ = _tmp69_;
		_tmp71_ = g_file_get_child (_tmp70_, "photo.db");
		_tmp72_ = _tmp71_;
		_tmp73_ = g_file_get_path (_tmp72_);
		_tmp74_ = _tmp73_;
		_g_object_unref0 (_tmp72_);
		_g_object_unref0 (_tmp70_);
		orig_path = _tmp74_;
		_tmp75_ = orig_path;
		_tmp76_ = g_strconcat (_tmp75_, ".bak", NULL);
		backup_path = _tmp76_;
		{
			GFile* src = NULL;
			const gchar* _tmp77_;
			GFile* _tmp78_;
			GFile* dest = NULL;
			const gchar* _tmp79_;
			GFile* _tmp80_;
			GFile* _tmp81_;
			GFile* _tmp82_;
			_tmp77_ = orig_path;
			_tmp78_ = g_file_new_for_commandline_arg (_tmp77_);
			src = _tmp78_;
			_tmp79_ = backup_path;
			_tmp80_ = g_file_new_for_commandline_arg (_tmp79_);
			dest = _tmp80_;
			_tmp81_ = src;
			_tmp82_ = dest;
			g_file_copy (_tmp81_, _tmp82_, G_FILE_COPY_OVERWRITE | G_FILE_COPY_ALL_METADATA, NULL, NULL, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_object_unref0 (dest);
				_g_object_unref0 (src);
				goto __catch2_g_error;
			}
			_g_object_unref0 (dest);
			_g_object_unref0 (src);
		}
		goto __finally2;
		__catch2_g_error:
		{
			GError* _error_ = NULL;
			GError* _tmp83_;
			const gchar* _tmp84_;
			_error_ = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp83_ = _error_;
			_tmp84_ = _tmp83_->message;
			g_warning ("main.vala:638: Failed to create backup file of database: %s", _tmp84_);
			_g_error_free0 (_error_);
		}
		__finally2:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (backup_path);
			_g_free0 (orig_path);
			_g_free0 (filename);
			mounts = (_vala_array_free (mounts, mounts_length1, (GDestroyNotify) g_free), NULL);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
		sync ();
		_g_free0 (backup_path);
		_g_free0 (orig_path);
	}
	_g_free0 (filename);
	mounts = (_vala_array_free (mounts, mounts_length1, (GDestroyNotify) g_free), NULL);
}

int
main (int argc,
      char ** argv)
{
	_vala_main (argv, argc);
	return 0;
}

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

