aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-zoom.h
diff options
context:
space:
mode:
authorChristian Persch <chpe+gnomebugz@stud.uni-saarland.de>2003-05-20 19:46:28 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-05-20 19:46:28 +0800
commit754c3261279b58118b16cfe9018613f058b59c9b (patch)
treed23770eeefb5b947ee44a27fc3cbad04f026de86 /lib/ephy-zoom.h
parentbc555495c56dc8836db5ac7a4f3f6b5772e315d6 (diff)
downloadgsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.gz
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.bz2
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.lz
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.xz
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.tar.zst
gsoc2013-epiphany-754c3261279b58118b16cfe9018613f058b59c9b.zip
Simplified and reorganised zoom. Implement a zoom control for the toolbar.
2003-05-19 Christian Persch <chpe+gnomebugz@stud.uni-saarland.de> Simplified and reorganised zoom. Implement a zoom control for the toolbar. * lib/widgets/ephy-zoom-action.h: * lib/widgets/ephy-zoom-action.c: * lib/widgets/ephy-zoom-control.h: * lib/widgets/ephy-zoom-control.c: New. A simple zoom control and a corresponding egg action. * lib/ephy-zoom.h: * lib/ephy-zoom.c: New. Define the supported zoom levels, plus some helper functions. * data/ui/epiphany-toolbar.xml.in: * src/toolbar.h: * src/toolbar.c: (toolbar_update_zoom_control), (zoom_to_level_cb), (toolbar_setup_actions): Hook up zoom control. * src/ephy-window.c: (toolbar_update_zoom_control): New. Updates toolbar zoom control and menu item sensitivity. * embed/mozilla/mozilla-embed.c: (impl_zoom_set, impl_zoom_get): * embed/ephy-embed.[ch]: (zoom_set), (zoom_get), (ephy_embed_zoom_set), (ephy_embed_zoom_get): * lib/ephy-marshal.list: * src/ephy-nautilus-view.c: (gnv_embed_zoom_change_cb), (gnv_zoomable_set_zoom_level_cb): * src/ephy-tab.c: (ephy_tab_zoom_changed_cb): * src/ephy-window.c: (ephy_window_set_zoom): Use float zoom factor instead of int percent for zoom. * src/ephy-nautilus-view.c: (ephy_nautilus_view_instance_init), (ephy_nautilus_view_class_init), (gnv_zoomable_set_zoom_level_cb), (gnv_zoomable_zoom_in_cb), (gnv_zoomable_zoom_out_cb), (gnv_zoomable_zoom_to_default_cb), (gnv_embed_zoom_change_cb): * src/window-commands.c: (window_cmd_view_zoom_in), (window_cmd_view_zoom_out), (window_cmd_view_zoom_normal): Simplified; use ephy-zoom.h where appropriate.
Diffstat (limited to 'lib/ephy-zoom.h')
-rw-r--r--lib/ephy-zoom.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/lib/ephy-zoom.h b/lib/ephy-zoom.h
new file mode 100644
index 000000000..648298fbc
--- /dev/null
+++ b/lib/ephy-zoom.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2003 Christian Persch
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef EPHY_ZOOM_H
+#define EPHY_ZOOM_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <glib.h>
+#include <bonobo/bonobo-i18n.h>
+
+G_BEGIN_DECLS
+
+static const
+struct
+{
+ gchar *name;
+ float level;
+}
+zoom_levels[] =
+{
+ { N_("50%"), 0.7071067811 },
+ { N_("75%"), 0.8408964152 },
+ { N_("100%"), 1.0 },
+ { N_("125%"), 1.1892071149 },
+ { N_("150%"), 1.4142135623 },
+ { N_("175%"), 1.6817928304 },
+ { N_("200%"), 2.0 },
+ { N_("300%"), 2.8284271247 },
+ { N_("400%"), 4.0 }
+};
+static const guint n_zoom_levels = G_N_ELEMENTS (zoom_levels);
+
+#define ZOOM_MINIMAL (zoom_levels[0].level)
+#define ZOOM_MAXIMAL (zoom_levels[n_zoom_levels - 1].level)
+#define ZOOM_IN (-1.0)
+#define ZOOM_OUT (-2.0)
+
+guint ephy_zoom_get_zoom_level_index (float level);
+
+float ephy_zoom_get_changed_zoom_level (float level, gint steps);
+
+float ephy_zoom_get_nearest_zoom_level (float level);
+
+G_END_DECLS
+
+#endif