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

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

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

#define PDFPC_WINDOW_TYPE_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;
typedef struct _pdfpcWindowToolBoxPrivate pdfpcWindowToolBoxPrivate;

#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;
enum  {
	PDFPC_WINDOW_TOOL_BOX_0_PROPERTY,
	PDFPC_WINDOW_TOOL_BOX_NUM_PROPERTIES
};
static GParamSpec* pdfpc_window_tool_box_properties[PDFPC_WINDOW_TOOL_BOX_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (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;

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

#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 _Block15Data Block15Data;

#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_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;
typedef enum  {
	PDFPC_OPTIONS_TOOLBOX_DIRECTION_LtoR,
	PDFPC_OPTIONS_TOOLBOX_DIRECTION_RtoL,
	PDFPC_OPTIONS_TOOLBOX_DIRECTION_TtoB,
	PDFPC_OPTIONS_TOOLBOX_DIRECTION_BtoT
} pdfpcOptionsToolboxDirection;

#define PDFPC_OPTIONS_TYPE_TOOLBOX_DIRECTION (pdfpc_options_toolbox_direction_get_type ())
typedef struct _pdfpcPresentationControllerPrivate pdfpcPresentationControllerPrivate;

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

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

typedef struct _pdfpcTimer pdfpcTimer;
typedef struct _pdfpcTimerClass pdfpcTimerClass;

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

typedef struct _pdfpcPresentationControllerActionDescription pdfpcPresentationControllerActionDescription;
typedef struct _pdfpcPresentationControllerActionDescriptionClass pdfpcPresentationControllerActionDescriptionClass;

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

typedef struct _pdfpcKeyDef pdfpcKeyDef;
typedef struct _pdfpcKeyDefClass pdfpcKeyDefClass;

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

typedef struct _pdfpcPresentationControllerActionAndParameter pdfpcPresentationControllerActionAndParameter;
typedef struct _pdfpcPresentationControllerActionAndParameterClass pdfpcPresentationControllerActionAndParameterClass;

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

typedef struct _ScreenSaver ScreenSaver;
typedef struct _ScreenSaverIface ScreenSaverIface;

#define TYPE_SCREEN_SAVER_PROXY (screen_saver_proxy_get_type ())

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

typedef struct _pdfpcPresentationControllerPointerTool pdfpcPresentationControllerPointerTool;
typedef struct _pdfpcPresentationControllerPointerToolClass pdfpcPresentationControllerPointerToolClass;

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

typedef struct _pdfpcDrawingsDrawing pdfpcDrawingsDrawing;
typedef struct _pdfpcDrawingsDrawingClass pdfpcDrawingsDrawingClass;

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

typedef struct _pdfpcDrawingsDrawingTool pdfpcDrawingsDrawingTool;
typedef struct _pdfpcDrawingsDrawingToolClass pdfpcDrawingsDrawingToolClass;

struct _pdfpcWindowToolBox {
	GtkFixed parent_instance;
	pdfpcWindowToolBoxPrivate * priv;
	pdfpcPresentationController* controller;
	GtkBox* toolbox;
	GtkColorButton* color_button;
	GtkScaleButton* scale_button;
};

struct _pdfpcWindowToolBoxClass {
	GtkFixedClass parent_class;
};

struct _pdfpcWindowToolBoxPrivate {
	gint x0;
	gint y0;
	gint icon_height;
};

struct _Block15Data {
	int _ref_count_;
	pdfpcWindowToolBox* self;
	GtkBox* button_panel;
};

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 _pdfpcPresentationControllerScaledRectangle {
	gdouble x;
	gdouble y;
	gdouble width;
	gdouble height;
};

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

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

struct _pdfpcPresentationControllerClass {
	GObjectClass parent_class;
};

static gint pdfpcWindowToolBox_private_offset;
static gpointer pdfpc_window_tool_box_parent_class = NULL;
VALA_EXTERN gboolean pdfpc_options_disable_tooltips;
VALA_EXTERN pdfpcOptionsToolboxDirection pdfpc_options_toolbox_direction;
VALA_EXTERN gboolean pdfpc_options_toolbox_minimized;
VALA_EXTERN gboolean pdfpc_options_toolbox_shown;

VALA_EXTERN GType pdfpc_window_tool_box_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcWindowToolBox, 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 gboolean pdfpc_window_tool_box_on_button_press (pdfpcWindowToolBox* self,
                                                GtkWidget* pbut,
                                                GdkEventButton* event);
VALA_EXTERN gboolean pdfpc_window_tool_box_on_move_pointer (pdfpcWindowToolBox* self,
                                                GtkWidget* pbut,
                                                GdkEventMotion* event);
VALA_EXTERN GtkButton* pdfpc_window_tool_box_add_button (pdfpcWindowToolBox* self,
                                             GtkBox* panel,
                                             gboolean tbox_inverse,
                                             const gchar* icon_fname,
                                             const gchar* tooltip);
VALA_EXTERN GtkImage* pdfpc_window_load_icon (const gchar* filename,
                                  gint size);
VALA_EXTERN GtkColorButton* pdfpc_window_tool_box_add_cbutton (pdfpcWindowToolBox* self,
                                                   GtkBox* panel,
                                                   gboolean tbox_inverse,
                                                   const gchar* tooltip);
VALA_EXTERN GtkScaleButton* pdfpc_window_tool_box_add_sbutton (pdfpcWindowToolBox* self,
                                                   GtkBox* panel,
                                                   gboolean tbox_inverse,
                                                   const gchar* icon_fname,
                                                   const gchar* tooltip);
static void __lambda20_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_set_ignore_input_events (pdfpcPresentationController* self,
                                                            gboolean v);
static void ___lambda20__gtk_widget_show (GtkWidget* _sender,
                                   gpointer self);
static void __lambda21_ (pdfpcWindowToolBox* self);
static void ___lambda21__gtk_widget_hide (GtkWidget* _sender,
                                   gpointer self);
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_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 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);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
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 pdfpcPresentationController* pdfpc_controllable_get_controller (pdfpcControllable* self);
VALA_EXTERN GType pdfpc_options_toolbox_direction_get_type (void) G_GNUC_CONST ;
static gboolean _pdfpc_window_tool_box_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                               GdkEventButton* event,
                                                                               gpointer self);
static gboolean _pdfpc_window_tool_box_on_move_pointer_gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                                                GdkEventMotion* event,
                                                                                gpointer self);
static void __lambda22_ (Block15Data* _data15_);
static void ___lambda22__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda23_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_set_normal_mode (pdfpcPresentationController* self);
static void ___lambda23__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda24_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_set_pointer_mode (pdfpcPresentationController* self);
static void ___lambda24__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda25_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_set_pen_mode (pdfpcPresentationController* self);
static void ___lambda25__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda26_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_set_eraser_mode (pdfpcPresentationController* self);
static void ___lambda26__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda27_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_set_spotlight_mode (pdfpcPresentationController* self);
static void ___lambda27__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda28_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_toggle_freeze (pdfpcPresentationController* self);
static void ___lambda28__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda29_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_fade_to_black (pdfpcPresentationController* self);
static void ___lambda29__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda30_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_hide_presentation (pdfpcPresentationController* self);
static void ___lambda30__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda31_ (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_presentation_controller_toggle_pause (pdfpcPresentationController* self);
static void ___lambda31__gtk_button_clicked (GtkButton* _sender,
                                      gpointer self);
static void __lambda32_ (pdfpcWindowToolBox* self,
                  gdouble val);
VALA_EXTERN void pdfpc_presentation_controller_set_pen_size (pdfpcPresentationController* self,
                                                 gdouble width);
static void ___lambda32__gtk_scale_button_value_changed (GtkScaleButton* _sender,
                                                  gdouble value,
                                                  gpointer self);
static void __lambda33_ (pdfpcWindowToolBox* 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 GType pdfpc_timer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcTimer, g_object_unref)
VALA_EXTERN GType pdfpc_presentation_controller_action_description_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcPresentationControllerActionDescription, g_object_unref)
VALA_EXTERN GType pdfpc_key_def_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcKeyDef, g_object_unref)
VALA_EXTERN GType pdfpc_presentation_controller_action_and_parameter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcPresentationControllerActionAndParameter, g_object_unref)
VALA_EXTERN GType screen_saver_proxy_get_type (void) G_GNUC_CONST ;
VALA_EXTERN guint screen_saver_register_object (void* object,
                                    GDBusConnection* connection,
                                    const gchar* path,
                                    GError** error);
VALA_EXTERN GType screen_saver_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ScreenSaver, g_object_unref)
VALA_EXTERN gpointer pdfpc_presentation_controller_pointer_tool_ref (gpointer instance);
VALA_EXTERN void pdfpc_presentation_controller_pointer_tool_unref (gpointer instance);
VALA_EXTERN GParamSpec* pdfpc_presentation_controller_param_spec_pointer_tool (const gchar* name,
                                                                   const gchar* nick,
                                                                   const gchar* blurb,
                                                                   GType object_type,
                                                                   GParamFlags flags);
VALA_EXTERN void pdfpc_presentation_controller_value_set_pointer_tool (GValue* value,
                                                           gpointer v_object);
VALA_EXTERN void pdfpc_presentation_controller_value_take_pointer_tool (GValue* value,
                                                            gpointer v_object);
VALA_EXTERN gpointer pdfpc_presentation_controller_value_get_pointer_tool (const GValue* value);
VALA_EXTERN GType pdfpc_presentation_controller_pointer_tool_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcPresentationControllerPointerTool, pdfpc_presentation_controller_pointer_tool_unref)
VALA_EXTERN GType pdfpc_drawings_drawing_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcDrawingsDrawing, g_object_unref)
VALA_EXTERN gpointer pdfpc_drawings_drawing_tool_ref (gpointer instance);
VALA_EXTERN void pdfpc_drawings_drawing_tool_unref (gpointer instance);
VALA_EXTERN GParamSpec* pdfpc_drawings_param_spec_drawing_tool (const gchar* name,
                                                    const gchar* nick,
                                                    const gchar* blurb,
                                                    GType object_type,
                                                    GParamFlags flags);
VALA_EXTERN void pdfpc_drawings_value_set_drawing_tool (GValue* value,
                                            gpointer v_object);
VALA_EXTERN void pdfpc_drawings_value_take_drawing_tool (GValue* value,
                                             gpointer v_object);
VALA_EXTERN gpointer pdfpc_drawings_value_get_drawing_tool (const GValue* value);
VALA_EXTERN GType pdfpc_drawings_drawing_tool_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (pdfpcDrawingsDrawingTool, pdfpc_drawings_drawing_tool_unref)
VALA_EXTERN pdfpcDrawingsDrawingTool* pdfpc_drawings_drawing_get_pen (pdfpcDrawingsDrawing* self);
VALA_EXTERN void pdfpc_drawings_drawing_tool_set_rgba (pdfpcDrawingsDrawingTool* self,
                                           GdkRGBA* color);
VALA_EXTERN void pdfpc_presentation_controller_queue_pen_surface_draws (pdfpcPresentationController* self);
static void ___lambda33__gtk_color_button_color_set (GtkColorButton* _sender,
                                              gpointer self);
VALA_EXTERN void pdfpc_window_tool_box_calculate_position (pdfpcWindowToolBox* self,
                                               gint w,
                                               gint h,
                                               gint* x,
                                               gint* y);
VALA_EXTERN gint pdfpc_window_fullscreen_get_window_w (pdfpcWindowFullscreen* self);
VALA_EXTERN gint pdfpc_window_fullscreen_get_window_h (pdfpcWindowFullscreen* self);
VALA_EXTERN void pdfpc_window_tool_box_update (pdfpcWindowToolBox* self);
VALA_EXTERN void pdfpc_drawings_drawing_tool_get_rgba (pdfpcDrawingsDrawingTool* self,
                                           GdkRGBA* result);
VALA_EXTERN gboolean pdfpc_presentation_controller_is_pen_active (pdfpcPresentationController* self);
VALA_EXTERN gdouble pdfpc_presentation_controller_get_pen_size (pdfpcPresentationController* self);
VALA_EXTERN gboolean pdfpc_presentation_controller_is_eraser_active (pdfpcPresentationController* self);
VALA_EXTERN void pdfpc_window_tool_box_on_window_resize (pdfpcWindowToolBox* self,
                                             gint w,
                                             gint h);
static void pdfpc_window_tool_box_finalize (GObject * obj);
static GType pdfpc_window_tool_box_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
pdfpc_window_tool_box_get_instance_private (pdfpcWindowToolBox* self)
{
	return G_STRUCT_MEMBER_P (self, pdfpcWindowToolBox_private_offset);
}

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

gboolean
pdfpc_window_tool_box_on_button_press (pdfpcWindowToolBox* self,
                                       GtkWidget* pbut,
                                       GdkEventButton* event)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (pbut != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	if (event->button == ((guint) 1)) {
		GdkWindow* w = NULL;
		GtkContainer* _tmp0_;
		GdkWindow* _tmp1_;
		GdkWindow* _tmp2_;
		GdkWindow* _tmp3_;
		gint _tmp4_ = 0;
		gint _tmp5_ = 0;
		_tmp0_ = gtk_widget_get_parent ((GtkWidget*) self);
		_tmp1_ = gtk_widget_get_window ((GtkWidget*) _tmp0_);
		_tmp2_ = _g_object_ref0 (_tmp1_);
		w = _tmp2_;
		_tmp3_ = w;
		gdk_window_get_position (_tmp3_, &_tmp4_, &_tmp5_);
		self->priv->x0 = _tmp4_;
		self->priv->y0 = _tmp5_;
		self->priv->x0 = self->priv->x0 + ((gint) event->x);
		self->priv->y0 = self->priv->y0 + ((gint) event->y);
		_g_object_unref0 (w);
	}
	result = TRUE;
	return result;
}

gboolean
pdfpc_window_tool_box_on_move_pointer (pdfpcWindowToolBox* self,
                                       GtkWidget* pbut,
                                       GdkEventMotion* event)
{
	gint x = 0;
	gint y = 0;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (pbut != NULL, FALSE);
	g_return_val_if_fail (event != NULL, FALSE);
	x = ((gint) event->x_root) - self->priv->x0;
	y = ((gint) event->y_root) - self->priv->y0;
	if (TRUE) {
		gint dest_x = 0;
		gint dest_y = 0;
		GtkBox* _tmp0_;
		gint _tmp1_ = 0;
		gint _tmp2_ = 0;
		GtkBox* _tmp3_;
		_tmp0_ = self->toolbox;
		gtk_widget_translate_coordinates ((GtkWidget*) _tmp0_, pbut, x, y, &_tmp1_, &_tmp2_);
		dest_x = _tmp1_;
		dest_y = _tmp2_;
		_tmp3_ = self->toolbox;
		gtk_fixed_move ((GtkFixed*) self, (GtkWidget*) _tmp3_, dest_x, dest_y);
	}
	result = TRUE;
	return result;
}

GtkButton*
pdfpc_window_tool_box_add_button (pdfpcWindowToolBox* self,
                                  GtkBox* panel,
                                  gboolean tbox_inverse,
                                  const gchar* icon_fname,
                                  const gchar* tooltip)
{
	GtkImage* bimage = NULL;
	GtkImage* _tmp0_;
	GtkImage* _tmp1_;
	GtkButton* button = NULL;
	GtkButton* _tmp2_;
	GtkButton* _tmp3_;
	GtkImage* _tmp4_;
	GtkButton* _tmp5_;
	GtkButton* _tmp6_;
	GtkButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (panel != NULL, NULL);
	g_return_val_if_fail (icon_fname != NULL, NULL);
	_tmp0_ = pdfpc_window_load_icon (icon_fname, self->priv->icon_height);
	bimage = _tmp0_;
	_tmp1_ = bimage;
	gtk_widget_show ((GtkWidget*) _tmp1_);
	_tmp2_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp2_);
	button = _tmp2_;
	_tmp3_ = button;
	_tmp4_ = bimage;
	gtk_container_add ((GtkContainer*) _tmp3_, (GtkWidget*) _tmp4_);
	_tmp5_ = button;
	gtk_widget_set_can_focus ((GtkWidget*) _tmp5_, FALSE);
	_tmp6_ = button;
	gtk_widget_add_events ((GtkWidget*) _tmp6_, (gint) GDK_POINTER_MOTION_MASK);
	if (!pdfpc_options_disable_tooltips) {
		GtkButton* _tmp7_;
		_tmp7_ = button;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp7_, tooltip);
	}
	if (tbox_inverse) {
		GtkButton* _tmp8_;
		_tmp8_ = button;
		gtk_box_pack_end (panel, (GtkWidget*) _tmp8_, TRUE, TRUE, (guint) 0);
	} else {
		GtkButton* _tmp9_;
		_tmp9_ = button;
		gtk_box_pack_start (panel, (GtkWidget*) _tmp9_, TRUE, TRUE, (guint) 0);
	}
	result = button;
	_g_object_unref0 (bimage);
	return result;
}

GtkColorButton*
pdfpc_window_tool_box_add_cbutton (pdfpcWindowToolBox* self,
                                   GtkBox* panel,
                                   gboolean tbox_inverse,
                                   const gchar* tooltip)
{
	GtkColorButton* button = NULL;
	GtkColorButton* _tmp0_;
	GtkColorButton* _tmp1_;
	GtkColorButton* _tmp2_;
	GtkColorButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (panel != NULL, NULL);
	_tmp0_ = (GtkColorButton*) gtk_color_button_new ();
	g_object_ref_sink (_tmp0_);
	button = _tmp0_;
	_tmp1_ = button;
	gtk_widget_set_can_focus ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = button;
	gtk_widget_add_events ((GtkWidget*) _tmp2_, (gint) GDK_POINTER_MOTION_MASK);
	if (!pdfpc_options_disable_tooltips) {
		GtkColorButton* _tmp3_;
		_tmp3_ = button;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp3_, tooltip);
	}
	if (tbox_inverse) {
		GtkColorButton* _tmp4_;
		_tmp4_ = button;
		gtk_box_pack_end (panel, (GtkWidget*) _tmp4_, TRUE, TRUE, (guint) 0);
	} else {
		GtkColorButton* _tmp5_;
		_tmp5_ = button;
		gtk_box_pack_start (panel, (GtkWidget*) _tmp5_, TRUE, TRUE, (guint) 0);
	}
	result = button;
	return result;
}

static void
__lambda20_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_set_ignore_input_events (_tmp0_, TRUE);
}

static void
___lambda20__gtk_widget_show (GtkWidget* _sender,
                              gpointer self)
{
	__lambda20_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda21_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_set_ignore_input_events (_tmp0_, FALSE);
}

static void
___lambda21__gtk_widget_hide (GtkWidget* _sender,
                              gpointer self)
{
	__lambda21_ ((pdfpcWindowToolBox*) self);
}

GtkScaleButton*
pdfpc_window_tool_box_add_sbutton (pdfpcWindowToolBox* self,
                                   GtkBox* panel,
                                   gboolean tbox_inverse,
                                   const gchar* icon_fname,
                                   const gchar* tooltip)
{
	GtkScaleButton* button = NULL;
	GtkScaleButton* _tmp0_;
	GtkImage* bimage = NULL;
	GtkImage* _tmp1_;
	GtkImage* _tmp2_;
	GtkScaleButton* _tmp3_;
	GtkImage* _tmp4_;
	GtkScaleButton* _tmp5_;
	GtkScaleButton* _tmp6_;
	GtkAdjustment* _tmp7_;
	GtkScaleButton* _tmp8_;
	GtkWidget* popup = NULL;
	GtkScaleButton* _tmp12_;
	GtkWidget* _tmp13_;
	GtkWidget* _tmp14_;
	GtkScaleButton* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (panel != NULL, NULL);
	g_return_val_if_fail (icon_fname != NULL, NULL);
	_tmp0_ = (GtkScaleButton*) gtk_scale_button_new ((GtkIconSize) GTK_ICON_SIZE_DIALOG, (gdouble) 0, (gdouble) 50, (gdouble) 2, NULL);
	g_object_ref_sink (_tmp0_);
	button = _tmp0_;
	_tmp1_ = pdfpc_window_load_icon (icon_fname, self->priv->icon_height);
	bimage = _tmp1_;
	_tmp2_ = bimage;
	gtk_widget_show ((GtkWidget*) _tmp2_);
	_tmp3_ = button;
	_tmp4_ = bimage;
	gtk_button_set_image ((GtkButton*) _tmp3_, (GtkWidget*) _tmp4_);
	_tmp5_ = button;
	gtk_button_set_relief ((GtkButton*) _tmp5_, GTK_RELIEF_NORMAL);
	_tmp6_ = button;
	_tmp7_ = gtk_scale_button_get_adjustment (_tmp6_);
	gtk_adjustment_set_page_increment (_tmp7_, (gdouble) 4);
	_tmp8_ = button;
	gtk_widget_add_events ((GtkWidget*) _tmp8_, (gint) GDK_POINTER_MOTION_MASK);
	if (!pdfpc_options_disable_tooltips) {
		GtkScaleButton* _tmp9_;
		_tmp9_ = button;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp9_, tooltip);
	}
	if (tbox_inverse) {
		GtkScaleButton* _tmp10_;
		_tmp10_ = button;
		gtk_box_pack_end (panel, (GtkWidget*) _tmp10_, TRUE, TRUE, (guint) 0);
	} else {
		GtkScaleButton* _tmp11_;
		_tmp11_ = button;
		gtk_box_pack_start (panel, (GtkWidget*) _tmp11_, TRUE, TRUE, (guint) 0);
	}
	_tmp12_ = button;
	_tmp13_ = gtk_scale_button_get_popup (_tmp12_);
	_tmp14_ = _g_object_ref0 (_tmp13_);
	popup = _tmp14_;
	g_signal_connect_object (popup, "show", (GCallback) ___lambda20__gtk_widget_show, self, 0);
	g_signal_connect_object (popup, "hide", (GCallback) ___lambda21__gtk_widget_hide, self, 0);
	result = button;
	_g_object_unref0 (popup);
	_g_object_unref0 (bimage);
	return result;
}

static Block15Data*
block15_data_ref (Block15Data* _data15_)
{
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}

static void
block15_data_unref (void * _userdata_)
{
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		pdfpcWindowToolBox* self;
		self = _data15_->self;
		_g_object_unref0 (_data15_->button_panel);
		_g_object_unref0 (self);
		g_slice_free (Block15Data, _data15_);
	}
}

static gboolean
_pdfpc_window_tool_box_on_button_press_gtk_widget_button_press_event (GtkWidget* _sender,
                                                                      GdkEventButton* event,
                                                                      gpointer self)
{
	gboolean result;
	result = pdfpc_window_tool_box_on_button_press ((pdfpcWindowToolBox*) self, _sender, event);
	return result;
}

static gboolean
_pdfpc_window_tool_box_on_move_pointer_gtk_widget_motion_notify_event (GtkWidget* _sender,
                                                                       GdkEventMotion* event,
                                                                       gpointer self)
{
	gboolean result;
	result = pdfpc_window_tool_box_on_move_pointer ((pdfpcWindowToolBox*) self, _sender, event);
	return result;
}

static void
__lambda22_ (Block15Data* _data15_)
{
	pdfpcWindowToolBox* self;
	gboolean state = FALSE;
	GtkBox* _tmp0_;
	GtkBox* _tmp1_;
	self = _data15_->self;
	_tmp0_ = _data15_->button_panel;
	state = gtk_widget_get_child_visible ((GtkWidget*) _tmp0_);
	_tmp1_ = _data15_->button_panel;
	gtk_widget_set_child_visible ((GtkWidget*) _tmp1_, !state);
}

static void
___lambda22__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda22_ (self);
}

static void
__lambda23_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_set_normal_mode (_tmp0_);
}

static void
___lambda23__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda23_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda24_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_set_pointer_mode (_tmp0_);
}

static void
___lambda24__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda24_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda25_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_set_pen_mode (_tmp0_);
}

static void
___lambda25__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda25_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda26_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_set_eraser_mode (_tmp0_);
}

static void
___lambda26__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda26_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda27_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_set_spotlight_mode (_tmp0_);
}

static void
___lambda27__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda27_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda28_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_toggle_freeze (_tmp0_);
}

static void
___lambda28__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda28_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda29_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_fade_to_black (_tmp0_);
}

static void
___lambda29__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda29_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda30_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_hide_presentation (_tmp0_);
}

static void
___lambda30__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda30_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda31_ (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_toggle_pause (_tmp0_);
}

static void
___lambda31__gtk_button_clicked (GtkButton* _sender,
                                 gpointer self)
{
	__lambda31_ ((pdfpcWindowToolBox*) self);
}

static void
__lambda32_ (pdfpcWindowToolBox* self,
             gdouble val)
{
	pdfpcPresentationController* _tmp0_;
	_tmp0_ = self->controller;
	pdfpc_presentation_controller_set_pen_size (_tmp0_, val);
}

static void
___lambda32__gtk_scale_button_value_changed (GtkScaleButton* _sender,
                                             gdouble value,
                                             gpointer self)
{
	__lambda32_ ((pdfpcWindowToolBox*) self, value);
}

static void
__lambda33_ (pdfpcWindowToolBox* self)
{
	GdkRGBA rgba = {0};
	GtkColorButton* _tmp0_;
	GdkRGBA _tmp1_ = {0};
	GdkRGBA _tmp2_;
	pdfpcPresentationController* _tmp3_;
	pdfpcDrawingsDrawing* _tmp4_;
	pdfpcDrawingsDrawingTool* _tmp5_;
	pdfpcDrawingsDrawingTool* _tmp6_;
	GdkRGBA _tmp7_;
	pdfpcPresentationController* _tmp8_;
	_tmp0_ = self->color_button;
	gtk_color_chooser_get_rgba ((GtkColorChooser*) _tmp0_, &_tmp1_);
	_tmp2_ = _tmp1_;
	rgba = _tmp2_;
	_tmp3_ = self->controller;
	_tmp4_ = _tmp3_->pen_drawing;
	_tmp5_ = pdfpc_drawings_drawing_get_pen (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = rgba;
	pdfpc_drawings_drawing_tool_set_rgba (_tmp6_, &_tmp7_);
	_tmp8_ = self->controller;
	pdfpc_presentation_controller_queue_pen_surface_draws (_tmp8_);
}

static void
___lambda33__gtk_color_button_color_set (GtkColorButton* _sender,
                                         gpointer self)
{
	__lambda33_ ((pdfpcWindowToolBox*) self);
}

pdfpcWindowToolBox*
pdfpc_window_tool_box_construct (GType object_type,
                                 pdfpcWindowPresenter* presenter,
                                 gint icon_height)
{
	pdfpcWindowToolBox * self = NULL;
	Block15Data* _data15_;
	pdfpcPresentationController* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	pdfpcPresentationController* _tmp2_;
	GtkOrientation orientation = 0;
	gboolean tbox_inverse = FALSE;
	GtkBox* _tmp3_;
	GtkBox* _tmp4_;
	GtkStyleContext* _tmp5_;
	GtkBox* _tmp6_;
	GtkBox* _tmp7_;
	GtkImage* himage = NULL;
	GtkImage* _tmp8_;
	GtkImage* _tmp9_;
	GtkEventBox* heventbox = NULL;
	GtkEventBox* _tmp10_;
	GtkEventBox* _tmp11_;
	GtkEventBox* _tmp12_;
	GtkEventBox* _tmp13_;
	GtkImage* _tmp14_;
	GtkEventBox* _tmp15_;
	GtkButton* tb = NULL;
	GtkBox* _tmp20_;
	GtkButton* _tmp21_;
	GtkBox* _tmp22_;
	GtkBox* _tmp23_;
	GtkBox* _tmp24_;
	GtkButton* _tmp30_;
	GtkBox* _tmp31_;
	GtkButton* _tmp32_;
	GtkButton* _tmp33_;
	GtkBox* _tmp34_;
	GtkButton* _tmp35_;
	GtkButton* _tmp36_;
	GtkBox* _tmp37_;
	GtkButton* _tmp38_;
	GtkButton* _tmp39_;
	GtkBox* _tmp40_;
	GtkButton* _tmp41_;
	GtkButton* _tmp42_;
	GtkBox* _tmp43_;
	GtkButton* _tmp44_;
	GtkButton* _tmp45_;
	GtkBox* _tmp46_;
	GtkButton* _tmp47_;
	GtkButton* _tmp48_;
	GtkBox* _tmp49_;
	GtkButton* _tmp50_;
	GtkButton* _tmp51_;
	GtkBox* _tmp52_;
	GtkButton* _tmp53_;
	GtkButton* _tmp54_;
	GtkBox* _tmp55_;
	GtkButton* _tmp56_;
	GtkButton* _tmp57_;
	GtkBox* _tmp58_;
	GtkScaleButton* _tmp59_;
	GtkScaleButton* _tmp60_;
	GtkScaleButton* _tmp61_;
	GtkBox* _tmp62_;
	GtkColorButton* _tmp63_;
	GtkColorButton* _tmp64_;
	GtkColorButton* _tmp65_;
	gint tbox_x = 0;
	gint tbox_y = 0;
	gint _tmp66_;
	gint _tmp67_;
	gint _tmp68_;
	gint _tmp69_;
	gint _tmp70_ = 0;
	gint _tmp71_ = 0;
	GtkBox* _tmp72_;
	g_return_val_if_fail (presenter != NULL, NULL);
	_data15_ = g_slice_new0 (Block15Data);
	_data15_->_ref_count_ = 1;
	self = (pdfpcWindowToolBox*) g_object_new (object_type, NULL);
	_data15_->self = g_object_ref (self);
	self->priv->icon_height = icon_height;
	_tmp0_ = pdfpc_controllable_get_controller ((pdfpcControllable*) presenter);
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->controller);
	self->controller = _tmp2_;
	orientation = GTK_ORIENTATION_HORIZONTAL;
	tbox_inverse = FALSE;
	switch (pdfpc_options_toolbox_direction) {
		case PDFPC_OPTIONS_TOOLBOX_DIRECTION_LtoR:
		{
			orientation = GTK_ORIENTATION_HORIZONTAL;
			tbox_inverse = FALSE;
			break;
		}
		case PDFPC_OPTIONS_TOOLBOX_DIRECTION_RtoL:
		{
			orientation = GTK_ORIENTATION_HORIZONTAL;
			tbox_inverse = TRUE;
			break;
		}
		case PDFPC_OPTIONS_TOOLBOX_DIRECTION_TtoB:
		{
			orientation = GTK_ORIENTATION_VERTICAL;
			tbox_inverse = FALSE;
			break;
		}
		case PDFPC_OPTIONS_TOOLBOX_DIRECTION_BtoT:
		{
			orientation = GTK_ORIENTATION_VERTICAL;
			tbox_inverse = TRUE;
			break;
		}
		default:
		break;
	}
	_tmp3_ = (GtkBox*) gtk_box_new (orientation, 0);
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->toolbox);
	self->toolbox = _tmp3_;
	_tmp4_ = self->toolbox;
	_tmp5_ = gtk_widget_get_style_context ((GtkWidget*) _tmp4_);
	gtk_style_context_add_class (_tmp5_, "toolbox");
	_tmp6_ = self->toolbox;
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	_tmp7_ = self->toolbox;
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_START);
	_tmp8_ = pdfpc_window_load_icon ("move.svg", icon_height);
	himage = _tmp8_;
	_tmp9_ = himage;
	gtk_widget_show ((GtkWidget*) _tmp9_);
	_tmp10_ = (GtkEventBox*) gtk_event_box_new ();
	g_object_ref_sink (_tmp10_);
	heventbox = _tmp10_;
	_tmp11_ = heventbox;
	g_signal_connect_object ((GtkWidget*) _tmp11_, "button-press-event", (GCallback) _pdfpc_window_tool_box_on_button_press_gtk_widget_button_press_event, self, 0);
	_tmp12_ = heventbox;
	g_signal_connect_object ((GtkWidget*) _tmp12_, "motion-notify-event", (GCallback) _pdfpc_window_tool_box_on_move_pointer_gtk_widget_motion_notify_event, self, 0);
	_tmp13_ = heventbox;
	_tmp14_ = himage;
	gtk_container_add ((GtkContainer*) _tmp13_, (GtkWidget*) _tmp14_);
	_tmp15_ = heventbox;
	gtk_widget_set_events ((GtkWidget*) _tmp15_, (gint) (GDK_BUTTON_PRESS_MASK | GDK_BUTTON1_MOTION_MASK));
	if (tbox_inverse) {
		GtkBox* _tmp16_;
		GtkEventBox* _tmp17_;
		_tmp16_ = self->toolbox;
		_tmp17_ = heventbox;
		gtk_box_pack_end (_tmp16_, (GtkWidget*) _tmp17_, TRUE, TRUE, (guint) 0);
	} else {
		GtkBox* _tmp18_;
		GtkEventBox* _tmp19_;
		_tmp18_ = self->toolbox;
		_tmp19_ = heventbox;
		gtk_box_pack_start (_tmp18_, (GtkWidget*) _tmp19_, TRUE, TRUE, (guint) 0);
	}
	_tmp20_ = self->toolbox;
	_tmp21_ = pdfpc_window_tool_box_add_button (self, _tmp20_, tbox_inverse, "settings.svg", "Toggle toolbox panel");
	_g_object_unref0 (tb);
	tb = _tmp21_;
	_tmp22_ = (GtkBox*) gtk_box_new (orientation, 0);
	g_object_ref_sink (_tmp22_);
	_data15_->button_panel = _tmp22_;
	_tmp23_ = _data15_->button_panel;
	gtk_box_set_spacing (_tmp23_, 0);
	_tmp24_ = _data15_->button_panel;
	gtk_box_set_homogeneous (_tmp24_, TRUE);
	if (pdfpc_options_toolbox_minimized) {
		GtkBox* _tmp25_;
		_tmp25_ = _data15_->button_panel;
		gtk_widget_set_child_visible ((GtkWidget*) _tmp25_, FALSE);
	}
	if (tbox_inverse) {
		GtkBox* _tmp26_;
		GtkBox* _tmp27_;
		_tmp26_ = self->toolbox;
		_tmp27_ = _data15_->button_panel;
		gtk_box_pack_end (_tmp26_, (GtkWidget*) _tmp27_, TRUE, TRUE, (guint) 0);
	} else {
		GtkBox* _tmp28_;
		GtkBox* _tmp29_;
		_tmp28_ = self->toolbox;
		_tmp29_ = _data15_->button_panel;
		gtk_box_pack_start (_tmp28_, (GtkWidget*) _tmp29_, TRUE, TRUE, (guint) 0);
	}
	_tmp30_ = tb;
	g_signal_connect_data (_tmp30_, "clicked", (GCallback) ___lambda22__gtk_button_clicked, block15_data_ref (_data15_), (GClosureNotify) block15_data_unref, 0);
	_tmp31_ = _data15_->button_panel;
	_tmp32_ = pdfpc_window_tool_box_add_button (self, _tmp31_, tbox_inverse, "empty.svg", "Normal mode");
	_g_object_unref0 (tb);
	tb = _tmp32_;
	_tmp33_ = tb;
	g_signal_connect_object (_tmp33_, "clicked", (GCallback) ___lambda23__gtk_button_clicked, self, 0);
	_tmp34_ = _data15_->button_panel;
	_tmp35_ = pdfpc_window_tool_box_add_button (self, _tmp34_, tbox_inverse, "highlight.svg", "Pointer mode");
	_g_object_unref0 (tb);
	tb = _tmp35_;
	_tmp36_ = tb;
	g_signal_connect_object (_tmp36_, "clicked", (GCallback) ___lambda24__gtk_button_clicked, self, 0);
	_tmp37_ = _data15_->button_panel;
	_tmp38_ = pdfpc_window_tool_box_add_button (self, _tmp37_, tbox_inverse, "pen.svg", "Pen mode");
	_g_object_unref0 (tb);
	tb = _tmp38_;
	_tmp39_ = tb;
	g_signal_connect_object (_tmp39_, "clicked", (GCallback) ___lambda25__gtk_button_clicked, self, 0);
	_tmp40_ = _data15_->button_panel;
	_tmp41_ = pdfpc_window_tool_box_add_button (self, _tmp40_, tbox_inverse, "eraser.svg", "Eraser mode");
	_g_object_unref0 (tb);
	tb = _tmp41_;
	_tmp42_ = tb;
	g_signal_connect_object (_tmp42_, "clicked", (GCallback) ___lambda26__gtk_button_clicked, self, 0);
	_tmp43_ = _data15_->button_panel;
	_tmp44_ = pdfpc_window_tool_box_add_button (self, _tmp43_, tbox_inverse, "spotlight.svg", "Spotlight mode");
	_g_object_unref0 (tb);
	tb = _tmp44_;
	_tmp45_ = tb;
	g_signal_connect_object (_tmp45_, "clicked", (GCallback) ___lambda27__gtk_button_clicked, self, 0);
	_tmp46_ = _data15_->button_panel;
	_tmp47_ = pdfpc_window_tool_box_add_button (self, _tmp46_, tbox_inverse, "snow.svg", "Freeze presentation window");
	_g_object_unref0 (tb);
	tb = _tmp47_;
	_tmp48_ = tb;
	g_signal_connect_object (_tmp48_, "clicked", (GCallback) ___lambda28__gtk_button_clicked, self, 0);
	_tmp49_ = _data15_->button_panel;
	_tmp50_ = pdfpc_window_tool_box_add_button (self, _tmp49_, tbox_inverse, "blank.svg", "Black presentation window");
	_g_object_unref0 (tb);
	tb = _tmp50_;
	_tmp51_ = tb;
	g_signal_connect_object (_tmp51_, "clicked", (GCallback) ___lambda29__gtk_button_clicked, self, 0);
	_tmp52_ = _data15_->button_panel;
	_tmp53_ = pdfpc_window_tool_box_add_button (self, _tmp52_, tbox_inverse, "hidden.svg", "Hide presentation window");
	_g_object_unref0 (tb);
	tb = _tmp53_;
	_tmp54_ = tb;
	g_signal_connect_object (_tmp54_, "clicked", (GCallback) ___lambda30__gtk_button_clicked, self, 0);
	_tmp55_ = _data15_->button_panel;
	_tmp56_ = pdfpc_window_tool_box_add_button (self, _tmp55_, tbox_inverse, "pause.svg", "Pause/resume timer");
	_g_object_unref0 (tb);
	tb = _tmp56_;
	_tmp57_ = tb;
	g_signal_connect_object (_tmp57_, "clicked", (GCallback) ___lambda31__gtk_button_clicked, self, 0);
	_tmp58_ = _data15_->button_panel;
	_tmp59_ = pdfpc_window_tool_box_add_sbutton (self, _tmp58_, tbox_inverse, "linewidth.svg", "Drawing tool size");
	_g_object_unref0 (self->scale_button);
	self->scale_button = _tmp59_;
	_tmp60_ = self->scale_button;
	gtk_widget_hide ((GtkWidget*) _tmp60_);
	_tmp61_ = self->scale_button;
	g_signal_connect_object (_tmp61_, "value-changed", (GCallback) ___lambda32__gtk_scale_button_value_changed, self, 0);
	_tmp62_ = _data15_->button_panel;
	_tmp63_ = pdfpc_window_tool_box_add_cbutton (self, _tmp62_, tbox_inverse, "Pen color");
	_g_object_unref0 (self->color_button);
	self->color_button = _tmp63_;
	_tmp64_ = self->color_button;
	gtk_widget_hide ((GtkWidget*) _tmp64_);
	_tmp65_ = self->color_button;
	g_signal_connect_object (_tmp65_, "color-set", (GCallback) ___lambda33__gtk_color_button_color_set, self, 0);
	_tmp66_ = pdfpc_window_fullscreen_get_window_w ((pdfpcWindowFullscreen*) presenter);
	_tmp67_ = _tmp66_;
	_tmp68_ = pdfpc_window_fullscreen_get_window_h ((pdfpcWindowFullscreen*) presenter);
	_tmp69_ = _tmp68_;
	pdfpc_window_tool_box_calculate_position (self, _tmp67_, _tmp69_, &_tmp70_, &_tmp71_);
	tbox_x = _tmp70_;
	tbox_y = _tmp71_;
	_tmp72_ = self->toolbox;
	gtk_fixed_put ((GtkFixed*) self, (GtkWidget*) _tmp72_, tbox_x, tbox_y);
	_g_object_unref0 (tb);
	_g_object_unref0 (heventbox);
	_g_object_unref0 (himage);
	block15_data_unref (_data15_);
	_data15_ = NULL;
	return self;
}

pdfpcWindowToolBox*
pdfpc_window_tool_box_new (pdfpcWindowPresenter* presenter,
                           gint icon_height)
{
	return pdfpc_window_tool_box_construct (PDFPC_WINDOW_TYPE_TOOL_BOX, presenter, icon_height);
}

void
pdfpc_window_tool_box_update (pdfpcWindowToolBox* self)
{
	pdfpcPresentationController* controller = NULL;
	pdfpcPresentationController* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	GdkRGBA rgba = {0};
	pdfpcPresentationController* _tmp2_;
	pdfpcDrawingsDrawing* _tmp3_;
	pdfpcDrawingsDrawingTool* _tmp4_;
	pdfpcDrawingsDrawingTool* _tmp5_;
	GdkRGBA _tmp6_ = {0};
	GtkColorButton* _tmp7_;
	GdkRGBA _tmp8_;
	pdfpcPresentationController* _tmp9_;
	GtkScaleButton* _tmp12_;
	pdfpcPresentationController* _tmp13_;
	gboolean _tmp14_ = FALSE;
	pdfpcPresentationController* _tmp15_;
	g_return_if_fail (self != NULL);
	if (pdfpc_options_toolbox_shown) {
		gtk_widget_show ((GtkWidget*) self);
	} else {
		gtk_widget_hide ((GtkWidget*) self);
	}
	_tmp0_ = self->controller;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	controller = _tmp1_;
	_tmp2_ = controller;
	_tmp3_ = _tmp2_->pen_drawing;
	_tmp4_ = pdfpc_drawings_drawing_get_pen (_tmp3_);
	_tmp5_ = _tmp4_;
	pdfpc_drawings_drawing_tool_get_rgba (_tmp5_, &_tmp6_);
	rgba = _tmp6_;
	_tmp7_ = self->color_button;
	_tmp8_ = rgba;
	gtk_color_chooser_set_rgba ((GtkColorChooser*) _tmp7_, &_tmp8_);
	_tmp9_ = controller;
	if (pdfpc_presentation_controller_is_pen_active (_tmp9_)) {
		GtkColorButton* _tmp10_;
		_tmp10_ = self->color_button;
		gtk_widget_show ((GtkWidget*) _tmp10_);
	} else {
		GtkColorButton* _tmp11_;
		_tmp11_ = self->color_button;
		gtk_widget_hide ((GtkWidget*) _tmp11_);
	}
	_tmp12_ = self->scale_button;
	_tmp13_ = controller;
	gtk_scale_button_set_value (_tmp12_, pdfpc_presentation_controller_get_pen_size (_tmp13_));
	_tmp15_ = controller;
	if (pdfpc_presentation_controller_is_pen_active (_tmp15_)) {
		_tmp14_ = TRUE;
	} else {
		pdfpcPresentationController* _tmp16_;
		_tmp16_ = controller;
		_tmp14_ = pdfpc_presentation_controller_is_eraser_active (_tmp16_);
	}
	if (_tmp14_) {
		GtkScaleButton* _tmp17_;
		_tmp17_ = self->scale_button;
		gtk_widget_show ((GtkWidget*) _tmp17_);
	} else {
		GtkScaleButton* _tmp18_;
		_tmp18_ = self->scale_button;
		gtk_widget_hide ((GtkWidget*) _tmp18_);
	}
	_g_object_unref0 (controller);
}

void
pdfpc_window_tool_box_calculate_position (pdfpcWindowToolBox* self,
                                          gint w,
                                          gint h,
                                          gint* x,
                                          gint* y)
{
	gint _vala_x = 0;
	gint _vala_y = 0;
	gdouble fx = 0.0;
	gdouble fy = 0.0;
	gdouble offset = 0.0;
	g_return_if_fail (self != NULL);
	fx = 0.0;
	fy = 0.0;
	offset = 0.02 * h;
	switch (pdfpc_options_toolbox_direction) {
		case PDFPC_OPTIONS_TOOLBOX_DIRECTION_LtoR:
		{
			fx = (0.15 * w) + offset;
			fy = (0.70 * h) + offset;
			break;
		}
		case PDFPC_OPTIONS_TOOLBOX_DIRECTION_RtoL:
		{
			fx = (0.15 * w) - offset;
			fy = (0.70 * h) + offset;
			break;
		}
		case PDFPC_OPTIONS_TOOLBOX_DIRECTION_TtoB:
		{
			fx = (0 * w) + offset;
			fy = (0 * h) + offset;
			break;
		}
		case PDFPC_OPTIONS_TOOLBOX_DIRECTION_BtoT:
		{
			fx = (0 * w) + offset;
			fy = (0 * h) + offset;
			break;
		}
		default:
		break;
	}
	_vala_x = (gint) fx;
	_vala_y = (gint) fy;
	if (x) {
		*x = _vala_x;
	}
	if (y) {
		*y = _vala_y;
	}
}

void
pdfpc_window_tool_box_on_window_resize (pdfpcWindowToolBox* self,
                                        gint w,
                                        gint h)
{
	gint x = 0;
	gint y = 0;
	gint _tmp0_ = 0;
	gint _tmp1_ = 0;
	GtkBox* _tmp2_;
	g_return_if_fail (self != NULL);
	pdfpc_window_tool_box_calculate_position (self, w, h, &_tmp0_, &_tmp1_);
	x = _tmp0_;
	y = _tmp1_;
	_tmp2_ = self->toolbox;
	gtk_fixed_move ((GtkFixed*) self, (GtkWidget*) _tmp2_, x, y);
}

static void
pdfpc_window_tool_box_class_init (pdfpcWindowToolBoxClass * klass,
                                  gpointer klass_data)
{
	pdfpc_window_tool_box_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &pdfpcWindowToolBox_private_offset);
	G_OBJECT_CLASS (klass)->finalize = pdfpc_window_tool_box_finalize;
}

static void
pdfpc_window_tool_box_instance_init (pdfpcWindowToolBox * self,
                                     gpointer klass)
{
	self->priv = pdfpc_window_tool_box_get_instance_private (self);
}

static void
pdfpc_window_tool_box_finalize (GObject * obj)
{
	pdfpcWindowToolBox * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PDFPC_WINDOW_TYPE_TOOL_BOX, pdfpcWindowToolBox);
	_g_object_unref0 (self->controller);
	_g_object_unref0 (self->toolbox);
	_g_object_unref0 (self->color_button);
	_g_object_unref0 (self->scale_button);
	G_OBJECT_CLASS (pdfpc_window_tool_box_parent_class)->finalize (obj);
}

/**
     * Fixed layout - container of the toolbox
     */
static GType
pdfpc_window_tool_box_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (pdfpcWindowToolBoxClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_window_tool_box_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcWindowToolBox), 0, (GInstanceInitFunc) pdfpc_window_tool_box_instance_init, NULL };
	GType pdfpc_window_tool_box_type_id;
	pdfpc_window_tool_box_type_id = g_type_register_static (gtk_fixed_get_type (), "pdfpcWindowToolBox", &g_define_type_info, 0);
	pdfpcWindowToolBox_private_offset = g_type_add_instance_private (pdfpc_window_tool_box_type_id, sizeof (pdfpcWindowToolBoxPrivate));
	return pdfpc_window_tool_box_type_id;
}

GType
pdfpc_window_tool_box_get_type (void)
{
	static volatile gsize pdfpc_window_tool_box_type_id__once = 0;
	if (g_once_init_enter (&pdfpc_window_tool_box_type_id__once)) {
		GType pdfpc_window_tool_box_type_id;
		pdfpc_window_tool_box_type_id = pdfpc_window_tool_box_get_type_once ();
		g_once_init_leave (&pdfpc_window_tool_box_type_id__once, pdfpc_window_tool_box_type_id);
	}
	return pdfpc_window_tool_box_type_id__once;
}

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

