]> www.fi.muni.cz Git - evince.git/blobdiff - backend/ev-document.c
Add a few more toolbar items.
[evince.git] / backend / ev-document.c
index 44910032276b36b3dd9facebb7c2b5440226d037..4aea1d11c0fbeaf5afc6261c1b20088f484fc8ad 100644 (file)
@@ -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,6 +21,7 @@
 #include "config.h"
 
 #include "ev-document.h"
+#include "ev-backend-marshal.c"
 
 static void ev_document_base_init (gpointer g_class);
 
@@ -48,15 +50,31 @@ ev_document_get_type (void)
 static void
 ev_document_base_init (gpointer g_class)
 {
+       static gboolean initialized = FALSE;
+
+       if (!initialized) {
+               g_signal_new ("found",
+                             EV_TYPE_DOCUMENT,
+                             G_SIGNAL_RUN_LAST,
+                             G_STRUCT_OFFSET (EvDocumentIface, found),
+                             NULL, NULL,
+                             _ev_backend_marshal_VOID__POINTER_INT_DOUBLE,
+                             G_TYPE_NONE, 3,
+                             G_TYPE_POINTER,
+                             G_TYPE_INT,
+                             G_TYPE_DOUBLE);
+
+               initialized = TRUE;
+       }
 }
 
-void
+gboolean
 ev_document_load (EvDocument  *document,
                  const char  *uri,
-                 GError      *error)
+                 GError     **error)
 {
        EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
-       iface->load (document, uri, error);
+       return iface->load (document, uri, error);
 }
 
 int
@@ -74,6 +92,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 +108,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 +143,19 @@ 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_begin_find (EvDocument   *document,
+                       const char   *search_string,
+                       gboolean      case_sensitive)
+{
+       EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
+       iface->begin_find (document, search_string, case_sensitive);
+}
+
+void
+ev_document_end_find (EvDocument   *document)
+{
+       EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
+       iface->end_find (document);
+}