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

#include <gtk/gtk.h>
#include <glib-object.h>
#include <glib.h>
#include <gdk/gdk.h>
#include <cairo-gobject.h>
#include <float.h>
#include <math.h>
#include <gee.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.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
#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 PDFPC_WINDOW_TYPE_FULLSCREEN (pdfpc_window_fullscreen_get_type ())
#define PDFPC_WINDOW_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreen))
#define PDFPC_WINDOW_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass))
#define PDFPC_WINDOW_IS_FULLSCREEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN))
#define PDFPC_WINDOW_IS_FULLSCREEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_FULLSCREEN))
#define PDFPC_WINDOW_FULLSCREEN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_FULLSCREEN, pdfpcWindowFullscreenClass))

typedef struct _pdfpcWindowFullscreen pdfpcWindowFullscreen;
typedef struct _pdfpcWindowFullscreenClass pdfpcWindowFullscreenClass;
typedef struct _pdfpcWindowFullscreenPrivate pdfpcWindowFullscreenPrivate;

#define PDFPC_TYPE_CONTROLLABLE (pdfpc_controllable_get_type ())
#define PDFPC_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllable))
#define PDFPC_IS_CONTROLLABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_CONTROLLABLE))
#define PDFPC_CONTROLLABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PDFPC_TYPE_CONTROLLABLE, pdfpcControllableIface))

typedef struct _pdfpcControllable pdfpcControllable;
typedef struct _pdfpcControllableIface pdfpcControllableIface;

#define PDFPC_TYPE_PRESENTATION_CONTROLLER (pdfpc_presentation_controller_get_type ())
#define PDFPC_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationController))
#define PDFPC_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass))
#define PDFPC_IS_PRESENTATION_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER))
#define PDFPC_IS_PRESENTATION_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_PRESENTATION_CONTROLLER))
#define PDFPC_PRESENTATION_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_PRESENTATION_CONTROLLER, pdfpcPresentationControllerClass))

typedef struct _pdfpcPresentationController pdfpcPresentationController;
typedef struct _pdfpcPresentationControllerClass pdfpcPresentationControllerClass;

#define PDFPC_VIEW_TYPE_PDF (pdfpc_view_pdf_get_type ())
#define PDFPC_VIEW_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdf))
#define PDFPC_VIEW_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass))
#define PDFPC_VIEW_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_PDF))
#define PDFPC_VIEW_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_PDF))
#define PDFPC_VIEW_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_PDF, pdfpcViewPdfClass))

typedef struct _pdfpcViewPdf pdfpcViewPdf;
typedef struct _pdfpcViewPdfClass pdfpcViewPdfClass;

#define PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW (pdfpc_window_controllable_window_get_type ())
#define PDFPC_WINDOW_CONTROLLABLE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW, pdfpcWindowControllableWindow))
#define PDFPC_WINDOW_CONTROLLABLE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW, pdfpcWindowControllableWindowClass))
#define PDFPC_WINDOW_IS_CONTROLLABLE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW))
#define PDFPC_WINDOW_IS_CONTROLLABLE_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW))
#define PDFPC_WINDOW_CONTROLLABLE_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW, pdfpcWindowControllableWindowClass))

typedef struct _pdfpcWindowControllableWindow pdfpcWindowControllableWindow;
typedef struct _pdfpcWindowControllableWindowClass pdfpcWindowControllableWindowClass;
typedef struct _pdfpcWindowControllableWindowPrivate pdfpcWindowControllableWindowPrivate;

#define PDFPC_VIEW_TYPE_VIDEO (pdfpc_view_video_get_type ())
#define PDFPC_VIEW_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_VIDEO, pdfpcViewVideo))
#define PDFPC_VIEW_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_VIDEO, pdfpcViewVideoClass))
#define PDFPC_VIEW_IS_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_VIDEO))
#define PDFPC_VIEW_IS_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_VIDEO))
#define PDFPC_VIEW_VIDEO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_VIDEO, pdfpcViewVideoClass))

typedef struct _pdfpcViewVideo pdfpcViewVideo;
typedef struct _pdfpcViewVideoClass pdfpcViewVideoClass;
enum  {
	PDFPC_WINDOW_CONTROLLABLE_WINDOW_0_PROPERTY,
	PDFPC_WINDOW_CONTROLLABLE_WINDOW_CONTROLLER_PROPERTY,
	PDFPC_WINDOW_CONTROLLABLE_WINDOW_MAIN_VIEW_PROPERTY,
	PDFPC_WINDOW_CONTROLLABLE_WINDOW_METADATA_PROPERTY,
	PDFPC_WINDOW_CONTROLLABLE_WINDOW_INTERACTIVE_PROPERTY,
	PDFPC_WINDOW_CONTROLLABLE_WINDOW_POINTER_DRAWING_SURFACE_PROPERTY,
	PDFPC_WINDOW_CONTROLLABLE_WINDOW_PEN_DRAWING_SURFACE_PROPERTY,
	PDFPC_WINDOW_CONTROLLABLE_WINDOW_VIDEO_SURFACE_PROPERTY,
	PDFPC_WINDOW_CONTROLLABLE_WINDOW_NUM_PROPERTIES
};
static GParamSpec* pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block12Data Block12Data;

#define PDFPC_PRESENTATION_CONTROLLER_TYPE_SCALED_RECTANGLE (pdfpc_presentation_controller_scaled_rectangle_get_type ())
typedef struct _pdfpcPresentationControllerScaledRectangle pdfpcPresentationControllerScaledRectangle;

#define PDFPC_PRESENTATION_CONTROLLER_TYPE_POINTER_TOOL (pdfpc_presentation_controller_pointer_tool_get_type ())
#define PDFPC_PRESENTATION_CONTROLLER_POINTER_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_POINTER_TOOL, pdfpcPresentationControllerPointerTool))
#define PDFPC_PRESENTATION_CONTROLLER_POINTER_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_POINTER_TOOL, pdfpcPresentationControllerPointerToolClass))
#define PDFPC_PRESENTATION_CONTROLLER_IS_POINTER_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_POINTER_TOOL))
#define PDFPC_PRESENTATION_CONTROLLER_IS_POINTER_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_POINTER_TOOL))
#define PDFPC_PRESENTATION_CONTROLLER_POINTER_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_POINTER_TOOL, pdfpcPresentationControllerPointerToolClass))

typedef struct _pdfpcPresentationControllerPointerTool pdfpcPresentationControllerPointerTool;
typedef struct _pdfpcPresentationControllerPointerToolClass pdfpcPresentationControllerPointerToolClass;
typedef struct _pdfpcPresentationControllerPrivate pdfpcPresentationControllerPrivate;

#define PDFPC_TYPE_TIMER (pdfpc_timer_get_type ())
#define PDFPC_TIMER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_TIMER, pdfpcTimer))
#define PDFPC_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_TIMER, pdfpcTimerClass))
#define PDFPC_IS_TIMER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_TIMER))
#define PDFPC_IS_TIMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_TIMER))
#define PDFPC_TIMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_TIMER, pdfpcTimerClass))

typedef struct _pdfpcTimer pdfpcTimer;
typedef struct _pdfpcTimerClass pdfpcTimerClass;

#define PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_DESCRIPTION (pdfpc_presentation_controller_action_description_get_type ())
#define PDFPC_PRESENTATION_CONTROLLER_ACTION_DESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_DESCRIPTION, pdfpcPresentationControllerActionDescription))
#define PDFPC_PRESENTATION_CONTROLLER_ACTION_DESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_DESCRIPTION, pdfpcPresentationControllerActionDescriptionClass))
#define PDFPC_PRESENTATION_CONTROLLER_IS_ACTION_DESCRIPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_DESCRIPTION))
#define PDFPC_PRESENTATION_CONTROLLER_IS_ACTION_DESCRIPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_DESCRIPTION))
#define PDFPC_PRESENTATION_CONTROLLER_ACTION_DESCRIPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_DESCRIPTION, pdfpcPresentationControllerActionDescriptionClass))

typedef struct _pdfpcPresentationControllerActionDescription pdfpcPresentationControllerActionDescription;
typedef struct _pdfpcPresentationControllerActionDescriptionClass pdfpcPresentationControllerActionDescriptionClass;

#define PDFPC_TYPE_KEY_DEF (pdfpc_key_def_get_type ())
#define PDFPC_KEY_DEF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_TYPE_KEY_DEF, pdfpcKeyDef))
#define PDFPC_KEY_DEF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_TYPE_KEY_DEF, pdfpcKeyDefClass))
#define PDFPC_IS_KEY_DEF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_TYPE_KEY_DEF))
#define PDFPC_IS_KEY_DEF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_TYPE_KEY_DEF))
#define PDFPC_KEY_DEF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_TYPE_KEY_DEF, pdfpcKeyDefClass))

typedef struct _pdfpcKeyDef pdfpcKeyDef;
typedef struct _pdfpcKeyDefClass pdfpcKeyDefClass;

#define PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_AND_PARAMETER (pdfpc_presentation_controller_action_and_parameter_get_type ())
#define PDFPC_PRESENTATION_CONTROLLER_ACTION_AND_PARAMETER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_AND_PARAMETER, pdfpcPresentationControllerActionAndParameter))
#define PDFPC_PRESENTATION_CONTROLLER_ACTION_AND_PARAMETER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_AND_PARAMETER, pdfpcPresentationControllerActionAndParameterClass))
#define PDFPC_PRESENTATION_CONTROLLER_IS_ACTION_AND_PARAMETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_AND_PARAMETER))
#define PDFPC_PRESENTATION_CONTROLLER_IS_ACTION_AND_PARAMETER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_AND_PARAMETER))
#define PDFPC_PRESENTATION_CONTROLLER_ACTION_AND_PARAMETER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_PRESENTATION_CONTROLLER_TYPE_ACTION_AND_PARAMETER, pdfpcPresentationControllerActionAndParameterClass))

typedef struct _pdfpcPresentationControllerActionAndParameter pdfpcPresentationControllerActionAndParameter;
typedef struct _pdfpcPresentationControllerActionAndParameterClass pdfpcPresentationControllerActionAndParameterClass;

#define TYPE_SCREEN_SAVER (screen_saver_get_type ())
#define SCREEN_SAVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SCREEN_SAVER, ScreenSaver))
#define IS_SCREEN_SAVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SCREEN_SAVER))
#define SCREEN_SAVER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TYPE_SCREEN_SAVER, ScreenSaverIface))

typedef struct _ScreenSaver ScreenSaver;
typedef struct _ScreenSaverIface ScreenSaverIface;

#define TYPE_SCREEN_SAVER_PROXY (screen_saver_proxy_get_type ())

#define PDFPC_DRAWINGS_TYPE_DRAWING (pdfpc_drawings_drawing_get_type ())
#define PDFPC_DRAWINGS_DRAWING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_DRAWINGS_TYPE_DRAWING, pdfpcDrawingsDrawing))
#define PDFPC_DRAWINGS_DRAWING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_DRAWINGS_TYPE_DRAWING, pdfpcDrawingsDrawingClass))
#define PDFPC_DRAWINGS_IS_DRAWING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_DRAWINGS_TYPE_DRAWING))
#define PDFPC_DRAWINGS_IS_DRAWING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_DRAWINGS_TYPE_DRAWING))
#define PDFPC_DRAWINGS_DRAWING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_DRAWINGS_TYPE_DRAWING, pdfpcDrawingsDrawingClass))

typedef struct _pdfpcDrawingsDrawing pdfpcDrawingsDrawing;
typedef struct _pdfpcDrawingsDrawingClass pdfpcDrawingsDrawingClass;

#define PDFPC_DRAWINGS_TYPE_DRAWING_TOOL (pdfpc_drawings_drawing_tool_get_type ())
#define PDFPC_DRAWINGS_DRAWING_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_DRAWINGS_TYPE_DRAWING_TOOL, pdfpcDrawingsDrawingTool))
#define PDFPC_DRAWINGS_DRAWING_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_DRAWINGS_TYPE_DRAWING_TOOL, pdfpcDrawingsDrawingToolClass))
#define PDFPC_DRAWINGS_IS_DRAWING_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_DRAWINGS_TYPE_DRAWING_TOOL))
#define PDFPC_DRAWINGS_IS_DRAWING_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_DRAWINGS_TYPE_DRAWING_TOOL))
#define PDFPC_DRAWINGS_DRAWING_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_DRAWINGS_TYPE_DRAWING_TOOL, pdfpcDrawingsDrawingToolClass))

typedef struct _pdfpcDrawingsDrawingTool pdfpcDrawingsDrawingTool;
typedef struct _pdfpcDrawingsDrawingToolClass pdfpcDrawingsDrawingToolClass;
typedef struct _pdfpcPresentationControllerPointerToolPrivate pdfpcPresentationControllerPointerToolPrivate;
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))
typedef enum  {
	PDFPC_PRESENTATION_CONTROLLER_ANNOTATION_MODE_NORMAL,
	PDFPC_PRESENTATION_CONTROLLER_ANNOTATION_MODE_POINTER,
	PDFPC_PRESENTATION_CONTROLLER_ANNOTATION_MODE_SPOTLIGHT,
	PDFPC_PRESENTATION_CONTROLLER_ANNOTATION_MODE_PEN,
	PDFPC_PRESENTATION_CONTROLLER_ANNOTATION_MODE_ERASER
} pdfpcPresentationControllerAnnotationMode;

#define PDFPC_PRESENTATION_CONTROLLER_TYPE_ANNOTATION_MODE (pdfpc_presentation_controller_annotation_mode_get_type ())

#define PDFPC_METADATA_TYPE_PDF (pdfpc_metadata_pdf_get_type ())
#define PDFPC_METADATA_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdf))
#define PDFPC_METADATA_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass))
#define PDFPC_METADATA_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_METADATA_TYPE_PDF))
#define PDFPC_METADATA_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_METADATA_TYPE_PDF))
#define PDFPC_METADATA_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_METADATA_TYPE_PDF, pdfpcMetadataPdfClass))

typedef struct _pdfpcMetadataPdf pdfpcMetadataPdf;
typedef struct _pdfpcMetadataPdfClass pdfpcMetadataPdfClass;

struct _pdfpcWindowFullscreen {
	GtkWindow parent_instance;
	pdfpcWindowFullscreenPrivate * priv;
	gboolean windowed;
	GdkScreen* screen_to_use;
	gint monitor_num_to_use;
};

struct _pdfpcWindowFullscreenClass {
	GtkWindowClass parent_class;
	void (*resize_gui) (pdfpcWindowFullscreen* self);
};

struct _pdfpcControllableIface {
	GTypeInterface parent_iface;
	pdfpcPresentationController* (*get_controller) (pdfpcControllable* self);
	void (*set_controller) (pdfpcControllable* self, pdfpcPresentationController* value);
	pdfpcViewPdf* (*get_main_view) (pdfpcControllable* self);
	void (*set_main_view) (pdfpcControllable* self, pdfpcViewPdf* value);
};

struct _pdfpcWindowControllableWindow {
	pdfpcWindowFullscreen parent_instance;
	pdfpcWindowControllableWindowPrivate * priv;
	GtkOverlay* overlay_layout;
	guint hide_cursor_timeout;
	gboolean cursor_blanked;
	guint accepted_key_mods;
	guint last_key_ev_time;
};

struct _pdfpcWindowControllableWindowClass {
	pdfpcWindowFullscreenClass parent_class;
};

struct _pdfpcWindowControllableWindowPrivate {
	pdfpcPresentationController* _controller;
	pdfpcViewPdf* _main_view;
	gboolean _interactive;
	GtkDrawingArea* _pointer_drawing_surface;
	GtkDrawingArea* _pen_drawing_surface;
	pdfpcViewVideo* _video_surface;
};

struct _Block12Data {
	int _ref_count_;
	pdfpcWindowControllableWindow* self;
	pdfpcPresentationController* controller;
};

struct _pdfpcPresentationControllerScaledRectangle {
	gdouble x;
	gdouble y;
	gdouble width;
	gdouble height;
};

struct _ScreenSaverIface {
	GTypeInterface parent_iface;
	void (*inhibit) (ScreenSaver* self, const gchar* application_name, const gchar* reason, GAsyncReadyCallback _callback_, gpointer _user_data_);
	guint32 (*inhibit_finish) (ScreenSaver* self, GAsyncResult* _res_, GError** error);
	void (*un_inhibit) (ScreenSaver* self, guint32 cookie, GError** error);
};

struct _pdfpcPresentationController {
	GObject parent_instance;
	pdfpcPresentationControllerPrivate * priv;
	pdfpcPresentationControllerScaledRectangle highlight;
	gboolean zoom_stack_drawing;
	pdfpcPresentationControllerScaledRectangle zoom_stack_highlight;
	GeeList* controllables;
	pdfpcTimer* timer;
	GSimpleActionGroup* action_group;
	GeeArrayList* action_descriptions;
	GeeHashMap* keyBindings;
	GeeHashMap* mouseBindings;
	ScreenSaver* screensaver;
	guint32 screensaver_cookie;
	pdfpcPresentationControllerPointerTool* pointer;
	pdfpcPresentationControllerPointerTool* spotlight;
	pdfpcDrawingsDrawing* pen_drawing;
	pdfpcDrawingsDrawingTool* current_pen_drawing_tool;
	gdouble pen_last_x;
	gdouble pen_last_y;
	gboolean pen_is_pressed;
	guint pointer_step;
	gboolean pointer_hidden;
	guint pointer_timeout_id;
	guint autoadvance_timeout_id;
	gdouble drag_x;
	gdouble drag_y;
	gdouble pointer_x;
	gdouble pointer_y;
};

struct _pdfpcPresentationControllerClass {
	GObjectClass parent_class;
};

struct _pdfpcPresentationControllerPointerTool {
	GTypeInstance parent_instance;
	volatile int ref_count;
	pdfpcPresentationControllerPointerToolPrivate * priv;
	gdouble red;
	gdouble green;
	gdouble blue;
	gdouble alpha;
	gdouble size;
};

struct _pdfpcPresentationControllerPointerToolClass {
	GTypeClass parent_class;
	void (*finalize) (pdfpcPresentationControllerPointerTool *self);
};

static gint pdfpcWindowControllableWindow_private_offset;
static gpointer pdfpc_window_controllable_window_parent_class = NULL;
VALA_EXTERN gboolean pdfpc_options_disable_input_autodetection;
VALA_EXTERN gboolean pdfpc_options_disable_input_pressure;
VALA_EXTERN gint pdfpc_options_cursor_timeout;
static pdfpcControllableIface * pdfpc_window_controllable_window_pdfpc_controllable_parent_iface = NULL;

VALA_EXTERN GType pdfpc_window_fullscreen_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcWindowFullscreen, g_object_unref)
VALA_EXTERN GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcPresentationController, g_object_unref)
VALA_EXTERN GType pdfpc_view_pdf_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcViewPdf, g_object_unref)
VALA_EXTERN GType pdfpc_controllable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcControllable, g_object_unref)
VALA_EXTERN GType pdfpc_window_controllable_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcWindowControllableWindow, g_object_unref)
VALA_EXTERN GType pdfpc_view_video_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcViewVideo, g_object_unref)
VALA_EXTERN pdfpcWindowControllableWindow* pdfpc_window_controllable_window_new (pdfpcPresentationController* controller,
                                                                     gboolean interactive,
                                                                     gint monitor_num,
                                                                     gboolean windowed,
                                                                     gint width,
                                                                     gint height);
VALA_EXTERN pdfpcWindowControllableWindow* pdfpc_window_controllable_window_construct (GType object_type,
                                                                           pdfpcPresentationController* controller,
                                                                           gboolean interactive,
                                                                           gint monitor_num,
                                                                           gboolean windowed,
                                                                           gint width,
                                                                           gint height);
static Block12Data* block12_data_ref (Block12Data* _data12_);
static void block12_data_unref (void * _userdata_);
VALA_EXTERN pdfpcWindowFullscreen* pdfpc_window_fullscreen_new (gint monitor_num,
                                                    gboolean windowed,
                                                    gint width,
                                                    gint height);
VALA_EXTERN pdfpcWindowFullscreen* pdfpc_window_fullscreen_construct (GType object_type,
                                                          gint monitor_num,
                                                          gboolean windowed,
                                                          gint width,
                                                          gint height);
VALA_EXTERN void pdfpc_controllable_set_controller (pdfpcControllable* self,
                                        pdfpcPresentationController* value);
VALA_EXTERN void pdfpc_window_controllable_window_set_interactive (pdfpcWindowControllableWindow* self,
                                                       gboolean value);
VALA_EXTERN pdfpcViewPdf* pdfpc_view_pdf_new_from_controllable_window (pdfpcWindowControllableWindow* window,
                                                           gboolean notes_area,
                                                           gboolean clickable_links,
                                                           gboolean user_slides);
VALA_EXTERN pdfpcViewPdf* pdfpc_view_pdf_construct_from_controllable_window (GType object_type,
                                                                 pdfpcWindowControllableWindow* window,
                                                                 gboolean notes_area,
                                                                 gboolean clickable_links,
                                                                 gboolean user_slides);
VALA_EXTERN void pdfpc_controllable_set_main_view (pdfpcControllable* self,
                                       pdfpcViewPdf* value);
VALA_EXTERN void pdfpc_window_controllable_window_set_pointer_drawing_surface (pdfpcWindowControllableWindow* self,
                                                                   GtkDrawingArea* value);
VALA_EXTERN void pdfpc_window_controllable_window_set_pen_drawing_surface (pdfpcWindowControllableWindow* self,
                                                               GtkDrawingArea* value);
VALA_EXTERN pdfpcViewVideo* pdfpc_view_video_new (void);
VALA_EXTERN pdfpcViewVideo* pdfpc_view_video_construct (GType object_type);
VALA_EXTERN void pdfpc_window_controllable_window_set_video_surface (pdfpcWindowControllableWindow* self,
                                                         pdfpcViewVideo* value);
VALA_EXTERN pdfpcViewPdf* pdfpc_controllable_get_main_view (pdfpcControllable* self);
VALA_EXTERN pdfpcViewVideo* pdfpc_window_controllable_window_get_video_surface (pdfpcWindowControllableWindow* self);
VALA_EXTERN GtkDrawingArea* pdfpc_window_controllable_window_get_pen_drawing_surface (pdfpcWindowControllableWindow* self);
VALA_EXTERN GtkDrawingArea* pdfpc_window_controllable_window_get_pointer_drawing_surface (pdfpcWindowControllableWindow* self);
static void __lambda14_ (pdfpcWindowControllableWindow* self);
VALA_EXTERN void pdfpc_window_controllable_window_set_widget_event_pass_through (pdfpcWindowControllableWindow* self,
                                                                     GtkWidget* w,
                                                                     gboolean pass_through);
static void ___lambda14__gtk_widget_realize (GtkWidget* _sender,
                                      gpointer self);
static void __lambda15_ (pdfpcWindowControllableWindow* self);
static void ___lambda15__gtk_widget_realize (GtkWidget* _sender,
                                      gpointer self);
static void __lambda16_ (pdfpcWindowControllableWindow* self);
static void ___lambda16__gtk_widget_realize (GtkWidget* _sender,
                                      gpointer self);
VALA_EXTERN gboolean pdfpc_window_controllable_window_draw_pointer (pdfpcWindowControllableWindow* self,
                                                        cairo_t* context);
static gboolean _pdfpc_window_controllable_window_draw_pointer_gtk_widget_draw (GtkWidget* _sender,
                                                                         cairo_t* cr,
                                                                         gpointer self);
VALA_EXTERN gboolean pdfpc_window_controllable_window_draw_pen (pdfpcWindowControllableWindow* self,
                                                    cairo_t* context);
static gboolean _pdfpc_window_controllable_window_draw_pen_gtk_widget_draw (GtkWidget* _sender,
                                                                     cairo_t* cr,
                                                                     gpointer self);
VALA_EXTERN pdfpcPresentationController* pdfpc_controllable_get_controller (pdfpcControllable* self);
VALA_EXTERN GType pdfpc_presentation_controller_scaled_rectangle_get_type (void) G_GNUC_CONST ;
VALA_EXTERN pdfpcPresentationControllerScaledRectangle* pdfpc_presentation_controller_scaled_rectangle_dup (const pdfpcPresentationControllerScaledRectangle* self);
VALA_EXTERN void pdfpc_presentation_controller_scaled_rectangle_free (pdfpcPresentationControllerScaledRectangle* self);
VALA_EXTERN void pdfpc_window_controllable_window_c_on_zoom (pdfpcWindowControllableWindow* self,
                                                 pdfpcPresentationControllerScaledRectangle* rect);
static void _pdfpc_window_controllable_window_c_on_zoom_pdfpc_presentation_controller_zoom_request (pdfpcPresentationController* _sender,
                                                                                             pdfpcPresentationControllerScaledRectangle* rect,
                                                                                             gpointer self);
VALA_EXTERN void pdfpc_window_controllable_window_c_on_reload (pdfpcWindowControllableWindow* self);
static void _pdfpc_window_controllable_window_c_on_reload_pdfpc_presentation_controller_reload_request (pdfpcPresentationController* _sender,
                                                                                                 gpointer self);
VALA_EXTERN void pdfpc_window_controllable_window_restart_hide_cursor_timer (pdfpcWindowControllableWindow* self);
static void __lambda17_ (Block12Data* _data12_,
                  GtkWidget* source);
VALA_EXTERN void pdfpc_presentation_controller_quit (pdfpcPresentationController* self);
static void ___lambda17__gtk_widget_destroy (GtkWidget* _sender,
                                      gpointer self);
VALA_EXTERN void pdfpc_window_controllable_window_add_top_container (pdfpcWindowControllableWindow* self,
                                                         GtkWidget* top);
VALA_EXTERN gboolean pdfpc_window_controllable_window_get_interactive (pdfpcWindowControllableWindow* self);
VALA_EXTERN void pdfpc_window_controllable_window_register_presenter_handlers (pdfpcWindowControllableWindow* self,
                                                                   GtkWidget* top);
VALA_EXTERN void pdfpc_window_controllable_window_enable_pointer (pdfpcWindowControllableWindow* self,
                                                      gboolean onoff);
VALA_EXTERN void pdfpc_window_controllable_window_enable_pen (pdfpcWindowControllableWindow* self,
                                                  gboolean onoff);
VALA_EXTERN gboolean pdfpc_window_controllable_window_v_on_mouse_move (pdfpcWindowControllableWindow* self,
                                                           GtkWidget* source,
                                                           GdkEventMotion* event);
static gboolean _pdfpc_window_controllable_window_v_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                                                           GdkEventMotion* event,
                                                                                           gpointer self);
VALA_EXTERN gboolean pdfpc_window_controllable_window_v_on_enter_notify (pdfpcWindowControllableWindow* self);
static gboolean _pdfpc_window_controllable_window_v_on_enter_notify_gtk_widget_enter_notify_event (GtkWidget* _sender,
                                                                                            GdkEventCrossing* event,
                                                                                            gpointer self);
VALA_EXTERN gboolean pdfpc_window_controllable_window_v_on_leave_notify (pdfpcWindowControllableWindow* self);
static gboolean _pdfpc_window_controllable_window_v_on_leave_notify_gtk_widget_leave_notify_event (GtkWidget* _sender,
                                                                                            GdkEventCrossing* event,
                                                                                            gpointer self);
VALA_EXTERN gboolean pdfpc_window_controllable_window_v_on_button_press (pdfpcWindowControllableWindow* self,
                                                             GdkEventButton* event);
static gboolean _pdfpc_window_controllable_window_v_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                            GdkEventButton* event,
                                                                                            gpointer self);
VALA_EXTERN gboolean pdfpc_window_controllable_window_v_on_button_release (pdfpcWindowControllableWindow* self,
                                                               GdkEventButton* event);
static gboolean _pdfpc_window_controllable_window_v_on_button_release_gtk_widget_button_release_event (GtkWidget* _sender,
                                                                                                GdkEventButton* event,
                                                                                                gpointer self);
VALA_EXTERN gboolean pdfpc_window_controllable_window_w_on_key_press (pdfpcWindowControllableWindow* self,
                                                          GdkEventKey* key);
static gboolean _pdfpc_window_controllable_window_w_on_key_press_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                      GdkEventKey* event,
                                                                                      gpointer self);
VALA_EXTERN gboolean pdfpc_window_controllable_window_w_on_scroll (pdfpcWindowControllableWindow* self,
                                                       GdkEventScroll* scroll);
static gboolean _pdfpc_window_controllable_window_w_on_scroll_gtk_widget_scroll_event (GtkWidget* _sender,
                                                                                GdkEventScroll* event,
                                                                                gpointer self);
VALA_EXTERN gboolean pdfpc_window_controllable_window_w_on_button_press (pdfpcWindowControllableWindow* self,
                                                             GdkEventButton* button);
static gboolean _pdfpc_window_controllable_window_w_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                            GdkEventButton* event,
                                                                                            gpointer self);
VALA_EXTERN gpointer pdfpc_presentation_controller_pointer_tool_ref (gpointer instance);
VALA_EXTERN void pdfpc_presentation_controller_pointer_tool_unref (gpointer instance);
VALA_EXTERN GParamSpec* pdfpc_presentation_controller_param_spec_pointer_tool (const gchar* name,
                                                                   const gchar* nick,
                                                                   const gchar* blurb,
                                                                   GType object_type,
                                                                   GParamFlags flags);
VALA_EXTERN void pdfpc_presentation_controller_value_set_pointer_tool (GValue* value,
                                                           gpointer v_object);
VALA_EXTERN void pdfpc_presentation_controller_value_take_pointer_tool (GValue* value,
                                                            gpointer v_object);
VALA_EXTERN gpointer pdfpc_presentation_controller_value_get_pointer_tool (const GValue* value);
VALA_EXTERN GType pdfpc_presentation_controller_pointer_tool_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcPresentationControllerPointerTool, pdfpc_presentation_controller_pointer_tool_unref)
VALA_EXTERN pdfpcPresentationControllerPointerTool* pdfpc_presentation_controller_get_current_pointer (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_pointer_tool_get_is_spotlight (pdfpcPresentationControllerPointerTool* self);
VALA_EXTERN GType pdfpc_timer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcTimer, g_object_unref)
VALA_EXTERN GType pdfpc_presentation_controller_action_description_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcPresentationControllerActionDescription, g_object_unref)
VALA_EXTERN GType pdfpc_key_def_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcKeyDef, g_object_unref)
VALA_EXTERN GType pdfpc_presentation_controller_action_and_parameter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcPresentationControllerActionAndParameter, g_object_unref)
VALA_EXTERN GType screen_saver_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint screen_saver_register_object (void* object,
                                    GDBusConnection* connection,
                                    const gchar* path,
                                    GError** error);
VALA_EXTERN GType screen_saver_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScreenSaver, g_object_unref)
VALA_EXTERN GType pdfpc_drawings_drawing_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcDrawingsDrawing, g_object_unref)
VALA_EXTERN gpointer pdfpc_drawings_drawing_tool_ref (gpointer instance);
VALA_EXTERN void pdfpc_drawings_drawing_tool_unref (gpointer instance);
VALA_EXTERN GParamSpec* pdfpc_drawings_param_spec_drawing_tool (const gchar* name,
                                                    const gchar* nick,
                                                    const gchar* blurb,
                                                    GType object_type,
                                                    GParamFlags flags);
VALA_EXTERN void pdfpc_drawings_value_set_drawing_tool (GValue* value,
                                            gpointer v_object);
VALA_EXTERN void pdfpc_drawings_value_take_drawing_tool (GValue* value,
                                             gpointer v_object);
VALA_EXTERN gpointer pdfpc_drawings_value_get_drawing_tool (const GValue* value);
VALA_EXTERN GType pdfpc_drawings_drawing_tool_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcDrawingsDrawingTool, pdfpc_drawings_drawing_tool_unref)
VALA_EXTERN void pdfpc_presentation_controller_pointer_tool_get_rgba (pdfpcPresentationControllerPointerTool* self,
                                                          GdkRGBA* result);
VALA_EXTERN cairo_surface_t* pdfpc_drawings_drawing_render_to_surface (pdfpcDrawingsDrawing* self);
VALA_EXTERN gint pdfpc_drawings_drawing_get_width (pdfpcDrawingsDrawing* self);
VALA_EXTERN gint pdfpc_drawings_drawing_get_height (pdfpcDrawingsDrawing* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_in_drawing_mode (pdfpcPresentationController* self);
VALA_EXTERN gdouble pdfpc_drawings_drawing_tool_get_red (pdfpcDrawingsDrawingTool* self);
VALA_EXTERN gdouble pdfpc_drawings_drawing_tool_get_green (pdfpcDrawingsDrawingTool* self);
VALA_EXTERN gdouble pdfpc_drawings_drawing_tool_get_blue (pdfpcDrawingsDrawingTool* self);
VALA_EXTERN gdouble pdfpc_drawings_drawing_tool_get_width (pdfpcDrawingsDrawingTool* self);
VALA_EXTERN pdfpcKeyDef* pdfpc_key_def_new (guint k,
                                guint m);
VALA_EXTERN pdfpcKeyDef* pdfpc_key_def_construct (GType object_type,
                                      guint k,
                                      guint m);
VALA_EXTERN gboolean pdfpc_presentation_controller_on_key_press (pdfpcPresentationController* self,
                                                     pdfpcKeyDef* keydef);
VALA_EXTERN gboolean pdfpc_presentation_controller_on_button_press (pdfpcPresentationController* self,
                                                        pdfpcKeyDef* keydef);
VALA_EXTERN gboolean pdfpc_presentation_controller_on_scroll (pdfpcPresentationController* self,
                                                  gboolean up,
                                                  guint state);
VALA_EXTERN void pdfpc_window_controllable_window_device_to_normalized (pdfpcWindowControllableWindow* self,
                                                            gdouble dev_x,
                                                            gdouble dev_y,
                                                            gdouble* x,
                                                            gdouble* y);
VALA_EXTERN gboolean pdfpc_presentation_controller_in_pointing_mode (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_on_move_pointer (pdfpcPresentationController* self);
VALA_EXTERN GType pdfpc_presentation_controller_annotation_mode_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void pdfpc_presentation_controller_set_mode (pdfpcPresentationController* self,
                                             pdfpcPresentationControllerAnnotationMode mode);
VALA_EXTERN void pdfpc_presentation_controller_set_pen_pressure (pdfpcPresentationController* self,
                                                     gdouble pressure);
VALA_EXTERN gboolean pdfpc_presentation_controller_on_move_pen (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_on_enter_notify (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_on_leave_notify (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_is_pointer_active (pdfpcPresentationController* self);
VALA_EXTERN void pdfpc_presentation_controller_move_pen (pdfpcPresentationController* self,
                                             gdouble x,
                                             gdouble y);
VALA_EXTERN void pdfpc_presentation_controller_update_highlight (pdfpcPresentationController* self,
                                                     gdouble x,
                                                     gdouble y);
VALA_EXTERN gboolean pdfpc_window_controllable_window_on_hide_cursor_timeout (pdfpcWindowControllableWindow* self);
static gboolean _pdfpc_window_controllable_window_on_hide_cursor_timeout_gsource_func (gpointer self);
VALA_EXTERN void pdfpc_view_pdf_invalidate (pdfpcViewPdf* self);
VALA_EXTERN void pdfpc_view_pdf_display (pdfpcViewPdf* self,
                             gint slide_number,
                             gboolean force,
                             pdfpcPresentationControllerScaledRectangle* rect);
VALA_EXTERN gint pdfpc_presentation_controller_get_current_slide_number (pdfpcPresentationController* self);
VALA_EXTERN GType pdfpc_metadata_pdf_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcMetadataPdf, g_object_unref)
VALA_EXTERN pdfpcMetadataPdf* pdfpc_window_controllable_window_get_metadata (pdfpcWindowControllableWindow* self);
VALA_EXTERN pdfpcMetadataPdf* pdfpc_presentation_controller_get_metadata (pdfpcPresentationController* self);
static void pdfpc_window_controllable_window_finalize (GObject * obj);
static GType pdfpc_window_controllable_window_get_type_once (void);
static void _vala_pdfpc_window_controllable_window_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec);
static void _vala_pdfpc_window_controllable_window_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
pdfpc_window_controllable_window_get_instance_private (pdfpcWindowControllableWindow* self)
{
	return G_STRUCT_MEMBER_P (self, pdfpcWindowControllableWindow_private_offset);
}

/**
         * Base constructor instantiating a new controllable window
         */
static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static Block12Data*
block12_data_ref (Block12Data* _data12_)
{
	g_atomic_int_inc (&_data12_->_ref_count_);
	return _data12_;
}

static void
block12_data_unref (void * _userdata_)
{
	Block12Data* _data12_;
	_data12_ = (Block12Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data12_->_ref_count_)) {
		pdfpcWindowControllableWindow* self;
		self = _data12_->self;
		_g_object_unref0 (_data12_->controller);
		_g_object_unref0 (self);
		g_slice_free (Block12Data, _data12_);
	}
}

static void
__lambda14_ (pdfpcWindowControllableWindow* self)
{
	pdfpcViewVideo* _tmp0_;
	_tmp0_ = self->priv->_video_surface;
	pdfpc_window_controllable_window_set_widget_event_pass_through (self, (GtkWidget*) _tmp0_, TRUE);
}

static void
___lambda14__gtk_widget_realize (GtkWidget* _sender,
                                 gpointer self)
{
	__lambda14_ ((pdfpcWindowControllableWindow*) self);
}

static void
__lambda15_ (pdfpcWindowControllableWindow* self)
{
	GtkDrawingArea* _tmp0_;
	GdkWindow* _tmp1_;
	GtkDrawingArea* _tmp2_;
	_tmp0_ = self->priv->_pen_drawing_surface;
	_tmp1_ = gtk_widget_get_window ((GtkWidget*) _tmp0_);
	gdk_window_set_pass_through (_tmp1_, TRUE);
	_tmp2_ = self->priv->_pen_drawing_surface;
	pdfpc_window_controllable_window_set_widget_event_pass_through (self, (GtkWidget*) _tmp2_, TRUE);
}

static void
___lambda15__gtk_widget_realize (GtkWidget* _sender,
                                 gpointer self)
{
	__lambda15_ ((pdfpcWindowControllableWindow*) self);
}

static void
__lambda16_ (pdfpcWindowControllableWindow* self)
{
	GtkDrawingArea* _tmp0_;
	GdkWindow* _tmp1_;
	GtkDrawingArea* _tmp2_;
	_tmp0_ = self->priv->_pointer_drawing_surface;
	_tmp1_ = gtk_widget_get_window ((GtkWidget*) _tmp0_);
	gdk_window_set_pass_through (_tmp1_, TRUE);
	_tmp2_ = self->priv->_pointer_drawing_surface;
	pdfpc_window_controllable_window_set_widget_event_pass_through (self, (GtkWidget*) _tmp2_, TRUE);
}

static void
___lambda16__gtk_widget_realize (GtkWidget* _sender,
                                 gpointer self)
{
	__lambda16_ ((pdfpcWindowControllableWindow*) self);
}

static gboolean
_pdfpc_window_controllable_window_draw_pointer_gtk_widget_draw (GtkWidget* _sender,
                                                                cairo_t* cr,
                                                                gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_draw_pointer ((pdfpcWindowControllableWindow*) self, cr);
	return result;
}

static gboolean
_pdfpc_window_controllable_window_draw_pen_gtk_widget_draw (GtkWidget* _sender,
                                                            cairo_t* cr,
                                                            gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_draw_pen ((pdfpcWindowControllableWindow*) self, cr);
	return result;
}

static void
_pdfpc_window_controllable_window_c_on_zoom_pdfpc_presentation_controller_zoom_request (pdfpcPresentationController* _sender,
                                                                                        pdfpcPresentationControllerScaledRectangle* rect,
                                                                                        gpointer self)
{
	pdfpc_window_controllable_window_c_on_zoom ((pdfpcWindowControllableWindow*) self, rect);
}

static void
_pdfpc_window_controllable_window_c_on_reload_pdfpc_presentation_controller_reload_request (pdfpcPresentationController* _sender,
                                                                                            gpointer self)
{
	pdfpc_window_controllable_window_c_on_reload ((pdfpcWindowControllableWindow*) self);
}

static void
__lambda17_ (Block12Data* _data12_,
             GtkWidget* source)
{
	pdfpcWindowControllableWindow* self;
	self = _data12_->self;
	g_return_if_fail (source != NULL);
	pdfpc_presentation_controller_quit (_data12_->controller);
}

static void
___lambda17__gtk_widget_destroy (GtkWidget* _sender,
                                 gpointer self)
{
	__lambda17_ (self, _sender);
}

pdfpcWindowControllableWindow*
pdfpc_window_controllable_window_construct (GType object_type,
                                            pdfpcPresentationController* controller,
                                            gboolean interactive,
                                            gint monitor_num,
                                            gboolean windowed,
                                            gint width,
                                            gint height)
{
	pdfpcWindowControllableWindow * self = NULL;
	Block12Data* _data12_;
	pdfpcPresentationController* _tmp0_;
	GtkOverlay* _tmp1_;
	pdfpcViewPdf* _tmp2_;
	pdfpcViewPdf* _tmp3_;
	GtkDrawingArea* _tmp4_;
	GtkDrawingArea* _tmp5_;
	GtkDrawingArea* _tmp6_;
	GtkDrawingArea* _tmp7_;
	pdfpcViewVideo* _tmp8_;
	pdfpcViewVideo* _tmp9_;
	GtkOverlay* _tmp10_;
	pdfpcViewPdf* _tmp11_;
	pdfpcViewPdf* _tmp12_;
	GtkOverlay* _tmp13_;
	pdfpcViewVideo* _tmp14_;
	GtkOverlay* _tmp15_;
	GtkDrawingArea* _tmp16_;
	GtkOverlay* _tmp17_;
	GtkDrawingArea* _tmp18_;
	GtkDrawingArea* _tmp19_;
	GtkDrawingArea* _tmp20_;
	pdfpcViewVideo* _tmp21_;
	GtkDrawingArea* _tmp22_;
	GtkDrawingArea* _tmp23_;
	GtkDrawingArea* _tmp24_;
	GtkDrawingArea* _tmp25_;
	pdfpcPresentationController* _tmp26_;
	pdfpcPresentationController* _tmp27_;
	pdfpcPresentationController* _tmp28_;
	pdfpcPresentationController* _tmp29_;
	g_return_val_if_fail (controller != NULL, NULL);
	_data12_ = g_slice_new0 (Block12Data);
	_data12_->_ref_count_ = 1;
	_tmp0_ = _g_object_ref0 (controller);
	_g_object_unref0 (_data12_->controller);
	_data12_->controller = _tmp0_;
	self = (pdfpcWindowControllableWindow*) pdfpc_window_fullscreen_construct (object_type, monitor_num, windowed, width, height);
	_data12_->self = g_object_ref (self);
	pdfpc_controllable_set_controller ((pdfpcControllable*) self, _data12_->controller);
	pdfpc_window_controllable_window_set_interactive (self, interactive);
	_tmp1_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->overlay_layout);
	self->overlay_layout = _tmp1_;
	_tmp2_ = pdfpc_view_pdf_new_from_controllable_window (self, FALSE, TRUE, FALSE);
	g_object_ref_sink (_tmp2_);
	_tmp3_ = _tmp2_;
	pdfpc_controllable_set_main_view ((pdfpcControllable*) self, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = (GtkDrawingArea*) gtk_drawing_area_new ();
	g_object_ref_sink (_tmp4_);
	_tmp5_ = _tmp4_;
	pdfpc_window_controllable_window_set_pointer_drawing_surface (self, _tmp5_);
	_g_object_unref0 (_tmp5_);
	_tmp6_ = (GtkDrawingArea*) gtk_drawing_area_new ();
	g_object_ref_sink (_tmp6_);
	_tmp7_ = _tmp6_;
	pdfpc_window_controllable_window_set_pen_drawing_surface (self, _tmp7_);
	_g_object_unref0 (_tmp7_);
	_tmp8_ = pdfpc_view_video_new ();
	g_object_ref_sink (_tmp8_);
	_tmp9_ = _tmp8_;
	pdfpc_window_controllable_window_set_video_surface (self, _tmp9_);
	_g_object_unref0 (_tmp9_);
	_tmp10_ = self->overlay_layout;
	_tmp11_ = pdfpc_controllable_get_main_view ((pdfpcControllable*) self);
	_tmp12_ = _tmp11_;
	gtk_container_add ((GtkContainer*) _tmp10_, (GtkWidget*) _tmp12_);
	_tmp13_ = self->overlay_layout;
	_tmp14_ = self->priv->_video_surface;
	gtk_overlay_add_overlay (_tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = self->overlay_layout;
	_tmp16_ = self->priv->_pen_drawing_surface;
	gtk_overlay_add_overlay (_tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = self->overlay_layout;
	_tmp18_ = self->priv->_pointer_drawing_surface;
	gtk_overlay_add_overlay (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = self->priv->_pointer_drawing_surface;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp19_, TRUE);
	_tmp20_ = self->priv->_pen_drawing_surface;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp20_, TRUE);
	_tmp21_ = self->priv->_video_surface;
	g_signal_connect_object ((GtkWidget*) _tmp21_, "realize", (GCallback) ___lambda14__gtk_widget_realize, self, 0);
	_tmp22_ = self->priv->_pen_drawing_surface;
	g_signal_connect_object ((GtkWidget*) _tmp22_, "realize", (GCallback) ___lambda15__gtk_widget_realize, self, 0);
	_tmp23_ = self->priv->_pointer_drawing_surface;
	g_signal_connect_object ((GtkWidget*) _tmp23_, "realize", (GCallback) ___lambda16__gtk_widget_realize, self, 0);
	_tmp24_ = self->priv->_pointer_drawing_surface;
	g_signal_connect_object ((GtkWidget*) _tmp24_, "draw", (GCallback) _pdfpc_window_controllable_window_draw_pointer_gtk_widget_draw, self, 0);
	_tmp25_ = self->priv->_pen_drawing_surface;
	g_signal_connect_object ((GtkWidget*) _tmp25_, "draw", (GCallback) _pdfpc_window_controllable_window_draw_pen_gtk_widget_draw, self, 0);
	_tmp26_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp27_ = _tmp26_;
	g_signal_connect_object (_tmp27_, "zoom-request", (GCallback) _pdfpc_window_controllable_window_c_on_zoom_pdfpc_presentation_controller_zoom_request, self, 0);
	_tmp28_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp29_ = _tmp28_;
	g_signal_connect_object (_tmp29_, "reload-request", (GCallback) _pdfpc_window_controllable_window_c_on_reload_pdfpc_presentation_controller_reload_request, self, 0);
	pdfpc_window_controllable_window_restart_hide_cursor_timer (self);
	g_signal_connect_data ((GtkWidget*) self, "destroy", (GCallback) ___lambda17__gtk_widget_destroy, block12_data_ref (_data12_), (GClosureNotify) block12_data_unref, 0);
	block12_data_unref (_data12_);
	_data12_ = NULL;
	return self;
}

pdfpcWindowControllableWindow*
pdfpc_window_controllable_window_new (pdfpcPresentationController* controller,
                                      gboolean interactive,
                                      gint monitor_num,
                                      gboolean windowed,
                                      gint width,
                                      gint height)
{
	return pdfpc_window_controllable_window_construct (PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW, controller, interactive, monitor_num, windowed, width, height);
}

void
pdfpc_window_controllable_window_add_top_container (pdfpcWindowControllableWindow* self,
                                                    GtkWidget* top)
{
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (top != NULL);
	gtk_container_add ((GtkContainer*) self, top);
	_tmp0_ = self->priv->_interactive;
	if (_tmp0_) {
		pdfpc_window_controllable_window_register_presenter_handlers (self, top);
	}
}

void
pdfpc_window_controllable_window_enable_pointer (pdfpcWindowControllableWindow* self,
                                                 gboolean onoff)
{
	g_return_if_fail (self != NULL);
	if (onoff) {
		GtkDrawingArea* _tmp0_;
		_tmp0_ = self->priv->_pointer_drawing_surface;
		gtk_widget_show ((GtkWidget*) _tmp0_);
	} else {
		GtkDrawingArea* _tmp1_;
		_tmp1_ = self->priv->_pointer_drawing_surface;
		gtk_widget_hide ((GtkWidget*) _tmp1_);
	}
}

void
pdfpc_window_controllable_window_enable_pen (pdfpcWindowControllableWindow* self,
                                             gboolean onoff)
{
	g_return_if_fail (self != NULL);
	if (onoff) {
		GtkDrawingArea* _tmp0_;
		_tmp0_ = self->priv->_pen_drawing_surface;
		gtk_widget_show ((GtkWidget*) _tmp0_);
	} else {
		GtkDrawingArea* _tmp1_;
		_tmp1_ = self->priv->_pen_drawing_surface;
		gtk_widget_hide ((GtkWidget*) _tmp1_);
	}
}

static gboolean
_pdfpc_window_controllable_window_v_on_mouse_move_gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                                                  GdkEventMotion* event,
                                                                                  gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_v_on_mouse_move ((pdfpcWindowControllableWindow*) self, _sender, event);
	return result;
}

static gboolean
_pdfpc_window_controllable_window_v_on_enter_notify_gtk_widget_enter_notify_event (GtkWidget* _sender,
                                                                                   GdkEventCrossing* event,
                                                                                   gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_v_on_enter_notify ((pdfpcWindowControllableWindow*) self);
	return result;
}

static gboolean
_pdfpc_window_controllable_window_v_on_leave_notify_gtk_widget_leave_notify_event (GtkWidget* _sender,
                                                                                   GdkEventCrossing* event,
                                                                                   gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_v_on_leave_notify ((pdfpcWindowControllableWindow*) self);
	return result;
}

static gboolean
_pdfpc_window_controllable_window_v_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                   GdkEventButton* event,
                                                                                   gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_v_on_button_press ((pdfpcWindowControllableWindow*) self, event);
	return result;
}

static gboolean
_pdfpc_window_controllable_window_v_on_button_release_gtk_widget_button_release_event (GtkWidget* _sender,
                                                                                       GdkEventButton* event,
                                                                                       gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_v_on_button_release ((pdfpcWindowControllableWindow*) self, event);
	return result;
}

static gboolean
_pdfpc_window_controllable_window_w_on_key_press_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                             GdkEventKey* event,
                                                                             gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_w_on_key_press ((pdfpcWindowControllableWindow*) self, event);
	return result;
}

static gboolean
_pdfpc_window_controllable_window_w_on_scroll_gtk_widget_scroll_event (GtkWidget* _sender,
                                                                       GdkEventScroll* event,
                                                                       gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_w_on_scroll ((pdfpcWindowControllableWindow*) self, event);
	return result;
}

static gboolean
_pdfpc_window_controllable_window_w_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                                   GdkEventButton* event,
                                                                                   gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_w_on_button_press ((pdfpcWindowControllableWindow*) self, event);
	return result;
}

void
pdfpc_window_controllable_window_register_presenter_handlers (pdfpcWindowControllableWindow* self,
                                                              GtkWidget* top)
{
	pdfpcViewPdf* view = NULL;
	pdfpcViewPdf* _tmp0_;
	pdfpcViewPdf* _tmp1_;
	pdfpcViewPdf* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (top != NULL);
	_tmp0_ = pdfpc_controllable_get_main_view ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	view = _tmp2_;
	gtk_widget_add_events ((GtkWidget*) view, (gint) (GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK));
	g_signal_connect_object ((GtkWidget*) view, "motion-notify-event", (GCallback) _pdfpc_window_controllable_window_v_on_mouse_move_gtk_widget_motion_notify_event, self, 0);
	g_signal_connect_object ((GtkWidget*) view, "enter-notify-event", (GCallback) _pdfpc_window_controllable_window_v_on_enter_notify_gtk_widget_enter_notify_event, self, 0);
	g_signal_connect_object ((GtkWidget*) view, "leave-notify-event", (GCallback) _pdfpc_window_controllable_window_v_on_leave_notify_gtk_widget_leave_notify_event, self, 0);
	g_signal_connect_object ((GtkWidget*) view, "button-press-event", (GCallback) _pdfpc_window_controllable_window_v_on_button_press_gtk_widget_button_press_event, self, 0);
	g_signal_connect_object ((GtkWidget*) view, "button-release-event", (GCallback) _pdfpc_window_controllable_window_v_on_button_release_gtk_widget_button_release_event, self, 0);
	g_signal_connect_object ((GtkWidget*) self, "key-press-event", (GCallback) _pdfpc_window_controllable_window_w_on_key_press_gtk_widget_key_press_event, self, 0);
	gtk_widget_add_events ((GtkWidget*) self, (gint) GDK_SCROLL_MASK);
	g_signal_connect_object ((GtkWidget*) self, "scroll-event", (GCallback) _pdfpc_window_controllable_window_w_on_scroll_gtk_widget_scroll_event, self, 0);
	g_signal_connect_object (top, "button-press-event", (GCallback) _pdfpc_window_controllable_window_w_on_button_press_gtk_widget_button_press_event, self, 0);
	_g_object_unref0 (view);
}

/**
         * Set the widget passthrough.
         *
         * If set to true, the widget will not receive events and they will be
         * forwarded to the underlying widgets within the Gtk.Overlay
         */
void
pdfpc_window_controllable_window_set_widget_event_pass_through (pdfpcWindowControllableWindow* self,
                                                                GtkWidget* w,
                                                                gboolean pass_through)
{
	GtkOverlay* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (w != NULL);
	_tmp0_ = self->overlay_layout;
	gtk_overlay_set_overlay_pass_through (_tmp0_, w, pass_through);
}

gboolean
pdfpc_window_controllable_window_draw_pointer (pdfpcWindowControllableWindow* self,
                                               cairo_t* context)
{
	GtkAllocation a = {0};
	GtkDrawingArea* _tmp0_;
	GtkAllocation _tmp1_ = {0};
	pdfpcPresentationController* c = NULL;
	pdfpcPresentationController* _tmp2_;
	pdfpcPresentationController* _tmp3_;
	pdfpcPresentationController* _tmp4_;
	gboolean _tmp5_ = FALSE;
	gboolean _tmp6_ = FALSE;
	pdfpcPresentationController* _tmp7_;
	pdfpcPresentationControllerPointerTool* _tmp8_;
	pdfpcPresentationControllerPointerTool* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp30_ = FALSE;
	pdfpcPresentationController* _tmp31_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (context != NULL, FALSE);
	_tmp0_ = self->priv->_pointer_drawing_surface;
	gtk_widget_get_allocation ((GtkWidget*) _tmp0_, &_tmp1_);
	a = _tmp1_;
	_tmp2_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	c = _tmp4_;
	_tmp7_ = c;
	_tmp8_ = pdfpc_presentation_controller_get_current_pointer (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = pdfpc_presentation_controller_pointer_tool_get_is_spotlight (_tmp9_);
	_tmp11_ = _tmp10_;
	if (!_tmp11_) {
		pdfpcPresentationController* _tmp12_;
		pdfpcPresentationControllerScaledRectangle _tmp13_;
		_tmp12_ = c;
		_tmp13_ = _tmp12_->highlight;
		_tmp6_ = _tmp13_.width > 0.01;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		pdfpcPresentationController* _tmp14_;
		pdfpcPresentationControllerScaledRectangle _tmp15_;
		_tmp14_ = c;
		_tmp15_ = _tmp14_->highlight;
		_tmp5_ = _tmp15_.height > 0.01;
	} else {
		_tmp5_ = FALSE;
	}
	if (_tmp5_) {
		GtkAllocation _tmp16_;
		GtkAllocation _tmp17_;
		pdfpcPresentationController* _tmp18_;
		pdfpcPresentationControllerScaledRectangle _tmp19_;
		GtkAllocation _tmp20_;
		pdfpcPresentationController* _tmp21_;
		pdfpcPresentationControllerScaledRectangle _tmp22_;
		GtkAllocation _tmp23_;
		pdfpcPresentationController* _tmp24_;
		pdfpcPresentationControllerScaledRectangle _tmp25_;
		GtkAllocation _tmp26_;
		pdfpcPresentationController* _tmp27_;
		pdfpcPresentationControllerScaledRectangle _tmp28_;
		GtkAllocation _tmp29_;
		_tmp16_ = a;
		_tmp17_ = a;
		cairo_rectangle (context, (gdouble) 0, (gdouble) 0, (gdouble) _tmp16_.width, (gdouble) _tmp17_.height);
		cairo_new_sub_path (context);
		_tmp18_ = c;
		_tmp19_ = _tmp18_->highlight;
		_tmp20_ = a;
		_tmp21_ = c;
		_tmp22_ = _tmp21_->highlight;
		_tmp23_ = a;
		_tmp24_ = c;
		_tmp25_ = _tmp24_->highlight;
		_tmp26_ = a;
		_tmp27_ = c;
		_tmp28_ = _tmp27_->highlight;
		_tmp29_ = a;
		cairo_rectangle (context, (gdouble) ((gint) (_tmp19_.x * _tmp20_.width)), (gdouble) ((gint) (_tmp22_.y * _tmp23_.height)), (gdouble) ((gint) (_tmp25_.width * _tmp26_.width)), (gdouble) ((gint) (_tmp28_.height * _tmp29_.height)));
		cairo_set_fill_rule (context, CAIRO_FILL_RULE_EVEN_ODD);
		cairo_set_source_rgba (context, (gdouble) 0, (gdouble) 0, (gdouble) 0, 0.5);
		cairo_fill_preserve (context);
		cairo_new_path (context);
	}
	_tmp31_ = c;
	if (_tmp31_->drag_x == ((gdouble) -1)) {
		gboolean _tmp32_ = FALSE;
		pdfpcPresentationController* _tmp33_;
		_tmp33_ = c;
		if (!_tmp33_->pointer_hidden) {
			_tmp32_ = TRUE;
		} else {
			pdfpcPresentationController* _tmp34_;
			pdfpcPresentationControllerPointerTool* _tmp35_;
			pdfpcPresentationControllerPointerTool* _tmp36_;
			gboolean _tmp37_;
			gboolean _tmp38_;
			_tmp34_ = c;
			_tmp35_ = pdfpc_presentation_controller_get_current_pointer (_tmp34_);
			_tmp36_ = _tmp35_;
			_tmp37_ = pdfpc_presentation_controller_pointer_tool_get_is_spotlight (_tmp36_);
			_tmp38_ = _tmp37_;
			_tmp32_ = _tmp38_;
		}
		_tmp30_ = _tmp32_;
	} else {
		_tmp30_ = FALSE;
	}
	if (_tmp30_) {
		gint x = 0;
		GtkAllocation _tmp39_;
		pdfpcPresentationController* _tmp40_;
		gint y = 0;
		GtkAllocation _tmp41_;
		pdfpcPresentationController* _tmp42_;
		gint r = 0;
		GtkAllocation _tmp43_;
		pdfpcPresentationController* _tmp44_;
		pdfpcPresentationControllerPointerTool* _tmp45_;
		pdfpcPresentationControllerPointerTool* _tmp46_;
		GdkRGBA rgba = {0};
		pdfpcPresentationController* _tmp47_;
		pdfpcPresentationControllerPointerTool* _tmp48_;
		pdfpcPresentationControllerPointerTool* _tmp49_;
		GdkRGBA _tmp50_ = {0};
		GdkRGBA _tmp51_;
		GdkRGBA _tmp52_;
		GdkRGBA _tmp53_;
		GdkRGBA _tmp54_;
		pdfpcPresentationController* _tmp55_;
		pdfpcPresentationControllerPointerTool* _tmp56_;
		pdfpcPresentationControllerPointerTool* _tmp57_;
		gboolean _tmp58_;
		gboolean _tmp59_;
		_tmp39_ = a;
		_tmp40_ = c;
		x = (gint) (_tmp39_.width * _tmp40_->pointer_x);
		_tmp41_ = a;
		_tmp42_ = c;
		y = (gint) (_tmp41_.height * _tmp42_->pointer_y);
		_tmp43_ = a;
		_tmp44_ = c;
		_tmp45_ = pdfpc_presentation_controller_get_current_pointer (_tmp44_);
		_tmp46_ = _tmp45_;
		r = (gint) ((_tmp43_.height * 0.001) * _tmp46_->size);
		_tmp47_ = c;
		_tmp48_ = pdfpc_presentation_controller_get_current_pointer (_tmp47_);
		_tmp49_ = _tmp48_;
		pdfpc_presentation_controller_pointer_tool_get_rgba (_tmp49_, &_tmp50_);
		rgba = _tmp50_;
		_tmp51_ = rgba;
		_tmp52_ = rgba;
		_tmp53_ = rgba;
		_tmp54_ = rgba;
		cairo_set_source_rgba (context, _tmp51_.red, _tmp52_.green, _tmp53_.blue, _tmp54_.alpha);
		_tmp55_ = c;
		_tmp56_ = pdfpc_presentation_controller_get_current_pointer (_tmp55_);
		_tmp57_ = _tmp56_;
		_tmp58_ = pdfpc_presentation_controller_pointer_tool_get_is_spotlight (_tmp57_);
		_tmp59_ = _tmp58_;
		if (_tmp59_) {
			GtkAllocation _tmp60_;
			GtkAllocation _tmp61_;
			_tmp60_ = a;
			_tmp61_ = a;
			cairo_rectangle (context, (gdouble) 0, (gdouble) 0, (gdouble) _tmp60_.width, (gdouble) _tmp61_.height);
			cairo_new_sub_path (context);
			cairo_set_fill_rule (context, CAIRO_FILL_RULE_EVEN_ODD);
		}
		cairo_arc (context, (gdouble) x, (gdouble) y, (gdouble) r, (gdouble) 0, 2 * G_PI);
		cairo_fill (context);
	}
	result = TRUE;
	_g_object_unref0 (c);
	return result;
}

gboolean
pdfpc_window_controllable_window_draw_pen (pdfpcWindowControllableWindow* self,
                                           cairo_t* context)
{
	GtkAllocation a = {0};
	GtkDrawingArea* _tmp0_;
	GtkAllocation _tmp1_ = {0};
	pdfpcPresentationController* c = NULL;
	pdfpcPresentationController* _tmp2_;
	pdfpcPresentationController* _tmp3_;
	pdfpcPresentationController* _tmp4_;
	pdfpcPresentationController* _tmp5_;
	pdfpcDrawingsDrawing* _tmp6_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (context != NULL, FALSE);
	_tmp0_ = self->priv->_pen_drawing_surface;
	gtk_widget_get_allocation ((GtkWidget*) _tmp0_, &_tmp1_);
	a = _tmp1_;
	_tmp2_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	c = _tmp4_;
	_tmp5_ = c;
	_tmp6_ = _tmp5_->pen_drawing;
	if (_tmp6_ != NULL) {
		cairo_surface_t* drawing_surface = NULL;
		pdfpcPresentationController* _tmp7_;
		pdfpcDrawingsDrawing* _tmp8_;
		cairo_surface_t* _tmp9_;
		gint x = 0;
		GtkAllocation _tmp10_;
		pdfpcPresentationController* _tmp11_;
		gint y = 0;
		GtkAllocation _tmp12_;
		pdfpcPresentationController* _tmp13_;
		gint base_width = 0;
		pdfpcPresentationController* _tmp14_;
		pdfpcDrawingsDrawing* _tmp15_;
		gint _tmp16_;
		gint _tmp17_;
		gint base_height = 0;
		pdfpcPresentationController* _tmp18_;
		pdfpcDrawingsDrawing* _tmp19_;
		gint _tmp20_;
		gint _tmp21_;
		cairo_matrix_t old_xform = {0};
		cairo_matrix_t _tmp22_ = {0};
		GtkAllocation _tmp23_;
		GtkAllocation _tmp24_;
		cairo_surface_t* _tmp25_;
		cairo_matrix_t _tmp26_;
		gboolean _tmp27_ = FALSE;
		gboolean _tmp28_ = FALSE;
		gboolean _tmp29_;
		_tmp7_ = c;
		_tmp8_ = _tmp7_->pen_drawing;
		_tmp9_ = pdfpc_drawings_drawing_render_to_surface (_tmp8_);
		drawing_surface = _tmp9_;
		_tmp10_ = a;
		_tmp11_ = c;
		x = (gint) (_tmp10_.width * _tmp11_->pen_last_x);
		_tmp12_ = a;
		_tmp13_ = c;
		y = (gint) (_tmp12_.height * _tmp13_->pen_last_y);
		_tmp14_ = c;
		_tmp15_ = _tmp14_->pen_drawing;
		_tmp16_ = pdfpc_drawings_drawing_get_width (_tmp15_);
		_tmp17_ = _tmp16_;
		base_width = _tmp17_;
		_tmp18_ = c;
		_tmp19_ = _tmp18_->pen_drawing;
		_tmp20_ = pdfpc_drawings_drawing_get_height (_tmp19_);
		_tmp21_ = _tmp20_;
		base_height = _tmp21_;
		cairo_get_matrix (context, &_tmp22_);
		old_xform = _tmp22_;
		_tmp23_ = a;
		_tmp24_ = a;
		cairo_scale (context, ((gdouble) _tmp23_.width) / base_width, ((gdouble) _tmp24_.height) / base_height);
		_tmp25_ = drawing_surface;
		cairo_set_source_surface (context, _tmp25_, (gdouble) 0, (gdouble) 0);
		cairo_paint (context);
		_tmp26_ = old_xform;
		cairo_set_matrix (context, &_tmp26_);
		_tmp29_ = self->priv->_interactive;
		if (_tmp29_) {
			pdfpcPresentationController* _tmp30_;
			_tmp30_ = c;
			_tmp28_ = pdfpc_presentation_controller_in_drawing_mode (_tmp30_);
		} else {
			_tmp28_ = FALSE;
		}
		if (_tmp28_) {
			pdfpcPresentationController* _tmp31_;
			_tmp31_ = c;
			_tmp27_ = !_tmp31_->pointer_hidden;
		} else {
			_tmp27_ = FALSE;
		}
		if (_tmp27_) {
			gdouble width_adjustment = 0.0;
			GtkAllocation _tmp32_;
			pdfpcPresentationController* _tmp33_;
			pdfpcDrawingsDrawingTool* _tmp34_;
			gdouble _tmp35_;
			gdouble _tmp36_;
			pdfpcPresentationController* _tmp37_;
			pdfpcDrawingsDrawingTool* _tmp38_;
			gdouble _tmp39_;
			gdouble _tmp40_;
			pdfpcPresentationController* _tmp41_;
			pdfpcDrawingsDrawingTool* _tmp42_;
			gdouble _tmp43_;
			gdouble _tmp44_;
			gdouble arc_radius = 0.0;
			pdfpcPresentationController* _tmp45_;
			pdfpcDrawingsDrawingTool* _tmp46_;
			gdouble _tmp47_;
			gdouble _tmp48_;
			_tmp32_ = a;
			width_adjustment = ((gdouble) _tmp32_.width) / base_width;
			cairo_set_operator (context, CAIRO_OPERATOR_OVER);
			cairo_set_line_width (context, 2.0);
			_tmp33_ = c;
			_tmp34_ = _tmp33_->current_pen_drawing_tool;
			_tmp35_ = pdfpc_drawings_drawing_tool_get_red (_tmp34_);
			_tmp36_ = _tmp35_;
			_tmp37_ = c;
			_tmp38_ = _tmp37_->current_pen_drawing_tool;
			_tmp39_ = pdfpc_drawings_drawing_tool_get_green (_tmp38_);
			_tmp40_ = _tmp39_;
			_tmp41_ = c;
			_tmp42_ = _tmp41_->current_pen_drawing_tool;
			_tmp43_ = pdfpc_drawings_drawing_tool_get_blue (_tmp42_);
			_tmp44_ = _tmp43_;
			cairo_set_source_rgba (context, _tmp36_, _tmp40_, _tmp44_, 1.0);
			_tmp45_ = c;
			_tmp46_ = _tmp45_->current_pen_drawing_tool;
			_tmp47_ = pdfpc_drawings_drawing_tool_get_width (_tmp46_);
			_tmp48_ = _tmp47_;
			arc_radius = (_tmp48_ * width_adjustment) / 2.0;
			if (arc_radius < 1.0) {
				arc_radius = 1.0;
			}
			cairo_arc (context, (gdouble) x, (gdouble) y, arc_radius, (gdouble) 0, 2 * G_PI);
			cairo_stroke (context);
		}
		_cairo_surface_destroy0 (drawing_surface);
	}
	result = TRUE;
	_g_object_unref0 (c);
	return result;
}

/**
         * Handle keypresses
         */
gboolean
pdfpc_window_controllable_window_w_on_key_press (pdfpcWindowControllableWindow* self,
                                                 GdkEventKey* key)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	if (key->time != ((guint32) self->last_key_ev_time)) {
		gboolean _tmp0_ = FALSE;
		pdfpcKeyDef* keydef = NULL;
		pdfpcKeyDef* _tmp1_;
		pdfpcPresentationController* _tmp2_;
		pdfpcPresentationController* _tmp3_;
		pdfpcKeyDef* _tmp4_;
		self->last_key_ev_time = (guint) key->time;
		if (g_ascii_ispunct ((gchar) key->keyval)) {
			_tmp0_ = TRUE;
		} else {
			_tmp0_ = g_ascii_isdigit ((gchar) key->keyval);
		}
		if (_tmp0_) {
			key->state = key->state & (~GDK_SHIFT_MASK);
		}
		_tmp1_ = pdfpc_key_def_new (key->keyval, (guint) (key->state & self->accepted_key_mods));
		keydef = _tmp1_;
		_tmp2_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = keydef;
		result = pdfpc_presentation_controller_on_key_press (_tmp3_, _tmp4_);
		_g_object_unref0 (keydef);
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

/**
         * Handle mouse clicks
         */
gboolean
pdfpc_window_controllable_window_w_on_button_press (pdfpcWindowControllableWindow* self,
                                                    GdkEventButton* button)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (button != NULL, FALSE);
	if (button->type == GDK_BUTTON_PRESS) {
		pdfpcKeyDef* keydef = NULL;
		pdfpcKeyDef* _tmp0_;
		pdfpcPresentationController* _tmp1_;
		pdfpcPresentationController* _tmp2_;
		pdfpcKeyDef* _tmp3_;
		_tmp0_ = pdfpc_key_def_new (button->button, (guint) (button->state & self->accepted_key_mods));
		keydef = _tmp0_;
		_tmp1_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp2_ = _tmp1_;
		_tmp3_ = keydef;
		result = pdfpc_presentation_controller_on_button_press (_tmp2_, _tmp3_);
		_g_object_unref0 (keydef);
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

/**
         * Handle mouse scrolling
         */
gboolean
pdfpc_window_controllable_window_w_on_scroll (pdfpcWindowControllableWindow* self,
                                              GdkEventScroll* scroll)
{
	gboolean up = FALSE;
	gboolean down = FALSE;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (scroll != NULL, FALSE);
	up = FALSE;
	down = FALSE;
	switch (scroll->direction) {
		case GDK_SCROLL_UP:
		case GDK_SCROLL_LEFT:
		{
			up = TRUE;
			break;
		}
		case GDK_SCROLL_DOWN:
		case GDK_SCROLL_RIGHT:
		{
			down = TRUE;
			break;
		}
		case GDK_SCROLL_SMOOTH:
		{
			gdouble dx = 0.0;
			gdouble dy = 0.0;
			gdouble _tmp0_ = 0.0;
			gdouble _tmp1_ = 0.0;
			gboolean _tmp2_ = FALSE;
			gdk_event_get_scroll_deltas ((GdkEvent*) scroll, &_tmp0_, &_tmp1_);
			dx = _tmp0_;
			dy = _tmp1_;
			if (dx > ((gdouble) 0)) {
				_tmp2_ = TRUE;
			} else {
				_tmp2_ = dy > ((gdouble) 0);
			}
			if (_tmp2_) {
				down = TRUE;
			} else {
				gboolean _tmp3_ = FALSE;
				if (dx < ((gdouble) 0)) {
					_tmp3_ = TRUE;
				} else {
					_tmp3_ = dy < ((gdouble) 0);
				}
				if (_tmp3_) {
					up = TRUE;
				}
			}
			break;
		}
		default:
		{
			break;
		}
	}
	if (up) {
		pdfpcPresentationController* _tmp4_;
		pdfpcPresentationController* _tmp5_;
		_tmp4_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp5_ = _tmp4_;
		result = pdfpc_presentation_controller_on_scroll (_tmp5_, TRUE, (guint) scroll->state);
		return result;
	} else {
		if (down) {
			pdfpcPresentationController* _tmp6_;
			pdfpcPresentationController* _tmp7_;
			_tmp6_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
			_tmp7_ = _tmp6_;
			result = pdfpc_presentation_controller_on_scroll (_tmp7_, FALSE, (guint) scroll->state);
			return result;
		} else {
			result = FALSE;
			return result;
		}
	}
}

/**
         * Called every time the mouse is moved
         */
gboolean
pdfpc_window_controllable_window_v_on_mouse_move (pdfpcWindowControllableWindow* self,
                                                  GtkWidget* source,
                                                  GdkEventMotion* event)
{
	pdfpcPresentationController* _tmp1_;
	pdfpcPresentationController* _tmp2_;
	pdfpcPresentationController* _tmp3_;
	pdfpcPresentationController* _tmp4_;
	gdouble _tmp5_ = 0.0;
	gdouble _tmp6_ = 0.0;
	pdfpcPresentationController* _tmp7_;
	pdfpcPresentationController* _tmp8_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (source != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	if (self->cursor_blanked) {
		GdkWindow* _tmp0_;
		_tmp0_ = event->window;
		gdk_window_set_cursor (_tmp0_, NULL);
		self->cursor_blanked = FALSE;
	}
	pdfpc_window_controllable_window_restart_hide_cursor_timer (self);
	_tmp1_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp4_ = _tmp3_;
	pdfpc_window_controllable_window_device_to_normalized (self, event->x, event->y, &_tmp5_, &_tmp6_);
	_tmp2_->pointer_x = _tmp5_;
	_tmp4_->pointer_y = _tmp6_;
	_tmp7_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp8_ = _tmp7_;
	if (pdfpc_presentation_controller_in_pointing_mode (_tmp8_)) {
		pdfpcPresentationController* _tmp9_;
		pdfpcPresentationController* _tmp10_;
		_tmp9_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp10_ = _tmp9_;
		result = pdfpc_presentation_controller_on_move_pointer (_tmp10_);
		return result;
	} else {
		pdfpcPresentationController* _tmp11_;
		pdfpcPresentationController* _tmp12_;
		_tmp11_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp12_ = _tmp11_;
		if (pdfpc_presentation_controller_in_drawing_mode (_tmp12_)) {
			GdkDevice* dev = NULL;
			GdkDevice* _tmp13_;
			GdkDevice* _tmp14_;
			gboolean _tmp20_ = FALSE;
			pdfpcPresentationController* _tmp29_;
			pdfpcPresentationController* _tmp30_;
			_tmp13_ = gdk_event_get_source_device ((GdkEvent*) event);
			_tmp14_ = _g_object_ref0 (_tmp13_);
			dev = _tmp14_;
			if (!pdfpc_options_disable_input_autodetection) {
				GdkInputSource source_type = 0;
				GdkDevice* _tmp15_;
				_tmp15_ = dev;
				source_type = gdk_device_get_source (_tmp15_);
				if (source_type == GDK_SOURCE_ERASER) {
					pdfpcPresentationControllerAnnotationMode mode = 0;
					pdfpcPresentationController* _tmp16_;
					pdfpcPresentationController* _tmp17_;
					mode = PDFPC_PRESENTATION_CONTROLLER_ANNOTATION_MODE_ERASER;
					_tmp16_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
					_tmp17_ = _tmp16_;
					pdfpc_presentation_controller_set_mode (_tmp17_, mode);
				} else {
					if (source_type == GDK_SOURCE_PEN) {
						pdfpcPresentationControllerAnnotationMode mode = 0;
						pdfpcPresentationController* _tmp18_;
						pdfpcPresentationController* _tmp19_;
						mode = PDFPC_PRESENTATION_CONTROLLER_ANNOTATION_MODE_PEN;
						_tmp18_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
						_tmp19_ = _tmp18_;
						pdfpc_presentation_controller_set_mode (_tmp19_, mode);
					}
				}
			}
			if (!pdfpc_options_disable_input_pressure) {
				pdfpcPresentationController* _tmp21_;
				pdfpcPresentationController* _tmp22_;
				_tmp21_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
				_tmp22_ = _tmp21_;
				_tmp20_ = _tmp22_->pen_is_pressed;
			} else {
				_tmp20_ = FALSE;
			}
			if (_tmp20_) {
				gdouble pressure = 0.0;
				GdkDevice* _tmp23_;
				gdouble* _tmp24_;
				gint _tmp24__length1;
				gdouble _tmp25_ = 0.0;
				gboolean _tmp26_;
				pdfpcPresentationController* _tmp27_;
				pdfpcPresentationController* _tmp28_;
				_tmp23_ = dev;
				_tmp24_ = event->axes;
				_tmp24__length1 = -1;
				_tmp26_ = gdk_device_get_axis (_tmp23_, _tmp24_, GDK_AXIS_PRESSURE, &_tmp25_);
				pressure = _tmp25_;
				if (_tmp26_ != TRUE) {
					pressure = -1.0;
				}
				_tmp27_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
				_tmp28_ = _tmp27_;
				pdfpc_presentation_controller_set_pen_pressure (_tmp28_, pressure);
			}
			_tmp29_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
			_tmp30_ = _tmp29_;
			result = pdfpc_presentation_controller_on_move_pen (_tmp30_);
			_g_object_unref0 (dev);
			return result;
		} else {
			result = FALSE;
			return result;
		}
	}
}

gboolean
pdfpc_window_controllable_window_v_on_enter_notify (pdfpcWindowControllableWindow* self)
{
	pdfpcPresentationController* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	result = pdfpc_presentation_controller_on_enter_notify (_tmp1_);
	return result;
}

gboolean
pdfpc_window_controllable_window_v_on_leave_notify (pdfpcWindowControllableWindow* self)
{
	pdfpcPresentationController* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	result = pdfpc_presentation_controller_on_leave_notify (_tmp1_);
	return result;
}

gboolean
pdfpc_window_controllable_window_v_on_button_press (pdfpcWindowControllableWindow* self,
                                                    GdkEventButton* event)
{
	pdfpcPresentationController* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	if (pdfpc_presentation_controller_is_pointer_active (_tmp1_)) {
		pdfpcPresentationController* _tmp2_;
		pdfpcPresentationController* _tmp3_;
		pdfpcPresentationController* _tmp4_;
		pdfpcPresentationController* _tmp5_;
		gdouble _tmp6_ = 0.0;
		gdouble _tmp7_ = 0.0;
		pdfpcPresentationController* _tmp8_;
		pdfpcPresentationController* _tmp9_;
		pdfpcPresentationController* _tmp10_;
		pdfpcPresentationController* _tmp11_;
		_tmp2_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp5_ = _tmp4_;
		pdfpc_window_controllable_window_device_to_normalized (self, event->x, event->y, &_tmp6_, &_tmp7_);
		_tmp3_->drag_x = _tmp6_;
		_tmp5_->drag_y = _tmp7_;
		_tmp8_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp9_ = _tmp8_;
		_tmp9_->highlight.width = (gdouble) 0;
		_tmp10_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp11_ = _tmp10_;
		_tmp11_->highlight.height = (gdouble) 0;
		result = TRUE;
		return result;
	} else {
		pdfpcPresentationController* _tmp12_;
		pdfpcPresentationController* _tmp13_;
		_tmp12_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp13_ = _tmp12_;
		if (pdfpc_presentation_controller_in_drawing_mode (_tmp13_)) {
			gdouble x = 0.0;
			gdouble y = 0.0;
			gdouble _tmp14_ = 0.0;
			gdouble _tmp15_ = 0.0;
			pdfpcPresentationController* _tmp16_;
			pdfpcPresentationController* _tmp17_;
			pdfpcPresentationController* _tmp18_;
			pdfpcPresentationController* _tmp19_;
			pdfpc_window_controllable_window_device_to_normalized (self, event->x, event->y, &_tmp14_, &_tmp15_);
			x = _tmp14_;
			y = _tmp15_;
			_tmp16_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
			_tmp17_ = _tmp16_;
			pdfpc_presentation_controller_move_pen (_tmp17_, x, y);
			_tmp18_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
			_tmp19_ = _tmp18_;
			_tmp19_->pen_is_pressed = TRUE;
			result = TRUE;
			return result;
		} else {
			result = FALSE;
			return result;
		}
	}
}

gboolean
pdfpc_window_controllable_window_v_on_button_release (pdfpcWindowControllableWindow* self,
                                                      GdkEventButton* event)
{
	pdfpcPresentationController* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	_tmp0_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	if (pdfpc_presentation_controller_is_pointer_active (_tmp1_)) {
		gdouble x = 0.0;
		gdouble y = 0.0;
		gdouble _tmp2_ = 0.0;
		gdouble _tmp3_ = 0.0;
		pdfpcPresentationController* _tmp4_;
		pdfpcPresentationController* _tmp5_;
		pdfpcPresentationController* _tmp6_;
		pdfpcPresentationController* _tmp7_;
		pdfpcPresentationController* _tmp8_;
		pdfpcPresentationController* _tmp9_;
		pdfpc_window_controllable_window_device_to_normalized (self, event->x, event->y, &_tmp2_, &_tmp3_);
		x = _tmp2_;
		y = _tmp3_;
		_tmp4_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp5_ = _tmp4_;
		pdfpc_presentation_controller_update_highlight (_tmp5_, x, y);
		_tmp6_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp7_ = _tmp6_;
		_tmp7_->drag_x = (gdouble) -1;
		_tmp8_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp9_ = _tmp8_;
		_tmp9_->drag_y = (gdouble) -1;
		result = TRUE;
		return result;
	} else {
		pdfpcPresentationController* _tmp10_;
		pdfpcPresentationController* _tmp11_;
		_tmp10_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp11_ = _tmp10_;
		if (pdfpc_presentation_controller_in_drawing_mode (_tmp11_)) {
			gdouble x = 0.0;
			gdouble y = 0.0;
			gdouble _tmp12_ = 0.0;
			gdouble _tmp13_ = 0.0;
			pdfpcPresentationController* _tmp14_;
			pdfpcPresentationController* _tmp15_;
			pdfpcPresentationController* _tmp16_;
			pdfpcPresentationController* _tmp17_;
			pdfpc_window_controllable_window_device_to_normalized (self, event->x, event->y, &_tmp12_, &_tmp13_);
			x = _tmp12_;
			y = _tmp13_;
			_tmp14_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
			_tmp15_ = _tmp14_;
			pdfpc_presentation_controller_move_pen (_tmp15_, x, y);
			_tmp16_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
			_tmp17_ = _tmp16_;
			_tmp17_->pen_is_pressed = FALSE;
			result = TRUE;
			return result;
		} else {
			result = FALSE;
			return result;
		}
	}
}

/**
         * Restart the timeout before hiding the mouse cursor
         */
static gboolean
_pdfpc_window_controllable_window_on_hide_cursor_timeout_gsource_func (gpointer self)
{
	gboolean result;
	result = pdfpc_window_controllable_window_on_hide_cursor_timeout ((pdfpcWindowControllableWindow*) self);
	return result;
}

void
pdfpc_window_controllable_window_restart_hide_cursor_timer (pdfpcWindowControllableWindow* self)
{
	g_return_if_fail (self != NULL);
	if (self->hide_cursor_timeout != ((guint) 0)) {
		g_source_remove (self->hide_cursor_timeout);
	}
	self->hide_cursor_timeout = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) pdfpc_options_cursor_timeout, _pdfpc_window_controllable_window_on_hide_cursor_timeout_gsource_func, g_object_ref (self), g_object_unref);
}

/**
         * Timeout method called if the mouse pointer has not been moved for
         * a while
         */
gboolean
pdfpc_window_controllable_window_on_hide_cursor_timeout (pdfpcWindowControllableWindow* self)
{
	GdkWindow* w = NULL;
	pdfpcViewPdf* _tmp0_;
	pdfpcViewPdf* _tmp1_;
	GdkWindow* _tmp2_;
	GdkWindow* _tmp3_;
	GdkWindow* _tmp4_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	self->hide_cursor_timeout = (guint) 0;
	_tmp0_ = pdfpc_controllable_get_main_view ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = gtk_widget_get_window ((GtkWidget*) _tmp1_);
	_tmp3_ = _g_object_ref0 (_tmp2_);
	w = _tmp3_;
	_tmp4_ = w;
	if (_tmp4_ != NULL) {
		GdkCursor* cursor = NULL;
		GdkDisplay* _tmp5_;
		GdkCursor* _tmp6_;
		GdkWindow* _tmp7_;
		GdkCursor* _tmp8_;
		_tmp5_ = gdk_display_get_default ();
		_tmp6_ = gdk_cursor_new_for_display (_tmp5_, GDK_BLANK_CURSOR);
		cursor = _tmp6_;
		_tmp7_ = w;
		_tmp8_ = cursor;
		gdk_window_set_cursor (_tmp7_, _tmp8_);
		self->cursor_blanked = TRUE;
		result = FALSE;
		_g_object_unref0 (cursor);
		_g_object_unref0 (w);
		return result;
	} else {
		result = TRUE;
		_g_object_unref0 (w);
		return result;
	}
}

/**
         * Called on document reload.
         * TODO: in principle the document geometry may change!
         */
void
pdfpc_window_controllable_window_c_on_reload (pdfpcWindowControllableWindow* self)
{
	pdfpcViewPdf* _tmp0_;
	pdfpcViewPdf* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_controllable_get_main_view ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	pdfpc_view_pdf_invalidate (_tmp1_);
}

void
pdfpc_window_controllable_window_c_on_zoom (pdfpcWindowControllableWindow* self,
                                            pdfpcPresentationControllerScaledRectangle* rect)
{
	pdfpcViewPdf* _tmp0_;
	pdfpcViewPdf* _tmp1_;
	pdfpcPresentationController* _tmp2_;
	pdfpcPresentationController* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_controllable_get_main_view ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = pdfpc_presentation_controller_get_current_slide_number (_tmp3_);
	_tmp5_ = _tmp4_;
	pdfpc_view_pdf_display (_tmp1_, _tmp5_, TRUE, rect);
}

/**
         * Convert device coordinates to normalized ones
         */
void
pdfpc_window_controllable_window_device_to_normalized (pdfpcWindowControllableWindow* self,
                                                       gdouble dev_x,
                                                       gdouble dev_y,
                                                       gdouble* x,
                                                       gdouble* y)
{
	gdouble _vala_x = 0.0;
	gdouble _vala_y = 0.0;
	GtkAllocation a = {0};
	pdfpcViewPdf* _tmp0_;
	pdfpcViewPdf* _tmp1_;
	GtkAllocation _tmp2_ = {0};
	GtkAllocation _tmp3_;
	GtkAllocation _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_controllable_get_main_view ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	gtk_widget_get_allocation ((GtkWidget*) _tmp1_, &_tmp2_);
	a = _tmp2_;
	_tmp3_ = a;
	_vala_x = dev_x / _tmp3_.width;
	_tmp4_ = a;
	_vala_y = dev_y / _tmp4_.height;
	if (x) {
		*x = _vala_x;
	}
	if (y) {
		*y = _vala_y;
	}
}

static pdfpcPresentationController*
pdfpc_window_controllable_window_real_get_controller (pdfpcControllable* base)
{
	pdfpcPresentationController* result;
	pdfpcWindowControllableWindow* self;
	pdfpcPresentationController* _tmp0_;
	self = (pdfpcWindowControllableWindow*) base;
	_tmp0_ = self->priv->_controller;
	result = _tmp0_;
	return result;
}

static void
pdfpc_window_controllable_window_real_set_controller (pdfpcControllable* base,
                                                      pdfpcPresentationController* value)
{
	pdfpcWindowControllableWindow* self;
	pdfpcPresentationController* old_value;
	self = (pdfpcWindowControllableWindow*) base;
	old_value = pdfpc_window_controllable_window_real_get_controller (base);
	if (old_value != value) {
		pdfpcPresentationController* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_controller);
		self->priv->_controller = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_CONTROLLER_PROPERTY]);
	}
}

static pdfpcViewPdf*
pdfpc_window_controllable_window_real_get_main_view (pdfpcControllable* base)
{
	pdfpcViewPdf* result;
	pdfpcWindowControllableWindow* self;
	pdfpcViewPdf* _tmp0_;
	self = (pdfpcWindowControllableWindow*) base;
	_tmp0_ = self->priv->_main_view;
	result = _tmp0_;
	return result;
}

static void
pdfpc_window_controllable_window_real_set_main_view (pdfpcControllable* base,
                                                     pdfpcViewPdf* value)
{
	pdfpcWindowControllableWindow* self;
	pdfpcViewPdf* old_value;
	self = (pdfpcWindowControllableWindow*) base;
	old_value = pdfpc_window_controllable_window_real_get_main_view (base);
	if (old_value != value) {
		pdfpcViewPdf* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_main_view);
		self->priv->_main_view = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_MAIN_VIEW_PROPERTY]);
	}
}

pdfpcMetadataPdf*
pdfpc_window_controllable_window_get_metadata (pdfpcWindowControllableWindow* self)
{
	pdfpcMetadataPdf* result;
	pdfpcPresentationController* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	pdfpcMetadataPdf* _tmp2_;
	pdfpcMetadataPdf* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = pdfpc_presentation_controller_get_metadata (_tmp1_);
	_tmp3_ = _tmp2_;
	result = _tmp3_;
	return result;
}

gboolean
pdfpc_window_controllable_window_get_interactive (pdfpcWindowControllableWindow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_interactive;
	return result;
}

void
pdfpc_window_controllable_window_set_interactive (pdfpcWindowControllableWindow* self,
                                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = pdfpc_window_controllable_window_get_interactive (self);
	if (old_value != value) {
		self->priv->_interactive = value;
		g_object_notify_by_pspec ((GObject *) self, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_INTERACTIVE_PROPERTY]);
	}
}

GtkDrawingArea*
pdfpc_window_controllable_window_get_pointer_drawing_surface (pdfpcWindowControllableWindow* self)
{
	GtkDrawingArea* result;
	GtkDrawingArea* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_pointer_drawing_surface;
	result = _tmp0_;
	return result;
}

void
pdfpc_window_controllable_window_set_pointer_drawing_surface (pdfpcWindowControllableWindow* self,
                                                              GtkDrawingArea* value)
{
	GtkDrawingArea* old_value;
	g_return_if_fail (self != NULL);
	old_value = pdfpc_window_controllable_window_get_pointer_drawing_surface (self);
	if (old_value != value) {
		GtkDrawingArea* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_pointer_drawing_surface);
		self->priv->_pointer_drawing_surface = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_POINTER_DRAWING_SURFACE_PROPERTY]);
	}
}

GtkDrawingArea*
pdfpc_window_controllable_window_get_pen_drawing_surface (pdfpcWindowControllableWindow* self)
{
	GtkDrawingArea* result;
	GtkDrawingArea* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_pen_drawing_surface;
	result = _tmp0_;
	return result;
}

void
pdfpc_window_controllable_window_set_pen_drawing_surface (pdfpcWindowControllableWindow* self,
                                                          GtkDrawingArea* value)
{
	GtkDrawingArea* old_value;
	g_return_if_fail (self != NULL);
	old_value = pdfpc_window_controllable_window_get_pen_drawing_surface (self);
	if (old_value != value) {
		GtkDrawingArea* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_pen_drawing_surface);
		self->priv->_pen_drawing_surface = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_PEN_DRAWING_SURFACE_PROPERTY]);
	}
}

pdfpcViewVideo*
pdfpc_window_controllable_window_get_video_surface (pdfpcWindowControllableWindow* self)
{
	pdfpcViewVideo* result;
	pdfpcViewVideo* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_video_surface;
	result = _tmp0_;
	return result;
}

void
pdfpc_window_controllable_window_set_video_surface (pdfpcWindowControllableWindow* self,
                                                    pdfpcViewVideo* value)
{
	pdfpcViewVideo* old_value;
	g_return_if_fail (self != NULL);
	old_value = pdfpc_window_controllable_window_get_video_surface (self);
	if (old_value != value) {
		pdfpcViewVideo* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_video_surface);
		self->priv->_video_surface = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_VIDEO_SURFACE_PROPERTY]);
	}
}

static void
pdfpc_window_controllable_window_class_init (pdfpcWindowControllableWindowClass * klass,
                                             gpointer klass_data)
{
	pdfpc_window_controllable_window_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &pdfpcWindowControllableWindow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_pdfpc_window_controllable_window_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_pdfpc_window_controllable_window_set_property;
	G_OBJECT_CLASS (klass)->finalize = pdfpc_window_controllable_window_finalize;
	/**
	         * The registered PresentationController
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_WINDOW_CONTROLLABLE_WINDOW_CONTROLLER_PROPERTY, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_CONTROLLER_PROPERTY] = g_param_spec_object ("controller", "controller", "controller", PDFPC_TYPE_PRESENTATION_CONTROLLER, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * The main view widget
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_WINDOW_CONTROLLABLE_WINDOW_MAIN_VIEW_PROPERTY, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_MAIN_VIEW_PROPERTY] = g_param_spec_object ("main-view", "main-view", "main-view", PDFPC_VIEW_TYPE_PDF, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Metadata of the slides
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_WINDOW_CONTROLLABLE_WINDOW_METADATA_PROPERTY, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_METADATA_PROPERTY] = g_param_spec_object ("metadata", "metadata", "metadata", PDFPC_METADATA_TYPE_PDF, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	         * Whether the user directly interacts with this window
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_WINDOW_CONTROLLABLE_WINDOW_INTERACTIVE_PROPERTY, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_INTERACTIVE_PROPERTY] = g_param_spec_boolean ("interactive", "interactive", "interactive", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Drawing area for pointer mode
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_WINDOW_CONTROLLABLE_WINDOW_POINTER_DRAWING_SURFACE_PROPERTY, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_POINTER_DRAWING_SURFACE_PROPERTY] = g_param_spec_object ("pointer-drawing-surface", "pointer-drawing-surface", "pointer-drawing-surface", gtk_drawing_area_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Drawing area for pen mode
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_WINDOW_CONTROLLABLE_WINDOW_PEN_DRAWING_SURFACE_PROPERTY, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_PEN_DRAWING_SURFACE_PROPERTY] = g_param_spec_object ("pen-drawing-surface", "pen-drawing-surface", "pen-drawing-surface", gtk_drawing_area_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	         * Video area for playback. All videos are added to this surface.
	         */
	g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_WINDOW_CONTROLLABLE_WINDOW_VIDEO_SURFACE_PROPERTY, pdfpc_window_controllable_window_properties[PDFPC_WINDOW_CONTROLLABLE_WINDOW_VIDEO_SURFACE_PROPERTY] = g_param_spec_object ("video-surface", "video-surface", "video-surface", PDFPC_VIEW_TYPE_VIDEO, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
pdfpc_window_controllable_window_pdfpc_controllable_interface_init (pdfpcControllableIface * iface,
                                                                    gpointer iface_data)
{
	pdfpc_window_controllable_window_pdfpc_controllable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_controller = pdfpc_window_controllable_window_real_get_controller;
	iface->set_controller = pdfpc_window_controllable_window_real_set_controller;
	iface->get_main_view = pdfpc_window_controllable_window_real_get_main_view;
	iface->set_main_view = pdfpc_window_controllable_window_real_set_main_view;
}

static void
pdfpc_window_controllable_window_instance_init (pdfpcWindowControllableWindow * self,
                                                gpointer klass)
{
	self->priv = pdfpc_window_controllable_window_get_instance_private (self);
	self->hide_cursor_timeout = (guint) 0;
	self->cursor_blanked = FALSE;
	self->accepted_key_mods = (guint) ((GDK_SHIFT_MASK | GDK_CONTROL_MASK) | GDK_META_MASK);
	self->last_key_ev_time = (guint) 0;
}

static void
pdfpc_window_controllable_window_finalize (GObject * obj)
{
	pdfpcWindowControllableWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW, pdfpcWindowControllableWindow);
	_g_object_unref0 (self->priv->_controller);
	_g_object_unref0 (self->priv->_main_view);
	_g_object_unref0 (self->priv->_pointer_drawing_surface);
	_g_object_unref0 (self->priv->_pen_drawing_surface);
	_g_object_unref0 (self->priv->_video_surface);
	_g_object_unref0 (self->overlay_layout);
	G_OBJECT_CLASS (pdfpc_window_controllable_window_parent_class)->finalize (obj);
}

static GType
pdfpc_window_controllable_window_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (pdfpcWindowControllableWindowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_window_controllable_window_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcWindowControllableWindow), 0, (GInstanceInitFunc) pdfpc_window_controllable_window_instance_init, NULL };
	static const GInterfaceInfo pdfpc_controllable_info = { (GInterfaceInitFunc) pdfpc_window_controllable_window_pdfpc_controllable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType pdfpc_window_controllable_window_type_id;
	pdfpc_window_controllable_window_type_id = g_type_register_static (PDFPC_WINDOW_TYPE_FULLSCREEN, "pdfpcWindowControllableWindow", &g_define_type_info, 0);
	g_type_add_interface_static (pdfpc_window_controllable_window_type_id, PDFPC_TYPE_CONTROLLABLE, &pdfpc_controllable_info);
	pdfpcWindowControllableWindow_private_offset = g_type_add_instance_private (pdfpc_window_controllable_window_type_id, sizeof (pdfpcWindowControllableWindowPrivate));
	return pdfpc_window_controllable_window_type_id;
}

GType
pdfpc_window_controllable_window_get_type (void)
{
	static volatile gsize pdfpc_window_controllable_window_type_id__once = 0;
	if (g_once_init_enter (&pdfpc_window_controllable_window_type_id__once)) {
		GType pdfpc_window_controllable_window_type_id;
		pdfpc_window_controllable_window_type_id = pdfpc_window_controllable_window_get_type_once ();
		g_once_init_leave (&pdfpc_window_controllable_window_type_id__once, pdfpc_window_controllable_window_type_id);
	}
	return pdfpc_window_controllable_window_type_id__once;
}

static void
_vala_pdfpc_window_controllable_window_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec)
{
	pdfpcWindowControllableWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW, pdfpcWindowControllableWindow);
	switch (property_id) {
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_CONTROLLER_PROPERTY:
		g_value_set_object (value, pdfpc_controllable_get_controller ((pdfpcControllable*) self));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_MAIN_VIEW_PROPERTY:
		g_value_set_object (value, pdfpc_controllable_get_main_view ((pdfpcControllable*) self));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_METADATA_PROPERTY:
		g_value_set_object (value, pdfpc_window_controllable_window_get_metadata (self));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_INTERACTIVE_PROPERTY:
		g_value_set_boolean (value, pdfpc_window_controllable_window_get_interactive (self));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_POINTER_DRAWING_SURFACE_PROPERTY:
		g_value_set_object (value, pdfpc_window_controllable_window_get_pointer_drawing_surface (self));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_PEN_DRAWING_SURFACE_PROPERTY:
		g_value_set_object (value, pdfpc_window_controllable_window_get_pen_drawing_surface (self));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_VIDEO_SURFACE_PROPERTY:
		g_value_set_object (value, pdfpc_window_controllable_window_get_video_surface (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_pdfpc_window_controllable_window_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec)
{
	pdfpcWindowControllableWindow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW, pdfpcWindowControllableWindow);
	switch (property_id) {
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_CONTROLLER_PROPERTY:
		pdfpc_controllable_set_controller ((pdfpcControllable*) self, g_value_get_object (value));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_MAIN_VIEW_PROPERTY:
		pdfpc_controllable_set_main_view ((pdfpcControllable*) self, g_value_get_object (value));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_INTERACTIVE_PROPERTY:
		pdfpc_window_controllable_window_set_interactive (self, g_value_get_boolean (value));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_POINTER_DRAWING_SURFACE_PROPERTY:
		pdfpc_window_controllable_window_set_pointer_drawing_surface (self, g_value_get_object (value));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_PEN_DRAWING_SURFACE_PROPERTY:
		pdfpc_window_controllable_window_set_pen_drawing_surface (self, g_value_get_object (value));
		break;
		case PDFPC_WINDOW_CONTROLLABLE_WINDOW_VIDEO_SURFACE_PROPERTY:
		pdfpc_window_controllable_window_set_video_surface (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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;
}

