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

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

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

#define PAGE_CONSIDER_CONFIGURE_HALTED_MSEC 400
#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_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;
typedef struct _InjectionGroupPrivate InjectionGroupPrivate;

#define INJECTION_GROUP_TYPE_ELEMENT (injection_group_element_get_type ())
#define INJECTION_GROUP_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INJECTION_GROUP_TYPE_ELEMENT, InjectionGroupElement))
#define INJECTION_GROUP_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INJECTION_GROUP_TYPE_ELEMENT, InjectionGroupElementClass))
#define INJECTION_GROUP_IS_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INJECTION_GROUP_TYPE_ELEMENT))
#define INJECTION_GROUP_IS_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INJECTION_GROUP_TYPE_ELEMENT))
#define INJECTION_GROUP_ELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INJECTION_GROUP_TYPE_ELEMENT, InjectionGroupElementClass))

typedef struct _InjectionGroupElement InjectionGroupElement;
typedef struct _InjectionGroupElementClass InjectionGroupElementClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef enum  {
	INJECTION_GROUP_ELEMENT_ITEM_TYPE_MENUITEM,
	INJECTION_GROUP_ELEMENT_ITEM_TYPE_MENU,
	INJECTION_GROUP_ELEMENT_ITEM_TYPE_SEPARATOR
} InjectionGroupElementItemType;

#define INJECTION_GROUP_ELEMENT_TYPE_ITEM_TYPE (injection_group_element_item_type_get_type ())
#define _injection_group_element_unref0(var) ((var == NULL) ? NULL : (var = (injection_group_element_unref (var), NULL)))
typedef struct _InjectionGroupElementPrivate InjectionGroupElementPrivate;
typedef struct _InjectionGroupParamSpecElement InjectionGroupParamSpecElement;
typedef struct _ParamSpecInjectionGroup ParamSpecInjectionGroup;

#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_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 TYPE_ONE_SHOT_SCHEDULER (one_shot_scheduler_get_type ())
#define ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotScheduler))
#define ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass))
#define IS_ONE_SHOT_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ONE_SHOT_SCHEDULER))
#define IS_ONE_SHOT_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ONE_SHOT_SCHEDULER))
#define ONE_SHOT_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ONE_SHOT_SCHEDULER, OneShotSchedulerClass))

typedef struct _OneShotScheduler OneShotScheduler;
typedef struct _OneShotSchedulerClass OneShotSchedulerClass;
enum  {
	PAGE_0_PROPERTY,
	PAGE_NUM_PROPERTIES
};
static GParamSpec* page_properties[PAGE_NUM_PROPERTIES];
#define _data_collection_unref0(var) ((var == NULL) ? NULL : (var = (data_collection_unref (var), NULL)))
#define _one_shot_scheduler_unref0(var) ((var == NULL) ? NULL : (var = (one_shot_scheduler_unref (var), NULL)))
#define _injection_group_unref0(var) ((var == NULL) ? NULL : (var = (injection_group_unref (var), NULL)))

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

typedef struct _AppWindow AppWindow;
typedef struct _AppWindowClass AppWindowClass;
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

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

typedef struct _CommandManager CommandManager;
typedef struct _CommandManagerClass CommandManagerClass;

#define TYPE_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;
typedef void (*OneShotCallback) (gpointer user_data);

#define TYPE_APPLICATION (application_get_type ())
#define APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APPLICATION, Application))
#define APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APPLICATION, ApplicationClass))
#define IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APPLICATION))
#define IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APPLICATION))
#define APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APPLICATION, ApplicationClass))

typedef struct _Application Application;
typedef struct _ApplicationClass ApplicationClass;
#define _application_unref0(var) ((var == NULL) ? NULL : (var = (application_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#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 _InjectionGroup {
	GTypeInstance parent_instance;
	volatile int ref_count;
	InjectionGroupPrivate * priv;
};

struct _InjectionGroupClass {
	GTypeClass parent_class;
	void (*finalize) (InjectionGroup *self);
};

struct _InjectionGroupPrivate {
	gchar* path;
	GeeArrayList* elements;
	gint separator_id;
};

struct _InjectionGroupElement {
	GTypeInstance parent_instance;
	volatile int ref_count;
	InjectionGroupElementPrivate * priv;
	gchar* name;
	gchar* action;
	gchar* accelerator;
	InjectionGroupElementItemType kind;
};

struct _InjectionGroupElementClass {
	GTypeClass parent_class;
	void (*finalize) (InjectionGroupElement *self);
};

struct _InjectionGroupParamSpecElement {
	GParamSpec parent_instance;
};

struct _ParamSpecInjectionGroup {
	GParamSpec parent_instance;
};

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 _PagePrivate {
	gchar* page_name;
	ViewCollection* view;
	GtkWindow* container;
	gchar* toolbar_path;
	GdkRectangle last_position;
	GtkWidget* event_source;
	gulong last_configure_ms;
	gboolean report_move_finished;
	gboolean report_resize_finished;
	GdkPoint last_down;
	gboolean is_destroyed;
	gboolean ctrl_pressed;
	gboolean alt_pressed;
	gboolean shift_pressed;
	gboolean super_pressed;
	GdkCursorType last_cursor;
	gboolean cursor_hidden;
	gint cursor_hide_msec;
	guint last_timeout_id;
	gint cursor_hide_time_cached;
	gboolean are_actions_attached;
	OneShotScheduler* update_actions_scheduler;
	gboolean menubar_injected;
};

static gint InjectionGroup_private_offset;
static gpointer injection_group_parent_class = NULL;
static gpointer injection_group_element_parent_class = NULL;
static gint Page_private_offset;
static gpointer page_parent_class = NULL;

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 gpointer injection_group_element_ref (gpointer instance);
VALA_EXTERN void injection_group_element_unref (gpointer instance);
VALA_EXTERN GParamSpec* injection_group_param_spec_element (const gchar* name,
                                                const gchar* nick,
                                                const gchar* blurb,
                                                GType object_type,
                                                GParamFlags flags);
VALA_EXTERN void injection_group_value_set_element (GValue* value,
                                        gpointer v_object);
VALA_EXTERN void injection_group_value_take_element (GValue* value,
                                         gpointer v_object);
VALA_EXTERN gpointer injection_group_value_get_element (const GValue* value);
VALA_EXTERN GType injection_group_element_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (InjectionGroupElement, injection_group_element_unref)
VALA_EXTERN InjectionGroup* injection_group_new (const gchar* path);
VALA_EXTERN InjectionGroup* injection_group_construct (GType object_type,
                                           const gchar* path);
VALA_EXTERN gchar* injection_group_get_path (InjectionGroup* self);
VALA_EXTERN GeeList* injection_group_get_elements (InjectionGroup* self);
VALA_EXTERN void injection_group_add_menu_item (InjectionGroup* self,
                                    const gchar* name,
                                    const gchar* action,
                                    const gchar* accelerator);
VALA_EXTERN GType injection_group_element_item_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN InjectionGroupElement* injection_group_element_new (const gchar* name,
                                                    const gchar* action,
                                                    const gchar* accelerator,
                                                    InjectionGroupElementItemType kind);
VALA_EXTERN InjectionGroupElement* injection_group_element_construct (GType object_type,
                                                          const gchar* name,
                                                          const gchar* action,
                                                          const gchar* accelerator,
                                                          InjectionGroupElementItemType kind);
VALA_EXTERN void injection_group_add_menu (InjectionGroup* self,
                               const gchar* name,
                               const gchar* action);
VALA_EXTERN void injection_group_add_separator (InjectionGroup* self);
static void injection_group_element_finalize (InjectionGroupElement * obj);
static GType injection_group_element_get_type_once (void);
static void injection_group_finalize (InjectionGroup * obj);
static GType injection_group_get_type_once (void);
VALA_EXTERN GType page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Page, g_object_unref)
VALA_EXTERN GType page_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PageWindow, g_object_unref)
VALA_EXTERN GType fullscreen_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FullscreenWindow, g_object_unref)
VALA_EXTERN gpointer 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 gpointer one_shot_scheduler_ref (gpointer instance);
VALA_EXTERN void one_shot_scheduler_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_one_shot_scheduler (const gchar* name,
                                           const gchar* nick,
                                           const gchar* blurb,
                                           GType object_type,
                                           GParamFlags flags);
VALA_EXTERN void value_set_one_shot_scheduler (GValue* value,
                                   gpointer v_object);
VALA_EXTERN void value_take_one_shot_scheduler (GValue* value,
                                    gpointer v_object);
VALA_EXTERN gpointer value_get_one_shot_scheduler (const GValue* value);
VALA_EXTERN GType one_shot_scheduler_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (OneShotScheduler, one_shot_scheduler_unref)
VALA_EXTERN void page_set_page_name (Page* self,
                         const gchar* page_name);
VALA_EXTERN void page_set_container (Page* self,
                         GtkWindow* container);
VALA_EXTERN void page_clear_container (Page* self);
VALA_EXTERN GtkToolbar* page_get_toolbar (Page* self);
VALA_EXTERN GtkMenu* page_get_page_context_menu (Page* self);
VALA_EXTERN void page_switching_from (Page* self);
VALA_EXTERN void page_switched_to (Page* self);
VALA_EXTERN void page_ready (Page* self);
VALA_EXTERN void page_switching_to_fullscreen (Page* self,
                                   FullscreenWindow* fsw);
VALA_EXTERN void page_returning_from_fullscreen (Page* self,
                                     FullscreenWindow* fsw);
VALA_EXTERN void page_add_actions (Page* self,
                       GActionMap* map);
VALA_EXTERN void page_remove_actions (Page* self,
                          GActionMap* map);
VALA_EXTERN void page_init_collect_ui_filenames (Page* self,
                                     GeeList* ui_filenames);
VALA_EXTERN InjectionGroup** page_init_collect_injection_groups (Page* self,
                                                     gint* result_length1);
VALA_EXTERN void page_init_actions (Page* self,
                        gint selected_count,
                        gint count);
VALA_EXTERN void page_update_actions (Page* self,
                          gint selected_count,
                          gint count);
VALA_EXTERN gboolean page_on_left_click (Page* self,
                             GdkEventButton* event);
VALA_EXTERN gboolean page_on_middle_click (Page* self,
                               GdkEventButton* event);
VALA_EXTERN gboolean page_on_right_click (Page* self,
                              GdkEventButton* event);
VALA_EXTERN gboolean page_on_left_released (Page* self,
                                GdkEventButton* event);
VALA_EXTERN gboolean page_on_middle_released (Page* self,
                                  GdkEventButton* event);
VALA_EXTERN gboolean page_on_right_released (Page* self,
                                 GdkEventButton* event);
VALA_EXTERN gboolean page_on_ctrl_pressed (Page* self,
                               GdkEventKey* event);
VALA_EXTERN gboolean page_on_ctrl_released (Page* self,
                                GdkEventKey* event);
VALA_EXTERN gboolean page_on_alt_pressed (Page* self,
                              GdkEventKey* event);
VALA_EXTERN gboolean page_on_alt_released (Page* self,
                               GdkEventKey* event);
VALA_EXTERN gboolean page_on_shift_pressed (Page* self,
                                GdkEventKey* event);
VALA_EXTERN gboolean page_on_shift_released (Page* self,
                                 GdkEventKey* event);
VALA_EXTERN gboolean page_on_super_pressed (Page* self,
                                GdkEventKey* event);
VALA_EXTERN gboolean page_on_super_released (Page* self,
                                 GdkEventKey* event);
VALA_EXTERN gboolean page_on_app_key_pressed (Page* self,
                                  GdkEventKey* event);
VALA_EXTERN gboolean page_on_app_key_released (Page* self,
                                   GdkEventKey* event);
VALA_EXTERN void page_on_move (Page* self,
                   GdkRectangle* rect);
VALA_EXTERN void page_on_move_start (Page* self,
                         GdkRectangle* rect);
VALA_EXTERN void page_on_move_finished (Page* self,
                            GdkRectangle* rect);
VALA_EXTERN void page_on_resize (Page* self,
                     GdkRectangle* rect);
VALA_EXTERN void page_on_resize_start (Page* self,
                           GdkRectangle* rect);
VALA_EXTERN void page_on_resize_finished (Page* self,
                              GdkRectangle* rect);
VALA_EXTERN gboolean page_on_configure (Page* self,
                            GdkEventConfigure* event,
                            GdkRectangle* rect);
VALA_EXTERN gboolean page_on_motion (Page* self,
                         GdkEventMotion* event,
                         gint x,
                         gint y,
                         GdkModifierType mask);
VALA_EXTERN gboolean page_on_leave_notify_event (Page* self);
VALA_EXTERN gboolean page_on_mousewheel_up (Page* self,
                                GdkEventScroll* event);
VALA_EXTERN gboolean page_on_mousewheel_down (Page* self,
                                  GdkEventScroll* event);
VALA_EXTERN gboolean page_on_mousewheel_left (Page* self,
                                  GdkEventScroll* event);
VALA_EXTERN gboolean page_on_mousewheel_right (Page* self,
                                   GdkEventScroll* event);
VALA_EXTERN gboolean page_on_context_keypress (Page* self);
VALA_EXTERN gboolean page_on_context_buttonpress (Page* self,
                                      GdkEventButton* event);
VALA_EXTERN gboolean page_on_context_invoked (Page* self);
VALA_EXTERN void page_set_page_cursor (Page* self,
                           GdkCursorType cursor_type);
VALA_EXTERN Page* page_construct (GType object_type,
                      const gchar* page_name);
VALA_EXTERN ViewCollection* view_collection_new (const gchar* name);
VALA_EXTERN ViewCollection* view_collection_construct (GType object_type,
                                           const gchar* name);
static gboolean _page_on_context_keypress_gtk_widget_popup_menu (GtkWidget* _sender,
                                                          gpointer self);
static void page_attach_view_signals (Page* self);
static void _page_attach_view_signals_gtk_widget_realize (GtkWidget* _sender,
                                                   gpointer self);
static void page_real_destroy (GtkWidget* base);
static void page_detach_event_source (Page* self);
static void page_detach_view_signals (Page* self);
VALA_EXTERN void data_collection_close (DataCollection* self);
VALA_EXTERN void one_shot_scheduler_cancel (OneShotScheduler* self);
VALA_EXTERN gchar* page_get_page_name (Page* self);
static void page_real_set_page_name (Page* self,
                              const gchar* page_name);
VALA_EXTERN gchar* page_to_string (Page* self);
VALA_EXTERN ViewCollection* page_get_view (Page* self);
VALA_EXTERN GtkWindow* page_get_container (Page* self);
static void page_real_set_container (Page* self,
                              GtkWindow* container);
static void page_real_clear_container (Page* self);
VALA_EXTERN void page_set_event_source (Page* self,
                            GtkWidget* event_source);
static gboolean page_on_button_pressed_internal (Page* self,
                                          GdkEventButton* event);
static gboolean _page_on_button_pressed_internal_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                         GdkEventButton* event,
                                                                         gpointer self);
static gboolean page_on_button_released_internal (Page* self,
                                           GdkEventButton* event);
static gboolean _page_on_button_released_internal_gtk_widget_button_release_event (GtkWidget* _sender,
                                                                            GdkEventButton* event,
                                                                            gpointer self);
static gboolean page_on_motion_internal (Page* self,
                                  GdkEventMotion* event);
static gboolean _page_on_motion_internal_gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                                  GdkEventMotion* event,
                                                                  gpointer self);
static gboolean _page_on_leave_notify_event_gtk_widget_leave_notify_event (GtkWidget* _sender,
                                                                    GdkEventCrossing* event,
                                                                    gpointer self);
static gboolean page_on_mousewheel_internal (Page* self,
                                      GdkEventScroll* event);
static gboolean _page_on_mousewheel_internal_gtk_widget_scroll_event (GtkWidget* _sender,
                                                               GdkEventScroll* event,
                                                               gpointer self);
VALA_EXTERN void page_on_event_source_realize (Page* self);
static void _page_on_event_source_realize_gtk_widget_realize (GtkWidget* _sender,
                                                       gpointer self);
VALA_EXTERN GtkWidget* page_get_event_source (Page* self);
VALA_EXTERN GMenuModel* page_get_menubar (Page* self);
VALA_EXTERN GMenuModel* page_find_extension_point (Page* self,
                                       GMenuModel* model,
                                       const gchar* extension_point);
static GtkToolbar* page_real_get_toolbar (Page* self);
static GtkMenu* page_real_get_page_context_menu (Page* self);
static void page_real_switching_from (Page* self);
static void page_real_switched_to (Page* self);
static void page_add_ui (Page* self);
VALA_EXTERN gint view_collection_get_selected_count (ViewCollection* self);
VALA_EXTERN gint data_collection_get_count (DataCollection* self);
static void page_update_modifiers (Page* self);
static void page_real_ready (Page* self);
VALA_EXTERN gboolean page_is_in_view (Page* self);
static void page_real_switching_to_fullscreen (Page* self,
                                        FullscreenWindow* fsw);
static void page_real_returning_from_fullscreen (Page* self,
                                          FullscreenWindow* fsw);
VALA_EXTERN GAction* page_get_action (Page* self,
                          const gchar* name);
VALA_EXTERN GType app_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (AppWindow, g_object_unref)
VALA_EXTERN AppWindow* app_window_get_instance (void);
VALA_EXTERN void page_set_action_sensitive (Page* self,
                                const gchar* name,
                                gboolean sensitive);
VALA_EXTERN void page_set_action_details (Page* self,
                              const gchar* name,
                              const gchar* label,
                              const gchar* tooltip,
                              gboolean sensitive);
VALA_EXTERN void page_update_menu_item_label (Page* self,
                                  const gchar* id,
                                  const gchar* new_label);
VALA_EXTERN void page_activate_action (Page* self,
                           const gchar* name);
VALA_EXTERN GAction* page_get_common_action (Page* self,
                                 const gchar* name,
                                 gboolean log_warning);
VALA_EXTERN void page_set_common_action_sensitive (Page* self,
                                       const gchar* name,
                                       gboolean sensitive);
VALA_EXTERN void page_set_common_action_label (Page* self,
                                   const gchar* name,
                                   const gchar* label);
VALA_EXTERN void page_set_common_action_important (Page* self,
                                       const gchar* name,
                                       gboolean important);
VALA_EXTERN void page_activate_common_action (Page* self,
                                  const gchar* name);
VALA_EXTERN gboolean page_get_ctrl_pressed (Page* self);
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);
VALA_EXTERN void page_set_action_active (Page* self,
                             const gchar* name,
                             gboolean active);
static GVariant* _variant_new18 (gboolean value);
static gboolean page_get_modifiers (Page* self,
                             gboolean* ctrl,
                             gboolean* alt,
                             gboolean* shift,
                             gboolean* super);
VALA_EXTERN PageWindow* page_get_page_window (Page* self);
VALA_EXTERN gpointer command_manager_ref (gpointer instance);
VALA_EXTERN void command_manager_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_command_manager (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void value_set_command_manager (GValue* value,
                                gpointer v_object);
VALA_EXTERN void value_take_command_manager (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer value_get_command_manager (const GValue* value);
VALA_EXTERN GType command_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (CommandManager, command_manager_unref)
VALA_EXTERN CommandManager* page_get_command_manager (Page* self);
VALA_EXTERN CommandManager* app_window_get_command_manager (void);
static void page_real_add_actions (Page* self,
                            GActionMap* map);
static void page_real_remove_actions (Page* self,
                               GActionMap* map);
VALA_EXTERN void page_on_action_toggle (Page* self,
                            GAction* action,
                            GVariant* value);
static gboolean _variant_get2 (GVariant* value);
static GVariant* _variant_new19 (gboolean value);
VALA_EXTERN void page_on_action_radio (Page* self,
                           GAction* action,
                           GVariant* value);
static void page_init_load_ui (Page* self,
                        const gchar* ui_filename);
VALA_EXTERN void page_init_toolbar (Page* self,
                        const gchar* path);
static void page_on_update_actions (Page* self);
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)
static void _page_on_update_actions_view_collection_items_state_changed (ViewCollection* _sender,
                                                                  GeeIterable* changed,
                                                                  gpointer self);
static void _page_on_update_actions_view_collection_selection_group_altered (ViewCollection* _sender,
                                                                      gpointer self);
static void _page_on_update_actions_view_collection_items_visibility_changed (ViewCollection* _sender,
                                                                       GeeCollection* changed,
                                                                       gpointer self);
static void _page_on_update_actions_data_collection_contents_altered (DataCollection* _sender,
                                                               GeeIterable* added,
                                                               GeeIterable* removed,
                                                               gpointer self);
static void page_on_update_actions_on_idle (Page* self);
static void _page_on_update_actions_on_idle_one_shot_callback (gpointer self);
VALA_EXTERN OneShotScheduler* one_shot_scheduler_new (const gchar* name,
                                          OneShotCallback callback,
                                          gpointer callback_target);
VALA_EXTERN OneShotScheduler* one_shot_scheduler_construct (GType object_type,
                                                const gchar* name,
                                                OneShotCallback callback,
                                                gpointer callback_target);
VALA_EXTERN void one_shot_scheduler_at_priority_idle (OneShotScheduler* self,
                                          gint priority);
VALA_EXTERN gchar* resources_get_ui (const gchar* filename);
VALA_EXTERN void app_window_error_message (const gchar* message,
                               GtkWindow* parent);
VALA_EXTERN gpointer application_ref (gpointer instance);
VALA_EXTERN void application_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_application (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_application (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_application (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_application (const GValue* value);
VALA_EXTERN GType application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Application, application_unref)
VALA_EXTERN Application* application_get_instance (void);
VALA_EXTERN void application_panic (Application* self);
static void page_real_init_collect_ui_filenames (Page* self,
                                          GeeList* ui_filenames);
static InjectionGroup** page_real_init_collect_injection_groups (Page* self,
                                                          gint* result_length1);
static void page_real_init_actions (Page* self,
                             gint selected_count,
                             gint count);
static void page_real_update_actions (Page* self,
                               gint selected_count,
                               gint count);
VALA_EXTERN gboolean page_get_event_source_pointer (Page* self,
                                        gint* x,
                                        gint* y,
                                        GdkModifierType* mask);
static gboolean page_real_on_left_click (Page* self,
                                  GdkEventButton* event);
static gboolean page_real_on_middle_click (Page* self,
                                    GdkEventButton* event);
static gboolean page_real_on_right_click (Page* self,
                                   GdkEventButton* event);
static gboolean page_real_on_left_released (Page* self,
                                     GdkEventButton* event);
static gboolean page_real_on_middle_released (Page* self,
                                       GdkEventButton* event);
static gboolean page_real_on_right_released (Page* self,
                                      GdkEventButton* event);
static gboolean page_real_on_ctrl_pressed (Page* self,
                                    GdkEventKey* event);
static gboolean page_real_on_ctrl_released (Page* self,
                                     GdkEventKey* event);
static gboolean page_real_on_alt_pressed (Page* self,
                                   GdkEventKey* event);
static gboolean page_real_on_alt_released (Page* self,
                                    GdkEventKey* event);
static gboolean page_real_on_shift_pressed (Page* self,
                                     GdkEventKey* event);
static gboolean page_real_on_shift_released (Page* self,
                                      GdkEventKey* event);
static gboolean page_real_on_super_pressed (Page* self,
                                     GdkEventKey* event);
static gboolean page_real_on_super_released (Page* self,
                                      GdkEventKey* event);
static gboolean page_real_on_app_key_pressed (Page* self,
                                       GdkEventKey* event);
static gboolean page_real_on_app_key_released (Page* self,
                                        GdkEventKey* event);
VALA_EXTERN gboolean page_notify_app_key_pressed (Page* self,
                                      GdkEventKey* event);
VALA_EXTERN gboolean page_notify_app_key_released (Page* self,
                                       GdkEventKey* event);
VALA_EXTERN gboolean page_notify_app_focus_in (Page* self,
                                   GdkEventFocus* event);
VALA_EXTERN gboolean page_notify_app_focus_out (Page* self,
                                    GdkEventFocus* event);
static void page_real_on_move (Page* self,
                        GdkRectangle* rect);
static void page_real_on_move_start (Page* self,
                              GdkRectangle* rect);
static void page_real_on_move_finished (Page* self,
                                 GdkRectangle* rect);
static void page_real_on_resize (Page* self,
                          GdkRectangle* rect);
static void page_real_on_resize_start (Page* self,
                                GdkRectangle* rect);
static void page_real_on_resize_finished (Page* self,
                                   GdkRectangle* rect);
static gboolean page_real_on_configure (Page* self,
                                 GdkEventConfigure* event,
                                 GdkRectangle* rect);
VALA_EXTERN gboolean page_notify_configure_event (Page* self,
                                      GdkEventConfigure* event);
static gboolean page_check_configure_halted (Page* self);
static gboolean _page_check_configure_halted_gsource_func (gpointer self);
VALA_EXTERN gulong now_ms (void);
static gboolean page_real_on_motion (Page* self,
                              GdkEventMotion* event,
                              gint x,
                              gint y,
                              GdkModifierType mask);
static void page_check_cursor_hiding (Page* self);
static gboolean page_real_on_leave_notify_event (Page* self);
static gboolean page_real_on_mousewheel_up (Page* self,
                                     GdkEventScroll* event);
static gboolean page_real_on_mousewheel_down (Page* self,
                                       GdkEventScroll* event);
static gboolean page_real_on_mousewheel_left (Page* self,
                                       GdkEventScroll* event);
static gboolean page_real_on_mousewheel_right (Page* self,
                                        GdkEventScroll* event);
static gboolean page_real_on_context_keypress (Page* self);
static gboolean page_real_on_context_buttonpress (Page* self,
                                           GdkEventButton* event);
static gboolean page_real_on_context_invoked (Page* self);
VALA_EXTERN gboolean page_popup_context_menu (Page* self,
                                  GtkMenu* context_menu,
                                  GdkEventButton* event);
VALA_EXTERN void page_set_cursor_hide_time (Page* self,
                                gint hide_time);
VALA_EXTERN void page_start_cursor_hiding (Page* self);
VALA_EXTERN void page_stop_cursor_hiding (Page* self);
VALA_EXTERN void page_suspend_cursor_hiding (Page* self);
VALA_EXTERN void page_restore_cursor_hiding (Page* self);
static void page_real_set_page_cursor (Page* self,
                                GdkCursorType cursor_type);
static gboolean page_on_hide_cursor (Page* self);
static gboolean _page_on_hide_cursor_gsource_func (gpointer self);
VALA_EXTERN void app_window_update_menu_item_label (AppWindow* self,
                                        const gchar* id,
                                        const gchar* new_label);
static void page_finalize (GObject * obj);
static GType page_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
injection_group_get_instance_private (InjectionGroup* self)
{
	return G_STRUCT_MEMBER_P (self, InjectionGroup_private_offset);
}

InjectionGroup*
injection_group_construct (GType object_type,
                           const gchar* path)
{
	InjectionGroup* self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (path != NULL, NULL);
	self = (InjectionGroup*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup (path);
	_g_free0 (self->priv->path);
	self->priv->path = _tmp0_;
	return self;
}

InjectionGroup*
injection_group_new (const gchar* path)
{
	return injection_group_construct (TYPE_INJECTION_GROUP, path);
}

gchar*
injection_group_get_path (InjectionGroup* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (IS_INJECTION_GROUP (self), NULL);
	_tmp0_ = self->priv->path;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

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

GeeList*
injection_group_get_elements (InjectionGroup* self)
{
	GeeArrayList* _tmp0_;
	GeeList* _tmp1_;
	GeeList* result;
	g_return_val_if_fail (IS_INJECTION_GROUP (self), NULL);
	_tmp0_ = self->priv->elements;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST, GeeList));
	result = _tmp1_;
	return result;
}

void
injection_group_add_menu_item (InjectionGroup* self,
                               const gchar* name,
                               const gchar* action,
                               const gchar* accelerator)
{
	GeeArrayList* _tmp0_;
	InjectionGroupElement* _tmp1_;
	InjectionGroupElement* _tmp2_;
	g_return_if_fail (IS_INJECTION_GROUP (self));
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->elements;
	_tmp1_ = injection_group_element_new (name, action, accelerator, INJECTION_GROUP_ELEMENT_ITEM_TYPE_MENUITEM);
	_tmp2_ = _tmp1_;
	gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp2_);
	_injection_group_element_unref0 (_tmp2_);
}

void
injection_group_add_menu (InjectionGroup* self,
                          const gchar* name,
                          const gchar* action)
{
	GeeArrayList* _tmp0_;
	InjectionGroupElement* _tmp1_;
	InjectionGroupElement* _tmp2_;
	g_return_if_fail (IS_INJECTION_GROUP (self));
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->elements;
	_tmp1_ = injection_group_element_new (name, action, NULL, INJECTION_GROUP_ELEMENT_ITEM_TYPE_MENU);
	_tmp2_ = _tmp1_;
	gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp2_);
	_injection_group_element_unref0 (_tmp2_);
}

void
injection_group_add_separator (InjectionGroup* self)
{
	GeeArrayList* _tmp0_;
	gint _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	InjectionGroupElement* _tmp4_;
	InjectionGroupElement* _tmp5_;
	g_return_if_fail (IS_INJECTION_GROUP (self));
	_tmp0_ = self->priv->elements;
	_tmp1_ = self->priv->separator_id;
	self->priv->separator_id = _tmp1_ + 1;
	_tmp2_ = g_strdup_printf ("%d-separator", _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = injection_group_element_new (_tmp3_, NULL, NULL, INJECTION_GROUP_ELEMENT_ITEM_TYPE_SEPARATOR);
	_tmp5_ = _tmp4_;
	gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), _tmp5_);
	_injection_group_element_unref0 (_tmp5_);
	_g_free0 (_tmp3_);
}

static GType
injection_group_element_item_type_get_type_once (void)
{
	static const GEnumValue values[] = {{INJECTION_GROUP_ELEMENT_ITEM_TYPE_MENUITEM, "INJECTION_GROUP_ELEMENT_ITEM_TYPE_MENUITEM", "menuitem"}, {INJECTION_GROUP_ELEMENT_ITEM_TYPE_MENU, "INJECTION_GROUP_ELEMENT_ITEM_TYPE_MENU", "menu"}, {INJECTION_GROUP_ELEMENT_ITEM_TYPE_SEPARATOR, "INJECTION_GROUP_ELEMENT_ITEM_TYPE_SEPARATOR", "separator"}, {0, NULL, NULL}};
	GType injection_group_element_item_type_type_id;
	injection_group_element_item_type_type_id = g_enum_register_static ("InjectionGroupElementItemType", values);
	return injection_group_element_item_type_type_id;
}

GType
injection_group_element_item_type_get_type (void)
{
	static volatile gsize injection_group_element_item_type_type_id__once = 0;
	if (g_once_init_enter (&injection_group_element_item_type_type_id__once)) {
		GType injection_group_element_item_type_type_id;
		injection_group_element_item_type_type_id = injection_group_element_item_type_get_type_once ();
		g_once_init_leave (&injection_group_element_item_type_type_id__once, injection_group_element_item_type_type_id);
	}
	return injection_group_element_item_type_type_id__once;
}

InjectionGroupElement*
injection_group_element_construct (GType object_type,
                                   const gchar* name,
                                   const gchar* action,
                                   const gchar* accelerator,
                                   InjectionGroupElementItemType kind)
{
	InjectionGroupElement* self = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (name != NULL, NULL);
	self = (InjectionGroupElement*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup (name);
	_g_free0 (self->name);
	self->name = _tmp0_;
	if (action != NULL) {
		_tmp1_ = action;
	} else {
		_tmp1_ = name;
	}
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (self->action);
	self->action = _tmp2_;
	_tmp3_ = g_strdup (accelerator);
	_g_free0 (self->accelerator);
	self->accelerator = _tmp3_;
	self->kind = kind;
	return self;
}

InjectionGroupElement*
injection_group_element_new (const gchar* name,
                             const gchar* action,
                             const gchar* accelerator,
                             InjectionGroupElementItemType kind)
{
	return injection_group_element_construct (INJECTION_GROUP_TYPE_ELEMENT, name, action, accelerator, kind);
}

static void
injection_group_value_element_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
injection_group_value_element_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		injection_group_element_unref (value->data[0].v_pointer);
	}
}

static void
injection_group_value_element_copy_value (const GValue* src_value,
                                          GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = injection_group_element_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
injection_group_value_element_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
injection_group_value_element_collect_value (GValue* value,
                                             guint n_collect_values,
                                             GTypeCValue* collect_values,
                                             guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		InjectionGroupElement * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = injection_group_element_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
injection_group_value_element_lcopy_value (const GValue* value,
                                           guint n_collect_values,
                                           GTypeCValue* collect_values,
                                           guint collect_flags)
{
	InjectionGroupElement ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = injection_group_element_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
injection_group_param_spec_element (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags)
{
	InjectionGroupParamSpecElement* spec;
	g_return_val_if_fail (g_type_is_a (object_type, INJECTION_GROUP_TYPE_ELEMENT), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
injection_group_value_get_element (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, INJECTION_GROUP_TYPE_ELEMENT), NULL);
	return value->data[0].v_pointer;
}

void
injection_group_value_set_element (GValue* value,
                                   gpointer v_object)
{
	InjectionGroupElement * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, INJECTION_GROUP_TYPE_ELEMENT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, INJECTION_GROUP_TYPE_ELEMENT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		injection_group_element_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		injection_group_element_unref (old);
	}
}

void
injection_group_value_take_element (GValue* value,
                                    gpointer v_object)
{
	InjectionGroupElement * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, INJECTION_GROUP_TYPE_ELEMENT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, INJECTION_GROUP_TYPE_ELEMENT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		injection_group_element_unref (old);
	}
}

static void
injection_group_element_class_init (InjectionGroupElementClass * klass,
                                    gpointer klass_data)
{
	injection_group_element_parent_class = g_type_class_peek_parent (klass);
	((InjectionGroupElementClass *) klass)->finalize = injection_group_element_finalize;
}

static void
injection_group_element_instance_init (InjectionGroupElement * self,
                                       gpointer klass)
{
	self->ref_count = 1;
}

static void
injection_group_element_finalize (InjectionGroupElement * obj)
{
	InjectionGroupElement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, INJECTION_GROUP_TYPE_ELEMENT, InjectionGroupElement);
	g_signal_handlers_destroy (self);
	_g_free0 (self->name);
	_g_free0 (self->action);
	_g_free0 (self->accelerator);
}

static GType
injection_group_element_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { injection_group_value_element_init, injection_group_value_element_free_value, injection_group_value_element_copy_value, injection_group_value_element_peek_pointer, "p", injection_group_value_element_collect_value, "p", injection_group_value_element_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (InjectionGroupElementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) injection_group_element_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (InjectionGroupElement), 0, (GInstanceInitFunc) injection_group_element_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType injection_group_element_type_id;
	injection_group_element_type_id = g_type_register_fundamental (g_type_fundamental_next (), "InjectionGroupElement", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return injection_group_element_type_id;
}

GType
injection_group_element_get_type (void)
{
	static volatile gsize injection_group_element_type_id__once = 0;
	if (g_once_init_enter (&injection_group_element_type_id__once)) {
		GType injection_group_element_type_id;
		injection_group_element_type_id = injection_group_element_get_type_once ();
		g_once_init_leave (&injection_group_element_type_id__once, injection_group_element_type_id);
	}
	return injection_group_element_type_id__once;
}

gpointer
injection_group_element_ref (gpointer instance)
{
	InjectionGroupElement * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
injection_group_element_unref (gpointer instance)
{
	InjectionGroupElement * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		INJECTION_GROUP_ELEMENT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
value_injection_group_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
value_injection_group_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		injection_group_unref (value->data[0].v_pointer);
	}
}

static void
value_injection_group_copy_value (const GValue* src_value,
                                  GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = injection_group_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
value_injection_group_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
value_injection_group_collect_value (GValue* value,
                                     guint n_collect_values,
                                     GTypeCValue* collect_values,
                                     guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		InjectionGroup * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = injection_group_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
value_injection_group_lcopy_value (const GValue* value,
                                   guint n_collect_values,
                                   GTypeCValue* collect_values,
                                   guint collect_flags)
{
	InjectionGroup ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = injection_group_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
param_spec_injection_group (const gchar* name,
                            const gchar* nick,
                            const gchar* blurb,
                            GType object_type,
                            GParamFlags flags)
{
	ParamSpecInjectionGroup* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_INJECTION_GROUP), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
value_get_injection_group (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_INJECTION_GROUP), NULL);
	return value->data[0].v_pointer;
}

void
value_set_injection_group (GValue* value,
                           gpointer v_object)
{
	InjectionGroup * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_INJECTION_GROUP));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_INJECTION_GROUP));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		injection_group_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		injection_group_unref (old);
	}
}

void
value_take_injection_group (GValue* value,
                            gpointer v_object)
{
	InjectionGroup * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_INJECTION_GROUP));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_INJECTION_GROUP));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		injection_group_unref (old);
	}
}

static void
injection_group_class_init (InjectionGroupClass * klass,
                            gpointer klass_data)
{
	injection_group_parent_class = g_type_class_peek_parent (klass);
	((InjectionGroupClass *) klass)->finalize = injection_group_finalize;
	g_type_class_adjust_private_offset (klass, &InjectionGroup_private_offset);
}

static void
injection_group_instance_init (InjectionGroup * self,
                               gpointer klass)
{
	GeeArrayList* _tmp0_;
	self->priv = injection_group_get_instance_private (self);
	_tmp0_ = gee_array_list_new (INJECTION_GROUP_TYPE_ELEMENT, (GBoxedCopyFunc) injection_group_element_ref, (GDestroyNotify) injection_group_element_unref, NULL, NULL, NULL);
	self->priv->elements = _tmp0_;
	self->priv->separator_id = 0;
	self->ref_count = 1;
}

static void
injection_group_finalize (InjectionGroup * obj)
{
	InjectionGroup * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_INJECTION_GROUP, InjectionGroup);
	g_signal_handlers_destroy (self);
	_g_free0 (self->priv->path);
	_g_object_unref0 (self->priv->elements);
}

static GType
injection_group_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { value_injection_group_init, value_injection_group_free_value, value_injection_group_copy_value, value_injection_group_peek_pointer, "p", value_injection_group_collect_value, "p", value_injection_group_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (InjectionGroupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) injection_group_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (InjectionGroup), 0, (GInstanceInitFunc) injection_group_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType injection_group_type_id;
	injection_group_type_id = g_type_register_fundamental (g_type_fundamental_next (), "InjectionGroup", &g_define_type_info, &g_define_type_fundamental_info, 0);
	InjectionGroup_private_offset = g_type_add_instance_private (injection_group_type_id, sizeof (InjectionGroupPrivate));
	return injection_group_type_id;
}

GType
injection_group_get_type (void)
{
	static volatile gsize injection_group_type_id__once = 0;
	if (g_once_init_enter (&injection_group_type_id__once)) {
		GType injection_group_type_id;
		injection_group_type_id = injection_group_get_type_once ();
		g_once_init_leave (&injection_group_type_id__once, injection_group_type_id);
	}
	return injection_group_type_id__once;
}

gpointer
injection_group_ref (gpointer instance)
{
	InjectionGroup * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
injection_group_unref (gpointer instance)
{
	InjectionGroup * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		INJECTION_GROUP_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
page_get_instance_private (Page* self)
{
	return G_STRUCT_MEMBER_P (self, Page_private_offset);
}

static gboolean
_page_on_context_keypress_gtk_widget_popup_menu (GtkWidget* _sender,
                                                 gpointer self)
{
	gboolean result;
	result = page_on_context_keypress ((Page*) self);
	return result;
}

static void
_page_attach_view_signals_gtk_widget_realize (GtkWidget* _sender,
                                              gpointer self)
{
	page_attach_view_signals ((Page*) self);
}

Page*
page_construct (GType object_type,
                const gchar* page_name)
{
	Page * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	ViewCollection* _tmp3_;
	GdkPoint _tmp4_ = {0};
	g_return_val_if_fail (page_name != NULL, NULL);
	self = (Page*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (page_name);
	_g_free0 (self->priv->page_name);
	self->priv->page_name = _tmp0_;
	_tmp1_ = g_strdup_printf ("ViewCollection for Page %s", page_name);
	_tmp2_ = _tmp1_;
	_tmp3_ = view_collection_new (_tmp2_);
	_data_collection_unref0 (self->priv->view);
	self->priv->view = _tmp3_;
	_g_free0 (_tmp2_);
	_tmp4_.x = -1;
	_tmp4_.y = -1;
	self->priv->last_down = _tmp4_;
	gtk_widget_set_can_focus (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), TRUE);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "popup-menu", (GCallback) _page_on_context_keypress_gtk_widget_popup_menu, self, 0);
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), "realize", (GCallback) _page_attach_view_signals_gtk_widget_realize, self, 0);
	return self;
}

static void
page_real_destroy (GtkWidget* base)
{
	Page * self;
	ViewCollection* _tmp0_;
	GtkToolbar* _tmp1_;
	OneShotScheduler* _tmp3_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, TYPE_PAGE, Page);
	if (self->priv->is_destroyed) {
		return;
	}
	page_detach_event_source (self);
	page_detach_view_signals (self);
	_tmp0_ = self->priv->view;
	data_collection_close (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_DATA_COLLECTION, DataCollection));
	page_clear_container (self);
	_tmp1_ = self->toolbar;
	if (_tmp1_ != NULL) {
		GtkToolbar* _tmp2_;
		_tmp2_ = self->toolbar;
		gtk_widget_destroy (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget));
	}
	_tmp3_ = self->priv->update_actions_scheduler;
	if (_tmp3_ != NULL) {
		OneShotScheduler* _tmp4_;
		_tmp4_ = self->priv->update_actions_scheduler;
		one_shot_scheduler_cancel (_tmp4_);
	}
	self->priv->is_destroyed = TRUE;
	GTK_WIDGET_CLASS (page_parent_class)->destroy (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_scrolled_window_get_type (), GtkScrolledWindow), gtk_widget_get_type (), GtkWidget));
	_tmp5_ = page_get_page_name (self);
	_tmp6_ = _tmp5_;
	g_debug ("Page.vala:136: Page %s Destroyed", _tmp6_);
	_g_free0 (_tmp6_);
}

gchar*
page_get_page_name (Page* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_tmp0_ = self->priv->page_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
page_real_set_page_name (Page* self,
                         const gchar* page_name)
{
	gchar* _tmp0_;
	g_return_if_fail (page_name != NULL);
	_tmp0_ = g_strdup (page_name);
	_g_free0 (self->priv->page_name);
	self->priv->page_name = _tmp0_;
}

void
page_set_page_name (Page* self,
                    const gchar* page_name)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->set_page_name) {
		_klass_->set_page_name (self, page_name);
	}
}

gchar*
page_to_string (Page* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_tmp0_ = self->priv->page_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

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

ViewCollection*
page_get_view (Page* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	ViewCollection* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_tmp0_ = self->priv->view;
	_tmp1_ = _data_collection_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

GtkWindow*
page_get_container (Page* self)
{
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	GtkWindow* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_tmp0_ = self->priv->container;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
page_real_set_container (Page* self,
                         GtkWindow* container)
{
	GtkWindow* _tmp0_;
	GtkWindow* _tmp1_;
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (container, gtk_window_get_type ()));
	_tmp0_ = self->priv->container;
	_vala_assert (_tmp0_ == NULL, "this.container == null");
	_tmp1_ = _g_object_ref0 (container);
	_g_object_unref0 (self->priv->container);
	self->priv->container = _tmp1_;
}

void
page_set_container (Page* self,
                    GtkWindow* container)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->set_container) {
		_klass_->set_container (self, container);
	}
}

static void
page_real_clear_container (Page* self)
{
	_g_object_unref0 (self->priv->container);
	self->priv->container = NULL;
}

void
page_clear_container (Page* self)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->clear_container) {
		_klass_->clear_container (self);
	}
}

static gboolean
_page_on_button_pressed_internal_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                GdkEventButton* event,
                                                                gpointer self)
{
	gboolean result;
	result = page_on_button_pressed_internal ((Page*) self, event);
	return result;
}

static gboolean
_page_on_button_released_internal_gtk_widget_button_release_event (GtkWidget* _sender,
                                                                   GdkEventButton* event,
                                                                   gpointer self)
{
	gboolean result;
	result = page_on_button_released_internal ((Page*) self, event);
	return result;
}

static gboolean
_page_on_motion_internal_gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                         GdkEventMotion* event,
                                                         gpointer self)
{
	gboolean result;
	result = page_on_motion_internal ((Page*) self, event);
	return result;
}

static gboolean
_page_on_leave_notify_event_gtk_widget_leave_notify_event (GtkWidget* _sender,
                                                           GdkEventCrossing* event,
                                                           gpointer self)
{
	gboolean result;
	result = page_on_leave_notify_event ((Page*) self);
	return result;
}

static gboolean
_page_on_mousewheel_internal_gtk_widget_scroll_event (GtkWidget* _sender,
                                                      GdkEventScroll* event,
                                                      gpointer self)
{
	gboolean result;
	result = page_on_mousewheel_internal ((Page*) self, event);
	return result;
}

static void
_page_on_event_source_realize_gtk_widget_realize (GtkWidget* _sender,
                                                  gpointer self)
{
	page_on_event_source_realize ((Page*) self);
}

void
page_set_event_source (Page* self,
                       GtkWidget* event_source)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (event_source, gtk_widget_get_type ()));
	_tmp0_ = self->priv->event_source;
	_vala_assert (_tmp0_ == NULL, "this.event_source == null");
	_tmp1_ = _g_object_ref0 (event_source);
	_g_object_unref0 (self->priv->event_source);
	self->priv->event_source = _tmp1_;
	gtk_widget_set_can_focus (event_source, TRUE);
	gtk_widget_add_events (event_source, (gint) (((((((GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK) | GDK_POINTER_MOTION_MASK) | GDK_POINTER_MOTION_HINT_MASK) | GDK_BUTTON_MOTION_MASK) | GDK_LEAVE_NOTIFY_MASK) | GDK_SCROLL_MASK) | GDK_SMOOTH_SCROLL_MASK));
	g_signal_connect_object (event_source, "button-press-event", (GCallback) _page_on_button_pressed_internal_gtk_widget_button_press_event, self, 0);
	g_signal_connect_object (event_source, "button-release-event", (GCallback) _page_on_button_released_internal_gtk_widget_button_release_event, self, 0);
	g_signal_connect_object (event_source, "motion-notify-event", (GCallback) _page_on_motion_internal_gtk_widget_motion_notify_event, self, 0);
	g_signal_connect_object (event_source, "leave-notify-event", (GCallback) _page_on_leave_notify_event_gtk_widget_leave_notify_event, self, 0);
	g_signal_connect_object (event_source, "scroll-event", (GCallback) _page_on_mousewheel_internal_gtk_widget_scroll_event, self, 0);
	g_signal_connect_object (event_source, "realize", (GCallback) _page_on_event_source_realize_gtk_widget_realize, self, 0);
}

static void
page_detach_event_source (Page* self)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	guint _tmp2_;
	GtkWidget* _tmp3_;
	guint _tmp4_;
	GtkWidget* _tmp5_;
	guint _tmp6_;
	GtkWidget* _tmp7_;
	guint _tmp8_;
	GtkWidget* _tmp9_;
	guint _tmp10_;
	g_return_if_fail (IS_PAGE (self));
	_tmp0_ = self->priv->event_source;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->event_source;
	g_signal_parse_name ("button-press-event", gtk_widget_get_type (), &_tmp2_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _page_on_button_pressed_internal_gtk_widget_button_press_event, self);
	_tmp3_ = self->priv->event_source;
	g_signal_parse_name ("button-release-event", gtk_widget_get_type (), &_tmp4_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp3_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp4_, 0, NULL, (GCallback) _page_on_button_released_internal_gtk_widget_button_release_event, self);
	_tmp5_ = self->priv->event_source;
	g_signal_parse_name ("motion-notify-event", gtk_widget_get_type (), &_tmp6_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp5_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp6_, 0, NULL, (GCallback) _page_on_motion_internal_gtk_widget_motion_notify_event, self);
	_tmp7_ = self->priv->event_source;
	g_signal_parse_name ("leave-notify-event", gtk_widget_get_type (), &_tmp8_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp7_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp8_, 0, NULL, (GCallback) _page_on_leave_notify_event_gtk_widget_leave_notify_event, self);
	_tmp9_ = self->priv->event_source;
	g_signal_parse_name ("scroll-event", gtk_widget_get_type (), &_tmp10_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp9_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp10_, 0, NULL, (GCallback) _page_on_mousewheel_internal_gtk_widget_scroll_event, self);
	_g_object_unref0 (self->priv->event_source);
	self->priv->event_source = NULL;
}

GtkWidget*
page_get_event_source (Page* self)
{
	GtkWidget* _tmp0_;
	GtkWidget* _tmp1_;
	GtkWidget* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_tmp0_ = self->priv->event_source;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static gpointer
_injection_group_ref0 (gpointer self)
{
	return self ? injection_group_ref (self) : NULL;
}

GMenuModel*
page_get_menubar (Page* self)
{
	GMenu* model = NULL;
	GtkBuilder* _tmp0_;
	GObject* _tmp1_;
	GMenu* _tmp2_;
	GMenu* _tmp3_;
	GMenuModel* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_tmp0_ = self->builder;
	_tmp1_ = gtk_builder_get_object (_tmp0_, "MenuBar");
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, g_menu_get_type ()) ? ((GMenu*) _tmp1_) : NULL);
	model = _tmp2_;
	_tmp3_ = model;
	if (_tmp3_ == NULL) {
		GMenu* _tmp4_;
		_tmp4_ = g_menu_new ();
		result = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, g_menu_model_get_type (), GMenuModel);
		_g_object_unref0 (model);
		return result;
	}
	if (!self->priv->menubar_injected) {
		InjectionGroup** injection_groups = NULL;
		gint _tmp5_ = 0;
		InjectionGroup** _tmp6_;
		gint injection_groups_length1;
		gint _injection_groups_size_;
		InjectionGroup** _tmp7_;
		gint _tmp7__length1;
		_tmp6_ = page_init_collect_injection_groups (self, &_tmp5_);
		injection_groups = _tmp6_;
		injection_groups_length1 = _tmp5_;
		_injection_groups_size_ = injection_groups_length1;
		_tmp7_ = injection_groups;
		_tmp7__length1 = injection_groups_length1;
		{
			InjectionGroup** group_collection = NULL;
			gint group_collection_length1 = 0;
			gint _group_collection_size_ = 0;
			gint group_it = 0;
			group_collection = _tmp7_;
			group_collection_length1 = _tmp7__length1;
			for (group_it = 0; group_it < group_collection_length1; group_it = group_it + 1) {
				InjectionGroup* _tmp8_;
				InjectionGroup* group = NULL;
				_tmp8_ = _injection_group_ref0 (group_collection[group_it]);
				group = _tmp8_;
				{
					gint items = 0;
					GMenu* _tmp9_;
					_tmp9_ = model;
					items = g_menu_model_get_n_items (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, g_menu_model_get_type (), GMenuModel));
					{
						gint i = 0;
						i = 0;
						{
							gboolean _tmp10_ = FALSE;
							_tmp10_ = TRUE;
							while (TRUE) {
								GMenuModel* submenu = NULL;
								GMenu* _tmp12_;
								GMenuModel* _tmp13_;
								GMenuModel* section = NULL;
								GMenuModel* _tmp14_;
								InjectionGroup* _tmp15_;
								gchar* _tmp16_;
								gchar* _tmp17_;
								GMenuModel* _tmp18_;
								GMenuModel* _tmp19_;
								GMenuModel* _tmp20_;
								if (!_tmp10_) {
									gint _tmp11_;
									_tmp11_ = i;
									i = _tmp11_ + 1;
								}
								_tmp10_ = FALSE;
								if (!(i < items)) {
									break;
								}
								_tmp12_ = model;
								_tmp13_ = g_menu_model_get_item_link (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, g_menu_model_get_type (), GMenuModel), i, G_MENU_LINK_SUBMENU);
								submenu = _tmp13_;
								_tmp14_ = submenu;
								_tmp15_ = group;
								_tmp16_ = injection_group_get_path (_tmp15_);
								_tmp17_ = _tmp16_;
								_tmp18_ = page_find_extension_point (self, _tmp14_, _tmp17_);
								_tmp19_ = _tmp18_;
								_g_free0 (_tmp17_);
								section = _tmp19_;
								_tmp20_ = section;
								if (_tmp20_ == NULL) {
									_g_object_unref0 (section);
									_g_object_unref0 (submenu);
									continue;
								}
								{
									GeeList* _element_list = NULL;
									InjectionGroup* _tmp21_;
									GeeList* _tmp22_;
									gint _element_size = 0;
									GeeList* _tmp23_;
									gint _tmp24_;
									gint _tmp25_;
									gint _element_index = 0;
									_tmp21_ = group;
									_tmp22_ = injection_group_get_elements (_tmp21_);
									_element_list = _tmp22_;
									_tmp23_ = _element_list;
									_tmp24_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, GEE_TYPE_COLLECTION, GeeCollection));
									_tmp25_ = _tmp24_;
									_element_size = _tmp25_;
									_element_index = -1;
									while (TRUE) {
										gint _tmp26_;
										gint _tmp27_;
										InjectionGroupElement* element = NULL;
										GeeList* _tmp28_;
										gpointer _tmp29_;
										GMenu* menu = NULL;
										GMenuModel* _tmp30_;
										GMenu* _tmp31_;
										InjectionGroupElement* _tmp32_;
										_element_index = _element_index + 1;
										_tmp26_ = _element_index;
										_tmp27_ = _element_size;
										if (!(_tmp26_ < _tmp27_)) {
											break;
										}
										_tmp28_ = _element_list;
										_tmp29_ = gee_list_get (_tmp28_, _element_index);
										element = (InjectionGroupElement*) _tmp29_;
										_tmp30_ = section;
										_tmp31_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp30_, g_menu_get_type ()) ? ((GMenu*) _tmp30_) : NULL);
										menu = _tmp31_;
										_tmp32_ = element;
										switch (_tmp32_->kind) {
											case INJECTION_GROUP_ELEMENT_ITEM_TYPE_MENUITEM:
											{
												GMenuItem* item = NULL;
												InjectionGroupElement* _tmp33_;
												const gchar* _tmp34_;
												InjectionGroupElement* _tmp35_;
												const gchar* _tmp36_;
												gchar* _tmp37_;
												gchar* _tmp38_;
												GMenuItem* _tmp39_;
												GMenuItem* _tmp40_;
												InjectionGroupElement* _tmp41_;
												const gchar* _tmp42_;
												GMenu* _tmp46_;
												GMenuItem* _tmp47_;
												_tmp33_ = element;
												_tmp34_ = _tmp33_->name;
												_tmp35_ = element;
												_tmp36_ = _tmp35_->action;
												_tmp37_ = g_strconcat ("win.", _tmp36_, NULL);
												_tmp38_ = _tmp37_;
												_tmp39_ = g_menu_item_new (_tmp34_, _tmp38_);
												_tmp40_ = _tmp39_;
												_g_free0 (_tmp38_);
												item = _tmp40_;
												_tmp41_ = element;
												_tmp42_ = _tmp41_->accelerator;
												if (_tmp42_ != NULL) {
													GMenuItem* _tmp43_;
													InjectionGroupElement* _tmp44_;
													const gchar* _tmp45_;
													_tmp43_ = item;
													_tmp44_ = element;
													_tmp45_ = _tmp44_->accelerator;
													g_menu_item_set_attribute (_tmp43_, "accel", "s", _tmp45_, NULL);
												}
												_tmp46_ = menu;
												_tmp47_ = item;
												g_menu_append_item (_tmp46_, _tmp47_);
												_g_object_unref0 (item);
												break;
											}
											default:
											{
												break;
											}
										}
										_g_object_unref0 (menu);
										_injection_group_element_unref0 (element);
									}
									_g_object_unref0 (_element_list);
								}
								_g_object_unref0 (section);
								_g_object_unref0 (submenu);
							}
						}
					}
					_injection_group_unref0 (group);
				}
			}
		}
		self->priv->menubar_injected = TRUE;
		injection_groups = (_vala_array_free (injection_groups, injection_groups_length1, (GDestroyNotify) injection_group_unref), NULL);
	}
	result = G_TYPE_CHECK_INSTANCE_CAST (model, g_menu_model_get_type (), GMenuModel);
	return result;
}

static GtkToolbar*
page_real_get_toolbar (Page* self)
{
	GtkToolbar* _tmp0_;
	GtkToolbar* _tmp12_;
	GtkToolbar* _tmp13_;
	GtkToolbar* result;
	_tmp0_ = self->toolbar;
	if (_tmp0_ == NULL) {
		GtkToolbar* _tmp1_ = NULL;
		const gchar* _tmp2_;
		GtkToolbar* _tmp8_;
		GtkToolbar* _tmp9_;
		GtkStyleContext* _tmp10_;
		GtkToolbar* _tmp11_;
		_tmp2_ = self->priv->toolbar_path;
		if (_tmp2_ == NULL) {
			GtkToolbar* _tmp3_;
			_tmp3_ = (GtkToolbar*) gtk_toolbar_new ();
			g_object_ref_sink (_tmp3_);
			_g_object_unref0 (_tmp1_);
			_tmp1_ = _tmp3_;
		} else {
			GtkBuilder* _tmp4_;
			const gchar* _tmp5_;
			GObject* _tmp6_;
			GtkToolbar* _tmp7_;
			_tmp4_ = self->builder;
			_tmp5_ = self->priv->toolbar_path;
			_tmp6_ = gtk_builder_get_object (_tmp4_, _tmp5_);
			_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, gtk_toolbar_get_type ()) ? ((GtkToolbar*) _tmp6_) : NULL);
			_g_object_unref0 (_tmp1_);
			_tmp1_ = _tmp7_;
		}
		_tmp8_ = _tmp1_;
		_tmp1_ = NULL;
		_g_object_unref0 (self->toolbar);
		self->toolbar = _tmp8_;
		_tmp9_ = self->toolbar;
		_tmp10_ = gtk_widget_get_style_context (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
		gtk_style_context_add_class (_tmp10_, "bottom-toolbar");
		_tmp11_ = self->toolbar;
		gtk_toolbar_set_icon_size (_tmp11_, GTK_ICON_SIZE_SMALL_TOOLBAR);
		_g_object_unref0 (_tmp1_);
	}
	_tmp12_ = self->toolbar;
	_tmp13_ = _g_object_ref0 (_tmp12_);
	result = _tmp13_;
	return result;
}

GtkToolbar*
page_get_toolbar (Page* self)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->get_toolbar) {
		return _klass_->get_toolbar (self);
	}
	return NULL;
}

static GtkMenu*
page_real_get_page_context_menu (Page* self)
{
	GtkMenu* result;
	result = NULL;
	return result;
}

GtkMenu*
page_get_page_context_menu (Page* self)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->get_page_context_menu) {
		return _klass_->get_page_context_menu (self);
	}
	return NULL;
}

static void
page_real_switching_from (Page* self)
{
	GActionMap* map = NULL;
	GtkWindow* _tmp0_;
	GActionMap* _tmp1_;
	GActionMap* _tmp2_;
	const gchar* _tmp4_;
	self->in_view = FALSE;
	_tmp0_ = page_get_container (self);
	_tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, g_action_map_get_type ()) ? ((GActionMap*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	map = _tmp1_;
	_tmp2_ = map;
	if (_tmp2_ != NULL) {
		GActionMap* _tmp3_;
		_tmp3_ = map;
		page_remove_actions (self, _tmp3_);
	}
	_tmp4_ = self->priv->toolbar_path;
	if (_tmp4_ != NULL) {
		_g_object_unref0 (self->toolbar);
		self->toolbar = NULL;
	}
	_g_object_unref0 (map);
}

void
page_switching_from (Page* self)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->switching_from) {
		_klass_->switching_from (self);
	}
}

static void
page_real_switched_to (Page* self)
{
	GActionMap* map = NULL;
	GtkWindow* _tmp0_;
	GActionMap* _tmp1_;
	GActionMap* _tmp2_;
	gint selected_count = 0;
	ViewCollection* _tmp4_;
	ViewCollection* _tmp5_;
	gint _tmp6_;
	gint count = 0;
	ViewCollection* _tmp7_;
	ViewCollection* _tmp8_;
	gint _tmp9_;
	self->in_view = TRUE;
	page_add_ui (self);
	_tmp0_ = page_get_container (self);
	_tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, g_action_map_get_type ()) ? ((GActionMap*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	map = _tmp1_;
	_tmp2_ = map;
	if (_tmp2_ != NULL) {
		GActionMap* _tmp3_;
		_tmp3_ = map;
		page_add_actions (self, _tmp3_);
	}
	_tmp4_ = page_get_view (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = view_collection_get_selected_count (_tmp5_);
	_data_collection_unref0 (_tmp5_);
	selected_count = _tmp6_;
	_tmp7_ = page_get_view (self);
	_tmp8_ = _tmp7_;
	_tmp9_ = data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp8_);
	count = _tmp9_;
	page_init_actions (self, selected_count, count);
	page_update_actions (self, selected_count, count);
	page_update_modifiers (self);
	_g_object_unref0 (map);
}

void
page_switched_to (Page* self)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->switched_to) {
		_klass_->switched_to (self);
	}
}

static void
page_real_ready (Page* self)
{
}

void
page_ready (Page* self)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->ready) {
		_klass_->ready (self);
	}
}

gboolean
page_is_in_view (Page* self)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	result = self->in_view;
	return result;
}

static void
page_real_switching_to_fullscreen (Page* self,
                                   FullscreenWindow* fsw)
{
	g_return_if_fail (IS_FULLSCREEN_WINDOW (fsw));
	page_add_actions (self, G_TYPE_CHECK_INSTANCE_CAST (fsw, g_action_map_get_type (), GActionMap));
}

void
page_switching_to_fullscreen (Page* self,
                              FullscreenWindow* fsw)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->switching_to_fullscreen) {
		_klass_->switching_to_fullscreen (self, fsw);
	}
}

static void
page_real_returning_from_fullscreen (Page* self,
                                     FullscreenWindow* fsw)
{
	g_return_if_fail (IS_FULLSCREEN_WINDOW (fsw));
	page_remove_actions (self, G_TYPE_CHECK_INSTANCE_CAST (fsw, g_action_map_get_type (), GActionMap));
	page_switched_to (self);
}

void
page_returning_from_fullscreen (Page* self,
                                FullscreenWindow* fsw)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->returning_from_fullscreen) {
		_klass_->returning_from_fullscreen (self, fsw);
	}
}

GAction*
page_get_action (Page* self,
                 const gchar* name)
{
	GActionMap* map = NULL;
	GtkWindow* _tmp0_;
	GActionMap* _tmp5_;
	GAction* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	g_return_val_if_fail (name != NULL, NULL);
	map = NULL;
	_tmp0_ = self->priv->container;
	if (IS_FULLSCREEN_WINDOW (_tmp0_)) {
		GtkWindow* _tmp1_;
		GActionMap* _tmp2_;
		_tmp1_ = self->priv->container;
		_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, g_action_map_get_type ()) ? ((GActionMap*) _tmp1_) : NULL);
		_g_object_unref0 (map);
		map = _tmp2_;
	} else {
		AppWindow* _tmp3_;
		GActionMap* _tmp4_;
		_tmp3_ = app_window_get_instance ();
		_tmp4_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, g_action_map_get_type ()) ? ((GActionMap*) _tmp3_) : NULL;
		if (_tmp4_ == NULL) {
			_g_object_unref0 (_tmp3_);
		}
		_g_object_unref0 (map);
		map = _tmp4_;
	}
	_tmp5_ = map;
	if (_tmp5_ != NULL) {
		GActionMap* _tmp6_;
		GAction* _tmp7_;
		GAction* _tmp8_;
		_tmp6_ = map;
		_tmp7_ = g_action_map_lookup_action (_tmp6_, name);
		_tmp8_ = _g_object_ref0 (_tmp7_);
		result = _tmp8_;
		_g_object_unref0 (map);
		return result;
	}
	result = NULL;
	_g_object_unref0 (map);
	return result;
}

void
page_set_action_sensitive (Page* self,
                           const gchar* name,
                           gboolean sensitive)
{
	GSimpleAction* action = NULL;
	GAction* _tmp0_;
	GSimpleAction* _tmp1_;
	GSimpleAction* _tmp2_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (name != NULL);
	_tmp0_ = page_get_action (self, name);
	_tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	action = _tmp1_;
	_tmp2_ = action;
	if (_tmp2_ != NULL) {
		GSimpleAction* _tmp3_;
		_tmp3_ = action;
		g_simple_action_set_enabled (_tmp3_, sensitive);
	}
	_g_object_unref0 (action);
}

void
page_set_action_details (Page* self,
                         const gchar* name,
                         const gchar* label,
                         const gchar* tooltip,
                         gboolean sensitive)
{
	GSimpleAction* action = NULL;
	GAction* _tmp0_;
	GSimpleAction* _tmp1_;
	GSimpleAction* _tmp2_;
	GSimpleAction* _tmp3_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (name != NULL);
	_tmp0_ = page_get_action (self, name);
	_tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	action = _tmp1_;
	_tmp2_ = action;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (action);
		return;
	}
	if (label != NULL) {
		page_update_menu_item_label (self, name, label);
	}
	_tmp3_ = action;
	g_simple_action_set_enabled (_tmp3_, sensitive);
	_g_object_unref0 (action);
}

void
page_activate_action (Page* self,
                      const gchar* name)
{
	GAction* action = NULL;
	GAction* _tmp0_;
	GAction* _tmp1_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (name != NULL);
	_tmp0_ = page_get_action (self, name);
	action = _tmp0_;
	_tmp1_ = action;
	if (_tmp1_ != NULL) {
		GAction* _tmp2_;
		_tmp2_ = action;
		g_action_activate (_tmp2_, NULL);
	}
	_g_object_unref0 (action);
}

GAction*
page_get_common_action (Page* self,
                        const gchar* name,
                        gboolean log_warning)
{
	GAction* action = NULL;
	GAction* _tmp0_;
	GAction* _tmp1_;
	GAction* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = page_get_action (self, name);
	action = _tmp0_;
	_tmp1_ = action;
	if (_tmp1_ != NULL) {
		result = action;
		return result;
	}
	if (log_warning) {
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = page_get_page_name (self);
		_tmp3_ = _tmp2_;
		g_warning ("Page.vala:357: Page %s: Unable to locate common action %s", _tmp3_, name);
		_g_free0 (_tmp3_);
	}
	result = NULL;
	_g_object_unref0 (action);
	return result;
}

void
page_set_common_action_sensitive (Page* self,
                                  const gchar* name,
                                  gboolean sensitive)
{
	GSimpleAction* action = NULL;
	GAction* _tmp0_;
	GSimpleAction* _tmp1_;
	GSimpleAction* _tmp2_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (name != NULL);
	_tmp0_ = page_get_common_action (self, name, TRUE);
	_tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	action = _tmp1_;
	_tmp2_ = action;
	if (_tmp2_ != NULL) {
		GSimpleAction* _tmp3_;
		_tmp3_ = action;
		g_simple_action_set_enabled (_tmp3_, sensitive);
	}
	_g_object_unref0 (action);
}

void
page_set_common_action_label (Page* self,
                              const gchar* name,
                              const gchar* label)
{
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (name != NULL);
	g_return_if_fail (label != NULL);
	g_debug ("Page.vala:369: Trying to set common action label for %s", name);
}

void
page_set_common_action_important (Page* self,
                                  const gchar* name,
                                  gboolean important)
{
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (name != NULL);
	g_debug ("Page.vala:373: Setting action to important: %s", name);
}

void
page_activate_common_action (Page* self,
                             const gchar* name)
{
	GSimpleAction* action = NULL;
	GAction* _tmp0_;
	GSimpleAction* _tmp1_;
	GSimpleAction* _tmp2_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (name != NULL);
	_tmp0_ = page_get_common_action (self, name, TRUE);
	_tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	action = _tmp1_;
	_tmp2_ = action;
	if (_tmp2_ != NULL) {
		GSimpleAction* _tmp3_;
		_tmp3_ = action;
		g_signal_emit_by_name (_tmp3_, "activate", NULL);
	}
	_g_object_unref0 (action);
}

gboolean
page_get_ctrl_pressed (Page* self)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	result = self->priv->ctrl_pressed;
	return result;
}

gboolean
page_get_alt_pressed (Page* self)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	result = self->priv->alt_pressed;
	return result;
}

gboolean
page_get_shift_pressed (Page* self)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	result = self->priv->shift_pressed;
	return result;
}

gboolean
page_get_super_pressed (Page* self)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	result = self->priv->super_pressed;
	return result;
}

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

void
page_set_action_active (Page* self,
                        const gchar* name,
                        gboolean active)
{
	GSimpleAction* action = NULL;
	GAction* _tmp0_;
	GSimpleAction* _tmp1_;
	GSimpleAction* _tmp2_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (name != NULL);
	_tmp0_ = page_get_action (self, name);
	_tmp1_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp0_) : NULL;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (_tmp0_);
	}
	action = _tmp1_;
	_tmp2_ = action;
	if (_tmp2_ != NULL) {
		GSimpleAction* _tmp3_;
		GVariant* _tmp4_;
		_tmp3_ = action;
		_tmp4_ = _variant_new18 (active);
		g_simple_action_set_state (_tmp3_, _tmp4_);
		_g_variant_unref0 (_tmp4_);
	}
	_g_object_unref0 (action);
}

static gboolean
page_get_modifiers (Page* self,
                    gboolean* ctrl,
                    gboolean* alt,
                    gboolean* shift,
                    gboolean* super)
{
	gboolean _vala_ctrl = FALSE;
	gboolean _vala_alt = FALSE;
	gboolean _vala_shift = FALSE;
	gboolean _vala_super = FALSE;
	AppWindow* _tmp0_;
	AppWindow* _tmp1_;
	GdkWindow* _tmp2_;
	gboolean _tmp3_;
	gint x = 0;
	gint y = 0;
	GdkModifierType mask = 0U;
	GdkSeat* seat = NULL;
	GdkDisplay* _tmp4_;
	GdkSeat* _tmp5_;
	GdkSeat* _tmp6_;
	AppWindow* _tmp7_;
	AppWindow* _tmp8_;
	GdkWindow* _tmp9_;
	GdkSeat* _tmp10_;
	GdkDevice* _tmp11_;
	gint _tmp12_ = 0;
	gint _tmp13_ = 0;
	GdkModifierType _tmp14_ = 0U;
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_tmp0_ = app_window_get_instance ();
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_widget_get_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
	_tmp3_ = _tmp2_ == NULL;
	_g_object_unref0 (_tmp1_);
	if (_tmp3_) {
		_vala_ctrl = FALSE;
		_vala_alt = FALSE;
		_vala_shift = FALSE;
		_vala_super = FALSE;
		result = FALSE;
		if (ctrl) {
			*ctrl = _vala_ctrl;
		}
		if (alt) {
			*alt = _vala_alt;
		}
		if (shift) {
			*shift = _vala_shift;
		}
		if (super) {
			*super = _vala_super;
		}
		return result;
	}
	_tmp4_ = gdk_display_get_default ();
	_tmp5_ = gdk_display_get_default_seat (_tmp4_);
	_tmp6_ = _g_object_ref0 (_tmp5_);
	seat = _tmp6_;
	_tmp7_ = app_window_get_instance ();
	_tmp8_ = _tmp7_;
	_tmp9_ = gtk_widget_get_window (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, gtk_widget_get_type (), GtkWidget));
	_tmp10_ = seat;
	_tmp11_ = gdk_seat_get_pointer (_tmp10_);
	gdk_window_get_device_position (_tmp9_, _tmp11_, &_tmp12_, &_tmp13_, &_tmp14_);
	x = _tmp12_;
	y = _tmp13_;
	mask = _tmp14_;
	_g_object_unref0 (_tmp8_);
	_vala_ctrl = (mask & GDK_CONTROL_MASK) != 0;
	_vala_alt = (mask & GDK_MOD1_MASK) != 0;
	_vala_shift = (mask & GDK_SHIFT_MASK) != 0;
	_vala_super = (mask & GDK_MOD4_MASK) != 0;
	result = TRUE;
	_g_object_unref0 (seat);
	if (ctrl) {
		*ctrl = _vala_ctrl;
	}
	if (alt) {
		*alt = _vala_alt;
	}
	if (shift) {
		*shift = _vala_shift;
	}
	if (super) {
		*super = _vala_super;
	}
	return result;
}

static void
page_update_modifiers (Page* self)
{
	gboolean ctrl_currently_pressed = FALSE;
	gboolean alt_currently_pressed = FALSE;
	gboolean shift_currently_pressed = FALSE;
	gboolean super_currently_pressed = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp7_ = FALSE;
	gboolean _tmp9_ = FALSE;
	gboolean _tmp11_ = FALSE;
	g_return_if_fail (IS_PAGE (self));
	_tmp4_ = page_get_modifiers (self, &_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_);
	ctrl_currently_pressed = _tmp0_;
	alt_currently_pressed = _tmp1_;
	shift_currently_pressed = _tmp2_;
	super_currently_pressed = _tmp3_;
	if (!_tmp4_) {
		return;
	}
	if (self->priv->ctrl_pressed) {
		_tmp5_ = !ctrl_currently_pressed;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		page_on_ctrl_released (self, NULL);
	} else {
		gboolean _tmp6_ = FALSE;
		if (!self->priv->ctrl_pressed) {
			_tmp6_ = ctrl_currently_pressed;
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			page_on_ctrl_pressed (self, NULL);
		}
	}
	if (self->priv->alt_pressed) {
		_tmp7_ = !alt_currently_pressed;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		page_on_alt_released (self, NULL);
	} else {
		gboolean _tmp8_ = FALSE;
		if (!self->priv->alt_pressed) {
			_tmp8_ = alt_currently_pressed;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			page_on_alt_pressed (self, NULL);
		}
	}
	if (self->priv->shift_pressed) {
		_tmp9_ = !shift_currently_pressed;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		page_on_shift_released (self, NULL);
	} else {
		gboolean _tmp10_ = FALSE;
		if (!self->priv->shift_pressed) {
			_tmp10_ = shift_currently_pressed;
		} else {
			_tmp10_ = FALSE;
		}
		if (_tmp10_) {
			page_on_shift_pressed (self, NULL);
		}
	}
	if (self->priv->super_pressed) {
		_tmp11_ = !super_currently_pressed;
	} else {
		_tmp11_ = FALSE;
	}
	if (_tmp11_) {
		page_on_super_released (self, NULL);
	} else {
		gboolean _tmp12_ = FALSE;
		if (!self->priv->super_pressed) {
			_tmp12_ = super_currently_pressed;
		} else {
			_tmp12_ = FALSE;
		}
		if (_tmp12_) {
			page_on_super_pressed (self, NULL);
		}
	}
	self->priv->ctrl_pressed = ctrl_currently_pressed;
	self->priv->alt_pressed = alt_currently_pressed;
	self->priv->shift_pressed = shift_currently_pressed;
	self->priv->super_pressed = super_currently_pressed;
}

PageWindow*
page_get_page_window (Page* self)
{
	GtkWidget* p = NULL;
	GtkContainer* _tmp0_;
	GtkContainer* _tmp1_;
	GtkWidget* _tmp2_;
	PageWindow* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_tmp0_ = gtk_widget_get_parent (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget));
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, gtk_widget_get_type (), GtkWidget));
	p = _tmp2_;
	while (TRUE) {
		GtkWidget* _tmp3_;
		GtkWidget* _tmp4_;
		GtkWidget* _tmp7_;
		GtkContainer* _tmp8_;
		GtkContainer* _tmp9_;
		GtkWidget* _tmp10_;
		_tmp3_ = p;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = p;
		if (IS_PAGE_WINDOW (_tmp4_)) {
			GtkWidget* _tmp5_;
			PageWindow* _tmp6_;
			_tmp5_ = p;
			_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_PAGE_WINDOW, PageWindow));
			result = _tmp6_;
			_g_object_unref0 (p);
			return result;
		}
		_tmp7_ = p;
		_tmp8_ = gtk_widget_get_parent (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, gtk_widget_get_type (), GtkWidget));
		_g_object_unref0 (p);
		p = _tmp10_;
	}
	result = NULL;
	_g_object_unref0 (p);
	return result;
}

CommandManager*
page_get_command_manager (Page* self)
{
	CommandManager* _tmp0_;
	CommandManager* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_tmp0_ = app_window_get_command_manager ();
	result = _tmp0_;
	return result;
}

static void
page_real_add_actions (Page* self,
                       GActionMap* map)
{
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (map, g_action_map_get_type ()));
}

void
page_add_actions (Page* self,
                  GActionMap* map)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->add_actions) {
		_klass_->add_actions (self, map);
	}
}

static void
page_real_remove_actions (Page* self,
                          GActionMap* map)
{
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (map, g_action_map_get_type ()));
}

void
page_remove_actions (Page* self,
                     GActionMap* map)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->remove_actions) {
		_klass_->remove_actions (self, map);
	}
}

static gboolean
_variant_get2 (GVariant* value)
{
	return g_variant_get_boolean (value);
}

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

void
page_on_action_toggle (Page* self,
                       GAction* action,
                       GVariant* value)
{
	GVariant* new_state = NULL;
	GVariant* _tmp0_;
	GVariant* _tmp1_;
	gboolean _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_action_get_type ()));
	_tmp0_ = g_action_get_state (action);
	_tmp1_ = _tmp0_;
	_tmp2_ = _variant_get2 (_tmp1_);
	_tmp3_ = _variant_new19 (!_tmp2_);
	_tmp4_ = _tmp3_;
	_g_variant_unref0 (_tmp1_);
	new_state = _tmp4_;
	g_action_change_state (action, new_state);
	_g_variant_unref0 (new_state);
}

void
page_on_action_radio (Page* self,
                      GAction* action,
                      GVariant* value)
{
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (action, g_action_get_type ()));
	g_action_change_state (action, value);
}

static void
page_add_ui (Page* self)
{
	GeeList* ui_filenames = NULL;
	GeeArrayList* _tmp0_;
	GeeList* _tmp1_;
	GeeList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	g_return_if_fail (IS_PAGE (self));
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
	ui_filenames = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_LIST, GeeList);
	_tmp1_ = ui_filenames;
	page_init_collect_ui_filenames (self, _tmp1_);
	_tmp2_ = ui_filenames;
	_tmp3_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GEE_TYPE_COLLECTION, GeeCollection));
	_tmp4_ = _tmp3_;
	if (_tmp4_ == 0) {
		gchar* _tmp5_;
		gchar* _tmp6_;
		_tmp5_ = page_get_page_name (self);
		_tmp6_ = _tmp5_;
		g_message ("Page.vala:495: No UI file specified for %s", _tmp6_);
		_g_free0 (_tmp6_);
	}
	{
		GeeList* _ui_filename_list = NULL;
		GeeList* _tmp7_;
		gint _ui_filename_size = 0;
		GeeList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gint _ui_filename_index = 0;
		_tmp7_ = ui_filenames;
		_ui_filename_list = _tmp7_;
		_tmp8_ = _ui_filename_list;
		_tmp9_ = gee_collection_get_size (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GEE_TYPE_COLLECTION, GeeCollection));
		_tmp10_ = _tmp9_;
		_ui_filename_size = _tmp10_;
		_ui_filename_index = -1;
		while (TRUE) {
			gint _tmp11_;
			gint _tmp12_;
			gchar* ui_filename = NULL;
			GeeList* _tmp13_;
			gpointer _tmp14_;
			const gchar* _tmp15_;
			_ui_filename_index = _ui_filename_index + 1;
			_tmp11_ = _ui_filename_index;
			_tmp12_ = _ui_filename_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _ui_filename_list;
			_tmp14_ = gee_list_get (_tmp13_, _ui_filename_index);
			ui_filename = (gchar*) _tmp14_;
			_tmp15_ = ui_filename;
			page_init_load_ui (self, _tmp15_);
			_g_free0 (ui_filename);
		}
	}
	_g_object_unref0 (ui_filenames);
}

void
page_init_toolbar (Page* self,
                   const gchar* path)
{
	gchar* _tmp0_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (path != NULL);
	_tmp0_ = g_strdup (path);
	_g_free0 (self->priv->toolbar_path);
	self->priv->toolbar_path = _tmp0_;
}

static void
_page_on_update_actions_view_collection_items_state_changed (ViewCollection* _sender,
                                                             GeeIterable* changed,
                                                             gpointer self)
{
	page_on_update_actions ((Page*) self);
}

static void
_page_on_update_actions_view_collection_selection_group_altered (ViewCollection* _sender,
                                                                 gpointer self)
{
	page_on_update_actions ((Page*) self);
}

static void
_page_on_update_actions_view_collection_items_visibility_changed (ViewCollection* _sender,
                                                                  GeeCollection* changed,
                                                                  gpointer self)
{
	page_on_update_actions ((Page*) self);
}

static void
_page_on_update_actions_data_collection_contents_altered (DataCollection* _sender,
                                                          GeeIterable* added,
                                                          GeeIterable* removed,
                                                          gpointer self)
{
	page_on_update_actions ((Page*) self);
}

static void
page_attach_view_signals (Page* self)
{
	gint selected_count = 0;
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	gint _tmp2_;
	gint count = 0;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	gint _tmp5_;
	ViewCollection* _tmp6_;
	ViewCollection* _tmp7_;
	ViewCollection* _tmp8_;
	ViewCollection* _tmp9_;
	ViewCollection* _tmp10_;
	ViewCollection* _tmp11_;
	ViewCollection* _tmp12_;
	ViewCollection* _tmp13_;
	g_return_if_fail (IS_PAGE (self));
	if (self->priv->are_actions_attached) {
		return;
	}
	_tmp0_ = page_get_view (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = view_collection_get_selected_count (_tmp1_);
	_data_collection_unref0 (_tmp1_);
	selected_count = _tmp2_;
	_tmp3_ = page_get_view (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_DATA_COLLECTION, DataCollection));
	_data_collection_unref0 (_tmp4_);
	count = _tmp5_;
	page_init_actions (self, selected_count, count);
	page_update_actions (self, selected_count, count);
	_tmp6_ = page_get_view (self);
	_tmp7_ = _tmp6_;
	g_signal_connect_object (_tmp7_, "items-state-changed", (GCallback) _page_on_update_actions_view_collection_items_state_changed, self, 0);
	_data_collection_unref0 (_tmp7_);
	_tmp8_ = page_get_view (self);
	_tmp9_ = _tmp8_;
	g_signal_connect_object (_tmp9_, "selection-group-altered", (GCallback) _page_on_update_actions_view_collection_selection_group_altered, self, 0);
	_data_collection_unref0 (_tmp9_);
	_tmp10_ = page_get_view (self);
	_tmp11_ = _tmp10_;
	g_signal_connect_object (_tmp11_, "items-visibility-changed", (GCallback) _page_on_update_actions_view_collection_items_visibility_changed, self, 0);
	_data_collection_unref0 (_tmp11_);
	_tmp12_ = page_get_view (self);
	_tmp13_ = _tmp12_;
	g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_DATA_COLLECTION, DataCollection), "contents-altered", (GCallback) _page_on_update_actions_data_collection_contents_altered, self, 0);
	_data_collection_unref0 (_tmp13_);
	self->priv->are_actions_attached = TRUE;
}

static void
page_detach_view_signals (Page* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	guint _tmp2_;
	ViewCollection* _tmp3_;
	ViewCollection* _tmp4_;
	guint _tmp5_;
	ViewCollection* _tmp6_;
	ViewCollection* _tmp7_;
	guint _tmp8_;
	ViewCollection* _tmp9_;
	ViewCollection* _tmp10_;
	guint _tmp11_;
	g_return_if_fail (IS_PAGE (self));
	if (!self->priv->are_actions_attached) {
		return;
	}
	_tmp0_ = page_get_view (self);
	_tmp1_ = _tmp0_;
	g_signal_parse_name ("items-state-changed", TYPE_VIEW_COLLECTION, &_tmp2_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp1_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp2_, 0, NULL, (GCallback) _page_on_update_actions_view_collection_items_state_changed, self);
	_data_collection_unref0 (_tmp1_);
	_tmp3_ = page_get_view (self);
	_tmp4_ = _tmp3_;
	g_signal_parse_name ("selection-group-altered", TYPE_VIEW_COLLECTION, &_tmp5_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp4_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp5_, 0, NULL, (GCallback) _page_on_update_actions_view_collection_selection_group_altered, self);
	_data_collection_unref0 (_tmp4_);
	_tmp6_ = page_get_view (self);
	_tmp7_ = _tmp6_;
	g_signal_parse_name ("items-visibility-changed", TYPE_VIEW_COLLECTION, &_tmp8_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (_tmp7_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp8_, 0, NULL, (GCallback) _page_on_update_actions_view_collection_items_visibility_changed, self);
	_data_collection_unref0 (_tmp7_);
	_tmp9_ = page_get_view (self);
	_tmp10_ = _tmp9_;
	g_signal_parse_name ("contents-altered", TYPE_DATA_COLLECTION, &_tmp11_, NULL, FALSE);
	g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_DATA_COLLECTION, DataCollection), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp11_, 0, NULL, (GCallback) _page_on_update_actions_data_collection_contents_altered, self);
	_data_collection_unref0 (_tmp10_);
	self->priv->are_actions_attached = FALSE;
}

static void
_page_on_update_actions_on_idle_one_shot_callback (gpointer self)
{
	page_on_update_actions_on_idle ((Page*) self);
}

static void
page_on_update_actions (Page* self)
{
	OneShotScheduler* _tmp0_;
	OneShotScheduler* _tmp6_;
	g_return_if_fail (IS_PAGE (self));
	_tmp0_ = self->priv->update_actions_scheduler;
	if (_tmp0_ == NULL) {
		gchar* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		OneShotScheduler* _tmp5_;
		_tmp1_ = page_get_page_name (self);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strdup_printf ("Update actions scheduler for %s", _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = one_shot_scheduler_new (_tmp4_, _page_on_update_actions_on_idle_one_shot_callback, self);
		_one_shot_scheduler_unref0 (self->priv->update_actions_scheduler);
		self->priv->update_actions_scheduler = _tmp5_;
		_g_free0 (_tmp4_);
		_g_free0 (_tmp2_);
	}
	_tmp6_ = self->priv->update_actions_scheduler;
	one_shot_scheduler_at_priority_idle (_tmp6_, G_PRIORITY_LOW);
}

static void
page_on_update_actions_on_idle (Page* self)
{
	ViewCollection* _tmp0_;
	ViewCollection* _tmp1_;
	ViewCollection* _tmp2_;
	ViewCollection* _tmp3_;
	g_return_if_fail (IS_PAGE (self));
	if (self->priv->is_destroyed) {
		return;
	}
	if (!self->in_view) {
		return;
	}
	_tmp0_ = page_get_view (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = page_get_view (self);
	_tmp3_ = _tmp2_;
	page_update_actions (self, view_collection_get_selected_count (_tmp1_), data_collection_get_count (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_DATA_COLLECTION, DataCollection)));
	_data_collection_unref0 (_tmp3_);
	_data_collection_unref0 (_tmp1_);
}

static void
page_init_load_ui (Page* self,
                   const gchar* ui_filename)
{
	gchar* ui_resource = NULL;
	gchar* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (ui_filename != NULL);
	_tmp0_ = resources_get_ui (ui_filename);
	ui_resource = _tmp0_;
	{
		GtkBuilder* _tmp1_;
		_tmp1_ = self->builder;
		gtk_builder_add_from_resource (_tmp1_, ui_resource, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		self->priv->menubar_injected = FALSE;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		Application* _tmp6_;
		Application* _tmp7_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = err;
		_tmp3_ = _tmp2_->message;
		_tmp4_ = g_strdup_printf ("Error loading UI resource %s: %s", ui_resource, _tmp3_);
		_tmp5_ = _tmp4_;
		app_window_error_message (_tmp5_, NULL);
		_g_free0 (_tmp5_);
		_tmp6_ = application_get_instance ();
		_tmp7_ = _tmp6_;
		application_panic (_tmp7_);
		_application_unref0 (_tmp7_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (ui_resource);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_free0 (ui_resource);
}

static void
page_real_init_collect_ui_filenames (Page* self,
                                     GeeList* ui_filenames)
{
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (ui_filenames, GEE_TYPE_LIST));
}

void
page_init_collect_ui_filenames (Page* self,
                                GeeList* ui_filenames)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->init_collect_ui_filenames) {
		_klass_->init_collect_ui_filenames (self, ui_filenames);
	}
}

static InjectionGroup**
page_real_init_collect_injection_groups (Page* self,
                                         gint* result_length1)
{
	InjectionGroup** _tmp0_;
	InjectionGroup** _tmp1_;
	gint _tmp1__length1;
	InjectionGroup** result;
	_tmp0_ = g_new0 (InjectionGroup*, 0 + 1);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

InjectionGroup**
page_init_collect_injection_groups (Page* self,
                                    gint* result_length1)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->init_collect_injection_groups) {
		return _klass_->init_collect_injection_groups (self, result_length1);
	}
	return NULL;
}

static void
page_real_init_actions (Page* self,
                        gint selected_count,
                        gint count)
{
}

void
page_init_actions (Page* self,
                   gint selected_count,
                   gint count)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->init_actions) {
		_klass_->init_actions (self, selected_count, count);
	}
}

static void
page_real_update_actions (Page* self,
                          gint selected_count,
                          gint count)
{
}

void
page_update_actions (Page* self,
                     gint selected_count,
                     gint count)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->update_actions) {
		_klass_->update_actions (self, selected_count, count);
	}
}

gboolean
page_get_event_source_pointer (Page* self,
                               gint* x,
                               gint* y,
                               GdkModifierType* mask)
{
	gint _vala_x = 0;
	gint _vala_y = 0;
	GdkModifierType _vala_mask = 0U;
	GtkWidget* _tmp0_;
	GdkSeat* seat = NULL;
	GdkDisplay* _tmp1_;
	GdkSeat* _tmp2_;
	GdkSeat* _tmp3_;
	GtkWidget* _tmp4_;
	GdkWindow* _tmp5_;
	GdkSeat* _tmp6_;
	GdkDevice* _tmp7_;
	gint _tmp8_ = 0;
	gint _tmp9_ = 0;
	GdkModifierType _tmp10_ = 0U;
	gboolean _tmp11_ = FALSE;
	GdkPoint _tmp12_;
	GdkPoint _tmp14_;
	GdkPoint _tmp15_;
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_tmp0_ = self->priv->event_source;
	if (_tmp0_ == NULL) {
		_vala_x = 0;
		_vala_y = 0;
		_vala_mask = 0;
		result = FALSE;
		if (x) {
			*x = _vala_x;
		}
		if (y) {
			*y = _vala_y;
		}
		if (mask) {
			*mask = _vala_mask;
		}
		return result;
	}
	_tmp1_ = gdk_display_get_default ();
	_tmp2_ = gdk_display_get_default_seat (_tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	seat = _tmp3_;
	_tmp4_ = self->priv->event_source;
	_tmp5_ = gtk_widget_get_window (_tmp4_);
	_tmp6_ = seat;
	_tmp7_ = gdk_seat_get_pointer (_tmp6_);
	gdk_window_get_device_position (_tmp5_, _tmp7_, &_tmp8_, &_tmp9_, &_tmp10_);
	_vala_x = _tmp8_;
	_vala_y = _tmp9_;
	_vala_mask = _tmp10_;
	_tmp12_ = self->priv->last_down;
	if (_tmp12_.x < 0) {
		_tmp11_ = TRUE;
	} else {
		GdkPoint _tmp13_;
		_tmp13_ = self->priv->last_down;
		_tmp11_ = _tmp13_.y < 0;
	}
	if (_tmp11_) {
		result = TRUE;
		_g_object_unref0 (seat);
		if (x) {
			*x = _vala_x;
		}
		if (y) {
			*y = _vala_y;
		}
		if (mask) {
			*mask = _vala_mask;
		}
		return result;
	}
	_tmp14_ = self->priv->last_down;
	if (abs (_vala_x - _tmp14_.x) >= 0x7FFF) {
		_vala_x = _vala_x + 0xFFFF;
	}
	_tmp15_ = self->priv->last_down;
	if (abs (_vala_y - _tmp15_.y) >= 0x7FFF) {
		_vala_y = _vala_y + 0xFFFF;
	}
	result = TRUE;
	_g_object_unref0 (seat);
	if (x) {
		*x = _vala_x;
	}
	if (y) {
		*y = _vala_y;
	}
	if (mask) {
		*mask = _vala_mask;
	}
	return result;
}

static gboolean
page_real_on_left_click (Page* self,
                         GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_left_click (Page* self,
                    GdkEventButton* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_left_click) {
		return _klass_->on_left_click (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_middle_click (Page* self,
                           GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_middle_click (Page* self,
                      GdkEventButton* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_middle_click) {
		return _klass_->on_middle_click (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_right_click (Page* self,
                          GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_right_click (Page* self,
                     GdkEventButton* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_right_click) {
		return _klass_->on_right_click (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_left_released (Page* self,
                            GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_left_released (Page* self,
                       GdkEventButton* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_left_released) {
		return _klass_->on_left_released (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_middle_released (Page* self,
                              GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_middle_released (Page* self,
                         GdkEventButton* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_middle_released) {
		return _klass_->on_middle_released (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_right_released (Page* self,
                             GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_right_released (Page* self,
                        GdkEventButton* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_right_released) {
		return _klass_->on_right_released (self, event);
	}
	return FALSE;
}

static gboolean
page_on_button_pressed_internal (Page* self,
                                 GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	switch (event->button) {
		case 1:
		{
			GtkWidget* _tmp0_;
			_tmp0_ = self->priv->event_source;
			if (_tmp0_ != NULL) {
				GtkWidget* _tmp1_;
				_tmp1_ = self->priv->event_source;
				gtk_widget_grab_focus (_tmp1_);
			}
			self->priv->last_down.x = (gint) event->x;
			self->priv->last_down.y = (gint) event->y;
			result = page_on_left_click (self, event);
			return result;
		}
		case 2:
		{
			result = page_on_middle_click (self, event);
			return result;
		}
		case 3:
		{
			result = page_on_right_click (self, event);
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

static gboolean
page_on_button_released_internal (Page* self,
                                  GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	switch (event->button) {
		case 1:
		{
			GdkPoint _tmp0_ = {0};
			_tmp0_.x = -1;
			_tmp0_.y = -1;
			self->priv->last_down = _tmp0_;
			result = page_on_left_released (self, event);
			return result;
		}
		case 2:
		{
			result = page_on_middle_released (self, event);
			return result;
		}
		case 3:
		{
			result = page_on_right_released (self, event);
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

static gboolean
page_real_on_ctrl_pressed (Page* self,
                           GdkEventKey* event)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_ctrl_pressed (Page* self,
                      GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_ctrl_pressed) {
		return _klass_->on_ctrl_pressed (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_ctrl_released (Page* self,
                            GdkEventKey* event)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_ctrl_released (Page* self,
                       GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_ctrl_released) {
		return _klass_->on_ctrl_released (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_alt_pressed (Page* self,
                          GdkEventKey* event)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_alt_pressed (Page* self,
                     GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_alt_pressed) {
		return _klass_->on_alt_pressed (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_alt_released (Page* self,
                           GdkEventKey* event)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_alt_released (Page* self,
                      GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_alt_released) {
		return _klass_->on_alt_released (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_shift_pressed (Page* self,
                            GdkEventKey* event)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_shift_pressed (Page* self,
                       GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_shift_pressed) {
		return _klass_->on_shift_pressed (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_shift_released (Page* self,
                             GdkEventKey* event)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_shift_released (Page* self,
                        GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_shift_released) {
		return _klass_->on_shift_released (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_super_pressed (Page* self,
                            GdkEventKey* event)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_super_pressed (Page* self,
                       GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_super_pressed) {
		return _klass_->on_super_pressed (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_super_released (Page* self,
                             GdkEventKey* event)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_super_released (Page* self,
                        GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_super_released) {
		return _klass_->on_super_released (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_app_key_pressed (Page* self,
                              GdkEventKey* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_app_key_pressed (Page* self,
                         GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_app_key_pressed) {
		return _klass_->on_app_key_pressed (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_app_key_released (Page* self,
                               GdkEventKey* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_app_key_released (Page* self,
                          GdkEventKey* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_app_key_released) {
		return _klass_->on_app_key_released (self, event);
	}
	return FALSE;
}

gboolean
page_notify_app_key_pressed (Page* self,
                             GdkEventKey* event)
{
	gboolean ctrl_currently_pressed = FALSE;
	gboolean alt_currently_pressed = FALSE;
	gboolean shift_currently_pressed = FALSE;
	gboolean super_currently_pressed = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GQuark _tmp7_ = 0U;
	static GQuark _tmp6_label0 = 0;
	static GQuark _tmp6_label1 = 0;
	static GQuark _tmp6_label2 = 0;
	static GQuark _tmp6_label3 = 0;
	static GQuark _tmp6_label4 = 0;
	static GQuark _tmp6_label5 = 0;
	static GQuark _tmp6_label6 = 0;
	static GQuark _tmp6_label7 = 0;
	static GQuark _tmp6_label8 = 0;
	static GQuark _tmp6_label9 = 0;
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	page_get_modifiers (self, &_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_);
	ctrl_currently_pressed = _tmp0_;
	alt_currently_pressed = _tmp1_;
	shift_currently_pressed = _tmp2_;
	super_currently_pressed = _tmp3_;
	_tmp4_ = gdk_keyval_name (event->keyval);
	_tmp5_ = _tmp4_;
	_tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
	if ((_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("Control_L")))) || (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("Control_R"))))) {
		switch (0) {
			default:
			{
				gboolean _tmp8_ = FALSE;
				if (!ctrl_currently_pressed) {
					_tmp8_ = TRUE;
				} else {
					_tmp8_ = self->priv->ctrl_pressed;
				}
				if (_tmp8_) {
					result = FALSE;
					return result;
				}
				self->priv->ctrl_pressed = TRUE;
				result = page_on_ctrl_pressed (self, event);
				return result;
			}
		}
	} else if ((((_tmp7_ == ((0 != _tmp6_label2) ? _tmp6_label2 : (_tmp6_label2 = g_quark_from_static_string ("Meta_L")))) || (_tmp7_ == ((0 != _tmp6_label3) ? _tmp6_label3 : (_tmp6_label3 = g_quark_from_static_string ("Meta_R"))))) || (_tmp7_ == ((0 != _tmp6_label4) ? _tmp6_label4 : (_tmp6_label4 = g_quark_from_static_string ("Alt_L"))))) || (_tmp7_ == ((0 != _tmp6_label5) ? _tmp6_label5 : (_tmp6_label5 = g_quark_from_static_string ("Alt_R"))))) {
		switch (0) {
			default:
			{
				gboolean _tmp9_ = FALSE;
				if (!alt_currently_pressed) {
					_tmp9_ = TRUE;
				} else {
					_tmp9_ = self->priv->alt_pressed;
				}
				if (_tmp9_) {
					result = FALSE;
					return result;
				}
				self->priv->alt_pressed = TRUE;
				result = page_on_alt_pressed (self, event);
				return result;
			}
		}
	} else if ((_tmp7_ == ((0 != _tmp6_label6) ? _tmp6_label6 : (_tmp6_label6 = g_quark_from_static_string ("Shift_L")))) || (_tmp7_ == ((0 != _tmp6_label7) ? _tmp6_label7 : (_tmp6_label7 = g_quark_from_static_string ("Shift_R"))))) {
		switch (0) {
			default:
			{
				gboolean _tmp10_ = FALSE;
				if (!shift_currently_pressed) {
					_tmp10_ = TRUE;
				} else {
					_tmp10_ = self->priv->shift_pressed;
				}
				if (_tmp10_) {
					result = FALSE;
					return result;
				}
				self->priv->shift_pressed = TRUE;
				result = page_on_shift_pressed (self, event);
				return result;
			}
		}
	} else if ((_tmp7_ == ((0 != _tmp6_label8) ? _tmp6_label8 : (_tmp6_label8 = g_quark_from_static_string ("Super_L")))) || (_tmp7_ == ((0 != _tmp6_label9) ? _tmp6_label9 : (_tmp6_label9 = g_quark_from_static_string ("Super_R"))))) {
		switch (0) {
			default:
			{
				gboolean _tmp11_ = FALSE;
				if (!super_currently_pressed) {
					_tmp11_ = TRUE;
				} else {
					_tmp11_ = self->priv->super_pressed;
				}
				if (_tmp11_) {
					result = FALSE;
					return result;
				}
				self->priv->super_pressed = TRUE;
				result = page_on_super_pressed (self, event);
				return result;
			}
		}
	}
	result = page_on_app_key_pressed (self, event);
	return result;
}

gboolean
page_notify_app_key_released (Page* self,
                              GdkEventKey* event)
{
	gboolean ctrl_currently_pressed = FALSE;
	gboolean alt_currently_pressed = FALSE;
	gboolean shift_currently_pressed = FALSE;
	gboolean super_currently_pressed = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GQuark _tmp7_ = 0U;
	static GQuark _tmp6_label0 = 0;
	static GQuark _tmp6_label1 = 0;
	static GQuark _tmp6_label2 = 0;
	static GQuark _tmp6_label3 = 0;
	static GQuark _tmp6_label4 = 0;
	static GQuark _tmp6_label5 = 0;
	static GQuark _tmp6_label6 = 0;
	static GQuark _tmp6_label7 = 0;
	static GQuark _tmp6_label8 = 0;
	static GQuark _tmp6_label9 = 0;
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	page_get_modifiers (self, &_tmp0_, &_tmp1_, &_tmp2_, &_tmp3_);
	ctrl_currently_pressed = _tmp0_;
	alt_currently_pressed = _tmp1_;
	shift_currently_pressed = _tmp2_;
	super_currently_pressed = _tmp3_;
	_tmp4_ = gdk_keyval_name (event->keyval);
	_tmp5_ = _tmp4_;
	_tmp7_ = (NULL == _tmp5_) ? 0 : g_quark_from_string (_tmp5_);
	if ((_tmp7_ == ((0 != _tmp6_label0) ? _tmp6_label0 : (_tmp6_label0 = g_quark_from_static_string ("Control_L")))) || (_tmp7_ == ((0 != _tmp6_label1) ? _tmp6_label1 : (_tmp6_label1 = g_quark_from_static_string ("Control_R"))))) {
		switch (0) {
			default:
			{
				gboolean _tmp8_ = FALSE;
				if (ctrl_currently_pressed) {
					_tmp8_ = TRUE;
				} else {
					_tmp8_ = !self->priv->ctrl_pressed;
				}
				if (_tmp8_) {
					result = FALSE;
					return result;
				}
				self->priv->ctrl_pressed = FALSE;
				result = page_on_ctrl_released (self, event);
				return result;
			}
		}
	} else if ((((_tmp7_ == ((0 != _tmp6_label2) ? _tmp6_label2 : (_tmp6_label2 = g_quark_from_static_string ("Meta_L")))) || (_tmp7_ == ((0 != _tmp6_label3) ? _tmp6_label3 : (_tmp6_label3 = g_quark_from_static_string ("Meta_R"))))) || (_tmp7_ == ((0 != _tmp6_label4) ? _tmp6_label4 : (_tmp6_label4 = g_quark_from_static_string ("Alt_L"))))) || (_tmp7_ == ((0 != _tmp6_label5) ? _tmp6_label5 : (_tmp6_label5 = g_quark_from_static_string ("Alt_R"))))) {
		switch (0) {
			default:
			{
				gboolean _tmp9_ = FALSE;
				if (alt_currently_pressed) {
					_tmp9_ = TRUE;
				} else {
					_tmp9_ = !self->priv->alt_pressed;
				}
				if (_tmp9_) {
					result = FALSE;
					return result;
				}
				self->priv->alt_pressed = FALSE;
				result = page_on_alt_released (self, event);
				return result;
			}
		}
	} else if ((_tmp7_ == ((0 != _tmp6_label6) ? _tmp6_label6 : (_tmp6_label6 = g_quark_from_static_string ("Shift_L")))) || (_tmp7_ == ((0 != _tmp6_label7) ? _tmp6_label7 : (_tmp6_label7 = g_quark_from_static_string ("Shift_R"))))) {
		switch (0) {
			default:
			{
				gboolean _tmp10_ = FALSE;
				if (shift_currently_pressed) {
					_tmp10_ = TRUE;
				} else {
					_tmp10_ = !self->priv->shift_pressed;
				}
				if (_tmp10_) {
					result = FALSE;
					return result;
				}
				self->priv->shift_pressed = FALSE;
				result = page_on_shift_released (self, event);
				return result;
			}
		}
	} else if ((_tmp7_ == ((0 != _tmp6_label8) ? _tmp6_label8 : (_tmp6_label8 = g_quark_from_static_string ("Super_L")))) || (_tmp7_ == ((0 != _tmp6_label9) ? _tmp6_label9 : (_tmp6_label9 = g_quark_from_static_string ("Super_R"))))) {
		switch (0) {
			default:
			{
				gboolean _tmp11_ = FALSE;
				if (super_currently_pressed) {
					_tmp11_ = TRUE;
				} else {
					_tmp11_ = !self->priv->super_pressed;
				}
				if (_tmp11_) {
					result = FALSE;
					return result;
				}
				self->priv->super_pressed = FALSE;
				result = page_on_super_released (self, event);
				return result;
			}
		}
	}
	result = page_on_app_key_released (self, event);
	return result;
}

gboolean
page_notify_app_focus_in (Page* self,
                          GdkEventFocus* event)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	page_update_modifiers (self);
	result = FALSE;
	return result;
}

gboolean
page_notify_app_focus_out (Page* self,
                           GdkEventFocus* event)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

static void
page_real_on_move (Page* self,
                   GdkRectangle* rect)
{
	g_return_if_fail (rect != NULL);
}

void
page_on_move (Page* self,
              GdkRectangle* rect)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_move) {
		_klass_->on_move (self, rect);
	}
}

static void
page_real_on_move_start (Page* self,
                         GdkRectangle* rect)
{
	g_return_if_fail (rect != NULL);
}

void
page_on_move_start (Page* self,
                    GdkRectangle* rect)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_move_start) {
		_klass_->on_move_start (self, rect);
	}
}

static void
page_real_on_move_finished (Page* self,
                            GdkRectangle* rect)
{
	g_return_if_fail (rect != NULL);
}

void
page_on_move_finished (Page* self,
                       GdkRectangle* rect)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_move_finished) {
		_klass_->on_move_finished (self, rect);
	}
}

static void
page_real_on_resize (Page* self,
                     GdkRectangle* rect)
{
	g_return_if_fail (rect != NULL);
}

void
page_on_resize (Page* self,
                GdkRectangle* rect)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_resize) {
		_klass_->on_resize (self, rect);
	}
}

static void
page_real_on_resize_start (Page* self,
                           GdkRectangle* rect)
{
	g_return_if_fail (rect != NULL);
}

void
page_on_resize_start (Page* self,
                      GdkRectangle* rect)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_resize_start) {
		_klass_->on_resize_start (self, rect);
	}
}

static void
page_real_on_resize_finished (Page* self,
                              GdkRectangle* rect)
{
	g_return_if_fail (rect != NULL);
}

void
page_on_resize_finished (Page* self,
                         GdkRectangle* rect)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_resize_finished) {
		_klass_->on_resize_finished (self, rect);
	}
}

static gboolean
page_real_on_configure (Page* self,
                        GdkEventConfigure* event,
                        GdkRectangle* rect)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	g_return_val_if_fail (rect != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_configure (Page* self,
                   GdkEventConfigure* event,
                   GdkRectangle* rect)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_configure) {
		return _klass_->on_configure (self, event, rect);
	}
	return FALSE;
}

static gboolean
_page_check_configure_halted_gsource_func (gpointer self)
{
	gboolean result;
	result = page_check_configure_halted ((Page*) self);
	return result;
}

gboolean
page_notify_configure_event (Page* self,
                             GdkEventConfigure* event)
{
	GdkRectangle rect = {0};
	gboolean _tmp12_ = FALSE;
	GdkRectangle _tmp13_;
	GdkRectangle _tmp14_;
	gboolean _tmp18_ = FALSE;
	GdkRectangle _tmp19_;
	GdkRectangle _tmp20_;
	GdkRectangle _tmp24_;
	GdkRectangle _tmp25_;
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	memset (&rect, 0, sizeof (GdkRectangle));
	rect.x = event->x;
	rect.y = event->y;
	rect.width = event->width;
	rect.height = event->height;
	if (self->priv->last_configure_ms == ((gulong) 0)) {
		gboolean _tmp0_ = FALSE;
		GdkRectangle _tmp1_;
		GdkRectangle _tmp2_;
		gboolean _tmp6_ = FALSE;
		GdkRectangle _tmp7_;
		GdkRectangle _tmp8_;
		_tmp1_ = self->priv->last_position;
		_tmp2_ = rect;
		if (_tmp1_.x != _tmp2_.x) {
			_tmp0_ = TRUE;
		} else {
			GdkRectangle _tmp3_;
			GdkRectangle _tmp4_;
			_tmp3_ = self->priv->last_position;
			_tmp4_ = rect;
			_tmp0_ = _tmp3_.y != _tmp4_.y;
		}
		if (_tmp0_) {
			GdkRectangle _tmp5_;
			_tmp5_ = rect;
			page_on_move_start (self, &_tmp5_);
			self->priv->report_move_finished = TRUE;
		}
		_tmp7_ = self->priv->last_position;
		_tmp8_ = rect;
		if (_tmp7_.width != _tmp8_.width) {
			_tmp6_ = TRUE;
		} else {
			GdkRectangle _tmp9_;
			GdkRectangle _tmp10_;
			_tmp9_ = self->priv->last_position;
			_tmp10_ = rect;
			_tmp6_ = _tmp9_.height != _tmp10_.height;
		}
		if (_tmp6_) {
			GdkRectangle _tmp11_;
			_tmp11_ = rect;
			page_on_resize_start (self, &_tmp11_);
			self->priv->report_resize_finished = TRUE;
		}
		g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) (PAGE_CONSIDER_CONFIGURE_HALTED_MSEC / 8), _page_check_configure_halted_gsource_func, g_object_ref (self), g_object_unref);
	}
	_tmp13_ = self->priv->last_position;
	_tmp14_ = rect;
	if (_tmp13_.x != _tmp14_.x) {
		_tmp12_ = TRUE;
	} else {
		GdkRectangle _tmp15_;
		GdkRectangle _tmp16_;
		_tmp15_ = self->priv->last_position;
		_tmp16_ = rect;
		_tmp12_ = _tmp15_.y != _tmp16_.y;
	}
	if (_tmp12_) {
		GdkRectangle _tmp17_;
		_tmp17_ = rect;
		page_on_move (self, &_tmp17_);
	}
	_tmp19_ = self->priv->last_position;
	_tmp20_ = rect;
	if (_tmp19_.width != _tmp20_.width) {
		_tmp18_ = TRUE;
	} else {
		GdkRectangle _tmp21_;
		GdkRectangle _tmp22_;
		_tmp21_ = self->priv->last_position;
		_tmp22_ = rect;
		_tmp18_ = _tmp21_.height != _tmp22_.height;
	}
	if (_tmp18_) {
		GdkRectangle _tmp23_;
		_tmp23_ = rect;
		page_on_resize (self, &_tmp23_);
	}
	_tmp24_ = rect;
	self->priv->last_position = _tmp24_;
	self->priv->last_configure_ms = now_ms ();
	_tmp25_ = rect;
	result = page_on_configure (self, event, &_tmp25_);
	return result;
}

static gboolean
page_check_configure_halted (Page* self)
{
	GtkAllocation allocation = {0};
	GtkAllocation _tmp0_ = {0};
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	if (self->priv->is_destroyed) {
		result = FALSE;
		return result;
	}
	if ((now_ms () - self->priv->last_configure_ms) < ((gulong) PAGE_CONSIDER_CONFIGURE_HALTED_MSEC)) {
		result = TRUE;
		return result;
	}
	gtk_widget_get_allocation (G_TYPE_CHECK_INSTANCE_CAST (self, gtk_widget_get_type (), GtkWidget), &_tmp0_);
	allocation = _tmp0_;
	if (self->priv->report_move_finished) {
		GtkAllocation _tmp1_;
		GdkRectangle _tmp2_;
		_tmp1_ = allocation;
		_tmp2_ = (GdkRectangle) _tmp1_;
		page_on_move_finished (self, &_tmp2_);
	}
	if (self->priv->report_resize_finished) {
		GtkAllocation _tmp3_;
		GdkRectangle _tmp4_;
		_tmp3_ = allocation;
		_tmp4_ = (GdkRectangle) _tmp3_;
		page_on_resize_finished (self, &_tmp4_);
	}
	self->priv->last_configure_ms = (gulong) 0;
	self->priv->report_move_finished = FALSE;
	self->priv->report_resize_finished = FALSE;
	result = FALSE;
	return result;
}

static gboolean
page_real_on_motion (Page* self,
                     GdkEventMotion* event,
                     gint x,
                     gint y,
                     GdkModifierType mask)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	page_check_cursor_hiding (self);
	result = FALSE;
	return result;
}

gboolean
page_on_motion (Page* self,
                GdkEventMotion* event,
                gint x,
                gint y,
                GdkModifierType mask)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_motion) {
		return _klass_->on_motion (self, event, x, y, mask);
	}
	return FALSE;
}

static gboolean
page_real_on_leave_notify_event (Page* self)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_leave_notify_event (Page* self)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_leave_notify_event) {
		return _klass_->on_leave_notify_event (self);
	}
	return FALSE;
}

static gboolean
page_on_motion_internal (Page* self,
                         GdkEventMotion* event)
{
	gint x = 0;
	gint y = 0;
	GdkModifierType mask = 0U;
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	if (((gint) event->is_hint) == 1) {
		gint _tmp0_ = 0;
		gint _tmp1_ = 0;
		GdkModifierType _tmp2_ = 0U;
		page_get_event_source_pointer (self, &_tmp0_, &_tmp1_, &_tmp2_);
		x = _tmp0_;
		y = _tmp1_;
		mask = _tmp2_;
	} else {
		x = (gint) event->x;
		y = (gint) event->y;
		mask = event->state;
	}
	result = page_on_motion (self, event, x, y, mask);
	return result;
}

static gboolean
page_on_mousewheel_internal (Page* self,
                             GdkEventScroll* event)
{
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	switch (event->direction) {
		case GDK_SCROLL_UP:
		{
			result = page_on_mousewheel_up (self, event);
			return result;
		}
		case GDK_SCROLL_DOWN:
		{
			result = page_on_mousewheel_down (self, event);
			return result;
		}
		case GDK_SCROLL_LEFT:
		{
			result = page_on_mousewheel_left (self, event);
			return result;
		}
		case GDK_SCROLL_RIGHT:
		{
			result = page_on_mousewheel_right (self, event);
			return result;
		}
		case GDK_SCROLL_SMOOTH:
		{
			{
				gdouble dx = 0.0;
				gdouble dy = 0.0;
				gdouble _tmp0_ = 0.0;
				gdouble _tmp1_ = 0.0;
				gdk_event_get_scroll_deltas ((GdkEvent*) event, &_tmp0_, &_tmp1_);
				dx = _tmp0_;
				dy = _tmp1_;
				if (dy < ((-1.0) * self->wheel_factor)) {
					result = page_on_mousewheel_up (self, event);
					return result;
				} else {
					if (dy > self->wheel_factor) {
						result = page_on_mousewheel_down (self, event);
						return result;
					} else {
						if (dx < ((-1.0) * self->wheel_factor)) {
							result = page_on_mousewheel_left (self, event);
							return result;
						} else {
							if (dx > self->wheel_factor) {
								result = page_on_mousewheel_right (self, event);
								return result;
							} else {
								result = FALSE;
								return result;
							}
						}
					}
				}
			}
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

static gboolean
page_real_on_mousewheel_up (Page* self,
                            GdkEventScroll* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_mousewheel_up (Page* self,
                       GdkEventScroll* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_mousewheel_up) {
		return _klass_->on_mousewheel_up (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_mousewheel_down (Page* self,
                              GdkEventScroll* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_mousewheel_down (Page* self,
                         GdkEventScroll* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_mousewheel_down) {
		return _klass_->on_mousewheel_down (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_mousewheel_left (Page* self,
                              GdkEventScroll* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_mousewheel_left (Page* self,
                         GdkEventScroll* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_mousewheel_left) {
		return _klass_->on_mousewheel_left (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_mousewheel_right (Page* self,
                               GdkEventScroll* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_mousewheel_right (Page* self,
                          GdkEventScroll* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_mousewheel_right) {
		return _klass_->on_mousewheel_right (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_context_keypress (Page* self)
{
	gboolean result;
	result = FALSE;
	return result;
}

gboolean
page_on_context_keypress (Page* self)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_context_keypress) {
		return _klass_->on_context_keypress (self);
	}
	return FALSE;
}

static gboolean
page_real_on_context_buttonpress (Page* self,
                                  GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	result = FALSE;
	return result;
}

gboolean
page_on_context_buttonpress (Page* self,
                             GdkEventButton* event)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_context_buttonpress) {
		return _klass_->on_context_buttonpress (self, event);
	}
	return FALSE;
}

static gboolean
page_real_on_context_invoked (Page* self)
{
	gboolean result;
	result = TRUE;
	return result;
}

gboolean
page_on_context_invoked (Page* self)
{
	PageClass* _klass_;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->on_context_invoked) {
		return _klass_->on_context_invoked (self);
	}
	return FALSE;
}

gboolean
page_popup_context_menu (Page* self,
                         GtkMenu* context_menu,
                         GdkEventButton* event)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	g_return_val_if_fail ((context_menu == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (context_menu, gtk_menu_get_type ()), FALSE);
	if (context_menu == NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = !page_on_context_invoked (self);
	}
	if (_tmp0_) {
		result = FALSE;
		return result;
	}
	gtk_menu_popup_at_pointer (context_menu, (GdkEvent*) event);
	result = TRUE;
	return result;
}

void
page_on_event_source_realize (Page* self)
{
	GtkWidget* _tmp0_;
	GdkWindow* _tmp1_;
	GtkWidget* _tmp2_;
	GdkWindow* _tmp3_;
	GdkCursor* _tmp4_;
	GdkWindow* parent_window = NULL;
	GtkWidget* _tmp8_;
	GdkWindow* _tmp9_;
	GdkWindow* _tmp10_;
	GdkWindow* _tmp19_;
	g_return_if_fail (IS_PAGE (self));
	_tmp0_ = self->priv->event_source;
	_tmp1_ = gtk_widget_get_window (_tmp0_);
	_vala_assert (_tmp1_ != NULL, "event_source.get_window() != null");
	_tmp2_ = self->priv->event_source;
	_tmp3_ = gtk_widget_get_window (_tmp2_);
	_tmp4_ = gdk_window_get_cursor (_tmp3_);
	if (_tmp4_ != NULL) {
		GtkWidget* _tmp5_;
		GdkWindow* _tmp6_;
		GdkCursor* _tmp7_;
		_tmp5_ = self->priv->event_source;
		_tmp6_ = gtk_widget_get_window (_tmp5_);
		_tmp7_ = gdk_window_get_cursor (_tmp6_);
		self->priv->last_cursor = gdk_cursor_get_cursor_type (_tmp7_);
		return;
	}
	_tmp8_ = self->priv->event_source;
	_tmp9_ = gtk_widget_get_window (_tmp8_);
	_tmp10_ = _g_object_ref0 (_tmp9_);
	parent_window = _tmp10_;
	{
		gboolean _tmp11_ = FALSE;
		_tmp11_ = TRUE;
		while (TRUE) {
			GdkWindow* _tmp16_;
			GdkWindow* _tmp17_;
			GdkWindow* _tmp18_;
			if (!_tmp11_) {
				gboolean _tmp12_ = FALSE;
				GdkWindow* _tmp13_;
				_tmp13_ = parent_window;
				if (_tmp13_ != NULL) {
					GdkWindow* _tmp14_;
					GdkCursor* _tmp15_;
					_tmp14_ = parent_window;
					_tmp15_ = gdk_window_get_cursor (_tmp14_);
					_tmp12_ = _tmp15_ == NULL;
				} else {
					_tmp12_ = FALSE;
				}
				if (!_tmp12_) {
					break;
				}
			}
			_tmp11_ = FALSE;
			_tmp16_ = parent_window;
			_tmp17_ = gdk_window_get_parent (_tmp16_);
			_tmp18_ = _g_object_ref0 (_tmp17_);
			_g_object_unref0 (parent_window);
			parent_window = _tmp18_;
		}
	}
	_tmp19_ = parent_window;
	if (_tmp19_ != NULL) {
		GdkWindow* _tmp20_;
		GdkCursor* _tmp21_;
		_tmp20_ = parent_window;
		_tmp21_ = gdk_window_get_cursor (_tmp20_);
		self->priv->last_cursor = gdk_cursor_get_cursor_type (_tmp21_);
	}
	_g_object_unref0 (parent_window);
}

void
page_set_cursor_hide_time (Page* self,
                           gint hide_time)
{
	g_return_if_fail (IS_PAGE (self));
	self->priv->cursor_hide_msec = hide_time;
}

void
page_start_cursor_hiding (Page* self)
{
	g_return_if_fail (IS_PAGE (self));
	page_check_cursor_hiding (self);
}

void
page_stop_cursor_hiding (Page* self)
{
	g_return_if_fail (IS_PAGE (self));
	if (self->priv->last_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->last_timeout_id);
		self->priv->last_timeout_id = (guint) 0;
	}
}

void
page_suspend_cursor_hiding (Page* self)
{
	g_return_if_fail (IS_PAGE (self));
	self->priv->cursor_hide_time_cached = self->priv->cursor_hide_msec;
	if (self->priv->last_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->last_timeout_id);
		self->priv->last_timeout_id = (guint) 0;
	}
	self->priv->cursor_hide_msec = 0;
}

void
page_restore_cursor_hiding (Page* self)
{
	g_return_if_fail (IS_PAGE (self));
	self->priv->cursor_hide_msec = self->priv->cursor_hide_time_cached;
	page_check_cursor_hiding (self);
}

static void
page_real_set_page_cursor (Page* self,
                           GdkCursorType cursor_type)
{
	gboolean _tmp0_ = FALSE;
	self->priv->last_cursor = cursor_type;
	if (!self->priv->cursor_hidden) {
		GtkWidget* _tmp1_;
		_tmp1_ = self->priv->event_source;
		_tmp0_ = _tmp1_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GdkDisplay* display = NULL;
		GtkWidget* _tmp2_;
		GdkWindow* _tmp3_;
		GdkDisplay* _tmp4_;
		GdkDisplay* _tmp5_;
		GtkWidget* _tmp6_;
		GdkWindow* _tmp7_;
		GdkDisplay* _tmp8_;
		GdkCursor* _tmp9_;
		GdkCursor* _tmp10_;
		_tmp2_ = self->priv->event_source;
		_tmp3_ = gtk_widget_get_window (_tmp2_);
		_tmp4_ = gdk_window_get_display (_tmp3_);
		_tmp5_ = _g_object_ref0 (_tmp4_);
		display = _tmp5_;
		_tmp6_ = self->priv->event_source;
		_tmp7_ = gtk_widget_get_window (_tmp6_);
		_tmp8_ = display;
		_tmp9_ = gdk_cursor_new_for_display (_tmp8_, cursor_type);
		_tmp10_ = _tmp9_;
		gdk_window_set_cursor (_tmp7_, _tmp10_);
		_g_object_unref0 (_tmp10_);
		_g_object_unref0 (display);
	}
}

void
page_set_page_cursor (Page* self,
                      GdkCursorType cursor_type)
{
	PageClass* _klass_;
	g_return_if_fail (IS_PAGE (self));
	_klass_ = PAGE_GET_CLASS (self);
	if (_klass_->set_page_cursor) {
		_klass_->set_page_cursor (self, cursor_type);
	}
}

static gboolean
_page_on_hide_cursor_gsource_func (gpointer self)
{
	gboolean result;
	result = page_on_hide_cursor ((Page*) self);
	return result;
}

static void
page_check_cursor_hiding (Page* self)
{
	g_return_if_fail (IS_PAGE (self));
	if (self->priv->cursor_hidden) {
		self->priv->cursor_hidden = FALSE;
		page_set_page_cursor (self, self->priv->last_cursor);
	}
	if (self->priv->cursor_hide_msec != 0) {
		if (self->priv->last_timeout_id != ((guint) 0)) {
			g_source_remove (self->priv->last_timeout_id);
		}
		self->priv->last_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) self->priv->cursor_hide_msec, _page_on_hide_cursor_gsource_func, g_object_ref (self), g_object_unref);
	}
}

static gboolean
page_on_hide_cursor (Page* self)
{
	GtkWidget* _tmp0_;
	gboolean result;
	g_return_val_if_fail (IS_PAGE (self), FALSE);
	self->priv->cursor_hidden = TRUE;
	_tmp0_ = self->priv->event_source;
	if (_tmp0_ != NULL) {
		GdkDisplay* display = NULL;
		GtkWidget* _tmp1_;
		GdkWindow* _tmp2_;
		GdkDisplay* _tmp3_;
		GdkDisplay* _tmp4_;
		GtkWidget* _tmp5_;
		GdkWindow* _tmp6_;
		GdkDisplay* _tmp7_;
		GdkCursor* _tmp8_;
		GdkCursor* _tmp9_;
		_tmp1_ = self->priv->event_source;
		_tmp2_ = gtk_widget_get_window (_tmp1_);
		_tmp3_ = gdk_window_get_display (_tmp2_);
		_tmp4_ = _g_object_ref0 (_tmp3_);
		display = _tmp4_;
		_tmp5_ = self->priv->event_source;
		_tmp6_ = gtk_widget_get_window (_tmp5_);
		_tmp7_ = display;
		_tmp8_ = gdk_cursor_new_for_display (_tmp7_, GDK_BLANK_CURSOR);
		_tmp9_ = _tmp8_;
		gdk_window_set_cursor (_tmp6_, _tmp9_);
		_g_object_unref0 (_tmp9_);
		_g_object_unref0 (display);
	}
	self->priv->last_timeout_id = (guint) 0;
	result = FALSE;
	return result;
}

void
page_update_menu_item_label (Page* self,
                             const gchar* id,
                             const gchar* new_label)
{
	AppWindow* _tmp0_;
	AppWindow* _tmp1_;
	g_return_if_fail (IS_PAGE (self));
	g_return_if_fail (id != NULL);
	g_return_if_fail (new_label != NULL);
	_tmp0_ = app_window_get_instance ();
	_tmp1_ = _tmp0_;
	app_window_update_menu_item_label (_tmp1_, id, new_label);
	_g_object_unref0 (_tmp1_);
}

GMenuModel*
page_find_extension_point (Page* self,
                           GMenuModel* model,
                           const gchar* extension_point)
{
	gint items = 0;
	GMenuModel* section = NULL;
	GMenuModel* result;
	g_return_val_if_fail (IS_PAGE (self), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (model, g_menu_model_get_type ()), NULL);
	g_return_val_if_fail (extension_point != NULL, NULL);
	items = g_menu_model_get_n_items (model);
	section = NULL;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				gboolean _tmp2_ = FALSE;
				gchar* name = NULL;
				gchar* _tmp4_ = NULL;
				const gchar* _tmp5_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				if (i < items) {
					GMenuModel* _tmp3_;
					_tmp3_ = section;
					_tmp2_ = _tmp3_ == NULL;
				} else {
					_tmp2_ = FALSE;
				}
				if (!_tmp2_) {
					break;
				}
				name = NULL;
				g_menu_model_get_item_attribute (model, i, "id", "s", &_tmp4_, NULL);
				_g_free0 (name);
				name = _tmp4_;
				_tmp5_ = name;
				if (g_strcmp0 (_tmp5_, extension_point) == 0) {
					GMenuModel* _tmp6_;
					_tmp6_ = g_menu_model_get_item_link (model, i, G_MENU_LINK_SECTION);
					_g_object_unref0 (section);
					section = _tmp6_;
				} else {
					GMenuModel* subsection = NULL;
					GMenuModel* _tmp7_;
					GMenuModel* _tmp8_;
					gint sub_items = 0;
					GMenuModel* _tmp9_;
					_tmp7_ = g_menu_model_get_item_link (model, i, G_MENU_LINK_SECTION);
					subsection = _tmp7_;
					_tmp8_ = subsection;
					if (_tmp8_ == NULL) {
						_g_object_unref0 (subsection);
						_g_free0 (name);
						continue;
					}
					_tmp9_ = subsection;
					sub_items = g_menu_model_get_n_items (_tmp9_);
					{
						gint j = 0;
						j = 0;
						{
							gboolean _tmp10_ = FALSE;
							_tmp10_ = TRUE;
							while (TRUE) {
								gboolean _tmp12_ = FALSE;
								GMenuModel* submenu = NULL;
								GMenuModel* _tmp14_;
								GMenuModel* _tmp15_;
								GMenuModel* _tmp16_;
								if (!_tmp10_) {
									gint _tmp11_;
									_tmp11_ = j;
									j = _tmp11_ + 1;
								}
								_tmp10_ = FALSE;
								if (j < sub_items) {
									GMenuModel* _tmp13_;
									_tmp13_ = section;
									_tmp12_ = _tmp13_ == NULL;
								} else {
									_tmp12_ = FALSE;
								}
								if (!_tmp12_) {
									break;
								}
								_tmp14_ = subsection;
								_tmp15_ = g_menu_model_get_item_link (_tmp14_, j, G_MENU_LINK_SUBMENU);
								submenu = _tmp15_;
								_tmp16_ = submenu;
								if (_tmp16_ != NULL) {
									GMenuModel* _tmp17_;
									GMenuModel* _tmp18_;
									_tmp17_ = submenu;
									_tmp18_ = page_find_extension_point (self, _tmp17_, extension_point);
									_g_object_unref0 (section);
									section = _tmp18_;
								}
								_g_object_unref0 (submenu);
							}
						}
					}
					_g_object_unref0 (subsection);
				}
				_g_free0 (name);
			}
		}
	}
	result = section;
	return result;
}

static void
page_class_init (PageClass * klass,
                 gpointer klass_data)
{
	page_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &Page_private_offset);
	((GtkWidgetClass *) klass)->destroy = (void (*) (GtkWidget*)) page_real_destroy;
	((PageClass *) klass)->set_page_name = (void (*) (Page*, const gchar*)) page_real_set_page_name;
	((PageClass *) klass)->set_container = (void (*) (Page*, GtkWindow*)) page_real_set_container;
	((PageClass *) klass)->clear_container = (void (*) (Page*)) page_real_clear_container;
	((PageClass *) klass)->get_toolbar = (GtkToolbar* (*) (Page*)) page_real_get_toolbar;
	((PageClass *) klass)->get_page_context_menu = (GtkMenu* (*) (Page*)) page_real_get_page_context_menu;
	((PageClass *) klass)->switching_from = (void (*) (Page*)) page_real_switching_from;
	((PageClass *) klass)->switched_to = (void (*) (Page*)) page_real_switched_to;
	((PageClass *) klass)->ready = (void (*) (Page*)) page_real_ready;
	((PageClass *) klass)->switching_to_fullscreen = (void (*) (Page*, FullscreenWindow*)) page_real_switching_to_fullscreen;
	((PageClass *) klass)->returning_from_fullscreen = (void (*) (Page*, FullscreenWindow*)) page_real_returning_from_fullscreen;
	((PageClass *) klass)->add_actions = (void (*) (Page*, GActionMap*)) page_real_add_actions;
	((PageClass *) klass)->remove_actions = (void (*) (Page*, GActionMap*)) page_real_remove_actions;
	((PageClass *) klass)->init_collect_ui_filenames = (void (*) (Page*, GeeList*)) page_real_init_collect_ui_filenames;
	((PageClass *) klass)->init_collect_injection_groups = (InjectionGroup** (*) (Page*, gint*)) page_real_init_collect_injection_groups;
	((PageClass *) klass)->init_actions = (void (*) (Page*, gint, gint)) page_real_init_actions;
	((PageClass *) klass)->update_actions = (void (*) (Page*, gint, gint)) page_real_update_actions;
	((PageClass *) klass)->on_left_click = (gboolean (*) (Page*, GdkEventButton*)) page_real_on_left_click;
	((PageClass *) klass)->on_middle_click = (gboolean (*) (Page*, GdkEventButton*)) page_real_on_middle_click;
	((PageClass *) klass)->on_right_click = (gboolean (*) (Page*, GdkEventButton*)) page_real_on_right_click;
	((PageClass *) klass)->on_left_released = (gboolean (*) (Page*, GdkEventButton*)) page_real_on_left_released;
	((PageClass *) klass)->on_middle_released = (gboolean (*) (Page*, GdkEventButton*)) page_real_on_middle_released;
	((PageClass *) klass)->on_right_released = (gboolean (*) (Page*, GdkEventButton*)) page_real_on_right_released;
	((PageClass *) klass)->on_ctrl_pressed = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_ctrl_pressed;
	((PageClass *) klass)->on_ctrl_released = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_ctrl_released;
	((PageClass *) klass)->on_alt_pressed = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_alt_pressed;
	((PageClass *) klass)->on_alt_released = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_alt_released;
	((PageClass *) klass)->on_shift_pressed = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_shift_pressed;
	((PageClass *) klass)->on_shift_released = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_shift_released;
	((PageClass *) klass)->on_super_pressed = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_super_pressed;
	((PageClass *) klass)->on_super_released = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_super_released;
	((PageClass *) klass)->on_app_key_pressed = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_app_key_pressed;
	((PageClass *) klass)->on_app_key_released = (gboolean (*) (Page*, GdkEventKey*)) page_real_on_app_key_released;
	((PageClass *) klass)->on_move = (void (*) (Page*, GdkRectangle*)) page_real_on_move;
	((PageClass *) klass)->on_move_start = (void (*) (Page*, GdkRectangle*)) page_real_on_move_start;
	((PageClass *) klass)->on_move_finished = (void (*) (Page*, GdkRectangle*)) page_real_on_move_finished;
	((PageClass *) klass)->on_resize = (void (*) (Page*, GdkRectangle*)) page_real_on_resize;
	((PageClass *) klass)->on_resize_start = (void (*) (Page*, GdkRectangle*)) page_real_on_resize_start;
	((PageClass *) klass)->on_resize_finished = (void (*) (Page*, GdkRectangle*)) page_real_on_resize_finished;
	((PageClass *) klass)->on_configure = (gboolean (*) (Page*, GdkEventConfigure*, GdkRectangle*)) page_real_on_configure;
	((PageClass *) klass)->on_motion = (gboolean (*) (Page*, GdkEventMotion*, gint, gint, GdkModifierType)) page_real_on_motion;
	((PageClass *) klass)->on_leave_notify_event = (gboolean (*) (Page*)) page_real_on_leave_notify_event;
	((PageClass *) klass)->on_mousewheel_up = (gboolean (*) (Page*, GdkEventScroll*)) page_real_on_mousewheel_up;
	((PageClass *) klass)->on_mousewheel_down = (gboolean (*) (Page*, GdkEventScroll*)) page_real_on_mousewheel_down;
	((PageClass *) klass)->on_mousewheel_left = (gboolean (*) (Page*, GdkEventScroll*)) page_real_on_mousewheel_left;
	((PageClass *) klass)->on_mousewheel_right = (gboolean (*) (Page*, GdkEventScroll*)) page_real_on_mousewheel_right;
	((PageClass *) klass)->on_context_keypress = (gboolean (*) (Page*)) page_real_on_context_keypress;
	((PageClass *) klass)->on_context_buttonpress = (gboolean (*) (Page*, GdkEventButton*)) page_real_on_context_buttonpress;
	((PageClass *) klass)->on_context_invoked = (gboolean (*) (Page*)) page_real_on_context_invoked;
	((PageClass *) klass)->set_page_cursor = (void (*) (Page*, GdkCursorType)) page_real_set_page_cursor;
	G_OBJECT_CLASS (klass)->finalize = page_finalize;
}

static void
page_instance_init (Page * self,
                    gpointer klass)
{
	GtkBuilder* _tmp0_;
	self->priv = page_get_instance_private (self);
	_tmp0_ = gtk_builder_new ();
	self->builder = _tmp0_;
	self->in_view = FALSE;
	self->priv->view = NULL;
	self->priv->container = NULL;
	memset (&self->priv->last_position, 0, sizeof (GdkRectangle));
	self->priv->event_source = NULL;
	self->priv->last_configure_ms = (gulong) 0;
	self->priv->report_move_finished = FALSE;
	self->priv->report_resize_finished = FALSE;
	memset (&self->priv->last_down, 0, sizeof (GdkPoint));
	self->priv->is_destroyed = FALSE;
	self->priv->ctrl_pressed = FALSE;
	self->priv->alt_pressed = FALSE;
	self->priv->shift_pressed = FALSE;
	self->priv->super_pressed = FALSE;
	self->priv->last_cursor = GDK_LEFT_PTR;
	self->priv->cursor_hidden = FALSE;
	self->priv->cursor_hide_msec = 0;
	self->priv->last_timeout_id = (guint) 0;
	self->priv->cursor_hide_time_cached = 0;
	self->priv->are_actions_attached = FALSE;
	self->priv->update_actions_scheduler = NULL;
	self->wheel_factor = 0.0;
	self->modified_wheel_factor = 1.0;
	self->priv->menubar_injected = FALSE;
}

static void
page_finalize (GObject * obj)
{
	Page * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PAGE, Page);
	_g_object_unref0 (self->builder);
	_g_object_unref0 (self->toolbar);
	_g_free0 (self->priv->page_name);
	_data_collection_unref0 (self->priv->view);
	_g_object_unref0 (self->priv->container);
	_g_free0 (self->priv->toolbar_path);
	_g_object_unref0 (self->priv->event_source);
	_one_shot_scheduler_unref0 (self->priv->update_actions_scheduler);
	G_OBJECT_CLASS (page_parent_class)->finalize (obj);
}

static GType
page_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PageClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) page_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Page), 0, (GInstanceInitFunc) page_instance_init, NULL };
	GType page_type_id;
	page_type_id = g_type_register_static (gtk_scrolled_window_get_type (), "Page", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	Page_private_offset = g_type_add_instance_private (page_type_id, sizeof (PagePrivate));
	return page_type_id;
}

GType
page_get_type (void)
{
	static volatile gsize page_type_id__once = 0;
	if (g_once_init_enter (&page_type_id__once)) {
		GType page_type_id;
		page_type_id = page_get_type_once ();
		g_once_init_leave (&page_type_id__once, page_type_id);
	}
	return page_type_id__once;
}

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

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

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

