Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ev-view.c')
-rw-r--r--shell/ev-view.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c
index cca3947..796aadd 100644
--- a/shell/ev-view.c
+++ b/shell/ev-view.c
@@ -77,7 +77,7 @@ typedef enum {
#define ZOOM_OUT_FACTOR (1.0/ZOOM_IN_FACTOR)
#define MIN_SCALE 0.05409
-#define MAX_SCALE 18.4884
+#define MAX_SCALE 6.0
struct _EvView {
GtkWidget parent_instance;
@@ -1597,6 +1597,26 @@ ev_view_zoom (EvView *view,
gtk_widget_queue_resize (GTK_WIDGET (view));
}
+gboolean
+ev_view_can_zoom_in (EvView *view)
+{
+ if (view->width != -1 || view->height != -1) {
+ return TRUE;
+ }
+
+ return view->scale * ZOOM_IN_FACTOR <= MAX_SCALE;
+}
+
+gboolean
+ev_view_can_zoom_out (EvView *view)
+{
+ if (view->width != -1 || view->height != -1) {
+ return TRUE;
+ }
+
+ return view->scale * ZOOM_OUT_FACTOR >= MIN_SCALE;
+}
+
void
ev_view_zoom_in (EvView *view)
{
@@ -1610,6 +1630,12 @@ ev_view_zoom_out (EvView *view)
}
void
+ev_view_zoom_normal (EvView *view)
+{
+ ev_view_zoom (view, 1.0, FALSE);
+}
+
+void
ev_view_set_size (EvView *view,
int width,
int height)