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

/*
* Copyright (c) 2010-2013 Yorba Foundation
*               2018 elementary LLC. (https://elementary.io)
*
* 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-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <glib/gi18n-lib.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 TRASH_PAGE_TYPE_TRASH_SEARCH_VIEW_FILTER (trash_page_trash_search_view_filter_get_type ())
#define TRASH_PAGE_TRASH_SEARCH_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRASH_PAGE_TYPE_TRASH_SEARCH_VIEW_FILTER, TrashPageTrashSearchViewFilter))
#define TRASH_PAGE_TRASH_SEARCH_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRASH_PAGE_TYPE_TRASH_SEARCH_VIEW_FILTER, TrashPageTrashSearchViewFilterClass))
#define TRASH_PAGE_IS_TRASH_SEARCH_VIEW_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRASH_PAGE_TYPE_TRASH_SEARCH_VIEW_FILTER))
#define TRASH_PAGE_IS_TRASH_SEARCH_VIEW_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRASH_PAGE_TYPE_TRASH_SEARCH_VIEW_FILTER))
#define TRASH_PAGE_TRASH_SEARCH_VIEW_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRASH_PAGE_TYPE_TRASH_SEARCH_VIEW_FILTER, TrashPageTrashSearchViewFilterClass))

typedef struct _TrashPageTrashSearchViewFilter TrashPageTrashSearchViewFilter;
typedef struct _TrashPageTrashSearchViewFilterClass TrashPageTrashSearchViewFilterClass;
enum  {
	TRASH_PAGE_0_PROPERTY,
	TRASH_PAGE_NUM_PROPERTIES
};
static GParamSpec* trash_page_properties[TRASH_PAGE_NUM_PROPERTIES];
#define _view_filter_unref0(var) ((var == NULL) ? NULL : (var = (view_filter_unref (var), NULL)))
#define _core_tracker_unref0(var) ((var == NULL) ? NULL : (var = (core_tracker_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
typedef struct _Block26Data Block26Data;
typedef struct _Block27Data Block27Data;
typedef struct _Block28Data Block28Data;

#define TRASH_PAGE_TYPE_TRASH_VIEW (trash_page_trash_view_get_type ())
#define TRASH_PAGE_TRASH_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRASH_PAGE_TYPE_TRASH_VIEW, TrashPageTrashView))
#define TRASH_PAGE_TRASH_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRASH_PAGE_TYPE_TRASH_VIEW, TrashPageTrashViewClass))
#define TRASH_PAGE_IS_TRASH_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRASH_PAGE_TYPE_TRASH_VIEW))
#define TRASH_PAGE_IS_TRASH_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRASH_PAGE_TYPE_TRASH_VIEW))
#define TRASH_PAGE_TRASH_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRASH_PAGE_TYPE_TRASH_VIEW, TrashPageTrashViewClass))

typedef struct _TrashPageTrashView TrashPageTrashView;
typedef struct _TrashPageTrashViewClass TrashPageTrashViewClass;
#define _command_manager_unref0(var) ((var == NULL) ? NULL : (var = (command_manager_unref (var), NULL)))
typedef struct _TrashPageTrashViewPrivate TrashPageTrashViewPrivate;
enum  {
	TRASH_PAGE_TRASH_VIEW_0_PROPERTY,
	TRASH_PAGE_TRASH_VIEW_NUM_PROPERTIES
};
static GParamSpec* trash_page_trash_view_properties[TRASH_PAGE_TRASH_VIEW_NUM_PROPERTIES];
typedef struct _TrashPageTrashSearchViewFilterPrivate TrashPageTrashSearchViewFilterPrivate;
#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 _TrashPagePrivate {
	TrashPageTrashSearchViewFilter* search_filter;
	MediaViewTracker* tracker;
	GtkMenu* page_sidebar_menu;
	GtkMenu* item_context_menu;
	GtkMenu* page_context_menu;
};

struct _Block26Data {
	int _ref_count_;
	TrashPage* self;
	GtkAction* delete_action;
	GtkAction* restore_action;
	GAction* jump_menu_action;
	GtkAction* empty_trash_action;
};

struct _Block27Data {
	int _ref_count_;
	TrashPage* self;
	GtkRadioMenuItem* ascending_menu_item;
	GtkAction* ascending_action;
	GtkRadioMenuItem* descending_menu_item;
	GtkAction* descending_action;
	GAction* select_action;
};

struct _Block28Data {
	int _ref_count_;
	TrashPage* self;
	GtkAction* empty_trash_action;
};

struct _TrashPageTrashView {
	Thumbnail parent_instance;
	TrashPageTrashViewPrivate * priv;
};

struct _TrashPageTrashViewClass {
	ThumbnailClass parent_class;
};

struct _TrashPageTrashSearchViewFilter {
	DefaultSearchViewFilter parent_instance;
	TrashPageTrashSearchViewFilterPrivate * priv;
};

struct _TrashPageTrashSearchViewFilterClass {
	DefaultSearchViewFilterClass parent_class;
};

static gint TrashPage_private_offset;
static gpointer trash_page_parent_class = NULL;
static gpointer trash_page_trash_view_parent_class = NULL;
static gpointer trash_page_trash_search_view_filter_parent_class = NULL;

static GType trash_page_trash_search_view_filter_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static TrashPageTrashSearchViewFilter* trash_page_trash_search_view_filter_new (void);
static TrashPageTrashSearchViewFilter* trash_page_trash_search_view_filter_construct (GType object_type);
static void trash_page_on_trashcan_contents_altered (TrashPage* self,
                                              GeeCollection* added,
                                              GeeCollection* removed);
static void _trash_page_on_trashcan_contents_altered_media_source_collection_trashcan_contents_altered (MediaSourceCollection* _sender,
                                                                                                 GeeCollection* added,
                                                                                                 GeeCollection* removed,
                                                                                                 gpointer self);
static void trash_page_real_add_toolbar_widgets (Page* base,
                                          GtkActionBar* toolbar);
static void trash_page_on_restore (TrashPage* self);
static void _trash_page_on_restore_gtk_button_clicked (GtkButton* _sender,
                                                gpointer self);
static void trash_page_on_delete (TrashPage* self);
static void _trash_page_on_delete_gtk_button_clicked (GtkButton* _sender,
                                               gpointer self);
static void _trash_page_on_empty_trash_gtk_button_clicked (GtkButton* _sender,
                                                    gpointer self);
static void trash_page_on_show_sidebar (TrashPage* self);
static void _trash_page_on_show_sidebar_gtk_button_clicked (GtkButton* _sender,
                                                     gpointer self);
static GtkMenu* trash_page_real_get_item_context_menu (CheckerboardPage* base);
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
static void ___lambda108_ (Block26Data* _data26_);
static void ____lambda108__gtk_menu_item_activate (GtkMenuItem* _sender,
                                            gpointer self);
static void ___lambda109_ (Block26Data* _data26_);
static void ____lambda109__gtk_menu_item_activate (GtkMenuItem* _sender,
                                            gpointer self);
static void ___lambda110_ (Block26Data* _data26_);
static void ____lambda110__gtk_menu_item_activate (GtkMenuItem* _sender,
                                            gpointer self);
static void ___lambda111_ (Block26Data* _data26_);
static void ____lambda111__gtk_menu_item_activate (GtkMenuItem* _sender,
                                            gpointer self);
static GtkMenu* trash_page_real_get_page_context_menu (Page* base);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
static void ___lambda112_ (Block27Data* _data27_);
static void ____lambda112__gtk_menu_item_activate (GtkMenuItem* _sender,
                                            gpointer self);
static void ___lambda113_ (Block27Data* _data27_);
static void ____lambda113__gtk_menu_item_activate (GtkMenuItem* _sender,
                                            gpointer self);
static void ___lambda114_ (Block27Data* _data27_);
static void ____lambda114__gtk_menu_item_activate (GtkMenuItem* _sender,
                                            gpointer self);
static GtkMenu* trash_page_real_get_page_sidebar_menu (Page* base);
static Block28Data* block28_data_ref (Block28Data* _data28_);
static void block28_data_unref (void * _userdata_);
static void ___lambda115_ (Block28Data* _data28_);
static void ____lambda115__gtk_menu_item_activate (GtkMenuItem* _sender,
                                            gpointer self);
static GtkActionEntry* trash_page_real_init_collect_action_entries (Page* base,
                                                             gint* result_length1);
static void _trash_page_on_delete_gcallback (GtkAction* action,
                                      gpointer self);
static void _vala_array_add221 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _trash_page_on_restore_gcallback (GtkAction* action,
                                       gpointer self);
static void _vala_array_add222 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static void _trash_page_on_empty_trash_gcallback (GtkAction* action,
                                           gpointer self);
static void _vala_array_add223 (GtkActionEntry* * array,
                         gint* length,
                         gint* size,
                         const GtkActionEntry* value);
static CoreViewTracker* trash_page_real_get_view_tracker (CheckerboardPage* base);
static void trash_page_real_update_actions (Page* base,
                                     gint selected_count,
                                     gint count);
static gboolean trash_page_can_empty_trash (TrashPage* self);
static TrashPageTrashView* trash_page_trash_view_new (MediaSource* source);
static TrashPageTrashView* trash_page_trash_view_construct (GType object_type,
                                                     MediaSource* source);
static GType trash_page_trash_view_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static gchar* trash_page_real_get_view_empty_message (CheckerboardPage* base);
static SearchViewFilter* trash_page_real_get_search_view_filter (CheckerboardPage* base);
static GType trash_page_trash_view_get_type_once (void);
static guint trash_page_trash_search_view_filter_real_get_criteria (SearchViewFilter* base);
static GType trash_page_trash_search_view_filter_get_type_once (void);
static void trash_page_finalize (GObject * obj);
static GType trash_page_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
trash_page_get_instance_private (TrashPage* self)
{
	return G_STRUCT_MEMBER_P (self, TrashPage_private_offset);
}

static void
_trash_page_on_trashcan_contents_altered_media_source_collection_trashcan_contents_altered (MediaSourceCollection* _sender,
                                                                                            GeeCollection* added,
                                                                                            GeeCollection* removed,
                                                                                            gpointer self)
{
	trash_page_on_trashcan_contents_altered ((TrashPage*) self, added, removed);
}

TrashPage*
trash_page_construct (GType object_type)
{
	TrashPage * self = NULL;
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	MediaViewTracker* _tmp2_;
	LibraryPhotoSourceCollection* _tmp3_;
	VideoSourceCollection* _tmp4_;
	LibraryPhotoSourceCollection* _tmp5_;
	GeeCollection* _tmp6_;
	GeeCollection* _tmp7_;
	VideoSourceCollection* _tmp8_;
	GeeCollection* _tmp9_;
	GeeCollection* _tmp10_;
	self = (TrashPage*) checkerboard_page_construct (object_type, TRASH_PAGE_NAME);
	_tmp0_ = page_get_view ((Page*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = media_view_tracker_new (_tmp1_);
	_core_tracker_unref0 (self->priv->tracker);
	self->priv->tracker = _tmp2_;
	_data_collection_unref0 (_tmp1_);
	_tmp3_ = library_photo_global;
	g_signal_connect_object ((MediaSourceCollection*) _tmp3_, "trashcan-contents-altered", (GCallback) _trash_page_on_trashcan_contents_altered_media_source_collection_trashcan_contents_altered, self, 0);
	_tmp4_ = video_global;
	g_signal_connect_object ((MediaSourceCollection*) _tmp4_, "trashcan-contents-altered", (GCallback) _trash_page_on_trashcan_contents_altered_media_source_collection_trashcan_contents_altered, self, 0);
	_tmp5_ = library_photo_global;
	_tmp6_ = media_source_collection_get_trashcan_contents ((MediaSourceCollection*) _tmp5_);
	_tmp7_ = _tmp6_;
	trash_page_on_trashcan_contents_altered (self, _tmp7_, NULL);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = video_global;
	_tmp9_ = media_source_collection_get_trashcan_contents ((MediaSourceCollection*) _tmp8_);
	_tmp10_ = _tmp9_;
	trash_page_on_trashcan_contents_altered (self, _tmp10_, NULL);
	_g_object_unref0 (_tmp10_);
	return self;
}

TrashPage*
trash_page_new (void)
{
	return trash_page_construct (TYPE_TRASH_PAGE);
}

static void
_trash_page_on_restore_gtk_button_clicked (GtkButton* _sender,
                                           gpointer self)
{
	trash_page_on_restore ((TrashPage*) self);
}

static void
_trash_page_on_delete_gtk_button_clicked (GtkButton* _sender,
                                          gpointer self)
{
	trash_page_on_delete ((TrashPage*) self);
}

static void
_trash_page_on_empty_trash_gtk_button_clicked (GtkButton* _sender,
                                               gpointer self)
{
	trash_page_on_empty_trash ((TrashPage*) self);
}

static void
_trash_page_on_show_sidebar_gtk_button_clicked (GtkButton* _sender,
                                                gpointer self)
{
	trash_page_on_show_sidebar ((TrashPage*) self);
}

static void
trash_page_real_add_toolbar_widgets (Page* base,
                                     GtkActionBar* toolbar)
{
	TrashPage * self;
	LibraryWindow* app = NULL;
	AppWindow* _tmp0_;
	LibraryWindow* _tmp1_;
	GtkButton* restore_button = NULL;
	GtkButton* _tmp2_;
	GtkToolItem* restore_tool = NULL;
	GtkToolItem* _tmp3_;
	GtkAction* restore_action = NULL;
	GtkAction* _tmp4_;
	GtkButton* delete_button = NULL;
	GtkButton* _tmp5_;
	GtkToolItem* delete_tool = NULL;
	GtkToolItem* _tmp6_;
	GtkAction* delete_action = NULL;
	GtkAction* _tmp7_;
	GtkButton* empty_trash_button = NULL;
	GtkButton* _tmp8_;
	GtkStyleContext* _tmp9_;
	GtkToolItem* empty_trash_tool = NULL;
	GtkToolItem* _tmp10_;
	GtkAction* empty_trash_action = NULL;
	GtkAction* _tmp11_;
	GtkButton* _tmp12_;
	GtkButton* _tmp13_;
	GtkSeparator* _tmp14_;
	GtkSeparator* _tmp15_;
	GtkButton* _tmp16_;
	self = (TrashPage*) base;
	g_return_if_fail (toolbar != NULL);
	_tmp0_ = app_window_get_instance ();
	_tmp1_ = IS_LIBRARY_WINDOW (_tmp0_) ? ((LibraryWindow*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	app = _tmp1_;
	_tmp2_ = (GtkButton*) gtk_button_new_with_mnemonic (RESOURCES_RESTORE_PHOTOS_MENU);
	g_object_ref_sink (_tmp2_);
	restore_button = _tmp2_;
	gtk_widget_set_margin_end ((GtkWidget*) restore_button, 3);
	gtk_widget_set_margin_start ((GtkWidget*) restore_button, 3);
	g_signal_connect_object (restore_button, "clicked", (GCallback) _trash_page_on_restore_gtk_button_clicked, self, 0);
	gtk_widget_set_tooltip_text ((GtkWidget*) restore_button, RESOURCES_RESTORE_PHOTOS_TOOLTIP);
	_tmp3_ = gtk_tool_item_new ();
	g_object_ref_sink (_tmp3_);
	restore_tool = _tmp3_;
	gtk_container_add ((GtkContainer*) restore_tool, (GtkWidget*) restore_button);
	_tmp4_ = page_get_action ((Page*) self, "Restore");
	restore_action = _tmp4_;
	g_object_bind_property_with_closures ((GObject*) restore_action, "sensitive", (GObject*) restore_button, "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)));
	_tmp5_ = (GtkButton*) gtk_button_new_with_mnemonic (RESOURCES_DELETE_PHOTOS_MENU);
	g_object_ref_sink (_tmp5_);
	delete_button = _tmp5_;
	gtk_widget_set_margin_end ((GtkWidget*) delete_button, 3);
	gtk_widget_set_margin_start ((GtkWidget*) delete_button, 3);
	gtk_widget_set_tooltip_text ((GtkWidget*) delete_button, RESOURCES_DELETE_FROM_TRASH_TOOLTIP);
	g_signal_connect_object (delete_button, "clicked", (GCallback) _trash_page_on_delete_gtk_button_clicked, self, 0);
	_tmp6_ = gtk_tool_item_new ();
	g_object_ref_sink (_tmp6_);
	delete_tool = _tmp6_;
	gtk_container_add ((GtkContainer*) delete_tool, (GtkWidget*) delete_button);
	_tmp7_ = page_get_action ((Page*) self, "Delete");
	delete_action = _tmp7_;
	g_object_bind_property_with_closures ((GObject*) delete_action, "sensitive", (GObject*) delete_button, "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)));
	_tmp8_ = (GtkButton*) gtk_button_new_with_mnemonic (_ ("_Empty Trash"));
	g_object_ref_sink (_tmp8_);
	empty_trash_button = _tmp8_;
	gtk_widget_set_margin_end ((GtkWidget*) empty_trash_button, 3);
	gtk_widget_set_margin_start ((GtkWidget*) empty_trash_button, 3);
	gtk_widget_set_tooltip_text ((GtkWidget*) empty_trash_button, _ ("Delete all photos in the trash"));
	_tmp9_ = gtk_widget_get_style_context ((GtkWidget*) empty_trash_button);
	gtk_style_context_add_class (_tmp9_, GTK_STYLE_CLASS_DESTRUCTIVE_ACTION);
	g_signal_connect_object (empty_trash_button, "clicked", (GCallback) _trash_page_on_empty_trash_gtk_button_clicked, self, 0);
	_tmp10_ = gtk_tool_item_new ();
	g_object_ref_sink (_tmp10_);
	empty_trash_tool = _tmp10_;
	gtk_container_add ((GtkContainer*) empty_trash_tool, (GtkWidget*) empty_trash_button);
	_tmp11_ = page_get_action ((Page*) self, "EmptyTrash");
	empty_trash_action = _tmp11_;
	g_object_bind_property_with_closures ((GObject*) empty_trash_action, "sensitive", (GObject*) empty_trash_button, "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)));
	_tmp12_ = media_page_create_sidebar_button ();
	_g_object_unref0 (((Page*) self)->show_sidebar_button);
	((Page*) self)->show_sidebar_button = _tmp12_;
	_tmp13_ = ((Page*) self)->show_sidebar_button;
	g_signal_connect_object (_tmp13_, "clicked", (GCallback) _trash_page_on_show_sidebar_gtk_button_clicked, self, 0);
	gtk_action_bar_pack_start (toolbar, (GtkWidget*) restore_tool);
	gtk_action_bar_pack_start (toolbar, (GtkWidget*) delete_tool);
	gtk_action_bar_pack_start (toolbar, (GtkWidget*) empty_trash_tool);
	_tmp14_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp14_);
	_tmp15_ = _tmp14_;
	gtk_action_bar_pack_end (toolbar, (GtkWidget*) _tmp15_);
	_g_object_unref0 (_tmp15_);
	_tmp16_ = ((Page*) self)->show_sidebar_button;
	gtk_action_bar_pack_end (toolbar, (GtkWidget*) _tmp16_);
	page_update_sidebar_action ((Page*) self, !library_window_is_metadata_sidebar_visible (app));
	PAGE_CLASS (trash_page_parent_class)->add_toolbar_widgets ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), toolbar);
	_g_object_unref0 (empty_trash_action);
	_g_object_unref0 (empty_trash_tool);
	_g_object_unref0 (empty_trash_button);
	_g_object_unref0 (delete_action);
	_g_object_unref0 (delete_tool);
	_g_object_unref0 (delete_button);
	_g_object_unref0 (restore_action);
	_g_object_unref0 (restore_tool);
	_g_object_unref0 (restore_button);
	_g_object_unref0 (app);
}

static Block26Data*
block26_data_ref (Block26Data* _data26_)
{
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}

static void
block26_data_unref (void * _userdata_)
{
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		TrashPage* self;
		self = _data26_->self;
		_g_object_unref0 (_data26_->empty_trash_action);
		_g_object_unref0 (_data26_->jump_menu_action);
		_g_object_unref0 (_data26_->restore_action);
		_g_object_unref0 (_data26_->delete_action);
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}

static void
___lambda108_ (Block26Data* _data26_)
{
	TrashPage* self;
	GtkAction* _tmp0_;
	self = _data26_->self;
	_tmp0_ = _data26_->delete_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda108__gtk_menu_item_activate (GtkMenuItem* _sender,
                                       gpointer self)
{
	___lambda108_ (self);
}

static void
___lambda109_ (Block26Data* _data26_)
{
	TrashPage* self;
	GtkAction* _tmp0_;
	self = _data26_->self;
	_tmp0_ = _data26_->restore_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda109__gtk_menu_item_activate (GtkMenuItem* _sender,
                                       gpointer self)
{
	___lambda109_ (self);
}

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

static void
___lambda110_ (Block26Data* _data26_)
{
	TrashPage* self;
	GAction* _tmp0_;
	self = _data26_->self;
	_tmp0_ = _data26_->jump_menu_action;
	g_action_activate (_tmp0_, NULL);
}

static void
____lambda110__gtk_menu_item_activate (GtkMenuItem* _sender,
                                       gpointer self)
{
	___lambda110_ (self);
}

static void
___lambda111_ (Block26Data* _data26_)
{
	TrashPage* self;
	GtkAction* _tmp0_;
	self = _data26_->self;
	_tmp0_ = _data26_->empty_trash_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda111__gtk_menu_item_activate (GtkMenuItem* _sender,
                                       gpointer self)
{
	___lambda111_ (self);
}

static GtkMenu*
trash_page_real_get_item_context_menu (CheckerboardPage* base)
{
	TrashPage * self;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp41_;
	GtkMenu* _tmp42_;
	GtkMenu* result;
	self = (TrashPage*) base;
	_tmp0_ = self->priv->item_context_menu;
	if (_tmp0_ == NULL) {
		Block26Data* _data26_;
		GtkMenu* _tmp1_;
		GtkMenuItem* delete_menu_item = NULL;
		GtkMenuItem* _tmp2_;
		GtkAction* _tmp3_;
		GtkAction* _tmp4_;
		GtkMenuItem* _tmp5_;
		GtkMenuItem* _tmp6_;
		GtkMenuItem* restore_menu_item = NULL;
		GtkMenuItem* _tmp7_;
		GtkAction* _tmp8_;
		GtkAction* _tmp9_;
		GtkMenuItem* _tmp10_;
		GtkMenuItem* _tmp11_;
		GtkMenuItem* jump_menu_item = NULL;
		GtkMenuItem* _tmp12_;
		AppWindow* _tmp13_;
		AppWindow* _tmp14_;
		GAction* _tmp15_;
		GAction* _tmp16_;
		GAction* _tmp17_;
		GAction* _tmp18_;
		GtkMenuItem* _tmp19_;
		GtkMenuItem* _tmp20_;
		GtkMenuItem* empty_menu_item = NULL;
		GtkMenuItem* _tmp21_;
		GtkAction* _tmp22_;
		GtkAction* _tmp23_;
		GtkMenuItem* _tmp24_;
		GtkMenuItem* _tmp25_;
		GtkMenu* _tmp26_;
		GtkMenuItem* _tmp27_;
		GtkMenu* _tmp28_;
		GtkMenuItem* _tmp29_;
		GtkMenu* _tmp30_;
		GtkSeparatorMenuItem* _tmp31_;
		GtkSeparatorMenuItem* _tmp32_;
		GtkMenu* _tmp33_;
		GtkMenuItem* _tmp34_;
		GtkMenu* _tmp35_;
		GtkSeparatorMenuItem* _tmp36_;
		GtkSeparatorMenuItem* _tmp37_;
		GtkMenu* _tmp38_;
		GtkMenuItem* _tmp39_;
		GtkMenu* _tmp40_;
		_data26_ = g_slice_new0 (Block26Data);
		_data26_->_ref_count_ = 1;
		_data26_->self = g_object_ref (self);
		_tmp1_ = (GtkMenu*) gtk_menu_new ();
		g_object_ref_sink (_tmp1_);
		_g_object_unref0 (self->priv->item_context_menu);
		self->priv->item_context_menu = _tmp1_;
		_tmp2_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_DELETE_PHOTOS_MENU);
		g_object_ref_sink (_tmp2_);
		delete_menu_item = _tmp2_;
		_tmp3_ = page_get_action ((Page*) self, "Delete");
		_data26_->delete_action = _tmp3_;
		_tmp4_ = _data26_->delete_action;
		_tmp5_ = delete_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp4_, "sensitive", (GObject*) _tmp5_, "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)));
		_tmp6_ = delete_menu_item;
		g_signal_connect_data (_tmp6_, "activate", (GCallback) ____lambda108__gtk_menu_item_activate, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
		_tmp7_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_RESTORE_PHOTOS_MENU);
		g_object_ref_sink (_tmp7_);
		restore_menu_item = _tmp7_;
		_tmp8_ = page_get_action ((Page*) self, "Restore");
		_data26_->restore_action = _tmp8_;
		_tmp9_ = _data26_->restore_action;
		_tmp10_ = restore_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_ = restore_menu_item;
		g_signal_connect_data (_tmp11_, "activate", (GCallback) ____lambda109__gtk_menu_item_activate, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
		_tmp12_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_JUMP_TO_FILE_MENU);
		g_object_ref_sink (_tmp12_);
		jump_menu_item = _tmp12_;
		_tmp13_ = app_window_get_instance ();
		_tmp14_ = _tmp13_;
		_tmp15_ = g_action_map_lookup_action ((GActionMap*) _tmp14_, APP_WINDOW_ACTION_JUMP_TO_FILE);
		_tmp16_ = _g_object_ref0 (_tmp15_);
		_tmp17_ = _tmp16_;
		_g_object_unref0 (_tmp14_);
		_data26_->jump_menu_action = _tmp17_;
		_tmp18_ = _data26_->jump_menu_action;
		_tmp19_ = jump_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp18_, "enabled", (GObject*) _tmp19_, "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)));
		_tmp20_ = jump_menu_item;
		g_signal_connect_data (_tmp20_, "activate", (GCallback) ____lambda110__gtk_menu_item_activate, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
		_tmp21_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_Empty Trash"));
		g_object_ref_sink (_tmp21_);
		empty_menu_item = _tmp21_;
		_tmp22_ = page_get_action ((Page*) self, "EmptyTrash");
		_data26_->empty_trash_action = _tmp22_;
		_tmp23_ = _data26_->empty_trash_action;
		_tmp24_ = empty_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp23_, "sensitive", (GObject*) _tmp24_, "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)));
		_tmp25_ = empty_menu_item;
		g_signal_connect_data (_tmp25_, "activate", (GCallback) ____lambda111__gtk_menu_item_activate, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
		_tmp26_ = self->priv->item_context_menu;
		_tmp27_ = delete_menu_item;
		gtk_container_add ((GtkContainer*) _tmp26_, (GtkWidget*) _tmp27_);
		_tmp28_ = self->priv->item_context_menu;
		_tmp29_ = restore_menu_item;
		gtk_container_add ((GtkContainer*) _tmp28_, (GtkWidget*) _tmp29_);
		_tmp30_ = self->priv->item_context_menu;
		_tmp31_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp31_);
		_tmp32_ = _tmp31_;
		gtk_container_add ((GtkContainer*) _tmp30_, (GtkWidget*) _tmp32_);
		_g_object_unref0 (_tmp32_);
		_tmp33_ = self->priv->item_context_menu;
		_tmp34_ = jump_menu_item;
		gtk_container_add ((GtkContainer*) _tmp33_, (GtkWidget*) _tmp34_);
		_tmp35_ = self->priv->item_context_menu;
		_tmp36_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp36_);
		_tmp37_ = _tmp36_;
		gtk_container_add ((GtkContainer*) _tmp35_, (GtkWidget*) _tmp37_);
		_g_object_unref0 (_tmp37_);
		_tmp38_ = self->priv->item_context_menu;
		_tmp39_ = empty_menu_item;
		gtk_container_add ((GtkContainer*) _tmp38_, (GtkWidget*) _tmp39_);
		_tmp40_ = self->priv->item_context_menu;
		gtk_widget_show_all ((GtkWidget*) _tmp40_);
		_g_object_unref0 (empty_menu_item);
		_g_object_unref0 (jump_menu_item);
		_g_object_unref0 (restore_menu_item);
		_g_object_unref0 (delete_menu_item);
		block26_data_unref (_data26_);
		_data26_ = NULL;
	}
	_tmp41_ = self->priv->item_context_menu;
	_tmp42_ = _g_object_ref0 (_tmp41_);
	result = _tmp42_;
	return result;
}

static Block27Data*
block27_data_ref (Block27Data* _data27_)
{
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}

static void
block27_data_unref (void * _userdata_)
{
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		TrashPage* self;
		self = _data27_->self;
		_g_object_unref0 (_data27_->select_action);
		_g_object_unref0 (_data27_->descending_action);
		_g_object_unref0 (_data27_->descending_menu_item);
		_g_object_unref0 (_data27_->ascending_action);
		_g_object_unref0 (_data27_->ascending_menu_item);
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}

static void
___lambda112_ (Block27Data* _data27_)
{
	TrashPage* self;
	GtkRadioMenuItem* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data27_->self;
	_tmp0_ = _data27_->ascending_menu_item;
	_tmp1_ = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkAction* _tmp3_;
		_tmp3_ = _data27_->ascending_action;
		gtk_action_activate (_tmp3_);
	}
}

static void
____lambda112__gtk_menu_item_activate (GtkMenuItem* _sender,
                                       gpointer self)
{
	___lambda112_ (self);
}

static void
___lambda113_ (Block27Data* _data27_)
{
	TrashPage* self;
	GtkRadioMenuItem* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data27_->self;
	_tmp0_ = _data27_->descending_menu_item;
	_tmp1_ = gtk_check_menu_item_get_active ((GtkCheckMenuItem*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkAction* _tmp3_;
		_tmp3_ = _data27_->descending_action;
		gtk_action_activate (_tmp3_);
	}
}

static void
____lambda113__gtk_menu_item_activate (GtkMenuItem* _sender,
                                       gpointer self)
{
	___lambda113_ (self);
}

static void
___lambda114_ (Block27Data* _data27_)
{
	TrashPage* self;
	GAction* _tmp0_;
	self = _data27_->self;
	_tmp0_ = _data27_->select_action;
	g_action_activate (_tmp0_, NULL);
}

static void
____lambda114__gtk_menu_item_activate (GtkMenuItem* _sender,
                                       gpointer self)
{
	___lambda114_ (self);
}

static GtkMenu*
trash_page_real_get_page_context_menu (Page* base)
{
	TrashPage * self;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp38_;
	GtkMenu* _tmp39_;
	GtkMenu* result;
	self = (TrashPage*) base;
	_tmp0_ = self->priv->page_context_menu;
	if (_tmp0_ == NULL) {
		Block27Data* _data27_;
		GtkMenu* _tmp1_;
		GtkMenuItem* sort_menu_item = NULL;
		GtkMenuItem* _tmp2_;
		GtkRadioMenuItem* _tmp3_;
		GtkAction* _tmp4_;
		GtkAction* _tmp5_;
		GtkRadioMenuItem* _tmp6_;
		GtkRadioMenuItem* _tmp7_;
		GtkRadioMenuItem* _tmp8_;
		GtkRadioMenuItem* _tmp9_;
		GtkAction* _tmp10_;
		GtkAction* _tmp11_;
		GtkRadioMenuItem* _tmp12_;
		GtkRadioMenuItem* _tmp13_;
		GtkMenu* sort_menu = NULL;
		GtkMenu* _tmp14_;
		GtkMenu* _tmp15_;
		GtkRadioMenuItem* _tmp16_;
		GtkMenu* _tmp17_;
		GtkRadioMenuItem* _tmp18_;
		GtkMenuItem* _tmp19_;
		GtkMenu* _tmp20_;
		GtkMenuItem* select_menu_item = NULL;
		GtkMenuItem* _tmp21_;
		AppWindow* _tmp22_;
		AppWindow* _tmp23_;
		GAction* _tmp24_;
		GAction* _tmp25_;
		GAction* _tmp26_;
		GAction* _tmp27_;
		GtkMenuItem* _tmp28_;
		GtkMenuItem* _tmp29_;
		GtkMenu* _tmp30_;
		GtkMenuItem* _tmp31_;
		GtkMenu* _tmp32_;
		GtkSeparatorMenuItem* _tmp33_;
		GtkSeparatorMenuItem* _tmp34_;
		GtkMenu* _tmp35_;
		GtkMenuItem* _tmp36_;
		GtkMenu* _tmp37_;
		_data27_ = g_slice_new0 (Block27Data);
		_data27_->_ref_count_ = 1;
		_data27_->self = g_object_ref (self);
		_tmp1_ = (GtkMenu*) gtk_menu_new ();
		g_object_ref_sink (_tmp1_);
		_g_object_unref0 (self->priv->page_context_menu);
		self->priv->page_context_menu = _tmp1_;
		_tmp2_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("Sort _Events"));
		g_object_ref_sink (_tmp2_);
		sort_menu_item = _tmp2_;
		_tmp3_ = (GtkRadioMenuItem*) gtk_radio_menu_item_new_with_mnemonic (NULL, _ ("_Ascending"));
		g_object_ref_sink (_tmp3_);
		_data27_->ascending_menu_item = _tmp3_;
		_tmp4_ = page_get_common_action ((Page*) self, "CommonSortEventsAscending", TRUE);
		_data27_->ascending_action = _tmp4_;
		_tmp5_ = _data27_->ascending_action;
		_tmp6_ = _data27_->ascending_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_ = _data27_->ascending_menu_item;
		g_signal_connect_data ((GtkMenuItem*) _tmp7_, "activate", (GCallback) ____lambda112__gtk_menu_item_activate, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
		_tmp8_ = _data27_->ascending_menu_item;
		_tmp9_ = (GtkRadioMenuItem*) gtk_radio_menu_item_new_with_mnemonic_from_widget (_tmp8_, _ ("D_escending"));
		g_object_ref_sink (_tmp9_);
		_data27_->descending_menu_item = _tmp9_;
		_tmp10_ = page_get_common_action ((Page*) self, "CommonSortEventsDescending", TRUE);
		_data27_->descending_action = _tmp10_;
		_tmp11_ = _data27_->descending_action;
		_tmp12_ = _data27_->descending_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp11_, "active", (GObject*) _tmp12_, "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)));
		_tmp13_ = _data27_->descending_menu_item;
		g_signal_connect_data ((GtkMenuItem*) _tmp13_, "activate", (GCallback) ____lambda113__gtk_menu_item_activate, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
		_tmp14_ = (GtkMenu*) gtk_menu_new ();
		g_object_ref_sink (_tmp14_);
		sort_menu = _tmp14_;
		_tmp15_ = sort_menu;
		_tmp16_ = _data27_->ascending_menu_item;
		gtk_container_add ((GtkContainer*) _tmp15_, (GtkWidget*) _tmp16_);
		_tmp17_ = sort_menu;
		_tmp18_ = _data27_->descending_menu_item;
		gtk_container_add ((GtkContainer*) _tmp17_, (GtkWidget*) _tmp18_);
		_tmp19_ = sort_menu_item;
		_tmp20_ = sort_menu;
		gtk_menu_item_set_submenu (_tmp19_, _tmp20_);
		_tmp21_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (RESOURCES_SELECT_ALL_MENU);
		g_object_ref_sink (_tmp21_);
		select_menu_item = _tmp21_;
		_tmp22_ = app_window_get_instance ();
		_tmp23_ = _tmp22_;
		_tmp24_ = g_action_map_lookup_action ((GActionMap*) _tmp23_, APP_WINDOW_ACTION_SELECT_ALL);
		_tmp25_ = _g_object_ref0 (_tmp24_);
		_tmp26_ = _tmp25_;
		_g_object_unref0 (_tmp23_);
		_data27_->select_action = _tmp26_;
		_tmp27_ = _data27_->select_action;
		_tmp28_ = select_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp27_, "enabled", (GObject*) _tmp28_, "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)));
		_tmp29_ = select_menu_item;
		g_signal_connect_data (_tmp29_, "activate", (GCallback) ____lambda114__gtk_menu_item_activate, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
		_tmp30_ = self->priv->page_context_menu;
		_tmp31_ = sort_menu_item;
		gtk_container_add ((GtkContainer*) _tmp30_, (GtkWidget*) _tmp31_);
		_tmp32_ = self->priv->page_context_menu;
		_tmp33_ = (GtkSeparatorMenuItem*) gtk_separator_menu_item_new ();
		g_object_ref_sink (_tmp33_);
		_tmp34_ = _tmp33_;
		gtk_container_add ((GtkContainer*) _tmp32_, (GtkWidget*) _tmp34_);
		_g_object_unref0 (_tmp34_);
		_tmp35_ = self->priv->page_context_menu;
		_tmp36_ = select_menu_item;
		gtk_container_add ((GtkContainer*) _tmp35_, (GtkWidget*) _tmp36_);
		_tmp37_ = self->priv->page_context_menu;
		gtk_widget_show_all ((GtkWidget*) _tmp37_);
		_g_object_unref0 (select_menu_item);
		_g_object_unref0 (sort_menu);
		_g_object_unref0 (sort_menu_item);
		block27_data_unref (_data27_);
		_data27_ = NULL;
	}
	_tmp38_ = self->priv->page_context_menu;
	_tmp39_ = _g_object_ref0 (_tmp38_);
	result = _tmp39_;
	return result;
}

static Block28Data*
block28_data_ref (Block28Data* _data28_)
{
	g_atomic_int_inc (&_data28_->_ref_count_);
	return _data28_;
}

static void
block28_data_unref (void * _userdata_)
{
	Block28Data* _data28_;
	_data28_ = (Block28Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data28_->_ref_count_)) {
		TrashPage* self;
		self = _data28_->self;
		_g_object_unref0 (_data28_->empty_trash_action);
		_g_object_unref0 (self);
		g_slice_free (Block28Data, _data28_);
	}
}

static void
___lambda115_ (Block28Data* _data28_)
{
	TrashPage* self;
	GtkAction* _tmp0_;
	self = _data28_->self;
	_tmp0_ = _data28_->empty_trash_action;
	gtk_action_activate (_tmp0_);
}

static void
____lambda115__gtk_menu_item_activate (GtkMenuItem* _sender,
                                       gpointer self)
{
	___lambda115_ (self);
}

static GtkMenu*
trash_page_real_get_page_sidebar_menu (Page* base)
{
	TrashPage * self;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp10_;
	GtkMenu* _tmp11_;
	GtkMenu* result;
	self = (TrashPage*) base;
	_tmp0_ = self->priv->page_sidebar_menu;
	if (_tmp0_ == NULL) {
		Block28Data* _data28_;
		GtkMenu* _tmp1_;
		GtkMenuItem* empty_menu_item = NULL;
		GtkMenuItem* _tmp2_;
		GtkAction* _tmp3_;
		GtkAction* _tmp4_;
		GtkMenuItem* _tmp5_;
		GtkMenuItem* _tmp6_;
		GtkMenu* _tmp7_;
		GtkMenuItem* _tmp8_;
		GtkMenu* _tmp9_;
		_data28_ = g_slice_new0 (Block28Data);
		_data28_->_ref_count_ = 1;
		_data28_->self = g_object_ref (self);
		_tmp1_ = (GtkMenu*) gtk_menu_new ();
		g_object_ref_sink (_tmp1_);
		_g_object_unref0 (self->priv->page_sidebar_menu);
		self->priv->page_sidebar_menu = _tmp1_;
		_tmp2_ = (GtkMenuItem*) gtk_menu_item_new_with_mnemonic (_ ("_Empty Trash"));
		g_object_ref_sink (_tmp2_);
		empty_menu_item = _tmp2_;
		_tmp3_ = page_get_action ((Page*) self, "EmptyTrash");
		_data28_->empty_trash_action = _tmp3_;
		_tmp4_ = _data28_->empty_trash_action;
		_tmp5_ = empty_menu_item;
		g_object_bind_property_with_closures ((GObject*) _tmp4_, "sensitive", (GObject*) _tmp5_, "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)));
		_tmp6_ = empty_menu_item;
		g_signal_connect_data (_tmp6_, "activate", (GCallback) ____lambda115__gtk_menu_item_activate, block28_data_ref (_data28_), (GClosureNotify) block28_data_unref, 0);
		_tmp7_ = self->priv->page_sidebar_menu;
		_tmp8_ = empty_menu_item;
		gtk_container_add ((GtkContainer*) _tmp7_, (GtkWidget*) _tmp8_);
		_tmp9_ = self->priv->page_sidebar_menu;
		gtk_widget_show_all ((GtkWidget*) _tmp9_);
		_g_object_unref0 (empty_menu_item);
		block28_data_unref (_data28_);
		_data28_ = NULL;
	}
	_tmp10_ = self->priv->page_sidebar_menu;
	_tmp11_ = _g_object_ref0 (_tmp10_);
	result = _tmp11_;
	return result;
}

static void
_trash_page_on_delete_gcallback (GtkAction* action,
                                 gpointer self)
{
	trash_page_on_delete ((TrashPage*) self);
}

static void
_vala_array_add221 (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
_trash_page_on_restore_gcallback (GtkAction* action,
                                  gpointer self)
{
	trash_page_on_restore ((TrashPage*) self);
}

static void
_vala_array_add222 (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
_trash_page_on_empty_trash_gcallback (GtkAction* action,
                                      gpointer self)
{
	trash_page_on_empty_trash ((TrashPage*) self);
}

static void
_vala_array_add223 (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*
trash_page_real_init_collect_action_entries (Page* base,
                                             gint* result_length1)
{
	TrashPage * self;
	GtkActionEntry* actions = NULL;
	gint _tmp0_ = 0;
	GtkActionEntry* _tmp1_;
	gint actions_length1;
	gint _actions_size_;
	GtkActionEntry delete_action = {0};
	GtkActionEntry _tmp2_ = {0};
	GtkActionEntry _tmp3_;
	GtkActionEntry restore = {0};
	GtkActionEntry _tmp4_ = {0};
	GtkActionEntry _tmp5_;
	GtkActionEntry empty = {0};
	GtkActionEntry _tmp6_ = {0};
	GtkActionEntry _tmp7_;
	GtkActionEntry* _tmp8_;
	gint _tmp8__length1;
	GtkActionEntry* result;
	self = (TrashPage*) base;
	_tmp1_ = PAGE_CLASS (trash_page_parent_class)->init_collect_action_entries ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), &_tmp0_);
	actions = _tmp1_;
	actions_length1 = _tmp0_;
	_actions_size_ = actions_length1;
	_tmp2_.name = "Delete";
	_tmp2_.stock_id = NULL;
	_tmp2_.label = RESOURCES_DELETE_PHOTOS_MENU;
	_tmp2_.accelerator = "Delete";
	_tmp2_.tooltip = RESOURCES_DELETE_FROM_TRASH_TOOLTIP;
	_tmp2_.callback = (GCallback) _trash_page_on_delete_gcallback;
	delete_action = _tmp2_;
	_tmp3_ = delete_action;
	_vala_array_add221 (&actions, &actions_length1, &_actions_size_, &_tmp3_);
	_tmp4_.name = "Restore";
	_tmp4_.stock_id = NULL;
	_tmp4_.label = RESOURCES_RESTORE_PHOTOS_MENU;
	_tmp4_.accelerator = "Restore";
	_tmp4_.tooltip = RESOURCES_RESTORE_PHOTOS_TOOLTIP;
	_tmp4_.callback = (GCallback) _trash_page_on_restore_gcallback;
	restore = _tmp4_;
	_tmp5_ = restore;
	_vala_array_add222 (&actions, &actions_length1, &_actions_size_, &_tmp5_);
	_tmp6_.name = "EmptyTrash";
	_tmp6_.stock_id = NULL;
	_tmp6_.label = _ ("_Empty Trash");
	_tmp6_.accelerator = NULL;
	_tmp6_.tooltip = _ ("Delete all photos in the trash");
	_tmp6_.callback = (GCallback) _trash_page_on_empty_trash_gcallback;
	empty = _tmp6_;
	_tmp7_ = empty;
	_vala_array_add223 (&actions, &actions_length1, &_actions_size_, &_tmp7_);
	_tmp8_ = actions;
	_tmp8__length1 = actions_length1;
	if (result_length1) {
		*result_length1 = _tmp8__length1;
	}
	result = _tmp8_;
	return result;
}

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

static CoreViewTracker*
trash_page_real_get_view_tracker (CheckerboardPage* base)
{
	TrashPage * self;
	MediaViewTracker* _tmp0_;
	CoreViewTracker* _tmp1_;
	CoreViewTracker* result;
	self = (TrashPage*) base;
	_tmp0_ = self->priv->tracker;
	_tmp1_ = _core_tracker_ref0 ((CoreViewTracker*) _tmp0_);
	result = _tmp1_;
	return result;
}

static void
trash_page_real_update_actions (Page* base,
                                gint selected_count,
                                gint count)
{
	TrashPage * self;
	gboolean has_selected = FALSE;
	self = (TrashPage*) base;
	has_selected = selected_count > 0;
	page_set_action_sensitive ((Page*) self, "Delete", has_selected);
	page_set_action_sensitive ((Page*) self, "Restore", has_selected);
	PAGE_CLASS (trash_page_parent_class)->update_actions ((Page*) G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_CHECKERBOARD_PAGE, CheckerboardPage), selected_count, count);
}

static gboolean
trash_page_can_empty_trash (TrashPage* self)
{
	gboolean _tmp0_ = FALSE;
	LibraryPhotoSourceCollection* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = library_photo_global;
	if (media_source_collection_get_trashcan_count ((MediaSourceCollection*) _tmp1_) > 0) {
		_tmp0_ = TRUE;
	} else {
		VideoSourceCollection* _tmp2_;
		_tmp2_ = video_global;
		_tmp0_ = media_source_collection_get_trashcan_count ((MediaSourceCollection*) _tmp2_) > 0;
	}
	result = _tmp0_;
	return result;
}

static void
trash_page_on_trashcan_contents_altered (TrashPage* self,
                                         GeeCollection* added,
                                         GeeCollection* removed)
{
	g_return_if_fail (self != NULL);
	if (added != NULL) {
		{
			GeeIterator* _source_it = NULL;
			GeeIterator* _tmp0_;
			_tmp0_ = gee_iterable_iterator ((GeeIterable*) added);
			_source_it = _tmp0_;
			while (TRUE) {
				GeeIterator* _tmp1_;
				MediaSource* source = NULL;
				GeeIterator* _tmp2_;
				gpointer _tmp3_;
				ViewCollection* _tmp4_;
				ViewCollection* _tmp5_;
				MediaSource* _tmp6_;
				TrashPageTrashView* _tmp7_;
				TrashPageTrashView* _tmp8_;
				_tmp1_ = _source_it;
				if (!gee_iterator_next (_tmp1_)) {
					break;
				}
				_tmp2_ = _source_it;
				_tmp3_ = gee_iterator_get (_tmp2_);
				source = (MediaSource*) _tmp3_;
				_tmp4_ = page_get_view ((Page*) self);
				_tmp5_ = _tmp4_;
				_tmp6_ = source;
				_tmp7_ = trash_page_trash_view_new (_tmp6_);
				_tmp8_ = _tmp7_;
				data_collection_add ((DataCollection*) _tmp5_, (DataObject*) _tmp8_);
				_g_object_unref0 (_tmp8_);
				_data_collection_unref0 (_tmp5_);
				_g_object_unref0 (source);
			}
			_g_object_unref0 (_source_it);
		}
	}
	if (removed != NULL) {
		Marker* marker = NULL;
		ViewCollection* _tmp9_;
		ViewCollection* _tmp10_;
		Marker* _tmp11_;
		Marker* _tmp12_;
		ViewCollection* _tmp23_;
		ViewCollection* _tmp24_;
		Marker* _tmp25_;
		_tmp9_ = page_get_view ((Page*) self);
		_tmp10_ = _tmp9_;
		_tmp11_ = data_collection_start_marking ((DataCollection*) _tmp10_);
		_tmp12_ = _tmp11_;
		_data_collection_unref0 (_tmp10_);
		marker = _tmp12_;
		{
			GeeIterator* _source_it = NULL;
			GeeIterator* _tmp13_;
			_tmp13_ = gee_iterable_iterator ((GeeIterable*) removed);
			_source_it = _tmp13_;
			while (TRUE) {
				GeeIterator* _tmp14_;
				MediaSource* source = NULL;
				GeeIterator* _tmp15_;
				gpointer _tmp16_;
				Marker* _tmp17_;
				ViewCollection* _tmp18_;
				ViewCollection* _tmp19_;
				MediaSource* _tmp20_;
				DataView* _tmp21_;
				DataView* _tmp22_;
				_tmp14_ = _source_it;
				if (!gee_iterator_next (_tmp14_)) {
					break;
				}
				_tmp15_ = _source_it;
				_tmp16_ = gee_iterator_get (_tmp15_);
				source = (MediaSource*) _tmp16_;
				_tmp17_ = marker;
				_tmp18_ = page_get_view ((Page*) self);
				_tmp19_ = _tmp18_;
				_tmp20_ = source;
				_tmp21_ = view_collection_get_view_for_source (_tmp19_, (DataSource*) _tmp20_);
				_tmp22_ = _tmp21_;
				marker_mark (_tmp17_, (DataObject*) _tmp22_);
				_g_object_unref0 (_tmp22_);
				_data_collection_unref0 (_tmp19_);
				_g_object_unref0 (source);
			}
			_g_object_unref0 (_source_it);
		}
		_tmp23_ = page_get_view ((Page*) self);
		_tmp24_ = _tmp23_;
		_tmp25_ = marker;
		data_collection_remove_marked ((DataCollection*) _tmp24_, _tmp25_);
		_data_collection_unref0 (_tmp24_);
		_g_object_unref0 (marker);
	}
	page_set_action_sensitive ((Page*) self, "EmptyTrash", trash_page_can_empty_trash (self));
}

static void
trash_page_on_restore (TrashPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	CommandManager* _tmp3_;
	CommandManager* _tmp4_;
	ViewCollection* _tmp5_;
	ViewCollection* _tmp6_;
	GeeList* _tmp7_;
	GeeCollection* _tmp8_;
	TrashUntrashPhotosCommand* _tmp9_;
	TrashUntrashPhotosCommand* _tmp10_;
	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_) {
		return;
	}
	_tmp3_ = page_get_command_manager ((Page*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = page_get_view ((Page*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = view_collection_get_selected_sources (_tmp6_);
	_tmp8_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_COLLECTION, GeeCollection);
	_tmp9_ = trash_untrash_photos_command_new (_tmp8_, FALSE);
	_tmp10_ = _tmp9_;
	command_manager_execute (_tmp4_, (Command*) _tmp10_);
	_g_object_unref0 (_tmp10_);
	_g_object_unref0 (_tmp8_);
	_data_collection_unref0 (_tmp6_);
	_command_manager_unref0 (_tmp4_);
}

static gchar*
trash_page_real_get_view_empty_message (CheckerboardPage* base)
{
	TrashPage * self;
	LibraryWindow* window = NULL;
	AppWindow* _tmp0_;
	LibraryWindow* _tmp1_;
	LibraryWindow* _tmp2_;
	LibraryWindow* _tmp3_;
	gchar* _tmp5_;
	gchar* result;
	self = (TrashPage*) base;
	_tmp0_ = app_window_get_instance ();
	_tmp1_ = IS_LIBRARY_WINDOW (_tmp0_) ? ((LibraryWindow*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	window = _tmp1_;
	_tmp2_ = window;
	g_warn_if_fail (_tmp2_ != NULL);
	_tmp3_ = window;
	if (_tmp3_ != NULL) {
		LibraryWindow* _tmp4_;
		_tmp4_ = window;
		library_window_toggle_welcome_page (_tmp4_, TRUE, "", _ ("Trash is empty"), FALSE);
	}
	_tmp5_ = g_strdup (_ ("Trash is empty"));
	result = _tmp5_;
	_g_object_unref0 (window);
	return result;
}

static void
trash_page_on_delete (TrashPage* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	GeeList* _tmp2_;
	GeeCollection* _tmp3_;
	ViewCollection* _tmp4_;
	ViewCollection* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = page_get_view ((Page*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_sources (_tmp1_);
	_tmp3_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection);
	_tmp4_ = page_get_view ((Page*) self);
	_tmp5_ = _tmp4_;
	remove_from_app (_tmp3_, _ ("Delete"), ngettext ("Deleting a Photo", "Deleting Photos", (gulong) view_collection_get_selected_count (_tmp5_)), TRUE);
	_data_collection_unref0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_data_collection_unref0 (_tmp1_);
}

void
trash_page_on_empty_trash (TrashPage* self)
{
	GeeArrayList* to_remove = NULL;
	GeeArrayList* _tmp0_;
	LibraryPhotoSourceCollection* _tmp1_;
	GeeCollection* _tmp2_;
	GeeCollection* _tmp3_;
	VideoSourceCollection* _tmp4_;
	GeeCollection* _tmp5_;
	GeeCollection* _tmp6_;
	CommandManager* _tmp7_;
	CommandManager* _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gee_array_list_new (TYPE_MEDIA_SOURCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	to_remove = _tmp0_;
	_tmp1_ = library_photo_global;
	_tmp2_ = media_source_collection_get_trashcan_contents ((MediaSourceCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	gee_array_list_add_all (to_remove, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = video_global;
	_tmp5_ = media_source_collection_get_trashcan_contents ((MediaSourceCollection*) _tmp4_);
	_tmp6_ = _tmp5_;
	gee_array_list_add_all (to_remove, _tmp6_);
	_g_object_unref0 (_tmp6_);
	remove_from_app ((GeeCollection*) to_remove, _ ("Empty Trash"), _ ("Emptying Trash…"), TRUE);
	_tmp7_ = app_window_get_command_manager ();
	_tmp8_ = _tmp7_;
	command_manager_reset (_tmp8_);
	_command_manager_unref0 (_tmp8_);
	_g_object_unref0 (to_remove);
}

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

static SearchViewFilter*
trash_page_real_get_search_view_filter (CheckerboardPage* base)
{
	TrashPage * self;
	TrashPageTrashSearchViewFilter* _tmp0_;
	SearchViewFilter* _tmp1_;
	SearchViewFilter* result;
	self = (TrashPage*) base;
	_tmp0_ = self->priv->search_filter;
	_tmp1_ = _view_filter_ref0 ((SearchViewFilter*) _tmp0_);
	result = _tmp1_;
	return result;
}

static void
trash_page_on_show_sidebar (TrashPage* self)
{
	LibraryWindow* app = NULL;
	AppWindow* _tmp0_;
	LibraryWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = app_window_get_instance ();
	_tmp1_ = IS_LIBRARY_WINDOW (_tmp0_) ? ((LibraryWindow*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	app = _tmp1_;
	library_window_set_metadata_sidebar_visible (app, !library_window_is_metadata_sidebar_visible (app));
	page_update_sidebar_action ((Page*) self, !library_window_is_metadata_sidebar_visible (app));
	_g_object_unref0 (app);
}

static TrashPageTrashView*
trash_page_trash_view_construct (GType object_type,
                                 MediaSource* source)
{
	TrashPageTrashView * self = NULL;
	gint _tmp0_;
	gint _tmp1_;
	g_return_val_if_fail (source != NULL, NULL);
	_tmp0_ = thumbnail_get_DEFAULT_SCALE ();
	_tmp1_ = _tmp0_;
	self = (TrashPageTrashView*) thumbnail_construct (object_type, source, _tmp1_);
	_vala_assert (media_source_is_trashed (source), "source.is_trashed ()");
	return self;
}

static TrashPageTrashView*
trash_page_trash_view_new (MediaSource* source)
{
	return trash_page_trash_view_construct (TRASH_PAGE_TYPE_TRASH_VIEW, source);
}

static void
trash_page_trash_view_class_init (TrashPageTrashViewClass * klass,
                                  gpointer klass_data)
{
	trash_page_trash_view_parent_class = g_type_class_peek_parent (klass);
}

static void
trash_page_trash_view_instance_init (TrashPageTrashView * self,
                                     gpointer klass)
{
}

static GType
trash_page_trash_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TrashPageTrashViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) trash_page_trash_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrashPageTrashView), 0, (GInstanceInitFunc) trash_page_trash_view_instance_init, NULL };
	GType trash_page_trash_view_type_id;
	trash_page_trash_view_type_id = g_type_register_static (TYPE_THUMBNAIL, "TrashPageTrashView", &g_define_type_info, 0);
	return trash_page_trash_view_type_id;
}

static GType
trash_page_trash_view_get_type (void)
{
	static volatile gsize trash_page_trash_view_type_id__once = 0;
	if (g_once_init_enter (&trash_page_trash_view_type_id__once)) {
		GType trash_page_trash_view_type_id;
		trash_page_trash_view_type_id = trash_page_trash_view_get_type_once ();
		g_once_init_leave (&trash_page_trash_view_type_id__once, trash_page_trash_view_type_id);
	}
	return trash_page_trash_view_type_id__once;
}

static guint
trash_page_trash_search_view_filter_real_get_criteria (SearchViewFilter* base)
{
	TrashPageTrashSearchViewFilter * self;
	guint result;
	self = (TrashPageTrashSearchViewFilter*) base;
	result = (guint) ((SEARCH_FILTER_CRITERIA_TEXT | SEARCH_FILTER_CRITERIA_FLAG) | SEARCH_FILTER_CRITERIA_MEDIA);
	return result;
}

static TrashPageTrashSearchViewFilter*
trash_page_trash_search_view_filter_construct (GType object_type)
{
	TrashPageTrashSearchViewFilter* self = NULL;
	self = (TrashPageTrashSearchViewFilter*) default_search_view_filter_construct (object_type);
	return self;
}

static TrashPageTrashSearchViewFilter*
trash_page_trash_search_view_filter_new (void)
{
	return trash_page_trash_search_view_filter_construct (TRASH_PAGE_TYPE_TRASH_SEARCH_VIEW_FILTER);
}

static void
trash_page_trash_search_view_filter_class_init (TrashPageTrashSearchViewFilterClass * klass,
                                                gpointer klass_data)
{
	trash_page_trash_search_view_filter_parent_class = g_type_class_peek_parent (klass);
	((SearchViewFilterClass *) klass)->get_criteria = (guint (*) (SearchViewFilter*)) trash_page_trash_search_view_filter_real_get_criteria;
}

static void
trash_page_trash_search_view_filter_instance_init (TrashPageTrashSearchViewFilter * self,
                                                   gpointer klass)
{
}

static GType
trash_page_trash_search_view_filter_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TrashPageTrashSearchViewFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) trash_page_trash_search_view_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrashPageTrashSearchViewFilter), 0, (GInstanceInitFunc) trash_page_trash_search_view_filter_instance_init, NULL };
	GType trash_page_trash_search_view_filter_type_id;
	trash_page_trash_search_view_filter_type_id = g_type_register_static (TYPE_DEFAULT_SEARCH_VIEW_FILTER, "TrashPageTrashSearchViewFilter", &g_define_type_info, 0);
	return trash_page_trash_search_view_filter_type_id;
}

static GType
trash_page_trash_search_view_filter_get_type (void)
{
	static volatile gsize trash_page_trash_search_view_filter_type_id__once = 0;
	if (g_once_init_enter (&trash_page_trash_search_view_filter_type_id__once)) {
		GType trash_page_trash_search_view_filter_type_id;
		trash_page_trash_search_view_filter_type_id = trash_page_trash_search_view_filter_get_type_once ();
		g_once_init_leave (&trash_page_trash_search_view_filter_type_id__once, trash_page_trash_search_view_filter_type_id);
	}
	return trash_page_trash_search_view_filter_type_id__once;
}

static void
trash_page_class_init (TrashPageClass * klass,
                       gpointer klass_data)
{
	trash_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TrashPage_private_offset);
	((PageClass *) klass)->add_toolbar_widgets = (void (*) (Page*, GtkActionBar*)) trash_page_real_add_toolbar_widgets;
	((CheckerboardPageClass *) klass)->get_item_context_menu = (GtkMenu* (*) (CheckerboardPage*)) trash_page_real_get_item_context_menu;
	((PageClass *) klass)->get_page_context_menu = (GtkMenu* (*) (Page*)) trash_page_real_get_page_context_menu;
	((PageClass *) klass)->get_page_sidebar_menu = (GtkMenu* (*) (Page*)) trash_page_real_get_page_sidebar_menu;
	((PageClass *) klass)->init_collect_action_entries = (GtkActionEntry* (*) (Page*, gint*)) trash_page_real_init_collect_action_entries;
	((CheckerboardPageClass *) klass)->get_view_tracker = (CoreViewTracker* (*) (CheckerboardPage*)) trash_page_real_get_view_tracker;
	((PageClass *) klass)->update_actions = (void (*) (Page*, gint, gint)) trash_page_real_update_actions;
	((CheckerboardPageClass *) klass)->get_view_empty_message = (gchar* (*) (CheckerboardPage*)) trash_page_real_get_view_empty_message;
	((CheckerboardPageClass *) klass)->get_search_view_filter = (SearchViewFilter* (*) (CheckerboardPage*)) trash_page_real_get_search_view_filter;
	G_OBJECT_CLASS (klass)->finalize = trash_page_finalize;
}

static void
trash_page_instance_init (TrashPage * self,
                          gpointer klass)
{
	TrashPageTrashSearchViewFilter* _tmp0_;
	self->priv = trash_page_get_instance_private (self);
	_tmp0_ = trash_page_trash_search_view_filter_new ();
	self->priv->search_filter = _tmp0_;
}

static void
trash_page_finalize (GObject * obj)
{
	TrashPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_TRASH_PAGE, TrashPage);
	_view_filter_unref0 (self->priv->search_filter);
	_core_tracker_unref0 (self->priv->tracker);
	_g_object_unref0 (self->priv->page_sidebar_menu);
	_g_object_unref0 (self->priv->item_context_menu);
	_g_object_unref0 (self->priv->page_context_menu);
	G_OBJECT_CLASS (trash_page_parent_class)->finalize (obj);
}

static GType
trash_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TrashPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) trash_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrashPage), 0, (GInstanceInitFunc) trash_page_instance_init, NULL };
	GType trash_page_type_id;
	trash_page_type_id = g_type_register_static (TYPE_CHECKERBOARD_PAGE, "TrashPage", &g_define_type_info, 0);
	TrashPage_private_offset = g_type_add_instance_private (trash_page_type_id, sizeof (TrashPagePrivate));
	return trash_page_type_id;
}

GType
trash_page_get_type (void)
{
	static volatile gsize trash_page_type_id__once = 0;
	if (g_once_init_enter (&trash_page_type_id__once)) {
		GType trash_page_type_id;
		trash_page_type_id = trash_page_get_type_once ();
		g_once_init_leave (&trash_page_type_id__once, trash_page_type_id);
	}
	return trash_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;
}

