X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=inline;f=backend%2Fev-document.c;h=dcc620483dd10729a93884d4fff338395924af19;hb=ad039deb64377ecf8bbc2c81155b6da9dbeb2a88;hp=5886e3f622100642e8d96633985befd63b79c8c1;hpb=a4cf673a3347ec011ebc90b22b6541bae0b9f6b4;p=evince.git diff --git a/backend/ev-document.c b/backend/ev-document.c index 5886e3f6..dcc62048 100644 --- a/backend/ev-document.c +++ b/backend/ev-document.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */ /* * Copyright (C) 2004 Marco Pesenti Gritti * @@ -20,9 +21,18 @@ #include "config.h" #include "ev-document.h" +#include "ev-backend-marshalers.h" static void ev_document_base_init (gpointer g_class); +enum +{ + CHANGED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + GType ev_document_get_type (void) { @@ -48,6 +58,22 @@ ev_document_get_type (void) static void ev_document_base_init (gpointer g_class) { + static gboolean initialized = FALSE; + + if (!initialized) + { + signals[CHANGED] = + g_signal_new ("changed", + EV_TYPE_DOCUMENT, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EvDocumentIface, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, + 0); + + initialized = TRUE; + } } gboolean @@ -74,6 +100,13 @@ ev_document_set_page (EvDocument *document, iface->set_page (document, page); } +int +ev_document_get_page (EvDocument *document) +{ + EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); + return iface->get_page (document); +} + void ev_document_set_target (EvDocument *document, GdkDrawable *target) @@ -83,14 +116,29 @@ ev_document_set_target (EvDocument *document, } void -ev_document_set_page_rect (EvDocument *document, - int x, - int y, - int width, - int height) +ev_document_set_scale (EvDocument *document, + double scale) { EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); - iface->set_page_rect (document, x, y, width, height); + iface->set_scale (document, scale); +} + +void +ev_document_set_page_offset (EvDocument *document, + int x, + int y) +{ + EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); + iface->set_page_offset (document, x, y); +} + +void +ev_document_get_page_size (EvDocument *document, + int *width, + int *height) +{ + EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); + iface->get_page_size (document, width, height); } void @@ -103,3 +151,9 @@ ev_document_render (EvDocument *document, EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); iface->render (document, clip_x, clip_y, clip_width, clip_height); } + +void +ev_document_changed (EvDocument *document) +{ + g_signal_emit (G_OBJECT (document), signals[CHANGED], 0); +}