From 34af9d3d79512725f33a28299f92f39997290181 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 14 Jun 2005 21:28:47 +0000 Subject: [PATCH] Implement orientation here too 2005-06-14 Marco Pesenti Gritti * ps/gstypes.h: * ps/ps-document.c: (ps_document_init), (get_page_orientation), (ps_document_set_orientation), (ps_document_document_iface_init): * ps/ps-document.h: Implement orientation here too * shell/ev-properties.c: (ev_properties_new): * data/evince-properties.glade: Hide the fonts page for backends that doesnt support it. --- ChangeLog | 18 +++++++++++++++++- data/evince-properties.glade | 2 +- ps/gstypes.h | 6 ------ ps/ps-document.c | 32 ++++++++++++++++++++++++++++++++ shell/ev-properties.c | 6 +++++- 5 files changed, 55 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4b20650f..d7fdf661 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2005-06-14 Marco Pesenti Gritti + + * ps/gstypes.h: + * ps/ps-document.c: (ps_document_init), (get_page_orientation), + (ps_document_set_orientation), (ps_document_document_iface_init): + * ps/ps-document.h: + + Implement orientation here too + + * shell/ev-properties.c: (ev_properties_new): + * data/evince-properties.glade: + + Hide the fonts page for backends that doesnt + support it. + 2005-06-14 Marco Pesenti Gritti * backend/ev-document.c: (ev_document_set_orientation): @@ -5,7 +20,8 @@ * pdf/ev-poppler.cc: Add orientation api. Currently poppler api is not optimal, - we need to set orientation every time we _get a page + we need to set orientation every time we _get a page. + I will try to fix that at some point. * data/evince-ui.xml: * shell/ev-window.c: (ev_window_cmd_edit_landscape), diff --git a/data/evince-properties.glade b/data/evince-properties.glade index 837ecd5a..f5192963 100644 --- a/data/evince-properties.glade +++ b/data/evince-properties.glade @@ -679,7 +679,7 @@ - + 12 True False diff --git a/ps/gstypes.h b/ps/gstypes.h index 29439dcc..f1f5cb26 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 31bb082d..83fa3d9f 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; } @@ -1236,6 +1241,32 @@ ps_document_get_info (EvDocument *document) return info; } +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) { @@ -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 diff --git a/shell/ev-properties.c b/shell/ev-properties.c index e8eca8f4..295194f4 100644 --- a/shell/ev-properties.c +++ b/shell/ev-properties.c @@ -245,7 +245,11 @@ ev_properties_new (EvDocument *document, const EvDocumentInfo *info) set_property (xml, SECURITY_PROPERTY, info->security); } - setup_fonts_view (xml, document); + if (EV_IS_DOCUMENT_FONTS (document)) { + setup_fonts_view (xml, document); + } else { + gtk_widget_hide (glade_xml_get_widget (xml, "fonts_page")); + } return GTK_DIALOG (dialog); } -- 2.43.5