From 606f66cbbca54996a165121743cda6a993762c47 Mon Sep 17 00:00:00 2001 From: James Bowes Date: Mon, 02 May 2005 16:19:48 +0000 Subject: Output zoom-control Makefile. build zoom-control subdir. 2005-05-02 James Bowes * configure.ac: Output zoom-control Makefile. * cut-n-paste/Makefile.am: build zoom-control subdir. * cut-n-paste/zoom-control/ephy-zoom-action.c: * cut-n-paste/zoom-control/ephy-zoom-action.h: * cut-n-paste/zoom-control/ephy-zoom-control.c: * cut-n-paste/zoom-control/ephy-zoom-control.h: * cut-n-paste/zoom-control/ephy-zoom.c: * cut-n-paste/zoom-control/ephy-zoom.h: New files imported from epiphany, and modified to add a separator into the menu. * cut-n-paste/zoom-control/Makefile.am: Build zoom-control. * data/evince-ui.xml: Replace old zoom toolbar actions with new zoom-control action. * shell/Makefile.am: Include zoom-control flags. * shell/ev-view.c: (ev_view_set_zoom), (ev_view_get_zoom), (ev_view_get_sizing_mode), (ev_view_zoom_in), (ev_view_zoom_out), (ev_view_zoom_for_size_presentation), (ev_view_zoom_for_size_continuous_and_dual_page), (ev_view_zoom_for_size_continuous), (ev_view_zoom_for_size_dual_page), (ev_view_zoom_for_size_single_page), (ev_view_zoom_normal): s/ev_view_zoom/ev_view_set_zoom/ and make public, add ev_view_get_zoom and ev_view_get_sizing_mode. * shell/ev-view.h: * shell/ev-window.c: (update_action_sensitivity), (update_sizing_buttons), (zoom_control_changed_cb), (register_custom_actions): Initialize and use the zoom-control widget. --- (limited to 'cut-n-paste/zoom-control/ephy-zoom.h') diff --git a/cut-n-paste/zoom-control/ephy-zoom.h b/cut-n-paste/zoom-control/ephy-zoom.h new file mode 100644 index 0000000..e62fdef --- /dev/null +++ b/cut-n-paste/zoom-control/ephy-zoom.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2003 Christian Persch + * + * Modified 2005 by James Bowes for use in evince. + * + * 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. + * + * $Id$ + */ + +#ifndef EPHY_ZOOM_H +#define EPHY_ZOOM_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +G_BEGIN_DECLS + +#define EPHY_ZOOM_BEST_FIT (-3.0) +#define EPHY_ZOOM_FIT_WIDTH (-4.0) +#define EPHY_ZOOM_SEPARATOR (-5.0) + +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 }, + { NULL, EPHY_ZOOM_SEPARATOR }, + { N_("Best Fit"), EPHY_ZOOM_BEST_FIT }, + { N_("Fit Page Width"), EPHY_ZOOM_FIT_WIDTH } +}; +static const guint n_zoom_levels = G_N_ELEMENTS (zoom_levels); + +#define ZOOM_MINIMAL (EPHY_ZOOM_SEPARATOR) +#define ZOOM_MAXIMAL (zoom_levels[n_zoom_levels - 4].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 -- cgit v0.9.1