/* PixbufCache.c generated by valac 0.36.6, the Vala compiler
 * generated from PixbufCache.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.h>
#include <glib-object.h>
#include <gee.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>


#define TYPE_PIXBUF_CACHE (pixbuf_cache_get_type ())
#define PIXBUF_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PIXBUF_CACHE, PixbufCache))
#define PIXBUF_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PIXBUF_CACHE, PixbufCacheClass))
#define IS_PIXBUF_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PIXBUF_CACHE))
#define IS_PIXBUF_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PIXBUF_CACHE))
#define PIXBUF_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PIXBUF_CACHE, PixbufCacheClass))

typedef struct _PixbufCache PixbufCache;
typedef struct _PixbufCacheClass PixbufCacheClass;
typedef struct _PixbufCachePrivate PixbufCachePrivate;

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

typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;

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

typedef struct _SourceCollection SourceCollection;
typedef struct _SourceCollectionClass SourceCollectionClass;

#define PIXBUF_CACHE_TYPE_PHOTO_TYPE (pixbuf_cache_photo_type_get_type ())

#define TYPE_SCALING (scaling_get_type ())

#define TYPE_SCALE_CONSTRAINT (scale_constraint_get_type ())

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

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

typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;

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

typedef struct _DataSource DataSource;
typedef struct _DataSourceClass DataSourceClass;

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

typedef struct _ThumbnailSource ThumbnailSource;
typedef struct _ThumbnailSourceClass ThumbnailSourceClass;

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

typedef struct _MediaSource MediaSource;
typedef struct _MediaSourceClass MediaSourceClass;

#define TYPE_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_BACKGROUND_JOB (background_job_get_type ())
#define BACKGROUND_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKGROUND_JOB, BackgroundJob))
#define BACKGROUND_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKGROUND_JOB, BackgroundJobClass))
#define IS_BACKGROUND_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKGROUND_JOB))
#define IS_BACKGROUND_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKGROUND_JOB))
#define BACKGROUND_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKGROUND_JOB, BackgroundJobClass))

typedef struct _BackgroundJob BackgroundJob;
typedef struct _BackgroundJobClass BackgroundJobClass;

#define PIXBUF_CACHE_TYPE_FETCH_JOB (pixbuf_cache_fetch_job_get_type ())
#define PIXBUF_CACHE_FETCH_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob))
#define PIXBUF_CACHE_FETCH_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJobClass))
#define PIXBUF_CACHE_IS_FETCH_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIXBUF_CACHE_TYPE_FETCH_JOB))
#define PIXBUF_CACHE_IS_FETCH_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIXBUF_CACHE_TYPE_FETCH_JOB))
#define PIXBUF_CACHE_FETCH_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJobClass))

typedef struct _PixbufCacheFetchJob PixbufCacheFetchJob;
typedef struct _PixbufCacheFetchJobClass PixbufCacheFetchJobClass;

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

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

#define TYPE_WORKERS (workers_get_type ())
#define WORKERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_WORKERS, Workers))
#define WORKERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_WORKERS, WorkersClass))
#define IS_WORKERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_WORKERS))
#define IS_WORKERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_WORKERS))
#define WORKERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_WORKERS, WorkersClass))

typedef struct _Workers Workers;
typedef struct _WorkersClass WorkersClass;
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
#define _workers_unref0(var) ((var == NULL) ? NULL : (var = (workers_unref (var), NULL)))
typedef struct _BackgroundJobPrivate BackgroundJobPrivate;

#define BACKGROUND_JOB_TYPE_JOB_PRIORITY (background_job_job_priority_get_type ())
typedef struct _PixbufCacheFetchJobPrivate PixbufCacheFetchJobPrivate;

#define PIXBUF_CACHE_TYPE_BASELINE_FETCH_JOB (pixbuf_cache_baseline_fetch_job_get_type ())
#define PIXBUF_CACHE_BASELINE_FETCH_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIXBUF_CACHE_TYPE_BASELINE_FETCH_JOB, PixbufCacheBaselineFetchJob))
#define PIXBUF_CACHE_BASELINE_FETCH_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PIXBUF_CACHE_TYPE_BASELINE_FETCH_JOB, PixbufCacheBaselineFetchJobClass))
#define PIXBUF_CACHE_IS_BASELINE_FETCH_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIXBUF_CACHE_TYPE_BASELINE_FETCH_JOB))
#define PIXBUF_CACHE_IS_BASELINE_FETCH_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIXBUF_CACHE_TYPE_BASELINE_FETCH_JOB))
#define PIXBUF_CACHE_BASELINE_FETCH_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PIXBUF_CACHE_TYPE_BASELINE_FETCH_JOB, PixbufCacheBaselineFetchJobClass))

typedef struct _PixbufCacheBaselineFetchJob PixbufCacheBaselineFetchJob;
typedef struct _PixbufCacheBaselineFetchJobClass PixbufCacheBaselineFetchJobClass;

#define PIXBUF_CACHE_TYPE_MASTER_FETCH_JOB (pixbuf_cache_master_fetch_job_get_type ())
#define PIXBUF_CACHE_MASTER_FETCH_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIXBUF_CACHE_TYPE_MASTER_FETCH_JOB, PixbufCacheMasterFetchJob))
#define PIXBUF_CACHE_MASTER_FETCH_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PIXBUF_CACHE_TYPE_MASTER_FETCH_JOB, PixbufCacheMasterFetchJobClass))
#define PIXBUF_CACHE_IS_MASTER_FETCH_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIXBUF_CACHE_TYPE_MASTER_FETCH_JOB))
#define PIXBUF_CACHE_IS_MASTER_FETCH_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIXBUF_CACHE_TYPE_MASTER_FETCH_JOB))
#define PIXBUF_CACHE_MASTER_FETCH_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PIXBUF_CACHE_TYPE_MASTER_FETCH_JOB, PixbufCacheMasterFetchJobClass))

typedef struct _PixbufCacheMasterFetchJob PixbufCacheMasterFetchJob;
typedef struct _PixbufCacheMasterFetchJobClass PixbufCacheMasterFetchJobClass;

#define PIXBUF_CACHE_TYPE_PIXBUF_CACHE_BATCH (pixbuf_cache_pixbuf_cache_batch_get_type ())
#define PIXBUF_CACHE_PIXBUF_CACHE_BATCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIXBUF_CACHE_TYPE_PIXBUF_CACHE_BATCH, PixbufCachePixbufCacheBatch))
#define PIXBUF_CACHE_PIXBUF_CACHE_BATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PIXBUF_CACHE_TYPE_PIXBUF_CACHE_BATCH, PixbufCachePixbufCacheBatchClass))
#define PIXBUF_CACHE_IS_PIXBUF_CACHE_BATCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIXBUF_CACHE_TYPE_PIXBUF_CACHE_BATCH))
#define PIXBUF_CACHE_IS_PIXBUF_CACHE_BATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIXBUF_CACHE_TYPE_PIXBUF_CACHE_BATCH))
#define PIXBUF_CACHE_PIXBUF_CACHE_BATCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PIXBUF_CACHE_TYPE_PIXBUF_CACHE_BATCH, PixbufCachePixbufCacheBatchClass))

typedef struct _PixbufCachePixbufCacheBatch PixbufCachePixbufCacheBatch;
typedef struct _PixbufCachePixbufCacheBatchClass PixbufCachePixbufCacheBatchClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _alteration_unref0(var) ((var == NULL) ? NULL : (var = (alteration_unref (var), NULL)))
typedef struct _PixbufCachePixbufCacheBatchPrivate PixbufCachePixbufCacheBatchPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_ABSTRACT_SEMAPHORE (abstract_semaphore_get_type ())
#define ABSTRACT_SEMAPHORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphore))
#define ABSTRACT_SEMAPHORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphoreClass))
#define IS_ABSTRACT_SEMAPHORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ABSTRACT_SEMAPHORE))
#define IS_ABSTRACT_SEMAPHORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ABSTRACT_SEMAPHORE))
#define ABSTRACT_SEMAPHORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphoreClass))

typedef struct _AbstractSemaphore AbstractSemaphore;
typedef struct _AbstractSemaphoreClass AbstractSemaphoreClass;

#define TYPE_SEMAPHORE (semaphore_get_type ())
#define SEMAPHORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SEMAPHORE, Semaphore))
#define SEMAPHORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SEMAPHORE, SemaphoreClass))
#define IS_SEMAPHORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SEMAPHORE))
#define IS_SEMAPHORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SEMAPHORE))
#define SEMAPHORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SEMAPHORE, SemaphoreClass))

typedef struct _Semaphore Semaphore;
typedef struct _SemaphoreClass SemaphoreClass;
#define _abstract_semaphore_unref0(var) ((var == NULL) ? NULL : (var = (abstract_semaphore_unref (var), NULL)))
typedef struct _PixbufCacheBaselineFetchJobPrivate PixbufCacheBaselineFetchJobPrivate;
typedef struct _PixbufCacheMasterFetchJobPrivate PixbufCacheMasterFetchJobPrivate;
enum  {
	PIXBUF_CACHE_FETCHED_SIGNAL,
	PIXBUF_CACHE_LAST_SIGNAL
};
static guint pixbuf_cache_signals[PIXBUF_CACHE_LAST_SIGNAL] = {0};
#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 _PixbufCache {
	GObject parent_instance;
	PixbufCachePrivate * priv;
};

struct _PixbufCacheClass {
	GObjectClass parent_class;
};

typedef enum  {
	PIXBUF_CACHE_PHOTO_TYPE_BASELINE,
	PIXBUF_CACHE_PHOTO_TYPE_MASTER
} PixbufCachePhotoType;

typedef enum  {
	SCALE_CONSTRAINT_ORIGINAL,
	SCALE_CONSTRAINT_DIMENSIONS,
	SCALE_CONSTRAINT_WIDTH,
	SCALE_CONSTRAINT_HEIGHT,
	SCALE_CONSTRAINT_FILL_VIEWPORT
} ScaleConstraint;

struct _Dimensions {
	gint width;
	gint height;
};

struct _Scaling {
	ScaleConstraint constraint;
	gint scale;
	Dimensions viewport;
	gboolean scale_up;
};

typedef gboolean (*PixbufCacheCacheFilter) (Photo* photo, void* user_data);
struct _PixbufCachePrivate {
	SourceCollection* sources;
	PixbufCachePhotoType type;
	gint max_count;
	Scaling scaling;
	PixbufCacheCacheFilter filter;
	gpointer filter_target;
	GeeHashMap* cache;
	GeeArrayList* lru;
	GeeHashMap* in_progress;
};

typedef enum  {
	BACKGROUND_JOB_JOB_PRIORITY_HIGHEST = 100,
	BACKGROUND_JOB_JOB_PRIORITY_HIGH = 75,
	BACKGROUND_JOB_JOB_PRIORITY_NORMAL = 50,
	BACKGROUND_JOB_JOB_PRIORITY_LOW = 25,
	BACKGROUND_JOB_JOB_PRIORITY_LOWEST = 0
} BackgroundJobJobPriority;

struct _BackgroundJob {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BackgroundJobPrivate * priv;
};

struct _BackgroundJobClass {
	GTypeClass parent_class;
	void (*finalize) (BackgroundJob *self);
	void (*execute) (BackgroundJob* self);
	BackgroundJobJobPriority (*get_priority) (BackgroundJob* self);
};

struct _PixbufCacheFetchJob {
	BackgroundJob parent_instance;
	PixbufCacheFetchJobPrivate * priv;
	BackgroundJobJobPriority priority;
	Photo* photo;
	Scaling scaling;
	GdkPixbuf* pixbuf;
	GError* err;
};

struct _PixbufCacheFetchJobClass {
	BackgroundJobClass parent_class;
};

typedef void (*CompletionCallback) (BackgroundJob* job, void* user_data);
struct _PixbufCachePixbufCacheBatch {
	GeeTreeMultiMap parent_instance;
	PixbufCachePixbufCacheBatchPrivate * priv;
};

struct _PixbufCachePixbufCacheBatchClass {
	GeeTreeMultiMapClass parent_class;
};

typedef void (*CancellationCallback) (BackgroundJob* job, void* user_data);
struct _PixbufCacheBaselineFetchJob {
	PixbufCacheFetchJob parent_instance;
	PixbufCacheBaselineFetchJobPrivate * priv;
};

struct _PixbufCacheBaselineFetchJobClass {
	PixbufCacheFetchJobClass parent_class;
};

struct _PixbufCacheMasterFetchJob {
	PixbufCacheFetchJob parent_instance;
	PixbufCacheMasterFetchJobPrivate * priv;
};

struct _PixbufCacheMasterFetchJobClass {
	PixbufCacheFetchJobClass parent_class;
};


static gpointer pixbuf_cache_parent_class = NULL;
static Workers* pixbuf_cache_background_workers;
static Workers* pixbuf_cache_background_workers = NULL;
static gpointer pixbuf_cache_pixbuf_cache_batch_parent_class = NULL;
static gpointer pixbuf_cache_fetch_job_parent_class = NULL;
static gpointer pixbuf_cache_baseline_fetch_job_parent_class = NULL;
static gpointer pixbuf_cache_master_fetch_job_parent_class = NULL;

GType pixbuf_cache_get_type (void) G_GNUC_CONST;
gpointer data_collection_ref (gpointer instance);
void data_collection_unref (gpointer instance);
GParamSpec* param_spec_data_collection (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_data_collection (GValue* value, gpointer v_object);
void value_take_data_collection (GValue* value, gpointer v_object);
gpointer value_get_data_collection (const GValue* value);
GType data_collection_get_type (void) G_GNUC_CONST;
GType source_collection_get_type (void) G_GNUC_CONST;
GType pixbuf_cache_photo_type_get_type (void) G_GNUC_CONST;
GType scaling_get_type (void) G_GNUC_CONST;
GType scale_constraint_get_type (void) G_GNUC_CONST;
GType dimensions_get_type (void) G_GNUC_CONST;
Dimensions* dimensions_dup (const Dimensions* self);
void dimensions_free (Dimensions* self);
Scaling* scaling_dup (const Scaling* self);
void scaling_free (Scaling* self);
GType data_object_get_type (void) G_GNUC_CONST;
GType data_source_get_type (void) G_GNUC_CONST;
GType thumbnail_source_get_type (void) G_GNUC_CONST;
GType media_source_get_type (void) G_GNUC_CONST;
GType photo_source_get_type (void) G_GNUC_CONST;
GType photo_get_type (void) G_GNUC_CONST;
gpointer background_job_ref (gpointer instance);
void background_job_unref (gpointer instance);
GParamSpec* param_spec_background_job (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_background_job (GValue* value, gpointer v_object);
void value_take_background_job (GValue* value, gpointer v_object);
gpointer value_get_background_job (const GValue* value);
GType background_job_get_type (void) G_GNUC_CONST;
static GType pixbuf_cache_fetch_job_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define PIXBUF_CACHE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PIXBUF_CACHE, PixbufCachePrivate))
enum  {
	PIXBUF_CACHE_DUMMY_PROPERTY
};
gpointer alteration_ref (gpointer instance);
void alteration_unref (gpointer instance);
GParamSpec* param_spec_alteration (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_alteration (GValue* value, gpointer v_object);
void value_take_alteration (GValue* value, gpointer v_object);
gpointer value_get_alteration (const GValue* value);
GType alteration_get_type (void) G_GNUC_CONST;
static void pixbuf_cache_on_sources_altered (PixbufCache* self, GeeMap* map);
static void _pixbuf_cache_on_sources_altered_data_collection_items_altered (DataCollection* _sender, GeeMap* items, gpointer self);
static void pixbuf_cache_on_sources_removed (PixbufCache* self, GeeIterable* removed);
static void _pixbuf_cache_on_sources_removed_data_collection_items_removed (DataCollection* _sender, GeeIterable* removed, gpointer self);
void background_job_cancel (BackgroundJob* self);
gpointer workers_ref (gpointer instance);
void workers_unref (gpointer instance);
GParamSpec* param_spec_workers (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_workers (GValue* value, gpointer v_object);
void value_take_workers (GValue* value, gpointer v_object);
gpointer value_get_workers (const GValue* value);
GType workers_get_type (void) G_GNUC_CONST;
PixbufCache* pixbuf_cache_new (SourceCollection* sources, PixbufCachePhotoType type, Scaling* scaling, gint max_count, PixbufCacheCacheFilter filter, void* filter_target);
PixbufCache* pixbuf_cache_construct (GType object_type, SourceCollection* sources, PixbufCachePhotoType type, Scaling* scaling, gint max_count, PixbufCacheCacheFilter filter, void* filter_target);
guint workers_thread_per_cpu_minus_one (void);
Workers* workers_new (guint max_threads, gboolean exclusive);
Workers* workers_construct (GType object_type, guint max_threads, gboolean exclusive);
void pixbuf_cache_get_scaling (PixbufCache* self, Scaling* result);
GdkPixbuf* pixbuf_cache_get_ready_pixbuf (PixbufCache* self, Photo* photo);
static GdkPixbuf* pixbuf_cache_get_cached (PixbufCache* self, Photo* photo);
GdkPixbuf* pixbuf_cache_fetch (PixbufCache* self, Photo* photo, GError** error);
GFile* photo_get_actual_file (Photo* self);
static void pixbuf_cache_decache (PixbufCache* self, Photo* photo);
void background_job_wait_for_completion (BackgroundJob* self);
GType background_job_job_priority_get_type (void) G_GNUC_CONST;
GdkPixbuf* photo_source_get_pixbuf (PhotoSource* self, Scaling* scaling, GError** error);
static void pixbuf_cache_encache (PixbufCache* self, Photo* photo, GdkPixbuf* pixbuf);
void pixbuf_cache_drop (PixbufCache* self, Photo* photo);
gboolean pixbuf_cache_cancel_prefetch (PixbufCache* self, Photo* photo);
void pixbuf_cache_prefetch (PixbufCache* self, Photo* photo, BackgroundJobJobPriority priority, gboolean force);
static void pixbuf_cache_prioritize (PixbufCache* self, Photo* photo);
static void pixbuf_cache_on_fetched (PixbufCache* self, BackgroundJob* j);
static void _pixbuf_cache_on_fetched_completion_callback (BackgroundJob* job, gpointer self);
static PixbufCacheBaselineFetchJob* pixbuf_cache_baseline_fetch_job_new (PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target);
static PixbufCacheBaselineFetchJob* pixbuf_cache_baseline_fetch_job_construct (GType object_type, PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target);
static GType pixbuf_cache_baseline_fetch_job_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static PixbufCacheMasterFetchJob* pixbuf_cache_master_fetch_job_new (PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target);
static PixbufCacheMasterFetchJob* pixbuf_cache_master_fetch_job_construct (GType object_type, PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target);
static GType pixbuf_cache_master_fetch_job_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
void workers_enqueue (Workers* self, BackgroundJob* job);
void pixbuf_cache_prefetch_many (PixbufCache* self, GeeCollection* photos, BackgroundJobJobPriority priority, gboolean force);
GType pixbuf_cache_pixbuf_cache_batch_get_type (void) G_GNUC_CONST;
void pixbuf_cache_prefetch_batch (PixbufCache* self, PixbufCachePixbufCacheBatch* batch, gboolean force);
void pixbuf_cache_cancel_all (PixbufCache* self);
gchar* data_object_to_string (DataObject* self);
gboolean alteration_has_subject (Alteration* self, const gchar* subject);
static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_POINTER (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
enum  {
	PIXBUF_CACHE_PIXBUF_CACHE_BATCH_DUMMY_PROPERTY
};
PixbufCachePixbufCacheBatch* pixbuf_cache_pixbuf_cache_batch_new (void);
PixbufCachePixbufCacheBatch* pixbuf_cache_pixbuf_cache_batch_construct (GType object_type);
gint background_job_job_priority_compare_func (BackgroundJobJobPriority a, BackgroundJobJobPriority b);
enum  {
	PIXBUF_CACHE_FETCH_JOB_DUMMY_PROPERTY
};
static PixbufCacheFetchJob* pixbuf_cache_fetch_job_construct (GType object_type, PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target);
Semaphore* semaphore_new (void);
Semaphore* semaphore_construct (GType object_type);
gpointer abstract_semaphore_ref (gpointer instance);
void abstract_semaphore_unref (gpointer instance);
GParamSpec* param_spec_abstract_semaphore (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_abstract_semaphore (GValue* value, gpointer v_object);
void value_take_abstract_semaphore (GValue* value, gpointer v_object);
gpointer value_get_abstract_semaphore (const GValue* value);
GType abstract_semaphore_get_type (void) G_GNUC_CONST;
GType semaphore_get_type (void) G_GNUC_CONST;
BackgroundJob* background_job_construct (GType object_type, GObject* owner, CompletionCallback callback, void* callback_target, GCancellable* cancellable, CancellationCallback cancellation, void* cancellation_target, AbstractSemaphore* completion_semaphore);
static BackgroundJobJobPriority pixbuf_cache_fetch_job_real_get_priority (BackgroundJob* base);
static void pixbuf_cache_fetch_job_finalize (BackgroundJob * obj);
enum  {
	PIXBUF_CACHE_BASELINE_FETCH_JOB_DUMMY_PROPERTY
};
static void pixbuf_cache_baseline_fetch_job_real_execute (BackgroundJob* base);
enum  {
	PIXBUF_CACHE_MASTER_FETCH_JOB_DUMMY_PROPERTY
};
static void pixbuf_cache_master_fetch_job_real_execute (BackgroundJob* base);
GdkPixbuf* photo_get_master_pixbuf (Photo* self, Scaling* scaling, gboolean rotate, GError** error);
static void pixbuf_cache_finalize (GObject * obj);


static void _pixbuf_cache_on_sources_altered_data_collection_items_altered (DataCollection* _sender, GeeMap* items, gpointer self) {
#line 111 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_on_sources_altered ((PixbufCache*) self, items);
#line 482 "PixbufCache.c"
}


static void _pixbuf_cache_on_sources_removed_data_collection_items_removed (DataCollection* _sender, GeeIterable* removed, gpointer self) {
#line 112 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_on_sources_removed ((PixbufCache*) self, removed);
#line 489 "PixbufCache.c"
}


GType pixbuf_cache_photo_type_get_type (void) {
	static volatile gsize pixbuf_cache_photo_type_type_id__volatile = 0;
	if (g_once_init_enter (&pixbuf_cache_photo_type_type_id__volatile)) {
		static const GEnumValue values[] = {{PIXBUF_CACHE_PHOTO_TYPE_BASELINE, "PIXBUF_CACHE_PHOTO_TYPE_BASELINE", "baseline"}, {PIXBUF_CACHE_PHOTO_TYPE_MASTER, "PIXBUF_CACHE_PHOTO_TYPE_MASTER", "master"}, {0, NULL, NULL}};
		GType pixbuf_cache_photo_type_type_id;
		pixbuf_cache_photo_type_type_id = g_enum_register_static ("PixbufCachePhotoType", values);
		g_once_init_leave (&pixbuf_cache_photo_type_type_id__volatile, pixbuf_cache_photo_type_type_id);
	}
	return pixbuf_cache_photo_type_type_id__volatile;
}


static gpointer _data_collection_ref0 (gpointer self) {
#line 87 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return self ? data_collection_ref (self) : NULL;
#line 508 "PixbufCache.c"
}


PixbufCache* pixbuf_cache_construct (GType object_type, SourceCollection* sources, PixbufCachePhotoType type, Scaling* scaling, gint max_count, PixbufCacheCacheFilter filter, void* filter_target) {
	PixbufCache * self = NULL;
	SourceCollection* _tmp0_;
	SourceCollection* _tmp1_;
	PixbufCachePhotoType _tmp2_;
	Scaling _tmp3_;
	gint _tmp4_;
	PixbufCacheCacheFilter _tmp5_;
	void* _tmp5__target;
	gint _tmp6_;
	Workers* _tmp7_;
	PixbufCachePhotoType _tmp10_;
	SourceCollection* _tmp12_;
#line 85 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_SOURCE_COLLECTION (sources), NULL);
#line 85 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 85 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = (PixbufCache*) g_object_new (object_type, NULL);
#line 87 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = sources;
#line 87 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = _data_collection_ref0 (_tmp0_);
#line 87 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_data_collection_unref0 (self->priv->sources);
#line 87 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv->sources = _tmp1_;
#line 88 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = type;
#line 88 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv->type = _tmp2_;
#line 89 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = *scaling;
#line 89 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv->scaling = _tmp3_;
#line 90 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = max_count;
#line 90 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv->max_count = _tmp4_;
#line 91 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp5_ = filter;
#line 91 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp5__target = filter_target;
#line 91 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv->filter = _tmp5_;
#line 91 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv->filter_target = _tmp5__target;
#line 93 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp6_ = max_count;
#line 93 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_vala_assert (_tmp6_ > 0, "max_count > 0");
#line 95 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp7_ = pixbuf_cache_background_workers;
#line 95 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp7_ == NULL) {
#line 567 "PixbufCache.c"
		guint _tmp8_;
		Workers* _tmp9_;
#line 96 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp8_ = workers_thread_per_cpu_minus_one ();
#line 96 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp9_ = workers_new (_tmp8_, FALSE);
#line 96 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_workers_unref0 (pixbuf_cache_background_workers);
#line 96 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		pixbuf_cache_background_workers = _tmp9_;
#line 578 "PixbufCache.c"
	}
#line 100 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp10_ = type;
#line 100 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp10_ != PIXBUF_CACHE_PHOTO_TYPE_MASTER) {
#line 584 "PixbufCache.c"
		SourceCollection* _tmp11_;
#line 101 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp11_ = sources;
#line 101 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_DATA_COLLECTION, DataCollection), "items-altered", (GCallback) _pixbuf_cache_on_sources_altered_data_collection_items_altered, self, 0);
#line 590 "PixbufCache.c"
	}
#line 102 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp12_ = sources;
#line 102 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_DATA_COLLECTION, DataCollection), "items-removed", (GCallback) _pixbuf_cache_on_sources_removed_data_collection_items_removed, self, 0);
#line 85 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return self;
#line 598 "PixbufCache.c"
}


PixbufCache* pixbuf_cache_new (SourceCollection* sources, PixbufCachePhotoType type, Scaling* scaling, gint max_count, PixbufCacheCacheFilter filter, void* filter_target) {
#line 85 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return pixbuf_cache_construct (TYPE_PIXBUF_CACHE, sources, type, scaling, max_count, filter, filter_target);
#line 605 "PixbufCache.c"
}


void pixbuf_cache_get_scaling (PixbufCache* self, Scaling* result) {
	Scaling _tmp0_;
#line 118 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 119 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = self->priv->scaling;
#line 119 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	*result = _tmp0_;
#line 119 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return;
#line 619 "PixbufCache.c"
}


GdkPixbuf* pixbuf_cache_get_ready_pixbuf (PixbufCache* self, Photo* photo) {
	GdkPixbuf* result = NULL;
	Photo* _tmp0_;
	GdkPixbuf* _tmp1_;
#line 123 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PIXBUF_CACHE (self), NULL);
#line 123 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PHOTO (photo), NULL);
#line 124 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = photo;
#line 124 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = pixbuf_cache_get_cached (self, _tmp0_);
#line 124 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	result = _tmp1_;
#line 124 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return result;
#line 639 "PixbufCache.c"
}


static gpointer _g_error_copy0 (gpointer self) {
#line 146 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return self ? g_error_copy (self) : NULL;
#line 646 "PixbufCache.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 148 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return self ? g_object_ref (self) : NULL;
#line 653 "PixbufCache.c"
}


GdkPixbuf* pixbuf_cache_fetch (PixbufCache* self, Photo* photo, GError** error) {
	GdkPixbuf* result = NULL;
	Photo* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GdkPixbuf* pixbuf = NULL;
	Photo* _tmp6_;
	GdkPixbuf* _tmp7_;
	GdkPixbuf* _tmp8_;
	PixbufCacheFetchJob* job = NULL;
	GeeHashMap* _tmp9_;
	Photo* _tmp10_;
	gpointer _tmp11_;
	PixbufCacheFetchJob* _tmp12_;
	GdkPixbuf* _tmp22_ = NULL;
	Photo* _tmp23_;
	Scaling _tmp24_;
	GdkPixbuf* _tmp25_;
	GdkPixbuf* _tmp26_;
	Photo* _tmp27_;
	GdkPixbuf* _tmp28_;
	GError * _inner_error_ = NULL;
#line 129 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PIXBUF_CACHE (self), NULL);
#line 129 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PHOTO (photo), NULL);
#line 130 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = photo;
#line 130 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = photo_get_actual_file (_tmp0_);
#line 130 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = _tmp1_;
#line 130 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = g_file_query_exists (_tmp2_, NULL);
#line 130 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = !_tmp3_;
#line 130 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (_tmp2_);
#line 130 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp4_) {
#line 699 "PixbufCache.c"
		Photo* _tmp5_;
#line 131 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp5_ = photo;
#line 131 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		pixbuf_cache_decache (self, _tmp5_);
#line 705 "PixbufCache.c"
	}
#line 133 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp6_ = photo;
#line 133 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp7_ = pixbuf_cache_get_cached (self, _tmp6_);
#line 133 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf = _tmp7_;
#line 134 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp8_ = pixbuf;
#line 134 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp8_ != NULL) {
#line 139 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		result = pixbuf;
#line 139 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return result;
#line 721 "PixbufCache.c"
	}
#line 142 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp9_ = self->priv->in_progress;
#line 142 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp10_ = photo;
#line 142 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp11_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp10_);
#line 142 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	job = (PixbufCacheFetchJob*) _tmp11_;
#line 143 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp12_ = job;
#line 143 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp12_ != NULL) {
#line 735 "PixbufCache.c"
		PixbufCacheFetchJob* _tmp13_;
		PixbufCacheFetchJob* _tmp14_;
		GError* _tmp15_;
		PixbufCacheFetchJob* _tmp19_;
		GdkPixbuf* _tmp20_;
		GdkPixbuf* _tmp21_;
#line 144 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp13_ = job;
#line 144 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		background_job_wait_for_completion (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_BACKGROUND_JOB, BackgroundJob));
#line 145 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp14_ = job;
#line 145 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp15_ = _tmp14_->err;
#line 145 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		if (_tmp15_ != NULL) {
#line 752 "PixbufCache.c"
			PixbufCacheFetchJob* _tmp16_;
			GError* _tmp17_;
			GError* _tmp18_;
#line 146 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp16_ = job;
#line 146 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp17_ = _tmp16_->err;
#line 146 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp18_ = _g_error_copy0 (_tmp17_);
#line 146 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_inner_error_ = _tmp18_;
#line 146 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			g_propagate_error (error, _inner_error_);
#line 146 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_background_job_unref0 (job);
#line 146 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_g_object_unref0 (pixbuf);
#line 146 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			return NULL;
#line 772 "PixbufCache.c"
		}
#line 148 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp19_ = job;
#line 148 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp20_ = _tmp19_->pixbuf;
#line 148 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp21_ = _g_object_ref0 (_tmp20_);
#line 148 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		result = _tmp21_;
#line 148 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_background_job_unref0 (job);
#line 148 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (pixbuf);
#line 148 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return result;
#line 788 "PixbufCache.c"
	}
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp23_ = photo;
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp24_ = self->priv->scaling;
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp25_ = photo_source_get_pixbuf (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, TYPE_PHOTO_SOURCE, PhotoSource), &_tmp24_, &_inner_error_);
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp22_ = _tmp25_;
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_propagate_error (error, _inner_error_);
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_background_job_unref0 (job);
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (pixbuf);
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return NULL;
#line 808 "PixbufCache.c"
	}
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp26_ = _tmp22_;
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp22_ = NULL;
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (pixbuf);
#line 155 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf = _tmp26_;
#line 157 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp27_ = photo;
#line 157 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp28_ = pixbuf;
#line 157 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_encache (self, _tmp27_, _tmp28_);
#line 159 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	result = pixbuf;
#line 159 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (_tmp22_);
#line 159 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_background_job_unref0 (job);
#line 159 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return result;
#line 832 "PixbufCache.c"
}


void pixbuf_cache_drop (PixbufCache* self, Photo* photo) {
	Photo* _tmp0_;
	Photo* _tmp1_;
#line 165 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 165 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PHOTO (photo));
#line 166 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = photo;
#line 166 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_cancel_prefetch (self, _tmp0_);
#line 167 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = photo;
#line 167 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_decache (self, _tmp1_);
#line 851 "PixbufCache.c"
}


static void _pixbuf_cache_on_fetched_completion_callback (BackgroundJob* job, gpointer self) {
#line 192 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_on_fetched ((PixbufCache*) self, job);
#line 858 "PixbufCache.c"
}


void pixbuf_cache_prefetch (PixbufCache* self, Photo* photo, BackgroundJobJobPriority priority, gboolean force) {
	Photo* _tmp0_;
	GFile* _tmp1_;
	GFile* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp6_ = FALSE;
	gboolean _tmp7_;
	GeeHashMap* _tmp12_;
	Photo* _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_ = FALSE;
	PixbufCacheCacheFilter _tmp16_;
	void* _tmp16__target;
	PixbufCacheFetchJob* job = NULL;
	PixbufCachePhotoType _tmp20_;
	GeeHashMap* _tmp30_;
	Photo* _tmp31_;
	PixbufCacheFetchJob* _tmp32_;
	Workers* _tmp33_;
	PixbufCacheFetchJob* _tmp34_;
#line 172 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 172 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PHOTO (photo));
#line 174 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = photo;
#line 174 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = photo_get_actual_file (_tmp0_);
#line 174 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = _tmp1_;
#line 174 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = g_file_query_exists (_tmp2_, NULL);
#line 174 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = !_tmp3_;
#line 174 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (_tmp2_);
#line 174 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp4_) {
#line 901 "PixbufCache.c"
		Photo* _tmp5_;
#line 175 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp5_ = photo;
#line 175 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		pixbuf_cache_decache (self, _tmp5_);
#line 907 "PixbufCache.c"
	}
#line 177 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp7_ = force;
#line 177 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (!_tmp7_) {
#line 913 "PixbufCache.c"
		GeeHashMap* _tmp8_;
		Photo* _tmp9_;
		gboolean _tmp10_;
#line 177 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp8_ = self->priv->cache;
#line 177 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp9_ = photo;
#line 177 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp10_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp9_);
#line 177 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp6_ = _tmp10_;
#line 925 "PixbufCache.c"
	} else {
#line 177 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp6_ = FALSE;
#line 929 "PixbufCache.c"
	}
#line 177 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp6_) {
#line 933 "PixbufCache.c"
		Photo* _tmp11_;
#line 178 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp11_ = photo;
#line 178 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		pixbuf_cache_prioritize (self, _tmp11_);
#line 180 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return;
#line 941 "PixbufCache.c"
	}
#line 183 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp12_ = self->priv->in_progress;
#line 183 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp13_ = photo;
#line 183 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp14_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp13_);
#line 183 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp14_) {
#line 184 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return;
#line 953 "PixbufCache.c"
	}
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp16_ = self->priv->filter;
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp16__target = self->priv->filter_target;
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp16_ != NULL) {
#line 961 "PixbufCache.c"
		PixbufCacheCacheFilter _tmp17_;
		void* _tmp17__target;
		Photo* _tmp18_;
		gboolean _tmp19_;
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp17_ = self->priv->filter;
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp17__target = self->priv->filter_target;
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp18_ = photo;
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp19_ = _tmp17_ (_tmp18_, _tmp17__target);
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp15_ = !_tmp19_;
#line 976 "PixbufCache.c"
	} else {
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp15_ = FALSE;
#line 980 "PixbufCache.c"
	}
#line 186 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp15_) {
#line 187 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return;
#line 986 "PixbufCache.c"
	}
#line 189 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	job = NULL;
#line 190 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp20_ = self->priv->type;
#line 190 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	switch (_tmp20_) {
#line 190 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		case PIXBUF_CACHE_PHOTO_TYPE_BASELINE:
#line 996 "PixbufCache.c"
		{
			BackgroundJobJobPriority _tmp21_;
			Photo* _tmp22_;
			Scaling _tmp23_;
			PixbufCacheBaselineFetchJob* _tmp24_;
#line 192 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp21_ = priority;
#line 192 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp22_ = photo;
#line 192 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp23_ = self->priv->scaling;
#line 192 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp24_ = pixbuf_cache_baseline_fetch_job_new (self, _tmp21_, _tmp22_, &_tmp23_, _pixbuf_cache_on_fetched_completion_callback, self);
#line 192 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_background_job_unref0 (job);
#line 192 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			job = G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob);
#line 193 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			break;
#line 1016 "PixbufCache.c"
		}
#line 190 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		case PIXBUF_CACHE_PHOTO_TYPE_MASTER:
#line 1020 "PixbufCache.c"
		{
			BackgroundJobJobPriority _tmp25_;
			Photo* _tmp26_;
			Scaling _tmp27_;
			PixbufCacheMasterFetchJob* _tmp28_;
#line 196 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp25_ = priority;
#line 196 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp26_ = photo;
#line 196 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp27_ = self->priv->scaling;
#line 196 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp28_ = pixbuf_cache_master_fetch_job_new (self, _tmp25_, _tmp26_, &_tmp27_, _pixbuf_cache_on_fetched_completion_callback, self);
#line 196 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_background_job_unref0 (job);
#line 196 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			job = G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob);
#line 197 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			break;
#line 1040 "PixbufCache.c"
		}
		default:
		{
			PixbufCachePhotoType _tmp29_;
#line 200 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp29_ = self->priv->type;
#line 200 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			g_error ("PixbufCache.vala:200: Unknown photo type: %d", (gint) _tmp29_);
#line 1049 "PixbufCache.c"
		}
	}
#line 203 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp30_ = self->priv->in_progress;
#line 203 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp31_ = photo;
#line 203 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp32_ = job;
#line 203 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp31_, _tmp32_);
#line 205 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp33_ = pixbuf_cache_background_workers;
#line 205 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp34_ = job;
#line 205 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	workers_enqueue (_tmp33_, G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, TYPE_BACKGROUND_JOB, BackgroundJob));
#line 172 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_background_job_unref0 (job);
#line 1068 "PixbufCache.c"
}


void pixbuf_cache_prefetch_many (PixbufCache* self, GeeCollection* photos, BackgroundJobJobPriority priority, gboolean force) {
#line 210 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 210 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (GEE_IS_COLLECTION (photos));
#line 1077 "PixbufCache.c"
	{
		GeeIterator* _photo_it = NULL;
		GeeCollection* _tmp0_;
		GeeIterator* _tmp1_;
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp0_ = photos;
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp1_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ITERABLE, GeeIterable));
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_photo_it = _tmp1_;
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		while (TRUE) {
#line 1090 "PixbufCache.c"
			GeeIterator* _tmp2_;
			gboolean _tmp3_;
			Photo* photo = NULL;
			GeeIterator* _tmp4_;
			gpointer _tmp5_;
			Photo* _tmp6_;
			BackgroundJobJobPriority _tmp7_;
			gboolean _tmp8_;
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp2_ = _photo_it;
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp3_ = gee_iterator_next (_tmp2_);
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			if (!_tmp3_) {
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				break;
#line 1107 "PixbufCache.c"
			}
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp4_ = _photo_it;
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp5_ = gee_iterator_get (_tmp4_);
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			photo = (Photo*) _tmp5_;
#line 213 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp6_ = photo;
#line 213 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp7_ = priority;
#line 213 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp8_ = force;
#line 213 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			pixbuf_cache_prefetch (self, _tmp6_, _tmp7_, _tmp8_);
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_g_object_unref0 (photo);
#line 1125 "PixbufCache.c"
		}
#line 212 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_photo_it);
#line 1129 "PixbufCache.c"
	}
}


void pixbuf_cache_prefetch_batch (PixbufCache* self, PixbufCachePixbufCacheBatch* batch, gboolean force) {
#line 217 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 217 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (PIXBUF_CACHE_IS_PIXBUF_CACHE_BATCH (batch));
#line 1139 "PixbufCache.c"
	{
		GeeIterator* _priority_it = NULL;
		PixbufCachePixbufCacheBatch* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp0_ = batch;
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp1_ = gee_multi_map_get_keys (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_MULTI_MAP, GeeMultiMap));
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp2_ = _tmp1_;
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp3_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ITERABLE, GeeIterable));
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp4_ = _tmp3_;
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_tmp2_);
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_priority_it = _tmp4_;
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		while (TRUE) {
#line 1163 "PixbufCache.c"
			GeeIterator* _tmp5_;
			gboolean _tmp6_;
			BackgroundJobJobPriority priority = 0;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp5_ = _priority_it;
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp6_ = gee_iterator_next (_tmp5_);
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			if (!_tmp6_) {
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				break;
#line 1177 "PixbufCache.c"
			}
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp7_ = _priority_it;
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp8_ = gee_iterator_get (_tmp7_);
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			priority = (BackgroundJobJobPriority) ((gintptr) _tmp8_);
#line 1185 "PixbufCache.c"
			{
				GeeIterator* _photo_it = NULL;
				PixbufCachePixbufCacheBatch* _tmp9_;
				BackgroundJobJobPriority _tmp10_;
				GeeCollection* _tmp11_;
				GeeCollection* _tmp12_;
				GeeIterator* _tmp13_;
				GeeIterator* _tmp14_;
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp9_ = batch;
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp10_ = priority;
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp11_ = gee_multi_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_MULTI_MAP, GeeMultiMap), (gpointer) ((gintptr) _tmp10_));
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp12_ = _tmp11_;
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp13_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, GEE_TYPE_ITERABLE, GeeIterable));
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp14_ = _tmp13_;
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_g_object_unref0 (_tmp12_);
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_photo_it = _tmp14_;
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				while (TRUE) {
#line 1212 "PixbufCache.c"
					GeeIterator* _tmp15_;
					gboolean _tmp16_;
					Photo* photo = NULL;
					GeeIterator* _tmp17_;
					gpointer _tmp18_;
					Photo* _tmp19_;
					BackgroundJobJobPriority _tmp20_;
					gboolean _tmp21_;
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_tmp15_ = _photo_it;
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_tmp16_ = gee_iterator_next (_tmp15_);
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					if (!_tmp16_) {
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
						break;
#line 1229 "PixbufCache.c"
					}
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_tmp17_ = _photo_it;
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_tmp18_ = gee_iterator_get (_tmp17_);
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					photo = (Photo*) _tmp18_;
#line 220 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_tmp19_ = photo;
#line 220 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_tmp20_ = priority;
#line 220 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_tmp21_ = force;
#line 220 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					pixbuf_cache_prefetch (self, _tmp19_, _tmp20_, _tmp21_);
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_g_object_unref0 (photo);
#line 1247 "PixbufCache.c"
				}
#line 219 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_g_object_unref0 (_photo_it);
#line 1251 "PixbufCache.c"
			}
		}
#line 218 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_priority_it);
#line 1256 "PixbufCache.c"
	}
}


gboolean pixbuf_cache_cancel_prefetch (PixbufCache* self, Photo* photo) {
	gboolean result = FALSE;
	PixbufCacheFetchJob* job = NULL;
	GeeHashMap* _tmp0_;
	Photo* _tmp1_;
	gpointer _tmp2_;
	PixbufCacheFetchJob* _tmp3_;
	gboolean removed = FALSE;
	GeeHashMap* _tmp4_;
	Photo* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	PixbufCacheFetchJob* _tmp8_;
#line 224 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PIXBUF_CACHE (self), FALSE);
#line 224 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PHOTO (photo), FALSE);
#line 225 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = self->priv->in_progress;
#line 225 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = photo;
#line 225 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_);
#line 225 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	job = (PixbufCacheFetchJob*) _tmp2_;
#line 226 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = job;
#line 226 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp3_ == NULL) {
#line 227 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		result = FALSE;
#line 227 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_background_job_unref0 (job);
#line 227 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return result;
#line 1296 "PixbufCache.c"
	}
#line 230 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = self->priv->in_progress;
#line 230 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp5_ = photo;
#line 230 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp6_ = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp5_, NULL);
#line 230 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	removed = _tmp6_;
#line 231 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp7_ = removed;
#line 231 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_vala_assert (_tmp7_, "removed");
#line 233 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp8_ = job;
#line 233 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	background_job_cancel (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_BACKGROUND_JOB, BackgroundJob));
#line 239 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	result = TRUE;
#line 239 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_background_job_unref0 (job);
#line 239 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return result;
#line 1320 "PixbufCache.c"
}


void pixbuf_cache_cancel_all (PixbufCache* self) {
	GeeHashMap* _tmp11_;
#line 242 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 1328 "PixbufCache.c"
	{
		GeeIterator* _job_it = NULL;
		GeeHashMap* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp0_ = self->priv->in_progress;
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp1_ = gee_abstract_map_get_values (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp2_ = _tmp1_;
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp3_ = _tmp2_;
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp5_ = _tmp4_;
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_tmp3_);
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_job_it = _tmp5_;
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		while (TRUE) {
#line 1355 "PixbufCache.c"
			GeeIterator* _tmp6_;
			gboolean _tmp7_;
			PixbufCacheFetchJob* job = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			PixbufCacheFetchJob* _tmp10_;
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp6_ = _job_it;
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			if (!_tmp7_) {
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				break;
#line 1370 "PixbufCache.c"
			}
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp8_ = _job_it;
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			job = (PixbufCacheFetchJob*) _tmp9_;
#line 247 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp10_ = job;
#line 247 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			background_job_cancel (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_BACKGROUND_JOB, BackgroundJob));
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_background_job_unref0 (job);
#line 1384 "PixbufCache.c"
		}
#line 246 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_job_it);
#line 1388 "PixbufCache.c"
	}
#line 249 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp11_ = self->priv->in_progress;
#line 249 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	gee_abstract_map_clear (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
#line 1394 "PixbufCache.c"
}


static gpointer _background_job_ref0 (gpointer self) {
#line 253 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return self ? background_job_ref (self) : NULL;
#line 1401 "PixbufCache.c"
}


static void pixbuf_cache_on_fetched (PixbufCache* self, BackgroundJob* j) {
	PixbufCacheFetchJob* job = NULL;
	BackgroundJob* _tmp0_;
	PixbufCacheFetchJob* _tmp1_;
	GeeHashMap* _tmp2_;
	PixbufCacheFetchJob* _tmp3_;
	Photo* _tmp4_;
	PixbufCacheFetchJob* _tmp5_;
	GError* _tmp6_;
	PixbufCacheFetchJob* _tmp20_;
	Photo* _tmp21_;
	PixbufCacheFetchJob* _tmp22_;
	GdkPixbuf* _tmp23_;
	PixbufCacheFetchJob* _tmp24_;
	Photo* _tmp25_;
	PixbufCacheFetchJob* _tmp26_;
	GdkPixbuf* _tmp27_;
#line 252 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 252 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_BACKGROUND_JOB (j));
#line 253 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = j;
#line 253 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = _background_job_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob));
#line 253 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	job = _tmp1_;
#line 257 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = self->priv->in_progress;
#line 257 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = job;
#line 257 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = _tmp3_->photo;
#line 257 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp4_, NULL);
#line 259 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp5_ = job;
#line 259 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp6_ = _tmp5_->err;
#line 259 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp6_ != NULL) {
#line 1446 "PixbufCache.c"
		PixbufCacheFetchJob* _tmp7_;
		GdkPixbuf* _tmp8_;
		PixbufCacheFetchJob* _tmp9_;
		Photo* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		PixbufCacheFetchJob* _tmp13_;
		GError* _tmp14_;
		const gchar* _tmp15_;
		PixbufCacheFetchJob* _tmp16_;
		Photo* _tmp17_;
		PixbufCacheFetchJob* _tmp18_;
		GError* _tmp19_;
#line 260 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp7_ = job;
#line 260 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp8_ = _tmp7_->pixbuf;
#line 260 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_vala_assert (_tmp8_ == NULL, "job.pixbuf == null");
#line 262 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp9_ = job;
#line 262 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp10_ = _tmp9_->photo;
#line 262 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp11_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_DATA_OBJECT, DataObject));
#line 262 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp12_ = _tmp11_;
#line 262 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp13_ = job;
#line 262 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp14_ = _tmp13_->err;
#line 262 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp15_ = _tmp14_->message;
#line 262 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_critical ("PixbufCache.vala:262: Unable to readahead %s: %s", _tmp12_, _tmp15_);
#line 262 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_free0 (_tmp12_);
#line 263 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp16_ = job;
#line 263 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp17_ = _tmp16_->photo;
#line 263 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp18_ = job;
#line 263 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp19_ = _tmp18_->err;
#line 263 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_signal_emit (self, pixbuf_cache_signals[PIXBUF_CACHE_FETCHED_SIGNAL], 0, _tmp17_, NULL, _tmp19_);
#line 265 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_background_job_unref0 (job);
#line 265 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return;
#line 1498 "PixbufCache.c"
	}
#line 272 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp20_ = job;
#line 272 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp21_ = _tmp20_->photo;
#line 272 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp22_ = job;
#line 272 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp23_ = _tmp22_->pixbuf;
#line 272 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_encache (self, _tmp21_, _tmp23_);
#line 275 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp24_ = job;
#line 275 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp25_ = _tmp24_->photo;
#line 275 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp26_ = job;
#line 275 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp27_ = _tmp26_->pixbuf;
#line 275 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_signal_emit (self, pixbuf_cache_signals[PIXBUF_CACHE_FETCHED_SIGNAL], 0, _tmp25_, _tmp27_, NULL);
#line 252 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_background_job_unref0 (job);
#line 1522 "PixbufCache.c"
}


static void pixbuf_cache_on_sources_altered (PixbufCache* self, GeeMap* map) {
#line 278 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 278 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (GEE_IS_MAP (map));
#line 1531 "PixbufCache.c"
	{
		GeeIterator* _object_it = NULL;
		GeeMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp0_ = map;
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp1_ = gee_map_get_keys (_tmp0_);
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp2_ = _tmp1_;
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp3_ = _tmp2_;
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp4_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ITERABLE, GeeIterable));
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp5_ = _tmp4_;
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_tmp3_);
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_object_it = _tmp5_;
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		while (TRUE) {
#line 1558 "PixbufCache.c"
			GeeIterator* _tmp6_;
			gboolean _tmp7_;
			DataObject* object = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			GeeMap* _tmp10_;
			DataObject* _tmp11_;
			gpointer _tmp12_;
			Alteration* _tmp13_;
			gboolean _tmp14_;
			gboolean _tmp15_;
			Photo* photo = NULL;
			DataObject* _tmp16_;
			Photo* _tmp17_;
			GeeHashMap* _tmp18_;
			Photo* _tmp19_;
			gboolean _tmp20_;
			Photo* _tmp30_;
			Photo* _tmp31_;
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp6_ = _object_it;
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp7_ = gee_iterator_next (_tmp6_);
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			if (!_tmp7_) {
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				break;
#line 1586 "PixbufCache.c"
			}
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp8_ = _object_it;
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp9_ = gee_iterator_get (_tmp8_);
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			object = (DataObject*) _tmp9_;
#line 280 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp10_ = map;
#line 280 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp11_ = object;
#line 280 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp12_ = gee_map_get (_tmp10_, _tmp11_);
#line 280 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp13_ = (Alteration*) _tmp12_;
#line 280 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp14_ = alteration_has_subject (_tmp13_, "image");
#line 280 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp15_ = !_tmp14_;
#line 280 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_alteration_unref0 (_tmp13_);
#line 280 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			if (_tmp15_) {
#line 281 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_g_object_unref0 (object);
#line 281 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				continue;
#line 1614 "PixbufCache.c"
			}
#line 283 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp16_ = object;
#line 283 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_PHOTO, Photo));
#line 283 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			photo = _tmp17_;
#line 285 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp18_ = self->priv->in_progress;
#line 285 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp19_ = photo;
#line 285 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp20_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp19_);
#line 285 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			if (_tmp20_) {
#line 1630 "PixbufCache.c"
				GeeHashMap* _tmp21_;
				Photo* _tmp22_;
				gpointer _tmp23_;
				PixbufCacheFetchJob* _tmp24_;
				GeeHashMap* _tmp25_;
				Photo* _tmp26_;
#line 288 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp21_ = self->priv->in_progress;
#line 288 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp22_ = photo;
#line 288 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp23_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp22_);
#line 288 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp24_ = (PixbufCacheFetchJob*) _tmp23_;
#line 288 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				background_job_cancel (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, TYPE_BACKGROUND_JOB, BackgroundJob));
#line 288 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_background_job_unref0 (_tmp24_);
#line 289 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp25_ = self->priv->in_progress;
#line 289 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp26_ = photo;
#line 289 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp26_, NULL);
#line 1655 "PixbufCache.c"
			} else {
				GeeHashMap* _tmp27_;
				Photo* _tmp28_;
				gboolean _tmp29_;
#line 290 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp27_ = self->priv->cache;
#line 290 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp28_ = photo;
#line 290 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				_tmp29_ = gee_abstract_map_has_key (G_TYPE_CHECK_INSTANCE_CAST (_tmp27_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp28_);
#line 290 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				if (!_tmp29_) {
#line 291 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_g_object_unref0 (photo);
#line 291 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					_g_object_unref0 (object);
#line 291 "/home/jens/Source/shotwell/src/PixbufCache.vala"
					continue;
#line 1674 "PixbufCache.c"
				}
			}
#line 294 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp30_ = photo;
#line 294 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			pixbuf_cache_decache (self, _tmp30_);
#line 301 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp31_ = photo;
#line 301 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			pixbuf_cache_prefetch (self, _tmp31_, BACKGROUND_JOB_JOB_PRIORITY_HIGH, FALSE);
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_g_object_unref0 (photo);
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_g_object_unref0 (object);
#line 1689 "PixbufCache.c"
		}
#line 279 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_object_it);
#line 1693 "PixbufCache.c"
	}
}


static void pixbuf_cache_on_sources_removed (PixbufCache* self, GeeIterable* removed) {
#line 305 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 305 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (GEE_IS_ITERABLE (removed));
#line 1703 "PixbufCache.c"
	{
		GeeIterator* _object_it = NULL;
		GeeIterable* _tmp0_;
		GeeIterator* _tmp1_;
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp0_ = removed;
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp1_ = gee_iterable_iterator (_tmp0_);
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_object_it = _tmp1_;
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		while (TRUE) {
#line 1716 "PixbufCache.c"
			GeeIterator* _tmp2_;
			gboolean _tmp3_;
			DataObject* object = NULL;
			GeeIterator* _tmp4_;
			gpointer _tmp5_;
			Photo* photo = NULL;
			DataObject* _tmp6_;
			Photo* _tmp7_;
			Photo* _tmp8_;
			Photo* _tmp9_;
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp2_ = _object_it;
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp3_ = gee_iterator_next (_tmp2_);
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			if (!_tmp3_) {
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				break;
#line 1735 "PixbufCache.c"
			}
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp4_ = _object_it;
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp5_ = gee_iterator_get (_tmp4_);
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			object = (DataObject*) _tmp5_;
#line 307 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp6_ = object;
#line 307 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, TYPE_PHOTO) ? ((Photo*) _tmp6_) : NULL);
#line 307 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			photo = _tmp7_;
#line 308 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp8_ = photo;
#line 308 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_vala_assert (_tmp8_ != NULL, "photo != null");
#line 310 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp9_ = photo;
#line 310 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			pixbuf_cache_decache (self, _tmp9_);
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_g_object_unref0 (photo);
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_g_object_unref0 (object);
#line 1761 "PixbufCache.c"
		}
#line 306 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_object_it);
#line 1765 "PixbufCache.c"
	}
}


static GdkPixbuf* pixbuf_cache_get_cached (PixbufCache* self, Photo* photo) {
	GdkPixbuf* result = NULL;
	GdkPixbuf* pixbuf = NULL;
	GeeHashMap* _tmp0_;
	Photo* _tmp1_;
	gpointer _tmp2_;
	GdkPixbuf* _tmp3_;
#line 314 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PIXBUF_CACHE (self), NULL);
#line 314 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PHOTO (photo), NULL);
#line 315 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = self->priv->cache;
#line 315 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = photo;
#line 315 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = gee_abstract_map_get (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_);
#line 315 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf = (GdkPixbuf*) _tmp2_;
#line 316 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = pixbuf;
#line 316 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp3_ != NULL) {
#line 1793 "PixbufCache.c"
		Photo* _tmp4_;
#line 317 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp4_ = photo;
#line 317 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		pixbuf_cache_prioritize (self, _tmp4_);
#line 1799 "PixbufCache.c"
	}
#line 319 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	result = pixbuf;
#line 319 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return result;
#line 1805 "PixbufCache.c"
}


static void pixbuf_cache_prioritize (PixbufCache* self, Photo* photo) {
	gint index = 0;
	GeeArrayList* _tmp0_;
	Photo* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
#line 323 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 323 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PHOTO (photo));
#line 324 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = self->priv->lru;
#line 324 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = photo;
#line 324 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = gee_abstract_list_index_of (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _tmp1_);
#line 324 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	index = _tmp2_;
#line 325 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = index;
#line 325 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_vala_assert (_tmp3_ >= 0, "index >= 0");
#line 327 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = index;
#line 327 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp4_ > 0) {
#line 1836 "PixbufCache.c"
		GeeArrayList* _tmp5_;
		gint _tmp6_;
		gpointer _tmp7_;
		Photo* _tmp8_;
		GeeArrayList* _tmp9_;
		Photo* _tmp10_;
#line 328 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp5_ = self->priv->lru;
#line 328 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp6_ = index;
#line 328 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp7_ = gee_abstract_list_remove_at (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _tmp6_);
#line 328 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp8_ = (Photo*) _tmp7_;
#line 328 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_tmp8_);
#line 329 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp9_ = self->priv->lru;
#line 329 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp10_ = photo;
#line 329 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		gee_abstract_list_insert (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), 0, _tmp10_);
#line 1859 "PixbufCache.c"
	}
}


static void pixbuf_cache_encache (PixbufCache* self, Photo* photo, GdkPixbuf* pixbuf) {
	Photo* _tmp0_;
	GeeHashMap* _tmp1_;
	Photo* _tmp2_;
	GdkPixbuf* _tmp3_;
	GeeArrayList* _tmp4_;
	Photo* _tmp5_;
	GeeArrayList* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	GeeHashMap* _tmp23_;
	gint _tmp24_;
	gint _tmp25_;
#line 333 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 333 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PHOTO (photo));
#line 333 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
#line 335 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = photo;
#line 335 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_decache (self, _tmp0_);
#line 337 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = self->priv->cache;
#line 337 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = photo;
#line 337 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = pixbuf;
#line 337 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	gee_abstract_map_set (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp2_, _tmp3_);
#line 338 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = self->priv->lru;
#line 338 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp5_ = photo;
#line 338 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	gee_abstract_list_insert (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), 0, _tmp5_);
#line 340 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	while (TRUE) {
#line 1903 "PixbufCache.c"
		GeeArrayList* _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		Photo* cached_photo = NULL;
		GeeArrayList* _tmp10_;
		GeeArrayList* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gpointer _tmp14_;
		Photo* _tmp15_;
		gboolean removed = FALSE;
		GeeHashMap* _tmp16_;
		Photo* _tmp17_;
		gboolean _tmp18_;
		gboolean _tmp19_;
#line 340 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp6_ = self->priv->lru;
#line 340 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp7_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
#line 340 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp8_ = _tmp7_;
#line 340 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp9_ = self->priv->max_count;
#line 340 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		if (!(_tmp8_ > _tmp9_)) {
#line 340 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			break;
#line 1932 "PixbufCache.c"
		}
#line 341 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp10_ = self->priv->lru;
#line 341 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp11_ = self->priv->lru;
#line 341 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp12_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
#line 341 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp13_ = _tmp12_;
#line 341 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp14_ = gee_abstract_list_remove_at (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GEE_TYPE_ABSTRACT_LIST, GeeAbstractList), _tmp13_ - 1);
#line 341 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		cached_photo = (Photo*) _tmp14_;
#line 342 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp15_ = cached_photo;
#line 342 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_vala_assert (_tmp15_ != NULL, "cached_photo != null");
#line 344 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp16_ = self->priv->cache;
#line 344 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp17_ = cached_photo;
#line 344 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp18_ = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp17_, NULL);
#line 344 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		removed = _tmp18_;
#line 345 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp19_ = removed;
#line 345 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_vala_assert (_tmp19_, "removed");
#line 340 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (cached_photo);
#line 1964 "PixbufCache.c"
	}
#line 348 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp20_ = self->priv->lru;
#line 348 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp21_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
#line 348 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp22_ = _tmp21_;
#line 348 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp23_ = self->priv->cache;
#line 348 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp24_ = gee_abstract_map_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
#line 348 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp25_ = _tmp24_;
#line 348 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_vala_assert (_tmp22_ == _tmp25_, "lru.size == cache.size");
#line 1980 "PixbufCache.c"
}


static void pixbuf_cache_decache (PixbufCache* self, Photo* photo) {
	GeeHashMap* _tmp0_;
	Photo* _tmp1_;
	gboolean _tmp2_;
	gboolean removed = FALSE;
	GeeArrayList* _tmp6_;
	Photo* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
#line 351 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PIXBUF_CACHE (self));
#line 351 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (IS_PHOTO (photo));
#line 352 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = self->priv->cache;
#line 352 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = photo;
#line 352 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = gee_abstract_map_unset (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap), _tmp1_, NULL);
#line 352 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (!_tmp2_) {
#line 2005 "PixbufCache.c"
		GeeArrayList* _tmp3_;
		Photo* _tmp4_;
		gboolean _tmp5_;
#line 353 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp3_ = self->priv->lru;
#line 353 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp4_ = photo;
#line 353 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp5_ = gee_abstract_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp4_);
#line 353 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_vala_assert (!_tmp5_, "!lru.contains(photo)");
#line 355 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return;
#line 2019 "PixbufCache.c"
	}
#line 358 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp6_ = self->priv->lru;
#line 358 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp7_ = photo;
#line 358 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp8_ = gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp7_);
#line 358 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	removed = _tmp8_;
#line 359 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp9_ = removed;
#line 359 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_vala_assert (_tmp9_, "removed");
#line 2033 "PixbufCache.c"
}


static void g_cclosure_user_marshal_VOID__OBJECT_OBJECT_POINTER (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
	typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT_POINTER) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer data2);
	register GMarshalFunc_VOID__OBJECT_OBJECT_POINTER callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_if_fail (n_param_values == 4);
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (G_CCLOSURE_SWAP_DATA (closure)) {
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		data1 = closure->data;
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		data2 = param_values->data[0].v_pointer;
#line 2052 "PixbufCache.c"
	} else {
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		data1 = param_values->data[0].v_pointer;
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		data2 = closure->data;
#line 2058 "PixbufCache.c"
	}
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	callback = (GMarshalFunc_VOID__OBJECT_OBJECT_POINTER) (marshal_data ? marshal_data : cc->callback);
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	callback (data1, g_value_get_object (param_values + 1), g_value_get_object (param_values + 2), g_value_get_pointer (param_values + 3), data2);
#line 2064 "PixbufCache.c"
}


PixbufCachePixbufCacheBatch* pixbuf_cache_pixbuf_cache_batch_construct (GType object_type) {
	PixbufCachePixbufCacheBatch * self = NULL;
#line 17 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = (PixbufCachePixbufCacheBatch*) gee_tree_multi_map_construct (object_type, BACKGROUND_JOB_TYPE_JOB_PRIORITY, NULL, NULL, TYPE_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, (GCompareDataFunc) background_job_job_priority_compare_func, NULL, NULL, NULL, NULL, NULL);
#line 16 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return self;
#line 2074 "PixbufCache.c"
}


PixbufCachePixbufCacheBatch* pixbuf_cache_pixbuf_cache_batch_new (void) {
#line 16 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return pixbuf_cache_pixbuf_cache_batch_construct (PIXBUF_CACHE_TYPE_PIXBUF_CACHE_BATCH);
#line 2081 "PixbufCache.c"
}


static void pixbuf_cache_pixbuf_cache_batch_class_init (PixbufCachePixbufCacheBatchClass * klass) {
#line 15 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_pixbuf_cache_batch_parent_class = g_type_class_peek_parent (klass);
#line 2088 "PixbufCache.c"
}


static void pixbuf_cache_pixbuf_cache_batch_instance_init (PixbufCachePixbufCacheBatch * self) {
}


GType pixbuf_cache_pixbuf_cache_batch_get_type (void) {
	static volatile gsize pixbuf_cache_pixbuf_cache_batch_type_id__volatile = 0;
	if (g_once_init_enter (&pixbuf_cache_pixbuf_cache_batch_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PixbufCachePixbufCacheBatchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pixbuf_cache_pixbuf_cache_batch_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PixbufCachePixbufCacheBatch), 0, (GInstanceInitFunc) pixbuf_cache_pixbuf_cache_batch_instance_init, NULL };
		GType pixbuf_cache_pixbuf_cache_batch_type_id;
		pixbuf_cache_pixbuf_cache_batch_type_id = g_type_register_static (GEE_TYPE_TREE_MULTI_MAP, "PixbufCachePixbufCacheBatch", &g_define_type_info, 0);
		g_once_init_leave (&pixbuf_cache_pixbuf_cache_batch_type_id__volatile, pixbuf_cache_pixbuf_cache_batch_type_id);
	}
	return pixbuf_cache_pixbuf_cache_batch_type_id__volatile;
}


static PixbufCacheFetchJob* pixbuf_cache_fetch_job_construct (GType object_type, PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target) {
	PixbufCacheFetchJob* self = NULL;
	PixbufCache* _tmp0_;
	CompletionCallback _tmp1_;
	void* _tmp1__target;
	GCancellable* _tmp2_;
	GCancellable* _tmp3_;
	Semaphore* _tmp4_;
	Semaphore* _tmp5_;
	BackgroundJobJobPriority _tmp6_;
	Photo* _tmp7_;
	Photo* _tmp8_;
	Scaling _tmp9_;
#line 28 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PIXBUF_CACHE (owner), NULL);
#line 28 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PHOTO (photo), NULL);
#line 28 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = owner;
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = callback;
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1__target = callback_target;
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = g_cancellable_new ();
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = _tmp2_;
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = semaphore_new ();
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp5_ = _tmp4_;
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = (PixbufCacheFetchJob*) background_job_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, G_TYPE_OBJECT, GObject), _tmp1_, _tmp1__target, _tmp3_, NULL, NULL, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphore));
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_abstract_semaphore_unref0 (_tmp5_);
#line 30 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (_tmp3_);
#line 32 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp6_ = priority;
#line 32 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priority = _tmp6_;
#line 33 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp7_ = photo;
#line 33 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp8_ = _g_object_ref0 (_tmp7_);
#line 33 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (self->photo);
#line 33 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->photo = _tmp8_;
#line 34 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp9_ = *scaling;
#line 34 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->scaling = _tmp9_;
#line 28 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return self;
#line 2165 "PixbufCache.c"
}


static BackgroundJobJobPriority pixbuf_cache_fetch_job_real_get_priority (BackgroundJob* base) {
	PixbufCacheFetchJob * self;
	BackgroundJobJobPriority result = 0;
	BackgroundJobJobPriority _tmp0_;
#line 37 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob);
#line 38 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = self->priority;
#line 38 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	result = _tmp0_;
#line 38 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return result;
#line 2181 "PixbufCache.c"
}


static void pixbuf_cache_fetch_job_class_init (PixbufCacheFetchJobClass * klass) {
#line 21 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_fetch_job_parent_class = g_type_class_peek_parent (klass);
#line 21 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	((BackgroundJobClass *) klass)->finalize = pixbuf_cache_fetch_job_finalize;
#line 21 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	((BackgroundJobClass *) klass)->get_priority = (BackgroundJobJobPriority (*) (BackgroundJob *)) pixbuf_cache_fetch_job_real_get_priority;
#line 2192 "PixbufCache.c"
}


static void pixbuf_cache_fetch_job_instance_init (PixbufCacheFetchJob * self) {
#line 25 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->pixbuf = NULL;
#line 26 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->err = NULL;
#line 2201 "PixbufCache.c"
}


static void pixbuf_cache_fetch_job_finalize (BackgroundJob * obj) {
	PixbufCacheFetchJob * self;
#line 21 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob);
#line 23 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (self->photo);
#line 25 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (self->pixbuf);
#line 26 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_error_free0 (self->err);
#line 21 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	BACKGROUND_JOB_CLASS (pixbuf_cache_fetch_job_parent_class)->finalize (obj);
#line 2217 "PixbufCache.c"
}


static GType pixbuf_cache_fetch_job_get_type (void) {
	static volatile gsize pixbuf_cache_fetch_job_type_id__volatile = 0;
	if (g_once_init_enter (&pixbuf_cache_fetch_job_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PixbufCacheFetchJobClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pixbuf_cache_fetch_job_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PixbufCacheFetchJob), 0, (GInstanceInitFunc) pixbuf_cache_fetch_job_instance_init, NULL };
		GType pixbuf_cache_fetch_job_type_id;
		pixbuf_cache_fetch_job_type_id = g_type_register_static (TYPE_BACKGROUND_JOB, "PixbufCacheFetchJob", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&pixbuf_cache_fetch_job_type_id__volatile, pixbuf_cache_fetch_job_type_id);
	}
	return pixbuf_cache_fetch_job_type_id__volatile;
}


static PixbufCacheBaselineFetchJob* pixbuf_cache_baseline_fetch_job_construct (GType object_type, PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target) {
	PixbufCacheBaselineFetchJob* self = NULL;
	PixbufCache* _tmp0_;
	BackgroundJobJobPriority _tmp1_;
	Photo* _tmp2_;
	Scaling _tmp3_;
	CompletionCallback _tmp4_;
	void* _tmp4__target;
#line 43 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PIXBUF_CACHE (owner), NULL);
#line 43 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PHOTO (photo), NULL);
#line 43 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 45 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = owner;
#line 45 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = priority;
#line 45 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = photo;
#line 45 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = *scaling;
#line 45 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = callback;
#line 45 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4__target = callback_target;
#line 45 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = (PixbufCacheBaselineFetchJob*) pixbuf_cache_fetch_job_construct (object_type, _tmp0_, _tmp1_, _tmp2_, &_tmp3_, _tmp4_, _tmp4__target);
#line 43 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return self;
#line 2263 "PixbufCache.c"
}


static PixbufCacheBaselineFetchJob* pixbuf_cache_baseline_fetch_job_new (PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target) {
#line 43 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return pixbuf_cache_baseline_fetch_job_construct (PIXBUF_CACHE_TYPE_BASELINE_FETCH_JOB, owner, priority, photo, scaling, callback, callback_target);
#line 2270 "PixbufCache.c"
}


static void pixbuf_cache_baseline_fetch_job_real_execute (BackgroundJob* base) {
	PixbufCacheBaselineFetchJob * self;
	GError * _inner_error_ = NULL;
#line 48 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PIXBUF_CACHE_TYPE_BASELINE_FETCH_JOB, PixbufCacheBaselineFetchJob);
#line 2279 "PixbufCache.c"
	{
		GdkPixbuf* _tmp0_ = NULL;
		Photo* _tmp1_;
		Scaling _tmp2_;
		GdkPixbuf* _tmp3_;
		GdkPixbuf* _tmp4_;
#line 50 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->photo;
#line 50 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->scaling;
#line 50 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp3_ = photo_source_get_pixbuf (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PHOTO_SOURCE, PhotoSource), &_tmp2_, &_inner_error_);
#line 50 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp0_ = _tmp3_;
#line 50 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2296 "PixbufCache.c"
			goto __catch454_g_error;
		}
#line 50 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp4_ = _tmp0_;
#line 50 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp0_ = NULL;
#line 50 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->pixbuf);
#line 50 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->pixbuf = _tmp4_;
#line 49 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_tmp0_);
#line 2309 "PixbufCache.c"
	}
	goto __finally454;
	__catch454_g_error:
	{
		GError* err = NULL;
		GError* _tmp5_;
		GError* _tmp6_;
#line 49 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		err = _inner_error_;
#line 49 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_inner_error_ = NULL;
#line 52 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp5_ = err;
#line 52 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp6_ = _g_error_copy0 (_tmp5_);
#line 52 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_error_free0 (G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->err);
#line 52 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->err = _tmp6_;
#line 49 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_error_free0 (err);
#line 2331 "PixbufCache.c"
	}
	__finally454:
#line 49 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 49 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 49 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_clear_error (&_inner_error_);
#line 49 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return;
#line 2342 "PixbufCache.c"
	}
}


static void pixbuf_cache_baseline_fetch_job_class_init (PixbufCacheBaselineFetchJobClass * klass) {
#line 42 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_baseline_fetch_job_parent_class = g_type_class_peek_parent (klass);
#line 42 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	((BackgroundJobClass *) klass)->execute = (void (*) (BackgroundJob *)) pixbuf_cache_baseline_fetch_job_real_execute;
#line 2352 "PixbufCache.c"
}


static void pixbuf_cache_baseline_fetch_job_instance_init (PixbufCacheBaselineFetchJob * self) {
}


static GType pixbuf_cache_baseline_fetch_job_get_type (void) {
	static volatile gsize pixbuf_cache_baseline_fetch_job_type_id__volatile = 0;
	if (g_once_init_enter (&pixbuf_cache_baseline_fetch_job_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PixbufCacheBaselineFetchJobClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pixbuf_cache_baseline_fetch_job_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PixbufCacheBaselineFetchJob), 0, (GInstanceInitFunc) pixbuf_cache_baseline_fetch_job_instance_init, NULL };
		GType pixbuf_cache_baseline_fetch_job_type_id;
		pixbuf_cache_baseline_fetch_job_type_id = g_type_register_static (PIXBUF_CACHE_TYPE_FETCH_JOB, "PixbufCacheBaselineFetchJob", &g_define_type_info, 0);
		g_once_init_leave (&pixbuf_cache_baseline_fetch_job_type_id__volatile, pixbuf_cache_baseline_fetch_job_type_id);
	}
	return pixbuf_cache_baseline_fetch_job_type_id__volatile;
}


static PixbufCacheMasterFetchJob* pixbuf_cache_master_fetch_job_construct (GType object_type, PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target) {
	PixbufCacheMasterFetchJob* self = NULL;
	PixbufCache* _tmp0_;
	BackgroundJobJobPriority _tmp1_;
	Photo* _tmp2_;
	Scaling _tmp3_;
	CompletionCallback _tmp4_;
	void* _tmp4__target;
#line 58 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PIXBUF_CACHE (owner), NULL);
#line 58 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (IS_PHOTO (photo), NULL);
#line 58 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_return_val_if_fail (scaling != NULL, NULL);
#line 60 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = owner;
#line 60 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = priority;
#line 60 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = photo;
#line 60 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = *scaling;
#line 60 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4_ = callback;
#line 60 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp4__target = callback_target;
#line 60 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = (PixbufCacheMasterFetchJob*) pixbuf_cache_fetch_job_construct (object_type, _tmp0_, _tmp1_, _tmp2_, &_tmp3_, _tmp4_, _tmp4__target);
#line 58 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return self;
#line 2402 "PixbufCache.c"
}


static PixbufCacheMasterFetchJob* pixbuf_cache_master_fetch_job_new (PixbufCache* owner, BackgroundJobJobPriority priority, Photo* photo, Scaling* scaling, CompletionCallback callback, void* callback_target) {
#line 58 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	return pixbuf_cache_master_fetch_job_construct (PIXBUF_CACHE_TYPE_MASTER_FETCH_JOB, owner, priority, photo, scaling, callback, callback_target);
#line 2409 "PixbufCache.c"
}


static void pixbuf_cache_master_fetch_job_real_execute (BackgroundJob* base) {
	PixbufCacheMasterFetchJob * self;
	GError * _inner_error_ = NULL;
#line 63 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PIXBUF_CACHE_TYPE_MASTER_FETCH_JOB, PixbufCacheMasterFetchJob);
#line 2418 "PixbufCache.c"
	{
		GdkPixbuf* _tmp0_ = NULL;
		Photo* _tmp1_;
		Scaling _tmp2_;
		GdkPixbuf* _tmp3_;
		GdkPixbuf* _tmp4_;
#line 65 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->photo;
#line 65 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->scaling;
#line 65 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp3_ = photo_get_master_pixbuf (_tmp1_, &_tmp2_, TRUE, &_inner_error_);
#line 65 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp0_ = _tmp3_;
#line 65 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 2435 "PixbufCache.c"
			goto __catch455_g_error;
		}
#line 65 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp4_ = _tmp0_;
#line 65 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp0_ = NULL;
#line 65 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->pixbuf);
#line 65 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->pixbuf = _tmp4_;
#line 64 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_tmp0_);
#line 2448 "PixbufCache.c"
	}
	goto __finally455;
	__catch455_g_error:
	{
		GError* err = NULL;
		GError* _tmp5_;
		GError* _tmp6_;
#line 64 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		err = _inner_error_;
#line 64 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_inner_error_ = NULL;
#line 67 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp5_ = err;
#line 67 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp6_ = _g_error_copy0 (_tmp5_);
#line 67 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_error_free0 (G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->err);
#line 67 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		G_TYPE_CHECK_INSTANCE_CAST (self, PIXBUF_CACHE_TYPE_FETCH_JOB, PixbufCacheFetchJob)->err = _tmp6_;
#line 64 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_error_free0 (err);
#line 2470 "PixbufCache.c"
	}
	__finally455:
#line 64 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 64 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 64 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_clear_error (&_inner_error_);
#line 64 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		return;
#line 2481 "PixbufCache.c"
	}
}


static void pixbuf_cache_master_fetch_job_class_init (PixbufCacheMasterFetchJobClass * klass) {
#line 57 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_master_fetch_job_parent_class = g_type_class_peek_parent (klass);
#line 57 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	((BackgroundJobClass *) klass)->execute = (void (*) (BackgroundJob *)) pixbuf_cache_master_fetch_job_real_execute;
#line 2491 "PixbufCache.c"
}


static void pixbuf_cache_master_fetch_job_instance_init (PixbufCacheMasterFetchJob * self) {
}


static GType pixbuf_cache_master_fetch_job_get_type (void) {
	static volatile gsize pixbuf_cache_master_fetch_job_type_id__volatile = 0;
	if (g_once_init_enter (&pixbuf_cache_master_fetch_job_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PixbufCacheMasterFetchJobClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pixbuf_cache_master_fetch_job_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PixbufCacheMasterFetchJob), 0, (GInstanceInitFunc) pixbuf_cache_master_fetch_job_instance_init, NULL };
		GType pixbuf_cache_master_fetch_job_type_id;
		pixbuf_cache_master_fetch_job_type_id = g_type_register_static (PIXBUF_CACHE_TYPE_FETCH_JOB, "PixbufCacheMasterFetchJob", &g_define_type_info, 0);
		g_once_init_leave (&pixbuf_cache_master_fetch_job_type_id__volatile, pixbuf_cache_master_fetch_job_type_id);
	}
	return pixbuf_cache_master_fetch_job_type_id__volatile;
}


static void pixbuf_cache_class_init (PixbufCacheClass * klass) {
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_parent_class = g_type_class_peek_parent (klass);
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_type_class_add_private (klass, sizeof (PixbufCachePrivate));
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	G_OBJECT_CLASS (klass)->finalize = pixbuf_cache_finalize;
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	pixbuf_cache_signals[PIXBUF_CACHE_FETCHED_SIGNAL] = g_signal_new ("fetched", TYPE_PIXBUF_CACHE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_OBJECT_POINTER, G_TYPE_NONE, 3, TYPE_PHOTO, gdk_pixbuf_get_type (), G_TYPE_POINTER);
#line 2520 "PixbufCache.c"
}


static void pixbuf_cache_instance_init (PixbufCache * self) {
	GeeHashMap* _tmp0_;
	GeeArrayList* _tmp1_;
	GeeHashMap* _tmp2_;
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv = PIXBUF_CACHE_GET_PRIVATE (self);
#line 79 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = gee_hash_map_new (TYPE_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, gdk_pixbuf_get_type (), (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 79 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv->cache = _tmp0_;
#line 80 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp1_ = gee_array_list_new (TYPE_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
#line 80 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv->lru = _tmp1_;
#line 81 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp2_ = gee_hash_map_new (TYPE_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, PIXBUF_CACHE_TYPE_FETCH_JOB, (GBoxedCopyFunc) background_job_ref, (GDestroyNotify) background_job_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 81 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self->priv->in_progress = _tmp2_;
#line 2542 "PixbufCache.c"
}


static void pixbuf_cache_finalize (GObject * obj) {
	PixbufCache * self;
	PixbufCachePhotoType _tmp0_;
	SourceCollection* _tmp3_;
	guint _tmp4_;
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PIXBUF_CACHE, PixbufCache);
#line 110 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp0_ = self->priv->type;
#line 110 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	if (_tmp0_ != PIXBUF_CACHE_PHOTO_TYPE_MASTER) {
#line 2557 "PixbufCache.c"
		SourceCollection* _tmp1_;
		guint _tmp2_;
#line 111 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp1_ = self->priv->sources;
#line 111 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_signal_parse_name ("items-altered", TYPE_DATA_COLLECTION, &_tmp2_, NULL, FALSE);
#line 111 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _pixbuf_cache_on_sources_altered_data_collection_items_altered, self);
#line 2566 "PixbufCache.c"
	}
#line 112 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_tmp3_ = self->priv->sources;
#line 112 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_signal_parse_name ("items-removed", TYPE_DATA_COLLECTION, &_tmp4_, NULL, FALSE);
#line 112 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _pixbuf_cache_on_sources_removed_data_collection_items_removed, self);
#line 2574 "PixbufCache.c"
	{
		GeeIterator* _job_it = NULL;
		GeeHashMap* _tmp5_;
		GeeCollection* _tmp6_;
		GeeCollection* _tmp7_;
		GeeCollection* _tmp8_;
		GeeIterator* _tmp9_;
		GeeIterator* _tmp10_;
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp5_ = self->priv->in_progress;
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp6_ = gee_abstract_map_get_values (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_ABSTRACT_MAP, GeeAbstractMap));
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp7_ = _tmp6_;
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp8_ = _tmp7_;
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp9_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_ITERABLE, GeeIterable));
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_tmp10_ = _tmp9_;
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_tmp8_);
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_job_it = _tmp10_;
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		while (TRUE) {
#line 2601 "PixbufCache.c"
			GeeIterator* _tmp11_;
			gboolean _tmp12_;
			PixbufCacheFetchJob* job = NULL;
			GeeIterator* _tmp13_;
			gpointer _tmp14_;
			PixbufCacheFetchJob* _tmp15_;
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp11_ = _job_it;
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp12_ = gee_iterator_next (_tmp11_);
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			if (!_tmp12_) {
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
				break;
#line 2616 "PixbufCache.c"
			}
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp13_ = _job_it;
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp14_ = gee_iterator_get (_tmp13_);
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			job = (PixbufCacheFetchJob*) _tmp14_;
#line 115 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_tmp15_ = job;
#line 115 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			background_job_cancel (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_BACKGROUND_JOB, BackgroundJob));
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
			_background_job_unref0 (job);
#line 2630 "PixbufCache.c"
		}
#line 114 "/home/jens/Source/shotwell/src/PixbufCache.vala"
		_g_object_unref0 (_job_it);
#line 2634 "PixbufCache.c"
	}
#line 74 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_data_collection_unref0 (self->priv->sources);
#line 79 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (self->priv->cache);
#line 80 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (self->priv->lru);
#line 81 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	_g_object_unref0 (self->priv->in_progress);
#line 7 "/home/jens/Source/shotwell/src/PixbufCache.vala"
	G_OBJECT_CLASS (pixbuf_cache_parent_class)->finalize (obj);
#line 2646 "PixbufCache.c"
}


GType pixbuf_cache_get_type (void) {
	static volatile gsize pixbuf_cache_type_id__volatile = 0;
	if (g_once_init_enter (&pixbuf_cache_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (PixbufCacheClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pixbuf_cache_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PixbufCache), 0, (GInstanceInitFunc) pixbuf_cache_instance_init, NULL };
		GType pixbuf_cache_type_id;
		pixbuf_cache_type_id = g_type_register_static (G_TYPE_OBJECT, "PixbufCache", &g_define_type_info, 0);
		g_once_init_leave (&pixbuf_cache_type_id__volatile, pixbuf_cache_type_id);
	}
	return pixbuf_cache_type_id__volatile;
}