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


#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <poppler.h>
#include <stdlib.h>
#include <string.h>


#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;
typedef struct _pdfpcViewBehaviourBasePrivate pdfpcViewBehaviourBasePrivate;

#define PDFPC_VIEW_TYPE_BASE (pdfpc_view_base_get_type ())
#define PDFPC_VIEW_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBase))
#define PDFPC_VIEW_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass))
#define PDFPC_VIEW_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_BASE))
#define PDFPC_VIEW_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_BASE))
#define PDFPC_VIEW_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_BASE, pdfpcViewBaseClass))

typedef struct _pdfpcViewBase pdfpcViewBase;
typedef struct _pdfpcViewBaseClass pdfpcViewBaseClass;

#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION (pdfpc_view_behaviour_pdf_link_implementation_get_type ())
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementation))
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass))
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION))
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_IMPLEMENTATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION))
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, pdfpcViewBehaviourPdfLinkImplementationClass))

typedef struct _pdfpcViewBehaviourPdfLinkImplementation pdfpcViewBehaviourPdfLinkImplementation;
typedef struct _pdfpcViewBehaviourPdfLinkImplementationClass pdfpcViewBehaviourPdfLinkImplementationClass;
typedef struct _pdfpcViewBehaviourPdfLinkImplementationPrivate pdfpcViewBehaviourPdfLinkImplementationPrivate;

#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER (pdfpc_view_behaviour_pdf_link_signal_provider_get_type ())
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProvider))
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass))
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER))
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IS_SIGNAL_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER))
#define PDFPC_VIEW_BEHAVIOUR_PDF_LINK_SIGNAL_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_SIGNAL_PROVIDER, pdfpcViewBehaviourPdfLinkSignalProviderClass))

typedef struct _pdfpcViewBehaviourPdfLinkSignalProvider pdfpcViewBehaviourPdfLinkSignalProvider;
typedef struct _pdfpcViewBehaviourPdfLinkSignalProviderClass pdfpcViewBehaviourPdfLinkSignalProviderClass;

#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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PDFPC_VIEW_TYPE_DEFAULT (pdfpc_view_default_get_type ())
#define PDFPC_VIEW_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefault))
#define PDFPC_VIEW_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass))
#define PDFPC_VIEW_IS_DEFAULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PDFPC_VIEW_TYPE_DEFAULT))
#define PDFPC_VIEW_IS_DEFAULT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PDFPC_VIEW_TYPE_DEFAULT))
#define PDFPC_VIEW_DEFAULT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PDFPC_VIEW_TYPE_DEFAULT, pdfpcViewDefaultClass))

typedef struct _pdfpcViewDefault pdfpcViewDefault;
typedef struct _pdfpcViewDefaultClass pdfpcViewDefaultClass;

#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 _gdk_cursor_unref0(var) ((var == NULL) ? NULL : (var = (gdk_cursor_unref (var), NULL)))

typedef enum  {
	PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_BEHAVIOUR_ALREADY_ASSOCIATED,
	PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR_VIEW_NOT_SUPPORTED
} pdfpcViewBehaviourAssociationError;
#define PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR pdfpc_view_behaviour_association_error_quark ()
struct _pdfpcViewBehaviourBase {
	GObject parent_instance;
	pdfpcViewBehaviourBasePrivate * priv;
	pdfpcViewBase* target;
};

struct _pdfpcViewBehaviourBaseClass {
	GObjectClass parent_class;
	void (*associate) (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error);
};

struct _pdfpcViewBehaviourPdfLinkImplementation {
	pdfpcViewBehaviourBase parent_instance;
	pdfpcViewBehaviourPdfLinkImplementationPrivate * priv;
	pdfpcViewBehaviourPdfLinkSignalProvider* signal_provider;
	pdfpcPresentationController* presentation_controller;
};

struct _pdfpcViewBehaviourPdfLinkImplementationClass {
	pdfpcViewBehaviourBaseClass parent_class;
};


static gpointer pdfpc_view_behaviour_pdf_link_implementation_parent_class = NULL;

GType pdfpc_view_behaviour_base_get_type (void) G_GNUC_CONST;
GType pdfpc_view_base_get_type (void) G_GNUC_CONST;
GQuark pdfpc_view_behaviour_association_error_quark (void);
GType pdfpc_view_behaviour_pdf_link_implementation_get_type (void) G_GNUC_CONST;
GType pdfpc_view_behaviour_pdf_link_signal_provider_get_type (void) G_GNUC_CONST;
GType pdfpc_presentation_controller_get_type (void) G_GNUC_CONST;
enum  {
	PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION_DUMMY_PROPERTY
};
pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_new (pdfpcPresentationController* presentation_controller);
pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_construct (GType object_type, pdfpcPresentationController* presentation_controller);
pdfpcViewBehaviourBase* pdfpc_view_behaviour_base_construct (GType object_type);
pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_new (void);
pdfpcViewBehaviourPdfLinkSignalProvider* pdfpc_view_behaviour_pdf_link_signal_provider_construct (GType object_type);
static void pdfpc_view_behaviour_pdf_link_implementation_real_associate (pdfpcViewBehaviourBase* base, pdfpcViewBase* target, GError** error);
void pdfpc_view_behaviour_base_enforce_exclusive_association (pdfpcViewBehaviourBase* self, pdfpcViewBase* target, GError** error);
GType pdfpc_view_default_get_type (void) G_GNUC_CONST;
GType pdfpc_view_pdf_get_type (void) G_GNUC_CONST;
void pdfpc_view_behaviour_pdf_link_signal_provider_attach (pdfpcViewBehaviourPdfLinkSignalProvider* self, pdfpcViewPdf* view);
void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping);
static void _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_enter (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, PopplerLinkMapping* mapping, gpointer self);
void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping);
static void _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_leave (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, PopplerLinkMapping* mapping, gpointer self);
void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, guint target_page_number);
static void _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_internal_link (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, guint source_page_number, guint target_page_number, gpointer self);
void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments);
static void _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_external_command (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments, gpointer self);
gboolean pdfpc_view_behaviour_pdf_link_implementation_is_supported (pdfpcViewBehaviourPdfLinkImplementation* self, pdfpcViewBase* target);
void pdfpc_presentation_controller_page_change_request (pdfpcPresentationController* self, gint page_number);
static void pdfpc_view_behaviour_pdf_link_implementation_finalize (GObject* obj);


/**
         * Base constructor not taking any arguments
         */
static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_construct (GType object_type, pdfpcPresentationController* presentation_controller) {
	pdfpcViewBehaviourPdfLinkImplementation * self = NULL;
	pdfpcViewBehaviourPdfLinkSignalProvider* _tmp0_;
	pdfpcPresentationController* _tmp1_;
	pdfpcPresentationController* _tmp2_;
	g_return_val_if_fail (presentation_controller != NULL, NULL);
	self = (pdfpcViewBehaviourPdfLinkImplementation*) pdfpc_view_behaviour_base_construct (object_type);
	_tmp0_ = pdfpc_view_behaviour_pdf_link_signal_provider_new ();
	_g_object_unref0 (self->signal_provider);
	self->signal_provider = _tmp0_;
	_tmp1_ = presentation_controller;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->presentation_controller);
	self->presentation_controller = _tmp2_;
	return self;
}


pdfpcViewBehaviourPdfLinkImplementation* pdfpc_view_behaviour_pdf_link_implementation_new (pdfpcPresentationController* presentation_controller) {
	return pdfpc_view_behaviour_pdf_link_implementation_construct (PDFPC_VIEW_BEHAVIOUR_PDF_LINK_TYPE_IMPLEMENTATION, presentation_controller);
}


/**
         * Associate the implementing Behaviour with the given View
         * 
         * This method will register a lot of new signals on the target to
         * handle all the different states.
         */
static void _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_enter (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, PopplerLinkMapping* mapping, gpointer self) {
	pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter (self, link_rect, mapping);
}


static void _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_leave (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, PopplerLinkMapping* mapping, gpointer self) {
	pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave (self, link_rect, mapping);
}


static void _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_internal_link (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, guint source_page_number, guint target_page_number, gpointer self) {
	pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link (self, link_rect, source_page_number, target_page_number);
}


static void _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_external_command (pdfpcViewBehaviourPdfLinkSignalProvider* _sender, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments, gpointer self) {
	pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command (self, link_rect, source_page_number, command, arguments);
}


static void pdfpc_view_behaviour_pdf_link_implementation_real_associate (pdfpcViewBehaviourBase* base, pdfpcViewBase* target, GError** error) {
	pdfpcViewBehaviourPdfLinkImplementation * self;
	pdfpcViewBase* _tmp0_;
	pdfpcViewBase* _tmp1_;
	pdfpcViewBase* _tmp2_;
	pdfpcViewBehaviourPdfLinkSignalProvider* _tmp3_;
	pdfpcViewBase* _tmp4_;
	pdfpcViewBehaviourPdfLinkSignalProvider* _tmp5_;
	pdfpcViewBehaviourPdfLinkSignalProvider* _tmp6_;
	pdfpcViewBehaviourPdfLinkSignalProvider* _tmp7_;
	pdfpcViewBehaviourPdfLinkSignalProvider* _tmp8_;
	GError * _inner_error_ = NULL;
	self = (pdfpcViewBehaviourPdfLinkImplementation*) base;
	g_return_if_fail (target != NULL);
	_tmp0_ = target;
	pdfpc_view_behaviour_base_enforce_exclusive_association ((pdfpcViewBehaviourBase*) self, _tmp0_, &_inner_error_);
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == PDFPC_VIEW_BEHAVIOUR_ASSOCIATION_ERROR) {
			g_propagate_error (error, _inner_error_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	_tmp1_ = target;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (((pdfpcViewBehaviourBase*) self)->target);
	((pdfpcViewBehaviourBase*) self)->target = _tmp2_;
	_tmp3_ = self->signal_provider;
	_tmp4_ = target;
	pdfpc_view_behaviour_pdf_link_signal_provider_attach (_tmp3_, PDFPC_VIEW_IS_PDF (_tmp4_) ? ((pdfpcViewPdf*) _tmp4_) : NULL);
	_tmp5_ = self->signal_provider;
	g_signal_connect_object (_tmp5_, "link-mouse-enter", (GCallback) _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_enter, self, 0);
	_tmp6_ = self->signal_provider;
	g_signal_connect_object (_tmp6_, "link-mouse-leave", (GCallback) _pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave_pdfpc_view_behaviour_pdf_link_signal_provider_link_mouse_leave, self, 0);
	_tmp7_ = self->signal_provider;
	g_signal_connect_object (_tmp7_, "clicked-internal-link", (GCallback) _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_internal_link, self, 0);
	_tmp8_ = self->signal_provider;
	g_signal_connect_object (_tmp8_, "clicked-external-command", (GCallback) _pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command_pdfpc_view_behaviour_pdf_link_signal_provider_clicked_external_command, self, 0);
}


/**
         * Check wheter the given target is supported by this Behaviour
         *
         * Only View.Pdf and its descendants are allowed to be used in
         * conjunction with this Behaviour
         */
gboolean pdfpc_view_behaviour_pdf_link_implementation_is_supported (pdfpcViewBehaviourPdfLinkImplementation* self, pdfpcViewBase* target) {
	gboolean result = FALSE;
	pdfpcViewBase* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	_tmp0_ = target;
	result = PDFPC_VIEW_IS_PDF (_tmp0_);
	return result;
}


/**
         * The mouse pointer has entered a pdf link
         */
void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_enter (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping) {
	pdfpcViewBase* _tmp0_;
	GdkWindow* _tmp1_;
	GdkDisplay* _tmp2_ = NULL;
	GdkCursor* _tmp3_;
	GdkCursor* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (link_rect != NULL);
	g_return_if_fail (mapping != NULL);
	_tmp0_ = ((pdfpcViewBehaviourBase*) self)->target;
	_tmp1_ = ((GtkWidget*) _tmp0_)->window;
	_tmp2_ = gdk_display_get_default ();
	_tmp3_ = gdk_cursor_new_from_name (_tmp2_, "hand2");
	_tmp4_ = _tmp3_;
	gdk_window_set_cursor (_tmp1_, _tmp4_);
	_gdk_cursor_unref0 (_tmp4_);
}


/**
         * The mouse pointer has left a pdf link
         */
void pdfpc_view_behaviour_pdf_link_implementation_on_link_mouse_leave (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, PopplerLinkMapping* mapping) {
	pdfpcViewBase* _tmp0_;
	GdkWindow* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (link_rect != NULL);
	g_return_if_fail (mapping != NULL);
	_tmp0_ = ((pdfpcViewBehaviourBase*) self)->target;
	_tmp1_ = ((GtkWidget*) _tmp0_)->window;
	gdk_window_set_cursor (_tmp1_, NULL);
}


/**
         * An internal link has been clicked
         */
void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_internal_link (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, guint target_page_number) {
	pdfpcPresentationController* _tmp0_;
	guint _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (link_rect != NULL);
	_tmp0_ = self->presentation_controller;
	_tmp1_ = target_page_number;
	pdfpc_presentation_controller_page_change_request (_tmp0_, (gint) _tmp1_);
}


/**
         * An external command link has been clicked
         */
void pdfpc_view_behaviour_pdf_link_implementation_on_clicked_external_command (pdfpcViewBehaviourPdfLinkImplementation* self, GdkRectangle* link_rect, guint source_page_number, const gchar* command, const gchar* arguments) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (link_rect != NULL);
	g_return_if_fail (command != NULL);
	g_return_if_fail (arguments != NULL);
}


static void pdfpc_view_behaviour_pdf_link_implementation_class_init (pdfpcViewBehaviourPdfLinkImplementationClass * klass) {
	pdfpc_view_behaviour_pdf_link_implementation_parent_class = g_type_class_peek_parent (klass);
	PDFPC_VIEW_BEHAVIOUR_BASE_CLASS (klass)->associate = pdfpc_view_behaviour_pdf_link_implementation_real_associate;
	G_OBJECT_CLASS (klass)->finalize = pdfpc_view_behaviour_pdf_link_implementation_finalize;
}


static void pdfpc_view_behaviour_pdf_link_implementation_instance_init (pdfpcViewBehaviourPdfLinkImplementation * self) {
	self->signal_provider = NULL;
}


static void pdfpc_view_behaviour_pdf_link_implementation_finalize (GObject* obj) {
	pdfpcViewBehaviourPdfLinkImplementation * self;
	self = PDFPC_VIEW_BEHAVIOUR_PDF_LINK_IMPLEMENTATION (obj);
	_g_object_unref0 (self->signal_provider);
	_g_object_unref0 (self->presentation_controller);
	G_OBJECT_CLASS (pdfpc_view_behaviour_pdf_link_implementation_parent_class)->finalize (obj);
}


/**
     * Behaviour which handles links inside of Pdf based Views
     */
GType pdfpc_view_behaviour_pdf_link_implementation_get_type (void) {
	static volatile gsize pdfpc_view_behaviour_pdf_link_implementation_type_id__volatile = 0;
	if (g_once_init_enter (&pdfpc_view_behaviour_pdf_link_implementation_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (pdfpcViewBehaviourPdfLinkImplementationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pdfpc_view_behaviour_pdf_link_implementation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (pdfpcViewBehaviourPdfLinkImplementation), 0, (GInstanceInitFunc) pdfpc_view_behaviour_pdf_link_implementation_instance_init, NULL };
		GType pdfpc_view_behaviour_pdf_link_implementation_type_id;
		pdfpc_view_behaviour_pdf_link_implementation_type_id = g_type_register_static (PDFPC_VIEW_BEHAVIOUR_TYPE_BASE, "pdfpcViewBehaviourPdfLinkImplementation", &g_define_type_info, 0);
		g_once_init_leave (&pdfpc_view_behaviour_pdf_link_implementation_type_id__volatile, pdfpc_view_behaviour_pdf_link_implementation_type_id);
	}
	return pdfpc_view_behaviour_pdf_link_implementation_type_id__volatile;
}



