/* controller-navigation-policy.c generated by valac 0.56.19, the Vala compiler
 * generated from controller-navigation-policy.vala, do not modify */

#include "protonplus_core.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <gee.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_0_PROPERTY,
	PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_GENERATION_PROPERTY,
	PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_PAGE_ID_PROPERTY,
	PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_SURFACE_GENERATION_PROPERTY,
	PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_NUM_PROPERTIES
};
static GParamSpec* proton_plus_utils_controller_focus_restore_request_properties[PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

#define PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_HISTORY_ENTRY (proton_plus_utils_controller_focus_history_entry_get_type ())
#define PROTON_PLUS_UTILS_CONTROLLER_FOCUS_HISTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_HISTORY_ENTRY, ProtonPlusUtilsControllerFocusHistoryEntry))
#define PROTON_PLUS_UTILS_CONTROLLER_FOCUS_HISTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_HISTORY_ENTRY, ProtonPlusUtilsControllerFocusHistoryEntryClass))
#define PROTON_PLUS_UTILS_IS_CONTROLLER_FOCUS_HISTORY_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_HISTORY_ENTRY))
#define PROTON_PLUS_UTILS_IS_CONTROLLER_FOCUS_HISTORY_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_HISTORY_ENTRY))
#define PROTON_PLUS_UTILS_CONTROLLER_FOCUS_HISTORY_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_HISTORY_ENTRY, ProtonPlusUtilsControllerFocusHistoryEntryClass))

typedef struct _ProtonPlusUtilsControllerFocusHistoryEntry ProtonPlusUtilsControllerFocusHistoryEntry;
typedef struct _ProtonPlusUtilsControllerFocusHistoryEntryClass ProtonPlusUtilsControllerFocusHistoryEntryClass;
typedef struct _ProtonPlusUtilsControllerFocusHistoryEntryPrivate ProtonPlusUtilsControllerFocusHistoryEntryPrivate;
enum  {
	PROTON_PLUS_UTILS_CONTROLLER_FOCUS_HISTORY_ENTRY_0_PROPERTY,
	PROTON_PLUS_UTILS_CONTROLLER_FOCUS_HISTORY_ENTRY_NUM_PROPERTIES
};
static GParamSpec* proton_plus_utils_controller_focus_history_entry_properties[PROTON_PLUS_UTILS_CONTROLLER_FOCUS_HISTORY_ENTRY_NUM_PROPERTIES];
enum  {
	PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_POLICY_0_PROPERTY,
	PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_POLICY_NUM_PROPERTIES
};
static GParamSpec* proton_plus_utils_controller_navigation_policy_properties[PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_POLICY_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusUtilsControllerFocusRestoreRequestPrivate {
	guint64 _generation;
	gchar* _page_id;
	guint64 _surface_generation;
};

struct _ProtonPlusUtilsControllerFocusHistoryEntry {
	GObject parent_instance;
	ProtonPlusUtilsControllerFocusHistoryEntryPrivate * priv;
	GObject* target;
};

struct _ProtonPlusUtilsControllerFocusHistoryEntryClass {
	GObjectClass parent_class;
};

struct _ProtonPlusUtilsControllerNavigationPolicyPrivate {
	GeeHashMap* focus_history;
	guint64 restore_generation;
};

static gint ProtonPlusUtilsControllerFocusRestoreRequest_private_offset;
static gpointer proton_plus_utils_controller_focus_restore_request_parent_class = NULL;
static gpointer proton_plus_utils_controller_focus_history_entry_parent_class = NULL;
static gint ProtonPlusUtilsControllerNavigationPolicy_private_offset;
static gpointer proton_plus_utils_controller_navigation_policy_parent_class = NULL;

static GType proton_plus_utils_controller_navigation_host_get_type_once (void);
static GType proton_plus_utils_controller_directional_focus_get_type_once (void);
static GType proton_plus_utils_controller_activation_redirect_get_type_once (void);
static GType proton_plus_utils_controller_page_shortcuts_get_type_once (void);
static void proton_plus_utils_controller_focus_restore_request_set_generation (ProtonPlusUtilsControllerFocusRestoreRequest* self,
                                                                        guint64 value);
static void proton_plus_utils_controller_focus_restore_request_set_page_id (ProtonPlusUtilsControllerFocusRestoreRequest* self,
                                                                     const gchar* value);
static void proton_plus_utils_controller_focus_restore_request_set_surface_generation (ProtonPlusUtilsControllerFocusRestoreRequest* self,
                                                                                guint64 value);
static void proton_plus_utils_controller_focus_restore_request_finalize (GObject * obj);
static GType proton_plus_utils_controller_focus_restore_request_get_type_once (void);
static void _vala_proton_plus_utils_controller_focus_restore_request_get_property (GObject * object,
                                                                            guint property_id,
                                                                            GValue * value,
                                                                            GParamSpec * pspec);
static void _vala_proton_plus_utils_controller_focus_restore_request_set_property (GObject * object,
                                                                            guint property_id,
                                                                            const GValue * value,
                                                                            GParamSpec * pspec);
VALA_EXTERN GType proton_plus_utils_controller_focus_history_entry_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusUtilsControllerFocusHistoryEntry* proton_plus_utils_controller_focus_history_entry_new (GObject* target);
VALA_EXTERN ProtonPlusUtilsControllerFocusHistoryEntry* proton_plus_utils_controller_focus_history_entry_construct (GType object_type,
                                                                                                        GObject* target);
static void proton_plus_utils_controller_focus_history_entry_finalize (GObject * obj);
static GType proton_plus_utils_controller_focus_history_entry_get_type_once (void);
static void proton_plus_utils_controller_navigation_policy_finalize (GObject * obj);
static GType proton_plus_utils_controller_navigation_policy_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static GType
proton_plus_utils_controller_back_action_get_type_once (void)
{
	static const GEnumValue values[] = {{PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_NONE, "PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_NONE", "none"}, {PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_DISMISS_SURFACE, "PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_DISMISS_SURFACE", "dismiss-surface"}, {PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_NAVIGATE_APPLICATION, "PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_NAVIGATE_APPLICATION", "navigate-application"}, {PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_REQUEST_EXIT, "PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_REQUEST_EXIT", "request-exit"}, {0, NULL, NULL}};
	GType proton_plus_utils_controller_back_action_type_id;
	proton_plus_utils_controller_back_action_type_id = g_enum_register_static ("ProtonPlusUtilsControllerBackAction", values);
	return proton_plus_utils_controller_back_action_type_id;
}

GType
proton_plus_utils_controller_back_action_get_type (void)
{
	static volatile gsize proton_plus_utils_controller_back_action_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_controller_back_action_type_id__once)) {
		GType proton_plus_utils_controller_back_action_type_id;
		proton_plus_utils_controller_back_action_type_id = proton_plus_utils_controller_back_action_get_type_once ();
		g_once_init_leave (&proton_plus_utils_controller_back_action_type_id__once, proton_plus_utils_controller_back_action_type_id);
	}
	return proton_plus_utils_controller_back_action_type_id__once;
}

static GType
proton_plus_utils_controller_focus_target_choice_get_type_once (void)
{
	static const GEnumValue values[] = {{PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_REMEMBERED, "PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_REMEMBERED", "remembered"}, {PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_INITIAL, "PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_INITIAL", "initial"}, {PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_TRAVERSE, "PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_TRAVERSE", "traverse"}, {0, NULL, NULL}};
	GType proton_plus_utils_controller_focus_target_choice_type_id;
	proton_plus_utils_controller_focus_target_choice_type_id = g_enum_register_static ("ProtonPlusUtilsControllerFocusTargetChoice", values);
	return proton_plus_utils_controller_focus_target_choice_type_id;
}

GType
proton_plus_utils_controller_focus_target_choice_get_type (void)
{
	static volatile gsize proton_plus_utils_controller_focus_target_choice_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_controller_focus_target_choice_type_id__once)) {
		GType proton_plus_utils_controller_focus_target_choice_type_id;
		proton_plus_utils_controller_focus_target_choice_type_id = proton_plus_utils_controller_focus_target_choice_get_type_once ();
		g_once_init_leave (&proton_plus_utils_controller_focus_target_choice_type_id__once, proton_plus_utils_controller_focus_target_choice_type_id);
	}
	return proton_plus_utils_controller_focus_target_choice_type_id__once;
}

gchar*
proton_plus_utils_controller_navigation_host_get_controller_page_id (ProtonPlusUtilsControllerNavigationHost* self)
{
	ProtonPlusUtilsControllerNavigationHostIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_HOST_GET_INTERFACE (self);
	if (_iface_->get_controller_page_id) {
		return _iface_->get_controller_page_id (self);
	}
	return NULL;
}

GObject*
proton_plus_utils_controller_navigation_host_get_controller_page_root (ProtonPlusUtilsControllerNavigationHost* self)
{
	ProtonPlusUtilsControllerNavigationHostIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_HOST_GET_INTERFACE (self);
	if (_iface_->get_controller_page_root) {
		return _iface_->get_controller_page_root (self);
	}
	return NULL;
}

GObject*
proton_plus_utils_controller_navigation_host_get_controller_initial_focus (ProtonPlusUtilsControllerNavigationHost* self)
{
	ProtonPlusUtilsControllerNavigationHostIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_HOST_GET_INTERFACE (self);
	if (_iface_->get_controller_initial_focus) {
		return _iface_->get_controller_initial_focus (self);
	}
	return NULL;
}

gboolean
proton_plus_utils_controller_navigation_host_controller_can_navigate_back (ProtonPlusUtilsControllerNavigationHost* self)
{
	ProtonPlusUtilsControllerNavigationHostIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_HOST_GET_INTERFACE (self);
	if (_iface_->controller_can_navigate_back) {
		return _iface_->controller_can_navigate_back (self);
	}
	return FALSE;
}

gboolean
proton_plus_utils_controller_navigation_host_controller_can_switch_page (ProtonPlusUtilsControllerNavigationHost* self)
{
	ProtonPlusUtilsControllerNavigationHostIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_HOST_GET_INTERFACE (self);
	if (_iface_->controller_can_switch_page) {
		return _iface_->controller_can_switch_page (self);
	}
	return FALSE;
}

gboolean
proton_plus_utils_controller_navigation_host_controller_prefers_initial_focus_after_switch (ProtonPlusUtilsControllerNavigationHost* self)
{
	ProtonPlusUtilsControllerNavigationHostIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_HOST_GET_INTERFACE (self);
	if (_iface_->controller_prefers_initial_focus_after_switch) {
		return _iface_->controller_prefers_initial_focus_after_switch (self);
	}
	return FALSE;
}

gboolean
proton_plus_utils_controller_navigation_host_controller_navigate_back (ProtonPlusUtilsControllerNavigationHost* self)
{
	ProtonPlusUtilsControllerNavigationHostIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_HOST_GET_INTERFACE (self);
	if (_iface_->controller_navigate_back) {
		return _iface_->controller_navigate_back (self);
	}
	return FALSE;
}

gboolean
proton_plus_utils_controller_navigation_host_controller_switch_page (ProtonPlusUtilsControllerNavigationHost* self,
                                                                     gint delta)
{
	ProtonPlusUtilsControllerNavigationHostIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_NAVIGATION_HOST_GET_INTERFACE (self);
	if (_iface_->controller_switch_page) {
		return _iface_->controller_switch_page (self, delta);
	}
	return FALSE;
}

static void
proton_plus_utils_controller_navigation_host_default_init (ProtonPlusUtilsControllerNavigationHostIface * iface,
                                                           gpointer iface_data)
{
}

static GType
proton_plus_utils_controller_navigation_host_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsControllerNavigationHostIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_controller_navigation_host_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_utils_controller_navigation_host_type_id;
	proton_plus_utils_controller_navigation_host_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusUtilsControllerNavigationHost", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_utils_controller_navigation_host_type_id, G_TYPE_OBJECT);
	return proton_plus_utils_controller_navigation_host_type_id;
}

GType
proton_plus_utils_controller_navigation_host_get_type (void)
{
	static volatile gsize proton_plus_utils_controller_navigation_host_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_controller_navigation_host_type_id__once)) {
		GType proton_plus_utils_controller_navigation_host_type_id;
		proton_plus_utils_controller_navigation_host_type_id = proton_plus_utils_controller_navigation_host_get_type_once ();
		g_once_init_leave (&proton_plus_utils_controller_navigation_host_type_id__once, proton_plus_utils_controller_navigation_host_type_id);
	}
	return proton_plus_utils_controller_navigation_host_type_id__once;
}

gboolean
proton_plus_utils_controller_directional_focus_controller_focus_direction (ProtonPlusUtilsControllerDirectionalFocus* self,
                                                                           GObject* focused,
                                                                           ProtonPlusUtilsControllerNavigationDirection direction)
{
	ProtonPlusUtilsControllerDirectionalFocusIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_DIRECTIONAL_FOCUS_GET_INTERFACE (self);
	if (_iface_->controller_focus_direction) {
		return _iface_->controller_focus_direction (self, focused, direction);
	}
	return FALSE;
}

static void
proton_plus_utils_controller_directional_focus_default_init (ProtonPlusUtilsControllerDirectionalFocusIface * iface,
                                                             gpointer iface_data)
{
}

static GType
proton_plus_utils_controller_directional_focus_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsControllerDirectionalFocusIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_controller_directional_focus_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_utils_controller_directional_focus_type_id;
	proton_plus_utils_controller_directional_focus_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusUtilsControllerDirectionalFocus", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_utils_controller_directional_focus_type_id, G_TYPE_OBJECT);
	return proton_plus_utils_controller_directional_focus_type_id;
}

GType
proton_plus_utils_controller_directional_focus_get_type (void)
{
	static volatile gsize proton_plus_utils_controller_directional_focus_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_controller_directional_focus_type_id__once)) {
		GType proton_plus_utils_controller_directional_focus_type_id;
		proton_plus_utils_controller_directional_focus_type_id = proton_plus_utils_controller_directional_focus_get_type_once ();
		g_once_init_leave (&proton_plus_utils_controller_directional_focus_type_id__once, proton_plus_utils_controller_directional_focus_type_id);
	}
	return proton_plus_utils_controller_directional_focus_type_id__once;
}

GObject*
proton_plus_utils_controller_activation_redirect_get_controller_activation_target (ProtonPlusUtilsControllerActivationRedirect* self,
                                                                                   GObject* focused)
{
	ProtonPlusUtilsControllerActivationRedirectIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_ACTIVATION_REDIRECT_GET_INTERFACE (self);
	if (_iface_->get_controller_activation_target) {
		return _iface_->get_controller_activation_target (self, focused);
	}
	return NULL;
}

static void
proton_plus_utils_controller_activation_redirect_default_init (ProtonPlusUtilsControllerActivationRedirectIface * iface,
                                                               gpointer iface_data)
{
}

static GType
proton_plus_utils_controller_activation_redirect_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsControllerActivationRedirectIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_controller_activation_redirect_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_utils_controller_activation_redirect_type_id;
	proton_plus_utils_controller_activation_redirect_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusUtilsControllerActivationRedirect", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_utils_controller_activation_redirect_type_id, G_TYPE_OBJECT);
	return proton_plus_utils_controller_activation_redirect_type_id;
}

GType
proton_plus_utils_controller_activation_redirect_get_type (void)
{
	static volatile gsize proton_plus_utils_controller_activation_redirect_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_controller_activation_redirect_type_id__once)) {
		GType proton_plus_utils_controller_activation_redirect_type_id;
		proton_plus_utils_controller_activation_redirect_type_id = proton_plus_utils_controller_activation_redirect_get_type_once ();
		g_once_init_leave (&proton_plus_utils_controller_activation_redirect_type_id__once, proton_plus_utils_controller_activation_redirect_type_id);
	}
	return proton_plus_utils_controller_activation_redirect_type_id__once;
}

gboolean
proton_plus_utils_controller_page_shortcuts_controller_can_open_search (ProtonPlusUtilsControllerPageShortcuts* self)
{
	ProtonPlusUtilsControllerPageShortcutsIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_PAGE_SHORTCUTS_GET_INTERFACE (self);
	if (_iface_->controller_can_open_search) {
		return _iface_->controller_can_open_search (self);
	}
	return FALSE;
}

gboolean
proton_plus_utils_controller_page_shortcuts_controller_can_open_filter (ProtonPlusUtilsControllerPageShortcuts* self)
{
	ProtonPlusUtilsControllerPageShortcutsIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_PAGE_SHORTCUTS_GET_INTERFACE (self);
	if (_iface_->controller_can_open_filter) {
		return _iface_->controller_can_open_filter (self);
	}
	return FALSE;
}

gboolean
proton_plus_utils_controller_page_shortcuts_controller_open_search (ProtonPlusUtilsControllerPageShortcuts* self)
{
	ProtonPlusUtilsControllerPageShortcutsIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_PAGE_SHORTCUTS_GET_INTERFACE (self);
	if (_iface_->controller_open_search) {
		return _iface_->controller_open_search (self);
	}
	return FALSE;
}

gboolean
proton_plus_utils_controller_page_shortcuts_controller_open_filter (ProtonPlusUtilsControllerPageShortcuts* self)
{
	ProtonPlusUtilsControllerPageShortcutsIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = PROTON_PLUS_UTILS_CONTROLLER_PAGE_SHORTCUTS_GET_INTERFACE (self);
	if (_iface_->controller_open_filter) {
		return _iface_->controller_open_filter (self);
	}
	return FALSE;
}

static void
proton_plus_utils_controller_page_shortcuts_default_init (ProtonPlusUtilsControllerPageShortcutsIface * iface,
                                                          gpointer iface_data)
{
}

static GType
proton_plus_utils_controller_page_shortcuts_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsControllerPageShortcutsIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_controller_page_shortcuts_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType proton_plus_utils_controller_page_shortcuts_type_id;
	proton_plus_utils_controller_page_shortcuts_type_id = g_type_register_static (G_TYPE_INTERFACE, "ProtonPlusUtilsControllerPageShortcuts", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (proton_plus_utils_controller_page_shortcuts_type_id, G_TYPE_OBJECT);
	return proton_plus_utils_controller_page_shortcuts_type_id;
}

GType
proton_plus_utils_controller_page_shortcuts_get_type (void)
{
	static volatile gsize proton_plus_utils_controller_page_shortcuts_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_controller_page_shortcuts_type_id__once)) {
		GType proton_plus_utils_controller_page_shortcuts_type_id;
		proton_plus_utils_controller_page_shortcuts_type_id = proton_plus_utils_controller_page_shortcuts_get_type_once ();
		g_once_init_leave (&proton_plus_utils_controller_page_shortcuts_type_id__once, proton_plus_utils_controller_page_shortcuts_type_id);
	}
	return proton_plus_utils_controller_page_shortcuts_type_id__once;
}

static inline gpointer
proton_plus_utils_controller_focus_restore_request_get_instance_private (ProtonPlusUtilsControllerFocusRestoreRequest* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusUtilsControllerFocusRestoreRequest_private_offset);
}

ProtonPlusUtilsControllerFocusRestoreRequest*
proton_plus_utils_controller_focus_restore_request_construct (GType object_type,
                                                              guint64 generation,
                                                              const gchar* page_id,
                                                              guint64 surface_generation)
{
	ProtonPlusUtilsControllerFocusRestoreRequest * self = NULL;
	g_return_val_if_fail (page_id != NULL, NULL);
	self = (ProtonPlusUtilsControllerFocusRestoreRequest*) g_object_new (object_type, NULL);
	proton_plus_utils_controller_focus_restore_request_set_generation (self, generation);
	proton_plus_utils_controller_focus_restore_request_set_page_id (self, page_id);
	proton_plus_utils_controller_focus_restore_request_set_surface_generation (self, surface_generation);
	return self;
}

ProtonPlusUtilsControllerFocusRestoreRequest*
proton_plus_utils_controller_focus_restore_request_new (guint64 generation,
                                                        const gchar* page_id,
                                                        guint64 surface_generation)
{
	return proton_plus_utils_controller_focus_restore_request_construct (PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_RESTORE_REQUEST, generation, page_id, surface_generation);
}

guint64
proton_plus_utils_controller_focus_restore_request_get_generation (ProtonPlusUtilsControllerFocusRestoreRequest* self)
{
	guint64 result;
	g_return_val_if_fail (self != NULL, 0ULL);
	result = self->priv->_generation;
	return result;
}

static void
proton_plus_utils_controller_focus_restore_request_set_generation (ProtonPlusUtilsControllerFocusRestoreRequest* self,
                                                                   guint64 value)
{
	guint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_controller_focus_restore_request_get_generation (self);
	if (old_value != value) {
		self->priv->_generation = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_controller_focus_restore_request_properties[PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_GENERATION_PROPERTY]);
	}
}

const gchar*
proton_plus_utils_controller_focus_restore_request_get_page_id (ProtonPlusUtilsControllerFocusRestoreRequest* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_page_id;
	result = _tmp0_;
	return result;
}

static void
proton_plus_utils_controller_focus_restore_request_set_page_id (ProtonPlusUtilsControllerFocusRestoreRequest* self,
                                                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_controller_focus_restore_request_get_page_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_page_id);
		self->priv->_page_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_controller_focus_restore_request_properties[PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_PAGE_ID_PROPERTY]);
	}
}

guint64
proton_plus_utils_controller_focus_restore_request_get_surface_generation (ProtonPlusUtilsControllerFocusRestoreRequest* self)
{
	guint64 result;
	g_return_val_if_fail (self != NULL, 0ULL);
	result = self->priv->_surface_generation;
	return result;
}

static void
proton_plus_utils_controller_focus_restore_request_set_surface_generation (ProtonPlusUtilsControllerFocusRestoreRequest* self,
                                                                           guint64 value)
{
	guint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_controller_focus_restore_request_get_surface_generation (self);
	if (old_value != value) {
		self->priv->_surface_generation = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_controller_focus_restore_request_properties[PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_SURFACE_GENERATION_PROPERTY]);
	}
}

static void
proton_plus_utils_controller_focus_restore_request_class_init (ProtonPlusUtilsControllerFocusRestoreRequestClass * klass,
                                                               gpointer klass_data)
{
	proton_plus_utils_controller_focus_restore_request_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusUtilsControllerFocusRestoreRequest_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_utils_controller_focus_restore_request_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_utils_controller_focus_restore_request_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_utils_controller_focus_restore_request_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_GENERATION_PROPERTY, proton_plus_utils_controller_focus_restore_request_properties[PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_GENERATION_PROPERTY] = g_param_spec_uint64 ("generation", "generation", "generation", 0, G_MAXUINT64, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_PAGE_ID_PROPERTY, proton_plus_utils_controller_focus_restore_request_properties[PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_PAGE_ID_PROPERTY] = g_param_spec_string ("page-id", "page-id", "page-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_SURFACE_GENERATION_PROPERTY, proton_plus_utils_controller_focus_restore_request_properties[PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_SURFACE_GENERATION_PROPERTY] = g_param_spec_uint64 ("surface-generation", "surface-generation", "surface-generation", 0, G_MAXUINT64, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
proton_plus_utils_controller_focus_restore_request_instance_init (ProtonPlusUtilsControllerFocusRestoreRequest * self,
                                                                  gpointer klass)
{
	self->priv = proton_plus_utils_controller_focus_restore_request_get_instance_private (self);
}

static void
proton_plus_utils_controller_focus_restore_request_finalize (GObject * obj)
{
	ProtonPlusUtilsControllerFocusRestoreRequest * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_RESTORE_REQUEST, ProtonPlusUtilsControllerFocusRestoreRequest);
	_g_free0 (self->priv->_page_id);
	G_OBJECT_CLASS (proton_plus_utils_controller_focus_restore_request_parent_class)->finalize (obj);
}

static GType
proton_plus_utils_controller_focus_restore_request_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsControllerFocusRestoreRequestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_controller_focus_restore_request_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusUtilsControllerFocusRestoreRequest), 0, (GInstanceInitFunc) proton_plus_utils_controller_focus_restore_request_instance_init, NULL };
	GType proton_plus_utils_controller_focus_restore_request_type_id;
	proton_plus_utils_controller_focus_restore_request_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusUtilsControllerFocusRestoreRequest", &g_define_type_info, 0);
	ProtonPlusUtilsControllerFocusRestoreRequest_private_offset = g_type_add_instance_private (proton_plus_utils_controller_focus_restore_request_type_id, sizeof (ProtonPlusUtilsControllerFocusRestoreRequestPrivate));
	return proton_plus_utils_controller_focus_restore_request_type_id;
}

GType
proton_plus_utils_controller_focus_restore_request_get_type (void)
{
	static volatile gsize proton_plus_utils_controller_focus_restore_request_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_controller_focus_restore_request_type_id__once)) {
		GType proton_plus_utils_controller_focus_restore_request_type_id;
		proton_plus_utils_controller_focus_restore_request_type_id = proton_plus_utils_controller_focus_restore_request_get_type_once ();
		g_once_init_leave (&proton_plus_utils_controller_focus_restore_request_type_id__once, proton_plus_utils_controller_focus_restore_request_type_id);
	}
	return proton_plus_utils_controller_focus_restore_request_type_id__once;
}

static void
_vala_proton_plus_utils_controller_focus_restore_request_get_property (GObject * object,
                                                                       guint property_id,
                                                                       GValue * value,
                                                                       GParamSpec * pspec)
{
	ProtonPlusUtilsControllerFocusRestoreRequest * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_RESTORE_REQUEST, ProtonPlusUtilsControllerFocusRestoreRequest);
	switch (property_id) {
		case PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_GENERATION_PROPERTY:
		g_value_set_uint64 (value, proton_plus_utils_controller_focus_restore_request_get_generation (self));
		break;
		case PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_PAGE_ID_PROPERTY:
		g_value_set_string (value, proton_plus_utils_controller_focus_restore_request_get_page_id (self));
		break;
		case PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_SURFACE_GENERATION_PROPERTY:
		g_value_set_uint64 (value, proton_plus_utils_controller_focus_restore_request_get_surface_generation (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_utils_controller_focus_restore_request_set_property (GObject * object,
                                                                       guint property_id,
                                                                       const GValue * value,
                                                                       GParamSpec * pspec)
{
	ProtonPlusUtilsControllerFocusRestoreRequest * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_RESTORE_REQUEST, ProtonPlusUtilsControllerFocusRestoreRequest);
	switch (property_id) {
		case PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_GENERATION_PROPERTY:
		proton_plus_utils_controller_focus_restore_request_set_generation (self, g_value_get_uint64 (value));
		break;
		case PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_PAGE_ID_PROPERTY:
		proton_plus_utils_controller_focus_restore_request_set_page_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_UTILS_CONTROLLER_FOCUS_RESTORE_REQUEST_SURFACE_GENERATION_PROPERTY:
		proton_plus_utils_controller_focus_restore_request_set_surface_generation (self, g_value_get_uint64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

ProtonPlusUtilsControllerFocusHistoryEntry*
proton_plus_utils_controller_focus_history_entry_construct (GType object_type,
                                                            GObject* target)
{
	ProtonPlusUtilsControllerFocusHistoryEntry * self = NULL;
	g_return_val_if_fail (target != NULL, NULL);
	self = (ProtonPlusUtilsControllerFocusHistoryEntry*) g_object_new (object_type, NULL);
	self->target = target;
	return self;
}

ProtonPlusUtilsControllerFocusHistoryEntry*
proton_plus_utils_controller_focus_history_entry_new (GObject* target)
{
	return proton_plus_utils_controller_focus_history_entry_construct (PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_HISTORY_ENTRY, target);
}

static void
proton_plus_utils_controller_focus_history_entry_class_init (ProtonPlusUtilsControllerFocusHistoryEntryClass * klass,
                                                             gpointer klass_data)
{
	proton_plus_utils_controller_focus_history_entry_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = proton_plus_utils_controller_focus_history_entry_finalize;
}

static void
proton_plus_utils_controller_focus_history_entry_instance_init (ProtonPlusUtilsControllerFocusHistoryEntry * self,
                                                                gpointer klass)
{
}

static void
proton_plus_utils_controller_focus_history_entry_finalize (GObject * obj)
{
	ProtonPlusUtilsControllerFocusHistoryEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_HISTORY_ENTRY, ProtonPlusUtilsControllerFocusHistoryEntry);
	G_OBJECT_CLASS (proton_plus_utils_controller_focus_history_entry_parent_class)->finalize (obj);
}

static GType
proton_plus_utils_controller_focus_history_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsControllerFocusHistoryEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_controller_focus_history_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusUtilsControllerFocusHistoryEntry), 0, (GInstanceInitFunc) proton_plus_utils_controller_focus_history_entry_instance_init, NULL };
	GType proton_plus_utils_controller_focus_history_entry_type_id;
	proton_plus_utils_controller_focus_history_entry_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusUtilsControllerFocusHistoryEntry", &g_define_type_info, 0);
	return proton_plus_utils_controller_focus_history_entry_type_id;
}

GType
proton_plus_utils_controller_focus_history_entry_get_type (void)
{
	static volatile gsize proton_plus_utils_controller_focus_history_entry_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_controller_focus_history_entry_type_id__once)) {
		GType proton_plus_utils_controller_focus_history_entry_type_id;
		proton_plus_utils_controller_focus_history_entry_type_id = proton_plus_utils_controller_focus_history_entry_get_type_once ();
		g_once_init_leave (&proton_plus_utils_controller_focus_history_entry_type_id__once, proton_plus_utils_controller_focus_history_entry_type_id);
	}
	return proton_plus_utils_controller_focus_history_entry_type_id__once;
}

static inline gpointer
proton_plus_utils_controller_navigation_policy_get_instance_private (ProtonPlusUtilsControllerNavigationPolicy* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusUtilsControllerNavigationPolicy_private_offset);
}

ProtonPlusUtilsControllerBackAction
proton_plus_utils_controller_navigation_policy_navigate_back (ProtonPlusUtilsControllerNavigationPolicy* self,
                                                              gboolean has_modal_surface,
                                                              ProtonPlusUtilsControllerNavigationHost* host,
                                                              gboolean exit_at_root)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ProtonPlusUtilsControllerBackAction result;
	g_return_val_if_fail (self != NULL, 0);
	if (has_modal_surface) {
		result = PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_DISMISS_SURFACE;
		return result;
	}
	if (host != NULL) {
		_tmp0_ = proton_plus_utils_controller_navigation_host_controller_navigate_back (host);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_NAVIGATE_APPLICATION;
		return result;
	}
	if (exit_at_root) {
		_tmp1_ = host != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		result = PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_REQUEST_EXIT;
		return result;
	}
	result = PROTON_PLUS_UTILS_CONTROLLER_BACK_ACTION_NONE;
	return result;
}

gboolean
proton_plus_utils_controller_navigation_policy_switch_page (ProtonPlusUtilsControllerNavigationPolicy* self,
                                                            ProtonPlusUtilsControllerNavigationHost* host,
                                                            gint delta)
{
	gboolean _tmp0_ = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	if (host != NULL) {
		_tmp0_ = proton_plus_utils_controller_navigation_host_controller_switch_page (host, delta);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

void
proton_plus_utils_controller_navigation_policy_remember_focus (ProtonPlusUtilsControllerNavigationPolicy* self,
                                                               const gchar* page_id,
                                                               GObject* target)
{
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_;
	ProtonPlusUtilsControllerFocusHistoryEntry* _tmp2_;
	ProtonPlusUtilsControllerFocusHistoryEntry* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (page_id != NULL);
	if (g_strcmp0 (page_id, "") == 0) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = target == NULL;
	}
	if (_tmp0_) {
		return;
	}
	_tmp1_ = self->priv->focus_history;
	_tmp2_ = proton_plus_utils_controller_focus_history_entry_new (G_TYPE_CHECK_INSTANCE_CAST (target, G_TYPE_OBJECT, GObject));
	_tmp3_ = _tmp2_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp1_, page_id, _tmp3_);
	_g_object_unref0 (_tmp3_);
}

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

GObject*
proton_plus_utils_controller_navigation_policy_recall_focus (ProtonPlusUtilsControllerNavigationPolicy* self,
                                                             const gchar* page_id)
{
	ProtonPlusUtilsControllerFocusHistoryEntry* entry = NULL;
	GeeHashMap* _tmp0_;
	gpointer _tmp1_;
	ProtonPlusUtilsControllerFocusHistoryEntry* _tmp2_ = NULL;
	ProtonPlusUtilsControllerFocusHistoryEntry* _tmp3_;
	GObject* _tmp4_ = NULL;
	GObject* _tmp6_;
	GObject* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (page_id != NULL, NULL);
	_tmp0_ = self->priv->focus_history;
	_tmp1_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp0_, page_id);
	entry = (ProtonPlusUtilsControllerFocusHistoryEntry*) _tmp1_;
	_tmp3_ = entry;
	_tmp2_ = _tmp3_;
	_tmp4_ = NULL;
	if (_tmp2_ != NULL) {
		GObject* _tmp5_;
		_tmp5_ = _tmp2_->target;
		_tmp4_ = _tmp5_;
	}
	_tmp6_ = _g_object_ref0 (_tmp4_);
	result = _tmp6_;
	_g_object_unref0 (entry);
	return result;
}

ProtonPlusUtilsControllerFocusRestoreRequest*
proton_plus_utils_controller_navigation_policy_begin_restore (ProtonPlusUtilsControllerNavigationPolicy* self,
                                                              const gchar* page_id,
                                                              guint64 surface_generation)
{
	guint64 _tmp0_;
	ProtonPlusUtilsControllerFocusRestoreRequest* _tmp1_;
	ProtonPlusUtilsControllerFocusRestoreRequest* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (page_id != NULL, NULL);
	_tmp0_ = self->priv->restore_generation;
	self->priv->restore_generation = _tmp0_ + 1;
	_tmp1_ = proton_plus_utils_controller_focus_restore_request_new (self->priv->restore_generation, page_id, surface_generation);
	result = _tmp1_;
	return result;
}

void
proton_plus_utils_controller_navigation_policy_invalidate_restores (ProtonPlusUtilsControllerNavigationPolicy* self)
{
	guint64 _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->restore_generation;
	self->priv->restore_generation = _tmp0_ + 1;
}

gboolean
proton_plus_utils_controller_navigation_policy_can_apply_restore (ProtonPlusUtilsControllerNavigationPolicy* self,
                                                                  ProtonPlusUtilsControllerFocusRestoreRequest* request,
                                                                  const gchar* active_page_id,
                                                                  guint64 active_surface_generation)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	guint64 _tmp2_;
	guint64 _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (request != NULL, FALSE);
	g_return_val_if_fail (active_page_id != NULL, FALSE);
	_tmp2_ = proton_plus_utils_controller_focus_restore_request_get_generation (request);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == self->priv->restore_generation) {
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = proton_plus_utils_controller_focus_restore_request_get_page_id (request);
		_tmp5_ = _tmp4_;
		_tmp1_ = g_strcmp0 (_tmp5_, active_page_id) == 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		guint64 _tmp6_;
		guint64 _tmp7_;
		_tmp6_ = proton_plus_utils_controller_focus_restore_request_get_surface_generation (request);
		_tmp7_ = _tmp6_;
		_tmp0_ = _tmp7_ == active_surface_generation;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

ProtonPlusUtilsControllerFocusTargetChoice
proton_plus_utils_controller_navigation_policy_choose_focus_target (gboolean remembered_valid,
                                                                    gboolean initial_valid,
                                                                    gboolean prefer_initial)
{
	gboolean _tmp0_ = FALSE;
	ProtonPlusUtilsControllerFocusTargetChoice result;
	if (prefer_initial) {
		_tmp0_ = initial_valid;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		result = PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_INITIAL;
		return result;
	}
	if (remembered_valid) {
		result = PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_REMEMBERED;
		return result;
	}
	if (initial_valid) {
		result = PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_INITIAL;
		return result;
	}
	result = PROTON_PLUS_UTILS_CONTROLLER_FOCUS_TARGET_CHOICE_TRAVERSE;
	return result;
}

ProtonPlusUtilsControllerNavigationPolicy*
proton_plus_utils_controller_navigation_policy_construct (GType object_type)
{
	ProtonPlusUtilsControllerNavigationPolicy * self = NULL;
	self = (ProtonPlusUtilsControllerNavigationPolicy*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusUtilsControllerNavigationPolicy*
proton_plus_utils_controller_navigation_policy_new (void)
{
	return proton_plus_utils_controller_navigation_policy_construct (PROTON_PLUS_UTILS_TYPE_CONTROLLER_NAVIGATION_POLICY);
}

static void
proton_plus_utils_controller_navigation_policy_class_init (ProtonPlusUtilsControllerNavigationPolicyClass * klass,
                                                           gpointer klass_data)
{
	proton_plus_utils_controller_navigation_policy_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusUtilsControllerNavigationPolicy_private_offset);
	G_OBJECT_CLASS (klass)->finalize = proton_plus_utils_controller_navigation_policy_finalize;
}

static void
proton_plus_utils_controller_navigation_policy_instance_init (ProtonPlusUtilsControllerNavigationPolicy * self,
                                                              gpointer klass)
{
	GeeHashMap* _tmp0_;
	self->priv = proton_plus_utils_controller_navigation_policy_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, PROTON_PLUS_UTILS_TYPE_CONTROLLER_FOCUS_HISTORY_ENTRY, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->focus_history = _tmp0_;
	self->priv->restore_generation = (guint64) 0;
}

static void
proton_plus_utils_controller_navigation_policy_finalize (GObject * obj)
{
	ProtonPlusUtilsControllerNavigationPolicy * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_UTILS_TYPE_CONTROLLER_NAVIGATION_POLICY, ProtonPlusUtilsControllerNavigationPolicy);
	_g_object_unref0 (self->priv->focus_history);
	G_OBJECT_CLASS (proton_plus_utils_controller_navigation_policy_parent_class)->finalize (obj);
}

static GType
proton_plus_utils_controller_navigation_policy_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsControllerNavigationPolicyClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_controller_navigation_policy_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusUtilsControllerNavigationPolicy), 0, (GInstanceInitFunc) proton_plus_utils_controller_navigation_policy_instance_init, NULL };
	GType proton_plus_utils_controller_navigation_policy_type_id;
	proton_plus_utils_controller_navigation_policy_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusUtilsControllerNavigationPolicy", &g_define_type_info, 0);
	ProtonPlusUtilsControllerNavigationPolicy_private_offset = g_type_add_instance_private (proton_plus_utils_controller_navigation_policy_type_id, sizeof (ProtonPlusUtilsControllerNavigationPolicyPrivate));
	return proton_plus_utils_controller_navigation_policy_type_id;
}

GType
proton_plus_utils_controller_navigation_policy_get_type (void)
{
	static volatile gsize proton_plus_utils_controller_navigation_policy_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_controller_navigation_policy_type_id__once)) {
		GType proton_plus_utils_controller_navigation_policy_type_id;
		proton_plus_utils_controller_navigation_policy_type_id = proton_plus_utils_controller_navigation_policy_get_type_once ();
		g_once_init_leave (&proton_plus_utils_controller_navigation_policy_type_id__once, proton_plus_utils_controller_navigation_policy_type_id);
	}
	return proton_plus_utils_controller_navigation_policy_type_id__once;
}

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

