Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2005-02-02 13:22:53 (GMT)
committer Jonathan Blandford <jrb@src.gnome.org>2005-02-02 13:22:53 (GMT)
commitbebd9ceae1ec88ddee03bda8c7572c9cb06f6b77 (patch)
tree473a80dc33f128ab0c24e3322002d2066f0fe293 /backend
parente6bb7c7e25b848008409db982bbac260fa97f73c (diff)
New file with some random thoughts.
Wed Feb 2 21:13:11 2005 Jonathan Blandford <jrb@redhat.com> * NOTES: New file with some random thoughts. * TODO: Update. * backend/ev-document-misc.c: (ev_document_misc_get_page_border_size): New function to canonicalize shadow drawing sizes. Possibly goofy. * shell/ev-view.c: (ev_view_size_request), (set_document_page), (ev_view_best_fit), (ev_view_fit_width): * pdf/xpdf/pdf-document.cc: * pixbuf/pixbuf-document.c: (pixbuf_document_get_page_size): * ps/ps-document.c: (ps_document_get_page_size): * backend/ev-document-misc.h: * backend/ev-document.c: (ev_document_get_page_size): * backend/ev-document.h: get_page_size now takes a page number parameter. Made all the backends/frontends honor it. * data/evince-ui.xml: Added a multiple-page mode. Uncomment to see. Doesn't work yet. * shell/Makefile.am: * shell/ev-page-view.[ch]: New multi-page view. Really rough. Doesn't do anything yet. * shell/ev-sidebar-thumbnails.c: (ev_sidebar_thumbnails_set_document): [1..n_pages] instead of [0..n_pages-1] * shell/ev-window.c: (update_action_sensitivity), (ev_window_setup_document), (ev_window_set_page_mode), (ev_window_page_mode_cb), (ev_window_init): Clean up the view-swapping code a bit so we can have multiple views on a document. Add the multi-page view, though it can't be turned on yet.
Diffstat (limited to 'backend')
-rw-r--r--backend/ev-document-misc.c29
-rw-r--r--backend/ev-document-misc.h7
-rw-r--r--backend/ev-document.c3
-rw-r--r--backend/ev-document.h2
4 files changed, 40 insertions, 1 deletions
diff --git a/backend/ev-document-misc.c b/backend/ev-document-misc.c
index d7d4beb..4145b8a 100644
--- a/backend/ev-document-misc.c
+++ b/backend/ev-document-misc.c
@@ -1,6 +1,7 @@
#include "ev-document-misc.h"
#include <string.h>
+#include <gtk/gtk.h>
/* Returns a new GdkPixbuf that is suitable for placing in the thumbnail view.
* It is four pixels wider and taller than the source. If source_pixbuf is not
@@ -62,3 +63,31 @@ ev_document_misc_get_thumbnail_frame (int width,
return retval;
}
+
+void
+ev_document_misc_get_page_border_size (gint page_width,
+ gint page_height,
+ gint *left_border,
+ gint *right_border,
+ gint *top_border,
+ gint *bottom_border)
+{
+ g_assert (left_border);
+ g_assert (right_border);
+ g_assert (top_border);
+ g_assert (bottom_border);
+
+ *left_border = 1;
+ *top_border = 1;
+ if (page_width < 100) {
+ *right_border = 2;
+ *bottom_border = 2;
+ } else if (page_width < 500) {
+ *right_border = 3;
+ *left_border = 3;
+ } else {
+ *right_border = 4;
+ *bottom_border = 4;
+ }
+}
+
diff --git a/backend/ev-document-misc.h b/backend/ev-document-misc.h
index 1fae363..a7ed645 100644
--- a/backend/ev-document-misc.h
+++ b/backend/ev-document-misc.h
@@ -32,6 +32,13 @@ GdkPixbuf *ev_document_misc_get_thumbnail_frame (int width,
int height,
GdkPixbuf *source_pixbuf);
+void ev_document_misc_get_page_border_size (gint page_width,
+ gint page_height,
+ gint *left_border,
+ gint *right_border,
+ gint *top_border,
+ gint *bottom_border);
+
G_END_DECLS
#endif /* EV_DOCUMENT_MISC_H */
diff --git a/backend/ev-document.c b/backend/ev-document.c
index 6f6a687..a53cbea 100644
--- a/backend/ev-document.c
+++ b/backend/ev-document.c
@@ -164,11 +164,12 @@ ev_document_set_page_offset (EvDocument *document,
void
ev_document_get_page_size (EvDocument *document,
+ int page,
int *width,
int *height)
{
EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
- iface->get_page_size (document, width, height);
+ iface->get_page_size (document, page, width, height);
}
char *
diff --git a/backend/ev-document.h b/backend/ev-document.h
index 5581cd7..18819f4 100644
--- a/backend/ev-document.h
+++ b/backend/ev-document.h
@@ -74,6 +74,7 @@ struct _EvDocumentIface
int x,
int y);
void (* get_page_size) (EvDocument *document,
+ int page,
int *width,
int *height);
char * (* get_text) (EvDocument *document,
@@ -112,6 +113,7 @@ void ev_document_set_page_offset (EvDocument *document,
int x,
int y);
void ev_document_get_page_size (EvDocument *document,
+ int page,
int *width,
int *height);
char *ev_document_get_text (EvDocument *document,