]> www.fi.muni.cz Git - evince.git/commitdiff
Use rotation rather than orientation. It's easier and enough for our
authorMarco Pesenti Gritti <mpg@redhat.com>
Fri, 29 Jul 2005 16:02:28 +0000 (16:02 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Fri, 29 Jul 2005 16:02:28 +0000 (16:02 +0000)
2005-07-29  Marco Pesenti Gritti  <mpg@redhat.com>

        * backend/ev-document-thumbnails.c:
        (ev_document_thumbnails_get_thumbnail):
        * backend/ev-document-thumbnails.h:
        * backend/ev-document.c:
        * backend/ev-document.h:
        * backend/ev-render-context.c: (ev_render_context_new),
        (ev_render_context_set_rotation):
        * backend/ev-render-context.h:
        * pdf/ev-poppler.cc:
        * ps/ps-document.c: (ps_document_document_iface_init):
        * shell/ev-jobs.c: (ev_job_thumbnail_new), (ev_job_thumbnail_run):
        * shell/ev-jobs.h:
        * shell/ev-page-cache.c: (build_height_to_page),
        (ev_page_cache_new), (ev_page_cache_get_size),
        (ev_page_cache_get_max_width), (ev_page_cache_get_max_height),
        (ev_page_cache_get_height_to_page):
        * shell/ev-page-cache.h:
        * shell/ev-pixbuf-cache.c: (check_job_size_and_unref),
        (add_job_if_needed), (ev_pixbuf_cache_add_jobs_if_needed),
        (ev_pixbuf_cache_set_page_range), (new_selection_pixbuf_needed),
        (ev_pixbuf_cache_get_selection_pixbuf):
        * shell/ev-pixbuf-cache.h:
        * shell/ev-print-job.c: (idle_print_handler):
        * shell/ev-sidebar-thumbnails.c: (add_range):
        * shell/ev-view.c: (view_update_range_and_current_page),
        (get_page_y_offset), (get_page_extents),
        (ev_view_size_request_continuous_dual_page),
        (ev_view_size_request_continuous),
        (ev_view_size_request_dual_page),
        (ev_view_size_request_single_page), (draw_one_page),
        (ev_view_set_rotation), (ev_view_rotate_right),
        (ev_view_rotate_left), (ev_view_zoom_for_size_presentation),
        (ev_view_zoom_for_size_continuous_and_dual_page),
        (ev_view_zoom_for_size_continuous),
        (ev_view_zoom_for_size_dual_page),
        (ev_view_zoom_for_size_single_page), (compute_new_selection_text),
        (ev_view_select_all):
        * thumbnailer/evince-thumbnailer.c: (evince_thumbnail_pngenc_get):
        * tiff/tiff-document.c: (tiff_document_render_pixbuf),
        (tiff_document_document_iface_init),
        (tiff_document_thumbnails_get_thumbnail):

        Use rotation rather than orientation. It's easier and enough
        for our needs.

19 files changed:
ChangeLog
backend/ev-document-thumbnails.c
backend/ev-document-thumbnails.h
backend/ev-document.c
backend/ev-document.h
backend/ev-render-context.c
backend/ev-render-context.h
pdf/ev-poppler.cc
ps/ps-document.c
shell/ev-jobs.c
shell/ev-jobs.h
shell/ev-page-cache.c
shell/ev-page-cache.h
shell/ev-pixbuf-cache.c
shell/ev-pixbuf-cache.h
shell/ev-print-job.c
shell/ev-sidebar-thumbnails.c
shell/ev-view.c
tiff/tiff-document.c

index fde394956d639323127689638a38b5f89a15343f..0cca8942f7791056b1694d0c8e5ee2ea85499061 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,50 @@
+2005-07-29  Marco Pesenti Gritti  <mpg@redhat.com>
+
+       * backend/ev-document-thumbnails.c:
+       (ev_document_thumbnails_get_thumbnail):
+       * backend/ev-document-thumbnails.h:
+       * backend/ev-document.c:
+       * backend/ev-document.h:
+       * backend/ev-render-context.c: (ev_render_context_new),
+       (ev_render_context_set_rotation):
+       * backend/ev-render-context.h:
+       * pdf/ev-poppler.cc:
+       * ps/ps-document.c: (ps_document_document_iface_init):
+       * shell/ev-jobs.c: (ev_job_thumbnail_new), (ev_job_thumbnail_run):
+       * shell/ev-jobs.h:
+       * shell/ev-page-cache.c: (build_height_to_page),
+       (ev_page_cache_new), (ev_page_cache_get_size),
+       (ev_page_cache_get_max_width), (ev_page_cache_get_max_height),
+       (ev_page_cache_get_height_to_page):
+       * shell/ev-page-cache.h:
+       * shell/ev-pixbuf-cache.c: (check_job_size_and_unref),
+       (add_job_if_needed), (ev_pixbuf_cache_add_jobs_if_needed),
+       (ev_pixbuf_cache_set_page_range), (new_selection_pixbuf_needed),
+       (ev_pixbuf_cache_get_selection_pixbuf):
+       * shell/ev-pixbuf-cache.h:
+       * shell/ev-print-job.c: (idle_print_handler):
+       * shell/ev-sidebar-thumbnails.c: (add_range):
+       * shell/ev-view.c: (view_update_range_and_current_page),
+       (get_page_y_offset), (get_page_extents),
+       (ev_view_size_request_continuous_dual_page),
+       (ev_view_size_request_continuous),
+       (ev_view_size_request_dual_page),
+       (ev_view_size_request_single_page), (draw_one_page),
+       (ev_view_set_rotation), (ev_view_rotate_right),
+       (ev_view_rotate_left), (ev_view_zoom_for_size_presentation),
+       (ev_view_zoom_for_size_continuous_and_dual_page),
+       (ev_view_zoom_for_size_continuous),
+       (ev_view_zoom_for_size_dual_page),
+       (ev_view_zoom_for_size_single_page), (compute_new_selection_text),
+       (ev_view_select_all):
+       * thumbnailer/evince-thumbnailer.c: (evince_thumbnail_pngenc_get):
+       * tiff/tiff-document.c: (tiff_document_render_pixbuf),
+       (tiff_document_document_iface_init),
+       (tiff_document_thumbnails_get_thumbnail):
+
+       Use rotation rather than orientation. It's easier and enough
+       for our needs.
+
 2005-07-29  Marco Pesenti Gritti  <mpg@redhat.com>
 
        * shell/ev-page-cache.c: (build_height_to_page),
index 9bf1695e24d31f0ffb4557f7e549388c5c808f17..f537afdb6bccc86a389fddb5123c2cce5e64328f 100644 (file)
@@ -47,7 +47,7 @@ ev_document_thumbnails_get_type (void)
 GdkPixbuf *
 ev_document_thumbnails_get_thumbnail (EvDocumentThumbnails   *document,
                                      gint                    page,
-                                     EvOrientation           orientation,
+                                     int                     rotation,
                                      gint                    size,
                                      gboolean                border)
 {
@@ -57,7 +57,7 @@ ev_document_thumbnails_get_thumbnail (EvDocumentThumbnails   *document,
 
        iface = EV_DOCUMENT_THUMBNAILS_GET_IFACE (document);
 
-       return iface->get_thumbnail (document, page, orientation, size, border);
+       return iface->get_thumbnail (document, page, rotation, size, border);
 }
 
 void
index ea77629b44572bbee2ab3bbdc26dbf23cc1c127f..6e15a327606999c096e090d4dd9674148bab5e35 100644 (file)
@@ -44,7 +44,7 @@ struct _EvDocumentThumbnailsIface
         /* Methods  */
         GdkPixbuf *  (* get_thumbnail)  (EvDocumentThumbnails *document,
                                          gint                  page,
-                                        EvOrientation         orientation,
+                                        gint                  rotation,
                                          gint                  size,
                                         gboolean              border);
         void         (* get_dimensions) (EvDocumentThumbnails *document,
@@ -63,7 +63,7 @@ GType      ev_document_thumbnails_get_type       (void);
 
 GdkPixbuf *ev_document_thumbnails_get_thumbnail  (EvDocumentThumbnails *document,
                                                   gint                  page,
-                                                 EvOrientation         orientation,
+                                                 gint                  rotation,
                                                   gint                  size,
                                                   gboolean              border);
 void       ev_document_thumbnails_get_dimensions (EvDocumentThumbnails *document,
index 2778f7796c872fb58d93c820f770fe046d6f9201..a800866f8b087d14f456c2aa2885462b86bc63d7 100644 (file)
@@ -217,14 +217,6 @@ ev_document_render_pixbuf (EvDocument      *document,
        return retval;
 }
 
-EvOrientation
-ev_document_get_orientation (EvDocument *document)
-{
-       EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document);
-
-       return iface->get_orientation (document);
-}
-
 void
 ev_document_info_free (EvDocumentInfo *info)
 {
index b4668e75551579fa963222d2080003a9bd5f5005..2629a47fd54eebff7429a3a06f882b96cb4c42c4 100644 (file)
@@ -89,7 +89,6 @@ struct _EvDocumentIface
                                              int           page);
        GdkPixbuf      * (* render_pixbuf)   (EvDocument      *document,
                                              EvRenderContext *rc);
-       EvOrientation    (* get_orientation) (EvDocument   *document);
        EvDocumentInfo * (* get_info)        (EvDocument   *document);
 };
 
@@ -121,10 +120,6 @@ GList             *ev_document_get_links       (EvDocument     *document,
                                             int             page);
 GdkPixbuf      *ev_document_render_pixbuf   (EvDocument     *document,
                                             EvRenderContext *rc);
-EvOrientation   ev_document_get_orientation (EvDocument     *document);
-void           ev_document_set_orientation (EvDocument     *document,
-                                            EvOrientation   orientation);
-
 
 gint            ev_rect_cmp                 (EvRectangle    *a,
                                             EvRectangle    *b);
index 2d09d4461f2673eee778452545151b440ac0b7ba..a3969adad32f1ed85279a5e8609dd32a95506e21 100644 (file)
@@ -35,7 +35,7 @@ ev_render_context_class_init (EvRenderContextClass *class)
 
 
 EvRenderContext *
-ev_render_context_new (EvOrientation orientation,
+ev_render_context_new (int           rotation,
                       gint          page,
                       gdouble       scale)
 {
@@ -43,7 +43,7 @@ ev_render_context_new (EvOrientation orientation,
 
        rc = (EvRenderContext *) g_object_new (EV_TYPE_RENDER_CONTEXT, NULL);
 
-       rc->orientation = orientation;
+       rc->rotation = rotation;
        rc->page = page;
        rc->scale = scale;
 
@@ -60,12 +60,12 @@ ev_render_context_set_page (EvRenderContext *rc,
 }
 
 void
-ev_render_context_set_orientation (EvRenderContext *rc,
-                                  EvOrientation    orientation)
+ev_render_context_set_rotation (EvRenderContext *rc,
+                               int              rotation)
 {
        g_return_if_fail (rc != NULL);
 
-       rc->orientation = orientation;
+       rc->rotation = rotation;
 }
 
 void
index 7bd73d60f481cf51bff95cccab307bea08ab53d1..636f02fd9e6185660a47d30b081ef649bac6dc6f 100644 (file)
@@ -32,15 +32,6 @@ typedef struct _EvRenderContextClass EvRenderContextClass;
 #define EV_RENDER_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_RENDER_CONTEXT, EvRenderContext))
 #define EV_IS_RENDER_CONTEXT(object)   (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_RENDER_CONTEXT))
 
-typedef enum
-{
-       EV_ORIENTATION_PORTRAIT,
-       EV_ORIENTATION_LANDSCAPE,
-       EV_ORIENTATION_UPSIDEDOWN,
-       EV_ORIENTATION_SEASCAPE
-} EvOrientation;
-
-
 struct _EvRenderContextClass
 {
        GObjectClass klass;
@@ -49,7 +40,7 @@ struct _EvRenderContextClass
 struct _EvRenderContext
 {
        GObject parent;
-       EvOrientation orientation;
+       int rotation;
        gint page;
        gdouble scale;
 
@@ -59,13 +50,13 @@ struct _EvRenderContext
 
 
 GType            ev_render_context_get_type        (void) G_GNUC_CONST;
-EvRenderContext *ev_render_context_new             (EvOrientation    orientation,
+EvRenderContext *ev_render_context_new             (int              rotation,
                                                    gint             page,
                                                    gdouble          scale);
 void             ev_render_context_set_page        (EvRenderContext *rc,
                                                    gint             page);
-void             ev_render_context_set_orientation (EvRenderContext *rc,
-                                                   EvOrientation    orientation);
+void             ev_render_context_set_rotation    (EvRenderContext *rc,
+                                                   int              rotation);
 void             ev_render_context_set_scale       (EvRenderContext *rc,
                                                    gdouble          scale);
 
index 08b811b3418079d2526b8ef40dc9428dc49c5b8b..07f1028c2be053e6c5c5b8828ea8507a18f29a10 100644 (file)
@@ -204,24 +204,6 @@ pdf_document_save (EvDocument  *document,
        return retval;
 }
 
-static PopplerOrientation
-get_document_orientation (PdfDocument *pdf_document)
-{
-       PopplerOrientation orientation;
-       PopplerPage *page;
-
-       /* Should prolly be smarter here and check more than first page */
-       page = poppler_document_get_page (pdf_document->document, 0);
-       if (page) {
-               orientation = poppler_page_get_orientation (page);
-       } else {
-               orientation = POPPLER_ORIENTATION_PORTRAIT;
-       }
-       g_object_unref (page);
-
-       return orientation;
-}
-
 static gboolean
 pdf_document_load (EvDocument   *document,
                   const char   *uri,
@@ -247,30 +229,28 @@ pdf_document_get_n_pages (EvDocument *document)
        return poppler_document_get_n_pages (PDF_DOCUMENT (document)->document);
 }
 
-/* FIXME This should not be necessary, poppler should rember it */
 static void
-set_page_orientation (PdfDocument *pdf_document, PopplerPage *page, EvOrientation orientation)
+set_page_orientation (PdfDocument *pdf_document, PopplerPage *page, int rotation)
 {
-       PopplerOrientation poppler_orientation;
+       PopplerOrientation orientation;
+       int r = rotation;
 
-       switch (orientation) {
-               case EV_ORIENTATION_PORTRAIT:
-                       poppler_orientation = POPPLER_ORIENTATION_PORTRAIT;
-                       break;
-               case EV_ORIENTATION_LANDSCAPE:
-                       poppler_orientation = POPPLER_ORIENTATION_LANDSCAPE;
-                       break;
-               case EV_ORIENTATION_UPSIDEDOWN:
-                       poppler_orientation = POPPLER_ORIENTATION_UPSIDEDOWN;
-                       break;
-               case EV_ORIENTATION_SEASCAPE:
-                       poppler_orientation = POPPLER_ORIENTATION_SEASCAPE;
-                       break;
-               default:
-                       g_assert_not_reached ();
+       orientation = poppler_page_get_orientation (page);
+
+       while (r > 0) {
+               if (orientation == POPPLER_ORIENTATION_PORTRAIT) {
+                       orientation = POPPLER_ORIENTATION_LANDSCAPE;
+               } else if (orientation == POPPLER_ORIENTATION_LANDSCAPE) {
+                       orientation = POPPLER_ORIENTATION_UPSIDEDOWN;
+               } else if (orientation == POPPLER_ORIENTATION_UPSIDEDOWN) {
+                       orientation = POPPLER_ORIENTATION_SEASCAPE;
+               } else {
+                       orientation = POPPLER_ORIENTATION_PORTRAIT;
+               }
+               r -= 90;
        }
 
-       poppler_page_set_orientation (page, poppler_orientation);
+       poppler_page_set_orientation (page, orientation);
 }
 
 static void
@@ -358,7 +338,7 @@ pdf_document_render_pixbuf (EvDocument   *document,
        pdf_document = PDF_DOCUMENT (document);
        poppler_page = poppler_document_get_page (pdf_document->document,
                                                  rc->page);
-       set_page_orientation (pdf_document, poppler_page, rc->orientation);
+       set_page_orientation (pdf_document, poppler_page, rc->rotation);
 
        poppler_page_get_size (poppler_page, &width_points, &height_points);
        width = (int) ((width_points * rc->scale) + 0.5);
@@ -568,32 +548,6 @@ pdf_document_get_text (EvDocument *document, int page, EvRectangle *rect)
        return text;
 }
 
-static EvOrientation
-pdf_document_get_orientation (EvDocument *document)
-{
-       EvOrientation result;
-       PdfDocument *pdf_document = PDF_DOCUMENT (document);
-
-       switch (get_document_orientation (pdf_document)) {
-       case POPPLER_ORIENTATION_PORTRAIT:
-               result = EV_ORIENTATION_PORTRAIT;
-               break;
-       case POPPLER_ORIENTATION_LANDSCAPE:
-               result = EV_ORIENTATION_LANDSCAPE;
-               break;
-       case POPPLER_ORIENTATION_UPSIDEDOWN:
-               result = EV_ORIENTATION_UPSIDEDOWN;
-               break;
-       case POPPLER_ORIENTATION_SEASCAPE:
-               result = EV_ORIENTATION_SEASCAPE;
-               break;
-       default:
-               g_assert_not_reached ();
-       }
-
-       return result;
-}
-
 static void
 pdf_document_document_iface_init (EvDocumentIface *iface)
 {
@@ -607,7 +561,6 @@ pdf_document_document_iface_init (EvDocumentIface *iface)
        iface->get_text = pdf_document_get_text;
        iface->can_get_text = pdf_document_can_get_text;
        iface->get_info = pdf_document_get_info;
-       iface->get_orientation = pdf_document_get_orientation;
 };
 
 static void
@@ -843,7 +796,7 @@ pdf_document_document_links_iface_init (EvDocumentLinksIface *iface)
 static GdkPixbuf *
 make_thumbnail_for_size (PdfDocument   *pdf_document,
                         gint           page,
-                        EvOrientation  orientation,
+                        int            rotation,
                         gint           size,
                         gboolean       border)
 {
@@ -854,7 +807,7 @@ make_thumbnail_for_size (PdfDocument   *pdf_document,
        gdouble unscaled_width, unscaled_height;
 
        poppler_page = poppler_document_get_page (pdf_document->document, page);
-       set_page_orientation (pdf_document, poppler_page, orientation);
+       set_page_orientation (pdf_document, poppler_page, rotation);
        g_return_val_if_fail (poppler_page != NULL, NULL);
 
        pdf_document_thumbnails_get_dimensions (EV_DOCUMENT_THUMBNAILS (pdf_document), page,
@@ -890,7 +843,7 @@ make_thumbnail_for_size (PdfDocument   *pdf_document,
 static GdkPixbuf *
 pdf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails,
                                       gint                  page,
-                                      EvOrientation         orientation,
+                                      gint                  rotation,
                                       gint                  size,
                                       gboolean              border)
 {
@@ -901,7 +854,7 @@ pdf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails
        pdf_document = PDF_DOCUMENT (document_thumbnails);
 
        poppler_page = poppler_document_get_page (pdf_document->document, page);
-       set_page_orientation (pdf_document, poppler_page, orientation);
+       set_page_orientation (pdf_document, poppler_page, rotation);
        g_return_val_if_fail (poppler_page != NULL, NULL);
 
        pixbuf = poppler_page_get_thumbnail (poppler_page);
@@ -917,7 +870,7 @@ pdf_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails
                }
        } else {
                /* There is no provided thumbnail.  We need to make one. */
-               pixbuf = make_thumbnail_for_size (pdf_document, page, orientation, size, border);
+               pixbuf = make_thumbnail_for_size (pdf_document, page, rotation, size, border);
        }
 
        g_object_unref (poppler_page);
@@ -1188,7 +1141,7 @@ pdf_document_ps_exporter_do_page (EvPSExporter *exporter, EvRenderContext *rc)
        g_return_if_fail (pdf_document->ps_file != NULL);
 
        poppler_page = poppler_document_get_page (pdf_document->document, rc->page);
-       set_page_orientation (pdf_document, poppler_page, rc->orientation);
+       set_page_orientation (pdf_document, poppler_page, rc->rotation);
        poppler_page_render_to_ps (poppler_page, pdf_document->ps_file);
        g_object_unref (poppler_page);
 }
@@ -1226,7 +1179,7 @@ pdf_selection_render_selection (EvSelection      *selection,
        pdf_document = PDF_DOCUMENT (selection);
        poppler_page = poppler_document_get_page (pdf_document->document,
                                                  rc->page);
-       set_page_orientation (pdf_document, poppler_page, rc->orientation);
+       set_page_orientation (pdf_document, poppler_page, rc->rotation);
 
        poppler_page_get_size (poppler_page, &width_points, &height_points);
        width = (int) ((width_points * rc->scale) + 0.5);
@@ -1259,7 +1212,7 @@ pdf_selection_get_selection_region (EvSelection     *selection,
        pdf_document = PDF_DOCUMENT (selection);
        poppler_page = poppler_document_get_page (pdf_document->document,
                                                  rc->page);
-       set_page_orientation (pdf_document, poppler_page, rc->orientation);
+       set_page_orientation (pdf_document, poppler_page, rc->rotation);
 
        retval = poppler_page_get_selection_region (poppler_page, rc->scale, (PopplerRectangle *) points);
        g_object_unref (poppler_page);
@@ -1279,7 +1232,7 @@ pdf_selection_get_selection_map (EvSelection     *selection,
        pdf_document = PDF_DOCUMENT (selection);
        poppler_page = poppler_document_get_page (pdf_document->document,
                                                  rc->page);
-       set_page_orientation (pdf_document, poppler_page, rc->orientation);
+       set_page_orientation (pdf_document, poppler_page, rc->rotation);
 
        points.x1 = 0.0;
        points.y1 = 0.0;
index 28c43745359485eaaf5202c4322942bffeebc748..cfd22d9d0f0f0eeb910a6916b6502937e51da37e 100644 (file)
@@ -1240,35 +1240,6 @@ ps_document_get_info (EvDocument *document)
        return info;
 }
 
-static EvOrientation
-ps_document_get_orientation (EvDocument *document)
-{
-       EvOrientation orientation;
-       PSDocument *ps = PS_DOCUMENT (document);
-
-       g_return_val_if_fail (ps != NULL, EV_ORIENTATION_PORTRAIT);
-
-       switch (ps->orientation) {
-               case GTK_GS_ORIENTATION_PORTRAIT:
-                       orientation = EV_ORIENTATION_PORTRAIT;
-                       break;
-               case GTK_GS_ORIENTATION_LANDSCAPE:
-                       orientation = EV_ORIENTATION_LANDSCAPE;
-                       break;
-               case GTK_GS_ORIENTATION_UPSIDEDOWN:
-                       orientation = EV_ORIENTATION_UPSIDEDOWN;
-                       break;
-               case GTK_GS_ORIENTATION_SEASCAPE:
-                       orientation = EV_ORIENTATION_SEASCAPE;
-                       break;
-               default:
-                       orientation = EV_ORIENTATION_PORTRAIT;
-                       break;
-       }
-
-       return orientation;
-}
-
 static void
 ps_document_document_iface_init (EvDocumentIface *iface)
 {
@@ -1278,7 +1249,6 @@ ps_document_document_iface_init (EvDocumentIface *iface)
        iface->get_n_pages = ps_document_get_n_pages;
        iface->get_page_size = ps_document_get_page_size;
        iface->get_info = ps_document_get_info;
-       iface->get_orientation = ps_document_get_orientation;
 }
 
 static void
index 677b39f046961a8bee2e77e338227cbd526359b3..c250f0ebda4845c9e12d4181c9de74ad92b9ecd1 100644 (file)
@@ -301,7 +301,7 @@ ev_job_render_run (EvJobRender *job)
 EvJob *
 ev_job_thumbnail_new (EvDocument   *document,
                      gint          page,
-                     EvOrientation orientation,
+                     int           rotation,
                      gint          requested_width)
 {
        EvJobThumbnail *job;
@@ -310,7 +310,7 @@ ev_job_thumbnail_new (EvDocument   *document,
 
        EV_JOB (job)->document = g_object_ref (document);
        job->page = page;
-       job->orientation = orientation;
+       job->rotation = rotation;
        job->requested_width = requested_width;
 
        return EV_JOB (job);
@@ -326,7 +326,7 @@ ev_job_thumbnail_run (EvJobThumbnail *job)
        job->thumbnail =
                ev_document_thumbnails_get_thumbnail (EV_DOCUMENT_THUMBNAILS (EV_JOB (job)->document),
                                                      job->page,
-                                                     job->orientation,
+                                                     job->rotation,
                                                      job->requested_width,
                                                      TRUE);
        EV_JOB (job)->finished = TRUE;
index 070fd4d5a768fe555e4c8133ae84a04e7b61b9fe..d7f49c70306e9149a5a5da6ce3d94105c0612c2d 100644 (file)
@@ -135,7 +135,7 @@ struct _EvJobThumbnail
        EvJob parent;
 
        gint page;
-       EvOrientation orientation;
+       gint rotation;
        gint requested_width;
        GdkPixbuf *thumbnail;
 };
@@ -193,7 +193,7 @@ void            ev_job_render_run         (EvJobRender     *thumbnail);
 GType           ev_job_thumbnail_get_type (void);
 EvJob          *ev_job_thumbnail_new      (EvDocument     *document,
                                           gint            page,
-                                          EvOrientation   orientation,
+                                          int             rotation,
                                           gint            requested_width);
 void            ev_job_thumbnail_run      (EvJobThumbnail *thumbnail);
 
index 1b0f8e4604adc130f952c3e5f94b8ef8fed3ba42..d7aa03db8f1d815120e9050c00670c3e2a844866 100644 (file)
@@ -33,7 +33,7 @@ struct _EvPageCache
        double* height_to_page;
        double* dual_height_to_page;
 
-       EvOrientation orientation;
+       int rotation;
 
        EvPageCacheInfo *size_cache;
        EvDocumentInfo *page_info;
@@ -111,8 +111,8 @@ build_height_to_page (EvPageCache *page_cache)
        double uniform_height, page_height, next_page_height;
        double saved_height;
 
-       swap = (page_cache->orientation == EV_ORIENTATION_LANDSCAPE ||
-               page_cache->orientation == EV_ORIENTATION_SEASCAPE);
+       swap = (page_cache->rotation == 90 ||
+               page_cache->rotation == 270);
 
        g_free (page_cache->height_to_page);
        g_free (page_cache->dual_height_to_page);
@@ -130,7 +130,7 @@ build_height_to_page (EvPageCache *page_cache)
                        }
                        page_cache->height_to_page [i] = (i + 1) * uniform_height;
                } else {
-                       if (swap) {
+                       if (!swap) {
                                page_height = page_cache->size_cache [i].height;
                        } else {
                                page_height = page_cache->size_cache [i].width;
@@ -186,7 +186,6 @@ ev_page_cache_new (EvDocument *document)
        /* Assume all pages are the same size until proven otherwise */
        page_cache->uniform = TRUE;
        page_cache->has_labels = FALSE;
-       page_cache->orientation = ev_document_get_orientation (document);
        page_cache->n_pages = ev_document_get_n_pages (document);
        page_cache->page_labels = g_new0 (char *, page_cache->n_pages);
        page_cache->max_width = 0;
@@ -363,7 +362,7 @@ ev_page_cache_get_title (EvPageCache *page_cache)
 void
 ev_page_cache_get_size (EvPageCache  *page_cache,
                        gint          page,
-                       EvOrientation orientation,
+                       gint          rotation,
                        gfloat        scale,
                        gint         *width,
                        gint         *height)
@@ -387,8 +386,7 @@ ev_page_cache_get_size (EvPageCache  *page_cache,
                        *height = info->height;
        }
 
-       if (orientation == EV_ORIENTATION_PORTRAIT ||
-           orientation == EV_ORIENTATION_UPSIDEDOWN) {
+       if (rotation == 0 || rotation == 180) {
                if (width)
                        *width = (int) ((*width) * scale + 0.5);
                if (height)
@@ -403,15 +401,14 @@ ev_page_cache_get_size (EvPageCache  *page_cache,
 
 void
 ev_page_cache_get_max_width (EvPageCache   *page_cache,
-                            EvOrientation  orientation,
+                            gint           rotation,
                             gfloat         scale,
                             gint          *width)
 {
        g_return_if_fail (EV_IS_PAGE_CACHE (page_cache));
 
        if (width) {
-               if (orientation == EV_ORIENTATION_PORTRAIT ||
-                   orientation == EV_ORIENTATION_UPSIDEDOWN) {
+               if (rotation == 0 || rotation == 180) {
                        *width = page_cache->max_width * scale;
                } else {
                        *width = page_cache->max_height * scale;
@@ -421,15 +418,14 @@ ev_page_cache_get_max_width (EvPageCache   *page_cache,
 
 void
 ev_page_cache_get_max_height (EvPageCache   *page_cache,
-                             EvOrientation  orientation,
+                             gint           rotation,
                              gfloat         scale,
                              gint          *height)
 {
        g_return_if_fail (EV_IS_PAGE_CACHE (page_cache));
 
        if (height) {
-               if (orientation == EV_ORIENTATION_PORTRAIT ||
-                   orientation == EV_ORIENTATION_UPSIDEDOWN) {
+               if (rotation == 0 || rotation == 180) {
                        *height = page_cache->max_height * scale;
                } else {
                        *height = page_cache->max_width * scale;
@@ -440,7 +436,7 @@ ev_page_cache_get_max_height (EvPageCache   *page_cache,
 void    
 ev_page_cache_get_height_to_page (EvPageCache   *page_cache,
                                  gint           page,
-                                 EvOrientation  orientation,
+                                 gint           rotation,
                                  gfloat         scale,
                                  gint          *height,
                                  gint          *dual_height)
@@ -450,8 +446,8 @@ ev_page_cache_get_height_to_page (EvPageCache   *page_cache,
        
        g_return_if_fail (EV_IS_PAGE_CACHE (page_cache));
 
-       if (page_cache->orientation != orientation) {
-               page_cache->orientation = orientation;
+       if (page_cache->rotation != rotation) {
+               page_cache->rotation = rotation;
                build_height_to_page (page_cache);
        }
 
index 3360d821c5626c496f1fae3428834d5434529e76..ae0c1796b36e9e4481a816ced71846093bbf80e2 100644 (file)
@@ -36,21 +36,21 @@ gint           ev_page_cache_get_n_pages         (EvPageCache   *page_cache);
 const char    *ev_page_cache_get_title           (EvPageCache   *page_cache);
 void           ev_page_cache_get_size            (EvPageCache   *page_cache,
                                                  gint           page,
-                                                 EvOrientation  orientation,
+                                                 gint           rotation,
                                                  gfloat         scale,
                                                  gint          *width,
                                                  gint          *height);
 void           ev_page_cache_get_max_width       (EvPageCache   *page_cache,
-                                                 EvOrientation  orientation,
+                                                 gint           rotation,
                                                  gfloat         scale,
                                                  gint          *width);
 void           ev_page_cache_get_max_height      (EvPageCache   *page_cache,
-                                                 EvOrientation  orientation,
+                                                 gint           rotation,
                                                  gfloat         scale,
                                                  gint          *height);
 void           ev_page_cache_get_height_to_page  (EvPageCache   *page_cache,
                                                  gint           page,
-                                                 EvOrientation  orientation,
+                                                 gint           rotation,
                                                  gfloat         scale,
                                                  gint          *height,
                                                  gint          *dual_height);
index 00d71d434e6b2c326c0c5471dc38f0e34f0d9545..7ada246a656a799279b6af4780145174065d10a8 100644 (file)
@@ -255,7 +255,7 @@ check_job_size_and_unref (CacheJobInfo *job_info,
 
        ev_page_cache_get_size (page_cache,
                                EV_JOB_RENDER (job_info->job)->rc->page,
-                               EV_JOB_RENDER (job_info->job)->rc->orientation,
+                               EV_JOB_RENDER (job_info->job)->rc->rotation,
                                scale,
                                &width, &height);
                                
@@ -479,7 +479,7 @@ add_job_if_needed (EvPixbufCache *pixbuf_cache,
                   CacheJobInfo  *job_info,
                   EvPageCache   *page_cache,
                   gint           page,
-                  EvOrientation  orientation,
+                  gint           rotation,
                   gfloat         scale,
                   EvJobPriority  priority)
 {
@@ -491,7 +491,7 @@ add_job_if_needed (EvPixbufCache *pixbuf_cache,
        if (job_info->job)
                return;
 
-       ev_page_cache_get_size (page_cache, page, orientation,
+       ev_page_cache_get_size (page_cache, page, rotation,
                                scale, &width, &height);
 
        if (job_info->pixbuf &&
@@ -501,11 +501,11 @@ add_job_if_needed (EvPixbufCache *pixbuf_cache,
 
        /* make a new job now */
        if (job_info->rc == NULL) {
-               job_info->rc = ev_render_context_new (orientation, page, scale);
+               job_info->rc = ev_render_context_new (rotation, page, scale);
        } else {
                ev_render_context_set_page (job_info->rc, page);
                ev_render_context_set_scale (job_info->rc, scale);
-               ev_render_context_set_orientation (job_info->rc, orientation);
+               ev_render_context_set_rotation (job_info->rc, rotation);
        }
 
        /* Figure out what else we need for this job */
@@ -531,7 +531,7 @@ add_job_if_needed (EvPixbufCache *pixbuf_cache,
 
 static void
 ev_pixbuf_cache_add_jobs_if_needed (EvPixbufCache *pixbuf_cache,
-                                   EvOrientation  orientation,
+                                   gint           rotation,
                                    gfloat         scale)
 {
        EvPageCache *page_cache;
@@ -546,7 +546,7 @@ ev_pixbuf_cache_add_jobs_if_needed (EvPixbufCache *pixbuf_cache,
                page = pixbuf_cache->start_page + i;
 
                add_job_if_needed (pixbuf_cache, job_info,
-                                  page_cache, page, orientation, scale,
+                                  page_cache, page, rotation, scale,
                                   EV_JOB_PRIORITY_HIGH);
        }
 
@@ -555,7 +555,7 @@ ev_pixbuf_cache_add_jobs_if_needed (EvPixbufCache *pixbuf_cache,
                page = pixbuf_cache->start_page - pixbuf_cache->preload_cache_size + i;
 
                add_job_if_needed (pixbuf_cache, job_info,
-                                  page_cache, page, orientation, scale,
+                                  page_cache, page, rotation, scale,
                                   EV_JOB_PRIORITY_LOW);
        }
 
@@ -564,18 +564,18 @@ ev_pixbuf_cache_add_jobs_if_needed (EvPixbufCache *pixbuf_cache,
                page = pixbuf_cache->end_page + 1 + i;
 
                add_job_if_needed (pixbuf_cache, job_info,
-                                  page_cache, page, orientation, scale,
+                                  page_cache, page, rotation, scale,
                                   EV_JOB_PRIORITY_LOW);
        }
 
 }
 
 void
-ev_pixbuf_cache_set_page_range (EvPixbufCache *pixbuf_cache,
-                               gint           start_page,
-                               gint           end_page,
-                               EvOrientation  orientation,
-                               gfloat         scale,
+ev_pixbuf_cache_set_page_range (EvPixbufCache  *pixbuf_cache,
+                               gint            start_page,
+                               gint            end_page,
+                               gint            rotation,
+                               gfloat          scale,
                                GList          *selection_list)
 {
        EvPageCache *page_cache;
@@ -601,7 +601,7 @@ ev_pixbuf_cache_set_page_range (EvPixbufCache *pixbuf_cache,
 
        /* Finally, we add the new jobs for all the sizes that don't have a
         * pixbuf */
-       ev_pixbuf_cache_add_jobs_if_needed (pixbuf_cache, orientation, scale);
+       ev_pixbuf_cache_add_jobs_if_needed (pixbuf_cache, rotation, scale);
 }
 
 GdkPixbuf *
@@ -654,7 +654,7 @@ new_selection_pixbuf_needed (EvPixbufCache *pixbuf_cache,
 
        if (job_info->selection) {
                page_cache = ev_page_cache_get (pixbuf_cache->document);
-               ev_page_cache_get_size (page_cache, page, job_info->rc->orientation,
+               ev_page_cache_get_size (page_cache, page, job_info->rc->rotation,
                                        scale, &width, &height);
                
                if (width != gdk_pixbuf_get_width (job_info->selection) ||
@@ -737,9 +737,7 @@ ev_pixbuf_cache_get_selection_pixbuf (EvPixbufCache *pixbuf_cache,
        if (ev_rect_cmp (&(job_info->new_points), &(job_info->selection_points))) {
                EvRenderContext *rc;
 
-               rc = ev_render_context_new (EV_ORIENTATION_PORTRAIT,
-                                           page,
-                                           scale);
+               rc = ev_render_context_new (0, page, scale);
 
                /* we need to get a new selection pixbuf */
                ev_document_doc_mutex_lock ();
index 7af72436d8c1ec45442445a3e513cb0940f533b2..0021f62d42349afd1a430e4c71d13476fd82b3bc 100644 (file)
@@ -52,7 +52,7 @@ EvPixbufCache *ev_pixbuf_cache_new                  (EvDocument    *document);
 void           ev_pixbuf_cache_set_page_range       (EvPixbufCache *pixbuf_cache,
                                                     gint           start_page,
                                                     gint           end_page,
-                                                    EvOrientation  orientation,
+                                                    gint           rotation,
                                                     gfloat         scale,
                                                     GList          *selection_list);
 GdkPixbuf     *ev_pixbuf_cache_get_pixbuf           (EvPixbufCache *pixbuf_cache,
index b9aded8b539f7f3e01dac17cc612724a7db1fc3f..955e4bab183b246f5f9b2bd9919f22be07631a3b 100644 (file)
@@ -273,8 +273,7 @@ idle_print_handler (EvPrintJob *job)
 #if 0
                g_printerr ("Printing page %d\n", job->next_page);
 #endif
-               rc = ev_render_context_new (EV_ORIENTATION_PORTRAIT,
-                                           job->next_page, 1.0);
+               rc = ev_render_context_new (0, job->next_page, 1.0);
 
                ev_document_doc_mutex_lock ();
                ev_ps_exporter_do_page (EV_PS_EXPORTER (job->document), rc);
index f992d87e1873f852b864ba46d66d66983fcf521e..46dc9cef2a06820dddda1049105913f487766a44 100644 (file)
@@ -229,8 +229,7 @@ add_range (EvSidebarThumbnails *sidebar_thumbnails,
                                    -1);
 
                if (job == NULL && !thumbnail_set) {
-                       job = (EvJobThumbnail *)ev_job_thumbnail_new (priv->document, page, THUMBNAIL_WIDTH,
-                                                                     EV_ORIENTATION_PORTRAIT);
+                       job = (EvJobThumbnail *)ev_job_thumbnail_new (priv->document, page, THUMBNAIL_WIDTH, 0);
                        ev_job_queue_add_job (EV_JOB (job), EV_JOB_PRIORITY_HIGH);
                        g_object_set_data_full (G_OBJECT (job), "tree_iter",
                                                gtk_tree_iter_copy (&iter),
index 09539990f65a072191bc2455a5b780de1dddb63a..e4524eba207448c866be3dc506757325b0113711 100644 (file)
@@ -149,7 +149,7 @@ struct _EvView {
        int find_result;
        int spacing;
 
-       EvOrientation orientation;
+       int rotation;
        double scale;
 
        gboolean continuous;
@@ -532,7 +532,7 @@ view_update_range_and_current_page (EvView *view)
        ev_pixbuf_cache_set_page_range (view->pixbuf_cache,
                                        view->start_page,
                                        view->end_page,
-                                       view->orientation,
+                                       view->rotation,
                                        view->scale,
                                        view->selection_info.selections);
 }
@@ -757,17 +757,17 @@ get_page_y_offset (EvView *view, int page, double zoom, int *y_offset)
 
        g_return_if_fail (y_offset != NULL);
 
-       ev_page_cache_get_max_width (view->page_cache, view->orientation, zoom, &max_width);
+       ev_page_cache_get_max_width (view->page_cache, view->rotation, zoom, &max_width);
 
        compute_border (view, max_width, max_width, &border);
 
        if (view->dual_page) {
                ev_page_cache_get_height_to_page (view->page_cache, page,
-                                                 view->orientation, zoom, NULL, &offset);
+                                                 view->rotation, zoom, NULL, &offset);
                offset += (page / 2 + 1) * view->spacing + (page / 2) * (border.top + border.bottom);
        } else {
                ev_page_cache_get_height_to_page (view->page_cache, page,
-                                                 view->orientation, zoom, &offset, NULL);
+                                                 view->rotation, zoom, &offset, NULL);
                offset += (page + 1) * view->spacing + page * (border.top + border.bottom);
        }
 
@@ -788,7 +788,7 @@ get_page_extents (EvView       *view,
 
        /* Get the size of the page */
        ev_page_cache_get_size (view->page_cache, page,
-                               view->orientation,
+                               view->rotation,
                                view->scale,
                                &width, &height);
        compute_border (view, width, height, border);
@@ -803,7 +803,7 @@ get_page_extents (EvView       *view,
                gint x, y;
 
                ev_page_cache_get_max_width (view->page_cache, view->scale,
-                                            view->orientation, &max_width);
+                                            view->rotation, &max_width);
                max_width = max_width + border->left + border->right;
                /* Get the location of the bounding box */
                if (view->dual_page) {
@@ -835,7 +835,7 @@ get_page_extents (EvView       *view,
                        if (other_page < ev_page_cache_get_n_pages (view->page_cache)) {
                                ev_page_cache_get_size (view->page_cache,
                                                        other_page,
-                                                       view->orientation,
+                                                       view->rotation,
                                                        view->scale,
                                                        &width_2, &height_2);
                                if (width_2 > width)
@@ -1067,7 +1067,7 @@ ev_view_size_request_continuous_dual_page (EvView         *view,
        gint n_pages;
        GtkBorder border;
 
-       ev_page_cache_get_max_width (view->page_cache, view->orientation,
+       ev_page_cache_get_max_width (view->page_cache, view->rotation,
                                     view->scale, &max_width);
        compute_border (view, max_width, max_width, &border);
 
@@ -1095,7 +1095,7 @@ ev_view_size_request_continuous (EvView         *view,
        GtkBorder border;
 
 
-       ev_page_cache_get_max_width (view->page_cache, view->orientation,
+       ev_page_cache_get_max_width (view->page_cache, view->rotation,
                                     view->scale, &max_width);
        n_pages = ev_page_cache_get_n_pages (view->page_cache);
        compute_border (view, max_width, max_width, &border);
@@ -1123,14 +1123,14 @@ ev_view_size_request_dual_page (EvView         *view,
        /* Find the largest of the two. */
        ev_page_cache_get_size (view->page_cache,
                                view->current_page,
-                               view->orientation,
+                               view->rotation,
                                view->scale,
                                &width, &height);
        if (view->current_page + 1 < ev_page_cache_get_n_pages (view->page_cache)) {
                gint width_2, height_2;
                ev_page_cache_get_size (view->page_cache,
                                        view->current_page + 1,
-                                       view->orientation,
+                                       view->rotation,
                                        view->scale,
                                        &width_2, &height_2);
                if (width_2 > width) {
@@ -1162,7 +1162,7 @@ ev_view_size_request_single_page (EvView         *view,
 
        ev_page_cache_get_size (view->page_cache,
                                view->current_page,
-                               view->orientation,
+                               view->rotation,
                                view->scale,
                                &width, &height);
        compute_border (view, width, height, &border);
@@ -1615,7 +1615,7 @@ draw_one_page (EvView          *view,
 
        selection = find_selection_for_page (view, page);
        ev_page_cache_get_size (view->page_cache,
-                               page, view->orientation,
+                               page, view->rotation,
                                view->scale,
                                &width, &height);
        /* Render the document itself */
@@ -2299,10 +2299,9 @@ ev_view_zoom_out (EvView *view)
 }
 
 static void
-ev_view_set_orientation (EvView         *view,
-                        EvOrientation   orientation)
+ev_view_set_rotation (EvView *view, int rotation)
 {
-       view->orientation = orientation;
+       view->rotation = rotation;
 
        gtk_widget_queue_resize (GTK_WIDGET (view));
 }
@@ -2310,37 +2309,13 @@ ev_view_set_orientation (EvView         *view,
 void
 ev_view_rotate_right (EvView *view)
 {
-       EvOrientation orientation;
-
-       if (view->orientation == EV_ORIENTATION_PORTRAIT) {
-               orientation = EV_ORIENTATION_LANDSCAPE;
-       } else if (view->orientation == EV_ORIENTATION_LANDSCAPE) {
-               orientation = EV_ORIENTATION_UPSIDEDOWN;
-       } else if (view->orientation == EV_ORIENTATION_UPSIDEDOWN) {
-               orientation = EV_ORIENTATION_SEASCAPE;
-       } else {
-               orientation = EV_ORIENTATION_PORTRAIT;
-       }
-
-       ev_view_set_orientation (view, orientation);
+       ev_view_set_rotation (view, view->rotation + 90);
 }
 
 void
 ev_view_rotate_left (EvView *view)
 {
-       EvOrientation orientation;
-
-       if (view->orientation == EV_ORIENTATION_PORTRAIT) {
-               orientation = EV_ORIENTATION_SEASCAPE;
-       } else if (view->orientation == EV_ORIENTATION_SEASCAPE) {
-               orientation = EV_ORIENTATION_UPSIDEDOWN;
-       } else if (view->orientation == EV_ORIENTATION_UPSIDEDOWN) {
-               orientation = EV_ORIENTATION_LANDSCAPE;
-       } else {
-               orientation = EV_ORIENTATION_PORTRAIT;
-       }
-
-       ev_view_set_orientation (view, orientation);
+       ev_view_set_rotation (view, view->rotation - 90);
 }
 
 static double
@@ -2393,7 +2368,7 @@ ev_view_zoom_for_size_presentation (EvView *view,
 
        ev_page_cache_get_size (view->page_cache,
                                view->current_page,
-                               view->orientation,
+                               view->rotation,
                                1.0,
                                &doc_width,
                                &doc_height);
@@ -2413,11 +2388,11 @@ ev_view_zoom_for_size_continuous_and_dual_page (EvView *view,
        gdouble scale;
 
        ev_page_cache_get_max_width (view->page_cache,
-                                    view->orientation,
+                                    view->rotation,
                                     1.0,
                                     &doc_width);
        ev_page_cache_get_max_height (view->page_cache,
-                                     view->orientation,
+                                     view->rotation,
                                      1.0,
                                      &doc_height);
        compute_border (view, doc_width, doc_height, &border);
@@ -2451,11 +2426,11 @@ ev_view_zoom_for_size_continuous (EvView *view,
        gdouble scale;
 
        ev_page_cache_get_max_width (view->page_cache,
-                                    view->orientation,
+                                    view->rotation,
                                     1.0,
                                     &doc_width);
        ev_page_cache_get_max_height (view->page_cache,
-                                     view->orientation,
+                                     view->rotation,
                                      1.0,
                                      &doc_height);
        compute_border (view, doc_width, doc_height, &border);
@@ -2493,7 +2468,7 @@ ev_view_zoom_for_size_dual_page (EvView *view,
        /* Find the largest of the two. */
        ev_page_cache_get_size (view->page_cache,
                                view->current_page,
-                               view->orientation,
+                               view->rotation,
                                1.0,
                                &doc_width, &doc_height);
 
@@ -2501,7 +2476,7 @@ ev_view_zoom_for_size_dual_page (EvView *view,
                gint width_2, height_2;
                ev_page_cache_get_size (view->page_cache,
                                        other_page,
-                                       view->orientation,
+                                       view->rotation,
                                        1.0,
                                        &width_2, &height_2);
                if (width_2 > doc_width)
@@ -2538,7 +2513,7 @@ ev_view_zoom_for_size_single_page (EvView *view,
 
        ev_page_cache_get_size (view->page_cache,
                                view->current_page,
-                               view->orientation,
+                               view->rotation,
                                1.0,
                                &doc_width,
                                &doc_height);
@@ -2883,7 +2858,7 @@ compute_new_selection_text (EvView   *view,
                GdkPoint *point;
 
                ev_page_cache_get_size (view->page_cache, i,
-                                       view->orientation,
+                                       view->rotation,
                                        1.0, &width, &height);
 
                selection = g_new0 (EvViewSelection, 1);
@@ -2981,7 +2956,7 @@ ev_view_select_all (EvView *view)
                EvViewSelection *selection;
 
                ev_page_cache_get_size (view->page_cache,
-                                       view->orientation,
+                                       view->rotation,
                                        i, 1.0, &width, &height);
 
                selection = g_new0 (EvViewSelection, 1);
index aba885112d1e3a798cc144f2ec88c409fc8dcdbc..d30ab18ea711dfcd908b73995f198f4053a32fd9 100644 (file)
@@ -176,30 +176,6 @@ tiff_document_get_page_size (EvDocument   *document,
   pop_handlers ();
 }
 
-static EvOrientation
-tiff_document_get_orientation (EvDocument *document)
-{
-       return EV_ORIENTATION_PORTRAIT;
-}
-
-static GdkPixbuf *
-rotate_pixbuf (EvDocument *document, EvOrientation orientation, GdkPixbuf *pixbuf)
-{
-       TiffDocument *tiff_document = TIFF_DOCUMENT (document);
-
-       switch (orientation)
-       {
-               case EV_ORIENTATION_LANDSCAPE:
-                       return gdk_pixbuf_rotate_simple (pixbuf, 90);
-               case EV_ORIENTATION_UPSIDEDOWN:
-                       return gdk_pixbuf_rotate_simple (pixbuf, 180);
-               case EV_ORIENTATION_SEASCAPE:
-                       return gdk_pixbuf_rotate_simple (pixbuf, 270);
-               default:
-                       return g_object_ref (pixbuf);
-       }
-}
-
 static GdkPixbuf *
 tiff_document_render_pixbuf (EvDocument      *document,
                             EvRenderContext *rc)
@@ -281,7 +257,7 @@ tiff_document_render_pixbuf (EvDocument      *document,
                                           GDK_INTERP_BILINEAR);
   g_object_unref (pixbuf);
 
-  rotated_pixbuf = rotate_pixbuf (document, rc->orientation, scaled_pixbuf);
+  rotated_pixbuf = gdk_pixbuf_rotate_simple (scaled_pixbuf, rc->rotation);
   g_object_unref (scaled_pixbuf);
 
   return rotated_pixbuf;
@@ -332,13 +308,12 @@ tiff_document_document_iface_init (EvDocumentIface *iface)
        iface->get_page_size = tiff_document_get_page_size;
        iface->render_pixbuf = tiff_document_render_pixbuf;
        iface->get_info = tiff_document_get_info;
-       iface->get_orientation = tiff_document_get_orientation;
 }
 
 static GdkPixbuf *
 tiff_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document,
                                        gint                  page,
-                                       EvOrientation         orientation,
+                                       gint                  rotation,
                                        gint                  size,
                                        gboolean              border)
 {
@@ -350,7 +325,7 @@ tiff_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document,
                               page,
                               &w, &h);
 
-  rc = ev_render_context_new (EV_ORIENTATION_PORTRAIT, page, size/w);
+  rc = ev_render_context_new (rotation, page, size/w);
   pixbuf = tiff_document_render_pixbuf (EV_DOCUMENT (document), rc);
   g_object_unref (G_OBJECT (rc));