Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ps
diff options
context:
space:
mode:
Diffstat (limited to 'ps')
-rw-r--r--ps/gstypes.h6
-rw-r--r--ps/ps-document.c32
2 files changed, 32 insertions, 6 deletions
diff --git a/ps/gstypes.h b/ps/gstypes.h
index 29439dc..f1f5cb2 100644
--- a/ps/gstypes.h
+++ b/ps/gstypes.h
@@ -38,12 +38,6 @@ typedef enum {
GTK_GS_ORIENTATION_LANDSCAPE = 1
} GtkGSOrientation;
-typedef enum {
- GTK_GS_ZOOM_ABSOLUTE = 0,
- GTK_GS_ZOOM_FIT_WIDTH = 1,
- GTK_GS_ZOOM_FIT_PAGE = 2
-} GtkGSZoomMode;
-
struct _GtkGSPaperSize {
gchar *name;
gint width, height;
diff --git a/ps/ps-document.c b/ps/ps-document.c
index 31bb082..83fa3d9 100644
--- a/ps/ps-document.c
+++ b/ps/ps-document.c
@@ -137,6 +137,8 @@ ps_document_init (PSDocument *gs)
gs->ps_export_pagelist = NULL;
gs->ps_export_filename = NULL;
+
+ gs->orientation = GTK_GS_ORIENTATION_NONE;
}
static void
@@ -441,6 +443,9 @@ get_page_orientation (PSDocument *gs, int page)
if (orientation == GTK_GS_ORIENTATION_NONE) {
orientation = GTK_GS_ORIENTATION_PORTRAIT;
}
+ if (gs->orientation != GTK_GS_ORIENTATION_NONE) {
+ orientation = gs->orientation;
+ }
return orientation;
}
@@ -1237,6 +1242,32 @@ ps_document_get_info (EvDocument *document)
}
static void
+ps_document_set_orientation (EvDocument *document, EvOrientation orientation)
+{
+ PSDocument *ps = PS_DOCUMENT (document);
+
+ g_return_if_fail (ps != NULL);
+
+ switch (orientation) {
+ case EV_ORIENTATION_DOCUMENT:
+ ps->orientation = GTK_GS_ORIENTATION_NONE;
+ break;
+ case EV_ORIENTATION_PORTRAIT:
+ ps->orientation = GTK_GS_ORIENTATION_PORTRAIT;
+ break;
+ case EV_ORIENTATION_LANDSCAPE:
+ ps->orientation = GTK_GS_ORIENTATION_LANDSCAPE;
+ break;
+ case EV_ORIENTATION_UPSIDEDOWN:
+ ps->orientation = GTK_GS_ORIENTATION_UPSIDEDOWN;
+ break;
+ case EV_ORIENTATION_SEASCAPE:
+ ps->orientation = GTK_GS_ORIENTATION_SEASCAPE;
+ break;
+ }
+}
+
+static void
ps_document_document_iface_init (EvDocumentIface *iface)
{
iface->load = ps_document_load;
@@ -1245,6 +1276,7 @@ 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->set_orientation = ps_document_set_orientation;
}
static void