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

/*
* Copyright (c) 2009-2013 Yorba Foundation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#include "io.elementary.photos.h"
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>

#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

#define LIBRARY_PHOTO_PAGE_TYPE_LIBRARY_PHOTO_PAGE_VIEW_FILTER (library_photo_page_library_photo_page_view_filter_get_type ())
#define LIBRARY_PHOTO_PAGE_LIBRARY_PHOTO_PAGE_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LIBRARY_PHOTO_PAGE_TYPE_LIBRARY_PHOTO_PAGE_VIEW_FILTER, LibraryPhotoPageLibraryPhotoPageViewFilter))
#define LIBRARY_PHOTO_PAGE_LIBRARY_PHOTO_PAGE_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LIBRARY_PHOTO_PAGE_TYPE_LIBRARY_PHOTO_PAGE_VIEW_FILTER, LibraryPhotoPageLibraryPhotoPageViewFilterClass))
#define LIBRARY_PHOTO_PAGE_IS_LIBRARY_PHOTO_PAGE_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LIBRARY_PHOTO_PAGE_TYPE_LIBRARY_PHOTO_PAGE_VIEW_FILTER))
#define LIBRARY_PHOTO_PAGE_IS_LIBRARY_PHOTO_PAGE_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LIBRARY_PHOTO_PAGE_TYPE_LIBRARY_PHOTO_PAGE_VIEW_FILTER))
#define LIBRARY_PHOTO_PAGE_LIBRARY_PHOTO_PAGE_VIEW_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LIBRARY_PHOTO_PAGE_TYPE_LIBRARY_PHOTO_PAGE_VIEW_FILTER, LibraryPhotoPageLibraryPhotoPageViewFilterClass))

typedef struct _LibraryPhotoPageLibraryPhotoPageViewFilter LibraryPhotoPageLibraryPhotoPageViewFilter;
typedef struct _LibraryPhotoPageLibraryPhotoPageViewFilterClass LibraryPhotoPageLibraryPhotoPageViewFilterClass;
enum  {
	LIBRARY_PHOTO_PAGE_0_PROPERTY,
	LIBRARY_PHOTO_PAGE_NUM_PROPERTIES
};
static GParamSpec* library_photo_page_properties[LIBRARY_PHOTO_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _view_filter_unref0(var) ((var == NULL) ? NULL : (var = (view_filter_unref (var), NULL)))
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _command_manager_unref0(var) ((var == NULL) ? NULL : (var = (command_manager_unref (var), NULL)))

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

typedef struct _SlideshowPage SlideshowPage;
typedef struct _SlideshowPageClass SlideshowPageClass;
typedef struct _Block18Data Block18Data;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
#define _print_manager_unref0(var) ((var == NULL) ? NULL : (var = (print_manager_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _alteration_unref0(var) ((var == NULL) ? NULL : (var = (alteration_unref (var), NULL)))
typedef struct _LibraryPhotoPageLibraryPhotoPageViewFilterPrivate LibraryPhotoPageLibraryPhotoPageViewFilterPrivate;
#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 _LibraryPhotoPagePrivate {
	CollectionPage* return_page;
	gboolean return_to_collection_on_release;
	LibraryPhotoPageLibraryPhotoPageViewFilter* filter;
	GtkMenu* contractor_menu;
	GtkMenu* item_context_menu;
};

struct _Block18Data {
	int _ref_count_;
	LibraryPhotoPage* self;
	GtkAction* revert_action;
	GtkAction* copy_color_action;
	GtkAction* paste_color_action;
	GtkAction* flag_action;
	GtkAction* raw_developer_app_action;
	GtkAction* raw_developer_camera_action;
	GtkAction* adjust_datetime_action;
	GtkAction* copy_image_action;
	GtkAction* copy_metadata_action;
	GtkAction* jump_event_action;
	GtkAction* print_action;
	GtkAction* export_action;
	GtkAction* remove_action;
	GtkAction* trash_action;
};

struct _LibraryPhotoPageLibraryPhotoPageViewFilter {
	ViewFilter parent_instance;
	LibraryPhotoPageLibraryPhotoPageViewFilterPrivate * priv;
};

struct _LibraryPhotoPageLibraryPhotoPageViewFilterClass {
	ViewFilterClass parent_class;
};

static gint LibraryPhotoPage_private_offset;
static gpointer library_photo_page_parent_class = NULL;
static gpointer library_photo_page_library_photo_page_view_filter_parent_class = NULL;

static GType library_photo_page_library_photo_page_view_filter_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static void library_photo_page_on_photo_destroyed (LibraryPhotoPage* self,
                                            DataSource* source);
static void _library_photo_page_on_photo_destroyed_source_collection_item_destroyed (SourceCollection* _sender,
                                                                              DataSource* source,
                                                                              gpointer self);
static void library_photo_page_on_metadata_altered (LibraryPhotoPage* self,
                                             GeeMap* map);
static void _library_photo_page_on_metadata_altered_data_collection_items_altered (DataCollection* _sender,
                                                                            GeeMap* items,
                                                                            gpointer self);
static LibraryPhotoPageLibraryPhotoPageViewFilter* library_photo_page_library_photo_page_view_filter_new (void);
static LibraryPhotoPageLibraryPhotoPageViewFilter* library_photo_page_library_photo_page_view_filter_construct (GType object_type);
static void library_photo_page_on_photos_altered (LibraryPhotoPage* self);
static void _library_photo_page_on_photos_altered_data_collection_items_altered (DataCollection* _sender,
                                                                          GeeMap* items,
                                                                          gpointer self);
static void library_photo_page_on_photo_unlinking (LibraryPhotoPage* self,
                                            GeeCollection* unlinking);
static void _library_photo_page_on_photo_unlinking_source_collection_items_unlinking (SourceCollection* _sender,
                                                                               GeeCollection* unlinking,
                                                                               gpointer self);
static void library_photo_page_on_photo_relinked (LibraryPhotoPage* self,
                                           GeeCollection* relinked);
static void _library_photo_page_on_photo_relinked_source_collection_items_relinked (SourceCollection* _sender,
                                                                             GeeCollection* relinked,
                                                                             gpointer self);
static void library_photo_page_real_add_toolbar_widgets (Page* base,
                                                  GtkActionBar* toolbar);
static void library_photo_page_on_slideshow (LibraryPhotoPage* self);
static void _library_photo_page_on_slideshow_gtk_button_clicked (GtkButton* _sender,
                                                          gpointer self);
static GtkBox* library_photo_page_real_get_header_buttons (Page* base);
static void library_photo_page_return_to_collection (LibraryPhotoPage* self);
static void _library_photo_page_return_to_collection_gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self);
static GtkActionEntry* library_photo_page_real_init_collect_action_entries (Page* base,
                                                                     gint* result_length1);
static void library_photo_page_on_export (LibraryPhotoPage* self);
static void _library_photo_page_on_export_gcallback (GtkAction* action,
                                              gpointer self);
static void library_photo_page_on_print (LibraryPhotoPage* self);
static void _library_photo_page_on_print_gcallback (GtkAction* action,
                                             gpointer self);
static void library_photo_page_on_remove_from_library (LibraryPhotoPage* self);
static void _library_photo_page_on_remove_from_library_gcallback (GtkAction* action,
                                                           gpointer self);
static void library_photo_page_on_move_to_trash (LibraryPhotoPage* self);
static void _library_photo_page_on_move_to_trash_gcallback (GtkAction* action,
                                                     gpointer self);
static void _single_photo_page_on_previous_photo_gcallback (GtkAction* action,
                                                     gpointer self);
static void _single_photo_page_on_next_photo_gcallback (GtkAction* action,
                                                 gpointer self);
static void _editing_host_page_on_rotate_clockwise_gcallback (GtkAction* action,
                                                       gpointer self);
static void _editing_host_page_on_rotate_counterclockwise_gcallback (GtkAction* action,
                                                              gpointer self);
static void _editing_host_page_on_flip_horizontally_gcallback (GtkAction* action,
                                                        gpointer self);
static void _editing_host_page_on_flip_vertically_gcallback (GtkAction* action,
                                                      gpointer self);
static void _editing_host_page_on_enhance_gcallback (GtkAction* action,
                                              gpointer self);
static void _editing_host_page_on_copy_adjustments_gcallback (GtkAction* action,
                                                       gpointer self);
static void _editing_host_page_on_paste_adjustments_gcallback (GtkAction* action,
                                                        gpointer self);
static void _editing_host_page_toggle_crop_gcallback (GtkAction* action,
                                               gpointer self);
static void _editing_host_page_toggle_straighten_gcallback (GtkAction* action,
                                                     gpointer self);
static void _editing_host_page_toggle_redeye_gcallback (GtkAction* action,
                                                 gpointer self);
static void _editing_host_page_toggle_adjust_gcallback (GtkAction* action,
                                                 gpointer self);
static void _editing_host_page_on_revert_gcallback (GtkAction* action,
                                             gpointer self);
static void _editing_host_page_on_adjust_date_time_gcallback (GtkAction* action,
                                                       gpointer self);
static void library_photo_page_on_flag_unflag (LibraryPhotoPage* self);
static void _library_photo_page_on_flag_unflag_gcallback (GtkAction* action,
                                                   gpointer self);
static void _editing_host_page_on_increase_size_gcallback (GtkAction* action,
                                                    gpointer self);
static void _editing_host_page_on_decrease_size_gcallback (GtkAction* action,
                                                    gpointer self);
static void _editing_host_page_snap_zoom_to_min_gcallback (GtkAction* action,
                                                    gpointer self);
static void _editing_host_page_snap_zoom_to_isomorphic_gcallback (GtkAction* action,
                                                           gpointer self);
static void _editing_host_page_snap_zoom_to_max_gcallback (GtkAction* action,
                                                    gpointer self);
static void _library_photo_page_on_slideshow_gcallback (GtkAction* action,
                                                 gpointer self);
static void _editing_host_page_on_copy_image_gcallback (GtkAction* action,
                                                 gpointer self);
static void _editing_host_page_on_copy_metadata_gcallback (GtkAction* action,
                                                    gpointer self);
static void _vala_array_add157 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add158 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add159 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add160 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add161 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add162 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add163 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add164 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add165 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add166 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add167 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add168 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add169 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add170 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add171 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add172 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add173 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add174 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add175 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add176 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add177 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add178 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add179 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add180 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add181 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add182 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add183 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add184 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add185 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add186 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _vala_array_add187 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static GtkToggleActionEntry* library_photo_page_real_init_collect_toggle_action_entries (Page* base,
                                                                                  gint* result_length1);
static void library_photo_page_real_register_radio_actions (Page* base,
                                                     GtkActionGroup* action_group);
static void _vala_array_add188 (GtkRadioActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkRadioActionEntry* value);
static void _vala_array_add189 (GtkRadioActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkRadioActionEntry* value);
static void library_photo_page_on_raw_developer_changed (LibraryPhotoPage* self,
                                                  GtkAction* action,
                                                  GtkAction* current);
static void _library_photo_page_on_raw_developer_changed_gcallback (GtkAction* action,
                                                             GtkAction* current,
                                                             gpointer self);
static void library_photo_page_real_update_actions (Page* base,
                                             gint selected_count,
                                             gint count);
static void library_photo_page_update_development_menu_item_sensitivity (LibraryPhotoPage* self);
static void library_photo_page_update_flag_action (LibraryPhotoPage* self);
static void library_photo_page_real_developer_changed (LibraryPhotoPage* self,
                                                RawDeveloper rd);
static void _library_photo_page_on_page_destroyed_gtk_widget_destroy (GtkWidget* _sender,
                                                               gpointer self);
static void library_photo_page_real_switched_to (Page* base);
static void library_photo_page_update_zoom_menu_item_sensitivity (LibraryPhotoPage* self);
static GdkPixbuf* library_photo_page_real_get_bottom_left_trinket (EditingHostPage* base,
                                                            gint scale);
static GdkPixbuf* library_photo_page_real_get_top_right_trinket (EditingHostPage* base,
                                                          gint scale);
VALA_EXTERN SlideshowPage* slideshow_page_new (SourceCollection* sources,
                                   ViewCollection* controller,
                                   Photo* start);
VALA_EXTERN SlideshowPage* slideshow_page_construct (GType object_type,
                                         SourceCollection* sources,
                                         ViewCollection* controller,
                                         Photo* start);
VALA_EXTERN GType slideshow_page_get_type (void) G_GNUC_CONST ;
static void library_photo_page_real_on_increase_size (EditingHostPage* base);
static void library_photo_page_real_on_decrease_size (EditingHostPage* base);
static gboolean library_photo_page_real_on_zoom_assembly_key_press (EditingHostPage* base,
                                                             GdkEventKey* event);
static void library_photo_page_real_update_ui (EditingHostPage* base,
                                        gboolean missing);
static void library_photo_page_real_notify_photo_backing_missing (EditingHostPage* base,
                                                           Photo* photo,
                                                           gboolean missing);
static gboolean library_photo_page_real_key_press_event (GtkWidget* base,
                                                  GdkEventKey* event);
static gboolean library_photo_page_real_on_double_click (EditingHostPage* base,
                                                  GdkEventButton* event);
static gboolean library_photo_page_real_on_left_released (Page* base,
                                                   GdkEventButton* event);
static GtkMenu* library_photo_page_get_context_menu (LibraryPhotoPage* self);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
static void ___lambda65_ (Block18Data* _data18_);
static void ____lambda65__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda66_ (Block18Data* _data18_);
static void ____lambda66__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda67_ (Block18Data* _data18_);
static void ____lambda67__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda68_ (Block18Data* _data18_);
static void ____lambda68__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda69_ (Block18Data* _data18_);
static void ____lambda69__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda70_ (Block18Data* _data18_);
static void ____lambda70__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda71_ (Block18Data* _data18_);
static void ____lambda71__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda72_ (Block18Data* _data18_);
static void ____lambda72__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda73_ (Block18Data* _data18_);
static void ____lambda73__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda74_ (Block18Data* _data18_);
static void ____lambda74__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda75_ (Block18Data* _data18_);
static void ____lambda75__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda76_ (Block18Data* _data18_);
static void ____lambda76__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda77_ (Block18Data* _data18_);
static void ____lambda77__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static void ___lambda78_ (Block18Data* _data18_);
static void ____lambda78__gtk_menu_item_activate (GtkMenuItem* _sender,
                                           gpointer self);
static gboolean library_photo_page_real_on_context_buttonpress (Page* base,
                                                         GdkEventButton* event);
static gboolean library_photo_page_real_on_context_keypress (Page* base);
static void library_photo_page_on_photo_removed (LibraryPhotoPage* self,
                                          LibraryPhoto* photo);
static gboolean library_photo_page_library_photo_page_view_filter_real_predicate (ViewFilter* base,
                                                                           DataView* view);
static GType library_photo_page_library_photo_page_view_filter_get_type_once (void);
static void library_photo_page_finalize (GObject * obj);
static GType library_photo_page_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
library_photo_page_get_instance_private (LibraryPhotoPage* self)
{
	return G_STRUCT_MEMBER_P (self, LibraryPhotoPage_private_offset);
}

static void
_library_photo_page_on_photo_destroyed_source_collection_item_destroyed (SourceCollection* _sender,
                                                                         DataSource* source,
                                                                         gpointer self)
{
	library_photo_page_on_photo_destroyed ((LibraryPhotoPage*) self, source);
}

static void
_library_photo_page_on_metadata_altered_data_collection_items_altered (DataCollection* _sender,
                                                                       GeeMap* items,
                                                                       gpointer self)
{
	library_photo_page_on_metadata_altered ((LibraryPhotoPage*) self, items);
}

static void
_library_photo_page_on_photos_altered_data_collection_items_altered (DataCollection* _sender,
                                                                     GeeMap* items,
                                                                     gpointer self)
{
	library_photo_page_on_photos_altered ((LibraryPhotoPage*) self);
}

static void
_library_photo_page_on_photo_unlinking_source_collection_items_unlinking (SourceCollection* _sender,
                                                                          GeeCollection* unlinking,
                                                                          gpointer self)
{
	library_photo_page_on_photo_unlinking ((LibraryPhotoPage*) self, unlinking);
}

static void
_library_photo_page_on_photo_relinked_source_collection_items_relinked (SourceCollection* _sender,
                                                                        GeeCollection* relinked,
                                                                        gpointer self)
{
	library_photo_page_on_photo_relinked ((LibraryPhotoPage*) self, relinked);
}

LibraryPhotoPage*
library_photo_page_construct (GType object_type)
{
	LibraryPhotoPage * self = NULL;
	LibraryPhotoSourceCollection* _tmp0_;
	ViewCollection* _tmp1_;
	ViewCollection* _tmp2_;
	LibraryPhotoSourceCollection* _tmp3_;
	LibraryPhotoSourceCollection* _tmp4_;
	ViewCollection* _tmp5_;
	ViewCollection* _tmp6_;
	LibraryPhotoPageLibraryPhotoPageViewFilter* _tmp7_;
	LibraryPhotoSourceCollection* _tmp8_;
	LibraryPhotoSourceCollection* _tmp9_;
	_tmp0_ = library_photo_global;
	self = (LibraryPhotoPage*) editing_host_page_construct (object_type, (SourceCollection*) _tmp0_, "Photo");
	_tmp1_ = page_get_view ((Page*) self);
	_tmp2_ = _tmp1_;
	g_signal_connect_object ((DataCollection*) _tmp2_, "items-altered", (GCallback) _library_photo_page_on_photos_altered_data_collection_items_altered, self, 0);
	_data_collection_unref0 (_tmp2_);
	_tmp3_ = library_photo_global;
	g_signal_connect_object ((SourceCollection*) _tmp3_, "item-destroyed", (GCallback) _library_photo_page_on_photo_destroyed_source_collection_item_destroyed, self, 0);
	_tmp4_ = library_photo_global;
	g_signal_connect_object ((DataCollection*) _tmp4_, "items-altered", (GCallback) _library_photo_page_on_metadata_altered_data_collection_items_altered, self, 0);
	_tmp5_ = page_get_view ((Page*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = self->priv->filter;
	view_collection_install_view_filter (_tmp6_, (ViewFilter*) _tmp7_);
	_data_collection_unref0 (_tmp6_);
	_tmp8_ = library_photo_global;
	g_signal_connect_object ((SourceCollection*) _tmp8_, "items-unlinking", (GCallback) _library_photo_page_on_photo_unlinking_source_collection_items_unlinking, self, 0);
	_tmp9_ = library_photo_global;
	g_signal_connect_object ((SourceCollection*) _tmp9_, "items-relinked", (GCallback) _library_photo_page_on_photo_relinked_source_collection_items_relinked, self, 0);
	return self;
}

LibraryPhotoPage*
library_photo_page_new (void)
{
	return library_photo_page_construct (TYPE_LIBRARY_PHOTO_PAGE);
}

static void
_library_photo_page_on_slideshow_gtk_button_clicked (GtkButton* _sender,
                                                     gpointer self)
{
	library_photo_page_on_slideshow ((LibraryPhotoPage*) self);
}

static void
library_photo_page_real_add_toolbar_widgets (Page* base,
                                             GtkActionBar* toolbar)
{
	LibraryPhotoPage * self;
	GtkButton* slideshow_button = NULL;
	GtkButton* _tmp0_;
	self = (LibraryPhotoPage*) base;
	g_return_if_fail (toolbar != NULL);
	_tmp0_ = (GtkButton*) gtk_button_new_from_icon_name ("media-playback-start-symbolic", (GtkIconSize) GTK_ICON_SIZE_LARGE_TOOLBAR);
	g_object_ref_sink (_tmp0_);
	slideshow_button = _tmp0_;
	gtk_widget_set_tooltip_text ((GtkWidget*) slideshow_button, _ ("Play a slideshow"));
	g_signal_connect_object (slideshow_button, "clicked", (GCallback) _library_photo_page_on_slideshow_gtk_button_clicked, self, 0);
	gtk_action_bar_pack_start (toolbar, (GtkWidget*) slideshow_button);
	PAGE_CLASS (library_photo_page_parent_class)->add_toolbar_widgets ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), toolbar);
	_g_object_unref0 (slideshow_button);
}

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

static void
_library_photo_page_return_to_collection_gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self)
{
	library_photo_page_return_to_collection ((LibraryPhotoPage*) self);
}

static GtkBox*
library_photo_page_real_get_header_buttons (Page* base)
{
	LibraryPhotoPage * self;
	GtkBox* _tmp0_;
	LibraryWindow* app = NULL;
	AppWindow* _tmp1_;
	LibraryWindow* _tmp2_;
	LibraryWindow* _tmp3_;
	CollectionPage* _tmp6_;
	GtkBox* _tmp21_;
	GtkBox* _tmp22_;
	GtkBox* result;
	self = (LibraryPhotoPage*) base;
	_tmp0_ = PAGE_CLASS (library_photo_page_parent_class)->get_header_buttons ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage));
	_g_object_unref0 (((Page*) self)->header_box);
	((Page*) self)->header_box = _tmp0_;
	_tmp1_ = app_window_get_instance ();
	_tmp2_ = IS_LIBRARY_WINDOW (_tmp1_) ? ((LibraryWindow*) _tmp1_) : NULL;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (_tmp1_);
	}
	app = _tmp2_;
	_tmp3_ = app;
	if (_tmp3_ == NULL) {
		GtkBox* _tmp4_;
		GtkBox* _tmp5_;
		_tmp4_ = ((Page*) self)->header_box;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		result = _tmp5_;
		_g_object_unref0 (app);
		return result;
	}
	_tmp6_ = self->priv->return_page;
	if (_tmp6_ != NULL) {
		gchar* last_name = NULL;
		CollectionPage* _tmp7_;
		gchar* _tmp8_;
		GtkButton* back_button = NULL;
		GtkButton* _tmp9_;
		GtkButton* _tmp10_;
		GtkButton* _tmp11_;
		GtkStyleContext* _tmp12_;
		GtkButton* _tmp13_;
		GtkButton* _tmp14_;
		GtkButton* _tmp15_;
		GtkButton* _tmp16_;
		GtkButton* _tmp17_;
		const gchar* _tmp18_;
		GtkBox* _tmp19_;
		GtkButton* _tmp20_;
		_tmp7_ = self->priv->return_page;
		_tmp8_ = checkerboard_page_get_back_name ((CheckerboardPage*) _tmp7_);
		last_name = _tmp8_;
		_tmp9_ = (GtkButton*) gtk_button_new ();
		g_object_ref_sink (_tmp9_);
		back_button = _tmp9_;
		_tmp10_ = back_button;
		g_signal_connect_object (_tmp10_, "clicked", (GCallback) _library_photo_page_return_to_collection_gtk_button_clicked, self, 0);
		_tmp11_ = back_button;
		_tmp12_ = gtk_widget_get_style_context ((GtkWidget*) _tmp11_);
		gtk_style_context_add_class (_tmp12_, "back-button");
		_tmp13_ = back_button;
		gtk_widget_set_can_focus ((GtkWidget*) _tmp13_, FALSE);
		_tmp14_ = back_button;
		gtk_widget_set_valign ((GtkWidget*) _tmp14_, GTK_ALIGN_CENTER);
		_tmp15_ = back_button;
		gtk_widget_set_vexpand ((GtkWidget*) _tmp15_, FALSE);
		_tmp16_ = back_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp16_, FALSE);
		_tmp17_ = back_button;
		_tmp18_ = last_name;
		gtk_button_set_label (_tmp17_, _tmp18_);
		_tmp19_ = ((Page*) self)->header_box;
		_tmp20_ = back_button;
		gtk_box_pack_start (_tmp19_, (GtkWidget*) _tmp20_, TRUE, TRUE, (guint) 0);
		_g_object_unref0 (back_button);
		_g_free0 (last_name);
	}
	_tmp21_ = ((Page*) self)->header_box;
	_tmp22_ = _g_object_ref0 (_tmp21_);
	result = _tmp22_;
	_g_object_unref0 (app);
	return result;
}

gboolean
library_photo_page_not_trashed_view_filter (LibraryPhotoPage* self,
                                            DataView* view)
{
	DataSource* _tmp0_;
	DataSource* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (view != NULL, FALSE);
	_tmp0_ = data_view_get_source (view);
	_tmp1_ = _tmp0_;
	result = !media_source_is_trashed (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_MEDIA_SOURCE, MediaSource));
	return result;
}

static void
library_photo_page_on_photo_unlinking (LibraryPhotoPage* self,
                                       GeeCollection* unlinking)
{
	LibraryPhotoPageLibraryPhotoPageViewFilter* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (unlinking != NULL);
	_tmp0_ = self->priv->filter;
	g_signal_emit_by_name ((ViewFilter*) _tmp0_, "refresh");
}

static void
library_photo_page_on_photo_relinked (LibraryPhotoPage* self,
                                      GeeCollection* relinked)
{
	LibraryPhotoPageLibraryPhotoPageViewFilter* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (relinked != NULL);
	_tmp0_ = self->priv->filter;
	g_signal_emit_by_name ((ViewFilter*) _tmp0_, "refresh");
}

static void
_library_photo_page_on_export_gcallback (GtkAction* action,
                                         gpointer self)
{
	library_photo_page_on_export ((LibraryPhotoPage*) self);
}

static void
_library_photo_page_on_print_gcallback (GtkAction* action,
                                        gpointer self)
{
	library_photo_page_on_print ((LibraryPhotoPage*) self);
}

static void
_library_photo_page_on_remove_from_library_gcallback (GtkAction* action,
                                                      gpointer self)
{
	library_photo_page_on_remove_from_library ((LibraryPhotoPage*) self);
}

static void
_library_photo_page_on_move_to_trash_gcallback (GtkAction* action,
                                                gpointer self)
{
	library_photo_page_on_move_to_trash ((LibraryPhotoPage*) self);
}

static void
_single_photo_page_on_previous_photo_gcallback (GtkAction* action,
                                                gpointer self)
{
	single_photo_page_on_previous_photo ((SinglePhotoPage*) self);
}

static void
_single_photo_page_on_next_photo_gcallback (GtkAction* action,
                                            gpointer self)
{
	single_photo_page_on_next_photo ((SinglePhotoPage*) self);
}

static void
_editing_host_page_on_rotate_clockwise_gcallback (GtkAction* action,
                                                  gpointer self)
{
	editing_host_page_on_rotate_clockwise ((EditingHostPage*) self);
}

static void
_editing_host_page_on_rotate_counterclockwise_gcallback (GtkAction* action,
                                                         gpointer self)
{
	editing_host_page_on_rotate_counterclockwise ((EditingHostPage*) self);
}

static void
_editing_host_page_on_flip_horizontally_gcallback (GtkAction* action,
                                                   gpointer self)
{
	editing_host_page_on_flip_horizontally ((EditingHostPage*) self);
}

static void
_editing_host_page_on_flip_vertically_gcallback (GtkAction* action,
                                                 gpointer self)
{
	editing_host_page_on_flip_vertically ((EditingHostPage*) self);
}

static void
_editing_host_page_on_enhance_gcallback (GtkAction* action,
                                         gpointer self)
{
	editing_host_page_on_enhance ((EditingHostPage*) self);
}

static void
_editing_host_page_on_copy_adjustments_gcallback (GtkAction* action,
                                                  gpointer self)
{
	editing_host_page_on_copy_adjustments ((EditingHostPage*) self);
}

static void
_editing_host_page_on_paste_adjustments_gcallback (GtkAction* action,
                                                   gpointer self)
{
	editing_host_page_on_paste_adjustments ((EditingHostPage*) self);
}

static void
_editing_host_page_toggle_crop_gcallback (GtkAction* action,
                                          gpointer self)
{
	editing_host_page_toggle_crop ((EditingHostPage*) self);
}

static void
_editing_host_page_toggle_straighten_gcallback (GtkAction* action,
                                                gpointer self)
{
	editing_host_page_toggle_straighten ((EditingHostPage*) self);
}

static void
_editing_host_page_toggle_redeye_gcallback (GtkAction* action,
                                            gpointer self)
{
	editing_host_page_toggle_redeye ((EditingHostPage*) self);
}

static void
_editing_host_page_toggle_adjust_gcallback (GtkAction* action,
                                            gpointer self)
{
	editing_host_page_toggle_adjust ((EditingHostPage*) self);
}

static void
_editing_host_page_on_revert_gcallback (GtkAction* action,
                                        gpointer self)
{
	editing_host_page_on_revert ((EditingHostPage*) self);
}

static void
_editing_host_page_on_adjust_date_time_gcallback (GtkAction* action,
                                                  gpointer self)
{
	editing_host_page_on_adjust_date_time ((EditingHostPage*) self);
}

static void
_library_photo_page_on_flag_unflag_gcallback (GtkAction* action,
                                              gpointer self)
{
	library_photo_page_on_flag_unflag ((LibraryPhotoPage*) self);
}

static void
_editing_host_page_on_increase_size_gcallback (GtkAction* action,
                                               gpointer self)
{
	editing_host_page_on_increase_size ((EditingHostPage*) self);
}

static void
_editing_host_page_on_decrease_size_gcallback (GtkAction* action,
                                               gpointer self)
{
	editing_host_page_on_decrease_size ((EditingHostPage*) self);
}

static void
_editing_host_page_snap_zoom_to_min_gcallback (GtkAction* action,
                                               gpointer self)
{
	editing_host_page_snap_zoom_to_min ((EditingHostPage*) self);
}

static void
_editing_host_page_snap_zoom_to_isomorphic_gcallback (GtkAction* action,
                                                      gpointer self)
{
	editing_host_page_snap_zoom_to_isomorphic ((EditingHostPage*) self);
}

static void
_editing_host_page_snap_zoom_to_max_gcallback (GtkAction* action,
                                               gpointer self)
{
	editing_host_page_snap_zoom_to_max ((EditingHostPage*) self);
}

static void
_library_photo_page_on_slideshow_gcallback (GtkAction* action,
                                            gpointer self)
{
	library_photo_page_on_slideshow ((LibraryPhotoPage*) self);
}

static void
_editing_host_page_on_copy_image_gcallback (GtkAction* action,
                                            gpointer self)
{
	editing_host_page_on_copy_image ((EditingHostPage*) self);
}

static void
_editing_host_page_on_copy_metadata_gcallback (GtkAction* action,
                                               gpointer self)
{
	editing_host_page_on_copy_metadata ((EditingHostPage*) self);
}

static void
_vala_array_add157 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add158 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add159 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add160 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add161 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add162 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add163 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add164 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add165 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add166 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add167 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add168 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add169 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add170 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add171 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add172 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add173 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add174 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add175 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add176 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add177 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add178 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add179 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add180 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add181 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add182 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add183 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add184 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add185 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add186 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add187 (GtkActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static GtkActionEntry*
library_photo_page_real_init_collect_action_entries (Page* base,
                                                     gint* result_length1)
{
	LibraryPhotoPage * self;
	GtkActionEntry export = {0};
	GtkActionEntry _tmp0_ = {0};
	GtkActionEntry print = {0};
	GtkActionEntry _tmp1_ = {0};
	GtkActionEntry remove_from_library = {0};
	GtkActionEntry _tmp2_ = {0};
	GtkActionEntry move_to_trash = {0};
	GtkActionEntry _tmp3_ = {0};
	GtkActionEntry prev = {0};
	GtkActionEntry _tmp4_ = {0};
	GtkActionEntry next = {0};
	GtkActionEntry _tmp5_ = {0};
	GtkActionEntry rotate_right = {0};
	GtkActionEntry _tmp6_ = {0};
	GtkActionEntry rotate_left = {0};
	GtkActionEntry _tmp7_ = {0};
	GtkActionEntry hflip = {0};
	GtkActionEntry _tmp8_ = {0};
	GtkActionEntry vflip = {0};
	GtkActionEntry _tmp9_ = {0};
	GtkActionEntry enhance = {0};
	GtkActionEntry _tmp10_ = {0};
	GtkActionEntry copy_adjustments = {0};
	GtkActionEntry _tmp11_ = {0};
	GtkActionEntry paste_adjustments = {0};
	GtkActionEntry _tmp12_ = {0};
	GtkActionEntry crop = {0};
	GtkActionEntry _tmp13_ = {0};
	GtkActionEntry straighten = {0};
	GtkActionEntry _tmp14_ = {0};
	GtkActionEntry red_eye = {0};
	GtkActionEntry _tmp15_ = {0};
	GtkActionEntry adjust = {0};
	GtkActionEntry _tmp16_ = {0};
	GtkActionEntry revert = {0};
	GtkActionEntry _tmp17_ = {0};
	GtkActionEntry adjust_date_time = {0};
	GtkActionEntry _tmp18_ = {0};
	GtkActionEntry flag = {0};
	GtkActionEntry _tmp19_ = {0};
	GtkActionEntry increase_size = {0};
	GtkActionEntry _tmp20_ = {0};
	GtkActionEntry decrease_size = {0};
	GtkActionEntry _tmp21_ = {0};
	GtkActionEntry best_fit = {0};
	GtkActionEntry _tmp22_ = {0};
	GtkActionEntry actual_size = {0};
	GtkActionEntry _tmp23_ = {0};
	GtkActionEntry max_size = {0};
	GtkActionEntry _tmp24_ = {0};
	GtkActionEntry slideshow = {0};
	GtkActionEntry _tmp25_ = {0};
	GtkActionEntry raw_developer = {0};
	GtkActionEntry _tmp26_ = {0};
	GtkActionEntry open_with = {0};
	GtkActionEntry _tmp27_ = {0};
	GtkActionEntry open_with_raw = {0};
	GtkActionEntry _tmp28_ = {0};
	GtkActionEntry copy_image = {0};
	GtkActionEntry _tmp29_ = {0};
	GtkActionEntry copy_metadata = {0};
	GtkActionEntry _tmp30_ = {0};
	GtkActionEntry* actions = NULL;
	gint _tmp31_ = 0;
	GtkActionEntry* _tmp32_;
	gint actions_length1;
	gint _actions_size_;
	GtkActionEntry _tmp33_;
	GtkActionEntry _tmp34_;
	GtkActionEntry _tmp35_;
	GtkActionEntry _tmp36_;
	GtkActionEntry _tmp37_;
	GtkActionEntry _tmp38_;
	GtkActionEntry _tmp39_;
	GtkActionEntry _tmp40_;
	GtkActionEntry _tmp41_;
	GtkActionEntry _tmp42_;
	GtkActionEntry _tmp43_;
	GtkActionEntry _tmp44_;
	GtkActionEntry _tmp45_;
	GtkActionEntry _tmp46_;
	GtkActionEntry _tmp47_;
	GtkActionEntry _tmp48_;
	GtkActionEntry _tmp49_;
	GtkActionEntry _tmp50_;
	GtkActionEntry _tmp51_;
	GtkActionEntry _tmp52_;
	GtkActionEntry _tmp53_;
	GtkActionEntry _tmp54_;
	GtkActionEntry _tmp55_;
	GtkActionEntry _tmp56_;
	GtkActionEntry _tmp57_;
	GtkActionEntry _tmp58_;
	GtkActionEntry _tmp59_;
	GtkActionEntry _tmp60_;
	GtkActionEntry _tmp61_;
	GtkActionEntry _tmp62_;
	GtkActionEntry _tmp63_;
	GtkActionEntry* _tmp64_;
	gint _tmp64__length1;
	GtkActionEntry* result;
	self = (LibraryPhotoPage*) base;
	_tmp0_.name = "Export";
	_tmp0_.stock_id = NULL;
	_tmp0_.label = NULL;
	_tmp0_.accelerator = "<Ctrl><Shift>E";
	_tmp0_.tooltip = NULL;
	_tmp0_.callback = (GCallback) _library_photo_page_on_export_gcallback;
	export = _tmp0_;
	_tmp1_.name = "Print";
	_tmp1_.stock_id = NULL;
	_tmp1_.label = NULL;
	_tmp1_.accelerator = "<Ctrl>P";
	_tmp1_.tooltip = NULL;
	_tmp1_.callback = (GCallback) _library_photo_page_on_print_gcallback;
	print = _tmp1_;
	_tmp2_.name = "RemoveFromLibrary";
	_tmp2_.stock_id = NULL;
	_tmp2_.label = NULL;
	_tmp2_.accelerator = "<Shift>Delete";
	_tmp2_.tooltip = NULL;
	_tmp2_.callback = (GCallback) _library_photo_page_on_remove_from_library_gcallback;
	remove_from_library = _tmp2_;
	_tmp3_.name = "MoveToTrash";
	_tmp3_.stock_id = NULL;
	_tmp3_.label = NULL;
	_tmp3_.accelerator = "Delete";
	_tmp3_.tooltip = NULL;
	_tmp3_.callback = (GCallback) _library_photo_page_on_move_to_trash_gcallback;
	move_to_trash = _tmp3_;
	_tmp4_.name = "PrevPhoto";
	_tmp4_.stock_id = NULL;
	_tmp4_.label = NULL;
	_tmp4_.accelerator = NULL;
	_tmp4_.tooltip = NULL;
	_tmp4_.callback = (GCallback) _single_photo_page_on_previous_photo_gcallback;
	prev = _tmp4_;
	_tmp5_.name = "NextPhoto";
	_tmp5_.stock_id = NULL;
	_tmp5_.label = NULL;
	_tmp5_.accelerator = NULL;
	_tmp5_.tooltip = NULL;
	_tmp5_.callback = (GCallback) _single_photo_page_on_next_photo_gcallback;
	next = _tmp5_;
	_tmp6_.name = "RotateClockwise";
	_tmp6_.stock_id = NULL;
	_tmp6_.label = NULL;
	_tmp6_.accelerator = "<Ctrl>R";
	_tmp6_.tooltip = NULL;
	_tmp6_.callback = (GCallback) _editing_host_page_on_rotate_clockwise_gcallback;
	rotate_right = _tmp6_;
	_tmp7_.name = "RotateCounterclockwise";
	_tmp7_.stock_id = NULL;
	_tmp7_.label = NULL;
	_tmp7_.accelerator = "<Ctrl><Shift>R";
	_tmp7_.tooltip = NULL;
	_tmp7_.callback = (GCallback) _editing_host_page_on_rotate_counterclockwise_gcallback;
	rotate_left = _tmp7_;
	_tmp8_.name = "FlipHorizontally";
	_tmp8_.stock_id = NULL;
	_tmp8_.label = NULL;
	_tmp8_.accelerator = NULL;
	_tmp8_.tooltip = NULL;
	_tmp8_.callback = (GCallback) _editing_host_page_on_flip_horizontally_gcallback;
	hflip = _tmp8_;
	_tmp9_.name = "FlipVertically";
	_tmp9_.stock_id = NULL;
	_tmp9_.label = NULL;
	_tmp9_.accelerator = NULL;
	_tmp9_.tooltip = NULL;
	_tmp9_.callback = (GCallback) _editing_host_page_on_flip_vertically_gcallback;
	vflip = _tmp9_;
	_tmp10_.name = "Enhance";
	_tmp10_.stock_id = NULL;
	_tmp10_.label = NULL;
	_tmp10_.accelerator = "<Ctrl>E";
	_tmp10_.tooltip = NULL;
	_tmp10_.callback = (GCallback) _editing_host_page_on_enhance_gcallback;
	enhance = _tmp10_;
	_tmp11_.name = "CopyColorAdjustments";
	_tmp11_.stock_id = NULL;
	_tmp11_.label = NULL;
	_tmp11_.accelerator = "<Ctrl><Shift>C";
	_tmp11_.tooltip = NULL;
	_tmp11_.callback = (GCallback) _editing_host_page_on_copy_adjustments_gcallback;
	copy_adjustments = _tmp11_;
	_tmp12_.name = "PasteColorAdjustments";
	_tmp12_.stock_id = NULL;
	_tmp12_.label = NULL;
	_tmp12_.accelerator = "<Ctrl><Shift>V";
	_tmp12_.tooltip = NULL;
	_tmp12_.callback = (GCallback) _editing_host_page_on_paste_adjustments_gcallback;
	paste_adjustments = _tmp12_;
	_tmp13_.name = "Crop";
	_tmp13_.stock_id = NULL;
	_tmp13_.label = NULL;
	_tmp13_.accelerator = "<Ctrl>O";
	_tmp13_.tooltip = NULL;
	_tmp13_.callback = (GCallback) _editing_host_page_toggle_crop_gcallback;
	crop = _tmp13_;
	_tmp14_.name = "Straighten";
	_tmp14_.stock_id = NULL;
	_tmp14_.label = NULL;
	_tmp14_.accelerator = "<Ctrl>A";
	_tmp14_.tooltip = NULL;
	_tmp14_.callback = (GCallback) _editing_host_page_toggle_straighten_gcallback;
	straighten = _tmp14_;
	_tmp15_.name = "RedEye";
	_tmp15_.stock_id = NULL;
	_tmp15_.label = NULL;
	_tmp15_.accelerator = "<Ctrl>Y";
	_tmp15_.tooltip = NULL;
	_tmp15_.callback = (GCallback) _editing_host_page_toggle_redeye_gcallback;
	red_eye = _tmp15_;
	_tmp16_.name = "Adjust";
	_tmp16_.stock_id = NULL;
	_tmp16_.label = NULL;
	_tmp16_.accelerator = "<Ctrl>D";
	_tmp16_.tooltip = NULL;
	_tmp16_.callback = (GCallback) _editing_host_page_toggle_adjust_gcallback;
	adjust = _tmp16_;
	_tmp17_.name = "Revert";
	_tmp17_.stock_id = NULL;
	_tmp17_.label = NULL;
	_tmp17_.accelerator = NULL;
	_tmp17_.tooltip = NULL;
	_tmp17_.callback = (GCallback) _editing_host_page_on_revert_gcallback;
	revert = _tmp17_;
	_tmp18_.name = "AdjustDateTime";
	_tmp18_.stock_id = NULL;
	_tmp18_.label = NULL;
	_tmp18_.accelerator = NULL;
	_tmp18_.tooltip = NULL;
	_tmp18_.callback = (GCallback) _editing_host_page_on_adjust_date_time_gcallback;
	adjust_date_time = _tmp18_;
	_tmp19_.name = "Flag";
	_tmp19_.stock_id = NULL;
	_tmp19_.label = NULL;
	_tmp19_.accelerator = "<Ctrl>G";
	_tmp19_.tooltip = NULL;
	_tmp19_.callback = (GCallback) _library_photo_page_on_flag_unflag_gcallback;
	flag = _tmp19_;
	_tmp20_.name = "IncreaseSize";
	_tmp20_.stock_id = NULL;
	_tmp20_.label = NULL;
	_tmp20_.accelerator = "<Ctrl>plus";
	_tmp20_.tooltip = NULL;
	_tmp20_.callback = (GCallback) _editing_host_page_on_increase_size_gcallback;
	increase_size = _tmp20_;
	_tmp21_.name = "DecreaseSize";
	_tmp21_.stock_id = NULL;
	_tmp21_.label = NULL;
	_tmp21_.accelerator = "<Ctrl>minus";
	_tmp21_.tooltip = NULL;
	_tmp21_.callback = (GCallback) _editing_host_page_on_decrease_size_gcallback;
	decrease_size = _tmp21_;
	_tmp22_.name = "ZoomFit";
	_tmp22_.stock_id = NULL;
	_tmp22_.label = NULL;
	_tmp22_.accelerator = "<Ctrl>0";
	_tmp22_.tooltip = NULL;
	_tmp22_.callback = (GCallback) _editing_host_page_snap_zoom_to_min_gcallback;
	best_fit = _tmp22_;
	_tmp23_.name = "Zoom100";
	_tmp23_.stock_id = NULL;
	_tmp23_.label = NULL;
	_tmp23_.accelerator = "<Ctrl>1";
	_tmp23_.tooltip = NULL;
	_tmp23_.callback = (GCallback) _editing_host_page_snap_zoom_to_isomorphic_gcallback;
	actual_size = _tmp23_;
	_tmp24_.name = "Zoom200";
	_tmp24_.stock_id = NULL;
	_tmp24_.label = NULL;
	_tmp24_.accelerator = "<Ctrl>2";
	_tmp24_.tooltip = NULL;
	_tmp24_.callback = (GCallback) _editing_host_page_snap_zoom_to_max_gcallback;
	max_size = _tmp24_;
	_tmp25_.name = "Slideshow";
	_tmp25_.stock_id = NULL;
	_tmp25_.label = NULL;
	_tmp25_.accelerator = "F5";
	_tmp25_.tooltip = NULL;
	_tmp25_.callback = (GCallback) _library_photo_page_on_slideshow_gcallback;
	slideshow = _tmp25_;
	_tmp26_.name = "RawDeveloper";
	_tmp26_.stock_id = NULL;
	_tmp26_.label = NULL;
	_tmp26_.accelerator = NULL;
	_tmp26_.tooltip = NULL;
	_tmp26_.callback = (GCallback) NULL;
	raw_developer = _tmp26_;
	_tmp27_.name = "OpenWith";
	_tmp27_.stock_id = NULL;
	_tmp27_.label = NULL;
	_tmp27_.accelerator = NULL;
	_tmp27_.tooltip = NULL;
	_tmp27_.callback = (GCallback) NULL;
	open_with = _tmp27_;
	_tmp28_.name = "OpenWithRaw";
	_tmp28_.stock_id = NULL;
	_tmp28_.label = NULL;
	_tmp28_.accelerator = NULL;
	_tmp28_.tooltip = NULL;
	_tmp28_.callback = (GCallback) NULL;
	open_with_raw = _tmp28_;
	_tmp29_.name = "CopyImage";
	_tmp29_.stock_id = NULL;
	_tmp29_.label = NULL;
	_tmp29_.accelerator = "<Ctrl>C";
	_tmp29_.tooltip = NULL;
	_tmp29_.callback = (GCallback) _editing_host_page_on_copy_image_gcallback;
	copy_image = _tmp29_;
	_tmp30_.name = "CopyMetadata";
	_tmp30_.stock_id = NULL;
	_tmp30_.label = NULL;
	_tmp30_.accelerator = "<Ctrl><Shift>C";
	_tmp30_.tooltip = NULL;
	_tmp30_.callback = (GCallback) _editing_host_page_on_copy_metadata_gcallback;
	copy_metadata = _tmp30_;
	_tmp32_ = PAGE_CLASS (library_photo_page_parent_class)->init_collect_action_entries ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), &_tmp31_);
	actions = _tmp32_;
	actions_length1 = _tmp31_;
	_actions_size_ = actions_length1;
	_tmp33_ = export;
	_vala_array_add157 (&actions, &actions_length1, &_actions_size_, &_tmp33_);
	_tmp34_ = print;
	_vala_array_add158 (&actions, &actions_length1, &_actions_size_, &_tmp34_);
	_tmp35_ = remove_from_library;
	_vala_array_add159 (&actions, &actions_length1, &_actions_size_, &_tmp35_);
	_tmp36_ = move_to_trash;
	_vala_array_add160 (&actions, &actions_length1, &_actions_size_, &_tmp36_);
	_tmp37_ = prev;
	_vala_array_add161 (&actions, &actions_length1, &_actions_size_, &_tmp37_);
	_tmp38_ = next;
	_vala_array_add162 (&actions, &actions_length1, &_actions_size_, &_tmp38_);
	_tmp39_ = rotate_right;
	_vala_array_add163 (&actions, &actions_length1, &_actions_size_, &_tmp39_);
	_tmp40_ = rotate_left;
	_vala_array_add164 (&actions, &actions_length1, &_actions_size_, &_tmp40_);
	_tmp41_ = hflip;
	_vala_array_add165 (&actions, &actions_length1, &_actions_size_, &_tmp41_);
	_tmp42_ = vflip;
	_vala_array_add166 (&actions, &actions_length1, &_actions_size_, &_tmp42_);
	_tmp43_ = enhance;
	_vala_array_add167 (&actions, &actions_length1, &_actions_size_, &_tmp43_);
	_tmp44_ = copy_adjustments;
	_vala_array_add168 (&actions, &actions_length1, &_actions_size_, &_tmp44_);
	_tmp45_ = paste_adjustments;
	_vala_array_add169 (&actions, &actions_length1, &_actions_size_, &_tmp45_);
	_tmp46_ = crop;
	_vala_array_add170 (&actions, &actions_length1, &_actions_size_, &_tmp46_);
	_tmp47_ = straighten;
	_vala_array_add171 (&actions, &actions_length1, &_actions_size_, &_tmp47_);
	_tmp48_ = red_eye;
	_vala_array_add172 (&actions, &actions_length1, &_actions_size_, &_tmp48_);
	_tmp49_ = adjust;
	_vala_array_add173 (&actions, &actions_length1, &_actions_size_, &_tmp49_);
	_tmp50_ = revert;
	_vala_array_add174 (&actions, &actions_length1, &_actions_size_, &_tmp50_);
	_tmp51_ = adjust_date_time;
	_vala_array_add175 (&actions, &actions_length1, &_actions_size_, &_tmp51_);
	_tmp52_ = flag;
	_vala_array_add176 (&actions, &actions_length1, &_actions_size_, &_tmp52_);
	_tmp53_ = increase_size;
	_vala_array_add177 (&actions, &actions_length1, &_actions_size_, &_tmp53_);
	_tmp54_ = decrease_size;
	_vala_array_add178 (&actions, &actions_length1, &_actions_size_, &_tmp54_);
	_tmp55_ = best_fit;
	_vala_array_add179 (&actions, &actions_length1, &_actions_size_, &_tmp55_);
	_tmp56_ = actual_size;
	_vala_array_add180 (&actions, &actions_length1, &_actions_size_, &_tmp56_);
	_tmp57_ = max_size;
	_vala_array_add181 (&actions, &actions_length1, &_actions_size_, &_tmp57_);
	_tmp58_ = slideshow;
	_vala_array_add182 (&actions, &actions_length1, &_actions_size_, &_tmp58_);
	_tmp59_ = raw_developer;
	_vala_array_add183 (&actions, &actions_length1, &_actions_size_, &_tmp59_);
	_tmp60_ = open_with;
	_vala_array_add184 (&actions, &actions_length1, &_actions_size_, &_tmp60_);
	_tmp61_ = open_with_raw;
	_vala_array_add185 (&actions, &actions_length1, &_actions_size_, &_tmp61_);
	_tmp62_ = copy_image;
	_vala_array_add186 (&actions, &actions_length1, &_actions_size_, &_tmp62_);
	_tmp63_ = copy_metadata;
	_vala_array_add187 (&actions, &actions_length1, &_actions_size_, &_tmp63_);
	_tmp64_ = actions;
	_tmp64__length1 = actions_length1;
	if (result_length1) {
		*result_length1 = _tmp64__length1;
	}
	result = _tmp64_;
	return result;
}

static GtkToggleActionEntry*
library_photo_page_real_init_collect_toggle_action_entries (Page* base,
                                                            gint* result_length1)
{
	LibraryPhotoPage * self;
	GtkToggleActionEntry* toggle_actions = NULL;
	gint _tmp0_ = 0;
	GtkToggleActionEntry* _tmp1_;
	gint toggle_actions_length1;
	gint _toggle_actions_size_;
	GtkToggleActionEntry* _tmp2_;
	gint _tmp2__length1;
	GtkToggleActionEntry* result;
	self = (LibraryPhotoPage*) base;
	_tmp1_ = PAGE_CLASS (library_photo_page_parent_class)->init_collect_toggle_action_entries ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), &_tmp0_);
	toggle_actions = _tmp1_;
	toggle_actions_length1 = _tmp0_;
	_toggle_actions_size_ = toggle_actions_length1;
	_tmp2_ = toggle_actions;
	_tmp2__length1 = toggle_actions_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static void
_vala_array_add188 (GtkRadioActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkRadioActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkRadioActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_vala_array_add189 (GtkRadioActionEntry* * array,
                    gint* length,
                    gint* size,
                    const GtkRadioActionEntry* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GtkRadioActionEntry, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_library_photo_page_on_raw_developer_changed_gcallback (GtkAction* action,
                                                        GtkAction* current,
                                                        gpointer self)
{
	library_photo_page_on_raw_developer_changed ((LibraryPhotoPage*) self, action, current);
}

static void
library_photo_page_real_register_radio_actions (Page* base,
                                                GtkActionGroup* action_group)
{
	LibraryPhotoPage * self;
	GtkRadioActionEntry* developer_actions = NULL;
	GtkRadioActionEntry* _tmp0_;
	gint developer_actions_length1;
	gint _developer_actions_size_;
	gchar* label_shotwell = NULL;
	gchar* _tmp1_;
	GtkRadioActionEntry dev_shotwell = {0};
	GtkRadioActionEntry _tmp2_ = {0};
	GtkRadioActionEntry _tmp3_;
	gchar* label_camera = NULL;
	gchar* _tmp4_;
	GtkRadioActionEntry dev_camera = {0};
	GtkRadioActionEntry _tmp5_ = {0};
	GtkRadioActionEntry _tmp6_;
	GtkRadioActionEntry* _tmp7_;
	gint _tmp7__length1;
	self = (LibraryPhotoPage*) base;
	g_return_if_fail (action_group != NULL);
	_tmp0_ = g_new0 (GtkRadioActionEntry, 0);
	developer_actions = _tmp0_;
	developer_actions_length1 = 0;
	_developer_actions_size_ = developer_actions_length1;
	_tmp1_ = raw_developer_get_label (RAW_DEVELOPER_SHOTWELL);
	label_shotwell = _tmp1_;
	_tmp2_.name = "RawDeveloperShotwell";
	_tmp2_.stock_id = NULL;
	_tmp2_.label = label_shotwell;
	_tmp2_.accelerator = NULL;
	_tmp2_.tooltip = label_shotwell;
	_tmp2_.value = (gint) RAW_DEVELOPER_SHOTWELL;
	dev_shotwell = _tmp2_;
	_tmp3_ = dev_shotwell;
	_vala_array_add188 (&developer_actions, &developer_actions_length1, &_developer_actions_size_, &_tmp3_);
	_tmp4_ = raw_developer_get_label (RAW_DEVELOPER_CAMERA);
	label_camera = _tmp4_;
	_tmp5_.name = "RawDeveloperCamera";
	_tmp5_.stock_id = NULL;
	_tmp5_.label = label_camera;
	_tmp5_.accelerator = NULL;
	_tmp5_.tooltip = label_camera;
	_tmp5_.value = (gint) RAW_DEVELOPER_CAMERA;
	dev_camera = _tmp5_;
	_tmp6_ = dev_camera;
	_vala_array_add189 (&developer_actions, &developer_actions_length1, &_developer_actions_size_, &_tmp6_);
	_tmp7_ = developer_actions;
	_tmp7__length1 = developer_actions_length1;
	gtk_action_group_add_radio_actions (action_group, _tmp7_, (guint) _tmp7__length1, (gint) RAW_DEVELOPER_SHOTWELL, (GCallback) _library_photo_page_on_raw_developer_changed_gcallback, self);
	PAGE_CLASS (library_photo_page_parent_class)->register_radio_actions ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), action_group);
	_g_free0 (label_camera);
	_g_free0 (label_shotwell);
	developer_actions = (g_free (developer_actions), NULL);
}

static void
library_photo_page_real_update_actions (Page* base,
                                        gint selected_count,
                                        gint count)
{
	LibraryPhotoPage * self;
	gboolean multiple = FALSE;
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean rotate_possible = FALSE;
	gboolean _tmp6_ = FALSE;
	gboolean is_raw = FALSE;
	gboolean _tmp9_ = FALSE;
	gboolean _tmp16_ = FALSE;
	gboolean _tmp17_ = FALSE;
	self = (LibraryPhotoPage*) base;
	_tmp0_ = page_get_view ((Page*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = data_collection_get_count ((DataCollection*) _tmp1_) > 1;
	_data_collection_unref0 (_tmp1_);
	multiple = _tmp2_;
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		Photo* _tmp4_;
		Photo* _tmp5_;
		_tmp4_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp5_ = _tmp4_;
		_tmp3_ = editing_host_page_is_rotate_available ((EditingHostPage*) self, _tmp5_);
		_g_object_unref0 (_tmp5_);
	} else {
		_tmp3_ = FALSE;
	}
	rotate_possible = _tmp3_;
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		Photo* _tmp7_;
		Photo* _tmp8_;
		_tmp7_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp8_ = _tmp7_;
		_tmp6_ = photo_get_master_file_format (_tmp8_) == PHOTO_FILE_FORMAT_RAW;
		_g_object_unref0 (_tmp8_);
	} else {
		_tmp6_ = FALSE;
	}
	is_raw = _tmp6_;
	page_set_action_sensitive ((Page*) self, "OpenWith", editing_host_page_has_photo ((EditingHostPage*) self));
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		gboolean _tmp10_ = FALSE;
		Photo* _tmp11_;
		Photo* _tmp12_;
		gboolean _tmp13_;
		_tmp11_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp12_ = _tmp11_;
		_tmp13_ = photo_has_transformations (_tmp12_);
		_g_object_unref0 (_tmp12_);
		if (_tmp13_) {
			_tmp10_ = TRUE;
		} else {
			Photo* _tmp14_;
			Photo* _tmp15_;
			_tmp14_ = editing_host_page_get_photo ((EditingHostPage*) self);
			_tmp15_ = _tmp14_;
			_tmp10_ = photo_has_editable (_tmp15_);
			_g_object_unref0 (_tmp15_);
		}
		_tmp9_ = _tmp10_;
	} else {
		_tmp9_ = FALSE;
	}
	page_set_action_sensitive ((Page*) self, "Revert", _tmp9_);
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		_tmp16_ = !editing_host_page_get_photo_missing ((EditingHostPage*) self);
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		library_photo_page_update_development_menu_item_sensitivity (self);
	}
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		Photo* _tmp18_;
		Photo* _tmp19_;
		_tmp18_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp19_ = _tmp18_;
		_tmp17_ = photo_has_color_adjustments (_tmp19_);
		_g_object_unref0 (_tmp19_);
	} else {
		_tmp17_ = FALSE;
	}
	page_set_action_sensitive ((Page*) self, "CopyColorAdjustments", _tmp17_);
	page_set_action_sensitive ((Page*) self, "PasteColorAdjustments", pixel_transformation_bundle_has_copied_color_adjustments ());
	page_set_action_sensitive ((Page*) self, "PrevPhoto", multiple);
	page_set_action_sensitive ((Page*) self, "NextPhoto", multiple);
	page_set_action_sensitive ((Page*) self, "RotateClockwise", rotate_possible);
	page_set_action_sensitive ((Page*) self, "RotateCounterclockwise", rotate_possible);
	page_set_action_sensitive ((Page*) self, "FlipHorizontally", rotate_possible);
	page_set_action_sensitive ((Page*) self, "FlipVertically", rotate_possible);
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		Photo* _tmp20_;
		Photo* _tmp21_;
		Scaling _tmp22_ = {0};
		Photo* _tmp23_;
		Photo* _tmp24_;
		Scaling _tmp25_ = {0};
		_tmp20_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp21_ = _tmp20_;
		scaling_for_original (&_tmp22_);
		page_set_action_sensitive ((Page*) self, "Crop", editing_tools_crop_tool_is_available (_tmp21_, &_tmp22_));
		_g_object_unref0 (_tmp21_);
		_tmp23_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp24_ = _tmp23_;
		scaling_for_original (&_tmp25_);
		page_set_action_sensitive ((Page*) self, "RedEye", editing_tools_redeye_tool_is_available (_tmp24_, &_tmp25_));
		_g_object_unref0 (_tmp24_);
	}
	library_photo_page_update_flag_action (self);
	editing_host_page_update_enhance_action ((EditingHostPage*) self);
	page_set_action_visible ((Page*) self, "OpenWithRaw", is_raw);
	PAGE_CLASS (library_photo_page_parent_class)->update_actions ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), selected_count, count);
}

static void
library_photo_page_on_photos_altered (LibraryPhotoPage* self)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		gboolean _tmp1_ = FALSE;
		Photo* _tmp2_;
		Photo* _tmp3_;
		gboolean _tmp4_;
		_tmp2_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = photo_has_transformations (_tmp3_);
		_g_object_unref0 (_tmp3_);
		if (_tmp4_) {
			_tmp1_ = TRUE;
		} else {
			Photo* _tmp5_;
			Photo* _tmp6_;
			_tmp5_ = editing_host_page_get_photo ((EditingHostPage*) self);
			_tmp6_ = _tmp5_;
			_tmp1_ = photo_has_editable (_tmp6_);
			_g_object_unref0 (_tmp6_);
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	page_set_action_sensitive ((Page*) self, "Revert", _tmp0_);
	library_photo_page_update_flag_action (self);
	editing_host_page_update_enhance_action ((EditingHostPage*) self);
}

static void
library_photo_page_on_raw_developer_changed (LibraryPhotoPage* self,
                                             GtkAction* action,
                                             GtkAction* current)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (action != NULL);
	g_return_if_fail (current != NULL);
	library_photo_page_developer_changed (self, (RawDeveloper) gtk_radio_action_get_current_value (G_TYPE_CHECK_INSTANCE_CAST (current, gtk_radio_action_get_type (), GtkRadioAction)));
}

static void
library_photo_page_real_developer_changed (LibraryPhotoPage* self,
                                           RawDeveloper rd)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	Photo* photo = NULL;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	gpointer _tmp7_;
	DataView* _tmp8_;
	DataSource* _tmp9_;
	DataSource* _tmp10_;
	Photo* _tmp11_;
	Photo* _tmp12_;
	gboolean _tmp13_ = FALSE;
	Photo* _tmp14_;
	gboolean _tmp16_ = FALSE;
	Photo* _tmp17_;
	_tmp0_ = page_get_view ((Page*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) != 1;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp3_ = page_get_view ((Page*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = gee_list_get (_tmp6_, 0);
	_tmp8_ = (DataView*) _tmp7_;
	_tmp9_ = data_view_get_source (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = _g_object_ref0 (IS_PHOTO (_tmp10_) ? ((Photo*) _tmp10_) : NULL);
	_tmp12_ = _tmp11_;
	_g_object_unref0 (_tmp8_);
	_g_object_unref0 (_tmp6_);
	_data_collection_unref0 (_tmp4_);
	photo = _tmp12_;
	_tmp14_ = photo;
	if (_tmp14_ == NULL) {
		_tmp13_ = TRUE;
	} else {
		Photo* _tmp15_;
		_tmp15_ = photo;
		_tmp13_ = raw_developer_is_equivalent (rd, photo_get_raw_developer (_tmp15_));
	}
	if (_tmp13_) {
		_g_object_unref0 (photo);
		return;
	}
	_tmp17_ = photo;
	if (!photo_has_transformations (_tmp17_)) {
		_tmp16_ = TRUE;
	} else {
		_tmp16_ = dialogs_confirm_warn_developer_changed (1);
	}
	if (_tmp16_) {
		SetRawDeveloperCommand* command = NULL;
		ViewCollection* _tmp18_;
		ViewCollection* _tmp19_;
		GeeList* _tmp20_;
		GeeList* _tmp21_;
		SetRawDeveloperCommand* _tmp22_;
		SetRawDeveloperCommand* _tmp23_;
		CommandManager* _tmp24_;
		CommandManager* _tmp25_;
		SetRawDeveloperCommand* _tmp26_;
		_tmp18_ = page_get_view ((Page*) self);
		_tmp19_ = _tmp18_;
		_tmp20_ = view_collection_get_selected (_tmp19_);
		_tmp21_ = _tmp20_;
		_tmp22_ = set_raw_developer_command_new ((GeeIterable*) _tmp21_, rd);
		_tmp23_ = _tmp22_;
		_g_object_unref0 (_tmp21_);
		_data_collection_unref0 (_tmp19_);
		command = _tmp23_;
		_tmp24_ = page_get_command_manager ((Page*) self);
		_tmp25_ = _tmp24_;
		_tmp26_ = command;
		command_manager_execute (_tmp25_, (Command*) _tmp26_);
		_command_manager_unref0 (_tmp25_);
		library_photo_page_update_development_menu_item_sensitivity (self);
		_g_object_unref0 (command);
	}
	_g_object_unref0 (photo);
}

void
library_photo_page_developer_changed (LibraryPhotoPage* self,
                                      RawDeveloper rd)
{
	LibraryPhotoPageClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = LIBRARY_PHOTO_PAGE_GET_CLASS (self);
	if (_klass_->developer_changed) {
		_klass_->developer_changed (self, rd);
	}
}

static void
library_photo_page_update_flag_action (LibraryPhotoPage* self)
{
	g_return_if_fail (self != NULL);
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		GtkAction* action = NULL;
		GtkAction* _tmp0_;
		GtkAction* _tmp1_;
		gboolean is_flagged = FALSE;
		Photo* _tmp2_;
		LibraryPhoto* _tmp3_;
		gboolean _tmp4_;
		const gchar* _tmp5_ = NULL;
		GtkAction* _tmp6_;
		GtkAction* _tmp7_;
		_tmp0_ = page_get_action ((Page*) self, "Flag");
		action = _tmp0_;
		_tmp1_ = action;
		_vala_assert (_tmp1_ != NULL, "action != null");
		_tmp2_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
		_tmp4_ = flaggable_is_flagged ((Flaggable*) _tmp3_);
		_g_object_unref0 (_tmp3_);
		is_flagged = _tmp4_;
		if (is_flagged) {
			_tmp5_ = RESOURCES_UNFLAG_MENU;
		} else {
			_tmp5_ = RESOURCES_FLAG_MENU;
		}
		_tmp6_ = action;
		gtk_action_set_label (_tmp6_, _tmp5_);
		_tmp7_ = action;
		gtk_action_set_sensitive (_tmp7_, TRUE);
		_g_object_unref0 (action);
	} else {
		page_set_action_sensitive ((Page*) self, "Flag", FALSE);
	}
}

static void
_library_photo_page_on_page_destroyed_gtk_widget_destroy (GtkWidget* _sender,
                                                          gpointer self)
{
	library_photo_page_on_page_destroyed ((LibraryPhotoPage*) self);
}

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

void
library_photo_page_display_for_collection (LibraryPhotoPage* self,
                                           CollectionPage* return_page,
                                           Photo* photo,
                                           ViewCollection* view)
{
	CollectionPage* _tmp0_;
	ViewCollection* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (return_page != NULL);
	g_return_if_fail (photo != NULL);
	_tmp0_ = _g_object_ref0 (return_page);
	_g_object_unref0 (self->priv->return_page);
	self->priv->return_page = _tmp0_;
	g_signal_connect_object ((GtkWidget*) return_page, "destroy", (GCallback) _library_photo_page_on_page_destroyed_gtk_widget_destroy, self, 0);
	if (view != NULL) {
		ViewCollection* _tmp2_;
		_tmp2_ = _data_collection_ref0 (view);
		_data_collection_unref0 (_tmp1_);
		_tmp1_ = _tmp2_;
	} else {
		ViewCollection* _tmp3_;
		_tmp3_ = page_get_view ((Page*) return_page);
		_data_collection_unref0 (_tmp1_);
		_tmp1_ = _tmp3_;
	}
	editing_host_page_display_copy_of ((EditingHostPage*) self, _tmp1_, photo);
	_data_collection_unref0 (_tmp1_);
}

void
library_photo_page_on_page_destroyed (LibraryPhotoPage* self)
{
	g_return_if_fail (self != NULL);
	_g_object_unref0 (self->priv->return_page);
	self->priv->return_page = NULL;
	editing_host_page_unset_view_collection ((EditingHostPage*) self);
}

CollectionPage*
library_photo_page_get_controller_page (LibraryPhotoPage* self)
{
	CollectionPage* _tmp0_;
	CollectionPage* _tmp1_;
	CollectionPage* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->return_page;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
library_photo_page_real_switched_to (Page* base)
{
	LibraryPhotoPage * self;
	Photo* _tmp0_;
	Photo* _tmp1_;
	self = (LibraryPhotoPage*) base;
	_tmp0_ = editing_host_page_get_photo ((EditingHostPage*) self);
	_tmp1_ = _tmp0_;
	_vala_assert (_tmp1_ != NULL, "get_photo () != null");
	_g_object_unref0 (_tmp1_);
	PAGE_CLASS (library_photo_page_parent_class)->switched_to ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage));
	library_photo_page_update_zoom_menu_item_sensitivity (self);
}

static GdkPixbuf*
library_photo_page_real_get_bottom_left_trinket (EditingHostPage* base,
                                                 gint scale)
{
	LibraryPhotoPage * self;
	GdkPixbuf* result;
	self = (LibraryPhotoPage*) base;
	result = NULL;
	return result;
}

static GdkPixbuf*
library_photo_page_real_get_top_right_trinket (EditingHostPage* base,
                                               gint scale)
{
	LibraryPhotoPage * self;
	gboolean _tmp0_ = FALSE;
	GdkPixbuf* _tmp3_;
	GdkPixbuf* result;
	self = (LibraryPhotoPage*) base;
	if (!editing_host_page_has_photo ((EditingHostPage*) self)) {
		_tmp0_ = TRUE;
	} else {
		Photo* _tmp1_;
		LibraryPhoto* _tmp2_;
		_tmp1_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
		_tmp0_ = !flaggable_is_flagged ((Flaggable*) _tmp2_);
		_g_object_unref0 (_tmp2_);
	}
	if (_tmp0_) {
		result = NULL;
		return result;
	}
	_tmp3_ = resources_get_flag_trinket ();
	result = _tmp3_;
	return result;
}

static void
library_photo_page_on_slideshow (LibraryPhotoPage* self)
{
	LibraryPhoto* photo = NULL;
	Photo* _tmp0_;
	LibraryPhoto* _tmp1_;
	AppWindow* _tmp2_;
	AppWindow* _tmp3_;
	LibraryPhotoSourceCollection* _tmp4_;
	ViewCollection* _tmp5_;
	ViewCollection* _tmp6_;
	LibraryPhoto* _tmp7_;
	SlideshowPage* _tmp8_;
	SlideshowPage* _tmp9_;
	g_return_if_fail (self != NULL);
	_tmp0_ = editing_host_page_get_photo ((EditingHostPage*) self);
	photo = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
	_tmp1_ = photo;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (photo);
		return;
	}
	_tmp2_ = app_window_get_instance ();
	_tmp3_ = _tmp2_;
	_tmp4_ = library_photo_global;
	_tmp5_ = page_get_view ((Page*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = photo;
	_tmp8_ = slideshow_page_new ((SourceCollection*) _tmp4_, _tmp6_, (Photo*) _tmp7_);
	g_object_ref_sink (_tmp8_);
	_tmp9_ = _tmp8_;
	app_window_go_fullscreen (_tmp3_, (Page*) _tmp9_);
	_g_object_unref0 (_tmp9_);
	_data_collection_unref0 (_tmp6_);
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (photo);
}

static void
library_photo_page_update_zoom_menu_item_sensitivity (LibraryPhotoPage* self)
{
	gboolean _tmp0_ = FALSE;
	ZoomState _tmp1_ = {0};
	gboolean _tmp2_ = FALSE;
	ZoomState _tmp3_ = {0};
	g_return_if_fail (self != NULL);
	single_photo_page_get_zoom_state ((SinglePhotoPage*) self, &_tmp1_);
	if (!zoom_state_is_max (&_tmp1_)) {
		_tmp0_ = !editing_host_page_get_photo_missing ((EditingHostPage*) self);
	} else {
		_tmp0_ = FALSE;
	}
	page_set_action_sensitive ((Page*) self, "IncreaseSize", _tmp0_);
	single_photo_page_get_zoom_state ((SinglePhotoPage*) self, &_tmp3_);
	if (!zoom_state_is_default (&_tmp3_)) {
		_tmp2_ = !editing_host_page_get_photo_missing ((EditingHostPage*) self);
	} else {
		_tmp2_ = FALSE;
	}
	page_set_action_sensitive ((Page*) self, "DecreaseSize", _tmp2_);
}

static void
library_photo_page_real_on_increase_size (EditingHostPage* base)
{
	LibraryPhotoPage * self;
	self = (LibraryPhotoPage*) base;
	EDITING_HOST_PAGE_CLASS (library_photo_page_parent_class)->on_increase_size (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage));
	library_photo_page_update_zoom_menu_item_sensitivity (self);
}

static void
library_photo_page_real_on_decrease_size (EditingHostPage* base)
{
	LibraryPhotoPage * self;
	self = (LibraryPhotoPage*) base;
	EDITING_HOST_PAGE_CLASS (library_photo_page_parent_class)->on_decrease_size (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage));
	library_photo_page_update_zoom_menu_item_sensitivity (self);
}

static gboolean
library_photo_page_real_on_zoom_assembly_key_press (EditingHostPage* base,
                                                    GdkEventKey* event)
{
	LibraryPhotoPage * self;
	const gchar* _tmp0_;
	gboolean result;
	self = (LibraryPhotoPage*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	if (EDITING_HOST_PAGE_CLASS (library_photo_page_parent_class)->on_zoom_assembly_key_press (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), event)) {
		result = TRUE;
		return result;
	}
	_tmp0_ = gdk_keyval_name (event->keyval);
	if (g_strcmp0 (_tmp0_, "Escape") == 0) {
		library_photo_page_return_to_collection (self);
		result = TRUE;
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

static void
library_photo_page_real_update_ui (EditingHostPage* base,
                                   gboolean missing)
{
	LibraryPhotoPage * self;
	gboolean sensitivity = FALSE;
	AppWindow* _tmp0_;
	AppWindow* _tmp1_;
	GAction* _tmp2_;
	AppWindow* _tmp3_;
	AppWindow* _tmp4_;
	GAction* _tmp5_;
	AppWindow* _tmp6_;
	AppWindow* _tmp7_;
	GAction* _tmp8_;
	self = (LibraryPhotoPage*) base;
	sensitivity = !missing;
	page_set_action_sensitive ((Page*) self, "Print", sensitivity);
	_tmp0_ = app_window_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_action_map_lookup_action ((GActionMap*) _tmp1_, APP_WINDOW_ACTION_JUMP_TO_FILE);
	g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, g_simple_action_get_type (), GSimpleAction), sensitivity);
	_g_object_unref0 (_tmp1_);
	_tmp3_ = app_window_get_instance ();
	_tmp4_ = _tmp3_;
	_tmp5_ = g_action_map_lookup_action ((GActionMap*) _tmp4_, APP_WINDOW_ACTION_UNDO);
	g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, g_simple_action_get_type (), GSimpleAction), sensitivity);
	_g_object_unref0 (_tmp4_);
	_tmp6_ = app_window_get_instance ();
	_tmp7_ = _tmp6_;
	_tmp8_ = g_action_map_lookup_action ((GActionMap*) _tmp7_, APP_WINDOW_ACTION_REDO);
	g_simple_action_set_enabled (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, g_simple_action_get_type (), GSimpleAction), sensitivity);
	_g_object_unref0 (_tmp7_);
	page_set_action_sensitive ((Page*) self, "IncreaseSize", sensitivity);
	page_set_action_sensitive ((Page*) self, "DecreaseSize", sensitivity);
	page_set_action_sensitive ((Page*) self, "ZoomFit", sensitivity);
	page_set_action_sensitive ((Page*) self, "Zoom100", sensitivity);
	page_set_action_sensitive ((Page*) self, "Zoom200", sensitivity);
	page_set_action_sensitive ((Page*) self, "Slideshow", sensitivity);
	page_set_action_sensitive ((Page*) self, "RotateClockwise", sensitivity);
	page_set_action_sensitive ((Page*) self, "RotateCounterclockwise", sensitivity);
	page_set_action_sensitive ((Page*) self, "FlipHorizontally", sensitivity);
	page_set_action_sensitive ((Page*) self, "FlipVertically", sensitivity);
	page_set_action_sensitive ((Page*) self, "Enhance", sensitivity);
	page_set_action_sensitive ((Page*) self, "Crop", sensitivity);
	page_set_action_sensitive ((Page*) self, "RedEye", sensitivity);
	page_set_action_sensitive ((Page*) self, "Adjust", sensitivity);
	page_set_action_sensitive ((Page*) self, "AdjustDateTime", sensitivity);
	page_set_action_sensitive ((Page*) self, "OpenWith", sensitivity);
	page_set_action_sensitive ((Page*) self, "OpenWithRaw", sensitivity);
	page_set_action_sensitive ((Page*) self, "Revert", sensitivity);
	page_set_action_sensitive ((Page*) self, "Flag", sensitivity);
	EDITING_HOST_PAGE_CLASS (library_photo_page_parent_class)->update_ui (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), missing);
}

static void
library_photo_page_real_notify_photo_backing_missing (EditingHostPage* base,
                                                      Photo* photo,
                                                      gboolean missing)
{
	LibraryPhotoPage * self;
	self = (LibraryPhotoPage*) base;
	g_return_if_fail (photo != NULL);
	if (missing) {
		media_source_mark_offline ((MediaSource*) G_TYPE_CHECK_INSTANCE_CAST (photo, TYPE_LIBRARY_PHOTO, LibraryPhoto));
	} else {
		media_source_mark_online ((MediaSource*) G_TYPE_CHECK_INSTANCE_CAST (photo, TYPE_LIBRARY_PHOTO, LibraryPhoto));
	}
	EDITING_HOST_PAGE_CLASS (library_photo_page_parent_class)->notify_photo_backing_missing (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), photo, missing);
}

static gboolean
library_photo_page_real_key_press_event (GtkWidget* base,
                                         GdkEventKey* event)
{
	LibraryPhotoPage * self;
	gboolean _tmp0_ = FALSE;
	gboolean handled = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	GQuark _tmp4_ = 0U;
	static GQuark _tmp3_label0 = 0;
	static GQuark _tmp3_label1 = 0;
	static GQuark _tmp3_label2 = 0;
	static GQuark _tmp3_label3 = 0;
	static GQuark _tmp3_label4 = 0;
	static GQuark _tmp3_label5 = 0;
	static GQuark _tmp3_label6 = 0;
	static GQuark _tmp3_label7 = 0;
	static GQuark _tmp3_label8 = 0;
	gboolean result;
	self = (LibraryPhotoPage*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	if (GTK_WIDGET_CLASS (library_photo_page_parent_class)->key_press_event != NULL) {
		_tmp0_ = GTK_WIDGET_CLASS (library_photo_page_parent_class)->key_press_event ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), event) == TRUE;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = TRUE;
		return result;
	}
	handled = TRUE;
	_tmp1_ = gdk_keyval_name (event->keyval);
	_tmp2_ = _tmp1_;
	_tmp4_ = (NULL == _tmp2_) ? 0 : g_quark_from_string (_tmp2_);
	if (((_tmp4_ == ((0 != _tmp3_label0) ? _tmp3_label0 : (_tmp3_label0 = g_quark_from_static_string ("Escape")))) || (_tmp4_ == ((0 != _tmp3_label1) ? _tmp3_label1 : (_tmp3_label1 = g_quark_from_static_string ("Return"))))) || (_tmp4_ == ((0 != _tmp3_label2) ? _tmp3_label2 : (_tmp3_label2 = g_quark_from_static_string ("KP_Enter"))))) {
		switch (0) {
			default:
			{
				GtkWindow* _tmp5_;
				GtkWindow* _tmp6_;
				gboolean _tmp7_;
				_tmp5_ = page_get_container ((Page*) self);
				_tmp6_ = _tmp5_;
				_tmp7_ = !IS_FULLSCREEN_WINDOW (_tmp6_);
				_g_object_unref0 (_tmp6_);
				if (_tmp7_) {
					library_photo_page_return_to_collection (self);
				}
				break;
			}
		}
	} else if ((_tmp4_ == ((0 != _tmp3_label3) ? _tmp3_label3 : (_tmp3_label3 = g_quark_from_static_string ("Delete")))) || (_tmp4_ == ((0 != _tmp3_label4) ? _tmp3_label4 : (_tmp3_label4 = g_quark_from_static_string ("BackSpace"))))) {
		switch (0) {
			default:
			{
				page_activate_action ((Page*) self, "MoveToTrash");
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label5) ? _tmp3_label5 : (_tmp3_label5 = g_quark_from_static_string ("bracketright")))) {
		switch (0) {
			default:
			{
				page_activate_action ((Page*) self, "RotateClockwise");
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label6) ? _tmp3_label6 : (_tmp3_label6 = g_quark_from_static_string ("bracketleft")))) {
		switch (0) {
			default:
			{
				page_activate_action ((Page*) self, "RotateCounterclockwise");
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label7) ? _tmp3_label7 : (_tmp3_label7 = g_quark_from_static_string ("slash")))) {
		switch (0) {
			default:
			{
				page_activate_action ((Page*) self, "Flag");
				break;
			}
		}
	} else if (_tmp4_ == ((0 != _tmp3_label8) ? _tmp3_label8 : (_tmp3_label8 = g_quark_from_static_string ("c")))) {
		switch (0) {
			default:
			{
				if ((event->state & GDK_CONTROL_MASK) != 0) {
					if ((event->state & GDK_SHIFT_MASK) != 0) {
						page_activate_action ((Page*) self, "CopyMetadata");
					} else {
						page_activate_action ((Page*) self, "CopyImage");
					}
				} else {
					handled = FALSE;
				}
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				handled = FALSE;
				break;
			}
		}
	}
	result = handled;
	return result;
}

static gboolean
library_photo_page_real_on_double_click (EditingHostPage* base,
                                         GdkEventButton* event)
{
	LibraryPhotoPage * self;
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	gboolean _tmp2_;
	AppWindow* _tmp3_;
	AppWindow* _tmp4_;
	gboolean result;
	self = (LibraryPhotoPage*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = page_get_container ((Page*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = !IS_FULLSCREEN_WINDOW (_tmp1_);
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		self->priv->return_to_collection_on_release = TRUE;
		result = TRUE;
		return result;
	}
	_tmp3_ = app_window_get_instance ();
	_tmp4_ = _tmp3_;
	app_window_end_fullscreen (_tmp4_);
	_g_object_unref0 (_tmp4_);
	result = EDITING_HOST_PAGE_CLASS (library_photo_page_parent_class)->on_double_click (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), event);
	return result;
}

static gboolean
library_photo_page_real_on_left_released (Page* base,
                                          GdkEventButton* event)
{
	LibraryPhotoPage * self;
	gboolean result;
	self = (LibraryPhotoPage*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	if (self->priv->return_to_collection_on_release) {
		self->priv->return_to_collection_on_release = FALSE;
		library_photo_page_return_to_collection (self);
		result = TRUE;
		return result;
	}
	result = PAGE_CLASS (library_photo_page_parent_class)->on_left_released ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_EDITING_HOST_PAGE, EditingHostPage), event);
	return result;
}

static Block18Data*
block18_data_ref (Block18Data* _data18_)
{
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}

static void
block18_data_unref (void * _userdata_)
{
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		LibraryPhotoPage* self;
		self = _data18_->self;
		_g_object_unref0 (_data18_->trash_action);
		_g_object_unref0 (_data18_->remove_action);
		_g_object_unref0 (_data18_->export_action);
		_g_object_unref0 (_data18_->print_action);
		_g_object_unref0 (_data18_->jump_event_action);
		_g_object_unref0 (_data18_->copy_metadata_action);
		_g_object_unref0 (_data18_->copy_image_action);
		_g_object_unref0 (_data18_->adjust_datetime_action);
		_g_object_unref0 (_data18_->raw_developer_camera_action);
		_g_object_unref0 (_data18_->raw_developer_app_action);
		_g_object_unref0 (_data18_->flag_action);
		_g_object_unref0 (_data18_->paste_color_action);
		_g_object_unref0 (_data18_->copy_color_action);
		_g_object_unref0 (_data18_->revert_action);
		_g_object_unref0 (self);
		g_slice_free (Block18Data, _data18_);
	}
}

static void
___lambda65_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->revert_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda65__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda65_ (self);
}

static void
___lambda66_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->copy_color_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda66__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda66_ (self);
}

static void
___lambda67_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->paste_color_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda67__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda67_ (self);
}

static void
___lambda68_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->flag_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda68__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda68_ (self);
}

static void
___lambda69_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->raw_developer_app_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda69__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda69_ (self);
}

static void
___lambda70_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->raw_developer_camera_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda70__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda70_ (self);
}

static void
___lambda71_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->adjust_datetime_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda71__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda71_ (self);
}

static void
___lambda72_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->copy_image_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda72__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda72_ (self);
}

static void
___lambda73_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->copy_metadata_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda73__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda73_ (self);
}

static void
___lambda74_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->jump_event_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda74__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda74_ (self);
}

static void
___lambda75_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->print_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda75__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda75_ (self);
}

static void
___lambda76_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->export_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda76__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda76_ (self);
}

static void
___lambda77_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->remove_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda77__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda77_ (self);
}

static void
___lambda78_ (Block18Data* _data18_)
{
	LibraryPhotoPage* self;
	GtkAction* _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->trash_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda78__gtk_menu_item_activate (GtkMenuItem* _sender,
                                      gpointer self)
{
	___lambda78_ (self);
}

static GtkMenu*
library_photo_page_get_context_menu (LibraryPhotoPage* self)
{
	GtkMenu* _tmp0_;
	GtkMenu* _tmp175_;
	GtkMenu* _tmp176_;
	GtkMenu* _tmp177_;
	GtkMenu* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->item_context_menu;
	if (_tmp0_ == NULL) {
		Block18Data* _data18_;
		GtkWidget* _tmp1_;
		GtkMenu* _tmp2_ = NULL;
		GtkCheckMenuItem* metadata_menu_item = NULL;
		GtkCheckMenuItem* _tmp3_;
		GtkAction* metadata_action = NULL;
		GtkAction* _tmp4_;
		GtkAction* _tmp5_;
		GtkCheckMenuItem* _tmp6_;
		GtkMenuItem* revert_menu_item = NULL;
		GtkMenuItem* _tmp7_;
		GtkAction* _tmp8_;
		GtkAction* _tmp9_;
		GtkMenuItem* _tmp10_;
		GtkMenuItem* _tmp11_;
		GtkMenuItem* copy_color_menu_item = NULL;
		GtkMenuItem* _tmp12_;
		GtkAction* _tmp13_;
		GtkAction* _tmp14_;
		GtkMenuItem* _tmp15_;
		GtkMenuItem* _tmp16_;
		GtkMenuItem* paste_color_menu_item = NULL;
		GtkMenuItem* _tmp17_;
		GtkAction* _tmp18_;
		GtkAction* _tmp19_;
		GtkMenuItem* _tmp20_;
		GtkMenuItem* _tmp21_;
		GtkMenuItem* flag_menu_item = NULL;
		GtkMenuItem* _tmp22_;
		GtkAction* _tmp23_;
		GtkAction* _tmp24_;
		GtkMenuItem* _tmp25_;
		GtkMenuItem* _tmp26_;
		GtkMenuItem* raw_developer_app_menu_item = NULL;
		gchar* _tmp27_;
		gchar* _tmp28_;
		GtkMenuItem* _tmp29_;
		GtkMenuItem* _tmp30_;
		GtkAction* _tmp31_;
		GtkAction* _tmp32_;
		GtkMenuItem* _tmp33_;
		GtkMenuItem* _tmp34_;
		GtkMenuItem* raw_developer_camera_menu_item = NULL;
		gchar* _tmp35_;
		gchar* _tmp36_;
		GtkMenuItem* _tmp37_;
		GtkMenuItem* _tmp38_;
		GtkAction* _tmp39_;
		GtkAction* _tmp40_;
		GtkMenuItem* _tmp41_;
		GtkMenuItem* _tmp42_;
		GtkMenuItem* raw_developer_menu_item = NULL;
		GtkMenuItem* _tmp43_;
		GtkAction* raw_developer_action = NULL;
		GtkAction* _tmp44_;
		GtkAction* _tmp45_;
		GtkMenuItem* _tmp46_;
		GtkMenu* raw_developer_menu = NULL;
		GtkMenu* _tmp47_;
		GtkMenu* _tmp48_;
		GtkMenuItem* _tmp49_;
		GtkMenu* _tmp50_;
		GtkMenuItem* _tmp51_;
		GtkMenuItem* _tmp52_;
		GtkMenu* _tmp53_;
		GtkMenuItem* adjust_datetime_menu_item = NULL;
		GtkMenuItem* _tmp54_;
		GtkAction* _tmp55_;
		GtkAction* _tmp56_;
		GtkMenuItem* _tmp57_;
		GtkMenuItem* _tmp58_;
		GtkMenuItem* copy_image_menu_item = NULL;
		GtkMenuItem* _tmp59_;
		GtkAction* _tmp60_;
		GtkMenuItem* _tmp61_;
		GtkMenuItem* copy_metadata_menu_item = NULL;
		GtkMenuItem* _tmp62_;
		GtkAction* _tmp63_;
		GtkMenuItem* _tmp64_;
		GtkMenuItem* open_menu_item = NULL;
		gchar* _tmp65_;
		GtkMenuItem* _tmp66_ = NULL;
		GtkMenuItem* jump_event_menu_item = NULL;
		GtkMenuItem* _tmp67_;
		GtkAction* _tmp68_;
		GtkAction* _tmp69_;
		GtkMenuItem* _tmp70_;
		GtkMenuItem* _tmp71_;
		GtkMenuItem* print_menu_item = NULL;
		GtkMenuItem* _tmp72_;
		GtkAction* _tmp73_;
		GtkAction* _tmp74_;
		GtkMenuItem* _tmp75_;
		GtkMenuItem* _tmp76_;
		GtkMenuItem* export_menu_item = NULL;
		GtkMenuItem* _tmp77_;
		GtkAction* _tmp78_;
		GtkAction* _tmp79_;
		GtkMenuItem* _tmp80_;
		GtkMenuItem* _tmp81_;
		GtkMenuItem* wallpaper_menuitem = NULL;
		gchar* _tmp82_;
		GtkMenuItem* _tmp83_ = NULL;
		GtkMenuItem* contractor_menu_item = NULL;
		GtkMenuItem* _tmp84_;
		GtkMenu* _tmp85_;
		GtkMenuItem* _tmp86_;
		GtkMenu* _tmp87_;
		GtkMenuItem* remove_menu_item = NULL;
		GtkMenuItem* _tmp88_;
		GtkAction* _tmp89_;
		GtkAction* _tmp90_;
		GtkMenuItem* _tmp91_;
		GtkMenuItem* _tmp92_;
		GtkMenuItem* trash_menu_item = NULL;
		GtkMenuItem* _tmp93_;
		GtkAction* _tmp94_;
		GtkAction* _tmp95_;
		GtkMenuItem* _tmp96_;
		GtkMenuItem* _tmp97_;
		GtkMenu* _tmp98_;
		GtkMenuItem* _tmp99_;
		GtkMenu* _tmp100_;
		GtkMenuItem* _tmp101_;
		GtkMenu* _tmp102_;
		GtkMenuItem* _tmp103_;
		GtkMenu* _tmp104_;
		GtkMenuItem* _tmp105_;
		GtkMenu* _tmp106_;
		GtkSeparatorMenuItem* _tmp107_;
		GtkSeparatorMenuItem* _tmp108_;
		GtkMenu* _tmp109_;
		GtkMenuItem* _tmp110_;
		GtkMenu* _tmp111_;
		GtkMenuItem* _tmp112_;
		GtkMenu* _tmp113_;
		GtkMenuItem* _tmp114_;
		GtkMenu* _tmp115_;
		GtkSeparatorMenuItem* _tmp116_;
		GtkSeparatorMenuItem* _tmp117_;
		GtkMenu* _tmp118_;
		GtkMenuItem* _tmp119_;
		GtkMenu* _tmp120_;
		GtkSeparatorMenuItem* _tmp121_;
		GtkSeparatorMenuItem* _tmp122_;
		GtkMenu* _tmp123_;
		GtkMenuItem* _tmp124_;
		GtkMenu* _tmp125_;
		GtkMenuItem* _tmp126_;
		GtkMenu* _tmp127_;
		GtkMenuItem* _tmp128_;
		GtkMenu* _tmp129_;
		GtkSeparatorMenuItem* _tmp130_;
		GtkSeparatorMenuItem* _tmp131_;
		GtkMenu* _tmp132_;
		GtkMenuItem* _tmp133_;
		GtkMenu* _tmp134_;
		GtkMenuItem* _tmp135_;
		GtkMenu* _tmp136_;
		GtkSeparatorMenuItem* _tmp137_;
		GtkSeparatorMenuItem* _tmp138_;
		GtkMenu* _tmp139_;
		GtkMenuItem* _tmp140_;
		GtkMenu* _tmp141_;
		GtkSeparatorMenuItem* _tmp142_;
		GtkSeparatorMenuItem* _tmp143_;
		GtkMenu* _tmp144_;
		GtkCheckMenuItem* _tmp145_;
		GtkMenu* _tmp146_;
		GtkSeparatorMenuItem* _tmp147_;
		GtkSeparatorMenuItem* _tmp148_;
		GtkMenu* _tmp149_;
		GtkMenuItem* _tmp150_;
		GtkMenu* _tmp151_;
		GtkMenuItem* _tmp152_;
		GtkMenu* _tmp153_;
		DataSource* source = NULL;
		ViewCollection* _tmp154_;
		ViewCollection* _tmp155_;
		DataView* _tmp156_;
		DataView* _tmp157_;
		DataSource* _tmp158_;
		DataSource* _tmp159_;
		DataSource* _tmp160_;
		DataSource* _tmp161_;
		gboolean _tmp162_ = FALSE;
		DataSource* _tmp163_;
		_data18_ = g_slice_new0 (Block18Data);
		_data18_->_ref_count_ = 1;
		_data18_->self = g_object_ref (self);
		_tmp1_ = _g_object_ref0 ((GtkWidget*) self);
		_tmp2_ = (GtkMenu*) gtk_menu_new ();
		g_object_set (_tmp2_, "attach-widget", _tmp1_, NULL);
		_g_object_unref0 (_tmp1_);
		g_object_ref_sink (_tmp2_);
		_g_object_unref0 (self->priv->item_context_menu);
		self->priv->item_context_menu = _tmp2_;
		_tmp3_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_mnemonic (_ ("Edit Photo In_fo"));
		g_object_ref_sink (_tmp3_);
		metadata_menu_item = _tmp3_;
		_tmp4_ = page_get_common_action ((Page*) self, "CommonDisplayMetadataSidebar", TRUE);
		metadata_action = _tmp4_;
		_tmp5_ = metadata_action;
		_tmp6_ = metadata_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp5_, "active", (GObject*) _tmp6_, "active", G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp7_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_REVERT_MENU);
		g_object_ref_sink (_tmp7_);
		revert_menu_item = _tmp7_;
		_tmp8_ = page_get_action ((Page*) self, "Revert");
		_data18_->revert_action = _tmp8_;
		_tmp9_ = _data18_->revert_action;
		_tmp10_ = revert_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp9_, "sensitive", (GObject*) _tmp10_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp11_ = revert_menu_item;
		g_signal_connect_data (_tmp11_, "activate", (GCallback) ____lambda65__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp12_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_COPY_ADJUSTMENTS_MENU);
		g_object_ref_sink (_tmp12_);
		copy_color_menu_item = _tmp12_;
		_tmp13_ = page_get_action ((Page*) self, "CopyColorAdjustments");
		_data18_->copy_color_action = _tmp13_;
		_tmp14_ = _data18_->copy_color_action;
		_tmp15_ = copy_color_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp14_, "sensitive", (GObject*) _tmp15_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp16_ = copy_color_menu_item;
		g_signal_connect_data (_tmp16_, "activate", (GCallback) ____lambda66__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp17_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_PASTE_ADJUSTMENTS_MENU);
		g_object_ref_sink (_tmp17_);
		paste_color_menu_item = _tmp17_;
		_tmp18_ = page_get_action ((Page*) self, "PasteColorAdjustments");
		_data18_->paste_color_action = _tmp18_;
		_tmp19_ = _data18_->paste_color_action;
		_tmp20_ = paste_color_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp19_, "sensitive", (GObject*) _tmp20_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp21_ = paste_color_menu_item;
		g_signal_connect_data (_tmp21_, "activate", (GCallback) ____lambda67__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp22_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_FLAG_MENU);
		g_object_ref_sink (_tmp22_);
		flag_menu_item = _tmp22_;
		_tmp23_ = page_get_action ((Page*) self, "Flag");
		_data18_->flag_action = _tmp23_;
		_tmp24_ = _data18_->flag_action;
		_tmp25_ = flag_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp24_, "sensitive", (GObject*) _tmp25_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp26_ = flag_menu_item;
		g_signal_connect_data (_tmp26_, "activate", (GCallback) ____lambda68__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp27_ = raw_developer_get_label (RAW_DEVELOPER_SHOTWELL);
		_tmp28_ = _tmp27_;
		_tmp29_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_tmp28_);
		g_object_ref_sink (_tmp29_);
		_tmp30_ = _tmp29_;
		_g_free0 (_tmp28_);
		raw_developer_app_menu_item = _tmp30_;
		_tmp31_ = page_get_action ((Page*) self, "RawDeveloperShotwell");
		_data18_->raw_developer_app_action = _tmp31_;
		_tmp32_ = _data18_->raw_developer_app_action;
		_tmp33_ = raw_developer_app_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp32_, "sensitive", (GObject*) _tmp33_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp34_ = raw_developer_app_menu_item;
		g_signal_connect_data (_tmp34_, "activate", (GCallback) ____lambda69__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp35_ = raw_developer_get_label (RAW_DEVELOPER_CAMERA);
		_tmp36_ = _tmp35_;
		_tmp37_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_tmp36_);
		g_object_ref_sink (_tmp37_);
		_tmp38_ = _tmp37_;
		_g_free0 (_tmp36_);
		raw_developer_camera_menu_item = _tmp38_;
		_tmp39_ = page_get_action ((Page*) self, "RawDeveloperCamera");
		_data18_->raw_developer_camera_action = _tmp39_;
		_tmp40_ = _data18_->raw_developer_camera_action;
		_tmp41_ = raw_developer_camera_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp40_, "sensitive", (GObject*) _tmp41_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp42_ = raw_developer_camera_menu_item;
		g_signal_connect_data (_tmp42_, "activate", (GCallback) ____lambda70__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp43_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_Developer"));
		g_object_ref_sink (_tmp43_);
		raw_developer_menu_item = _tmp43_;
		_tmp44_ = page_get_action ((Page*) self, "RawDeveloper");
		raw_developer_action = _tmp44_;
		_tmp45_ = raw_developer_action;
		_tmp46_ = raw_developer_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp45_, "sensitive", (GObject*) _tmp46_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp47_ = (GtkMenu*) gtk_menu_new ();
		g_object_ref_sink (_tmp47_);
		raw_developer_menu = _tmp47_;
		_tmp48_ = raw_developer_menu;
		_tmp49_ = raw_developer_app_menu_item;
		gtk_container_add ((GtkContainer*) _tmp48_, (GtkWidget*) _tmp49_);
		_tmp50_ = raw_developer_menu;
		_tmp51_ = raw_developer_camera_menu_item;
		gtk_container_add ((GtkContainer*) _tmp50_, (GtkWidget*) _tmp51_);
		_tmp52_ = raw_developer_menu_item;
		_tmp53_ = raw_developer_menu;
		gtk_menu_item_set_submenu (_tmp52_, _tmp53_);
		_tmp54_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_ADJUST_DATE_TIME_MENU);
		g_object_ref_sink (_tmp54_);
		adjust_datetime_menu_item = _tmp54_;
		_tmp55_ = page_get_action ((Page*) self, "AdjustDateTime");
		_data18_->adjust_datetime_action = _tmp55_;
		_tmp56_ = _data18_->adjust_datetime_action;
		_tmp57_ = adjust_datetime_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp56_, "sensitive", (GObject*) _tmp57_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp58_ = adjust_datetime_menu_item;
		g_signal_connect_data (_tmp58_, "activate", (GCallback) ____lambda71__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp59_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_COPY_IMAGE_LABEL);
		g_object_ref_sink (_tmp59_);
		copy_image_menu_item = _tmp59_;
		_tmp60_ = page_get_action ((Page*) self, "CopyImage");
		_data18_->copy_image_action = _tmp60_;
		_tmp61_ = copy_image_menu_item;
		g_signal_connect_data (_tmp61_, "activate", (GCallback) ____lambda72__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp62_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_COPY_METADATA_LABEL);
		g_object_ref_sink (_tmp62_);
		copy_metadata_menu_item = _tmp62_;
		_tmp63_ = page_get_action ((Page*) self, "CopyMetadata");
		_data18_->copy_metadata_action = _tmp63_;
		_tmp64_ = copy_metadata_menu_item;
		g_signal_connect_data (_tmp64_, "activate", (GCallback) ____lambda73__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp65_ = g_strdup (APP_WINDOW_ACTION_PREFIX APP_WINDOW_ACTION_JUMP_TO_FILE);
		_tmp66_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_ ("Show in Files"));
		gtk_actionable_set_action_name ((GtkActionable*) _tmp66_, _tmp65_);
		_g_free0 (_tmp65_);
		g_object_ref_sink (_tmp66_);
		open_menu_item = _tmp66_;
		_tmp67_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("View Eve_nt for Photo"));
		g_object_ref_sink (_tmp67_);
		jump_event_menu_item = _tmp67_;
		_tmp68_ = page_get_common_action ((Page*) self, "CommonJumpToEvent", TRUE);
		_data18_->jump_event_action = _tmp68_;
		_tmp69_ = _data18_->jump_event_action;
		_tmp70_ = jump_event_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp69_, "sensitive", (GObject*) _tmp70_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp71_ = jump_event_menu_item;
		g_signal_connect_data (_tmp71_, "activate", (GCallback) ____lambda74__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp72_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_PRINT_MENU);
		g_object_ref_sink (_tmp72_);
		print_menu_item = _tmp72_;
		_tmp73_ = page_get_action ((Page*) self, "Print");
		_data18_->print_action = _tmp73_;
		_tmp74_ = _data18_->print_action;
		_tmp75_ = print_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp74_, "sensitive", (GObject*) _tmp75_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp76_ = print_menu_item;
		g_signal_connect_data (_tmp76_, "activate", (GCallback) ____lambda75__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp77_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_EXPORT_MENU);
		g_object_ref_sink (_tmp77_);
		export_menu_item = _tmp77_;
		_tmp78_ = page_get_action ((Page*) self, "Export");
		_data18_->export_action = _tmp78_;
		_tmp79_ = _data18_->export_action;
		_tmp80_ = export_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp79_, "sensitive", (GObject*) _tmp80_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp81_ = export_menu_item;
		g_signal_connect_data (_tmp81_, "activate", (GCallback) ____lambda76__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp82_ = g_strdup (APP_WINDOW_ACTION_PREFIX APP_WINDOW_ACTION_SET_WALLPAPER);
		_tmp83_ = (GtkMenuItem*) gtk_menu_item_new_with_label (_ ("Set as Wallpaper"));
		gtk_actionable_set_action_name ((GtkActionable*) _tmp83_, _tmp82_);
		_g_free0 (_tmp82_);
		g_object_ref_sink (_tmp83_);
		wallpaper_menuitem = _tmp83_;
		_tmp84_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("Other Actions"));
		g_object_ref_sink (_tmp84_);
		contractor_menu_item = _tmp84_;
		_tmp85_ = (GtkMenu*) gtk_menu_new ();
		g_object_ref_sink (_tmp85_);
		_g_object_unref0 (self->priv->contractor_menu);
		self->priv->contractor_menu = _tmp85_;
		_tmp86_ = contractor_menu_item;
		_tmp87_ = self->priv->contractor_menu;
		gtk_menu_item_set_submenu (_tmp86_, _tmp87_);
		_tmp88_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_REMOVE_FROM_LIBRARY_MENU);
		g_object_ref_sink (_tmp88_);
		remove_menu_item = _tmp88_;
		_tmp89_ = page_get_action ((Page*) self, "RemoveFromLibrary");
		_data18_->remove_action = _tmp89_;
		_tmp90_ = _data18_->remove_action;
		_tmp91_ = remove_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp90_, "sensitive", (GObject*) _tmp91_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp92_ = remove_menu_item;
		g_signal_connect_data (_tmp92_, "activate", (GCallback) ____lambda77__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp93_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_MOVE_TO_TRASH_MENU);
		g_object_ref_sink (_tmp93_);
		trash_menu_item = _tmp93_;
		_tmp94_ = page_get_action ((Page*) self, "MoveToTrash");
		_data18_->trash_action = _tmp94_;
		_tmp95_ = _data18_->trash_action;
		_tmp96_ = trash_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp95_, "sensitive", (GObject*) _tmp96_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp97_ = trash_menu_item;
		g_signal_connect_data (_tmp97_, "activate", (GCallback) ____lambda78__gtk_menu_item_activate, block18_data_ref (_data18_), (GClosureNotify) block18_data_unref, 0);
		_tmp98_ = self->priv->contractor_menu;
		_tmp99_ = print_menu_item;
		gtk_container_add ((GtkContainer*) _tmp98_, (GtkWidget*) _tmp99_);
		_tmp100_ = self->priv->contractor_menu;
		_tmp101_ = export_menu_item;
		gtk_container_add ((GtkContainer*) _tmp100_, (GtkWidget*) _tmp101_);
		_tmp102_ = self->priv->contractor_menu;
		_tmp103_ = wallpaper_menuitem;
		gtk_container_add ((GtkContainer*) _tmp102_, (GtkWidget*) _tmp103_);
		_tmp104_ = self->priv->item_context_menu;
		_tmp105_ = adjust_datetime_menu_item;
		gtk_container_add ((GtkContainer*) _tmp104_, (GtkWidget*) _tmp105_);
		_tmp106_ = self->priv->item_context_menu;
		_tmp107_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp107_);
		_tmp108_ = _tmp107_;
		gtk_container_add ((GtkContainer*) _tmp106_, (GtkWidget*) _tmp108_);
		_g_object_unref0 (_tmp108_);
		_tmp109_ = self->priv->item_context_menu;
		_tmp110_ = copy_image_menu_item;
		gtk_container_add ((GtkContainer*) _tmp109_, (GtkWidget*) _tmp110_);
		_tmp111_ = self->priv->item_context_menu;
		_tmp112_ = copy_metadata_menu_item;
		gtk_container_add ((GtkContainer*) _tmp111_, (GtkWidget*) _tmp112_);
		_tmp113_ = self->priv->item_context_menu;
		_tmp114_ = open_menu_item;
		gtk_container_add ((GtkContainer*) _tmp113_, (GtkWidget*) _tmp114_);
		_tmp115_ = self->priv->item_context_menu;
		_tmp116_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp116_);
		_tmp117_ = _tmp116_;
		gtk_container_add ((GtkContainer*) _tmp115_, (GtkWidget*) _tmp117_);
		_g_object_unref0 (_tmp117_);
		_tmp118_ = self->priv->item_context_menu;
		_tmp119_ = contractor_menu_item;
		gtk_container_add ((GtkContainer*) _tmp118_, (GtkWidget*) _tmp119_);
		_tmp120_ = self->priv->item_context_menu;
		_tmp121_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp121_);
		_tmp122_ = _tmp121_;
		gtk_container_add ((GtkContainer*) _tmp120_, (GtkWidget*) _tmp122_);
		_g_object_unref0 (_tmp122_);
		_tmp123_ = self->priv->item_context_menu;
		_tmp124_ = copy_color_menu_item;
		gtk_container_add ((GtkContainer*) _tmp123_, (GtkWidget*) _tmp124_);
		_tmp125_ = self->priv->item_context_menu;
		_tmp126_ = paste_color_menu_item;
		gtk_container_add ((GtkContainer*) _tmp125_, (GtkWidget*) _tmp126_);
		_tmp127_ = self->priv->item_context_menu;
		_tmp128_ = revert_menu_item;
		gtk_container_add ((GtkContainer*) _tmp127_, (GtkWidget*) _tmp128_);
		_tmp129_ = self->priv->item_context_menu;
		_tmp130_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp130_);
		_tmp131_ = _tmp130_;
		gtk_container_add ((GtkContainer*) _tmp129_, (GtkWidget*) _tmp131_);
		_g_object_unref0 (_tmp131_);
		_tmp132_ = self->priv->item_context_menu;
		_tmp133_ = flag_menu_item;
		gtk_container_add ((GtkContainer*) _tmp132_, (GtkWidget*) _tmp133_);
		_tmp134_ = self->priv->item_context_menu;
		_tmp135_ = raw_developer_menu_item;
		gtk_container_add ((GtkContainer*) _tmp134_, (GtkWidget*) _tmp135_);
		_tmp136_ = self->priv->item_context_menu;
		_tmp137_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp137_);
		_tmp138_ = _tmp137_;
		gtk_container_add ((GtkContainer*) _tmp136_, (GtkWidget*) _tmp138_);
		_g_object_unref0 (_tmp138_);
		_tmp139_ = self->priv->item_context_menu;
		_tmp140_ = jump_event_menu_item;
		gtk_container_add ((GtkContainer*) _tmp139_, (GtkWidget*) _tmp140_);
		_tmp141_ = self->priv->item_context_menu;
		_tmp142_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp142_);
		_tmp143_ = _tmp142_;
		gtk_container_add ((GtkContainer*) _tmp141_, (GtkWidget*) _tmp143_);
		_g_object_unref0 (_tmp143_);
		_tmp144_ = self->priv->item_context_menu;
		_tmp145_ = metadata_menu_item;
		gtk_container_add ((GtkContainer*) _tmp144_, (GtkWidget*) _tmp145_);
		_tmp146_ = self->priv->item_context_menu;
		_tmp147_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp147_);
		_tmp148_ = _tmp147_;
		gtk_container_add ((GtkContainer*) _tmp146_, (GtkWidget*) _tmp148_);
		_g_object_unref0 (_tmp148_);
		_tmp149_ = self->priv->item_context_menu;
		_tmp150_ = remove_menu_item;
		gtk_container_add ((GtkContainer*) _tmp149_, (GtkWidget*) _tmp150_);
		_tmp151_ = self->priv->item_context_menu;
		_tmp152_ = trash_menu_item;
		gtk_container_add ((GtkContainer*) _tmp151_, (GtkWidget*) _tmp152_);
		_tmp153_ = self->priv->item_context_menu;
		gtk_widget_show_all ((GtkWidget*) _tmp153_);
		_tmp154_ = page_get_view ((Page*) self);
		_tmp155_ = _tmp154_;
		_tmp156_ = view_collection_get_selected_at (_tmp155_, 0);
		_tmp157_ = _tmp156_;
		_tmp158_ = data_view_get_source (_tmp157_);
		_tmp159_ = _tmp158_;
		_tmp160_ = _g_object_ref0 (_tmp159_);
		_tmp161_ = _tmp160_;
		_g_object_unref0 (_tmp157_);
		_data_collection_unref0 (_tmp155_);
		source = _tmp161_;
		_tmp163_ = source;
		if (_tmp163_ != NULL) {
			DataSource* _tmp164_;
			_tmp164_ = source;
			_tmp162_ = IS_PHOTO (_tmp164_);
		} else {
			_tmp162_ = FALSE;
		}
		if (_tmp162_) {
			GFile* file = NULL;
			Photo* _tmp165_;
			Photo* _tmp166_;
			GFile* _tmp167_;
			GFile* _tmp168_;
			GtkMenuItem* _tmp169_;
			GFile* _tmp170_;
			gchar* _tmp171_;
			gchar* _tmp172_;
			GVariant* _tmp173_;
			GVariant* _tmp174_;
			_tmp165_ = editing_host_page_get_photo ((EditingHostPage*) self);
			_tmp166_ = _tmp165_;
			_tmp167_ = media_source_get_file ((MediaSource*) _tmp166_);
			_tmp168_ = _tmp167_;
			_g_object_unref0 (_tmp166_);
			file = _tmp168_;
			_tmp169_ = wallpaper_menuitem;
			_tmp170_ = file;
			_tmp171_ = g_file_get_uri (_tmp170_);
			_tmp172_ = _tmp171_;
			_tmp173_ = g_variant_new_string (_tmp172_);
			g_variant_ref_sink (_tmp173_);
			_tmp174_ = _tmp173_;
			g_object_set ((GtkActionable*) _tmp169_, "action-target", _tmp174_, NULL);
			_g_variant_unref0 (_tmp174_);
			_g_free0 (_tmp172_);
			_g_object_unref0 (file);
		}
		_g_object_unref0 (source);
		_g_object_unref0 (trash_menu_item);
		_g_object_unref0 (remove_menu_item);
		_g_object_unref0 (contractor_menu_item);
		_g_object_unref0 (wallpaper_menuitem);
		_g_object_unref0 (export_menu_item);
		_g_object_unref0 (print_menu_item);
		_g_object_unref0 (jump_event_menu_item);
		_g_object_unref0 (open_menu_item);
		_g_object_unref0 (copy_metadata_menu_item);
		_g_object_unref0 (copy_image_menu_item);
		_g_object_unref0 (adjust_datetime_menu_item);
		_g_object_unref0 (raw_developer_menu);
		_g_object_unref0 (raw_developer_action);
		_g_object_unref0 (raw_developer_menu_item);
		_g_object_unref0 (raw_developer_camera_menu_item);
		_g_object_unref0 (raw_developer_app_menu_item);
		_g_object_unref0 (flag_menu_item);
		_g_object_unref0 (paste_color_menu_item);
		_g_object_unref0 (copy_color_menu_item);
		_g_object_unref0 (revert_menu_item);
		_g_object_unref0 (metadata_action);
		_g_object_unref0 (metadata_menu_item);
		block18_data_unref (_data18_);
		_data18_ = NULL;
	}
	_tmp175_ = self->priv->contractor_menu;
	page_populate_contractor_menu ((Page*) self, _tmp175_);
	_tmp176_ = self->priv->item_context_menu;
	_tmp177_ = _g_object_ref0 (_tmp176_);
	result = _tmp177_;
	return result;
}

static gboolean
library_photo_page_real_on_context_buttonpress (Page* base,
                                                GdkEventButton* event)
{
	LibraryPhotoPage * self;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp1_;
	gboolean result;
	self = (LibraryPhotoPage*) base;
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = library_photo_page_get_context_menu (self);
	_tmp1_ = _tmp0_;
	page_popup_context_menu ((Page*) self, _tmp1_, event);
	_g_object_unref0 (_tmp1_);
	result = TRUE;
	return result;
}

static gboolean
library_photo_page_real_on_context_keypress (Page* base)
{
	LibraryPhotoPage * self;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp1_;
	gboolean result;
	self = (LibraryPhotoPage*) base;
	_tmp0_ = library_photo_page_get_context_menu (self);
	_tmp1_ = _tmp0_;
	page_popup_context_menu ((Page*) self, _tmp1_, NULL);
	_g_object_unref0 (_tmp1_);
	result = TRUE;
	return result;
}

static void
library_photo_page_return_to_collection (LibraryPhotoPage* self)
{
	CollectionPage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->return_page;
	if (NULL != _tmp0_) {
		LibraryWindow* _tmp1_;
		LibraryWindow* _tmp2_;
		CollectionPage* _tmp3_;
		_tmp1_ = library_window_get_app ();
		_tmp2_ = _tmp1_;
		_tmp3_ = self->priv->return_page;
		library_window_switch_to_page (_tmp2_, (Page*) _tmp3_);
		_g_object_unref0 (_tmp2_);
	} else {
		LibraryWindow* _tmp4_;
		LibraryWindow* _tmp5_;
		_tmp4_ = library_window_get_app ();
		_tmp5_ = _tmp4_;
		library_window_switch_to_library_page (_tmp5_);
		_g_object_unref0 (_tmp5_);
	}
}

static void
library_photo_page_on_remove_from_library (LibraryPhotoPage* self)
{
	LibraryPhoto* photo = NULL;
	Photo* _tmp0_;
	GeeCollection* photos = NULL;
	GeeArrayList* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = editing_host_page_get_photo ((EditingHostPage*) self);
	photo = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
	_tmp1_ = gee_array_list_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	photos = (GeeCollection*) _tmp1_;
	gee_collection_add (photos, photo);
	remove_from_app (photos, _ ("Remove From Library"), _ ("Removing Photo From Library"), FALSE);
	_g_object_unref0 (photos);
	_g_object_unref0 (photo);
}

static void
library_photo_page_on_move_to_trash (LibraryPhotoPage* self)
{
	CollectionPage* _tmp0_;
	LibraryPhoto* photo = NULL;
	Photo* _tmp3_;
	GeeCollection* photos = NULL;
	GeeArrayList* _tmp4_;
	GeeCollection* _tmp5_;
	LibraryPhoto* _tmp6_;
	LibraryPhoto* _tmp7_;
	Photo* _tmp8_;
	Photo* _tmp9_;
	gboolean _tmp10_;
	CommandManager* _tmp20_;
	CommandManager* _tmp21_;
	GeeCollection* _tmp22_;
	TrashUntrashPhotosCommand* _tmp23_;
	TrashUntrashPhotosCommand* _tmp24_;
	LibraryWindow* _tmp25_;
	LibraryWindow* _tmp26_;
	g_return_if_fail (self != NULL);
	if (!editing_host_page_has_photo ((EditingHostPage*) self)) {
		return;
	}
	_tmp0_ = self->priv->return_page;
	if (IS_EVENT_PAGE (_tmp0_)) {
		LibraryWindow* _tmp1_;
		LibraryWindow* _tmp2_;
		_tmp1_ = library_window_get_app ();
		_tmp2_ = _tmp1_;
		library_window_set_page_switching_enabled (_tmp2_, FALSE);
		_g_object_unref0 (_tmp2_);
	}
	_tmp3_ = editing_host_page_get_photo ((EditingHostPage*) self);
	photo = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
	_tmp4_ = gee_array_list_new (TYPE_LIBRARY_PHOTO, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	photos = (GeeCollection*) _tmp4_;
	_tmp5_ = photos;
	_tmp6_ = photo;
	gee_collection_add (_tmp5_, _tmp6_);
	single_photo_page_on_next_photo ((SinglePhotoPage*) self);
	_tmp7_ = photo;
	_tmp8_ = editing_host_page_get_photo ((EditingHostPage*) self);
	_tmp9_ = _tmp8_;
	_tmp10_ = data_source_equals ((DataSource*) _tmp7_, (DataSource*) _tmp9_);
	_g_object_unref0 (_tmp9_);
	if (_tmp10_) {
		LibraryWindow* _tmp11_;
		LibraryWindow* _tmp12_;
		GtkWindow* _tmp13_;
		GtkWindow* _tmp14_;
		gboolean _tmp15_;
		LibraryWindow* _tmp18_;
		LibraryWindow* _tmp19_;
		_tmp11_ = library_window_get_app ();
		_tmp12_ = _tmp11_;
		library_window_set_page_switching_enabled (_tmp12_, TRUE);
		_g_object_unref0 (_tmp12_);
		_tmp13_ = page_get_container ((Page*) self);
		_tmp14_ = _tmp13_;
		_tmp15_ = IS_FULLSCREEN_WINDOW (_tmp14_);
		_g_object_unref0 (_tmp14_);
		if (_tmp15_) {
			GtkWindow* _tmp16_;
			FullscreenWindow* _tmp17_;
			_tmp16_ = page_get_container ((Page*) self);
			_tmp17_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_FULLSCREEN_WINDOW, FullscreenWindow);
			fullscreen_window_close (_tmp17_);
			_g_object_unref0 (_tmp17_);
		}
		_tmp18_ = library_window_get_app ();
		_tmp19_ = _tmp18_;
		library_window_switch_to_library_page (_tmp19_);
		_g_object_unref0 (_tmp19_);
	}
	_tmp20_ = page_get_command_manager ((Page*) self);
	_tmp21_ = _tmp20_;
	_tmp22_ = photos;
	_tmp23_ = trash_untrash_photos_command_new (_tmp22_, TRUE);
	_tmp24_ = _tmp23_;
	command_manager_execute (_tmp21_, (Command*) _tmp24_);
	_g_object_unref0 (_tmp24_);
	_command_manager_unref0 (_tmp21_);
	_tmp25_ = library_window_get_app ();
	_tmp26_ = _tmp25_;
	library_window_set_page_switching_enabled (_tmp26_, TRUE);
	_g_object_unref0 (_tmp26_);
	_g_object_unref0 (photos);
	_g_object_unref0 (photo);
}

static void
library_photo_page_on_flag_unflag (LibraryPhotoPage* self)
{
	g_return_if_fail (self != NULL);
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		GeeArrayList* photo_list = NULL;
		GeeArrayList* _tmp0_;
		GeeArrayList* _tmp1_;
		Photo* _tmp2_;
		Photo* _tmp3_;
		CommandManager* _tmp4_;
		CommandManager* _tmp5_;
		GeeArrayList* _tmp6_;
		Photo* _tmp7_;
		LibraryPhoto* _tmp8_;
		FlagUnflagCommand* _tmp9_;
		FlagUnflagCommand* _tmp10_;
		_tmp0_ = gee_array_list_new (TYPE_MEDIA_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
		photo_list = _tmp0_;
		_tmp1_ = photo_list;
		_tmp2_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp3_ = _tmp2_;
		gee_abstract_collection_add ((GeeAbstractCollection*) _tmp1_, (MediaSource*) _tmp3_);
		_g_object_unref0 (_tmp3_);
		_tmp4_ = page_get_command_manager ((Page*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = photo_list;
		_tmp7_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp8_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_LIBRARY_PHOTO, LibraryPhoto);
		_tmp9_ = flag_unflag_command_new ((GeeCollection*) _tmp6_, !flaggable_is_flagged ((Flaggable*) _tmp8_));
		_tmp10_ = _tmp9_;
		command_manager_execute (_tmp5_, (Command*) _tmp10_);
		_g_object_unref0 (_tmp10_);
		_g_object_unref0 (_tmp8_);
		_command_manager_unref0 (_tmp5_);
		_g_object_unref0 (photo_list);
	}
}

static void
library_photo_page_on_photo_destroyed (LibraryPhotoPage* self,
                                       DataSource* source)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	library_photo_page_on_photo_removed (self, G_TYPE_CHECK_INSTANCE_CAST (source, TYPE_LIBRARY_PHOTO, LibraryPhoto));
}

static void
library_photo_page_on_photo_removed (LibraryPhotoPage* self,
                                     LibraryPhoto* photo)
{
	gboolean _tmp0_ = FALSE;
	Photo* _tmp3_;
	Photo* _tmp4_;
	gboolean _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (photo != NULL);
	if (photo == NULL) {
		_tmp0_ = TRUE;
	} else {
		Photo* _tmp1_;
		Photo* _tmp2_;
		_tmp1_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp2_ = _tmp1_;
		_tmp0_ = !data_source_equals ((DataSource*) photo, (DataSource*) _tmp2_);
		_g_object_unref0 (_tmp2_);
	}
	if (_tmp0_) {
		return;
	}
	single_photo_page_on_next_photo ((SinglePhotoPage*) self);
	_tmp3_ = editing_host_page_get_photo ((EditingHostPage*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = data_source_equals ((DataSource*) photo, (DataSource*) _tmp4_);
	_g_object_unref0 (_tmp4_);
	if (_tmp5_) {
		LibraryWindow* _tmp6_;
		LibraryWindow* _tmp7_;
		_tmp6_ = library_window_get_app ();
		_tmp7_ = _tmp6_;
		library_window_switch_to_library_page (_tmp7_);
		_g_object_unref0 (_tmp7_);
	}
}

static void
library_photo_page_on_print (LibraryPhotoPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = page_get_view ((Page*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_) > 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		PrintManager* _tmp3_;
		PrintManager* _tmp4_;
		ViewCollection* _tmp5_;
		ViewCollection* _tmp6_;
		GeeList* _tmp7_;
		GeeCollection* _tmp8_;
		_tmp3_ = print_manager_get_instance ();
		_tmp4_ = _tmp3_;
		_tmp5_ = page_get_view ((Page*) self);
		_tmp6_ = _tmp5_;
		_tmp7_ = view_collection_get_selected_sources_of_type (_tmp6_, TYPE_PHOTO);
		_tmp8_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_COLLECTION, GeeCollection);
		print_manager_spool_photo (_tmp4_, _tmp8_);
		_g_object_unref0 (_tmp8_);
		_data_collection_unref0 (_tmp6_);
		_print_manager_unref0 (_tmp4_);
	}
}

static void
library_photo_page_on_export (LibraryPhotoPage* self)
{
	ExportDialog* export_dialog = NULL;
	ExportDialog* _tmp0_;
	gint scale = 0;
	ScaleConstraint constraint = 0;
	ExportFormatParameters export_params = {0};
	ExportFormatParameters _tmp1_ = {0};
	ExportDialog* _tmp2_;
	gint _tmp3_ = 0;
	ScaleConstraint _tmp4_ = 0;
	gboolean _tmp5_;
	GFile* save_as = NULL;
	Photo* _tmp6_;
	Photo* _tmp7_;
	ExportFormatParameters _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GFile* _tmp11_;
	GFile* _tmp12_;
	GFile* _tmp13_;
	Scaling scaling = {0};
	Scaling _tmp14_ = {0};
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	if (!editing_host_page_has_photo ((EditingHostPage*) self)) {
		return;
	}
	_tmp0_ = export_dialog_new (_ ("Export Photo"));
	g_object_ref_sink (_tmp0_);
	export_dialog = _tmp0_;
	export_format_parameters_last (&_tmp1_);
	export_params = _tmp1_;
	_tmp2_ = export_dialog;
	_tmp5_ = export_dialog_execute (_tmp2_, &_tmp3_, &_tmp4_, &export_params);
	scale = _tmp3_;
	constraint = _tmp4_;
	if (!_tmp5_) {
		_g_object_unref0 (export_dialog);
		return;
	}
	_tmp6_ = editing_host_page_get_photo ((EditingHostPage*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = export_params;
	_tmp9_ = photo_get_export_basename_for_parameters (_tmp7_, &_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = export_ui_choose_file (_tmp10_);
	_tmp12_ = _tmp11_;
	_g_free0 (_tmp10_);
	_g_object_unref0 (_tmp7_);
	save_as = _tmp12_;
	_tmp13_ = save_as;
	if (_tmp13_ == NULL) {
		_g_object_unref0 (save_as);
		_g_object_unref0 (export_dialog);
		return;
	}
	scaling_for_constraint (constraint, scale, FALSE, &_tmp14_);
	scaling = _tmp14_;
	{
		Photo* _tmp15_;
		Photo* _tmp16_;
		GFile* _tmp17_;
		Scaling _tmp18_;
		ExportFormatParameters _tmp19_;
		Photo* _tmp20_;
		Photo* _tmp21_;
		ExportFormatParameters _tmp22_;
		ExportFormatParameters _tmp23_;
		ExportFormatParameters _tmp24_;
		_tmp15_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp16_ = _tmp15_;
		_tmp17_ = save_as;
		_tmp18_ = scaling;
		_tmp19_ = export_params;
		_tmp20_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp21_ = _tmp20_;
		_tmp22_ = export_params;
		_tmp23_ = export_params;
		_tmp24_ = export_params;
		photo_export (_tmp16_, _tmp17_, &_tmp18_, _tmp19_.quality, photo_get_export_format_for_parameters (_tmp21_, &_tmp22_), _tmp23_.mode == EXPORT_FORMAT_MODE_UNMODIFIED, _tmp24_.export_metadata, &_inner_error0_);
		_g_object_unref0 (_tmp21_);
		_g_object_unref0 (_tmp16_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GFile* _tmp25_;
		gchar* _tmp26_;
		gchar* _tmp27_;
		GError* _tmp28_;
		const gchar* _tmp29_;
		gchar* _tmp30_;
		gchar* _tmp31_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp25_ = save_as;
		_tmp26_ = g_file_get_path (_tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = err;
		_tmp29_ = _tmp28_->message;
		_tmp30_ = g_strdup_printf (_ ("Unable to export %s: %s"), _tmp27_, _tmp29_);
		_tmp31_ = _tmp30_;
		app_window_error_message (_tmp31_, NULL, NULL);
		_g_free0 (_tmp31_);
		_g_free0 (_tmp27_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (save_as);
		_g_object_unref0 (export_dialog);
		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 (save_as);
	_g_object_unref0 (export_dialog);
}

static void
library_photo_page_update_development_menu_item_sensitivity (LibraryPhotoPage* self)
{
	PhotoFileFormat format = 0;
	Photo* _tmp0_;
	Photo* _tmp1_;
	PhotoFileFormat _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = editing_host_page_get_photo ((EditingHostPage*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = photo_get_master_file_format (_tmp1_);
	_g_object_unref0 (_tmp1_);
	format = _tmp2_;
	page_set_action_sensitive ((Page*) self, "RawDeveloper", format == PHOTO_FILE_FORMAT_RAW);
	if (format == PHOTO_FILE_FORMAT_RAW) {
		Photo* _tmp3_;
		Photo* _tmp4_;
		gboolean _tmp5_ = FALSE;
		Photo* _tmp6_;
		Photo* _tmp7_;
		gboolean _tmp8_;
		Photo* _tmp11_;
		Photo* _tmp12_;
		RawDeveloper _tmp13_;
		_tmp3_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp4_ = _tmp3_;
		page_set_action_sensitive ((Page*) self, "RawDeveloperShotwell", photo_is_raw_developer_available (_tmp4_, RAW_DEVELOPER_SHOTWELL));
		_g_object_unref0 (_tmp4_);
		_tmp6_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp7_ = _tmp6_;
		_tmp8_ = photo_is_raw_developer_available (_tmp7_, RAW_DEVELOPER_EMBEDDED);
		_g_object_unref0 (_tmp7_);
		if (_tmp8_) {
			_tmp5_ = TRUE;
		} else {
			Photo* _tmp9_;
			Photo* _tmp10_;
			_tmp9_ = editing_host_page_get_photo ((EditingHostPage*) self);
			_tmp10_ = _tmp9_;
			_tmp5_ = photo_is_raw_developer_available (_tmp10_, RAW_DEVELOPER_CAMERA);
			_g_object_unref0 (_tmp10_);
		}
		page_set_action_sensitive ((Page*) self, "RawDeveloperCamera", _tmp5_);
		_tmp11_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp12_ = _tmp11_;
		_tmp13_ = photo_get_raw_developer (_tmp12_);
		_g_object_unref0 (_tmp12_);
		switch (_tmp13_) {
			case RAW_DEVELOPER_SHOTWELL:
			{
				page_activate_action ((Page*) self, "RawDeveloperShotwell");
				break;
			}
			case RAW_DEVELOPER_CAMERA:
			case RAW_DEVELOPER_EMBEDDED:
			{
				page_activate_action ((Page*) self, "RawDeveloperCamera");
				break;
			}
			default:
			{
				g_assert_not_reached ();
			}
		}
	}
}

static void
library_photo_page_on_metadata_altered (LibraryPhotoPage* self,
                                        GeeMap* map)
{
	gboolean _tmp0_ = FALSE;
	Photo* _tmp1_;
	Photo* _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (map != NULL);
	if (editing_host_page_has_photo ((EditingHostPage*) self)) {
		editing_host_page_update_enhance_action ((EditingHostPage*) self);
	}
	_tmp1_ = editing_host_page_get_photo ((EditingHostPage*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = gee_map_has_key (map, (DataObject*) _tmp2_);
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		Photo* _tmp4_;
		Photo* _tmp5_;
		gpointer _tmp6_;
		Alteration* _tmp7_;
		_tmp4_ = editing_host_page_get_photo ((EditingHostPage*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_map_get (map, (DataObject*) _tmp5_);
		_tmp7_ = (Alteration*) _tmp6_;
		_tmp0_ = alteration_has_subject (_tmp7_, "metadata");
		_alteration_unref0 (_tmp7_);
		_g_object_unref0 (_tmp5_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		single_photo_page_repaint ((SinglePhotoPage*) self, NULL);
	}
}

static gboolean
library_photo_page_library_photo_page_view_filter_real_predicate (ViewFilter* base,
                                                                  DataView* view)
{
	LibraryPhotoPageLibraryPhotoPageViewFilter * self;
	DataSource* _tmp0_;
	DataSource* _tmp1_;
	gboolean result;
	self = (LibraryPhotoPageLibraryPhotoPageViewFilter*) base;
	g_return_val_if_fail (view != NULL, FALSE);
	_tmp0_ = data_view_get_source (view);
	_tmp1_ = _tmp0_;
	result = !media_source_is_trashed (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_MEDIA_SOURCE, MediaSource));
	return result;
}

static LibraryPhotoPageLibraryPhotoPageViewFilter*
library_photo_page_library_photo_page_view_filter_construct (GType object_type)
{
	LibraryPhotoPageLibraryPhotoPageViewFilter* self = NULL;
	self = (LibraryPhotoPageLibraryPhotoPageViewFilter*) view_filter_construct (object_type);
	return self;
}

static LibraryPhotoPageLibraryPhotoPageViewFilter*
library_photo_page_library_photo_page_view_filter_new (void)
{
	return library_photo_page_library_photo_page_view_filter_construct (LIBRARY_PHOTO_PAGE_TYPE_LIBRARY_PHOTO_PAGE_VIEW_FILTER);
}

static void
library_photo_page_library_photo_page_view_filter_class_init (LibraryPhotoPageLibraryPhotoPageViewFilterClass * klass,
                                                              gpointer klass_data)
{
	library_photo_page_library_photo_page_view_filter_parent_class = g_type_class_peek_parent (klass);
	((ViewFilterClass *) klass)->predicate = (gboolean (*) (ViewFilter*, DataView*)) library_photo_page_library_photo_page_view_filter_real_predicate;
}

static void
library_photo_page_library_photo_page_view_filter_instance_init (LibraryPhotoPageLibraryPhotoPageViewFilter * self,
                                                                 gpointer klass)
{
}

static GType
library_photo_page_library_photo_page_view_filter_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LibraryPhotoPageLibraryPhotoPageViewFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_photo_page_library_photo_page_view_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryPhotoPageLibraryPhotoPageViewFilter), 0, (GInstanceInitFunc) library_photo_page_library_photo_page_view_filter_instance_init, NULL };
	GType library_photo_page_library_photo_page_view_filter_type_id;
	library_photo_page_library_photo_page_view_filter_type_id = g_type_register_static (TYPE_VIEW_FILTER, "LibraryPhotoPageLibraryPhotoPageViewFilter", &g_define_type_info, 0);
	return library_photo_page_library_photo_page_view_filter_type_id;
}

static GType
library_photo_page_library_photo_page_view_filter_get_type (void)
{
	static volatile gsize library_photo_page_library_photo_page_view_filter_type_id__once = 0;
	if (g_once_init_enter (&library_photo_page_library_photo_page_view_filter_type_id__once)) {
		GType library_photo_page_library_photo_page_view_filter_type_id;
		library_photo_page_library_photo_page_view_filter_type_id = library_photo_page_library_photo_page_view_filter_get_type_once ();
		g_once_init_leave (&library_photo_page_library_photo_page_view_filter_type_id__once, library_photo_page_library_photo_page_view_filter_type_id);
	}
	return library_photo_page_library_photo_page_view_filter_type_id__once;
}

static void
library_photo_page_class_init (LibraryPhotoPageClass * klass,
                               gpointer klass_data)
{
	library_photo_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LibraryPhotoPage_private_offset);
	((PageClass *) klass)->add_toolbar_widgets = (void (*) (Page*, GtkActionBar*)) library_photo_page_real_add_toolbar_widgets;
	((PageClass *) klass)->get_header_buttons = (GtkBox* (*) (Page*)) library_photo_page_real_get_header_buttons;
	((PageClass *) klass)->init_collect_action_entries = (GtkActionEntry* (*) (Page*, gint*)) library_photo_page_real_init_collect_action_entries;
	((PageClass *) klass)->init_collect_toggle_action_entries = (GtkToggleActionEntry* (*) (Page*, gint*)) library_photo_page_real_init_collect_toggle_action_entries;
	((PageClass *) klass)->register_radio_actions = (void (*) (Page*, GtkActionGroup*)) library_photo_page_real_register_radio_actions;
	((PageClass *) klass)->update_actions = (void (*) (Page*, gint, gint)) library_photo_page_real_update_actions;
	((LibraryPhotoPageClass *) klass)->developer_changed = (void (*) (LibraryPhotoPage*, RawDeveloper)) library_photo_page_real_developer_changed;
	((PageClass *) klass)->switched_to = (void (*) (Page*)) library_photo_page_real_switched_to;
	((EditingHostPageClass *) klass)->get_bottom_left_trinket = (GdkPixbuf* (*) (EditingHostPage*, gint)) library_photo_page_real_get_bottom_left_trinket;
	((EditingHostPageClass *) klass)->get_top_right_trinket = (GdkPixbuf* (*) (EditingHostPage*, gint)) library_photo_page_real_get_top_right_trinket;
	((EditingHostPageClass *) klass)->on_increase_size = (void (*) (EditingHostPage*)) library_photo_page_real_on_increase_size;
	((EditingHostPageClass *) klass)->on_decrease_size = (void (*) (EditingHostPage*)) library_photo_page_real_on_decrease_size;
	((EditingHostPageClass *) klass)->on_zoom_assembly_key_press = (gboolean (*) (EditingHostPage*, GdkEventKey*)) library_photo_page_real_on_zoom_assembly_key_press;
	((EditingHostPageClass *) klass)->update_ui = (void (*) (EditingHostPage*, gboolean)) library_photo_page_real_update_ui;
	((EditingHostPageClass *) klass)->notify_photo_backing_missing = (void (*) (EditingHostPage*, Photo*, gboolean)) library_photo_page_real_notify_photo_backing_missing;
	((GtkWidgetClass *) klass)->key_press_event = (gboolean (*) (GtkWidget*, GdkEventKey*)) library_photo_page_real_key_press_event;
	((EditingHostPageClass *) klass)->on_double_click = (gboolean (*) (EditingHostPage*, GdkEventButton*)) library_photo_page_real_on_double_click;
	((PageClass *) klass)->on_left_released = (gboolean (*) (Page*, GdkEventButton*)) library_photo_page_real_on_left_released;
	((PageClass *) klass)->on_context_buttonpress = (gboolean (*) (Page*, GdkEventButton*)) library_photo_page_real_on_context_buttonpress;
	((PageClass *) klass)->on_context_keypress = (gboolean (*) (Page*)) library_photo_page_real_on_context_keypress;
	G_OBJECT_CLASS (klass)->finalize = library_photo_page_finalize;
}

static void
library_photo_page_instance_init (LibraryPhotoPage * self,
                                  gpointer klass)
{
	LibraryPhotoPageLibraryPhotoPageViewFilter* _tmp0_;
	self->priv = library_photo_page_get_instance_private (self);
	self->priv->return_page = NULL;
	self->priv->return_to_collection_on_release = FALSE;
	_tmp0_ = library_photo_page_library_photo_page_view_filter_new ();
	self->priv->filter = _tmp0_;
}

static void
library_photo_page_finalize (GObject * obj)
{
	LibraryPhotoPage * self;
	LibraryPhotoSourceCollection* _tmp0_;
	guint _tmp1_;
	LibraryPhotoSourceCollection* _tmp2_;
	guint _tmp3_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_LIBRARY_PHOTO_PAGE, LibraryPhotoPage);
	_tmp0_ = library_photo_global;
	g_signal_parse_name ("item-destroyed", TYPE_SOURCE_COLLECTION, &_tmp1_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((SourceCollection*) _tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _library_photo_page_on_photo_destroyed_source_collection_item_destroyed, self);
	_tmp2_ = library_photo_global;
	g_signal_parse_name ("items-altered", TYPE_DATA_COLLECTION, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched ((DataCollection*) _tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _library_photo_page_on_metadata_altered_data_collection_items_altered, self);
	_g_object_unref0 (self->priv->return_page);
	_view_filter_unref0 (self->priv->filter);
	_g_object_unref0 (self->priv->contractor_menu);
	_g_object_unref0 (self->priv->item_context_menu);
	G_OBJECT_CLASS (library_photo_page_parent_class)->finalize (obj);
}

static GType
library_photo_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LibraryPhotoPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) library_photo_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LibraryPhotoPage), 0, (GInstanceInitFunc) library_photo_page_instance_init, NULL };
	GType library_photo_page_type_id;
	library_photo_page_type_id = g_type_register_static (TYPE_EDITING_HOST_PAGE, "LibraryPhotoPage", &g_define_type_info, 0);
	LibraryPhotoPage_private_offset = g_type_add_instance_private (library_photo_page_type_id, sizeof (LibraryPhotoPagePrivate));
	return library_photo_page_type_id;
}

GType
library_photo_page_get_type (void)
{
	static volatile gsize library_photo_page_type_id__once = 0;
	if (g_once_init_enter (&library_photo_page_type_id__once)) {
		GType library_photo_page_type_id;
		library_photo_page_type_id = library_photo_page_get_type_once ();
		g_once_init_leave (&library_photo_page_type_id__once, library_photo_page_type_id);
	}
	return library_photo_page_type_id__once;
}

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

