/* ImportPage.c generated by valac 0.56.19, the Vala compiler
 * generated from ImportPage.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 <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gphoto2/gphoto2-camera.h>
#include <shotwell-gphoto-helper.h>
#include <gphoto2/gphoto2-result.h>
#include <gphoto2/gphoto2-port-result.h>
#include <float.h>
#include <math.h>
#include <gphoto2/gphoto2-context.h>
#include "metadata.h"
#include <cairo-gobject.h>
#include <gdk/gdk.h>
#include <pango/pango.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <gphoto2/gphoto2-list.h>
#include <gphoto2/gphoto2-filesys.h>

#define DATA_OBJECT_INVALID_OBJECT_ID ((gint64) -1)
#define PHOTO_IMPORT_SOURCE_INTERP GDK_INTERP_BILINEAR
#define IMPORT_PREVIEW_MAX_SCALE 128
#define IMPORT_PAGE_UNMOUNT_FAILED_MSG _ ("Unable to unmount camera. Try unmounting the camera from the file mana" \
"ger.")
#define CHECKERBOARD_ITEM_PROP_SHOW_SUBTITLES "show-subtitles"
#define RESOURCES_IMPORT "image-x-generic-symbolic"
#define RESOURCES_IMPORT_ALL "filter-photos-symbolic"
#define RESOURCES_APP_TITLE "Shotwell"
#define RESOURCES_DELETE_LABEL _ ("_Delete")
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_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;
typedef struct _DataCollectionPrivate DataCollectionPrivate;

#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_ALTERATION (alteration_get_type ())
#define ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALTERATION, Alteration))
#define ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALTERATION, AlterationClass))
#define IS_ALTERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALTERATION))
#define IS_ALTERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALTERATION))
#define ALTERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALTERATION, AlterationClass))

typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;
typedef gint64 (*Comparator) (void* a, void* b, gpointer user_data);
typedef gboolean (*ComparatorPredicate) (DataObject* object, Alteration* alteration, gpointer user_data);
typedef gboolean (*ProgressMonitor) (guint64 current, guint64 total, gboolean do_event_loop, gpointer user_data);

#define TYPE_MARKER (marker_get_type ())
#define MARKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MARKER, Marker))
#define IS_MARKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MARKER))
#define MARKER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MARKER, MarkerIface))

typedef struct _Marker Marker;
typedef struct _MarkerIface MarkerIface;

#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;
typedef struct _SourceCollectionPrivate SourceCollectionPrivate;

#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_SOURCE_BACKLINK (source_backlink_get_type ())
#define SOURCE_BACKLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_BACKLINK, SourceBacklink))
#define SOURCE_BACKLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_BACKLINK, SourceBacklinkClass))
#define IS_SOURCE_BACKLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_BACKLINK))
#define IS_SOURCE_BACKLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_BACKLINK))
#define SOURCE_BACKLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_BACKLINK, SourceBacklinkClass))

typedef struct _SourceBacklink SourceBacklink;
typedef struct _SourceBacklinkClass SourceBacklinkClass;

#define TYPE_IMPORT_SOURCE_COLLECTION (import_source_collection_get_type ())
#define IMPORT_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IMPORT_SOURCE_COLLECTION, ImportSourceCollection))
#define IMPORT_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMPORT_SOURCE_COLLECTION, ImportSourceCollectionClass))
#define IS_IMPORT_SOURCE_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IMPORT_SOURCE_COLLECTION))
#define IS_IMPORT_SOURCE_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IMPORT_SOURCE_COLLECTION))
#define IMPORT_SOURCE_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IMPORT_SOURCE_COLLECTION, ImportSourceCollectionClass))

typedef struct _ImportSourceCollection ImportSourceCollection;
typedef struct _ImportSourceCollectionClass ImportSourceCollectionClass;
typedef struct _ImportSourceCollectionPrivate ImportSourceCollectionPrivate;

#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_IMPORT_SOURCE (import_source_get_type ())
#define IMPORT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IMPORT_SOURCE, ImportSource))
#define IMPORT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMPORT_SOURCE, ImportSourceClass))
#define IS_IMPORT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IMPORT_SOURCE))
#define IS_IMPORT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IMPORT_SOURCE))
#define IMPORT_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IMPORT_SOURCE, ImportSourceClass))

typedef struct _ImportSource ImportSource;
typedef struct _ImportSourceClass ImportSourceClass;
typedef struct _DataObjectPrivate DataObjectPrivate;
typedef struct _DataSourcePrivate DataSourcePrivate;

#define TYPE_SOURCE_HOLDING_TANK (source_holding_tank_get_type ())
#define SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTank))
#define SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTankClass))
#define IS_SOURCE_HOLDING_TANK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_HOLDING_TANK))
#define IS_SOURCE_HOLDING_TANK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_HOLDING_TANK))
#define SOURCE_HOLDING_TANK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_HOLDING_TANK, SourceHoldingTankClass))

typedef struct _SourceHoldingTank SourceHoldingTank;
typedef struct _SourceHoldingTankClass SourceHoldingTankClass;

#define TYPE_SOURCE_SNAPSHOT (source_snapshot_get_type ())
#define SOURCE_SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOURCE_SNAPSHOT, SourceSnapshot))
#define SOURCE_SNAPSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOURCE_SNAPSHOT, SourceSnapshotClass))
#define IS_SOURCE_SNAPSHOT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOURCE_SNAPSHOT))
#define IS_SOURCE_SNAPSHOT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOURCE_SNAPSHOT))
#define SOURCE_SNAPSHOT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOURCE_SNAPSHOT, SourceSnapshotClass))

typedef struct _SourceSnapshot SourceSnapshot;
typedef struct _SourceSnapshotClass SourceSnapshotClass;
typedef struct _ThumbnailSourcePrivate ThumbnailSourcePrivate;
typedef enum  {
	PHOTO_FILE_FORMAT_JFIF,
	PHOTO_FILE_FORMAT_RAW,
	PHOTO_FILE_FORMAT_PNG,
	PHOTO_FILE_FORMAT_TIFF,
	PHOTO_FILE_FORMAT_BMP,
	PHOTO_FILE_FORMAT_GIF,
	PHOTO_FILE_FORMAT_WEBP,
	PHOTO_FILE_FORMAT_AVIF,
	PHOTO_FILE_FORMAT_HEIF,
	PHOTO_FILE_FORMAT_JPEGXL,
	PHOTO_FILE_FORMAT_UNKNOWN
} PhotoFileFormat;

#define TYPE_PHOTO_FILE_FORMAT (photo_file_format_get_type ())

#define TYPE_INDEXABLE (indexable_get_type ())
#define INDEXABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_INDEXABLE, Indexable))
#define IS_INDEXABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_INDEXABLE))
#define INDEXABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_INDEXABLE, IndexableIface))

typedef struct _Indexable Indexable;
typedef struct _IndexableIface IndexableIface;
typedef struct _ImportSourcePrivate ImportSourcePrivate;
enum  {
	IMPORT_SOURCE_0_PROPERTY,
	IMPORT_SOURCE_NUM_PROPERTIES
};
static GParamSpec* import_source_properties[IMPORT_SOURCE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _gp_camera_unref0(var) ((var == NULL) ? NULL : (var = (gp_camera_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GP_TYPE_CONTEXT_WRAPPER (gp_context_wrapper_get_type ())
#define GP_CONTEXT_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper))
#define GP_CONTEXT_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GP_TYPE_CONTEXT_WRAPPER, GPContextWrapperClass))
#define GP_IS_CONTEXT_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GP_TYPE_CONTEXT_WRAPPER))
#define GP_IS_CONTEXT_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GP_TYPE_CONTEXT_WRAPPER))
#define GP_CONTEXT_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GP_TYPE_CONTEXT_WRAPPER, GPContextWrapperClass))

typedef struct _GPContextWrapper GPContextWrapper;
typedef struct _GPContextWrapperClass GPContextWrapperClass;

#define GP_TYPE_SPIN_IDLE_WRAPPER (gp_spin_idle_wrapper_get_type ())
#define GP_SPIN_IDLE_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GP_TYPE_SPIN_IDLE_WRAPPER, GPSpinIdleWrapper))
#define GP_SPIN_IDLE_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GP_TYPE_SPIN_IDLE_WRAPPER, GPSpinIdleWrapperClass))
#define GP_IS_SPIN_IDLE_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GP_TYPE_SPIN_IDLE_WRAPPER))
#define GP_IS_SPIN_IDLE_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GP_TYPE_SPIN_IDLE_WRAPPER))
#define GP_SPIN_IDLE_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GP_TYPE_SPIN_IDLE_WRAPPER, GPSpinIdleWrapperClass))

typedef struct _GPSpinIdleWrapper GPSpinIdleWrapper;
typedef struct _GPSpinIdleWrapperClass GPSpinIdleWrapperClass;
typedef struct _GPContextWrapperPrivate GPContextWrapperPrivate;

#define TYPE_VIDEO_IMPORT_SOURCE (video_import_source_get_type ())
#define VIDEO_IMPORT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO_IMPORT_SOURCE, VideoImportSource))
#define VIDEO_IMPORT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO_IMPORT_SOURCE, VideoImportSourceClass))
#define IS_VIDEO_IMPORT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO_IMPORT_SOURCE))
#define IS_VIDEO_IMPORT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO_IMPORT_SOURCE))
#define VIDEO_IMPORT_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO_IMPORT_SOURCE, VideoImportSourceClass))

typedef struct _VideoImportSource VideoImportSource;
typedef struct _VideoImportSourceClass VideoImportSourceClass;
typedef struct _VideoImportSourcePrivate VideoImportSourcePrivate;
enum  {
	VIDEO_IMPORT_SOURCE_0_PROPERTY,
	VIDEO_IMPORT_SOURCE_NUM_PROPERTIES
};
static GParamSpec* video_import_source_properties[VIDEO_IMPORT_SOURCE_NUM_PROPERTIES];

#define TYPE_PHOTO_IMPORT_SOURCE (photo_import_source_get_type ())
#define PHOTO_IMPORT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource))
#define PHOTO_IMPORT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSourceClass))
#define IS_PHOTO_IMPORT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_IMPORT_SOURCE))
#define IS_PHOTO_IMPORT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_IMPORT_SOURCE))
#define PHOTO_IMPORT_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSourceClass))

typedef struct _PhotoImportSource PhotoImportSource;
typedef struct _PhotoImportSourceClass PhotoImportSourceClass;
typedef struct _PhotoImportSourcePrivate PhotoImportSourcePrivate;

#define TYPE_PHOTO_METADATA (photo_metadata_get_type ())
#define PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHOTO_METADATA, PhotoMetadata))
#define PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHOTO_METADATA, PhotoMetadataClass))
#define IS_PHOTO_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHOTO_METADATA))
#define IS_PHOTO_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHOTO_METADATA))
#define PHOTO_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHOTO_METADATA, PhotoMetadataClass))

typedef struct _PhotoMetadata PhotoMetadata;
typedef struct _PhotoMetadataClass PhotoMetadataClass;
enum  {
	PHOTO_IMPORT_SOURCE_0_PROPERTY,
	PHOTO_IMPORT_SOURCE_NUM_PROPERTIES
};
static GParamSpec* photo_import_source_properties[PHOTO_IMPORT_SOURCE_NUM_PROPERTIES];
#define _media_metadata_unref0(var) ((var == NULL) ? NULL : (var = (media_metadata_unref (var), NULL)))
#define _metadata_date_time_unref0(var) ((var == NULL) ? NULL : (var = (metadata_date_time_unref (var), NULL)))

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

typedef struct _DataView DataView;
typedef struct _DataViewClass DataViewClass;
typedef struct _DataViewPrivate DataViewPrivate;

#define TYPE_THUMBNAIL_VIEW (thumbnail_view_get_type ())
#define THUMBNAIL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_VIEW, ThumbnailView))
#define THUMBNAIL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_VIEW, ThumbnailViewClass))
#define IS_THUMBNAIL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_VIEW))
#define IS_THUMBNAIL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_VIEW))
#define THUMBNAIL_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_VIEW, ThumbnailViewClass))

typedef struct _ThumbnailView ThumbnailView;
typedef struct _ThumbnailViewClass ThumbnailViewClass;
typedef struct _ThumbnailViewPrivate ThumbnailViewPrivate;

#define TYPE_CHECKERBOARD_ITEM (checkerboard_item_get_type ())
#define CHECKERBOARD_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CHECKERBOARD_ITEM, CheckerboardItem))
#define CHECKERBOARD_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CHECKERBOARD_ITEM, CheckerboardItemClass))
#define IS_CHECKERBOARD_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CHECKERBOARD_ITEM))
#define IS_CHECKERBOARD_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CHECKERBOARD_ITEM))
#define CHECKERBOARD_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CHECKERBOARD_ITEM, CheckerboardItemClass))

typedef struct _CheckerboardItem CheckerboardItem;
typedef struct _CheckerboardItemClass CheckerboardItemClass;
typedef struct _CheckerboardItemPrivate CheckerboardItemPrivate;

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

#define TYPE_MEDIA_SOURCE_ITEM (media_source_item_get_type ())
#define MEDIA_SOURCE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem))
#define MEDIA_SOURCE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_SOURCE_ITEM, MediaSourceItemClass))
#define IS_MEDIA_SOURCE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_SOURCE_ITEM))
#define IS_MEDIA_SOURCE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_SOURCE_ITEM))
#define MEDIA_SOURCE_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_SOURCE_ITEM, MediaSourceItemClass))

typedef struct _MediaSourceItem MediaSourceItem;
typedef struct _MediaSourceItemClass MediaSourceItemClass;
typedef struct _MediaSourceItemPrivate MediaSourceItemPrivate;

#define TYPE_IMPORT_PREVIEW (import_preview_get_type ())
#define IMPORT_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_IMPORT_PREVIEW, ImportPreview))
#define IMPORT_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_IMPORT_PREVIEW, ImportPreviewClass))
#define IS_IMPORT_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_IMPORT_PREVIEW))
#define IS_IMPORT_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_IMPORT_PREVIEW))
#define IMPORT_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_IMPORT_PREVIEW, ImportPreviewClass))

typedef struct _ImportPreview ImportPreview;
typedef struct _ImportPreviewClass ImportPreviewClass;
typedef struct _ImportPreviewPrivate ImportPreviewPrivate;

#define TYPE_DUPLICATED_FILE (duplicated_file_get_type ())
#define DUPLICATED_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DUPLICATED_FILE, DuplicatedFile))
#define DUPLICATED_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DUPLICATED_FILE, DuplicatedFileClass))
#define IS_DUPLICATED_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DUPLICATED_FILE))
#define IS_DUPLICATED_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DUPLICATED_FILE))
#define DUPLICATED_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DUPLICATED_FILE, DuplicatedFileClass))

typedef struct _DuplicatedFile DuplicatedFile;
typedef struct _DuplicatedFileClass DuplicatedFileClass;
enum  {
	IMPORT_PREVIEW_0_PROPERTY,
	IMPORT_PREVIEW_NUM_PROPERTIES
};
static GParamSpec* import_preview_properties[IMPORT_PREVIEW_NUM_PROPERTIES];
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef enum  {
	ORIENTATION_MIN = 1,
	ORIENTATION_TOP_LEFT = 1,
	ORIENTATION_TOP_RIGHT = 2,
	ORIENTATION_BOTTOM_RIGHT = 3,
	ORIENTATION_BOTTOM_LEFT = 4,
	ORIENTATION_LEFT_TOP = 5,
	ORIENTATION_RIGHT_TOP = 6,
	ORIENTATION_RIGHT_BOTTOM = 7,
	ORIENTATION_LEFT_BOTTOM = 8,
	ORIENTATION_MAX = 8
} Orientation;

#define TYPE_ORIENTATION (orientation_get_type ())

#define TYPE_PHOTO_ID (photo_id_get_type ())
typedef struct _PhotoID PhotoID;

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

typedef struct _PhotoSource PhotoSource;
typedef struct _PhotoSourceClass PhotoSourceClass;

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

typedef struct _Photo Photo;
typedef struct _PhotoClass PhotoClass;

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

typedef struct _LibraryPhoto LibraryPhoto;
typedef struct _LibraryPhotoClass LibraryPhotoClass;

#define TYPE_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_VIDEO_ID (video_id_get_type ())
typedef struct _VideoID VideoID;

#define CORE_TYPE_TRACKER (core_tracker_get_type ())
#define CORE_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CORE_TYPE_TRACKER, CoreTracker))
#define CORE_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CORE_TYPE_TRACKER, CoreTrackerClass))
#define CORE_IS_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CORE_TYPE_TRACKER))
#define CORE_IS_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CORE_TYPE_TRACKER))
#define CORE_TRACKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CORE_TYPE_TRACKER, CoreTrackerClass))

typedef struct _CoreTracker CoreTracker;
typedef struct _CoreTrackerClass CoreTrackerClass;
typedef struct _CoreTrackerPrivate CoreTrackerPrivate;

#define CORE_TYPE_VIEW_TRACKER (core_view_tracker_get_type ())
#define CORE_VIEW_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CORE_TYPE_VIEW_TRACKER, CoreViewTracker))
#define CORE_VIEW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CORE_TYPE_VIEW_TRACKER, CoreViewTrackerClass))
#define CORE_IS_VIEW_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CORE_TYPE_VIEW_TRACKER))
#define CORE_IS_VIEW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CORE_TYPE_VIEW_TRACKER))
#define CORE_VIEW_TRACKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CORE_TYPE_VIEW_TRACKER, CoreViewTrackerClass))

typedef struct _CoreViewTracker CoreViewTracker;
typedef struct _CoreViewTrackerClass CoreViewTrackerClass;
typedef struct _CoreViewTrackerPrivate CoreViewTrackerPrivate;

#define TYPE_CAMERA_VIEW_TRACKER (camera_view_tracker_get_type ())
#define CAMERA_VIEW_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CAMERA_VIEW_TRACKER, CameraViewTracker))
#define CAMERA_VIEW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CAMERA_VIEW_TRACKER, CameraViewTrackerClass))
#define IS_CAMERA_VIEW_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CAMERA_VIEW_TRACKER))
#define IS_CAMERA_VIEW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CAMERA_VIEW_TRACKER))
#define CAMERA_VIEW_TRACKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CAMERA_VIEW_TRACKER, CameraViewTrackerClass))

typedef struct _CameraViewTracker CameraViewTracker;
typedef struct _CameraViewTrackerClass CameraViewTrackerClass;
typedef struct _CameraViewTrackerPrivate CameraViewTrackerPrivate;

#define TYPE_CAMERA_ACCUMULATOR (camera_accumulator_get_type ())
#define CAMERA_ACCUMULATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CAMERA_ACCUMULATOR, CameraAccumulator))
#define CAMERA_ACCUMULATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CAMERA_ACCUMULATOR, CameraAccumulatorClass))
#define IS_CAMERA_ACCUMULATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CAMERA_ACCUMULATOR))
#define IS_CAMERA_ACCUMULATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CAMERA_ACCUMULATOR))
#define CAMERA_ACCUMULATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CAMERA_ACCUMULATOR, CameraAccumulatorClass))

typedef struct _CameraAccumulator CameraAccumulator;
typedef struct _CameraAccumulatorClass CameraAccumulatorClass;

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

typedef struct _ViewCollection ViewCollection;
typedef struct _ViewCollectionClass ViewCollectionClass;

#define CORE_TYPE_TRACKER_ACCUMULATOR (core_tracker_accumulator_get_type ())
#define CORE_TRACKER_ACCUMULATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CORE_TYPE_TRACKER_ACCUMULATOR, CoreTrackerAccumulator))
#define CORE_IS_TRACKER_ACCUMULATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CORE_TYPE_TRACKER_ACCUMULATOR))
#define CORE_TRACKER_ACCUMULATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CORE_TYPE_TRACKER_ACCUMULATOR, CoreTrackerAccumulatorIface))

typedef struct _CoreTrackerAccumulator CoreTrackerAccumulator;
typedef struct _CoreTrackerAccumulatorIface CoreTrackerAccumulatorIface;
typedef struct _CameraAccumulatorPrivate CameraAccumulatorPrivate;
enum  {
	CAMERA_ACCUMULATOR_0_PROPERTY,
	CAMERA_ACCUMULATOR_TOTAL_PROPERTY,
	CAMERA_ACCUMULATOR_PHOTOS_PROPERTY,
	CAMERA_ACCUMULATOR_VIDEOS_PROPERTY,
	CAMERA_ACCUMULATOR_RAW_PROPERTY,
	CAMERA_ACCUMULATOR_NUM_PROPERTIES
};
static GParamSpec* camera_accumulator_properties[CAMERA_ACCUMULATOR_NUM_PROPERTIES];

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

typedef struct _Page Page;
typedef struct _PageClass PageClass;
typedef struct _PagePrivate PagePrivate;

#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_FULLSCREEN_WINDOW (fullscreen_window_get_type ())
#define FULLSCREEN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FULLSCREEN_WINDOW, FullscreenWindow))
#define FULLSCREEN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FULLSCREEN_WINDOW, FullscreenWindowClass))
#define IS_FULLSCREEN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FULLSCREEN_WINDOW))
#define IS_FULLSCREEN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FULLSCREEN_WINDOW))
#define FULLSCREEN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FULLSCREEN_WINDOW, FullscreenWindowClass))

typedef struct _FullscreenWindow FullscreenWindow;
typedef struct _FullscreenWindowClass FullscreenWindowClass;

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

typedef struct _InjectionGroup InjectionGroup;
typedef struct _InjectionGroupClass InjectionGroupClass;

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

typedef struct _CheckerboardPage CheckerboardPage;
typedef struct _CheckerboardPageClass CheckerboardPageClass;
typedef struct _CheckerboardPagePrivate CheckerboardPagePrivate;
typedef enum  {
	CHECKERBOARD_PAGE_ACTIVATOR_KEYBOARD,
	CHECKERBOARD_PAGE_ACTIVATOR_MOUSE
} CheckerboardPageActivator;

#define CHECKERBOARD_PAGE_TYPE_ACTIVATOR (checkerboard_page_activator_get_type ())

#define CHECKERBOARD_PAGE_TYPE_KEYBOARD_MODIFIERS (checkerboard_page_keyboard_modifiers_get_type ())
typedef struct _CheckerboardPageKeyboardModifiers CheckerboardPageKeyboardModifiers;

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

typedef struct _ViewFilter ViewFilter;
typedef struct _ViewFilterClass ViewFilterClass;

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

typedef struct _SearchViewFilter SearchViewFilter;
typedef struct _SearchViewFilterClass SearchViewFilterClass;

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

typedef struct _ImportPage ImportPage;
typedef struct _ImportPageClass ImportPageClass;
typedef struct _ImportPagePrivate ImportPagePrivate;

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

typedef struct _DiscoveredCamera DiscoveredCamera;
typedef struct _DiscoveredCameraClass DiscoveredCameraClass;

#define IMPORT_PAGE_TYPE_IMPORT_PAGE_SEARCH_VIEW_FILTER (import_page_import_page_search_view_filter_get_type ())
#define IMPORT_PAGE_IMPORT_PAGE_SEARCH_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IMPORT_PAGE_TYPE_IMPORT_PAGE_SEARCH_VIEW_FILTER, ImportPageImportPageSearchViewFilter))
#define IMPORT_PAGE_IMPORT_PAGE_SEARCH_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IMPORT_PAGE_TYPE_IMPORT_PAGE_SEARCH_VIEW_FILTER, ImportPageImportPageSearchViewFilterClass))
#define IMPORT_PAGE_IS_IMPORT_PAGE_SEARCH_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IMPORT_PAGE_TYPE_IMPORT_PAGE_SEARCH_VIEW_FILTER))
#define IMPORT_PAGE_IS_IMPORT_PAGE_SEARCH_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IMPORT_PAGE_TYPE_IMPORT_PAGE_SEARCH_VIEW_FILTER))
#define IMPORT_PAGE_IMPORT_PAGE_SEARCH_VIEW_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IMPORT_PAGE_TYPE_IMPORT_PAGE_SEARCH_VIEW_FILTER, ImportPageImportPageSearchViewFilterClass))

typedef struct _ImportPageImportPageSearchViewFilter ImportPageImportPageSearchViewFilter;
typedef struct _ImportPageImportPageSearchViewFilterClass ImportPageImportPageSearchViewFilterClass;

#define IMPORT_PAGE_TYPE_HIDE_IMPORTED_VIEW_FILTER (import_page_hide_imported_view_filter_get_type ())
#define IMPORT_PAGE_HIDE_IMPORTED_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IMPORT_PAGE_TYPE_HIDE_IMPORTED_VIEW_FILTER, ImportPageHideImportedViewFilter))
#define IMPORT_PAGE_HIDE_IMPORTED_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IMPORT_PAGE_TYPE_HIDE_IMPORTED_VIEW_FILTER, ImportPageHideImportedViewFilterClass))
#define IMPORT_PAGE_IS_HIDE_IMPORTED_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IMPORT_PAGE_TYPE_HIDE_IMPORTED_VIEW_FILTER))
#define IMPORT_PAGE_IS_HIDE_IMPORTED_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IMPORT_PAGE_TYPE_HIDE_IMPORTED_VIEW_FILTER))
#define IMPORT_PAGE_HIDE_IMPORTED_VIEW_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IMPORT_PAGE_TYPE_HIDE_IMPORTED_VIEW_FILTER, ImportPageHideImportedViewFilterClass))

typedef struct _ImportPageHideImportedViewFilter ImportPageHideImportedViewFilter;
typedef struct _ImportPageHideImportedViewFilterClass ImportPageHideImportedViewFilterClass;
enum  {
	IMPORT_PAGE_0_PROPERTY,
	IMPORT_PAGE_NUM_PROPERTIES
};
static GParamSpec* import_page_properties[IMPORT_PAGE_NUM_PROPERTIES];
typedef enum  {
	IMPORT_PAGE_REFRESH_RESULT_OK,
	IMPORT_PAGE_REFRESH_RESULT_BUSY,
	IMPORT_PAGE_REFRESH_RESULT_LOCKED,
	IMPORT_PAGE_REFRESH_RESULT_LIBRARY_ERROR
} ImportPageRefreshResult;

#define IMPORT_PAGE_TYPE_REFRESH_RESULT (import_page_refresh_result_get_type ())
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);
typedef void (*GSimpleActionChangeStateCallback) (GSimpleAction* action, GVariant* value, gpointer user_data);
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
#define _discovered_camera_unref0(var) ((var == NULL) ? NULL : (var = (discovered_camera_unref (var), NULL)))
#define _view_filter_unref0(var) ((var == NULL) ? NULL : (var = (view_filter_unref (var), NULL)))
#define _core_tracker_unref0(var) ((var == NULL) ? NULL : (var = (core_tracker_unref (var), NULL)))
typedef struct _DiscoveredCameraPrivate DiscoveredCameraPrivate;
#define _gp_context_wrapper_unref0(var) ((var == NULL) ? NULL : (var = (gp_context_wrapper_unref (var), NULL)))

#define TYPE_VIEW_MANAGER (view_manager_get_type ())
#define VIEW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIEW_MANAGER, ViewManager))
#define VIEW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIEW_MANAGER, ViewManagerClass))
#define IS_VIEW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIEW_MANAGER))
#define IS_VIEW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIEW_MANAGER))
#define VIEW_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIEW_MANAGER, ViewManagerClass))

typedef struct _ViewManager ViewManager;
typedef struct _ViewManagerClass ViewManagerClass;

#define VIEW_COLLECTION_TYPE_MONITOR (view_collection_monitor_get_type ())
#define VIEW_COLLECTION_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VIEW_COLLECTION_TYPE_MONITOR, ViewCollectionMonitor))
#define VIEW_COLLECTION_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VIEW_COLLECTION_TYPE_MONITOR, ViewCollectionMonitorClass))
#define VIEW_COLLECTION_IS_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VIEW_COLLECTION_TYPE_MONITOR))
#define VIEW_COLLECTION_IS_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VIEW_COLLECTION_TYPE_MONITOR))
#define VIEW_COLLECTION_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VIEW_COLLECTION_TYPE_MONITOR, ViewCollectionMonitorClass))

typedef struct _ViewCollectionMonitor ViewCollectionMonitor;
typedef struct _ViewCollectionMonitorClass ViewCollectionMonitorClass;

#define IMPORT_PAGE_TYPE_IMPORT_VIEW_MANAGER (import_page_import_view_manager_get_type ())
#define IMPORT_PAGE_IMPORT_VIEW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IMPORT_PAGE_TYPE_IMPORT_VIEW_MANAGER, ImportPageImportViewManager))
#define IMPORT_PAGE_IMPORT_VIEW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IMPORT_PAGE_TYPE_IMPORT_VIEW_MANAGER, ImportPageImportViewManagerClass))
#define IMPORT_PAGE_IS_IMPORT_VIEW_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IMPORT_PAGE_TYPE_IMPORT_VIEW_MANAGER))
#define IMPORT_PAGE_IS_IMPORT_VIEW_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IMPORT_PAGE_TYPE_IMPORT_VIEW_MANAGER))
#define IMPORT_PAGE_IMPORT_VIEW_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IMPORT_PAGE_TYPE_IMPORT_VIEW_MANAGER, ImportPageImportViewManagerClass))

typedef struct _ImportPageImportViewManager ImportPageImportViewManager;
typedef struct _ImportPageImportViewManagerClass ImportPageImportViewManagerClass;
#define _view_collection_monitor_unref0(var) ((var == NULL) ? NULL : (var = (view_collection_monitor_unref (var), NULL)))
#define _view_manager_unref0(var) ((var == NULL) ? NULL : (var = (view_manager_unref (var), NULL)))
typedef gboolean (*ValueEqualFunc) (GValue* a, GValue* b, gpointer user_data);

#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_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 IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB (import_page_camera_import_job_get_type ())
#define IMPORT_PAGE_CAMERA_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob))
#define IMPORT_PAGE_CAMERA_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJobClass))
#define IMPORT_PAGE_IS_CAMERA_IMPORT_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB))
#define IMPORT_PAGE_IS_CAMERA_IMPORT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB))
#define IMPORT_PAGE_CAMERA_IMPORT_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJobClass))

typedef struct _ImportPageCameraImportJob ImportPageCameraImportJob;
typedef struct _ImportPageCameraImportJobClass ImportPageCameraImportJobClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

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

#define TYPE_SORTED_LIST (sorted_list_get_type ())
#define SORTED_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SORTED_LIST, SortedList))
#define SORTED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SORTED_LIST, SortedListClass))
#define IS_SORTED_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SORTED_LIST))
#define IS_SORTED_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SORTED_LIST))
#define SORTED_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SORTED_LIST, SortedListClass))

typedef struct _SortedList SortedList;
typedef struct _SortedListClass SortedListClass;
#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_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 TYPE_BATCH_IMPORT_ROLL (batch_import_roll_get_type ())
#define BATCH_IMPORT_ROLL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BATCH_IMPORT_ROLL, BatchImportRoll))
#define BATCH_IMPORT_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BATCH_IMPORT_ROLL, BatchImportRollClass))
#define IS_BATCH_IMPORT_ROLL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BATCH_IMPORT_ROLL))
#define IS_BATCH_IMPORT_ROLL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BATCH_IMPORT_ROLL))
#define BATCH_IMPORT_ROLL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BATCH_IMPORT_ROLL, BatchImportRollClass))

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

#define 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 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 _import_manifest_unref0(var) ((var == NULL) ? NULL : (var = (import_manifest_unref (var), NULL)))
typedef struct _BatchImportResultPrivate BatchImportResultPrivate;
typedef enum  {
	IMPORT_RESULT_SUCCESS,
	IMPORT_RESULT_FILE_ERROR,
	IMPORT_RESULT_DECODE_ERROR,
	IMPORT_RESULT_DATABASE_ERROR,
	IMPORT_RESULT_USER_ABORT,
	IMPORT_RESULT_NOT_A_FILE,
	IMPORT_RESULT_PHOTO_EXISTS,
	IMPORT_RESULT_UNSUPPORTED_FORMAT,
	IMPORT_RESULT_NOT_AN_IMAGE,
	IMPORT_RESULT_DISK_FAILURE,
	IMPORT_RESULT_DISK_FULL,
	IMPORT_RESULT_CAMERA_ERROR,
	IMPORT_RESULT_FILE_WRITE_ERROR,
	IMPORT_RESULT_PIXBUF_CORRUPT_IMAGE
} ImportResult;

#define TYPE_IMPORT_RESULT (import_result_get_type ())
typedef struct _ImportManifestPrivate ImportManifestPrivate;

#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 _import_ui_question_params_unref0(var) ((var == NULL) ? NULL : (var = (import_ui_question_params_unref (var), NULL)))
#define _batch_import_result_unref0(var) ((var == NULL) ? NULL : (var = (batch_import_result_unref (var), NULL)))

#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;
typedef struct _ViewManagerPrivate ViewManagerPrivate;
typedef struct _ImportPageImportViewManagerPrivate ImportPageImportViewManagerPrivate;
typedef struct _BatchImportJobPrivate BatchImportJobPrivate;
typedef struct _ImportPageCameraImportJobPrivate ImportPageCameraImportJobPrivate;

#define TYPE_BACKING_PHOTO_ROW (backing_photo_row_get_type ())
#define BACKING_PHOTO_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKING_PHOTO_ROW, BackingPhotoRow))
#define BACKING_PHOTO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKING_PHOTO_ROW, BackingPhotoRowClass))
#define IS_BACKING_PHOTO_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKING_PHOTO_ROW))
#define IS_BACKING_PHOTO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKING_PHOTO_ROW))
#define BACKING_PHOTO_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKING_PHOTO_ROW, BackingPhotoRowClass))

typedef struct _BackingPhotoRow BackingPhotoRow;
typedef struct _BackingPhotoRowClass BackingPhotoRowClass;
#define _backing_photo_row_unref0(var) ((var == NULL) ? NULL : (var = (backing_photo_row_unref (var), NULL)))
typedef enum  {
	RAW_DEVELOPER_SHOTWELL = 0,
	RAW_DEVELOPER_CAMERA,
	RAW_DEVELOPER_EMBEDDED
} RawDeveloper;

#define TYPE_RAW_DEVELOPER (raw_developer_get_type ())
typedef struct _BackingPhotoRowPrivate BackingPhotoRowPrivate;

#define TYPE_BACKING_PHOTO_ID (backing_photo_id_get_type ())
typedef struct _BackingPhotoID BackingPhotoID;
typedef struct _ViewFilterPrivate ViewFilterPrivate;
typedef struct _SearchViewFilterPrivate SearchViewFilterPrivate;
typedef struct _ImportPageImportPageSearchViewFilterPrivate ImportPageImportPageSearchViewFilterPrivate;
typedef enum  {
	SEARCH_FILTER_CRITERIA_NONE = 0,
	SEARCH_FILTER_CRITERIA_RECURSIVE = 1 << 0,
	SEARCH_FILTER_CRITERIA_TEXT = 1 << 1,
	SEARCH_FILTER_CRITERIA_FLAG = 1 << 2,
	SEARCH_FILTER_CRITERIA_MEDIA = 1 << 3,
	SEARCH_FILTER_CRITERIA_RATING = 1 << 4,
	SEARCH_FILTER_CRITERIA_SAVEDSEARCH = 1 << 5,
	SEARCH_FILTER_CRITERIA_ALL = 0xFFFFFFFFLL
} SearchFilterCriteria;

#define TYPE_SEARCH_FILTER_CRITERIA (search_filter_criteria_get_type ())
typedef struct _ImportPageHideImportedViewFilterPrivate ImportPageHideImportedViewFilterPrivate;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _MarkerIface {
	GTypeInterface parent_iface;
	void (*mark) (Marker* self, DataObject* object);
	void (*unmark) (Marker* self, DataObject* object);
	gboolean (*toggle) (Marker* self, DataObject* object);
	void (*mark_many) (Marker* self, GeeCollection* list);
	void (*unmark_many) (Marker* self, GeeCollection* list);
	void (*mark_all) (Marker* self);
	gint (*get_count) (Marker* self);
	GeeCollection* (*get_all) (Marker* self);
};

struct _DataCollection {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DataCollectionPrivate * priv;
};

struct _DataCollectionClass {
	GTypeClass parent_class;
	void (*finalize) (DataCollection *self);
	gchar* (*to_string) (DataCollection* self);
	void (*notify_items_added) (DataCollection* self, GeeIterable* added);
	void (*notify_items_removed) (DataCollection* self, GeeIterable* removed);
	void (*notify_contents_altered) (DataCollection* self, GeeIterable* added, GeeIterable* removed);
	void (*notify_items_altered) (DataCollection* self, GeeMap* items);
	void (*notify_ordering_changed) (DataCollection* self);
	void (*notify_property_set) (DataCollection* self, const gchar* name, GValue* old, GValue* val);
	void (*notify_property_cleared) (DataCollection* self, const gchar* name);
	gboolean (*valid_type) (DataCollection* self, DataObject* object);
	void (*set_comparator) (DataCollection* self, Comparator comparator, gpointer comparator_target, ComparatorPredicate predicate, gpointer predicate_target);
	void (*reset_comparator) (DataCollection* self);
	GeeCollection* (*get_all) (DataCollection* self);
	gint (*get_count) (DataCollection* self);
	DataObject* (*get_at) (DataCollection* self, gint index);
	gint (*index_of) (DataCollection* self, DataObject* object);
	gboolean (*contains) (DataCollection* self, DataObject* object);
	gboolean (*add) (DataCollection* self, DataObject* object);
	GeeCollection* (*add_many) (DataCollection* self, GeeCollection* objects, ProgressMonitor monitor, gpointer monitor_target);
	void (*remove_marked) (DataCollection* self, Marker* m);
	void (*clear) (DataCollection* self);
	void (*close) (DataCollection* self);
	void (*notify_frozen) (DataCollection* self);
	void (*notify_thawed) (DataCollection* self);
	void (*items_added) (DataCollection* self, GeeIterable* added);
	void (*items_removed) (DataCollection* self, GeeIterable* removed);
	void (*contents_altered) (DataCollection* self, GeeIterable* added, GeeIterable* removed);
	void (*items_altered) (DataCollection* self, GeeMap* items);
	void (*ordering_changed) (DataCollection* self);
	void (*property_set) (DataCollection* self, const gchar* name, GValue* old, GValue* val);
	void (*property_cleared) (DataCollection* self, const gchar* name);
	void (*frozen) (DataCollection* self);
	void (*thawed) (DataCollection* self);
};

struct _SourceCollection {
	DataCollection parent_instance;
	SourceCollectionPrivate * priv;
};

struct _SourceCollectionClass {
	DataCollectionClass parent_class;
	gboolean (*holds_type_of_source) (SourceCollection* self, DataSource* source);
	void (*notify_items_unlinking) (SourceCollection* self, GeeCollection* unlinking);
	void (*notify_items_relinked) (SourceCollection* self, GeeCollection* relinked);
	void (*notify_item_destroyed) (SourceCollection* self, DataSource* source);
	void (*notify_items_destroyed) (SourceCollection* self, GeeCollection* destroyed);
	void (*notify_unlinked_destroyed) (SourceCollection* self, DataSource* unlinked);
	void (*notify_backlink_removed) (SourceCollection* self, SourceBacklink* backlink, GeeCollection* sources);
	gboolean (*has_backlink) (SourceCollection* self, SourceBacklink* backlink);
	void (*remove_backlink) (SourceCollection* self, SourceBacklink* backlink);
	void (*items_unlinking) (SourceCollection* self, GeeCollection* unlinking);
	void (*items_relinked) (SourceCollection* self, GeeCollection* relinked);
	void (*item_destroyed) (SourceCollection* self, DataSource* source);
	void (*items_destroyed) (SourceCollection* self, GeeCollection* destroyed);
	void (*unlinked_destroyed) (SourceCollection* self, DataSource* source);
	void (*backlink_removed) (SourceCollection* self, SourceBacklink* backlink, GeeCollection* sources);
};

struct _ImportSourceCollection {
	SourceCollection parent_instance;
	ImportSourceCollectionPrivate * priv;
};

struct _ImportSourceCollectionClass {
	SourceCollectionClass parent_class;
};

struct _DataObject {
	GObject parent_instance;
	DataObjectPrivate * priv;
};

struct _DataObjectClass {
	GObjectClass parent_class;
	void (*notify_altered) (DataObject* self, Alteration* alteration);
	void (*notify_membership_changed) (DataObject* self, DataCollection* collection);
	void (*notify_collection_property_set) (DataObject* self, const gchar* name, GValue* old, GValue* val);
	void (*notify_collection_property_cleared) (DataObject* self, const gchar* name);
	gchar* (*get_name) (DataObject* self);
	gchar* (*to_string) (DataObject* self);
};

struct _DataSource {
	DataObject parent_instance;
	DataSourcePrivate * priv;
};

struct _DataSourceClass {
	DataObjectClass parent_class;
	void (*notify_held_in_tank) (DataSource* self, SourceHoldingTank* holding_tank);
	void (*notify_unlinking) (DataSource* self, SourceCollection* collection);
	void (*notify_unlinked) (DataSource* self);
	void (*notify_relinking) (DataSource* self, SourceCollection* collection);
	void (*notify_relinked) (DataSource* self);
	gchar* (*get_typename) (DataSource* self);
	gint64 (*get_instance_id) (DataSource* self);
	gchar* (*get_source_id) (DataSource* self);
	void (*commit_backlinks) (DataSource* self, SourceCollection* sources, const gchar* dehydrated);
	SourceSnapshot* (*save_snapshot) (DataSource* self);
	gboolean (*internal_delete_backing) (DataSource* self, GError** error);
	gboolean (*equals) (DataSource* self, DataSource* source);
	void (*destroy) (DataSource* self);
	void (*unlinked) (DataSource* self, SourceCollection* sources);
	void (*relinked) (DataSource* self, SourceCollection* sources);
	void (*destroyed) (DataSource* self);
};

struct _ThumbnailSource {
	DataSource parent_instance;
	ThumbnailSourcePrivate * priv;
};

struct _ThumbnailSourceClass {
	DataSourceClass parent_class;
	void (*notify_thumbnail_altered) (ThumbnailSource* self);
	GdkPixbuf* (*get_thumbnail) (ThumbnailSource* self, gint scale, GError** error);
	GdkPixbuf* (*create_thumbnail) (ThumbnailSource* self, gint scale, GError** error);
	gchar* (*get_representative_id) (ThumbnailSource* self);
	PhotoFileFormat (*get_preferred_thumbnail_format) (ThumbnailSource* self);
	void (*thumbnail_altered) (ThumbnailSource* self);
};

struct _IndexableIface {
	GTypeInterface parent_iface;
	const gchar* (*get_indexable_keywords) (Indexable* self);
};

struct _ImportSource {
	ThumbnailSource parent_instance;
	ImportSourcePrivate * priv;
};

struct _ImportSourceClass {
	ThumbnailSourceClass parent_class;
	GdkPixbuf* (*get_preview) (ImportSource* self);
	GDateTime* (*get_exposure_time) (ImportSource* self);
};

struct _ImportSourcePrivate {
	gchar* camera_name;
	Camera* camera;
	gint fsid;
	gchar* folder;
	gchar* filename;
	gulong file_size;
	GDateTime* modification_time;
	GdkPixbuf* preview;
	gchar* indexable_keywords;
};

struct _GPContextWrapper {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GPContextWrapperPrivate * priv;
	GPContext* context;
};

struct _GPContextWrapperClass {
	GTypeClass parent_class;
	void (*finalize) (GPContextWrapper *self);
	void (*idle) (GPContextWrapper* self);
	void (*error) (GPContextWrapper* self, const gchar* text, void* data);
	void (*status) (GPContextWrapper* self, const gchar* text, void* data);
	void (*message) (GPContextWrapper* self, const gchar* text, void* data);
	void (*progress_start) (GPContextWrapper* self, gfloat current, const gchar* text, void* data);
	void (*progress_update) (GPContextWrapper* self, gfloat current, void* data);
	void (*progress_stop) (GPContextWrapper* self);
};

struct _VideoImportSource {
	ImportSource parent_instance;
	VideoImportSourcePrivate * priv;
};

struct _VideoImportSourceClass {
	ImportSourceClass parent_class;
};

struct _PhotoImportSource {
	ImportSource parent_instance;
	PhotoImportSourcePrivate * priv;
};

struct _PhotoImportSourceClass {
	ImportSourceClass parent_class;
};

struct _PhotoImportSourcePrivate {
	PhotoFileFormat file_format;
	gchar* preview_md5;
	PhotoMetadata* metadata;
	gchar* exif_md5;
	PhotoImportSource* associated;
};

struct _DataView {
	DataObject parent_instance;
	DataViewPrivate * priv;
};

struct _DataViewClass {
	DataObjectClass parent_class;
	void (*notify_view_altered) (DataView* self);
	void (*notify_geometry_altered) (DataView* self);
	void (*notify_unsubscribed) (DataView* self, DataSource* source);
	void (*state_changed) (DataView* self, gboolean selected);
	void (*visibility_changed) (DataView* self, gboolean visible);
	void (*view_altered) (DataView* self);
	void (*geometry_altered) (DataView* self);
	void (*unsubscribed) (DataView* self, DataSource* source);
};

struct _ThumbnailView {
	DataView parent_instance;
	ThumbnailViewPrivate * priv;
};

struct _ThumbnailViewClass {
	DataViewClass parent_class;
	void (*notify_thumbnail_altered) (ThumbnailView* self);
	void (*thumbnail_altered) (ThumbnailView* self);
};

struct _Dimensions {
	gint width;
	gint height;
};

struct _CheckerboardItem {
	ThumbnailView parent_instance;
	CheckerboardItemPrivate * priv;
	Dimensions requisition;
	GdkRectangle allocation;
};

struct _CheckerboardItemClass {
	ThumbnailViewClass parent_class;
	void (*handle_mouse_motion) (CheckerboardItem* self, gint x, gint y, gint height, gint width);
	void (*handle_mouse_leave) (CheckerboardItem* self);
	void (*handle_mouse_enter) (CheckerboardItem* self);
	void (*exposed) (CheckerboardItem* self);
	void (*unexposed) (CheckerboardItem* self);
	gboolean (*is_exposed) (CheckerboardItem* self);
	void (*paint_shadow) (CheckerboardItem* self, cairo_t* ctx, Dimensions* dimensions, GdkPoint* origin, gint radius, gfloat initial_alpha);
	void (*paint_border) (CheckerboardItem* self, cairo_t* ctx, Dimensions* object_dimensions, GdkPoint* object_origin, gint border_width);
	void (*paint_image) (CheckerboardItem* self, cairo_t* ctx, GdkPixbuf* pixbuf, GdkPoint* origin);
	GdkPixbuf* (*get_top_left_trinket) (CheckerboardItem* self, gint scale);
	GdkPixbuf* (*get_top_right_trinket) (CheckerboardItem* self, gint scale);
	GdkPixbuf* (*get_bottom_left_trinket) (CheckerboardItem* self, gint scale);
	GdkPixbuf* (*get_bottom_right_trinket) (CheckerboardItem* self, gint scale);
};

struct _MediaSourceItem {
	CheckerboardItem parent_instance;
	MediaSourceItemPrivate * priv;
};

struct _MediaSourceItemClass {
	CheckerboardItemClass parent_class;
};

struct _ImportPreview {
	MediaSourceItem parent_instance;
	ImportPreviewPrivate * priv;
};

struct _ImportPreviewClass {
	MediaSourceItemClass parent_class;
};

struct _ImportPreviewPrivate {
	DuplicatedFile* duplicated_file;
};

struct _PhotoID {
	gint64 id;
};

struct _VideoID {
	gint64 id;
};

struct _CoreTracker {
	GTypeInstance parent_instance;
	volatile int ref_count;
	CoreTrackerPrivate * priv;
};

struct _CoreTrackerClass {
	GTypeClass parent_class;
	void (*finalize) (CoreTracker *self);
	void (*updated) (CoreTracker* self);
};

struct _CoreViewTracker {
	CoreTracker parent_instance;
	CoreViewTrackerPrivate * priv;
};

struct _CoreViewTrackerClass {
	CoreTrackerClass parent_class;
};

struct _CameraViewTracker {
	CoreViewTracker parent_instance;
	CameraViewTrackerPrivate * priv;
	CameraAccumulator* all;
	CameraAccumulator* visible;
	CameraAccumulator* selected;
};

struct _CameraViewTrackerClass {
	CoreViewTrackerClass parent_class;
};

struct _CoreTrackerAccumulatorIface {
	GTypeInterface parent_iface;
	gboolean (*include) (CoreTrackerAccumulator* self, DataObject* object);
	gboolean (*uninclude) (CoreTrackerAccumulator* self, DataObject* object);
	gboolean (*altered) (CoreTrackerAccumulator* self, DataObject* object, Alteration* alteration);
};

struct _CameraAccumulator {
	GObject parent_instance;
	CameraAccumulatorPrivate * priv;
};

struct _CameraAccumulatorClass {
	GObjectClass parent_class;
};

struct _CameraAccumulatorPrivate {
	gint _total;
	gint _photos;
	gint _videos;
	gint _raw;
};

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

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

struct _CheckerboardPageKeyboardModifiers {
	gboolean ctrl_pressed;
	gboolean alt_pressed;
	gboolean shift_pressed;
	gboolean super_pressed;
};

struct _CheckerboardPage {
	Page parent_instance;
	CheckerboardPagePrivate * priv;
	CheckerboardItem* anchor;
	CheckerboardItem* cursor;
};

struct _CheckerboardPageClass {
	PageClass parent_class;
	GtkMenu* (*get_item_context_menu) (CheckerboardPage* self);
	gchar* (*get_view_empty_icon) (CheckerboardPage* self);
	gchar* (*get_view_empty_message) (CheckerboardPage* self);
	gchar* (*get_filter_no_match_message) (CheckerboardPage* self);
	void (*on_item_activated) (CheckerboardPage* self, CheckerboardItem* item, CheckerboardPageActivator activator, CheckerboardPageKeyboardModifiers* modifiers);
	SearchViewFilter* (*get_search_view_filter) (CheckerboardPage* self);
	CoreViewTracker* (*get_view_tracker) (CheckerboardPage* self);
	gboolean (*on_mouse_over) (CheckerboardPage* self, CheckerboardItem* item, gint x, gint y, GdkModifierType mask);
	void (*set_display_titles) (CheckerboardPage* self, gboolean display);
	void (*set_display_comments) (CheckerboardPage* self, gboolean display);
};

struct _ImportPage {
	CheckerboardPage parent_instance;
	ImportPagePrivate * priv;
};

struct _ImportPageClass {
	CheckerboardPageClass parent_class;
};

struct _ImportPagePrivate {
	SourceCollection* import_sources;
	GtkLabel* camera_label;
	GtkCheckButton* hide_imported;
	GtkProgressBar* progress_bar;
	DiscoveredCamera* dcamera;
	gboolean busy;
	gboolean refreshed;
	int refresh_result;
	gchar* refresh_error;
	GVolumeMonitor* volume_monitor;
	ImportPage* local_ref;
	ImportPageImportPageSearchViewFilter* search_filter;
	ImportPageHideImportedViewFilter* hide_imported_filter;
	CameraViewTracker* tracker;
	gint claim_timeout;
};

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

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

struct _BatchImportResult {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BatchImportResultPrivate * priv;
	BatchImportJob* job;
	GFile* file;
	gchar* src_identifier;
	gchar* dest_identifier;
	ImportResult result;
	gchar* errmsg;
	DuplicatedFile* duplicate_of;
};

struct _BatchImportResultClass {
	GTypeClass parent_class;
	void (*finalize) (BatchImportResult *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 _ViewManager {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ViewManagerPrivate * priv;
};

struct _ViewManagerClass {
	GTypeClass parent_class;
	void (*finalize) (ViewManager *self);
	gboolean (*include_in_view) (ViewManager* self, DataSource* source);
	DataView* (*create_view) (ViewManager* self, DataSource* source);
};

struct _ImportPageImportViewManager {
	ViewManager parent_instance;
	ImportPageImportViewManagerPrivate * priv;
};

struct _ImportPageImportViewManagerClass {
	ViewManagerClass parent_class;
};

struct _ImportPageImportViewManagerPrivate {
	ImportPage* owner;
};

struct _BatchImportJob {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BatchImportJobPrivate * priv;
};

struct _BatchImportJobClass {
	GTypeClass parent_class;
	void (*finalize) (BatchImportJob *self);
	gchar* (*get_dest_identifier) (BatchImportJob* self);
	gchar* (*get_source_identifier) (BatchImportJob* self);
	gboolean (*is_directory) (BatchImportJob* self);
	gchar* (*get_basename) (BatchImportJob* self);
	gchar* (*get_path) (BatchImportJob* self);
	DuplicatedFile* (*get_duplicated_file) (BatchImportJob* self);
	GFile* (*get_associated_file) (BatchImportJob* self);
	void (*set_associated) (BatchImportJob* self, BatchImportJob* associated);
	gboolean (*determine_file_size) (BatchImportJob* self, guint64* filesize, GFile** file_or_dir);
	gboolean (*prepare) (BatchImportJob* self, GFile** file_to_import, gboolean* copy_to_library, GError** error);
	gboolean (*complete) (BatchImportJob* self, MediaSource* source, BatchImportRoll* import_roll, GError** error);
	GDateTime* (*get_exposure_time_override) (BatchImportJob* self);
	gboolean (*recurse) (BatchImportJob* self);
};

struct _ImportPageCameraImportJob {
	BatchImportJob parent_instance;
	ImportPageCameraImportJobPrivate * priv;
};

struct _ImportPageCameraImportJobClass {
	BatchImportJobClass parent_class;
};

struct _ImportPageCameraImportJobPrivate {
	GPContextWrapper* context;
	ImportSource* import_file;
	Camera* camera;
	gchar* fulldir;
	gchar* filename;
	guint64 filesize;
	PhotoMetadata* metadata;
	GDateTime* exposure_time;
	ImportPageCameraImportJob* associated;
	BackingPhotoRow* associated_file;
	DuplicatedFile* duplicated_file;
};

struct _BackingPhotoID {
	gint64 id;
};

struct _BackingPhotoRow {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BackingPhotoRowPrivate * priv;
	BackingPhotoID id;
	gint64 time_created;
	gchar* filepath;
	gint64 filesize;
	GDateTime* timestamp;
	PhotoFileFormat file_format;
	Dimensions dim;
	Orientation original_orientation;
};

struct _BackingPhotoRowClass {
	GTypeClass parent_class;
	void (*finalize) (BackingPhotoRow *self);
};

struct _ViewFilter {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ViewFilterPrivate * priv;
};

struct _ViewFilterClass {
	GTypeClass parent_class;
	void (*finalize) (ViewFilter *self);
	gboolean (*predicate) (ViewFilter* self, DataView* view);
	void (*refresh) (ViewFilter* self);
};

struct _SearchViewFilter {
	ViewFilter parent_instance;
	SearchViewFilterPrivate * priv;
};

struct _SearchViewFilterClass {
	ViewFilterClass parent_class;
	guint (*get_criteria) (SearchViewFilter* self);
};

struct _ImportPageImportPageSearchViewFilter {
	SearchViewFilter parent_instance;
	ImportPageImportPageSearchViewFilterPrivate * priv;
};

struct _ImportPageImportPageSearchViewFilterClass {
	SearchViewFilterClass parent_class;
};

struct _ImportPageHideImportedViewFilter {
	ViewFilter parent_instance;
	ImportPageHideImportedViewFilterPrivate * priv;
};

struct _ImportPageHideImportedViewFilterClass {
	ViewFilterClass parent_class;
};

static gpointer import_source_collection_parent_class = NULL;
static gint ImportSource_private_offset;
static gpointer import_source_parent_class = NULL;
VALA_EXTERN GPSpinIdleWrapper* import_page_spin_idle_context;
static IndexableIface * import_source_indexable_parent_iface = NULL;
static gpointer video_import_source_parent_class = NULL;
static gint PhotoImportSource_private_offset;
static gpointer photo_import_source_parent_class = NULL;
static gint ImportPreview_private_offset;
static gpointer import_preview_parent_class = NULL;
static GdkPixbuf* import_preview_placeholder_preview;
static GdkPixbuf* import_preview_placeholder_preview = NULL;
VALA_EXTERN LibraryPhotoSourceCollection* library_photo_global;
VALA_EXTERN VideoSourceCollection* video_global;
static gpointer camera_view_tracker_parent_class = NULL;
static gint CameraAccumulator_private_offset;
static gpointer camera_accumulator_parent_class = NULL;
static CoreTrackerAccumulatorIface * camera_accumulator_core_tracker_accumulator_parent_iface = NULL;
static gint ImportPage_private_offset;
static gpointer import_page_parent_class = NULL;
VALA_EXTERN GPContextWrapper* import_page_null_context;
GPContextWrapper* import_page_null_context = NULL;
GPSpinIdleWrapper* import_page_spin_idle_context = NULL;
static gint ImportPageImportViewManager_private_offset;
static gpointer import_page_import_view_manager_parent_class = NULL;
static gint ImportPageCameraImportJob_private_offset;
static gpointer import_page_camera_import_job_parent_class = NULL;
static gpointer import_page_import_page_search_view_filter_parent_class = NULL;
static gpointer import_page_hide_imported_view_filter_parent_class = NULL;

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 data_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataObject, g_object_unref)
VALA_EXTERN gpointer alteration_ref (gpointer instance);
VALA_EXTERN void alteration_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_alteration (const gchar* name,
                                   const gchar* nick,
                                   const gchar* blurb,
                                   GType object_type,
                                   GParamFlags flags);
VALA_EXTERN void value_set_alteration (GValue* value,
                           gpointer v_object);
VALA_EXTERN void value_take_alteration (GValue* value,
                            gpointer v_object);
VALA_EXTERN gpointer value_get_alteration (const GValue* value);
VALA_EXTERN GType alteration_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Alteration, alteration_unref)
VALA_EXTERN GType marker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Marker, g_object_unref)
VALA_EXTERN GType source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SourceCollection, data_collection_unref)
VALA_EXTERN GType data_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataSource, g_object_unref)
VALA_EXTERN gpointer source_backlink_ref (gpointer instance);
VALA_EXTERN void source_backlink_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_source_backlink (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_source_backlink (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_source_backlink (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_source_backlink (const GValue* value);
VALA_EXTERN GType source_backlink_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SourceBacklink, source_backlink_unref)
VALA_EXTERN GType import_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportSourceCollection, data_collection_unref)
VALA_EXTERN gboolean source_collection_holds_type_of_source (SourceCollection* self,
                                                 DataSource* source);
VALA_EXTERN ImportSourceCollection* import_source_collection_new (const gchar* name);
VALA_EXTERN ImportSourceCollection* import_source_collection_construct (GType object_type,
                                                            const gchar* name);
VALA_EXTERN SourceCollection* source_collection_construct (GType object_type,
                                               const gchar* name);
static gboolean import_source_collection_real_holds_type_of_source (SourceCollection* base,
                                                             DataSource* source);
VALA_EXTERN GType thumbnail_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThumbnailSource, g_object_unref)
VALA_EXTERN GType import_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportSource, g_object_unref)
static GType import_source_collection_get_type_once (void);
VALA_EXTERN gpointer source_holding_tank_ref (gpointer instance);
VALA_EXTERN void source_holding_tank_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_source_holding_tank (const gchar* name,
                                            const gchar* nick,
                                            const gchar* blurb,
                                            GType object_type,
                                            GParamFlags flags);
VALA_EXTERN void value_set_source_holding_tank (GValue* value,
                                    gpointer v_object);
VALA_EXTERN void value_take_source_holding_tank (GValue* value,
                                     gpointer v_object);
VALA_EXTERN gpointer value_get_source_holding_tank (const GValue* value);
VALA_EXTERN GType source_holding_tank_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SourceHoldingTank, source_holding_tank_unref)
VALA_EXTERN gpointer source_snapshot_ref (gpointer instance);
VALA_EXTERN void source_snapshot_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_source_snapshot (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_source_snapshot (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_source_snapshot (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_source_snapshot (const GValue* value);
VALA_EXTERN GType source_snapshot_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SourceSnapshot, source_snapshot_unref)
VALA_EXTERN GType photo_file_format_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType indexable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Indexable, g_object_unref)
VALA_EXTERN GdkPixbuf* import_source_get_preview (ImportSource* self);
VALA_EXTERN GDateTime* import_source_get_exposure_time (ImportSource* self);
VALA_EXTERN gchar* data_object_to_string (DataObject* self);
VALA_EXTERN gboolean data_source_internal_delete_backing (DataSource* self,
                                              GError** error);
VALA_EXTERN ImportSource* import_source_construct (GType object_type,
                                       const gchar* camera_name,
                                       Camera* camera,
                                       gint fsid,
                                       const gchar* folder,
                                       const gchar* filename,
                                       gulong file_size,
                                       GDateTime* modification_time);
VALA_EXTERN ThumbnailSource* thumbnail_source_construct (GType object_type,
                                             gint64 object_id);
VALA_EXTERN gchar* indexable_prepare_indexable_string (const gchar* str);
VALA_EXTERN void import_source_set_preview (ImportSource* self,
                                GdkPixbuf* preview);
VALA_EXTERN gchar* import_source_get_camera_name (ImportSource* self);
VALA_EXTERN Camera* import_source_get_camera (ImportSource* self);
VALA_EXTERN gint import_source_get_fsid (ImportSource* self);
VALA_EXTERN gchar* import_source_get_folder (ImportSource* self);
VALA_EXTERN gchar* import_source_get_filename (ImportSource* self);
VALA_EXTERN gulong import_source_get_filesize (ImportSource* self);
VALA_EXTERN GDateTime* import_source_get_modification_time (ImportSource* self);
static GdkPixbuf* import_source_real_get_preview (ImportSource* self);
static GDateTime* import_source_real_get_exposure_time (ImportSource* self);
VALA_EXTERN gchar* import_source_get_fulldir (ImportSource* self);
VALA_EXTERN gchar* import_page_get_fulldir (Camera* camera,
                                const gchar* camera_name,
                                gint fsid,
                                const gchar* folder);
static gchar* import_source_real_to_string (DataObject* base);
static gboolean import_source_real_internal_delete_backing (DataSource* base,
                                                     GError** error);
VALA_EXTERN gpointer gp_context_wrapper_ref (gpointer instance);
VALA_EXTERN void gp_context_wrapper_unref (gpointer instance);
VALA_EXTERN GParamSpec* gp_param_spec_context_wrapper (const gchar* name,
                                           const gchar* nick,
                                           const gchar* blurb,
                                           GType object_type,
                                           GParamFlags flags);
VALA_EXTERN void gp_value_set_context_wrapper (GValue* value,
                                   gpointer v_object);
VALA_EXTERN void gp_value_take_context_wrapper (GValue* value,
                                    gpointer v_object);
VALA_EXTERN gpointer gp_value_get_context_wrapper (const GValue* value);
VALA_EXTERN GType gp_context_wrapper_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GPContextWrapper, gp_context_wrapper_unref)
VALA_EXTERN GType gp_spin_idle_wrapper_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GPSpinIdleWrapper, gp_context_wrapper_unref)
static const gchar* import_source_real_get_indexable_keywords (Indexable* base);
VALA_EXTERN const gchar* indexable_get_indexable_keywords (Indexable* self);
static void import_source_finalize (GObject * obj);
static GType import_source_get_type_once (void);
VALA_EXTERN GType video_import_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VideoImportSource, g_object_unref)
VALA_EXTERN GdkPixbuf* thumbnail_source_get_thumbnail (ThumbnailSource* self,
                                           gint scale,
                                           GError** error);
VALA_EXTERN GdkPixbuf* thumbnail_source_create_thumbnail (ThumbnailSource* self,
                                              gint scale,
                                              GError** error);
VALA_EXTERN gchar* data_source_get_typename (DataSource* self);
VALA_EXTERN gint64 data_source_get_instance_id (DataSource* self);
VALA_EXTERN PhotoFileFormat thumbnail_source_get_preferred_thumbnail_format (ThumbnailSource* self);
VALA_EXTERN gchar* data_object_get_name (DataObject* self);
VALA_EXTERN VideoImportSource* video_import_source_new (const gchar* camera_name,
                                            Camera* camera,
                                            gint fsid,
                                            const gchar* folder,
                                            const gchar* filename,
                                            gulong file_size,
                                            GDateTime* modification_time);
VALA_EXTERN VideoImportSource* video_import_source_construct (GType object_type,
                                                  const gchar* camera_name,
                                                  Camera* camera,
                                                  gint fsid,
                                                  const gchar* folder,
                                                  const gchar* filename,
                                                  gulong file_size,
                                                  GDateTime* modification_time);
static GdkPixbuf* video_import_source_real_get_thumbnail (ThumbnailSource* base,
                                                   gint scale,
                                                   GError** error);
static GdkPixbuf* video_import_source_real_create_thumbnail (ThumbnailSource* base,
                                                      gint scale,
                                                      GError** error);
VALA_EXTERN GdkPixbuf* scale_pixbuf (GdkPixbuf* pixbuf,
                         gint scale,
                         GdkInterpType interp,
                         gboolean scale_up);
static gchar* video_import_source_real_get_typename (DataSource* base);
static gint64 video_import_source_real_get_instance_id (DataSource* base);
VALA_EXTERN gint64 data_object_get_object_id (DataObject* self);
static PhotoFileFormat video_import_source_real_get_preferred_thumbnail_format (ThumbnailSource* base);
VALA_EXTERN PhotoFileFormat photo_file_format_get_system_default_format (void);
static gchar* video_import_source_real_get_name (DataObject* base);
VALA_EXTERN void video_import_source_update (VideoImportSource* self,
                                 GdkPixbuf* preview);
VALA_EXTERN GdkPixbuf* resources_get_noninterpretable_badge_pixbuf (void);
static GType video_import_source_get_type_once (void);
VALA_EXTERN GType photo_import_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotoImportSource, g_object_unref)
VALA_EXTERN GType photo_metadata_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotoMetadata, media_metadata_unref)
VALA_EXTERN PhotoImportSource* photo_import_source_new (const gchar* camera_name,
                                            Camera* camera,
                                            gint fsid,
                                            const gchar* folder,
                                            const gchar* filename,
                                            gulong file_size,
                                            GDateTime* modification_time,
                                            PhotoFileFormat file_format);
VALA_EXTERN PhotoImportSource* photo_import_source_construct (GType object_type,
                                                  const gchar* camera_name,
                                                  Camera* camera,
                                                  gint fsid,
                                                  const gchar* folder,
                                                  const gchar* filename,
                                                  gulong file_size,
                                                  GDateTime* modification_time,
                                                  PhotoFileFormat file_format);
static gchar* photo_import_source_real_get_name (DataObject* base);
VALA_EXTERN gchar* photo_import_source_get_title (PhotoImportSource* self);
VALA_EXTERN gboolean is_string_empty (const gchar* s);
static gchar* photo_import_source_real_get_typename (DataSource* base);
static gint64 photo_import_source_real_get_instance_id (DataSource* base);
static PhotoFileFormat photo_import_source_real_get_preferred_thumbnail_format (ThumbnailSource* base);
VALA_EXTERN gboolean photo_file_format_can_write (PhotoFileFormat self);
static GdkPixbuf* photo_import_source_real_create_thumbnail (ThumbnailSource* base,
                                                      gint scale,
                                                      GError** error);
VALA_EXTERN void photo_import_source_update (PhotoImportSource* self,
                                 GdkPixbuf* preview,
                                 const gchar* preview_md5,
                                 PhotoMetadata* metadata,
                                 const gchar* exif_md5);
static GDateTime* photo_import_source_real_get_exposure_time (ImportSource* base);
VALA_EXTERN MetadataDateTime* photo_metadata_get_exposure_date_time (PhotoMetadata* self);
VALA_EXTERN PhotoMetadata* photo_import_source_get_metadata (PhotoImportSource* self);
static GdkPixbuf* photo_import_source_real_get_preview (ImportSource* base);
static GdkPixbuf* photo_import_source_real_get_thumbnail (ThumbnailSource* base,
                                                   gint scale,
                                                   GError** error);
VALA_EXTERN PhotoFileFormat photo_import_source_get_file_format (PhotoImportSource* self);
VALA_EXTERN gchar* photo_import_source_get_preview_md5 (PhotoImportSource* self);
VALA_EXTERN void photo_import_source_set_associated (PhotoImportSource* self,
                                         PhotoImportSource* associated);
VALA_EXTERN PhotoImportSource* photo_import_source_get_associated (PhotoImportSource* self);
static gboolean photo_import_source_real_internal_delete_backing (DataSource* base,
                                                           GError** error);
static void photo_import_source_finalize (GObject * obj);
static GType photo_import_source_get_type_once (void);
VALA_EXTERN GType data_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataView, g_object_unref)
VALA_EXTERN GType thumbnail_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThumbnailView, g_object_unref)
VALA_EXTERN GType checkerboard_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardItem, g_object_unref)
VALA_EXTERN GType dimensions_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Dimensions* dimensions_dup (const Dimensions* self);
VALA_EXTERN void dimensions_free (Dimensions* self);
VALA_EXTERN GType media_source_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaSourceItem, g_object_unref)
VALA_EXTERN GType import_preview_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportPreview, g_object_unref)
VALA_EXTERN GType duplicated_file_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DuplicatedFile, g_object_unref)
VALA_EXTERN GdkPixbuf* checkerboard_item_get_top_left_trinket (CheckerboardItem* self,
                                                   gint scale);
VALA_EXTERN ImportPreview* import_preview_new (ImportSource* source);
VALA_EXTERN ImportPreview* import_preview_construct (GType object_type,
                                         ImportSource* source);
VALA_EXTERN void dimensions_init (Dimensions *self,
                      gint width,
                      gint height);
VALA_EXTERN MediaSourceItem* media_source_item_new (ThumbnailSource* source,
                                        Dimensions* initial_pixbuf_dim,
                                        const gchar* title,
                                        const gchar* comment,
                                        gboolean marked_up,
                                        PangoAlignment alignment);
VALA_EXTERN MediaSourceItem* media_source_item_construct (GType object_type,
                                              ThumbnailSource* source,
                                              Dimensions* initial_pixbuf_dim,
                                              const gchar* title,
                                              const gchar* comment,
                                              gboolean marked_up,
                                              PangoAlignment alignment);
VALA_EXTERN GdkPixbuf* get_placeholder_pixbuf (void);
VALA_EXTERN GType orientation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Orientation photo_metadata_get_orientation (PhotoMetadata* self);
VALA_EXTERN GdkPixbuf* orientation_rotate_pixbuf (Orientation self,
                                      GdkPixbuf* pixbuf);
VALA_EXTERN void checkerboard_item_set_subtitle (CheckerboardItem* self,
                                     const gchar* text,
                                     gboolean marked_up,
                                     PangoAlignment alignment);
VALA_EXTERN void checkerboard_item_set_image (CheckerboardItem* self,
                                  GdkPixbuf* pixbuf);
VALA_EXTERN gboolean import_preview_is_already_imported (ImportPreview* self);
VALA_EXTERN ImportSource* import_preview_get_import_source (ImportPreview* self);
VALA_EXTERN gboolean library_photo_has_nontrash_duplicate (GFile* file,
                                               const gchar* thumbnail_md5,
                                               const gchar* full_md5,
                                               PhotoFileFormat file_format);
VALA_EXTERN GType photo_id_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PhotoID* photo_id_dup (const PhotoID* self);
VALA_EXTERN void photo_id_free (PhotoID* self);
VALA_EXTERN DuplicatedFile* duplicated_file_create_from_photo_id (PhotoID* photo_id);
VALA_EXTERN void library_photo_get_nontrash_duplicate (GFile* file,
                                           const gchar* thumbnail_md5,
                                           const gchar* full_md5,
                                           PhotoFileFormat file_format,
                                           PhotoID* result);
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 GType library_photo_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryPhotoSourceCollection, data_collection_unref)
VALA_EXTERN void library_photo_source_collection_get_basename_filesize_duplicate (LibraryPhotoSourceCollection* self,
                                                                      const gchar* basename,
                                                                      gint64 filesize,
                                                                      PhotoID* result);
VALA_EXTERN gboolean photo_id_is_valid (PhotoID *self);
VALA_EXTERN GType media_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaSource, g_object_unref)
VALA_EXTERN GType photo_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotoSource, g_object_unref)
VALA_EXTERN GType photo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Photo, g_object_unref)
VALA_EXTERN GType library_photo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryPhoto, g_object_unref)
VALA_EXTERN LibraryPhoto* library_photo_source_collection_fetch (LibraryPhotoSourceCollection* self,
                                                     PhotoID* photo_id);
VALA_EXTERN GDateTime* media_source_get_exposure_time (MediaSource* self);
VALA_EXTERN GType video_source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VideoSourceCollection, data_collection_unref)
VALA_EXTERN gboolean video_source_collection_has_basename_filesize_duplicate (VideoSourceCollection* self,
                                                                  const gchar* basename,
                                                                  guint64 filesize);
VALA_EXTERN GType video_id_get_type (void) G_GNUC_CONST ;
VALA_EXTERN VideoID* video_id_dup (const VideoID* self);
VALA_EXTERN void video_id_free (VideoID* self);
VALA_EXTERN DuplicatedFile* duplicated_file_create_from_video_id (VideoID* video_id);
VALA_EXTERN void video_source_collection_get_basename_filesize_duplicate (VideoSourceCollection* self,
                                                              const gchar* basename,
                                                              guint64 filesize,
                                                              VideoID* result);
VALA_EXTERN DuplicatedFile* import_preview_get_duplicated_file (ImportPreview* self);
VALA_EXTERN DataSource* data_view_get_source (DataView* self);
static GdkPixbuf* import_preview_real_get_top_left_trinket (CheckerboardItem* base,
                                                     gint scale);
VALA_EXTERN GdkPixbuf* resources_get_video_trinket (gint scale);
static void import_preview_finalize (GObject * obj);
static GType import_preview_get_type_once (void);
VALA_EXTERN gpointer core_tracker_ref (gpointer instance);
VALA_EXTERN void core_tracker_unref (gpointer instance);
VALA_EXTERN GParamSpec* core_param_spec_tracker (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags);
VALA_EXTERN void core_value_set_tracker (GValue* value,
                             gpointer v_object);
VALA_EXTERN void core_value_take_tracker (GValue* value,
                              gpointer v_object);
VALA_EXTERN gpointer core_value_get_tracker (const GValue* value);
VALA_EXTERN GType core_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoreTracker, core_tracker_unref)
VALA_EXTERN GType core_view_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoreViewTracker, core_tracker_unref)
VALA_EXTERN GType camera_view_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CameraViewTracker, core_tracker_unref)
VALA_EXTERN GType camera_accumulator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CameraAccumulator, g_object_unref)
VALA_EXTERN CameraAccumulator* camera_accumulator_new (void);
VALA_EXTERN CameraAccumulator* camera_accumulator_construct (GType object_type);
VALA_EXTERN GType view_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewCollection, data_collection_unref)
VALA_EXTERN CameraViewTracker* camera_view_tracker_new (ViewCollection* collection);
VALA_EXTERN CameraViewTracker* camera_view_tracker_construct (GType object_type,
                                                  ViewCollection* collection);
VALA_EXTERN CoreViewTracker* core_view_tracker_new (ViewCollection* collection);
VALA_EXTERN CoreViewTracker* core_view_tracker_construct (GType object_type,
                                              ViewCollection* collection);
VALA_EXTERN GType core_tracker_accumulator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoreTrackerAccumulator, g_object_unref)
VALA_EXTERN void core_view_tracker_start (CoreViewTracker* self,
                              CoreTrackerAccumulator* all,
                              CoreTrackerAccumulator* visible,
                              CoreTrackerAccumulator* selected);
static void camera_view_tracker_finalize (CoreTracker * obj);
static GType camera_view_tracker_get_type_once (void);
static gboolean camera_accumulator_real_include (CoreTrackerAccumulator* base,
                                          DataObject* object);
VALA_EXTERN gint camera_accumulator_get_total (CameraAccumulator* self);
static void camera_accumulator_set_total (CameraAccumulator* self,
                                   gint value);
VALA_EXTERN gint camera_accumulator_get_photos (CameraAccumulator* self);
static void camera_accumulator_set_photos (CameraAccumulator* self,
                                    gint value);
VALA_EXTERN gint camera_accumulator_get_raw (CameraAccumulator* self);
static void camera_accumulator_set_raw (CameraAccumulator* self,
                                 gint value);
VALA_EXTERN gint camera_accumulator_get_videos (CameraAccumulator* self);
static void camera_accumulator_set_videos (CameraAccumulator* self,
                                    gint value);
static gboolean camera_accumulator_real_uninclude (CoreTrackerAccumulator* base,
                                            DataObject* object);
static gboolean camera_accumulator_real_altered (CoreTrackerAccumulator* base,
                                          DataObject* object,
                                          Alteration* alteration);
VALA_EXTERN gchar* camera_accumulator_to_string (CameraAccumulator* self);
VALA_EXTERN gboolean core_tracker_accumulator_include (CoreTrackerAccumulator* self,
                                           DataObject* object);
VALA_EXTERN gboolean core_tracker_accumulator_uninclude (CoreTrackerAccumulator* self,
                                             DataObject* object);
VALA_EXTERN gboolean core_tracker_accumulator_altered (CoreTrackerAccumulator* self,
                                           DataObject* object,
                                           Alteration* alteration);
static void camera_accumulator_finalize (GObject * obj);
static GType camera_accumulator_get_type_once (void);
static void _vala_camera_accumulator_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_camera_accumulator_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
VALA_EXTERN GType page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Page, g_object_unref)
VALA_EXTERN GType page_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageWindow, g_object_unref)
VALA_EXTERN GType fullscreen_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FullscreenWindow, g_object_unref)
VALA_EXTERN gpointer injection_group_ref (gpointer instance);
VALA_EXTERN void injection_group_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_injection_group (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_injection_group (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_injection_group (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_injection_group (const GValue* value);
VALA_EXTERN GType injection_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (InjectionGroup, injection_group_unref)
VALA_EXTERN GType checkerboard_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardPage, g_object_unref)
VALA_EXTERN GType checkerboard_page_activator_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType checkerboard_page_keyboard_modifiers_get_type (void) G_GNUC_CONST ;
VALA_EXTERN CheckerboardPageKeyboardModifiers* checkerboard_page_keyboard_modifiers_dup (const CheckerboardPageKeyboardModifiers* self);
VALA_EXTERN void checkerboard_page_keyboard_modifiers_free (CheckerboardPageKeyboardModifiers* self);
VALA_EXTERN gpointer view_filter_ref (gpointer instance);
VALA_EXTERN void view_filter_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_view_filter (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_view_filter (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_view_filter (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_view_filter (const GValue* value);
VALA_EXTERN GType view_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewFilter, view_filter_unref)
VALA_EXTERN GType search_view_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SearchViewFilter, view_filter_unref)
VALA_EXTERN GType import_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportPage, g_object_unref)
VALA_EXTERN gpointer discovered_camera_ref (gpointer instance);
VALA_EXTERN void discovered_camera_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_discovered_camera (const gchar* name,
                                          const gchar* nick,
                                          const gchar* blurb,
                                          GType object_type,
                                          GParamFlags flags);
VALA_EXTERN void value_set_discovered_camera (GValue* value,
                                  gpointer v_object);
VALA_EXTERN void value_take_discovered_camera (GValue* value,
                                   gpointer v_object);
VALA_EXTERN gpointer value_get_discovered_camera (const GValue* value);
VALA_EXTERN GType discovered_camera_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DiscoveredCamera, discovered_camera_unref)
static GType import_page_import_page_search_view_filter_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportPageImportPageSearchViewFilter, view_filter_unref)
static GType import_page_hide_imported_view_filter_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportPageHideImportedViewFilter, view_filter_unref)
VALA_EXTERN GtkToolbar* page_get_toolbar (Page* self);
VALA_EXTERN CoreViewTracker* checkerboard_page_get_view_tracker (CheckerboardPage* self);
VALA_EXTERN gchar* checkerboard_page_get_view_empty_icon (CheckerboardPage* self);
VALA_EXTERN gchar* checkerboard_page_get_view_empty_message (CheckerboardPage* self);
VALA_EXTERN gchar* checkerboard_page_get_filter_no_match_message (CheckerboardPage* self);
VALA_EXTERN void page_init_collect_ui_filenames (Page* self,
                                     GeeList* ui_filenames);
VALA_EXTERN void page_add_actions (Page* self,
                       GActionMap* map);
VALA_EXTERN void page_remove_actions (Page* self,
                          GActionMap* map);
VALA_EXTERN void page_init_actions (Page* self,
                        gint selected_count,
                        gint count);
VALA_EXTERN void page_switched_to (Page* self);
VALA_EXTERN void page_ready (Page* self);
VALA_EXTERN void checkerboard_page_set_display_titles (CheckerboardPage* self,
                                           gboolean display);
VALA_EXTERN SearchViewFilter* checkerboard_page_get_search_view_filter (CheckerboardPage* self);
static void import_page_on_media_added_removed (ImportPage* self);
static void _import_page_on_media_added_removed_data_collection_contents_altered (DataCollection* _sender,
                                                                           GeeIterable* added,
                                                                           GeeIterable* removed,
                                                                           gpointer self);
VALA_EXTERN GType import_page_refresh_result_get_type (void) G_GNUC_CONST ;
static void import_page_on_import_selected (ImportPage* self);
static void _import_page_on_import_selected_gsimple_action_activate_callback (GSimpleAction* action,
                                                                       GVariant* parameter,
                                                                       gpointer self);
static void import_page_on_import_all (ImportPage* self);
static void _import_page_on_import_all_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self);
VALA_EXTERN void page_on_action_toggle (Page* self,
                            GAction* action,
                            GVariant* value);
static void _page_on_action_toggle_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self);
static void import_page_on_display_titles (ImportPage* self,
                                    GSimpleAction* action,
                                    GVariant* value);
static void _import_page_on_display_titles_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                          GVariant* value,
                                                                          gpointer self);
static ImportPageImportPageSearchViewFilter* import_page_import_page_search_view_filter_new (void);
static ImportPageImportPageSearchViewFilter* import_page_import_page_search_view_filter_construct (GType object_type);
static ImportPageHideImportedViewFilter* import_page_hide_imported_view_filter_new (void);
static ImportPageHideImportedViewFilter* import_page_hide_imported_view_filter_construct (GType object_type);
VALA_EXTERN ImportPage* import_page_new (DiscoveredCamera* dcamera);
VALA_EXTERN ImportPage* import_page_construct (GType object_type,
                                   DiscoveredCamera* dcamera);
VALA_EXTERN CheckerboardPage* checkerboard_page_construct (GType object_type,
                                               const gchar* page_name);
VALA_EXTERN ViewCollection* page_get_view (Page* self);
VALA_EXTERN void page_set_page_name (Page* self,
                         const gchar* page_name);
VALA_EXTERN GPContextWrapper* gp_context_wrapper_new (void);
VALA_EXTERN GPContextWrapper* gp_context_wrapper_construct (GType object_type);
VALA_EXTERN GPSpinIdleWrapper* gp_spin_idle_wrapper_new (void);
VALA_EXTERN GPSpinIdleWrapper* gp_spin_idle_wrapper_construct (GType object_type);
VALA_EXTERN gpointer view_manager_ref (gpointer instance);
VALA_EXTERN void view_manager_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_view_manager (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags);
VALA_EXTERN void value_set_view_manager (GValue* value,
                             gpointer v_object);
VALA_EXTERN void value_take_view_manager (GValue* value,
                              gpointer v_object);
VALA_EXTERN gpointer value_get_view_manager (const GValue* value);
VALA_EXTERN GType view_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewManager, view_manager_unref)
VALA_EXTERN gpointer view_collection_monitor_ref (gpointer instance);
VALA_EXTERN void view_collection_monitor_unref (gpointer instance);
VALA_EXTERN GParamSpec* view_collection_param_spec_monitor (const gchar* name,
                                                const gchar* nick,
                                                const gchar* blurb,
                                                GType object_type,
                                                GParamFlags flags);
VALA_EXTERN void view_collection_value_set_monitor (GValue* value,
                                        gpointer v_object);
VALA_EXTERN void view_collection_value_take_monitor (GValue* value,
                                         gpointer v_object);
VALA_EXTERN gpointer view_collection_value_get_monitor (const GValue* value);
VALA_EXTERN GType view_collection_monitor_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewCollectionMonitor, view_collection_monitor_unref)
VALA_EXTERN ViewCollectionMonitor* view_collection_monitor_source_collection (ViewCollection* self,
                                                                  SourceCollection* sources,
                                                                  ViewManager* manager,
                                                                  Alteration* prereq,
                                                                  GeeCollection* initial,
                                                                  ProgressMonitor progress_monitor,
                                                                  gpointer progress_monitor_target);
static ImportPageImportViewManager* import_page_import_view_manager_new (ImportPage* owner);
static ImportPageImportViewManager* import_page_import_view_manager_construct (GType object_type,
                                                                        ImportPage* owner);
static GType import_page_import_view_manager_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportPageImportViewManager, view_manager_unref)
VALA_EXTERN void data_collection_set_comparator (DataCollection* self,
                                     Comparator comparator,
                                     gpointer comparator_target,
                                     ComparatorPredicate predicate,
                                     gpointer predicate_target);
static gint64 import_page_preview_comparator (void* a,
                                       void* b);
static gint64 _import_page_preview_comparator_comparator (void* a,
                                                   void* b,
                                                   gpointer self);
static gboolean import_page_preview_comparator_predicate (DataObject* object,
                                                   Alteration* alteration);
static gboolean _import_page_preview_comparator_predicate_comparator_predicate (DataObject* object,
                                                                         Alteration* alteration,
                                                                         gpointer self);
static void import_page_on_view_changed (ImportPage* self);
static void _import_page_on_view_changed_view_collection_items_state_changed (ViewCollection* _sender,
                                                                       GeeIterable* changed,
                                                                       gpointer self);
static void _import_page_on_view_changed_data_collection_contents_altered (DataCollection* _sender,
                                                                    GeeIterable* added,
                                                                    GeeIterable* removed,
                                                                    gpointer self);
static void _import_page_on_view_changed_view_collection_items_visibility_changed (ViewCollection* _sender,
                                                                            GeeCollection* changed,
                                                                            gpointer self);
VALA_EXTERN void data_collection_set_property (DataCollection* self,
                                   const gchar* name,
                                   GValue* val,
                                   ValueEqualFunc value_equals,
                                   gpointer value_equals_target);
VALA_EXTERN void checkerboard_page_init_item_context_menu (CheckerboardPage* self,
                                               const gchar* path);
VALA_EXTERN void checkerboard_page_init_page_context_menu (CheckerboardPage* self,
                                               const gchar* path);
static GtkToolbar* import_page_real_get_toolbar (Page* base);
static void import_page_on_hide_imported (ImportPage* self);
static void _import_page_on_hide_imported_gtk_button_clicked (GtkButton* _sender,
                                                       gpointer self);
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_hide_photos_already_imported (ConfigurationFacade* self);
static void import_page_update_toolbar_state (ImportPage* self);
static CoreViewTracker* import_page_real_get_view_tracker (CheckerboardPage* base);
static gchar* import_page_real_get_view_empty_icon (CheckerboardPage* base);
static gchar* import_page_real_get_view_empty_message (CheckerboardPage* base);
static gchar* import_page_real_get_filter_no_match_message (CheckerboardPage* base);
VALA_EXTERN gint64 nullsafe_date_time_comperator (GDateTime* time_a,
                                      GDateTime* time_b);
VALA_EXTERN gboolean alteration_has_detail (Alteration* self,
                                const gchar* subject,
                                const gchar* detail);
static gint64 import_page_import_job_comparator (ImportPage* self,
                                          void* a,
                                          void* b);
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)
static GType import_page_camera_import_job_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportPageCameraImportJob, batch_import_job_unref)
static GDateTime* import_page_camera_import_job_get_exposure_time (ImportPageCameraImportJob* self);
static void import_page_real_init_collect_ui_filenames (Page* base,
                                                 GeeList* ui_filenames);
static void import_page_real_add_actions (Page* base,
                                   GActionMap* map);
VALA_EXTERN GAction* page_get_action (Page* self,
                          const gchar* name);
VALA_EXTERN gboolean configuration_facade_get_display_photo_titles (ConfigurationFacade* self);
static GVariant* _variant_new13 (gboolean value);
static void import_page_real_remove_actions (Page* base,
                                      GActionMap* map);
VALA_EXTERN Camera* import_page_get_camera (ImportPage* self);
VALA_EXTERN gchar* import_page_get_uri (ImportPage* self);
VALA_EXTERN gboolean import_page_is_busy (ImportPage* self);
static void import_page_real_init_actions (Page* base,
                                    gint selected_count,
                                    gint count);
VALA_EXTERN void page_set_action_sensitive (Page* self,
                                const gchar* name,
                                gboolean sensitive);
VALA_EXTERN gboolean import_page_is_refreshed (ImportPage* self);
VALA_EXTERN gchar* import_page_get_refresh_message (ImportPage* self);
static void import_page_update_status (ImportPage* self,
                                gboolean busy,
                                gboolean refreshed);
VALA_EXTERN gint view_collection_get_unfiltered_count (ViewCollection* self);
VALA_EXTERN gint view_collection_get_selected_count (ViewCollection* self);
VALA_EXTERN gint data_collection_get_count (DataCollection* self);
VALA_EXTERN void configuration_facade_set_display_photo_titles (ConfigurationFacade* self,
                                                    gboolean display);
static void import_page_real_switched_to (Page* base);
static void import_page_real_ready (Page* base);
static void import_page_try_refreshing_camera (ImportPage* self,
                                        gboolean fail_on_locked);
static ImportPageRefreshResult import_page_refresh_camera (ImportPage* self);
VALA_EXTERN void app_window_error_message (const gchar* message,
                               GtkWindow* parent);
VALA_EXTERN GMount* discovered_camera_get_mount (DiscoveredCamera* self);
VALA_EXTERN GType app_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AppWindow, g_object_unref)
VALA_EXTERN AppWindow* app_window_get_instance (void);
VALA_EXTERN void checkerboard_page_set_page_message (CheckerboardPage* self,
                                         const gchar* message);
VALA_EXTERN gboolean import_page_unmount_camera (ImportPage* self,
                                     GMount* mount);
static void import_page_on_unmounted (ImportPage* self,
                               GMount* mount);
static void _import_page_on_unmounted_g_mount_unmounted (GMount* _sender,
                                                  gpointer self);
static void import_page_on_unmount_finished (ImportPage* self,
                                      GObject* source,
                                      GAsyncResult* aresult);
static void _import_page_on_unmount_finished_gasync_ready_callback (GObject* source_object,
                                                             GAsyncResult* res,
                                                             gpointer self);
static gboolean __lambda23_ (ImportPage* self);
static gboolean ___lambda23__gsource_func (gpointer self);
static void import_page_clear_all_import_sources (ImportPage* self);
VALA_EXTERN Marker* data_collection_start_marking (DataCollection* self);
VALA_EXTERN void marker_mark_all (Marker* self);
VALA_EXTERN gint source_collection_destroy_marked (SourceCollection* self,
                                       Marker* marker,
                                       gboolean delete_backing,
                                       ProgressMonitor monitor,
                                       gpointer monitor_target,
                                       GeeList* not_removed);
static gboolean import_page_check_directory_exists (ImportPage* self,
                                             gint fsid,
                                             const gchar* dir,
                                             const gchar* search_target);
static gboolean ____lambda22_ (ImportPage* self);
static gboolean _____lambda22__gsource_func (gpointer self);
static gboolean import_page_enumerate_files (ImportPage* self,
                                      gint fsid,
                                      const gchar* dir,
                                      GeeArrayList* import_list);
static void import_page_auto_match_raw_jpeg (ImportPage* self,
                                      GeeArrayList* import_list);
static void import_page_load_previews_and_metadata (ImportPage* self,
                                             GeeList* import_list);
static gchar* import_page_chomp_ch (const gchar* str,
                             gchar ch);
VALA_EXTERN gchar* import_page_append_path (const gchar* basepath,
                                const gchar* addition);
VALA_EXTERN gchar* import_page_get_fs_basedir (Camera* camera,
                                   gint fsid);
VALA_EXTERN gboolean gp_get_info (GPContext* context,
                      Camera* camera,
                      const gchar* folder,
                      const gchar* filename,
                      CameraFileInfo* info,
                      GError** error);
VALA_EXTERN gboolean video_reader_is_supported_video_filename (const gchar* filename);
VALA_EXTERN PhotoFileFormat photo_file_format_from_gphoto_type (const gchar* type);
VALA_EXTERN PhotoFileFormat photo_file_format_get_by_basename_extension (const gchar* basename);
VALA_EXTERN void spin_event_loop (void);
VALA_EXTERN void disassemble_filename (const gchar* basename,
                           gchar** name,
                           gchar** ext);
VALA_EXTERN PhotoMetadata* gp_load_metadata (GPContext* context,
                                 Camera* camera,
                                 const gchar* folder,
                                 const gchar* filename,
                                 GError** error);
VALA_EXTERN gchar* photo_metadata_exif_hash (PhotoMetadata* self);
VALA_EXTERN GdkPixbuf* gp_load_preview (GPContext* context,
                            Camera* camera,
                            const gchar* folder,
                            const gchar* filename,
                            gchar** preview_md5,
                            GError** error);
VALA_EXTERN gboolean data_collection_add (DataCollection* self,
                              DataObject* object);
VALA_EXTERN void view_collection_install_view_filter (ViewCollection* self,
                                          ViewFilter* f);
VALA_EXTERN void view_collection_remove_view_filter (ViewCollection* self,
                                         ViewFilter* f);
VALA_EXTERN void configuration_facade_set_hide_photos_already_imported (ConfigurationFacade* self,
                                                            gboolean hide_imported);
static void import_page_import (ImportPage* self,
                         GeeIterable* items);
VALA_EXTERN GeeList* view_collection_get_selected (ViewCollection* self);
VALA_EXTERN GeeCollection* data_collection_get_all (DataCollection* self);
VALA_EXTERN GType sorted_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SortedList, g_object_unref)
static gint64 _import_page_import_job_comparator_comparator (void* a,
                                                      void* b,
                                                      gpointer self);
VALA_EXTERN SortedList* sorted_list_new (GType g_type,
                             GBoxedCopyFunc g_dup_func,
                             GDestroyNotify g_destroy_func,
                             Comparator cmp,
                             gpointer cmp_target);
VALA_EXTERN SortedList* sorted_list_construct (GType object_type,
                                   GType g_type,
                                   GBoxedCopyFunc g_dup_func,
                                   GDestroyNotify g_destroy_func,
                                   Comparator cmp,
                                   gpointer cmp_target);
static ImportPageCameraImportJob* import_page_camera_import_job_new (GPContextWrapper* context,
                                                              ImportSource* import_file,
                                                              DuplicatedFile* duplicated_file);
static ImportPageCameraImportJob* import_page_camera_import_job_construct (GType object_type,
                                                                    GPContextWrapper* context,
                                                                    ImportSource* import_file,
                                                                    DuplicatedFile* duplicated_file);
VALA_EXTERN void batch_import_job_set_associated (BatchImportJob* self,
                                      BatchImportJob* associated);
VALA_EXTERN GType batch_import_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BatchImport, g_object_unref)
VALA_EXTERN gpointer import_manifest_ref (gpointer instance);
VALA_EXTERN void import_manifest_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_import_manifest (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_import_manifest (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_import_manifest (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_import_manifest (const GValue* value);
VALA_EXTERN GType import_manifest_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ImportManifest, import_manifest_unref)
static void import_page_import_reporter (ImportPage* self,
                                  ImportManifest* manifest);
VALA_EXTERN gpointer batch_import_roll_ref (gpointer instance);
VALA_EXTERN void batch_import_roll_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_batch_import_roll (const gchar* name,
                                          const gchar* nick,
                                          const gchar* blurb,
                                          GType object_type,
                                          GParamFlags flags);
VALA_EXTERN void value_set_batch_import_roll (GValue* value,
                                  gpointer v_object);
VALA_EXTERN void value_take_batch_import_roll (GValue* value,
                                   gpointer v_object);
VALA_EXTERN gpointer value_get_batch_import_roll (const GValue* value);
VALA_EXTERN GType batch_import_roll_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BatchImportRoll, batch_import_roll_unref)
static void _import_page_import_reporter_batch_import_import_reporter (ImportManifest* manifest,
                                                                BatchImportRoll* import_roll,
                                                                gpointer self);
VALA_EXTERN BatchImport* batch_import_new (GeeIterable* jobs,
                               const gchar* name,
                               BatchImportImportReporter reporter,
                               gpointer reporter_target,
                               GeeArrayList* prefailed,
                               GeeArrayList* pre_already_imported,
                               GCancellable* cancellable,
                               BatchImportRoll* import_roll,
                               ImportManifest* skip_manifest);
VALA_EXTERN BatchImport* batch_import_construct (GType object_type,
                                     GeeIterable* jobs,
                                     const gchar* name,
                                     BatchImportImportReporter reporter,
                                     gpointer reporter_target,
                                     GeeArrayList* prefailed,
                                     GeeArrayList* pre_already_imported,
                                     GCancellable* cancellable,
                                     BatchImportRoll* import_roll,
                                     ImportManifest* skip_manifest);
VALA_EXTERN 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)
static void import_page_on_import_job_failed (ImportPage* self,
                                       BatchImportResult* _result_);
static void _import_page_on_import_job_failed_batch_import_import_job_failed (BatchImport* _sender,
                                                                       BatchImportResult* _result_,
                                                                       gpointer self);
static void import_page_close_import (ImportPage* self);
static void _import_page_close_import_batch_import_import_complete (BatchImport* _sender,
                                                             ImportManifest* manifest,
                                                             BatchImportRoll* import_roll,
                                                             gpointer self);
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_get_app (void);
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 ImportManifest* import_manifest_new (GeeList* prefailed,
                                     GeeList* pre_already_imported);
VALA_EXTERN ImportManifest* import_manifest_construct (GType object_type,
                                           GeeList* prefailed,
                                           GeeList* pre_already_imported);
VALA_EXTERN GType import_result_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gchar* import_ui_get_media_specific_string (GeeCollection* import_collection,
                                            const gchar* photos_msg,
                                            const gchar* videos_msg,
                                            const gchar* both_msg,
                                            const gchar* neither_msg);
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 ImportUIQuestionParams* import_ui_question_params_new (const gchar* question,
                                                       const gchar* yes_button,
                                                       const gchar* no_button);
VALA_EXTERN ImportUIQuestionParams* import_ui_question_params_construct (GType object_type,
                                                             const gchar* question,
                                                             const gchar* yes_button,
                                                             const gchar* no_button);
VALA_EXTERN gboolean import_ui_report_manifest (ImportManifest* manifest,
                                    gboolean show_dest_id,
                                    ImportUIQuestionParams* question);
VALA_EXTERN void marker_mark (Marker* self,
                  DataObject* object);
static ImportSource* import_page_camera_import_job_get_source (ImportPageCameraImportJob* self);
VALA_EXTERN GType progress_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProgressDialog, g_object_unref)
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 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 void progress_dialog_close (ProgressDialog* self);
static void import_page_real_set_display_titles (CheckerboardPage* base,
                                          gboolean display);
VALA_EXTERN void page_set_action_active (Page* self,
                             const gchar* name,
                             gboolean active);
static SearchViewFilter* import_page_real_get_search_view_filter (CheckerboardPage* base);
VALA_EXTERN DataView* view_manager_create_view (ViewManager* self,
                                    DataSource* source);
VALA_EXTERN ViewManager* view_manager_construct (GType object_type);
static DataView* import_page_import_view_manager_real_create_view (ViewManager* base,
                                                            DataSource* source);
static void import_page_import_view_manager_finalize (ViewManager * obj);
static GType import_page_import_view_manager_get_type_once (void);
VALA_EXTERN gpointer backing_photo_row_ref (gpointer instance);
VALA_EXTERN void backing_photo_row_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_backing_photo_row (const gchar* name,
                                          const gchar* nick,
                                          const gchar* blurb,
                                          GType object_type,
                                          GParamFlags flags);
VALA_EXTERN void value_set_backing_photo_row (GValue* value,
                                  gpointer v_object);
VALA_EXTERN void value_take_backing_photo_row (GValue* value,
                                   gpointer v_object);
VALA_EXTERN gpointer value_get_backing_photo_row (const GValue* value);
VALA_EXTERN GType backing_photo_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BackingPhotoRow, backing_photo_row_unref)
VALA_EXTERN DuplicatedFile* batch_import_job_get_duplicated_file (BatchImportJob* self);
VALA_EXTERN GDateTime* batch_import_job_get_exposure_time_override (BatchImportJob* self);
VALA_EXTERN gchar* batch_import_job_get_dest_identifier (BatchImportJob* self);
VALA_EXTERN gchar* batch_import_job_get_source_identifier (BatchImportJob* self);
VALA_EXTERN gchar* batch_import_job_get_basename (BatchImportJob* self);
VALA_EXTERN gchar* batch_import_job_get_path (BatchImportJob* self);
VALA_EXTERN gboolean batch_import_job_is_directory (BatchImportJob* self);
VALA_EXTERN gboolean batch_import_job_determine_file_size (BatchImportJob* self,
                                               guint64* filesize,
                                               GFile** file_or_dir);
VALA_EXTERN gboolean batch_import_job_prepare (BatchImportJob* self,
                                   GFile** file_to_import,
                                   gboolean* copy_to_library,
                                   GError** error);
VALA_EXTERN GFile* batch_import_job_get_associated_file (BatchImportJob* self);
VALA_EXTERN BatchImportJob* batch_import_job_construct (GType object_type);
static DuplicatedFile* import_page_camera_import_job_real_get_duplicated_file (BatchImportJob* base);
static GDateTime* import_page_camera_import_job_real_get_exposure_time_override (BatchImportJob* base);
static gchar* import_page_camera_import_job_real_get_dest_identifier (BatchImportJob* base);
static gchar* import_page_camera_import_job_real_get_source_identifier (BatchImportJob* base);
static gchar* import_page_camera_import_job_real_get_basename (BatchImportJob* base);
static gchar* import_page_camera_import_job_real_get_path (BatchImportJob* base);
static void import_page_camera_import_job_real_set_associated (BatchImportJob* base,
                                                        BatchImportJob* associated);
static gboolean import_page_camera_import_job_real_is_directory (BatchImportJob* base);
static gboolean import_page_camera_import_job_real_determine_file_size (BatchImportJob* base,
                                                                 guint64* filesize,
                                                                 GFile** file);
static gboolean import_page_camera_import_job_real_prepare (BatchImportJob* base,
                                                     GFile** file_to_import,
                                                     gboolean* copy_to_library,
                                                     GError** error);
VALA_EXTERN GFile* library_files_generate_unique_file (const gchar* basename,
                                           MediaMetadata* metadata,
                                           GDateTime* ts,
                                           gboolean* collision,
                                           GError** error);
VALA_EXTERN void library_monitor_blacklist_file (GFile* file,
                                     const gchar* reason);
VALA_EXTERN void gp_save_image (GPContext* context,
                    Camera* camera,
                    const gchar* folder,
                    const gchar* filename,
                    GFile* dest_file,
                    GError** error);
VALA_EXTERN void library_monitor_unblacklist_file (GFile* file);
VALA_EXTERN GType raw_developer_get_type (void) G_GNUC_CONST ;
VALA_EXTERN BackingPhotoRow* raw_developer_create_backing_row_for_development (RawDeveloper self,
                                                                   const gchar* raw_filepath,
                                                                   const gchar* camera_development_filename,
                                                                   GError** error);
VALA_EXTERN GType backing_photo_id_get_type (void) G_GNUC_CONST ;
VALA_EXTERN BackingPhotoID* backing_photo_id_dup (const BackingPhotoID* self);
VALA_EXTERN void backing_photo_id_free (BackingPhotoID* self);
static GFile* import_page_camera_import_job_real_get_associated_file (BatchImportJob* base);
static void import_page_camera_import_job_finalize (BatchImportJob * obj);
static GType import_page_camera_import_job_get_type_once (void);
VALA_EXTERN guint search_view_filter_get_criteria (SearchViewFilter* self);
VALA_EXTERN gboolean view_filter_predicate (ViewFilter* self,
                                DataView* view);
static guint import_page_import_page_search_view_filter_real_get_criteria (SearchViewFilter* base);
VALA_EXTERN GType search_filter_criteria_get_type (void) G_GNUC_CONST ;
static gboolean import_page_import_page_search_view_filter_real_predicate (ViewFilter* base,
                                                                    DataView* view);
VALA_EXTERN gboolean search_view_filter_filter_by_media_type (SearchViewFilter* self);
VALA_EXTERN gboolean search_view_filter_get_show_media_video (SearchViewFilter* self);
VALA_EXTERN gboolean search_view_filter_get_show_media_photos (SearchViewFilter* self);
VALA_EXTERN gboolean search_view_filter_get_show_media_raw (SearchViewFilter* self);
VALA_EXTERN gchar** search_view_filter_get_search_filter_words (SearchViewFilter* self,
                                                    gint* result_length1);
VALA_EXTERN SearchViewFilter* search_view_filter_construct (GType object_type);
static GType import_page_import_page_search_view_filter_get_type_once (void);
static gboolean import_page_hide_imported_view_filter_real_predicate (ViewFilter* base,
                                                               DataView* view);
VALA_EXTERN ViewFilter* view_filter_construct (GType object_type);
static GType import_page_hide_imported_view_filter_get_type_once (void);
static void import_page_finalize (GObject * obj);
static GType import_page_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GActionEntry IMPORT_PAGE_entries[3] = {{"ImportSelected", _import_page_on_import_selected_gsimple_action_activate_callback}, {"ImportAll", _import_page_on_import_all_gsimple_action_activate_callback}, {"ViewTitle", _page_on_action_toggle_gsimple_action_activate_callback, NULL, "false", _import_page_on_display_titles_gsimple_action_change_state_callback}};

ImportSourceCollection*
import_source_collection_construct (GType object_type,
                                    const gchar* name)
{
	ImportSourceCollection* self = NULL;
	g_return_val_if_fail (name != NULL, NULL);
	self = (ImportSourceCollection*) source_collection_construct (object_type, name);
	return self;
}

ImportSourceCollection*
import_source_collection_new (const gchar* name)
{
	return import_source_collection_construct (TYPE_IMPORT_SOURCE_COLLECTION, name);
}

static gboolean
import_source_collection_real_holds_type_of_source (SourceCollection* base,
                                                    DataSource* source)
{
	ImportSourceCollection * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_SOURCE_COLLECTION, ImportSourceCollection);
	g_return_val_if_fail (IS_DATA_SOURCE (source), FALSE);
	result = IS_IMPORT_SOURCE (source);
	return result;
}

static void
import_source_collection_class_init (ImportSourceCollectionClass * klass,
                                     gpointer klass_data)
{
	import_source_collection_parent_class = g_type_class_peek_parent (klass);
	((SourceCollectionClass *) klass)->holds_type_of_source = (gboolean (*) (SourceCollection*, DataSource*)) import_source_collection_real_holds_type_of_source;
}

static void
import_source_collection_instance_init (ImportSourceCollection * self,
                                        gpointer klass)
{
}

static GType
import_source_collection_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ImportSourceCollectionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) import_source_collection_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ImportSourceCollection), 0, (GInstanceInitFunc) import_source_collection_instance_init, NULL };
	GType import_source_collection_type_id;
	import_source_collection_type_id = g_type_register_static (TYPE_SOURCE_COLLECTION, "ImportSourceCollection", &g_define_type_info, 0);
	return import_source_collection_type_id;
}

GType
import_source_collection_get_type (void)
{
	static volatile gsize import_source_collection_type_id__once = 0;
	if (g_once_init_enter (&import_source_collection_type_id__once)) {
		GType import_source_collection_type_id;
		import_source_collection_type_id = import_source_collection_get_type_once ();
		g_once_init_leave (&import_source_collection_type_id__once, import_source_collection_type_id);
	}
	return import_source_collection_type_id__once;
}

static inline gpointer
import_source_get_instance_private (ImportSource* self)
{
	return G_STRUCT_MEMBER_P (self, ImportSource_private_offset);
}

static gpointer
_GPHOTO_REF_CAMERA0 (gpointer self)
{
	return self ? GPHOTO_REF_CAMERA (self) : NULL;
}

static gpointer
_g_date_time_ref0 (gpointer self)
{
	return self ? g_date_time_ref (self) : NULL;
}

ImportSource*
import_source_construct (GType object_type,
                         const gchar* camera_name,
                         Camera* camera,
                         gint fsid,
                         const gchar* folder,
                         const gchar* filename,
                         gulong file_size,
                         GDateTime* modification_time)
{
	ImportSource * self = NULL;
	gchar* _tmp0_;
	Camera* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GDateTime* _tmp4_;
	gchar* _tmp5_;
	g_return_val_if_fail (camera_name != NULL, NULL);
	g_return_val_if_fail (camera != NULL, NULL);
	g_return_val_if_fail (folder != NULL, NULL);
	g_return_val_if_fail (filename != NULL, NULL);
	g_return_val_if_fail (modification_time != NULL, NULL);
	self = (ImportSource*) thumbnail_source_construct (object_type, DATA_OBJECT_INVALID_OBJECT_ID);
	_tmp0_ = g_strdup (camera_name);
	_g_free0 (self->priv->camera_name);
	self->priv->camera_name = _tmp0_;
	_tmp1_ = _GPHOTO_REF_CAMERA0 (camera);
	_gp_camera_unref0 (self->priv->camera);
	self->priv->camera = _tmp1_;
	self->priv->fsid = fsid;
	_tmp2_ = g_strdup (folder);
	_g_free0 (self->priv->folder);
	self->priv->folder = _tmp2_;
	_tmp3_ = g_strdup (filename);
	_g_free0 (self->priv->filename);
	self->priv->filename = _tmp3_;
	self->priv->file_size = file_size;
	_tmp4_ = _g_date_time_ref0 (modification_time);
	_g_date_time_unref0 (self->priv->modification_time);
	self->priv->modification_time = _tmp4_;
	_tmp5_ = indexable_prepare_indexable_string (filename);
	_g_free0 (self->priv->indexable_keywords);
	self->priv->indexable_keywords = _tmp5_;
	return self;
}

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

void
import_source_set_preview (ImportSource* self,
                           GdkPixbuf* preview)
{
	GdkPixbuf* _tmp0_;
	g_return_if_fail (IS_IMPORT_SOURCE (self));
	g_return_if_fail ((preview == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (preview, gdk_pixbuf_get_type ()));
	_tmp0_ = _g_object_ref0 (preview);
	_g_object_unref0 (self->priv->preview);
	self->priv->preview = _tmp0_;
}

gchar*
import_source_get_camera_name (ImportSource* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), NULL);
	_tmp0_ = self->priv->camera_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

Camera*
import_source_get_camera (ImportSource* self)
{
	Camera* _tmp0_;
	Camera* _tmp1_;
	Camera* result;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), NULL);
	_tmp0_ = self->priv->camera;
	_tmp1_ = _GPHOTO_REF_CAMERA0 (_tmp0_);
	result = _tmp1_;
	return result;
}

gint
import_source_get_fsid (ImportSource* self)
{
	gint result;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), -1);
	result = self->priv->fsid;
	return result;
}

gchar*
import_source_get_folder (ImportSource* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), NULL);
	_tmp0_ = self->priv->folder;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
import_source_get_filename (ImportSource* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), NULL);
	_tmp0_ = self->priv->filename;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gulong
import_source_get_filesize (ImportSource* self)
{
	gulong result;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), 0UL);
	result = self->priv->file_size;
	return result;
}

GDateTime*
import_source_get_modification_time (ImportSource* self)
{
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* result;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), NULL);
	_tmp0_ = self->priv->modification_time;
	_tmp1_ = _g_date_time_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static GdkPixbuf*
import_source_real_get_preview (ImportSource* self)
{
	GdkPixbuf* _tmp0_;
	GdkPixbuf* _tmp1_;
	GdkPixbuf* result;
	_tmp0_ = self->priv->preview;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

GdkPixbuf*
import_source_get_preview (ImportSource* self)
{
	ImportSourceClass* _klass_;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), NULL);
	_klass_ = IMPORT_SOURCE_GET_CLASS (self);
	if (_klass_->get_preview) {
		return _klass_->get_preview (self);
	}
	return NULL;
}

static GDateTime*
import_source_real_get_exposure_time (ImportSource* self)
{
	GDateTime* _tmp0_;
	GDateTime* result;
	_tmp0_ = import_source_get_modification_time (self);
	result = _tmp0_;
	return result;
}

GDateTime*
import_source_get_exposure_time (ImportSource* self)
{
	ImportSourceClass* _klass_;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), NULL);
	_klass_ = IMPORT_SOURCE_GET_CLASS (self);
	if (_klass_->get_exposure_time) {
		return _klass_->get_exposure_time (self);
	}
	return NULL;
}

gchar*
import_source_get_fulldir (ImportSource* self)
{
	Camera* _tmp0_;
	Camera* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* result;
	g_return_val_if_fail (IS_IMPORT_SOURCE (self), NULL);
	_tmp0_ = import_source_get_camera (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = import_source_get_camera_name (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = import_source_get_folder (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = import_page_get_fulldir (_tmp1_, _tmp3_, import_source_get_fsid (self), _tmp5_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_g_free0 (_tmp3_);
	_gp_camera_unref0 (_tmp1_);
	result = _tmp7_;
	return result;
}

static gchar*
import_source_real_to_string (DataObject* base)
{
	ImportSource * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_SOURCE, ImportSource);
	_tmp0_ = import_source_get_camera_name (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = import_source_get_folder (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = import_source_get_filename (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strdup_printf ("%s %s/%s", _tmp1_, _tmp3_, _tmp5_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	result = _tmp7_;
	return result;
}

static gchar*
gp_result_to_full_string (int self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	_tmp0_ = gp_port_result_as_string (self);
	_tmp1_ = g_strdup_printf ("%s (%d)", _tmp0_, (gint) self);
	result = _tmp1_;
	return result;
}

static gboolean
import_source_real_internal_delete_backing (DataSource* base,
                                            GError** error)
{
	ImportSource * self;
	gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* fulldir = NULL;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	int _result_ = 0;
	Camera* _tmp10_;
	Camera* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GPSpinIdleWrapper* _tmp15_;
	GPContext* _tmp16_;
	int _tmp17_;
	gboolean _tmp23_ = FALSE;
	gboolean _tmp24_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_SOURCE, ImportSource);
	_tmp0_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->camera_name;
	g_debug ("ImportPage.vala:89: Deleting %s from %s", _tmp1_, _tmp2_);
	_g_free0 (_tmp1_);
	_tmp3_ = import_source_get_fulldir (self);
	fulldir = _tmp3_;
	_tmp4_ = fulldir;
	if (_tmp4_ == NULL) {
		gchar* _tmp5_;
		gchar* _tmp6_;
		const gchar* _tmp7_;
		gboolean _tmp8_ = FALSE;
		_tmp5_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
		_tmp6_ = _tmp5_;
		_tmp7_ = self->priv->camera_name;
		g_warning ("ImportPage.vala:93: Skipping deleting %s from %s: invalid folder name", _tmp6_, _tmp7_);
		_g_free0 (_tmp6_);
		_tmp8_ = DATA_SOURCE_CLASS (import_source_parent_class)->internal_delete_backing (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), TYPE_DATA_SOURCE, DataSource), &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp9_ = FALSE;
			g_propagate_error (error, _inner_error0_);
			_g_free0 (fulldir);
			return _tmp9_;
		}
		result = _tmp8_;
		_g_free0 (fulldir);
		return result;
	}
	_tmp10_ = import_source_get_camera (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = fulldir;
	_tmp13_ = import_source_get_filename (self);
	_tmp14_ = _tmp13_;
	_tmp15_ = import_page_spin_idle_context;
	_tmp16_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
	_tmp17_ = gp_camera_file_delete (_tmp11_, _tmp12_, _tmp14_, _tmp16_);
	_g_free0 (_tmp14_);
	_gp_camera_unref0 (_tmp11_);
	_result_ = _tmp17_;
	if (_result_ != GP_OK) {
		gchar* _tmp18_;
		gchar* _tmp19_;
		const gchar* _tmp20_;
		gchar* _tmp21_;
		gchar* _tmp22_;
		_tmp18_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
		_tmp19_ = _tmp18_;
		_tmp20_ = self->priv->camera_name;
		_tmp21_ = gp_result_to_full_string (_result_);
		_tmp22_ = _tmp21_;
		g_warning ("ImportPage.vala:101: Error deleting %s from %s: %s", _tmp19_, _tmp20_, _tmp22_);
		_g_free0 (_tmp22_);
		_g_free0 (_tmp19_);
	}
	_tmp24_ = DATA_SOURCE_CLASS (import_source_parent_class)->internal_delete_backing (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), TYPE_DATA_SOURCE, DataSource), &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp25_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		_g_free0 (fulldir);
		return _tmp25_;
	}
	if (_tmp24_) {
		_tmp23_ = _result_ == GP_OK;
	} else {
		_tmp23_ = FALSE;
	}
	result = _tmp23_;
	_g_free0 (fulldir);
	return result;
}

static const gchar*
import_source_real_get_indexable_keywords (Indexable* base)
{
	ImportSource * self;
	const gchar* _tmp0_;
	const gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_SOURCE, ImportSource);
	_tmp0_ = self->priv->indexable_keywords;
	result = _tmp0_;
	return result;
}

static void
import_source_class_init (ImportSourceClass * klass,
                          gpointer klass_data)
{
	import_source_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ImportSource_private_offset);
	((ImportSourceClass *) klass)->get_preview = (GdkPixbuf* (*) (ImportSource*)) import_source_real_get_preview;
	((ImportSourceClass *) klass)->get_exposure_time = (GDateTime* (*) (ImportSource*)) import_source_real_get_exposure_time;
	((DataObjectClass *) klass)->to_string = (gchar* (*) (DataObject*)) import_source_real_to_string;
	((DataSourceClass *) klass)->internal_delete_backing = (gboolean (*) (DataSource*, GError**)) import_source_real_internal_delete_backing;
	G_OBJECT_CLASS (klass)->finalize = import_source_finalize;
}

static void
import_source_indexable_interface_init (IndexableIface * iface,
                                        gpointer iface_data)
{
	import_source_indexable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_indexable_keywords = (const gchar* (*) (Indexable*)) import_source_real_get_indexable_keywords;
}

static void
import_source_instance_init (ImportSource * self,
                             gpointer klass)
{
	self->priv = import_source_get_instance_private (self);
	self->priv->preview = NULL;
	self->priv->indexable_keywords = NULL;
}

static void
import_source_finalize (GObject * obj)
{
	ImportSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_IMPORT_SOURCE, ImportSource);
	_g_free0 (self->priv->camera_name);
	_gp_camera_unref0 (self->priv->camera);
	_g_free0 (self->priv->folder);
	_g_free0 (self->priv->filename);
	_g_date_time_unref0 (self->priv->modification_time);
	_g_object_unref0 (self->priv->preview);
	_g_free0 (self->priv->indexable_keywords);
	G_OBJECT_CLASS (import_source_parent_class)->finalize (obj);
}

static GType
import_source_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ImportSourceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) import_source_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ImportSource), 0, (GInstanceInitFunc) import_source_instance_init, NULL };
	static const GInterfaceInfo indexable_info = { (GInterfaceInitFunc) import_source_indexable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType import_source_type_id;
	import_source_type_id = g_type_register_static (TYPE_THUMBNAIL_SOURCE, "ImportSource", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	g_type_add_interface_static (import_source_type_id, TYPE_INDEXABLE, &indexable_info);
	ImportSource_private_offset = g_type_add_instance_private (import_source_type_id, sizeof (ImportSourcePrivate));
	return import_source_type_id;
}

GType
import_source_get_type (void)
{
	static volatile gsize import_source_type_id__once = 0;
	if (g_once_init_enter (&import_source_type_id__once)) {
		GType import_source_type_id;
		import_source_type_id = import_source_get_type_once ();
		g_once_init_leave (&import_source_type_id__once, import_source_type_id);
	}
	return import_source_type_id__once;
}

VideoImportSource*
video_import_source_construct (GType object_type,
                               const gchar* camera_name,
                               Camera* camera,
                               gint fsid,
                               const gchar* folder,
                               const gchar* filename,
                               gulong file_size,
                               GDateTime* modification_time)
{
	VideoImportSource * self = NULL;
	g_return_val_if_fail (camera_name != NULL, NULL);
	g_return_val_if_fail (camera != NULL, NULL);
	g_return_val_if_fail (folder != NULL, NULL);
	g_return_val_if_fail (filename != NULL, NULL);
	g_return_val_if_fail (modification_time != NULL, NULL);
	self = (VideoImportSource*) import_source_construct (object_type, camera_name, camera, fsid, folder, filename, file_size, modification_time);
	return self;
}

VideoImportSource*
video_import_source_new (const gchar* camera_name,
                         Camera* camera,
                         gint fsid,
                         const gchar* folder,
                         const gchar* filename,
                         gulong file_size,
                         GDateTime* modification_time)
{
	return video_import_source_construct (TYPE_VIDEO_IMPORT_SOURCE, camera_name, camera, fsid, folder, filename, file_size, modification_time);
}

static GdkPixbuf*
video_import_source_real_get_thumbnail (ThumbnailSource* base,
                                        gint scale,
                                        GError** error)
{
	VideoImportSource * self;
	GdkPixbuf* _tmp0_ = NULL;
	GdkPixbuf* _tmp1_;
	GdkPixbuf* _tmp2_;
	GError* _inner_error0_ = NULL;
	GdkPixbuf* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_VIDEO_IMPORT_SOURCE, VideoImportSource);
	_tmp1_ = thumbnail_source_create_thumbnail (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), scale, &_inner_error0_);
	_tmp0_ = _tmp1_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	}
	_tmp2_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp2_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static GdkPixbuf*
video_import_source_real_create_thumbnail (ThumbnailSource* base,
                                           gint scale,
                                           GError** error)
{
	VideoImportSource * self;
	GdkPixbuf* _tmp0_;
	GdkPixbuf* _tmp1_;
	gboolean _tmp2_;
	GdkPixbuf* _tmp3_ = NULL;
	GdkPixbuf* _tmp8_;
	GdkPixbuf* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_VIDEO_IMPORT_SOURCE, VideoImportSource);
	_tmp0_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ == NULL;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		result = NULL;
		return result;
	}
	if (scale > 0) {
		GdkPixbuf* _tmp4_;
		GdkPixbuf* _tmp5_;
		GdkPixbuf* _tmp6_;
		_tmp4_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		_tmp5_ = _tmp4_;
		_tmp6_ = scale_pixbuf (_tmp5_, scale, GDK_INTERP_BILINEAR, TRUE);
		_g_object_unref0 (_tmp3_);
		_tmp3_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
	} else {
		GdkPixbuf* _tmp7_;
		_tmp7_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		_g_object_unref0 (_tmp3_);
		_tmp3_ = _tmp7_;
	}
	_tmp8_ = _tmp3_;
	_tmp3_ = NULL;
	result = _tmp8_;
	_g_object_unref0 (_tmp3_);
	return result;
}

static gchar*
video_import_source_real_get_typename (DataSource* base)
{
	VideoImportSource * self;
	gchar* _tmp0_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_VIDEO_IMPORT_SOURCE, VideoImportSource);
	_tmp0_ = g_strdup ("videoimport");
	result = _tmp0_;
	return result;
}

static gint64
video_import_source_real_get_instance_id (DataSource* base)
{
	VideoImportSource * self;
	gint64 result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_VIDEO_IMPORT_SOURCE, VideoImportSource);
	result = data_object_get_object_id (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
	return result;
}

static PhotoFileFormat
video_import_source_real_get_preferred_thumbnail_format (ThumbnailSource* base)
{
	VideoImportSource * self;
	PhotoFileFormat result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_VIDEO_IMPORT_SOURCE, VideoImportSource);
	result = photo_file_format_get_system_default_format ();
	return result;
}

static gchar*
video_import_source_real_get_name (DataObject* base)
{
	VideoImportSource * self;
	gchar* _tmp0_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_VIDEO_IMPORT_SOURCE, VideoImportSource);
	_tmp0_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
	result = _tmp0_;
	return result;
}

void
video_import_source_update (VideoImportSource* self,
                            GdkPixbuf* preview)
{
	GdkPixbuf* _tmp0_ = NULL;
	g_return_if_fail (IS_VIDEO_IMPORT_SOURCE (self));
	g_return_if_fail ((preview == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (preview, gdk_pixbuf_get_type ()));
	if (preview != NULL) {
		GdkPixbuf* _tmp1_;
		_tmp1_ = _g_object_ref0 (preview);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = _tmp1_;
	} else {
		GdkPixbuf* _tmp2_;
		_tmp2_ = resources_get_noninterpretable_badge_pixbuf ();
		_g_object_unref0 (_tmp0_);
		_tmp0_ = _tmp2_;
	}
	import_source_set_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource), _tmp0_);
	_g_object_unref0 (_tmp0_);
}

static void
video_import_source_class_init (VideoImportSourceClass * klass,
                                gpointer klass_data)
{
	video_import_source_parent_class = g_type_class_peek_parent (klass);
	((ThumbnailSourceClass *) klass)->get_thumbnail = (GdkPixbuf* (*) (ThumbnailSource*, gint, GError**)) video_import_source_real_get_thumbnail;
	((ThumbnailSourceClass *) klass)->create_thumbnail = (GdkPixbuf* (*) (ThumbnailSource*, gint, GError**)) video_import_source_real_create_thumbnail;
	((DataSourceClass *) klass)->get_typename = (gchar* (*) (DataSource*)) video_import_source_real_get_typename;
	((DataSourceClass *) klass)->get_instance_id = (gint64 (*) (DataSource*)) video_import_source_real_get_instance_id;
	((ThumbnailSourceClass *) klass)->get_preferred_thumbnail_format = (PhotoFileFormat (*) (ThumbnailSource*)) video_import_source_real_get_preferred_thumbnail_format;
	((DataObjectClass *) klass)->get_name = (gchar* (*) (DataObject*)) video_import_source_real_get_name;
}

static void
video_import_source_instance_init (VideoImportSource * self,
                                   gpointer klass)
{
}

static GType
video_import_source_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (VideoImportSourceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) video_import_source_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (VideoImportSource), 0, (GInstanceInitFunc) video_import_source_instance_init, NULL };
	GType video_import_source_type_id;
	video_import_source_type_id = g_type_register_static (TYPE_IMPORT_SOURCE, "VideoImportSource", &g_define_type_info, 0);
	return video_import_source_type_id;
}

GType
video_import_source_get_type (void)
{
	static volatile gsize video_import_source_type_id__once = 0;
	if (g_once_init_enter (&video_import_source_type_id__once)) {
		GType video_import_source_type_id;
		video_import_source_type_id = video_import_source_get_type_once ();
		g_once_init_leave (&video_import_source_type_id__once, video_import_source_type_id);
	}
	return video_import_source_type_id__once;
}

static inline gpointer
photo_import_source_get_instance_private (PhotoImportSource* self)
{
	return G_STRUCT_MEMBER_P (self, PhotoImportSource_private_offset);
}

PhotoImportSource*
photo_import_source_construct (GType object_type,
                               const gchar* camera_name,
                               Camera* camera,
                               gint fsid,
                               const gchar* folder,
                               const gchar* filename,
                               gulong file_size,
                               GDateTime* modification_time,
                               PhotoFileFormat file_format)
{
	PhotoImportSource * self = NULL;
	g_return_val_if_fail (camera_name != NULL, NULL);
	g_return_val_if_fail (camera != NULL, NULL);
	g_return_val_if_fail (folder != NULL, NULL);
	g_return_val_if_fail (filename != NULL, NULL);
	g_return_val_if_fail (modification_time != NULL, NULL);
	self = (PhotoImportSource*) import_source_construct (object_type, camera_name, camera, fsid, folder, filename, file_size, modification_time);
	self->priv->file_format = file_format;
	return self;
}

PhotoImportSource*
photo_import_source_new (const gchar* camera_name,
                         Camera* camera,
                         gint fsid,
                         const gchar* folder,
                         const gchar* filename,
                         gulong file_size,
                         GDateTime* modification_time,
                         PhotoFileFormat file_format)
{
	return photo_import_source_construct (TYPE_PHOTO_IMPORT_SOURCE, camera_name, camera, fsid, folder, filename, file_size, modification_time, file_format);
}

static gchar*
photo_import_source_real_get_name (DataObject* base)
{
	PhotoImportSource * self;
	gchar* title = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_;
	gchar* _tmp6_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	_tmp0_ = photo_import_source_get_title (self);
	title = _tmp0_;
	_tmp2_ = title;
	if (!is_string_empty (_tmp2_)) {
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp3_ = title;
		_tmp4_ = g_strdup (_tmp3_);
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp4_;
	} else {
		gchar* _tmp5_;
		_tmp5_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		_g_free0 (_tmp1_);
		_tmp1_ = _tmp5_;
	}
	_tmp6_ = _tmp1_;
	_tmp1_ = NULL;
	result = _tmp6_;
	_g_free0 (_tmp1_);
	_g_free0 (title);
	return result;
}

static gchar*
photo_import_source_real_get_typename (DataSource* base)
{
	PhotoImportSource * self;
	gchar* _tmp0_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	_tmp0_ = g_strdup ("photoimport");
	result = _tmp0_;
	return result;
}

static gint64
photo_import_source_real_get_instance_id (DataSource* base)
{
	PhotoImportSource * self;
	gint64 result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	result = data_object_get_object_id (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
	return result;
}

static PhotoFileFormat
photo_import_source_real_get_preferred_thumbnail_format (ThumbnailSource* base)
{
	PhotoImportSource * self;
	PhotoFileFormat _tmp0_ = 0;
	PhotoFileFormat result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	if (photo_file_format_can_write (self->priv->file_format)) {
		_tmp0_ = self->priv->file_format;
	} else {
		_tmp0_ = photo_file_format_get_system_default_format ();
	}
	result = _tmp0_;
	return result;
}

static GdkPixbuf*
photo_import_source_real_create_thumbnail (ThumbnailSource* base,
                                           gint scale,
                                           GError** error)
{
	PhotoImportSource * self;
	GdkPixbuf* _tmp0_;
	GdkPixbuf* _tmp1_;
	gboolean _tmp2_;
	GdkPixbuf* _tmp3_ = NULL;
	GdkPixbuf* _tmp8_;
	GdkPixbuf* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	_tmp0_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ == NULL;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		result = NULL;
		return result;
	}
	if (scale > 0) {
		GdkPixbuf* _tmp4_;
		GdkPixbuf* _tmp5_;
		GdkPixbuf* _tmp6_;
		_tmp4_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		_tmp5_ = _tmp4_;
		_tmp6_ = scale_pixbuf (_tmp5_, scale, PHOTO_IMPORT_SOURCE_INTERP, TRUE);
		_g_object_unref0 (_tmp3_);
		_tmp3_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
	} else {
		GdkPixbuf* _tmp7_;
		_tmp7_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		_g_object_unref0 (_tmp3_);
		_tmp3_ = _tmp7_;
	}
	_tmp8_ = _tmp3_;
	_tmp3_ = NULL;
	result = _tmp8_;
	_g_object_unref0 (_tmp3_);
	return result;
}

static gpointer
_media_metadata_ref0 (gpointer self)
{
	return self ? media_metadata_ref (self) : NULL;
}

void
photo_import_source_update (PhotoImportSource* self,
                            GdkPixbuf* preview,
                            const gchar* preview_md5,
                            PhotoMetadata* metadata,
                            const gchar* exif_md5)
{
	gchar* _tmp0_;
	PhotoMetadata* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (IS_PHOTO_IMPORT_SOURCE (self));
	g_return_if_fail ((preview == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (preview, gdk_pixbuf_get_type ()));
	g_return_if_fail ((metadata == NULL) || IS_PHOTO_METADATA (metadata));
	import_source_set_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource), preview);
	_tmp0_ = g_strdup (preview_md5);
	_g_free0 (self->priv->preview_md5);
	self->priv->preview_md5 = _tmp0_;
	_tmp1_ = _media_metadata_ref0 (metadata);
	_media_metadata_unref0 (self->priv->metadata);
	self->priv->metadata = _tmp1_;
	_tmp2_ = g_strdup (exif_md5);
	_g_free0 (self->priv->exif_md5);
	self->priv->exif_md5 = _tmp2_;
}

static GDateTime*
photo_import_source_real_get_exposure_time (ImportSource* base)
{
	PhotoImportSource * self;
	PhotoMetadata* _tmp0_;
	MetadataDateTime* date_time = NULL;
	PhotoMetadata* _tmp2_;
	MetadataDateTime* _tmp3_;
	GDateTime* _tmp4_ = NULL;
	MetadataDateTime* _tmp5_;
	GDateTime* _tmp9_;
	GDateTime* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	_tmp0_ = self->priv->metadata;
	if (_tmp0_ == NULL) {
		GDateTime* _tmp1_;
		_tmp1_ = import_source_get_modification_time (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		result = _tmp1_;
		return result;
	}
	_tmp2_ = self->priv->metadata;
	_tmp3_ = photo_metadata_get_exposure_date_time (_tmp2_);
	date_time = _tmp3_;
	_tmp5_ = date_time;
	if (_tmp5_ != NULL) {
		MetadataDateTime* _tmp6_;
		GDateTime* _tmp7_;
		_tmp6_ = date_time;
		_tmp7_ = metadata_date_time_get_timestamp (_tmp6_);
		_g_date_time_unref0 (_tmp4_);
		_tmp4_ = _tmp7_;
	} else {
		GDateTime* _tmp8_;
		_tmp8_ = import_source_get_modification_time (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		_g_date_time_unref0 (_tmp4_);
		_tmp4_ = _tmp8_;
	}
	_tmp9_ = _tmp4_;
	_tmp4_ = NULL;
	result = _tmp9_;
	_g_date_time_unref0 (_tmp4_);
	_metadata_date_time_unref0 (date_time);
	return result;
}

gchar*
photo_import_source_get_title (PhotoImportSource* self)
{
	gchar* _tmp0_ = NULL;
	PhotoMetadata* _tmp1_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (IS_PHOTO_IMPORT_SOURCE (self), NULL);
	_tmp1_ = self->priv->metadata;
	if (_tmp1_ != NULL) {
		PhotoMetadata* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = self->priv->metadata;
		_tmp3_ = media_metadata_get_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_MEDIA_METADATA, MediaMetadata));
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp3_;
	} else {
		_g_free0 (_tmp0_);
		_tmp0_ = NULL;
	}
	_tmp4_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp4_;
	_g_free0 (_tmp0_);
	return result;
}

PhotoMetadata*
photo_import_source_get_metadata (PhotoImportSource* self)
{
	PhotoImportSource* _tmp0_;
	PhotoMetadata* _tmp3_;
	PhotoMetadata* _tmp4_;
	PhotoMetadata* result;
	g_return_val_if_fail (IS_PHOTO_IMPORT_SOURCE (self), NULL);
	_tmp0_ = self->priv->associated;
	if (_tmp0_ != NULL) {
		PhotoImportSource* _tmp1_;
		PhotoMetadata* _tmp2_;
		_tmp1_ = self->priv->associated;
		_tmp2_ = photo_import_source_get_metadata (_tmp1_);
		result = _tmp2_;
		return result;
	}
	_tmp3_ = self->priv->metadata;
	_tmp4_ = _media_metadata_ref0 (_tmp3_);
	result = _tmp4_;
	return result;
}

static GdkPixbuf*
photo_import_source_real_get_preview (ImportSource* base)
{
	PhotoImportSource * self;
	PhotoImportSource* _tmp0_;
	GdkPixbuf* _tmp3_;
	GdkPixbuf* _tmp4_;
	gboolean _tmp5_;
	GdkPixbuf* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	_tmp0_ = self->priv->associated;
	if (_tmp0_ != NULL) {
		PhotoImportSource* _tmp1_;
		GdkPixbuf* _tmp2_;
		_tmp1_ = self->priv->associated;
		_tmp2_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_IMPORT_SOURCE, ImportSource));
		result = _tmp2_;
		return result;
	}
	_tmp3_ = IMPORT_SOURCE_CLASS (photo_import_source_parent_class)->get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_ != NULL;
	_g_object_unref0 (_tmp4_);
	if (_tmp5_) {
		GdkPixbuf* _tmp6_;
		_tmp6_ = IMPORT_SOURCE_CLASS (photo_import_source_parent_class)->get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		result = _tmp6_;
		return result;
	}
	result = NULL;
	return result;
}

static GdkPixbuf*
photo_import_source_real_get_thumbnail (ThumbnailSource* base,
                                        gint scale,
                                        GError** error)
{
	PhotoImportSource * self;
	GdkPixbuf* _tmp0_;
	GdkPixbuf* _tmp1_;
	gboolean _tmp2_;
	GdkPixbuf* _tmp3_ = NULL;
	GdkPixbuf* _tmp8_;
	GdkPixbuf* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	_tmp0_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_ == NULL;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		result = NULL;
		return result;
	}
	if (scale > 0) {
		GdkPixbuf* _tmp4_;
		GdkPixbuf* _tmp5_;
		GdkPixbuf* _tmp6_;
		_tmp4_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		_tmp5_ = _tmp4_;
		_tmp6_ = scale_pixbuf (_tmp5_, scale, PHOTO_IMPORT_SOURCE_INTERP, TRUE);
		_g_object_unref0 (_tmp3_);
		_tmp3_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
	} else {
		GdkPixbuf* _tmp7_;
		_tmp7_ = import_source_get_preview (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource));
		_g_object_unref0 (_tmp3_);
		_tmp3_ = _tmp7_;
	}
	_tmp8_ = _tmp3_;
	_tmp3_ = NULL;
	result = _tmp8_;
	_g_object_unref0 (_tmp3_);
	return result;
}

PhotoFileFormat
photo_import_source_get_file_format (PhotoImportSource* self)
{
	PhotoFileFormat result;
	g_return_val_if_fail (IS_PHOTO_IMPORT_SOURCE (self), 0);
	result = self->priv->file_format;
	return result;
}

gchar*
photo_import_source_get_preview_md5 (PhotoImportSource* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (IS_PHOTO_IMPORT_SOURCE (self), NULL);
	_tmp0_ = self->priv->preview_md5;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

void
photo_import_source_set_associated (PhotoImportSource* self,
                                    PhotoImportSource* associated)
{
	PhotoImportSource* _tmp0_;
	g_return_if_fail (IS_PHOTO_IMPORT_SOURCE (self));
	g_return_if_fail ((associated == NULL) || IS_PHOTO_IMPORT_SOURCE (associated));
	_tmp0_ = _g_object_ref0 (associated);
	_g_object_unref0 (self->priv->associated);
	self->priv->associated = _tmp0_;
}

PhotoImportSource*
photo_import_source_get_associated (PhotoImportSource* self)
{
	PhotoImportSource* _tmp0_;
	PhotoImportSource* _tmp1_;
	PhotoImportSource* result;
	g_return_val_if_fail (IS_PHOTO_IMPORT_SOURCE (self), NULL);
	_tmp0_ = self->priv->associated;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
photo_import_source_real_internal_delete_backing (DataSource* base,
                                                  GError** error)
{
	PhotoImportSource * self;
	gboolean ret = FALSE;
	PhotoImportSource* _tmp1_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	ret = DATA_SOURCE_CLASS (photo_import_source_parent_class)->internal_delete_backing (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_IMPORT_SOURCE, ImportSource), TYPE_DATA_SOURCE, DataSource), &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp0_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp0_;
	}
	_tmp1_ = self->priv->associated;
	if (_tmp1_ != NULL) {
		gboolean _tmp2_ = FALSE;
		PhotoImportSource* _tmp3_;
		_tmp3_ = self->priv->associated;
		_tmp2_ = data_source_internal_delete_backing (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_SOURCE, DataSource), &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp4_ = FALSE;
			g_propagate_error (error, _inner_error0_);
			return _tmp4_;
		}
		ret &= _tmp2_;
	}
	result = ret;
	return result;
}

static void
photo_import_source_class_init (PhotoImportSourceClass * klass,
                                gpointer klass_data)
{
	photo_import_source_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PhotoImportSource_private_offset);
	((DataObjectClass *) klass)->get_name = (gchar* (*) (DataObject*)) photo_import_source_real_get_name;
	((DataSourceClass *) klass)->get_typename = (gchar* (*) (DataSource*)) photo_import_source_real_get_typename;
	((DataSourceClass *) klass)->get_instance_id = (gint64 (*) (DataSource*)) photo_import_source_real_get_instance_id;
	((ThumbnailSourceClass *) klass)->get_preferred_thumbnail_format = (PhotoFileFormat (*) (ThumbnailSource*)) photo_import_source_real_get_preferred_thumbnail_format;
	((ThumbnailSourceClass *) klass)->create_thumbnail = (GdkPixbuf* (*) (ThumbnailSource*, gint, GError**)) photo_import_source_real_create_thumbnail;
	((ImportSourceClass *) klass)->get_exposure_time = (GDateTime* (*) (ImportSource*)) photo_import_source_real_get_exposure_time;
	((ImportSourceClass *) klass)->get_preview = (GdkPixbuf* (*) (ImportSource*)) photo_import_source_real_get_preview;
	((ThumbnailSourceClass *) klass)->get_thumbnail = (GdkPixbuf* (*) (ThumbnailSource*, gint, GError**)) photo_import_source_real_get_thumbnail;
	((DataSourceClass *) klass)->internal_delete_backing = (gboolean (*) (DataSource*, GError**)) photo_import_source_real_internal_delete_backing;
	G_OBJECT_CLASS (klass)->finalize = photo_import_source_finalize;
}

static void
photo_import_source_instance_init (PhotoImportSource * self,
                                   gpointer klass)
{
	self->priv = photo_import_source_get_instance_private (self);
	self->priv->preview_md5 = NULL;
	self->priv->metadata = NULL;
	self->priv->exif_md5 = NULL;
	self->priv->associated = NULL;
}

static void
photo_import_source_finalize (GObject * obj)
{
	PhotoImportSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource);
	_g_free0 (self->priv->preview_md5);
	_media_metadata_unref0 (self->priv->metadata);
	_g_free0 (self->priv->exif_md5);
	_g_object_unref0 (self->priv->associated);
	G_OBJECT_CLASS (photo_import_source_parent_class)->finalize (obj);
}

static GType
photo_import_source_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PhotoImportSourceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) photo_import_source_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhotoImportSource), 0, (GInstanceInitFunc) photo_import_source_instance_init, NULL };
	GType photo_import_source_type_id;
	photo_import_source_type_id = g_type_register_static (TYPE_IMPORT_SOURCE, "PhotoImportSource", &g_define_type_info, 0);
	PhotoImportSource_private_offset = g_type_add_instance_private (photo_import_source_type_id, sizeof (PhotoImportSourcePrivate));
	return photo_import_source_type_id;
}

GType
photo_import_source_get_type (void)
{
	static volatile gsize photo_import_source_type_id__once = 0;
	if (g_once_init_enter (&photo_import_source_type_id__once)) {
		GType photo_import_source_type_id;
		photo_import_source_type_id = photo_import_source_get_type_once ();
		g_once_init_leave (&photo_import_source_type_id__once, photo_import_source_type_id);
	}
	return photo_import_source_type_id__once;
}

static inline gpointer
import_preview_get_instance_private (ImportPreview* self)
{
	return G_STRUCT_MEMBER_P (self, ImportPreview_private_offset);
}

ImportPreview*
import_preview_construct (GType object_type,
                          ImportSource* source)
{
	ImportPreview * self = NULL;
	Dimensions _tmp0_ = {0};
	gchar* _tmp1_;
	gchar* _tmp2_;
	GdkPixbuf* pixbuf = NULL;
	gboolean using_placeholder = FALSE;
	GdkPixbuf* _tmp10_;
	GdkPixbuf* _tmp11_;
	gboolean _tmp18_ = FALSE;
	GdkPixbuf* _tmp19_;
	GdkPixbuf* _tmp39_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (IS_IMPORT_SOURCE (source), NULL);
	dimensions_init (&_tmp0_, 0, 0);
	_tmp1_ = data_object_get_name (G_TYPE_CHECK_INSTANCE_CAST (source, TYPE_DATA_OBJECT, DataObject));
	_tmp2_ = _tmp1_;
	self = (ImportPreview*) media_source_item_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (source, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), &_tmp0_, _tmp2_, NULL, FALSE, PANGO_ALIGN_LEFT);
	_g_free0 (_tmp2_);
	_g_object_unref0 (self->priv->duplicated_file);
	self->priv->duplicated_file = NULL;
	pixbuf = NULL;
	{
		GdkPixbuf* _tmp3_ = NULL;
		GdkPixbuf* _tmp4_;
		GdkPixbuf* _tmp5_;
		_tmp4_ = thumbnail_source_get_thumbnail (G_TYPE_CHECK_INSTANCE_CAST (source, TYPE_THUMBNAIL_SOURCE, ThumbnailSource), 0, &_inner_error0_);
		_tmp3_ = _tmp4_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp5_ = _tmp3_;
		_tmp3_ = NULL;
		_g_object_unref0 (pixbuf);
		pixbuf = _tmp5_;
		_g_object_unref0 (_tmp3_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		gchar* _tmp6_;
		gchar* _tmp7_;
		GError* _tmp8_;
		const gchar* _tmp9_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp6_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_OBJECT, DataObject));
		_tmp7_ = _tmp6_;
		_tmp8_ = err;
		_tmp9_ = _tmp8_->message;
		g_warning ("ImportPage.vala:281: Unable to fetch loaded import preview for %s: %s", _tmp7_, _tmp9_);
		_g_free0 (_tmp7_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (pixbuf);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
	_tmp10_ = pixbuf;
	using_placeholder = _tmp10_ == NULL;
	_tmp11_ = pixbuf;
	if (_tmp11_ == NULL) {
		GdkPixbuf* _tmp12_;
		GdkPixbuf* _tmp16_;
		GdkPixbuf* _tmp17_;
		_tmp12_ = import_preview_placeholder_preview;
		if (_tmp12_ == NULL) {
			GdkPixbuf* _tmp13_;
			GdkPixbuf* _tmp14_;
			GdkPixbuf* _tmp15_;
			_tmp13_ = get_placeholder_pixbuf ();
			_g_object_unref0 (import_preview_placeholder_preview);
			import_preview_placeholder_preview = _tmp13_;
			_tmp14_ = import_preview_placeholder_preview;
			_tmp15_ = scale_pixbuf (_tmp14_, IMPORT_PREVIEW_MAX_SCALE, GDK_INTERP_BILINEAR, TRUE);
			_g_object_unref0 (import_preview_placeholder_preview);
			import_preview_placeholder_preview = _tmp15_;
		}
		_tmp16_ = import_preview_placeholder_preview;
		_tmp17_ = _g_object_ref0 (_tmp16_);
		_g_object_unref0 (pixbuf);
		pixbuf = _tmp17_;
	}
	_tmp19_ = pixbuf;
	if (gdk_pixbuf_get_width (_tmp19_) > IMPORT_PREVIEW_MAX_SCALE) {
		_tmp18_ = TRUE;
	} else {
		GdkPixbuf* _tmp20_;
		_tmp20_ = pixbuf;
		_tmp18_ = gdk_pixbuf_get_height (_tmp20_) > IMPORT_PREVIEW_MAX_SCALE;
	}
	if (_tmp18_) {
		GdkPixbuf* _tmp21_;
		GdkPixbuf* _tmp22_;
		_tmp21_ = pixbuf;
		_tmp22_ = scale_pixbuf (_tmp21_, IMPORT_PREVIEW_MAX_SCALE, PHOTO_IMPORT_SOURCE_INTERP, FALSE);
		_g_object_unref0 (pixbuf);
		pixbuf = _tmp22_;
	}
	if (IS_PHOTO_IMPORT_SOURCE (source)) {
		PhotoImportSource* photo_import_source = NULL;
		PhotoImportSource* _tmp23_;
		gboolean _tmp24_ = FALSE;
		PhotoImportSource* _tmp33_;
		PhotoImportSource* _tmp34_;
		PhotoImportSource* _tmp35_;
		gboolean _tmp36_;
		_tmp23_ = _g_object_ref0 (IS_PHOTO_IMPORT_SOURCE (source) ? ((PhotoImportSource*) source) : NULL);
		photo_import_source = _tmp23_;
		if (!using_placeholder) {
			PhotoImportSource* _tmp25_;
			PhotoMetadata* _tmp26_;
			PhotoMetadata* _tmp27_;
			_tmp25_ = photo_import_source;
			_tmp26_ = photo_import_source_get_metadata (_tmp25_);
			_tmp27_ = _tmp26_;
			_tmp24_ = _tmp27_ != NULL;
			_media_metadata_unref0 (_tmp27_);
		} else {
			_tmp24_ = FALSE;
		}
		if (_tmp24_) {
			PhotoImportSource* _tmp28_;
			PhotoMetadata* _tmp29_;
			PhotoMetadata* _tmp30_;
			GdkPixbuf* _tmp31_;
			GdkPixbuf* _tmp32_;
			_tmp28_ = photo_import_source;
			_tmp29_ = photo_import_source_get_metadata (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = pixbuf;
			_tmp32_ = orientation_rotate_pixbuf (photo_metadata_get_orientation (_tmp30_), _tmp31_);
			_g_object_unref0 (pixbuf);
			pixbuf = _tmp32_;
			_media_metadata_unref0 (_tmp30_);
		}
		_tmp33_ = photo_import_source;
		_tmp34_ = photo_import_source_get_associated (_tmp33_);
		_tmp35_ = _tmp34_;
		_tmp36_ = _tmp35_ != NULL;
		_g_object_unref0 (_tmp35_);
		if (_tmp36_) {
			gchar* _tmp37_;
			gchar* _tmp38_;
			_tmp37_ = g_strdup_printf ("<small>%s</small>", _ ("RAW+JPEG"));
			_tmp38_ = _tmp37_;
			checkerboard_item_set_subtitle (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), _tmp38_, TRUE, PANGO_ALIGN_LEFT);
			_g_free0 (_tmp38_);
		}
		_g_object_unref0 (photo_import_source);
	}
	_tmp39_ = pixbuf;
	checkerboard_item_set_image (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), _tmp39_);
	_g_object_unref0 (pixbuf);
	return self;
}

ImportPreview*
import_preview_new (ImportSource* source)
{
	return import_preview_construct (TYPE_IMPORT_PREVIEW, source);
}

gboolean
import_preview_is_already_imported (ImportPreview* self)
{
	PhotoImportSource* photo_import_source = NULL;
	ImportSource* _tmp0_;
	PhotoImportSource* _tmp1_;
	PhotoImportSource* _tmp2_;
	VideoImportSource* video_import_source = NULL;
	ImportSource* _tmp38_;
	VideoImportSource* _tmp39_;
	VideoImportSource* _tmp40_;
	gboolean result;
	g_return_val_if_fail (IS_IMPORT_PREVIEW (self), FALSE);
	_tmp0_ = import_preview_get_import_source (self);
	_tmp1_ = IS_PHOTO_IMPORT_SOURCE (_tmp0_) ? ((PhotoImportSource*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	photo_import_source = _tmp1_;
	_tmp2_ = photo_import_source;
	if (_tmp2_ != NULL) {
		gchar* preview_md5 = NULL;
		PhotoImportSource* _tmp3_;
		gchar* _tmp4_;
		PhotoFileFormat file_format = 0;
		PhotoImportSource* _tmp5_;
		gboolean _tmp6_ = FALSE;
		const gchar* _tmp7_;
		_tmp3_ = photo_import_source;
		_tmp4_ = photo_import_source_get_preview_md5 (_tmp3_);
		preview_md5 = _tmp4_;
		_tmp5_ = photo_import_source;
		file_format = photo_import_source_get_file_format (_tmp5_);
		_tmp7_ = preview_md5;
		if (!is_string_empty (_tmp7_)) {
			const gchar* _tmp8_;
			_tmp8_ = preview_md5;
			_tmp6_ = library_photo_has_nontrash_duplicate (NULL, _tmp8_, NULL, file_format);
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			const gchar* _tmp9_;
			PhotoID _tmp10_ = {0};
			DuplicatedFile* _tmp11_;
			_tmp9_ = preview_md5;
			library_photo_get_nontrash_duplicate (NULL, _tmp9_, NULL, file_format, &_tmp10_);
			_tmp11_ = duplicated_file_create_from_photo_id (&_tmp10_);
			_g_object_unref0 (self->priv->duplicated_file);
			self->priv->duplicated_file = _tmp11_;
			result = TRUE;
			_g_free0 (preview_md5);
			_g_object_unref0 (photo_import_source);
			return result;
		}
		if (file_format == PHOTO_FILE_FORMAT_RAW) {
			guint64 filesize = 0ULL;
			ImportSource* _tmp12_;
			ImportSource* _tmp13_;
			guint64 _tmp14_;
			_tmp12_ = import_preview_get_import_source (self);
			_tmp13_ = _tmp12_;
			_tmp14_ = (guint64) import_source_get_filesize (_tmp13_);
			_g_object_unref0 (_tmp13_);
			filesize = _tmp14_;
			if (filesize <= ((guint64) G_MAXINT64)) {
				PhotoID duplicated_photo_id = {0};
				LibraryPhotoSourceCollection* _tmp15_;
				ImportSource* _tmp16_;
				ImportSource* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
				PhotoID _tmp20_ = {0};
				PhotoID _tmp21_;
				_tmp15_ = library_photo_global;
				_tmp16_ = import_preview_get_import_source (self);
				_tmp17_ = _tmp16_;
				_tmp18_ = import_source_get_filename (_tmp17_);
				_tmp19_ = _tmp18_;
				library_photo_source_collection_get_basename_filesize_duplicate (_tmp15_, _tmp19_, (gint64) filesize, &_tmp20_);
				_tmp21_ = _tmp20_;
				_g_free0 (_tmp19_);
				_g_object_unref0 (_tmp17_);
				duplicated_photo_id = _tmp21_;
				if (photo_id_is_valid (&duplicated_photo_id)) {
					LibraryPhoto* duplicated_photo = NULL;
					LibraryPhotoSourceCollection* _tmp22_;
					PhotoID _tmp23_;
					LibraryPhoto* _tmp24_;
					GDateTime* photo_exposure_time = NULL;
					PhotoImportSource* _tmp25_;
					GDateTime* _tmp26_;
					GDateTime* duplicated_photo_exposure_time = NULL;
					LibraryPhoto* _tmp27_;
					GDateTime* _tmp28_;
					GDateTime* _tmp29_;
					GDateTime* _tmp30_;
					_tmp22_ = library_photo_global;
					_tmp23_ = duplicated_photo_id;
					_tmp24_ = library_photo_source_collection_fetch (_tmp22_, &_tmp23_);
					duplicated_photo = _tmp24_;
					_tmp25_ = photo_import_source;
					_tmp26_ = import_source_get_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, TYPE_IMPORT_SOURCE, ImportSource));
					photo_exposure_time = _tmp26_;
					_tmp27_ = duplicated_photo;
					_tmp28_ = media_source_get_exposure_time (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, TYPE_MEDIA_SOURCE, MediaSource));
					duplicated_photo_exposure_time = _tmp28_;
					_tmp29_ = photo_exposure_time;
					_tmp30_ = duplicated_photo_exposure_time;
					if (g_date_time_equal (_tmp29_, _tmp30_)) {
						LibraryPhotoSourceCollection* _tmp31_;
						ImportSource* _tmp32_;
						ImportSource* _tmp33_;
						gchar* _tmp34_;
						gchar* _tmp35_;
						PhotoID _tmp36_ = {0};
						DuplicatedFile* _tmp37_;
						_tmp31_ = library_photo_global;
						_tmp32_ = import_preview_get_import_source (self);
						_tmp33_ = _tmp32_;
						_tmp34_ = import_source_get_filename (_tmp33_);
						_tmp35_ = _tmp34_;
						library_photo_source_collection_get_basename_filesize_duplicate (_tmp31_, _tmp35_, (gint64) filesize, &_tmp36_);
						_tmp37_ = duplicated_file_create_from_photo_id (&_tmp36_);
						_g_object_unref0 (self->priv->duplicated_file);
						self->priv->duplicated_file = _tmp37_;
						_g_free0 (_tmp35_);
						_g_object_unref0 (_tmp33_);
						result = TRUE;
						_g_date_time_unref0 (duplicated_photo_exposure_time);
						_g_date_time_unref0 (photo_exposure_time);
						_g_object_unref0 (duplicated_photo);
						_g_free0 (preview_md5);
						_g_object_unref0 (photo_import_source);
						return result;
					}
					_g_date_time_unref0 (duplicated_photo_exposure_time);
					_g_date_time_unref0 (photo_exposure_time);
					_g_object_unref0 (duplicated_photo);
				}
			}
		}
		result = FALSE;
		_g_free0 (preview_md5);
		_g_object_unref0 (photo_import_source);
		return result;
	}
	_tmp38_ = import_preview_get_import_source (self);
	_tmp39_ = IS_VIDEO_IMPORT_SOURCE (_tmp38_) ? ((VideoImportSource*) _tmp38_) : NULL;
	if (_tmp39_ == NULL) {
		_g_object_unref0 (_tmp38_);
	}
	video_import_source = _tmp39_;
	_tmp40_ = video_import_source;
	if (_tmp40_ != NULL) {
		VideoSourceCollection* _tmp41_;
		VideoImportSource* _tmp42_;
		gchar* _tmp43_;
		gchar* _tmp44_;
		VideoImportSource* _tmp45_;
		gboolean _tmp46_;
		_tmp41_ = video_global;
		_tmp42_ = video_import_source;
		_tmp43_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, TYPE_IMPORT_SOURCE, ImportSource));
		_tmp44_ = _tmp43_;
		_tmp45_ = video_import_source;
		_tmp46_ = video_source_collection_has_basename_filesize_duplicate (_tmp41_, _tmp44_, (guint64) import_source_get_filesize (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, TYPE_IMPORT_SOURCE, ImportSource)));
		_g_free0 (_tmp44_);
		if (_tmp46_) {
			VideoSourceCollection* _tmp47_;
			VideoImportSource* _tmp48_;
			gchar* _tmp49_;
			gchar* _tmp50_;
			VideoImportSource* _tmp51_;
			VideoID _tmp52_ = {0};
			DuplicatedFile* _tmp53_;
			_tmp47_ = video_global;
			_tmp48_ = video_import_source;
			_tmp49_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, TYPE_IMPORT_SOURCE, ImportSource));
			_tmp50_ = _tmp49_;
			_tmp51_ = video_import_source;
			video_source_collection_get_basename_filesize_duplicate (_tmp47_, _tmp50_, (guint64) import_source_get_filesize (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, TYPE_IMPORT_SOURCE, ImportSource)), &_tmp52_);
			_tmp53_ = duplicated_file_create_from_video_id (&_tmp52_);
			_g_object_unref0 (self->priv->duplicated_file);
			self->priv->duplicated_file = _tmp53_;
			_g_free0 (_tmp50_);
			result = TRUE;
			_g_object_unref0 (video_import_source);
			_g_object_unref0 (photo_import_source);
			return result;
		}
		result = FALSE;
		_g_object_unref0 (video_import_source);
		_g_object_unref0 (photo_import_source);
		return result;
	}
	result = FALSE;
	_g_object_unref0 (video_import_source);
	_g_object_unref0 (photo_import_source);
	return result;
}

DuplicatedFile*
import_preview_get_duplicated_file (ImportPreview* self)
{
	DuplicatedFile* _tmp0_;
	DuplicatedFile* _tmp1_;
	DuplicatedFile* result;
	g_return_val_if_fail (IS_IMPORT_PREVIEW (self), NULL);
	if (!import_preview_is_already_imported (self)) {
		result = NULL;
		return result;
	}
	_tmp0_ = self->priv->duplicated_file;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

ImportSource*
import_preview_get_import_source (ImportPreview* self)
{
	DataSource* _tmp0_;
	ImportSource* result;
	g_return_val_if_fail (IS_IMPORT_PREVIEW (self), NULL);
	_tmp0_ = data_view_get_source (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_DATA_VIEW, DataView));
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_IMPORT_SOURCE, ImportSource);
	return result;
}

static GdkPixbuf*
import_preview_real_get_top_left_trinket (CheckerboardItem* base,
                                          gint scale)
{
	ImportPreview * self;
	GdkPixbuf* _tmp0_ = NULL;
	ImportSource* _tmp1_;
	ImportSource* _tmp2_;
	gboolean _tmp3_;
	GdkPixbuf* _tmp5_;
	GdkPixbuf* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PREVIEW, ImportPreview);
	_tmp1_ = import_preview_get_import_source (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = IS_VIDEO_IMPORT_SOURCE (_tmp2_);
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		GdkPixbuf* _tmp4_;
		_tmp4_ = resources_get_video_trinket (scale);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = _tmp4_;
	} else {
		_g_object_unref0 (_tmp0_);
		_tmp0_ = NULL;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp5_;
	_g_object_unref0 (_tmp0_);
	return result;
}

static void
import_preview_class_init (ImportPreviewClass * klass,
                           gpointer klass_data)
{
	import_preview_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ImportPreview_private_offset);
	((CheckerboardItemClass *) klass)->get_top_left_trinket = (GdkPixbuf* (*) (CheckerboardItem*, gint)) import_preview_real_get_top_left_trinket;
	G_OBJECT_CLASS (klass)->finalize = import_preview_finalize;
}

static void
import_preview_instance_init (ImportPreview * self,
                              gpointer klass)
{
	self->priv = import_preview_get_instance_private (self);
}

static void
import_preview_finalize (GObject * obj)
{
	ImportPreview * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_IMPORT_PREVIEW, ImportPreview);
	_g_object_unref0 (self->priv->duplicated_file);
	G_OBJECT_CLASS (import_preview_parent_class)->finalize (obj);
}

static GType
import_preview_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ImportPreviewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) import_preview_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ImportPreview), 0, (GInstanceInitFunc) import_preview_instance_init, NULL };
	GType import_preview_type_id;
	import_preview_type_id = g_type_register_static (TYPE_MEDIA_SOURCE_ITEM, "ImportPreview", &g_define_type_info, 0);
	ImportPreview_private_offset = g_type_add_instance_private (import_preview_type_id, sizeof (ImportPreviewPrivate));
	return import_preview_type_id;
}

GType
import_preview_get_type (void)
{
	static volatile gsize import_preview_type_id__once = 0;
	if (g_once_init_enter (&import_preview_type_id__once)) {
		GType import_preview_type_id;
		import_preview_type_id = import_preview_get_type_once ();
		g_once_init_leave (&import_preview_type_id__once, import_preview_type_id);
	}
	return import_preview_type_id__once;
}

CameraViewTracker*
camera_view_tracker_construct (GType object_type,
                               ViewCollection* collection)
{
	CameraViewTracker* self = NULL;
	CameraAccumulator* _tmp0_;
	CameraAccumulator* _tmp1_;
	CameraAccumulator* _tmp2_;
	g_return_val_if_fail (IS_VIEW_COLLECTION (collection), NULL);
	self = (CameraViewTracker*) core_view_tracker_construct (object_type, collection);
	_tmp0_ = self->all;
	_tmp1_ = self->visible;
	_tmp2_ = self->selected;
	core_view_tracker_start (G_TYPE_CHECK_INSTANCE_CAST (self, CORE_TYPE_VIEW_TRACKER, CoreViewTracker), G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CORE_TYPE_TRACKER_ACCUMULATOR, CoreTrackerAccumulator), G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, CORE_TYPE_TRACKER_ACCUMULATOR, CoreTrackerAccumulator), G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, CORE_TYPE_TRACKER_ACCUMULATOR, CoreTrackerAccumulator));
	return self;
}

CameraViewTracker*
camera_view_tracker_new (ViewCollection* collection)
{
	return camera_view_tracker_construct (TYPE_CAMERA_VIEW_TRACKER, collection);
}

static void
camera_view_tracker_class_init (CameraViewTrackerClass * klass,
                                gpointer klass_data)
{
	camera_view_tracker_parent_class = g_type_class_peek_parent (klass);
	((CoreTrackerClass *) klass)->finalize = camera_view_tracker_finalize;
}

static void
camera_view_tracker_instance_init (CameraViewTracker * self,
                                   gpointer klass)
{
	CameraAccumulator* _tmp0_;
	CameraAccumulator* _tmp1_;
	CameraAccumulator* _tmp2_;
	_tmp0_ = camera_accumulator_new ();
	self->all = _tmp0_;
	_tmp1_ = camera_accumulator_new ();
	self->visible = _tmp1_;
	_tmp2_ = camera_accumulator_new ();
	self->selected = _tmp2_;
}

static void
camera_view_tracker_finalize (CoreTracker * obj)
{
	CameraViewTracker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CAMERA_VIEW_TRACKER, CameraViewTracker);
	_g_object_unref0 (self->all);
	_g_object_unref0 (self->visible);
	_g_object_unref0 (self->selected);
	CORE_TRACKER_CLASS (camera_view_tracker_parent_class)->finalize (obj);
}

static GType
camera_view_tracker_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CameraViewTrackerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) camera_view_tracker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CameraViewTracker), 0, (GInstanceInitFunc) camera_view_tracker_instance_init, NULL };
	GType camera_view_tracker_type_id;
	camera_view_tracker_type_id = g_type_register_static (CORE_TYPE_VIEW_TRACKER, "CameraViewTracker", &g_define_type_info, 0);
	return camera_view_tracker_type_id;
}

GType
camera_view_tracker_get_type (void)
{
	static volatile gsize camera_view_tracker_type_id__once = 0;
	if (g_once_init_enter (&camera_view_tracker_type_id__once)) {
		GType camera_view_tracker_type_id;
		camera_view_tracker_type_id = camera_view_tracker_get_type_once ();
		g_once_init_leave (&camera_view_tracker_type_id__once, camera_view_tracker_type_id);
	}
	return camera_view_tracker_type_id__once;
}

static inline gpointer
camera_accumulator_get_instance_private (CameraAccumulator* self)
{
	return G_STRUCT_MEMBER_P (self, CameraAccumulator_private_offset);
}

static gboolean
camera_accumulator_real_include (CoreTrackerAccumulator* base,
                                 DataObject* object)
{
	CameraAccumulator * self;
	ImportSource* source = NULL;
	DataSource* _tmp0_;
	gint _tmp1_;
	PhotoImportSource* photo = NULL;
	ImportSource* _tmp2_;
	PhotoImportSource* _tmp3_;
	gboolean _tmp4_ = FALSE;
	PhotoImportSource* _tmp5_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CAMERA_ACCUMULATOR, CameraAccumulator);
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
	_tmp0_ = data_view_get_source (G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_DATA_VIEW, DataView));
	source = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_IMPORT_SOURCE, ImportSource);
	_tmp1_ = self->priv->_total;
	camera_accumulator_set_total (self, _tmp1_ + 1);
	_tmp2_ = source;
	_tmp3_ = _g_object_ref0 (IS_PHOTO_IMPORT_SOURCE (_tmp2_) ? ((PhotoImportSource*) _tmp2_) : NULL);
	photo = _tmp3_;
	_tmp5_ = photo;
	if (_tmp5_ != NULL) {
		PhotoImportSource* _tmp6_;
		_tmp6_ = photo;
		_tmp4_ = photo_import_source_get_file_format (_tmp6_) != PHOTO_FILE_FORMAT_RAW;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		gint _tmp7_;
		_tmp7_ = self->priv->_photos;
		camera_accumulator_set_photos (self, _tmp7_ + 1);
	} else {
		gboolean _tmp8_ = FALSE;
		PhotoImportSource* _tmp9_;
		_tmp9_ = photo;
		if (_tmp9_ != NULL) {
			PhotoImportSource* _tmp10_;
			_tmp10_ = photo;
			_tmp8_ = photo_import_source_get_file_format (_tmp10_) == PHOTO_FILE_FORMAT_RAW;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			gint _tmp11_;
			_tmp11_ = self->priv->_raw;
			camera_accumulator_set_raw (self, _tmp11_ + 1);
		} else {
			ImportSource* _tmp12_;
			_tmp12_ = source;
			if (IS_VIDEO_IMPORT_SOURCE (_tmp12_)) {
				gint _tmp13_;
				_tmp13_ = self->priv->_videos;
				camera_accumulator_set_videos (self, _tmp13_ + 1);
			}
		}
	}
	result = TRUE;
	_g_object_unref0 (photo);
	_g_object_unref0 (source);
	return result;
}

static gboolean
camera_accumulator_real_uninclude (CoreTrackerAccumulator* base,
                                   DataObject* object)
{
	CameraAccumulator * self;
	ImportSource* source = NULL;
	DataSource* _tmp0_;
	gint _tmp1_;
	PhotoImportSource* photo = NULL;
	ImportSource* _tmp2_;
	PhotoImportSource* _tmp3_;
	gboolean _tmp4_ = FALSE;
	PhotoImportSource* _tmp5_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CAMERA_ACCUMULATOR, CameraAccumulator);
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
	_tmp0_ = data_view_get_source (G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_DATA_VIEW, DataView));
	source = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_IMPORT_SOURCE, ImportSource);
	_tmp1_ = self->priv->_total;
	camera_accumulator_set_total (self, _tmp1_ + 1);
	_tmp2_ = source;
	_tmp3_ = _g_object_ref0 (IS_PHOTO_IMPORT_SOURCE (_tmp2_) ? ((PhotoImportSource*) _tmp2_) : NULL);
	photo = _tmp3_;
	_tmp5_ = photo;
	if (_tmp5_ != NULL) {
		PhotoImportSource* _tmp6_;
		_tmp6_ = photo;
		_tmp4_ = photo_import_source_get_file_format (_tmp6_) != PHOTO_FILE_FORMAT_RAW;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		gint _tmp7_;
		gint _tmp8_;
		_tmp7_ = self->priv->_photos;
		_vala_assert (_tmp7_ > 0, "photos > 0");
		_tmp8_ = self->priv->_photos;
		camera_accumulator_set_photos (self, _tmp8_ - 1);
	} else {
		gboolean _tmp9_ = FALSE;
		PhotoImportSource* _tmp10_;
		_tmp10_ = photo;
		if (_tmp10_ != NULL) {
			PhotoImportSource* _tmp11_;
			_tmp11_ = photo;
			_tmp9_ = photo_import_source_get_file_format (_tmp11_) == PHOTO_FILE_FORMAT_RAW;
		} else {
			_tmp9_ = FALSE;
		}
		if (_tmp9_) {
			gint _tmp12_;
			gint _tmp13_;
			_tmp12_ = self->priv->_raw;
			_vala_assert (_tmp12_ > 0, "raw > 0");
			_tmp13_ = self->priv->_raw;
			camera_accumulator_set_raw (self, _tmp13_ - 1);
		} else {
			ImportSource* _tmp14_;
			_tmp14_ = source;
			if (IS_VIDEO_IMPORT_SOURCE (_tmp14_)) {
				gint _tmp15_;
				gint _tmp16_;
				_tmp15_ = self->priv->_videos;
				_vala_assert (_tmp15_ > 0, "videos > 0");
				_tmp16_ = self->priv->_videos;
				camera_accumulator_set_videos (self, _tmp16_ - 1);
			}
		}
	}
	result = TRUE;
	_g_object_unref0 (photo);
	_g_object_unref0 (source);
	return result;
}

static gboolean
camera_accumulator_real_altered (CoreTrackerAccumulator* base,
                                 DataObject* object,
                                 Alteration* alteration)
{
	CameraAccumulator * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CAMERA_ACCUMULATOR, CameraAccumulator);
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
	g_return_val_if_fail (IS_ALTERATION (alteration), FALSE);
	result = FALSE;
	return result;
}

gchar*
camera_accumulator_to_string (CameraAccumulator* self)
{
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (IS_CAMERA_ACCUMULATOR (self), NULL);
	_tmp0_ = self->priv->_total;
	_tmp1_ = self->priv->_photos;
	_tmp2_ = self->priv->_videos;
	_tmp3_ = self->priv->_raw;
	_tmp4_ = g_strdup_printf ("%d total/%d photos/%d videos/%d raw", _tmp0_, _tmp1_, _tmp2_, _tmp3_);
	result = _tmp4_;
	return result;
}

CameraAccumulator*
camera_accumulator_construct (GType object_type)
{
	CameraAccumulator * self = NULL;
	self = (CameraAccumulator*) g_object_new (object_type, NULL);
	return self;
}

CameraAccumulator*
camera_accumulator_new (void)
{
	return camera_accumulator_construct (TYPE_CAMERA_ACCUMULATOR);
}

gint
camera_accumulator_get_total (CameraAccumulator* self)
{
	gint result;
	g_return_val_if_fail (IS_CAMERA_ACCUMULATOR (self), -1);
	result = self->priv->_total;
	return result;
}

static void
camera_accumulator_set_total (CameraAccumulator* self,
                              gint value)
{
	gint old_value;
	g_return_if_fail (IS_CAMERA_ACCUMULATOR (self));
	old_value = camera_accumulator_get_total (self);
	if (old_value != value) {
		self->priv->_total = value;
		g_object_notify_by_pspec ((GObject *) self, camera_accumulator_properties[CAMERA_ACCUMULATOR_TOTAL_PROPERTY]);
	}
}

gint
camera_accumulator_get_photos (CameraAccumulator* self)
{
	gint result;
	g_return_val_if_fail (IS_CAMERA_ACCUMULATOR (self), -1);
	result = self->priv->_photos;
	return result;
}

static void
camera_accumulator_set_photos (CameraAccumulator* self,
                               gint value)
{
	gint old_value;
	g_return_if_fail (IS_CAMERA_ACCUMULATOR (self));
	old_value = camera_accumulator_get_photos (self);
	if (old_value != value) {
		self->priv->_photos = value;
		g_object_notify_by_pspec ((GObject *) self, camera_accumulator_properties[CAMERA_ACCUMULATOR_PHOTOS_PROPERTY]);
	}
}

gint
camera_accumulator_get_videos (CameraAccumulator* self)
{
	gint result;
	g_return_val_if_fail (IS_CAMERA_ACCUMULATOR (self), -1);
	result = self->priv->_videos;
	return result;
}

static void
camera_accumulator_set_videos (CameraAccumulator* self,
                               gint value)
{
	gint old_value;
	g_return_if_fail (IS_CAMERA_ACCUMULATOR (self));
	old_value = camera_accumulator_get_videos (self);
	if (old_value != value) {
		self->priv->_videos = value;
		g_object_notify_by_pspec ((GObject *) self, camera_accumulator_properties[CAMERA_ACCUMULATOR_VIDEOS_PROPERTY]);
	}
}

gint
camera_accumulator_get_raw (CameraAccumulator* self)
{
	gint result;
	g_return_val_if_fail (IS_CAMERA_ACCUMULATOR (self), -1);
	result = self->priv->_raw;
	return result;
}

static void
camera_accumulator_set_raw (CameraAccumulator* self,
                            gint value)
{
	gint old_value;
	g_return_if_fail (IS_CAMERA_ACCUMULATOR (self));
	old_value = camera_accumulator_get_raw (self);
	if (old_value != value) {
		self->priv->_raw = value;
		g_object_notify_by_pspec ((GObject *) self, camera_accumulator_properties[CAMERA_ACCUMULATOR_RAW_PROPERTY]);
	}
}

static void
camera_accumulator_class_init (CameraAccumulatorClass * klass,
                               gpointer klass_data)
{
	camera_accumulator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CameraAccumulator_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_camera_accumulator_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_camera_accumulator_set_property;
	G_OBJECT_CLASS (klass)->finalize = camera_accumulator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CAMERA_ACCUMULATOR_TOTAL_PROPERTY, camera_accumulator_properties[CAMERA_ACCUMULATOR_TOTAL_PROPERTY] = g_param_spec_int ("total", "total", "total", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CAMERA_ACCUMULATOR_PHOTOS_PROPERTY, camera_accumulator_properties[CAMERA_ACCUMULATOR_PHOTOS_PROPERTY] = g_param_spec_int ("photos", "photos", "photos", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CAMERA_ACCUMULATOR_VIDEOS_PROPERTY, camera_accumulator_properties[CAMERA_ACCUMULATOR_VIDEOS_PROPERTY] = g_param_spec_int ("videos", "videos", "videos", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CAMERA_ACCUMULATOR_RAW_PROPERTY, camera_accumulator_properties[CAMERA_ACCUMULATOR_RAW_PROPERTY] = g_param_spec_int ("raw", "raw", "raw", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
camera_accumulator_core_tracker_accumulator_interface_init (CoreTrackerAccumulatorIface * iface,
                                                            gpointer iface_data)
{
	camera_accumulator_core_tracker_accumulator_parent_iface = g_type_interface_peek_parent (iface);
	iface->include = (gboolean (*) (CoreTrackerAccumulator*, DataObject*)) camera_accumulator_real_include;
	iface->uninclude = (gboolean (*) (CoreTrackerAccumulator*, DataObject*)) camera_accumulator_real_uninclude;
	iface->altered = (gboolean (*) (CoreTrackerAccumulator*, DataObject*, Alteration*)) camera_accumulator_real_altered;
}

static void
camera_accumulator_instance_init (CameraAccumulator * self,
                                  gpointer klass)
{
	self->priv = camera_accumulator_get_instance_private (self);
	self->priv->_total = 0;
	self->priv->_photos = 0;
	self->priv->_videos = 0;
	self->priv->_raw = 0;
}

static void
camera_accumulator_finalize (GObject * obj)
{
	CameraAccumulator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CAMERA_ACCUMULATOR, CameraAccumulator);
	G_OBJECT_CLASS (camera_accumulator_parent_class)->finalize (obj);
}

static GType
camera_accumulator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CameraAccumulatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) camera_accumulator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CameraAccumulator), 0, (GInstanceInitFunc) camera_accumulator_instance_init, NULL };
	static const GInterfaceInfo core_tracker_accumulator_info = { (GInterfaceInitFunc) camera_accumulator_core_tracker_accumulator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType camera_accumulator_type_id;
	camera_accumulator_type_id = g_type_register_static (G_TYPE_OBJECT, "CameraAccumulator", &g_define_type_info, 0);
	g_type_add_interface_static (camera_accumulator_type_id, CORE_TYPE_TRACKER_ACCUMULATOR, &core_tracker_accumulator_info);
	CameraAccumulator_private_offset = g_type_add_instance_private (camera_accumulator_type_id, sizeof (CameraAccumulatorPrivate));
	return camera_accumulator_type_id;
}

GType
camera_accumulator_get_type (void)
{
	static volatile gsize camera_accumulator_type_id__once = 0;
	if (g_once_init_enter (&camera_accumulator_type_id__once)) {
		GType camera_accumulator_type_id;
		camera_accumulator_type_id = camera_accumulator_get_type_once ();
		g_once_init_leave (&camera_accumulator_type_id__once, camera_accumulator_type_id);
	}
	return camera_accumulator_type_id__once;
}

static void
_vala_camera_accumulator_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	CameraAccumulator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CAMERA_ACCUMULATOR, CameraAccumulator);
	switch (property_id) {
		case CAMERA_ACCUMULATOR_TOTAL_PROPERTY:
		g_value_set_int (value, camera_accumulator_get_total (self));
		break;
		case CAMERA_ACCUMULATOR_PHOTOS_PROPERTY:
		g_value_set_int (value, camera_accumulator_get_photos (self));
		break;
		case CAMERA_ACCUMULATOR_VIDEOS_PROPERTY:
		g_value_set_int (value, camera_accumulator_get_videos (self));
		break;
		case CAMERA_ACCUMULATOR_RAW_PROPERTY:
		g_value_set_int (value, camera_accumulator_get_raw (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_camera_accumulator_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	CameraAccumulator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CAMERA_ACCUMULATOR, CameraAccumulator);
	switch (property_id) {
		case CAMERA_ACCUMULATOR_TOTAL_PROPERTY:
		camera_accumulator_set_total (self, g_value_get_int (value));
		break;
		case CAMERA_ACCUMULATOR_PHOTOS_PROPERTY:
		camera_accumulator_set_photos (self, g_value_get_int (value));
		break;
		case CAMERA_ACCUMULATOR_VIDEOS_PROPERTY:
		camera_accumulator_set_videos (self, g_value_get_int (value));
		break;
		case CAMERA_ACCUMULATOR_RAW_PROPERTY:
		camera_accumulator_set_raw (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
import_page_get_instance_private (ImportPage* self)
{
	return G_STRUCT_MEMBER_P (self, ImportPage_private_offset);
}

static void
_import_page_on_media_added_removed_data_collection_contents_altered (DataCollection* _sender,
                                                                      GeeIterable* added,
                                                                      GeeIterable* removed,
                                                                      gpointer self)
{
	import_page_on_media_added_removed ((ImportPage*) self);
}

static GType
import_page_refresh_result_get_type_once (void)
{
	static const GEnumValue values[] = {{IMPORT_PAGE_REFRESH_RESULT_OK, "IMPORT_PAGE_REFRESH_RESULT_OK", "ok"}, {IMPORT_PAGE_REFRESH_RESULT_BUSY, "IMPORT_PAGE_REFRESH_RESULT_BUSY", "busy"}, {IMPORT_PAGE_REFRESH_RESULT_LOCKED, "IMPORT_PAGE_REFRESH_RESULT_LOCKED", "locked"}, {IMPORT_PAGE_REFRESH_RESULT_LIBRARY_ERROR, "IMPORT_PAGE_REFRESH_RESULT_LIBRARY_ERROR", "library-error"}, {0, NULL, NULL}};
	GType import_page_refresh_result_type_id;
	import_page_refresh_result_type_id = g_enum_register_static ("ImportPageRefreshResult", values);
	return import_page_refresh_result_type_id;
}

GType
import_page_refresh_result_get_type (void)
{
	static volatile gsize import_page_refresh_result_type_id__once = 0;
	if (g_once_init_enter (&import_page_refresh_result_type_id__once)) {
		GType import_page_refresh_result_type_id;
		import_page_refresh_result_type_id = import_page_refresh_result_get_type_once ();
		g_once_init_leave (&import_page_refresh_result_type_id__once, import_page_refresh_result_type_id);
	}
	return import_page_refresh_result_type_id__once;
}

static void
_import_page_on_import_selected_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self)
{
	import_page_on_import_selected ((ImportPage*) self);
}

static void
_import_page_on_import_all_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self)
{
	import_page_on_import_all ((ImportPage*) self);
}

static void
_page_on_action_toggle_gsimple_action_activate_callback (GSimpleAction* action,
                                                         GVariant* parameter,
                                                         gpointer self)
{
	page_on_action_toggle ((Page*) self, action, parameter);
}

static void
_import_page_on_display_titles_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                     GVariant* value,
                                                                     gpointer self)
{
	import_page_on_display_titles ((ImportPage*) self, action, value);
}

static gpointer
_discovered_camera_ref0 (gpointer self)
{
	return self ? discovered_camera_ref (self) : NULL;
}

static gint64
_import_page_preview_comparator_comparator (void* a,
                                            void* b,
                                            gpointer self)
{
	gint64 result;
	result = import_page_preview_comparator (a, b);
	return result;
}

static gboolean
_import_page_preview_comparator_predicate_comparator_predicate (DataObject* object,
                                                                Alteration* alteration,
                                                                gpointer self)
{
	gboolean result;
	result = import_page_preview_comparator_predicate (object, alteration);
	return result;
}

static void
_import_page_on_view_changed_view_collection_items_state_changed (ViewCollection* _sender,
                                                                  GeeIterable* changed,
                                                                  gpointer self)
{
	import_page_on_view_changed ((ImportPage*) self);
}

static void
_import_page_on_view_changed_data_collection_contents_altered (DataCollection* _sender,
                                                               GeeIterable* added,
                                                               GeeIterable* removed,
                                                               gpointer self)
{
	import_page_on_view_changed ((ImportPage*) self);
}

static void
_import_page_on_view_changed_view_collection_items_visibility_changed (ViewCollection* _sender,
                                                                       GeeCollection* changed,
                                                                       gpointer self)
{
	import_page_on_view_changed ((ImportPage*) self);
}

ImportPage*
import_page_construct (GType object_type,
                       DiscoveredCamera* dcamera)
{
	ImportPage * self = NULL;
	DiscoveredCamera* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	ImportSourceCollection* _tmp4_;
	ViewCollection* _tmp5_;
	ViewCollection* _tmp6_;
	CameraViewTracker* _tmp7_;
	GtkLabel* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	GVolumeMonitor* _tmp11_;
	GPContextWrapper* _tmp12_;
	GPSpinIdleWrapper* _tmp14_;
	ViewCollection* _tmp16_;
	ViewCollection* _tmp17_;
	SourceCollection* _tmp18_;
	ImportPageImportViewManager* _tmp19_;
	ImportPageImportViewManager* _tmp20_;
	ViewCollectionMonitor* _tmp21_;
	ViewCollectionMonitor* _tmp22_;
	ViewCollection* _tmp23_;
	ViewCollection* _tmp24_;
	ViewCollection* _tmp25_;
	ViewCollection* _tmp26_;
	ViewCollection* _tmp27_;
	ViewCollection* _tmp28_;
	ViewCollection* _tmp29_;
	ViewCollection* _tmp30_;
	ViewCollection* _tmp31_;
	ViewCollection* _tmp32_;
	GValue _tmp33_ = {0};
	LibraryPhotoSourceCollection* _tmp34_;
	VideoSourceCollection* _tmp35_;
	g_return_val_if_fail (IS_DISCOVERED_CAMERA (dcamera), NULL);
	self = (ImportPage*) checkerboard_page_construct (object_type, _ ("Camera"));
	_tmp0_ = _discovered_camera_ref0 (dcamera);
	_discovered_camera_unref0 (self->priv->dcamera);
	self->priv->dcamera = _tmp0_;
	_tmp1_ = dcamera->uri;
	_tmp2_ = g_strdup_printf ("ImportSources for %s", _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = import_source_collection_new (_tmp3_);
	_data_collection_unref0 (self->priv->import_sources);
	self->priv->import_sources = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_SOURCE_COLLECTION, SourceCollection);
	_g_free0 (_tmp3_);
	_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp6_ = _tmp5_;
	_tmp7_ = camera_view_tracker_new (_tmp6_);
	_core_tracker_unref0 (self->priv->tracker);
	self->priv->tracker = _tmp7_;
	_data_collection_unref0 (_tmp6_);
	_tmp8_ = self->priv->camera_label;
	_tmp9_ = dcamera->display_name;
	gtk_label_set_text (_tmp8_, _tmp9_);
	_tmp10_ = dcamera->display_name;
	page_set_page_name (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), _tmp10_);
	_tmp11_ = g_volume_monitor_get ();
	_g_object_unref0 (self->priv->volume_monitor);
	self->priv->volume_monitor = _tmp11_;
	_tmp12_ = import_page_null_context;
	if (_tmp12_ == NULL) {
		GPContextWrapper* _tmp13_;
		_tmp13_ = gp_context_wrapper_new ();
		_gp_context_wrapper_unref0 (import_page_null_context);
		import_page_null_context = _tmp13_;
	}
	_tmp14_ = import_page_spin_idle_context;
	if (_tmp14_ == NULL) {
		GPSpinIdleWrapper* _tmp15_;
		_tmp15_ = gp_spin_idle_wrapper_new ();
		_gp_context_wrapper_unref0 (import_page_spin_idle_context);
		import_page_spin_idle_context = _tmp15_;
	}
	_tmp16_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp17_ = _tmp16_;
	_tmp18_ = self->priv->import_sources;
	_tmp19_ = import_page_import_view_manager_new (self);
	_tmp20_ = _tmp19_;
	_tmp21_ = view_collection_monitor_source_collection (_tmp17_, _tmp18_, G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_VIEW_MANAGER, ViewManager), NULL, NULL, NULL, NULL);
	_tmp22_ = _tmp21_;
	_view_collection_monitor_unref0 (_tmp22_);
	_view_manager_unref0 (_tmp20_);
	_data_collection_unref0 (_tmp17_);
	_tmp23_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp24_ = _tmp23_;
	data_collection_set_comparator (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, TYPE_DATA_COLLECTION, DataCollection), _import_page_preview_comparator_comparator, NULL, _import_page_preview_comparator_predicate_comparator_predicate, NULL);
	_data_collection_unref0 (_tmp24_);
	_tmp25_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp26_ = _tmp25_;
	g_signal_connect_object (_tmp26_, "items-state-changed", (GCallback) _import_page_on_view_changed_view_collection_items_state_changed, self, 0);
	_data_collection_unref0 (_tmp26_);
	_tmp27_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp28_ = _tmp27_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, TYPE_DATA_COLLECTION, DataCollection), "contents-altered", (GCallback) _import_page_on_view_changed_data_collection_contents_altered, self, 0);
	_data_collection_unref0 (_tmp28_);
	_tmp29_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp30_ = _tmp29_;
	g_signal_connect_object (_tmp30_, "items-visibility-changed", (GCallback) _import_page_on_view_changed_view_collection_items_visibility_changed, self, 0);
	_data_collection_unref0 (_tmp30_);
	_tmp31_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp32_ = _tmp31_;
	g_value_init (&_tmp33_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp33_, TRUE);
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, TYPE_DATA_COLLECTION, DataCollection), CHECKERBOARD_ITEM_PROP_SHOW_SUBTITLES, &_tmp33_, NULL, NULL);
	G_IS_VALUE (&_tmp33_) ? (g_value_unset (&_tmp33_), NULL) : NULL;
	_data_collection_unref0 (_tmp32_);
	_tmp34_ = library_photo_global;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, TYPE_DATA_COLLECTION, DataCollection), "contents-altered", (GCallback) _import_page_on_media_added_removed_data_collection_contents_altered, self, 0);
	_tmp35_ = video_global;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, TYPE_DATA_COLLECTION, DataCollection), "contents-altered", (GCallback) _import_page_on_media_added_removed_data_collection_contents_altered, self, 0);
	checkerboard_page_init_item_context_menu (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), "ImportContextMenu");
	checkerboard_page_init_page_context_menu (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), "ImportContextMenu");
	return self;
}

ImportPage*
import_page_new (DiscoveredCamera* dcamera)
{
	return import_page_construct (TYPE_IMPORT_PAGE, dcamera);
}

static void
_import_page_on_hide_imported_gtk_button_clicked (GtkButton* _sender,
                                                  gpointer self)
{
	import_page_on_hide_imported ((ImportPage*) self);
}

static GtkToolbar*
import_page_real_get_toolbar (Page* base)
{
	ImportPage * self;
	GtkToolbar* _tmp0_;
	GtkToolbar* _tmp54_;
	GtkToolbar* _tmp55_;
	GtkToolbar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->toolbar;
	if (_tmp0_ == NULL) {
		GtkToolbar* _tmp1_;
		GtkToolbar* _tmp2_;
		GtkCheckButton* _tmp3_;
		GtkCheckButton* _tmp4_;
		GtkCheckButton* _tmp5_;
		GtkCheckButton* _tmp6_;
		GtkCheckButton* _tmp7_;
		ConfigFacade* _tmp8_;
		ConfigFacade* _tmp9_;
		GtkToolItem* hide_item = NULL;
		GtkToolItem* _tmp10_;
		GtkToolItem* _tmp11_;
		GtkToolItem* _tmp12_;
		GtkCheckButton* _tmp13_;
		GtkToolbar* _tmp14_;
		GtkToolItem* _tmp15_;
		GtkSeparatorToolItem* separator = NULL;
		GtkSeparatorToolItem* _tmp16_;
		GtkSeparatorToolItem* _tmp17_;
		GtkToolbar* _tmp18_;
		GtkSeparatorToolItem* _tmp19_;
		GtkProgressBar* _tmp20_;
		GtkProgressBar* _tmp21_;
		GtkToolItem* progress_item = NULL;
		GtkToolItem* _tmp22_;
		GtkToolItem* _tmp23_;
		GtkToolItem* _tmp24_;
		GtkProgressBar* _tmp25_;
		GtkProgressBar* _tmp26_;
		GtkToolbar* _tmp27_;
		GtkToolItem* _tmp28_;
		GtkToggleToolButton* find_button = NULL;
		GtkToggleToolButton* _tmp29_;
		GtkToggleToolButton* _tmp30_;
		GtkToggleToolButton* _tmp31_;
		GtkToolbar* _tmp32_;
		GtkToggleToolButton* _tmp33_;
		GtkToolbar* _tmp34_;
		GtkSeparatorToolItem* _tmp35_;
		GtkSeparatorToolItem* _tmp36_;
		GtkToolButton* import_selected_button = NULL;
		GtkToolButton* _tmp37_;
		GtkToolButton* _tmp38_;
		GtkToolButton* _tmp39_;
		GtkToolButton* _tmp40_;
		GtkToolButton* _tmp41_;
		GtkToolButton* _tmp42_;
		GtkToolbar* _tmp43_;
		GtkToolButton* _tmp44_;
		GtkToolButton* import_all_button = NULL;
		GtkToolButton* _tmp45_;
		GtkToolButton* _tmp46_;
		GtkToolButton* _tmp47_;
		GtkToolButton* _tmp48_;
		GtkToolButton* _tmp49_;
		GtkToolButton* _tmp50_;
		GtkToolbar* _tmp51_;
		GtkToolButton* _tmp52_;
		GtkProgressBar* _tmp53_;
		_tmp1_ = PAGE_CLASS (import_page_parent_class)->get_toolbar (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page));
		_tmp2_ = _tmp1_;
		_g_object_unref0 (_tmp2_);
		_tmp3_ = (GtkCheckButton*) gtk_check_button_new_with_label (_ ("Hide photos already imported"));
		g_object_ref_sink (_tmp3_);
		_g_object_unref0 (self->priv->hide_imported);
		self->priv->hide_imported = _tmp3_;
		_tmp4_ = self->priv->hide_imported;
		gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), _ ("Only display photos that have not been imported"));
		_tmp5_ = self->priv->hide_imported;
		g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_button_get_type (), GtkButton), "clicked", (GCallback) _import_page_on_hide_imported_gtk_button_clicked, self, 0);
		_tmp6_ = self->priv->hide_imported;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), FALSE);
		_tmp7_ = self->priv->hide_imported;
		_tmp8_ = config_facade_get_instance ();
		_tmp9_ = _tmp8_;
		gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_toggle_button_get_type (), GtkToggleButton), configuration_facade_get_hide_photos_already_imported (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
		_g_object_unref0 (_tmp9_);
		_tmp10_ = gtk_tool_item_new ();
		g_object_ref_sink (_tmp10_);
		hide_item = _tmp10_;
		_tmp11_ = hide_item;
		gtk_tool_item_set_is_important (_tmp11_, TRUE);
		_tmp12_ = hide_item;
		_tmp13_ = self->priv->hide_imported;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget));
		_tmp14_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->toolbar;
		_tmp15_ = hide_item;
		gtk_toolbar_insert (_tmp14_, _tmp15_, -1);
		_tmp16_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
		g_object_ref_sink (_tmp16_);
		separator = _tmp16_;
		_tmp17_ = separator;
		gtk_separator_tool_item_set_draw (_tmp17_, FALSE);
		_tmp18_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->toolbar;
		_tmp19_ = separator;
		gtk_toolbar_insert (_tmp18_, G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_tool_item_get_type (), GtkToolItem), -1);
		_tmp20_ = self->priv->progress_bar;
		gtk_orientable_set_orientation (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_orientable_get_type (), GtkOrientable), GTK_ORIENTATION_HORIZONTAL);
		_tmp21_ = self->priv->progress_bar;
		gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, gtk_widget_get_type (), GtkWidget), FALSE);
		_tmp22_ = gtk_tool_item_new ();
		g_object_ref_sink (_tmp22_);
		progress_item = _tmp22_;
		_tmp23_ = progress_item;
		gtk_tool_item_set_expand (_tmp23_, TRUE);
		_tmp24_ = progress_item;
		_tmp25_ = self->priv->progress_bar;
		gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget));
		_tmp26_ = self->priv->progress_bar;
		gtk_progress_bar_set_show_text (_tmp26_, TRUE);
		_tmp27_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->toolbar;
		_tmp28_ = progress_item;
		gtk_toolbar_insert (_tmp27_, _tmp28_, -1);
		_tmp29_ = (GtkToggleToolButton*) gtk_toggle_tool_button_new ();
		g_object_ref_sink (_tmp29_);
		find_button = _tmp29_;
		_tmp30_ = find_button;
		gtk_tool_button_set_icon_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_tool_button_get_type (), GtkToolButton), "edit-find-symbolic");
		_tmp31_ = find_button;
		gtk_actionable_set_action_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_actionable_get_type (), GtkActionable), "win.CommonDisplaySearchbar");
		_tmp32_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->toolbar;
		_tmp33_ = find_button;
		gtk_toolbar_insert (_tmp32_, G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_tool_item_get_type (), GtkToolItem), -1);
		_tmp34_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->toolbar;
		_tmp35_ = (GtkSeparatorToolItem*) gtk_separator_tool_item_new ();
		g_object_ref_sink (_tmp35_);
		_tmp36_ = _tmp35_;
		gtk_toolbar_insert (_tmp34_, G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, gtk_tool_item_get_type (), GtkToolItem), -1);
		_g_object_unref0 (_tmp36_);
		_tmp37_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
		g_object_ref_sink (_tmp37_);
		import_selected_button = _tmp37_;
		_tmp38_ = import_selected_button;
		gtk_tool_button_set_icon_name (_tmp38_, RESOURCES_IMPORT);
		_tmp39_ = import_selected_button;
		gtk_tool_button_set_label (_tmp39_, _ ("Import _Selected"));
		_tmp40_ = import_selected_button;
		gtk_tool_item_set_is_important (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, gtk_tool_item_get_type (), GtkToolItem), TRUE);
		_tmp41_ = import_selected_button;
		gtk_tool_button_set_use_underline (_tmp41_, TRUE);
		_tmp42_ = import_selected_button;
		gtk_actionable_set_action_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, gtk_actionable_get_type (), GtkActionable), "win.ImportSelected");
		_tmp43_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->toolbar;
		_tmp44_ = import_selected_button;
		gtk_toolbar_insert (_tmp43_, G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, gtk_tool_item_get_type (), GtkToolItem), -1);
		_tmp45_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
		g_object_ref_sink (_tmp45_);
		import_all_button = _tmp45_;
		_tmp46_ = import_all_button;
		gtk_tool_button_set_icon_name (_tmp46_, RESOURCES_IMPORT_ALL);
		_tmp47_ = import_all_button;
		gtk_tool_button_set_label (_tmp47_, _ ("Import _All"));
		_tmp48_ = import_all_button;
		gtk_tool_item_set_is_important (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, gtk_tool_item_get_type (), GtkToolItem), TRUE);
		_tmp49_ = import_all_button;
		gtk_tool_button_set_use_underline (_tmp49_, TRUE);
		_tmp50_ = import_all_button;
		gtk_actionable_set_action_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, gtk_actionable_get_type (), GtkActionable), "win.ImportAll");
		_tmp51_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->toolbar;
		_tmp52_ = import_all_button;
		gtk_toolbar_insert (_tmp51_, G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, gtk_tool_item_get_type (), GtkToolItem), -1);
		_tmp53_ = self->priv->progress_bar;
		gtk_widget_set_no_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, gtk_widget_get_type (), GtkWidget), TRUE);
		import_page_update_toolbar_state (self);
		gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
		_g_object_unref0 (import_all_button);
		_g_object_unref0 (import_selected_button);
		_g_object_unref0 (find_button);
		_g_object_unref0 (progress_item);
		_g_object_unref0 (separator);
		_g_object_unref0 (hide_item);
	}
	_tmp54_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->toolbar;
	_tmp55_ = _g_object_ref0 (_tmp54_);
	result = _tmp55_;
	return result;
}

static gpointer
_core_tracker_ref0 (gpointer self)
{
	return self ? core_tracker_ref (self) : NULL;
}

static CoreViewTracker*
import_page_real_get_view_tracker (CheckerboardPage* base)
{
	ImportPage * self;
	CameraViewTracker* _tmp0_;
	CoreViewTracker* _tmp1_;
	CoreViewTracker* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	_tmp0_ = self->priv->tracker;
	_tmp1_ = _core_tracker_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CORE_TYPE_VIEW_TRACKER, CoreViewTracker));
	result = _tmp1_;
	return result;
}

static gchar*
import_page_real_get_view_empty_icon (CheckerboardPage* base)
{
	ImportPage * self;
	DiscoveredCamera* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp5_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	_tmp0_ = self->priv->dcamera;
	_tmp1_ = _tmp0_->icon;
	if (_tmp1_ != NULL) {
		DiscoveredCamera* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp2_ = self->priv->dcamera;
		_tmp3_ = _tmp2_->icon;
		_tmp4_ = g_strdup (_tmp3_);
		result = _tmp4_;
		return result;
	}
	_tmp5_ = g_strdup ("camera-photo-symbolic");
	result = _tmp5_;
	return result;
}

static gchar*
import_page_real_get_view_empty_message (CheckerboardPage* base)
{
	ImportPage * self;
	gchar* _tmp0_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	_tmp0_ = g_strdup (_ ("The camera seems to be empty. No photos/videos found to import"));
	result = _tmp0_;
	return result;
}

static gchar*
import_page_real_get_filter_no_match_message (CheckerboardPage* base)
{
	ImportPage * self;
	gchar* _tmp0_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	_tmp0_ = g_strdup (_ ("No new photos/videos found on camera"));
	result = _tmp0_;
	return result;
}

static gint64
import_page_preview_comparator (void* a,
                                void* b)
{
	ImportSource* _tmp0_;
	ImportSource* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	ImportSource* _tmp4_;
	ImportSource* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	gint64 _tmp8_;
	gint64 result;
	_tmp0_ = import_preview_get_import_source (G_TYPE_CHECK_INSTANCE_CAST ((ImportPreview*) a, TYPE_IMPORT_PREVIEW, ImportPreview));
	_tmp1_ = _tmp0_;
	_tmp2_ = import_source_get_exposure_time (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = import_preview_get_import_source (G_TYPE_CHECK_INSTANCE_CAST ((ImportPreview*) b, TYPE_IMPORT_PREVIEW, ImportPreview));
	_tmp5_ = _tmp4_;
	_tmp6_ = import_source_get_exposure_time (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = nullsafe_date_time_comperator (_tmp3_, _tmp7_);
	_g_date_time_unref0 (_tmp7_);
	_g_object_unref0 (_tmp5_);
	_g_date_time_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	result = _tmp8_;
	return result;
}

static gboolean
import_page_preview_comparator_predicate (DataObject* object,
                                          Alteration* alteration)
{
	gboolean result;
	g_return_val_if_fail (IS_DATA_OBJECT (object), FALSE);
	g_return_val_if_fail (IS_ALTERATION (alteration), FALSE);
	result = alteration_has_detail (alteration, "metadata", "exposure-time");
	return result;
}

static gint64
import_page_import_job_comparator (ImportPage* self,
                                   void* a,
                                   void* b)
{
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	gint64 _tmp4_;
	gint64 result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), -1LL);
	_tmp0_ = import_page_camera_import_job_get_exposure_time (G_TYPE_CHECK_INSTANCE_CAST ((ImportPageCameraImportJob*) a, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob));
	_tmp1_ = _tmp0_;
	_tmp2_ = import_page_camera_import_job_get_exposure_time (G_TYPE_CHECK_INSTANCE_CAST ((ImportPageCameraImportJob*) b, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob));
	_tmp3_ = _tmp2_;
	_tmp4_ = nullsafe_date_time_comperator (_tmp1_, _tmp3_);
	_g_date_time_unref0 (_tmp3_);
	_g_date_time_unref0 (_tmp1_);
	result = _tmp4_;
	return result;
}

static void
import_page_real_init_collect_ui_filenames (Page* base,
                                            GeeList* ui_filenames)
{
	ImportPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (ui_filenames, GEE_TYPE_LIST));
	PAGE_CLASS (import_page_parent_class)->init_collect_ui_filenames (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), ui_filenames);
	gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (ui_filenames, GEE_TYPE_COLLECTION, GeeCollection), "import.ui");
}

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

static void
import_page_real_add_actions (Page* base,
                              GActionMap* map)
{
	ImportPage * self;
	GAction* _tmp0_;
	GAction* _tmp1_;
	ConfigFacade* _tmp2_;
	ConfigFacade* _tmp3_;
	GVariant* _tmp4_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (map, g_action_map_get_type ()));
	PAGE_CLASS (import_page_parent_class)->add_actions (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), map);
	g_action_map_add_action_entries (map, IMPORT_PAGE_entries, (gint) G_N_ELEMENTS (IMPORT_PAGE_entries), self);
	_tmp0_ = page_get_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewTitle");
	_tmp1_ = _tmp0_;
	_tmp2_ = config_facade_get_instance ();
	_tmp3_ = _tmp2_;
	_tmp4_ = _variant_new13 (configuration_facade_get_display_photo_titles (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	g_action_change_state (_tmp1_, _tmp4_);
	_g_variant_unref0 (_tmp4_);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
}

static void
import_page_real_remove_actions (Page* base,
                                 GActionMap* map)
{
	ImportPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (map, g_action_map_get_type ()));
	PAGE_CLASS (import_page_parent_class)->remove_actions (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), map);
	{
		GActionEntry* entry_collection = NULL;
		gint entry_collection_length1 = 0;
		gint _entry_collection_size_ = 0;
		gint entry_it = 0;
		entry_collection = IMPORT_PAGE_entries;
		entry_collection_length1 = G_N_ELEMENTS (IMPORT_PAGE_entries);
		for (entry_it = 0; entry_it < entry_collection_length1; entry_it = entry_it + 1) {
			GActionEntry entry = {0};
			entry = entry_collection[entry_it];
			{
				GActionEntry _tmp0_;
				const gchar* _tmp1_;
				_tmp0_ = entry;
				_tmp1_ = _tmp0_.name;
				g_action_map_remove_action (map, _tmp1_);
			}
		}
	}
}

Camera*
import_page_get_camera (ImportPage* self)
{
	DiscoveredCamera* _tmp0_;
	Camera* _tmp1_;
	Camera* _tmp2_;
	Camera* result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), NULL);
	_tmp0_ = self->priv->dcamera;
	_tmp1_ = _tmp0_->gcamera;
	_tmp2_ = _GPHOTO_REF_CAMERA0 (_tmp1_);
	result = _tmp2_;
	return result;
}

gchar*
import_page_get_uri (ImportPage* self)
{
	DiscoveredCamera* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), NULL);
	_tmp0_ = self->priv->dcamera;
	_tmp1_ = _tmp0_->uri;
	_tmp2_ = g_strdup (_tmp1_);
	result = _tmp2_;
	return result;
}

gboolean
import_page_is_busy (ImportPage* self)
{
	gboolean result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), FALSE);
	result = self->priv->busy;
	return result;
}

static void
import_page_real_init_actions (Page* base,
                               gint selected_count,
                               gint count)
{
	ImportPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	import_page_on_view_changed (self);
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ImportSelected", TRUE);
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ImportAll", TRUE);
	PAGE_CLASS (import_page_parent_class)->init_actions (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), selected_count, count);
}

gboolean
import_page_is_refreshed (ImportPage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), FALSE);
	if (self->priv->refreshed) {
		_tmp0_ = !self->priv->busy;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

gchar*
import_page_get_refresh_message (ImportPage* self)
{
	gchar* msg = NULL;
	const gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), NULL);
	msg = NULL;
	_tmp0_ = self->priv->refresh_error;
	if (_tmp0_ != NULL) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = self->priv->refresh_error;
		_tmp2_ = g_strdup (_tmp1_);
		_g_free0 (msg);
		msg = _tmp2_;
	} else {
		if (self->priv->refresh_result == GP_OK) {
		} else {
			gchar* _tmp3_;
			_tmp3_ = gp_result_to_full_string (self->priv->refresh_result);
			_g_free0 (msg);
			msg = _tmp3_;
		}
	}
	result = msg;
	return result;
}

static void
import_page_update_status (ImportPage* self,
                           gboolean busy,
                           gboolean refreshed)
{
	g_return_if_fail (IS_IMPORT_PAGE (self));
	self->priv->busy = busy;
	self->priv->refreshed = refreshed;
	import_page_on_view_changed (self);
}

static void
import_page_update_toolbar_state (ImportPage* self)
{
	GtkCheckButton* _tmp0_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	_tmp0_ = self->priv->hide_imported;
	if (_tmp0_ != NULL) {
		gboolean _tmp1_ = FALSE;
		gboolean _tmp2_ = FALSE;
		GtkCheckButton* _tmp5_;
		if (!self->priv->busy) {
			_tmp2_ = self->priv->refreshed;
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			ViewCollection* _tmp3_;
			ViewCollection* _tmp4_;
			_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
			_tmp4_ = _tmp3_;
			_tmp1_ = view_collection_get_unfiltered_count (_tmp4_) > 0;
			_data_collection_unref0 (_tmp4_);
		} else {
			_tmp1_ = FALSE;
		}
		_tmp5_ = self->priv->hide_imported;
		gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), _tmp1_);
	}
}

static void
import_page_on_view_changed (ImportPage* self)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp8_ = FALSE;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	if (!self->priv->busy) {
		_tmp1_ = self->priv->refreshed;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		ViewCollection* _tmp2_;
		ViewCollection* _tmp3_;
		_tmp2_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp3_ = _tmp2_;
		_tmp0_ = view_collection_get_selected_count (_tmp3_) > 0;
		_data_collection_unref0 (_tmp3_);
	} else {
		_tmp0_ = FALSE;
	}
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ImportSelected", _tmp0_);
	if (!self->priv->busy) {
		_tmp5_ = self->priv->refreshed;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		ViewCollection* _tmp6_;
		ViewCollection* _tmp7_;
		_tmp6_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp7_ = _tmp6_;
		_tmp4_ = data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_DATA_COLLECTION, DataCollection)) > 0;
		_data_collection_unref0 (_tmp7_);
	} else {
		_tmp4_ = FALSE;
	}
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ImportAll", _tmp4_);
	if (!self->priv->busy) {
		ViewCollection* _tmp9_;
		ViewCollection* _tmp10_;
		_tmp9_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp10_ = _tmp9_;
		_tmp8_ = data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_DATA_COLLECTION, DataCollection)) > 0;
		_data_collection_unref0 (_tmp10_);
	} else {
		_tmp8_ = FALSE;
	}
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "CommonSelectAll", _tmp8_);
	import_page_update_toolbar_state (self);
}

static void
import_page_on_media_added_removed (ImportPage* self)
{
	ImportPageImportPageSearchViewFilter* _tmp0_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	_tmp0_ = self->priv->search_filter;
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_VIEW_FILTER, ViewFilter), "refresh");
}

static void
import_page_on_display_titles (ImportPage* self,
                               GSimpleAction* action,
                               GVariant* value)
{
	gboolean display = FALSE;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	display = g_variant_get_boolean (value);
	checkerboard_page_set_display_titles (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), display);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	configuration_facade_set_display_photo_titles (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), display);
	_g_object_unref0 (_tmp1_);
	g_simple_action_set_state (action, value);
}

static void
import_page_real_switched_to (Page* base)
{
	ImportPage * self;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	checkerboard_page_set_display_titles (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), configuration_facade_get_display_photo_titles (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	_g_object_unref0 (_tmp1_);
	PAGE_CLASS (import_page_parent_class)->switched_to (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page));
}

static void
import_page_real_ready (Page* base)
{
	ImportPage * self;
	ImportPageHideImportedViewFilter* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	import_page_try_refreshing_camera (self, FALSE);
	_tmp0_ = self->priv->hide_imported_filter;
	g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_VIEW_FILTER, ViewFilter), "refresh");
}

static void
import_page_try_refreshing_camera (ImportPage* self,
                                   gboolean fail_on_locked)
{
	gboolean _tmp0_ = FALSE;
	ImportPageRefreshResult res = 0;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	if (self->priv->refreshed) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = self->priv->busy;
	}
	if (_tmp0_) {
		return;
	}
	res = import_page_refresh_camera (self);
	switch (res) {
		case IMPORT_PAGE_REFRESH_RESULT_OK:
		case IMPORT_PAGE_REFRESH_RESULT_BUSY:
		{
			break;
		}
		case IMPORT_PAGE_REFRESH_RESULT_LOCKED:
		{
			DiscoveredCamera* _tmp1_;
			const gchar* _tmp2_;
			GMount* mount = NULL;
			DiscoveredCamera* _tmp3_;
			GMount* _tmp4_;
			GMount* _tmp5_;
			if (fail_on_locked) {
				app_window_error_message (IMPORT_PAGE_UNMOUNT_FAILED_MSG, NULL);
				break;
			}
			_tmp1_ = self->priv->dcamera;
			_tmp2_ = _tmp1_->uri;
			g_debug ("ImportPage.vala:994: Checking if %s is mounted…", _tmp2_);
			_tmp3_ = self->priv->dcamera;
			_tmp4_ = discovered_camera_get_mount (_tmp3_);
			mount = _tmp4_;
			_tmp5_ = mount;
			if (_tmp5_ != NULL) {
				gchar* mounted_message = NULL;
				gchar* _tmp6_;
				GtkMessageDialog* dialog = NULL;
				AppWindow* _tmp7_;
				AppWindow* _tmp8_;
				const gchar* _tmp9_;
				GtkMessageDialog* _tmp10_;
				GtkMessageDialog* _tmp11_;
				GtkMessageDialog* _tmp12_;
				GtkMessageDialog* _tmp13_;
				gint dialog_res = 0;
				GtkMessageDialog* _tmp14_;
				GtkMessageDialog* _tmp15_;
				_tmp6_ = g_strdup (_ ("Shotwell needs to unmount the camera from the filesystem in order to a" \
"ccess it. Continue?"));
				mounted_message = _tmp6_;
				_tmp7_ = app_window_get_instance ();
				_tmp8_ = _tmp7_;
				_tmp9_ = mounted_message;
				_tmp10_ = (GtkMessageDialog*) gtk_message_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_window_get_type (), GtkWindow), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_CANCEL, "%s", _tmp9_);
				g_object_ref_sink (_tmp10_);
				_tmp11_ = _tmp10_;
				_g_object_unref0 (_tmp8_);
				dialog = _tmp11_;
				_tmp12_ = dialog;
				gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_window_get_type (), GtkWindow), RESOURCES_APP_TITLE);
				_tmp13_ = dialog;
				gtk_dialog_add_button (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_dialog_get_type (), GtkDialog), _ ("_Unmount"), (gint) GTK_RESPONSE_YES);
				_tmp14_ = dialog;
				dialog_res = gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_dialog_get_type (), GtkDialog));
				_tmp15_ = dialog;
				gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget));
				if (dialog_res != ((gint) GTK_RESPONSE_YES)) {
					checkerboard_page_set_page_message (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), _ ("Please unmount the camera."));
				} else {
					GMount* _tmp16_;
					_tmp16_ = mount;
					import_page_unmount_camera (self, _tmp16_);
				}
				_g_object_unref0 (dialog);
				_g_free0 (mounted_message);
			} else {
				gchar* locked_message = NULL;
				gchar* _tmp17_;
				GtkMessageDialog* dialog = NULL;
				AppWindow* _tmp18_;
				AppWindow* _tmp19_;
				const gchar* _tmp20_;
				GtkMessageDialog* _tmp21_;
				GtkMessageDialog* _tmp22_;
				GtkMessageDialog* _tmp23_;
				GtkMessageDialog* _tmp24_;
				GtkMessageDialog* _tmp25_;
				_tmp17_ = g_strdup (_ ("The camera is locked by another application. Shotwell can only access " \
"the camera when it’s unlocked. Please close any other application usin" \
"g the camera and try again."));
				locked_message = _tmp17_;
				_tmp18_ = app_window_get_instance ();
				_tmp19_ = _tmp18_;
				_tmp20_ = locked_message;
				_tmp21_ = (GtkMessageDialog*) gtk_message_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, gtk_window_get_type (), GtkWindow), GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, "%s", _tmp20_);
				g_object_ref_sink (_tmp21_);
				_tmp22_ = _tmp21_;
				_g_object_unref0 (_tmp19_);
				dialog = _tmp22_;
				_tmp23_ = dialog;
				gtk_window_set_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, gtk_window_get_type (), GtkWindow), RESOURCES_APP_TITLE);
				_tmp24_ = dialog;
				gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, gtk_dialog_get_type (), GtkDialog));
				_tmp25_ = dialog;
				gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, gtk_widget_get_type (), GtkWidget));
				checkerboard_page_set_page_message (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), _ ("Please close any other application using the camera."));
				_g_object_unref0 (dialog);
				_g_free0 (locked_message);
			}
			_g_object_unref0 (mount);
			break;
		}
		case IMPORT_PAGE_REFRESH_RESULT_LIBRARY_ERROR:
		{
			gchar* _tmp26_;
			gchar* _tmp27_;
			gchar* _tmp28_;
			gchar* _tmp29_;
			_tmp26_ = import_page_get_refresh_message (self);
			_tmp27_ = _tmp26_;
			_tmp28_ = g_strdup_printf (_ ("Unable to fetch previews from the camera:\n%s"), _tmp27_);
			_tmp29_ = _tmp28_;
			app_window_error_message (_tmp29_, NULL);
			_g_free0 (_tmp29_);
			_g_free0 (_tmp27_);
			break;
		}
		default:
		{
			g_error ("ImportPage.vala:1036: Unknown result type %d", (gint) res);
		}
	}
}

static void
_import_page_on_unmounted_g_mount_unmounted (GMount* _sender,
                                             gpointer self)
{
	import_page_on_unmounted ((ImportPage*) self, _sender);
}

static void
_import_page_on_unmount_finished_gasync_ready_callback (GObject* source_object,
                                                        GAsyncResult* res,
                                                        gpointer self)
{
	import_page_on_unmount_finished ((ImportPage*) self, source_object, res);
	g_object_unref (self);
}

gboolean
import_page_unmount_camera (ImportPage* self,
                            GMount* mount)
{
	GtkProgressBar* _tmp0_;
	GtkProgressBar* _tmp1_;
	GtkProgressBar* _tmp2_;
	GtkProgressBar* _tmp3_;
	AppWindow* _tmp4_;
	AppWindow* _tmp5_;
	GtkMountOperation* _tmp6_;
	GtkMountOperation* _tmp7_;
	gboolean result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (mount, g_mount_get_type ()), FALSE);
	if (self->priv->busy) {
		result = FALSE;
		return result;
	}
	import_page_update_status (self, TRUE, FALSE);
	_tmp0_ = self->priv->progress_bar;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp1_ = self->priv->progress_bar;
	gtk_progress_bar_set_fraction (_tmp1_, 0.0);
	_tmp2_ = self->priv->progress_bar;
	gtk_progress_bar_set_ellipsize (_tmp2_, PANGO_ELLIPSIZE_NONE);
	_tmp3_ = self->priv->progress_bar;
	gtk_progress_bar_set_text (_tmp3_, _ ("Unmounting…"));
	g_signal_connect_object (mount, "unmounted", (GCallback) _import_page_on_unmounted_g_mount_unmounted, self, 0);
	g_debug ("ImportPage.vala:1055: Unmounting camera…");
	_tmp4_ = app_window_get_instance ();
	_tmp5_ = _tmp4_;
	_tmp6_ = (GtkMountOperation*) gtk_mount_operation_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_window_get_type (), GtkWindow));
	_tmp7_ = _tmp6_;
	g_mount_unmount_with_operation (mount, G_MOUNT_UNMOUNT_NONE, G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, g_mount_operation_get_type (), GMountOperation), NULL, _import_page_on_unmount_finished_gasync_ready_callback, g_object_ref (self));
	_g_object_unref0 (_tmp7_);
	_g_object_unref0 (_tmp5_);
	result = TRUE;
	return result;
}

static void
import_page_on_unmount_finished (ImportPage* self,
                                 GObject* source,
                                 GAsyncResult* aresult)
{
	GMount* mount = NULL;
	GMount* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	g_return_if_fail ((source == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (source, G_TYPE_OBJECT));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (aresult, g_async_result_get_type ()));
	g_debug ("ImportPage.vala:1063: Async unmount finished");
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (source, g_mount_get_type (), GMount));
	mount = _tmp0_;
	{
		g_mount_unmount_with_operation_finish (mount, aresult, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		guint _tmp1_;
		GtkProgressBar* _tmp2_;
		GtkProgressBar* _tmp3_;
		GtkProgressBar* _tmp4_;
		g_clear_error (&_inner_error0_);
		app_window_error_message (IMPORT_PAGE_UNMOUNT_FAILED_MSG, NULL);
		g_signal_parse_name ("unmounted", g_mount_get_type (), &_tmp1_, NULL, FALSE);
		g_signal_handlers_disconnect_matched (mount, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _import_page_on_unmounted_g_mount_unmounted, self);
		import_page_update_status (self, FALSE, self->priv->refreshed);
		_tmp2_ = self->priv->progress_bar;
		gtk_progress_bar_set_ellipsize (_tmp2_, PANGO_ELLIPSIZE_NONE);
		_tmp3_ = self->priv->progress_bar;
		gtk_progress_bar_set_text (_tmp3_, "");
		_tmp4_ = self->priv->progress_bar;
		gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_widget_get_type (), GtkWidget), FALSE);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (mount);
		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_object_unref0 (mount);
}

static gboolean
__lambda23_ (ImportPage* self)
{
	gboolean result;
	import_page_try_refreshing_camera (self, TRUE);
	result = FALSE;
	return result;
}

static gboolean
___lambda23__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda23_ ((ImportPage*) self);
	return result;
}

static void
import_page_on_unmounted (ImportPage* self,
                          GMount* mount)
{
	GtkProgressBar* _tmp0_;
	GtkProgressBar* _tmp1_;
	GtkProgressBar* _tmp2_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (mount, g_mount_get_type ()));
	g_debug ("ImportPage.vala:1082: on_unmounted");
	import_page_update_status (self, FALSE, self->priv->refreshed);
	_tmp0_ = self->priv->progress_bar;
	gtk_progress_bar_set_ellipsize (_tmp0_, PANGO_ELLIPSIZE_NONE);
	_tmp1_ = self->priv->progress_bar;
	gtk_progress_bar_set_text (_tmp1_, "");
	_tmp2_ = self->priv->progress_bar;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget), FALSE);
	g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 3, ___lambda23__gsource_func, g_object_ref (self), g_object_unref);
}

static void
import_page_clear_all_import_sources (ImportPage* self)
{
	Marker* marker = NULL;
	SourceCollection* _tmp0_;
	Marker* _tmp1_;
	SourceCollection* _tmp2_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	_tmp0_ = self->priv->import_sources;
	_tmp1_ = data_collection_start_marking (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DATA_COLLECTION, DataCollection));
	marker = _tmp1_;
	marker_mark_all (marker);
	_tmp2_ = self->priv->import_sources;
	source_collection_destroy_marked (_tmp2_, marker, FALSE, NULL, NULL, NULL);
	_g_object_unref0 (marker);
}

/**
     * @brief Returns whether the current device has a given directory or not.
     *
     * @param fsid The file system id of the camera or other device to search.
     * @param dir The path to start searching from.
     * @param search_target The name of the directory to look for.
     */
static gboolean
import_page_check_directory_exists (ImportPage* self,
                                    gint fsid,
                                    const gchar* dir,
                                    const gchar* search_target)
{
	gchar* fulldir = NULL;
	DiscoveredCamera* _tmp0_;
	Camera* _tmp1_;
	DiscoveredCamera* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	int _result_ = 0;
	CameraList* folders = NULL;
	CameraList* _tmp5_ = NULL;
	int _tmp6_;
	DiscoveredCamera* _tmp7_;
	Camera* _tmp8_;
	const gchar* _tmp9_;
	CameraList* _tmp10_;
	GPSpinIdleWrapper* _tmp11_;
	GPContext* _tmp12_;
	gint list_len = 0;
	CameraList* _tmp13_;
	gboolean result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), FALSE);
	g_return_val_if_fail (dir != NULL, FALSE);
	g_return_val_if_fail (search_target != NULL, FALSE);
	_tmp0_ = self->priv->dcamera;
	_tmp1_ = _tmp0_->gcamera;
	_tmp2_ = self->priv->dcamera;
	_tmp3_ = _tmp2_->display_name;
	_tmp4_ = import_page_get_fulldir (_tmp1_, _tmp3_, fsid, dir);
	fulldir = _tmp4_;
	_tmp6_ = gp_list_new (&_tmp5_);
	_gp_list_unref0 (folders);
	folders = _tmp5_;
	_result_ = _tmp6_;
	if (_result_ != GP_OK) {
		result = FALSE;
		_gp_list_unref0 (folders);
		_g_free0 (fulldir);
		return result;
	}
	_tmp7_ = self->priv->dcamera;
	_tmp8_ = _tmp7_->gcamera;
	_tmp9_ = fulldir;
	_tmp10_ = folders;
	_tmp11_ = import_page_spin_idle_context;
	_tmp12_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
	_result_ = gp_camera_folder_list_folders (_tmp8_, _tmp9_, _tmp10_, _tmp12_);
	if (_result_ != GP_OK) {
		result = FALSE;
		_gp_list_unref0 (folders);
		_g_free0 (fulldir);
		return result;
	}
	_tmp13_ = folders;
	list_len = gp_list_count (_tmp13_);
	{
		gint list_index = 0;
		list_index = 0;
		{
			gboolean _tmp14_ = FALSE;
			_tmp14_ = TRUE;
			while (TRUE) {
				gchar* tmp = NULL;
				CameraList* _tmp16_;
				const gchar* _tmp17_ = NULL;
				gchar* _tmp18_;
				const gchar* _tmp19_;
				if (!_tmp14_) {
					gint _tmp15_;
					_tmp15_ = list_index;
					list_index = _tmp15_ + 1;
				}
				_tmp14_ = FALSE;
				if (!(list_index < list_len)) {
					break;
				}
				_tmp16_ = folders;
				gp_list_get_name (_tmp16_, list_index, &_tmp17_);
				_g_free0 (tmp);
				_tmp18_ = g_strdup (_tmp17_);
				tmp = _tmp18_;
				_tmp19_ = tmp;
				if (g_strcmp0 (_tmp19_, search_target) == 0) {
					result = TRUE;
					_g_free0 (tmp);
					_gp_list_unref0 (folders);
					_g_free0 (fulldir);
					return result;
				}
				_g_free0 (tmp);
			}
		}
	}
	result = FALSE;
	_gp_list_unref0 (folders);
	_g_free0 (fulldir);
	return result;
}

static gboolean
____lambda22_ (ImportPage* self)
{
	gboolean result;
	import_page_refresh_camera (self);
	result = FALSE;
	return result;
}

static gboolean
_____lambda22__gsource_func (gpointer self)
{
	gboolean result;
	result = ____lambda22_ ((ImportPage*) self);
	return result;
}

static ImportPageRefreshResult
import_page_refresh_camera (ImportPage* self)
{
	DiscoveredCamera* _tmp0_;
	Camera* _tmp1_;
	GPSpinIdleWrapper* _tmp2_;
	GPContext* _tmp3_;
	GtkProgressBar* _tmp7_;
	GtkProgressBar* _tmp8_;
	GtkProgressBar* _tmp9_;
	GtkProgressBar* _tmp10_;
	GtkProgressBar* _tmp11_;
	GeeArrayList* import_list = NULL;
	GeeArrayList* _tmp12_;
	CameraStorageInformation* sifs = NULL;
	gint sifs_length1;
	gint _sifs_size_;
	DiscoveredCamera* _tmp13_;
	Camera* _tmp14_;
	GPSpinIdleWrapper* _tmp15_;
	GPContext* _tmp16_;
	CameraStorageInformation* _tmp17_ = NULL;
	gint _tmp18_ = 0;
	int _tmp19_;
	GeeArrayList* _tmp35_;
	GeeArrayList* _tmp36_;
	GtkProgressBar* _tmp37_;
	GtkProgressBar* _tmp38_;
	GtkProgressBar* _tmp39_;
	GtkProgressBar* _tmp40_;
	int res = 0;
	DiscoveredCamera* _tmp41_;
	Camera* _tmp42_;
	GPSpinIdleWrapper* _tmp43_;
	GPContext* _tmp44_;
	ImportPageRefreshResult result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), 0);
	if (self->priv->busy) {
		result = IMPORT_PAGE_REFRESH_RESULT_BUSY;
		return result;
	}
	checkerboard_page_set_page_message (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), _ ("Connecting to camera, please wait…"));
	import_page_update_status (self, self->priv->busy, FALSE);
	_g_free0 (self->priv->refresh_error);
	self->priv->refresh_error = NULL;
	_tmp0_ = self->priv->dcamera;
	_tmp1_ = _tmp0_->gcamera;
	_tmp2_ = import_page_spin_idle_context;
	_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
	self->priv->refresh_result = gp_camera_init (_tmp1_, _tmp3_);
	if (self->priv->refresh_result == GP_ERROR_IO_USB_CLAIM) {
		if (self->priv->claim_timeout < 4000) {
			g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) self->priv->claim_timeout, _____lambda22__gsource_func, g_object_ref (self), g_object_unref);
			self->priv->claim_timeout = self->priv->claim_timeout * 2;
			result = IMPORT_PAGE_REFRESH_RESULT_LOCKED;
			return result;
		}
	}
	self->priv->claim_timeout = 500;
	if (self->priv->refresh_result != GP_OK) {
		gchar* _tmp4_;
		gchar* _tmp5_;
		ImportPageRefreshResult _tmp6_ = 0;
		_tmp4_ = gp_result_to_full_string (self->priv->refresh_result);
		_tmp5_ = _tmp4_;
		g_warning ("ImportPage.vala:1168: Unable to initialize camera: %s", _tmp5_);
		_g_free0 (_tmp5_);
		if (self->priv->refresh_result == GP_ERROR_IO_LOCK) {
			_tmp6_ = IMPORT_PAGE_REFRESH_RESULT_LOCKED;
		} else {
			_tmp6_ = IMPORT_PAGE_REFRESH_RESULT_LIBRARY_ERROR;
		}
		result = _tmp6_;
		return result;
	}
	checkerboard_page_set_page_message (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), _ ("Starting import, please wait…"));
	import_page_update_status (self, TRUE, self->priv->refreshed);
	import_page_on_view_changed (self);
	_tmp7_ = self->priv->progress_bar;
	gtk_progress_bar_set_ellipsize (_tmp7_, PANGO_ELLIPSIZE_NONE);
	_tmp8_ = self->priv->progress_bar;
	gtk_progress_bar_set_text (_tmp8_, _ ("Fetching photo information"));
	_tmp9_ = self->priv->progress_bar;
	gtk_progress_bar_set_fraction (_tmp9_, 0.0);
	_tmp10_ = self->priv->progress_bar;
	gtk_progress_bar_set_pulse_step (_tmp10_, 0.01);
	_tmp11_ = self->priv->progress_bar;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget), TRUE);
	_tmp12_ = gee_array_list_new (TYPE_IMPORT_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	import_list = _tmp12_;
	sifs = NULL;
	sifs_length1 = 0;
	_sifs_size_ = sifs_length1;
	_tmp13_ = self->priv->dcamera;
	_tmp14_ = _tmp13_->gcamera;
	_tmp15_ = import_page_spin_idle_context;
	_tmp16_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
	_tmp19_ = gp_camera_get_storageinfo (_tmp14_, &_tmp17_, &_tmp18_, _tmp16_);
	sifs = (g_free (sifs), NULL);
	sifs = _tmp17_;
	sifs_length1 = _tmp18_;
	_sifs_size_ = sifs_length1;
	self->priv->refresh_result = _tmp19_;
	if (self->priv->refresh_result == GP_OK) {
		{
			gint fsid = 0;
			fsid = 0;
			{
				gboolean _tmp20_ = FALSE;
				_tmp20_ = TRUE;
				while (TRUE) {
					CameraStorageInformation* _tmp22_;
					gint _tmp22__length1;
					gboolean got_well_known_dir = FALSE;
					if (!_tmp20_) {
						gint _tmp21_;
						_tmp21_ = fsid;
						fsid = _tmp21_ + 1;
					}
					_tmp20_ = FALSE;
					_tmp22_ = sifs;
					_tmp22__length1 = sifs_length1;
					if (!(fsid < _tmp22__length1)) {
						break;
					}
					got_well_known_dir = FALSE;
					if (import_page_check_directory_exists (self, fsid, "/", "DCIM")) {
						GeeArrayList* _tmp23_;
						_tmp23_ = import_list;
						import_page_enumerate_files (self, fsid, "/DCIM", _tmp23_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/", "dcim")) {
						GeeArrayList* _tmp24_;
						_tmp24_ = import_list;
						import_page_enumerate_files (self, fsid, "/dcim", _tmp24_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/PRIVATE/", "AVCHD")) {
						GeeArrayList* _tmp25_;
						_tmp25_ = import_list;
						import_page_enumerate_files (self, fsid, "/PRIVATE/AVCHD", _tmp25_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/private/", "avchd")) {
						GeeArrayList* _tmp26_;
						_tmp26_ = import_list;
						import_page_enumerate_files (self, fsid, "/private/avchd", _tmp26_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/", "AVCHD")) {
						GeeArrayList* _tmp27_;
						_tmp27_ = import_list;
						import_page_enumerate_files (self, fsid, "/AVCHD", _tmp27_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/", "avchd")) {
						GeeArrayList* _tmp28_;
						_tmp28_ = import_list;
						import_page_enumerate_files (self, fsid, "/avchd", _tmp28_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/PRIVATE/", "SONY")) {
						GeeArrayList* _tmp29_;
						_tmp29_ = import_list;
						import_page_enumerate_files (self, fsid, "/PRIVATE/SONY", _tmp29_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/PRIVATE/M4ROOT/", "CLIP")) {
						GeeArrayList* _tmp30_;
						_tmp30_ = import_list;
						import_page_enumerate_files (self, fsid, "/PRIVATE/M4ROOT/CLIP", _tmp30_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/private/", "sony")) {
						GeeArrayList* _tmp31_;
						_tmp31_ = import_list;
						import_page_enumerate_files (self, fsid, "/private/sony", _tmp31_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/", "MP_ROOT")) {
						GeeArrayList* _tmp32_;
						_tmp32_ = import_list;
						import_page_enumerate_files (self, fsid, "/MP_ROOT", _tmp32_);
						got_well_known_dir = TRUE;
					}
					if (import_page_check_directory_exists (self, fsid, "/", "mp_root")) {
						GeeArrayList* _tmp33_;
						_tmp33_ = import_list;
						import_page_enumerate_files (self, fsid, "/mp_root", _tmp33_);
						got_well_known_dir = TRUE;
					}
					if (!got_well_known_dir) {
						GeeArrayList* _tmp34_;
						_tmp34_ = import_list;
						if (!import_page_enumerate_files (self, fsid, "/", _tmp34_)) {
							break;
						}
					}
				}
			}
		}
	}
	import_page_clear_all_import_sources (self);
	_tmp35_ = import_list;
	import_page_auto_match_raw_jpeg (self, _tmp35_);
	_tmp36_ = import_list;
	import_page_load_previews_and_metadata (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, GEE_TYPE_LIST, GeeList));
	_tmp37_ = self->priv->progress_bar;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp38_ = self->priv->progress_bar;
	gtk_progress_bar_set_ellipsize (_tmp38_, PANGO_ELLIPSIZE_NONE);
	_tmp39_ = self->priv->progress_bar;
	gtk_progress_bar_set_text (_tmp39_, "");
	_tmp40_ = self->priv->progress_bar;
	gtk_progress_bar_set_fraction (_tmp40_, 0.0);
	_tmp41_ = self->priv->dcamera;
	_tmp42_ = _tmp41_->gcamera;
	_tmp43_ = import_page_spin_idle_context;
	_tmp44_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
	res = gp_camera_exit (_tmp42_, _tmp44_);
	if (res != GP_OK) {
		gchar* _tmp45_;
		gchar* _tmp46_;
		_tmp45_ = gp_result_to_full_string (res);
		_tmp46_ = _tmp45_;
		g_warning ("ImportPage.vala:1283: Unable to unlock camera: %s", _tmp46_);
		_g_free0 (_tmp46_);
	}
	if (self->priv->refresh_result == GP_OK) {
		SourceCollection* _tmp47_;
		_tmp47_ = self->priv->import_sources;
		if (data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, TYPE_DATA_COLLECTION, DataCollection)) == 0) {
			gchar* _tmp48_;
			gchar* _tmp49_;
			_tmp48_ = checkerboard_page_get_view_empty_message (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage));
			_tmp49_ = _tmp48_;
			checkerboard_page_set_page_message (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), _tmp49_);
			_g_free0 (_tmp49_);
		}
		import_page_update_status (self, FALSE, TRUE);
	} else {
		import_page_update_status (self, FALSE, FALSE);
		import_page_clear_all_import_sources (self);
	}
	import_page_on_view_changed (self);
	switch (self->priv->refresh_result) {
		case GP_OK:
		{
			result = IMPORT_PAGE_REFRESH_RESULT_OK;
			sifs = (g_free (sifs), NULL);
			_g_object_unref0 (import_list);
			return result;
		}
		case GP_ERROR_IO_LOCK:
		{
			result = IMPORT_PAGE_REFRESH_RESULT_LOCKED;
			sifs = (g_free (sifs), NULL);
			_g_object_unref0 (import_list);
			return result;
		}
		default:
		{
			result = IMPORT_PAGE_REFRESH_RESULT_LIBRARY_ERROR;
			sifs = (g_free (sifs), NULL);
			_g_object_unref0 (import_list);
			return result;
		}
	}
}

static gchar
string_get (const gchar* self,
            glong index)
{
	gchar _tmp0_;
	gchar result;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = ((gchar*) self)[index];
	result = _tmp0_;
	return result;
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static gchar*
import_page_chomp_ch (const gchar* str,
                      gchar ch)
{
	glong offset = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (str != NULL, NULL);
	_tmp0_ = strlen (str);
	_tmp1_ = _tmp0_;
	offset = (glong) _tmp1_;
	while (TRUE) {
		glong _tmp2_;
		offset = offset - 1;
		_tmp2_ = offset;
		if (!(_tmp2_ >= ((glong) 0))) {
			break;
		}
		if (string_get (str, offset) != ch) {
			gchar* _tmp3_;
			_tmp3_ = string_slice (str, (glong) 0, offset);
			result = _tmp3_;
			return result;
		}
	}
	_tmp4_ = g_strdup ("");
	result = _tmp4_;
	return result;
}

gchar*
import_page_append_path (const gchar* basepath,
                         const gchar* addition)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	g_return_val_if_fail (basepath != NULL, NULL);
	g_return_val_if_fail (addition != NULL, NULL);
	if (!g_str_has_suffix (basepath, "/")) {
		_tmp0_ = !g_str_has_prefix (addition, "/");
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gchar* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp1_ = g_strconcat (basepath, "/", NULL);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strconcat (_tmp2_, addition, NULL);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		result = _tmp4_;
		return result;
	} else {
		gboolean _tmp5_ = FALSE;
		if (g_str_has_suffix (basepath, "/")) {
			_tmp5_ = g_str_has_prefix (addition, "/");
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			gchar* _tmp6_;
			gchar* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			_tmp6_ = import_page_chomp_ch (basepath, '/');
			_tmp7_ = _tmp6_;
			_tmp8_ = g_strconcat (_tmp7_, addition, NULL);
			_tmp9_ = _tmp8_;
			_g_free0 (_tmp7_);
			result = _tmp9_;
			return result;
		} else {
			gchar* _tmp10_;
			_tmp10_ = g_strconcat (basepath, addition, NULL);
			result = _tmp10_;
			return result;
		}
	}
}

gchar*
import_page_get_fs_basedir (Camera* camera,
                            gint fsid)
{
	CameraStorageInformation* sifs = NULL;
	gint sifs_length1;
	gint _sifs_size_;
	int res = 0;
	GPContextWrapper* _tmp0_;
	GPContext* _tmp1_;
	CameraStorageInformation* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	int _tmp4_;
	CameraStorageInformation* _tmp5_;
	gint _tmp5__length1;
	CameraStorageInformation* _tmp6_;
	gint _tmp6__length1;
	CameraStorageInformation _tmp7_;
	gchar* result;
	g_return_val_if_fail (camera != NULL, NULL);
	sifs = NULL;
	sifs_length1 = 0;
	_sifs_size_ = sifs_length1;
	_tmp0_ = import_page_null_context;
	_tmp1_ = _tmp0_->context;
	_tmp4_ = gp_camera_get_storageinfo (camera, &_tmp2_, &_tmp3_, _tmp1_);
	sifs = (g_free (sifs), NULL);
	sifs = _tmp2_;
	sifs_length1 = _tmp3_;
	_sifs_size_ = sifs_length1;
	res = _tmp4_;
	if (res != GP_OK) {
		result = NULL;
		sifs = (g_free (sifs), NULL);
		return result;
	}
	_tmp5_ = sifs;
	_tmp5__length1 = sifs_length1;
	if (fsid >= _tmp5__length1) {
		result = NULL;
		sifs = (g_free (sifs), NULL);
		return result;
	}
	_tmp6_ = sifs;
	_tmp6__length1 = sifs_length1;
	_tmp7_ = _tmp6_[fsid];
	if ((_tmp7_.fields & GP_STORAGEINFO_BASE) == GP_STORAGEINFO_BASE) {
		CameraStorageInformation* _tmp8_;
		gint _tmp8__length1;
		CameraStorageInformation _tmp9_;
		gchar* _tmp10_;
		_tmp8_ = sifs;
		_tmp8__length1 = sifs_length1;
		_tmp9_ = _tmp8_[fsid];
		_tmp10_ = g_strdup ((const gchar*) _tmp9_.basedir);
		result = _tmp10_;
		sifs = (g_free (sifs), NULL);
		return result;
	} else {
		gchar* _tmp11_;
		_tmp11_ = g_strdup ("/");
		result = _tmp11_;
		sifs = (g_free (sifs), NULL);
		return result;
	}
}

gchar*
import_page_get_fulldir (Camera* camera,
                         const gchar* camera_name,
                         gint fsid,
                         const gchar* folder)
{
	gchar* basedir = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (camera != NULL, NULL);
	g_return_val_if_fail (camera_name != NULL, NULL);
	g_return_val_if_fail (folder != NULL, NULL);
	_tmp0_ = import_page_get_fs_basedir (camera, fsid);
	basedir = _tmp0_;
	_tmp1_ = basedir;
	if (_tmp1_ == NULL) {
		gchar* _tmp2_;
		g_debug ("ImportPage.vala:1352: Unable to find base directory for %s fsid %d", camera_name, fsid);
		_tmp2_ = g_strdup (folder);
		result = _tmp2_;
		_g_free0 (basedir);
		return result;
	}
	_tmp3_ = basedir;
	_tmp4_ = import_page_append_path (_tmp3_, folder);
	result = _tmp4_;
	_g_free0 (basedir);
	return result;
}

static gboolean
import_page_enumerate_files (ImportPage* self,
                             gint fsid,
                             const gchar* dir,
                             GeeArrayList* import_list)
{
	gchar* fulldir = NULL;
	DiscoveredCamera* _tmp0_;
	Camera* _tmp1_;
	DiscoveredCamera* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	CameraList* files = NULL;
	CameraList* _tmp6_ = NULL;
	int _tmp7_;
	DiscoveredCamera* _tmp10_;
	Camera* _tmp11_;
	const gchar* _tmp12_;
	CameraList* _tmp13_;
	GPSpinIdleWrapper* _tmp14_;
	GPContext* _tmp15_;
	CameraList* _tmp19_;
	CameraList* folders = NULL;
	CameraList* _tmp77_ = NULL;
	int _tmp78_;
	DiscoveredCamera* _tmp81_;
	Camera* _tmp82_;
	const gchar* _tmp83_;
	CameraList* _tmp84_;
	GPSpinIdleWrapper* _tmp85_;
	GPContext* _tmp86_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (IS_IMPORT_PAGE (self), FALSE);
	g_return_val_if_fail (dir != NULL, FALSE);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (import_list, GEE_TYPE_ARRAY_LIST), FALSE);
	_tmp0_ = self->priv->dcamera;
	_tmp1_ = _tmp0_->gcamera;
	_tmp2_ = self->priv->dcamera;
	_tmp3_ = _tmp2_->display_name;
	_tmp4_ = import_page_get_fulldir (_tmp1_, _tmp3_, fsid, dir);
	fulldir = _tmp4_;
	_tmp5_ = fulldir;
	if (_tmp5_ == NULL) {
		g_warning ("ImportPage.vala:1363: Skipping enumerating %s: invalid folder name", dir);
		result = TRUE;
		_g_free0 (fulldir);
		return result;
	}
	_tmp7_ = gp_list_new (&_tmp6_);
	_gp_list_unref0 (files);
	files = _tmp6_;
	self->priv->refresh_result = _tmp7_;
	if (self->priv->refresh_result != GP_OK) {
		gchar* _tmp8_;
		gchar* _tmp9_;
		_tmp8_ = gp_result_to_full_string (self->priv->refresh_result);
		_tmp9_ = _tmp8_;
		g_warning ("ImportPage.vala:1371: Unable to create file list: %s", _tmp9_);
		_g_free0 (_tmp9_);
		result = FALSE;
		_gp_list_unref0 (files);
		_g_free0 (fulldir);
		return result;
	}
	_tmp10_ = self->priv->dcamera;
	_tmp11_ = _tmp10_->gcamera;
	_tmp12_ = fulldir;
	_tmp13_ = files;
	_tmp14_ = import_page_spin_idle_context;
	_tmp15_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
	self->priv->refresh_result = gp_camera_folder_list_files (_tmp11_, _tmp12_, _tmp13_, _tmp15_);
	if (self->priv->refresh_result != GP_OK) {
		const gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		_tmp16_ = fulldir;
		_tmp17_ = gp_result_to_full_string (self->priv->refresh_result);
		_tmp18_ = _tmp17_;
		g_warning ("ImportPage.vala:1378: Unable to list files in %s: %s", _tmp16_, _tmp18_);
		_g_free0 (_tmp18_);
		self->priv->refresh_result = GP_OK;
		result = TRUE;
		_gp_list_unref0 (files);
		_g_free0 (fulldir);
		return result;
	}
	_tmp19_ = files;
	gp_list_sort (_tmp19_);
	{
		gint ctr = 0;
		ctr = 0;
		{
			gboolean _tmp20_ = FALSE;
			_tmp20_ = TRUE;
			while (TRUE) {
				CameraList* _tmp22_;
				gchar* filename = NULL;
				CameraList* _tmp23_;
				const gchar* _tmp24_ = NULL;
				int _tmp25_;
				gchar* _tmp26_;
				if (!_tmp20_) {
					gint _tmp21_;
					_tmp21_ = ctr;
					ctr = _tmp21_ + 1;
				}
				_tmp20_ = FALSE;
				_tmp22_ = files;
				if (!(ctr < gp_list_count (_tmp22_))) {
					break;
				}
				_tmp23_ = files;
				_tmp25_ = gp_list_get_name (_tmp23_, ctr, &_tmp24_);
				_g_free0 (filename);
				_tmp26_ = g_strdup (_tmp24_);
				filename = _tmp26_;
				self->priv->refresh_result = _tmp25_;
				if (self->priv->refresh_result != GP_OK) {
					const gchar* _tmp27_;
					gchar* _tmp28_;
					gchar* _tmp29_;
					_tmp27_ = fulldir;
					_tmp28_ = gp_result_to_full_string (self->priv->refresh_result);
					_tmp29_ = _tmp28_;
					g_warning ("ImportPage.vala:1391: Unable to get the name of file %d in %s: %s", ctr, _tmp27_, _tmp29_);
					_g_free0 (_tmp29_);
					result = FALSE;
					_g_free0 (filename);
					_gp_list_unref0 (files);
					_g_free0 (fulldir);
					return result;
				}
				{
					CameraFileInfo info = {0};
					gboolean _tmp30_ = FALSE;
					GPSpinIdleWrapper* _tmp31_;
					GPContext* _tmp32_;
					DiscoveredCamera* _tmp33_;
					Camera* _tmp34_;
					const gchar* _tmp35_;
					const gchar* _tmp36_;
					CameraFileInfo _tmp37_ = {0};
					gboolean _tmp38_;
					const gchar* _tmp43_;
					GtkProgressBar* _tmp69_;
					_tmp31_ = import_page_spin_idle_context;
					_tmp32_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
					_tmp33_ = self->priv->dcamera;
					_tmp34_ = _tmp33_->gcamera;
					_tmp35_ = fulldir;
					_tmp36_ = filename;
					_tmp38_ = gp_get_info (_tmp32_, _tmp34_, _tmp35_, _tmp36_, &_tmp37_, &_inner_error0_);
					 (info);
					info = _tmp37_;
					_tmp30_ = _tmp38_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						 (info);
						goto __catch0_g_error;
					}
					if (!_tmp30_) {
						const gchar* _tmp39_;
						const gchar* _tmp40_;
						_tmp39_ = fulldir;
						_tmp40_ = filename;
						g_warning ("ImportPage.vala:1400: Skipping import of %s/%s: name too long", _tmp39_, _tmp40_);
						 (info);
						_g_free0 (filename);
						continue;
					}
					if ((info.file.fields & GP_FILE_INFO_TYPE) == 0) {
						const gchar* _tmp41_;
						const gchar* _tmp42_;
						_tmp41_ = fulldir;
						_tmp42_ = filename;
						g_message ("ImportPage.vala:1406: Skipping %s/%s: No file (file=%02Xh)", _tmp41_, _tmp42_, (guint) info.file.fields);
						 (info);
						_g_free0 (filename);
						continue;
					}
					_tmp43_ = filename;
					if (video_reader_is_supported_video_filename (_tmp43_)) {
						VideoImportSource* video_source = NULL;
						DiscoveredCamera* _tmp44_;
						const gchar* _tmp45_;
						DiscoveredCamera* _tmp46_;
						Camera* _tmp47_;
						const gchar* _tmp48_;
						GDateTime* _tmp49_;
						GDateTime* _tmp50_;
						VideoImportSource* _tmp51_;
						VideoImportSource* _tmp52_;
						VideoImportSource* _tmp53_;
						_tmp44_ = self->priv->dcamera;
						_tmp45_ = _tmp44_->display_name;
						_tmp46_ = self->priv->dcamera;
						_tmp47_ = _tmp46_->gcamera;
						_tmp48_ = filename;
						_tmp49_ = g_date_time_new_from_unix_utc ((gint64) info.file.mtime);
						_tmp50_ = _tmp49_;
						_tmp51_ = video_import_source_new (_tmp45_, _tmp47_, fsid, dir, _tmp48_, info.file.size, _tmp50_);
						_tmp52_ = _tmp51_;
						_g_date_time_unref0 (_tmp50_);
						video_source = _tmp52_;
						_tmp53_ = video_source;
						gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (import_list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, TYPE_IMPORT_SOURCE, ImportSource));
						_g_object_unref0 (video_source);
					} else {
						gchar* file_type = NULL;
						gchar* _tmp54_;
						PhotoFileFormat file_format = 0;
						const gchar* _tmp55_;
						DiscoveredCamera* _tmp60_;
						const gchar* _tmp61_;
						DiscoveredCamera* _tmp62_;
						Camera* _tmp63_;
						const gchar* _tmp64_;
						GDateTime* _tmp65_;
						GDateTime* _tmp66_;
						PhotoImportSource* _tmp67_;
						PhotoImportSource* _tmp68_;
						_tmp54_ = g_strdup ((const gchar*) info.file.type);
						file_type = _tmp54_;
						_tmp55_ = file_type;
						file_format = photo_file_format_from_gphoto_type (_tmp55_);
						if (file_format == PHOTO_FILE_FORMAT_UNKNOWN) {
							const gchar* _tmp56_;
							_tmp56_ = filename;
							file_format = photo_file_format_get_by_basename_extension (_tmp56_);
							if (file_format == PHOTO_FILE_FORMAT_UNKNOWN) {
								const gchar* _tmp57_;
								const gchar* _tmp58_;
								const gchar* _tmp59_;
								_tmp57_ = fulldir;
								_tmp58_ = filename;
								_tmp59_ = file_type;
								g_message ("ImportPage.vala:1423: Skipping %s/%s: Not a supported file extension (" \
"%s)", _tmp57_, _tmp58_, _tmp59_);
								_g_free0 (file_type);
								 (info);
								_g_free0 (filename);
								continue;
							}
						}
						_tmp60_ = self->priv->dcamera;
						_tmp61_ = _tmp60_->display_name;
						_tmp62_ = self->priv->dcamera;
						_tmp63_ = _tmp62_->gcamera;
						_tmp64_ = filename;
						_tmp65_ = g_date_time_new_from_unix_utc ((gint64) info.file.mtime);
						_tmp66_ = _tmp65_;
						_tmp67_ = photo_import_source_new (_tmp61_, _tmp63_, fsid, dir, _tmp64_, info.file.size, _tmp66_, file_format);
						_tmp68_ = _tmp67_;
						gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (import_list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, TYPE_IMPORT_SOURCE, ImportSource));
						_g_object_unref0 (_tmp68_);
						_g_date_time_unref0 (_tmp66_);
						_g_free0 (file_type);
					}
					_tmp69_ = self->priv->progress_bar;
					gtk_progress_bar_pulse (_tmp69_);
					spin_event_loop ();
					 (info);
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* err = NULL;
					const gchar* _tmp70_;
					GError* _tmp71_;
					const gchar* _tmp72_;
					GError* _tmp73_;
					const gchar* _tmp74_;
					gchar* _tmp75_;
					err = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp70_ = fulldir;
					_tmp71_ = err;
					_tmp72_ = _tmp71_->message;
					g_warning ("ImportPage.vala:1438: Error while enumerating files in %s: %s", _tmp70_, _tmp72_);
					_tmp73_ = err;
					_tmp74_ = _tmp73_->message;
					_tmp75_ = g_strdup (_tmp74_);
					_g_free0 (self->priv->refresh_error);
					self->priv->refresh_error = _tmp75_;
					result = FALSE;
					_g_error_free0 (err);
					_g_free0 (filename);
					_gp_list_unref0 (files);
					_g_free0 (fulldir);
					return result;
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					gboolean _tmp76_ = FALSE;
					_g_free0 (filename);
					_gp_list_unref0 (files);
					_g_free0 (fulldir);
					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 _tmp76_;
				}
				_g_free0 (filename);
			}
		}
	}
	_tmp78_ = gp_list_new (&_tmp77_);
	_gp_list_unref0 (folders);
	folders = _tmp77_;
	self->priv->refresh_result = _tmp78_;
	if (self->priv->refresh_result != GP_OK) {
		gchar* _tmp79_;
		gchar* _tmp80_;
		_tmp79_ = gp_result_to_full_string (self->priv->refresh_result);
		_tmp80_ = _tmp79_;
		g_warning ("ImportPage.vala:1449: Unable to create folder list: %s", _tmp80_);
		_g_free0 (_tmp80_);
		result = FALSE;
		_gp_list_unref0 (folders);
		_gp_list_unref0 (files);
		_g_free0 (fulldir);
		return result;
	}
	_tmp81_ = self->priv->dcamera;
	_tmp82_ = _tmp81_->gcamera;
	_tmp83_ = fulldir;
	_tmp84_ = folders;
	_tmp85_ = import_page_spin_idle_context;
	_tmp86_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp85_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
	self->priv->refresh_result = gp_camera_folder_list_folders (_tmp82_, _tmp83_, _tmp84_, _tmp86_);
	if (self->priv->refresh_result != GP_OK) {
		const gchar* _tmp87_;
		gchar* _tmp88_;
		gchar* _tmp89_;
		_tmp87_ = fulldir;
		_tmp88_ = gp_result_to_full_string (self->priv->refresh_result);
		_tmp89_ = _tmp88_;
		g_warning ("ImportPage.vala:1456: Unable to list folders in %s: %s", _tmp87_, _tmp89_);
		_g_free0 (_tmp89_);
		self->priv->refresh_result = GP_OK;
		result = TRUE;
		_gp_list_unref0 (folders);
		_gp_list_unref0 (files);
		_g_free0 (fulldir);
		return result;
	}
	{
		gint ctr = 0;
		ctr = 0;
		{
			gboolean _tmp90_ = FALSE;
			_tmp90_ = TRUE;
			while (TRUE) {
				CameraList* _tmp92_;
				gchar* subdir = NULL;
				CameraList* _tmp93_;
				const gchar* _tmp94_ = NULL;
				int _tmp95_;
				gchar* _tmp96_;
				const gchar* _tmp99_;
				if (!_tmp90_) {
					gint _tmp91_;
					_tmp91_ = ctr;
					ctr = _tmp91_ + 1;
				}
				_tmp90_ = FALSE;
				_tmp92_ = folders;
				if (!(ctr < gp_list_count (_tmp92_))) {
					break;
				}
				_tmp93_ = folders;
				_tmp95_ = gp_list_get_name (_tmp93_, ctr, &_tmp94_);
				_g_free0 (subdir);
				_tmp96_ = g_strdup (_tmp94_);
				subdir = _tmp96_;
				self->priv->refresh_result = _tmp95_;
				if (self->priv->refresh_result != GP_OK) {
					gchar* _tmp97_;
					gchar* _tmp98_;
					_tmp97_ = gp_result_to_full_string (self->priv->refresh_result);
					_tmp98_ = _tmp97_;
					g_warning ("ImportPage.vala:1468: Unable to get name of folder %d: %s", ctr, _tmp98_);
					_g_free0 (_tmp98_);
					result = FALSE;
					_g_free0 (subdir);
					_gp_list_unref0 (folders);
					_gp_list_unref0 (files);
					_g_free0 (fulldir);
					return result;
				}
				_tmp99_ = subdir;
				if (g_str_has_prefix (_tmp99_, ".")) {
					const gchar* _tmp100_;
					_tmp100_ = subdir;
					g_debug ("ImportPage.vala:1474: Skipping hidden sub-folder %s in %s", _tmp100_, dir);
				} else {
					const gchar* _tmp101_;
					gchar* _tmp102_;
					gchar* _tmp103_;
					gboolean _tmp104_;
					_tmp101_ = subdir;
					_tmp102_ = import_page_append_path (dir, _tmp101_);
					_tmp103_ = _tmp102_;
					_tmp104_ = !import_page_enumerate_files (self, fsid, _tmp103_, import_list);
					_g_free0 (_tmp103_);
					if (_tmp104_) {
						result = FALSE;
						_g_free0 (subdir);
						_gp_list_unref0 (folders);
						_gp_list_unref0 (files);
						_g_free0 (fulldir);
						return result;
					}
				}
				_g_free0 (subdir);
			}
		}
	}
	result = TRUE;
	_gp_list_unref0 (folders);
	_gp_list_unref0 (files);
	_g_free0 (fulldir);
	return result;
}

static void
import_page_auto_match_raw_jpeg (ImportPage* self,
                                 GeeArrayList* import_list)
{
	g_return_if_fail (IS_IMPORT_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (import_list, GEE_TYPE_ARRAY_LIST));
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gint _tmp2_;
				gint _tmp3_;
				PhotoImportSource* current = NULL;
				gpointer _tmp4_;
				ImportSource* _tmp5_;
				PhotoImportSource* _tmp6_;
				PhotoImportSource* _tmp7_ = NULL;
				gint _tmp8_;
				gint _tmp9_;
				PhotoImportSource* next = NULL;
				PhotoImportSource* _tmp13_;
				PhotoImportSource* _tmp14_ = NULL;
				PhotoImportSource* prev = NULL;
				PhotoImportSource* _tmp18_;
				gboolean _tmp19_ = FALSE;
				PhotoImportSource* _tmp20_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (import_list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
				_tmp3_ = _tmp2_;
				if (!(i < _tmp3_)) {
					break;
				}
				_tmp4_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (import_list, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), i);
				_tmp5_ = (ImportSource*) _tmp4_;
				_tmp6_ = IS_PHOTO_IMPORT_SOURCE (_tmp5_) ? ((PhotoImportSource*) _tmp5_) : NULL;
				if (_tmp6_ == NULL) {
					_g_object_unref0 (_tmp5_);
				}
				current = _tmp6_;
				_tmp8_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (import_list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
				_tmp9_ = _tmp8_;
				if ((i + 1) < _tmp9_) {
					gpointer _tmp10_;
					ImportSource* _tmp11_;
					PhotoImportSource* _tmp12_;
					_tmp10_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (import_list, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), i + 1);
					_tmp11_ = (ImportSource*) _tmp10_;
					_tmp12_ = IS_PHOTO_IMPORT_SOURCE (_tmp11_) ? ((PhotoImportSource*) _tmp11_) : NULL;
					if (_tmp12_ == NULL) {
						_g_object_unref0 (_tmp11_);
					}
					_g_object_unref0 (_tmp7_);
					_tmp7_ = _tmp12_;
				} else {
					_g_object_unref0 (_tmp7_);
					_tmp7_ = NULL;
				}
				_tmp13_ = _tmp7_;
				_tmp7_ = NULL;
				next = _tmp13_;
				if (i > 0) {
					gpointer _tmp15_;
					ImportSource* _tmp16_;
					PhotoImportSource* _tmp17_;
					_tmp15_ = gee_abstract_list_get (G_TYPE_CHECK_INSTANCE_CAST (import_list, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), i - 1);
					_tmp16_ = (ImportSource*) _tmp15_;
					_tmp17_ = IS_PHOTO_IMPORT_SOURCE (_tmp16_) ? ((PhotoImportSource*) _tmp16_) : NULL;
					if (_tmp17_ == NULL) {
						_g_object_unref0 (_tmp16_);
					}
					_g_object_unref0 (_tmp14_);
					_tmp14_ = _tmp17_;
				} else {
					_g_object_unref0 (_tmp14_);
					_tmp14_ = NULL;
				}
				_tmp18_ = _tmp14_;
				_tmp14_ = NULL;
				prev = _tmp18_;
				_tmp20_ = current;
				if (_tmp20_ != NULL) {
					PhotoImportSource* _tmp21_;
					_tmp21_ = current;
					_tmp19_ = photo_import_source_get_file_format (_tmp21_) == PHOTO_FILE_FORMAT_RAW;
				} else {
					_tmp19_ = FALSE;
				}
				if (_tmp19_) {
					gchar* current_name = NULL;
					gchar* ext = NULL;
					PhotoImportSource* _tmp22_;
					gchar* _tmp23_;
					gchar* _tmp24_;
					gchar* _tmp25_ = NULL;
					gchar* _tmp26_ = NULL;
					PhotoImportSource* associated = NULL;
					gboolean _tmp27_ = FALSE;
					PhotoImportSource* _tmp28_;
					gboolean _tmp39_ = FALSE;
					PhotoImportSource* _tmp40_;
					PhotoImportSource* _tmp51_;
					_tmp22_ = current;
					_tmp23_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_IMPORT_SOURCE, ImportSource));
					_tmp24_ = _tmp23_;
					disassemble_filename (_tmp24_, &_tmp25_, &_tmp26_);
					_g_free0 (current_name);
					current_name = _tmp25_;
					_g_free0 (ext);
					ext = _tmp26_;
					_g_free0 (_tmp24_);
					associated = NULL;
					_tmp28_ = next;
					if (_tmp28_ != NULL) {
						PhotoImportSource* _tmp29_;
						_tmp29_ = next;
						_tmp27_ = photo_import_source_get_file_format (_tmp29_) == PHOTO_FILE_FORMAT_JFIF;
					} else {
						_tmp27_ = FALSE;
					}
					if (_tmp27_) {
						gchar* next_name = NULL;
						PhotoImportSource* _tmp30_;
						gchar* _tmp31_;
						gchar* _tmp32_;
						gchar* _tmp33_ = NULL;
						gchar* _tmp34_ = NULL;
						const gchar* _tmp35_;
						const gchar* _tmp36_;
						_tmp30_ = next;
						_tmp31_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, TYPE_IMPORT_SOURCE, ImportSource));
						_tmp32_ = _tmp31_;
						disassemble_filename (_tmp32_, &_tmp33_, &_tmp34_);
						_g_free0 (next_name);
						next_name = _tmp33_;
						_g_free0 (ext);
						ext = _tmp34_;
						_g_free0 (_tmp32_);
						_tmp35_ = next_name;
						_tmp36_ = current_name;
						if (g_strcmp0 (_tmp35_, _tmp36_) == 0) {
							PhotoImportSource* _tmp37_;
							PhotoImportSource* _tmp38_;
							_tmp37_ = next;
							_tmp38_ = _g_object_ref0 (_tmp37_);
							_g_object_unref0 (associated);
							associated = _tmp38_;
						}
						_g_free0 (next_name);
					}
					_tmp40_ = prev;
					if (_tmp40_ != NULL) {
						PhotoImportSource* _tmp41_;
						_tmp41_ = prev;
						_tmp39_ = photo_import_source_get_file_format (_tmp41_) == PHOTO_FILE_FORMAT_JFIF;
					} else {
						_tmp39_ = FALSE;
					}
					if (_tmp39_) {
						gchar* prev_name = NULL;
						PhotoImportSource* _tmp42_;
						gchar* _tmp43_;
						gchar* _tmp44_;
						gchar* _tmp45_ = NULL;
						gchar* _tmp46_ = NULL;
						const gchar* _tmp47_;
						const gchar* _tmp48_;
						_tmp42_ = prev;
						_tmp43_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, TYPE_IMPORT_SOURCE, ImportSource));
						_tmp44_ = _tmp43_;
						disassemble_filename (_tmp44_, &_tmp45_, &_tmp46_);
						_g_free0 (prev_name);
						prev_name = _tmp45_;
						_g_free0 (ext);
						ext = _tmp46_;
						_g_free0 (_tmp44_);
						_tmp47_ = prev_name;
						_tmp48_ = current_name;
						if (g_strcmp0 (_tmp47_, _tmp48_) == 0) {
							PhotoImportSource* _tmp49_;
							PhotoImportSource* _tmp50_;
							_tmp49_ = prev;
							_tmp50_ = _g_object_ref0 (_tmp49_);
							_g_object_unref0 (associated);
							associated = _tmp50_;
						}
						_g_free0 (prev_name);
					}
					_tmp51_ = associated;
					if (_tmp51_ != NULL) {
						PhotoImportSource* _tmp52_;
						gchar* _tmp53_;
						gchar* _tmp54_;
						PhotoImportSource* _tmp55_;
						gchar* _tmp56_;
						gchar* _tmp57_;
						PhotoImportSource* _tmp58_;
						PhotoImportSource* _tmp59_;
						PhotoImportSource* _tmp60_;
						_tmp52_ = current;
						_tmp53_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp52_, TYPE_IMPORT_SOURCE, ImportSource));
						_tmp54_ = _tmp53_;
						_tmp55_ = associated;
						_tmp56_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp55_, TYPE_IMPORT_SOURCE, ImportSource));
						_tmp57_ = _tmp56_;
						g_debug ("ImportPage.vala:1514: Found RAW+JPEG pair: %s and %s", _tmp54_, _tmp57_);
						_g_free0 (_tmp57_);
						_g_free0 (_tmp54_);
						_tmp58_ = current;
						_tmp59_ = associated;
						photo_import_source_set_associated (_tmp58_, _tmp59_);
						_tmp60_ = associated;
						if (!gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (import_list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, TYPE_IMPORT_SOURCE, ImportSource))) {
							PhotoImportSource* _tmp61_;
							g_debug ("ImportPage.vala:1517: Unable to associate files");
							_tmp61_ = current;
							photo_import_source_set_associated (_tmp61_, NULL);
						}
					}
					_g_object_unref0 (associated);
					_g_free0 (ext);
					_g_free0 (current_name);
				}
				_g_object_unref0 (prev);
				_g_object_unref0 (_tmp14_);
				_g_object_unref0 (next);
				_g_object_unref0 (_tmp7_);
				_g_object_unref0 (current);
			}
		}
	}
}

static void
import_page_load_previews_and_metadata (ImportPage* self,
                                        GeeList* import_list)
{
	gint loaded_photos = 0;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (import_list, GEE_TYPE_LIST));
	loaded_photos = 0;
	{
		GeeList* _import_source_list = NULL;
		gint _import_source_size = 0;
		GeeList* _tmp0_;
		gint _tmp1_;
		gint _tmp2_;
		gint _import_source_index = 0;
		_import_source_list = import_list;
		_tmp0_ = _import_source_list;
		_tmp1_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp2_ = _tmp1_;
		_import_source_size = _tmp2_;
		_import_source_index = -1;
		while (TRUE) {
			gint _tmp3_;
			gint _tmp4_;
			ImportSource* import_source = NULL;
			GeeList* _tmp5_;
			gpointer _tmp6_;
			gchar* filename = NULL;
			ImportSource* _tmp7_;
			gchar* _tmp8_;
			gchar* fulldir = NULL;
			ImportSource* _tmp9_;
			gchar* _tmp10_;
			const gchar* _tmp11_;
			PhotoImportSource* associated = NULL;
			gboolean _tmp15_ = FALSE;
			ImportSource* _tmp16_;
			GtkProgressBar* _tmp22_;
			GtkProgressBar* _tmp23_;
			ImportSource* _tmp24_;
			gchar* _tmp25_;
			gchar* _tmp26_;
			gchar* _tmp27_;
			gchar* _tmp28_;
			PhotoMetadata* metadata = NULL;
			const gchar* _tmp29_;
			gchar* exif_only_md5 = NULL;
			PhotoMetadata* _tmp43_;
			GdkPixbuf* preview = NULL;
			gchar* preview_md5 = NULL;
			VideoImportSource* video_import_source = NULL;
			ImportSource* _tmp70_;
			VideoImportSource* _tmp71_;
			VideoImportSource* _tmp72_;
			PhotoImportSource* photo_import_source = NULL;
			ImportSource* _tmp75_;
			PhotoImportSource* _tmp76_;
			PhotoImportSource* _tmp77_;
			PhotoImportSource* _tmp83_;
			SourceCollection* _tmp108_;
			ImportSource* _tmp109_;
			GtkProgressBar* _tmp110_;
			gint _tmp111_;
			gint _tmp112_;
			gint _tmp113_;
			_import_source_index = _import_source_index + 1;
			_tmp3_ = _import_source_index;
			_tmp4_ = _import_source_size;
			if (!(_tmp3_ < _tmp4_)) {
				break;
			}
			_tmp5_ = _import_source_list;
			_tmp6_ = gee_list_get (_tmp5_, _import_source_index);
			import_source = (ImportSource*) _tmp6_;
			_tmp7_ = import_source;
			_tmp8_ = import_source_get_filename (_tmp7_);
			filename = _tmp8_;
			_tmp9_ = import_source;
			_tmp10_ = import_source_get_fulldir (_tmp9_);
			fulldir = _tmp10_;
			_tmp11_ = fulldir;
			if (_tmp11_ == NULL) {
				ImportSource* _tmp12_;
				gchar* _tmp13_;
				gchar* _tmp14_;
				_tmp12_ = import_source;
				_tmp13_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_DATA_OBJECT, DataObject));
				_tmp14_ = _tmp13_;
				g_warning ("ImportPage.vala:1531: Skipping loading preview of %s: invalid folder n" \
"ame", _tmp14_);
				_g_free0 (_tmp14_);
				_g_free0 (fulldir);
				_g_free0 (filename);
				_g_object_unref0 (import_source);
				continue;
			}
			associated = NULL;
			_tmp16_ = import_source;
			if (IS_PHOTO_IMPORT_SOURCE (_tmp16_)) {
				ImportSource* _tmp17_;
				PhotoImportSource* _tmp18_;
				PhotoImportSource* _tmp19_;
				_tmp17_ = import_source;
				_tmp18_ = photo_import_source_get_associated (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource));
				_tmp19_ = _tmp18_;
				_tmp15_ = _tmp19_ != NULL;
				_g_object_unref0 (_tmp19_);
			} else {
				_tmp15_ = FALSE;
			}
			if (_tmp15_) {
				ImportSource* _tmp20_;
				PhotoImportSource* _tmp21_;
				_tmp20_ = import_source;
				_tmp21_ = photo_import_source_get_associated (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource));
				_g_object_unref0 (associated);
				associated = _tmp21_;
			}
			_tmp22_ = self->priv->progress_bar;
			gtk_progress_bar_set_ellipsize (_tmp22_, PANGO_ELLIPSIZE_MIDDLE);
			_tmp23_ = self->priv->progress_bar;
			_tmp24_ = import_source;
			_tmp25_ = data_object_get_name (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, TYPE_DATA_OBJECT, DataObject));
			_tmp26_ = _tmp25_;
			_tmp27_ = g_strdup_printf (_ ("Fetching preview for %s"), _tmp26_);
			_tmp28_ = _tmp27_;
			gtk_progress_bar_set_text (_tmp23_, _tmp28_);
			_g_free0 (_tmp28_);
			_g_free0 (_tmp26_);
			metadata = NULL;
			_tmp29_ = filename;
			if (!video_reader_is_supported_video_filename (_tmp29_)) {
				{
					PhotoMetadata* _tmp30_ = NULL;
					GPSpinIdleWrapper* _tmp31_;
					GPContext* _tmp32_;
					DiscoveredCamera* _tmp33_;
					Camera* _tmp34_;
					const gchar* _tmp35_;
					const gchar* _tmp36_;
					PhotoMetadata* _tmp37_;
					PhotoMetadata* _tmp38_;
					_tmp31_ = import_page_spin_idle_context;
					_tmp32_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
					_tmp33_ = self->priv->dcamera;
					_tmp34_ = _tmp33_->gcamera;
					_tmp35_ = fulldir;
					_tmp36_ = filename;
					_tmp37_ = gp_load_metadata (_tmp32_, _tmp34_, _tmp35_, _tmp36_, &_inner_error0_);
					_tmp30_ = _tmp37_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
					_tmp38_ = _tmp30_;
					_tmp30_ = NULL;
					_media_metadata_unref0 (metadata);
					metadata = _tmp38_;
					_media_metadata_unref0 (_tmp30_);
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* err = NULL;
					const gchar* _tmp39_;
					const gchar* _tmp40_;
					GError* _tmp41_;
					const gchar* _tmp42_;
					err = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp39_ = fulldir;
					_tmp40_ = filename;
					_tmp41_ = err;
					_tmp42_ = _tmp41_->message;
					g_warning ("ImportPage.vala:1557: Unable to fetch metadata for %s/%s: %s", _tmp39_, _tmp40_, _tmp42_);
					_g_error_free0 (err);
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_media_metadata_unref0 (metadata);
					_g_object_unref0 (associated);
					_g_free0 (fulldir);
					_g_free0 (filename);
					_g_object_unref0 (import_source);
					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;
				}
			}
			exif_only_md5 = NULL;
			_tmp43_ = metadata;
			if (_tmp43_ != NULL) {
				PhotoMetadata* _tmp44_;
				gchar* _tmp45_;
				_tmp44_ = metadata;
				_tmp45_ = photo_metadata_exif_hash (_tmp44_);
				_g_free0 (exif_only_md5);
				exif_only_md5 = _tmp45_;
			}
			preview = NULL;
			preview_md5 = NULL;
			{
				gchar* preview_fulldir = NULL;
				const gchar* _tmp46_;
				gchar* _tmp47_;
				gchar* preview_filename = NULL;
				const gchar* _tmp48_;
				gchar* _tmp49_;
				PhotoImportSource* _tmp50_;
				GdkPixbuf* _tmp55_ = NULL;
				GPSpinIdleWrapper* _tmp56_;
				GPContext* _tmp57_;
				DiscoveredCamera* _tmp58_;
				Camera* _tmp59_;
				const gchar* _tmp60_;
				const gchar* _tmp61_;
				gchar* _tmp62_ = NULL;
				GdkPixbuf* _tmp63_;
				GdkPixbuf* _tmp64_;
				_tmp46_ = fulldir;
				_tmp47_ = g_strdup (_tmp46_);
				preview_fulldir = _tmp47_;
				_tmp48_ = filename;
				_tmp49_ = g_strdup (_tmp48_);
				preview_filename = _tmp49_;
				_tmp50_ = associated;
				if (_tmp50_ != NULL) {
					PhotoImportSource* _tmp51_;
					gchar* _tmp52_;
					PhotoImportSource* _tmp53_;
					gchar* _tmp54_;
					_tmp51_ = associated;
					_tmp52_ = import_source_get_fulldir (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, TYPE_IMPORT_SOURCE, ImportSource));
					_g_free0 (preview_fulldir);
					preview_fulldir = _tmp52_;
					_tmp53_ = associated;
					_tmp54_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, TYPE_IMPORT_SOURCE, ImportSource));
					_g_free0 (preview_filename);
					preview_filename = _tmp54_;
				}
				_tmp56_ = import_page_spin_idle_context;
				_tmp57_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp56_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
				_tmp58_ = self->priv->dcamera;
				_tmp59_ = _tmp58_->gcamera;
				_tmp60_ = preview_fulldir;
				_tmp61_ = preview_filename;
				_tmp63_ = gp_load_preview (_tmp57_, _tmp59_, _tmp60_, _tmp61_, &_tmp62_, &_inner_error0_);
				_g_free0 (preview_md5);
				preview_md5 = _tmp62_;
				_tmp55_ = _tmp63_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_free0 (preview_filename);
					_g_free0 (preview_fulldir);
					goto __catch1_g_error;
				}
				_tmp64_ = _tmp55_;
				_tmp55_ = NULL;
				_g_object_unref0 (preview);
				preview = _tmp64_;
				_g_object_unref0 (_tmp55_);
				_g_free0 (preview_filename);
				_g_free0 (preview_fulldir);
			}
			goto __finally1;
			__catch1_g_error:
			{
				GError* err = NULL;
				const gchar* _tmp65_;
				err = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp65_ = filename;
				if (!video_reader_is_supported_video_filename (_tmp65_)) {
					const gchar* _tmp66_;
					const gchar* _tmp67_;
					GError* _tmp68_;
					const gchar* _tmp69_;
					_tmp66_ = fulldir;
					_tmp67_ = filename;
					_tmp68_ = err;
					_tmp69_ = _tmp68_->message;
					g_warning ("ImportPage.vala:1592: Unable to fetch preview for %s/%s: %s", _tmp66_, _tmp67_, _tmp69_);
				}
				_g_error_free0 (err);
			}
			__finally1:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_free0 (preview_md5);
				_g_object_unref0 (preview);
				_g_free0 (exif_only_md5);
				_media_metadata_unref0 (metadata);
				_g_object_unref0 (associated);
				_g_free0 (fulldir);
				_g_free0 (filename);
				_g_object_unref0 (import_source);
				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;
			}
			_tmp70_ = import_source;
			_tmp71_ = _g_object_ref0 (IS_VIDEO_IMPORT_SOURCE (_tmp70_) ? ((VideoImportSource*) _tmp70_) : NULL);
			video_import_source = _tmp71_;
			_tmp72_ = video_import_source;
			if (_tmp72_ != NULL) {
				VideoImportSource* _tmp73_;
				GdkPixbuf* _tmp74_;
				_tmp73_ = video_import_source;
				_tmp74_ = preview;
				video_import_source_update (_tmp73_, _tmp74_);
			}
			_tmp75_ = import_source;
			_tmp76_ = _g_object_ref0 (IS_PHOTO_IMPORT_SOURCE (_tmp75_) ? ((PhotoImportSource*) _tmp75_) : NULL);
			photo_import_source = _tmp76_;
			_tmp77_ = photo_import_source;
			if (_tmp77_ != NULL) {
				PhotoImportSource* _tmp78_;
				GdkPixbuf* _tmp79_;
				const gchar* _tmp80_;
				PhotoMetadata* _tmp81_;
				const gchar* _tmp82_;
				_tmp78_ = photo_import_source;
				_tmp79_ = preview;
				_tmp80_ = preview_md5;
				_tmp81_ = metadata;
				_tmp82_ = exif_only_md5;
				photo_import_source_update (_tmp78_, _tmp79_, _tmp80_, _tmp81_, _tmp82_);
			}
			_tmp83_ = associated;
			if (_tmp83_ != NULL) {
				{
					PhotoMetadata* associated_metadata = NULL;
					GPSpinIdleWrapper* _tmp84_;
					GPContext* _tmp85_;
					DiscoveredCamera* _tmp86_;
					Camera* _tmp87_;
					PhotoImportSource* _tmp88_;
					gchar* _tmp89_;
					gchar* _tmp90_;
					PhotoImportSource* _tmp91_;
					gchar* _tmp92_;
					gchar* _tmp93_;
					PhotoMetadata* _tmp94_;
					PhotoMetadata* _tmp95_;
					PhotoImportSource* _tmp96_;
					GdkPixbuf* _tmp97_;
					const gchar* _tmp98_;
					PhotoMetadata* _tmp99_;
					_tmp84_ = import_page_spin_idle_context;
					_tmp85_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp84_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
					_tmp86_ = self->priv->dcamera;
					_tmp87_ = _tmp86_->gcamera;
					_tmp88_ = associated;
					_tmp89_ = import_source_get_fulldir (G_TYPE_CHECK_INSTANCE_CAST (_tmp88_, TYPE_IMPORT_SOURCE, ImportSource));
					_tmp90_ = _tmp89_;
					_tmp91_ = associated;
					_tmp92_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp91_, TYPE_IMPORT_SOURCE, ImportSource));
					_tmp93_ = _tmp92_;
					_tmp94_ = gp_load_metadata (_tmp85_, _tmp87_, _tmp90_, _tmp93_, &_inner_error0_);
					_tmp95_ = _tmp94_;
					_g_free0 (_tmp93_);
					_g_free0 (_tmp90_);
					associated_metadata = _tmp95_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch2_g_error;
					}
					_tmp96_ = associated;
					_tmp97_ = preview;
					_tmp98_ = preview_md5;
					_tmp99_ = associated_metadata;
					photo_import_source_update (_tmp96_, _tmp97_, _tmp98_, _tmp99_, NULL);
					_media_metadata_unref0 (associated_metadata);
				}
				goto __finally2;
				__catch2_g_error:
				{
					GError* err = NULL;
					PhotoImportSource* _tmp100_;
					gchar* _tmp101_;
					gchar* _tmp102_;
					PhotoImportSource* _tmp103_;
					gchar* _tmp104_;
					gchar* _tmp105_;
					GError* _tmp106_;
					const gchar* _tmp107_;
					err = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp100_ = associated;
					_tmp101_ = import_source_get_fulldir (G_TYPE_CHECK_INSTANCE_CAST (_tmp100_, TYPE_IMPORT_SOURCE, ImportSource));
					_tmp102_ = _tmp101_;
					_tmp103_ = associated;
					_tmp104_ = import_source_get_filename (G_TYPE_CHECK_INSTANCE_CAST (_tmp103_, TYPE_IMPORT_SOURCE, ImportSource));
					_tmp105_ = _tmp104_;
					_tmp106_ = err;
					_tmp107_ = _tmp106_->message;
					g_warning ("ImportPage.vala:1614: Unable to fetch metadata for %s/%s: %s", _tmp102_, _tmp105_, _tmp107_);
					_g_free0 (_tmp105_);
					_g_free0 (_tmp102_);
					_g_error_free0 (err);
				}
				__finally2:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (photo_import_source);
					_g_object_unref0 (video_import_source);
					_g_free0 (preview_md5);
					_g_object_unref0 (preview);
					_g_free0 (exif_only_md5);
					_media_metadata_unref0 (metadata);
					_g_object_unref0 (associated);
					_g_free0 (fulldir);
					_g_free0 (filename);
					_g_object_unref0 (import_source);
					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;
				}
			}
			_tmp108_ = self->priv->import_sources;
			_tmp109_ = import_source;
			data_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp108_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp109_, TYPE_DATA_OBJECT, DataObject));
			_tmp110_ = self->priv->progress_bar;
			loaded_photos = loaded_photos + 1;
			_tmp111_ = loaded_photos;
			_tmp112_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (import_list, GEE_TYPE_COLLECTION, GeeCollection));
			_tmp113_ = _tmp112_;
			gtk_progress_bar_set_fraction (_tmp110_, ((gdouble) _tmp111_) / ((gdouble) _tmp113_));
			spin_event_loop ();
			_g_object_unref0 (photo_import_source);
			_g_object_unref0 (video_import_source);
			_g_free0 (preview_md5);
			_g_object_unref0 (preview);
			_g_free0 (exif_only_md5);
			_media_metadata_unref0 (metadata);
			_g_object_unref0 (associated);
			_g_free0 (fulldir);
			_g_free0 (filename);
			_g_object_unref0 (import_source);
		}
	}
}

static void
import_page_on_hide_imported (ImportPage* self)
{
	GtkCheckButton* _tmp0_;
	ConfigFacade* _tmp7_;
	ConfigFacade* _tmp8_;
	GtkCheckButton* _tmp9_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	_tmp0_ = self->priv->hide_imported;
	if (gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_toggle_button_get_type (), GtkToggleButton))) {
		ViewCollection* _tmp1_;
		ViewCollection* _tmp2_;
		ImportPageHideImportedViewFilter* _tmp3_;
		_tmp1_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp2_ = _tmp1_;
		_tmp3_ = self->priv->hide_imported_filter;
		view_collection_install_view_filter (_tmp2_, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_VIEW_FILTER, ViewFilter));
		_data_collection_unref0 (_tmp2_);
	} else {
		ViewCollection* _tmp4_;
		ViewCollection* _tmp5_;
		ImportPageHideImportedViewFilter* _tmp6_;
		_tmp4_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp5_ = _tmp4_;
		_tmp6_ = self->priv->hide_imported_filter;
		view_collection_remove_view_filter (_tmp5_, G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_VIEW_FILTER, ViewFilter));
		_data_collection_unref0 (_tmp5_);
	}
	_tmp7_ = config_facade_get_instance ();
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->hide_imported;
	configuration_facade_set_hide_photos_already_imported (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_toggle_button_get_type (), GtkToggleButton)));
	_g_object_unref0 (_tmp8_);
}

static void
import_page_on_import_selected (ImportPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	GeeList* _tmp2_;
	GeeList* _tmp3_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected (_tmp1_);
	_tmp3_ = _tmp2_;
	import_page_import (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
	_g_object_unref0 (_tmp3_);
	_data_collection_unref0 (_tmp1_);
}

static void
import_page_on_import_all (ImportPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = data_collection_get_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection));
	_tmp3_ = _tmp2_;
	import_page_import (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
	_g_object_unref0 (_tmp3_);
	_data_collection_unref0 (_tmp1_);
}

static gint64
_import_page_import_job_comparator_comparator (void* a,
                                               void* b,
                                               gpointer self)
{
	gint64 result;
	result = import_page_import_job_comparator ((ImportPage*) self, a, b);
	return result;
}

static void
_import_page_import_reporter_batch_import_import_reporter (ImportManifest* manifest,
                                                           BatchImportRoll* import_roll,
                                                           gpointer self)
{
	import_page_import_reporter ((ImportPage*) self, manifest);
}

static void
_import_page_on_import_job_failed_batch_import_import_job_failed (BatchImport* _sender,
                                                                  BatchImportResult* _result_,
                                                                  gpointer self)
{
	import_page_on_import_job_failed ((ImportPage*) self, _result_);
}

static void
_import_page_close_import_batch_import_import_complete (BatchImport* _sender,
                                                        ImportManifest* manifest,
                                                        BatchImportRoll* import_roll,
                                                        gpointer self)
{
	import_page_close_import ((ImportPage*) self);
}

static void
import_page_import (ImportPage* self,
                    GeeIterable* items)
{
	int res = 0;
	DiscoveredCamera* _tmp0_;
	Camera* _tmp1_;
	GPSpinIdleWrapper* _tmp2_;
	GPContext* _tmp3_;
	GtkProgressBar* _tmp8_;
	SortedList* jobs = NULL;
	SortedList* _tmp9_;
	GeeArrayList* already_imported = NULL;
	GeeArrayList* _tmp10_;
	SortedList* _tmp48_;
	gint _tmp49_;
	gint _tmp50_;
	DiscoveredCamera* _tmp51_;
	const gchar* _tmp52_;
	SortedList* _tmp53_;
	gint _tmp54_;
	gint _tmp55_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (items, GEE_TYPE_ITERABLE));
	_tmp0_ = self->priv->dcamera;
	_tmp1_ = _tmp0_->gcamera;
	_tmp2_ = import_page_spin_idle_context;
	_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
	res = gp_camera_init (_tmp1_, _tmp3_);
	if (res != GP_OK) {
		gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp4_ = gp_result_to_full_string (res);
		_tmp5_ = _tmp4_;
		_tmp6_ = g_strdup_printf (_ ("Unable to lock camera: %s"), _tmp5_);
		_tmp7_ = _tmp6_;
		app_window_error_message (_tmp7_, NULL);
		_g_free0 (_tmp7_);
		_g_free0 (_tmp5_);
		return;
	}
	import_page_update_status (self, TRUE, self->priv->refreshed);
	import_page_on_view_changed (self);
	_tmp8_ = self->priv->progress_bar;
	gtk_widget_set_visible (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget), FALSE);
	_tmp9_ = sorted_list_new (IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, (GBoxedCopyFunc) batch_import_job_ref, (GDestroyNotify) batch_import_job_unref, _import_page_import_job_comparator_comparator, self);
	jobs = _tmp9_;
	_tmp10_ = gee_array_list_new (IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, (GBoxedCopyFunc) batch_import_job_ref, (GDestroyNotify) batch_import_job_unref, NULL, NULL, NULL);
	already_imported = _tmp10_;
	{
		GeeIterator* _object_it = NULL;
		GeeIterator* _tmp11_;
		_tmp11_ = gee_iterable_iterator (items);
		_object_it = _tmp11_;
		while (TRUE) {
			GeeIterator* _tmp12_;
			DataObject* object = NULL;
			GeeIterator* _tmp13_;
			gpointer _tmp14_;
			ImportPreview* preview = NULL;
			DataObject* _tmp15_;
			ImportPreview* _tmp16_;
			ImportSource* import_file = NULL;
			ImportPreview* _tmp17_;
			DataSource* _tmp18_;
			ImportPreview* _tmp19_;
			ImportPageCameraImportJob* import_job = NULL;
			GPContextWrapper* _tmp31_;
			ImportSource* _tmp32_;
			ImportPageCameraImportJob* _tmp33_;
			gboolean _tmp34_ = FALSE;
			ImportSource* _tmp35_;
			SortedList* _tmp46_;
			ImportPageCameraImportJob* _tmp47_;
			_tmp12_ = _object_it;
			if (!gee_iterator_next (_tmp12_)) {
				break;
			}
			_tmp13_ = _object_it;
			_tmp14_ = gee_iterator_get (_tmp13_);
			object = (DataObject*) _tmp14_;
			_tmp15_ = object;
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_IMPORT_PREVIEW, ImportPreview));
			preview = _tmp16_;
			_tmp17_ = preview;
			_tmp18_ = data_view_get_source (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, TYPE_DATA_VIEW, DataView));
			import_file = G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_IMPORT_SOURCE, ImportSource);
			_tmp19_ = preview;
			if (import_preview_is_already_imported (_tmp19_)) {
				ImportSource* _tmp20_;
				gchar* _tmp21_;
				gchar* _tmp22_;
				GeeArrayList* _tmp23_;
				GPContextWrapper* _tmp24_;
				ImportSource* _tmp25_;
				ImportPreview* _tmp26_;
				DuplicatedFile* _tmp27_;
				DuplicatedFile* _tmp28_;
				ImportPageCameraImportJob* _tmp29_;
				ImportPageCameraImportJob* _tmp30_;
				_tmp20_ = import_file;
				_tmp21_ = import_source_get_filename (_tmp20_);
				_tmp22_ = _tmp21_;
				g_message ("ImportPage.vala:1671: Skipping import of %s: checksum detected in libr" \
"ary", _tmp22_);
				_g_free0 (_tmp22_);
				_tmp23_ = already_imported;
				_tmp24_ = import_page_null_context;
				_tmp25_ = import_file;
				_tmp26_ = preview;
				_tmp27_ = import_preview_get_duplicated_file (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = import_page_camera_import_job_new (_tmp24_, _tmp25_, _tmp28_);
				_tmp30_ = _tmp29_;
				gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp30_);
				_batch_import_job_unref0 (_tmp30_);
				_g_object_unref0 (_tmp28_);
				_g_object_unref0 (import_file);
				_g_object_unref0 (preview);
				_g_object_unref0 (object);
				continue;
			}
			_tmp31_ = import_page_null_context;
			_tmp32_ = import_file;
			_tmp33_ = import_page_camera_import_job_new (_tmp31_, _tmp32_, NULL);
			import_job = _tmp33_;
			_tmp35_ = import_file;
			if (IS_PHOTO_IMPORT_SOURCE (_tmp35_)) {
				ImportSource* _tmp36_;
				PhotoImportSource* _tmp37_;
				PhotoImportSource* _tmp38_;
				_tmp36_ = import_file;
				_tmp37_ = photo_import_source_get_associated (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource));
				_tmp38_ = _tmp37_;
				_tmp34_ = _tmp38_ != NULL;
				_g_object_unref0 (_tmp38_);
			} else {
				_tmp34_ = FALSE;
			}
			if (_tmp34_) {
				ImportPageCameraImportJob* _tmp39_;
				GPContextWrapper* _tmp40_;
				ImportSource* _tmp41_;
				PhotoImportSource* _tmp42_;
				PhotoImportSource* _tmp43_;
				ImportPageCameraImportJob* _tmp44_;
				ImportPageCameraImportJob* _tmp45_;
				_tmp39_ = import_job;
				_tmp40_ = import_page_null_context;
				_tmp41_ = import_file;
				_tmp42_ = photo_import_source_get_associated (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, TYPE_PHOTO_IMPORT_SOURCE, PhotoImportSource));
				_tmp43_ = _tmp42_;
				_tmp44_ = import_page_camera_import_job_new (_tmp40_, G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, TYPE_IMPORT_SOURCE, ImportSource), NULL);
				_tmp45_ = _tmp44_;
				batch_import_job_set_associated (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, TYPE_BATCH_IMPORT_JOB, BatchImportJob), G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, TYPE_BATCH_IMPORT_JOB, BatchImportJob));
				_batch_import_job_unref0 (_tmp45_);
				_g_object_unref0 (_tmp43_);
			}
			_tmp46_ = jobs;
			_tmp47_ = import_job;
			gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, GEE_TYPE_COLLECTION, GeeCollection), _tmp47_);
			_batch_import_job_unref0 (import_job);
			_g_object_unref0 (import_file);
			_g_object_unref0 (preview);
			_g_object_unref0 (object);
		}
		_g_object_unref0 (_object_it);
	}
	_tmp48_ = jobs;
	_tmp49_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp50_ = _tmp49_;
	_tmp51_ = self->priv->dcamera;
	_tmp52_ = _tmp51_->display_name;
	g_debug ("ImportPage.vala:1692: Importing %d files from %s", _tmp50_, _tmp52_);
	_tmp53_ = jobs;
	_tmp54_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp55_ = _tmp54_;
	if (_tmp55_ > 0) {
		ImportPage* _tmp56_;
		ImportPage* _tmp57_;
		BatchImport* batch_import = NULL;
		SortedList* _tmp58_;
		DiscoveredCamera* _tmp59_;
		const gchar* _tmp60_;
		GeeArrayList* _tmp61_;
		BatchImport* _tmp62_;
		BatchImport* _tmp63_;
		BatchImport* _tmp64_;
		LibraryWindow* _tmp65_;
		LibraryWindow* _tmp66_;
		BatchImport* _tmp67_;
		LibraryWindow* _tmp68_;
		LibraryWindow* _tmp69_;
		_tmp56_ = self->priv->local_ref;
		_vala_assert (_tmp56_ == NULL, "local_ref == null");
		_tmp57_ = _g_object_ref0 (self);
		_g_object_unref0 (self->priv->local_ref);
		self->priv->local_ref = _tmp57_;
		_tmp58_ = jobs;
		_tmp59_ = self->priv->dcamera;
		_tmp60_ = _tmp59_->display_name;
		_tmp61_ = already_imported;
		_tmp62_ = batch_import_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, GEE_TYPE_ITERABLE, GeeIterable), _tmp60_, _import_page_import_reporter_batch_import_import_reporter, self, NULL, _tmp61_, NULL, NULL, NULL);
		batch_import = _tmp62_;
		_tmp63_ = batch_import;
		g_signal_connect_object (_tmp63_, "import-job-failed", (GCallback) _import_page_on_import_job_failed_batch_import_import_job_failed, self, 0);
		_tmp64_ = batch_import;
		g_signal_connect_object (_tmp64_, "import-complete", (GCallback) _import_page_close_import_batch_import_import_complete, self, 0);
		_tmp65_ = library_window_get_app ();
		_tmp66_ = _tmp65_;
		_tmp67_ = batch_import;
		library_window_enqueue_batch_import (_tmp66_, _tmp67_, TRUE);
		_g_object_unref0 (_tmp66_);
		_tmp68_ = library_window_get_app ();
		_tmp69_ = _tmp68_;
		library_window_switch_to_import_queue_page (_tmp69_);
		_g_object_unref0 (_tmp69_);
		_g_object_unref0 (batch_import);
	} else {
		GeeArrayList* _tmp70_;
		gint _tmp71_;
		gint _tmp72_;
		_tmp70_ = already_imported;
		_tmp71_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp70_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
		_tmp72_ = _tmp71_;
		if (_tmp72_ > 0) {
			GeeArrayList* _tmp73_;
			ImportManifest* _tmp74_;
			ImportManifest* _tmp75_;
			_tmp73_ = already_imported;
			_tmp74_ = import_manifest_new (NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp73_, GEE_TYPE_LIST, GeeList));
			_tmp75_ = _tmp74_;
			import_page_import_reporter (self, _tmp75_);
			_import_manifest_unref0 (_tmp75_);
		}
		import_page_close_import (self);
	}
	_g_object_unref0 (already_imported);
	_g_object_unref0 (jobs);
}

static void
import_page_on_import_job_failed (ImportPage* self,
                                  BatchImportResult* _result_)
{
	gboolean _tmp0_ = FALSE;
	GFile* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	g_return_if_fail (IS_BATCH_IMPORT_RESULT (_result_));
	_tmp1_ = _result_->file;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = _result_->result == IMPORT_RESULT_SUCCESS;
	}
	if (_tmp0_) {
		return;
	}
	{
		GFile* _tmp2_;
		_tmp2_ = _result_->file;
		g_file_delete (_tmp2_, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GFile* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		GError* _tmp6_;
		const gchar* _tmp7_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = _result_->file;
		_tmp4_ = g_file_get_path (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = err;
		_tmp7_ = _tmp6_->message;
		g_message ("ImportPage.vala:1724: Unable to delete downloaded file %s: %s", _tmp5_, _tmp7_);
		_g_free0 (_tmp5_);
		_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;
	}
}

static gpointer
_batch_import_job_ref0 (gpointer self)
{
	return self ? batch_import_job_ref (self) : NULL;
}

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 void
import_page_import_reporter (ImportPage* self,
                             ImportManifest* manifest)
{
	ImportPage* local_ref = NULL;
	ImportPage* _tmp0_;
	ImportPage* _tmp1_;
	GeeList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	Marker* marker = NULL;
	SourceCollection* _tmp42_;
	Marker* _tmp43_;
	ProgressDialog* progress = NULL;
	AppWindow* _tmp59_;
	AppWindow* _tmp60_;
	GCancellable* _tmp61_;
	GCancellable* _tmp62_;
	ProgressDialog* _tmp63_;
	ProgressDialog* _tmp64_;
	gint error_count = 0;
	SourceCollection* _tmp65_;
	Marker* _tmp66_;
	ProgressDialog* _tmp67_;
	ProgressDialog* _tmp70_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	g_return_if_fail (IS_IMPORT_MANIFEST (manifest));
	_tmp0_ = self->priv->local_ref;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	local_ref = _tmp1_;
	_g_object_unref0 (self->priv->local_ref);
	self->priv->local_ref = NULL;
	_tmp2_ = manifest->success;
	_tmp3_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp4_ = _tmp3_;
	if (_tmp4_ > 0) {
		gchar* photos_string = NULL;
		GeeList* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		GeeList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gchar* _tmp11_;
		gchar* videos_string = NULL;
		GeeList* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		GeeList* _tmp15_;
		gint _tmp16_;
		gint _tmp17_;
		gchar* _tmp18_;
		gchar* both_string = NULL;
		GeeList* _tmp19_;
		gint _tmp20_;
		gint _tmp21_;
		GeeList* _tmp22_;
		gint _tmp23_;
		gint _tmp24_;
		gchar* _tmp25_;
		gchar* neither_string = NULL;
		GeeList* _tmp26_;
		gint _tmp27_;
		gint _tmp28_;
		GeeList* _tmp29_;
		gint _tmp30_;
		gint _tmp31_;
		gchar* _tmp32_;
		gchar* question_string = NULL;
		GeeList* _tmp33_;
		const gchar* _tmp34_;
		const gchar* _tmp35_;
		const gchar* _tmp36_;
		const gchar* _tmp37_;
		gchar* _tmp38_;
		ImportUIQuestionParams* question = NULL;
		const gchar* _tmp39_;
		ImportUIQuestionParams* _tmp40_;
		ImportUIQuestionParams* _tmp41_;
		_tmp5_ = manifest->success;
		_tmp6_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp7_ = _tmp6_;
		_tmp8_ = manifest->success;
		_tmp9_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp10_ = _tmp9_;
		_tmp11_ = g_strdup_printf (ngettext ("Delete this photo from camera?", "Delete these %d photos from camera?", (gulong) _tmp7_), _tmp10_);
		photos_string = _tmp11_;
		_tmp12_ = manifest->success;
		_tmp13_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp14_ = _tmp13_;
		_tmp15_ = manifest->success;
		_tmp16_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp17_ = _tmp16_;
		_tmp18_ = g_strdup_printf (ngettext ("Delete this video from camera?", "Delete these %d videos from camera?", (gulong) _tmp14_), _tmp17_);
		videos_string = _tmp18_;
		_tmp19_ = manifest->success;
		_tmp20_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp21_ = _tmp20_;
		_tmp22_ = manifest->success;
		_tmp23_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp24_ = _tmp23_;
		_tmp25_ = g_strdup_printf (ngettext ("Delete this photo/video from camera?", "Delete these %d photos/videos from camera?", (gulong) _tmp21_), _tmp24_);
		both_string = _tmp25_;
		_tmp26_ = manifest->success;
		_tmp27_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp28_ = _tmp27_;
		_tmp29_ = manifest->success;
		_tmp30_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp29_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp31_ = _tmp30_;
		_tmp32_ = g_strdup_printf (ngettext ("Delete these files from camera?", "Delete these %d files from camera?", (gulong) _tmp28_), _tmp31_);
		neither_string = _tmp32_;
		_tmp33_ = manifest->success;
		_tmp34_ = photos_string;
		_tmp35_ = videos_string;
		_tmp36_ = both_string;
		_tmp37_ = neither_string;
		_tmp38_ = import_ui_get_media_specific_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, GEE_TYPE_COLLECTION, GeeCollection), _tmp34_, _tmp35_, _tmp36_, _tmp37_);
		question_string = _tmp38_;
		_tmp39_ = question_string;
		_tmp40_ = import_ui_question_params_new (_tmp39_, RESOURCES_DELETE_LABEL, _ ("_Keep"));
		question = _tmp40_;
		_tmp41_ = question;
		if (!import_ui_report_manifest (manifest, FALSE, _tmp41_)) {
			_import_ui_question_params_unref0 (question);
			_g_free0 (question_string);
			_g_free0 (neither_string);
			_g_free0 (both_string);
			_g_free0 (videos_string);
			_g_free0 (photos_string);
			_g_object_unref0 (local_ref);
			return;
		}
		_import_ui_question_params_unref0 (question);
		_g_free0 (question_string);
		_g_free0 (neither_string);
		_g_free0 (both_string);
		_g_free0 (videos_string);
		_g_free0 (photos_string);
	} else {
		import_ui_report_manifest (manifest, FALSE, NULL);
		_g_object_unref0 (local_ref);
		return;
	}
	_tmp42_ = self->priv->import_sources;
	_tmp43_ = data_collection_start_marking (G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, TYPE_DATA_COLLECTION, DataCollection));
	marker = _tmp43_;
	{
		GeeList* _batch_result_list = NULL;
		GeeList* _tmp44_;
		gint _batch_result_size = 0;
		GeeList* _tmp45_;
		gint _tmp46_;
		gint _tmp47_;
		gint _batch_result_index = 0;
		_tmp44_ = manifest->success;
		_batch_result_list = _tmp44_;
		_tmp45_ = _batch_result_list;
		_tmp46_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp47_ = _tmp46_;
		_batch_result_size = _tmp47_;
		_batch_result_index = -1;
		while (TRUE) {
			gint _tmp48_;
			gint _tmp49_;
			BatchImportResult* batch_result = NULL;
			GeeList* _tmp50_;
			gpointer _tmp51_;
			ImportPageCameraImportJob* job = NULL;
			BatchImportResult* _tmp52_;
			BatchImportJob* _tmp53_;
			ImportPageCameraImportJob* _tmp54_;
			Marker* _tmp55_;
			ImportPageCameraImportJob* _tmp56_;
			ImportSource* _tmp57_;
			ImportSource* _tmp58_;
			_batch_result_index = _batch_result_index + 1;
			_tmp48_ = _batch_result_index;
			_tmp49_ = _batch_result_size;
			if (!(_tmp48_ < _tmp49_)) {
				break;
			}
			_tmp50_ = _batch_result_list;
			_tmp51_ = gee_list_get (_tmp50_, _batch_result_index);
			batch_result = (BatchImportResult*) _tmp51_;
			_tmp52_ = batch_result;
			_tmp53_ = _tmp52_->job;
			_tmp54_ = _batch_import_job_ref0 (IMPORT_PAGE_IS_CAMERA_IMPORT_JOB (_tmp53_) ? ((ImportPageCameraImportJob*) _tmp53_) : NULL);
			job = _tmp54_;
			_tmp55_ = marker;
			_tmp56_ = job;
			_tmp57_ = import_page_camera_import_job_get_source (_tmp56_);
			_tmp58_ = _tmp57_;
			marker_mark (_tmp55_, G_TYPE_CHECK_INSTANCE_CAST (_tmp58_, TYPE_DATA_OBJECT, DataObject));
			_g_object_unref0 (_tmp58_);
			_batch_import_job_unref0 (job);
			_batch_import_result_unref0 (batch_result);
		}
	}
	_tmp59_ = app_window_get_instance ();
	_tmp60_ = _tmp59_;
	_tmp61_ = g_cancellable_new ();
	_tmp62_ = _tmp61_;
	_tmp63_ = progress_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp60_, gtk_window_get_type (), GtkWindow), _ ("Removing photos/videos from camera"), _tmp62_);
	g_object_ref_sink (_tmp63_);
	_tmp64_ = _tmp63_;
	_g_object_unref0 (_tmp62_);
	_g_object_unref0 (_tmp60_);
	progress = _tmp64_;
	_tmp65_ = self->priv->import_sources;
	_tmp66_ = marker;
	_tmp67_ = progress;
	error_count = source_collection_destroy_marked (_tmp65_, _tmp66_, TRUE, _progress_dialog_monitor_progress_monitor, _tmp67_, NULL);
	if (error_count > 0) {
		gchar* error_string = NULL;
		gchar* _tmp68_;
		const gchar* _tmp69_;
		_tmp68_ = g_strdup_printf (ngettext ("Unable to delete %d photo/video from the camera due to errors.", "Unable to delete %d photos/videos from the camera due to errors.", (gulong) error_count), error_count);
		error_string = _tmp68_;
		_tmp69_ = error_string;
		app_window_error_message (_tmp69_, NULL);
		_g_free0 (error_string);
	}
	_tmp70_ = progress;
	progress_dialog_close (_tmp70_);
	_g_object_unref0 (local_ref);
	local_ref = NULL;
	_g_object_unref0 (progress);
	_g_object_unref0 (marker);
	_g_object_unref0 (local_ref);
}

static void
import_page_close_import (ImportPage* self)
{
	int res = 0;
	DiscoveredCamera* _tmp0_;
	Camera* _tmp1_;
	GPSpinIdleWrapper* _tmp2_;
	GPContext* _tmp3_;
	g_return_if_fail (IS_IMPORT_PAGE (self));
	_tmp0_ = self->priv->dcamera;
	_tmp1_ = _tmp0_->gcamera;
	_tmp2_ = import_page_spin_idle_context;
	_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GP_TYPE_CONTEXT_WRAPPER, GPContextWrapper)->context;
	res = gp_camera_exit (_tmp1_, _tmp3_);
	if (res != GP_OK) {
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = gp_result_to_full_string (res);
		_tmp5_ = _tmp4_;
		g_message ("ImportPage.vala:1794: Unable to unlock camera: %s", _tmp5_);
		_g_free0 (_tmp5_);
	}
	import_page_update_status (self, FALSE, self->priv->refreshed);
	import_page_on_view_changed (self);
}

static void
import_page_real_set_display_titles (CheckerboardPage* base,
                                     gboolean display)
{
	ImportPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	CHECKERBOARD_PAGE_CLASS (import_page_parent_class)->set_display_titles (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), display);
	page_set_action_active (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewTitle", display);
}

static gpointer
_view_filter_ref0 (gpointer self)
{
	return self ? view_filter_ref (self) : NULL;
}

static SearchViewFilter*
import_page_real_get_search_view_filter (CheckerboardPage* base)
{
	ImportPage * self;
	ImportPageImportPageSearchViewFilter* _tmp0_;
	SearchViewFilter* _tmp1_;
	SearchViewFilter* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_IMPORT_PAGE, ImportPage);
	_tmp0_ = self->priv->search_filter;
	_tmp1_ = _view_filter_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter));
	result = _tmp1_;
	return result;
}

static inline gpointer
import_page_import_view_manager_get_instance_private (ImportPageImportViewManager* self)
{
	return G_STRUCT_MEMBER_P (self, ImportPageImportViewManager_private_offset);
}

static ImportPageImportViewManager*
import_page_import_view_manager_construct (GType object_type,
                                           ImportPage* owner)
{
	ImportPageImportViewManager* self = NULL;
	ImportPage* _tmp0_;
	g_return_val_if_fail (IS_IMPORT_PAGE (owner), NULL);
	self = (ImportPageImportViewManager*) view_manager_construct (object_type);
	_tmp0_ = _g_object_ref0 (owner);
	_g_object_unref0 (self->priv->owner);
	self->priv->owner = _tmp0_;
	return self;
}

static ImportPageImportViewManager*
import_page_import_view_manager_new (ImportPage* owner)
{
	return import_page_import_view_manager_construct (IMPORT_PAGE_TYPE_IMPORT_VIEW_MANAGER, owner);
}

static DataView*
import_page_import_view_manager_real_create_view (ViewManager* base,
                                                  DataSource* source)
{
	ImportPageImportViewManager * self;
	ImportPreview* _tmp0_;
	DataView* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_IMPORT_VIEW_MANAGER, ImportPageImportViewManager);
	g_return_val_if_fail (IS_DATA_SOURCE (source), NULL);
	_tmp0_ = import_preview_new (G_TYPE_CHECK_INSTANCE_CAST (source, TYPE_IMPORT_SOURCE, ImportSource));
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DATA_VIEW, DataView);
	return result;
}

static void
import_page_import_view_manager_class_init (ImportPageImportViewManagerClass * klass,
                                            gpointer klass_data)
{
	import_page_import_view_manager_parent_class = g_type_class_peek_parent (klass);
	((ViewManagerClass *) klass)->finalize = import_page_import_view_manager_finalize;
	g_type_class_adjust_private_offset (klass, &ImportPageImportViewManager_private_offset);
	((ViewManagerClass *) klass)->create_view = (DataView* (*) (ViewManager*, DataSource*)) import_page_import_view_manager_real_create_view;
}

static void
import_page_import_view_manager_instance_init (ImportPageImportViewManager * self,
                                               gpointer klass)
{
	self->priv = import_page_import_view_manager_get_instance_private (self);
}

static void
import_page_import_view_manager_finalize (ViewManager * obj)
{
	ImportPageImportViewManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, IMPORT_PAGE_TYPE_IMPORT_VIEW_MANAGER, ImportPageImportViewManager);
	_g_object_unref0 (self->priv->owner);
	VIEW_MANAGER_CLASS (import_page_import_view_manager_parent_class)->finalize (obj);
}

static GType
import_page_import_view_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ImportPageImportViewManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) import_page_import_view_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ImportPageImportViewManager), 0, (GInstanceInitFunc) import_page_import_view_manager_instance_init, NULL };
	GType import_page_import_view_manager_type_id;
	import_page_import_view_manager_type_id = g_type_register_static (TYPE_VIEW_MANAGER, "ImportPageImportViewManager", &g_define_type_info, 0);
	ImportPageImportViewManager_private_offset = g_type_add_instance_private (import_page_import_view_manager_type_id, sizeof (ImportPageImportViewManagerPrivate));
	return import_page_import_view_manager_type_id;
}

static GType
import_page_import_view_manager_get_type (void)
{
	static volatile gsize import_page_import_view_manager_type_id__once = 0;
	if (g_once_init_enter (&import_page_import_view_manager_type_id__once)) {
		GType import_page_import_view_manager_type_id;
		import_page_import_view_manager_type_id = import_page_import_view_manager_get_type_once ();
		g_once_init_leave (&import_page_import_view_manager_type_id__once, import_page_import_view_manager_type_id);
	}
	return import_page_import_view_manager_type_id__once;
}

static inline gpointer
import_page_camera_import_job_get_instance_private (ImportPageCameraImportJob* self)
{
	return G_STRUCT_MEMBER_P (self, ImportPageCameraImportJob_private_offset);
}

static gpointer
_gp_context_wrapper_ref0 (gpointer self)
{
	return self ? gp_context_wrapper_ref (self) : NULL;
}

static ImportPageCameraImportJob*
import_page_camera_import_job_construct (GType object_type,
                                         GPContextWrapper* context,
                                         ImportSource* import_file,
                                         DuplicatedFile* duplicated_file)
{
	ImportPageCameraImportJob* self = NULL;
	GPContextWrapper* _tmp0_;
	ImportSource* _tmp1_;
	DuplicatedFile* _tmp2_;
	Camera* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	PhotoImportSource* photo_import_source = NULL;
	PhotoImportSource* _tmp7_;
	PhotoMetadata* _tmp8_ = NULL;
	PhotoImportSource* _tmp9_;
	PhotoMetadata* _tmp12_;
	GDateTime* _tmp13_;
	g_return_val_if_fail (GP_IS_CONTEXT_WRAPPER (context), NULL);
	g_return_val_if_fail (IS_IMPORT_SOURCE (import_file), NULL);
	g_return_val_if_fail ((duplicated_file == NULL) || IS_DUPLICATED_FILE (duplicated_file), NULL);
	self = (ImportPageCameraImportJob*) batch_import_job_construct (object_type);
	_tmp0_ = _gp_context_wrapper_ref0 (context);
	_gp_context_wrapper_unref0 (self->priv->context);
	self->priv->context = _tmp0_;
	_tmp1_ = _g_object_ref0 (import_file);
	_g_object_unref0 (self->priv->import_file);
	self->priv->import_file = _tmp1_;
	_tmp2_ = _g_object_ref0 (duplicated_file);
	_g_object_unref0 (self->priv->duplicated_file);
	self->priv->duplicated_file = _tmp2_;
	_tmp3_ = import_source_get_camera (import_file);
	_gp_camera_unref0 (self->priv->camera);
	self->priv->camera = _tmp3_;
	_tmp4_ = import_source_get_fulldir (import_file);
	_g_free0 (self->priv->fulldir);
	self->priv->fulldir = _tmp4_;
	_tmp5_ = self->priv->fulldir;
	_vala_assert (_tmp5_ != NULL, "fulldir != null");
	_tmp6_ = import_source_get_filename (import_file);
	_g_free0 (self->priv->filename);
	self->priv->filename = _tmp6_;
	self->priv->filesize = (guint64) import_source_get_filesize (import_file);
	_tmp7_ = _g_object_ref0 (IS_PHOTO_IMPORT_SOURCE (import_file) ? ((PhotoImportSource*) import_file) : NULL);
	photo_import_source = _tmp7_;
	_tmp9_ = photo_import_source;
	if (_tmp9_ != NULL) {
		PhotoImportSource* _tmp10_;
		PhotoMetadata* _tmp11_;
		_tmp10_ = photo_import_source;
		_tmp11_ = photo_import_source_get_metadata (_tmp10_);
		_media_metadata_unref0 (_tmp8_);
		_tmp8_ = _tmp11_;
	} else {
		_media_metadata_unref0 (_tmp8_);
		_tmp8_ = NULL;
	}
	_tmp12_ = _tmp8_;
	_tmp8_ = NULL;
	_media_metadata_unref0 (self->priv->metadata);
	self->priv->metadata = _tmp12_;
	_tmp13_ = import_source_get_exposure_time (import_file);
	_g_date_time_unref0 (self->priv->exposure_time);
	self->priv->exposure_time = _tmp13_;
	_media_metadata_unref0 (_tmp8_);
	_g_object_unref0 (photo_import_source);
	return self;
}

static ImportPageCameraImportJob*
import_page_camera_import_job_new (GPContextWrapper* context,
                                   ImportSource* import_file,
                                   DuplicatedFile* duplicated_file)
{
	return import_page_camera_import_job_construct (IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, context, import_file, duplicated_file);
}

static GDateTime*
import_page_camera_import_job_get_exposure_time (ImportPageCameraImportJob* self)
{
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* result;
	g_return_val_if_fail (IMPORT_PAGE_IS_CAMERA_IMPORT_JOB (self), NULL);
	_tmp0_ = self->priv->exposure_time;
	_tmp1_ = _g_date_time_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static DuplicatedFile*
import_page_camera_import_job_real_get_duplicated_file (BatchImportJob* base)
{
	ImportPageCameraImportJob * self;
	DuplicatedFile* _tmp0_;
	DuplicatedFile* _tmp1_;
	DuplicatedFile* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_tmp0_ = self->priv->duplicated_file;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static GDateTime*
import_page_camera_import_job_real_get_exposure_time_override (BatchImportJob* base)
{
	ImportPageCameraImportJob * self;
	GDateTime* _tmp0_ = NULL;
	ImportSource* _tmp1_;
	GDateTime* _tmp3_;
	GDateTime* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_tmp1_ = self->priv->import_file;
	if (IS_VIDEO_IMPORT_SOURCE (_tmp1_)) {
		GDateTime* _tmp2_;
		_tmp2_ = import_page_camera_import_job_get_exposure_time (self);
		_g_date_time_unref0 (_tmp0_);
		_tmp0_ = _tmp2_;
	} else {
		_g_date_time_unref0 (_tmp0_);
		_tmp0_ = NULL;
	}
	_tmp3_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp3_;
	_g_date_time_unref0 (_tmp0_);
	return result;
}

static gchar*
import_page_camera_import_job_real_get_dest_identifier (BatchImportJob* base)
{
	ImportPageCameraImportJob * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_tmp0_ = self->priv->filename;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
import_page_camera_import_job_real_get_source_identifier (BatchImportJob* base)
{
	ImportPageCameraImportJob * self;
	ImportSource* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_tmp0_ = self->priv->import_file;
	_tmp1_ = import_source_get_filename (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
import_page_camera_import_job_real_get_basename (BatchImportJob* base)
{
	ImportPageCameraImportJob * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_tmp0_ = self->priv->filename;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static gchar*
import_page_camera_import_job_real_get_path (BatchImportJob* base)
{
	ImportPageCameraImportJob * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_tmp0_ = self->priv->fulldir;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
import_page_camera_import_job_real_set_associated (BatchImportJob* base,
                                                   BatchImportJob* associated)
{
	ImportPageCameraImportJob * self;
	ImportPageCameraImportJob* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	g_return_if_fail (IS_BATCH_IMPORT_JOB (associated));
	_tmp0_ = _batch_import_job_ref0 (IMPORT_PAGE_IS_CAMERA_IMPORT_JOB (associated) ? ((ImportPageCameraImportJob*) associated) : NULL);
	_batch_import_job_unref0 (self->priv->associated);
	self->priv->associated = _tmp0_;
}

static ImportSource*
import_page_camera_import_job_get_source (ImportPageCameraImportJob* self)
{
	ImportSource* _tmp0_;
	ImportSource* _tmp1_;
	ImportSource* result;
	g_return_val_if_fail (IMPORT_PAGE_IS_CAMERA_IMPORT_JOB (self), NULL);
	_tmp0_ = self->priv->import_file;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static gboolean
import_page_camera_import_job_real_is_directory (BatchImportJob* base)
{
	ImportPageCameraImportJob * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	result = FALSE;
	return result;
}

static gboolean
import_page_camera_import_job_real_determine_file_size (BatchImportJob* base,
                                                        guint64* filesize,
                                                        GFile** file)
{
	ImportPageCameraImportJob * self;
	guint64 _vala_filesize = 0ULL;
	GFile* _vala_file = NULL;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_g_object_unref0 (_vala_file);
	_vala_file = NULL;
	_vala_filesize = self->priv->filesize;
	result = TRUE;
	if (filesize) {
		*filesize = _vala_filesize;
	}
	if (file) {
		*file = _vala_file;
	} else {
		_g_object_unref0 (_vala_file);
	}
	return result;
}

static gboolean
import_page_camera_import_job_real_prepare (BatchImportJob* base,
                                            GFile** file_to_import,
                                            gboolean* copy_to_library,
                                            GError** error)
{
	ImportPageCameraImportJob * self;
	GFile* _vala_file_to_import = NULL;
	gboolean _vala_copy_to_library = FALSE;
	GFile* dest_file = NULL;
	GFile* _tmp13_;
	GFile* _tmp17_;
	ImportPageCameraImportJob* _tmp26_;
	GFile* _tmp59_;
	GFile* _tmp60_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_g_object_unref0 (_vala_file_to_import);
	_vala_file_to_import = NULL;
	_vala_copy_to_library = FALSE;
	dest_file = NULL;
	{
		gboolean collision = FALSE;
		GFile* _tmp0_ = NULL;
		const gchar* _tmp1_;
		PhotoMetadata* _tmp2_;
		GDateTime* _tmp3_;
		gboolean _tmp4_ = FALSE;
		GFile* _tmp5_;
		GFile* _tmp6_;
		_tmp1_ = self->priv->filename;
		_tmp2_ = self->priv->metadata;
		_tmp3_ = self->priv->exposure_time;
		_tmp5_ = library_files_generate_unique_file (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_MEDIA_METADATA, MediaMetadata), _tmp3_, &_tmp4_, &_inner_error0_);
		collision = _tmp4_;
		_tmp0_ = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp6_ = _tmp0_;
		_tmp0_ = NULL;
		_g_object_unref0 (dest_file);
		dest_file = _tmp6_;
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		ImportSource* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		GError* _tmp10_;
		const gchar* _tmp11_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = self->priv->import_file;
		_tmp8_ = import_source_get_filename (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = err;
		_tmp11_ = _tmp10_->message;
		g_warning ("ImportPage.vala:569: Unable to generate local file for %s: %s", _tmp9_, _tmp11_);
		_g_free0 (_tmp9_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp12_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (dest_file);
		_g_object_unref0 (_vala_file_to_import);
		return _tmp12_;
	}
	_tmp13_ = dest_file;
	if (_tmp13_ == NULL) {
		ImportSource* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		_tmp14_ = self->priv->import_file;
		_tmp15_ = import_source_get_filename (_tmp14_);
		_tmp16_ = _tmp15_;
		g_message ("ImportPage.vala:574: Unable to generate local file for %s", _tmp16_);
		_g_free0 (_tmp16_);
		result = FALSE;
		_g_object_unref0 (dest_file);
		if (file_to_import) {
			*file_to_import = _vala_file_to_import;
		} else {
			_g_object_unref0 (_vala_file_to_import);
		}
		if (copy_to_library) {
			*copy_to_library = _vala_copy_to_library;
		}
		return result;
	}
	_tmp17_ = dest_file;
	library_monitor_blacklist_file (_tmp17_, "CameraImportJob.prepare");
	{
		GPContextWrapper* _tmp18_;
		GPContext* _tmp19_;
		Camera* _tmp20_;
		const gchar* _tmp21_;
		const gchar* _tmp22_;
		GFile* _tmp23_;
		_tmp18_ = self->priv->context;
		_tmp19_ = _tmp18_->context;
		_tmp20_ = self->priv->camera;
		_tmp21_ = self->priv->fulldir;
		_tmp22_ = self->priv->filename;
		_tmp23_ = dest_file;
		gp_save_image (_tmp19_, _tmp20_, _tmp21_, _tmp22_, _tmp23_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __finally1;
		}
	}
	__finally1:
	{
		GError* _inner_error1_ = NULL;
		GFile* _tmp24_;
		_tmp24_ = dest_file;
		library_monitor_unblacklist_file (_tmp24_);
	}
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp25_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (dest_file);
		_g_object_unref0 (_vala_file_to_import);
		return _tmp25_;
	}
	_tmp26_ = self->priv->associated;
	if (_tmp26_ != NULL) {
		BackingPhotoRow* _tmp42_;
		GFile* assoc_dest = NULL;
		BackingPhotoRow* _tmp45_;
		const gchar* _tmp46_;
		GFile* _tmp47_;
		GFile* _tmp48_;
		{
			BackingPhotoRow* _tmp27_ = NULL;
			GFile* _tmp28_;
			gchar* _tmp29_;
			gchar* _tmp30_;
			ImportPageCameraImportJob* _tmp31_;
			gchar* _tmp32_;
			gchar* _tmp33_;
			BackingPhotoRow* _tmp34_;
			BackingPhotoRow* _tmp35_;
			BackingPhotoRow* _tmp36_;
			_tmp28_ = dest_file;
			_tmp29_ = g_file_get_path (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = self->priv->associated;
			_tmp32_ = batch_import_job_get_basename (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, TYPE_BATCH_IMPORT_JOB, BatchImportJob));
			_tmp33_ = _tmp32_;
			_tmp34_ = raw_developer_create_backing_row_for_development (RAW_DEVELOPER_CAMERA, _tmp30_, _tmp33_, &_inner_error0_);
			_tmp35_ = _tmp34_;
			_g_free0 (_tmp33_);
			_g_free0 (_tmp30_);
			_tmp27_ = _tmp35_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch2_g_error;
			}
			_tmp36_ = _tmp27_;
			_tmp27_ = NULL;
			_backing_photo_row_unref0 (self->priv->associated_file);
			self->priv->associated_file = _tmp36_;
			_backing_photo_row_unref0 (_tmp27_);
		}
		goto __finally2;
		__catch2_g_error:
		{
			GError* err = NULL;
			ImportPageCameraImportJob* _tmp37_;
			const gchar* _tmp38_;
			GError* _tmp39_;
			const gchar* _tmp40_;
			err = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp37_ = self->priv->associated;
			_tmp38_ = _tmp37_->priv->filename;
			_tmp39_ = err;
			_tmp40_ = _tmp39_->message;
			g_warning ("ImportPage.vala:595: Unable to generate backing associated file for %s" \
": %s", _tmp38_, _tmp40_);
			_g_error_free0 (err);
		}
		__finally2:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp41_ = FALSE;
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (dest_file);
			_g_object_unref0 (_vala_file_to_import);
			return _tmp41_;
		}
		_tmp42_ = self->priv->associated_file;
		if (_tmp42_ == NULL) {
			ImportPageCameraImportJob* _tmp43_;
			const gchar* _tmp44_;
			_tmp43_ = self->priv->associated;
			_tmp44_ = _tmp43_->priv->filename;
			g_message ("ImportPage.vala:600: Unable to generate backing associated file for %s", _tmp44_);
			result = FALSE;
			_g_object_unref0 (dest_file);
			if (file_to_import) {
				*file_to_import = _vala_file_to_import;
			} else {
				_g_object_unref0 (_vala_file_to_import);
			}
			if (copy_to_library) {
				*copy_to_library = _vala_copy_to_library;
			}
			return result;
		}
		_tmp45_ = self->priv->associated_file;
		_tmp46_ = _tmp45_->filepath;
		_tmp47_ = g_file_new_for_path (_tmp46_);
		assoc_dest = _tmp47_;
		_tmp48_ = assoc_dest;
		library_monitor_blacklist_file (_tmp48_, "CameraImportJob.prepare");
		{
			GPContextWrapper* _tmp49_;
			GPContext* _tmp50_;
			Camera* _tmp51_;
			ImportPageCameraImportJob* _tmp52_;
			const gchar* _tmp53_;
			ImportPageCameraImportJob* _tmp54_;
			const gchar* _tmp55_;
			GFile* _tmp56_;
			_tmp49_ = self->priv->context;
			_tmp50_ = _tmp49_->context;
			_tmp51_ = self->priv->camera;
			_tmp52_ = self->priv->associated;
			_tmp53_ = _tmp52_->priv->fulldir;
			_tmp54_ = self->priv->associated;
			_tmp55_ = _tmp54_->priv->filename;
			_tmp56_ = assoc_dest;
			gp_save_image (_tmp50_, _tmp51_, _tmp53_, _tmp55_, _tmp56_, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __finally3;
			}
		}
		__finally3:
		{
			GError* _inner_error1_ = NULL;
			GFile* _tmp57_;
			_tmp57_ = assoc_dest;
			library_monitor_unblacklist_file (_tmp57_);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp58_ = FALSE;
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (assoc_dest);
			_g_object_unref0 (dest_file);
			_g_object_unref0 (_vala_file_to_import);
			return _tmp58_;
		}
		_g_object_unref0 (assoc_dest);
	}
	_tmp59_ = dest_file;
	_tmp60_ = _g_object_ref0 (_tmp59_);
	_g_object_unref0 (_vala_file_to_import);
	_vala_file_to_import = _tmp60_;
	_vala_copy_to_library = FALSE;
	result = TRUE;
	_g_object_unref0 (dest_file);
	if (file_to_import) {
		*file_to_import = _vala_file_to_import;
	} else {
		_g_object_unref0 (_vala_file_to_import);
	}
	if (copy_to_library) {
		*copy_to_library = _vala_copy_to_library;
	}
	return result;
}

static GFile*
import_page_camera_import_job_real_get_associated_file (BatchImportJob* base)
{
	ImportPageCameraImportJob * self;
	BackingPhotoRow* _tmp0_;
	BackingPhotoRow* _tmp1_;
	const gchar* _tmp2_;
	GFile* _tmp3_;
	GFile* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_tmp0_ = self->priv->associated_file;
	if (_tmp0_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = self->priv->associated_file;
	_tmp2_ = _tmp1_->filepath;
	_tmp3_ = g_file_new_for_path (_tmp2_);
	result = _tmp3_;
	return result;
}

static void
import_page_camera_import_job_class_init (ImportPageCameraImportJobClass * klass,
                                          gpointer klass_data)
{
	import_page_camera_import_job_parent_class = g_type_class_peek_parent (klass);
	((BatchImportJobClass *) klass)->finalize = import_page_camera_import_job_finalize;
	g_type_class_adjust_private_offset (klass, &ImportPageCameraImportJob_private_offset);
	((BatchImportJobClass *) klass)->get_duplicated_file = (DuplicatedFile* (*) (BatchImportJob*)) import_page_camera_import_job_real_get_duplicated_file;
	((BatchImportJobClass *) klass)->get_exposure_time_override = (GDateTime* (*) (BatchImportJob*)) import_page_camera_import_job_real_get_exposure_time_override;
	((BatchImportJobClass *) klass)->get_dest_identifier = (gchar* (*) (BatchImportJob*)) import_page_camera_import_job_real_get_dest_identifier;
	((BatchImportJobClass *) klass)->get_source_identifier = (gchar* (*) (BatchImportJob*)) import_page_camera_import_job_real_get_source_identifier;
	((BatchImportJobClass *) klass)->get_basename = (gchar* (*) (BatchImportJob*)) import_page_camera_import_job_real_get_basename;
	((BatchImportJobClass *) klass)->get_path = (gchar* (*) (BatchImportJob*)) import_page_camera_import_job_real_get_path;
	((BatchImportJobClass *) klass)->set_associated = (void (*) (BatchImportJob*, BatchImportJob*)) import_page_camera_import_job_real_set_associated;
	((BatchImportJobClass *) klass)->is_directory = (gboolean (*) (BatchImportJob*)) import_page_camera_import_job_real_is_directory;
	((BatchImportJobClass *) klass)->determine_file_size = (gboolean (*) (BatchImportJob*, guint64*, GFile**)) import_page_camera_import_job_real_determine_file_size;
	((BatchImportJobClass *) klass)->prepare = (gboolean (*) (BatchImportJob*, GFile**, gboolean*, GError**)) import_page_camera_import_job_real_prepare;
	((BatchImportJobClass *) klass)->get_associated_file = (GFile* (*) (BatchImportJob*)) import_page_camera_import_job_real_get_associated_file;
}

static void
import_page_camera_import_job_instance_init (ImportPageCameraImportJob * self,
                                             gpointer klass)
{
	self->priv = import_page_camera_import_job_get_instance_private (self);
	self->priv->associated = NULL;
	self->priv->associated_file = NULL;
}

static void
import_page_camera_import_job_finalize (BatchImportJob * obj)
{
	ImportPageCameraImportJob * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, IMPORT_PAGE_TYPE_CAMERA_IMPORT_JOB, ImportPageCameraImportJob);
	_gp_context_wrapper_unref0 (self->priv->context);
	_g_object_unref0 (self->priv->import_file);
	_gp_camera_unref0 (self->priv->camera);
	_g_free0 (self->priv->fulldir);
	_g_free0 (self->priv->filename);
	_media_metadata_unref0 (self->priv->metadata);
	_g_date_time_unref0 (self->priv->exposure_time);
	_batch_import_job_unref0 (self->priv->associated);
	_backing_photo_row_unref0 (self->priv->associated_file);
	_g_object_unref0 (self->priv->duplicated_file);
	BATCH_IMPORT_JOB_CLASS (import_page_camera_import_job_parent_class)->finalize (obj);
}

static GType
import_page_camera_import_job_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ImportPageCameraImportJobClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) import_page_camera_import_job_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ImportPageCameraImportJob), 0, (GInstanceInitFunc) import_page_camera_import_job_instance_init, NULL };
	GType import_page_camera_import_job_type_id;
	import_page_camera_import_job_type_id = g_type_register_static (TYPE_BATCH_IMPORT_JOB, "ImportPageCameraImportJob", &g_define_type_info, 0);
	ImportPageCameraImportJob_private_offset = g_type_add_instance_private (import_page_camera_import_job_type_id, sizeof (ImportPageCameraImportJobPrivate));
	return import_page_camera_import_job_type_id;
}

static GType
import_page_camera_import_job_get_type (void)
{
	static volatile gsize import_page_camera_import_job_type_id__once = 0;
	if (g_once_init_enter (&import_page_camera_import_job_type_id__once)) {
		GType import_page_camera_import_job_type_id;
		import_page_camera_import_job_type_id = import_page_camera_import_job_get_type_once ();
		g_once_init_leave (&import_page_camera_import_job_type_id__once, import_page_camera_import_job_type_id);
	}
	return import_page_camera_import_job_type_id__once;
}

static guint
import_page_import_page_search_view_filter_real_get_criteria (SearchViewFilter* base)
{
	ImportPageImportPageSearchViewFilter * self;
	guint result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_IMPORT_PAGE_SEARCH_VIEW_FILTER, ImportPageImportPageSearchViewFilter);
	result = (guint) (SEARCH_FILTER_CRITERIA_TEXT | SEARCH_FILTER_CRITERIA_MEDIA);
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
import_page_import_page_search_view_filter_real_predicate (ViewFilter* base,
                                                           DataView* view)
{
	ImportPageImportPageSearchViewFilter * self;
	ImportSource* source = NULL;
	ImportSource* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_IMPORT_PAGE_SEARCH_VIEW_FILTER, ImportPageImportPageSearchViewFilter);
	g_return_val_if_fail (IS_DATA_VIEW (view), FALSE);
	_tmp0_ = import_preview_get_import_source (G_TYPE_CHECK_INSTANCE_CAST (view, TYPE_IMPORT_PREVIEW, ImportPreview));
	source = _tmp0_;
	if ((gboolean) (SEARCH_FILTER_CRITERIA_MEDIA & search_view_filter_get_criteria (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter)))) {
		_tmp1_ = search_view_filter_filter_by_media_type (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter));
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		ImportSource* _tmp2_;
		_tmp2_ = source;
		if (IS_VIDEO_IMPORT_SOURCE (_tmp2_)) {
			gboolean _tmp3_;
			gboolean _tmp4_;
			_tmp3_ = search_view_filter_get_show_media_video (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter));
			_tmp4_ = _tmp3_;
			if (!_tmp4_) {
				result = FALSE;
				_g_object_unref0 (source);
				return result;
			}
		} else {
			ImportSource* _tmp5_;
			_tmp5_ = source;
			if (IS_PHOTO_IMPORT_SOURCE (_tmp5_)) {
				PhotoImportSource* photo = NULL;
				ImportSource* _tmp6_;
				PhotoImportSource* _tmp7_;
				PhotoImportSource* _tmp8_;
				_tmp6_ = source;
				_tmp7_ = _g_object_ref0 (IS_PHOTO_IMPORT_SOURCE (_tmp6_) ? ((PhotoImportSource*) _tmp6_) : NULL);
				photo = _tmp7_;
				_tmp8_ = photo;
				if (photo_import_source_get_file_format (_tmp8_) == PHOTO_FILE_FORMAT_RAW) {
					PhotoImportSource* _tmp9_;
					PhotoImportSource* _tmp10_;
					PhotoImportSource* _tmp11_;
					gboolean _tmp12_;
					_tmp9_ = photo;
					_tmp10_ = photo_import_source_get_associated (_tmp9_);
					_tmp11_ = _tmp10_;
					_tmp12_ = _tmp11_ != NULL;
					_g_object_unref0 (_tmp11_);
					if (_tmp12_) {
						gboolean _tmp13_ = FALSE;
						gboolean _tmp14_;
						gboolean _tmp15_;
						_tmp14_ = search_view_filter_get_show_media_photos (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter));
						_tmp15_ = _tmp14_;
						if (!_tmp15_) {
							gboolean _tmp16_;
							gboolean _tmp17_;
							_tmp16_ = search_view_filter_get_show_media_raw (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter));
							_tmp17_ = _tmp16_;
							_tmp13_ = !_tmp17_;
						} else {
							_tmp13_ = FALSE;
						}
						if (_tmp13_) {
							result = FALSE;
							_g_object_unref0 (photo);
							_g_object_unref0 (source);
							return result;
						}
					} else {
						gboolean _tmp18_;
						gboolean _tmp19_;
						_tmp18_ = search_view_filter_get_show_media_raw (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter));
						_tmp19_ = _tmp18_;
						if (!_tmp19_) {
							result = FALSE;
							_g_object_unref0 (photo);
							_g_object_unref0 (source);
							return result;
						}
					}
				} else {
					gboolean _tmp20_;
					gboolean _tmp21_;
					_tmp20_ = search_view_filter_get_show_media_photos (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter));
					_tmp21_ = _tmp20_;
					if (!_tmp21_) {
						result = FALSE;
						_g_object_unref0 (photo);
						_g_object_unref0 (source);
						return result;
					}
				}
				_g_object_unref0 (photo);
			}
		}
	}
	if ((gboolean) (SEARCH_FILTER_CRITERIA_TEXT & search_view_filter_get_criteria (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter)))) {
		const gchar* keywords = NULL;
		ImportSource* _tmp22_;
		const gchar* _tmp23_;
		const gchar* _tmp24_;
		gint _tmp25_ = 0;
		gchar** _tmp26_;
		_tmp22_ = source;
		_tmp23_ = indexable_get_indexable_keywords (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_INDEXABLE, Indexable));
		keywords = _tmp23_;
		_tmp24_ = keywords;
		if (is_string_empty (_tmp24_)) {
			result = FALSE;
			_g_object_unref0 (source);
			return result;
		}
		_tmp26_ = search_view_filter_get_search_filter_words (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SEARCH_VIEW_FILTER, SearchViewFilter), &_tmp25_);
		{
			gchar** word_collection = NULL;
			gint word_collection_length1 = 0;
			gint _word_collection_size_ = 0;
			gint word_it = 0;
			word_collection = _tmp26_;
			word_collection_length1 = _tmp25_;
			for (word_it = 0; word_it < word_collection_length1; word_it = word_it + 1) {
				const gchar* word = NULL;
				word = word_collection[word_it];
				{
					const gchar* _tmp27_;
					const gchar* _tmp28_;
					_tmp27_ = keywords;
					_tmp28_ = word;
					if (!string_contains (_tmp27_, _tmp28_)) {
						result = FALSE;
						_g_object_unref0 (source);
						return result;
					}
				}
			}
		}
	}
	result = TRUE;
	_g_object_unref0 (source);
	return result;
}

static ImportPageImportPageSearchViewFilter*
import_page_import_page_search_view_filter_construct (GType object_type)
{
	ImportPageImportPageSearchViewFilter* self = NULL;
	self = (ImportPageImportPageSearchViewFilter*) search_view_filter_construct (object_type);
	return self;
}

static ImportPageImportPageSearchViewFilter*
import_page_import_page_search_view_filter_new (void)
{
	return import_page_import_page_search_view_filter_construct (IMPORT_PAGE_TYPE_IMPORT_PAGE_SEARCH_VIEW_FILTER);
}

static void
import_page_import_page_search_view_filter_class_init (ImportPageImportPageSearchViewFilterClass * klass,
                                                       gpointer klass_data)
{
	import_page_import_page_search_view_filter_parent_class = g_type_class_peek_parent (klass);
	((SearchViewFilterClass *) klass)->get_criteria = (guint (*) (SearchViewFilter*)) import_page_import_page_search_view_filter_real_get_criteria;
	((ViewFilterClass *) klass)->predicate = (gboolean (*) (ViewFilter*, DataView*)) import_page_import_page_search_view_filter_real_predicate;
}

static void
import_page_import_page_search_view_filter_instance_init (ImportPageImportPageSearchViewFilter * self,
                                                          gpointer klass)
{
}

static GType
import_page_import_page_search_view_filter_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ImportPageImportPageSearchViewFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) import_page_import_page_search_view_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ImportPageImportPageSearchViewFilter), 0, (GInstanceInitFunc) import_page_import_page_search_view_filter_instance_init, NULL };
	GType import_page_import_page_search_view_filter_type_id;
	import_page_import_page_search_view_filter_type_id = g_type_register_static (TYPE_SEARCH_VIEW_FILTER, "ImportPageImportPageSearchViewFilter", &g_define_type_info, 0);
	return import_page_import_page_search_view_filter_type_id;
}

static GType
import_page_import_page_search_view_filter_get_type (void)
{
	static volatile gsize import_page_import_page_search_view_filter_type_id__once = 0;
	if (g_once_init_enter (&import_page_import_page_search_view_filter_type_id__once)) {
		GType import_page_import_page_search_view_filter_type_id;
		import_page_import_page_search_view_filter_type_id = import_page_import_page_search_view_filter_get_type_once ();
		g_once_init_leave (&import_page_import_page_search_view_filter_type_id__once, import_page_import_page_search_view_filter_type_id);
	}
	return import_page_import_page_search_view_filter_type_id__once;
}

static gboolean
import_page_hide_imported_view_filter_real_predicate (ViewFilter* base,
                                                      DataView* view)
{
	ImportPageHideImportedViewFilter * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, IMPORT_PAGE_TYPE_HIDE_IMPORTED_VIEW_FILTER, ImportPageHideImportedViewFilter);
	g_return_val_if_fail (IS_DATA_VIEW (view), FALSE);
	result = !import_preview_is_already_imported (G_TYPE_CHECK_INSTANCE_CAST (view, TYPE_IMPORT_PREVIEW, ImportPreview));
	return result;
}

static ImportPageHideImportedViewFilter*
import_page_hide_imported_view_filter_construct (GType object_type)
{
	ImportPageHideImportedViewFilter* self = NULL;
	self = (ImportPageHideImportedViewFilter*) view_filter_construct (object_type);
	return self;
}

static ImportPageHideImportedViewFilter*
import_page_hide_imported_view_filter_new (void)
{
	return import_page_hide_imported_view_filter_construct (IMPORT_PAGE_TYPE_HIDE_IMPORTED_VIEW_FILTER);
}

static void
import_page_hide_imported_view_filter_class_init (ImportPageHideImportedViewFilterClass * klass,
                                                  gpointer klass_data)
{
	import_page_hide_imported_view_filter_parent_class = g_type_class_peek_parent (klass);
	((ViewFilterClass *) klass)->predicate = (gboolean (*) (ViewFilter*, DataView*)) import_page_hide_imported_view_filter_real_predicate;
}

static void
import_page_hide_imported_view_filter_instance_init (ImportPageHideImportedViewFilter * self,
                                                     gpointer klass)
{
}

static GType
import_page_hide_imported_view_filter_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ImportPageHideImportedViewFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) import_page_hide_imported_view_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ImportPageHideImportedViewFilter), 0, (GInstanceInitFunc) import_page_hide_imported_view_filter_instance_init, NULL };
	GType import_page_hide_imported_view_filter_type_id;
	import_page_hide_imported_view_filter_type_id = g_type_register_static (TYPE_VIEW_FILTER, "ImportPageHideImportedViewFilter", &g_define_type_info, 0);
	return import_page_hide_imported_view_filter_type_id;
}

static GType
import_page_hide_imported_view_filter_get_type (void)
{
	static volatile gsize import_page_hide_imported_view_filter_type_id__once = 0;
	if (g_once_init_enter (&import_page_hide_imported_view_filter_type_id__once)) {
		GType import_page_hide_imported_view_filter_type_id;
		import_page_hide_imported_view_filter_type_id = import_page_hide_imported_view_filter_get_type_once ();
		g_once_init_leave (&import_page_hide_imported_view_filter_type_id__once, import_page_hide_imported_view_filter_type_id);
	}
	return import_page_hide_imported_view_filter_type_id__once;
}

static void
import_page_class_init (ImportPageClass * klass,
                        gpointer klass_data)
{
	import_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ImportPage_private_offset);
	((PageClass *) klass)->get_toolbar = (GtkToolbar* (*) (Page*)) import_page_real_get_toolbar;
	((CheckerboardPageClass *) klass)->get_view_tracker = (CoreViewTracker* (*) (CheckerboardPage*)) import_page_real_get_view_tracker;
	((CheckerboardPageClass *) klass)->get_view_empty_icon = (gchar* (*) (CheckerboardPage*)) import_page_real_get_view_empty_icon;
	((CheckerboardPageClass *) klass)->get_view_empty_message = (gchar* (*) (CheckerboardPage*)) import_page_real_get_view_empty_message;
	((CheckerboardPageClass *) klass)->get_filter_no_match_message = (gchar* (*) (CheckerboardPage*)) import_page_real_get_filter_no_match_message;
	((PageClass *) klass)->init_collect_ui_filenames = (void (*) (Page*, GeeList*)) import_page_real_init_collect_ui_filenames;
	((PageClass *) klass)->add_actions = (void (*) (Page*, GActionMap*)) import_page_real_add_actions;
	((PageClass *) klass)->remove_actions = (void (*) (Page*, GActionMap*)) import_page_real_remove_actions;
	((PageClass *) klass)->init_actions = (void (*) (Page*, gint, gint)) import_page_real_init_actions;
	((PageClass *) klass)->switched_to = (void (*) (Page*)) import_page_real_switched_to;
	((PageClass *) klass)->ready = (void (*) (Page*)) import_page_real_ready;
	((CheckerboardPageClass *) klass)->set_display_titles = (void (*) (CheckerboardPage*, gboolean)) import_page_real_set_display_titles;
	((CheckerboardPageClass *) klass)->get_search_view_filter = (SearchViewFilter* (*) (CheckerboardPage*)) import_page_real_get_search_view_filter;
	G_OBJECT_CLASS (klass)->finalize = import_page_finalize;
}

static void
import_page_instance_init (ImportPage * self,
                           gpointer klass)
{
	GtkLabel* _tmp0_;
	GtkProgressBar* _tmp1_;
	ImportPageImportPageSearchViewFilter* _tmp2_;
	ImportPageHideImportedViewFilter* _tmp3_;
	self->priv = import_page_get_instance_private (self);
	self->priv->import_sources = NULL;
	_tmp0_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp0_);
	self->priv->camera_label = _tmp0_;
	_tmp1_ = (GtkProgressBar*) gtk_progress_bar_new ();
	g_object_ref_sink (_tmp1_);
	self->priv->progress_bar = _tmp1_;
	self->priv->busy = FALSE;
	self->priv->refreshed = FALSE;
	self->priv->refresh_result = GP_OK;
	self->priv->refresh_error = NULL;
	self->priv->volume_monitor = NULL;
	self->priv->local_ref = NULL;
	_tmp2_ = import_page_import_page_search_view_filter_new ();
	self->priv->search_filter = _tmp2_;
	_tmp3_ = import_page_hide_imported_view_filter_new ();
	self->priv->hide_imported_filter = _tmp3_;
	self->priv->claim_timeout = 500;
}

static void
import_page_finalize (GObject * obj)
{
	ImportPage * self;
	LibraryPhotoSourceCollection* _tmp0_;
	guint _tmp1_;
	VideoSourceCollection* _tmp2_;
	guint _tmp3_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_IMPORT_PAGE, ImportPage);
	_tmp0_ = library_photo_global;
	g_signal_parse_name ("contents-altered", TYPE_DATA_COLLECTION, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _import_page_on_media_added_removed_data_collection_contents_altered, self);
	_tmp2_ = video_global;
	g_signal_parse_name ("contents-altered", TYPE_DATA_COLLECTION, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _import_page_on_media_added_removed_data_collection_contents_altered, self);
	_data_collection_unref0 (self->priv->import_sources);
	_g_object_unref0 (self->priv->camera_label);
	_g_object_unref0 (self->priv->hide_imported);
	_g_object_unref0 (self->priv->progress_bar);
	_discovered_camera_unref0 (self->priv->dcamera);
	_g_free0 (self->priv->refresh_error);
	_g_object_unref0 (self->priv->volume_monitor);
	_g_object_unref0 (self->priv->local_ref);
	_view_filter_unref0 (self->priv->search_filter);
	_view_filter_unref0 (self->priv->hide_imported_filter);
	_core_tracker_unref0 (self->priv->tracker);
	G_OBJECT_CLASS (import_page_parent_class)->finalize (obj);
}

static GType
import_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ImportPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) import_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ImportPage), 0, (GInstanceInitFunc) import_page_instance_init, NULL };
	GType import_page_type_id;
	import_page_type_id = g_type_register_static (TYPE_CHECKERBOARD_PAGE, "ImportPage", &g_define_type_info, 0);
	ImportPage_private_offset = g_type_add_instance_private (import_page_type_id, sizeof (ImportPagePrivate));
	return import_page_type_id;
}

GType
import_page_get_type (void)
{
	static volatile gsize import_page_type_id__once = 0;
	if (g_once_init_enter (&import_page_type_id__once)) {
		GType import_page_type_id;
		import_page_type_id = import_page_get_type_once ();
		g_once_init_leave (&import_page_type_id__once, import_page_type_id);
	}
	return import_page_type_id__once;
}

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

