]> www.fi.muni.cz Git - evince.git/blob - cut-n-paste/zoom-control/ephy-zoom.h
293880a200f05191d5816e9235924f07bf2f4792
[evince.git] / cut-n-paste / zoom-control / ephy-zoom.h
1 /*
2  *  Copyright (C) 2003 Christian Persch
3  *
4  *  Modified 2005 by James Bowes for use in evince.
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2, or (at your option)
9  *  any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  *  $Id$
21  */
22
23 #ifndef EPHY_ZOOM_H
24 #define EPHY_ZOOM_H
25
26 #ifdef HAVE_CONFIG_H
27 #include <config.h>
28 #endif
29
30 #include <glib.h>
31 #include <glib/gi18n.h>
32
33 G_BEGIN_DECLS
34
35 #define EPHY_ZOOM_BEST_FIT  (-3.0)
36 #define EPHY_ZOOM_FIT_WIDTH (-4.0)
37 #define EPHY_ZOOM_SEPARATOR (-5.0)
38
39 static const
40 struct
41 {
42         gchar *name;
43         float level;
44 }
45
46 zoom_levels[] =
47 {
48         { N_("Best Fit"),       EPHY_ZOOM_BEST_FIT  },
49         { N_("Fit Page Width"), EPHY_ZOOM_FIT_WIDTH },
50         { NULL,                 EPHY_ZOOM_SEPARATOR },
51         { N_("50%"), 0.5 },
52         { N_("70%"), 0.7071067811 },
53         { N_("85%"), 0.8408964152 },
54         { N_("100%"), 1.0 },
55         { N_("125%"), 1.1892071149 },
56         { N_("150%"), 1.4142135623 },
57         { N_("175%"), 1.6817928304 },
58         { N_("200%"), 2.0 },
59         { N_("300%"), 2.8284271247 },
60         { N_("400%"), 4.0 }
61 };
62 static const guint n_zoom_levels = G_N_ELEMENTS (zoom_levels);
63
64 #define ZOOM_MINIMAL    (EPHY_ZOOM_SEPARATOR)
65 #define ZOOM_MAXIMAL    (zoom_levels[n_zoom_levels - 1].level)
66 #define ZOOM_IN         (-1.0)
67 #define ZOOM_OUT        (-2.0)
68
69 guint   ephy_zoom_get_zoom_level_index   (float level);
70
71 float   ephy_zoom_get_changed_zoom_level (float level, gint steps);
72
73 float   ephy_zoom_get_nearest_zoom_level (float level);
74
75 G_END_DECLS
76
77 #endif