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

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <cairo-gobject.h>
#include <glib-object.h>
#include <gdk/gdk.h>
#include <webkit2/webkit2.h>
#include "display_backend.h"
#include <float.h>
#include <math.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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _cairo_surface_destroy0(var) ((var == NULL) ? NULL : (var = (cairo_surface_destroy (var), NULL)))

#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_WINDOW_TYPE_PRESENTER (pdfpc_window_presenter_get_type ())
#define PDFPC_WINDOW_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenter))
#define PDFPC_WINDOW_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass))
#define PDFPC_WINDOW_IS_PRESENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_PRESENTER))
#define PDFPC_WINDOW_IS_PRESENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_PRESENTER))
#define PDFPC_WINDOW_PRESENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenterClass))

typedef struct _pdfpcWindowPresenter pdfpcWindowPresenter;
typedef struct _pdfpcWindowPresenterClass pdfpcWindowPresenterClass;
typedef struct _pdfpcWindowPresenterPrivate pdfpcWindowPresenterPrivate;

#define PDFPC_VIEW_TYPE_MARKDOWN_VIEW (pdfpc_view_markdown_view_get_type ())
#define PDFPC_VIEW_MARKDOWN_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_MARKDOWN_VIEW, pdfpcViewMarkdownView))
#define PDFPC_VIEW_MARKDOWN_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_MARKDOWN_VIEW, pdfpcViewMarkdownViewClass))
#define PDFPC_VIEW_IS_MARKDOWN_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_MARKDOWN_VIEW))
#define PDFPC_VIEW_IS_MARKDOWN_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_MARKDOWN_VIEW))
#define PDFPC_VIEW_MARKDOWN_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_MARKDOWN_VIEW, pdfpcViewMarkdownViewClass))

typedef struct _pdfpcViewMarkdownView pdfpcViewMarkdownView;
typedef struct _pdfpcViewMarkdownViewClass pdfpcViewMarkdownViewClass;

#define PDFPC_WINDOW_TYPE_OVERVIEW (pdfpc_window_overview_get_type ())
#define PDFPC_WINDOW_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverview))
#define PDFPC_WINDOW_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass))
#define PDFPC_WINDOW_IS_OVERVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_OVERVIEW))
#define PDFPC_WINDOW_IS_OVERVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_OVERVIEW))
#define PDFPC_WINDOW_OVERVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_OVERVIEW, pdfpcWindowOverviewClass))

typedef struct _pdfpcWindowOverview pdfpcWindowOverview;
typedef struct _pdfpcWindowOverviewClass pdfpcWindowOverviewClass;

#define PDFPC_WINDOW_TYPE_TOOL_BOX (pdfpc_window_tool_box_get_type ())
#define PDFPC_WINDOW_TOOL_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_TOOL_BOX, pdfpcWindowToolBox))
#define PDFPC_WINDOW_TOOL_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_TOOL_BOX, pdfpcWindowToolBoxClass))
#define PDFPC_WINDOW_IS_TOOL_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_TOOL_BOX))
#define PDFPC_WINDOW_IS_TOOL_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_TOOL_BOX))
#define PDFPC_WINDOW_TOOL_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_TOOL_BOX, pdfpcWindowToolBoxClass))

typedef struct _pdfpcWindowToolBox pdfpcWindowToolBox;
typedef struct _pdfpcWindowToolBoxClass pdfpcWindowToolBoxClass;
enum  {
	PDFPC_WINDOW_PRESENTER_0_PROPERTY,
	PDFPC_WINDOW_PRESENTER_CURRENT_VIEW_MAXIMIZED_PROPERTY,
	PDFPC_WINDOW_PRESENTER_NUM_PROPERTIES
};
static GParamSpec* pdfpc_window_presenter_properties[PDFPC_WINDOW_PRESENTER_NUM_PROPERTIES];
typedef struct _Block13Data Block13Data;
#define _g_free0(var) (var = (g_free (var), NULL))

#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;
typedef enum  {
	PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_PreTalk,
	PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_Normal,
	PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_Slow,
	PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_Fast,
	PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_LastMinutes,
	PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_Overtime
} pdfpcPresentationControllerProgressStatus;

#define PDFPC_PRESENTATION_CONTROLLER_TYPE_PROGRESS_STATUS (pdfpc_presentation_controller_progress_status_get_type ())

#define PDFPC_WINDOW_TYPE_QR_CODE (pdfpc_window_qr_code_get_type ())
#define PDFPC_WINDOW_QR_CODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_WINDOW_TYPE_QR_CODE, pdfpcWindowQRCode))
#define PDFPC_WINDOW_QR_CODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_WINDOW_TYPE_QR_CODE, pdfpcWindowQRCodeClass))
#define PDFPC_WINDOW_IS_QR_CODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_WINDOW_TYPE_QR_CODE))
#define PDFPC_WINDOW_IS_QR_CODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_WINDOW_TYPE_QR_CODE))
#define PDFPC_WINDOW_QR_CODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_WINDOW_TYPE_QR_CODE, pdfpcWindowQRCodeClass))

typedef struct _pdfpcWindowQRCode pdfpcWindowQRCode;
typedef struct _pdfpcWindowQRCodeClass pdfpcWindowQRCodeClass;

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

#define PDFPC_RENDERER_TYPE_PDF (pdfpc_renderer_pdf_get_type ())
#define PDFPC_RENDERER_PDF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdf))
#define PDFPC_RENDERER_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass))
#define PDFPC_RENDERER_IS_PDF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_RENDERER_TYPE_PDF))
#define PDFPC_RENDERER_IS_PDF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_RENDERER_TYPE_PDF))
#define PDFPC_RENDERER_PDF_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_RENDERER_TYPE_PDF, pdfpcRendererPdfClass))

typedef struct _pdfpcRendererPdf pdfpcRendererPdf;
typedef struct _pdfpcRendererPdfClass pdfpcRendererPdfClass;

#define PDFPC_VIEW_BEHAVIOUR_TYPE_BASE (pdfpc_view_behaviour_base_get_type ())
#define PDFPC_VIEW_BEHAVIOUR_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBase))
#define PDFPC_VIEW_BEHAVIOUR_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass))
#define PDFPC_VIEW_BEHAVIOUR_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE))
#define PDFPC_VIEW_BEHAVIOUR_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE))
#define PDFPC_VIEW_BEHAVIOUR_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, pdfpcViewBehaviourBaseClass))

typedef struct _pdfpcViewBehaviourBase pdfpcViewBehaviourBase;
typedef struct _pdfpcViewBehaviourBaseClass pdfpcViewBehaviourBaseClass;

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 _pdfpcWindowPresenter {
	pdfpcWindowControllableWindow parent_instance;
	pdfpcWindowPresenterPrivate * priv;
	pdfpcViewPdf* next_view;
	pdfpcViewPdf* strict_next_view;
	pdfpcViewPdf* strict_prev_view;
	GtkStack* notes_stack;
	GtkTextView* notes_editor;
	pdfpcViewPdf* notes_view;
	pdfpcViewMarkdownView* mdview;
	GtkPaned* slide_views;
	GtkPaned* current_view_and_stricts;
	GtkPaned* next_view_and_notes;
	GtkPaned* full_layout;
	GtkLabel* timer_label;
	GtkEntry* slide_progress;
	GtkBox* status;
	GtkImage* blank_icon;
	GtkImage* hidden_icon;
	GtkImage* frozen_icon;
	GtkImage* pause_icon;
	GtkImage* saved_icon;
	GtkImage* loaded_icon;
	GtkImage* locked_icon;
	GtkCssProvider* css_provider;
	GtkCssProvider* bottom_text_css_provider;
	GtkImage* highlight_icon;
	GtkImage* pen_icon;
	GtkImage* eraser_icon;
	GtkImage* spotlight_icon;
	pdfpcWindowOverview* overview;
	GtkStack* slide_stack;
	pdfpcWindowToolBox* toolbox;
};

struct _pdfpcWindowPresenterClass {
	pdfpcWindowControllableWindowClass parent_class;
};

struct _pdfpcWindowPresenterPrivate {
	gboolean _current_view_maximized;
	gint handle_thickness;
	gint bottom_height;
};

struct _Block13Data {
	int _ref_count_;
	pdfpcWindowPresenter* self;
	GtkPaned* paned;
};

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

struct _pdfpcViewPdf {
	GtkDrawingArea parent_instance;
	pdfpcViewPdfPrivate * priv;
	gboolean entering_slide_queued;
	pdfpcRendererPdf* renderer;
	gint current_slide_number;
	cairo_surface_t* current_slide;
	cairo_surface_t* buffer;
	gboolean disabled;
	gboolean user_slides;
	GList* behaviours;
	gint gdk_scale;
	gboolean notes_area;
	guint prerender_tid;
	guint transition_tid;
	gboolean transitions_enabled;
	pdfpcPresentationControllerScaledRectangle* zoom_area;
};

struct _pdfpcViewPdfClass {
	GtkDrawingAreaClass parent_class;
	gboolean (*prerender) (pdfpcViewPdf* self);
};

static gint pdfpcWindowPresenter_private_offset;
static gpointer pdfpc_window_presenter_parent_class = NULL;
VALA_EXTERN guint pdfpc_options_current_size;
VALA_EXTERN guint pdfpc_options_status_height;
VALA_EXTERN guint pdfpc_options_current_height;
VALA_EXTERN guint pdfpc_options_next_height;
VALA_EXTERN gboolean pdfpc_options_final_slide_overlay;
VALA_EXTERN gboolean pdfpc_options_next_slide_first_overlay;

VALA_EXTERN GtkImage* pdfpc_window_load_icon (const gchar* filename,
                                  gint size);
VALA_EXTERN cairo_surface_t* pdfpc_renderer_image_render (const gchar* filename,
                                              gint width,
                                              gint height);
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_window_presenter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcWindowPresenter, g_object_unref)
VALA_EXTERN GType pdfpc_view_markdown_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcViewMarkdownView, g_object_unref)
VALA_EXTERN GType pdfpc_window_overview_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcWindowOverview, g_object_unref)
VALA_EXTERN GType pdfpc_window_tool_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcWindowToolBox, g_object_unref)
VALA_EXTERN void pdfpc_window_fullscreen_resize_gui (pdfpcWindowFullscreen* self);
VALA_EXTERN GtkScrolledWindow* pdfpc_window_presenter_create_help_window (pdfpcWindowPresenter* self);
static gboolean __lambda34_ (pdfpcWindowPresenter* self,
                      GdkEventKey* event);
VALA_EXTERN void pdfpc_window_presenter_show_help_window (pdfpcWindowPresenter* self,
                                              gboolean onoff);
static gboolean ___lambda34__gtk_widget_key_press_event (GtkWidget* _sender,
                                                  GdkEventKey* event,
                                                  gpointer self);
VALA_EXTERN pdfpcPresentationController* pdfpc_controllable_get_controller (pdfpcControllable* self);
VALA_EXTERN gchar** pdfpc_presentation_controller_get_action_bindings (pdfpcPresentationController* self,
                                                           gint* result_length1);
static void pdfpc_window_presenter_enable_paned_handle (pdfpcWindowPresenter* self,
                                                 GtkPaned* paned,
                                                 gboolean onoff);
VALA_EXTERN GtkPaned* pdfpc_window_presenter_create_paned (pdfpcWindowPresenter* self,
                                               GtkOrientation orientation);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
static void __lambda35_ (Block13Data* _data13_);
static void ___lambda35__gtk_widget_map (GtkWidget* _sender,
                                  gpointer self);
VALA_EXTERN void pdfpc_window_presenter_set_customizable (pdfpcWindowPresenter* self,
                                              gboolean onoff);
VALA_EXTERN void pdfpc_window_presenter_maximize_current_view (pdfpcWindowPresenter* self,
                                                   gboolean onoff);
VALA_EXTERN gboolean pdfpc_window_presenter_get_current_view_maximized (pdfpcWindowPresenter* self);
VALA_EXTERN gint pdfpc_window_fullscreen_get_window_w (pdfpcWindowFullscreen* self);
VALA_EXTERN void pdfpc_window_presenter_set_current_view_maximized (pdfpcWindowPresenter* self,
                                                        gboolean value);
VALA_EXTERN void pdfpc_window_presenter_show_status_icons (pdfpcWindowPresenter* self,
                                               gboolean onoff);
static void pdfpc_window_presenter_update_status_icons (pdfpcWindowPresenter* self);
static void pdfpc_window_presenter_reload_status_icons (pdfpcWindowPresenter* self,
                                                 gint height);
VALA_EXTERN gint pdfpc_window_fullscreen_get_gdk_scale (pdfpcWindowFullscreen* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_is_paused (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_get_faded_to_black (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_get_hidden (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_get_frozen (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_is_pointer_active (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_is_eraser_active (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_is_pen_active (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_is_spotlight_active (pdfpcPresentationController* self);
static void pdfpc_window_presenter_resize_bottom_texts (pdfpcWindowPresenter* self,
                                                 gint height);
static void pdfpc_window_presenter_on_bottom_resize (pdfpcWindowPresenter* self,
                                              GtkAllocation* a);
VALA_EXTERN gint pdfpc_window_fullscreen_get_window_h (pdfpcWindowFullscreen* self);
VALA_EXTERN void pdfpc_window_overview_set_available_space (pdfpcWindowOverview* self,
                                                gint width,
                                                gint height);
VALA_EXTERN pdfpcWindowPresenter* pdfpc_window_presenter_new (pdfpcPresentationController* controller,
                                                  gint screen_num,
                                                  gboolean windowed);
VALA_EXTERN pdfpcWindowPresenter* pdfpc_window_presenter_construct (GType object_type,
                                                        pdfpcPresentationController* controller,
                                                        gint screen_num,
                                                        gboolean windowed);
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);
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_presentation_controller_get_metadata (pdfpcPresentationController* self);
VALA_EXTERN gchar* pdfpc_metadata_pdf_get_title (pdfpcMetadataPdf* self);
VALA_EXTERN void pdfpc_window_presenter_on_reload (pdfpcWindowPresenter* self);
static void _pdfpc_window_presenter_on_reload_pdfpc_presentation_controller_reload_request (pdfpcPresentationController* _sender,
                                                                                     gpointer self);
VALA_EXTERN void pdfpc_window_presenter_update (pdfpcWindowPresenter* self);
static void _pdfpc_window_presenter_update_pdfpc_presentation_controller_update_request (pdfpcPresentationController* _sender,
                                                                                  gpointer self);
VALA_EXTERN void pdfpc_window_presenter_edit_note (pdfpcWindowPresenter* self);
static void _pdfpc_window_presenter_edit_note_pdfpc_presentation_controller_edit_note_request (pdfpcPresentationController* _sender,
                                                                                        gpointer self);
VALA_EXTERN void pdfpc_window_presenter_ask_goto_page (pdfpcWindowPresenter* self);
static void _pdfpc_window_presenter_ask_goto_page_pdfpc_presentation_controller_ask_goto_page_request (pdfpcPresentationController* _sender,
                                                                                                gpointer self);
VALA_EXTERN void pdfpc_window_presenter_show_overview (pdfpcWindowPresenter* self);
static void _pdfpc_window_presenter_show_overview_pdfpc_presentation_controller_show_overview_request (pdfpcPresentationController* _sender,
                                                                                                gpointer self);
VALA_EXTERN void pdfpc_window_presenter_hide_overview (pdfpcWindowPresenter* self);
static void _pdfpc_window_presenter_hide_overview_pdfpc_presentation_controller_hide_overview_request (pdfpcPresentationController* _sender,
                                                                                                gpointer self);
VALA_EXTERN void pdfpc_window_presenter_increase_font_size (pdfpcWindowPresenter* self);
static void _pdfpc_window_presenter_increase_font_size_pdfpc_presentation_controller_increase_font_size_request (pdfpcPresentationController* _sender,
                                                                                                          gpointer self);
VALA_EXTERN void pdfpc_window_presenter_decrease_font_size (pdfpcWindowPresenter* self);
static void _pdfpc_window_presenter_decrease_font_size_pdfpc_presentation_controller_decrease_font_size_request (pdfpcPresentationController* _sender,
                                                                                                          gpointer self);
VALA_EXTERN pdfpcMetadataPdf* pdfpc_window_controllable_window_get_metadata (pdfpcWindowControllableWindow* self);
VALA_EXTERN gdouble pdfpc_metadata_pdf_get_page_width (pdfpcMetadataPdf* self);
VALA_EXTERN gdouble pdfpc_metadata_pdf_get_page_height (pdfpcMetadataPdf* self);
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 gboolean pdfpc_window_presenter_on_key_press_notes_editor (pdfpcWindowPresenter* self,
                                                           GtkWidget* source,
                                                           GdkEventKey* key);
static gboolean _pdfpc_window_presenter_on_key_press_notes_editor_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                       GdkEventKey* event,
                                                                                       gpointer self);
VALA_EXTERN pdfpcViewMarkdownView* pdfpc_view_markdown_view_new (void);
VALA_EXTERN pdfpcViewMarkdownView* pdfpc_view_markdown_view_construct (GType object_type);
VALA_EXTERN gint pdfpc_metadata_pdf_get_font_size (pdfpcMetadataPdf* self);
static void pdfpc_window_presenter_apply_font_size (pdfpcWindowPresenter* self,
                                             gint size);
static void __lambda37_ (pdfpcWindowPresenter* self,
                  const gchar* str);
VALA_EXTERN GType pdfpc_presentation_controller_progress_status_get_type (void) G_GNUC_CONST ;
VALA_EXTERN pdfpcPresentationControllerProgressStatus pdfpc_presentation_controller_get_progress_status (pdfpcPresentationController* self);
static void ___lambda37__pdfpc_presentation_controller_timer_change (pdfpcPresentationController* _sender,
                                                              const gchar* label,
                                                              gpointer self);
VALA_EXTERN void pdfpc_presentation_controller_reset_timer (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_window_presenter_on_key_press_slide_progress (pdfpcWindowPresenter* self,
                                                             GtkWidget* source,
                                                             GdkEventKey* key);
static gboolean _pdfpc_window_presenter_on_key_press_slide_progress_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                         GdkEventKey* event,
                                                                                         gpointer self);
VALA_EXTERN pdfpcWindowOverview* pdfpc_window_overview_new (pdfpcPresentationController* controller);
VALA_EXTERN pdfpcWindowOverview* pdfpc_window_overview_construct (GType object_type,
                                                      pdfpcPresentationController* controller);
VALA_EXTERN void pdfpc_window_overview_set_n_slides (pdfpcWindowOverview* self,
                                         gint n);
VALA_EXTERN gint pdfpc_presentation_controller_get_user_n_slides (pdfpcPresentationController* self);
VALA_EXTERN void pdfpc_presentation_controller_set_overview (pdfpcPresentationController* self,
                                                 pdfpcWindowOverview* value);
VALA_EXTERN GType pdfpc_window_qr_code_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcWindowQRCode, g_object_unref)
VALA_EXTERN pdfpcWindowQRCode* pdfpc_window_qr_code_new (pdfpcPresentationController* controller,
                                             gdouble size);
VALA_EXTERN pdfpcWindowQRCode* pdfpc_window_qr_code_construct (GType object_type,
                                                   pdfpcPresentationController* controller,
                                                   gdouble size);
static gboolean __lambda39_ (pdfpcWindowPresenter* self,
                      GdkEventKey* event);
VALA_EXTERN void pdfpc_window_presenter_show_qrcode_window (pdfpcWindowPresenter* self,
                                                gboolean onoff);
static gboolean ___lambda39__gtk_widget_key_press_event (GtkWidget* _sender,
                                                  GdkEventKey* event,
                                                  gpointer self);
static void _pdfpc_window_presenter_on_bottom_resize_gtk_widget_size_allocate (GtkWidget* _sender,
                                                                        GtkAllocation* allocation,
                                                                        gpointer self);
VALA_EXTERN pdfpcWindowToolBox* pdfpc_window_tool_box_new (pdfpcWindowPresenter* presenter,
                                               gint icon_height);
VALA_EXTERN pdfpcWindowToolBox* pdfpc_window_tool_box_construct (GType object_type,
                                                     pdfpcWindowPresenter* presenter,
                                                     gint icon_height);
VALA_EXTERN void pdfpc_window_controllable_window_add_top_container (pdfpcWindowControllableWindow* self,
                                                         GtkWidget* top);
VALA_EXTERN void pdfpc_window_presenter_session_saved (pdfpcWindowPresenter* self);
VALA_EXTERN void pdfpc_window_presenter_session_loaded (pdfpcWindowPresenter* self);
VALA_EXTERN void pdfpc_window_presenter_update_slide_count (pdfpcWindowPresenter* self);
VALA_EXTERN gint pdfpc_presentation_controller_get_current_user_slide_number (pdfpcPresentationController* self);
VALA_EXTERN void pdfpc_window_presenter_custom_slide_count (pdfpcWindowPresenter* self,
                                                gint current);
VALA_EXTERN gint pdfpc_metadata_pdf_get_end_user_slide (pdfpcMetadataPdf* self);
VALA_EXTERN void pdfpc_view_pdf_invalidate (pdfpcViewPdf* self);
VALA_EXTERN gboolean pdfpc_metadata_pdf_get_is_ready (pdfpcMetadataPdf* self);
VALA_EXTERN gint pdfpc_presentation_controller_get_current_slide_number (pdfpcPresentationController* self);
VALA_EXTERN pdfpcViewPdf* pdfpc_controllable_get_main_view (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_view_pdf_display (pdfpcViewPdf* self,
                             gint slide_number,
                             gboolean force,
                             pdfpcPresentationControllerScaledRectangle* rect);
VALA_EXTERN gboolean pdfpc_metadata_pdf_is_user_slide (pdfpcMetadataPdf* self,
                                           gint number);
VALA_EXTERN gint pdfpc_metadata_pdf_user_slide_to_real_slide (pdfpcMetadataPdf* self,
                                                  gint number,
                                                  gboolean lastSlide);
VALA_EXTERN gint pdfpc_metadata_pdf_nearest_nonhidden (pdfpcMetadataPdf* self,
                                           gint slide_number,
                                           gboolean backwards);
VALA_EXTERN GType pdfpc_renderer_pdf_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcRendererPdf, g_object_unref)
VALA_EXTERN GType pdfpc_view_behaviour_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcViewBehaviourBase, g_object_unref)
VALA_EXTERN gint pdfpc_metadata_pdf_next_in_overlay (pdfpcMetadataPdf* self,
                                         gint slide_number);
VALA_EXTERN gint pdfpc_metadata_pdf_prev_in_overlay (pdfpcMetadataPdf* self,
                                         gint slide_number);
VALA_EXTERN gboolean pdfpc_metadata_pdf_get_has_beamer_notes (pdfpcMetadataPdf* self);
VALA_EXTERN void pdfpc_window_presenter_update_note (pdfpcWindowPresenter* self);
VALA_EXTERN void pdfpc_window_tool_box_update (pdfpcWindowToolBox* self);
static void pdfpc_window_presenter_real_resize_gui (pdfpcWindowFullscreen* base);
VALA_EXTERN void pdfpc_window_tool_box_on_window_resize (pdfpcWindowToolBox* self,
                                             gint w,
                                             gint h);
VALA_EXTERN void pdfpc_presentation_controller_set_ignore_input_events (pdfpcPresentationController* self,
                                                            gboolean v);
VALA_EXTERN void pdfpc_presentation_controller_goto_user_page (pdfpcPresentationController* self,
                                                   gint page_number,
                                                   gboolean useLast);
static void pdfpc_window_presenter_blink_lock_icon (pdfpcWindowPresenter* self);
static gboolean __lambda36_ (pdfpcWindowPresenter* self);
static gboolean ___lambda36__gsource_func (gpointer self);
VALA_EXTERN gboolean pdfpc_metadata_pdf_is_note_read_only (pdfpcMetadataPdf* self,
                                               gint slide_number);
VALA_EXTERN void pdfpc_metadata_pdf_set_note (pdfpcMetadataPdf* self,
                                  const gchar* note_text,
                                  gint slide_number,
                                  gboolean is_native);
VALA_EXTERN void pdfpc_view_markdown_view_render (pdfpcViewMarkdownView* self,
                                      const gchar* text,
                                      gboolean plain_text);
VALA_EXTERN gboolean pdfpc_metadata_pdf_get_disable_markdown (pdfpcMetadataPdf* self);
VALA_EXTERN gchar* pdfpc_metadata_pdf_get_note (pdfpcMetadataPdf* self,
                                    gint slide_number);
VALA_EXTERN void pdfpc_window_overview_set_current_slide (pdfpcWindowOverview* self,
                                              gint value);
VALA_EXTERN gboolean pdfpc_window_presenter_is_overview_shown (pdfpcWindowPresenter* self);
VALA_EXTERN void pdfpc_metadata_pdf_set_font_size (pdfpcMetadataPdf* self,
                                       gint size);
VALA_EXTERN void pdfpc_view_markdown_view_apply_zoom (pdfpcViewMarkdownView* self,
                                          gdouble level);
static void pdfpc_window_presenter_finalize (GObject * obj);
static GType pdfpc_window_presenter_get_type_once (void);
static void _vala_pdfpc_window_presenter_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
static void _vala_pdfpc_window_presenter_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

/**
     * An auxiliary function to load an icon (essentially, a square image)
     */
GtkImage*
pdfpc_window_load_icon (const gchar* filename,
                        gint size)
{
	GtkImage* icon = NULL;
	cairo_surface_t* surface = NULL;
	cairo_surface_t* _tmp0_;
	cairo_surface_t* _tmp1_;
	GtkImage* _tmp5_;
	GtkImage* result;
	g_return_val_if_fail (filename != NULL, NULL);
	_tmp0_ = pdfpc_renderer_image_render (filename, size, size);
	surface = _tmp0_;
	_tmp1_ = surface;
	if (_tmp1_ != NULL) {
		cairo_surface_t* _tmp2_;
		GtkImage* _tmp3_;
		_tmp2_ = surface;
		_tmp3_ = (GtkImage*) gtk_image_new_from_surface (_tmp2_);
		g_object_ref_sink (_tmp3_);
		_g_object_unref0 (icon);
		icon = _tmp3_;
	} else {
		GtkImage* _tmp4_;
		_tmp4_ = (GtkImage*) gtk_image_new_from_icon_name ("image-missing", (GtkIconSize) GTK_ICON_SIZE_LARGE_TOOLBAR);
		g_object_ref_sink (_tmp4_);
		_g_object_unref0 (icon);
		icon = _tmp4_;
	}
	_tmp5_ = icon;
	gtk_widget_set_no_show_all ((GtkWidget*) _tmp5_, TRUE);
	result = icon;
	_cairo_surface_destroy0 (surface);
	return result;
}

static inline gpointer
pdfpc_window_presenter_get_instance_private (pdfpcWindowPresenter* self)
{
	return G_STRUCT_MEMBER_P (self, pdfpcWindowPresenter_private_offset);
}

static gboolean
__lambda34_ (pdfpcWindowPresenter* self,
             GdkEventKey* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	switch (event->keyval) {
		case GDK_KEY_Escape:
		case GDK_KEY_Return:
		case GDK_KEY_q:
		{
			pdfpc_window_presenter_show_help_window (self, FALSE);
			result = TRUE;
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

static gboolean
___lambda34__gtk_widget_key_press_event (GtkWidget* _sender,
                                         GdkEventKey* event,
                                         gpointer self)
{
	gboolean result;
	result = __lambda34_ ((pdfpcWindowPresenter*) self, event);
	return result;
}

GtkScrolledWindow*
pdfpc_window_presenter_create_help_window (pdfpcWindowPresenter* self)
{
	GtkScrolledWindow* help_sw = NULL;
	GtkScrolledWindow* _tmp0_;
	GtkScrolledWindow* _tmp1_;
	GtkScrolledWindow* _tmp2_;
	GtkStyleContext* _tmp3_;
	GtkScrolledWindow* _tmp4_;
	GtkGrid* help_grid = NULL;
	GtkGrid* _tmp5_;
	GtkGrid* _tmp6_;
	GtkGrid* _tmp7_;
	GtkGrid* _tmp8_;
	GtkScrolledWindow* _tmp9_;
	GtkGrid* _tmp10_;
	gchar** actions = NULL;
	pdfpcPresentationController* _tmp11_;
	pdfpcPresentationController* _tmp12_;
	gint _tmp13_ = 0;
	gchar** _tmp14_;
	gint actions_length1;
	gint _actions_size_;
	GtkScrolledWindow* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	help_sw = _tmp0_;
	_tmp1_ = help_sw;
	gtk_scrolled_window_set_policy (_tmp1_, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
	_tmp2_ = help_sw;
	_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) _tmp2_);
	gtk_style_context_add_class (_tmp3_, "help");
	_tmp4_ = help_sw;
	g_signal_connect_object ((GtkWidget*) _tmp4_, "key-press-event", (GCallback) ___lambda34__gtk_widget_key_press_event, self, 0);
	_tmp5_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp5_);
	help_grid = _tmp5_;
	_tmp6_ = help_grid;
	gtk_grid_set_row_homogeneous (_tmp6_, TRUE);
	_tmp7_ = help_grid;
	gtk_grid_set_column_spacing (_tmp7_, 20);
	_tmp8_ = help_grid;
	g_object_set ((GtkWidget*) _tmp8_, "margin", 20, NULL);
	_tmp9_ = help_sw;
	_tmp10_ = help_grid;
	gtk_container_add ((GtkContainer*) _tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp12_ = _tmp11_;
	_tmp14_ = pdfpc_presentation_controller_get_action_bindings (_tmp12_, &_tmp13_);
	actions = _tmp14_;
	actions_length1 = _tmp13_;
	_actions_size_ = actions_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp15_ = FALSE;
			_tmp15_ = TRUE;
			while (TRUE) {
				gchar** _tmp16_;
				gint _tmp16__length1;
				gint row = 0;
				GtkLabel* action_lbl = NULL;
				gchar** _tmp17_;
				gint _tmp17__length1;
				const gchar* _tmp18_;
				GtkLabel* _tmp19_;
				GtkLabel* _tmp20_;
				GtkLabel* binding_lbl = NULL;
				gchar** _tmp21_;
				gint _tmp21__length1;
				const gchar* _tmp22_;
				GtkLabel* _tmp23_;
				GtkLabel* _tmp24_;
				GtkGrid* _tmp25_;
				GtkLabel* _tmp26_;
				GtkGrid* _tmp27_;
				GtkLabel* _tmp28_;
				if (!_tmp15_) {
					i += 2;
				}
				_tmp15_ = FALSE;
				_tmp16_ = actions;
				_tmp16__length1 = actions_length1;
				if (!(i < _tmp16__length1)) {
					break;
				}
				row = i / 2;
				_tmp17_ = actions;
				_tmp17__length1 = actions_length1;
				_tmp18_ = _tmp17_[i];
				_tmp19_ = (GtkLabel*) gtk_label_new (_tmp18_);
				g_object_ref_sink (_tmp19_);
				action_lbl = _tmp19_;
				_tmp20_ = action_lbl;
				gtk_widget_set_halign ((GtkWidget*) _tmp20_, GTK_ALIGN_START);
				_tmp21_ = actions;
				_tmp21__length1 = actions_length1;
				_tmp22_ = _tmp21_[i + 1];
				_tmp23_ = (GtkLabel*) gtk_label_new (_tmp22_);
				g_object_ref_sink (_tmp23_);
				binding_lbl = _tmp23_;
				_tmp24_ = binding_lbl;
				gtk_widget_set_halign ((GtkWidget*) _tmp24_, GTK_ALIGN_START);
				_tmp25_ = help_grid;
				_tmp26_ = action_lbl;
				gtk_grid_attach (_tmp25_, (GtkWidget*) _tmp26_, 0, row, 1, 1);
				_tmp27_ = help_grid;
				_tmp28_ = binding_lbl;
				gtk_grid_attach (_tmp27_, (GtkWidget*) _tmp28_, 1, row, 1, 1);
				_g_object_unref0 (binding_lbl);
				_g_object_unref0 (action_lbl);
			}
		}
	}
	result = help_sw;
	actions = (_vala_array_free (actions, actions_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (help_grid);
	return result;
}

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

static void
pdfpc_window_presenter_enable_paned_handle (pdfpcWindowPresenter* self,
                                            GtkPaned* paned,
                                            gboolean onoff)
{
	GdkWindow* handle = NULL;
	GdkWindow* _tmp0_;
	GdkWindow* _tmp1_;
	GdkWindow* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (paned != NULL);
	_tmp0_ = gtk_paned_get_handle_window (paned);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	handle = _tmp1_;
	_tmp2_ = handle;
	if (_tmp2_ != NULL) {
		GdkEventMask emask = 0U;
		GdkCursor* cursor = NULL;
		GtkStyleContext* context = NULL;
		GtkStyleContext* _tmp3_;
		GtkStyleContext* _tmp4_;
		GdkWindow* _tmp12_;
		GdkCursor* _tmp13_;
		GdkWindow* _tmp14_;
		_tmp3_ = gtk_widget_get_style_context ((GtkWidget*) self);
		_tmp4_ = _g_object_ref0 (_tmp3_);
		context = _tmp4_;
		if (onoff) {
			GdkWindow* _tmp5_;
			gconstpointer _tmp6_;
			GdkCursor* _tmp7_;
			GdkWindow* _tmp8_;
			gconstpointer _tmp9_;
			GtkStyleContext* _tmp10_;
			_tmp5_ = handle;
			_tmp6_ = g_object_get_data ((GObject*) _tmp5_, "cursor");
			_tmp7_ = _g_object_ref0 ((GdkCursor*) _tmp6_);
			_g_object_unref0 (cursor);
			cursor = _tmp7_;
			_tmp8_ = handle;
			_tmp9_ = g_object_get_data ((GObject*) _tmp8_, "emask");
			emask = (GdkEventMask) ((gintptr) _tmp9_);
			_tmp10_ = context;
			gtk_style_context_add_class (_tmp10_, "customization");
		} else {
			GtkStyleContext* _tmp11_;
			_g_object_unref0 (cursor);
			cursor = NULL;
			emask = 0;
			_tmp11_ = context;
			gtk_style_context_remove_class (_tmp11_, "customization");
		}
		_tmp12_ = handle;
		_tmp13_ = cursor;
		gdk_window_set_cursor (_tmp12_, _tmp13_);
		_tmp14_ = handle;
		gdk_window_set_events (_tmp14_, emask);
		_g_object_unref0 (context);
		_g_object_unref0 (cursor);
	}
	_g_object_unref0 (handle);
}

/**
         * A wrapper for the Gtk.Paned constructor providing the
         * enable/disable functionality which is missing in Gtk
         */
static Block13Data*
block13_data_ref (Block13Data* _data13_)
{
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}

static void
block13_data_unref (void * _userdata_)
{
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		pdfpcWindowPresenter* self;
		self = _data13_->self;
		_g_object_unref0 (_data13_->paned);
		_g_object_unref0 (self);
		g_slice_free (Block13Data, _data13_);
	}
}

static void
__lambda35_ (Block13Data* _data13_)
{
	pdfpcWindowPresenter* self;
	GdkWindow* handle = NULL;
	GdkWindow* _tmp0_;
	GdkWindow* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GdkWindow* _tmp3_;
	self = _data13_->self;
	_tmp0_ = gtk_paned_get_handle_window (_data13_->paned);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	handle = _tmp1_;
	_tmp3_ = handle;
	if (_tmp3_ != NULL) {
		GdkWindow* _tmp4_;
		gconstpointer _tmp5_;
		_tmp4_ = handle;
		_tmp5_ = g_object_get_data ((GObject*) _tmp4_, "initialized");
		_tmp2_ = !((gboolean) ((gintptr) _tmp5_));
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GdkWindow* _tmp6_;
		GdkWindow* _tmp7_;
		GdkCursor* _tmp8_;
		GdkCursor* _tmp9_;
		GdkWindow* _tmp10_;
		GdkWindow* _tmp11_;
		GdkWindow* _tmp12_;
		_tmp6_ = handle;
		_tmp7_ = handle;
		_tmp8_ = gdk_window_get_cursor (_tmp7_);
		_tmp9_ = _g_object_ref0 (_tmp8_);
		g_object_set_data_full ((GObject*) _tmp6_, "cursor", _tmp9_, g_object_unref);
		_tmp10_ = handle;
		_tmp11_ = handle;
		g_object_set_data_full ((GObject*) _tmp10_, "emask", (gpointer) ((gintptr) gdk_window_get_events (_tmp11_)), NULL);
		_tmp12_ = handle;
		g_object_set_data_full ((GObject*) _tmp12_, "initialized", (gpointer) ((gintptr) TRUE), NULL);
		pdfpc_window_presenter_enable_paned_handle (self, _data13_->paned, FALSE);
	}
	_g_object_unref0 (handle);
}

static void
___lambda35__gtk_widget_map (GtkWidget* _sender,
                             gpointer self)
{
	__lambda35_ (self);
}

GtkPaned*
pdfpc_window_presenter_create_paned (pdfpcWindowPresenter* self,
                                     GtkOrientation orientation)
{
	Block13Data* _data13_;
	GtkPaned* _tmp0_;
	GtkPaned* _tmp1_;
	GtkPaned* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data13_ = g_slice_new0 (Block13Data);
	_data13_->_ref_count_ = 1;
	_data13_->self = g_object_ref (self);
	_tmp0_ = (GtkPaned*) gtk_paned_new (orientation);
	g_object_ref_sink (_tmp0_);
	_data13_->paned = _tmp0_;
	gtk_paned_set_wide_handle (_data13_->paned, TRUE);
	g_signal_connect_data ((GtkWidget*) _data13_->paned, "map", (GCallback) ___lambda35__gtk_widget_map, block13_data_ref (_data13_), (GClosureNotify) block13_data_unref, 0);
	_tmp1_ = _g_object_ref0 (_data13_->paned);
	result = _tmp1_;
	block13_data_unref (_data13_);
	_data13_ = NULL;
	return result;
}

void
pdfpc_window_presenter_set_customizable (pdfpcWindowPresenter* self,
                                         gboolean onoff)
{
	GtkPaned* _tmp0_;
	GtkPaned* _tmp1_;
	GtkPaned* _tmp2_;
	GtkPaned* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->slide_views;
	pdfpc_window_presenter_enable_paned_handle (self, _tmp0_, onoff);
	_tmp1_ = self->current_view_and_stricts;
	pdfpc_window_presenter_enable_paned_handle (self, _tmp1_, onoff);
	_tmp2_ = self->next_view_and_notes;
	pdfpc_window_presenter_enable_paned_handle (self, _tmp2_, onoff);
	_tmp3_ = self->full_layout;
	pdfpc_window_presenter_enable_paned_handle (self, _tmp3_, onoff);
}

void
pdfpc_window_presenter_maximize_current_view (pdfpcWindowPresenter* self,
                                              gboolean onoff)
{
	gboolean _tmp0_;
	gint width = 0;
	gint height = 0;
	GtkPaned* _tmp16_;
	GtkPaned* _tmp17_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_current_view_maximized;
	if (_tmp0_ == onoff) {
		return;
	}
	if (onoff) {
		gint _tmp1_;
		gint _tmp2_;
		GtkPaned* _tmp3_;
		GtkPaned* _tmp4_;
		GtkPaned* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		GtkPaned* _tmp8_;
		GtkPaned* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		_tmp1_ = pdfpc_window_fullscreen_get_window_w ((pdfpcWindowFullscreen*) self);
		_tmp2_ = _tmp1_;
		width = _tmp2_;
		_tmp3_ = self->current_view_and_stricts;
		height = gtk_widget_get_allocated_height ((GtkWidget*) _tmp3_);
		_tmp4_ = self->slide_views;
		_tmp5_ = self->slide_views;
		_tmp6_ = gtk_paned_get_position (_tmp5_);
		_tmp7_ = _tmp6_;
		g_object_set_data_full ((GObject*) _tmp4_, "position", (gpointer) ((gintptr) _tmp7_), NULL);
		_tmp8_ = self->current_view_and_stricts;
		_tmp9_ = self->current_view_and_stricts;
		_tmp10_ = gtk_paned_get_position (_tmp9_);
		_tmp11_ = _tmp10_;
		g_object_set_data_full ((GObject*) _tmp8_, "position", (gpointer) ((gintptr) _tmp11_), NULL);
	} else {
		GtkPaned* _tmp12_;
		gconstpointer _tmp13_;
		GtkPaned* _tmp14_;
		gconstpointer _tmp15_;
		_tmp12_ = self->slide_views;
		_tmp13_ = g_object_get_data ((GObject*) _tmp12_, "position");
		width = (gint) ((gintptr) _tmp13_);
		_tmp14_ = self->current_view_and_stricts;
		_tmp15_ = g_object_get_data ((GObject*) _tmp14_, "position");
		height = (gint) ((gintptr) _tmp15_);
	}
	_tmp16_ = self->slide_views;
	gtk_paned_set_position (_tmp16_, width);
	_tmp17_ = self->current_view_and_stricts;
	gtk_paned_set_position (_tmp17_, height);
	pdfpc_window_presenter_set_current_view_maximized (self, onoff);
}

void
pdfpc_window_presenter_show_status_icons (pdfpcWindowPresenter* self,
                                          gboolean onoff)
{
	g_return_if_fail (self != NULL);
	if (onoff) {
		pdfpc_window_presenter_update_status_icons (self);
	} else {
		GList* icons = NULL;
		GtkBox* _tmp0_;
		GList* _tmp1_;
		GList* _tmp2_;
		_tmp0_ = self->status;
		_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
		icons = _tmp1_;
		_tmp2_ = icons;
		{
			GList* icon_collection = NULL;
			GList* icon_it = NULL;
			icon_collection = _tmp2_;
			for (icon_it = icon_collection; icon_it != NULL; icon_it = icon_it->next) {
				GtkWidget* _tmp3_;
				GtkWidget* icon = NULL;
				_tmp3_ = _g_object_ref0 ((GtkWidget*) icon_it->data);
				icon = _tmp3_;
				{
					GtkWidget* _tmp4_;
					_tmp4_ = icon;
					gtk_widget_hide (_tmp4_);
					_g_object_unref0 (icon);
				}
			}
		}
		(icons == NULL) ? NULL : (icons = (g_list_free (icons), NULL));
	}
}

/**
         * (Re)load status icons
         **/
static void
pdfpc_window_presenter_reload_status_icons (pdfpcWindowPresenter* self,
                                            gint height)
{
	gboolean _tmp0_ = FALSE;
	GList* icons = NULL;
	GtkBox* _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	GtkImage* _tmp8_;
	GtkImage* _tmp9_;
	GtkImage* _tmp10_;
	GtkImage* _tmp11_;
	GtkImage* _tmp12_;
	GtkImage* _tmp13_;
	GtkImage* _tmp14_;
	GtkImage* _tmp15_;
	GtkImage* _tmp16_;
	GtkImage* _tmp17_;
	GtkImage* _tmp18_;
	GtkBox* _tmp19_;
	GtkImage* _tmp20_;
	GtkBox* _tmp21_;
	GtkImage* _tmp22_;
	GtkBox* _tmp23_;
	GtkImage* _tmp24_;
	GtkBox* _tmp25_;
	GtkImage* _tmp26_;
	GtkBox* _tmp27_;
	GtkImage* _tmp28_;
	GtkBox* _tmp29_;
	GtkImage* _tmp30_;
	GtkBox* _tmp31_;
	GtkImage* _tmp32_;
	GtkBox* _tmp33_;
	GtkImage* _tmp34_;
	GtkBox* _tmp35_;
	GtkImage* _tmp36_;
	GtkBox* _tmp37_;
	GtkImage* _tmp38_;
	GtkBox* _tmp39_;
	GtkImage* _tmp40_;
	g_return_if_fail (self != NULL);
	if (!is_Wayland_backend ()) {
		_tmp0_ = !is_Quartz_backend ();
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = pdfpc_window_fullscreen_get_gdk_scale ((pdfpcWindowFullscreen*) self);
		_tmp2_ = _tmp1_;
		height = height * _tmp2_;
	}
	_tmp3_ = self->status;
	_tmp4_ = gtk_container_get_children ((GtkContainer*) _tmp3_);
	icons = _tmp4_;
	_tmp5_ = icons;
	{
		GList* icon_collection = NULL;
		GList* icon_it = NULL;
		icon_collection = _tmp5_;
		for (icon_it = icon_collection; icon_it != NULL; icon_it = icon_it->next) {
			GtkWidget* _tmp6_;
			GtkWidget* icon = NULL;
			_tmp6_ = _g_object_ref0 ((GtkWidget*) icon_it->data);
			icon = _tmp6_;
			{
				GtkWidget* _tmp7_;
				_tmp7_ = icon;
				gtk_widget_destroy (_tmp7_);
				_g_object_unref0 (icon);
			}
		}
	}
	_tmp8_ = pdfpc_window_load_icon ("blank.svg", height);
	_g_object_unref0 (self->blank_icon);
	self->blank_icon = _tmp8_;
	_tmp9_ = pdfpc_window_load_icon ("hidden.svg", height);
	_g_object_unref0 (self->hidden_icon);
	self->hidden_icon = _tmp9_;
	_tmp10_ = pdfpc_window_load_icon ("snow.svg", height);
	_g_object_unref0 (self->frozen_icon);
	self->frozen_icon = _tmp10_;
	_tmp11_ = pdfpc_window_load_icon ("pause.svg", height);
	_g_object_unref0 (self->pause_icon);
	self->pause_icon = _tmp11_;
	_tmp12_ = pdfpc_window_load_icon ("saved.svg", height);
	_g_object_unref0 (self->saved_icon);
	self->saved_icon = _tmp12_;
	_tmp13_ = pdfpc_window_load_icon ("loaded.svg", height);
	_g_object_unref0 (self->loaded_icon);
	self->loaded_icon = _tmp13_;
	_tmp14_ = pdfpc_window_load_icon ("locked.svg", height);
	_g_object_unref0 (self->locked_icon);
	self->locked_icon = _tmp14_;
	_tmp15_ = pdfpc_window_load_icon ("highlight.svg", height);
	_g_object_unref0 (self->highlight_icon);
	self->highlight_icon = _tmp15_;
	_tmp16_ = pdfpc_window_load_icon ("pen.svg", height);
	_g_object_unref0 (self->pen_icon);
	self->pen_icon = _tmp16_;
	_tmp17_ = pdfpc_window_load_icon ("eraser.svg", height);
	_g_object_unref0 (self->eraser_icon);
	self->eraser_icon = _tmp17_;
	_tmp18_ = pdfpc_window_load_icon ("spotlight.svg", height);
	_g_object_unref0 (self->spotlight_icon);
	self->spotlight_icon = _tmp18_;
	_tmp19_ = self->status;
	_tmp20_ = self->blank_icon;
	gtk_box_pack_start (_tmp19_, (GtkWidget*) _tmp20_, FALSE, TRUE, (guint) 0);
	_tmp21_ = self->status;
	_tmp22_ = self->hidden_icon;
	gtk_box_pack_start (_tmp21_, (GtkWidget*) _tmp22_, FALSE, TRUE, (guint) 0);
	_tmp23_ = self->status;
	_tmp24_ = self->frozen_icon;
	gtk_box_pack_start (_tmp23_, (GtkWidget*) _tmp24_, FALSE, TRUE, (guint) 0);
	_tmp25_ = self->status;
	_tmp26_ = self->pause_icon;
	gtk_box_pack_start (_tmp25_, (GtkWidget*) _tmp26_, FALSE, TRUE, (guint) 0);
	_tmp27_ = self->status;
	_tmp28_ = self->saved_icon;
	gtk_box_pack_start (_tmp27_, (GtkWidget*) _tmp28_, FALSE, TRUE, (guint) 0);
	_tmp29_ = self->status;
	_tmp30_ = self->loaded_icon;
	gtk_box_pack_start (_tmp29_, (GtkWidget*) _tmp30_, FALSE, TRUE, (guint) 0);
	_tmp31_ = self->status;
	_tmp32_ = self->locked_icon;
	gtk_box_pack_start (_tmp31_, (GtkWidget*) _tmp32_, FALSE, TRUE, (guint) 0);
	_tmp33_ = self->status;
	_tmp34_ = self->highlight_icon;
	gtk_box_pack_start (_tmp33_, (GtkWidget*) _tmp34_, FALSE, TRUE, (guint) 0);
	_tmp35_ = self->status;
	_tmp36_ = self->pen_icon;
	gtk_box_pack_start (_tmp35_, (GtkWidget*) _tmp36_, FALSE, TRUE, (guint) 0);
	_tmp37_ = self->status;
	_tmp38_ = self->eraser_icon;
	gtk_box_pack_start (_tmp37_, (GtkWidget*) _tmp38_, FALSE, TRUE, (guint) 0);
	_tmp39_ = self->status;
	_tmp40_ = self->spotlight_icon;
	gtk_box_pack_start (_tmp39_, (GtkWidget*) _tmp40_, FALSE, TRUE, (guint) 0);
	(icons == NULL) ? NULL : (icons = (g_list_free (icons), NULL));
}

/**
         * Update (hide/show) status icons
         **/
static void
pdfpc_window_presenter_update_status_icons (pdfpcWindowPresenter* self)
{
	pdfpcPresentationController* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	pdfpcPresentationController* _tmp4_;
	pdfpcPresentationController* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	pdfpcPresentationController* _tmp10_;
	pdfpcPresentationController* _tmp11_;
	gboolean _tmp12_;
	gboolean _tmp13_;
	pdfpcPresentationController* _tmp16_;
	pdfpcPresentationController* _tmp17_;
	gboolean _tmp18_;
	gboolean _tmp19_;
	pdfpcPresentationController* _tmp22_;
	pdfpcPresentationController* _tmp23_;
	pdfpcPresentationController* _tmp26_;
	pdfpcPresentationController* _tmp27_;
	pdfpcPresentationController* _tmp30_;
	pdfpcPresentationController* _tmp31_;
	pdfpcPresentationController* _tmp34_;
	pdfpcPresentationController* _tmp35_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	if (pdfpc_presentation_controller_is_paused (_tmp1_)) {
		GtkImage* _tmp2_;
		_tmp2_ = self->pause_icon;
		gtk_widget_show ((GtkWidget*) _tmp2_);
	} else {
		GtkImage* _tmp3_;
		_tmp3_ = self->pause_icon;
		gtk_widget_hide ((GtkWidget*) _tmp3_);
	}
	_tmp4_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp5_ = _tmp4_;
	_tmp6_ = pdfpc_presentation_controller_get_faded_to_black (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		GtkImage* _tmp8_;
		_tmp8_ = self->blank_icon;
		gtk_widget_show ((GtkWidget*) _tmp8_);
	} else {
		GtkImage* _tmp9_;
		_tmp9_ = self->blank_icon;
		gtk_widget_hide ((GtkWidget*) _tmp9_);
	}
	_tmp10_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp11_ = _tmp10_;
	_tmp12_ = pdfpc_presentation_controller_get_hidden (_tmp11_);
	_tmp13_ = _tmp12_;
	if (_tmp13_) {
		GtkImage* _tmp14_;
		_tmp14_ = self->hidden_icon;
		gtk_widget_show ((GtkWidget*) _tmp14_);
	} else {
		GtkImage* _tmp15_;
		_tmp15_ = self->hidden_icon;
		gtk_widget_hide ((GtkWidget*) _tmp15_);
	}
	_tmp16_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp17_ = _tmp16_;
	_tmp18_ = pdfpc_presentation_controller_get_frozen (_tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_) {
		GtkImage* _tmp20_;
		_tmp20_ = self->frozen_icon;
		gtk_widget_show ((GtkWidget*) _tmp20_);
	} else {
		GtkImage* _tmp21_;
		_tmp21_ = self->frozen_icon;
		gtk_widget_hide ((GtkWidget*) _tmp21_);
	}
	_tmp22_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp23_ = _tmp22_;
	if (pdfpc_presentation_controller_is_pointer_active (_tmp23_)) {
		GtkImage* _tmp24_;
		_tmp24_ = self->highlight_icon;
		gtk_widget_show ((GtkWidget*) _tmp24_);
	} else {
		GtkImage* _tmp25_;
		_tmp25_ = self->highlight_icon;
		gtk_widget_hide ((GtkWidget*) _tmp25_);
	}
	_tmp26_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp27_ = _tmp26_;
	if (pdfpc_presentation_controller_is_eraser_active (_tmp27_)) {
		GtkImage* _tmp28_;
		_tmp28_ = self->eraser_icon;
		gtk_widget_show ((GtkWidget*) _tmp28_);
	} else {
		GtkImage* _tmp29_;
		_tmp29_ = self->eraser_icon;
		gtk_widget_hide ((GtkWidget*) _tmp29_);
	}
	_tmp30_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp31_ = _tmp30_;
	if (pdfpc_presentation_controller_is_pen_active (_tmp31_)) {
		GtkImage* _tmp32_;
		_tmp32_ = self->pen_icon;
		gtk_widget_show ((GtkWidget*) _tmp32_);
	} else {
		GtkImage* _tmp33_;
		_tmp33_ = self->pen_icon;
		gtk_widget_hide ((GtkWidget*) _tmp33_);
	}
	_tmp34_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp35_ = _tmp34_;
	if (pdfpc_presentation_controller_is_spotlight_active (_tmp35_)) {
		GtkImage* _tmp36_;
		_tmp36_ = self->spotlight_icon;
		gtk_widget_show ((GtkWidget*) _tmp36_);
	} else {
		GtkImage* _tmp37_;
		_tmp37_ = self->spotlight_icon;
		gtk_widget_hide ((GtkWidget*) _tmp37_);
	}
}

/**
         * Set font size for the timer & slide progress widgets
         **/
static void
pdfpc_window_presenter_resize_bottom_texts (pdfpcWindowPresenter* self,
                                            gint height)
{
	static const char css_template[] = ".bottomText { font-size: %dpx; }";
	gint font_size = 0;
	gchar* bottom_css = NULL;
	gchar* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	font_size = (gint) (0.7 * height);
	_tmp0_ = g_strdup_printf (css_template, font_size);
	bottom_css = _tmp0_;
	{
		GtkCssProvider* _tmp1_;
		_tmp1_ = self->bottom_text_css_provider;
		gtk_css_provider_load_from_data (_tmp1_, bottom_css, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		g_printerr ("Warning: failed to set CSS for controls.\n");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (bottom_css);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_free0 (bottom_css);
}

static void
pdfpc_window_presenter_on_bottom_resize (pdfpcWindowPresenter* self,
                                         GtkAllocation* a)
{
	gint height = 0;
	GtkAllocation _tmp0_;
	gint jutting = 0;
	GtkStack* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (a != NULL);
	_tmp0_ = *a;
	height = _tmp0_.height;
	_tmp1_ = self->slide_stack;
	_tmp2_ = pdfpc_window_fullscreen_get_window_h ((pdfpcWindowFullscreen*) self);
	_tmp3_ = _tmp2_;
	jutting = ((gtk_widget_get_allocated_height ((GtkWidget*) _tmp1_) + height) + self->priv->handle_thickness) - _tmp3_;
	if (jutting > 0) {
		height -= jutting;
	}
	if (self->priv->bottom_height != height) {
		pdfpcWindowOverview* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gint _tmp8_;
		self->priv->bottom_height = height;
		pdfpc_window_presenter_reload_status_icons (self, height);
		pdfpc_window_presenter_update_status_icons (self);
		pdfpc_window_presenter_resize_bottom_texts (self, height);
		_tmp4_ = self->overview;
		_tmp5_ = pdfpc_window_fullscreen_get_window_w ((pdfpcWindowFullscreen*) self);
		_tmp6_ = _tmp5_;
		_tmp7_ = pdfpc_window_fullscreen_get_window_h ((pdfpcWindowFullscreen*) self);
		_tmp8_ = _tmp7_;
		pdfpc_window_overview_set_available_space (_tmp4_, _tmp6_, _tmp8_ - height);
	}
}

/**
         * Base constructor instantiating a new presenter window
         */
static void
_pdfpc_window_presenter_on_reload_pdfpc_presentation_controller_reload_request (pdfpcPresentationController* _sender,
                                                                                gpointer self)
{
	pdfpc_window_presenter_on_reload ((pdfpcWindowPresenter*) self);
}

static void
_pdfpc_window_presenter_update_pdfpc_presentation_controller_update_request (pdfpcPresentationController* _sender,
                                                                             gpointer self)
{
	pdfpc_window_presenter_update ((pdfpcWindowPresenter*) self);
}

static void
_pdfpc_window_presenter_edit_note_pdfpc_presentation_controller_edit_note_request (pdfpcPresentationController* _sender,
                                                                                   gpointer self)
{
	pdfpc_window_presenter_edit_note ((pdfpcWindowPresenter*) self);
}

static void
_pdfpc_window_presenter_ask_goto_page_pdfpc_presentation_controller_ask_goto_page_request (pdfpcPresentationController* _sender,
                                                                                           gpointer self)
{
	pdfpc_window_presenter_ask_goto_page ((pdfpcWindowPresenter*) self);
}

static void
_pdfpc_window_presenter_show_overview_pdfpc_presentation_controller_show_overview_request (pdfpcPresentationController* _sender,
                                                                                           gpointer self)
{
	pdfpc_window_presenter_show_overview ((pdfpcWindowPresenter*) self);
}

static void
_pdfpc_window_presenter_hide_overview_pdfpc_presentation_controller_hide_overview_request (pdfpcPresentationController* _sender,
                                                                                           gpointer self)
{
	pdfpc_window_presenter_hide_overview ((pdfpcWindowPresenter*) self);
}

static void
_pdfpc_window_presenter_increase_font_size_pdfpc_presentation_controller_increase_font_size_request (pdfpcPresentationController* _sender,
                                                                                                     gpointer self)
{
	pdfpc_window_presenter_increase_font_size ((pdfpcWindowPresenter*) self);
}

static void
_pdfpc_window_presenter_decrease_font_size_pdfpc_presentation_controller_decrease_font_size_request (pdfpcPresentationController* _sender,
                                                                                                     gpointer self)
{
	pdfpc_window_presenter_decrease_font_size ((pdfpcWindowPresenter*) self);
}

static gboolean
_pdfpc_window_presenter_on_key_press_notes_editor_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                              GdkEventKey* event,
                                                                              gpointer self)
{
	gboolean result;
	result = pdfpc_window_presenter_on_key_press_notes_editor ((pdfpcWindowPresenter*) self, _sender, event);
	return result;
}

static void
__lambda37_ (pdfpcWindowPresenter* self,
             const gchar* str)
{
	GtkStyleContext* context = NULL;
	GtkStyleContext* _tmp0_;
	GtkStyleContext* _tmp1_;
	GtkStyleContext* _tmp2_;
	GtkStyleContext* _tmp3_;
	GtkStyleContext* _tmp4_;
	GtkStyleContext* _tmp5_;
	GtkStyleContext* _tmp6_;
	pdfpcPresentationController* _tmp7_;
	pdfpcPresentationController* _tmp8_;
	pdfpcPresentationControllerProgressStatus _tmp9_;
	pdfpcPresentationControllerProgressStatus _tmp10_;
	GtkLabel* _tmp16_;
	g_return_if_fail (str != NULL);
	_tmp0_ = gtk_widget_get_style_context ((GtkWidget*) self);
	_tmp1_ = _g_object_ref0 (_tmp0_);
	context = _tmp1_;
	_tmp2_ = context;
	gtk_style_context_remove_class (_tmp2_, "pretalk");
	_tmp3_ = context;
	gtk_style_context_remove_class (_tmp3_, "too-fast");
	_tmp4_ = context;
	gtk_style_context_remove_class (_tmp4_, "too-slow");
	_tmp5_ = context;
	gtk_style_context_remove_class (_tmp5_, "last-minutes");
	_tmp6_ = context;
	gtk_style_context_remove_class (_tmp6_, "overtime");
	_tmp7_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp8_ = _tmp7_;
	_tmp9_ = pdfpc_presentation_controller_get_progress_status (_tmp8_);
	_tmp10_ = _tmp9_;
	switch (_tmp10_) {
		case PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_PreTalk:
		{
			GtkStyleContext* _tmp11_;
			_tmp11_ = context;
			gtk_style_context_add_class (_tmp11_, "pretalk");
			break;
		}
		case PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_Fast:
		{
			GtkStyleContext* _tmp12_;
			_tmp12_ = context;
			gtk_style_context_add_class (_tmp12_, "too-fast");
			break;
		}
		case PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_Slow:
		{
			GtkStyleContext* _tmp13_;
			_tmp13_ = context;
			gtk_style_context_add_class (_tmp13_, "too-slow");
			break;
		}
		case PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_LastMinutes:
		{
			GtkStyleContext* _tmp14_;
			_tmp14_ = context;
			gtk_style_context_add_class (_tmp14_, "last-minutes");
			break;
		}
		case PDFPC_PRESENTATION_CONTROLLER_PROGRESS_STATUS_Overtime:
		{
			GtkStyleContext* _tmp15_;
			_tmp15_ = context;
			gtk_style_context_add_class (_tmp15_, "overtime");
			break;
		}
		default:
		{
			break;
		}
	}
	_tmp16_ = self->timer_label;
	gtk_label_set_label (_tmp16_, str);
	_g_object_unref0 (context);
}

static void
___lambda37__pdfpc_presentation_controller_timer_change (pdfpcPresentationController* _sender,
                                                         const gchar* label,
                                                         gpointer self)
{
	__lambda37_ ((pdfpcWindowPresenter*) self, label);
}

static gboolean
_pdfpc_window_presenter_on_key_press_slide_progress_gtk_widget_key_press_event (GtkWidget* _sender,
                                                                                GdkEventKey* event,
                                                                                gpointer self)
{
	gboolean result;
	result = pdfpc_window_presenter_on_key_press_slide_progress ((pdfpcWindowPresenter*) self, _sender, event);
	return result;
}

static gboolean
__lambda39_ (pdfpcWindowPresenter* self,
             GdkEventKey* event)
{
	gboolean result;
	g_return_val_if_fail (event != NULL, FALSE);
	switch (event->keyval) {
		case GDK_KEY_Escape:
		case GDK_KEY_Return:
		case GDK_KEY_q:
		{
			pdfpc_window_presenter_show_qrcode_window (self, FALSE);
			result = TRUE;
			return result;
		}
		default:
		{
			result = FALSE;
			return result;
		}
	}
}

static gboolean
___lambda39__gtk_widget_key_press_event (GtkWidget* _sender,
                                         GdkEventKey* event,
                                         gpointer self)
{
	gboolean result;
	result = __lambda39_ ((pdfpcWindowPresenter*) self, event);
	return result;
}

static void
_pdfpc_window_presenter_on_bottom_resize_gtk_widget_size_allocate (GtkWidget* _sender,
                                                                   GtkAllocation* allocation,
                                                                   gpointer self)
{
	pdfpc_window_presenter_on_bottom_resize ((pdfpcWindowPresenter*) self, allocation);
}

pdfpcWindowPresenter*
pdfpc_window_presenter_construct (GType object_type,
                                  pdfpcPresentationController* controller,
                                  gint screen_num,
                                  gboolean windowed)
{
	pdfpcWindowPresenter * self = NULL;
	pdfpcMetadataPdf* _tmp0_;
	pdfpcMetadataPdf* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	pdfpcPresentationController* _tmp6_;
	pdfpcPresentationController* _tmp7_;
	pdfpcPresentationController* _tmp8_;
	pdfpcPresentationController* _tmp9_;
	pdfpcPresentationController* _tmp10_;
	pdfpcPresentationController* _tmp11_;
	pdfpcPresentationController* _tmp12_;
	pdfpcPresentationController* _tmp13_;
	pdfpcPresentationController* _tmp14_;
	pdfpcPresentationController* _tmp15_;
	pdfpcPresentationController* _tmp16_;
	pdfpcPresentationController* _tmp17_;
	pdfpcPresentationController* _tmp18_;
	pdfpcPresentationController* _tmp19_;
	pdfpcPresentationController* _tmp20_;
	pdfpcPresentationController* _tmp21_;
	gfloat page_ratio = 0.0F;
	pdfpcMetadataPdf* _tmp22_;
	pdfpcMetadataPdf* _tmp23_;
	pdfpcMetadataPdf* _tmp24_;
	pdfpcMetadataPdf* _tmp25_;
	gint current_allocated_width = 0;
	gint _tmp26_;
	gint _tmp27_;
	pdfpcViewPdf* _tmp28_;
	pdfpcViewPdf* _tmp29_;
	pdfpcViewPdf* _tmp30_;
	GtkCssProvider* _tmp31_;
	GdkScreen* _tmp32_;
	GtkCssProvider* _tmp33_;
	GtkCssProvider* _tmp34_;
	GdkScreen* _tmp35_;
	GtkCssProvider* _tmp36_;
	GtkAspectFrame* frame = NULL;
	GtkTextView* _tmp37_;
	GtkTextView* _tmp38_;
	GtkTextView* _tmp39_;
	GtkTextView* _tmp40_;
	GtkTextView* _tmp41_;
	GtkTextView* _tmp42_;
	GtkTextBuffer* _tmp43_;
	GtkTextBuffer* _tmp44_;
	GtkTextView* _tmp45_;
	GtkScrolledWindow* notes_sw = NULL;
	GtkScrolledWindow* _tmp46_;
	GtkScrolledWindow* _tmp47_;
	GtkTextView* _tmp48_;
	GtkScrolledWindow* _tmp49_;
	pdfpcViewPdf* _tmp50_;
	GtkAspectFrame* _tmp51_;
	GtkAspectFrame* _tmp52_;
	pdfpcViewPdf* _tmp53_;
	GtkStack* _tmp54_;
	GtkStack* _tmp55_;
	GtkScrolledWindow* _tmp56_;
	GtkStack* _tmp57_;
	GtkAspectFrame* _tmp58_;
	pdfpcViewMarkdownView* _tmp59_;
	GtkStack* _tmp60_;
	pdfpcViewMarkdownView* _tmp61_;
	GtkStack* _tmp62_;
	gint meta_font_size = 0;
	pdfpcMetadataPdf* _tmp63_;
	pdfpcMetadataPdf* _tmp64_;
	GtkLabel* _tmp65_;
	GtkLabel* _tmp66_;
	GtkLabel* _tmp67_;
	GtkStyleContext* _tmp68_;
	GtkLabel* _tmp69_;
	GtkLabel* _tmp70_;
	GtkLabel* _tmp71_;
	GtkLabel* _tmp72_;
	pdfpcPresentationController* _tmp73_;
	pdfpcPresentationController* _tmp74_;
	pdfpcPresentationController* _tmp75_;
	pdfpcPresentationController* _tmp76_;
	GtkEntry* _tmp77_;
	GtkEntry* _tmp78_;
	GtkEntry* _tmp79_;
	GtkStyleContext* _tmp80_;
	GtkEntry* _tmp81_;
	GtkEntry* _tmp82_;
	GtkEntry* _tmp83_;
	GtkEntry* _tmp84_;
	GtkEntry* _tmp85_;
	GtkEntry* _tmp86_;
	GtkBox* _tmp87_;
	pdfpcPresentationController* _tmp88_;
	pdfpcPresentationController* _tmp89_;
	pdfpcWindowOverview* _tmp90_;
	pdfpcWindowOverview* _tmp91_;
	pdfpcWindowOverview* _tmp92_;
	pdfpcWindowOverview* _tmp93_;
	pdfpcPresentationController* _tmp94_;
	pdfpcPresentationController* _tmp95_;
	gint _tmp96_;
	gint _tmp97_;
	pdfpcPresentationController* _tmp98_;
	pdfpcPresentationController* _tmp99_;
	pdfpcWindowOverview* _tmp100_;
	GtkPaned* _tmp101_;
	GtkPaned* _tmp102_;
	GtkGrid* strict_views = NULL;
	GtkGrid* _tmp103_;
	GtkGrid* _tmp104_;
	GtkGrid* _tmp105_;
	GtkGrid* _tmp106_;
	GtkAspectFrame* _tmp107_;
	GtkAspectFrame* _tmp108_;
	pdfpcViewPdf* _tmp109_;
	GtkGrid* _tmp110_;
	GtkAspectFrame* _tmp111_;
	GtkAspectFrame* _tmp112_;
	GtkAspectFrame* _tmp113_;
	pdfpcViewPdf* _tmp114_;
	GtkGrid* _tmp115_;
	GtkAspectFrame* _tmp116_;
	GtkPaned* _tmp117_;
	gdouble main_height = 0.0;
	gint _tmp118_;
	gint _tmp119_;
	gdouble wheight1 = 0.0;
	gdouble wheight2 = 0.0;
	GtkPaned* _tmp120_;
	GtkAspectFrame* _tmp121_;
	GtkAspectFrame* _tmp122_;
	GtkOverlay* _tmp123_;
	GtkPaned* _tmp124_;
	GtkAspectFrame* _tmp125_;
	GtkPaned* _tmp126_;
	GtkGrid* _tmp127_;
	GtkPaned* _tmp128_;
	GtkPaned* _tmp129_;
	GtkPaned* _tmp130_;
	gint next_allocated_width = 0;
	gint _tmp131_;
	gint _tmp132_;
	GtkPaned* _tmp133_;
	GtkAspectFrame* _tmp134_;
	GtkAspectFrame* _tmp135_;
	pdfpcViewPdf* _tmp136_;
	GtkPaned* _tmp137_;
	GtkAspectFrame* _tmp138_;
	GtkPaned* _tmp139_;
	GtkStack* _tmp140_;
	GtkPaned* _tmp141_;
	GtkPaned* _tmp142_;
	GtkScrolledWindow* help_sw = NULL;
	GtkScrolledWindow* _tmp143_;
	pdfpcWindowQRCode* qrcode_da = NULL;
	pdfpcPresentationController* _tmp144_;
	pdfpcPresentationController* _tmp145_;
	gint _tmp146_;
	gint _tmp147_;
	pdfpcWindowQRCode* _tmp148_;
	pdfpcWindowQRCode* _tmp149_;
	GtkStack* _tmp150_;
	GtkStack* _tmp151_;
	GtkPaned* _tmp152_;
	GtkStack* _tmp153_;
	pdfpcWindowOverview* _tmp154_;
	GtkStack* _tmp155_;
	GtkScrolledWindow* _tmp156_;
	GtkStack* _tmp157_;
	pdfpcWindowQRCode* _tmp158_;
	GtkStack* _tmp159_;
	GtkBox* bottom_row = NULL;
	GtkBox* _tmp160_;
	GtkBox* _tmp161_;
	GtkBox* _tmp162_;
	GtkBox* _tmp163_;
	GtkBox* _tmp164_;
	GtkLabel* _tmp165_;
	GtkBox* _tmp166_;
	GtkEntry* _tmp167_;
	GtkBox* _tmp168_;
	GtkPaned* _tmp169_;
	GtkPaned* _tmp170_;
	GtkPaned* _tmp171_;
	GtkStack* _tmp172_;
	GtkPaned* _tmp173_;
	GtkBox* _tmp174_;
	GtkOverlay* full_overlay = NULL;
	GtkOverlay* _tmp175_;
	GtkOverlay* _tmp176_;
	GtkPaned* _tmp177_;
	gint toolbox_icon_height = 0;
	gboolean _tmp178_ = FALSE;
	pdfpcWindowToolBox* _tmp181_;
	GtkOverlay* _tmp182_;
	pdfpcWindowToolBox* _tmp183_;
	GtkOverlay* _tmp184_;
	pdfpcWindowToolBox* _tmp185_;
	GtkOverlay* _tmp186_;
	g_return_val_if_fail (controller != NULL, NULL);
	self = (pdfpcWindowPresenter*) pdfpc_window_controllable_window_construct (object_type, controller, TRUE, screen_num, windowed, -1, -1);
	_tmp0_ = pdfpc_presentation_controller_get_metadata (controller);
	_tmp1_ = _tmp0_;
	_tmp2_ = pdfpc_metadata_pdf_get_title (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf ("pdfpc - presenter (%s)", _tmp3_);
	_tmp5_ = _tmp4_;
	gtk_window_set_title ((GtkWindow*) self, _tmp5_);
	_g_free0 (_tmp5_);
	_g_free0 (_tmp3_);
	_tmp6_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp7_ = _tmp6_;
	g_signal_connect_object (_tmp7_, "reload-request", (GCallback) _pdfpc_window_presenter_on_reload_pdfpc_presentation_controller_reload_request, self, 0);
	_tmp8_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp9_ = _tmp8_;
	g_signal_connect_object (_tmp9_, "update-request", (GCallback) _pdfpc_window_presenter_update_pdfpc_presentation_controller_update_request, self, 0);
	_tmp10_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp11_ = _tmp10_;
	g_signal_connect_object (_tmp11_, "edit-note-request", (GCallback) _pdfpc_window_presenter_edit_note_pdfpc_presentation_controller_edit_note_request, self, 0);
	_tmp12_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp13_ = _tmp12_;
	g_signal_connect_object (_tmp13_, "ask-goto-page-request", (GCallback) _pdfpc_window_presenter_ask_goto_page_pdfpc_presentation_controller_ask_goto_page_request, self, 0);
	_tmp14_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp15_ = _tmp14_;
	g_signal_connect_object (_tmp15_, "show-overview-request", (GCallback) _pdfpc_window_presenter_show_overview_pdfpc_presentation_controller_show_overview_request, self, 0);
	_tmp16_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp17_ = _tmp16_;
	g_signal_connect_object (_tmp17_, "hide-overview-request", (GCallback) _pdfpc_window_presenter_hide_overview_pdfpc_presentation_controller_hide_overview_request, self, 0);
	_tmp18_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp19_ = _tmp18_;
	g_signal_connect_object (_tmp19_, "increase-font-size-request", (GCallback) _pdfpc_window_presenter_increase_font_size_pdfpc_presentation_controller_increase_font_size_request, self, 0);
	_tmp20_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp21_ = _tmp20_;
	g_signal_connect_object (_tmp21_, "decrease-font-size-request", (GCallback) _pdfpc_window_presenter_decrease_font_size_pdfpc_presentation_controller_decrease_font_size_request, self, 0);
	_tmp22_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp23_ = _tmp22_;
	_tmp24_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp25_ = _tmp24_;
	page_ratio = (gfloat) (pdfpc_metadata_pdf_get_page_width (_tmp23_) / pdfpc_metadata_pdf_get_page_height (_tmp25_));
	_tmp26_ = pdfpc_window_fullscreen_get_window_w ((pdfpcWindowFullscreen*) self);
	_tmp27_ = _tmp26_;
	current_allocated_width = (gint) ((_tmp27_ * pdfpc_options_current_size) / 100.0);
	_tmp28_ = pdfpc_view_pdf_new_from_controllable_window ((pdfpcWindowControllableWindow*) self, FALSE, FALSE, TRUE);
	g_object_ref_sink (_tmp28_);
	_g_object_unref0 (self->next_view);
	self->next_view = _tmp28_;
	_tmp29_ = pdfpc_view_pdf_new_from_controllable_window ((pdfpcWindowControllableWindow*) self, FALSE, FALSE, FALSE);
	g_object_ref_sink (_tmp29_);
	_g_object_unref0 (self->strict_next_view);
	self->strict_next_view = _tmp29_;
	_tmp30_ = pdfpc_view_pdf_new_from_controllable_window ((pdfpcWindowControllableWindow*) self, FALSE, FALSE, FALSE);
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->strict_prev_view);
	self->strict_prev_view = _tmp30_;
	_tmp31_ = gtk_css_provider_new ();
	_g_object_unref0 (self->css_provider);
	self->css_provider = _tmp31_;
	_tmp32_ = ((pdfpcWindowFullscreen*) self)->screen_to_use;
	_tmp33_ = self->css_provider;
	gtk_style_context_add_provider_for_screen (_tmp32_, (GtkStyleProvider*) _tmp33_, (guint) GTK_STYLE_PROVIDER_PRIORITY_USER);
	_tmp34_ = gtk_css_provider_new ();
	_g_object_unref0 (self->bottom_text_css_provider);
	self->bottom_text_css_provider = _tmp34_;
	_tmp35_ = ((pdfpcWindowFullscreen*) self)->screen_to_use;
	_tmp36_ = self->bottom_text_css_provider;
	gtk_style_context_add_provider_for_screen (_tmp35_, (GtkStyleProvider*) _tmp36_, (guint) GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
	_tmp37_ = (GtkTextView*) gtk_text_view_new ();
	g_object_ref_sink (_tmp37_);
	_g_object_unref0 (self->notes_editor);
	self->notes_editor = _tmp37_;
	_tmp38_ = self->notes_editor;
	gtk_widget_set_name ((GtkWidget*) _tmp38_, "notesView");
	_tmp39_ = self->notes_editor;
	gtk_text_view_set_editable (_tmp39_, FALSE);
	_tmp40_ = self->notes_editor;
	gtk_text_view_set_cursor_visible (_tmp40_, FALSE);
	_tmp41_ = self->notes_editor;
	gtk_text_view_set_wrap_mode (_tmp41_, GTK_WRAP_WORD);
	_tmp42_ = self->notes_editor;
	_tmp43_ = gtk_text_view_get_buffer (_tmp42_);
	_tmp44_ = _tmp43_;
	g_object_set (_tmp44_, "text", "", NULL);
	_tmp45_ = self->notes_editor;
	g_signal_connect_object ((GtkWidget*) _tmp45_, "key-press-event", (GCallback) _pdfpc_window_presenter_on_key_press_notes_editor_gtk_widget_key_press_event, self, 0);
	_tmp46_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp46_);
	notes_sw = _tmp46_;
	_tmp47_ = notes_sw;
	_tmp48_ = self->notes_editor;
	gtk_container_add ((GtkContainer*) _tmp47_, (GtkWidget*) _tmp48_);
	_tmp49_ = notes_sw;
	gtk_scrolled_window_set_policy (_tmp49_, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
	_tmp50_ = pdfpc_view_pdf_new_from_controllable_window ((pdfpcWindowControllableWindow*) self, TRUE, FALSE, FALSE);
	g_object_ref_sink (_tmp50_);
	_g_object_unref0 (self->notes_view);
	self->notes_view = _tmp50_;
	_tmp51_ = (GtkAspectFrame*) gtk_aspect_frame_new (NULL, 0.5f, 0.0f, page_ratio, FALSE);
	g_object_ref_sink (_tmp51_);
	_g_object_unref0 (frame);
	frame = _tmp51_;
	_tmp52_ = frame;
	_tmp53_ = self->notes_view;
	gtk_container_add ((GtkContainer*) _tmp52_, (GtkWidget*) _tmp53_);
	_tmp54_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp54_);
	_g_object_unref0 (self->notes_stack);
	self->notes_stack = _tmp54_;
	_tmp55_ = self->notes_stack;
	_tmp56_ = notes_sw;
	gtk_stack_add_named (_tmp55_, (GtkWidget*) _tmp56_, "editor");
	_tmp57_ = self->notes_stack;
	_tmp58_ = frame;
	gtk_stack_add_named (_tmp57_, (GtkWidget*) _tmp58_, "view");
	_tmp59_ = pdfpc_view_markdown_view_new ();
	g_object_ref_sink (_tmp59_);
	_g_object_unref0 (self->mdview);
	self->mdview = _tmp59_;
	_tmp60_ = self->notes_stack;
	_tmp61_ = self->mdview;
	gtk_stack_add_named (_tmp60_, (GtkWidget*) _tmp61_, "mdview");
	_tmp62_ = self->notes_stack;
	gtk_stack_set_homogeneous (_tmp62_, TRUE);
	_tmp63_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp64_ = _tmp63_;
	meta_font_size = pdfpc_metadata_pdf_get_font_size (_tmp64_);
	pdfpc_window_presenter_apply_font_size (self, meta_font_size);
	_tmp65_ = (GtkLabel*) gtk_label_new ("");
	g_object_ref_sink (_tmp65_);
	_g_object_unref0 (self->timer_label);
	self->timer_label = _tmp65_;
	_tmp66_ = self->timer_label;
	gtk_widget_set_name ((GtkWidget*) _tmp66_, "timer");
	_tmp67_ = self->timer_label;
	_tmp68_ = gtk_widget_get_style_context ((GtkWidget*) _tmp67_);
	gtk_style_context_add_class (_tmp68_, "bottomText");
	_tmp69_ = self->timer_label;
	gtk_label_set_justify (_tmp69_, GTK_JUSTIFY_CENTER);
	_tmp70_ = self->timer_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp70_, GTK_ALIGN_CENTER);
	_tmp71_ = self->timer_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp71_, GTK_ALIGN_CENTER);
	_tmp72_ = self->timer_label;
	g_object_set ((GtkWidget*) _tmp72_, "margin", 0, NULL);
	_tmp73_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp74_ = _tmp73_;
	g_signal_connect_object (_tmp74_, "timer-change", (GCallback) ___lambda37__pdfpc_presentation_controller_timer_change, self, 0);
	_tmp75_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp76_ = _tmp75_;
	pdfpc_presentation_controller_reset_timer (_tmp76_);
	_tmp77_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp77_);
	_g_object_unref0 (self->slide_progress);
	self->slide_progress = _tmp77_;
	_tmp78_ = self->slide_progress;
	gtk_widget_set_name ((GtkWidget*) _tmp78_, "slideProgress");
	_tmp79_ = self->slide_progress;
	_tmp80_ = gtk_widget_get_style_context ((GtkWidget*) _tmp79_);
	gtk_style_context_add_class (_tmp80_, "bottomText");
	_tmp81_ = self->slide_progress;
	gtk_entry_set_alignment (_tmp81_, 1.f);
	_tmp82_ = self->slide_progress;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp82_, FALSE);
	_tmp83_ = self->slide_progress;
	gtk_entry_set_has_frame (_tmp83_, FALSE);
	_tmp84_ = self->slide_progress;
	g_signal_connect_object ((GtkWidget*) _tmp84_, "key-press-event", (GCallback) _pdfpc_window_presenter_on_key_press_slide_progress_gtk_widget_key_press_event, self, 0);
	_tmp85_ = self->slide_progress;
	gtk_widget_set_valign ((GtkWidget*) _tmp85_, GTK_ALIGN_CENTER);
	_tmp86_ = self->slide_progress;
	gtk_entry_set_width_chars (_tmp86_, 7);
	_tmp87_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp87_);
	_g_object_unref0 (self->status);
	self->status = _tmp87_;
	_tmp88_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp89_ = _tmp88_;
	_tmp90_ = pdfpc_window_overview_new (_tmp89_);
	g_object_ref_sink (_tmp90_);
	_g_object_unref0 (self->overview);
	self->overview = _tmp90_;
	_tmp91_ = self->overview;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp91_, TRUE);
	_tmp92_ = self->overview;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp92_, TRUE);
	_tmp93_ = self->overview;
	_tmp94_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp95_ = _tmp94_;
	_tmp96_ = pdfpc_presentation_controller_get_user_n_slides (_tmp95_);
	_tmp97_ = _tmp96_;
	pdfpc_window_overview_set_n_slides (_tmp93_, _tmp97_);
	_tmp98_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp99_ = _tmp98_;
	_tmp100_ = self->overview;
	pdfpc_presentation_controller_set_overview (_tmp99_, _tmp100_);
	_tmp101_ = pdfpc_window_presenter_create_paned (self, GTK_ORIENTATION_HORIZONTAL);
	_g_object_unref0 (self->slide_views);
	self->slide_views = _tmp101_;
	_tmp102_ = self->slide_views;
	gtk_paned_set_position (_tmp102_, current_allocated_width);
	_tmp103_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp103_);
	strict_views = _tmp103_;
	_tmp104_ = strict_views;
	gtk_grid_set_column_homogeneous (_tmp104_, TRUE);
	_tmp105_ = strict_views;
	gtk_grid_set_row_homogeneous (_tmp105_, TRUE);
	_tmp106_ = strict_views;
	gtk_grid_set_column_spacing (_tmp106_, 10);
	_tmp107_ = (GtkAspectFrame*) gtk_aspect_frame_new (NULL, 0.0f, 0.0f, page_ratio, FALSE);
	g_object_ref_sink (_tmp107_);
	_g_object_unref0 (frame);
	frame = _tmp107_;
	_tmp108_ = frame;
	_tmp109_ = self->strict_prev_view;
	gtk_container_add ((GtkContainer*) _tmp108_, (GtkWidget*) _tmp109_);
	_tmp110_ = strict_views;
	_tmp111_ = frame;
	gtk_grid_attach (_tmp110_, (GtkWidget*) _tmp111_, 0, 0, 1, 1);
	_tmp112_ = (GtkAspectFrame*) gtk_aspect_frame_new (NULL, 1.0f, 0.0f, page_ratio, FALSE);
	g_object_ref_sink (_tmp112_);
	_g_object_unref0 (frame);
	frame = _tmp112_;
	_tmp113_ = frame;
	_tmp114_ = self->strict_next_view;
	gtk_container_add ((GtkContainer*) _tmp113_, (GtkWidget*) _tmp114_);
	_tmp115_ = strict_views;
	_tmp116_ = frame;
	gtk_grid_attach (_tmp115_, (GtkWidget*) _tmp116_, 1, 0, 1, 1);
	_tmp117_ = pdfpc_window_presenter_create_paned (self, GTK_ORIENTATION_VERTICAL);
	_g_object_unref0 (self->current_view_and_stricts);
	self->current_view_and_stricts = _tmp117_;
	_tmp118_ = pdfpc_window_fullscreen_get_window_h ((pdfpcWindowFullscreen*) self);
	_tmp119_ = _tmp118_;
	main_height = (1.0 - (pdfpc_options_status_height / 100.0)) * _tmp119_;
	wheight1 = (pdfpc_options_current_height / 100.0) * main_height;
	wheight2 = (gdouble) (current_allocated_width / page_ratio);
	_tmp120_ = self->current_view_and_stricts;
	gtk_paned_set_position (_tmp120_, (gint) MIN (wheight1, wheight2));
	_tmp121_ = (GtkAspectFrame*) gtk_aspect_frame_new (NULL, 0.5f, 0.0f, page_ratio, FALSE);
	g_object_ref_sink (_tmp121_);
	_g_object_unref0 (frame);
	frame = _tmp121_;
	_tmp122_ = frame;
	_tmp123_ = ((pdfpcWindowControllableWindow*) self)->overlay_layout;
	gtk_container_add ((GtkContainer*) _tmp122_, (GtkWidget*) _tmp123_);
	_tmp124_ = self->current_view_and_stricts;
	_tmp125_ = frame;
	gtk_paned_pack1 (_tmp124_, (GtkWidget*) _tmp125_, TRUE, TRUE);
	_tmp126_ = self->current_view_and_stricts;
	_tmp127_ = strict_views;
	gtk_paned_pack2 (_tmp126_, (GtkWidget*) _tmp127_, TRUE, TRUE);
	_tmp128_ = self->slide_views;
	_tmp129_ = self->current_view_and_stricts;
	gtk_paned_pack1 (_tmp128_, (GtkWidget*) _tmp129_, TRUE, TRUE);
	_tmp130_ = pdfpc_window_presenter_create_paned (self, GTK_ORIENTATION_VERTICAL);
	_g_object_unref0 (self->next_view_and_notes);
	self->next_view_and_notes = _tmp130_;
	_tmp131_ = pdfpc_window_fullscreen_get_window_w ((pdfpcWindowFullscreen*) self);
	_tmp132_ = _tmp131_;
	next_allocated_width = (_tmp132_ - current_allocated_width) - self->priv->handle_thickness;
	wheight1 = (pdfpc_options_next_height / 100.0) * main_height;
	wheight2 = (gdouble) (next_allocated_width / page_ratio);
	_tmp133_ = self->next_view_and_notes;
	gtk_paned_set_position (_tmp133_, (gint) MIN (wheight1, wheight2));
	_tmp134_ = (GtkAspectFrame*) gtk_aspect_frame_new (NULL, 0.5f, 0.0f, page_ratio, FALSE);
	g_object_ref_sink (_tmp134_);
	_g_object_unref0 (frame);
	frame = _tmp134_;
	_tmp135_ = frame;
	_tmp136_ = self->next_view;
	gtk_container_add ((GtkContainer*) _tmp135_, (GtkWidget*) _tmp136_);
	_tmp137_ = self->next_view_and_notes;
	_tmp138_ = frame;
	gtk_paned_pack1 (_tmp137_, (GtkWidget*) _tmp138_, TRUE, TRUE);
	_tmp139_ = self->next_view_and_notes;
	_tmp140_ = self->notes_stack;
	gtk_paned_pack2 (_tmp139_, (GtkWidget*) _tmp140_, TRUE, TRUE);
	_tmp141_ = self->slide_views;
	_tmp142_ = self->next_view_and_notes;
	gtk_paned_pack2 (_tmp141_, (GtkWidget*) _tmp142_, TRUE, TRUE);
	_tmp143_ = pdfpc_window_presenter_create_help_window (self);
	help_sw = _tmp143_;
	_tmp144_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp145_ = _tmp144_;
	_tmp146_ = pdfpc_window_fullscreen_get_window_h ((pdfpcWindowFullscreen*) self);
	_tmp147_ = _tmp146_;
	_tmp148_ = pdfpc_window_qr_code_new (_tmp145_, 0.5 * _tmp147_);
	g_object_ref_sink (_tmp148_);
	qrcode_da = _tmp148_;
	_tmp149_ = qrcode_da;
	g_signal_connect_object ((GtkWidget*) _tmp149_, "key-press-event", (GCallback) ___lambda39__gtk_widget_key_press_event, self, 0);
	_tmp150_ = (GtkStack*) gtk_stack_new ();
	g_object_ref_sink (_tmp150_);
	_g_object_unref0 (self->slide_stack);
	self->slide_stack = _tmp150_;
	_tmp151_ = self->slide_stack;
	_tmp152_ = self->slide_views;
	gtk_stack_add_named (_tmp151_, (GtkWidget*) _tmp152_, "slides");
	_tmp153_ = self->slide_stack;
	_tmp154_ = self->overview;
	gtk_stack_add_named (_tmp153_, (GtkWidget*) _tmp154_, "overview");
	_tmp155_ = self->slide_stack;
	_tmp156_ = help_sw;
	gtk_stack_add_named (_tmp155_, (GtkWidget*) _tmp156_, "help");
	_tmp157_ = self->slide_stack;
	_tmp158_ = qrcode_da;
	gtk_stack_add_named (_tmp157_, (GtkWidget*) _tmp158_, "qrcode");
	_tmp159_ = self->slide_stack;
	gtk_stack_set_homogeneous (_tmp159_, TRUE);
	_tmp160_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	g_object_ref_sink (_tmp160_);
	bottom_row = _tmp160_;
	_tmp161_ = bottom_row;
	gtk_box_set_homogeneous (_tmp161_, TRUE);
	_tmp162_ = bottom_row;
	_tmp163_ = self->status;
	gtk_box_pack_start (_tmp162_, (GtkWidget*) _tmp163_, TRUE, TRUE, (guint) 0);
	_tmp164_ = bottom_row;
	_tmp165_ = self->timer_label;
	gtk_box_pack_start (_tmp164_, (GtkWidget*) _tmp165_, TRUE, TRUE, (guint) 0);
	_tmp166_ = bottom_row;
	_tmp167_ = self->slide_progress;
	gtk_box_pack_start (_tmp166_, (GtkWidget*) _tmp167_, TRUE, TRUE, (guint) 0);
	_tmp168_ = bottom_row;
	g_signal_connect_object ((GtkWidget*) _tmp168_, "size-allocate", (GCallback) _pdfpc_window_presenter_on_bottom_resize_gtk_widget_size_allocate, self, 0);
	_tmp169_ = pdfpc_window_presenter_create_paned (self, GTK_ORIENTATION_VERTICAL);
	_g_object_unref0 (self->full_layout);
	self->full_layout = _tmp169_;
	_tmp170_ = self->full_layout;
	gtk_paned_set_position (_tmp170_, (gint) main_height);
	_tmp171_ = self->full_layout;
	_tmp172_ = self->slide_stack;
	gtk_paned_pack1 (_tmp171_, (GtkWidget*) _tmp172_, TRUE, TRUE);
	_tmp173_ = self->full_layout;
	_tmp174_ = bottom_row;
	gtk_paned_pack2 (_tmp173_, (GtkWidget*) _tmp174_, TRUE, TRUE);
	_tmp175_ = (GtkOverlay*) gtk_overlay_new ();
	g_object_ref_sink (_tmp175_);
	full_overlay = _tmp175_;
	_tmp176_ = full_overlay;
	_tmp177_ = self->full_layout;
	gtk_container_add ((GtkContainer*) _tmp176_, (GtkWidget*) _tmp177_);
	toolbox_icon_height = 36;
	if (!is_Wayland_backend ()) {
		_tmp178_ = !is_Quartz_backend ();
	} else {
		_tmp178_ = FALSE;
	}
	if (_tmp178_) {
		gint _tmp179_;
		gint _tmp180_;
		_tmp179_ = pdfpc_window_fullscreen_get_gdk_scale ((pdfpcWindowFullscreen*) self);
		_tmp180_ = _tmp179_;
		toolbox_icon_height *= _tmp180_;
	}
	_tmp181_ = pdfpc_window_tool_box_new (self, toolbox_icon_height);
	g_object_ref_sink (_tmp181_);
	_g_object_unref0 (self->toolbox);
	self->toolbox = _tmp181_;
	_tmp182_ = full_overlay;
	_tmp183_ = self->toolbox;
	gtk_overlay_add_overlay (_tmp182_, (GtkWidget*) _tmp183_);
	_tmp184_ = full_overlay;
	_tmp185_ = self->toolbox;
	gtk_overlay_set_overlay_pass_through (_tmp184_, (GtkWidget*) _tmp185_, TRUE);
	_tmp186_ = full_overlay;
	pdfpc_window_controllable_window_add_top_container ((pdfpcWindowControllableWindow*) self, (GtkWidget*) _tmp186_);
	_g_object_unref0 (full_overlay);
	_g_object_unref0 (bottom_row);
	_g_object_unref0 (qrcode_da);
	_g_object_unref0 (help_sw);
	_g_object_unref0 (strict_views);
	_g_object_unref0 (notes_sw);
	_g_object_unref0 (frame);
	return self;
}

pdfpcWindowPresenter*
pdfpc_window_presenter_new (pdfpcPresentationController* controller,
                            gint screen_num,
                            gboolean windowed)
{
	return pdfpc_window_presenter_construct (PDFPC_WINDOW_TYPE_PRESENTER, controller, screen_num, windowed);
}

void
pdfpc_window_presenter_session_saved (pdfpcWindowPresenter* self)
{
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->saved_icon;
	gtk_widget_show ((GtkWidget*) _tmp0_);
}

void
pdfpc_window_presenter_session_loaded (pdfpcWindowPresenter* self)
{
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->loaded_icon;
	gtk_widget_show ((GtkWidget*) _tmp0_);
}

/**
         * Update the slide count view
         */
void
pdfpc_window_presenter_update_slide_count (pdfpcWindowPresenter* self)
{
	gint current_user_slide_number = 0;
	pdfpcPresentationController* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = pdfpc_presentation_controller_get_current_user_slide_number (_tmp1_);
	_tmp3_ = _tmp2_;
	current_user_slide_number = _tmp3_;
	pdfpc_window_presenter_custom_slide_count (self, current_user_slide_number + 1);
}

void
pdfpc_window_presenter_custom_slide_count (pdfpcWindowPresenter* self,
                                           gint current)
{
	gint total = 0;
	pdfpcMetadataPdf* _tmp0_;
	pdfpcMetadataPdf* _tmp1_;
	GtkEntry* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp1_ = _tmp0_;
	total = pdfpc_metadata_pdf_get_end_user_slide (_tmp1_) + 1;
	_tmp2_ = self->slide_progress;
	_tmp3_ = g_strdup_printf ("%d/%u", current, (guint) total);
	_tmp4_ = _tmp3_;
	gtk_entry_set_text (_tmp2_, _tmp4_);
	_g_free0 (_tmp4_);
}

/**
         * Called on document reload.
         * TODO: in principle the document geometry may change!
         */
void
pdfpc_window_presenter_on_reload (pdfpcWindowPresenter* self)
{
	pdfpcViewPdf* _tmp0_;
	pdfpcViewPdf* _tmp1_;
	pdfpcViewPdf* _tmp2_;
	pdfpcViewPdf* _tmp3_;
	pdfpcWindowOverview* _tmp4_;
	pdfpcPresentationController* _tmp5_;
	pdfpcPresentationController* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->next_view;
	pdfpc_view_pdf_invalidate (_tmp0_);
	_tmp1_ = self->strict_next_view;
	pdfpc_view_pdf_invalidate (_tmp1_);
	_tmp2_ = self->strict_prev_view;
	pdfpc_view_pdf_invalidate (_tmp2_);
	_tmp3_ = self->notes_view;
	pdfpc_view_pdf_invalidate (_tmp3_);
	_tmp4_ = self->overview;
	_tmp5_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = pdfpc_presentation_controller_get_user_n_slides (_tmp6_);
	_tmp8_ = _tmp7_;
	pdfpc_window_overview_set_n_slides (_tmp4_, _tmp8_);
}

void
pdfpc_window_presenter_update (pdfpcWindowPresenter* self)
{
	pdfpcMetadataPdf* _tmp0_;
	pdfpcMetadataPdf* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gint current_slide_number = 0;
	pdfpcPresentationController* _tmp4_;
	pdfpcPresentationController* _tmp5_;
	gint _tmp6_;
	gint _tmp7_;
	gint current_user_slide_number = 0;
	pdfpcPresentationController* _tmp8_;
	pdfpcPresentationController* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	pdfpcViewPdf* _tmp12_;
	pdfpcViewPdf* _tmp13_;
	gint next_view_user_slide = 0;
	gboolean _tmp14_ = FALSE;
	gboolean show_final_slide_of_current_overlay = FALSE;
	gboolean _tmp18_ = FALSE;
	gint view_slide_number = 0;
	pdfpcMetadataPdf* _tmp19_;
	pdfpcMetadataPdf* _tmp20_;
	pdfpcMetadataPdf* _tmp21_;
	pdfpcMetadataPdf* _tmp22_;
	pdfpcViewPdf* _tmp23_;
	pdfpcViewPdf* _tmp24_;
	pdfpcMetadataPdf* _tmp25_;
	pdfpcMetadataPdf* _tmp26_;
	pdfpcMetadataPdf* _tmp27_;
	pdfpcMetadataPdf* _tmp28_;
	pdfpcViewPdf* _tmp29_;
	pdfpcViewPdf* _tmp30_;
	pdfpcMetadataPdf* _tmp31_;
	pdfpcMetadataPdf* _tmp32_;
	pdfpcMetadataPdf* _tmp33_;
	pdfpcMetadataPdf* _tmp34_;
	pdfpcViewPdf* _tmp35_;
	pdfpcViewPdf* _tmp36_;
	pdfpcMetadataPdf* _tmp37_;
	pdfpcMetadataPdf* _tmp38_;
	gboolean _tmp39_;
	gboolean _tmp40_;
	pdfpcPresentationController* _tmp44_;
	pdfpcPresentationController* _tmp45_;
	gboolean _tmp46_;
	gboolean _tmp47_;
	GtkImage* _tmp48_;
	GtkImage* _tmp49_;
	GtkImage* _tmp50_;
	pdfpcWindowToolBox* _tmp51_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = pdfpc_metadata_pdf_get_is_ready (_tmp1_);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		return;
	}
	_tmp4_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp5_ = _tmp4_;
	_tmp6_ = pdfpc_presentation_controller_get_current_slide_number (_tmp5_);
	_tmp7_ = _tmp6_;
	current_slide_number = _tmp7_;
	_tmp8_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp9_ = _tmp8_;
	_tmp10_ = pdfpc_presentation_controller_get_current_user_slide_number (_tmp9_);
	_tmp11_ = _tmp10_;
	current_user_slide_number = _tmp11_;
	_tmp12_ = pdfpc_controllable_get_main_view ((pdfpcControllable*) self);
	_tmp13_ = _tmp12_;
	pdfpc_view_pdf_display (_tmp13_, current_slide_number, FALSE, NULL);
	next_view_user_slide = current_user_slide_number;
	if (pdfpc_options_final_slide_overlay) {
		pdfpcMetadataPdf* _tmp15_;
		pdfpcMetadataPdf* _tmp16_;
		_tmp15_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
		_tmp16_ = _tmp15_;
		_tmp14_ = !pdfpc_metadata_pdf_is_user_slide (_tmp16_, current_slide_number);
	} else {
		_tmp14_ = FALSE;
	}
	show_final_slide_of_current_overlay = _tmp14_;
	if (!show_final_slide_of_current_overlay) {
		gint _tmp17_;
		_tmp17_ = next_view_user_slide;
		next_view_user_slide = _tmp17_ + 1;
	}
	if (show_final_slide_of_current_overlay) {
		_tmp18_ = TRUE;
	} else {
		_tmp18_ = !pdfpc_options_next_slide_first_overlay;
	}
	_tmp19_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp20_ = _tmp19_;
	view_slide_number = pdfpc_metadata_pdf_user_slide_to_real_slide (_tmp20_, next_view_user_slide, _tmp18_);
	_tmp21_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp22_ = _tmp21_;
	view_slide_number = pdfpc_metadata_pdf_nearest_nonhidden (_tmp22_, view_slide_number, FALSE);
	_tmp23_ = self->next_view;
	_tmp23_->disabled = view_slide_number < 0;
	_tmp24_ = self->next_view;
	pdfpc_view_pdf_display (_tmp24_, view_slide_number, FALSE, NULL);
	_tmp25_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp26_ = _tmp25_;
	view_slide_number = pdfpc_metadata_pdf_next_in_overlay (_tmp26_, current_slide_number);
	_tmp27_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp28_ = _tmp27_;
	view_slide_number = pdfpc_metadata_pdf_nearest_nonhidden (_tmp28_, view_slide_number, FALSE);
	_tmp29_ = self->strict_next_view;
	_tmp29_->disabled = view_slide_number < 0;
	_tmp30_ = self->strict_next_view;
	pdfpc_view_pdf_display (_tmp30_, view_slide_number, FALSE, NULL);
	_tmp31_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp32_ = _tmp31_;
	view_slide_number = pdfpc_metadata_pdf_prev_in_overlay (_tmp32_, current_slide_number);
	_tmp33_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp34_ = _tmp33_;
	view_slide_number = pdfpc_metadata_pdf_nearest_nonhidden (_tmp34_, view_slide_number, TRUE);
	_tmp35_ = self->strict_prev_view;
	_tmp35_->disabled = view_slide_number < 0;
	_tmp36_ = self->strict_prev_view;
	pdfpc_view_pdf_display (_tmp36_, view_slide_number, FALSE, NULL);
	_tmp37_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp38_ = _tmp37_;
	_tmp39_ = pdfpc_metadata_pdf_get_has_beamer_notes (_tmp38_);
	_tmp40_ = _tmp39_;
	if (_tmp40_) {
		GtkStack* _tmp41_;
		pdfpcViewPdf* _tmp42_;
		_tmp41_ = self->notes_stack;
		gtk_stack_set_visible_child_name (_tmp41_, "view");
		_tmp42_ = self->notes_view;
		pdfpc_view_pdf_display (_tmp42_, current_slide_number, FALSE, NULL);
	} else {
		GtkStack* _tmp43_;
		_tmp43_ = self->notes_stack;
		gtk_stack_set_visible_child_name (_tmp43_, "mdview");
		pdfpc_window_presenter_update_note (self);
	}
	pdfpc_window_presenter_update_slide_count (self);
	pdfpc_window_presenter_update_status_icons (self);
	_tmp44_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp45_ = _tmp44_;
	_tmp46_ = pdfpc_presentation_controller_get_hidden (_tmp45_);
	_tmp47_ = _tmp46_;
	if (_tmp47_) {
		gtk_window_present ((GtkWindow*) self);
	}
	_tmp48_ = self->saved_icon;
	gtk_widget_hide ((GtkWidget*) _tmp48_);
	_tmp49_ = self->loaded_icon;
	gtk_widget_hide ((GtkWidget*) _tmp49_);
	_tmp50_ = self->locked_icon;
	gtk_widget_hide ((GtkWidget*) _tmp50_);
	_tmp51_ = self->toolbox;
	pdfpc_window_tool_box_update (_tmp51_);
}

static void
pdfpc_window_presenter_real_resize_gui (pdfpcWindowFullscreen* base)
{
	pdfpcWindowPresenter * self;
	pdfpcWindowToolBox* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	self = (pdfpcWindowPresenter*) base;
	_tmp0_ = self->toolbox;
	_tmp1_ = pdfpc_window_fullscreen_get_window_w ((pdfpcWindowFullscreen*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = pdfpc_window_fullscreen_get_window_h ((pdfpcWindowFullscreen*) self);
	_tmp4_ = _tmp3_;
	pdfpc_window_tool_box_on_window_resize (_tmp0_, _tmp2_, _tmp4_);
}

/**
         * Ask for the page to jump to
         */
void
pdfpc_window_presenter_ask_goto_page (pdfpcWindowPresenter* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	GtkEntry* _tmp2_;
	pdfpcPresentationController* _tmp3_;
	pdfpcPresentationController* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GtkEntry* _tmp9_;
	GtkEntry* _tmp10_;
	GtkEntry* _tmp11_;
	pdfpcPresentationController* _tmp12_;
	pdfpcPresentationController* _tmp13_;
	g_return_if_fail (self != NULL);
	g_object_get ((GtkWindow*) self, "is-active", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		return;
	}
	_tmp2_ = self->slide_progress;
	_tmp3_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = pdfpc_presentation_controller_get_user_n_slides (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strdup_printf ("/%u", (guint) _tmp6_);
	_tmp8_ = _tmp7_;
	gtk_entry_set_text (_tmp2_, _tmp8_);
	_g_free0 (_tmp8_);
	_tmp9_ = self->slide_progress;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, TRUE);
	_tmp10_ = self->slide_progress;
	gtk_widget_grab_focus ((GtkWidget*) _tmp10_);
	_tmp11_ = self->slide_progress;
	gtk_editable_set_position ((GtkEditable*) _tmp11_, 0);
	_tmp12_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp13_ = _tmp12_;
	pdfpc_presentation_controller_set_ignore_input_events (_tmp13_, TRUE);
}

/**
         * Handle key events for the slide_progress entry field
         */
static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static gint
string_index_of (const gchar* self,
                 const gchar* needle,
                 gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (needle != NULL, 0);
	_tmp0_ = strstr (((gchar*) self) + start_index, (gchar*) needle);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}

gboolean
pdfpc_window_presenter_on_key_press_slide_progress (pdfpcWindowPresenter* self,
                                                    GtkWidget* source,
                                                    GdkEventKey* key)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (source != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	if (key->keyval == GDK_KEY_Return) {
		gchar* input_text = NULL;
		GtkEntry* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gint destination = 0;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gint _tmp8_;
		GtkEntry* _tmp9_;
		pdfpcPresentationController* _tmp10_;
		pdfpcPresentationController* _tmp11_;
		_tmp0_ = self->slide_progress;
		_tmp1_ = gtk_entry_get_text (_tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strdup (_tmp2_);
		input_text = _tmp3_;
		_tmp4_ = input_text;
		_tmp5_ = input_text;
		_tmp6_ = string_substring (_tmp4_, (glong) 0, (glong) string_index_of (_tmp5_, "/", 0));
		_tmp7_ = _tmp6_;
		_tmp8_ = atoi (_tmp7_);
		_g_free0 (_tmp7_);
		destination = _tmp8_;
		_tmp9_ = self->slide_progress;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, FALSE);
		_tmp10_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp11_ = _tmp10_;
		pdfpc_presentation_controller_set_ignore_input_events (_tmp11_, FALSE);
		if (destination != 0) {
			pdfpcPresentationController* _tmp12_;
			pdfpcPresentationController* _tmp13_;
			_tmp12_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
			_tmp13_ = _tmp12_;
			pdfpc_presentation_controller_goto_user_page (_tmp13_, destination - 1, TRUE);
		} else {
			pdfpc_window_presenter_update_slide_count (self);
		}
		result = TRUE;
		_g_free0 (input_text);
		return result;
	} else {
		if (key->keyval == GDK_KEY_Escape) {
			GtkEntry* _tmp14_;
			pdfpcPresentationController* _tmp15_;
			pdfpcPresentationController* _tmp16_;
			_tmp14_ = self->slide_progress;
			gtk_widget_set_sensitive ((GtkWidget*) _tmp14_, FALSE);
			_tmp15_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
			_tmp16_ = _tmp15_;
			pdfpc_presentation_controller_set_ignore_input_events (_tmp16_, FALSE);
			pdfpc_window_presenter_update_slide_count (self);
			result = TRUE;
			return result;
		} else {
			result = FALSE;
			return result;
		}
	}
}

static gboolean
__lambda36_ (pdfpcWindowPresenter* self)
{
	GtkImage* _tmp0_;
	gboolean result;
	_tmp0_ = self->locked_icon;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
	result = FALSE;
	return result;
}

static gboolean
___lambda36__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda36_ ((pdfpcWindowPresenter*) self);
	return result;
}

static void
pdfpc_window_presenter_blink_lock_icon (pdfpcWindowPresenter* self)
{
	GtkImage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->locked_icon;
	gtk_widget_show ((GtkWidget*) _tmp0_);
	g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 1000, ___lambda36__gsource_func, g_object_ref (self), g_object_unref);
}

/**
         * Edit a note. Basically give focus to notes_editor
         */
void
pdfpc_window_presenter_edit_note (pdfpcWindowPresenter* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	gint number = 0;
	pdfpcPresentationController* _tmp2_;
	pdfpcPresentationController* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gboolean _tmp6_ = FALSE;
	pdfpcMetadataPdf* _tmp7_;
	pdfpcMetadataPdf* _tmp8_;
	GtkStack* _tmp13_;
	GtkTextView* _tmp14_;
	GtkTextView* _tmp15_;
	GtkTextView* _tmp16_;
	pdfpcPresentationController* _tmp17_;
	pdfpcPresentationController* _tmp18_;
	g_return_if_fail (self != NULL);
	g_object_get ((GtkWindow*) self, "is-active", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		return;
	}
	_tmp2_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = pdfpc_presentation_controller_get_current_user_slide_number (_tmp3_);
	_tmp5_ = _tmp4_;
	number = _tmp5_;
	_tmp7_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp8_ = _tmp7_;
	if (pdfpc_metadata_pdf_is_note_read_only (_tmp8_, number)) {
		_tmp6_ = TRUE;
	} else {
		pdfpcMetadataPdf* _tmp9_;
		pdfpcMetadataPdf* _tmp10_;
		gboolean _tmp11_;
		gboolean _tmp12_;
		_tmp9_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
		_tmp10_ = _tmp9_;
		_tmp11_ = pdfpc_metadata_pdf_get_has_beamer_notes (_tmp10_);
		_tmp12_ = _tmp11_;
		_tmp6_ = _tmp12_;
	}
	if (_tmp6_) {
		pdfpc_window_presenter_blink_lock_icon (self);
		return;
	}
	_tmp13_ = self->notes_stack;
	gtk_stack_set_visible_child_name (_tmp13_, "editor");
	_tmp14_ = self->notes_editor;
	gtk_text_view_set_editable (_tmp14_, TRUE);
	_tmp15_ = self->notes_editor;
	gtk_text_view_set_cursor_visible (_tmp15_, TRUE);
	_tmp16_ = self->notes_editor;
	gtk_widget_grab_focus ((GtkWidget*) _tmp16_);
	_tmp17_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp18_ = _tmp17_;
	pdfpc_presentation_controller_set_ignore_input_events (_tmp18_, TRUE);
}

/**
         * Handle key presses when editing a note
         */
gboolean
pdfpc_window_presenter_on_key_press_notes_editor (pdfpcWindowPresenter* self,
                                                  GtkWidget* source,
                                                  GdkEventKey* key)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (source != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	if (key->keyval == GDK_KEY_Escape) {
		gchar* this_note = NULL;
		GtkTextView* _tmp0_;
		GtkTextBuffer* _tmp1_;
		GtkTextBuffer* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GtkTextView* _tmp5_;
		GtkTextView* _tmp6_;
		pdfpcMetadataPdf* _tmp7_;
		pdfpcMetadataPdf* _tmp8_;
		const gchar* _tmp9_;
		pdfpcPresentationController* _tmp10_;
		pdfpcPresentationController* _tmp11_;
		gint _tmp12_;
		gint _tmp13_;
		pdfpcPresentationController* _tmp14_;
		pdfpcPresentationController* _tmp15_;
		pdfpcViewMarkdownView* _tmp16_;
		const gchar* _tmp17_;
		pdfpcMetadataPdf* _tmp18_;
		pdfpcMetadataPdf* _tmp19_;
		GtkStack* _tmp20_;
		_tmp0_ = self->notes_editor;
		_tmp1_ = gtk_text_view_get_buffer (_tmp0_);
		_tmp2_ = _tmp1_;
		g_object_get (_tmp2_, "text", &_tmp3_, NULL);
		_tmp4_ = _tmp3_;
		this_note = _tmp4_;
		_tmp5_ = self->notes_editor;
		gtk_text_view_set_editable (_tmp5_, FALSE);
		_tmp6_ = self->notes_editor;
		gtk_text_view_set_cursor_visible (_tmp6_, FALSE);
		_tmp7_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
		_tmp8_ = _tmp7_;
		_tmp9_ = this_note;
		_tmp10_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp11_ = _tmp10_;
		_tmp12_ = pdfpc_presentation_controller_get_current_slide_number (_tmp11_);
		_tmp13_ = _tmp12_;
		pdfpc_metadata_pdf_set_note (_tmp8_, _tmp9_, _tmp13_, FALSE);
		_tmp14_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp15_ = _tmp14_;
		pdfpc_presentation_controller_set_ignore_input_events (_tmp15_, FALSE);
		_tmp16_ = self->mdview;
		_tmp17_ = this_note;
		_tmp18_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
		_tmp19_ = _tmp18_;
		pdfpc_view_markdown_view_render (_tmp16_, _tmp17_, pdfpc_metadata_pdf_get_disable_markdown (_tmp19_));
		_tmp20_ = self->notes_stack;
		gtk_stack_set_visible_child_name (_tmp20_, "mdview");
		result = TRUE;
		_g_free0 (this_note);
		return result;
	} else {
		result = FALSE;
		return result;
	}
}

/**
         * Update the text of the current note
         */
void
pdfpc_window_presenter_update_note (pdfpcWindowPresenter* self)
{
	gchar* this_note = NULL;
	pdfpcMetadataPdf* _tmp0_;
	pdfpcMetadataPdf* _tmp1_;
	pdfpcPresentationController* _tmp2_;
	pdfpcPresentationController* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	gchar* _tmp6_;
	GtkTextView* _tmp7_;
	GtkTextBuffer* _tmp8_;
	GtkTextBuffer* _tmp9_;
	pdfpcViewMarkdownView* _tmp10_;
	pdfpcMetadataPdf* _tmp11_;
	pdfpcMetadataPdf* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = pdfpc_presentation_controller_get_current_slide_number (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = pdfpc_metadata_pdf_get_note (_tmp1_, _tmp5_);
	this_note = _tmp6_;
	_tmp7_ = self->notes_editor;
	_tmp8_ = gtk_text_view_get_buffer (_tmp7_);
	_tmp9_ = _tmp8_;
	g_object_set (_tmp9_, "text", this_note, NULL);
	_tmp10_ = self->mdview;
	_tmp11_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp12_ = _tmp11_;
	pdfpc_view_markdown_view_render (_tmp10_, this_note, pdfpc_metadata_pdf_get_disable_markdown (_tmp12_));
	_g_free0 (this_note);
}

void
pdfpc_window_presenter_show_overview (pdfpcWindowPresenter* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	pdfpcWindowOverview* _tmp2_;
	pdfpcPresentationController* _tmp3_;
	pdfpcPresentationController* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	GtkStack* _tmp7_;
	pdfpcPresentationController* _tmp8_;
	pdfpcPresentationController* _tmp9_;
	g_return_if_fail (self != NULL);
	g_object_get ((GtkWindow*) self, "is-active", &_tmp0_, NULL);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		return;
	}
	_tmp2_ = self->overview;
	_tmp3_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = pdfpc_presentation_controller_get_current_user_slide_number (_tmp4_);
	_tmp6_ = _tmp5_;
	pdfpc_window_overview_set_current_slide (_tmp2_, _tmp6_);
	_tmp7_ = self->slide_stack;
	gtk_stack_set_visible_child_name (_tmp7_, "overview");
	_tmp8_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp9_ = _tmp8_;
	pdfpc_presentation_controller_set_ignore_input_events (_tmp9_, TRUE);
}

void
pdfpc_window_presenter_hide_overview (pdfpcWindowPresenter* self)
{
	GtkStack* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	pdfpcPresentationController* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->slide_stack;
	gtk_stack_set_visible_child_name (_tmp0_, "slides");
	_tmp1_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
	_tmp2_ = _tmp1_;
	pdfpc_presentation_controller_set_ignore_input_events (_tmp2_, FALSE);
}

gboolean
pdfpc_window_presenter_is_overview_shown (pdfpcWindowPresenter* self)
{
	GtkStack* _tmp0_;
	GtkWidget* _tmp1_;
	pdfpcWindowOverview* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->slide_stack;
	_tmp1_ = gtk_stack_get_visible_child (_tmp0_);
	_tmp2_ = self->overview;
	result = _tmp1_ == G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, gtk_widget_get_type (), GtkWidget);
	return result;
}

/**
         * Increase font sizes for Widgets
         */
void
pdfpc_window_presenter_increase_font_size (pdfpcWindowPresenter* self)
{
	gint font_size = 0;
	pdfpcMetadataPdf* _tmp0_;
	pdfpcMetadataPdf* _tmp1_;
	pdfpcMetadataPdf* _tmp2_;
	pdfpcMetadataPdf* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp1_ = _tmp0_;
	font_size = pdfpc_metadata_pdf_get_font_size (_tmp1_);
	font_size += 2;
	_tmp2_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp3_ = _tmp2_;
	pdfpc_metadata_pdf_set_font_size (_tmp3_, font_size);
	pdfpc_window_presenter_apply_font_size (self, font_size);
}

/**
         * Decrease font sizes for Widgets
         */
void
pdfpc_window_presenter_decrease_font_size (pdfpcWindowPresenter* self)
{
	gint font_size = 0;
	pdfpcMetadataPdf* _tmp0_;
	pdfpcMetadataPdf* _tmp1_;
	pdfpcMetadataPdf* _tmp2_;
	pdfpcMetadataPdf* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp1_ = _tmp0_;
	font_size = pdfpc_metadata_pdf_get_font_size (_tmp1_);
	font_size -= 2;
	if (font_size < 2) {
		font_size = 2;
	}
	_tmp2_ = pdfpc_window_controllable_window_get_metadata ((pdfpcWindowControllableWindow*) self);
	_tmp3_ = _tmp2_;
	pdfpc_metadata_pdf_set_font_size (_tmp3_, font_size);
	pdfpc_window_presenter_apply_font_size (self, font_size);
}

static void
pdfpc_window_presenter_apply_font_size (pdfpcWindowPresenter* self,
                                        gint size)
{
	static const char text_css_template[] = "#notesView { font-size: %dpt; }";
	gchar* css = NULL;
	gchar* _tmp0_;
	gdouble mdview_zoom = 0.0;
	pdfpcViewMarkdownView* _tmp2_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup_printf (text_css_template, size);
	css = _tmp0_;
	{
		GtkCssProvider* _tmp1_;
		_tmp1_ = self->css_provider;
		gtk_css_provider_load_from_data (_tmp1_, css, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_inner_error0_);
		g_printerr ("Warning: failed to set CSS for notes.\n");
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (css);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	mdview_zoom = size / 20.0;
	_tmp2_ = self->mdview;
	pdfpc_view_markdown_view_apply_zoom (_tmp2_, mdview_zoom);
	_g_free0 (css);
}

void
pdfpc_window_presenter_show_help_window (pdfpcWindowPresenter* self,
                                         gboolean onoff)
{
	g_return_if_fail (self != NULL);
	if (onoff) {
		GtkStack* _tmp0_;
		GtkStack* _tmp1_;
		GtkWidget* _tmp2_;
		pdfpcPresentationController* _tmp3_;
		pdfpcPresentationController* _tmp4_;
		_tmp0_ = self->slide_stack;
		gtk_stack_set_visible_child_name (_tmp0_, "help");
		_tmp1_ = self->slide_stack;
		_tmp2_ = gtk_stack_get_child_by_name (_tmp1_, "help");
		gtk_widget_grab_focus (_tmp2_);
		_tmp3_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp4_ = _tmp3_;
		pdfpc_presentation_controller_set_ignore_input_events (_tmp4_, TRUE);
	} else {
		GtkStack* _tmp5_;
		pdfpcPresentationController* _tmp6_;
		pdfpcPresentationController* _tmp7_;
		_tmp5_ = self->slide_stack;
		gtk_stack_set_visible_child_name (_tmp5_, "slides");
		_tmp6_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp7_ = _tmp6_;
		pdfpc_presentation_controller_set_ignore_input_events (_tmp7_, FALSE);
	}
}

void
pdfpc_window_presenter_show_qrcode_window (pdfpcWindowPresenter* self,
                                           gboolean onoff)
{
	g_return_if_fail (self != NULL);
	if (onoff) {
		GtkStack* _tmp0_;
		GtkStack* _tmp1_;
		GtkWidget* _tmp2_;
		pdfpcPresentationController* _tmp3_;
		pdfpcPresentationController* _tmp4_;
		_tmp0_ = self->slide_stack;
		gtk_stack_set_visible_child_name (_tmp0_, "qrcode");
		_tmp1_ = self->slide_stack;
		_tmp2_ = gtk_stack_get_child_by_name (_tmp1_, "qrcode");
		gtk_widget_grab_focus (_tmp2_);
		_tmp3_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp4_ = _tmp3_;
		pdfpc_presentation_controller_set_ignore_input_events (_tmp4_, TRUE);
	} else {
		GtkStack* _tmp5_;
		pdfpcPresentationController* _tmp6_;
		pdfpcPresentationController* _tmp7_;
		_tmp5_ = self->slide_stack;
		gtk_stack_set_visible_child_name (_tmp5_, "slides");
		_tmp6_ = pdfpc_controllable_get_controller ((pdfpcControllable*) self);
		_tmp7_ = _tmp6_;
		pdfpc_presentation_controller_set_ignore_input_events (_tmp7_, FALSE);
	}
}

gboolean
pdfpc_window_presenter_get_current_view_maximized (pdfpcWindowPresenter* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_current_view_maximized;
	return result;
}

void
pdfpc_window_presenter_set_current_view_maximized (pdfpcWindowPresenter* self,
                                                   gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = pdfpc_window_presenter_get_current_view_maximized (self);
	if (old_value != value) {
		self->priv->_current_view_maximized = value;
		g_object_notify_by_pspec ((GObject *) self, pdfpc_window_presenter_properties[PDFPC_WINDOW_PRESENTER_CURRENT_VIEW_MAXIMIZED_PROPERTY]);
	}
}

static void
pdfpc_window_presenter_class_init (pdfpcWindowPresenterClass * klass,
                                   gpointer klass_data)
{
	pdfpc_window_presenter_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &pdfpcWindowPresenter_private_offset);
	((pdfpcWindowFullscreenClass *) klass)->resize_gui = (void (*) (pdfpcWindowFullscreen*)) pdfpc_window_presenter_real_resize_gui;
	G_OBJECT_CLASS (klass)->get_property = _vala_pdfpc_window_presenter_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_pdfpc_window_presenter_set_property;
	G_OBJECT_CLASS (klass)->finalize = pdfpc_window_presenter_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PDFPC_WINDOW_PRESENTER_CURRENT_VIEW_MAXIMIZED_PROPERTY, pdfpc_window_presenter_properties[PDFPC_WINDOW_PRESENTER_CURRENT_VIEW_MAXIMIZED_PROPERTY] = g_param_spec_boolean ("current-view-maximized", "current-view-maximized", "current-view-maximized", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
pdfpc_window_presenter_instance_init (pdfpcWindowPresenter * self,
                                      gpointer klass)
{
	self->priv = pdfpc_window_presenter_get_instance_private (self);
	self->overview = NULL;
	self->priv->_current_view_maximized = FALSE;
	self->priv->handle_thickness = 5;
	self->priv->bottom_height = 0;
}

static void
pdfpc_window_presenter_finalize (GObject * obj)
{
	pdfpcWindowPresenter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenter);
	_g_object_unref0 (self->next_view);
	_g_object_unref0 (self->strict_next_view);
	_g_object_unref0 (self->strict_prev_view);
	_g_object_unref0 (self->notes_stack);
	_g_object_unref0 (self->notes_editor);
	_g_object_unref0 (self->notes_view);
	_g_object_unref0 (self->mdview);
	_g_object_unref0 (self->slide_views);
	_g_object_unref0 (self->current_view_and_stricts);
	_g_object_unref0 (self->next_view_and_notes);
	_g_object_unref0 (self->full_layout);
	_g_object_unref0 (self->timer_label);
	_g_object_unref0 (self->slide_progress);
	_g_object_unref0 (self->status);
	_g_object_unref0 (self->blank_icon);
	_g_object_unref0 (self->hidden_icon);
	_g_object_unref0 (self->frozen_icon);
	_g_object_unref0 (self->pause_icon);
	_g_object_unref0 (self->saved_icon);
	_g_object_unref0 (self->loaded_icon);
	_g_object_unref0 (self->locked_icon);
	_g_object_unref0 (self->css_provider);
	_g_object_unref0 (self->bottom_text_css_provider);
	_g_object_unref0 (self->highlight_icon);
	_g_object_unref0 (self->pen_icon);
	_g_object_unref0 (self->eraser_icon);
	_g_object_unref0 (self->spotlight_icon);
	_g_object_unref0 (self->overview);
	_g_object_unref0 (self->slide_stack);
	_g_object_unref0 (self->toolbox);
	G_OBJECT_CLASS (pdfpc_window_presenter_parent_class)->finalize (obj);
}

/**
     * Window showing the currently active and next slide.
     *
     * Other useful information like time slide count, ... can be displayed here as
     * well.
     */
static GType
pdfpc_window_presenter_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (pdfpcWindowPresenterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_window_presenter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcWindowPresenter), 0, (GInstanceInitFunc) pdfpc_window_presenter_instance_init, NULL };
	GType pdfpc_window_presenter_type_id;
	pdfpc_window_presenter_type_id = g_type_register_static (PDFPC_WINDOW_TYPE_CONTROLLABLE_WINDOW, "pdfpcWindowPresenter", &g_define_type_info, 0);
	pdfpcWindowPresenter_private_offset = g_type_add_instance_private (pdfpc_window_presenter_type_id, sizeof (pdfpcWindowPresenterPrivate));
	return pdfpc_window_presenter_type_id;
}

GType
pdfpc_window_presenter_get_type (void)
{
	static volatile gsize pdfpc_window_presenter_type_id__once = 0;
	if (g_once_init_enter (&pdfpc_window_presenter_type_id__once)) {
		GType pdfpc_window_presenter_type_id;
		pdfpc_window_presenter_type_id = pdfpc_window_presenter_get_type_once ();
		g_once_init_leave (&pdfpc_window_presenter_type_id__once, pdfpc_window_presenter_type_id);
	}
	return pdfpc_window_presenter_type_id__once;
}

static void
_vala_pdfpc_window_presenter_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	pdfpcWindowPresenter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenter);
	switch (property_id) {
		case PDFPC_WINDOW_PRESENTER_CURRENT_VIEW_MAXIMIZED_PROPERTY:
		g_value_set_boolean (value, pdfpc_window_presenter_get_current_view_maximized (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_pdfpc_window_presenter_set_property (GObject * object,
                                           guint property_id,
                                           const GValue * value,
                                           GParamSpec * pspec)
{
	pdfpcWindowPresenter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PDFPC_WINDOW_TYPE_PRESENTER, pdfpcWindowPresenter);
	switch (property_id) {
		case PDFPC_WINDOW_PRESENTER_CURRENT_VIEW_MAXIMIZED_PROPERTY:
		pdfpc_window_presenter_set_current_view_maximized (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

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

