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

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

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <cairo-gobject.h>
#include <gdk/gdk.h>
#include <float.h>
#include <math.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <pango/pango.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <gee.h>
#include <glib/gi18n-lib.h>

#define MEDIA_PAGE_SORT_ORDER_ASCENDING 0
#define MEDIA_PAGE_SORT_ORDER_DESCENDING 1
#define MEDIA_PAGE_MANUAL_STEPPING 16
#define MEDIA_PAGE_SLIDER_STEPPING 4
#define CHECKERBOARD_ITEM_PROP_SHOW_TITLES "show-titles"
#define CHECKERBOARD_ITEM_PROP_SHOW_COMMENTS "show-comments"
#define CHECKERBOARD_ITEM_PROP_SHOW_SUBTITLES "show-subtitles"
#define THUMBNAIL_PROP_SHOW_TAGS CHECKERBOARD_ITEM_PROP_SHOW_SUBTITLES
#define THUMBNAIL_PROP_SIZE "thumbnail-size"
#define THUMBNAIL_PROP_SHOW_RATINGS "show-ratings"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TYPE_DATA_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;
typedef struct _DataObjectPrivate DataObjectPrivate;

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

typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;

#define 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_DATA_VIEW (data_view_get_type ())
#define DATA_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DATA_VIEW, DataView))
#define DATA_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DATA_VIEW, DataViewClass))
#define IS_DATA_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DATA_VIEW))
#define IS_DATA_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DATA_VIEW))
#define DATA_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DATA_VIEW, DataViewClass))

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

#define TYPE_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_VIEW (thumbnail_view_get_type ())
#define THUMBNAIL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_VIEW, ThumbnailView))
#define THUMBNAIL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_VIEW, ThumbnailViewClass))
#define IS_THUMBNAIL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_VIEW))
#define IS_THUMBNAIL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_VIEW))
#define THUMBNAIL_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_VIEW, ThumbnailViewClass))

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

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

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

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

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

typedef struct _MediaSourceItem MediaSourceItem;
typedef struct _MediaSourceItemClass MediaSourceItemClass;
typedef struct _MediaSourceItemPrivate MediaSourceItemPrivate;
enum  {
	MEDIA_SOURCE_ITEM_0_PROPERTY,
	MEDIA_SOURCE_ITEM_NUM_PROPERTIES
};
static GParamSpec* media_source_item_properties[MEDIA_SOURCE_ITEM_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#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_PAGE (page_get_type ())
#define PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE, Page))
#define PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE, PageClass))
#define IS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE))
#define IS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE))
#define PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE, PageClass))

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

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

typedef struct _PageWindow PageWindow;
typedef struct _PageWindowClass PageWindowClass;

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

typedef struct _FullscreenWindow FullscreenWindow;
typedef struct _FullscreenWindowClass FullscreenWindowClass;

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

typedef struct _InjectionGroup InjectionGroup;
typedef struct _InjectionGroupClass InjectionGroupClass;

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

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

#define CHECKERBOARD_PAGE_TYPE_ACTIVATOR (checkerboard_page_activator_get_type ())

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

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

typedef struct _ViewFilter ViewFilter;
typedef struct _ViewFilterClass ViewFilterClass;

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

typedef struct _SearchViewFilter SearchViewFilter;
typedef struct _SearchViewFilterClass SearchViewFilterClass;

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

typedef struct _CoreTracker CoreTracker;
typedef struct _CoreTrackerClass CoreTrackerClass;

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

typedef struct _CoreViewTracker CoreViewTracker;
typedef struct _CoreViewTrackerClass CoreViewTrackerClass;

#define TYPE_MEDIA_PAGE (media_page_get_type ())
#define MEDIA_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_PAGE, MediaPage))
#define MEDIA_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_PAGE, MediaPageClass))
#define IS_MEDIA_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_PAGE))
#define IS_MEDIA_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_PAGE))
#define MEDIA_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_PAGE, MediaPageClass))

typedef struct _MediaPage MediaPage;
typedef struct _MediaPageClass MediaPageClass;
typedef struct _MediaPagePrivate MediaPagePrivate;
typedef enum  {
	RATING_REJECTED = -1,
	RATING_UNRATED = 0,
	RATING_ONE = 1,
	RATING_TWO = 2,
	RATING_THREE = 3,
	RATING_FOUR = 4,
	RATING_FIVE = 5
} Rating;

#define TYPE_RATING (rating_get_type ())
typedef enum  {
	RAW_DEVELOPER_SHOTWELL = 0,
	RAW_DEVELOPER_CAMERA,
	RAW_DEVELOPER_EMBEDDED
} RawDeveloper;

#define TYPE_RAW_DEVELOPER (raw_developer_get_type ())

#define MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY (media_page_zoom_slider_assembly_get_type ())
#define MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY, MediaPageZoomSliderAssembly))
#define MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY, MediaPageZoomSliderAssemblyClass))
#define MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY))
#define MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY))
#define MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY, MediaPageZoomSliderAssemblyClass))

typedef struct _MediaPageZoomSliderAssembly MediaPageZoomSliderAssembly;
typedef struct _MediaPageZoomSliderAssemblyClass MediaPageZoomSliderAssemblyClass;

#define TYPE_DRAG_AND_DROP_HANDLER (drag_and_drop_handler_get_type ())
#define DRAG_AND_DROP_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandler))
#define DRAG_AND_DROP_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandlerClass))
#define IS_DRAG_AND_DROP_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DRAG_AND_DROP_HANDLER))
#define IS_DRAG_AND_DROP_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DRAG_AND_DROP_HANDLER))
#define DRAG_AND_DROP_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DRAG_AND_DROP_HANDLER, DragAndDropHandlerClass))

typedef struct _DragAndDropHandler DragAndDropHandler;
typedef struct _DragAndDropHandlerClass DragAndDropHandlerClass;

#define TYPE_MEDIA_VIEW_TRACKER (media_view_tracker_get_type ())
#define MEDIA_VIEW_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEDIA_VIEW_TRACKER, MediaViewTracker))
#define MEDIA_VIEW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEDIA_VIEW_TRACKER, MediaViewTrackerClass))
#define IS_MEDIA_VIEW_TRACKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEDIA_VIEW_TRACKER))
#define IS_MEDIA_VIEW_TRACKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEDIA_VIEW_TRACKER))
#define MEDIA_VIEW_TRACKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEDIA_VIEW_TRACKER, MediaViewTrackerClass))

typedef struct _MediaViewTracker MediaViewTracker;
typedef struct _MediaViewTrackerClass MediaViewTrackerClass;
enum  {
	MEDIA_PAGE_0_PROPERTY,
	MEDIA_PAGE_NUM_PROPERTIES
};
static GParamSpec* media_page_properties[MEDIA_PAGE_NUM_PROPERTIES];
typedef enum  {
	MEDIA_PAGE_SORT_BY_MIN = 1,
	MEDIA_PAGE_SORT_BY_TITLE = 1,
	MEDIA_PAGE_SORT_BY_EXPOSURE_DATE = 2,
	MEDIA_PAGE_SORT_BY_RATING = 3,
	MEDIA_PAGE_SORT_BY_FILENAME = 4,
	MEDIA_PAGE_SORT_BY_MAX = 4
} MediaPageSortBy;

#define MEDIA_PAGE_TYPE_SORT_BY (media_page_sort_by_get_type ())
typedef void (*GSimpleActionActivateCallback) (GSimpleAction* action, GVariant* parameter, gpointer user_data);
typedef void (*GSimpleActionChangeStateCallback) (GSimpleAction* action, GVariant* value, gpointer user_data);
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _drag_and_drop_handler_unref0(var) ((var == NULL) ? NULL : (var = (drag_and_drop_handler_unref (var), NULL)))
#define _core_tracker_unref0(var) ((var == NULL) ? NULL : (var = (core_tracker_unref (var), NULL)))

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

typedef struct _ViewCollection ViewCollection;
typedef struct _ViewCollectionClass ViewCollectionClass;
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
typedef gboolean (*ValueEqualFunc) (GValue* a, GValue* b, gpointer user_data);

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

typedef struct _ConfigurationFacade ConfigurationFacade;
typedef struct _ConfigurationFacadeClass ConfigurationFacadeClass;

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

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

#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_VIDEO_SOURCE (video_source_get_type ())
#define VIDEO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO_SOURCE, VideoSource))
#define VIDEO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO_SOURCE, VideoSourceClass))
#define IS_VIDEO_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO_SOURCE))
#define IS_VIDEO_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO_SOURCE))
#define VIDEO_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO_SOURCE, VideoSourceClass))

typedef struct _VideoSource VideoSource;
typedef struct _VideoSourceClass VideoSourceClass;

#define TYPE_VIDEO (video_get_type ())
#define VIDEO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_VIDEO, Video))
#define VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_VIDEO, VideoClass))
#define IS_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_VIDEO))
#define IS_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_VIDEO))
#define VIDEO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_VIDEO, VideoClass))

typedef struct _Video Video;
typedef struct _VideoClass VideoClass;
#define _alteration_unref0(var) ((var == NULL) ? NULL : (var = (alteration_unref (var), NULL)))

#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_THUMBNAIL (thumbnail_get_type ())
#define THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL, Thumbnail))
#define THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL, ThumbnailClass))
#define IS_THUMBNAIL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL))
#define IS_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL))
#define THUMBNAIL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL, ThumbnailClass))

typedef struct _Thumbnail Thumbnail;
typedef struct _ThumbnailClass ThumbnailClass;
typedef enum  {
	PHOTO_FILE_FORMAT_JFIF,
	PHOTO_FILE_FORMAT_RAW,
	PHOTO_FILE_FORMAT_PNG,
	PHOTO_FILE_FORMAT_TIFF,
	PHOTO_FILE_FORMAT_BMP,
	PHOTO_FILE_FORMAT_GIF,
	PHOTO_FILE_FORMAT_WEBP,
	PHOTO_FILE_FORMAT_AVIF,
	PHOTO_FILE_FORMAT_HEIF,
	PHOTO_FILE_FORMAT_JPEGXL,
	PHOTO_FILE_FORMAT_UNKNOWN
} PhotoFileFormat;

#define TYPE_PHOTO_FILE_FORMAT (photo_file_format_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_TEXT_ENTRY_DIALOG_MEDIATOR (text_entry_dialog_mediator_get_type ())
#define TEXT_ENTRY_DIALOG_MEDIATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR, TextEntryDialogMediator))
#define TEXT_ENTRY_DIALOG_MEDIATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR, TextEntryDialogMediatorClass))
#define IS_TEXT_ENTRY_DIALOG_MEDIATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR))
#define IS_TEXT_ENTRY_DIALOG_MEDIATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR))
#define TEXT_ENTRY_DIALOG_MEDIATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEXT_ENTRY_DIALOG_MEDIATOR, TextEntryDialogMediatorClass))

typedef struct _TextEntryDialogMediator TextEntryDialogMediator;
typedef struct _TextEntryDialogMediatorClass TextEntryDialogMediatorClass;

#define TYPE_TAGS_DIALOG (tags_dialog_get_type ())
#define TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAGS_DIALOG, TagsDialog))
#define TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAGS_DIALOG, TagsDialogClass))
#define IS_TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAGS_DIALOG))
#define IS_TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAGS_DIALOG))
#define TAGS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAGS_DIALOG, TagsDialogClass))

typedef struct _TagsDialog TagsDialog;
typedef struct _TagsDialogClass TagsDialogClass;

#define TYPE_ADD_TAGS_DIALOG (add_tags_dialog_get_type ())
#define ADD_TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADD_TAGS_DIALOG, AddTagsDialog))
#define ADD_TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ADD_TAGS_DIALOG, AddTagsDialogClass))
#define IS_ADD_TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADD_TAGS_DIALOG))
#define IS_ADD_TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ADD_TAGS_DIALOG))
#define ADD_TAGS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ADD_TAGS_DIALOG, AddTagsDialogClass))

typedef struct _AddTagsDialog AddTagsDialog;
typedef struct _AddTagsDialogClass AddTagsDialogClass;

#define TYPE_COMMAND_MANAGER (command_manager_get_type ())
#define COMMAND_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMMAND_MANAGER, CommandManager))
#define COMMAND_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMMAND_MANAGER, CommandManagerClass))
#define IS_COMMAND_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMMAND_MANAGER))
#define IS_COMMAND_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COMMAND_MANAGER))
#define COMMAND_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COMMAND_MANAGER, CommandManagerClass))

typedef struct _CommandManager CommandManager;
typedef struct _CommandManagerClass CommandManagerClass;

#define TYPE_COMMAND (command_get_type ())
#define COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMMAND, Command))
#define COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMMAND, CommandClass))
#define IS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMMAND))
#define IS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_COMMAND))
#define COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_COMMAND, CommandClass))

typedef struct _Command Command;
typedef struct _CommandClass CommandClass;

#define TYPE_HIERARCHICAL_TAG_INDEX (hierarchical_tag_index_get_type ())
#define HIERARCHICAL_TAG_INDEX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_HIERARCHICAL_TAG_INDEX, HierarchicalTagIndex))
#define HIERARCHICAL_TAG_INDEX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_HIERARCHICAL_TAG_INDEX, HierarchicalTagIndexClass))
#define IS_HIERARCHICAL_TAG_INDEX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_HIERARCHICAL_TAG_INDEX))
#define IS_HIERARCHICAL_TAG_INDEX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_HIERARCHICAL_TAG_INDEX))
#define HIERARCHICAL_TAG_INDEX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_HIERARCHICAL_TAG_INDEX, HierarchicalTagIndexClass))

typedef struct _HierarchicalTagIndex HierarchicalTagIndex;
typedef struct _HierarchicalTagIndexClass HierarchicalTagIndexClass;

#define TYPE_PAGE_COMMAND (page_command_get_type ())
#define PAGE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_COMMAND, PageCommand))
#define PAGE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_COMMAND, PageCommandClass))
#define IS_PAGE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_COMMAND))
#define IS_PAGE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_COMMAND))
#define PAGE_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_COMMAND, PageCommandClass))

typedef struct _PageCommand PageCommand;
typedef struct _PageCommandClass PageCommandClass;

#define TYPE_ADD_TAGS_COMMAND (add_tags_command_get_type ())
#define ADD_TAGS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ADD_TAGS_COMMAND, AddTagsCommand))
#define ADD_TAGS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ADD_TAGS_COMMAND, AddTagsCommandClass))
#define IS_ADD_TAGS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ADD_TAGS_COMMAND))
#define IS_ADD_TAGS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ADD_TAGS_COMMAND))
#define ADD_TAGS_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ADD_TAGS_COMMAND, AddTagsCommandClass))

typedef struct _AddTagsCommand AddTagsCommand;
typedef struct _AddTagsCommandClass AddTagsCommandClass;
#define _hierarchical_tag_index_unref0(var) ((var == NULL) ? NULL : (var = (hierarchical_tag_index_unref (var), NULL)))
#define _command_manager_unref0(var) ((var == NULL) ? NULL : (var = (command_manager_unref (var), NULL)))
#define _text_entry_dialog_mediator_unref0(var) ((var == NULL) ? NULL : (var = (text_entry_dialog_mediator_unref (var), NULL)))

#define TYPE_MODIFY_TAGS_DIALOG (modify_tags_dialog_get_type ())
#define MODIFY_TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MODIFY_TAGS_DIALOG, ModifyTagsDialog))
#define MODIFY_TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MODIFY_TAGS_DIALOG, ModifyTagsDialogClass))
#define IS_MODIFY_TAGS_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MODIFY_TAGS_DIALOG))
#define IS_MODIFY_TAGS_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MODIFY_TAGS_DIALOG))
#define MODIFY_TAGS_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MODIFY_TAGS_DIALOG, ModifyTagsDialogClass))

typedef struct _ModifyTagsDialog ModifyTagsDialog;
typedef struct _ModifyTagsDialogClass ModifyTagsDialogClass;

#define TYPE_TAG (tag_get_type ())
#define TAG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TAG, Tag))
#define TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TAG, TagClass))
#define IS_TAG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TAG))
#define IS_TAG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TAG))
#define TAG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TAG, TagClass))

typedef struct _Tag Tag;
typedef struct _TagClass TagClass;

#define TYPE_SINGLE_DATA_SOURCE_COMMAND (single_data_source_command_get_type ())
#define SINGLE_DATA_SOURCE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SINGLE_DATA_SOURCE_COMMAND, SingleDataSourceCommand))
#define SINGLE_DATA_SOURCE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SINGLE_DATA_SOURCE_COMMAND, SingleDataSourceCommandClass))
#define IS_SINGLE_DATA_SOURCE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SINGLE_DATA_SOURCE_COMMAND))
#define IS_SINGLE_DATA_SOURCE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SINGLE_DATA_SOURCE_COMMAND))
#define SINGLE_DATA_SOURCE_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SINGLE_DATA_SOURCE_COMMAND, SingleDataSourceCommandClass))

typedef struct _SingleDataSourceCommand SingleDataSourceCommand;
typedef struct _SingleDataSourceCommandClass SingleDataSourceCommandClass;

#define TYPE_MODIFY_TAGS_COMMAND (modify_tags_command_get_type ())
#define MODIFY_TAGS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MODIFY_TAGS_COMMAND, ModifyTagsCommand))
#define MODIFY_TAGS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MODIFY_TAGS_COMMAND, ModifyTagsCommandClass))
#define IS_MODIFY_TAGS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MODIFY_TAGS_COMMAND))
#define IS_MODIFY_TAGS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MODIFY_TAGS_COMMAND))
#define MODIFY_TAGS_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MODIFY_TAGS_COMMAND, ModifyTagsCommandClass))

typedef struct _ModifyTagsCommand ModifyTagsCommand;
typedef struct _ModifyTagsCommandClass ModifyTagsCommandClass;

#define TYPE_MOVE_PHOTOS_COMMAND (move_photos_command_get_type ())
#define MOVE_PHOTOS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MOVE_PHOTOS_COMMAND, MovePhotosCommand))
#define MOVE_PHOTOS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MOVE_PHOTOS_COMMAND, MovePhotosCommandClass))
#define IS_MOVE_PHOTOS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MOVE_PHOTOS_COMMAND))
#define IS_MOVE_PHOTOS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MOVE_PHOTOS_COMMAND))
#define MOVE_PHOTOS_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MOVE_PHOTOS_COMMAND, MovePhotosCommandClass))

typedef struct _MovePhotosCommand MovePhotosCommand;
typedef struct _MovePhotosCommandClass MovePhotosCommandClass;

#define TYPE_NEW_EVENT_COMMAND (new_event_command_get_type ())
#define NEW_EVENT_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NEW_EVENT_COMMAND, NewEventCommand))
#define NEW_EVENT_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NEW_EVENT_COMMAND, NewEventCommandClass))
#define IS_NEW_EVENT_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NEW_EVENT_COMMAND))
#define IS_NEW_EVENT_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NEW_EVENT_COMMAND))
#define NEW_EVENT_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NEW_EVENT_COMMAND, NewEventCommandClass))

typedef struct _NewEventCommand NewEventCommand;
typedef struct _NewEventCommandClass NewEventCommandClass;

#define TYPE_FLAGGABLE (flaggable_get_type ())
#define FLAGGABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FLAGGABLE, Flaggable))
#define IS_FLAGGABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FLAGGABLE))
#define FLAGGABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_FLAGGABLE, FlaggableIface))

typedef struct _Flaggable Flaggable;
typedef struct _FlaggableIface FlaggableIface;

#define TYPE_MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND (multiple_data_source_at_once_command_get_type ())
#define MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND, MultipleDataSourceAtOnceCommand))
#define MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND, MultipleDataSourceAtOnceCommandClass))
#define IS_MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND))
#define IS_MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND))
#define MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MULTIPLE_DATA_SOURCE_AT_ONCE_COMMAND, MultipleDataSourceAtOnceCommandClass))

typedef struct _MultipleDataSourceAtOnceCommand MultipleDataSourceAtOnceCommand;
typedef struct _MultipleDataSourceAtOnceCommandClass MultipleDataSourceAtOnceCommandClass;

#define TYPE_FLAG_UNFLAG_COMMAND (flag_unflag_command_get_type ())
#define FLAG_UNFLAG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FLAG_UNFLAG_COMMAND, FlagUnflagCommand))
#define FLAG_UNFLAG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FLAG_UNFLAG_COMMAND, FlagUnflagCommandClass))
#define IS_FLAG_UNFLAG_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FLAG_UNFLAG_COMMAND))
#define IS_FLAG_UNFLAG_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FLAG_UNFLAG_COMMAND))
#define FLAG_UNFLAG_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FLAG_UNFLAG_COMMAND, FlagUnflagCommandClass))

typedef struct _FlagUnflagCommand FlagUnflagCommand;
typedef struct _FlagUnflagCommandClass FlagUnflagCommandClass;

#define TYPE_MULTIPLE_DATA_SOURCE_COMMAND (multiple_data_source_command_get_type ())
#define MULTIPLE_DATA_SOURCE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MULTIPLE_DATA_SOURCE_COMMAND, MultipleDataSourceCommand))
#define MULTIPLE_DATA_SOURCE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MULTIPLE_DATA_SOURCE_COMMAND, MultipleDataSourceCommandClass))
#define IS_MULTIPLE_DATA_SOURCE_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MULTIPLE_DATA_SOURCE_COMMAND))
#define IS_MULTIPLE_DATA_SOURCE_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MULTIPLE_DATA_SOURCE_COMMAND))
#define MULTIPLE_DATA_SOURCE_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MULTIPLE_DATA_SOURCE_COMMAND, MultipleDataSourceCommandClass))

typedef struct _MultipleDataSourceCommand MultipleDataSourceCommand;
typedef struct _MultipleDataSourceCommandClass MultipleDataSourceCommandClass;

#define TYPE_SET_RATING_COMMAND (set_rating_command_get_type ())
#define SET_RATING_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_RATING_COMMAND, SetRatingCommand))
#define SET_RATING_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_RATING_COMMAND, SetRatingCommandClass))
#define IS_SET_RATING_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_RATING_COMMAND))
#define IS_SET_RATING_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_RATING_COMMAND))
#define SET_RATING_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_RATING_COMMAND, SetRatingCommandClass))

typedef struct _SetRatingCommand SetRatingCommand;
typedef struct _SetRatingCommandClass SetRatingCommandClass;

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

typedef struct _LibraryPhoto LibraryPhoto;
typedef struct _LibraryPhotoClass LibraryPhotoClass;

#define TYPE_TRASH_UNTRASH_PHOTOS_COMMAND (trash_untrash_photos_command_get_type ())
#define TRASH_UNTRASH_PHOTOS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRASH_UNTRASH_PHOTOS_COMMAND, TrashUntrashPhotosCommand))
#define TRASH_UNTRASH_PHOTOS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRASH_UNTRASH_PHOTOS_COMMAND, TrashUntrashPhotosCommandClass))
#define IS_TRASH_UNTRASH_PHOTOS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRASH_UNTRASH_PHOTOS_COMMAND))
#define IS_TRASH_UNTRASH_PHOTOS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRASH_UNTRASH_PHOTOS_COMMAND))
#define TRASH_UNTRASH_PHOTOS_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRASH_UNTRASH_PHOTOS_COMMAND, TrashUntrashPhotosCommandClass))

typedef struct _TrashUntrashPhotosCommand TrashUntrashPhotosCommand;
typedef struct _TrashUntrashPhotosCommandClass TrashUntrashPhotosCommandClass;

#define TYPE_EDIT_TITLE_DIALOG (edit_title_dialog_get_type ())
#define EDIT_TITLE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EDIT_TITLE_DIALOG, EditTitleDialog))
#define EDIT_TITLE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EDIT_TITLE_DIALOG, EditTitleDialogClass))
#define IS_EDIT_TITLE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EDIT_TITLE_DIALOG))
#define IS_EDIT_TITLE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EDIT_TITLE_DIALOG))
#define EDIT_TITLE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EDIT_TITLE_DIALOG, EditTitleDialogClass))

typedef struct _EditTitleDialog EditTitleDialog;
typedef struct _EditTitleDialogClass EditTitleDialogClass;

#define TYPE_EDIT_MULTIPLE_TITLES_COMMAND (edit_multiple_titles_command_get_type ())
#define EDIT_MULTIPLE_TITLES_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EDIT_MULTIPLE_TITLES_COMMAND, EditMultipleTitlesCommand))
#define EDIT_MULTIPLE_TITLES_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EDIT_MULTIPLE_TITLES_COMMAND, EditMultipleTitlesCommandClass))
#define IS_EDIT_MULTIPLE_TITLES_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EDIT_MULTIPLE_TITLES_COMMAND))
#define IS_EDIT_MULTIPLE_TITLES_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EDIT_MULTIPLE_TITLES_COMMAND))
#define EDIT_MULTIPLE_TITLES_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EDIT_MULTIPLE_TITLES_COMMAND, EditMultipleTitlesCommandClass))

typedef struct _EditMultipleTitlesCommand EditMultipleTitlesCommand;
typedef struct _EditMultipleTitlesCommandClass EditMultipleTitlesCommandClass;

#define TYPE_MULTI_TEXT_ENTRY_DIALOG_MEDIATOR (multi_text_entry_dialog_mediator_get_type ())
#define MULTI_TEXT_ENTRY_DIALOG_MEDIATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MULTI_TEXT_ENTRY_DIALOG_MEDIATOR, MultiTextEntryDialogMediator))
#define MULTI_TEXT_ENTRY_DIALOG_MEDIATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MULTI_TEXT_ENTRY_DIALOG_MEDIATOR, MultiTextEntryDialogMediatorClass))
#define IS_MULTI_TEXT_ENTRY_DIALOG_MEDIATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MULTI_TEXT_ENTRY_DIALOG_MEDIATOR))
#define IS_MULTI_TEXT_ENTRY_DIALOG_MEDIATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MULTI_TEXT_ENTRY_DIALOG_MEDIATOR))
#define MULTI_TEXT_ENTRY_DIALOG_MEDIATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MULTI_TEXT_ENTRY_DIALOG_MEDIATOR, MultiTextEntryDialogMediatorClass))

typedef struct _MultiTextEntryDialogMediator MultiTextEntryDialogMediator;
typedef struct _MultiTextEntryDialogMediatorClass MultiTextEntryDialogMediatorClass;

#define TYPE_EDIT_COMMENT_DIALOG (edit_comment_dialog_get_type ())
#define EDIT_COMMENT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EDIT_COMMENT_DIALOG, EditCommentDialog))
#define EDIT_COMMENT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EDIT_COMMENT_DIALOG, EditCommentDialogClass))
#define IS_EDIT_COMMENT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EDIT_COMMENT_DIALOG))
#define IS_EDIT_COMMENT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EDIT_COMMENT_DIALOG))
#define EDIT_COMMENT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EDIT_COMMENT_DIALOG, EditCommentDialogClass))

typedef struct _EditCommentDialog EditCommentDialog;
typedef struct _EditCommentDialogClass EditCommentDialogClass;

#define TYPE_EDIT_MULTIPLE_COMMENTS_COMMAND (edit_multiple_comments_command_get_type ())
#define EDIT_MULTIPLE_COMMENTS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_EDIT_MULTIPLE_COMMENTS_COMMAND, EditMultipleCommentsCommand))
#define EDIT_MULTIPLE_COMMENTS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_EDIT_MULTIPLE_COMMENTS_COMMAND, EditMultipleCommentsCommandClass))
#define IS_EDIT_MULTIPLE_COMMENTS_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_EDIT_MULTIPLE_COMMENTS_COMMAND))
#define IS_EDIT_MULTIPLE_COMMENTS_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_EDIT_MULTIPLE_COMMENTS_COMMAND))
#define EDIT_MULTIPLE_COMMENTS_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_EDIT_MULTIPLE_COMMENTS_COMMAND, EditMultipleCommentsCommandClass))

typedef struct _EditMultipleCommentsCommand EditMultipleCommentsCommand;
typedef struct _EditMultipleCommentsCommandClass EditMultipleCommentsCommandClass;
#define _multi_text_entry_dialog_mediator_unref0(var) ((var == NULL) ? NULL : (var = (multi_text_entry_dialog_mediator_unref (var), NULL)))

#define TYPE_SET_RAW_DEVELOPER_COMMAND (set_raw_developer_command_get_type ())
#define SET_RAW_DEVELOPER_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SET_RAW_DEVELOPER_COMMAND, SetRawDeveloperCommand))
#define SET_RAW_DEVELOPER_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SET_RAW_DEVELOPER_COMMAND, SetRawDeveloperCommandClass))
#define IS_SET_RAW_DEVELOPER_COMMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SET_RAW_DEVELOPER_COMMAND))
#define IS_SET_RAW_DEVELOPER_COMMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SET_RAW_DEVELOPER_COMMAND))
#define SET_RAW_DEVELOPER_COMMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SET_RAW_DEVELOPER_COMMAND, SetRawDeveloperCommandClass))

typedef struct _SetRawDeveloperCommand SetRawDeveloperCommand;
typedef struct _SetRawDeveloperCommandClass SetRawDeveloperCommandClass;
typedef gint64 (*Comparator) (void* a, void* b, gpointer user_data);
typedef gboolean (*ComparatorPredicate) (DataObject* object, Alteration* alteration, gpointer user_data);

#define TYPE_CHECKERBOARD_LAYOUT (checkerboard_layout_get_type ())
#define CHECKERBOARD_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CHECKERBOARD_LAYOUT, CheckerboardLayout))
#define CHECKERBOARD_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CHECKERBOARD_LAYOUT, CheckerboardLayoutClass))
#define IS_CHECKERBOARD_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CHECKERBOARD_LAYOUT))
#define IS_CHECKERBOARD_LAYOUT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CHECKERBOARD_LAYOUT))
#define CHECKERBOARD_LAYOUT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CHECKERBOARD_LAYOUT, CheckerboardLayoutClass))

typedef struct _CheckerboardLayout CheckerboardLayout;
typedef struct _CheckerboardLayoutClass CheckerboardLayoutClass;
typedef struct _MediaPageZoomSliderAssemblyPrivate MediaPageZoomSliderAssemblyPrivate;
enum  {
	MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_0_PROPERTY,
	MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_NUM_PROPERTIES
};
static GParamSpec* media_page_zoom_slider_assembly_properties[MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_NUM_PROPERTIES];
enum  {
	MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_ZOOM_CHANGED_SIGNAL,
	MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_NUM_SIGNALS
};
static guint media_page_zoom_slider_assembly_signals[MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_NUM_SIGNALS] = {0};
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

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

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

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

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

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

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

struct _Dimensions {
	gint width;
	gint height;
};

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

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

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

struct _MediaSourceItemClass {
	CheckerboardItemClass parent_class;
};

struct _MediaSourceItemPrivate {
	gchar* natural_collation_key;
};

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

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

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

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

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

struct _MediaPage {
	CheckerboardPage parent_instance;
	MediaPagePrivate * priv;
};

struct _MediaPageClass {
	CheckerboardPageClass parent_class;
	void (*on_zoom_changed) (MediaPage* self);
	void (*on_export) (MediaPage* self);
	void (*on_increase_size) (MediaPage* self);
	void (*on_decrease_size) (MediaPage* self);
	void (*on_increase_rating) (MediaPage* self);
	void (*on_decrease_rating) (MediaPage* self);
	void (*on_set_rating) (MediaPage* self, Rating rating);
	void (*on_rate_rejected) (MediaPage* self);
	void (*on_rate_unrated) (MediaPage* self);
	void (*on_rate_one) (MediaPage* self);
	void (*on_rate_two) (MediaPage* self);
	void (*on_rate_three) (MediaPage* self);
	void (*on_rate_four) (MediaPage* self);
	void (*on_rate_five) (MediaPage* self);
	void (*on_move_to_trash) (MediaPage* self);
	void (*on_edit_title) (MediaPage* self);
	void (*on_edit_comment) (MediaPage* self);
	void (*on_display_titles) (MediaPage* self, GSimpleAction* action, GVariant* value);
	void (*on_display_comments) (MediaPage* self, GSimpleAction* action, GVariant* value);
	void (*on_display_ratings) (MediaPage* self, GSimpleAction* action, GVariant* value);
	void (*on_display_tags) (MediaPage* self, GSimpleAction* action, GVariant* value);
	void (*get_config_photos_sort) (MediaPage* self, gboolean* sort_order, gint* sort_by);
	void (*set_config_photos_sort) (MediaPage* self, gboolean sort_order, gint sort_by);
	void (*on_sort_changed) (MediaPage* self, GSimpleAction* action, GVariant* value);
	void (*developer_changed) (MediaPage* self, RawDeveloper rd);
	DataView* (*create_thumbnail) (MediaPage* self, DataSource* source);
};

struct _MediaPagePrivate {
	MediaPageZoomSliderAssembly* connected_slider;
	DragAndDropHandler* dnd_handler;
	MediaViewTracker* tracker;
};

struct _FlaggableIface {
	GTypeInterface parent_iface;
	gboolean (*is_flagged) (Flaggable* self);
	void (*mark_flagged) (Flaggable* self);
	void (*mark_unflagged) (Flaggable* self);
};

struct _MediaPageZoomSliderAssembly {
	GtkToolItem parent_instance;
	MediaPageZoomSliderAssemblyPrivate * priv;
};

struct _MediaPageZoomSliderAssemblyClass {
	GtkToolItemClass parent_class;
};

struct _MediaPageZoomSliderAssemblyPrivate {
	GtkScale* slider;
	GtkAdjustment* adjustment;
};

static gint MediaSourceItem_private_offset;
static gpointer media_source_item_parent_class = NULL;
static gint MediaPage_private_offset;
static gpointer media_page_parent_class = NULL;
static gint MediaPageZoomSliderAssembly_private_offset;
static gpointer media_page_zoom_slider_assembly_parent_class = NULL;

VALA_EXTERN GType data_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataObject, g_object_unref)
VALA_EXTERN gpointer alteration_ref (gpointer instance);
VALA_EXTERN void alteration_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_alteration (const gchar* name,
                                   const gchar* nick,
                                   const gchar* blurb,
                                   GType object_type,
                                   GParamFlags flags);
VALA_EXTERN void value_set_alteration (GValue* value,
                           gpointer v_object);
VALA_EXTERN void value_take_alteration (GValue* value,
                            gpointer v_object);
VALA_EXTERN gpointer value_get_alteration (const GValue* value);
VALA_EXTERN GType alteration_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Alteration, alteration_unref)
VALA_EXTERN gpointer data_collection_ref (gpointer instance);
VALA_EXTERN void data_collection_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_data_collection (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_data_collection (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_data_collection (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_data_collection (const GValue* value);
VALA_EXTERN GType data_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataCollection, data_collection_unref)
VALA_EXTERN GType data_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataView, 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_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThumbnailView, g_object_unref)
VALA_EXTERN GType checkerboard_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardItem, g_object_unref)
VALA_EXTERN GType dimensions_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Dimensions* dimensions_dup (const Dimensions* self);
VALA_EXTERN void dimensions_free (Dimensions* self);
VALA_EXTERN GType media_source_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaSourceItem, g_object_unref)
VALA_EXTERN GType thumbnail_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThumbnailSource, g_object_unref)
VALA_EXTERN MediaSourceItem* media_source_item_new (ThumbnailSource* source,
                                        Dimensions* initial_pixbuf_dim,
                                        const gchar* title,
                                        const gchar* comment,
                                        gboolean marked_up,
                                        PangoAlignment alignment);
VALA_EXTERN MediaSourceItem* media_source_item_construct (GType object_type,
                                              ThumbnailSource* source,
                                              Dimensions* initial_pixbuf_dim,
                                              const gchar* title,
                                              const gchar* comment,
                                              gboolean marked_up,
                                              PangoAlignment alignment);
VALA_EXTERN CheckerboardItem* checkerboard_item_construct (GType object_type,
                                               ThumbnailSource* source,
                                               Dimensions* initial_pixbuf_dim,
                                               const gchar* title,
                                               const gchar* comment,
                                               gboolean marked_up,
                                               PangoAlignment alignment);
VALA_EXTERN void media_source_item_set_title (MediaSourceItem* self,
                                  const gchar* text,
                                  gboolean marked_up,
                                  PangoAlignment alignment);
VALA_EXTERN void checkerboard_item_set_title (CheckerboardItem* self,
                                  const gchar* text,
                                  gboolean marked_up,
                                  PangoAlignment alignment);
VALA_EXTERN gchar* media_source_item_get_natural_collation_key (MediaSourceItem* self);
VALA_EXTERN gchar* natural_collate_collate_key (gchar* str);
VALA_EXTERN gchar* checkerboard_item_get_title (CheckerboardItem* self);
static void media_source_item_finalize (GObject * obj);
static GType media_source_item_get_type_once (void);
VALA_EXTERN GType page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Page, g_object_unref)
VALA_EXTERN GType page_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageWindow, g_object_unref)
VALA_EXTERN GType fullscreen_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FullscreenWindow, g_object_unref)
VALA_EXTERN gpointer injection_group_ref (gpointer instance);
VALA_EXTERN void injection_group_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_injection_group (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_injection_group (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_injection_group (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_injection_group (const GValue* value);
VALA_EXTERN GType injection_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (InjectionGroup, injection_group_unref)
VALA_EXTERN GType checkerboard_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardPage, g_object_unref)
VALA_EXTERN GType checkerboard_page_activator_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType checkerboard_page_keyboard_modifiers_get_type (void) G_GNUC_CONST ;
VALA_EXTERN CheckerboardPageKeyboardModifiers* checkerboard_page_keyboard_modifiers_dup (const CheckerboardPageKeyboardModifiers* self);
VALA_EXTERN void checkerboard_page_keyboard_modifiers_free (CheckerboardPageKeyboardModifiers* self);
VALA_EXTERN gpointer view_filter_ref (gpointer instance);
VALA_EXTERN void view_filter_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_view_filter (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_view_filter (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_view_filter (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_view_filter (const GValue* value);
VALA_EXTERN GType view_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewFilter, view_filter_unref)
VALA_EXTERN GType search_view_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SearchViewFilter, view_filter_unref)
VALA_EXTERN gpointer core_tracker_ref (gpointer instance);
VALA_EXTERN void core_tracker_unref (gpointer instance);
VALA_EXTERN GParamSpec* core_param_spec_tracker (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags);
VALA_EXTERN void core_value_set_tracker (GValue* value,
                             gpointer v_object);
VALA_EXTERN void core_value_take_tracker (GValue* value,
                              gpointer v_object);
VALA_EXTERN gpointer core_value_get_tracker (const GValue* value);
VALA_EXTERN GType core_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoreTracker, core_tracker_unref)
VALA_EXTERN GType core_view_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoreViewTracker, core_tracker_unref)
VALA_EXTERN GType media_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaPage, g_object_unref)
VALA_EXTERN GType rating_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType raw_developer_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType media_page_zoom_slider_assembly_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaPageZoomSliderAssembly, g_object_unref)
VALA_EXTERN gpointer drag_and_drop_handler_ref (gpointer instance);
VALA_EXTERN void drag_and_drop_handler_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_drag_and_drop_handler (const gchar* name,
                                              const gchar* nick,
                                              const gchar* blurb,
                                              GType object_type,
                                              GParamFlags flags);
VALA_EXTERN void value_set_drag_and_drop_handler (GValue* value,
                                      gpointer v_object);
VALA_EXTERN void value_take_drag_and_drop_handler (GValue* value,
                                       gpointer v_object);
VALA_EXTERN gpointer value_get_drag_and_drop_handler (const GValue* value);
VALA_EXTERN GType drag_and_drop_handler_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DragAndDropHandler, drag_and_drop_handler_unref)
VALA_EXTERN GType media_view_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaViewTracker, core_tracker_unref)
VALA_EXTERN void page_init_collect_ui_filenames (Page* self,
                                     GeeList* ui_filenames);
VALA_EXTERN void page_add_actions (Page* self,
                       GActionMap* map);
VALA_EXTERN void page_remove_actions (Page* self,
                          GActionMap* map);
VALA_EXTERN void page_update_actions (Page* self,
                          gint selected_count,
                          gint count);
VALA_EXTERN CoreViewTracker* checkerboard_page_get_view_tracker (CheckerboardPage* self);
VALA_EXTERN gboolean page_on_mousewheel_up (Page* self,
                                GdkEventScroll* event);
VALA_EXTERN gboolean page_on_mousewheel_down (Page* self,
                                  GdkEventScroll* event);
VALA_EXTERN gboolean page_on_app_key_pressed (Page* self,
                                  GdkEventKey* event);
VALA_EXTERN void page_switched_to (Page* self);
VALA_EXTERN void page_switching_from (Page* self);
VALA_EXTERN void media_page_on_zoom_changed (MediaPage* self);
VALA_EXTERN void media_page_on_export (MediaPage* self);
VALA_EXTERN void media_page_on_increase_size (MediaPage* self);
VALA_EXTERN void media_page_on_decrease_size (MediaPage* self);
VALA_EXTERN void media_page_on_increase_rating (MediaPage* self);
VALA_EXTERN void media_page_on_decrease_rating (MediaPage* self);
VALA_EXTERN void media_page_on_set_rating (MediaPage* self,
                               Rating rating);
VALA_EXTERN void media_page_on_rate_rejected (MediaPage* self);
VALA_EXTERN void media_page_on_rate_unrated (MediaPage* self);
VALA_EXTERN void media_page_on_rate_one (MediaPage* self);
VALA_EXTERN void media_page_on_rate_two (MediaPage* self);
VALA_EXTERN void media_page_on_rate_three (MediaPage* self);
VALA_EXTERN void media_page_on_rate_four (MediaPage* self);
VALA_EXTERN void media_page_on_rate_five (MediaPage* self);
VALA_EXTERN void media_page_on_move_to_trash (MediaPage* self);
VALA_EXTERN void media_page_on_edit_title (MediaPage* self);
VALA_EXTERN void media_page_on_edit_comment (MediaPage* self);
VALA_EXTERN void media_page_on_display_titles (MediaPage* self,
                                   GSimpleAction* action,
                                   GVariant* value);
VALA_EXTERN void media_page_on_display_comments (MediaPage* self,
                                     GSimpleAction* action,
                                     GVariant* value);
VALA_EXTERN void media_page_on_display_ratings (MediaPage* self,
                                    GSimpleAction* action,
                                    GVariant* value);
VALA_EXTERN void media_page_on_display_tags (MediaPage* self,
                                 GSimpleAction* action,
                                 GVariant* value);
VALA_EXTERN void media_page_get_config_photos_sort (MediaPage* self,
                                        gboolean* sort_order,
                                        gint* sort_by);
VALA_EXTERN void media_page_set_config_photos_sort (MediaPage* self,
                                        gboolean sort_order,
                                        gint sort_by);
VALA_EXTERN void media_page_on_sort_changed (MediaPage* self,
                                 GSimpleAction* action,
                                 GVariant* value);
VALA_EXTERN void media_page_developer_changed (MediaPage* self,
                                   RawDeveloper rd);
VALA_EXTERN void checkerboard_page_set_display_titles (CheckerboardPage* self,
                                           gboolean display);
VALA_EXTERN void checkerboard_page_set_display_comments (CheckerboardPage* self,
                                             gboolean display);
VALA_EXTERN DataView* media_page_create_thumbnail (MediaPage* self,
                                       DataSource* source);
VALA_EXTERN GType media_page_sort_by_get_type (void) G_GNUC_CONST ;
static void _media_page_on_export_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self);
static void media_page_on_send_to (MediaPage* self);
static void _media_page_on_send_to_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self);
static void media_page_on_remove_from_library (MediaPage* self);
static void _media_page_on_remove_from_library_gsimple_action_activate_callback (GSimpleAction* action,
                                                                          GVariant* parameter,
                                                                          gpointer self);
static void _media_page_on_move_to_trash_gsimple_action_activate_callback (GSimpleAction* action,
                                                                    GVariant* parameter,
                                                                    gpointer self);
static void media_page_on_new_event (MediaPage* self);
static void _media_page_on_new_event_gsimple_action_activate_callback (GSimpleAction* action,
                                                                GVariant* parameter,
                                                                gpointer self);
static void media_page_on_add_tags (MediaPage* self);
static void _media_page_on_add_tags_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self);
static void media_page_on_modify_tags (MediaPage* self);
static void _media_page_on_modify_tags_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self);
static void _media_page_on_increase_size_gsimple_action_activate_callback (GSimpleAction* action,
                                                                    GVariant* parameter,
                                                                    gpointer self);
static void _media_page_on_decrease_size_gsimple_action_activate_callback (GSimpleAction* action,
                                                                    GVariant* parameter,
                                                                    gpointer self);
static void media_page_on_flag_unflag (MediaPage* self);
static void _media_page_on_flag_unflag_gsimple_action_activate_callback (GSimpleAction* action,
                                                                  GVariant* parameter,
                                                                  gpointer self);
static void _media_page_on_increase_rating_gsimple_action_activate_callback (GSimpleAction* action,
                                                                      GVariant* parameter,
                                                                      gpointer self);
static void _media_page_on_decrease_rating_gsimple_action_activate_callback (GSimpleAction* action,
                                                                      GVariant* parameter,
                                                                      gpointer self);
static void _media_page_on_rate_rejected_gsimple_action_activate_callback (GSimpleAction* action,
                                                                    GVariant* parameter,
                                                                    gpointer self);
static void _media_page_on_rate_unrated_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self);
static void _media_page_on_rate_one_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self);
static void _media_page_on_rate_two_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self);
static void _media_page_on_rate_three_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self);
static void _media_page_on_rate_four_gsimple_action_activate_callback (GSimpleAction* action,
                                                                GVariant* parameter,
                                                                gpointer self);
static void _media_page_on_rate_five_gsimple_action_activate_callback (GSimpleAction* action,
                                                                GVariant* parameter,
                                                                gpointer self);
static void _media_page_on_edit_title_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self);
static void _media_page_on_edit_comment_gsimple_action_activate_callback (GSimpleAction* action,
                                                                   GVariant* parameter,
                                                                   gpointer self);
VALA_EXTERN void media_page_on_play_video (MediaPage* self);
static void _media_page_on_play_video_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self);
VALA_EXTERN void page_on_action_toggle (Page* self,
                            GAction* action,
                            GVariant* value);
static void _page_on_action_toggle_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self);
static void _media_page_on_display_titles_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                         GVariant* value,
                                                                         gpointer self);
static void _media_page_on_display_comments_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                           GVariant* value,
                                                                           gpointer self);
static void _media_page_on_display_ratings_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                          GVariant* value,
                                                                          gpointer self);
static void _media_page_on_display_tags_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                       GVariant* value,
                                                                       gpointer self);
VALA_EXTERN void page_on_action_radio (Page* self,
                           GAction* action,
                           GVariant* value);
static void _page_on_action_radio_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self);
static void _media_page_on_sort_changed_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                       GVariant* value,
                                                                       gpointer self);
VALA_EXTERN MediaPage* media_page_construct (GType object_type,
                                 const gchar* page_name);
VALA_EXTERN CheckerboardPage* checkerboard_page_construct (GType object_type,
                                               const gchar* page_name);
VALA_EXTERN GType view_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewCollection, data_collection_unref)
VALA_EXTERN ViewCollection* page_get_view (Page* self);
VALA_EXTERN MediaViewTracker* media_view_tracker_new (ViewCollection* collection);
VALA_EXTERN MediaViewTracker* media_view_tracker_construct (GType object_type,
                                                ViewCollection* collection);
static void media_page_on_media_altered (MediaPage* self,
                                  GeeMap* altered);
static void _media_page_on_media_altered_data_collection_items_altered (DataCollection* _sender,
                                                                 GeeMap* items,
                                                                 gpointer self);
VALA_EXTERN void data_collection_freeze_notifications (DataCollection* self);
VALA_EXTERN void data_collection_set_property (DataCollection* self,
                                   const gchar* name,
                                   GValue* val,
                                   ValueEqualFunc value_equals,
                                   gpointer value_equals_target);
VALA_EXTERN GType configuration_facade_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigurationFacade, g_object_unref)
VALA_EXTERN GType config_facade_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ConfigFacade, g_object_unref)
VALA_EXTERN ConfigFacade* config_facade_get_instance (void);
VALA_EXTERN gboolean configuration_facade_get_display_photo_titles (ConfigurationFacade* self);
VALA_EXTERN gboolean configuration_facade_get_display_photo_comments (ConfigurationFacade* self);
VALA_EXTERN gboolean configuration_facade_get_display_photo_tags (ConfigurationFacade* self);
VALA_EXTERN gint media_page_get_thumb_size (MediaPage* self);
VALA_EXTERN gboolean configuration_facade_get_display_photo_ratings (ConfigurationFacade* self);
VALA_EXTERN void data_collection_thaw_notifications (DataCollection* self);
VALA_EXTERN DragAndDropHandler* drag_and_drop_handler_new (Page* page);
VALA_EXTERN DragAndDropHandler* drag_and_drop_handler_construct (GType object_type,
                                                     Page* page);
static gint media_page_compute_zoom_scale_increase (gint current_scale);
VALA_EXTERN gint thumbnail_get_MIN_SCALE (void);
VALA_EXTERN gint thumbnail_get_MAX_SCALE (void);
static gint media_page_compute_zoom_scale_decrease (gint current_scale);
static void media_page_real_init_collect_ui_filenames (Page* base,
                                                GeeList* ui_filenames);
static void media_page_real_add_actions (Page* base,
                                  GActionMap* map);
VALA_EXTERN GAction* page_get_action (Page* self,
                          const gchar* name);
static GVariant* _variant_new20 (gboolean value);
static GVariant* _variant_new21 (gboolean value);
static GVariant* _variant_new22 (gboolean value);
static GVariant* _variant_new23 (gboolean value);
static GVariant* _variant_new24 (gchar* value);
static GVariant* _variant_new25 (const gchar* value);
VALA_EXTERN RawDeveloper configuration_facade_get_default_raw_developer (ConfigurationFacade* self);
static GVariant* _variant_new26 (const gchar* value);
static void media_page_on_raw_developer_changed (MediaPage* self,
                                          GSimpleAction* action,
                                          GVariant* value);
static void _media_page_on_raw_developer_changed_g_simple_action_change_state (GSimpleAction* _sender,
                                                                        GVariant* value,
                                                                        gpointer self);
static void media_page_real_remove_actions (Page* base,
                                     GActionMap* map);
static void media_page_real_update_actions (Page* base,
                                     gint selected_count,
                                     gint count);
VALA_EXTERN void page_set_action_sensitive (Page* self,
                                const gchar* name,
                                gboolean sensitive);
VALA_EXTERN gboolean desktop_integration_is_send_to_installed (void);
static void media_page_update_rating_sensitivities (MediaPage* self);
static void media_page_update_development_menu_item_sensitivity (MediaPage* self);
VALA_EXTERN DataSource* view_collection_get_selected_source_at (ViewCollection* self,
                                                    gint index);
VALA_EXTERN GType media_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MediaSource, g_object_unref)
VALA_EXTERN GType video_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (VideoSource, g_object_unref)
VALA_EXTERN GType video_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Video, g_object_unref)
static void media_page_update_flag_action (MediaPage* self,
                                    gint selected_count);
VALA_EXTERN gboolean alteration_has_detail (Alteration* self,
                                const gchar* subject,
                                const gchar* detail);
VALA_EXTERN gint view_collection_get_selected_count (ViewCollection* self);
static gboolean media_page_can_rate_selected (MediaPage* self,
                                       Rating rating);
static gboolean media_page_can_increase_selected_rating (MediaPage* self);
static gboolean media_page_can_decrease_selected_rating (MediaPage* self);
VALA_EXTERN GeeList* view_collection_get_selected (ViewCollection* self);
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 thumbnail_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Thumbnail, g_object_unref)
VALA_EXTERN MediaSource* thumbnail_get_media_source (Thumbnail* self);
VALA_EXTERN GType photo_file_format_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PhotoFileFormat photo_get_master_file_format (Photo* self);
static CoreViewTracker* media_page_real_get_view_tracker (CheckerboardPage* base);
VALA_EXTERN void media_page_set_display_ratings (MediaPage* self,
                                     gboolean display);
VALA_EXTERN void page_set_action_active (Page* self,
                             const gchar* name,
                             gboolean active);
VALA_EXTERN Rating media_source_get_rating (MediaSource* self);
VALA_EXTERN gboolean rating_can_increase (Rating self);
VALA_EXTERN gboolean rating_can_decrease (Rating self);
VALA_EXTERN MediaPageZoomSliderAssembly* media_page_create_zoom_slider_assembly (MediaPage* self);
VALA_EXTERN MediaPageZoomSliderAssembly* media_page_zoom_slider_assembly_new (void);
VALA_EXTERN MediaPageZoomSliderAssembly* media_page_zoom_slider_assembly_construct (GType object_type);
static gboolean media_page_real_on_mousewheel_up (Page* base,
                                           GdkEventScroll* event);
VALA_EXTERN void media_page_increase_zoom_level (MediaPage* self);
static gboolean media_page_real_on_mousewheel_down (Page* base,
                                             GdkEventScroll* event);
VALA_EXTERN void media_page_decrease_zoom_level (MediaPage* self);
VALA_EXTERN void desktop_integration_send_to (GeeCollection* media);
VALA_EXTERN GeeList* view_collection_get_selected_sources (ViewCollection* self);
VALA_EXTERN DataView* view_collection_get_selected_at (ViewCollection* self,
                                           gint index);
VALA_EXTERN DataSource* data_view_get_source (DataView* self);
VALA_EXTERN GFile* media_source_get_file (MediaSource* self);
VALA_EXTERN void app_window_error_message (const gchar* message,
                               GtkWindow* parent);
static gboolean media_page_real_on_app_key_pressed (Page* base,
                                             GdkEventKey* event);
VALA_EXTERN void page_activate_action (Page* self,
                           const gchar* name);
static void media_page_real_switched_to (Page* base);
static void media_page_set_display_tags (MediaPage* self,
                                  gboolean display);
VALA_EXTERN void checkerboard_page_cursor_to_item (CheckerboardPage* self,
                                       CheckerboardItem* item);
VALA_EXTERN void media_page_sync_sort (MediaPage* self);
static void media_page_real_switching_from (Page* base);
VALA_EXTERN void media_page_disconnect_slider (MediaPage* self);
VALA_EXTERN void media_page_connect_slider (MediaPage* self,
                                MediaPageZoomSliderAssembly* slider);
static void _media_page_on_zoom_changed_media_page_zoom_slider_assembly_zoom_changed (MediaPageZoomSliderAssembly* _sender,
                                                                               gpointer self);
static void media_page_load_persistent_thumbnail_scale (MediaPage* self);
static void media_page_save_persistent_thumbnail_scale (MediaPage* self);
VALA_EXTERN void configuration_facade_set_photo_thumbnail_scale (ConfigurationFacade* self,
                                                     gint scale);
VALA_EXTERN gint media_page_zoom_slider_assembly_get_scale (MediaPageZoomSliderAssembly* self);
VALA_EXTERN gint configuration_facade_get_photo_thumbnail_scale (ConfigurationFacade* self);
VALA_EXTERN void media_page_zoom_slider_assembly_set_scale (MediaPageZoomSliderAssembly* self,
                                                gint scale);
VALA_EXTERN void media_page_set_thumb_size (MediaPage* self,
                                gint new_scale);
static void media_page_real_on_zoom_changed (MediaPage* self);
static void media_page_real_on_export (MediaPage* self);
static void media_page_real_on_increase_size (MediaPage* self);
static void media_page_real_on_decrease_size (MediaPage* self);
VALA_EXTERN gpointer text_entry_dialog_mediator_ref (gpointer instance);
VALA_EXTERN void text_entry_dialog_mediator_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_text_entry_dialog_mediator (const gchar* name,
                                                   const gchar* nick,
                                                   const gchar* blurb,
                                                   GType object_type,
                                                   GParamFlags flags);
VALA_EXTERN void value_set_text_entry_dialog_mediator (GValue* value,
                                           gpointer v_object);
VALA_EXTERN void value_take_text_entry_dialog_mediator (GValue* value,
                                            gpointer v_object);
VALA_EXTERN gpointer value_get_text_entry_dialog_mediator (const GValue* value);
VALA_EXTERN GType text_entry_dialog_mediator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TextEntryDialogMediator, text_entry_dialog_mediator_unref)
VALA_EXTERN GType tags_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TagsDialog, text_entry_dialog_mediator_unref)
VALA_EXTERN GType add_tags_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AddTagsDialog, text_entry_dialog_mediator_unref)
VALA_EXTERN AddTagsDialog* add_tags_dialog_new (void);
VALA_EXTERN AddTagsDialog* add_tags_dialog_construct (GType object_type);
VALA_EXTERN gchar** add_tags_dialog_execute (AddTagsDialog* self,
                                 gint* result_length1);
VALA_EXTERN gpointer command_manager_ref (gpointer instance);
VALA_EXTERN void command_manager_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_command_manager (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_command_manager (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_command_manager (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_command_manager (const GValue* value);
VALA_EXTERN GType command_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CommandManager, command_manager_unref)
VALA_EXTERN CommandManager* page_get_command_manager (Page* self);
VALA_EXTERN GType command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Command, g_object_unref)
VALA_EXTERN void command_manager_execute (CommandManager* self,
                              Command* command);
VALA_EXTERN gpointer hierarchical_tag_index_ref (gpointer instance);
VALA_EXTERN void hierarchical_tag_index_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_hierarchical_tag_index (const gchar* name,
                                               const gchar* nick,
                                               const gchar* blurb,
                                               GType object_type,
                                               GParamFlags flags);
VALA_EXTERN void value_set_hierarchical_tag_index (GValue* value,
                                       gpointer v_object);
VALA_EXTERN void value_take_hierarchical_tag_index (GValue* value,
                                        gpointer v_object);
VALA_EXTERN gpointer value_get_hierarchical_tag_index (const GValue* value);
VALA_EXTERN GType hierarchical_tag_index_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (HierarchicalTagIndex, hierarchical_tag_index_unref)
VALA_EXTERN HierarchicalTagIndex* hierarchical_tag_index_get_global_index (void);
VALA_EXTERN gchar** hierarchical_tag_index_get_paths_for_names_array (HierarchicalTagIndex* self,
                                                          gchar** names,
                                                          gint names_length1,
                                                          gint* result_length1);
VALA_EXTERN AddTagsCommand* add_tags_command_new (gchar** paths,
                                      gint paths_length1,
                                      GeeCollection* sources);
VALA_EXTERN AddTagsCommand* add_tags_command_construct (GType object_type,
                                            gchar** paths,
                                            gint paths_length1,
                                            GeeCollection* sources);
VALA_EXTERN GType page_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageCommand, g_object_unref)
VALA_EXTERN GType add_tags_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AddTagsCommand, g_object_unref)
VALA_EXTERN GType modify_tags_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ModifyTagsDialog, text_entry_dialog_mediator_unref)
VALA_EXTERN ModifyTagsDialog* modify_tags_dialog_new (MediaSource* source);
VALA_EXTERN ModifyTagsDialog* modify_tags_dialog_construct (GType object_type,
                                                MediaSource* source);
VALA_EXTERN GType tag_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Tag, g_object_unref)
VALA_EXTERN GeeArrayList* modify_tags_dialog_execute (ModifyTagsDialog* self);
VALA_EXTERN ModifyTagsCommand* modify_tags_command_new (MediaSource* media,
                                            GeeCollection* new_tag_list);
VALA_EXTERN ModifyTagsCommand* modify_tags_command_construct (GType object_type,
                                                  MediaSource* media,
                                                  GeeCollection* new_tag_list);
VALA_EXTERN GType single_data_source_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SingleDataSourceCommand, g_object_unref)
VALA_EXTERN GType modify_tags_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ModifyTagsCommand, g_object_unref)
VALA_EXTERN NewEventCommand* new_event_command_new (GeeIterable* iter);
VALA_EXTERN NewEventCommand* new_event_command_construct (GType object_type,
                                              GeeIterable* iter);
VALA_EXTERN GType move_photos_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MovePhotosCommand, g_object_unref)
VALA_EXTERN GType new_event_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (NewEventCommand, g_object_unref)
VALA_EXTERN GeeList* view_collection_get_selected_sources_of_type (ViewCollection* self,
                                                       GType t);
VALA_EXTERN GType flaggable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Flaggable, g_object_unref)
VALA_EXTERN gboolean flaggable_is_flagged (Flaggable* self);
VALA_EXTERN FlagUnflagCommand* flag_unflag_command_new (GeeCollection* sources,
                                            gboolean flag);
VALA_EXTERN FlagUnflagCommand* flag_unflag_command_construct (GType object_type,
                                                  GeeCollection* sources,
                                                  gboolean flag);
VALA_EXTERN GType multiple_data_source_at_once_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MultipleDataSourceAtOnceCommand, g_object_unref)
VALA_EXTERN GType flag_unflag_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlagUnflagCommand, g_object_unref)
static void media_page_real_on_increase_rating (MediaPage* self);
VALA_EXTERN GType multiple_data_source_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MultipleDataSourceCommand, g_object_unref)
VALA_EXTERN GType set_rating_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SetRatingCommand, g_object_unref)
VALA_EXTERN SetRatingCommand* set_rating_command_new_inc_dec (GeeIterable* iter,
                                                  gboolean is_incrementing);
VALA_EXTERN SetRatingCommand* set_rating_command_construct_inc_dec (GType object_type,
                                                        GeeIterable* iter,
                                                        gboolean is_incrementing);
static void media_page_real_on_decrease_rating (MediaPage* self);
static void media_page_real_on_set_rating (MediaPage* self,
                                    Rating rating);
VALA_EXTERN SetRatingCommand* set_rating_command_new (GeeIterable* iter,
                                          Rating rating);
VALA_EXTERN SetRatingCommand* set_rating_command_construct (GType object_type,
                                                GeeIterable* iter,
                                                Rating rating);
static void media_page_real_on_rate_rejected (MediaPage* self);
static void media_page_real_on_rate_unrated (MediaPage* self);
static void media_page_real_on_rate_one (MediaPage* self);
static void media_page_real_on_rate_two (MediaPage* self);
static void media_page_real_on_rate_three (MediaPage* self);
static void media_page_real_on_rate_four (MediaPage* self);
static void media_page_real_on_rate_five (MediaPage* self);
VALA_EXTERN GType library_photo_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LibraryPhoto, g_object_unref)
VALA_EXTERN void remove_photos_from_library (GeeCollection* photos);
static void media_page_real_on_move_to_trash (MediaPage* self);
VALA_EXTERN DataView* view_collection_get_next (ViewCollection* self,
                                    DataView* view,
                                    gboolean** wrapped);
VALA_EXTERN gboolean data_collection_contains (DataCollection* self,
                                   DataObject* object);
VALA_EXTERN void checkerboard_page_set_cursor (CheckerboardPage* self,
                                   CheckerboardItem* item);
VALA_EXTERN TrashUntrashPhotosCommand* trash_untrash_photos_command_new (GeeCollection* sources,
                                                             gboolean to_trash);
VALA_EXTERN TrashUntrashPhotosCommand* trash_untrash_photos_command_construct (GType object_type,
                                                                   GeeCollection* sources,
                                                                   gboolean to_trash);
VALA_EXTERN GType trash_untrash_photos_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TrashUntrashPhotosCommand, g_object_unref)
static void media_page_real_on_edit_title (MediaPage* self);
VALA_EXTERN GType edit_title_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EditTitleDialog, text_entry_dialog_mediator_unref)
VALA_EXTERN gchar* media_source_get_title (MediaSource* self);
VALA_EXTERN EditTitleDialog* edit_title_dialog_new (const gchar* photo_title);
VALA_EXTERN EditTitleDialog* edit_title_dialog_construct (GType object_type,
                                              const gchar* photo_title);
VALA_EXTERN gchar* edit_title_dialog_execute (EditTitleDialog* self);
VALA_EXTERN EditMultipleTitlesCommand* edit_multiple_titles_command_new (GeeCollection* media_sources,
                                                             const gchar* new_title);
VALA_EXTERN EditMultipleTitlesCommand* edit_multiple_titles_command_construct (GType object_type,
                                                                   GeeCollection* media_sources,
                                                                   const gchar* new_title);
VALA_EXTERN GType edit_multiple_titles_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EditMultipleTitlesCommand, g_object_unref)
static void media_page_real_on_edit_comment (MediaPage* self);
VALA_EXTERN gpointer multi_text_entry_dialog_mediator_ref (gpointer instance);
VALA_EXTERN void multi_text_entry_dialog_mediator_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_multi_text_entry_dialog_mediator (const gchar* name,
                                                         const gchar* nick,
                                                         const gchar* blurb,
                                                         GType object_type,
                                                         GParamFlags flags);
VALA_EXTERN void value_set_multi_text_entry_dialog_mediator (GValue* value,
                                                 gpointer v_object);
VALA_EXTERN void value_take_multi_text_entry_dialog_mediator (GValue* value,
                                                  gpointer v_object);
VALA_EXTERN gpointer value_get_multi_text_entry_dialog_mediator (const GValue* value);
VALA_EXTERN GType multi_text_entry_dialog_mediator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MultiTextEntryDialogMediator, multi_text_entry_dialog_mediator_unref)
VALA_EXTERN GType edit_comment_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EditCommentDialog, multi_text_entry_dialog_mediator_unref)
VALA_EXTERN gchar* media_source_get_comment (MediaSource* self);
VALA_EXTERN EditCommentDialog* edit_comment_dialog_new (const gchar* comment,
                                            gboolean is_event);
VALA_EXTERN EditCommentDialog* edit_comment_dialog_construct (GType object_type,
                                                  const gchar* comment,
                                                  gboolean is_event);
VALA_EXTERN gchar* edit_comment_dialog_execute (EditCommentDialog* self);
VALA_EXTERN EditMultipleCommentsCommand* edit_multiple_comments_command_new (GeeCollection* media_sources,
                                                                 const gchar* new_comment);
VALA_EXTERN EditMultipleCommentsCommand* edit_multiple_comments_command_construct (GType object_type,
                                                                       GeeCollection* media_sources,
                                                                       const gchar* new_comment);
VALA_EXTERN GType edit_multiple_comments_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (EditMultipleCommentsCommand, g_object_unref)
static void media_page_real_on_display_titles (MediaPage* self,
                                        GSimpleAction* action,
                                        GVariant* value);
VALA_EXTERN void configuration_facade_set_display_photo_titles (ConfigurationFacade* self,
                                                    gboolean display);
static void media_page_real_on_display_comments (MediaPage* self,
                                          GSimpleAction* action,
                                          GVariant* value);
VALA_EXTERN void configuration_facade_set_display_photo_comments (ConfigurationFacade* self,
                                                      gboolean display);
static void media_page_real_on_display_ratings (MediaPage* self,
                                         GSimpleAction* action,
                                         GVariant* value);
VALA_EXTERN void configuration_facade_set_display_photo_ratings (ConfigurationFacade* self,
                                                     gboolean display);
static void media_page_real_on_display_tags (MediaPage* self,
                                      GSimpleAction* action,
                                      GVariant* value);
VALA_EXTERN void configuration_facade_set_display_photo_tags (ConfigurationFacade* self,
                                                  gboolean display);
static void media_page_real_get_config_photos_sort (MediaPage* self,
                                             gboolean* sort_order,
                                             gint* sort_by);
static void media_page_real_set_config_photos_sort (MediaPage* self,
                                             gboolean sort_order,
                                             gint sort_by);
static void media_page_real_on_sort_changed (MediaPage* self,
                                      GSimpleAction* action,
                                      GVariant* value);
VALA_EXTERN gint media_page_get_menu_sort_by (MediaPage* self);
VALA_EXTERN gboolean media_page_get_menu_sort_order (MediaPage* self);
static void media_page_set_view_comparator (MediaPage* self,
                                     gint sort_by,
                                     gboolean ascending);
static void media_page_real_developer_changed (MediaPage* self,
                                        RawDeveloper rd);
VALA_EXTERN gboolean raw_developer_is_equivalent (RawDeveloper self,
                                      RawDeveloper d);
VALA_EXTERN RawDeveloper photo_get_raw_developer (Photo* self);
VALA_EXTERN gboolean photo_has_transformations (Photo* self);
VALA_EXTERN gboolean dialogs_confirm_warn_developer_changed (gint number);
VALA_EXTERN GType set_raw_developer_command_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SetRawDeveloperCommand, g_object_unref)
VALA_EXTERN SetRawDeveloperCommand* set_raw_developer_command_new (GeeIterable* iter,
                                                       RawDeveloper developer);
VALA_EXTERN SetRawDeveloperCommand* set_raw_developer_command_construct (GType object_type,
                                                             GeeIterable* iter,
                                                             RawDeveloper developer);
static void media_page_real_set_display_titles (CheckerboardPage* base,
                                         gboolean display);
static void media_page_real_set_display_comments (CheckerboardPage* base,
                                           gboolean display);
static GAction* media_page_sort_by_title_action (MediaPage* self);
static GAction* media_page_sort_ascending_action (MediaPage* self);
VALA_EXTERN void media_page_set_menu_sort_by (MediaPage* self,
                                  gint val);
static GVariant* _variant_new27 (const gchar* value);
VALA_EXTERN void media_page_set_menu_sort_order (MediaPage* self,
                                     gboolean ascending);
static GVariant* _variant_new28 (const gchar* value);
VALA_EXTERN gint64 thumbnail_title_ascending_comparator (void* a,
                                             void* b);
static gint64 _thumbnail_title_ascending_comparator_comparator (void* a,
                                                         void* b,
                                                         gpointer self);
VALA_EXTERN gint64 thumbnail_title_descending_comparator (void* a,
                                              void* b);
static gint64 _thumbnail_title_descending_comparator_comparator (void* a,
                                                          void* b,
                                                          gpointer self);
VALA_EXTERN gboolean thumbnail_title_comparator_predicate (DataObject* object,
                                               Alteration* alteration);
static gboolean _thumbnail_title_comparator_predicate_comparator_predicate (DataObject* object,
                                                                     Alteration* alteration,
                                                                     gpointer self);
VALA_EXTERN gint64 thumbnail_exposure_time_ascending_comparator (void* a,
                                                     void* b);
static gint64 _thumbnail_exposure_time_ascending_comparator_comparator (void* a,
                                                                 void* b,
                                                                 gpointer self);
VALA_EXTERN gint64 thumbnail_exposure_time_descending_comparator (void* a,
                                                      void* b);
static gint64 _thumbnail_exposure_time_descending_comparator_comparator (void* a,
                                                                  void* b,
                                                                  gpointer self);
VALA_EXTERN gboolean thumbnail_exposure_time_comparator_predicate (DataObject* object,
                                                       Alteration* alteration);
static gboolean _thumbnail_exposure_time_comparator_predicate_comparator_predicate (DataObject* object,
                                                                             Alteration* alteration,
                                                                             gpointer self);
VALA_EXTERN gint64 thumbnail_rating_ascending_comparator (void* a,
                                              void* b);
static gint64 _thumbnail_rating_ascending_comparator_comparator (void* a,
                                                          void* b,
                                                          gpointer self);
VALA_EXTERN gint64 thumbnail_rating_descending_comparator (void* a,
                                               void* b);
static gint64 _thumbnail_rating_descending_comparator_comparator (void* a,
                                                           void* b,
                                                           gpointer self);
VALA_EXTERN gboolean thumbnail_rating_comparator_predicate (DataObject* object,
                                                Alteration* alteration);
static gboolean _thumbnail_rating_comparator_predicate_comparator_predicate (DataObject* object,
                                                                      Alteration* alteration,
                                                                      gpointer self);
VALA_EXTERN gint64 thumbnail_filename_ascending_comparator (void* a,
                                                void* b);
static gint64 _thumbnail_filename_ascending_comparator_comparator (void* a,
                                                            void* b,
                                                            gpointer self);
VALA_EXTERN gint64 thumbnail_filename_descending_comparator (void* a,
                                                 void* b);
static gint64 _thumbnail_filename_descending_comparator_comparator (void* a,
                                                             void* b,
                                                             gpointer self);
VALA_EXTERN gboolean thumbnail_filename_comparator_predicate (DataObject* object,
                                                  Alteration* alteration);
static gboolean _thumbnail_filename_comparator_predicate_comparator_predicate (DataObject* object,
                                                                        Alteration* alteration,
                                                                        gpointer self);
VALA_EXTERN void data_collection_set_comparator (DataCollection* self,
                                     Comparator comparator,
                                     gpointer comparator_target,
                                     ComparatorPredicate predicate,
                                     gpointer predicate_target);
static void media_page_real_destroy (GtkWidget* base);
VALA_EXTERN void media_page_zoom_slider_assembly_increase_step (MediaPageZoomSliderAssembly* self);
VALA_EXTERN void media_page_zoom_slider_assembly_decrease_step (MediaPageZoomSliderAssembly* self);
static DataView* media_page_real_create_thumbnail (MediaPage* self,
                                            DataSource* source);
VALA_EXTERN Thumbnail* thumbnail_new (MediaSource* media,
                          gint scale);
VALA_EXTERN Thumbnail* thumbnail_construct (GType object_type,
                                MediaSource* media,
                                gint scale);
VALA_EXTERN gboolean page_is_in_view (Page* self);
VALA_EXTERN GType checkerboard_layout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardLayout, g_object_unref)
VALA_EXTERN CheckerboardLayout* checkerboard_page_get_checkerboard_layout (CheckerboardPage* self);
VALA_EXTERN void checkerboard_layout_set_scale (CheckerboardLayout* self,
                                    gint scale);
VALA_EXTERN gint checkerboard_layout_get_scale (CheckerboardLayout* self);
static gboolean media_page_zoom_slider_assembly_on_zoom_out_pressed (MediaPageZoomSliderAssembly* self,
                                                              GdkEventButton* event);
static gboolean _media_page_zoom_slider_assembly_on_zoom_out_pressed_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                             GdkEventButton* event,
                                                                                             gpointer self);
VALA_EXTERN gdouble media_page_zoom_slider_assembly_scale_to_slider (gint value);
static void media_page_zoom_slider_assembly_on_slider_changed (MediaPageZoomSliderAssembly* self);
static void _media_page_zoom_slider_assembly_on_slider_changed_gtk_range_value_changed (GtkRange* _sender,
                                                                                 gpointer self);
static gboolean media_page_zoom_slider_assembly_on_zoom_in_pressed (MediaPageZoomSliderAssembly* self,
                                                             GdkEventButton* event);
static gboolean _media_page_zoom_slider_assembly_on_zoom_in_pressed_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                            GdkEventButton* event,
                                                                                            gpointer self);
VALA_EXTERN gint media_page_zoom_slider_assembly_slider_to_scale (gdouble value);
VALA_EXTERN void media_page_zoom_slider_assembly_snap_to_min (MediaPageZoomSliderAssembly* self);
VALA_EXTERN void media_page_zoom_slider_assembly_snap_to_max (MediaPageZoomSliderAssembly* self);
static void media_page_zoom_slider_assembly_finalize (GObject * obj);
static GType media_page_zoom_slider_assembly_get_type_once (void);
static void media_page_finalize (GObject * obj);
static GType media_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 const GActionEntry MEDIA_PAGE_entries[29] = {{"Export", _media_page_on_export_gsimple_action_activate_callback}, {"SendTo", _media_page_on_send_to_gsimple_action_activate_callback}, {"SendToContextMenu", _media_page_on_send_to_gsimple_action_activate_callback}, {"RemoveFromLibrary", _media_page_on_remove_from_library_gsimple_action_activate_callback}, {"MoveToTrash", _media_page_on_move_to_trash_gsimple_action_activate_callback}, {"NewEvent", _media_page_on_new_event_gsimple_action_activate_callback}, {"AddTags", _media_page_on_add_tags_gsimple_action_activate_callback}, {"ModifyTags", _media_page_on_modify_tags_gsimple_action_activate_callback}, {"IncreaseSize", _media_page_on_increase_size_gsimple_action_activate_callback}, {"DecreaseSize", _media_page_on_decrease_size_gsimple_action_activate_callback}, {"Flag", _media_page_on_flag_unflag_gsimple_action_activate_callback}, {"IncreaseRating", _media_page_on_increase_rating_gsimple_action_activate_callback}, {"DecreaseRating", _media_page_on_decrease_rating_gsimple_action_activate_callback}, {"RateRejected", _media_page_on_rate_rejected_gsimple_action_activate_callback}, {"RateUnrated", _media_page_on_rate_unrated_gsimple_action_activate_callback}, {"RateOne", _media_page_on_rate_one_gsimple_action_activate_callback}, {"RateTwo", _media_page_on_rate_two_gsimple_action_activate_callback}, {"RateThree", _media_page_on_rate_three_gsimple_action_activate_callback}, {"RateFour", _media_page_on_rate_four_gsimple_action_activate_callback}, {"RateFive", _media_page_on_rate_five_gsimple_action_activate_callback}, {"EditTitle", _media_page_on_edit_title_gsimple_action_activate_callback}, {"EditComment", _media_page_on_edit_comment_gsimple_action_activate_callback}, {"PlayVideo", _media_page_on_play_video_gsimple_action_activate_callback}, {"ViewTitle", _page_on_action_toggle_gsimple_action_activate_callback, NULL, "false", _media_page_on_display_titles_gsimple_action_change_state_callback}, {"ViewComment", _page_on_action_toggle_gsimple_action_activate_callback, NULL, "false", _media_page_on_display_comments_gsimple_action_change_state_callback}, {"ViewRatings", _page_on_action_toggle_gsimple_action_activate_callback, NULL, "false", _media_page_on_display_ratings_gsimple_action_change_state_callback}, {"ViewTags", _page_on_action_toggle_gsimple_action_activate_callback, NULL, "false", _media_page_on_display_tags_gsimple_action_change_state_callback}, {"SortBy", _page_on_action_radio_gsimple_action_activate_callback, "s", "'1'", _media_page_on_sort_changed_gsimple_action_change_state_callback}, {"Sort", _page_on_action_radio_gsimple_action_activate_callback, "s", "'ascending'", _media_page_on_sort_changed_gsimple_action_change_state_callback}};

static inline gpointer
media_source_item_get_instance_private (MediaSourceItem* self)
{
	return G_STRUCT_MEMBER_P (self, MediaSourceItem_private_offset);
}

MediaSourceItem*
media_source_item_construct (GType object_type,
                             ThumbnailSource* source,
                             Dimensions* initial_pixbuf_dim,
                             const gchar* title,
                             const gchar* comment,
                             gboolean marked_up,
                             PangoAlignment alignment)
{
	MediaSourceItem * self = NULL;
	Dimensions _tmp0_;
	g_return_val_if_fail (IS_THUMBNAIL_SOURCE (source), NULL);
	g_return_val_if_fail (initial_pixbuf_dim != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	_tmp0_ = *initial_pixbuf_dim;
	self = (MediaSourceItem*) checkerboard_item_construct (object_type, source, &_tmp0_, title, comment, marked_up, alignment);
	return self;
}

MediaSourceItem*
media_source_item_new (ThumbnailSource* source,
                       Dimensions* initial_pixbuf_dim,
                       const gchar* title,
                       const gchar* comment,
                       gboolean marked_up,
                       PangoAlignment alignment)
{
	return media_source_item_construct (TYPE_MEDIA_SOURCE_ITEM, source, initial_pixbuf_dim, title, comment, marked_up, alignment);
}

void
media_source_item_set_title (MediaSourceItem* self,
                             const gchar* text,
                             gboolean marked_up,
                             PangoAlignment alignment)
{
	g_return_if_fail (IS_MEDIA_SOURCE_ITEM (self));
	g_return_if_fail (text != NULL);
	checkerboard_item_set_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem), text, marked_up, alignment);
	_g_free0 (self->priv->natural_collation_key);
	self->priv->natural_collation_key = NULL;
}

gchar*
media_source_item_get_natural_collation_key (MediaSourceItem* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (IS_MEDIA_SOURCE_ITEM (self), NULL);
	_tmp0_ = self->priv->natural_collation_key;
	if (_tmp0_ == NULL) {
		gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = checkerboard_item_get_title (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
		_tmp2_ = natural_collate_collate_key (_tmp1_);
		_g_free0 (self->priv->natural_collation_key);
		self->priv->natural_collation_key = _tmp2_;
	}
	_tmp3_ = self->priv->natural_collation_key;
	_tmp4_ = g_strdup (_tmp3_);
	result = _tmp4_;
	return result;
}

static void
media_source_item_class_init (MediaSourceItemClass * klass,
                              gpointer klass_data)
{
	media_source_item_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &MediaSourceItem_private_offset);
	G_OBJECT_CLASS (klass)->finalize = media_source_item_finalize;
}

static void
media_source_item_instance_init (MediaSourceItem * self,
                                 gpointer klass)
{
	self->priv = media_source_item_get_instance_private (self);
	self->priv->natural_collation_key = NULL;
}

static void
media_source_item_finalize (GObject * obj)
{
	MediaSourceItem * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MEDIA_SOURCE_ITEM, MediaSourceItem);
	_g_free0 (self->priv->natural_collation_key);
	G_OBJECT_CLASS (media_source_item_parent_class)->finalize (obj);
}

static GType
media_source_item_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MediaSourceItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) media_source_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MediaSourceItem), 0, (GInstanceInitFunc) media_source_item_instance_init, NULL };
	GType media_source_item_type_id;
	media_source_item_type_id = g_type_register_static (TYPE_CHECKERBOARD_ITEM, "MediaSourceItem", &g_define_type_info, 0);
	MediaSourceItem_private_offset = g_type_add_instance_private (media_source_item_type_id, sizeof (MediaSourceItemPrivate));
	return media_source_item_type_id;
}

GType
media_source_item_get_type (void)
{
	static volatile gsize media_source_item_type_id__once = 0;
	if (g_once_init_enter (&media_source_item_type_id__once)) {
		GType media_source_item_type_id;
		media_source_item_type_id = media_source_item_get_type_once ();
		g_once_init_leave (&media_source_item_type_id__once, media_source_item_type_id);
	}
	return media_source_item_type_id__once;
}

static inline gpointer
media_page_get_instance_private (MediaPage* self)
{
	return G_STRUCT_MEMBER_P (self, MediaPage_private_offset);
}

static GType
media_page_sort_by_get_type_once (void)
{
	static const GEnumValue values[] = {{MEDIA_PAGE_SORT_BY_MIN, "MEDIA_PAGE_SORT_BY_MIN", "min"}, {MEDIA_PAGE_SORT_BY_TITLE, "MEDIA_PAGE_SORT_BY_TITLE", "title"}, {MEDIA_PAGE_SORT_BY_EXPOSURE_DATE, "MEDIA_PAGE_SORT_BY_EXPOSURE_DATE", "exposure-date"}, {MEDIA_PAGE_SORT_BY_RATING, "MEDIA_PAGE_SORT_BY_RATING", "rating"}, {MEDIA_PAGE_SORT_BY_FILENAME, "MEDIA_PAGE_SORT_BY_FILENAME", "filename"}, {MEDIA_PAGE_SORT_BY_MAX, "MEDIA_PAGE_SORT_BY_MAX", "max"}, {0, NULL, NULL}};
	GType media_page_sort_by_type_id;
	media_page_sort_by_type_id = g_enum_register_static ("MediaPageSortBy", values);
	return media_page_sort_by_type_id;
}

GType
media_page_sort_by_get_type (void)
{
	static volatile gsize media_page_sort_by_type_id__once = 0;
	if (g_once_init_enter (&media_page_sort_by_type_id__once)) {
		GType media_page_sort_by_type_id;
		media_page_sort_by_type_id = media_page_sort_by_get_type_once ();
		g_once_init_leave (&media_page_sort_by_type_id__once, media_page_sort_by_type_id);
	}
	return media_page_sort_by_type_id__once;
}

static void
_media_page_on_export_gsimple_action_activate_callback (GSimpleAction* action,
                                                        GVariant* parameter,
                                                        gpointer self)
{
	media_page_on_export ((MediaPage*) self);
}

static void
_media_page_on_send_to_gsimple_action_activate_callback (GSimpleAction* action,
                                                         GVariant* parameter,
                                                         gpointer self)
{
	media_page_on_send_to ((MediaPage*) self);
}

static void
_media_page_on_remove_from_library_gsimple_action_activate_callback (GSimpleAction* action,
                                                                     GVariant* parameter,
                                                                     gpointer self)
{
	media_page_on_remove_from_library ((MediaPage*) self);
}

static void
_media_page_on_move_to_trash_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self)
{
	media_page_on_move_to_trash ((MediaPage*) self);
}

static void
_media_page_on_new_event_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self)
{
	media_page_on_new_event ((MediaPage*) self);
}

static void
_media_page_on_add_tags_gsimple_action_activate_callback (GSimpleAction* action,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	media_page_on_add_tags ((MediaPage*) self);
}

static void
_media_page_on_modify_tags_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self)
{
	media_page_on_modify_tags ((MediaPage*) self);
}

static void
_media_page_on_increase_size_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self)
{
	media_page_on_increase_size ((MediaPage*) self);
}

static void
_media_page_on_decrease_size_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self)
{
	media_page_on_decrease_size ((MediaPage*) self);
}

static void
_media_page_on_flag_unflag_gsimple_action_activate_callback (GSimpleAction* action,
                                                             GVariant* parameter,
                                                             gpointer self)
{
	media_page_on_flag_unflag ((MediaPage*) self);
}

static void
_media_page_on_increase_rating_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self)
{
	media_page_on_increase_rating ((MediaPage*) self);
}

static void
_media_page_on_decrease_rating_gsimple_action_activate_callback (GSimpleAction* action,
                                                                 GVariant* parameter,
                                                                 gpointer self)
{
	media_page_on_decrease_rating ((MediaPage*) self);
}

static void
_media_page_on_rate_rejected_gsimple_action_activate_callback (GSimpleAction* action,
                                                               GVariant* parameter,
                                                               gpointer self)
{
	media_page_on_rate_rejected ((MediaPage*) self);
}

static void
_media_page_on_rate_unrated_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self)
{
	media_page_on_rate_unrated ((MediaPage*) self);
}

static void
_media_page_on_rate_one_gsimple_action_activate_callback (GSimpleAction* action,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	media_page_on_rate_one ((MediaPage*) self);
}

static void
_media_page_on_rate_two_gsimple_action_activate_callback (GSimpleAction* action,
                                                          GVariant* parameter,
                                                          gpointer self)
{
	media_page_on_rate_two ((MediaPage*) self);
}

static void
_media_page_on_rate_three_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self)
{
	media_page_on_rate_three ((MediaPage*) self);
}

static void
_media_page_on_rate_four_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self)
{
	media_page_on_rate_four ((MediaPage*) self);
}

static void
_media_page_on_rate_five_gsimple_action_activate_callback (GSimpleAction* action,
                                                           GVariant* parameter,
                                                           gpointer self)
{
	media_page_on_rate_five ((MediaPage*) self);
}

static void
_media_page_on_edit_title_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self)
{
	media_page_on_edit_title ((MediaPage*) self);
}

static void
_media_page_on_edit_comment_gsimple_action_activate_callback (GSimpleAction* action,
                                                              GVariant* parameter,
                                                              gpointer self)
{
	media_page_on_edit_comment ((MediaPage*) self);
}

static void
_media_page_on_play_video_gsimple_action_activate_callback (GSimpleAction* action,
                                                            GVariant* parameter,
                                                            gpointer self)
{
	media_page_on_play_video ((MediaPage*) self);
}

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

static void
_media_page_on_display_titles_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                    GVariant* value,
                                                                    gpointer self)
{
	media_page_on_display_titles ((MediaPage*) self, action, value);
}

static void
_media_page_on_display_comments_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                      GVariant* value,
                                                                      gpointer self)
{
	media_page_on_display_comments ((MediaPage*) self, action, value);
}

static void
_media_page_on_display_ratings_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                     GVariant* value,
                                                                     gpointer self)
{
	media_page_on_display_ratings ((MediaPage*) self, action, value);
}

static void
_media_page_on_display_tags_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                  GVariant* value,
                                                                  gpointer self)
{
	media_page_on_display_tags ((MediaPage*) self, action, value);
}

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

static void
_media_page_on_sort_changed_gsimple_action_change_state_callback (GSimpleAction* action,
                                                                  GVariant* value,
                                                                  gpointer self)
{
	media_page_on_sort_changed ((MediaPage*) self, action, value);
}

static void
_media_page_on_media_altered_data_collection_items_altered (DataCollection* _sender,
                                                            GeeMap* items,
                                                            gpointer self)
{
	media_page_on_media_altered ((MediaPage*) self, items);
}

MediaPage*
media_page_construct (GType object_type,
                      const gchar* page_name)
{
	MediaPage * self = NULL;
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	MediaViewTracker* _tmp2_;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	ViewCollection* _tmp5_;
	ViewCollection* _tmp6_;
	ViewCollection* _tmp7_;
	ViewCollection* _tmp8_;
	ConfigFacade* _tmp9_;
	ConfigFacade* _tmp10_;
	GValue _tmp11_ = {0};
	ViewCollection* _tmp12_;
	ViewCollection* _tmp13_;
	ConfigFacade* _tmp14_;
	ConfigFacade* _tmp15_;
	GValue _tmp16_ = {0};
	ViewCollection* _tmp17_;
	ViewCollection* _tmp18_;
	ConfigFacade* _tmp19_;
	ConfigFacade* _tmp20_;
	GValue _tmp21_ = {0};
	ViewCollection* _tmp22_;
	ViewCollection* _tmp23_;
	GValue _tmp24_ = {0};
	ViewCollection* _tmp25_;
	ViewCollection* _tmp26_;
	ConfigFacade* _tmp27_;
	ConfigFacade* _tmp28_;
	GValue _tmp29_ = {0};
	ViewCollection* _tmp30_;
	ViewCollection* _tmp31_;
	DragAndDropHandler* _tmp32_;
	g_return_val_if_fail (page_name != NULL, NULL);
	self = (MediaPage*) checkerboard_page_construct (object_type, page_name);
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = media_view_tracker_new (_tmp1_);
	_core_tracker_unref0 (self->priv->tracker);
	self->priv->tracker = _tmp2_;
	_data_collection_unref0 (_tmp1_);
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_DATA_COLLECTION, DataCollection), "items-altered", (GCallback) _media_page_on_media_altered_data_collection_items_altered, self, 0);
	_data_collection_unref0 (_tmp4_);
	_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp6_ = _tmp5_;
	data_collection_freeze_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp6_);
	_tmp7_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp8_ = _tmp7_;
	_tmp9_ = config_facade_get_instance ();
	_tmp10_ = _tmp9_;
	g_value_init (&_tmp11_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp11_, configuration_facade_get_display_photo_titles (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_DATA_COLLECTION, DataCollection), CHECKERBOARD_ITEM_PROP_SHOW_TITLES, &_tmp11_, NULL, NULL);
	G_IS_VALUE (&_tmp11_) ? (g_value_unset (&_tmp11_), NULL) : NULL;
	_g_object_unref0 (_tmp10_);
	_data_collection_unref0 (_tmp8_);
	_tmp12_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp13_ = _tmp12_;
	_tmp14_ = config_facade_get_instance ();
	_tmp15_ = _tmp14_;
	g_value_init (&_tmp16_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp16_, configuration_facade_get_display_photo_comments (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_COLLECTION, DataCollection), CHECKERBOARD_ITEM_PROP_SHOW_COMMENTS, &_tmp16_, NULL, NULL);
	G_IS_VALUE (&_tmp16_) ? (g_value_unset (&_tmp16_), NULL) : NULL;
	_g_object_unref0 (_tmp15_);
	_data_collection_unref0 (_tmp13_);
	_tmp17_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp18_ = _tmp17_;
	_tmp19_ = config_facade_get_instance ();
	_tmp20_ = _tmp19_;
	g_value_init (&_tmp21_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp21_, configuration_facade_get_display_photo_tags (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_DATA_COLLECTION, DataCollection), THUMBNAIL_PROP_SHOW_TAGS, &_tmp21_, NULL, NULL);
	G_IS_VALUE (&_tmp21_) ? (g_value_unset (&_tmp21_), NULL) : NULL;
	_g_object_unref0 (_tmp20_);
	_data_collection_unref0 (_tmp18_);
	_tmp22_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp23_ = _tmp22_;
	g_value_init (&_tmp24_, G_TYPE_INT);
	g_value_set_int (&_tmp24_, media_page_get_thumb_size (self));
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, TYPE_DATA_COLLECTION, DataCollection), THUMBNAIL_PROP_SIZE, &_tmp24_, NULL, NULL);
	G_IS_VALUE (&_tmp24_) ? (g_value_unset (&_tmp24_), NULL) : NULL;
	_data_collection_unref0 (_tmp23_);
	_tmp25_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp26_ = _tmp25_;
	_tmp27_ = config_facade_get_instance ();
	_tmp28_ = _tmp27_;
	g_value_init (&_tmp29_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp29_, configuration_facade_get_display_photo_ratings (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, TYPE_DATA_COLLECTION, DataCollection), THUMBNAIL_PROP_SHOW_RATINGS, &_tmp29_, NULL, NULL);
	G_IS_VALUE (&_tmp29_) ? (g_value_unset (&_tmp29_), NULL) : NULL;
	_g_object_unref0 (_tmp28_);
	_data_collection_unref0 (_tmp26_);
	_tmp30_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp31_ = _tmp30_;
	data_collection_thaw_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp31_);
	_tmp32_ = drag_and_drop_handler_new (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_drag_and_drop_handler_unref0 (self->priv->dnd_handler);
	self->priv->dnd_handler = _tmp32_;
	return self;
}

static gint
media_page_compute_zoom_scale_increase (gint current_scale)
{
	gint new_scale = 0;
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint result;
	new_scale = current_scale + MEDIA_PAGE_MANUAL_STEPPING;
	_tmp0_ = thumbnail_get_MIN_SCALE ();
	_tmp1_ = _tmp0_;
	_tmp2_ = thumbnail_get_MAX_SCALE ();
	_tmp3_ = _tmp2_;
	result = CLAMP (new_scale, _tmp1_, _tmp3_);
	return result;
}

static gint
media_page_compute_zoom_scale_decrease (gint current_scale)
{
	gint new_scale = 0;
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint result;
	new_scale = current_scale - MEDIA_PAGE_MANUAL_STEPPING;
	_tmp0_ = thumbnail_get_MIN_SCALE ();
	_tmp1_ = _tmp0_;
	_tmp2_ = thumbnail_get_MAX_SCALE ();
	_tmp3_ = _tmp2_;
	result = CLAMP (new_scale, _tmp1_, _tmp3_);
	return result;
}

static void
media_page_real_init_collect_ui_filenames (Page* base,
                                           GeeList* ui_filenames)
{
	MediaPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (ui_filenames, GEE_TYPE_LIST));
	PAGE_CLASS (media_page_parent_class)->init_collect_ui_filenames (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), ui_filenames);
	gee_collection_add (G_TYPE_CHECK_INSTANCE_CAST (ui_filenames, GEE_TYPE_COLLECTION, GeeCollection), "media.ui");
}

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

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

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

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

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

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

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

static void
_media_page_on_raw_developer_changed_g_simple_action_change_state (GSimpleAction* _sender,
                                                                   GVariant* value,
                                                                   gpointer self)
{
	media_page_on_raw_developer_changed ((MediaPage*) self, _sender, value);
}

static void
media_page_real_add_actions (Page* base,
                             GActionMap* map)
{
	MediaPage * self;
	gboolean sort_order = FALSE;
	gint sort_by = 0;
	gboolean _tmp0_ = FALSE;
	gint _tmp1_ = 0;
	GAction* _tmp2_;
	GAction* _tmp3_;
	ConfigFacade* _tmp4_;
	ConfigFacade* _tmp5_;
	GVariant* _tmp6_;
	GAction* _tmp7_;
	GAction* _tmp8_;
	ConfigFacade* _tmp9_;
	ConfigFacade* _tmp10_;
	GVariant* _tmp11_;
	GAction* _tmp12_;
	GAction* _tmp13_;
	ConfigFacade* _tmp14_;
	ConfigFacade* _tmp15_;
	GVariant* _tmp16_;
	GAction* _tmp17_;
	GAction* _tmp18_;
	ConfigFacade* _tmp19_;
	ConfigFacade* _tmp20_;
	GVariant* _tmp21_;
	GAction* _tmp22_;
	GAction* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	GVariant* _tmp26_;
	const gchar* _tmp27_ = NULL;
	GAction* _tmp28_;
	GAction* _tmp29_;
	GVariant* _tmp30_;
	RawDeveloper d = 0;
	ConfigFacade* _tmp31_;
	ConfigFacade* _tmp32_;
	RawDeveloper _tmp33_;
	const gchar* _tmp34_ = NULL;
	GSimpleAction* action = NULL;
	const GVariantType* _tmp35_;
	GVariant* _tmp36_;
	GSimpleAction* _tmp37_;
	GSimpleAction* _tmp38_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (map, g_action_map_get_type ()));
	PAGE_CLASS (media_page_parent_class)->add_actions (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), map);
	media_page_get_config_photos_sort (self, &_tmp0_, &_tmp1_);
	sort_order = _tmp0_;
	sort_by = _tmp1_;
	g_action_map_add_action_entries (map, MEDIA_PAGE_entries, (gint) G_N_ELEMENTS (MEDIA_PAGE_entries), self);
	_tmp2_ = page_get_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewTitle");
	_tmp3_ = _tmp2_;
	_tmp4_ = config_facade_get_instance ();
	_tmp5_ = _tmp4_;
	_tmp6_ = _variant_new20 (configuration_facade_get_display_photo_titles (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	g_action_change_state (_tmp3_, _tmp6_);
	_g_variant_unref0 (_tmp6_);
	_g_object_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_tmp7_ = page_get_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewComment");
	_tmp8_ = _tmp7_;
	_tmp9_ = config_facade_get_instance ();
	_tmp10_ = _tmp9_;
	_tmp11_ = _variant_new21 (configuration_facade_get_display_photo_comments (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	g_action_change_state (_tmp8_, _tmp11_);
	_g_variant_unref0 (_tmp11_);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (_tmp8_);
	_tmp12_ = page_get_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewRatings");
	_tmp13_ = _tmp12_;
	_tmp14_ = config_facade_get_instance ();
	_tmp15_ = _tmp14_;
	_tmp16_ = _variant_new22 (configuration_facade_get_display_photo_ratings (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	g_action_change_state (_tmp13_, _tmp16_);
	_g_variant_unref0 (_tmp16_);
	_g_object_unref0 (_tmp15_);
	_g_object_unref0 (_tmp13_);
	_tmp17_ = page_get_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewTags");
	_tmp18_ = _tmp17_;
	_tmp19_ = config_facade_get_instance ();
	_tmp20_ = _tmp19_;
	_tmp21_ = _variant_new23 (configuration_facade_get_display_photo_tags (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	g_action_change_state (_tmp18_, _tmp21_);
	_g_variant_unref0 (_tmp21_);
	_g_object_unref0 (_tmp20_);
	_g_object_unref0 (_tmp18_);
	_tmp22_ = page_get_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "SortBy");
	_tmp23_ = _tmp22_;
	_tmp24_ = g_strdup_printf ("%d", sort_by);
	_tmp25_ = _tmp24_;
	_tmp26_ = _variant_new24 (_tmp25_);
	g_action_change_state (_tmp23_, _tmp26_);
	_g_variant_unref0 (_tmp26_);
	_g_free0 (_tmp25_);
	_g_object_unref0 (_tmp23_);
	if (sort_order) {
		_tmp27_ = "ascending";
	} else {
		_tmp27_ = "descending";
	}
	_tmp28_ = page_get_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "Sort");
	_tmp29_ = _tmp28_;
	_tmp30_ = _variant_new25 (_tmp27_);
	g_action_change_state (_tmp29_, _tmp30_);
	_g_variant_unref0 (_tmp30_);
	_g_object_unref0 (_tmp29_);
	_tmp31_ = config_facade_get_instance ();
	_tmp32_ = _tmp31_;
	_tmp33_ = configuration_facade_get_default_raw_developer (G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp32_);
	d = _tmp33_;
	if (d == RAW_DEVELOPER_SHOTWELL) {
		_tmp34_ = "Shotwell";
	} else {
		_tmp34_ = "Camera";
	}
	_tmp35_ = G_VARIANT_TYPE_STRING;
	_tmp36_ = _variant_new26 (_tmp34_);
	_tmp37_ = g_simple_action_new_stateful ("RawDeveloper", _tmp35_, _tmp36_);
	_tmp38_ = _tmp37_;
	_g_variant_unref0 (_tmp36_);
	action = _tmp38_;
	g_signal_connect_object (action, "change-state", (GCallback) _media_page_on_raw_developer_changed_g_simple_action_change_state, self, 0);
	g_simple_action_set_enabled (action, TRUE);
	g_action_map_add_action (map, G_TYPE_CHECK_INSTANCE_CAST (action, g_action_get_type (), GAction));
	_g_object_unref0 (action);
}

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

static void
media_page_real_update_actions (Page* base,
                                gint selected_count,
                                gint count)
{
	MediaPage * self;
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gboolean _tmp4_ = FALSE;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "Export", selected_count > 0);
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "EditTitle", selected_count > 0);
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "EditComment", selected_count > 0);
	_tmp0_ = thumbnail_get_MAX_SCALE ();
	_tmp1_ = _tmp0_;
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "IncreaseSize", media_page_get_thumb_size (self) < _tmp1_);
	_tmp2_ = thumbnail_get_MIN_SCALE ();
	_tmp3_ = _tmp2_;
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "DecreaseSize", media_page_get_thumb_size (self) > _tmp3_);
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RemoveFromLibrary", selected_count > 0);
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "MoveToTrash", selected_count > 0);
	if (desktop_integration_is_send_to_installed ()) {
		page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "SendTo", selected_count > 0);
	} else {
		page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "SendTo", FALSE);
	}
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "Rate", selected_count > 0);
	media_page_update_rating_sensitivities (self);
	media_page_update_development_menu_item_sensitivity (self);
	if (selected_count == 1) {
		ViewCollection* _tmp5_;
		ViewCollection* _tmp6_;
		DataSource* _tmp7_;
		DataSource* _tmp8_;
		_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp6_ = _tmp5_;
		_tmp7_ = view_collection_get_selected_source_at (_tmp6_, 0);
		_tmp8_ = _tmp7_;
		_tmp4_ = IS_VIDEO (_tmp8_);
		_g_object_unref0 (_tmp8_);
		_data_collection_unref0 (_tmp6_);
	} else {
		_tmp4_ = FALSE;
	}
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "PlayVideo", _tmp4_);
	media_page_update_flag_action (self, selected_count);
	PAGE_CLASS (media_page_parent_class)->update_actions (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), selected_count, count);
}

static void
media_page_on_media_altered (MediaPage* self,
                             GeeMap* altered)
{
	g_return_if_fail (IS_MEDIA_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (altered, GEE_TYPE_MAP));
	{
		GeeIterator* _object_it = NULL;
		GeeSet* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp0_ = gee_map_get_keys (altered);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_ITERABLE, GeeIterable));
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		_object_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			DataObject* object = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			DataObject* _tmp8_;
			gpointer _tmp9_;
			Alteration* _tmp10_;
			gboolean _tmp11_;
			_tmp5_ = _object_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = _object_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			object = (DataObject*) _tmp7_;
			_tmp8_ = object;
			_tmp9_ = gee_map_get (altered, _tmp8_);
			_tmp10_ = (Alteration*) _tmp9_;
			_tmp11_ = alteration_has_detail (_tmp10_, "metadata", "flagged");
			_alteration_unref0 (_tmp10_);
			if (_tmp11_) {
				ViewCollection* _tmp12_;
				ViewCollection* _tmp13_;
				_tmp12_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp13_ = _tmp12_;
				media_page_update_flag_action (self, view_collection_get_selected_count (_tmp13_));
				_data_collection_unref0 (_tmp13_);
				_g_object_unref0 (object);
				break;
			}
			_g_object_unref0 (object);
		}
		_g_object_unref0 (_object_it);
	}
}

static void
media_page_update_rating_sensitivities (MediaPage* self)
{
	g_return_if_fail (IS_MEDIA_PAGE (self));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateRejected", media_page_can_rate_selected (self, RATING_REJECTED));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateUnrated", media_page_can_rate_selected (self, RATING_UNRATED));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateOne", media_page_can_rate_selected (self, RATING_ONE));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateTwo", media_page_can_rate_selected (self, RATING_TWO));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateThree", media_page_can_rate_selected (self, RATING_THREE));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateFour", media_page_can_rate_selected (self, RATING_FOUR));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateFive", media_page_can_rate_selected (self, RATING_FIVE));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "IncreaseRating", media_page_can_increase_selected_rating (self));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "DecreaseRating", media_page_can_decrease_selected_rating (self));
}

static void
media_page_update_development_menu_item_sensitivity (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	GeeList* _tmp2_;
	GeeList* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gboolean _tmp6_;
	gboolean is_raw = FALSE;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp5_ == 0;
	_g_object_unref0 (_tmp3_);
	_data_collection_unref0 (_tmp1_);
	if (_tmp6_) {
		page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RawDeveloper", FALSE);
		return;
	}
	is_raw = FALSE;
	{
		GeeList* _view_list = NULL;
		ViewCollection* _tmp7_;
		ViewCollection* _tmp8_;
		GeeList* _tmp9_;
		GeeList* _tmp10_;
		gint _view_size = 0;
		GeeList* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		gint _view_index = 0;
		_tmp7_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp8_ = _tmp7_;
		_tmp9_ = view_collection_get_selected (_tmp8_);
		_tmp10_ = _tmp9_;
		_data_collection_unref0 (_tmp8_);
		_view_list = _tmp10_;
		_tmp11_ = _view_list;
		_tmp12_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp13_ = _tmp12_;
		_view_size = _tmp13_;
		_view_index = -1;
		while (TRUE) {
			gint _tmp14_;
			gint _tmp15_;
			DataView* view = NULL;
			GeeList* _tmp16_;
			gpointer _tmp17_;
			Photo* photo = NULL;
			DataView* _tmp18_;
			MediaSource* _tmp19_;
			Photo* _tmp20_;
			gboolean _tmp21_ = FALSE;
			Photo* _tmp22_;
			_view_index = _view_index + 1;
			_tmp14_ = _view_index;
			_tmp15_ = _view_size;
			if (!(_tmp14_ < _tmp15_)) {
				break;
			}
			_tmp16_ = _view_list;
			_tmp17_ = gee_list_get (_tmp16_, _view_index);
			view = (DataView*) _tmp17_;
			_tmp18_ = view;
			_tmp19_ = thumbnail_get_media_source (G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, TYPE_THUMBNAIL, Thumbnail));
			_tmp20_ = IS_PHOTO (_tmp19_) ? ((Photo*) _tmp19_) : NULL;
			if (_tmp20_ == NULL) {
				_g_object_unref0 (_tmp19_);
			}
			photo = _tmp20_;
			_tmp22_ = photo;
			if (_tmp22_ != NULL) {
				Photo* _tmp23_;
				_tmp23_ = photo;
				_tmp21_ = photo_get_master_file_format (_tmp23_) == PHOTO_FILE_FORMAT_RAW;
			} else {
				_tmp21_ = FALSE;
			}
			if (_tmp21_) {
				is_raw = TRUE;
				_g_object_unref0 (photo);
				_g_object_unref0 (view);
				break;
			}
			_g_object_unref0 (photo);
			_g_object_unref0 (view);
		}
		_g_object_unref0 (_view_list);
	}
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RawDeveloper", is_raw);
}

static void
media_page_update_flag_action (MediaPage* self,
                               gint selected_count)
{
	g_return_if_fail (IS_MEDIA_PAGE (self));
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "Flag", selected_count > 0);
}

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

static CoreViewTracker*
media_page_real_get_view_tracker (CheckerboardPage* base)
{
	MediaPage * self;
	MediaViewTracker* _tmp0_;
	CoreViewTracker* _tmp1_;
	CoreViewTracker* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	_tmp0_ = self->priv->tracker;
	_tmp1_ = _core_tracker_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CORE_TYPE_VIEW_TRACKER, CoreViewTracker));
	result = _tmp1_;
	return result;
}

void
media_page_set_display_ratings (MediaPage* self,
                                gboolean display)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	GValue _tmp4_ = {0};
	ViewCollection* _tmp5_;
	ViewCollection* _tmp6_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	data_collection_freeze_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp1_);
	_tmp2_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp3_ = _tmp2_;
	g_value_init (&_tmp4_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp4_, display);
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_COLLECTION, DataCollection), THUMBNAIL_PROP_SHOW_RATINGS, &_tmp4_, NULL, NULL);
	G_IS_VALUE (&_tmp4_) ? (g_value_unset (&_tmp4_), NULL) : NULL;
	_data_collection_unref0 (_tmp3_);
	_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp6_ = _tmp5_;
	data_collection_thaw_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp6_);
	page_set_action_active (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewRatings", display);
}

static gboolean
media_page_can_rate_selected (MediaPage* self,
                              Rating rating)
{
	gboolean result;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), FALSE);
	{
		GeeList* _view_list = NULL;
		ViewCollection* _tmp0_;
		ViewCollection* _tmp1_;
		GeeList* _tmp2_;
		GeeList* _tmp3_;
		gint _view_size = 0;
		GeeList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _view_index = 0;
		_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp1_ = _tmp0_;
		_tmp2_ = view_collection_get_selected (_tmp1_);
		_tmp3_ = _tmp2_;
		_data_collection_unref0 (_tmp1_);
		_view_list = _tmp3_;
		_tmp4_ = _view_list;
		_tmp5_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp6_ = _tmp5_;
		_view_size = _tmp6_;
		_view_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			DataView* view = NULL;
			GeeList* _tmp9_;
			gpointer _tmp10_;
			DataView* _tmp11_;
			MediaSource* _tmp12_;
			MediaSource* _tmp13_;
			gboolean _tmp14_;
			_view_index = _view_index + 1;
			_tmp7_ = _view_index;
			_tmp8_ = _view_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _view_list;
			_tmp10_ = gee_list_get (_tmp9_, _view_index);
			view = (DataView*) _tmp10_;
			_tmp11_ = view;
			_tmp12_ = thumbnail_get_media_source (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_THUMBNAIL, Thumbnail));
			_tmp13_ = _tmp12_;
			_tmp14_ = media_source_get_rating (_tmp13_) != rating;
			_g_object_unref0 (_tmp13_);
			if (_tmp14_) {
				result = TRUE;
				_g_object_unref0 (view);
				_g_object_unref0 (_view_list);
				return result;
			}
			_g_object_unref0 (view);
		}
		_g_object_unref0 (_view_list);
	}
	result = FALSE;
	return result;
}

static gboolean
media_page_can_increase_selected_rating (MediaPage* self)
{
	gboolean result;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), FALSE);
	{
		GeeList* _view_list = NULL;
		ViewCollection* _tmp0_;
		ViewCollection* _tmp1_;
		GeeList* _tmp2_;
		GeeList* _tmp3_;
		gint _view_size = 0;
		GeeList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _view_index = 0;
		_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp1_ = _tmp0_;
		_tmp2_ = view_collection_get_selected (_tmp1_);
		_tmp3_ = _tmp2_;
		_data_collection_unref0 (_tmp1_);
		_view_list = _tmp3_;
		_tmp4_ = _view_list;
		_tmp5_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp6_ = _tmp5_;
		_view_size = _tmp6_;
		_view_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			DataView* view = NULL;
			GeeList* _tmp9_;
			gpointer _tmp10_;
			DataView* _tmp11_;
			MediaSource* _tmp12_;
			MediaSource* _tmp13_;
			gboolean _tmp14_;
			_view_index = _view_index + 1;
			_tmp7_ = _view_index;
			_tmp8_ = _view_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _view_list;
			_tmp10_ = gee_list_get (_tmp9_, _view_index);
			view = (DataView*) _tmp10_;
			_tmp11_ = view;
			_tmp12_ = thumbnail_get_media_source (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_THUMBNAIL, Thumbnail));
			_tmp13_ = _tmp12_;
			_tmp14_ = rating_can_increase (media_source_get_rating (_tmp13_));
			_g_object_unref0 (_tmp13_);
			if (_tmp14_) {
				result = TRUE;
				_g_object_unref0 (view);
				_g_object_unref0 (_view_list);
				return result;
			}
			_g_object_unref0 (view);
		}
		_g_object_unref0 (_view_list);
	}
	result = FALSE;
	return result;
}

static gboolean
media_page_can_decrease_selected_rating (MediaPage* self)
{
	gboolean result;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), FALSE);
	{
		GeeList* _view_list = NULL;
		ViewCollection* _tmp0_;
		ViewCollection* _tmp1_;
		GeeList* _tmp2_;
		GeeList* _tmp3_;
		gint _view_size = 0;
		GeeList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _view_index = 0;
		_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp1_ = _tmp0_;
		_tmp2_ = view_collection_get_selected (_tmp1_);
		_tmp3_ = _tmp2_;
		_data_collection_unref0 (_tmp1_);
		_view_list = _tmp3_;
		_tmp4_ = _view_list;
		_tmp5_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp6_ = _tmp5_;
		_view_size = _tmp6_;
		_view_index = -1;
		while (TRUE) {
			gint _tmp7_;
			gint _tmp8_;
			DataView* view = NULL;
			GeeList* _tmp9_;
			gpointer _tmp10_;
			DataView* _tmp11_;
			MediaSource* _tmp12_;
			MediaSource* _tmp13_;
			gboolean _tmp14_;
			_view_index = _view_index + 1;
			_tmp7_ = _view_index;
			_tmp8_ = _view_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _view_list;
			_tmp10_ = gee_list_get (_tmp9_, _view_index);
			view = (DataView*) _tmp10_;
			_tmp11_ = view;
			_tmp12_ = thumbnail_get_media_source (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_THUMBNAIL, Thumbnail));
			_tmp13_ = _tmp12_;
			_tmp14_ = rating_can_decrease (media_source_get_rating (_tmp13_));
			_g_object_unref0 (_tmp13_);
			if (_tmp14_) {
				result = TRUE;
				_g_object_unref0 (view);
				_g_object_unref0 (_view_list);
				return result;
			}
			_g_object_unref0 (view);
		}
		_g_object_unref0 (_view_list);
	}
	result = FALSE;
	return result;
}

MediaPageZoomSliderAssembly*
media_page_create_zoom_slider_assembly (MediaPage* self)
{
	MediaPageZoomSliderAssembly* _tmp0_;
	MediaPageZoomSliderAssembly* result;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), NULL);
	_tmp0_ = media_page_zoom_slider_assembly_new ();
	g_object_ref_sink (_tmp0_);
	result = _tmp0_;
	return result;
}

static gboolean
media_page_real_on_mousewheel_up (Page* base,
                                  GdkEventScroll* event)
{
	MediaPage * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	g_return_val_if_fail (event != NULL, FALSE);
	if ((event->state & GDK_CONTROL_MASK) != 0) {
		media_page_increase_zoom_level (self);
		result = TRUE;
		return result;
	} else {
		result = PAGE_CLASS (media_page_parent_class)->on_mousewheel_up (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), event);
		return result;
	}
}

static gboolean
media_page_real_on_mousewheel_down (Page* base,
                                    GdkEventScroll* event)
{
	MediaPage * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	g_return_val_if_fail (event != NULL, FALSE);
	if ((event->state & GDK_CONTROL_MASK) != 0) {
		media_page_decrease_zoom_level (self);
		result = TRUE;
		return result;
	} else {
		result = PAGE_CLASS (media_page_parent_class)->on_mousewheel_down (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), event);
		return result;
	}
}

static void
media_page_on_send_to (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	GeeList* _tmp2_;
	GeeCollection* _tmp3_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_sources (_tmp1_);
	_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection);
	desktop_integration_send_to (_tmp3_);
	_g_object_unref0 (_tmp3_);
	_data_collection_unref0 (_tmp1_);
}

void
media_page_on_play_video (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	Video* video = NULL;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	DataView* _tmp5_;
	DataView* _tmp6_;
	DataSource* _tmp7_;
	Video* _tmp8_;
	Video* _tmp9_;
	Video* _tmp10_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) != 1;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected_at (_tmp4_, 0);
	_tmp6_ = _tmp5_;
	_tmp7_ = data_view_get_source (_tmp6_);
	_tmp8_ = IS_VIDEO (_tmp7_) ? ((Video*) _tmp7_) : NULL;
	if (_tmp8_ == NULL) {
		_g_object_unref0 (_tmp7_);
	}
	_tmp9_ = _tmp8_;
	_g_object_unref0 (_tmp6_);
	_data_collection_unref0 (_tmp4_);
	video = _tmp9_;
	_tmp10_ = video;
	if (_tmp10_ == NULL) {
		_g_object_unref0 (video);
		return;
	}
	{
		Video* _tmp11_;
		GFile* _tmp12_;
		GFile* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp11_ = video;
		_tmp12_ = media_source_get_file (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_MEDIA_SOURCE, MediaSource));
		_tmp13_ = _tmp12_;
		_tmp14_ = g_file_get_uri (_tmp13_);
		_tmp15_ = _tmp14_;
		g_app_info_launch_default_for_uri (_tmp15_, NULL, &_inner_error0_);
		_g_free0 (_tmp15_);
		_g_object_unref0 (_tmp13_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp16_;
		const gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp16_ = e;
		_tmp17_ = _tmp16_->message;
		_tmp18_ = g_strdup_printf (_ ("Shotwell was unable to play the selected video:\n%s"), _tmp17_);
		_tmp19_ = _tmp18_;
		app_window_error_message (_tmp19_, NULL);
		_g_free0 (_tmp19_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (video);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_object_unref0 (video);
}

static gboolean
media_page_real_on_app_key_pressed (Page* base,
                                    GdkEventKey* event)
{
	MediaPage * 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;
	static GQuark _tmp2_label3 = 0;
	static GQuark _tmp2_label4 = 0;
	static GQuark _tmp2_label5 = 0;
	static GQuark _tmp2_label6 = 0;
	static GQuark _tmp2_label7 = 0;
	static GQuark _tmp2_label8 = 0;
	static GQuark _tmp2_label9 = 0;
	static GQuark _tmp2_label10 = 0;
	static GQuark _tmp2_label11 = 0;
	static GQuark _tmp2_label12 = 0;
	static GQuark _tmp2_label13 = 0;
	static GQuark _tmp2_label14 = 0;
	static GQuark _tmp2_label15 = 0;
	gboolean _tmp4_ = FALSE;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	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 ("equal")))) || (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("plus"))))) || (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("KP_Add"))))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "IncreaseSize");
				break;
			}
		}
	} else if (((_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("minus")))) || (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("underscore"))))) || (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("KP_Subtract"))))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "DecreaseSize");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label6) ? _tmp2_label6 : (_tmp2_label6 = g_quark_from_static_string ("period")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "IncreaseRating");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label7) ? _tmp2_label7 : (_tmp2_label7 = g_quark_from_static_string ("comma")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "DecreaseRating");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label8) ? _tmp2_label8 : (_tmp2_label8 = g_quark_from_static_string ("KP_1")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateOne");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label9) ? _tmp2_label9 : (_tmp2_label9 = g_quark_from_static_string ("KP_2")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateTwo");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label10) ? _tmp2_label10 : (_tmp2_label10 = g_quark_from_static_string ("KP_3")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateThree");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label11) ? _tmp2_label11 : (_tmp2_label11 = g_quark_from_static_string ("KP_4")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateFour");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label12) ? _tmp2_label12 : (_tmp2_label12 = g_quark_from_static_string ("KP_5")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateFive");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label13) ? _tmp2_label13 : (_tmp2_label13 = g_quark_from_static_string ("KP_0")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateUnrated");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label14) ? _tmp2_label14 : (_tmp2_label14 = g_quark_from_static_string ("KP_9")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "RateRejected");
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label15) ? _tmp2_label15 : (_tmp2_label15 = g_quark_from_static_string ("slash")))) {
		switch (0) {
			default:
			{
				page_activate_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "Flag");
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				handled = FALSE;
				break;
			}
		}
	}
	if (handled) {
		_tmp4_ = TRUE;
	} else {
		_tmp4_ = PAGE_CLASS (media_page_parent_class)->on_app_key_pressed (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page), event);
	}
	result = _tmp4_;
	return result;
}

static void
media_page_real_switched_to (Page* base)
{
	MediaPage * self;
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	ConfigFacade* _tmp2_;
	ConfigFacade* _tmp3_;
	ConfigFacade* _tmp4_;
	ConfigFacade* _tmp5_;
	ConfigFacade* _tmp6_;
	ConfigFacade* _tmp7_;
	ConfigFacade* _tmp8_;
	ConfigFacade* _tmp9_;
	ViewCollection* _tmp10_;
	ViewCollection* _tmp11_;
	ViewCollection* _tmp12_;
	ViewCollection* _tmp13_;
	gboolean _tmp14_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	PAGE_CLASS (media_page_parent_class)->switched_to (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	data_collection_freeze_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp1_);
	_tmp2_ = config_facade_get_instance ();
	_tmp3_ = _tmp2_;
	checkerboard_page_set_display_titles (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), configuration_facade_get_display_photo_titles (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	_g_object_unref0 (_tmp3_);
	_tmp4_ = config_facade_get_instance ();
	_tmp5_ = _tmp4_;
	checkerboard_page_set_display_comments (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), configuration_facade_get_display_photo_comments (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	_g_object_unref0 (_tmp5_);
	_tmp6_ = config_facade_get_instance ();
	_tmp7_ = _tmp6_;
	media_page_set_display_ratings (self, configuration_facade_get_display_photo_ratings (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	_g_object_unref0 (_tmp7_);
	_tmp8_ = config_facade_get_instance ();
	_tmp9_ = _tmp8_;
	media_page_set_display_tags (self, configuration_facade_get_display_photo_tags (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
	_g_object_unref0 (_tmp9_);
	_tmp10_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp11_ = _tmp10_;
	data_collection_thaw_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp11_);
	_tmp12_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp13_ = _tmp12_;
	_tmp14_ = view_collection_get_selected_count (_tmp13_) > 0;
	_data_collection_unref0 (_tmp13_);
	if (_tmp14_) {
		CheckerboardItem* selected = NULL;
		ViewCollection* _tmp15_;
		ViewCollection* _tmp16_;
		DataView* _tmp17_;
		CheckerboardItem* _tmp18_;
		CheckerboardItem* _tmp19_;
		_tmp15_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp16_ = _tmp15_;
		_tmp17_ = view_collection_get_selected_at (_tmp16_, 0);
		_tmp18_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, TYPE_CHECKERBOARD_ITEM, CheckerboardItem);
		_data_collection_unref0 (_tmp16_);
		selected = _tmp18_;
		_tmp19_ = selected;
		if (_tmp19_ != NULL) {
			CheckerboardItem* _tmp20_;
			_tmp20_ = selected;
			checkerboard_page_cursor_to_item (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), _tmp20_);
		}
		_g_object_unref0 (selected);
	}
	media_page_sync_sort (self);
}

static void
media_page_real_switching_from (Page* base)
{
	MediaPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	media_page_disconnect_slider (self);
	PAGE_CLASS (media_page_parent_class)->switching_from (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), TYPE_PAGE, Page));
}

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

static void
_media_page_on_zoom_changed_media_page_zoom_slider_assembly_zoom_changed (MediaPageZoomSliderAssembly* _sender,
                                                                          gpointer self)
{
	media_page_on_zoom_changed ((MediaPage*) self);
}

void
media_page_connect_slider (MediaPage* self,
                           MediaPageZoomSliderAssembly* slider)
{
	MediaPageZoomSliderAssembly* _tmp0_;
	MediaPageZoomSliderAssembly* _tmp1_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	g_return_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (slider));
	_tmp0_ = _g_object_ref0 (slider);
	_g_object_unref0 (self->priv->connected_slider);
	self->priv->connected_slider = _tmp0_;
	_tmp1_ = self->priv->connected_slider;
	g_signal_connect_object (_tmp1_, "zoom-changed", (GCallback) _media_page_on_zoom_changed_media_page_zoom_slider_assembly_zoom_changed, self, 0);
	media_page_load_persistent_thumbnail_scale (self);
}

static void
media_page_save_persistent_thumbnail_scale (MediaPage* self)
{
	MediaPageZoomSliderAssembly* _tmp0_;
	ConfigFacade* _tmp1_;
	ConfigFacade* _tmp2_;
	MediaPageZoomSliderAssembly* _tmp3_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = self->priv->connected_slider;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = config_facade_get_instance ();
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->connected_slider;
	configuration_facade_set_photo_thumbnail_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), media_page_zoom_slider_assembly_get_scale (_tmp3_));
	_g_object_unref0 (_tmp2_);
}

static void
media_page_load_persistent_thumbnail_scale (MediaPage* self)
{
	MediaPageZoomSliderAssembly* _tmp0_;
	gint persistent_scale = 0;
	ConfigFacade* _tmp1_;
	ConfigFacade* _tmp2_;
	gint _tmp3_;
	MediaPageZoomSliderAssembly* _tmp4_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = self->priv->connected_slider;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = config_facade_get_instance ();
	_tmp2_ = _tmp1_;
	_tmp3_ = configuration_facade_get_photo_thumbnail_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp2_);
	persistent_scale = _tmp3_;
	_tmp4_ = self->priv->connected_slider;
	media_page_zoom_slider_assembly_set_scale (_tmp4_, persistent_scale);
	media_page_set_thumb_size (self, persistent_scale);
}

void
media_page_disconnect_slider (MediaPage* self)
{
	MediaPageZoomSliderAssembly* _tmp0_;
	MediaPageZoomSliderAssembly* _tmp1_;
	guint _tmp2_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = self->priv->connected_slider;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->connected_slider;
	g_signal_parse_name ("zoom-changed", MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY, &_tmp2_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _media_page_on_zoom_changed_media_page_zoom_slider_assembly_zoom_changed, self);
	_g_object_unref0 (self->priv->connected_slider);
	self->priv->connected_slider = NULL;
}

static void
media_page_real_on_zoom_changed (MediaPage* self)
{
	MediaPageZoomSliderAssembly* _tmp0_;
	_tmp0_ = self->priv->connected_slider;
	if (_tmp0_ != NULL) {
		MediaPageZoomSliderAssembly* _tmp1_;
		_tmp1_ = self->priv->connected_slider;
		media_page_set_thumb_size (self, media_page_zoom_slider_assembly_get_scale (_tmp1_));
	}
	media_page_save_persistent_thumbnail_scale (self);
}

void
media_page_on_zoom_changed (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_zoom_changed) {
		_klass_->on_zoom_changed (self);
	}
}

static void
media_page_real_on_export (MediaPage* self)
{
	g_critical ("Type `%s' does not implement abstract method `media_page_on_export'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
media_page_on_export (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_export) {
		_klass_->on_export (self);
	}
}

static void
media_page_real_on_increase_size (MediaPage* self)
{
	media_page_increase_zoom_level (self);
}

void
media_page_on_increase_size (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_increase_size) {
		_klass_->on_increase_size (self);
	}
}

static void
media_page_real_on_decrease_size (MediaPage* self)
{
	media_page_decrease_zoom_level (self);
}

void
media_page_on_decrease_size (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_decrease_size) {
		_klass_->on_decrease_size (self);
	}
}

static void
media_page_on_add_tags (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	AddTagsDialog* dialog = NULL;
	AddTagsDialog* _tmp3_;
	gchar** names = NULL;
	AddTagsDialog* _tmp4_;
	gint _tmp5_ = 0;
	gchar** _tmp6_;
	gint names_length1;
	gint _names_size_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) == 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = add_tags_dialog_new ();
	dialog = _tmp3_;
	_tmp4_ = dialog;
	_tmp6_ = add_tags_dialog_execute (_tmp4_, &_tmp5_);
	names = _tmp6_;
	names_length1 = _tmp5_;
	_names_size_ = names_length1;
	_tmp7_ = names;
	_tmp7__length1 = names_length1;
	if (_tmp7_ != NULL) {
		CommandManager* _tmp8_;
		CommandManager* _tmp9_;
		HierarchicalTagIndex* _tmp10_;
		HierarchicalTagIndex* _tmp11_;
		gchar** _tmp12_;
		gint _tmp12__length1;
		gint _tmp13_ = 0;
		gchar** _tmp14_;
		gchar** _tmp15_;
		gint _tmp15__length1;
		ViewCollection* _tmp16_;
		ViewCollection* _tmp17_;
		GeeList* _tmp18_;
		GeeCollection* _tmp19_;
		AddTagsCommand* _tmp20_;
		AddTagsCommand* _tmp21_;
		_tmp8_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp9_ = _tmp8_;
		_tmp10_ = hierarchical_tag_index_get_global_index ();
		_tmp11_ = _tmp10_;
		_tmp12_ = names;
		_tmp12__length1 = names_length1;
		_tmp14_ = hierarchical_tag_index_get_paths_for_names_array (_tmp11_, _tmp12_, (gint) _tmp12__length1, &_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp15__length1 = _tmp13_;
		_tmp16_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp17_ = _tmp16_;
		_tmp18_ = view_collection_get_selected_sources (_tmp17_);
		_tmp19_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp18_, GEE_TYPE_COLLECTION, GeeCollection);
		_tmp20_ = add_tags_command_new (_tmp15_, _tmp13_, _tmp19_);
		_tmp21_ = _tmp20_;
		command_manager_execute (_tmp9_, G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_COMMAND, Command));
		_g_object_unref0 (_tmp21_);
		_g_object_unref0 (_tmp19_);
		_data_collection_unref0 (_tmp17_);
		_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
		_hierarchical_tag_index_unref0 (_tmp11_);
		_command_manager_unref0 (_tmp9_);
	}
	names = (_vala_array_free (names, names_length1, (GDestroyNotify) g_free), NULL);
	_text_entry_dialog_mediator_unref0 (dialog);
}

static void
media_page_on_modify_tags (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	MediaSource* media = NULL;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	DataView* _tmp5_;
	DataView* _tmp6_;
	DataSource* _tmp7_;
	MediaSource* _tmp8_;
	ModifyTagsDialog* dialog = NULL;
	MediaSource* _tmp9_;
	ModifyTagsDialog* _tmp10_;
	GeeArrayList* new_tags = NULL;
	ModifyTagsDialog* _tmp11_;
	GeeArrayList* _tmp12_;
	GeeArrayList* _tmp13_;
	CommandManager* _tmp14_;
	CommandManager* _tmp15_;
	MediaSource* _tmp16_;
	GeeArrayList* _tmp17_;
	ModifyTagsCommand* _tmp18_;
	ModifyTagsCommand* _tmp19_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) != 1;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected_at (_tmp4_, 0);
	_tmp6_ = _tmp5_;
	_tmp7_ = data_view_get_source (_tmp6_);
	_tmp8_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_MEDIA_SOURCE, MediaSource);
	_g_object_unref0 (_tmp6_);
	_data_collection_unref0 (_tmp4_);
	media = _tmp8_;
	_tmp9_ = media;
	_tmp10_ = modify_tags_dialog_new (_tmp9_);
	dialog = _tmp10_;
	_tmp11_ = dialog;
	_tmp12_ = modify_tags_dialog_execute (_tmp11_);
	new_tags = _tmp12_;
	_tmp13_ = new_tags;
	if (_tmp13_ == NULL) {
		_g_object_unref0 (new_tags);
		_text_entry_dialog_mediator_unref0 (dialog);
		_g_object_unref0 (media);
		return;
	}
	_tmp14_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp15_ = _tmp14_;
	_tmp16_ = media;
	_tmp17_ = new_tags;
	_tmp18_ = modify_tags_command_new (_tmp16_, G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp19_ = _tmp18_;
	command_manager_execute (_tmp15_, G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_COMMAND, Command));
	_g_object_unref0 (_tmp19_);
	_command_manager_unref0 (_tmp15_);
	_g_object_unref0 (new_tags);
	_text_entry_dialog_mediator_unref0 (dialog);
	_g_object_unref0 (media);
}

static void
media_page_set_display_tags (MediaPage* self,
                             gboolean display)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	GValue _tmp4_ = {0};
	ViewCollection* _tmp5_;
	ViewCollection* _tmp6_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	data_collection_freeze_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp1_);
	_tmp2_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp3_ = _tmp2_;
	g_value_init (&_tmp4_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp4_, display);
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_COLLECTION, DataCollection), THUMBNAIL_PROP_SHOW_TAGS, &_tmp4_, NULL, NULL);
	G_IS_VALUE (&_tmp4_) ? (g_value_unset (&_tmp4_), NULL) : NULL;
	_data_collection_unref0 (_tmp3_);
	_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp6_ = _tmp5_;
	data_collection_thaw_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp6_);
	page_set_action_active (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewTags", display);
}

static void
media_page_on_new_event (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) > 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		CommandManager* _tmp3_;
		CommandManager* _tmp4_;
		ViewCollection* _tmp5_;
		ViewCollection* _tmp6_;
		GeeList* _tmp7_;
		GeeList* _tmp8_;
		NewEventCommand* _tmp9_;
		NewEventCommand* _tmp10_;
		_tmp3_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp4_ = _tmp3_;
		_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp6_ = _tmp5_;
		_tmp7_ = view_collection_get_selected (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = new_event_command_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_ITERABLE, GeeIterable));
		_tmp10_ = _tmp9_;
		command_manager_execute (_tmp4_, G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_COMMAND, Command));
		_g_object_unref0 (_tmp10_);
		_g_object_unref0 (_tmp8_);
		_data_collection_unref0 (_tmp6_);
		_command_manager_unref0 (_tmp4_);
	}
}

static void
media_page_on_flag_unflag (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	GeeCollection* sources = NULL;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	GeeList* _tmp5_;
	GeeCollection* _tmp6_;
	gboolean flag = FALSE;
	CommandManager* _tmp17_;
	CommandManager* _tmp18_;
	GeeCollection* _tmp19_;
	FlagUnflagCommand* _tmp20_;
	FlagUnflagCommand* _tmp21_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) == 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected_sources_of_type (_tmp4_, TYPE_MEDIA_SOURCE);
	_tmp6_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_COLLECTION, GeeCollection);
	_data_collection_unref0 (_tmp4_);
	sources = _tmp6_;
	flag = FALSE;
	{
		GeeIterator* _source_it = NULL;
		GeeCollection* _tmp7_;
		GeeIterator* _tmp8_;
		_tmp7_ = sources;
		_tmp8_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ITERABLE, GeeIterable));
		_source_it = _tmp8_;
		while (TRUE) {
			GeeIterator* _tmp9_;
			MediaSource* source = NULL;
			GeeIterator* _tmp10_;
			gpointer _tmp11_;
			Flaggable* flaggable = NULL;
			MediaSource* _tmp12_;
			Flaggable* _tmp13_;
			gboolean _tmp14_ = FALSE;
			Flaggable* _tmp15_;
			_tmp9_ = _source_it;
			if (!gee_iterator_next (_tmp9_)) {
				break;
			}
			_tmp10_ = _source_it;
			_tmp11_ = gee_iterator_get (_tmp10_);
			source = (MediaSource*) _tmp11_;
			_tmp12_ = source;
			_tmp13_ = _g_object_ref0 (IS_FLAGGABLE (_tmp12_) ? ((Flaggable*) _tmp12_) : NULL);
			flaggable = _tmp13_;
			_tmp15_ = flaggable;
			if (_tmp15_ != NULL) {
				Flaggable* _tmp16_;
				_tmp16_ = flaggable;
				_tmp14_ = !flaggable_is_flagged (_tmp16_);
			} else {
				_tmp14_ = FALSE;
			}
			if (_tmp14_) {
				flag = TRUE;
				_g_object_unref0 (flaggable);
				_g_object_unref0 (source);
				break;
			}
			_g_object_unref0 (flaggable);
			_g_object_unref0 (source);
		}
		_g_object_unref0 (_source_it);
	}
	_tmp17_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp18_ = _tmp17_;
	_tmp19_ = sources;
	_tmp20_ = flag_unflag_command_new (_tmp19_, flag);
	_tmp21_ = _tmp20_;
	command_manager_execute (_tmp18_, G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_COMMAND, Command));
	_g_object_unref0 (_tmp21_);
	_command_manager_unref0 (_tmp18_);
	_g_object_unref0 (sources);
}

static void
media_page_real_on_increase_rating (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	SetRatingCommand* command = NULL;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	SetRatingCommand* _tmp7_;
	SetRatingCommand* _tmp8_;
	CommandManager* _tmp9_;
	CommandManager* _tmp10_;
	SetRatingCommand* _tmp11_;
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) == 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = set_rating_command_new_inc_dec (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ITERABLE, GeeIterable), TRUE);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp6_);
	_data_collection_unref0 (_tmp4_);
	command = _tmp8_;
	_tmp9_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp10_ = _tmp9_;
	_tmp11_ = command;
	command_manager_execute (_tmp10_, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_COMMAND, Command));
	_command_manager_unref0 (_tmp10_);
	media_page_update_rating_sensitivities (self);
	_g_object_unref0 (command);
}

void
media_page_on_increase_rating (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_increase_rating) {
		_klass_->on_increase_rating (self);
	}
}

static void
media_page_real_on_decrease_rating (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	SetRatingCommand* command = NULL;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	SetRatingCommand* _tmp7_;
	SetRatingCommand* _tmp8_;
	CommandManager* _tmp9_;
	CommandManager* _tmp10_;
	SetRatingCommand* _tmp11_;
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) == 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = set_rating_command_new_inc_dec (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ITERABLE, GeeIterable), FALSE);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp6_);
	_data_collection_unref0 (_tmp4_);
	command = _tmp8_;
	_tmp9_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp10_ = _tmp9_;
	_tmp11_ = command;
	command_manager_execute (_tmp10_, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_COMMAND, Command));
	_command_manager_unref0 (_tmp10_);
	media_page_update_rating_sensitivities (self);
	_g_object_unref0 (command);
}

void
media_page_on_decrease_rating (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_decrease_rating) {
		_klass_->on_decrease_rating (self);
	}
}

static void
media_page_real_on_set_rating (MediaPage* self,
                               Rating rating)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	SetRatingCommand* command = NULL;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	SetRatingCommand* _tmp7_;
	SetRatingCommand* _tmp8_;
	CommandManager* _tmp9_;
	CommandManager* _tmp10_;
	SetRatingCommand* _tmp11_;
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) == 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = set_rating_command_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, GEE_TYPE_ITERABLE, GeeIterable), rating);
	_tmp8_ = _tmp7_;
	_g_object_unref0 (_tmp6_);
	_data_collection_unref0 (_tmp4_);
	command = _tmp8_;
	_tmp9_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp10_ = _tmp9_;
	_tmp11_ = command;
	command_manager_execute (_tmp10_, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_COMMAND, Command));
	_command_manager_unref0 (_tmp10_);
	media_page_update_rating_sensitivities (self);
	_g_object_unref0 (command);
}

void
media_page_on_set_rating (MediaPage* self,
                          Rating rating)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_set_rating) {
		_klass_->on_set_rating (self, rating);
	}
}

static void
media_page_real_on_rate_rejected (MediaPage* self)
{
	media_page_on_set_rating (self, RATING_REJECTED);
}

void
media_page_on_rate_rejected (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_rate_rejected) {
		_klass_->on_rate_rejected (self);
	}
}

static void
media_page_real_on_rate_unrated (MediaPage* self)
{
	media_page_on_set_rating (self, RATING_UNRATED);
}

void
media_page_on_rate_unrated (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_rate_unrated) {
		_klass_->on_rate_unrated (self);
	}
}

static void
media_page_real_on_rate_one (MediaPage* self)
{
	media_page_on_set_rating (self, RATING_ONE);
}

void
media_page_on_rate_one (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_rate_one) {
		_klass_->on_rate_one (self);
	}
}

static void
media_page_real_on_rate_two (MediaPage* self)
{
	media_page_on_set_rating (self, RATING_TWO);
}

void
media_page_on_rate_two (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_rate_two) {
		_klass_->on_rate_two (self);
	}
}

static void
media_page_real_on_rate_three (MediaPage* self)
{
	media_page_on_set_rating (self, RATING_THREE);
}

void
media_page_on_rate_three (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_rate_three) {
		_klass_->on_rate_three (self);
	}
}

static void
media_page_real_on_rate_four (MediaPage* self)
{
	media_page_on_set_rating (self, RATING_FOUR);
}

void
media_page_on_rate_four (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_rate_four) {
		_klass_->on_rate_four (self);
	}
}

static void
media_page_real_on_rate_five (MediaPage* self)
{
	media_page_on_set_rating (self, RATING_FIVE);
}

void
media_page_on_rate_five (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_rate_five) {
		_klass_->on_rate_five (self);
	}
}

static void
media_page_on_remove_from_library (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	GeeList* _tmp2_;
	GeeCollection* _tmp3_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_sources (_tmp1_);
	_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection);
	remove_photos_from_library (_tmp3_);
	_g_object_unref0 (_tmp3_);
	_data_collection_unref0 (_tmp1_);
}

static void
media_page_real_on_move_to_trash (MediaPage* self)
{
	CheckerboardItem* restore_point = NULL;
	CheckerboardItem* _tmp0_;
	GeeList* sources = NULL;
	ViewCollection* _tmp6_;
	ViewCollection* _tmp7_;
	GeeList* _tmp8_;
	GeeList* _tmp9_;
	gboolean _tmp10_ = FALSE;
	CheckerboardItem* _tmp11_;
	ViewCollection* _tmp16_;
	ViewCollection* _tmp17_;
	gboolean _tmp18_;
	restore_point = NULL;
	_tmp0_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage)->cursor;
	if (_tmp0_ != NULL) {
		ViewCollection* _tmp1_;
		ViewCollection* _tmp2_;
		CheckerboardItem* _tmp3_;
		DataView* _tmp4_;
		CheckerboardItem* _tmp5_;
		_tmp1_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp2_ = _tmp1_;
		_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage)->cursor;
		_tmp4_ = view_collection_get_next (_tmp2_, G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_VIEW, DataView), NULL);
		_tmp5_ = IS_CHECKERBOARD_ITEM (_tmp4_) ? ((CheckerboardItem*) _tmp4_) : NULL;
		if (_tmp5_ == NULL) {
			_g_object_unref0 (_tmp4_);
		}
		_g_object_unref0 (restore_point);
		restore_point = _tmp5_;
		_data_collection_unref0 (_tmp2_);
	}
	_tmp6_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp7_ = _tmp6_;
	_tmp8_ = view_collection_get_selected_sources (_tmp7_);
	_tmp9_ = _tmp8_;
	_data_collection_unref0 (_tmp7_);
	sources = _tmp9_;
	_tmp11_ = restore_point;
	if (_tmp11_ != NULL) {
		ViewCollection* _tmp12_;
		ViewCollection* _tmp13_;
		CheckerboardItem* _tmp14_;
		_tmp12_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp13_ = _tmp12_;
		_tmp14_ = restore_point;
		_tmp10_ = data_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, TYPE_DATA_OBJECT, DataObject));
		_data_collection_unref0 (_tmp13_);
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		CheckerboardItem* _tmp15_;
		_tmp15_ = restore_point;
		checkerboard_page_set_cursor (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), _tmp15_);
	}
	_tmp16_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp17_ = _tmp16_;
	_tmp18_ = view_collection_get_selected_count (_tmp17_) > 0;
	_data_collection_unref0 (_tmp17_);
	if (_tmp18_) {
		CommandManager* _tmp19_;
		CommandManager* _tmp20_;
		GeeList* _tmp21_;
		TrashUntrashPhotosCommand* _tmp22_;
		TrashUntrashPhotosCommand* _tmp23_;
		_tmp19_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp20_ = _tmp19_;
		_tmp21_ = sources;
		_tmp22_ = trash_untrash_photos_command_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_TYPE_COLLECTION, GeeCollection), TRUE);
		_tmp23_ = _tmp22_;
		command_manager_execute (_tmp20_, G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, TYPE_COMMAND, Command));
		_g_object_unref0 (_tmp23_);
		_command_manager_unref0 (_tmp20_);
	}
	_g_object_unref0 (sources);
	_g_object_unref0 (restore_point);
}

void
media_page_on_move_to_trash (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_move_to_trash) {
		_klass_->on_move_to_trash (self);
	}
}

static void
media_page_real_on_edit_title (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	GeeList* media_sources = NULL;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	EditTitleDialog* edit_title_dialog = NULL;
	GeeList* _tmp7_;
	gpointer _tmp8_;
	MediaSource* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	EditTitleDialog* _tmp12_;
	EditTitleDialog* _tmp13_;
	gchar* new_title = NULL;
	EditTitleDialog* _tmp14_;
	gchar* _tmp15_;
	const gchar* _tmp16_;
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) == 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected_sources (_tmp4_);
	_tmp6_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_LIST, GeeList);
	_data_collection_unref0 (_tmp4_);
	media_sources = _tmp6_;
	_tmp7_ = media_sources;
	_tmp8_ = gee_list_get (_tmp7_, 0);
	_tmp9_ = (MediaSource*) _tmp8_;
	_tmp10_ = media_source_get_title (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = edit_title_dialog_new (_tmp11_);
	_tmp13_ = _tmp12_;
	_g_free0 (_tmp11_);
	_g_object_unref0 (_tmp9_);
	edit_title_dialog = _tmp13_;
	_tmp14_ = edit_title_dialog;
	_tmp15_ = edit_title_dialog_execute (_tmp14_);
	new_title = _tmp15_;
	_tmp16_ = new_title;
	if (_tmp16_ != NULL) {
		CommandManager* _tmp17_;
		CommandManager* _tmp18_;
		GeeList* _tmp19_;
		const gchar* _tmp20_;
		EditMultipleTitlesCommand* _tmp21_;
		EditMultipleTitlesCommand* _tmp22_;
		_tmp17_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp18_ = _tmp17_;
		_tmp19_ = media_sources;
		_tmp20_ = new_title;
		_tmp21_ = edit_multiple_titles_command_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_COLLECTION, GeeCollection), _tmp20_);
		_tmp22_ = _tmp21_;
		command_manager_execute (_tmp18_, G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_COMMAND, Command));
		_g_object_unref0 (_tmp22_);
		_command_manager_unref0 (_tmp18_);
	}
	_g_free0 (new_title);
	_text_entry_dialog_mediator_unref0 (edit_title_dialog);
	_g_object_unref0 (media_sources);
}

void
media_page_on_edit_title (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_edit_title) {
		_klass_->on_edit_title (self);
	}
}

static void
media_page_real_on_edit_comment (MediaPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	GeeList* media_sources = NULL;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	EditCommentDialog* edit_comment_dialog = NULL;
	GeeList* _tmp7_;
	gpointer _tmp8_;
	MediaSource* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	EditCommentDialog* _tmp12_;
	EditCommentDialog* _tmp13_;
	gchar* new_comment = NULL;
	EditCommentDialog* _tmp14_;
	gchar* _tmp15_;
	const gchar* _tmp16_;
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) == 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected_sources (_tmp4_);
	_tmp6_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GEE_TYPE_LIST, GeeList);
	_data_collection_unref0 (_tmp4_);
	media_sources = _tmp6_;
	_tmp7_ = media_sources;
	_tmp8_ = gee_list_get (_tmp7_, 0);
	_tmp9_ = (MediaSource*) _tmp8_;
	_tmp10_ = media_source_get_comment (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = edit_comment_dialog_new (_tmp11_, FALSE);
	_tmp13_ = _tmp12_;
	_g_free0 (_tmp11_);
	_g_object_unref0 (_tmp9_);
	edit_comment_dialog = _tmp13_;
	_tmp14_ = edit_comment_dialog;
	_tmp15_ = edit_comment_dialog_execute (_tmp14_);
	new_comment = _tmp15_;
	_tmp16_ = new_comment;
	if (_tmp16_ != NULL) {
		CommandManager* _tmp17_;
		CommandManager* _tmp18_;
		GeeList* _tmp19_;
		const gchar* _tmp20_;
		EditMultipleCommentsCommand* _tmp21_;
		EditMultipleCommentsCommand* _tmp22_;
		_tmp17_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp18_ = _tmp17_;
		_tmp19_ = media_sources;
		_tmp20_ = new_comment;
		_tmp21_ = edit_multiple_comments_command_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_COLLECTION, GeeCollection), _tmp20_);
		_tmp22_ = _tmp21_;
		command_manager_execute (_tmp18_, G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, TYPE_COMMAND, Command));
		_g_object_unref0 (_tmp22_);
		_command_manager_unref0 (_tmp18_);
	}
	_g_free0 (new_comment);
	_multi_text_entry_dialog_mediator_unref0 (edit_comment_dialog);
	_g_object_unref0 (media_sources);
}

void
media_page_on_edit_comment (MediaPage* self)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_edit_comment) {
		_klass_->on_edit_comment (self);
	}
}

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

void
media_page_on_display_titles (MediaPage* self,
                              GSimpleAction* action,
                              GVariant* value)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_display_titles) {
		_klass_->on_display_titles (self, action, value);
	}
}

static void
media_page_real_on_display_comments (MediaPage* self,
                                     GSimpleAction* action,
                                     GVariant* value)
{
	gboolean display = FALSE;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	display = g_variant_get_boolean (value);
	checkerboard_page_set_display_comments (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), display);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	configuration_facade_set_display_photo_comments (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), display);
	_g_object_unref0 (_tmp1_);
	g_simple_action_set_state (action, value);
}

void
media_page_on_display_comments (MediaPage* self,
                                GSimpleAction* action,
                                GVariant* value)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_display_comments) {
		_klass_->on_display_comments (self, action, value);
	}
}

static void
media_page_real_on_display_ratings (MediaPage* self,
                                    GSimpleAction* action,
                                    GVariant* value)
{
	gboolean display = FALSE;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	display = g_variant_get_boolean (value);
	media_page_set_display_ratings (self, display);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	configuration_facade_set_display_photo_ratings (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), display);
	_g_object_unref0 (_tmp1_);
	g_simple_action_set_state (action, value);
}

void
media_page_on_display_ratings (MediaPage* self,
                               GSimpleAction* action,
                               GVariant* value)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_display_ratings) {
		_klass_->on_display_ratings (self, action, value);
	}
}

static void
media_page_real_on_display_tags (MediaPage* self,
                                 GSimpleAction* action,
                                 GVariant* value)
{
	gboolean display = FALSE;
	ConfigFacade* _tmp0_;
	ConfigFacade* _tmp1_;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	display = g_variant_get_boolean (value);
	media_page_set_display_tags (self, display);
	_tmp0_ = config_facade_get_instance ();
	_tmp1_ = _tmp0_;
	configuration_facade_set_display_photo_tags (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade), display);
	_g_object_unref0 (_tmp1_);
	g_simple_action_set_state (action, value);
}

void
media_page_on_display_tags (MediaPage* self,
                            GSimpleAction* action,
                            GVariant* value)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_display_tags) {
		_klass_->on_display_tags (self, action, value);
	}
}

static void
media_page_real_get_config_photos_sort (MediaPage* self,
                                        gboolean* sort_order,
                                        gint* sort_by)
{
	g_critical ("Type `%s' does not implement abstract method `media_page_get_config_photos_sort'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
media_page_get_config_photos_sort (MediaPage* self,
                                   gboolean* sort_order,
                                   gint* sort_by)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->get_config_photos_sort) {
		_klass_->get_config_photos_sort (self, sort_order, sort_by);
	}
}

static void
media_page_real_set_config_photos_sort (MediaPage* self,
                                        gboolean sort_order,
                                        gint sort_by)
{
	g_critical ("Type `%s' does not implement abstract method `media_page_set_config_photos_sort'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
media_page_set_config_photos_sort (MediaPage* self,
                                   gboolean sort_order,
                                   gint sort_by)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->set_config_photos_sort) {
		_klass_->set_config_photos_sort (self, sort_order, sort_by);
	}
}

static void
media_page_real_on_sort_changed (MediaPage* self,
                                 GSimpleAction* action,
                                 GVariant* value)
{
	gint sort_by = 0;
	gboolean sort_order = FALSE;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	g_simple_action_set_state (action, value);
	sort_by = media_page_get_menu_sort_by (self);
	sort_order = media_page_get_menu_sort_order (self);
	media_page_set_view_comparator (self, sort_by, sort_order);
	media_page_set_config_photos_sort (self, sort_order, sort_by);
}

void
media_page_on_sort_changed (MediaPage* self,
                            GSimpleAction* action,
                            GVariant* value)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->on_sort_changed) {
		_klass_->on_sort_changed (self, action, value);
	}
}

static void
media_page_on_raw_developer_changed (MediaPage* self,
                                     GSimpleAction* action,
                                     GVariant* value)
{
	RawDeveloper developer = 0;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_simple_action_get_type ()));
	developer = RAW_DEVELOPER_SHOTWELL;
	_tmp0_ = g_variant_get_string (value, NULL);
	_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 ("Shotwell")))) {
		switch (0) {
			default:
			{
				developer = RAW_DEVELOPER_SHOTWELL;
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("Camera")))) {
		switch (0) {
			default:
			{
				developer = RAW_DEVELOPER_CAMERA;
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				break;
			}
		}
	}
	media_page_developer_changed (self, developer);
	g_simple_action_set_state (action, value);
}

static void
media_page_real_developer_changed (MediaPage* self,
                                   RawDeveloper rd)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	gboolean need_warn = FALSE;
	GeeArrayList* to_set = NULL;
	GeeArrayList* _tmp3_;
	gboolean _tmp24_ = FALSE;
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) == 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	need_warn = FALSE;
	_tmp3_ = gee_array_list_new (TYPE_DATA_VIEW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	to_set = _tmp3_;
	{
		GeeList* _view_list = NULL;
		ViewCollection* _tmp4_;
		ViewCollection* _tmp5_;
		GeeList* _tmp6_;
		GeeList* _tmp7_;
		gint _view_size = 0;
		GeeList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gint _view_index = 0;
		_tmp4_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp5_ = _tmp4_;
		_tmp6_ = view_collection_get_selected (_tmp5_);
		_tmp7_ = _tmp6_;
		_data_collection_unref0 (_tmp5_);
		_view_list = _tmp7_;
		_tmp8_ = _view_list;
		_tmp9_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp10_ = _tmp9_;
		_view_size = _tmp10_;
		_view_index = -1;
		while (TRUE) {
			gint _tmp11_;
			gint _tmp12_;
			DataView* view = NULL;
			GeeList* _tmp13_;
			gpointer _tmp14_;
			Photo* p = NULL;
			DataView* _tmp15_;
			DataSource* _tmp16_;
			Photo* _tmp17_;
			gboolean _tmp18_ = FALSE;
			Photo* _tmp19_;
			_view_index = _view_index + 1;
			_tmp11_ = _view_index;
			_tmp12_ = _view_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _view_list;
			_tmp14_ = gee_list_get (_tmp13_, _view_index);
			view = (DataView*) _tmp14_;
			_tmp15_ = view;
			_tmp16_ = data_view_get_source (_tmp15_);
			_tmp17_ = IS_PHOTO (_tmp16_) ? ((Photo*) _tmp16_) : NULL;
			if (_tmp17_ == NULL) {
				_g_object_unref0 (_tmp16_);
			}
			p = _tmp17_;
			_tmp19_ = p;
			if (_tmp19_ != NULL) {
				Photo* _tmp20_;
				_tmp20_ = p;
				_tmp18_ = !raw_developer_is_equivalent (rd, photo_get_raw_developer (_tmp20_));
			} else {
				_tmp18_ = FALSE;
			}
			if (_tmp18_) {
				GeeArrayList* _tmp21_;
				DataView* _tmp22_;
				Photo* _tmp23_;
				_tmp21_ = to_set;
				_tmp22_ = view;
				gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp22_);
				_tmp23_ = p;
				if (photo_has_transformations (_tmp23_)) {
					need_warn = TRUE;
				}
			}
			_g_object_unref0 (p);
			_g_object_unref0 (view);
		}
		_g_object_unref0 (_view_list);
	}
	if (!need_warn) {
		_tmp24_ = TRUE;
	} else {
		GeeArrayList* _tmp25_;
		gint _tmp26_;
		gint _tmp27_;
		_tmp25_ = to_set;
		_tmp26_ = gee_abstract_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection));
		_tmp27_ = _tmp26_;
		_tmp24_ = dialogs_confirm_warn_developer_changed (_tmp27_);
	}
	if (_tmp24_) {
		SetRawDeveloperCommand* command = NULL;
		GeeArrayList* _tmp28_;
		SetRawDeveloperCommand* _tmp29_;
		CommandManager* _tmp30_;
		CommandManager* _tmp31_;
		SetRawDeveloperCommand* _tmp32_;
		_tmp28_ = to_set;
		_tmp29_ = set_raw_developer_command_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, GEE_TYPE_ITERABLE, GeeIterable), rd);
		command = _tmp29_;
		_tmp30_ = page_get_command_manager (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp31_ = _tmp30_;
		_tmp32_ = command;
		command_manager_execute (_tmp31_, G_TYPE_CHECK_INSTANCE_CAST (_tmp32_, TYPE_COMMAND, Command));
		_command_manager_unref0 (_tmp31_);
		media_page_update_development_menu_item_sensitivity (self);
		_g_object_unref0 (command);
	}
	_g_object_unref0 (to_set);
}

void
media_page_developer_changed (MediaPage* self,
                              RawDeveloper rd)
{
	MediaPageClass* _klass_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->developer_changed) {
		_klass_->developer_changed (self, rd);
	}
}

static void
media_page_real_set_display_titles (CheckerboardPage* base,
                                    gboolean display)
{
	MediaPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	CHECKERBOARD_PAGE_CLASS (media_page_parent_class)->set_display_titles (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), display);
	page_set_action_active (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewTitle", display);
}

static void
media_page_real_set_display_comments (CheckerboardPage* base,
                                      gboolean display)
{
	MediaPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	CHECKERBOARD_PAGE_CLASS (media_page_parent_class)->set_display_comments (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), display);
	page_set_action_active (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "ViewComment", display);
}

static GAction*
media_page_sort_by_title_action (MediaPage* self)
{
	GAction* action = NULL;
	GAction* _tmp0_;
	GAction* result;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), NULL);
	_tmp0_ = page_get_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "SortBy");
	action = _tmp0_;
	_vala_assert (action != NULL, "action != null");
	result = action;
	return result;
}

static GAction*
media_page_sort_ascending_action (MediaPage* self)
{
	GAction* action = NULL;
	GAction* _tmp0_;
	GAction* result;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), NULL);
	_tmp0_ = page_get_action (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "Sort");
	action = _tmp0_;
	_vala_assert (action != NULL, "action != null");
	result = action;
	return result;
}

gint
media_page_get_menu_sort_by (MediaPage* self)
{
	GAction* _tmp0_;
	GAction* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	const gchar* _tmp4_;
	gint _tmp5_;
	gint result;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), -1);
	_tmp0_ = media_page_sort_by_title_action (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_action_get_state (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_variant_get_string (_tmp3_, NULL);
	_tmp5_ = atoi (_tmp4_);
	_g_variant_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	result = _tmp5_;
	return result;
}

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

void
media_page_set_menu_sort_by (MediaPage* self,
                             gint val)
{
	gchar* sort = NULL;
	gchar* _tmp0_;
	GAction* _tmp1_;
	GAction* _tmp2_;
	GVariant* _tmp3_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = g_strdup_printf ("%d", val);
	sort = _tmp0_;
	_tmp1_ = media_page_sort_by_title_action (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _variant_new27 (sort);
	g_action_change_state (_tmp2_, _tmp3_);
	_g_variant_unref0 (_tmp3_);
	_g_object_unref0 (_tmp2_);
	_g_free0 (sort);
}

gboolean
media_page_get_menu_sort_order (MediaPage* self)
{
	GAction* _tmp0_;
	GAction* _tmp1_;
	GVariant* _tmp2_;
	GVariant* _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp5_;
	gboolean result;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), FALSE);
	_tmp0_ = media_page_sort_ascending_action (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_action_get_state (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_variant_get_string (_tmp3_, NULL);
	_tmp5_ = g_strcmp0 (_tmp4_, "ascending") == 0;
	_g_variant_unref0 (_tmp3_);
	_g_object_unref0 (_tmp1_);
	result = _tmp5_;
	return result;
}

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

void
media_page_set_menu_sort_order (MediaPage* self,
                                gboolean ascending)
{
	const gchar* _tmp0_ = NULL;
	GAction* _tmp1_;
	GAction* _tmp2_;
	GVariant* _tmp3_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	if (ascending) {
		_tmp0_ = "ascending";
	} else {
		_tmp0_ = "descending";
	}
	_tmp1_ = media_page_sort_ascending_action (self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _variant_new28 (_tmp0_);
	g_action_change_state (_tmp2_, _tmp3_);
	_g_variant_unref0 (_tmp3_);
	_g_object_unref0 (_tmp2_);
}

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

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

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

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

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

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

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

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

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

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

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

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

static void
media_page_set_view_comparator (MediaPage* self,
                                gint sort_by,
                                gboolean ascending)
{
	Comparator comparator = NULL;
	gpointer comparator_target = NULL;
	GDestroyNotify comparator_target_destroy_notify = NULL;
	ComparatorPredicate predicate = NULL;
	gpointer predicate_target = NULL;
	GDestroyNotify predicate_target_destroy_notify = NULL;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	Comparator _tmp4_;
	gpointer _tmp4__target;
	ComparatorPredicate _tmp5_;
	gpointer _tmp5__target;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	switch (sort_by) {
		case MEDIA_PAGE_SORT_BY_TITLE:
		{
			if (ascending) {
				(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
				comparator = NULL;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
				comparator = _thumbnail_title_ascending_comparator_comparator;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
			} else {
				(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
				comparator = NULL;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
				comparator = _thumbnail_title_descending_comparator_comparator;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
			}
			(predicate_target_destroy_notify == NULL) ? NULL : (predicate_target_destroy_notify (predicate_target), NULL);
			predicate = NULL;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			predicate = _thumbnail_title_comparator_predicate_comparator_predicate;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			break;
		}
		case MEDIA_PAGE_SORT_BY_EXPOSURE_DATE:
		{
			if (ascending) {
				(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
				comparator = NULL;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
				comparator = _thumbnail_exposure_time_ascending_comparator_comparator;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
			} else {
				(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
				comparator = NULL;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
				comparator = _thumbnail_exposure_time_descending_comparator_comparator;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
			}
			(predicate_target_destroy_notify == NULL) ? NULL : (predicate_target_destroy_notify (predicate_target), NULL);
			predicate = NULL;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			predicate = _thumbnail_exposure_time_comparator_predicate_comparator_predicate;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			break;
		}
		case MEDIA_PAGE_SORT_BY_RATING:
		{
			if (ascending) {
				(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
				comparator = NULL;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
				comparator = _thumbnail_rating_ascending_comparator_comparator;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
			} else {
				(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
				comparator = NULL;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
				comparator = _thumbnail_rating_descending_comparator_comparator;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
			}
			(predicate_target_destroy_notify == NULL) ? NULL : (predicate_target_destroy_notify (predicate_target), NULL);
			predicate = NULL;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			predicate = _thumbnail_rating_comparator_predicate_comparator_predicate;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			break;
		}
		case MEDIA_PAGE_SORT_BY_FILENAME:
		{
			if (ascending) {
				(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
				comparator = NULL;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
				comparator = _thumbnail_filename_ascending_comparator_comparator;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
			} else {
				(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
				comparator = NULL;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
				comparator = _thumbnail_filename_descending_comparator_comparator;
				comparator_target = NULL;
				comparator_target_destroy_notify = NULL;
			}
			(predicate_target_destroy_notify == NULL) ? NULL : (predicate_target_destroy_notify (predicate_target), NULL);
			predicate = NULL;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			predicate = _thumbnail_filename_comparator_predicate_comparator_predicate;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			break;
		}
		default:
		{
			gchar* _tmp0_;
			gchar* _tmp1_;
			_tmp0_ = g_strdup_printf ("%i", media_page_get_menu_sort_by (self));
			_tmp1_ = _tmp0_;
			g_debug ("MediaPage.vala:906: Unknown sort criteria: %s", _tmp1_);
			_g_free0 (_tmp1_);
			(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
			comparator = NULL;
			comparator_target = NULL;
			comparator_target_destroy_notify = NULL;
			comparator = _thumbnail_title_descending_comparator_comparator;
			comparator_target = NULL;
			comparator_target_destroy_notify = NULL;
			(predicate_target_destroy_notify == NULL) ? NULL : (predicate_target_destroy_notify (predicate_target), NULL);
			predicate = NULL;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			predicate = _thumbnail_title_comparator_predicate_comparator_predicate;
			predicate_target = NULL;
			predicate_target_destroy_notify = NULL;
			break;
		}
	}
	_tmp2_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp3_ = _tmp2_;
	_tmp4_ = comparator;
	_tmp4__target = comparator_target;
	_tmp5_ = predicate;
	_tmp5__target = predicate_target;
	data_collection_set_comparator (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_COLLECTION, DataCollection), _tmp4_, _tmp4__target, _tmp5_, _tmp5__target);
	_data_collection_unref0 (_tmp3_);
	(predicate_target_destroy_notify == NULL) ? NULL : (predicate_target_destroy_notify (predicate_target), NULL);
	predicate = NULL;
	predicate_target = NULL;
	predicate_target_destroy_notify = NULL;
	(comparator_target_destroy_notify == NULL) ? NULL : (comparator_target_destroy_notify (comparator_target), NULL);
	comparator = NULL;
	comparator_target = NULL;
	comparator_target_destroy_notify = NULL;
}

void
media_page_sync_sort (MediaPage* self)
{
	gboolean sort_ascending = FALSE;
	gint sort_by = 0;
	gboolean _tmp0_ = FALSE;
	gint _tmp1_ = 0;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	media_page_get_config_photos_sort (self, &_tmp0_, &_tmp1_);
	sort_ascending = _tmp0_;
	sort_by = _tmp1_;
	media_page_set_menu_sort_by (self, sort_by);
	media_page_set_menu_sort_order (self, sort_ascending);
	media_page_set_view_comparator (self, sort_by, sort_ascending);
}

static void
media_page_real_destroy (GtkWidget* base)
{
	MediaPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_MEDIA_PAGE, MediaPage);
	media_page_disconnect_slider (self);
	GTK_WIDGET_CLASS (media_page_parent_class)->destroy (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), gtk_widget_get_type (), GtkWidget));
}

void
media_page_increase_zoom_level (MediaPage* self)
{
	MediaPageZoomSliderAssembly* _tmp0_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = self->priv->connected_slider;
	if (_tmp0_ != NULL) {
		MediaPageZoomSliderAssembly* _tmp1_;
		_tmp1_ = self->priv->connected_slider;
		media_page_zoom_slider_assembly_increase_step (_tmp1_);
	} else {
		gint new_scale = 0;
		new_scale = media_page_compute_zoom_scale_increase (media_page_get_thumb_size (self));
		media_page_save_persistent_thumbnail_scale (self);
		media_page_set_thumb_size (self, new_scale);
	}
}

void
media_page_decrease_zoom_level (MediaPage* self)
{
	MediaPageZoomSliderAssembly* _tmp0_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	_tmp0_ = self->priv->connected_slider;
	if (_tmp0_ != NULL) {
		MediaPageZoomSliderAssembly* _tmp1_;
		_tmp1_ = self->priv->connected_slider;
		media_page_zoom_slider_assembly_decrease_step (_tmp1_);
	} else {
		gint new_scale = 0;
		new_scale = media_page_compute_zoom_scale_decrease (media_page_get_thumb_size (self));
		media_page_save_persistent_thumbnail_scale (self);
		media_page_set_thumb_size (self, new_scale);
	}
}

static DataView*
media_page_real_create_thumbnail (MediaPage* self,
                                  DataSource* source)
{
	Thumbnail* _tmp0_;
	DataView* result;
	g_return_val_if_fail (IS_DATA_SOURCE (source), NULL);
	_tmp0_ = thumbnail_new (G_TYPE_CHECK_INSTANCE_CAST (source, TYPE_MEDIA_SOURCE, MediaSource), media_page_get_thumb_size (self));
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DATA_VIEW, DataView);
	return result;
}

DataView*
media_page_create_thumbnail (MediaPage* self,
                             DataSource* source)
{
	MediaPageClass* _klass_;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), NULL);
	_klass_ = MEDIA_PAGE_GET_CLASS (self);
	if (_klass_->create_thumbnail) {
		return _klass_->create_thumbnail (self, source);
	}
	return NULL;
}

void
media_page_set_thumb_size (MediaPage* self,
                           gint new_scale)
{
	gboolean _tmp0_ = FALSE;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	CheckerboardLayout* _tmp5_;
	CheckerboardLayout* _tmp6_;
	ViewCollection* _tmp7_;
	ViewCollection* _tmp8_;
	ViewCollection* _tmp9_;
	ViewCollection* _tmp10_;
	GValue _tmp11_ = {0};
	ViewCollection* _tmp12_;
	ViewCollection* _tmp13_;
	gint _tmp14_;
	gint _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	g_return_if_fail (IS_MEDIA_PAGE (self));
	if (media_page_get_thumb_size (self) == new_scale) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = !page_is_in_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	}
	if (_tmp0_) {
		return;
	}
	_tmp1_ = thumbnail_get_MIN_SCALE ();
	_tmp2_ = _tmp1_;
	_tmp3_ = thumbnail_get_MAX_SCALE ();
	_tmp4_ = _tmp3_;
	new_scale = CLAMP (new_scale, _tmp2_, _tmp4_);
	_tmp5_ = checkerboard_page_get_checkerboard_layout (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage));
	_tmp6_ = _tmp5_;
	checkerboard_layout_set_scale (_tmp6_, new_scale);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp8_ = _tmp7_;
	data_collection_freeze_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp8_);
	_tmp9_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp10_ = _tmp9_;
	g_value_init (&_tmp11_, G_TYPE_INT);
	g_value_set_int (&_tmp11_, new_scale);
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_DATA_COLLECTION, DataCollection), THUMBNAIL_PROP_SIZE, &_tmp11_, NULL, NULL);
	G_IS_VALUE (&_tmp11_) ? (g_value_unset (&_tmp11_), NULL) : NULL;
	_data_collection_unref0 (_tmp10_);
	_tmp12_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp13_ = _tmp12_;
	data_collection_thaw_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp13_);
	_tmp14_ = thumbnail_get_MAX_SCALE ();
	_tmp15_ = _tmp14_;
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "IncreaseSize", new_scale < _tmp15_);
	_tmp16_ = thumbnail_get_MIN_SCALE ();
	_tmp17_ = _tmp16_;
	page_set_action_sensitive (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), "DecreaseSize", new_scale > _tmp17_);
}

gint
media_page_get_thumb_size (MediaPage* self)
{
	CheckerboardLayout* _tmp0_;
	CheckerboardLayout* _tmp1_;
	gboolean _tmp2_;
	CheckerboardLayout* _tmp7_;
	CheckerboardLayout* _tmp8_;
	gint _tmp9_;
	gint result;
	g_return_val_if_fail (IS_MEDIA_PAGE (self), -1);
	_tmp0_ = checkerboard_page_get_checkerboard_layout (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage));
	_tmp1_ = _tmp0_;
	_tmp2_ = checkerboard_layout_get_scale (_tmp1_) <= 0;
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		CheckerboardLayout* _tmp3_;
		CheckerboardLayout* _tmp4_;
		ConfigFacade* _tmp5_;
		ConfigFacade* _tmp6_;
		_tmp3_ = checkerboard_page_get_checkerboard_layout (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage));
		_tmp4_ = _tmp3_;
		_tmp5_ = config_facade_get_instance ();
		_tmp6_ = _tmp5_;
		checkerboard_layout_set_scale (_tmp4_, configuration_facade_get_photo_thumbnail_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade)));
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (_tmp4_);
	}
	_tmp7_ = checkerboard_page_get_checkerboard_layout (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage));
	_tmp8_ = _tmp7_;
	_tmp9_ = checkerboard_layout_get_scale (_tmp8_);
	_g_object_unref0 (_tmp8_);
	result = _tmp9_;
	return result;
}

static inline gpointer
media_page_zoom_slider_assembly_get_instance_private (MediaPageZoomSliderAssembly* self)
{
	return G_STRUCT_MEMBER_P (self, MediaPageZoomSliderAssembly_private_offset);
}

static gboolean
_media_page_zoom_slider_assembly_on_zoom_out_pressed_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                    GdkEventButton* event,
                                                                                    gpointer self)
{
	gboolean result;
	result = media_page_zoom_slider_assembly_on_zoom_out_pressed ((MediaPageZoomSliderAssembly*) self, event);
	return result;
}

static void
_media_page_zoom_slider_assembly_on_slider_changed_gtk_range_value_changed (GtkRange* _sender,
                                                                            gpointer self)
{
	media_page_zoom_slider_assembly_on_slider_changed ((MediaPageZoomSliderAssembly*) self);
}

static gboolean
_media_page_zoom_slider_assembly_on_zoom_in_pressed_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                   GdkEventButton* event,
                                                                                   gpointer self)
{
	gboolean result;
	result = media_page_zoom_slider_assembly_on_zoom_in_pressed ((MediaPageZoomSliderAssembly*) self, event);
	return result;
}

MediaPageZoomSliderAssembly*
media_page_zoom_slider_assembly_construct (GType object_type)
{
	MediaPageZoomSliderAssembly * self = NULL;
	GtkBox* zoom_group = NULL;
	GtkBox* _tmp0_;
	GtkImage* zoom_out = NULL;
	GtkImage* _tmp1_;
	GtkEventBox* zoom_out_box = NULL;
	GtkEventBox* _tmp2_;
	gint persisted_scale = 0;
	ConfigFacade* _tmp3_;
	ConfigFacade* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	GtkAdjustment* _tmp8_;
	GtkAdjustment* _tmp9_;
	GtkScale* _tmp10_;
	GtkScale* _tmp11_;
	GtkScale* _tmp12_;
	GtkScale* _tmp13_;
	GtkScale* _tmp14_;
	GtkScale* _tmp15_;
	GtkImage* zoom_in = NULL;
	GtkImage* _tmp16_;
	GtkEventBox* zoom_in_box = NULL;
	GtkEventBox* _tmp17_;
	self = (MediaPageZoomSliderAssembly*) g_object_new (object_type, NULL);
	_tmp0_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp0_);
	zoom_group = _tmp0_;
	_tmp1_ = (GtkImage*) gtk_image_new_from_icon_name ("image-zoom-out-symbolic", (GtkIconSize) GTK_ICON_SIZE_SMALL_TOOLBAR);
	g_object_ref_sink (_tmp1_);
	zoom_out = _tmp1_;
	_tmp2_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp2_);
	zoom_out_box = _tmp2_;
	gtk_event_box_set_above_child (zoom_out_box, TRUE);
	gtk_event_box_set_visible_window (zoom_out_box, FALSE);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (zoom_out_box, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (zoom_out, gtk_widget_get_type (), GtkWidget));
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (zoom_out_box, gtk_widget_get_type (), GtkWidget), "button-press-event", (GCallback) _media_page_zoom_slider_assembly_on_zoom_out_pressed_gtk_widget_button_press_event, self, 0);
	gtk_box_pack_start (zoom_group, G_TYPE_CHECK_INSTANCE_CAST (zoom_out_box, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
	_tmp3_ = config_facade_get_instance ();
	_tmp4_ = _tmp3_;
	_tmp5_ = configuration_facade_get_photo_thumbnail_scale (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_CONFIGURATION_FACADE, ConfigurationFacade));
	_g_object_unref0 (_tmp4_);
	persisted_scale = _tmp5_;
	_tmp6_ = thumbnail_get_MAX_SCALE ();
	_tmp7_ = _tmp6_;
	_tmp8_ = gtk_adjustment_new (media_page_zoom_slider_assembly_scale_to_slider (persisted_scale), (gdouble) 0, media_page_zoom_slider_assembly_scale_to_slider (_tmp7_), (gdouble) 1, (gdouble) 10, (gdouble) 0);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->adjustment);
	self->priv->adjustment = _tmp8_;
	_tmp9_ = self->priv->adjustment;
	_tmp10_ = (GtkScale*) gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, _tmp9_);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->slider);
	self->priv->slider = _tmp10_;
	_tmp11_ = self->priv->slider;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_range_get_type (), GtkRange), "value-changed", (GCallback) _media_page_zoom_slider_assembly_on_slider_changed_gtk_range_value_changed, self, 0);
	_tmp12_ = self->priv->slider;
	gtk_scale_set_draw_value (_tmp12_, FALSE);
	_tmp13_ = self->priv->slider;
	gtk_widget_set_size_request (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_widget_get_type (), GtkWidget), 200, -1);
	_tmp14_ = self->priv->slider;
	gtk_widget_set_tooltip_text (G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, gtk_widget_get_type (), GtkWidget), _ ("Adjust the size of the thumbnails"));
	_tmp15_ = self->priv->slider;
	gtk_box_pack_start (zoom_group, G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
	_tmp16_ = (GtkImage*) gtk_image_new_from_icon_name ("image-zoom-in-symbolic", (GtkIconSize) GTK_ICON_SIZE_SMALL_TOOLBAR);
	g_object_ref_sink (_tmp16_);
	zoom_in = _tmp16_;
	_tmp17_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp17_);
	zoom_in_box = _tmp17_;
	gtk_event_box_set_above_child (zoom_in_box, TRUE);
	gtk_event_box_set_visible_window (zoom_in_box, FALSE);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (zoom_in_box, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (zoom_in, gtk_widget_get_type (), GtkWidget));
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (zoom_in_box, gtk_widget_get_type (), GtkWidget), "button-press-event", (GCallback) _media_page_zoom_slider_assembly_on_zoom_in_pressed_gtk_widget_button_press_event, self, 0);
	gtk_box_pack_start (zoom_group, G_TYPE_CHECK_INSTANCE_CAST (zoom_in_box, gtk_widget_get_type (), GtkWidget), FALSE, FALSE, (guint) 0);
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (zoom_group, gtk_widget_get_type (), GtkWidget));
	_g_object_unref0 (zoom_in_box);
	_g_object_unref0 (zoom_in);
	_g_object_unref0 (zoom_out_box);
	_g_object_unref0 (zoom_out);
	_g_object_unref0 (zoom_group);
	return self;
}

MediaPageZoomSliderAssembly*
media_page_zoom_slider_assembly_new (void)
{
	return media_page_zoom_slider_assembly_construct (MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY);
}

gdouble
media_page_zoom_slider_assembly_scale_to_slider (gint value)
{
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gdouble result;
	_tmp0_ = thumbnail_get_MIN_SCALE ();
	_tmp1_ = _tmp0_;
	_tmp2_ = thumbnail_get_MAX_SCALE ();
	_tmp3_ = _tmp2_;
	_tmp4_ = thumbnail_get_MIN_SCALE ();
	_tmp5_ = _tmp4_;
	result = (gdouble) ((CLAMP (value, _tmp1_, _tmp3_) - _tmp5_) / MEDIA_PAGE_SLIDER_STEPPING);
	return result;
}

gint
media_page_zoom_slider_assembly_slider_to_scale (gdouble value)
{
	gint res = 0;
	gint _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gint result;
	_tmp0_ = thumbnail_get_MIN_SCALE ();
	_tmp1_ = _tmp0_;
	res = ((gint) (value * MEDIA_PAGE_SLIDER_STEPPING)) + _tmp1_;
	_tmp2_ = thumbnail_get_MIN_SCALE ();
	_tmp3_ = _tmp2_;
	_vala_assert (res >= _tmp3_, "res >= Thumbnail.MIN_SCALE");
	_tmp4_ = thumbnail_get_MAX_SCALE ();
	_tmp5_ = _tmp4_;
	_vala_assert (res <= _tmp5_, "res <= Thumbnail.MAX_SCALE");
	result = res;
	return result;
}

static gboolean
media_page_zoom_slider_assembly_on_zoom_out_pressed (MediaPageZoomSliderAssembly* self,
                                                     GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	media_page_zoom_slider_assembly_snap_to_min (self);
	result = TRUE;
	return result;
}

static gboolean
media_page_zoom_slider_assembly_on_zoom_in_pressed (MediaPageZoomSliderAssembly* self,
                                                    GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	media_page_zoom_slider_assembly_snap_to_max (self);
	result = TRUE;
	return result;
}

static void
media_page_zoom_slider_assembly_on_slider_changed (MediaPageZoomSliderAssembly* self)
{
	g_return_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (self));
	g_signal_emit (self, media_page_zoom_slider_assembly_signals[MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_ZOOM_CHANGED_SIGNAL], 0);
}

void
media_page_zoom_slider_assembly_snap_to_min (MediaPageZoomSliderAssembly* self)
{
	GtkScale* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (self));
	_tmp0_ = self->priv->slider;
	_tmp1_ = thumbnail_get_MIN_SCALE ();
	_tmp2_ = _tmp1_;
	gtk_range_set_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_range_get_type (), GtkRange), media_page_zoom_slider_assembly_scale_to_slider (_tmp2_));
}

void
media_page_zoom_slider_assembly_snap_to_max (MediaPageZoomSliderAssembly* self)
{
	GtkScale* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	g_return_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (self));
	_tmp0_ = self->priv->slider;
	_tmp1_ = thumbnail_get_MAX_SCALE ();
	_tmp2_ = _tmp1_;
	gtk_range_set_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_range_get_type (), GtkRange), media_page_zoom_slider_assembly_scale_to_slider (_tmp2_));
}

void
media_page_zoom_slider_assembly_increase_step (MediaPageZoomSliderAssembly* self)
{
	gint new_scale = 0;
	GtkScale* _tmp0_;
	g_return_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (self));
	new_scale = media_page_compute_zoom_scale_increase (media_page_zoom_slider_assembly_get_scale (self));
	if (media_page_zoom_slider_assembly_get_scale (self) == new_scale) {
		return;
	}
	_tmp0_ = self->priv->slider;
	gtk_range_set_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_range_get_type (), GtkRange), media_page_zoom_slider_assembly_scale_to_slider (new_scale));
}

void
media_page_zoom_slider_assembly_decrease_step (MediaPageZoomSliderAssembly* self)
{
	gint new_scale = 0;
	GtkScale* _tmp0_;
	g_return_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (self));
	new_scale = media_page_compute_zoom_scale_decrease (media_page_zoom_slider_assembly_get_scale (self));
	if (media_page_zoom_slider_assembly_get_scale (self) == new_scale) {
		return;
	}
	_tmp0_ = self->priv->slider;
	gtk_range_set_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_range_get_type (), GtkRange), media_page_zoom_slider_assembly_scale_to_slider (new_scale));
}

gint
media_page_zoom_slider_assembly_get_scale (MediaPageZoomSliderAssembly* self)
{
	GtkScale* _tmp0_;
	gint result;
	g_return_val_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (self), -1);
	_tmp0_ = self->priv->slider;
	result = media_page_zoom_slider_assembly_slider_to_scale (gtk_range_get_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_range_get_type (), GtkRange)));
	return result;
}

void
media_page_zoom_slider_assembly_set_scale (MediaPageZoomSliderAssembly* self,
                                           gint scale)
{
	GtkScale* _tmp0_;
	g_return_if_fail (MEDIA_PAGE_IS_ZOOM_SLIDER_ASSEMBLY (self));
	if (media_page_zoom_slider_assembly_get_scale (self) == scale) {
		return;
	}
	_tmp0_ = self->priv->slider;
	gtk_range_set_value (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_range_get_type (), GtkRange), media_page_zoom_slider_assembly_scale_to_slider (scale));
}

static void
media_page_zoom_slider_assembly_class_init (MediaPageZoomSliderAssemblyClass * klass,
                                            gpointer klass_data)
{
	media_page_zoom_slider_assembly_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &MediaPageZoomSliderAssembly_private_offset);
	G_OBJECT_CLASS (klass)->finalize = media_page_zoom_slider_assembly_finalize;
	media_page_zoom_slider_assembly_signals[MEDIA_PAGE_ZOOM_SLIDER_ASSEMBLY_ZOOM_CHANGED_SIGNAL] = g_signal_new ("zoom-changed", MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
media_page_zoom_slider_assembly_instance_init (MediaPageZoomSliderAssembly * self,
                                               gpointer klass)
{
	self->priv = media_page_zoom_slider_assembly_get_instance_private (self);
}

static void
media_page_zoom_slider_assembly_finalize (GObject * obj)
{
	MediaPageZoomSliderAssembly * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MEDIA_PAGE_TYPE_ZOOM_SLIDER_ASSEMBLY, MediaPageZoomSliderAssembly);
	_g_object_unref0 (self->priv->slider);
	_g_object_unref0 (self->priv->adjustment);
	G_OBJECT_CLASS (media_page_zoom_slider_assembly_parent_class)->finalize (obj);
}

static GType
media_page_zoom_slider_assembly_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MediaPageZoomSliderAssemblyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) media_page_zoom_slider_assembly_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MediaPageZoomSliderAssembly), 0, (GInstanceInitFunc) media_page_zoom_slider_assembly_instance_init, NULL };
	GType media_page_zoom_slider_assembly_type_id;
	media_page_zoom_slider_assembly_type_id = g_type_register_static (gtk_tool_item_get_type (), "MediaPageZoomSliderAssembly", &g_define_type_info, 0);
	MediaPageZoomSliderAssembly_private_offset = g_type_add_instance_private (media_page_zoom_slider_assembly_type_id, sizeof (MediaPageZoomSliderAssemblyPrivate));
	return media_page_zoom_slider_assembly_type_id;
}

GType
media_page_zoom_slider_assembly_get_type (void)
{
	static volatile gsize media_page_zoom_slider_assembly_type_id__once = 0;
	if (g_once_init_enter (&media_page_zoom_slider_assembly_type_id__once)) {
		GType media_page_zoom_slider_assembly_type_id;
		media_page_zoom_slider_assembly_type_id = media_page_zoom_slider_assembly_get_type_once ();
		g_once_init_leave (&media_page_zoom_slider_assembly_type_id__once, media_page_zoom_slider_assembly_type_id);
	}
	return media_page_zoom_slider_assembly_type_id__once;
}

static void
media_page_class_init (MediaPageClass * klass,
                       gpointer klass_data)
{
	media_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &MediaPage_private_offset);
	((PageClass *) klass)->init_collect_ui_filenames = (void (*) (Page*, GeeList*)) media_page_real_init_collect_ui_filenames;
	((PageClass *) klass)->add_actions = (void (*) (Page*, GActionMap*)) media_page_real_add_actions;
	((PageClass *) klass)->remove_actions = (void (*) (Page*, GActionMap*)) media_page_real_remove_actions;
	((PageClass *) klass)->update_actions = (void (*) (Page*, gint, gint)) media_page_real_update_actions;
	((CheckerboardPageClass *) klass)->get_view_tracker = (CoreViewTracker* (*) (CheckerboardPage*)) media_page_real_get_view_tracker;
	((PageClass *) klass)->on_mousewheel_up = (gboolean (*) (Page*, GdkEventScroll*)) media_page_real_on_mousewheel_up;
	((PageClass *) klass)->on_mousewheel_down = (gboolean (*) (Page*, GdkEventScroll*)) media_page_real_on_mousewheel_down;
	((PageClass *) klass)->on_app_key_pressed = (gboolean (*) (Page*, GdkEventKey*)) media_page_real_on_app_key_pressed;
	((PageClass *) klass)->switched_to = (void (*) (Page*)) media_page_real_switched_to;
	((PageClass *) klass)->switching_from = (void (*) (Page*)) media_page_real_switching_from;
	((MediaPageClass *) klass)->on_zoom_changed = (void (*) (MediaPage*)) media_page_real_on_zoom_changed;
	((MediaPageClass *) klass)->on_export = (void (*) (MediaPage*)) media_page_real_on_export;
	((MediaPageClass *) klass)->on_increase_size = (void (*) (MediaPage*)) media_page_real_on_increase_size;
	((MediaPageClass *) klass)->on_decrease_size = (void (*) (MediaPage*)) media_page_real_on_decrease_size;
	((MediaPageClass *) klass)->on_increase_rating = (void (*) (MediaPage*)) media_page_real_on_increase_rating;
	((MediaPageClass *) klass)->on_decrease_rating = (void (*) (MediaPage*)) media_page_real_on_decrease_rating;
	((MediaPageClass *) klass)->on_set_rating = (void (*) (MediaPage*, Rating)) media_page_real_on_set_rating;
	((MediaPageClass *) klass)->on_rate_rejected = (void (*) (MediaPage*)) media_page_real_on_rate_rejected;
	((MediaPageClass *) klass)->on_rate_unrated = (void (*) (MediaPage*)) media_page_real_on_rate_unrated;
	((MediaPageClass *) klass)->on_rate_one = (void (*) (MediaPage*)) media_page_real_on_rate_one;
	((MediaPageClass *) klass)->on_rate_two = (void (*) (MediaPage*)) media_page_real_on_rate_two;
	((MediaPageClass *) klass)->on_rate_three = (void (*) (MediaPage*)) media_page_real_on_rate_three;
	((MediaPageClass *) klass)->on_rate_four = (void (*) (MediaPage*)) media_page_real_on_rate_four;
	((MediaPageClass *) klass)->on_rate_five = (void (*) (MediaPage*)) media_page_real_on_rate_five;
	((MediaPageClass *) klass)->on_move_to_trash = (void (*) (MediaPage*)) media_page_real_on_move_to_trash;
	((MediaPageClass *) klass)->on_edit_title = (void (*) (MediaPage*)) media_page_real_on_edit_title;
	((MediaPageClass *) klass)->on_edit_comment = (void (*) (MediaPage*)) media_page_real_on_edit_comment;
	((MediaPageClass *) klass)->on_display_titles = (void (*) (MediaPage*, GSimpleAction*, GVariant*)) media_page_real_on_display_titles;
	((MediaPageClass *) klass)->on_display_comments = (void (*) (MediaPage*, GSimpleAction*, GVariant*)) media_page_real_on_display_comments;
	((MediaPageClass *) klass)->on_display_ratings = (void (*) (MediaPage*, GSimpleAction*, GVariant*)) media_page_real_on_display_ratings;
	((MediaPageClass *) klass)->on_display_tags = (void (*) (MediaPage*, GSimpleAction*, GVariant*)) media_page_real_on_display_tags;
	((MediaPageClass *) klass)->get_config_photos_sort = (void (*) (MediaPage*, gboolean*, gint*)) media_page_real_get_config_photos_sort;
	((MediaPageClass *) klass)->set_config_photos_sort = (void (*) (MediaPage*, gboolean, gint)) media_page_real_set_config_photos_sort;
	((MediaPageClass *) klass)->on_sort_changed = (void (*) (MediaPage*, GSimpleAction*, GVariant*)) media_page_real_on_sort_changed;
	((MediaPageClass *) klass)->developer_changed = (void (*) (MediaPage*, RawDeveloper)) media_page_real_developer_changed;
	((CheckerboardPageClass *) klass)->set_display_titles = (void (*) (CheckerboardPage*, gboolean)) media_page_real_set_display_titles;
	((CheckerboardPageClass *) klass)->set_display_comments = (void (*) (CheckerboardPage*, gboolean)) media_page_real_set_display_comments;
	((GtkWidgetClass *) klass)->destroy = (void (*) (GtkWidget*)) media_page_real_destroy;
	((MediaPageClass *) klass)->create_thumbnail = (DataView* (*) (MediaPage*, DataSource*)) media_page_real_create_thumbnail;
	G_OBJECT_CLASS (klass)->finalize = media_page_finalize;
}

static void
media_page_instance_init (MediaPage * self,
                          gpointer klass)
{
	self->priv = media_page_get_instance_private (self);
	self->priv->connected_slider = NULL;
	self->priv->dnd_handler = NULL;
}

static void
media_page_finalize (GObject * obj)
{
	MediaPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_MEDIA_PAGE, MediaPage);
	_g_object_unref0 (self->priv->connected_slider);
	_drag_and_drop_handler_unref0 (self->priv->dnd_handler);
	_core_tracker_unref0 (self->priv->tracker);
	G_OBJECT_CLASS (media_page_parent_class)->finalize (obj);
}

static GType
media_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MediaPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) media_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MediaPage), 0, (GInstanceInitFunc) media_page_instance_init, NULL };
	GType media_page_type_id;
	media_page_type_id = g_type_register_static (TYPE_CHECKERBOARD_PAGE, "MediaPage", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	MediaPage_private_offset = g_type_add_instance_private (media_page_type_id, sizeof (MediaPagePrivate));
	return media_page_type_id;
}

GType
media_page_get_type (void)
{
	static volatile gsize media_page_type_id__once = 0;
	if (g_once_init_enter (&media_page_type_id__once)) {
		GType media_page_type_id;
		media_page_type_id = media_page_get_type_once ();
		g_once_init_leave (&media_page_type_id__once, media_page_type_id);
	}
	return media_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;
}

