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

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

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

#define CHECKERBOARD_PAGE_AUTOSCROLL_PIXELS 50
#define CHECKERBOARD_PAGE_AUTOSCROLL_TICKS_MSEC 50
#define CHECKERBOARD_LAYOUT_ROW_GUTTER_PADDING 24
#define CHECKERBOARD_ITEM_PROP_SHOW_TITLES "show-titles"
#define CHECKERBOARD_ITEM_PROP_SHOW_COMMENTS "show-comments"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

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

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

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

typedef struct _PageWindow PageWindow;
typedef struct _PageWindowClass PageWindowClass;

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

typedef struct _FullscreenWindow FullscreenWindow;
typedef struct _FullscreenWindowClass FullscreenWindowClass;

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

typedef struct _InjectionGroup InjectionGroup;
typedef struct _InjectionGroupClass InjectionGroupClass;

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

typedef struct _CheckerboardPage CheckerboardPage;
typedef struct _CheckerboardPageClass CheckerboardPageClass;
typedef struct _CheckerboardPagePrivate CheckerboardPagePrivate;

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

typedef struct _DataObject DataObject;
typedef struct _DataObjectClass DataObjectClass;

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

typedef struct _DataView DataView;
typedef struct _DataViewClass DataViewClass;

#define TYPE_THUMBNAIL_VIEW (thumbnail_view_get_type ())
#define THUMBNAIL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_THUMBNAIL_VIEW, ThumbnailView))
#define THUMBNAIL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_THUMBNAIL_VIEW, ThumbnailViewClass))
#define IS_THUMBNAIL_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_THUMBNAIL_VIEW))
#define IS_THUMBNAIL_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_THUMBNAIL_VIEW))
#define THUMBNAIL_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_THUMBNAIL_VIEW, ThumbnailViewClass))

typedef struct _ThumbnailView ThumbnailView;
typedef struct _ThumbnailViewClass ThumbnailViewClass;

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

typedef struct _CheckerboardItem CheckerboardItem;
typedef struct _CheckerboardItemClass CheckerboardItemClass;
typedef enum  {
	CHECKERBOARD_PAGE_ACTIVATOR_KEYBOARD,
	CHECKERBOARD_PAGE_ACTIVATOR_MOUSE
} CheckerboardPageActivator;

#define CHECKERBOARD_PAGE_TYPE_ACTIVATOR (checkerboard_page_activator_get_type ())

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

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

typedef struct _ViewFilter ViewFilter;
typedef struct _ViewFilterClass ViewFilterClass;

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

typedef struct _SearchViewFilter SearchViewFilter;
typedef struct _SearchViewFilterClass SearchViewFilterClass;

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

typedef struct _CoreTracker CoreTracker;
typedef struct _CoreTrackerClass CoreTrackerClass;

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

typedef struct _CoreViewTracker CoreViewTracker;
typedef struct _CoreViewTrackerClass CoreViewTrackerClass;

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

typedef struct _CheckerboardLayout CheckerboardLayout;
typedef struct _CheckerboardLayoutClass CheckerboardLayoutClass;

#define TYPE_PAGE_MESSAGE_PANE (page_message_pane_get_type ())
#define PAGE_MESSAGE_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PAGE_MESSAGE_PANE, PageMessagePane))
#define PAGE_MESSAGE_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PAGE_MESSAGE_PANE, PageMessagePaneClass))
#define IS_PAGE_MESSAGE_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PAGE_MESSAGE_PANE))
#define IS_PAGE_MESSAGE_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PAGE_MESSAGE_PANE))
#define PAGE_MESSAGE_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PAGE_MESSAGE_PANE, PageMessagePaneClass))

typedef struct _PageMessagePane PageMessagePane;
typedef struct _PageMessagePaneClass PageMessagePaneClass;
enum  {
	CHECKERBOARD_PAGE_0_PROPERTY,
	CHECKERBOARD_PAGE_NUM_PROPERTIES
};
static GParamSpec* checkerboard_page_properties[CHECKERBOARD_PAGE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

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

typedef struct _DataCollection DataCollection;
typedef struct _DataCollectionClass DataCollectionClass;

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

typedef struct _ViewCollection ViewCollection;
typedef struct _ViewCollectionClass ViewCollectionClass;
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
#define _view_filter_unref0(var) ((var == NULL) ? NULL : (var = (view_filter_unref (var), NULL)))
typedef enum  {
	ADJUSTMENT_RELATION_BELOW,
	ADJUSTMENT_RELATION_IN_RANGE,
	ADJUSTMENT_RELATION_ABOVE
} AdjustmentRelation;

#define TYPE_ADJUSTMENT_RELATION (adjustment_relation_get_type ())
typedef struct _DataObjectPrivate DataObjectPrivate;

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

typedef struct _Alteration Alteration;
typedef struct _AlterationClass AlterationClass;
typedef struct _DataViewPrivate DataViewPrivate;

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

typedef struct _DataSource DataSource;
typedef struct _DataSourceClass DataSourceClass;
typedef struct _ThumbnailViewPrivate ThumbnailViewPrivate;
typedef struct _CheckerboardItemPrivate CheckerboardItemPrivate;

#define TYPE_DIMENSIONS (dimensions_get_type ())
typedef struct _Dimensions Dimensions;
typedef struct _PageMessagePanePrivate PageMessagePanePrivate;
typedef enum  {
	COMPASS_POINT_NORTH,
	COMPASS_POINT_SOUTH,
	COMPASS_POINT_EAST,
	COMPASS_POINT_WEST
} CompassPoint;

#define TYPE_COMPASS_POINT (compass_point_get_type ())

#define TYPE_MARKER (marker_get_type ())
#define MARKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MARKER, Marker))
#define IS_MARKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MARKER))
#define MARKER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_MARKER, MarkerIface))

typedef struct _Marker Marker;
typedef struct _MarkerIface MarkerIface;
typedef gboolean (*ValueEqualFunc) (GValue* a, GValue* b, gpointer user_data);
#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 _Page {
	GtkScrolledWindow parent_instance;
	PagePrivate * priv;
	GtkBuilder* builder;
	GtkToolbar* toolbar;
	gboolean in_view;
	gdouble wheel_factor;
	gdouble modified_wheel_factor;
};

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

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

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

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

struct _CheckerboardPagePrivate {
	CheckerboardLayout* layout;
	GtkStack* stack;
	PageMessagePane* message_pane;
	gchar* item_context_menu_path;
	gchar* page_context_menu_path;
	GtkViewport* viewport;
	CheckerboardItem* current_hovered_item;
	gboolean autoscroll_scheduled;
	CheckerboardItem* activated_item;
	GeeArrayList* previously_selected;
	GtkMenu* item_context_menu;
	GtkMenu* page_context_menu;
};

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

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

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

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

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

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

struct _Dimensions {
	gint width;
	gint height;
};

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

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

struct _PageMessagePane {
	GtkBox parent_instance;
	PageMessagePanePrivate * priv;
	GtkLabel* label;
	GtkImage* icon_image;
};

struct _PageMessagePaneClass {
	GtkBoxClass parent_class;
};

struct _MarkerIface {
	GTypeInterface parent_iface;
	void (*mark) (Marker* self, DataObject* object);
	void (*unmark) (Marker* self, DataObject* object);
	gboolean (*toggle) (Marker* self, DataObject* object);
	void (*mark_many) (Marker* self, GeeCollection* list);
	void (*unmark_many) (Marker* self, GeeCollection* list);
	void (*mark_all) (Marker* self);
	gint (*get_count) (Marker* self);
	GeeCollection* (*get_all) (Marker* self);
};

static gint CheckerboardPage_private_offset;
static gpointer checkerboard_page_parent_class = NULL;

VALA_EXTERN GType page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Page, g_object_unref)
VALA_EXTERN GType page_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageWindow, g_object_unref)
VALA_EXTERN GType fullscreen_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FullscreenWindow, g_object_unref)
VALA_EXTERN gpointer injection_group_ref (gpointer instance);
VALA_EXTERN void injection_group_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_injection_group (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_injection_group (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_injection_group (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_injection_group (const GValue* value);
VALA_EXTERN GType injection_group_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (InjectionGroup, injection_group_unref)
VALA_EXTERN GType checkerboard_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardPage, g_object_unref)
VALA_EXTERN GType data_object_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataObject, g_object_unref)
VALA_EXTERN GType data_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataView, g_object_unref)
VALA_EXTERN GType thumbnail_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThumbnailView, g_object_unref)
VALA_EXTERN GType checkerboard_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardItem, g_object_unref)
VALA_EXTERN GType checkerboard_page_activator_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType checkerboard_page_keyboard_modifiers_get_type (void) G_GNUC_CONST ;
VALA_EXTERN CheckerboardPageKeyboardModifiers* checkerboard_page_keyboard_modifiers_dup (const CheckerboardPageKeyboardModifiers* self);
VALA_EXTERN void checkerboard_page_keyboard_modifiers_free (CheckerboardPageKeyboardModifiers* self);
VALA_EXTERN gpointer view_filter_ref (gpointer instance);
VALA_EXTERN void view_filter_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_view_filter (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_view_filter (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_view_filter (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_view_filter (const GValue* value);
VALA_EXTERN GType view_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewFilter, view_filter_unref)
VALA_EXTERN GType search_view_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SearchViewFilter, view_filter_unref)
VALA_EXTERN gpointer core_tracker_ref (gpointer instance);
VALA_EXTERN void core_tracker_unref (gpointer instance);
VALA_EXTERN GParamSpec* core_param_spec_tracker (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags);
VALA_EXTERN void core_value_set_tracker (GValue* value,
                             gpointer v_object);
VALA_EXTERN void core_value_take_tracker (GValue* value,
                              gpointer v_object);
VALA_EXTERN gpointer core_value_get_tracker (const GValue* value);
VALA_EXTERN GType core_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoreTracker, core_tracker_unref)
VALA_EXTERN GType core_view_tracker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CoreViewTracker, core_tracker_unref)
VALA_EXTERN GType checkerboard_layout_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CheckerboardLayout, g_object_unref)
VALA_EXTERN GType page_message_pane_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageMessagePane, g_object_unref)
VALA_EXTERN GtkMenu* checkerboard_page_get_item_context_menu (CheckerboardPage* self);
VALA_EXTERN GtkMenu* page_get_page_context_menu (Page* self);
VALA_EXTERN gboolean page_on_context_keypress (Page* self);
VALA_EXTERN gchar* checkerboard_page_get_view_empty_icon (CheckerboardPage* self);
VALA_EXTERN gchar* checkerboard_page_get_view_empty_message (CheckerboardPage* self);
VALA_EXTERN gchar* checkerboard_page_get_filter_no_match_message (CheckerboardPage* self);
VALA_EXTERN void checkerboard_page_on_item_activated (CheckerboardPage* self,
                                          CheckerboardItem* item,
                                          CheckerboardPageActivator activator,
                                          CheckerboardPageKeyboardModifiers* modifiers);
VALA_EXTERN SearchViewFilter* checkerboard_page_get_search_view_filter (CheckerboardPage* self);
VALA_EXTERN CoreViewTracker* checkerboard_page_get_view_tracker (CheckerboardPage* self);
VALA_EXTERN void page_switching_from (Page* self);
VALA_EXTERN void page_switched_to (Page* self);
VALA_EXTERN void page_set_page_name (Page* self,
                         const gchar* page_name);
VALA_EXTERN gboolean page_on_left_click (Page* self,
                             GdkEventButton* event);
VALA_EXTERN gboolean page_on_left_released (Page* self,
                                GdkEventButton* event);
VALA_EXTERN gboolean page_on_right_click (Page* self,
                              GdkEventButton* event);
VALA_EXTERN gboolean checkerboard_page_on_mouse_over (CheckerboardPage* self,
                                          CheckerboardItem* item,
                                          gint x,
                                          gint y,
                                          GdkModifierType mask);
VALA_EXTERN gboolean page_on_motion (Page* self,
                         GdkEventMotion* event,
                         gint x,
                         gint y,
                         GdkModifierType mask);
VALA_EXTERN void checkerboard_page_set_display_titles (CheckerboardPage* self,
                                           gboolean display);
VALA_EXTERN void checkerboard_page_set_display_comments (CheckerboardPage* self,
                                             gboolean display);
VALA_EXTERN CheckerboardPage* checkerboard_page_construct (GType object_type,
                                               const gchar* page_name);
VALA_EXTERN Page* page_construct (GType object_type,
                      const gchar* page_name);
VALA_EXTERN PageMessagePane* page_message_pane_new (void);
VALA_EXTERN PageMessagePane* page_message_pane_construct (GType object_type);
VALA_EXTERN gpointer data_collection_ref (gpointer instance);
VALA_EXTERN void data_collection_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_data_collection (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_data_collection (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_data_collection (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_data_collection (const GValue* value);
VALA_EXTERN GType data_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataCollection, data_collection_unref)
VALA_EXTERN GType view_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ViewCollection, data_collection_unref)
VALA_EXTERN ViewCollection* page_get_view (Page* self);
VALA_EXTERN CheckerboardLayout* checkerboard_layout_new (ViewCollection* view);
VALA_EXTERN CheckerboardLayout* checkerboard_layout_construct (GType object_type,
                                                   ViewCollection* view);
VALA_EXTERN void checkerboard_layout_set_name (CheckerboardLayout* self,
                                   const gchar* name);
VALA_EXTERN void page_set_event_source (Page* self,
                            GtkWidget* event_source);
VALA_EXTERN void checkerboard_layout_set_adjustments (CheckerboardLayout* self,
                                          GtkAdjustment* hadjustment,
                                          GtkAdjustment* vadjustment);
static void checkerboard_page_on_items_hidden (CheckerboardPage* self,
                                        GeeIterable* hidden);
static void _checkerboard_page_on_items_hidden_view_collection_items_hidden (ViewCollection* _sender,
                                                                      GeeCollection* hidden,
                                                                      gpointer self);
static void checkerboard_page_on_contents_altered (CheckerboardPage* self,
                                            GeeIterable* added,
                                            GeeIterable* removed);
static void _checkerboard_page_on_contents_altered_data_collection_contents_altered (DataCollection* _sender,
                                                                              GeeIterable* added,
                                                                              GeeIterable* removed,
                                                                              gpointer self);
static void checkerboard_page_on_items_state_changed (CheckerboardPage* self,
                                               GeeIterable* changed);
static void _checkerboard_page_on_items_state_changed_view_collection_items_state_changed (ViewCollection* _sender,
                                                                                    GeeIterable* changed,
                                                                                    gpointer self);
static void checkerboard_page_on_items_visibility_changed (CheckerboardPage* self,
                                                    GeeCollection* changed);
static void _checkerboard_page_on_items_visibility_changed_view_collection_items_visibility_changed (ViewCollection* _sender,
                                                                                              GeeCollection* changed,
                                                                                              gpointer self);
VALA_EXTERN void checkerboard_page_init_item_context_menu (CheckerboardPage* self,
                                               const gchar* path);
VALA_EXTERN void checkerboard_page_init_page_context_menu (CheckerboardPage* self,
                                               const gchar* path);
VALA_EXTERN GtkMenu* checkerboard_page_get_context_menu (CheckerboardPage* self);
VALA_EXTERN gint view_collection_get_selected_count (ViewCollection* self);
static GtkMenu* checkerboard_page_real_get_item_context_menu (CheckerboardPage* self);
static GtkMenu* checkerboard_page_real_get_page_context_menu (Page* base);
static gboolean checkerboard_page_real_on_context_keypress (Page* base);
VALA_EXTERN gboolean page_popup_context_menu (Page* self,
                                  GtkMenu* context_menu,
                                  GdkEventButton* event);
static gchar* checkerboard_page_real_get_view_empty_icon (CheckerboardPage* self);
static gchar* checkerboard_page_real_get_view_empty_message (CheckerboardPage* self);
static gchar* checkerboard_page_real_get_filter_no_match_message (CheckerboardPage* self);
static void checkerboard_page_real_on_item_activated (CheckerboardPage* self,
                                               CheckerboardItem* item,
                                               CheckerboardPageActivator activator,
                                               CheckerboardPageKeyboardModifiers* modifiers);
VALA_EXTERN CheckerboardLayout* checkerboard_page_get_checkerboard_layout (CheckerboardPage* self);
static SearchViewFilter* checkerboard_page_real_get_search_view_filter (CheckerboardPage* self);
static CoreViewTracker* checkerboard_page_real_get_view_tracker (CheckerboardPage* self);
static void checkerboard_page_real_switching_from (Page* base);
VALA_EXTERN void checkerboard_layout_set_in_view (CheckerboardLayout* self,
                                      gboolean in_view);
static void checkerboard_page_on_view_filter_refresh (CheckerboardPage* self);
static void _checkerboard_page_on_view_filter_refresh_view_filter_refresh (ViewFilter* _sender,
                                                                    gpointer self);
VALA_EXTERN void view_collection_unselect_all (ViewCollection* self);
VALA_EXTERN void checkerboard_page_scroll_to_item (CheckerboardPage* self,
                                       CheckerboardItem* item);
VALA_EXTERN GType adjustment_relation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN AdjustmentRelation get_adjustment_relation (GtkAdjustment* adjustment,
                                            gint value);
VALA_EXTERN gpointer alteration_ref (gpointer instance);
VALA_EXTERN void alteration_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_alteration (const gchar* name,
                                   const gchar* nick,
                                   const gchar* blurb,
                                   GType object_type,
                                   GParamFlags flags);
VALA_EXTERN void value_set_alteration (GValue* value,
                           gpointer v_object);
VALA_EXTERN void value_take_alteration (GValue* value,
                            gpointer v_object);
VALA_EXTERN gpointer value_get_alteration (const GValue* value);
VALA_EXTERN GType alteration_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Alteration, alteration_unref)
VALA_EXTERN GType data_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DataSource, g_object_unref)
VALA_EXTERN GType dimensions_get_type (void) G_GNUC_CONST ;
VALA_EXTERN Dimensions* dimensions_dup (const Dimensions* self);
VALA_EXTERN void dimensions_free (Dimensions* self);
static void checkerboard_page_real_switched_to (Page* base);
VALA_EXTERN DataView* view_collection_get_selected_at (ViewCollection* self,
                                           gint index);
static void checkerboard_page_update_view_filter_message (CheckerboardPage* self);
VALA_EXTERN gboolean view_collection_are_items_filtered_out (ViewCollection* self);
VALA_EXTERN gint data_collection_get_count (DataCollection* self);
VALA_EXTERN void checkerboard_page_set_page_message (CheckerboardPage* self,
                                         const gchar* message);
VALA_EXTERN void checkerboard_page_unset_page_message (CheckerboardPage* self);
static void checkerboard_page_real_set_page_name (Page* base,
                                           const gchar* name);
VALA_EXTERN CheckerboardItem* checkerboard_page_get_item_at_pixel (CheckerboardPage* self,
                                                       gdouble x,
                                                       gdouble y);
VALA_EXTERN CheckerboardItem* checkerboard_layout_get_item_at_pixel (CheckerboardLayout* self,
                                                         gdouble xd,
                                                         gdouble yd);
static gboolean checkerboard_page_real_key_press_event (GtkWidget* base,
                                                 GdkEventKey* event);
VALA_EXTERN GType compass_point_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void checkerboard_page_move_cursor (CheckerboardPage* self,
                                    CompassPoint point);
VALA_EXTERN void checkerboard_page_select_anchor_to_cursor (CheckerboardPage* self,
                                                guint state);
VALA_EXTERN DataView* view_collection_get_first (ViewCollection* self);
VALA_EXTERN void checkerboard_page_cursor_to_item (CheckerboardPage* self,
                                       CheckerboardItem* item);
VALA_EXTERN DataView* view_collection_get_last (ViewCollection* self);
VALA_EXTERN void checkerboard_page_keyboard_modifiers_init (CheckerboardPageKeyboardModifiers *self,
                                                Page* page);
VALA_EXTERN GType marker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Marker, g_object_unref)
VALA_EXTERN Marker* data_collection_mark (DataCollection* self,
                              DataObject* object);
VALA_EXTERN CheckerboardItem* checkerboard_layout_get_cursor (CheckerboardLayout* self);
VALA_EXTERN void view_collection_toggle_marked (ViewCollection* self,
                                    Marker* marker);
static gboolean checkerboard_page_real_on_left_click (Page* base,
                                               GdkEventButton* event);
VALA_EXTERN gboolean checkerboard_layout_handle_left_click (CheckerboardLayout* self,
                                                CheckerboardItem* item,
                                                gdouble xd,
                                                gdouble yd,
                                                GdkModifierType mask);
VALA_EXTERN gboolean data_view_is_selected (DataView* self);
VALA_EXTERN void checkerboard_page_select_between_items (CheckerboardPage* self,
                                             CheckerboardItem* item_start,
                                             CheckerboardItem* item_end);
VALA_EXTERN Marker* data_collection_start_marking (DataCollection* self);
VALA_EXTERN void marker_mark_many (Marker* self,
                       GeeCollection* list);
VALA_EXTERN GeeList* view_collection_get_selected (ViewCollection* self);
VALA_EXTERN void view_collection_unselect_and_select_marked (ViewCollection* self,
                                                 Marker* unselect,
                                                 Marker* select);
VALA_EXTERN void checkerboard_layout_set_cursor (CheckerboardLayout* self,
                                     CheckerboardItem* item);
VALA_EXTERN void checkerboard_layout_set_drag_select_origin (CheckerboardLayout* self,
                                                 gint x,
                                                 gint y);
static gboolean checkerboard_page_real_on_left_released (Page* base,
                                                  GdkEventButton* event);
VALA_EXTERN gboolean checkerboard_layout_is_drag_select_active (CheckerboardLayout* self);
VALA_EXTERN void checkerboard_layout_clear_drag_select (CheckerboardLayout* self);
VALA_EXTERN void view_collection_unselect_all_but (ViewCollection* self,
                                       DataView* exception);
static gboolean checkerboard_page_real_on_right_click (Page* base,
                                                GdkEventButton* event);
static gboolean checkerboard_page_real_on_mouse_over (CheckerboardPage* self,
                                               CheckerboardItem* item,
                                               gint x,
                                               gint y,
                                               GdkModifierType mask);
VALA_EXTERN gboolean checkerboard_layout_handle_mouse_motion (CheckerboardLayout* self,
                                                  CheckerboardItem* item,
                                                  gint x,
                                                  gint y,
                                                  GdkModifierType mask);
VALA_EXTERN void checkerboard_item_handle_mouse_leave (CheckerboardItem* self);
VALA_EXTERN void checkerboard_item_handle_mouse_enter (CheckerboardItem* self);
static gboolean checkerboard_page_real_on_motion (Page* base,
                                           GdkEventMotion* event,
                                           gint x,
                                           gint y,
                                           GdkModifierType mask);
VALA_EXTERN void checkerboard_layout_set_drag_select_endpoint (CheckerboardLayout* self,
                                                   gint x,
                                                   gint y);
static void checkerboard_page_updated_selection_band (CheckerboardPage* self);
static gboolean checkerboard_page_selection_autoscroll (CheckerboardPage* self);
static gboolean _checkerboard_page_selection_autoscroll_gsource_func (gpointer self);
VALA_EXTERN GeeList* checkerboard_layout_items_in_selection_band (CheckerboardLayout* self);
VALA_EXTERN void marker_unmark_many (Marker* self,
                         GeeCollection* list);
VALA_EXTERN gboolean marker_toggle (Marker* self,
                        DataObject* object);
VALA_EXTERN void marker_unmark (Marker* self,
                    DataObject* object);
VALA_EXTERN void marker_mark (Marker* self,
                  DataObject* object);
VALA_EXTERN void view_collection_select_marked (ViewCollection* self,
                                    Marker* marker);
VALA_EXTERN void view_collection_unselect_marked (ViewCollection* self,
                                      Marker* marker);
VALA_EXTERN gboolean page_get_event_source_pointer (Page* self,
                                        gint* x,
                                        gint* y,
                                        GdkModifierType* mask);
VALA_EXTERN gboolean data_collection_contains (DataCollection* self,
                                   DataObject* object);
VALA_EXTERN gboolean page_get_ctrl_pressed (Page* self);
VALA_EXTERN CheckerboardItem* checkerboard_layout_get_item_at_coordinate (CheckerboardLayout* self,
                                                              gint col,
                                                              gint row);
VALA_EXTERN CheckerboardItem* checkerboard_layout_get_item_relative_to (CheckerboardLayout* self,
                                                            CheckerboardItem* item,
                                                            CompassPoint point);
VALA_EXTERN void checkerboard_page_set_cursor (CheckerboardPage* self,
                                   CheckerboardItem* item);
VALA_EXTERN GeeCollection* data_collection_get_all (DataCollection* self);
static void checkerboard_page_real_set_display_titles (CheckerboardPage* self,
                                                gboolean display);
VALA_EXTERN void data_collection_freeze_notifications (DataCollection* self);
VALA_EXTERN void data_collection_set_property (DataCollection* self,
                                   const gchar* name,
                                   GValue* val,
                                   ValueEqualFunc value_equals,
                                   gpointer value_equals_target);
VALA_EXTERN void data_collection_thaw_notifications (DataCollection* self);
static void checkerboard_page_real_set_display_comments (CheckerboardPage* self,
                                                  gboolean display);
VALA_EXTERN gboolean page_get_alt_pressed (Page* self);
VALA_EXTERN gboolean page_get_shift_pressed (Page* self);
VALA_EXTERN gboolean page_get_super_pressed (Page* self);
static void checkerboard_page_finalize (GObject * obj);
static GType checkerboard_page_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
checkerboard_page_get_instance_private (CheckerboardPage* self)
{
	return G_STRUCT_MEMBER_P (self, CheckerboardPage_private_offset);
}

static GType
checkerboard_page_activator_get_type_once (void)
{
	static const GEnumValue values[] = {{CHECKERBOARD_PAGE_ACTIVATOR_KEYBOARD, "CHECKERBOARD_PAGE_ACTIVATOR_KEYBOARD", "keyboard"}, {CHECKERBOARD_PAGE_ACTIVATOR_MOUSE, "CHECKERBOARD_PAGE_ACTIVATOR_MOUSE", "mouse"}, {0, NULL, NULL}};
	GType checkerboard_page_activator_type_id;
	checkerboard_page_activator_type_id = g_enum_register_static ("CheckerboardPageActivator", values);
	return checkerboard_page_activator_type_id;
}

GType
checkerboard_page_activator_get_type (void)
{
	static volatile gsize checkerboard_page_activator_type_id__once = 0;
	if (g_once_init_enter (&checkerboard_page_activator_type_id__once)) {
		GType checkerboard_page_activator_type_id;
		checkerboard_page_activator_type_id = checkerboard_page_activator_get_type_once ();
		g_once_init_leave (&checkerboard_page_activator_type_id__once, checkerboard_page_activator_type_id);
	}
	return checkerboard_page_activator_type_id__once;
}

static void
_checkerboard_page_on_items_hidden_view_collection_items_hidden (ViewCollection* _sender,
                                                                 GeeCollection* hidden,
                                                                 gpointer self)
{
	checkerboard_page_on_items_hidden ((CheckerboardPage*) self, hidden);
}

static void
_checkerboard_page_on_contents_altered_data_collection_contents_altered (DataCollection* _sender,
                                                                         GeeIterable* added,
                                                                         GeeIterable* removed,
                                                                         gpointer self)
{
	checkerboard_page_on_contents_altered ((CheckerboardPage*) self, added, removed);
}

static void
_checkerboard_page_on_items_state_changed_view_collection_items_state_changed (ViewCollection* _sender,
                                                                               GeeIterable* changed,
                                                                               gpointer self)
{
	checkerboard_page_on_items_state_changed ((CheckerboardPage*) self, changed);
}

static void
_checkerboard_page_on_items_visibility_changed_view_collection_items_visibility_changed (ViewCollection* _sender,
                                                                                         GeeCollection* changed,
                                                                                         gpointer self)
{
	checkerboard_page_on_items_visibility_changed ((CheckerboardPage*) self, changed);
}

CheckerboardPage*
checkerboard_page_construct (GType object_type,
                             const gchar* page_name)
{
	CheckerboardPage * self = NULL;
	GtkStack* _tmp0_;
	PageMessagePane* _tmp1_;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	CheckerboardLayout* _tmp4_;
	CheckerboardLayout* _tmp5_;
	GtkStack* _tmp6_;
	CheckerboardLayout* _tmp7_;
	GtkStack* _tmp8_;
	PageMessagePane* _tmp9_;
	GtkStack* _tmp10_;
	CheckerboardLayout* _tmp11_;
	CheckerboardLayout* _tmp12_;
	GtkViewport* _tmp13_;
	GtkViewport* _tmp14_;
	GtkViewport* _tmp15_;
	GtkStack* _tmp16_;
	CheckerboardLayout* _tmp17_;
	GtkAdjustment* _tmp18_;
	GtkAdjustment* _tmp19_;
	GtkViewport* _tmp20_;
	ViewCollection* _tmp21_;
	ViewCollection* _tmp22_;
	ViewCollection* _tmp23_;
	ViewCollection* _tmp24_;
	ViewCollection* _tmp25_;
	ViewCollection* _tmp26_;
	ViewCollection* _tmp27_;
	ViewCollection* _tmp28_;
	g_return_val_if_fail (page_name != NULL, NULL);
	self = (CheckerboardPage*) page_construct (object_type, page_name);
	_tmp0_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->stack);
	self->priv->stack = _tmp0_;
	_tmp1_ = page_message_pane_new ();
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->message_pane);
	self->priv->message_pane = _tmp1_;
	_tmp2_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp3_ = _tmp2_;
	_tmp4_ = checkerboard_layout_new (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->layout);
	self->priv->layout = _tmp4_;
	_data_collection_unref0 (_tmp3_);
	_tmp5_ = self->priv->layout;
	checkerboard_layout_set_name (_tmp5_, page_name);
	_tmp6_ = self->priv->stack;
	_tmp7_ = self->priv->layout;
	gtk_stack_add_named (_tmp6_, G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, gtk_widget_get_type (), GtkWidget), "layout");
	_tmp8_ = self->priv->stack;
	_tmp9_ = self->priv->message_pane;
	gtk_stack_add_named (_tmp8_, G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget), "message");
	_tmp10_ = self->priv->stack;
	_tmp11_ = self->priv->layout;
	gtk_stack_set_visible_child (_tmp10_, G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, gtk_widget_get_type (), GtkWidget));
	_tmp12_ = self->priv->layout;
	page_set_event_source (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, gtk_widget_get_type (), GtkWidget));
	gtk_container_set_border_width (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), (guint) 0);
	gtk_scrolled_window_set_shadow_type (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_scrolled_window_get_type (), GtkScrolledWindow), GTK_SHADOW_NONE);
	_tmp13_ = self->priv->viewport;
	gtk_container_set_border_width (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, gtk_container_get_type (), GtkContainer), (guint) 0);
	_tmp14_ = self->priv->viewport;
	gtk_viewport_set_shadow_type (_tmp14_, GTK_SHADOW_NONE);
	_tmp15_ = self->priv->viewport;
	_tmp16_ = self->priv->stack;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, gtk_widget_get_type (), GtkWidget));
	_tmp17_ = self->priv->layout;
	_tmp18_ = gtk_scrolled_window_get_hadjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_scrolled_window_get_type (), GtkScrolledWindow));
	_tmp19_ = gtk_scrolled_window_get_vadjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_scrolled_window_get_type (), GtkScrolledWindow));
	checkerboard_layout_set_adjustments (_tmp17_, _tmp18_, _tmp19_);
	_tmp20_ = self->priv->viewport;
	gtk_container_add (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_container_get_type (), GtkContainer), G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, gtk_widget_get_type (), GtkWidget));
	_tmp21_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp22_ = _tmp21_;
	g_signal_connect_object (_tmp22_, "items-hidden", (GCallback) _checkerboard_page_on_items_hidden_view_collection_items_hidden, self, 0);
	_data_collection_unref0 (_tmp22_);
	_tmp23_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp24_ = _tmp23_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, TYPE_DATA_COLLECTION, DataCollection), "contents-altered", (GCallback) _checkerboard_page_on_contents_altered_data_collection_contents_altered, self, 0);
	_data_collection_unref0 (_tmp24_);
	_tmp25_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp26_ = _tmp25_;
	g_signal_connect_object (_tmp26_, "items-state-changed", (GCallback) _checkerboard_page_on_items_state_changed_view_collection_items_state_changed, self, 0);
	_data_collection_unref0 (_tmp26_);
	_tmp27_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp28_ = _tmp27_;
	g_signal_connect_object (_tmp28_, "items-visibility-changed", (GCallback) _checkerboard_page_on_items_visibility_changed_view_collection_items_visibility_changed, self, 0);
	_data_collection_unref0 (_tmp28_);
	gtk_scrolled_window_set_policy (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_scrolled_window_get_type (), GtkScrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
	return self;
}

void
checkerboard_page_init_item_context_menu (CheckerboardPage* self,
                                          const gchar* path)
{
	gchar* _tmp0_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (path != NULL);
	_tmp0_ = g_strdup (path);
	_g_free0 (self->priv->item_context_menu_path);
	self->priv->item_context_menu_path = _tmp0_;
}

void
checkerboard_page_init_page_context_menu (CheckerboardPage* self,
                                          const gchar* path)
{
	gchar* _tmp0_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (path != NULL);
	_tmp0_ = g_strdup (path);
	_g_free0 (self->priv->page_context_menu_path);
	self->priv->page_context_menu_path = _tmp0_;
}

GtkMenu*
checkerboard_page_get_context_menu (CheckerboardPage* self)
{
	GtkMenu* _tmp0_ = NULL;
	ViewCollection* _tmp1_;
	ViewCollection* _tmp2_;
	gboolean _tmp3_;
	GtkMenu* _tmp6_;
	GtkMenu* result;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), NULL);
	_tmp1_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp2_ = _tmp1_;
	_tmp3_ = view_collection_get_selected_count (_tmp2_) != 0;
	_data_collection_unref0 (_tmp2_);
	if (_tmp3_) {
		GtkMenu* _tmp4_;
		_tmp4_ = checkerboard_page_get_item_context_menu (self);
		_g_object_unref0 (_tmp0_);
		_tmp0_ = _tmp4_;
	} else {
		GtkMenu* _tmp5_;
		_tmp5_ = page_get_page_context_menu (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_g_object_unref0 (_tmp0_);
		_tmp0_ = _tmp5_;
	}
	_tmp6_ = _tmp0_;
	_tmp0_ = NULL;
	result = _tmp6_;
	_g_object_unref0 (_tmp0_);
	return result;
}

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

static GtkMenu*
checkerboard_page_real_get_item_context_menu (CheckerboardPage* self)
{
	GtkMenu* _tmp0_;
	GtkMenu* _tmp8_;
	GtkMenu* _tmp9_;
	GtkMenu* result;
	_tmp0_ = self->priv->item_context_menu;
	if (_tmp0_ == NULL) {
		GMenuModel* model = NULL;
		GtkBuilder* _tmp1_;
		const gchar* _tmp2_;
		GObject* _tmp3_;
		GMenuModel* _tmp4_;
		GMenuModel* _tmp5_;
		GtkMenu* _tmp6_;
		GtkMenu* _tmp7_;
		_tmp1_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->builder;
		_tmp2_ = self->priv->item_context_menu_path;
		_tmp3_ = gtk_builder_get_object (_tmp1_, _tmp2_);
		_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, g_menu_model_get_type ()) ? ((GMenuModel*) _tmp3_) : NULL);
		model = _tmp4_;
		_tmp5_ = model;
		_tmp6_ = (GtkMenu*) gtk_menu_new_from_model (_tmp5_);
		g_object_ref_sink (_tmp6_);
		_g_object_unref0 (self->priv->item_context_menu);
		self->priv->item_context_menu = _tmp6_;
		_tmp7_ = self->priv->item_context_menu;
		gtk_menu_attach_to_widget (_tmp7_, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), NULL);
		_g_object_unref0 (model);
	}
	_tmp8_ = self->priv->item_context_menu;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	result = _tmp9_;
	return result;
}

GtkMenu*
checkerboard_page_get_item_context_menu (CheckerboardPage* self)
{
	CheckerboardPageClass* _klass_;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), NULL);
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->get_item_context_menu) {
		return _klass_->get_item_context_menu (self);
	}
	return NULL;
}

static GtkMenu*
checkerboard_page_real_get_page_context_menu (Page* base)
{
	CheckerboardPage * self;
	const gchar* _tmp0_;
	GtkMenu* _tmp1_;
	GtkMenu* _tmp9_;
	GtkMenu* _tmp10_;
	GtkMenu* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	_tmp0_ = self->priv->page_context_menu_path;
	if (_tmp0_ == NULL) {
		result = NULL;
		return result;
	}
	_tmp1_ = self->priv->page_context_menu;
	if (_tmp1_ == NULL) {
		GMenuModel* model = NULL;
		GtkBuilder* _tmp2_;
		const gchar* _tmp3_;
		GObject* _tmp4_;
		GMenuModel* _tmp5_;
		GMenuModel* _tmp6_;
		GtkMenu* _tmp7_;
		GtkMenu* _tmp8_;
		_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page)->builder;
		_tmp3_ = self->priv->page_context_menu_path;
		_tmp4_ = gtk_builder_get_object (_tmp2_, _tmp3_);
		_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, g_menu_model_get_type ()) ? ((GMenuModel*) _tmp4_) : NULL);
		model = _tmp5_;
		_tmp6_ = model;
		_tmp7_ = (GtkMenu*) gtk_menu_new_from_model (_tmp6_);
		g_object_ref_sink (_tmp7_);
		_g_object_unref0 (self->priv->page_context_menu);
		self->priv->page_context_menu = _tmp7_;
		_tmp8_ = self->priv->page_context_menu;
		gtk_menu_attach_to_widget (_tmp8_, G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), NULL);
		_g_object_unref0 (model);
	}
	_tmp9_ = self->priv->page_context_menu;
	_tmp10_ = _g_object_ref0 (_tmp9_);
	result = _tmp10_;
	return result;
}

static gboolean
checkerboard_page_real_on_context_keypress (Page* base)
{
	CheckerboardPage * self;
	GtkMenu* _tmp0_;
	GtkMenu* _tmp1_;
	gboolean _tmp2_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	_tmp0_ = checkerboard_page_get_context_menu (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = page_popup_context_menu (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), _tmp1_, NULL);
	_g_object_unref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

static gchar*
checkerboard_page_real_get_view_empty_icon (CheckerboardPage* self)
{
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_strdup ("image-x-generic-symbolic");
	result = _tmp0_;
	return result;
}

gchar*
checkerboard_page_get_view_empty_icon (CheckerboardPage* self)
{
	CheckerboardPageClass* _klass_;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), NULL);
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->get_view_empty_icon) {
		return _klass_->get_view_empty_icon (self);
	}
	return NULL;
}

static gchar*
checkerboard_page_real_get_view_empty_message (CheckerboardPage* self)
{
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_strdup (_ ("No photos/videos"));
	result = _tmp0_;
	return result;
}

gchar*
checkerboard_page_get_view_empty_message (CheckerboardPage* self)
{
	CheckerboardPageClass* _klass_;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), NULL);
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->get_view_empty_message) {
		return _klass_->get_view_empty_message (self);
	}
	return NULL;
}

static gchar*
checkerboard_page_real_get_filter_no_match_message (CheckerboardPage* self)
{
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_strdup (_ ("No photos/videos found which match the current filter"));
	result = _tmp0_;
	return result;
}

gchar*
checkerboard_page_get_filter_no_match_message (CheckerboardPage* self)
{
	CheckerboardPageClass* _klass_;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), NULL);
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->get_filter_no_match_message) {
		return _klass_->get_filter_no_match_message (self);
	}
	return NULL;
}

static void
checkerboard_page_real_on_item_activated (CheckerboardPage* self,
                                          CheckerboardItem* item,
                                          CheckerboardPageActivator activator,
                                          CheckerboardPageKeyboardModifiers* modifiers)
{
	g_return_if_fail (IS_CHECKERBOARD_ITEM (item));
	g_return_if_fail (modifiers != NULL);
}

void
checkerboard_page_on_item_activated (CheckerboardPage* self,
                                     CheckerboardItem* item,
                                     CheckerboardPageActivator activator,
                                     CheckerboardPageKeyboardModifiers* modifiers)
{
	CheckerboardPageClass* _klass_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->on_item_activated) {
		_klass_->on_item_activated (self, item, activator, modifiers);
	}
}

CheckerboardLayout*
checkerboard_page_get_checkerboard_layout (CheckerboardPage* self)
{
	CheckerboardLayout* _tmp0_;
	CheckerboardLayout* _tmp1_;
	CheckerboardLayout* result;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), NULL);
	_tmp0_ = self->priv->layout;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static SearchViewFilter*
checkerboard_page_real_get_search_view_filter (CheckerboardPage* self)
{
	g_critical ("Type `%s' does not implement abstract method `checkerboard_page_get_search_view_filter'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

SearchViewFilter*
checkerboard_page_get_search_view_filter (CheckerboardPage* self)
{
	CheckerboardPageClass* _klass_;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), NULL);
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->get_search_view_filter) {
		return _klass_->get_search_view_filter (self);
	}
	return NULL;
}

static CoreViewTracker*
checkerboard_page_real_get_view_tracker (CheckerboardPage* self)
{
	CoreViewTracker* result;
	result = NULL;
	return result;
}

CoreViewTracker*
checkerboard_page_get_view_tracker (CheckerboardPage* self)
{
	CheckerboardPageClass* _klass_;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), NULL);
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->get_view_tracker) {
		return _klass_->get_view_tracker (self);
	}
	return NULL;
}

static void
_checkerboard_page_on_view_filter_refresh_view_filter_refresh (ViewFilter* _sender,
                                                               gpointer self)
{
	checkerboard_page_on_view_filter_refresh ((CheckerboardPage*) self);
}

static void
checkerboard_page_real_switching_from (Page* base)
{
	CheckerboardPage * self;
	CheckerboardLayout* _tmp0_;
	SearchViewFilter* _tmp1_;
	SearchViewFilter* _tmp2_;
	guint _tmp3_;
	ViewCollection* _tmp4_;
	ViewCollection* _tmp5_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	_tmp0_ = self->priv->layout;
	checkerboard_layout_set_in_view (_tmp0_, FALSE);
	_tmp1_ = checkerboard_page_get_search_view_filter (self);
	_tmp2_ = _tmp1_;
	g_signal_parse_name ("refresh", TYPE_VIEW_FILTER, &_tmp3_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_VIEW_FILTER, ViewFilter), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _checkerboard_page_on_view_filter_refresh_view_filter_refresh, self);
	_view_filter_unref0 (_tmp2_);
	_tmp4_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp5_ = _tmp4_;
	view_collection_unselect_all (_tmp5_);
	_data_collection_unref0 (_tmp5_);
	PAGE_CLASS (checkerboard_page_parent_class)->switching_from (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
}

void
checkerboard_page_scroll_to_item (CheckerboardPage* self,
                                  CheckerboardItem* item)
{
	GtkAdjustment* vadj = NULL;
	GtkAdjustment* _tmp0_;
	GtkAdjustment* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GtkAdjustment* _tmp3_;
	GdkRectangle _tmp4_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (IS_CHECKERBOARD_ITEM (item));
	_tmp0_ = gtk_scrolled_window_get_vadjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_scrolled_window_get_type (), GtkScrolledWindow));
	_tmp1_ = _g_object_ref0 (_tmp0_);
	vadj = _tmp1_;
	_tmp3_ = vadj;
	_tmp4_ = item->allocation;
	if (get_adjustment_relation (_tmp3_, _tmp4_.y) == ADJUSTMENT_RELATION_IN_RANGE) {
		GtkAdjustment* _tmp5_;
		GdkRectangle _tmp6_;
		GdkRectangle _tmp7_;
		_tmp5_ = vadj;
		_tmp6_ = item->allocation;
		_tmp7_ = item->allocation;
		_tmp2_ = get_adjustment_relation (_tmp5_, _tmp6_.y + _tmp7_.height) == ADJUSTMENT_RELATION_IN_RANGE;
	} else {
		_tmp2_ = FALSE;
	}
	if (!_tmp2_) {
		gint top = 0;
		GdkRectangle _tmp8_;
		GtkAdjustment* _tmp9_;
		GtkAdjustment* _tmp14_;
		top = 0;
		_tmp8_ = item->allocation;
		_tmp9_ = vadj;
		if (((gdouble) _tmp8_.y) < gtk_adjustment_get_value (_tmp9_)) {
			GdkRectangle _tmp10_;
			_tmp10_ = item->allocation;
			top = _tmp10_.y;
			top -= CHECKERBOARD_LAYOUT_ROW_GUTTER_PADDING / 2;
		} else {
			GdkRectangle _tmp11_;
			GdkRectangle _tmp12_;
			GtkAdjustment* _tmp13_;
			_tmp11_ = item->allocation;
			_tmp12_ = item->allocation;
			_tmp13_ = vadj;
			top = (_tmp11_.y + _tmp12_.height) - ((gint) gtk_adjustment_get_page_size (_tmp13_));
			top += CHECKERBOARD_LAYOUT_ROW_GUTTER_PADDING / 2;
		}
		_tmp14_ = vadj;
		gtk_adjustment_set_value (_tmp14_, (gdouble) top);
	}
	_g_object_unref0 (vadj);
}

static void
checkerboard_page_real_switched_to (Page* base)
{
	CheckerboardPage * self;
	CheckerboardLayout* _tmp0_;
	SearchViewFilter* _tmp1_;
	SearchViewFilter* _tmp2_;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	gboolean _tmp5_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	_tmp0_ = self->priv->layout;
	checkerboard_layout_set_in_view (_tmp0_, TRUE);
	_tmp1_ = checkerboard_page_get_search_view_filter (self);
	_tmp2_ = _tmp1_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_VIEW_FILTER, ViewFilter), "refresh", (GCallback) _checkerboard_page_on_view_filter_refresh_view_filter_refresh, self, 0);
	_view_filter_unref0 (_tmp2_);
	checkerboard_page_on_view_filter_refresh (self);
	_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp4_ = _tmp3_;
	_tmp5_ = view_collection_get_selected_count (_tmp4_) > 0;
	_data_collection_unref0 (_tmp4_);
	if (_tmp5_) {
		CheckerboardItem* item = NULL;
		ViewCollection* _tmp6_;
		ViewCollection* _tmp7_;
		DataView* _tmp8_;
		CheckerboardItem* _tmp9_;
		CheckerboardItem* _tmp10_;
		_tmp6_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp7_ = _tmp6_;
		_tmp8_ = view_collection_get_selected_at (_tmp7_, 0);
		_tmp9_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_CHECKERBOARD_ITEM, CheckerboardItem);
		_data_collection_unref0 (_tmp7_);
		item = _tmp9_;
		_tmp10_ = item;
		checkerboard_page_scroll_to_item (self, _tmp10_);
		_g_object_unref0 (item);
	}
	PAGE_CLASS (checkerboard_page_parent_class)->switched_to (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
}

static void
checkerboard_page_on_view_filter_refresh (CheckerboardPage* self)
{
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	checkerboard_page_update_view_filter_message (self);
}

static void
checkerboard_page_on_contents_altered (CheckerboardPage* self,
                                       GeeIterable* added,
                                       GeeIterable* removed)
{
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail ((added == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (added, GEE_TYPE_ITERABLE));
	g_return_if_fail ((removed == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (removed, GEE_TYPE_ITERABLE));
	checkerboard_page_update_view_filter_message (self);
}

static void
checkerboard_page_on_items_state_changed (CheckerboardPage* self,
                                          GeeIterable* changed)
{
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (changed, GEE_TYPE_ITERABLE));
	checkerboard_page_update_view_filter_message (self);
}

static void
checkerboard_page_on_items_visibility_changed (CheckerboardPage* self,
                                               GeeCollection* changed)
{
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (changed, GEE_TYPE_COLLECTION));
	checkerboard_page_update_view_filter_message (self);
}

static void
checkerboard_page_update_view_filter_message (CheckerboardPage* self)
{
	gboolean _tmp0_ = FALSE;
	ViewCollection* _tmp1_;
	ViewCollection* _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	_tmp1_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp2_ = _tmp1_;
	_tmp3_ = view_collection_are_items_filtered_out (_tmp2_);
	_data_collection_unref0 (_tmp2_);
	if (_tmp3_) {
		ViewCollection* _tmp4_;
		ViewCollection* _tmp5_;
		_tmp4_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp5_ = _tmp4_;
		_tmp0_ = data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_DATA_COLLECTION, DataCollection)) == 0;
		_data_collection_unref0 (_tmp5_);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp6_ = checkerboard_page_get_filter_no_match_message (self);
		_tmp7_ = _tmp6_;
		checkerboard_page_set_page_message (self, _tmp7_);
		_g_free0 (_tmp7_);
	} else {
		ViewCollection* _tmp8_;
		ViewCollection* _tmp9_;
		gboolean _tmp10_;
		_tmp8_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp9_ = _tmp8_;
		_tmp10_ = data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_DATA_COLLECTION, DataCollection)) == 0;
		_data_collection_unref0 (_tmp9_);
		if (_tmp10_) {
			gchar* _tmp11_;
			gchar* _tmp12_;
			_tmp11_ = checkerboard_page_get_view_empty_message (self);
			_tmp12_ = _tmp11_;
			checkerboard_page_set_page_message (self, _tmp12_);
			_g_free0 (_tmp12_);
		} else {
			checkerboard_page_unset_page_message (self);
		}
	}
}

void
checkerboard_page_set_page_message (CheckerboardPage* self,
                                    const gchar* message)
{
	PageMessagePane* _tmp0_;
	GtkLabel* _tmp1_;
	GtkStack* _tmp15_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (message != NULL);
	_tmp0_ = self->priv->message_pane;
	_tmp1_ = _tmp0_->label;
	gtk_label_set_label (_tmp1_, message);
	{
		PageMessagePane* _tmp2_;
		GtkImage* _tmp3_;
		GIcon* _tmp4_ = NULL;
		gchar* _tmp5_;
		gchar* _tmp6_;
		GIcon* _tmp7_;
		GIcon* _tmp8_;
		PageMessagePane* _tmp9_;
		GtkImage* _tmp10_;
		_tmp2_ = self->priv->message_pane;
		_tmp3_ = _tmp2_->icon_image;
		g_object_set (_tmp3_, "icon-name", NULL, NULL);
		_tmp5_ = checkerboard_page_get_view_empty_icon (self);
		_tmp6_ = _tmp5_;
		_tmp7_ = g_icon_new_for_string (_tmp6_, &_inner_error0_);
		_tmp8_ = _tmp7_;
		_g_free0 (_tmp6_);
		_tmp4_ = _tmp8_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp9_ = self->priv->message_pane;
		_tmp10_ = _tmp9_->icon_image;
		g_object_set (_tmp10_, "gicon", _tmp4_, NULL);
		_g_object_unref0 (_tmp4_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		PageMessagePane* _tmp11_;
		GtkImage* _tmp12_;
		PageMessagePane* _tmp13_;
		GtkImage* _tmp14_;
		g_clear_error (&_inner_error0_);
		_tmp11_ = self->priv->message_pane;
		_tmp12_ = _tmp11_->icon_image;
		g_object_set (_tmp12_, "gicon", NULL, NULL);
		_tmp13_ = self->priv->message_pane;
		_tmp14_ = _tmp13_->icon_image;
		g_object_set (_tmp14_, "icon-name", "image-x-generic-symbolic", NULL);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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;
	}
	_tmp15_ = self->priv->stack;
	gtk_stack_set_visible_child_name (_tmp15_, "message");
}

void
checkerboard_page_unset_page_message (CheckerboardPage* self)
{
	GtkStack* _tmp0_;
	CheckerboardLayout* _tmp1_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	_tmp0_ = self->priv->stack;
	_tmp1_ = self->priv->layout;
	gtk_stack_set_visible_child (_tmp0_, G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
}

static void
checkerboard_page_real_set_page_name (Page* base,
                                      const gchar* name)
{
	CheckerboardPage * self;
	CheckerboardLayout* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	g_return_if_fail (name != NULL);
	PAGE_CLASS (checkerboard_page_parent_class)->set_page_name (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), name);
	_tmp0_ = self->priv->layout;
	checkerboard_layout_set_name (_tmp0_, name);
}

CheckerboardItem*
checkerboard_page_get_item_at_pixel (CheckerboardPage* self,
                                     gdouble x,
                                     gdouble y)
{
	CheckerboardLayout* _tmp0_;
	CheckerboardItem* _tmp1_;
	CheckerboardItem* result;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), NULL);
	_tmp0_ = self->priv->layout;
	_tmp1_ = checkerboard_layout_get_item_at_pixel (_tmp0_, x, y);
	result = _tmp1_;
	return result;
}

static void
checkerboard_page_on_items_hidden (CheckerboardPage* self,
                                   GeeIterable* hidden)
{
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (hidden, GEE_TYPE_ITERABLE));
	{
		GeeIterator* _view_it = NULL;
		GeeIterator* _tmp0_;
		_tmp0_ = gee_iterable_iterator (hidden);
		_view_it = _tmp0_;
		while (TRUE) {
			GeeIterator* _tmp1_;
			DataView* view = NULL;
			GeeIterator* _tmp2_;
			gpointer _tmp3_;
			CheckerboardItem* item = NULL;
			DataView* _tmp4_;
			CheckerboardItem* _tmp5_;
			CheckerboardItem* _tmp6_;
			CheckerboardItem* _tmp7_;
			CheckerboardItem* _tmp8_;
			CheckerboardItem* _tmp9_;
			CheckerboardItem* _tmp10_;
			CheckerboardItem* _tmp11_;
			_tmp1_ = _view_it;
			if (!gee_iterator_next (_tmp1_)) {
				break;
			}
			_tmp2_ = _view_it;
			_tmp3_ = gee_iterator_get (_tmp2_);
			view = (DataView*) _tmp3_;
			_tmp4_ = view;
			_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
			item = _tmp5_;
			_tmp6_ = self->anchor;
			_tmp7_ = item;
			if (_tmp6_ == _tmp7_) {
				_g_object_unref0 (self->anchor);
				self->anchor = NULL;
			}
			_tmp8_ = self->cursor;
			_tmp9_ = item;
			if (_tmp8_ == _tmp9_) {
				_g_object_unref0 (self->cursor);
				self->cursor = NULL;
			}
			_tmp10_ = self->priv->current_hovered_item;
			_tmp11_ = item;
			if (_tmp10_ == _tmp11_) {
				_g_object_unref0 (self->priv->current_hovered_item);
				self->priv->current_hovered_item = NULL;
			}
			_g_object_unref0 (item);
			_g_object_unref0 (view);
		}
		_g_object_unref0 (_view_it);
	}
}

static gboolean
checkerboard_page_real_key_press_event (GtkWidget* base,
                                        GdkEventKey* event)
{
	CheckerboardPage * self;
	gboolean handled = FALSE;
	guint state = 0U;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	static GQuark _tmp2_label3 = 0;
	static GQuark _tmp2_label4 = 0;
	static GQuark _tmp2_label5 = 0;
	static GQuark _tmp2_label6 = 0;
	static GQuark _tmp2_label7 = 0;
	static GQuark _tmp2_label8 = 0;
	static GQuark _tmp2_label9 = 0;
	static GQuark _tmp2_label10 = 0;
	static GQuark _tmp2_label11 = 0;
	static GQuark _tmp2_label12 = 0;
	static GQuark _tmp2_label13 = 0;
	static GQuark _tmp2_label14 = 0;
	gboolean _tmp34_ = FALSE;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	g_return_val_if_fail (event != NULL, FALSE);
	handled = TRUE;
	state = (guint) (event->state & GDK_SHIFT_MASK);
	_tmp0_ = gdk_keyval_name (event->keyval);
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if ((_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("Up")))) || (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("KP_Up"))))) {
		switch (0) {
			default:
			{
				checkerboard_page_move_cursor (self, COMPASS_POINT_NORTH);
				checkerboard_page_select_anchor_to_cursor (self, state);
				break;
			}
		}
	} else if ((_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("Down")))) || (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("KP_Down"))))) {
		switch (0) {
			default:
			{
				checkerboard_page_move_cursor (self, COMPASS_POINT_SOUTH);
				checkerboard_page_select_anchor_to_cursor (self, state);
				break;
			}
		}
	} else if ((_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("Left")))) || (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("KP_Left"))))) {
		switch (0) {
			default:
			{
				checkerboard_page_move_cursor (self, COMPASS_POINT_WEST);
				checkerboard_page_select_anchor_to_cursor (self, state);
				break;
			}
		}
	} else if ((_tmp3_ == ((0 != _tmp2_label6) ? _tmp2_label6 : (_tmp2_label6 = g_quark_from_static_string ("Right")))) || (_tmp3_ == ((0 != _tmp2_label7) ? _tmp2_label7 : (_tmp2_label7 = g_quark_from_static_string ("KP_Right"))))) {
		switch (0) {
			default:
			{
				checkerboard_page_move_cursor (self, COMPASS_POINT_EAST);
				checkerboard_page_select_anchor_to_cursor (self, state);
				break;
			}
		}
	} else if ((_tmp3_ == ((0 != _tmp2_label8) ? _tmp2_label8 : (_tmp2_label8 = g_quark_from_static_string ("Home")))) || (_tmp3_ == ((0 != _tmp2_label9) ? _tmp2_label9 : (_tmp2_label9 = g_quark_from_static_string ("KP_Home"))))) {
		switch (0) {
			default:
			{
				CheckerboardItem* first = NULL;
				ViewCollection* _tmp4_;
				ViewCollection* _tmp5_;
				DataView* _tmp6_;
				CheckerboardItem* _tmp7_;
				CheckerboardItem* _tmp8_;
				_tmp4_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp5_ = _tmp4_;
				_tmp6_ = view_collection_get_first (_tmp5_);
				_tmp7_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_CHECKERBOARD_ITEM, CheckerboardItem);
				_data_collection_unref0 (_tmp5_);
				first = _tmp7_;
				_tmp8_ = first;
				if (_tmp8_ != NULL) {
					CheckerboardItem* _tmp9_;
					_tmp9_ = first;
					checkerboard_page_cursor_to_item (self, _tmp9_);
				}
				checkerboard_page_select_anchor_to_cursor (self, state);
				_g_object_unref0 (first);
				break;
			}
		}
	} else if ((_tmp3_ == ((0 != _tmp2_label10) ? _tmp2_label10 : (_tmp2_label10 = g_quark_from_static_string ("End")))) || (_tmp3_ == ((0 != _tmp2_label11) ? _tmp2_label11 : (_tmp2_label11 = g_quark_from_static_string ("KP_End"))))) {
		switch (0) {
			default:
			{
				CheckerboardItem* last = NULL;
				ViewCollection* _tmp10_;
				ViewCollection* _tmp11_;
				DataView* _tmp12_;
				CheckerboardItem* _tmp13_;
				CheckerboardItem* _tmp14_;
				_tmp10_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp11_ = _tmp10_;
				_tmp12_ = view_collection_get_last (_tmp11_);
				_tmp13_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_CHECKERBOARD_ITEM, CheckerboardItem);
				_data_collection_unref0 (_tmp11_);
				last = _tmp13_;
				_tmp14_ = last;
				if (_tmp14_ != NULL) {
					CheckerboardItem* _tmp15_;
					_tmp15_ = last;
					checkerboard_page_cursor_to_item (self, _tmp15_);
				}
				checkerboard_page_select_anchor_to_cursor (self, state);
				_g_object_unref0 (last);
				break;
			}
		}
	} else if ((_tmp3_ == ((0 != _tmp2_label12) ? _tmp2_label12 : (_tmp2_label12 = g_quark_from_static_string ("Return")))) || (_tmp3_ == ((0 != _tmp2_label13) ? _tmp2_label13 : (_tmp2_label13 = g_quark_from_static_string ("KP_Enter"))))) {
		switch (0) {
			default:
			{
				ViewCollection* _tmp16_;
				ViewCollection* _tmp17_;
				gboolean _tmp18_;
				_tmp16_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp17_ = _tmp16_;
				_tmp18_ = view_collection_get_selected_count (_tmp17_) == 1;
				_data_collection_unref0 (_tmp17_);
				if (_tmp18_) {
					ViewCollection* _tmp19_;
					ViewCollection* _tmp20_;
					DataView* _tmp21_;
					CheckerboardItem* _tmp22_;
					CheckerboardPageKeyboardModifiers _tmp23_ = {0};
					_tmp19_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
					_tmp20_ = _tmp19_;
					_tmp21_ = view_collection_get_selected_at (_tmp20_, 0);
					_tmp22_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, TYPE_CHECKERBOARD_ITEM, CheckerboardItem);
					checkerboard_page_keyboard_modifiers_init (&_tmp23_, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
					checkerboard_page_on_item_activated (self, _tmp22_, CHECKERBOARD_PAGE_ACTIVATOR_KEYBOARD, &_tmp23_);
					_g_object_unref0 (_tmp22_);
					_data_collection_unref0 (_tmp20_);
				} else {
					handled = FALSE;
				}
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label14) ? _tmp2_label14 : (_tmp2_label14 = g_quark_from_static_string ("space")))) {
		switch (0) {
			default:
			{
				Marker* marker = NULL;
				ViewCollection* _tmp24_;
				ViewCollection* _tmp25_;
				CheckerboardLayout* _tmp26_;
				CheckerboardItem* _tmp27_;
				CheckerboardItem* _tmp28_;
				Marker* _tmp29_;
				Marker* _tmp30_;
				ViewCollection* _tmp31_;
				ViewCollection* _tmp32_;
				Marker* _tmp33_;
				_tmp24_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp25_ = _tmp24_;
				_tmp26_ = self->priv->layout;
				_tmp27_ = checkerboard_layout_get_cursor (_tmp26_);
				_tmp28_ = _tmp27_;
				_tmp29_ = data_collection_mark (G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, TYPE_DATA_OBJECT, DataObject));
				_tmp30_ = _tmp29_;
				_g_object_unref0 (_tmp28_);
				_data_collection_unref0 (_tmp25_);
				marker = _tmp30_;
				_tmp31_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp32_ = _tmp31_;
				_tmp33_ = marker;
				view_collection_toggle_marked (_tmp32_, _tmp33_);
				_data_collection_unref0 (_tmp32_);
				_g_object_unref0 (marker);
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				handled = FALSE;
				break;
			}
		}
	}
	if (handled) {
		result = TRUE;
		return result;
	}
	if (GTK_WIDGET_CLASS (checkerboard_page_parent_class)->key_press_event != NULL) {
		_tmp34_ = GTK_WIDGET_CLASS (checkerboard_page_parent_class)->key_press_event (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), gtk_widget_get_type (), GtkWidget), event);
	} else {
		_tmp34_ = TRUE;
	}
	result = _tmp34_;
	return result;
}

static gboolean
checkerboard_page_real_on_left_click (Page* base,
                                      GdkEventButton* event)
{
	CheckerboardPage * self;
	gboolean _tmp0_ = FALSE;
	guint state = 0U;
	CheckerboardItem* item = NULL;
	CheckerboardItem* _tmp1_;
	CheckerboardItem* _tmp2_;
	ViewCollection* _tmp77_;
	ViewCollection* _tmp78_;
	gboolean _tmp79_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->type != GDK_BUTTON_PRESS) {
		_tmp0_ = event->type != GDK_2BUTTON_PRESS;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	state = (guint) (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK));
	_tmp1_ = checkerboard_page_get_item_at_pixel (self, event->x, event->y);
	item = _tmp1_;
	_tmp2_ = item;
	if (_tmp2_ != NULL) {
		CheckerboardLayout* _tmp3_;
		CheckerboardItem* _tmp4_;
		CheckerboardLayout* _tmp58_;
		CheckerboardItem* _tmp59_;
		_tmp3_ = self->priv->layout;
		_tmp4_ = item;
		if (checkerboard_layout_handle_left_click (_tmp3_, _tmp4_, event->x, event->y, event->state)) {
			result = TRUE;
			_g_object_unref0 (item);
			return result;
		}
		switch (state) {
			case GDK_CONTROL_MASK:
			{
				Marker* marker = NULL;
				ViewCollection* _tmp5_;
				ViewCollection* _tmp6_;
				CheckerboardItem* _tmp7_;
				Marker* _tmp8_;
				Marker* _tmp9_;
				ViewCollection* _tmp10_;
				ViewCollection* _tmp11_;
				Marker* _tmp12_;
				CheckerboardItem* _tmp13_;
				_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp6_ = _tmp5_;
				_tmp7_ = item;
				_tmp8_ = data_collection_mark (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_DATA_OBJECT, DataObject));
				_tmp9_ = _tmp8_;
				_data_collection_unref0 (_tmp6_);
				marker = _tmp9_;
				_tmp10_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp11_ = _tmp10_;
				_tmp12_ = marker;
				view_collection_toggle_marked (_tmp11_, _tmp12_);
				_data_collection_unref0 (_tmp11_);
				_tmp13_ = item;
				if (data_view_is_selected (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_VIEW, DataView))) {
					CheckerboardItem* _tmp14_;
					CheckerboardItem* _tmp15_;
					CheckerboardItem* _tmp16_;
					CheckerboardItem* _tmp17_;
					_tmp14_ = item;
					_tmp15_ = _g_object_ref0 (_tmp14_);
					_g_object_unref0 (self->anchor);
					self->anchor = _tmp15_;
					_tmp16_ = item;
					_tmp17_ = _g_object_ref0 (_tmp16_);
					_g_object_unref0 (self->cursor);
					self->cursor = _tmp17_;
				}
				_g_object_unref0 (marker);
				break;
			}
			case GDK_SHIFT_MASK:
			{
				ViewCollection* _tmp18_;
				ViewCollection* _tmp19_;
				CheckerboardItem* _tmp20_;
				CheckerboardItem* _tmp23_;
				CheckerboardItem* _tmp24_;
				CheckerboardItem* _tmp25_;
				CheckerboardItem* _tmp26_;
				_tmp18_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp19_ = _tmp18_;
				view_collection_unselect_all (_tmp19_);
				_data_collection_unref0 (_tmp19_);
				_tmp20_ = self->anchor;
				if (_tmp20_ == NULL) {
					CheckerboardItem* _tmp21_;
					CheckerboardItem* _tmp22_;
					_tmp21_ = item;
					_tmp22_ = _g_object_ref0 (_tmp21_);
					_g_object_unref0 (self->anchor);
					self->anchor = _tmp22_;
				}
				_tmp23_ = self->anchor;
				_tmp24_ = item;
				checkerboard_page_select_between_items (self, _tmp23_, _tmp24_);
				_tmp25_ = item;
				_tmp26_ = _g_object_ref0 (_tmp25_);
				_g_object_unref0 (self->cursor);
				self->cursor = _tmp26_;
				break;
			}
			case GDK_CONTROL_MASK | GDK_SHIFT_MASK:
			{
				CheckerboardItem* _tmp27_;
				CheckerboardItem* _tmp30_;
				CheckerboardItem* _tmp31_;
				CheckerboardItem* _tmp32_;
				CheckerboardItem* _tmp33_;
				_tmp27_ = self->anchor;
				if (_tmp27_ == NULL) {
					CheckerboardItem* _tmp28_;
					CheckerboardItem* _tmp29_;
					_tmp28_ = item;
					_tmp29_ = _g_object_ref0 (_tmp28_);
					_g_object_unref0 (self->anchor);
					self->anchor = _tmp29_;
				}
				_tmp30_ = self->anchor;
				_tmp31_ = item;
				checkerboard_page_select_between_items (self, _tmp30_, _tmp31_);
				_tmp32_ = item;
				_tmp33_ = _g_object_ref0 (_tmp32_);
				_g_object_unref0 (self->cursor);
				self->cursor = _tmp33_;
				break;
			}
			default:
			{
				CheckerboardItem* _tmp54_;
				CheckerboardItem* _tmp55_;
				CheckerboardItem* _tmp56_;
				CheckerboardItem* _tmp57_;
				if (event->type == GDK_2BUTTON_PRESS) {
					CheckerboardItem* _tmp34_;
					CheckerboardItem* _tmp35_;
					_tmp34_ = item;
					_tmp35_ = _g_object_ref0 (_tmp34_);
					_g_object_unref0 (self->priv->activated_item);
					self->priv->activated_item = _tmp35_;
				} else {
					CheckerboardItem* _tmp36_;
					_tmp36_ = item;
					if (!data_view_is_selected (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, TYPE_DATA_VIEW, DataView))) {
						Marker* all = NULL;
						ViewCollection* _tmp37_;
						ViewCollection* _tmp38_;
						Marker* _tmp39_;
						Marker* _tmp40_;
						Marker* _tmp41_;
						ViewCollection* _tmp42_;
						ViewCollection* _tmp43_;
						GeeList* _tmp44_;
						GeeList* _tmp45_;
						ViewCollection* _tmp46_;
						ViewCollection* _tmp47_;
						Marker* _tmp48_;
						ViewCollection* _tmp49_;
						ViewCollection* _tmp50_;
						CheckerboardItem* _tmp51_;
						Marker* _tmp52_;
						Marker* _tmp53_;
						_tmp37_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
						_tmp38_ = _tmp37_;
						_tmp39_ = data_collection_start_marking (G_TYPE_CHECK_INSTANCE_CAST (_tmp38_, TYPE_DATA_COLLECTION, DataCollection));
						_tmp40_ = _tmp39_;
						_data_collection_unref0 (_tmp38_);
						all = _tmp40_;
						_tmp41_ = all;
						_tmp42_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
						_tmp43_ = _tmp42_;
						_tmp44_ = view_collection_get_selected (_tmp43_);
						_tmp45_ = _tmp44_;
						marker_mark_many (_tmp41_, G_TYPE_CHECK_INSTANCE_CAST (_tmp45_, GEE_TYPE_COLLECTION, GeeCollection));
						_g_object_unref0 (_tmp45_);
						_data_collection_unref0 (_tmp43_);
						_tmp46_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
						_tmp47_ = _tmp46_;
						_tmp48_ = all;
						_tmp49_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
						_tmp50_ = _tmp49_;
						_tmp51_ = item;
						_tmp52_ = data_collection_mark (G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp51_, TYPE_DATA_OBJECT, DataObject));
						_tmp53_ = _tmp52_;
						view_collection_unselect_and_select_marked (_tmp47_, _tmp48_, _tmp53_);
						_g_object_unref0 (_tmp53_);
						_data_collection_unref0 (_tmp50_);
						_data_collection_unref0 (_tmp47_);
						_g_object_unref0 (all);
					}
				}
				_tmp54_ = item;
				_tmp55_ = _g_object_ref0 (_tmp54_);
				_g_object_unref0 (self->anchor);
				self->anchor = _tmp55_;
				_tmp56_ = item;
				_tmp57_ = _g_object_ref0 (_tmp56_);
				_g_object_unref0 (self->cursor);
				self->cursor = _tmp57_;
				break;
			}
		}
		_tmp58_ = self->priv->layout;
		_tmp59_ = item;
		checkerboard_layout_set_cursor (_tmp58_, _tmp59_);
	} else {
		GeeArrayList* _tmp62_;
		CheckerboardLayout* _tmp76_;
		if (state != ((guint) GDK_CONTROL_MASK)) {
			ViewCollection* _tmp60_;
			ViewCollection* _tmp61_;
			_tmp60_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
			_tmp61_ = _tmp60_;
			view_collection_unselect_all (_tmp61_);
			_data_collection_unref0 (_tmp61_);
		}
		_tmp62_ = gee_array_list_new (TYPE_CHECKERBOARD_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
		_g_object_unref0 (self->priv->previously_selected);
		self->priv->previously_selected = _tmp62_;
		{
			GeeList* _view_list = NULL;
			ViewCollection* _tmp63_;
			ViewCollection* _tmp64_;
			GeeList* _tmp65_;
			GeeList* _tmp66_;
			gint _view_size = 0;
			GeeList* _tmp67_;
			gint _tmp68_;
			gint _tmp69_;
			gint _view_index = 0;
			_tmp63_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
			_tmp64_ = _tmp63_;
			_tmp65_ = view_collection_get_selected (_tmp64_);
			_tmp66_ = _tmp65_;
			_data_collection_unref0 (_tmp64_);
			_view_list = _tmp66_;
			_tmp67_ = _view_list;
			_tmp68_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp67_, GEE_TYPE_COLLECTION, GeeCollection));
			_tmp69_ = _tmp68_;
			_view_size = _tmp69_;
			_view_index = -1;
			while (TRUE) {
				gint _tmp70_;
				gint _tmp71_;
				DataView* view = NULL;
				GeeList* _tmp72_;
				gpointer _tmp73_;
				GeeArrayList* _tmp74_;
				DataView* _tmp75_;
				_view_index = _view_index + 1;
				_tmp70_ = _view_index;
				_tmp71_ = _view_size;
				if (!(_tmp70_ < _tmp71_)) {
					break;
				}
				_tmp72_ = _view_list;
				_tmp73_ = gee_list_get (_tmp72_, _view_index);
				view = (DataView*) _tmp73_;
				_tmp74_ = self->priv->previously_selected;
				_tmp75_ = view;
				gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp74_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp75_, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
				_g_object_unref0 (view);
			}
			_g_object_unref0 (_view_list);
		}
		_tmp76_ = self->priv->layout;
		checkerboard_layout_set_drag_select_origin (_tmp76_, (gint) event->x, (gint) event->y);
		result = TRUE;
		_g_object_unref0 (item);
		return result;
	}
	_tmp77_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp78_ = _tmp77_;
	_tmp79_ = view_collection_get_selected_count (_tmp78_) == 0;
	_data_collection_unref0 (_tmp78_);
	result = _tmp79_;
	_g_object_unref0 (item);
	return result;
}

static gboolean
checkerboard_page_real_on_left_released (Page* base,
                                         GdkEventButton* event)
{
	CheckerboardPage * self;
	CheckerboardLayout* _tmp0_;
	CheckerboardItem* _tmp4_;
	CheckerboardItem* item = NULL;
	CheckerboardItem* _tmp7_;
	CheckerboardItem* _tmp8_;
	CheckerboardItem* _tmp9_;
	CheckerboardItem* _tmp10_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	g_return_val_if_fail (event != NULL, FALSE);
	_g_object_unref0 (self->priv->previously_selected);
	self->priv->previously_selected = NULL;
	_tmp0_ = self->priv->layout;
	if (checkerboard_layout_is_drag_select_active (_tmp0_)) {
		CheckerboardLayout* _tmp1_;
		CheckerboardItem* _tmp2_;
		CheckerboardItem* _tmp3_;
		_tmp1_ = self->priv->layout;
		checkerboard_layout_clear_drag_select (_tmp1_);
		_tmp2_ = self->cursor;
		_tmp3_ = _g_object_ref0 (_tmp2_);
		_g_object_unref0 (self->anchor);
		self->anchor = _tmp3_;
		result = TRUE;
		return result;
	}
	if ((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) != 0) {
		result = FALSE;
		return result;
	}
	_tmp4_ = self->priv->activated_item;
	if (_tmp4_ != NULL) {
		CheckerboardItem* _tmp5_;
		CheckerboardPageKeyboardModifiers _tmp6_ = {0};
		_tmp5_ = self->priv->activated_item;
		checkerboard_page_keyboard_modifiers_init (&_tmp6_, G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		checkerboard_page_on_item_activated (self, _tmp5_, CHECKERBOARD_PAGE_ACTIVATOR_MOUSE, &_tmp6_);
		_g_object_unref0 (self->priv->activated_item);
		self->priv->activated_item = NULL;
		result = TRUE;
		return result;
	}
	_tmp7_ = checkerboard_page_get_item_at_pixel (self, event->x, event->y);
	item = _tmp7_;
	_tmp8_ = item;
	if (_tmp8_ == NULL) {
		result = TRUE;
		_g_object_unref0 (item);
		return result;
	}
	_tmp9_ = self->cursor;
	_tmp10_ = item;
	if (_tmp9_ != _tmp10_) {
		ViewCollection* _tmp11_;
		ViewCollection* _tmp12_;
		_tmp11_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp12_ = _tmp11_;
		view_collection_unselect_all (_tmp12_);
		_data_collection_unref0 (_tmp12_);
	} else {
		CheckerboardItem* _tmp13_;
		_tmp13_ = item;
		if (data_view_is_selected (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_VIEW, DataView))) {
			ViewCollection* _tmp14_;
			ViewCollection* _tmp15_;
			CheckerboardItem* _tmp16_;
			_tmp14_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
			_tmp15_ = _tmp14_;
			_tmp16_ = item;
			view_collection_unselect_all_but (_tmp15_, G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, TYPE_DATA_VIEW, DataView));
			_data_collection_unref0 (_tmp15_);
		}
	}
	result = TRUE;
	_g_object_unref0 (item);
	return result;
}

static gboolean
checkerboard_page_real_on_right_click (Page* base,
                                       GdkEventButton* event)
{
	CheckerboardPage * self;
	CheckerboardItem* item = NULL;
	CheckerboardItem* _tmp0_;
	CheckerboardItem* _tmp1_;
	GtkMenu* context_menu = NULL;
	GtkMenu* _tmp30_;
	GtkMenu* _tmp31_;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->type != GDK_BUTTON_PRESS) {
		result = FALSE;
		return result;
	}
	_tmp0_ = checkerboard_page_get_item_at_pixel (self, event->x, event->y);
	item = _tmp0_;
	_tmp1_ = item;
	if (_tmp1_ != NULL) {
		switch (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) {
			case GDK_CONTROL_MASK:
			{
				Marker* marker = NULL;
				ViewCollection* _tmp2_;
				ViewCollection* _tmp3_;
				CheckerboardItem* _tmp4_;
				Marker* _tmp5_;
				Marker* _tmp6_;
				ViewCollection* _tmp7_;
				ViewCollection* _tmp8_;
				Marker* _tmp9_;
				_tmp2_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp3_ = _tmp2_;
				_tmp4_ = item;
				_tmp5_ = data_collection_mark (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_DATA_OBJECT, DataObject));
				_tmp6_ = _tmp5_;
				_data_collection_unref0 (_tmp3_);
				marker = _tmp6_;
				_tmp7_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
				_tmp8_ = _tmp7_;
				_tmp9_ = marker;
				view_collection_toggle_marked (_tmp8_, _tmp9_);
				_data_collection_unref0 (_tmp8_);
				_g_object_unref0 (marker);
				break;
			}
			case GDK_SHIFT_MASK:
			{
				break;
			}
			case GDK_CONTROL_MASK | GDK_SHIFT_MASK:
			{
				break;
			}
			default:
			{
				CheckerboardItem* _tmp10_;
				_tmp10_ = item;
				if (!data_view_is_selected (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_DATA_VIEW, DataView))) {
					Marker* all = NULL;
					ViewCollection* _tmp11_;
					ViewCollection* _tmp12_;
					Marker* _tmp13_;
					Marker* _tmp14_;
					Marker* _tmp15_;
					ViewCollection* _tmp16_;
					ViewCollection* _tmp17_;
					GeeList* _tmp18_;
					GeeList* _tmp19_;
					ViewCollection* _tmp20_;
					ViewCollection* _tmp21_;
					Marker* _tmp22_;
					ViewCollection* _tmp23_;
					ViewCollection* _tmp24_;
					CheckerboardItem* _tmp25_;
					Marker* _tmp26_;
					Marker* _tmp27_;
					_tmp11_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
					_tmp12_ = _tmp11_;
					_tmp13_ = data_collection_start_marking (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_DATA_COLLECTION, DataCollection));
					_tmp14_ = _tmp13_;
					_data_collection_unref0 (_tmp12_);
					all = _tmp14_;
					_tmp15_ = all;
					_tmp16_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
					_tmp17_ = _tmp16_;
					_tmp18_ = view_collection_get_selected (_tmp17_);
					_tmp19_ = _tmp18_;
					marker_mark_many (_tmp15_, G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_COLLECTION, GeeCollection));
					_g_object_unref0 (_tmp19_);
					_data_collection_unref0 (_tmp17_);
					_tmp20_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
					_tmp21_ = _tmp20_;
					_tmp22_ = all;
					_tmp23_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
					_tmp24_ = _tmp23_;
					_tmp25_ = item;
					_tmp26_ = data_collection_mark (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp25_, TYPE_DATA_OBJECT, DataObject));
					_tmp27_ = _tmp26_;
					view_collection_unselect_and_select_marked (_tmp21_, _tmp22_, _tmp27_);
					_g_object_unref0 (_tmp27_);
					_data_collection_unref0 (_tmp24_);
					_data_collection_unref0 (_tmp21_);
					_g_object_unref0 (all);
				}
				break;
			}
		}
	} else {
		ViewCollection* _tmp28_;
		ViewCollection* _tmp29_;
		_tmp28_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp29_ = _tmp28_;
		view_collection_unselect_all (_tmp29_);
		_data_collection_unref0 (_tmp29_);
	}
	_tmp30_ = checkerboard_page_get_context_menu (self);
	context_menu = _tmp30_;
	_tmp31_ = context_menu;
	result = page_popup_context_menu (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), _tmp31_, event);
	_g_object_unref0 (context_menu);
	_g_object_unref0 (item);
	return result;
}

static gboolean
checkerboard_page_real_on_mouse_over (CheckerboardPage* self,
                                      CheckerboardItem* item,
                                      gint x,
                                      gint y,
                                      GdkModifierType mask)
{
	CheckerboardItem* _tmp1_;
	CheckerboardItem* _tmp2_;
	CheckerboardItem* _tmp4_;
	CheckerboardItem* _tmp5_;
	gboolean result;
	g_return_val_if_fail ((item == NULL) || IS_CHECKERBOARD_ITEM (item), FALSE);
	if (item != NULL) {
		CheckerboardLayout* _tmp0_;
		_tmp0_ = self->priv->layout;
		checkerboard_layout_handle_mouse_motion (_tmp0_, item, x, y, mask);
	}
	_tmp1_ = self->priv->current_hovered_item;
	if (item == _tmp1_) {
		result = TRUE;
		return result;
	}
	_tmp2_ = self->priv->current_hovered_item;
	if (_tmp2_ != NULL) {
		CheckerboardItem* _tmp3_;
		_tmp3_ = self->priv->current_hovered_item;
		checkerboard_item_handle_mouse_leave (_tmp3_);
		_g_object_unref0 (self->priv->current_hovered_item);
		self->priv->current_hovered_item = NULL;
	}
	if (item == NULL) {
		result = TRUE;
		return result;
	}
	_tmp4_ = _g_object_ref0 (item);
	_g_object_unref0 (self->priv->current_hovered_item);
	self->priv->current_hovered_item = _tmp4_;
	_tmp5_ = self->priv->current_hovered_item;
	checkerboard_item_handle_mouse_enter (_tmp5_);
	result = TRUE;
	return result;
}

gboolean
checkerboard_page_on_mouse_over (CheckerboardPage* self,
                                 CheckerboardItem* item,
                                 gint x,
                                 gint y,
                                 GdkModifierType mask)
{
	CheckerboardPageClass* _klass_;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), FALSE);
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->on_mouse_over) {
		return _klass_->on_mouse_over (self, item, x, y, mask);
	}
	return FALSE;
}

static gboolean
_checkerboard_page_selection_autoscroll_gsource_func (gpointer self)
{
	gboolean result;
	result = checkerboard_page_selection_autoscroll ((CheckerboardPage*) self);
	return result;
}

static gboolean
checkerboard_page_real_on_motion (Page* base,
                                  GdkEventMotion* event,
                                  gint x,
                                  gint y,
                                  GdkModifierType mask)
{
	CheckerboardPage * self;
	CheckerboardItem* _tmp0_;
	CheckerboardItem* _tmp1_;
	gboolean _tmp2_;
	CheckerboardLayout* _tmp3_;
	CheckerboardLayout* _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = checkerboard_page_get_item_at_pixel (self, (gdouble) x, (gdouble) y);
	_tmp1_ = _tmp0_;
	_tmp2_ = !checkerboard_page_on_mouse_over (self, _tmp1_, x, y, mask);
	_g_object_unref0 (_tmp1_);
	if (_tmp2_) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->layout;
	if (!checkerboard_layout_is_drag_select_active (_tmp3_)) {
		result = FALSE;
		return result;
	}
	_tmp4_ = self->priv->layout;
	checkerboard_layout_set_drag_select_endpoint (_tmp4_, x, y);
	checkerboard_page_updated_selection_band (self);
	if (!self->priv->autoscroll_scheduled) {
		GtkAdjustment* _tmp6_;
		_tmp6_ = gtk_scrolled_window_get_vadjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_scrolled_window_get_type (), GtkScrolledWindow));
		_tmp5_ = get_adjustment_relation (_tmp6_, y) != ADJUSTMENT_RELATION_IN_RANGE;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) CHECKERBOARD_PAGE_AUTOSCROLL_TICKS_MSEC, _checkerboard_page_selection_autoscroll_gsource_func, g_object_ref (self), g_object_unref);
		self->priv->autoscroll_scheduled = TRUE;
	}
	result = TRUE;
	return result;
}

static void
checkerboard_page_updated_selection_band (CheckerboardPage* self)
{
	CheckerboardLayout* _tmp0_;
	GeeList* intersection = NULL;
	CheckerboardLayout* _tmp1_;
	GeeList* _tmp2_;
	GeeList* _tmp3_;
	Marker* to_unselect = NULL;
	ViewCollection* _tmp4_;
	ViewCollection* _tmp5_;
	Marker* _tmp6_;
	Marker* _tmp7_;
	Marker* to_select = NULL;
	ViewCollection* _tmp8_;
	ViewCollection* _tmp9_;
	Marker* _tmp10_;
	Marker* _tmp11_;
	Marker* _tmp12_;
	ViewCollection* _tmp13_;
	ViewCollection* _tmp14_;
	GeeList* _tmp15_;
	GeeList* _tmp16_;
	GeeArrayList* _tmp17_;
	Marker* _tmp18_;
	GeeArrayList* _tmp19_;
	Marker* _tmp20_;
	GeeArrayList* _tmp21_;
	ViewCollection* _tmp39_;
	ViewCollection* _tmp40_;
	Marker* _tmp41_;
	ViewCollection* _tmp42_;
	ViewCollection* _tmp43_;
	Marker* _tmp44_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	_tmp0_ = self->priv->layout;
	_vala_assert (checkerboard_layout_is_drag_select_active (_tmp0_), "layout.is_drag_select_active()");
	_tmp1_ = self->priv->layout;
	_tmp2_ = checkerboard_layout_items_in_selection_band (_tmp1_);
	intersection = _tmp2_;
	_tmp3_ = intersection;
	if (_tmp3_ == NULL) {
		_g_object_unref0 (intersection);
		return;
	}
	_tmp4_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp5_ = _tmp4_;
	_tmp6_ = data_collection_start_marking (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_DATA_COLLECTION, DataCollection));
	_tmp7_ = _tmp6_;
	_data_collection_unref0 (_tmp5_);
	to_unselect = _tmp7_;
	_tmp8_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp9_ = _tmp8_;
	_tmp10_ = data_collection_start_marking (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_DATA_COLLECTION, DataCollection));
	_tmp11_ = _tmp10_;
	_data_collection_unref0 (_tmp9_);
	to_select = _tmp11_;
	_tmp12_ = to_unselect;
	_tmp13_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp14_ = _tmp13_;
	_tmp15_ = view_collection_get_selected (_tmp14_);
	_tmp16_ = _tmp15_;
	marker_mark_many (_tmp12_, G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, GEE_TYPE_COLLECTION, GeeCollection));
	_g_object_unref0 (_tmp16_);
	_data_collection_unref0 (_tmp14_);
	_tmp17_ = self->priv->previously_selected;
	_vala_assert (_tmp17_ != NULL, "previously_selected != null");
	_tmp18_ = to_unselect;
	_tmp19_ = self->priv->previously_selected;
	marker_unmark_many (_tmp18_, G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp20_ = to_select;
	_tmp21_ = self->priv->previously_selected;
	marker_mark_many (_tmp20_, G_TYPE_CHECK_INSTANCE_CAST (_tmp21_, GEE_TYPE_COLLECTION, GeeCollection));
	_g_object_unref0 (self->cursor);
	self->cursor = NULL;
	{
		GeeList* _item_list = NULL;
		GeeList* _tmp22_;
		gint _item_size = 0;
		GeeList* _tmp23_;
		gint _tmp24_;
		gint _tmp25_;
		gint _item_index = 0;
		_tmp22_ = intersection;
		_item_list = _tmp22_;
		_tmp23_ = _item_list;
		_tmp24_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp25_ = _tmp24_;
		_item_size = _tmp25_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp26_;
			gint _tmp27_;
			CheckerboardItem* item = NULL;
			GeeList* _tmp28_;
			gpointer _tmp29_;
			Marker* _tmp30_;
			CheckerboardItem* _tmp31_;
			CheckerboardItem* _tmp36_;
			_item_index = _item_index + 1;
			_tmp26_ = _item_index;
			_tmp27_ = _item_size;
			if (!(_tmp26_ < _tmp27_)) {
				break;
			}
			_tmp28_ = _item_list;
			_tmp29_ = gee_list_get (_tmp28_, _item_index);
			item = (CheckerboardItem*) _tmp29_;
			_tmp30_ = to_select;
			_tmp31_ = item;
			if (marker_toggle (_tmp30_, G_TYPE_CHECK_INSTANCE_CAST (_tmp31_, TYPE_DATA_OBJECT, DataObject))) {
				Marker* _tmp32_;
				CheckerboardItem* _tmp33_;
				_tmp32_ = to_unselect;
				_tmp33_ = item;
				marker_unmark (_tmp32_, G_TYPE_CHECK_INSTANCE_CAST (_tmp33_, TYPE_DATA_OBJECT, DataObject));
			} else {
				Marker* _tmp34_;
				CheckerboardItem* _tmp35_;
				_tmp34_ = to_unselect;
				_tmp35_ = item;
				marker_mark (_tmp34_, G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, TYPE_DATA_OBJECT, DataObject));
			}
			_tmp36_ = self->cursor;
			if (_tmp36_ == NULL) {
				CheckerboardItem* _tmp37_;
				CheckerboardItem* _tmp38_;
				_tmp37_ = item;
				_tmp38_ = _g_object_ref0 (_tmp37_);
				_g_object_unref0 (self->cursor);
				self->cursor = _tmp38_;
			}
			_g_object_unref0 (item);
		}
	}
	_tmp39_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp40_ = _tmp39_;
	_tmp41_ = to_select;
	view_collection_select_marked (_tmp40_, _tmp41_);
	_data_collection_unref0 (_tmp40_);
	_tmp42_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp43_ = _tmp42_;
	_tmp44_ = to_unselect;
	view_collection_unselect_marked (_tmp43_, _tmp44_);
	_data_collection_unref0 (_tmp43_);
	_g_object_unref0 (to_select);
	_g_object_unref0 (to_unselect);
	_g_object_unref0 (intersection);
}

static gboolean
checkerboard_page_selection_autoscroll (CheckerboardPage* self)
{
	CheckerboardLayout* _tmp0_;
	GtkAdjustment* vadj = NULL;
	GtkAdjustment* _tmp1_;
	GtkAdjustment* _tmp2_;
	gint x = 0;
	gint y = 0;
	GdkModifierType mask = 0U;
	gint _tmp3_ = 0;
	gint _tmp4_ = 0;
	GdkModifierType _tmp5_ = 0U;
	gint new_value = 0;
	GtkAdjustment* _tmp6_;
	GtkAdjustment* _tmp7_;
	GtkAdjustment* _tmp11_;
	GtkAdjustment* _tmp12_;
	GtkAdjustment* _tmp13_;
	GtkAdjustment* _tmp14_;
	gboolean result;
	g_return_val_if_fail (IS_CHECKERBOARD_PAGE (self), FALSE);
	_tmp0_ = self->priv->layout;
	if (!checkerboard_layout_is_drag_select_active (_tmp0_)) {
		self->priv->autoscroll_scheduled = FALSE;
		result = FALSE;
		return result;
	}
	_tmp1_ = gtk_scrolled_window_get_vadjustment (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_scrolled_window_get_type (), GtkScrolledWindow));
	_tmp2_ = _g_object_ref0 (_tmp1_);
	vadj = _tmp2_;
	page_get_event_source_pointer (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page), &_tmp3_, &_tmp4_, &_tmp5_);
	x = _tmp3_;
	y = _tmp4_;
	mask = _tmp5_;
	_tmp6_ = vadj;
	new_value = (gint) gtk_adjustment_get_value (_tmp6_);
	_tmp7_ = vadj;
	switch (get_adjustment_relation (_tmp7_, y)) {
		case ADJUSTMENT_RELATION_BELOW:
		{
			CheckerboardLayout* _tmp8_;
			new_value -= CHECKERBOARD_PAGE_AUTOSCROLL_PIXELS;
			_tmp8_ = self->priv->layout;
			checkerboard_layout_set_drag_select_endpoint (_tmp8_, x, new_value);
			break;
		}
		case ADJUSTMENT_RELATION_ABOVE:
		{
			CheckerboardLayout* _tmp9_;
			GtkAdjustment* _tmp10_;
			new_value += CHECKERBOARD_PAGE_AUTOSCROLL_PIXELS;
			_tmp9_ = self->priv->layout;
			_tmp10_ = vadj;
			checkerboard_layout_set_drag_select_endpoint (_tmp9_, x, new_value + ((gint) gtk_adjustment_get_page_size (_tmp10_)));
			break;
		}
		case ADJUSTMENT_RELATION_IN_RANGE:
		{
			self->priv->autoscroll_scheduled = FALSE;
			result = FALSE;
			_g_object_unref0 (vadj);
			return result;
		}
		default:
		{
			g_warn_if_reached ();
			break;
		}
	}
	_tmp11_ = vadj;
	_tmp12_ = vadj;
	_tmp13_ = vadj;
	_tmp14_ = vadj;
	gtk_adjustment_set_value (_tmp11_, (gdouble) CLAMP (new_value, (gint) gtk_adjustment_get_lower (_tmp12_), ((gint) gtk_adjustment_get_upper (_tmp13_)) - ((gint) gtk_adjustment_get_page_size (_tmp14_))));
	checkerboard_page_updated_selection_band (self);
	result = TRUE;
	_g_object_unref0 (vadj);
	return result;
}

void
checkerboard_page_cursor_to_item (CheckerboardPage* self,
                                  CheckerboardItem* item)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	CheckerboardItem* _tmp2_;
	CheckerboardLayout* _tmp12_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (IS_CHECKERBOARD_ITEM (item));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_vala_assert (data_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (item, TYPE_DATA_OBJECT, DataObject)), "get_view().contains(item)");
	_data_collection_unref0 (_tmp1_);
	_tmp2_ = _g_object_ref0 (item);
	_g_object_unref0 (self->cursor);
	self->cursor = _tmp2_;
	if (!page_get_ctrl_pressed (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page))) {
		ViewCollection* _tmp3_;
		ViewCollection* _tmp4_;
		Marker* marker = NULL;
		ViewCollection* _tmp5_;
		ViewCollection* _tmp6_;
		Marker* _tmp7_;
		Marker* _tmp8_;
		ViewCollection* _tmp9_;
		ViewCollection* _tmp10_;
		Marker* _tmp11_;
		_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp4_ = _tmp3_;
		view_collection_unselect_all (_tmp4_);
		_data_collection_unref0 (_tmp4_);
		_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp6_ = _tmp5_;
		_tmp7_ = data_collection_mark (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (item, TYPE_DATA_OBJECT, DataObject));
		_tmp8_ = _tmp7_;
		_data_collection_unref0 (_tmp6_);
		marker = _tmp8_;
		_tmp9_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp10_ = _tmp9_;
		_tmp11_ = marker;
		view_collection_select_marked (_tmp10_, _tmp11_);
		_data_collection_unref0 (_tmp10_);
		_g_object_unref0 (marker);
	}
	_tmp12_ = self->priv->layout;
	checkerboard_layout_set_cursor (_tmp12_, item);
	checkerboard_page_scroll_to_item (self, item);
}

void
checkerboard_page_move_cursor (CheckerboardPage* self,
                               CompassPoint point)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	CheckerboardItem* _tmp5_;
	CheckerboardItem* _tmp19_;
	CheckerboardItem* item = NULL;
	CheckerboardLayout* _tmp23_;
	CheckerboardItem* _tmp24_;
	CheckerboardItem* _tmp25_;
	CheckerboardItem* _tmp26_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection)) == 0;
	_data_collection_unref0 (_tmp1_);
	if (_tmp2_) {
		return;
	}
	_tmp5_ = self->cursor;
	if (_tmp5_ == NULL) {
		CheckerboardLayout* _tmp6_;
		CheckerboardItem* _tmp7_;
		CheckerboardItem* _tmp8_;
		_tmp6_ = self->priv->layout;
		_tmp7_ = checkerboard_layout_get_cursor (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp4_ = _tmp8_ == NULL;
		_g_object_unref0 (_tmp8_);
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		_tmp3_ = TRUE;
	} else {
		gboolean _tmp9_ = FALSE;
		CheckerboardItem* _tmp10_;
		_tmp10_ = self->cursor;
		if (_tmp10_ != NULL) {
			ViewCollection* _tmp11_;
			ViewCollection* _tmp12_;
			CheckerboardItem* _tmp13_;
			_tmp11_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
			_tmp12_ = _tmp11_;
			_tmp13_ = self->cursor;
			_tmp9_ = !data_collection_contains (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_OBJECT, DataObject));
			_data_collection_unref0 (_tmp12_);
		} else {
			_tmp9_ = FALSE;
		}
		_tmp3_ = _tmp9_;
	}
	if (_tmp3_) {
		CheckerboardItem* item = NULL;
		CheckerboardLayout* _tmp14_;
		CheckerboardItem* _tmp15_;
		CheckerboardItem* _tmp16_;
		CheckerboardItem* _tmp17_;
		CheckerboardItem* _tmp18_;
		_tmp14_ = self->priv->layout;
		_tmp15_ = checkerboard_layout_get_item_at_coordinate (_tmp14_, 0, 0);
		item = _tmp15_;
		_tmp16_ = item;
		checkerboard_page_cursor_to_item (self, _tmp16_);
		_tmp17_ = item;
		_tmp18_ = _g_object_ref0 (_tmp17_);
		_g_object_unref0 (self->anchor);
		self->anchor = _tmp18_;
		_g_object_unref0 (item);
		return;
	}
	_tmp19_ = self->cursor;
	if (_tmp19_ == NULL) {
		CheckerboardLayout* _tmp20_;
		CheckerboardItem* _tmp21_;
		CheckerboardItem* _tmp22_;
		_tmp20_ = self->priv->layout;
		_tmp21_ = checkerboard_layout_get_cursor (_tmp20_);
		_tmp22_ = IS_CHECKERBOARD_ITEM (_tmp21_) ? ((CheckerboardItem*) _tmp21_) : NULL;
		if (_tmp22_ == NULL) {
			_g_object_unref0 (_tmp21_);
		}
		_g_object_unref0 (self->cursor);
		self->cursor = _tmp22_;
	}
	_tmp23_ = self->priv->layout;
	_tmp24_ = self->cursor;
	_tmp25_ = checkerboard_layout_get_item_relative_to (_tmp23_, _tmp24_, point);
	item = _tmp25_;
	_tmp26_ = item;
	if (_tmp26_ != NULL) {
		CheckerboardItem* _tmp27_;
		_tmp27_ = item;
		checkerboard_page_cursor_to_item (self, _tmp27_);
	}
	_g_object_unref0 (item);
}

void
checkerboard_page_set_cursor (CheckerboardPage* self,
                              CheckerboardItem* item)
{
	Marker* marker = NULL;
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	Marker* _tmp2_;
	Marker* _tmp3_;
	ViewCollection* _tmp4_;
	ViewCollection* _tmp5_;
	CheckerboardItem* _tmp6_;
	CheckerboardItem* _tmp7_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (IS_CHECKERBOARD_ITEM (item));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = data_collection_mark (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection), G_TYPE_CHECK_INSTANCE_CAST (item, TYPE_DATA_OBJECT, DataObject));
	_tmp3_ = _tmp2_;
	_data_collection_unref0 (_tmp1_);
	marker = _tmp3_;
	_tmp4_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp5_ = _tmp4_;
	view_collection_select_marked (_tmp5_, marker);
	_data_collection_unref0 (_tmp5_);
	_tmp6_ = _g_object_ref0 (item);
	_g_object_unref0 (self->cursor);
	self->cursor = _tmp6_;
	_tmp7_ = _g_object_ref0 (item);
	_g_object_unref0 (self->anchor);
	self->anchor = _tmp7_;
	_g_object_unref0 (marker);
}

void
checkerboard_page_select_between_items (CheckerboardPage* self,
                                        CheckerboardItem* item_start,
                                        CheckerboardItem* item_end)
{
	Marker* marker = NULL;
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	Marker* _tmp2_;
	Marker* _tmp3_;
	gboolean passed_start = FALSE;
	gboolean passed_end = FALSE;
	ViewCollection* _tmp21_;
	ViewCollection* _tmp22_;
	Marker* _tmp23_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	g_return_if_fail (IS_CHECKERBOARD_ITEM (item_start));
	g_return_if_fail (IS_CHECKERBOARD_ITEM (item_end));
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	_tmp2_ = data_collection_start_marking (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection));
	_tmp3_ = _tmp2_;
	_data_collection_unref0 (_tmp1_);
	marker = _tmp3_;
	passed_start = FALSE;
	passed_end = FALSE;
	{
		GeeIterator* _object_it = NULL;
		ViewCollection* _tmp4_;
		ViewCollection* _tmp5_;
		GeeCollection* _tmp6_;
		GeeCollection* _tmp7_;
		GeeIterator* _tmp8_;
		GeeIterator* _tmp9_;
		_tmp4_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp5_ = _tmp4_;
		_tmp6_ = data_collection_get_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_DATA_COLLECTION, DataCollection));
		_tmp7_ = _tmp6_;
		_tmp8_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, GEE_TYPE_ITERABLE, GeeIterable));
		_tmp9_ = _tmp8_;
		_g_object_unref0 (_tmp7_);
		_data_collection_unref0 (_tmp5_);
		_object_it = _tmp9_;
		while (TRUE) {
			GeeIterator* _tmp10_;
			DataObject* object = NULL;
			GeeIterator* _tmp11_;
			gpointer _tmp12_;
			CheckerboardItem* item = NULL;
			DataObject* _tmp13_;
			CheckerboardItem* _tmp14_;
			CheckerboardItem* _tmp15_;
			CheckerboardItem* _tmp16_;
			gboolean _tmp17_ = FALSE;
			gboolean _tmp20_ = FALSE;
			_tmp10_ = _object_it;
			if (!gee_iterator_next (_tmp10_)) {
				break;
			}
			_tmp11_ = _object_it;
			_tmp12_ = gee_iterator_get (_tmp11_);
			object = (DataObject*) _tmp12_;
			_tmp13_ = object;
			_tmp14_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_CHECKERBOARD_ITEM, CheckerboardItem));
			item = _tmp14_;
			_tmp15_ = item;
			if (item_start == _tmp15_) {
				passed_start = TRUE;
			}
			_tmp16_ = item;
			if (item_end == _tmp16_) {
				passed_end = TRUE;
			}
			if (passed_start) {
				_tmp17_ = TRUE;
			} else {
				_tmp17_ = passed_end;
			}
			if (_tmp17_) {
				Marker* _tmp18_;
				DataObject* _tmp19_;
				_tmp18_ = marker;
				_tmp19_ = object;
				marker_mark (_tmp18_, G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, TYPE_DATA_VIEW, DataView), TYPE_DATA_OBJECT, DataObject));
			}
			if (passed_start) {
				_tmp20_ = passed_end;
			} else {
				_tmp20_ = FALSE;
			}
			if (_tmp20_) {
				_g_object_unref0 (item);
				_g_object_unref0 (object);
				break;
			}
			_g_object_unref0 (item);
			_g_object_unref0 (object);
		}
		_g_object_unref0 (_object_it);
	}
	_tmp21_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp22_ = _tmp21_;
	_tmp23_ = marker;
	view_collection_select_marked (_tmp22_, _tmp23_);
	_data_collection_unref0 (_tmp22_);
	_g_object_unref0 (marker);
}

void
checkerboard_page_select_anchor_to_cursor (CheckerboardPage* self,
                                           guint state)
{
	gboolean _tmp0_ = FALSE;
	CheckerboardItem* _tmp1_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	_tmp1_ = self->cursor;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		CheckerboardItem* _tmp2_;
		_tmp2_ = self->anchor;
		_tmp0_ = _tmp2_ == NULL;
	}
	if (_tmp0_) {
		return;
	}
	if (state == ((guint) GDK_SHIFT_MASK)) {
		ViewCollection* _tmp3_;
		ViewCollection* _tmp4_;
		CheckerboardItem* _tmp5_;
		CheckerboardItem* _tmp6_;
		_tmp3_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
		_tmp4_ = _tmp3_;
		view_collection_unselect_all (_tmp4_);
		_data_collection_unref0 (_tmp4_);
		_tmp5_ = self->anchor;
		_tmp6_ = self->cursor;
		checkerboard_page_select_between_items (self, _tmp5_, _tmp6_);
	} else {
		CheckerboardItem* _tmp7_;
		CheckerboardItem* _tmp8_;
		_tmp7_ = self->cursor;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_g_object_unref0 (self->anchor);
		self->anchor = _tmp8_;
	}
}

static void
checkerboard_page_real_set_display_titles (CheckerboardPage* self,
                                           gboolean display)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	GValue _tmp4_ = {0};
	ViewCollection* _tmp5_;
	ViewCollection* _tmp6_;
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	data_collection_freeze_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp1_);
	_tmp2_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp3_ = _tmp2_;
	g_value_init (&_tmp4_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp4_, display);
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_COLLECTION, DataCollection), CHECKERBOARD_ITEM_PROP_SHOW_TITLES, &_tmp4_, NULL, NULL);
	G_IS_VALUE (&_tmp4_) ? (g_value_unset (&_tmp4_), NULL) : NULL;
	_data_collection_unref0 (_tmp3_);
	_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp6_ = _tmp5_;
	data_collection_thaw_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp6_);
}

void
checkerboard_page_set_display_titles (CheckerboardPage* self,
                                      gboolean display)
{
	CheckerboardPageClass* _klass_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->set_display_titles) {
		_klass_->set_display_titles (self, display);
	}
}

static void
checkerboard_page_real_set_display_comments (CheckerboardPage* self,
                                             gboolean display)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	GValue _tmp4_ = {0};
	ViewCollection* _tmp5_;
	ViewCollection* _tmp6_;
	_tmp0_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp1_ = _tmp0_;
	data_collection_freeze_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp1_);
	_tmp2_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp3_ = _tmp2_;
	g_value_init (&_tmp4_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp4_, display);
	data_collection_set_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_COLLECTION, DataCollection), CHECKERBOARD_ITEM_PROP_SHOW_COMMENTS, &_tmp4_, NULL, NULL);
	G_IS_VALUE (&_tmp4_) ? (g_value_unset (&_tmp4_), NULL) : NULL;
	_data_collection_unref0 (_tmp3_);
	_tmp5_ = page_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, TYPE_PAGE, Page));
	_tmp6_ = _tmp5_;
	data_collection_thaw_notifications (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp6_);
}

void
checkerboard_page_set_display_comments (CheckerboardPage* self,
                                        gboolean display)
{
	CheckerboardPageClass* _klass_;
	g_return_if_fail (IS_CHECKERBOARD_PAGE (self));
	_klass_ = CHECKERBOARD_PAGE_GET_CLASS (self);
	if (_klass_->set_display_comments) {
		_klass_->set_display_comments (self, display);
	}
}

void
checkerboard_page_keyboard_modifiers_init (CheckerboardPageKeyboardModifiers *self,
                                           Page* page)
{
	g_return_if_fail (IS_PAGE (page));
	memset (self, 0, sizeof (CheckerboardPageKeyboardModifiers));
	(*self).ctrl_pressed = page_get_ctrl_pressed (page);
	(*self).alt_pressed = page_get_alt_pressed (page);
	(*self).shift_pressed = page_get_shift_pressed (page);
	(*self).super_pressed = page_get_super_pressed (page);
}

CheckerboardPageKeyboardModifiers*
checkerboard_page_keyboard_modifiers_dup (const CheckerboardPageKeyboardModifiers* self)
{
	CheckerboardPageKeyboardModifiers* dup;
	dup = g_new0 (CheckerboardPageKeyboardModifiers, 1);
	memcpy (dup, self, sizeof (CheckerboardPageKeyboardModifiers));
	return dup;
}

void
checkerboard_page_keyboard_modifiers_free (CheckerboardPageKeyboardModifiers* self)
{
	g_free (self);
}

static GType
checkerboard_page_keyboard_modifiers_get_type_once (void)
{
	GType checkerboard_page_keyboard_modifiers_type_id;
	checkerboard_page_keyboard_modifiers_type_id = g_boxed_type_register_static ("CheckerboardPageKeyboardModifiers", (GBoxedCopyFunc) checkerboard_page_keyboard_modifiers_dup, (GBoxedFreeFunc) checkerboard_page_keyboard_modifiers_free);
	return checkerboard_page_keyboard_modifiers_type_id;
}

GType
checkerboard_page_keyboard_modifiers_get_type (void)
{
	static volatile gsize checkerboard_page_keyboard_modifiers_type_id__once = 0;
	if (g_once_init_enter (&checkerboard_page_keyboard_modifiers_type_id__once)) {
		GType checkerboard_page_keyboard_modifiers_type_id;
		checkerboard_page_keyboard_modifiers_type_id = checkerboard_page_keyboard_modifiers_get_type_once ();
		g_once_init_leave (&checkerboard_page_keyboard_modifiers_type_id__once, checkerboard_page_keyboard_modifiers_type_id);
	}
	return checkerboard_page_keyboard_modifiers_type_id__once;
}

static void
checkerboard_page_class_init (CheckerboardPageClass * klass,
                              gpointer klass_data)
{
	checkerboard_page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &CheckerboardPage_private_offset);
	((CheckerboardPageClass *) klass)->get_item_context_menu = (GtkMenu* (*) (CheckerboardPage*)) checkerboard_page_real_get_item_context_menu;
	((PageClass *) klass)->get_page_context_menu = (GtkMenu* (*) (Page*)) checkerboard_page_real_get_page_context_menu;
	((PageClass *) klass)->on_context_keypress = (gboolean (*) (Page*)) checkerboard_page_real_on_context_keypress;
	((CheckerboardPageClass *) klass)->get_view_empty_icon = (gchar* (*) (CheckerboardPage*)) checkerboard_page_real_get_view_empty_icon;
	((CheckerboardPageClass *) klass)->get_view_empty_message = (gchar* (*) (CheckerboardPage*)) checkerboard_page_real_get_view_empty_message;
	((CheckerboardPageClass *) klass)->get_filter_no_match_message = (gchar* (*) (CheckerboardPage*)) checkerboard_page_real_get_filter_no_match_message;
	((CheckerboardPageClass *) klass)->on_item_activated = (void (*) (CheckerboardPage*, CheckerboardItem*, CheckerboardPageActivator, CheckerboardPageKeyboardModifiers*)) checkerboard_page_real_on_item_activated;
	((CheckerboardPageClass *) klass)->get_search_view_filter = (SearchViewFilter* (*) (CheckerboardPage*)) checkerboard_page_real_get_search_view_filter;
	((CheckerboardPageClass *) klass)->get_view_tracker = (CoreViewTracker* (*) (CheckerboardPage*)) checkerboard_page_real_get_view_tracker;
	((PageClass *) klass)->switching_from = (void (*) (Page*)) checkerboard_page_real_switching_from;
	((PageClass *) klass)->switched_to = (void (*) (Page*)) checkerboard_page_real_switched_to;
	((PageClass *) klass)->set_page_name = (void (*) (Page*, const gchar*)) checkerboard_page_real_set_page_name;
	((GtkWidgetClass *) klass)->key_press_event = (gboolean (*) (GtkWidget*, GdkEventKey*)) checkerboard_page_real_key_press_event;
	((PageClass *) klass)->on_left_click = (gboolean (*) (Page*, GdkEventButton*)) checkerboard_page_real_on_left_click;
	((PageClass *) klass)->on_left_released = (gboolean (*) (Page*, GdkEventButton*)) checkerboard_page_real_on_left_released;
	((PageClass *) klass)->on_right_click = (gboolean (*) (Page*, GdkEventButton*)) checkerboard_page_real_on_right_click;
	((CheckerboardPageClass *) klass)->on_mouse_over = (gboolean (*) (CheckerboardPage*, CheckerboardItem*, gint, gint, GdkModifierType)) checkerboard_page_real_on_mouse_over;
	((PageClass *) klass)->on_motion = (gboolean (*) (Page*, GdkEventMotion*, gint, gint, GdkModifierType)) checkerboard_page_real_on_motion;
	((CheckerboardPageClass *) klass)->set_display_titles = (void (*) (CheckerboardPage*, gboolean)) checkerboard_page_real_set_display_titles;
	((CheckerboardPageClass *) klass)->set_display_comments = (void (*) (CheckerboardPage*, gboolean)) checkerboard_page_real_set_display_comments;
	G_OBJECT_CLASS (klass)->finalize = checkerboard_page_finalize;
}

static void
checkerboard_page_instance_init (CheckerboardPage * self,
                                 gpointer klass)
{
	GtkViewport* _tmp0_;
	self->priv = checkerboard_page_get_instance_private (self);
	self->priv->item_context_menu_path = NULL;
	self->priv->page_context_menu_path = NULL;
	_tmp0_ = (GtkViewport*) gtk_viewport_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	self->priv->viewport = _tmp0_;
	self->anchor = NULL;
	self->cursor = NULL;
	self->priv->current_hovered_item = NULL;
	self->priv->autoscroll_scheduled = FALSE;
	self->priv->activated_item = NULL;
	self->priv->previously_selected = NULL;
}

static void
checkerboard_page_finalize (GObject * obj)
{
	CheckerboardPage * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CHECKERBOARD_PAGE, CheckerboardPage);
	_g_object_unref0 (self->priv->layout);
	_g_object_unref0 (self->priv->stack);
	_g_object_unref0 (self->priv->message_pane);
	_g_free0 (self->priv->item_context_menu_path);
	_g_free0 (self->priv->page_context_menu_path);
	_g_object_unref0 (self->priv->viewport);
	_g_object_unref0 (self->anchor);
	_g_object_unref0 (self->cursor);
	_g_object_unref0 (self->priv->current_hovered_item);
	_g_object_unref0 (self->priv->activated_item);
	_g_object_unref0 (self->priv->previously_selected);
	_g_object_unref0 (self->priv->item_context_menu);
	_g_object_unref0 (self->priv->page_context_menu);
	G_OBJECT_CLASS (checkerboard_page_parent_class)->finalize (obj);
}

static GType
checkerboard_page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (CheckerboardPageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) checkerboard_page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (CheckerboardPage), 0, (GInstanceInitFunc) checkerboard_page_instance_init, NULL };
	GType checkerboard_page_type_id;
	checkerboard_page_type_id = g_type_register_static (TYPE_PAGE, "CheckerboardPage", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	CheckerboardPage_private_offset = g_type_add_instance_private (checkerboard_page_type_id, sizeof (CheckerboardPagePrivate));
	return checkerboard_page_type_id;
}

GType
checkerboard_page_get_type (void)
{
	static volatile gsize checkerboard_page_type_id__once = 0;
	if (g_once_init_enter (&checkerboard_page_type_id__once)) {
		GType checkerboard_page_type_id;
		checkerboard_page_type_id = checkerboard_page_get_type_once ();
		g_once_init_leave (&checkerboard_page_type_id__once, checkerboard_page_type_id);
	}
	return checkerboard_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;
}

