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 /shell/ev-view.c | |
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 'shell/ev-view.c')
-rw-r--r-- | shell/ev-view.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c index 6ae9ac6..c366b04 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -2145,7 +2145,7 @@ ev_view_zoom_out (EvView *view) ev_view_set_zoom (view, ZOOM_OUT_FACTOR, TRUE); } -void +static void ev_view_set_orientation (EvView *view, EvOrientation orientation) { @@ -2157,6 +2157,42 @@ ev_view_set_orientation (EvView *view, gtk_widget_queue_resize (GTK_WIDGET (view)); } +void +ev_view_rotate_right (EvView *view) +{ + EvOrientation orientation, new_orientation; + + orientation = ev_document_get_orientation (view->document); + if (orientation == EV_ORIENTATION_PORTRAIT) { + new_orientation = EV_ORIENTATION_LANDSCAPE; + } else if (orientation == EV_ORIENTATION_LANDSCAPE) { + new_orientation = EV_ORIENTATION_UPSIDEDOWN; + } else if (orientation == EV_ORIENTATION_UPSIDEDOWN) { + new_orientation = EV_ORIENTATION_SEASCAPE; + } else { + new_orientation = EV_ORIENTATION_PORTRAIT; + } + ev_view_set_orientation (view, new_orientation); +} + +void +ev_view_rotate_left (EvView *view) +{ + EvOrientation orientation, new_orientation; + + orientation = ev_document_get_orientation (view->document); + if (orientation == EV_ORIENTATION_PORTRAIT) { + new_orientation = EV_ORIENTATION_SEASCAPE; + } else if (orientation == EV_ORIENTATION_SEASCAPE) { + new_orientation = EV_ORIENTATION_UPSIDEDOWN; + } else if (orientation == EV_ORIENTATION_UPSIDEDOWN) { + new_orientation = EV_ORIENTATION_LANDSCAPE; + } else { + new_orientation = EV_ORIENTATION_PORTRAIT; + } + ev_view_set_orientation (view, new_orientation); +} + static double zoom_for_size_fit_width (int doc_width, int doc_height, |