]> www.fi.muni.cz Git - evince.git/commitdiff
Implement orientation here too
authorMarco Pesenti Gritti <mpg@redhat.com>
Tue, 14 Jun 2005 21:28:47 +0000 (21:28 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Tue, 14 Jun 2005 21:28:47 +0000 (21:28 +0000)
2005-06-14  Marco Pesenti Gritti <mpg@redhat.com>

        * 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
data/evince-properties.glade
ps/gstypes.h
ps/ps-document.c
shell/ev-properties.c

index 4b20650f2f11b602d28b0266a54ea12726d7b754..d7fdf661edf28e2213ff8d2472d67b4f15377731 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-06-14  Marco Pesenti Gritti <mpg@redhat.com>
+
+       * 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 <mpg@redhat.com>
 
        * 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),
index 837ecd5a7e45b59fb2e62034ff0779a3dcd2f899..f5192963797a486ee4e648334ba52fd6907f43b7 100644 (file)
          </child>
 
          <child>
-           <widget class="GtkVBox" id="vbox1">
+           <widget class="GtkVBox" id="fonts_page">
              <property name="border_width">12</property>
              <property name="visible">True</property>
              <property name="homogeneous">False</property>
index 29439dcc57f82323a5baf16099cc6076afdc87d2..f1f5cb267cd3e25b98eb14c6e8e62c96e8c61832 100644 (file)
@@ -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;
index 31bb082d622e5b29485b7a2eba7e964f257f7688..83fa3d9fe93573659b558fadd6d709b87006a6c1 100644 (file)
@@ -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
index e8eca8f48d5539e610afe52a295073ce16e256e0..295194f47888c5dc295c3834fb8ffd985bf78160 100644 (file)
@@ -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); 
 }