diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2005-06-16 16:40:40 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2005-06-16 16:40:40 (GMT) |
commit | e9ffd7b5401b32979ea83bc56da4592e80f8ce3e (patch) | |
tree | 97318da1b21a7b6a979e3d40eceec207f30f7f45 /ps | |
parent | 4f1722b0523879cd73ee936d483a735e163a6b54 (diff) |
Add a get_orientation api. Improve set_orientation.
2005-06-16 Marco Pesenti Gritti <mpg@redhat.com>
* backend/ev-document.c: (ev_document_get_orientation):
* backend/ev-document.h:
* pdf/ev-poppler.cc:
* ps/ps-document.c: (ps_document_get_orientation),
(ps_document_set_orientation), (ps_document_document_iface_init):
Add a get_orientation api. Improve set_orientation.
* data/evince-ui.xml:
* shell/ev-view.c: (ev_view_set_orientation),
(ev_view_rotate_right), (ev_view_rotate_left):
* shell/ev-view.h:
* shell/ev-window.c: (ev_window_cmd_edit_rotate_left),
(ev_window_cmd_edit_rotate_right):
Better ui for changing document orientation
Diffstat (limited to 'ps')
-rw-r--r-- | ps/ps-document.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/ps/ps-document.c b/ps/ps-document.c index 83fa3d9..642f5c8 100644 --- a/ps/ps-document.c +++ b/ps/ps-document.c @@ -1241,6 +1241,35 @@ 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_set_orientation (EvDocument *document, EvOrientation orientation) { @@ -1249,9 +1278,6 @@ ps_document_set_orientation (EvDocument *document, EvOrientation orientation) 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; @@ -1277,6 +1303,7 @@ ps_document_document_iface_init (EvDocumentIface *iface) iface->get_page_size = ps_document_get_page_size; iface->get_info = ps_document_get_info; iface->set_orientation = ps_document_set_orientation; + iface->get_orientation = ps_document_get_orientation; } static void |