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

#define SLIDESHOW_PAGE_READAHEAD_COUNT 5
#define SLIDESHOW_PAGE_CHECK_ADVANCE_MSEC 250
#define NULL_TRANSITION_DESCRIPTOR_EFFECT_ID "org.gnome.shotwell.transitions.null"
#define RANDOM_EFFECT_DESCRIPTOR_EFFECT_ID "org.gnome.shotwell.transitions.random"
#define PHOTO_TYPENAME "thumb"
#define TRANSITION_EFFECTS_MANAGER_NULL_EFFECT_ID NULL_TRANSITION_DESCRIPTOR_EFFECT_ID
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

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

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

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

typedef struct _PageWindow PageWindow;
typedef struct _PageWindowClass PageWindowClass;

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

typedef struct _FullscreenWindow FullscreenWindow;
typedef struct _FullscreenWindowClass FullscreenWindowClass;

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

typedef struct _InjectionGroup InjectionGroup;
typedef struct _InjectionGroupClass InjectionGroupClass;

#define TYPE_SINGLE_PHOTO_PAGE (single_photo_page_get_type ())
#define SINGLE_PHOTO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage))
#define SINGLE_PHOTO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPageClass))
#define IS_SINGLE_PHOTO_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SINGLE_PHOTO_PAGE))
#define IS_SINGLE_PHOTO_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SINGLE_PHOTO_PAGE))
#define SINGLE_PHOTO_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPageClass))

typedef struct _SinglePhotoPage SinglePhotoPage;
typedef struct _SinglePhotoPageClass SinglePhotoPageClass;
typedef struct _SinglePhotoPagePrivate SinglePhotoPagePrivate;

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

typedef struct _ZoomBuffer ZoomBuffer;
typedef struct _ZoomBufferClass ZoomBufferClass;

#define TYPE_DIMENSIONS (dimensions_get_type ())
typedef struct _Dimensions Dimensions;
typedef enum  {
	SINGLE_PHOTO_PAGE_UPDATE_REASON_NEW_PIXBUF,
	SINGLE_PHOTO_PAGE_UPDATE_REASON_QUALITY_IMPROVEMENT,
	SINGLE_PHOTO_PAGE_UPDATE_REASON_RESIZED_CANVAS
} SinglePhotoPageUpdateReason;

#define SINGLE_PHOTO_PAGE_TYPE_UPDATE_REASON (single_photo_page_update_reason_get_type ())

#define TYPE_SLIDESHOW_PAGE (slideshow_page_get_type ())
#define SLIDESHOW_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SLIDESHOW_PAGE, SlideshowPage))
#define SLIDESHOW_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SLIDESHOW_PAGE, SlideshowPageClass))
#define IS_SLIDESHOW_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SLIDESHOW_PAGE))
#define IS_SLIDESHOW_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SLIDESHOW_PAGE))
#define SLIDESHOW_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SLIDESHOW_PAGE, SlideshowPageClass))

typedef struct _SlideshowPage SlideshowPage;
typedef struct _SlideshowPageClass SlideshowPageClass;
typedef struct _SlideshowPagePrivate SlideshowPagePrivate;

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

typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;

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

typedef struct _SourceCollection SourceCollection;
typedef struct _SourceCollectionClass SourceCollectionClass;

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

typedef struct _ViewCollection ViewCollection;
typedef struct _ViewCollectionClass ViewCollectionClass;

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

#define TYPE_SCREENSAVER (screensaver_get_type ())
#define SCREENSAVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SCREENSAVER, Screensaver))
#define SCREENSAVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SCREENSAVER, ScreensaverClass))
#define IS_SCREENSAVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SCREENSAVER))
#define IS_SCREENSAVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SCREENSAVER))
#define SCREENSAVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SCREENSAVER, ScreensaverClass))

typedef struct _Screensaver Screensaver;
typedef struct _ScreensaverClass ScreensaverClass;
enum  {
	SLIDESHOW_PAGE_0_PROPERTY,
	SLIDESHOW_PAGE_NUM_PROPERTIES
};
static GParamSpec* slideshow_page_properties[SLIDESHOW_PAGE_NUM_PROPERTIES];
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))
#define _screensaver_unref0(var) ((var == NULL) ? NULL : (var = (screensaver_unref (var), NULL)))

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

typedef struct _ConfigurationFacade ConfigurationFacade;
typedef struct _ConfigurationFacadeClass ConfigurationFacadeClass;

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

typedef struct _ConfigFacade ConfigFacade;
typedef struct _ConfigFacadeClass ConfigFacadeClass;

#define TYPE_TRANSITION_EFFECTS_MANAGER (transition_effects_manager_get_type ())
#define TRANSITION_EFFECTS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSITION_EFFECTS_MANAGER, TransitionEffectsManager))
#define TRANSITION_EFFECTS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSITION_EFFECTS_MANAGER, TransitionEffectsManagerClass))
#define IS_TRANSITION_EFFECTS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSITION_EFFECTS_MANAGER))
#define IS_TRANSITION_EFFECTS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSITION_EFFECTS_MANAGER))
#define TRANSITION_EFFECTS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSITION_EFFECTS_MANAGER, TransitionEffectsManagerClass))

typedef struct _TransitionEffectsManager TransitionEffectsManager;
typedef struct _TransitionEffectsManagerClass TransitionEffectsManagerClass;
#define _transition_effects_manager_unref0(var) ((var == NULL) ? NULL : (var = (transition_effects_manager_unref (var), NULL)))

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

typedef struct _DataView DataView;
typedef struct _DataViewClass DataViewClass;
typedef enum  {
	PIXBUF_CACHE_PHOTO_TYPE_BASELINE,
	PIXBUF_CACHE_PHOTO_TYPE_MASTER
} PixbufCachePhotoType;

#define PIXBUF_CACHE_TYPE_PHOTO_TYPE (pixbuf_cache_photo_type_get_type ())

#define TYPE_SCALING (scaling_get_type ())
typedef struct _Scaling Scaling;
typedef enum  {
	SCALE_CONSTRAINT_ORIGINAL,
	SCALE_CONSTRAINT_DIMENSIONS,
	SCALE_CONSTRAINT_WIDTH,
	SCALE_CONSTRAINT_HEIGHT,
	SCALE_CONSTRAINT_FILL_VIEWPORT
} ScaleConstraint;

#define TYPE_SCALE_CONSTRAINT (scale_constraint_get_type ())
typedef gboolean (*PixbufCacheCacheFilter) (Photo* photo, gpointer user_data);
typedef enum  {
	DIRECTION_FORWARD,
	DIRECTION_BACKWARD
} Direction;

#define TYPE_DIRECTION (direction_get_type ())
typedef enum  {
	PHOTO_EXCEPTION_NONE = 0,
	PHOTO_EXCEPTION_ORIENTATION = 1 << 0,
	PHOTO_EXCEPTION_CROP = 1 << 1,
	PHOTO_EXCEPTION_REDEYE = 1 << 2,
	PHOTO_EXCEPTION_ADJUST = 1 << 3,
	PHOTO_EXCEPTION_STRAIGHTEN = 1 << 4,
	PHOTO_EXCEPTION_ALL = 0xFFFFFFFFLL
} PhotoException;

#define PHOTO_TYPE_EXCEPTION (photo_exception_get_type ())
#define _g_free0(var) (var = (g_free (var), NULL))

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

typedef struct _AppWindow AppWindow;
typedef struct _AppWindowClass AppWindowClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
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;

#define BACKGROUND_JOB_TYPE_JOB_PRIORITY (background_job_job_priority_get_type ())

#define SLIDESHOW_PAGE_TYPE_SETTINGS_DIALOG (slideshow_page_settings_dialog_get_type ())
#define SLIDESHOW_PAGE_SETTINGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SLIDESHOW_PAGE_TYPE_SETTINGS_DIALOG, SlideshowPageSettingsDialog))
#define SLIDESHOW_PAGE_SETTINGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SLIDESHOW_PAGE_TYPE_SETTINGS_DIALOG, SlideshowPageSettingsDialogClass))
#define SLIDESHOW_PAGE_IS_SETTINGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SLIDESHOW_PAGE_TYPE_SETTINGS_DIALOG))
#define SLIDESHOW_PAGE_IS_SETTINGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SLIDESHOW_PAGE_TYPE_SETTINGS_DIALOG))
#define SLIDESHOW_PAGE_SETTINGS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SLIDESHOW_PAGE_TYPE_SETTINGS_DIALOG, SlideshowPageSettingsDialogClass))

typedef struct _SlideshowPageSettingsDialog SlideshowPageSettingsDialog;
typedef struct _SlideshowPageSettingsDialogClass SlideshowPageSettingsDialogClass;
#define _pango_attribute_destroy0(var) ((var == NULL) ? NULL : (var = (pango_attribute_destroy (var), NULL)))
#define _pango_attr_list_unref0(var) ((var == NULL) ? NULL : (var = (pango_attr_list_unref (var), NULL)))
typedef struct _SlideshowPageSettingsDialogPrivate SlideshowPageSettingsDialogPrivate;
enum  {
	SLIDESHOW_PAGE_SETTINGS_DIALOG_0_PROPERTY,
	SLIDESHOW_PAGE_SETTINGS_DIALOG_NUM_PROPERTIES
};
static GParamSpec* slideshow_page_settings_dialog_properties[SLIDESHOW_PAGE_SETTINGS_DIALOG_NUM_PROPERTIES];
enum  {
	SLIDESHOW_PAGE_HIDE_TOOLBAR_SIGNAL,
	SLIDESHOW_PAGE_NUM_SIGNALS
};
static guint slideshow_page_signals[SLIDESHOW_PAGE_NUM_SIGNALS] = {0};

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

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

struct _Dimensions {
	gint width;
	gint height;
};

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

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

struct _SlideshowPage {
	SinglePhotoPage parent_instance;
	SlideshowPagePrivate * priv;
};

struct _SlideshowPageClass {
	SinglePhotoPageClass parent_class;
};

struct _SlideshowPagePrivate {
	SourceCollection* sources;
	ViewCollection* controller_source;
	ViewCollection* controller;
	Photo* current;
	GtkToolButton* play_pause_button;
	GtkToolButton* settings_button;
	PixbufCache* cache;
	GTimer* timer;
	gboolean playing;
	gboolean exiting;
	gboolean shuffled;
	gchar** transitions;
	gint transitions_length1;
	gint _transitions_size_;
	Screensaver* screensaver;
};

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

struct _SlideshowPageSettingsDialog {
	GtkDialog parent_instance;
	SlideshowPageSettingsDialogPrivate * priv;
};

struct _SlideshowPageSettingsDialogClass {
	GtkDialogClass parent_class;
};

struct _SlideshowPageSettingsDialogPrivate {
	GtkAdjustment* delay_adjustment;
	GtkSpinButton* delay_entry;
	GtkComboBoxText* transition_effect_selector;
	GtkScale* transition_effect_hscale;
	GtkSpinButton* transition_effect_entry;
	GtkAdjustment* transition_effect_adjustment;
	GtkCheckButton* show_title_button;
	GtkCheckButton* shuffle_button;
};

static gint SlideshowPage_private_offset;
static gpointer slideshow_page_parent_class = NULL;
static gint SlideshowPageSettingsDialog_private_offset;
static gpointer slideshow_page_settings_dialog_parent_class = NULL;

VALA_EXTERN GType page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Page, g_object_unref)
VALA_EXTERN GType page_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageWindow, g_object_unref)
VALA_EXTERN GType fullscreen_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FullscreenWindow, g_object_unref)
VALA_EXTERN gpointer injection_group_ref (gpointer instance);
VALA_EXTERN void injection_group_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_injection_group (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_injection_group (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_injection_group (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_injection_group (const GValue* value);
VALA_EXTERN GType injection_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (InjectionGroup, injection_group_unref)
VALA_EXTERN GType single_photo_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SinglePhotoPage, g_object_unref)
VALA_EXTERN GType zoom_buffer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ZoomBuffer, g_object_unref)
VALA_EXTERN GType dimensions_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Dimensions* dimensions_dup (const Dimensions* self);
VALA_EXTERN void dimensions_free (Dimensions* self);
VALA_EXTERN GType single_photo_page_update_reason_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType slideshow_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SlideshowPage, g_object_unref)
VALA_EXTERN gpointer data_collection_ref (gpointer instance);
VALA_EXTERN void data_collection_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_data_collection (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_data_collection (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_data_collection (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_data_collection (const GValue* value);
VALA_EXTERN GType data_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataCollection, data_collection_unref)
VALA_EXTERN GType source_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SourceCollection, data_collection_unref)
VALA_EXTERN GType view_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewCollection, data_collection_unref)
VALA_EXTERN GType data_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataObject, g_object_unref)
VALA_EXTERN GType data_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataSource, g_object_unref)
VALA_EXTERN GType thumbnail_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThumbnailSource, g_object_unref)
VALA_EXTERN GType media_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaSource, g_object_unref)
VALA_EXTERN GType photo_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotoSource, g_object_unref)
VALA_EXTERN GType photo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Photo, g_object_unref)
VALA_EXTERN GType pixbuf_cache_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PixbufCache, g_object_unref)
VALA_EXTERN gpointer screensaver_ref (gpointer instance);
VALA_EXTERN void screensaver_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_screensaver (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_screensaver (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_screensaver (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_screensaver (const GValue* value);
VALA_EXTERN GType screensaver_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Screensaver, screensaver_unref)
VALA_EXTERN void page_switched_to (Page* self);
VALA_EXTERN void page_switching_from (Page* self);
VALA_EXTERN void single_photo_page_on_previous_photo (SinglePhotoPage* self);
VALA_EXTERN void single_photo_page_on_next_photo (SinglePhotoPage* self);
VALA_EXTERN void single_photo_page_paint (SinglePhotoPage* self,
                              cairo_t* ctx,
                              Dimensions* ctx_dim);
VALA_EXTERN SlideshowPage* slideshow_page_new (SourceCollection* sources,
                                   ViewCollection* controller,
                                   Photo* start);
VALA_EXTERN SlideshowPage* slideshow_page_construct (GType object_type,
                                         SourceCollection* sources,
                                         ViewCollection* controller,
                                         Photo* start);
VALA_EXTERN SinglePhotoPage* single_photo_page_construct (GType object_type,
                                              const gchar* page_name,
                                              gboolean scale_up_to_viewport);
VALA_EXTERN GType configuration_facade_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigurationFacade, g_object_unref)
VALA_EXTERN GType config_facade_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigFacade, g_object_unref)
VALA_EXTERN ConfigFacade* config_facade_get_instance (void);
VALA_EXTERN gboolean configuration_facade_get_slideshow_shuffle (ConfigurationFacade* self);
VALA_EXTERN ViewCollection* view_collection_shuffled_copy (ViewCollection* self,
                                               Photo* start);
VALA_EXTERN gpointer transition_effects_manager_ref (gpointer instance);
VALA_EXTERN void transition_effects_manager_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_transition_effects_manager (const gchar* name,
                                                   const gchar* nick,
                                                   const gchar* blurb,
                                                   GType object_type,
                                                   GParamFlags flags);
VALA_EXTERN void value_set_transition_effects_manager (GValue* value,
                                           gpointer v_object);
VALA_EXTERN void value_take_transition_effects_manager (GValue* value,
                                            gpointer v_object);
VALA_EXTERN gpointer value_get_transition_effects_manager (const GValue* value);
VALA_EXTERN GType transition_effects_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TransitionEffectsManager, transition_effects_manager_unref)
VALA_EXTERN TransitionEffectsManager* transition_effects_manager_get_instance (void);
VALA_EXTERN GeeCollection* transition_effects_manager_get_effect_ids (TransitionEffectsManager* self);
VALA_EXTERN GType data_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataView, g_object_unref)
VALA_EXTERN DataView* view_collection_get_first_photo (ViewCollection* self);
VALA_EXTERN DataSource* data_view_get_source (DataView* self);
static void slideshow_page_update_transition_effect (SlideshowPage* self);
VALA_EXTERN GtkToolbar* page_get_toolbar (Page* self);
static void _single_photo_page_on_previous_photo_gtk_tool_button_clicked (GtkToolButton* _sender,
                                                                   gpointer self);
static void slideshow_page_on_play_pause (SlideshowPage* self);
static void _slideshow_page_on_play_pause_gtk_tool_button_clicked (GtkToolButton* _sender,
                                                            gpointer self);
static void _single_photo_page_on_next_photo_gtk_tool_button_clicked (GtkToolButton* _sender,
                                                               gpointer self);
static void slideshow_page_on_change_settings (SlideshowPage* self);
static void _slideshow_page_on_change_settings_gtk_tool_button_clicked (GtkToolButton* _sender,
                                                                 gpointer self);
VALA_EXTERN Screensaver* screensaver_new (void);
VALA_EXTERN Screensaver* screensaver_construct (GType object_type);
static void slideshow_page_real_switched_to (Page* base);
VALA_EXTERN GType pixbuf_cache_photo_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType scaling_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType scale_constraint_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Scaling* scaling_dup (const Scaling* self);
VALA_EXTERN void scaling_free (Scaling* self);
VALA_EXTERN void single_photo_page_get_canvas_scaling (SinglePhotoPage* self,
                                           Scaling* result);
VALA_EXTERN PixbufCache* pixbuf_cache_new (SourceCollection* sources,
                               PixbufCachePhotoType type,
                               Scaling* scaling,
                               gint max_count,
                               PixbufCacheCacheFilter filter,
                               gpointer filter_target);
VALA_EXTERN PixbufCache* pixbuf_cache_construct (GType object_type,
                                     SourceCollection* sources,
                                     PixbufCachePhotoType type,
                                     Scaling* scaling,
                                     gint max_count,
                                     PixbufCacheCacheFilter filter,
                                     gpointer filter_target);
VALA_EXTERN GType direction_get_type (void) G_GNUC_CONST ;
static gboolean slideshow_page_get_next_photo (SlideshowPage* self,
                                        Photo* start,
                                        Direction direction,
                                        Photo** next,
                                        GdkPixbuf** next_pixbuf);
VALA_EXTERN void single_photo_page_set_pixbuf (SinglePhotoPage* self,
                                   GdkPixbuf* unscaled,
                                   Dimensions* max_dim,
                                   Direction* direction);
VALA_EXTERN GType photo_exception_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void media_source_get_dimensions (MediaSource* self,
                                  PhotoException disallowed_steps,
                                  Dimensions* result);
static gboolean slideshow_page_auto_advance (SlideshowPage* self);
static gboolean _slideshow_page_auto_advance_gsource_func (gpointer self);
VALA_EXTERN void screensaver_inhibit (Screensaver* self,
                          const gchar* reason);
static void slideshow_page_real_switching_from (Page* base);
VALA_EXTERN void screensaver_uninhibit (Screensaver* self);
VALA_EXTERN GdkPixbuf* pixbuf_cache_fetch (PixbufCache* self,
                               Photo* photo,
                               GError** error);
VALA_EXTERN gchar* data_object_to_string (DataObject* self);
VALA_EXTERN DataView* view_collection_get_view_for_source (ViewCollection* self,
                                               DataSource* source);
VALA_EXTERN DataView* view_collection_get_next (ViewCollection* self,
                                    DataView* view,
                                    gboolean** wrapped);
VALA_EXTERN DataView* view_collection_get_previous (ViewCollection* self,
                                        DataView* view);
VALA_EXTERN void app_window_error_message (const gchar* message,
                               GtkWindow* parent);
VALA_EXTERN GtkWindow* page_get_container (Page* self);
VALA_EXTERN GType app_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AppWindow, g_object_unref)
VALA_EXTERN AppWindow* app_window_get_instance (void);
VALA_EXTERN void app_window_end_fullscreen (AppWindow* self);
VALA_EXTERN gboolean view_collection_get_immediate_neighbors (ViewCollection* self,
                                                  DataSource* home,
                                                  DataSource** next,
                                                  DataSource** prev,
                                                  const gchar* type_selector);
VALA_EXTERN GType background_job_job_priority_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void pixbuf_cache_prefetch (PixbufCache* self,
                            Photo* photo,
                            BackgroundJobJobPriority priority,
                            gboolean force);
VALA_EXTERN GeeSet* view_collection_get_extended_neighbors (ViewCollection* self,
                                                DataSource* home,
                                                const gchar* typename);
VALA_EXTERN void pixbuf_cache_prefetch_many (PixbufCache* self,
                                 GeeCollection* photos,
                                 BackgroundJobJobPriority priority,
                                 gboolean force);
static void slideshow_page_real_on_previous_photo (SinglePhotoPage* base);
static void slideshow_page_advance (SlideshowPage* self,
                             Photo* photo,
                             Direction direction);
static void slideshow_page_real_on_next_photo (SinglePhotoPage* base);
VALA_EXTERN DataView* view_collection_get_first (ViewCollection* self);
VALA_EXTERN gchar* configuration_facade_get_slideshow_transition_effect_id (ConfigurationFacade* self);
static void slideshow_page_random_transition_effect (SlideshowPage* self);
VALA_EXTERN gdouble configuration_facade_get_slideshow_delay (ConfigurationFacade* self);
static gboolean slideshow_page_real_key_press_event (GtkWidget* base,
                                              GdkEventKey* event);
static GType slideshow_page_settings_dialog_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SlideshowPageSettingsDialog, g_object_unref)
static SlideshowPageSettingsDialog* slideshow_page_settings_dialog_new (void);
static SlideshowPageSettingsDialog* slideshow_page_settings_dialog_construct (GType object_type);
VALA_EXTERN void page_suspend_cursor_hiding (Page* self);
VALA_EXTERN void configuration_facade_set_slideshow_delay (ConfigurationFacade* self,
                                               gdouble delay);
static gdouble slideshow_page_settings_dialog_get_delay (SlideshowPageSettingsDialog* self);
VALA_EXTERN void configuration_facade_set_slideshow_transition_delay (ConfigurationFacade* self,
                                                          gdouble delay);
static gdouble slideshow_page_settings_dialog_get_transition_delay (SlideshowPageSettingsDialog* self);
VALA_EXTERN void configuration_facade_set_slideshow_transition_effect_id (ConfigurationFacade* self,
                                                              const gchar* id);
static gchar* slideshow_page_settings_dialog_get_transition_effect_id (SlideshowPageSettingsDialog* self);
VALA_EXTERN void configuration_facade_set_slideshow_show_title (ConfigurationFacade* self,
                                                    gboolean show_title);
static gboolean slideshow_page_settings_dialog_get_show_title (SlideshowPageSettingsDialog* self);
static gboolean slideshow_page_settings_dialog_get_shuffle (SlideshowPageSettingsDialog* self);
VALA_EXTERN void configuration_facade_set_slideshow_shuffle (ConfigurationFacade* self,
                                                 gboolean shuffle);
VALA_EXTERN void page_restore_cursor_hiding (Page* self);
VALA_EXTERN gdouble configuration_facade_get_slideshow_transition_delay (ConfigurationFacade* self);
VALA_EXTERN void single_photo_page_set_transition (SinglePhotoPage* self,
                                       const gchar* effect_id,
                                       gint duration_msec);
static void slideshow_page_paint_title (SlideshowPage* self,
                                 cairo_t* ctx,
                                 Dimensions* ctx_dim);
VALA_EXTERN gchar* media_source_get_title (MediaSource* self);
VALA_EXTERN void set_source_color_from_string (cairo_t* ctx,
                                   const gchar* spec);
static void slideshow_page_real_paint (SinglePhotoPage* base,
                                cairo_t* ctx,
                                Dimensions* ctx_dim);
VALA_EXTERN gboolean configuration_facade_get_slideshow_show_title (ConfigurationFacade* self);
VALA_EXTERN gboolean single_photo_page_is_transition_in_progress (SinglePhotoPage* self);
VALA_EXTERN gint resources_use_header_bar (void);
VALA_EXTERN FullscreenWindow* app_window_get_fullscreen (void);
VALA_EXTERN gchar* transition_effects_manager_get_effect_name (TransitionEffectsManager* self,
                                                   const gchar* effect_id);
VALA_EXTERN GeeCollection* transition_effects_manager_get_effect_names (TransitionEffectsManager* self,
                                                            GCompareDataFunc comparator,
                                                            gpointer comparator_target,
                                                            GDestroyNotify comparator_target_destroy_notify);
VALA_EXTERN gint utf8_ci_compare (const gchar* a,
                      const gchar* b);
static gint _utf8_ci_compare_gcompare_data_func (gconstpointer a,
                                          gconstpointer b,
                                          gpointer self);
VALA_EXTERN gchar* transition_effects_manager_get_id_for_effect_name (TransitionEffectsManager* self,
                                                          const gchar* effect_name);
static void slideshow_page_settings_dialog_on_transition_changed (SlideshowPageSettingsDialog* self);
static void _slideshow_page_settings_dialog_on_transition_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                                  gpointer self);
static void slideshow_page_settings_dialog_finalize (GObject * obj);
static GType slideshow_page_settings_dialog_get_type_once (void);
static void slideshow_page_finalize (GObject * obj);
static GType slideshow_page_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
slideshow_page_get_instance_private (SlideshowPage* self)
{
	return G_STRUCT_MEMBER_P (self, SlideshowPage_private_offset);
}

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

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

static void
_single_photo_page_on_previous_photo_gtk_tool_button_clicked (GtkToolButton* _sender,
                                                              gpointer self)
{
	single_photo_page_on_previous_photo ((SinglePhotoPage*) self);
}

static void
_slideshow_page_on_play_pause_gtk_tool_button_clicked (GtkToolButton* _sender,
                                                       gpointer self)
{
	slideshow_page_on_play_pause ((SlideshowPage*) self);
}

static void
_single_photo_page_on_next_photo_gtk_tool_button_clicked (GtkToolButton* _sender,
                                                          gpointer self)
{
	single_photo_page_on_next_photo ((SinglePhotoPage*) self);
}

static void
_slideshow_page_on_change_settings_gtk_tool_button_clicked (GtkToolButton* _sender,
                                                            gpointer self)
{
	slideshow_page_on_change_settings ((SlideshowPage*) self);
}

SlideshowPage*
slideshow_page_construct (GType object_type,
                          SourceCollection* sources,
                          ViewCollection* controller,
                          Photo* start)
{
	SlideshowPage * self = NULL;
	SourceCollection* _tmp0_;
	ViewCollection* _tmp1_;
	ConfigFacade* _tmp2_;
	ConfigFacade* _tmp3_;
	ViewCollection* _tmp4_ = NULL;
	ViewCollection* _tmp7_;
	GeeCollection* pluggables = NULL;
	TransitionEffectsManager* _tmp8_;
	TransitionEffectsManager* _tmp9_;
	GeeCollection* _tmp10_;
	GeeCollection* _tmp11_;
	GeeArrayList* a = NULL;
	GeeArrayList* _tmp12_;
	GeeArrayList* _tmp13_;
	GeeCollection* _tmp14_;
	GeeArrayList* _tmp15_;
	GeeArrayList* _tmp16_;
	GeeArrayList* _tmp17_;
	gint _tmp18_ = 0;
	gpointer* _tmp19_;
	Photo* _tmp20_ = NULL;
	Photo* _tmp26_;
	GtkToolbar* toolbar = NULL;
	GtkToolbar* _tmp27_;
	GtkToolButton* previous_button = NULL;
	GtkToolButton* _tmp28_;
	GtkToolButton* _tmp29_;
	GtkToolButton* _tmp30_;
	GtkToolButton* _tmp31_;
	GtkToolButton* _tmp32_;
	GtkToolButton* _tmp33_;
	GtkToolButton* next_button = NULL;
	GtkToolButton* _tmp34_;
	GtkToolButton* _tmp35_;
	GtkToolButton* _tmp36_;
	GtkToolButton* _tmp37_;
	GtkToolButton* _tmp38_;
	GtkToolButton* _tmp39_;
	GtkToolButton* _tmp40_;
	GtkToolButton* _tmp41_;
	Screensaver* _tmp42_;
	g_return_val_if_fail (IS_SOURCE_COLLECTION (sources), NULL);
	g_return_val_if_fail (IS_VIEW_COLLECTION (controller), NULL);
	g_return_val_if_fail ((start == NULL) || IS_PHOTO (start), NULL);
	self = (SlideshowPage*) single_photo_page_construct (object_type, _ ("Slideshow"), TRUE);
	_tmp0_ = _data_collection_ref0 (sources);
	_data_collection_unref0 (self->priv->sources);
	self->priv->sources = _tmp0_;
	_tmp1_ = _data_collection_ref0 (controller);
	_data_collection_unref0 (self->priv->controller_source);
	self->priv->controller_source = _tmp1_;
	_tmp2_ = config_facade_get_instance ();
	_tmp3_ = _tmp2_;
	self->priv->shuffled = configuration_facade_get_slideshow_shuffle (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp3_);
	if (self->priv->shuffled) {
		ViewCollection* _tmp5_;
		_tmp5_ = view_collection_shuffled_copy (controller, start);
		_data_collection_unref0 (_tmp4_);
		_tmp4_ = _tmp5_;
	} else {
		ViewCollection* _tmp6_;
		_tmp6_ = _data_collection_ref0 (controller);
		_data_collection_unref0 (_tmp4_);
		_tmp4_ = _tmp6_;
	}
	_tmp7_ = _tmp4_;
	_tmp4_ = NULL;
	_data_collection_unref0 (self->priv->controller);
	self->priv->controller = _tmp7_;
	_tmp8_ = transition_effects_manager_get_instance ();
	_tmp9_ = _tmp8_;
	_tmp10_ = transition_effects_manager_get_effect_ids (_tmp9_);
	_tmp11_ = _tmp10_;
	_transition_effects_manager_unref0 (_tmp9_);
	pluggables = _tmp11_;
	_tmp12_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	a = _tmp12_;
	_tmp13_ = a;
	_tmp14_ = pluggables;
	gee_array_list_add_all (_tmp13_, _tmp14_);
	_tmp15_ = a;
	gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), NULL_TRANSITION_DESCRIPTOR_EFFECT_ID);
	_tmp16_ = a;
	gee_abstract_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), RANDOM_EFFECT_DESCRIPTOR_EFFECT_ID);
	_tmp17_ = a;
	_tmp19_ = gee_collection_to_array (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, GEE_TYPE_COLLECTION, GeeCollection), &_tmp18_);
	self->priv->transitions = (_vala_array_free (self->priv->transitions, self->priv->transitions_length1, (GDestroyNotify) g_free), NULL);
	self->priv->transitions = _tmp19_;
	self->priv->transitions_length1 = _tmp18_;
	self->priv->_transitions_size_ = self->priv->transitions_length1;
	if (start == NULL) {
		ViewCollection* _tmp21_;
		DataView* _tmp22_;
		DataView* _tmp23_;
		DataSource* _tmp24_;
		_tmp21_ = self->priv->controller;
		_tmp22_ = view_collection_get_first_photo (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp24_ = data_view_get_source (_tmp23_);
		_g_object_unref0 (_tmp20_);
		_tmp20_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, TYPE_PHOTO, Photo);
		_g_object_unref0 (_tmp23_);
	} else {
		Photo* _tmp25_;
		_tmp25_ = _g_object_ref0 (start);
		_g_object_unref0 (_tmp20_);
		_tmp20_ = _tmp25_;
	}
	_tmp26_ = _tmp20_;
	_tmp20_ = NULL;
	_g_object_unref0 (self->priv->current);
	self->priv->current = _tmp26_;
	slideshow_page_update_transition_effect (self);
	_tmp27_ = page_get_toolbar (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	toolbar = _tmp27_;
	_tmp28_ = (GtkToolButton*) gtk_tool_button_new (NULL, _ ("Back"));
	g_object_ref_sink (_tmp28_);
	previous_button = _tmp28_;
	gtk_tool_button_set_icon_name (previous_button, "go-previous-symbolic");
	gtk_tool_item_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (previous_button, gtk_tool_item_get_type (), GtkToolItem), _ ("Go to the previous photo"));
	g_signal_connect_object (previous_button, "clicked", (GCallback) _single_photo_page_on_previous_photo_gtk_tool_button_clicked, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), 0);
	gtk_toolbar_insert (toolbar, G_TYPE_CHECK_INSTANCE_CAST (previous_button, gtk_tool_item_get_type (), GtkToolItem), -1);
	_tmp29_ = (GtkToolButton*) gtk_tool_button_new (NULL, _ ("Pause"));
	g_object_ref_sink (_tmp29_);
	_g_object_unref0 (self->priv->play_pause_button);
	self->priv->play_pause_button = _tmp29_;
	_tmp30_ = self->priv->play_pause_button;
	gtk_tool_button_set_icon_name (_tmp30_, "media-playback-pause-symbolic");
	_tmp31_ = self->priv->play_pause_button;
	gtk_tool_item_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, gtk_tool_item_get_type (), GtkToolItem), _ ("Pause the slideshow"));
	_tmp32_ = self->priv->play_pause_button;
	g_signal_connect_object (_tmp32_, "clicked", (GCallback) _slideshow_page_on_play_pause_gtk_tool_button_clicked, self, 0);
	_tmp33_ = self->priv->play_pause_button;
	gtk_toolbar_insert (toolbar, G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, gtk_tool_item_get_type (), GtkToolItem), -1);
	_tmp34_ = (GtkToolButton*) gtk_tool_button_new (NULL, _ ("Next"));
	g_object_ref_sink (_tmp34_);
	next_button = _tmp34_;
	gtk_tool_button_set_icon_name (next_button, "go-next-symbolic");
	gtk_tool_item_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (next_button, gtk_tool_item_get_type (), GtkToolItem), _ ("Go to the next photo"));
	g_signal_connect_object (next_button, "clicked", (GCallback) _single_photo_page_on_next_photo_gtk_tool_button_clicked, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), 0);
	gtk_toolbar_insert (toolbar, G_TYPE_CHECK_INSTANCE_CAST (next_button, gtk_tool_item_get_type (), GtkToolItem), -1);
	_tmp35_ = (GtkToolButton*) gtk_tool_button_new (NULL, NULL);
	g_object_ref_sink (_tmp35_);
	_g_object_unref0 (self->priv->settings_button);
	self->priv->settings_button = _tmp35_;
	_tmp36_ = self->priv->settings_button;
	gtk_tool_button_set_icon_name (_tmp36_, "preferences-system-symbolic");
	_tmp37_ = self->priv->settings_button;
	gtk_tool_button_set_label (_tmp37_, _ ("Settings"));
	_tmp38_ = self->priv->settings_button;
	gtk_tool_item_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, gtk_tool_item_get_type (), GtkToolItem), _ ("Change slideshow settings"));
	_tmp39_ = self->priv->settings_button;
	g_signal_connect_object (_tmp39_, "clicked", (GCallback) _slideshow_page_on_change_settings_gtk_tool_button_clicked, self, 0);
	_tmp40_ = self->priv->settings_button;
	gtk_tool_item_set_is_important (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, gtk_tool_item_get_type (), GtkToolItem), TRUE);
	_tmp41_ = self->priv->settings_button;
	gtk_toolbar_insert (toolbar, G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, gtk_tool_item_get_type (), GtkToolItem), -1);
	_tmp42_ = screensaver_new ();
	_screensaver_unref0 (self->priv->screensaver);
	self->priv->screensaver = _tmp42_;
	_g_object_unref0 (next_button);
	_g_object_unref0 (previous_button);
	_g_object_unref0 (toolbar);
	_g_object_unref0 (_tmp20_);
	_g_object_unref0 (a);
	_g_object_unref0 (pluggables);
	_data_collection_unref0 (_tmp4_);
	return self;
}

SlideshowPage*
slideshow_page_new (SourceCollection* sources,
                    ViewCollection* controller,
                    Photo* start)
{
	return slideshow_page_construct (TYPE_SLIDESHOW_PAGE, sources, controller, start);
}

static gboolean
_slideshow_page_auto_advance_gsource_func (gpointer self)
{
	gboolean result;
	result = slideshow_page_auto_advance ((SlideshowPage*) self);
	return result;
}

static void
slideshow_page_real_switched_to (Page* base)
{
	SlideshowPage * self;
	SourceCollection* _tmp0_;
	Scaling _tmp1_ = {0};
	PixbufCache* _tmp2_;
	GdkPixbuf* pixbuf = NULL;
	Photo* _tmp3_;
	Photo* _tmp4_ = NULL;
	GdkPixbuf* _tmp5_ = NULL;
	gboolean _tmp6_;
	GTimer* _tmp11_;
	Screensaver* _tmp12_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SLIDESHOW_PAGE, SlideshowPage);
	PAGE_CLASS (slideshow_page_parent_class)->switched_to (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), TYPE_PAGE, Page));
	_tmp0_ = self->priv->sources;
	single_photo_page_get_canvas_scaling (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), &_tmp1_);
	_tmp2_ = pixbuf_cache_new (_tmp0_, PIXBUF_CACHE_PHOTO_TYPE_BASELINE, &_tmp1_, SLIDESHOW_PAGE_READAHEAD_COUNT, NULL, NULL);
	_g_object_unref0 (self->priv->cache);
	self->priv->cache = _tmp2_;
	_tmp3_ = self->priv->current;
	_tmp6_ = slideshow_page_get_next_photo (self, _tmp3_, DIRECTION_FORWARD, &_tmp4_, &_tmp5_);
	_g_object_unref0 (self->priv->current);
	self->priv->current = _tmp4_;
	_g_object_unref0 (pixbuf);
	pixbuf = _tmp5_;
	if (_tmp6_) {
		GdkPixbuf* _tmp7_;
		Photo* _tmp8_;
		Dimensions _tmp9_ = {0};
		Direction _tmp10_;
		_tmp7_ = pixbuf;
		_tmp8_ = self->priv->current;
		media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_MEDIA_SOURCE, MediaSource), PHOTO_EXCEPTION_NONE, &_tmp9_);
		_tmp10_ = DIRECTION_FORWARD;
		single_photo_page_set_pixbuf (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), _tmp7_, &_tmp9_, &_tmp10_);
	}
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) SLIDESHOW_PAGE_CHECK_ADVANCE_MSEC, _slideshow_page_auto_advance_gsource_func, g_object_ref (self), g_object_unref);
	_tmp11_ = self->priv->timer;
	g_timer_start (_tmp11_);
	_tmp12_ = self->priv->screensaver;
	screensaver_inhibit (_tmp12_, "Playing slideshow");
	_g_object_unref0 (pixbuf);
}

static void
slideshow_page_real_switching_from (Page* base)
{
	SlideshowPage * self;
	Screensaver* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SLIDESHOW_PAGE, SlideshowPage);
	PAGE_CLASS (slideshow_page_parent_class)->switching_from (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), TYPE_PAGE, Page));
	_tmp0_ = self->priv->screensaver;
	screensaver_uninhibit (_tmp0_);
	self->priv->exiting = TRUE;
}

static gboolean
slideshow_page_get_next_photo (SlideshowPage* self,
                               Photo* start,
                               Direction direction,
                               Photo** next,
                               GdkPixbuf** next_pixbuf)
{
	Photo* _vala_next = NULL;
	GdkPixbuf* _vala_next_pixbuf = NULL;
	Photo* _tmp0_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (IS_SLIDESHOW_PAGE (self), FALSE);
	g_return_val_if_fail (IS_PHOTO (start), FALSE);
	_tmp0_ = _g_object_ref0 (start);
	_g_object_unref0 (_vala_next);
	_vala_next = _tmp0_;
	{
		gboolean _tmp1_ = FALSE;
		_tmp1_ = TRUE;
		while (TRUE) {
			DataSource* forward = NULL;
			DataSource* back = NULL;
			ViewCollection* _tmp37_;
			Photo* _tmp38_;
			DataSource* _tmp39_ = NULL;
			DataSource* _tmp40_ = NULL;
			PixbufCache* _tmp41_;
			DataSource* _tmp42_;
			PixbufCache* _tmp43_;
			DataSource* _tmp44_;
			GeeSet* neighbors = NULL;
			ViewCollection* _tmp45_;
			Photo* _tmp46_;
			GeeSet* _tmp47_;
			GeeSet* _tmp48_;
			DataSource* _tmp49_;
			GeeSet* _tmp50_;
			DataSource* _tmp51_;
			PixbufCache* _tmp52_;
			GeeSet* _tmp53_;
			if (!_tmp1_) {
			}
			_tmp1_ = FALSE;
			{
				GdkPixbuf* _tmp2_ = NULL;
				PixbufCache* _tmp3_;
				Photo* _tmp4_;
				GdkPixbuf* _tmp5_;
				GdkPixbuf* _tmp6_;
				_tmp3_ = self->priv->cache;
				_tmp4_ = _vala_next;
				_tmp5_ = pixbuf_cache_fetch (_tmp3_, _tmp4_, &_inner_error0_);
				_tmp2_ = _tmp5_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					goto __catch0_g_error;
				}
				_tmp6_ = _tmp2_;
				_tmp2_ = NULL;
				_g_object_unref0 (_vala_next_pixbuf);
				_vala_next_pixbuf = _tmp6_;
				_g_object_unref0 (_tmp2_);
			}
			goto __finally0;
			__catch0_g_error:
			{
				GError* err = NULL;
				Photo* _tmp7_;
				gchar* _tmp8_;
				gchar* _tmp9_;
				GError* _tmp10_;
				const gchar* _tmp11_;
				DataView* view = NULL;
				ViewCollection* _tmp12_;
				Photo* _tmp13_;
				DataView* _tmp14_;
				DataView* _tmp15_ = NULL;
				DataView* _tmp22_;
				DataView* _tmp23_;
				DataSource* _tmp24_;
				gboolean _tmp25_ = FALSE;
				gboolean _tmp26_ = FALSE;
				Photo* _tmp27_;
				err = _inner_error0_;
				_inner_error0_ = NULL;
				_tmp7_ = _vala_next;
				_tmp8_ = data_object_to_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_DATA_OBJECT, DataObject));
				_tmp9_ = _tmp8_;
				_tmp10_ = err;
				_tmp11_ = _tmp10_->message;
				g_warning ("SlideshowPage.vala:218: Unable to fetch pixbuf for %s: %s", _tmp9_, _tmp11_);
				_g_free0 (_tmp9_);
				_tmp12_ = self->priv->controller;
				_tmp13_ = _vala_next;
				_tmp14_ = view_collection_get_view_for_source (_tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_SOURCE, DataSource));
				view = _tmp14_;
				if (direction == DIRECTION_FORWARD) {
					ViewCollection* _tmp16_;
					DataView* _tmp17_;
					DataView* _tmp18_;
					_tmp16_ = self->priv->controller;
					_tmp17_ = view;
					_tmp18_ = view_collection_get_next (_tmp16_, _tmp17_, NULL);
					_g_object_unref0 (_tmp15_);
					_tmp15_ = _tmp18_;
				} else {
					ViewCollection* _tmp19_;
					DataView* _tmp20_;
					DataView* _tmp21_;
					_tmp19_ = self->priv->controller;
					_tmp20_ = view;
					_tmp21_ = view_collection_get_previous (_tmp19_, _tmp20_);
					_g_object_unref0 (_tmp15_);
					_tmp15_ = _tmp21_;
				}
				_tmp22_ = _tmp15_;
				_tmp15_ = NULL;
				_g_object_unref0 (view);
				view = _tmp22_;
				_tmp23_ = view;
				_tmp24_ = data_view_get_source (_tmp23_);
				_g_object_unref0 (_vala_next);
				_vala_next = G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, TYPE_PHOTO, Photo);
				_tmp27_ = _vala_next;
				if (_tmp27_ == start) {
					Photo* _tmp28_;
					Photo* _tmp29_;
					_tmp28_ = _vala_next;
					_tmp29_ = self->priv->current;
					_tmp26_ = _tmp28_ != _tmp29_;
				} else {
					_tmp26_ = FALSE;
				}
				if (_tmp26_) {
					_tmp25_ = TRUE;
				} else {
					Photo* _tmp30_;
					Photo* _tmp31_;
					_tmp30_ = _vala_next;
					_tmp31_ = self->priv->current;
					_tmp25_ = _tmp30_ == _tmp31_;
				}
				if (_tmp25_) {
					GtkWindow* _tmp32_;
					GtkWindow* _tmp33_;
					AppWindow* _tmp34_;
					AppWindow* _tmp35_;
					_tmp32_ = page_get_container (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
					_tmp33_ = _tmp32_;
					app_window_error_message (_ ("All photo source files are missing."), _tmp33_);
					_g_object_unref0 (_tmp33_);
					_tmp34_ = app_window_get_instance ();
					_tmp35_ = _tmp34_;
					app_window_end_fullscreen (_tmp35_);
					_g_object_unref0 (_tmp35_);
					_g_object_unref0 (_vala_next);
					_vala_next = NULL;
					_g_object_unref0 (_vala_next_pixbuf);
					_vala_next_pixbuf = NULL;
					result = FALSE;
					_g_object_unref0 (_tmp15_);
					_g_object_unref0 (view);
					_g_error_free0 (err);
					if (next) {
						*next = _vala_next;
					} else {
						_g_object_unref0 (_vala_next);
					}
					if (next_pixbuf) {
						*next_pixbuf = _vala_next_pixbuf;
					} else {
						_g_object_unref0 (_vala_next_pixbuf);
					}
					return result;
				}
				_g_object_unref0 (_tmp15_);
				_g_object_unref0 (view);
				_g_error_free0 (err);
				continue;
			}
			__finally0:
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				gboolean _tmp36_ = FALSE;
				_g_object_unref0 (_vala_next);
				_g_object_unref0 (_vala_next_pixbuf);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return _tmp36_;
			}
			_tmp37_ = self->priv->controller;
			_tmp38_ = _vala_next;
			view_collection_get_immediate_neighbors (_tmp37_, G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, TYPE_DATA_SOURCE, DataSource), &_tmp39_, &_tmp40_, PHOTO_TYPENAME);
			_g_object_unref0 (forward);
			forward = _tmp39_;
			_g_object_unref0 (back);
			back = _tmp40_;
			_tmp41_ = self->priv->cache;
			_tmp42_ = forward;
			pixbuf_cache_prefetch (_tmp41_, G_TYPE_CHECK_INSTANCE_CAST (_tmp42_, TYPE_PHOTO, Photo), BACKGROUND_JOB_JOB_PRIORITY_HIGHEST, FALSE);
			_tmp43_ = self->priv->cache;
			_tmp44_ = back;
			pixbuf_cache_prefetch (_tmp43_, G_TYPE_CHECK_INSTANCE_CAST (_tmp44_, TYPE_PHOTO, Photo), BACKGROUND_JOB_JOB_PRIORITY_NORMAL, FALSE);
			_tmp45_ = self->priv->controller;
			_tmp46_ = _vala_next;
			_tmp47_ = view_collection_get_extended_neighbors (_tmp45_, G_TYPE_CHECK_INSTANCE_CAST (_tmp46_, TYPE_DATA_SOURCE, DataSource), PHOTO_TYPENAME);
			neighbors = _tmp47_;
			_tmp48_ = neighbors;
			_tmp49_ = forward;
			gee_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp48_, GEE_TYPE_COLLECTION, GeeCollection), _tmp49_);
			_tmp50_ = neighbors;
			_tmp51_ = back;
			gee_collection_remove (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, GEE_TYPE_COLLECTION, GeeCollection), _tmp51_);
			_tmp52_ = self->priv->cache;
			_tmp53_ = neighbors;
			pixbuf_cache_prefetch_many (_tmp52_, G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, GEE_TYPE_COLLECTION, GeeCollection), BACKGROUND_JOB_JOB_PRIORITY_LOWEST, FALSE);
			result = TRUE;
			_g_object_unref0 (neighbors);
			_g_object_unref0 (back);
			_g_object_unref0 (forward);
			if (next) {
				*next = _vala_next;
			} else {
				_g_object_unref0 (_vala_next);
			}
			if (next_pixbuf) {
				*next_pixbuf = _vala_next_pixbuf;
			} else {
				_g_object_unref0 (_vala_next_pixbuf);
			}
			return result;
		}
	}
}

static void
slideshow_page_on_play_pause (SlideshowPage* self)
{
	GTimer* _tmp6_;
	g_return_if_fail (IS_SLIDESHOW_PAGE (self));
	if (self->priv->playing) {
		GtkToolButton* _tmp0_;
		GtkToolButton* _tmp1_;
		GtkToolButton* _tmp2_;
		_tmp0_ = self->priv->play_pause_button;
		gtk_tool_button_set_icon_name (_tmp0_, "media-playback-start-symbolic");
		_tmp1_ = self->priv->play_pause_button;
		gtk_tool_button_set_label (_tmp1_, _ ("Play"));
		_tmp2_ = self->priv->play_pause_button;
		gtk_tool_item_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_tool_item_get_type (), GtkToolItem), _ ("Continue the slideshow"));
	} else {
		GtkToolButton* _tmp3_;
		GtkToolButton* _tmp4_;
		GtkToolButton* _tmp5_;
		_tmp3_ = self->priv->play_pause_button;
		gtk_tool_button_set_icon_name (_tmp3_, "media-playback-pause-symbolic");
		_tmp4_ = self->priv->play_pause_button;
		gtk_tool_button_set_label (_tmp4_, _ ("Pause"));
		_tmp5_ = self->priv->play_pause_button;
		gtk_tool_item_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_tool_item_get_type (), GtkToolItem), _ ("Pause the slideshow"));
	}
	self->priv->playing = !self->priv->playing;
	_tmp6_ = self->priv->timer;
	g_timer_start (_tmp6_);
}

static void
slideshow_page_real_on_previous_photo (SinglePhotoPage* base)
{
	SlideshowPage * self;
	DataView* view = NULL;
	ViewCollection* _tmp0_;
	Photo* _tmp1_;
	DataView* _tmp2_;
	Photo* prev_photo = NULL;
	DataView* start_view = NULL;
	ViewCollection* _tmp3_;
	DataView* _tmp4_;
	DataView* _tmp5_;
	DataView* prev_view = NULL;
	DataView* _tmp6_;
	DataView* _tmp7_;
	Photo* _tmp20_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SLIDESHOW_PAGE, SlideshowPage);
	_tmp0_ = self->priv->controller;
	_tmp1_ = self->priv->current;
	_tmp2_ = view_collection_get_view_for_source (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_SOURCE, DataSource));
	view = _tmp2_;
	prev_photo = NULL;
	_tmp3_ = self->priv->controller;
	_tmp4_ = view;
	_tmp5_ = view_collection_get_previous (_tmp3_, _tmp4_);
	start_view = _tmp5_;
	_tmp6_ = start_view;
	_tmp7_ = _g_object_ref0 (_tmp6_);
	prev_view = _tmp7_;
	while (TRUE) {
		DataView* _tmp8_;
		DataView* _tmp9_;
		DataSource* _tmp10_;
		DataSource* _tmp11_;
		gboolean _tmp12_;
		ViewCollection* _tmp15_;
		DataView* _tmp16_;
		DataView* _tmp17_;
		DataView* _tmp18_;
		DataView* _tmp19_;
		_tmp8_ = prev_view;
		if (!(_tmp8_ != NULL)) {
			break;
		}
		_tmp9_ = prev_view;
		_tmp10_ = data_view_get_source (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = IS_PHOTO (_tmp11_);
		_g_object_unref0 (_tmp11_);
		if (_tmp12_) {
			DataView* _tmp13_;
			DataSource* _tmp14_;
			_tmp13_ = prev_view;
			_tmp14_ = data_view_get_source (_tmp13_);
			_g_object_unref0 (prev_photo);
			prev_photo = G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_PHOTO, Photo);
			break;
		}
		_tmp15_ = self->priv->controller;
		_tmp16_ = prev_view;
		_tmp17_ = view_collection_get_previous (_tmp15_, _tmp16_);
		_g_object_unref0 (prev_view);
		prev_view = _tmp17_;
		_tmp18_ = prev_view;
		_tmp19_ = start_view;
		if (_tmp18_ == _tmp19_) {
			g_warning ("SlideshowPage.vala:291: on_previous( ): can't advance to previous phot" \
"o: collection has only videos");
			_g_object_unref0 (prev_view);
			_g_object_unref0 (start_view);
			_g_object_unref0 (prev_photo);
			_g_object_unref0 (view);
			return;
		}
	}
	_tmp20_ = prev_photo;
	slideshow_page_advance (self, _tmp20_, DIRECTION_BACKWARD);
	_g_object_unref0 (prev_view);
	_g_object_unref0 (start_view);
	_g_object_unref0 (prev_photo);
	_g_object_unref0 (view);
}

static void
slideshow_page_real_on_next_photo (SinglePhotoPage* base)
{
	SlideshowPage * self;
	DataView* view = NULL;
	ViewCollection* _tmp0_;
	Photo* _tmp1_;
	DataView* _tmp2_;
	gboolean wrapped = FALSE;
	Photo* next_photo = NULL;
	DataView* start_view = NULL;
	ViewCollection* _tmp3_;
	DataView* _tmp4_;
	gboolean* _tmp5_ = NULL;
	DataView* _tmp6_;
	gboolean* _tmp7_;
	DataView* _tmp8_;
	gboolean _tmp9_ = FALSE;
	DataView* next_view = NULL;
	DataView* _tmp14_;
	DataView* _tmp15_;
	ConfigFacade* _tmp35_;
	ConfigFacade* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gboolean _tmp39_;
	Photo* _tmp40_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SLIDESHOW_PAGE, SlideshowPage);
	_tmp0_ = self->priv->controller;
	_tmp1_ = self->priv->current;
	_tmp2_ = view_collection_get_view_for_source (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_SOURCE, DataSource));
	view = _tmp2_;
	next_photo = NULL;
	_tmp3_ = self->priv->controller;
	_tmp4_ = view;
	_tmp6_ = view_collection_get_next (_tmp3_, _tmp4_, &_tmp5_);
	_tmp7_ = _tmp5_;
	wrapped = *_tmp7_;
	_tmp8_ = _tmp6_;
	_g_free0 (_tmp7_);
	start_view = _tmp8_;
	if (wrapped) {
		_tmp9_ = self->priv->shuffled;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		ViewCollection* _tmp10_;
		ViewCollection* _tmp11_;
		ViewCollection* _tmp12_;
		DataView* _tmp13_;
		_tmp10_ = self->priv->controller_source;
		_tmp11_ = view_collection_shuffled_copy (_tmp10_, NULL);
		_data_collection_unref0 (self->priv->controller);
		self->priv->controller = _tmp11_;
		_tmp12_ = self->priv->controller;
		_tmp13_ = view_collection_get_first (_tmp12_);
		_g_object_unref0 (start_view);
		start_view = _tmp13_;
	}
	_tmp14_ = start_view;
	_tmp15_ = _g_object_ref0 (_tmp14_);
	next_view = _tmp15_;
	while (TRUE) {
		DataView* _tmp16_;
		DataView* _tmp17_;
		DataSource* _tmp18_;
		DataSource* _tmp19_;
		gboolean _tmp20_;
		ViewCollection* _tmp23_;
		DataView* _tmp24_;
		gboolean* _tmp25_ = NULL;
		DataView* _tmp26_;
		gboolean* _tmp27_;
		gboolean _tmp28_ = FALSE;
		DataView* _tmp33_;
		DataView* _tmp34_;
		_tmp16_ = next_view;
		if (!(_tmp16_ != NULL)) {
			break;
		}
		_tmp17_ = next_view;
		_tmp18_ = data_view_get_source (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = IS_PHOTO (_tmp19_);
		_g_object_unref0 (_tmp19_);
		if (_tmp20_) {
			DataView* _tmp21_;
			DataSource* _tmp22_;
			_tmp21_ = next_view;
			_tmp22_ = data_view_get_source (_tmp21_);
			_g_object_unref0 (next_photo);
			next_photo = G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_PHOTO, Photo);
			break;
		}
		_tmp23_ = self->priv->controller;
		_tmp24_ = next_view;
		_tmp26_ = view_collection_get_next (_tmp23_, _tmp24_, &_tmp25_);
		_tmp27_ = _tmp25_;
		wrapped = *_tmp27_;
		_g_object_unref0 (next_view);
		next_view = _tmp26_;
		_g_free0 (_tmp27_);
		if (wrapped) {
			_tmp28_ = self->priv->shuffled;
		} else {
			_tmp28_ = FALSE;
		}
		if (_tmp28_) {
			ViewCollection* _tmp29_;
			ViewCollection* _tmp30_;
			ViewCollection* _tmp31_;
			DataView* _tmp32_;
			_tmp29_ = self->priv->controller_source;
			_tmp30_ = view_collection_shuffled_copy (_tmp29_, NULL);
			_data_collection_unref0 (self->priv->controller);
			self->priv->controller = _tmp30_;
			_tmp31_ = self->priv->controller;
			_tmp32_ = view_collection_get_first (_tmp31_);
			_g_object_unref0 (start_view);
			start_view = _tmp32_;
		}
		_tmp33_ = next_view;
		_tmp34_ = start_view;
		if (_tmp33_ == _tmp34_) {
			g_warning ("SlideshowPage.vala:324: on_next( ): can't advance to next photo: colle" \
"ction has only videos");
			_g_object_unref0 (next_view);
			_g_object_unref0 (start_view);
			_g_object_unref0 (next_photo);
			_g_object_unref0 (view);
			return;
		}
	}
	_tmp35_ = config_facade_get_instance ();
	_tmp36_ = _tmp35_;
	_tmp37_ = configuration_facade_get_slideshow_transition_effect_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_tmp38_ = _tmp37_;
	_tmp39_ = g_strcmp0 (_tmp38_, RANDOM_EFFECT_DESCRIPTOR_EFFECT_ID) == 0;
	_g_free0 (_tmp38_);
	_g_object_unref0 (_tmp36_);
	if (_tmp39_) {
		slideshow_page_random_transition_effect (self);
	}
	_tmp40_ = next_photo;
	slideshow_page_advance (self, _tmp40_, DIRECTION_FORWARD);
	_g_object_unref0 (next_view);
	_g_object_unref0 (start_view);
	_g_object_unref0 (next_photo);
	_g_object_unref0 (view);
}

static void
slideshow_page_advance (SlideshowPage* self,
                        Photo* photo,
                        Direction direction)
{
	Photo* _tmp0_;
	GdkPixbuf* next_pixbuf = NULL;
	Photo* _tmp1_;
	Photo* _tmp2_ = NULL;
	GdkPixbuf* _tmp3_ = NULL;
	gboolean _tmp4_;
	GTimer* _tmp8_;
	g_return_if_fail (IS_SLIDESHOW_PAGE (self));
	g_return_if_fail (IS_PHOTO (photo));
	_tmp0_ = _g_object_ref0 (photo);
	_g_object_unref0 (self->priv->current);
	self->priv->current = _tmp0_;
	_tmp1_ = self->priv->current;
	_tmp4_ = slideshow_page_get_next_photo (self, _tmp1_, direction, &_tmp2_, &_tmp3_);
	_g_object_unref0 (self->priv->current);
	self->priv->current = _tmp2_;
	_g_object_unref0 (next_pixbuf);
	next_pixbuf = _tmp3_;
	if (_tmp4_) {
		GdkPixbuf* _tmp5_;
		Photo* _tmp6_;
		Dimensions _tmp7_ = {0};
		_tmp5_ = next_pixbuf;
		_tmp6_ = self->priv->current;
		media_source_get_dimensions (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_MEDIA_SOURCE, MediaSource), PHOTO_EXCEPTION_NONE, &_tmp7_);
		single_photo_page_set_pixbuf (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), _tmp5_, &_tmp7_, &direction);
	}
	_tmp8_ = self->priv->timer;
	g_timer_start (_tmp8_);
	_g_object_unref0 (next_pixbuf);
}

static gboolean
slideshow_page_auto_advance (SlideshowPage* self)
{
	GTimer* _tmp0_;
	ConfigFacade* _tmp1_;
	ConfigFacade* _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	g_return_val_if_fail (IS_SLIDESHOW_PAGE (self), FALSE);
	if (self->priv->exiting) {
		result = FALSE;
		return result;
	}
	if (!self->priv->playing) {
		result = TRUE;
		return result;
	}
	_tmp0_ = self->priv->timer;
	_tmp1_ = config_facade_get_instance ();
	_tmp2_ = _tmp1_;
	_tmp3_ = g_timer_elapsed (_tmp0_, NULL) < configuration_facade_get_slideshow_delay (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		result = TRUE;
		return result;
	}
	single_photo_page_on_next_photo (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage));
	result = TRUE;
	return result;
}

static gboolean
slideshow_page_real_key_press_event (GtkWidget* base,
                                     GdkEventKey* event)
{
	SlideshowPage * self;
	gboolean handled = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	gboolean _tmp4_ = FALSE;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SLIDESHOW_PAGE, SlideshowPage);
	g_return_val_if_fail (event != NULL, FALSE);
	handled = TRUE;
	_tmp0_ = gdk_keyval_name (event->keyval);
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if ((_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("Down")))) || (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("KP_Down"))))) {
		switch (0) {
			default:
			{
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("space")))) {
		switch (0) {
			default:
			{
				slideshow_page_on_play_pause (self);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				handled = FALSE;
				break;
			}
		}
	}
	if (handled) {
		result = TRUE;
		return result;
	}
	if (GTK_WIDGET_CLASS (slideshow_page_parent_class)->key_press_event != NULL) {
		_tmp4_ = GTK_WIDGET_CLASS (slideshow_page_parent_class)->key_press_event (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), gtk_widget_get_type (), GtkWidget), event);
	} else {
		_tmp4_ = TRUE;
	}
	result = _tmp4_;
	return result;
}

static void
slideshow_page_on_change_settings (SlideshowPage* self)
{
	SlideshowPageSettingsDialog* settings_dialog = NULL;
	SlideshowPageSettingsDialog* _tmp0_;
	SlideshowPageSettingsDialog* _tmp1_;
	gboolean slideshow_playing = FALSE;
	gboolean old_shuffled = FALSE;
	ConfigFacade* _tmp2_;
	ConfigFacade* _tmp3_;
	gboolean _tmp4_;
	SlideshowPageSettingsDialog* _tmp5_;
	gboolean _tmp23_ = FALSE;
	SlideshowPageSettingsDialog* _tmp30_;
	GTimer* _tmp31_;
	g_return_if_fail (IS_SLIDESHOW_PAGE (self));
	_tmp0_ = slideshow_page_settings_dialog_new ();
	g_object_ref_sink (_tmp0_);
	settings_dialog = _tmp0_;
	_tmp1_ = settings_dialog;
	gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
	slideshow_playing = self->priv->playing;
	self->priv->playing = FALSE;
	g_signal_emit (self, slideshow_page_signals[SLIDESHOW_PAGE_HIDE_TOOLBAR_SIGNAL], 0);
	page_suspend_cursor_hiding (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp2_ = config_facade_get_instance ();
	_tmp3_ = _tmp2_;
	_tmp4_ = configuration_facade_get_slideshow_shuffle (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp3_);
	old_shuffled = _tmp4_;
	_tmp5_ = settings_dialog;
	if (gtk_dialog_run (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_dialog_get_type (), GtkDialog)) == ((gint) GTK_RESPONSE_OK)) {
		ConfigFacade* _tmp6_;
		ConfigFacade* _tmp7_;
		SlideshowPageSettingsDialog* _tmp8_;
		ConfigFacade* _tmp9_;
		ConfigFacade* _tmp10_;
		SlideshowPageSettingsDialog* _tmp11_;
		ConfigFacade* _tmp12_;
		ConfigFacade* _tmp13_;
		SlideshowPageSettingsDialog* _tmp14_;
		gchar* _tmp15_;
		gchar* _tmp16_;
		ConfigFacade* _tmp17_;
		ConfigFacade* _tmp18_;
		SlideshowPageSettingsDialog* _tmp19_;
		SlideshowPageSettingsDialog* _tmp20_;
		ConfigFacade* _tmp21_;
		ConfigFacade* _tmp22_;
		_tmp6_ = config_facade_get_instance ();
		_tmp7_ = _tmp6_;
		_tmp8_ = settings_dialog;
		configuration_facade_set_slideshow_delay (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), slideshow_page_settings_dialog_get_delay (_tmp8_));
		_g_object_unref0 (_tmp7_);
		_tmp9_ = config_facade_get_instance ();
		_tmp10_ = _tmp9_;
		_tmp11_ = settings_dialog;
		configuration_facade_set_slideshow_transition_delay (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), slideshow_page_settings_dialog_get_transition_delay (_tmp11_));
		_g_object_unref0 (_tmp10_);
		_tmp12_ = config_facade_get_instance ();
		_tmp13_ = _tmp12_;
		_tmp14_ = settings_dialog;
		_tmp15_ = slideshow_page_settings_dialog_get_transition_effect_id (_tmp14_);
		_tmp16_ = _tmp15_;
		configuration_facade_set_slideshow_transition_effect_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), _tmp16_);
		_g_free0 (_tmp16_);
		_g_object_unref0 (_tmp13_);
		_tmp17_ = config_facade_get_instance ();
		_tmp18_ = _tmp17_;
		_tmp19_ = settings_dialog;
		configuration_facade_set_slideshow_show_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), slideshow_page_settings_dialog_get_show_title (_tmp19_));
		_g_object_unref0 (_tmp18_);
		_tmp20_ = settings_dialog;
		self->priv->shuffled = slideshow_page_settings_dialog_get_shuffle (_tmp20_);
		_tmp21_ = config_facade_get_instance ();
		_tmp22_ = _tmp21_;
		configuration_facade_set_slideshow_shuffle (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), self->priv->shuffled);
		_g_object_unref0 (_tmp22_);
		slideshow_page_update_transition_effect (self);
	}
	if (old_shuffled) {
		_tmp23_ = !self->priv->shuffled;
	} else {
		_tmp23_ = FALSE;
	}
	if (_tmp23_) {
		ViewCollection* _tmp24_;
		ViewCollection* _tmp25_;
		_tmp24_ = self->priv->controller_source;
		_tmp25_ = _data_collection_ref0 (_tmp24_);
		_data_collection_unref0 (self->priv->controller);
		self->priv->controller = _tmp25_;
	} else {
		gboolean _tmp26_ = FALSE;
		if (!old_shuffled) {
			_tmp26_ = self->priv->shuffled;
		} else {
			_tmp26_ = FALSE;
		}
		if (_tmp26_) {
			ViewCollection* _tmp27_;
			Photo* _tmp28_;
			ViewCollection* _tmp29_;
			_tmp27_ = self->priv->controller_source;
			_tmp28_ = self->priv->current;
			_tmp29_ = view_collection_shuffled_copy (_tmp27_, _tmp28_);
			_data_collection_unref0 (self->priv->controller);
			self->priv->controller = _tmp29_;
		}
	}
	_tmp30_ = settings_dialog;
	gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, gtk_widget_get_type (), GtkWidget));
	page_restore_cursor_hiding (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	self->priv->playing = slideshow_playing;
	_tmp31_ = self->priv->timer;
	g_timer_start (_tmp31_);
	_g_object_unref0 (settings_dialog);
}

static void
slideshow_page_update_transition_effect (SlideshowPage* self)
{
	gchar* effect_id = NULL;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gdouble effect_delay = 0.0;
	ConfigFacade* _tmp4_;
	ConfigFacade* _tmp5_;
	gdouble _tmp6_;
	g_return_if_fail (IS_SLIDESHOW_PAGE (self));
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = configuration_facade_get_slideshow_transition_effect_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	effect_id = _tmp3_;
	_tmp4_ = config_facade_get_instance ();
	_tmp5_ = _tmp4_;
	_tmp6_ = configuration_facade_get_slideshow_transition_delay (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp5_);
	effect_delay = _tmp6_;
	single_photo_page_set_transition (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), effect_id, (gint) (effect_delay * 1000.0));
	_g_free0 (effect_id);
}

static void
slideshow_page_random_transition_effect (SlideshowPage* self)
{
	gdouble effect_delay = 0.0;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	gdouble _tmp2_;
	gchar* effect_id = NULL;
	gchar* _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	const gchar* _tmp9_;
	g_return_if_fail (IS_SLIDESHOW_PAGE (self));
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = configuration_facade_get_slideshow_transition_delay (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp1_);
	effect_delay = _tmp2_;
	_tmp3_ = g_strdup (TRANSITION_EFFECTS_MANAGER_NULL_EFFECT_ID);
	effect_id = _tmp3_;
	_tmp4_ = self->priv->transitions;
	_tmp4__length1 = self->priv->transitions_length1;
	if (0 < _tmp4__length1) {
		gint random = 0;
		gchar** _tmp5_;
		gint _tmp5__length1;
		gchar** _tmp6_;
		gint _tmp6__length1;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		_tmp5_ = self->priv->transitions;
		_tmp5__length1 = self->priv->transitions_length1;
		random = (gint) g_random_int_range ((gint32) 0, (gint32) _tmp5__length1);
		_tmp6_ = self->priv->transitions;
		_tmp6__length1 = self->priv->transitions_length1;
		_tmp7_ = _tmp6_[random];
		_tmp8_ = g_strdup (_tmp7_);
		_g_free0 (effect_id);
		effect_id = _tmp8_;
	}
	_tmp9_ = effect_id;
	single_photo_page_set_transition (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), _tmp9_, (gint) (effect_delay * 1000.0));
	_g_free0 (effect_id);
}

static void
slideshow_page_paint_title (SlideshowPage* self,
                            cairo_t* ctx,
                            Dimensions* ctx_dim)
{
	gchar* title = NULL;
	Photo* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_;
	PangoLayout* layout = NULL;
	const gchar* _tmp5_;
	PangoLayout* _tmp6_;
	PangoAttrList* list = NULL;
	PangoAttrList* _tmp7_;
	PangoAttribute* size = NULL;
	PangoAttribute* _tmp8_;
	PangoAttrList* _tmp9_;
	PangoAttribute* _tmp10_;
	PangoAttribute* _tmp11_;
	PangoLayout* _tmp12_;
	PangoAttrList* _tmp13_;
	PangoLayout* _tmp14_;
	Dimensions _tmp15_;
	gint title_width = 0;
	gint title_height = 0;
	PangoLayout* _tmp16_;
	gint _tmp17_ = 0;
	gint _tmp18_ = 0;
	gdouble x = 0.0;
	Dimensions _tmp19_;
	gdouble y = 0.0;
	Dimensions _tmp20_;
	Dimensions _tmp21_;
	Dimensions _tmp23_;
	PangoLayout* _tmp25_;
	PangoLayout* _tmp26_;
	g_return_if_fail (IS_SLIDESHOW_PAGE (self));
	g_return_if_fail (ctx != NULL);
	g_return_if_fail (ctx_dim != NULL);
	_tmp0_ = self->priv->current;
	_tmp1_ = media_source_get_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_MEDIA_SOURCE, MediaSource));
	title = _tmp1_;
	_tmp3_ = title;
	if (_tmp3_ == NULL) {
		_tmp2_ = TRUE;
	} else {
		const gchar* _tmp4_;
		_tmp4_ = title;
		_tmp2_ = g_strcmp0 (_tmp4_, "") == 0;
	}
	if (_tmp2_) {
		_g_free0 (title);
		return;
	}
	_tmp5_ = title;
	_tmp6_ = gtk_widget_create_pango_layout (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), _tmp5_);
	layout = _tmp6_;
	_tmp7_ = pango_attr_list_new ();
	list = _tmp7_;
	_tmp8_ = pango_attr_scale_new ((gdouble) 3);
	size = _tmp8_;
	_tmp9_ = list;
	_tmp10_ = size;
	_tmp11_ = pango_attribute_copy (_tmp10_);
	pango_attr_list_insert (_tmp9_, _tmp11_);
	_tmp12_ = layout;
	_tmp13_ = list;
	pango_layout_set_attributes (_tmp12_, _tmp13_);
	_tmp14_ = layout;
	_tmp15_ = *ctx_dim;
	pango_layout_set_width (_tmp14_, (gint) ((_tmp15_.width * 0.9) * PANGO_SCALE));
	_tmp16_ = layout;
	pango_layout_get_pixel_size (_tmp16_, &_tmp17_, &_tmp18_);
	title_width = _tmp17_;
	title_height = _tmp18_;
	_tmp19_ = *ctx_dim;
	x = _tmp19_.width * 0.2;
	_tmp20_ = *ctx_dim;
	y = _tmp20_.height * 0.90;
	_tmp21_ = *ctx_dim;
	if ((y + title_height) >= (_tmp21_.height * 0.95)) {
		Dimensions _tmp22_;
		_tmp22_ = *ctx_dim;
		y = (_tmp22_.height * 0.95) - title_height;
	}
	_tmp23_ = *ctx_dim;
	if ((x + title_width) >= (_tmp23_.width * 0.95)) {
		Dimensions _tmp24_;
		_tmp24_ = *ctx_dim;
		x = (gdouble) ((_tmp24_.width / 2) - (title_width / 2));
	}
	set_source_color_from_string (ctx, "#fff");
	cairo_move_to (ctx, x, y);
	_tmp25_ = layout;
	pango_cairo_show_layout (ctx, _tmp25_);
	_tmp26_ = layout;
	pango_cairo_layout_path (ctx, _tmp26_);
	cairo_set_line_width (ctx, 1.5);
	set_source_color_from_string (ctx, "#000");
	cairo_stroke (ctx);
	_pango_attribute_destroy0 (size);
	_pango_attr_list_unref0 (list);
	_g_object_unref0 (layout);
	_g_free0 (title);
}

static void
slideshow_page_real_paint (SinglePhotoPage* base,
                           cairo_t* ctx,
                           Dimensions* ctx_dim)
{
	SlideshowPage * self;
	Dimensions _tmp0_;
	gboolean _tmp1_ = FALSE;
	ConfigFacade* _tmp2_;
	ConfigFacade* _tmp3_;
	gboolean _tmp4_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_SLIDESHOW_PAGE, SlideshowPage);
	g_return_if_fail (ctx != NULL);
	g_return_if_fail (ctx_dim != NULL);
	_tmp0_ = *ctx_dim;
	SINGLE_PHOTO_PAGE_CLASS (slideshow_page_parent_class)->paint (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage), ctx, &_tmp0_);
	_tmp2_ = config_facade_get_instance ();
	_tmp3_ = _tmp2_;
	_tmp4_ = configuration_facade_get_slideshow_show_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp3_);
	if (_tmp4_) {
		_tmp1_ = !single_photo_page_is_transition_in_progress (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_SINGLE_PHOTO_PAGE, SinglePhotoPage));
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		Dimensions _tmp5_;
		_tmp5_ = *ctx_dim;
		slideshow_page_paint_title (self, ctx, &_tmp5_);
	}
}

static inline gpointer
slideshow_page_settings_dialog_get_instance_private (SlideshowPageSettingsDialog* self)
{
	return G_STRUCT_MEMBER_P (self, SlideshowPageSettingsDialog_private_offset);
}

static gint
_utf8_ci_compare_gcompare_data_func (gconstpointer a,
                                     gconstpointer b,
                                     gpointer self)
{
	gint result;
	result = utf8_ci_compare ((const gchar*) a, (const gchar*) b);
	return result;
}

static void
_slideshow_page_settings_dialog_on_transition_changed_gtk_combo_box_changed (GtkComboBox* _sender,
                                                                             gpointer self)
{
	slideshow_page_settings_dialog_on_transition_changed ((SlideshowPageSettingsDialog*) self);
}

static SlideshowPageSettingsDialog*
slideshow_page_settings_dialog_construct (GType object_type)
{
	SlideshowPageSettingsDialog * self = NULL;
	gdouble delay = 0.0;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	gdouble _tmp2_;
	FullscreenWindow* _tmp3_;
	FullscreenWindow* _tmp4_;
	GtkAdjustment* _tmp5_;
	gchar* effect_id = NULL;
	ConfigFacade* _tmp6_;
	ConfigFacade* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* null_display_name = NULL;
	TransitionEffectsManager* _tmp10_;
	TransitionEffectsManager* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	GtkComboBoxText* _tmp14_;
	const gchar* _tmp15_;
	GtkComboBoxText* _tmp16_;
	gint i = 0;
	GtkComboBoxText* _tmp39_;
	gdouble transition_delay = 0.0;
	ConfigFacade* _tmp40_;
	ConfigFacade* _tmp41_;
	gdouble _tmp42_;
	GtkAdjustment* _tmp43_;
	gboolean show_title = FALSE;
	ConfigFacade* _tmp44_;
	ConfigFacade* _tmp45_;
	gboolean _tmp46_;
	GtkCheckButton* _tmp47_;
	gboolean shuffle = FALSE;
	ConfigFacade* _tmp48_;
	ConfigFacade* _tmp49_;
	gboolean _tmp50_;
	GtkCheckButton* _tmp51_;
	self = (SlideshowPageSettingsDialog*) g_object_new (object_type, "use-header-bar", resources_use_header_bar (), NULL);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = configuration_facade_get_slideshow_delay (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp1_);
	delay = _tmp2_;
	_tmp3_ = app_window_get_fullscreen ();
	_tmp4_ = _tmp3_;
	gtk_window_set_transient_for (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_window_get_type (), GtkWindow), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, gtk_window_get_type (), GtkWindow));
	_g_object_unref0 (_tmp4_);
	_tmp5_ = self->priv->delay_adjustment;
	gtk_adjustment_set_value (_tmp5_, delay);
	_tmp6_ = config_facade_get_instance ();
	_tmp7_ = _tmp6_;
	_tmp8_ = configuration_facade_get_slideshow_transition_effect_id (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_tmp9_ = _tmp8_;
	_g_object_unref0 (_tmp7_);
	effect_id = _tmp9_;
	_tmp10_ = transition_effects_manager_get_instance ();
	_tmp11_ = _tmp10_;
	_tmp12_ = transition_effects_manager_get_effect_name (_tmp11_, TRANSITION_EFFECTS_MANAGER_NULL_EFFECT_ID);
	_tmp13_ = _tmp12_;
	_transition_effects_manager_unref0 (_tmp11_);
	null_display_name = _tmp13_;
	_tmp14_ = self->priv->transition_effect_selector;
	_tmp15_ = null_display_name;
	gtk_combo_box_text_append_text (_tmp14_, _tmp15_);
	_tmp16_ = self->priv->transition_effect_selector;
	gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_combo_box_get_type (), GtkComboBox), 0);
	i = 1;
	{
		GeeIterator* _display_name_it = NULL;
		TransitionEffectsManager* _tmp17_;
		TransitionEffectsManager* _tmp18_;
		GeeCollection* _tmp19_;
		GeeCollection* _tmp20_;
		GeeIterator* _tmp21_;
		GeeIterator* _tmp22_;
		_tmp17_ = transition_effects_manager_get_instance ();
		_tmp18_ = _tmp17_;
		_tmp19_ = transition_effects_manager_get_effect_names (_tmp18_, _utf8_ci_compare_gcompare_data_func, NULL, NULL);
		_tmp20_ = _tmp19_;
		_tmp21_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, GEE_TYPE_ITERABLE, GeeIterable));
		_tmp22_ = _tmp21_;
		_g_object_unref0 (_tmp20_);
		_transition_effects_manager_unref0 (_tmp18_);
		_display_name_it = _tmp22_;
		while (TRUE) {
			GeeIterator* _tmp23_;
			gchar* display_name = NULL;
			GeeIterator* _tmp24_;
			gpointer _tmp25_;
			const gchar* _tmp26_;
			const gchar* _tmp27_;
			GtkComboBoxText* _tmp28_;
			const gchar* _tmp29_;
			const gchar* _tmp30_;
			TransitionEffectsManager* _tmp31_;
			TransitionEffectsManager* _tmp32_;
			const gchar* _tmp33_;
			gchar* _tmp34_;
			gchar* _tmp35_;
			gboolean _tmp36_;
			gint _tmp38_;
			_tmp23_ = _display_name_it;
			if (!gee_iterator_next (_tmp23_)) {
				break;
			}
			_tmp24_ = _display_name_it;
			_tmp25_ = gee_iterator_get (_tmp24_);
			display_name = (gchar*) _tmp25_;
			_tmp26_ = display_name;
			_tmp27_ = null_display_name;
			if (g_strcmp0 (_tmp26_, _tmp27_) == 0) {
				_g_free0 (display_name);
				continue;
			}
			_tmp28_ = self->priv->transition_effect_selector;
			_tmp29_ = display_name;
			gtk_combo_box_text_append_text (_tmp28_, _tmp29_);
			_tmp30_ = effect_id;
			_tmp31_ = transition_effects_manager_get_instance ();
			_tmp32_ = _tmp31_;
			_tmp33_ = display_name;
			_tmp34_ = transition_effects_manager_get_id_for_effect_name (_tmp32_, _tmp33_);
			_tmp35_ = _tmp34_;
			_tmp36_ = g_strcmp0 (_tmp30_, _tmp35_) == 0;
			_g_free0 (_tmp35_);
			_transition_effects_manager_unref0 (_tmp32_);
			if (_tmp36_) {
				GtkComboBoxText* _tmp37_;
				_tmp37_ = self->priv->transition_effect_selector;
				gtk_combo_box_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp37_, gtk_combo_box_get_type (), GtkComboBox), i);
			}
			i = i + 1;
			_tmp38_ = i;
			_g_free0 (display_name);
		}
		_g_object_unref0 (_display_name_it);
	}
	_tmp39_ = self->priv->transition_effect_selector;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp39_, gtk_combo_box_get_type (), GtkComboBox), "changed", (GCallback) _slideshow_page_settings_dialog_on_transition_changed_gtk_combo_box_changed, self, 0);
	_tmp40_ = config_facade_get_instance ();
	_tmp41_ = _tmp40_;
	_tmp42_ = configuration_facade_get_slideshow_transition_delay (G_TYPE_CHECK_INSTANCE_CAST (_tmp41_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp41_);
	transition_delay = _tmp42_;
	_tmp43_ = self->priv->transition_effect_adjustment;
	gtk_adjustment_set_value (_tmp43_, transition_delay);
	_tmp44_ = config_facade_get_instance ();
	_tmp45_ = _tmp44_;
	_tmp46_ = configuration_facade_get_slideshow_show_title (G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp45_);
	show_title = _tmp46_;
	_tmp47_ = self->priv->show_title_button;
	gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp47_, gtk_toggle_button_get_type (), GtkToggleButton), show_title);
	_tmp48_ = config_facade_get_instance ();
	_tmp49_ = _tmp48_;
	_tmp50_ = configuration_facade_get_slideshow_shuffle (G_TYPE_CHECK_INSTANCE_CAST (_tmp49_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp49_);
	shuffle = _tmp50_;
	_tmp51_ = self->priv->shuffle_button;
	gtk_toggle_button_set_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, gtk_toggle_button_get_type (), GtkToggleButton), shuffle);
	slideshow_page_settings_dialog_on_transition_changed (self);
	_g_free0 (null_display_name);
	_g_free0 (effect_id);
	return self;
}

static SlideshowPageSettingsDialog*
slideshow_page_settings_dialog_new (void)
{
	return slideshow_page_settings_dialog_construct (SLIDESHOW_PAGE_TYPE_SETTINGS_DIALOG);
}

static void
slideshow_page_settings_dialog_on_transition_changed (SlideshowPageSettingsDialog* self)
{
	gchar* selected = NULL;
	GtkComboBoxText* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_;
	gboolean sensitive = FALSE;
	GtkScale* _tmp5_;
	GtkSpinButton* _tmp6_;
	g_return_if_fail (SLIDESHOW_PAGE_IS_SETTINGS_DIALOG (self));
	_tmp0_ = self->priv->transition_effect_selector;
	_tmp1_ = gtk_combo_box_text_get_active_text (_tmp0_);
	selected = _tmp1_;
	_tmp3_ = selected;
	if (_tmp3_ != NULL) {
		const gchar* _tmp4_;
		_tmp4_ = selected;
		_tmp2_ = g_strcmp0 (_tmp4_, TRANSITION_EFFECTS_MANAGER_NULL_EFFECT_ID) != 0;
	} else {
		_tmp2_ = FALSE;
	}
	sensitive = _tmp2_;
	_tmp5_ = self->priv->transition_effect_hscale;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, gtk_widget_get_type (), GtkWidget), sensitive);
	_tmp6_ = self->priv->transition_effect_entry;
	gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, gtk_widget_get_type (), GtkWidget), sensitive);
	_g_free0 (selected);
}

static gdouble
slideshow_page_settings_dialog_get_delay (SlideshowPageSettingsDialog* self)
{
	GtkSpinButton* _tmp0_;
	gdouble result;
	g_return_val_if_fail (SLIDESHOW_PAGE_IS_SETTINGS_DIALOG (self), -1.0);
	_tmp0_ = self->priv->delay_entry;
	result = gtk_spin_button_get_value (_tmp0_);
	return result;
}

static gdouble
slideshow_page_settings_dialog_get_transition_delay (SlideshowPageSettingsDialog* self)
{
	GtkSpinButton* _tmp0_;
	gdouble result;
	g_return_val_if_fail (SLIDESHOW_PAGE_IS_SETTINGS_DIALOG (self), -1.0);
	_tmp0_ = self->priv->transition_effect_entry;
	result = gtk_spin_button_get_value (_tmp0_);
	return result;
}

static gchar*
slideshow_page_settings_dialog_get_transition_effect_id (SlideshowPageSettingsDialog* self)
{
	gchar* active = NULL;
	GtkComboBoxText* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* id = NULL;
	TransitionEffectsManager* _tmp4_;
	TransitionEffectsManager* _tmp5_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	const gchar* _tmp9_ = NULL;
	const gchar* _tmp10_;
	gchar* _tmp12_;
	gchar* result;
	g_return_val_if_fail (SLIDESHOW_PAGE_IS_SETTINGS_DIALOG (self), NULL);
	_tmp0_ = self->priv->transition_effect_selector;
	_tmp1_ = gtk_combo_box_text_get_active_text (_tmp0_);
	active = _tmp1_;
	_tmp2_ = active;
	if (_tmp2_ == NULL) {
		gchar* _tmp3_;
		_tmp3_ = g_strdup (TRANSITION_EFFECTS_MANAGER_NULL_EFFECT_ID);
		result = _tmp3_;
		_g_free0 (active);
		return result;
	}
	_tmp4_ = transition_effects_manager_get_instance ();
	_tmp5_ = _tmp4_;
	_tmp6_ = active;
	_tmp7_ = transition_effects_manager_get_id_for_effect_name (_tmp5_, _tmp6_);
	_tmp8_ = _tmp7_;
	_transition_effects_manager_unref0 (_tmp5_);
	id = _tmp8_;
	_tmp10_ = id;
	if (_tmp10_ != NULL) {
		const gchar* _tmp11_;
		_tmp11_ = id;
		_tmp9_ = _tmp11_;
	} else {
		_tmp9_ = TRANSITION_EFFECTS_MANAGER_NULL_EFFECT_ID;
	}
	_tmp12_ = g_strdup (_tmp9_);
	result = _tmp12_;
	_g_free0 (id);
	_g_free0 (active);
	return result;
}

static gboolean
slideshow_page_settings_dialog_get_show_title (SlideshowPageSettingsDialog* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (SLIDESHOW_PAGE_IS_SETTINGS_DIALOG (self), FALSE);
	_tmp0_ = self->priv->show_title_button;
	_tmp1_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_toggle_button_get_type (), GtkToggleButton));
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static gboolean
slideshow_page_settings_dialog_get_shuffle (SlideshowPageSettingsDialog* self)
{
	GtkCheckButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	g_return_val_if_fail (SLIDESHOW_PAGE_IS_SETTINGS_DIALOG (self), FALSE);
	_tmp0_ = self->priv->shuffle_button;
	_tmp1_ = gtk_toggle_button_get_active (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_toggle_button_get_type (), GtkToggleButton));
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static void
slideshow_page_settings_dialog_class_init (SlideshowPageSettingsDialogClass * klass,
                                           gpointer klass_data)
{
	slideshow_page_settings_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SlideshowPageSettingsDialog_private_offset);
	G_OBJECT_CLASS (klass)->finalize = slideshow_page_settings_dialog_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/Shotwell/ui/slideshow_settings.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delay_adjustment", FALSE, SlideshowPageSettingsDialog_private_offset + G_STRUCT_OFFSET (SlideshowPageSettingsDialogPrivate, delay_adjustment));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "delay_entry", FALSE, SlideshowPageSettingsDialog_private_offset + G_STRUCT_OFFSET (SlideshowPageSettingsDialogPrivate, delay_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "transition_effect_selector", FALSE, SlideshowPageSettingsDialog_private_offset + G_STRUCT_OFFSET (SlideshowPageSettingsDialogPrivate, transition_effect_selector));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "transition_effect_hscale", FALSE, SlideshowPageSettingsDialog_private_offset + G_STRUCT_OFFSET (SlideshowPageSettingsDialogPrivate, transition_effect_hscale));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "transition_effect_entry", FALSE, SlideshowPageSettingsDialog_private_offset + G_STRUCT_OFFSET (SlideshowPageSettingsDialogPrivate, transition_effect_entry));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "transition_effect_adjustment", FALSE, SlideshowPageSettingsDialog_private_offset + G_STRUCT_OFFSET (SlideshowPageSettingsDialogPrivate, transition_effect_adjustment));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "show_title_button", FALSE, SlideshowPageSettingsDialog_private_offset + G_STRUCT_OFFSET (SlideshowPageSettingsDialogPrivate, show_title_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "shuffle_button", FALSE, SlideshowPageSettingsDialog_private_offset + G_STRUCT_OFFSET (SlideshowPageSettingsDialogPrivate, shuffle_button));
}

static void
slideshow_page_settings_dialog_instance_init (SlideshowPageSettingsDialog * self,
                                              gpointer klass)
{
	self->priv = slideshow_page_settings_dialog_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
slideshow_page_settings_dialog_finalize (GObject * obj)
{
	SlideshowPageSettingsDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLIDESHOW_PAGE_TYPE_SETTINGS_DIALOG, SlideshowPageSettingsDialog);
	G_OBJECT_CLASS (slideshow_page_settings_dialog_parent_class)->finalize (obj);
}

static GType
slideshow_page_settings_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SlideshowPageSettingsDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) slideshow_page_settings_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SlideshowPageSettingsDialog), 0, (GInstanceInitFunc) slideshow_page_settings_dialog_instance_init, NULL };
	GType slideshow_page_settings_dialog_type_id;
	slideshow_page_settings_dialog_type_id = g_type_register_static (gtk_dialog_get_type (), "SlideshowPageSettingsDialog", &g_define_type_info, 0);
	SlideshowPageSettingsDialog_private_offset = g_type_add_instance_private (slideshow_page_settings_dialog_type_id, sizeof (SlideshowPageSettingsDialogPrivate));
	return slideshow_page_settings_dialog_type_id;
}

static GType
slideshow_page_settings_dialog_get_type (void)
{
	static volatile gsize slideshow_page_settings_dialog_type_id__once = 0;
	if (g_once_init_enter (&slideshow_page_settings_dialog_type_id__once)) {
		GType slideshow_page_settings_dialog_type_id;
		slideshow_page_settings_dialog_type_id = slideshow_page_settings_dialog_get_type_once ();
		g_once_init_leave (&slideshow_page_settings_dialog_type_id__once, slideshow_page_settings_dialog_type_id);
	}
	return slideshow_page_settings_dialog_type_id__once;
}

static void
slideshow_page_class_init (SlideshowPageClass * klass,
                           gpointer klass_data)
{
	slideshow_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SlideshowPage_private_offset);
	((PageClass *) klass)->switched_to = (void (*) (Page*)) slideshow_page_real_switched_to;
	((PageClass *) klass)->switching_from = (void (*) (Page*)) slideshow_page_real_switching_from;
	((SinglePhotoPageClass *) klass)->on_previous_photo = (void (*) (SinglePhotoPage*)) slideshow_page_real_on_previous_photo;
	((SinglePhotoPageClass *) klass)->on_next_photo = (void (*) (SinglePhotoPage*)) slideshow_page_real_on_next_photo;
	((GtkWidgetClass *) klass)->key_press_event = (gboolean (*) (GtkWidget*, GdkEventKey*)) slideshow_page_real_key_press_event;
	((SinglePhotoPageClass *) klass)->paint = (void (*) (SinglePhotoPage*, cairo_t*, Dimensions*)) slideshow_page_real_paint;
	G_OBJECT_CLASS (klass)->finalize = slideshow_page_finalize;
	slideshow_page_signals[SLIDESHOW_PAGE_HIDE_TOOLBAR_SIGNAL] = g_signal_new ("hide-toolbar", TYPE_SLIDESHOW_PAGE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
slideshow_page_instance_init (SlideshowPage * self,
                              gpointer klass)
{
	GTimer* _tmp0_;
	self->priv = slideshow_page_get_instance_private (self);
	self->priv->cache = NULL;
	_tmp0_ = g_timer_new ();
	self->priv->timer = _tmp0_;
	self->priv->playing = TRUE;
	self->priv->exiting = FALSE;
}

static void
slideshow_page_finalize (GObject * obj)
{
	SlideshowPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_SLIDESHOW_PAGE, SlideshowPage);
	_data_collection_unref0 (self->priv->sources);
	_data_collection_unref0 (self->priv->controller_source);
	_data_collection_unref0 (self->priv->controller);
	_g_object_unref0 (self->priv->current);
	_g_object_unref0 (self->priv->play_pause_button);
	_g_object_unref0 (self->priv->settings_button);
	_g_object_unref0 (self->priv->cache);
	_g_timer_destroy0 (self->priv->timer);
	self->priv->transitions = (_vala_array_free (self->priv->transitions, self->priv->transitions_length1, (GDestroyNotify) g_free), NULL);
	_screensaver_unref0 (self->priv->screensaver);
	G_OBJECT_CLASS (slideshow_page_parent_class)->finalize (obj);
}

static GType
slideshow_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SlideshowPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) slideshow_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SlideshowPage), 0, (GInstanceInitFunc) slideshow_page_instance_init, NULL };
	GType slideshow_page_type_id;
	slideshow_page_type_id = g_type_register_static (TYPE_SINGLE_PHOTO_PAGE, "SlideshowPage", &g_define_type_info, 0);
	SlideshowPage_private_offset = g_type_add_instance_private (slideshow_page_type_id, sizeof (SlideshowPagePrivate));
	return slideshow_page_type_id;
}

GType
slideshow_page_get_type (void)
{
	static volatile gsize slideshow_page_type_id__once = 0;
	if (g_once_init_enter (&slideshow_page_type_id__once)) {
		GType slideshow_page_type_id;
		slideshow_page_type_id = slideshow_page_get_type_once ();
		g_once_init_leave (&slideshow_page_type_id__once, slideshow_page_type_id);
	}
	return slideshow_page_type_id__once;
}

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

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

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

