From 754c3261279b58118b16cfe9018613f058b59c9b Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Tue, 20 May 2003 11:46:28 +0000 Subject: Simplified and reorganised zoom. Implement a zoom control for the toolbar. 2003-05-19 Christian Persch 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. --- lib/widgets/ephy-zoom-action.h | 60 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lib/widgets/ephy-zoom-action.h (limited to 'lib/widgets/ephy-zoom-action.h') diff --git a/lib/widgets/ephy-zoom-action.h b/lib/widgets/ephy-zoom-action.h new file mode 100644 index 000000000..04e2d4e9b --- /dev/null +++ b/lib/widgets/ephy-zoom-action.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2003 Marco Pesenti Gritti + * 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_ACTION_H +#define EPHY_ZOOM_ACTION_H + +#include + +G_BEGIN_DECLS + +#define EPHY_TYPE_ZOOM_ACTION (ephy_zoom_action_get_type ()) +#define EPHY_ZOOM_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_ZOOM_ACTION, EphyZoomAction)) +#define EPHY_ZOOM_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_TYPE_ZOOM_ACTION, EphyZoomActionClass)) +#define EPHY_IS_ZOOM_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_TYPE_ZOOM_ACTION)) +#define EPHY_IS_ZOOM_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EPHY_TYPE_ZOOM_ACTION)) +#define EPHY_ZOOM_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), EPHY_TYPE_ZOOM_ACTION, EphyZoomActionClass)) + +typedef struct _EphyZoomAction EphyZoomAction; +typedef struct _EphyZoomActionClass EphyZoomActionClass; +typedef struct _EphyZoomActionPrivate EphyZoomActionPrivate; + +struct _EphyZoomAction +{ + EggAction parent; + + EphyZoomActionPrivate *priv; +}; + +struct _EphyZoomActionClass +{ + EggActionClass parent_class; + + void (* zoom_to_level) (EphyZoomAction *action, float level); +}; + +GType ephy_zoom_action_get_type (void); + +void ephy_zoom_action_set_zoom_level (EphyZoomAction *action, float zoom); + +float ephy_zoom_action_get_zoom_level (EphyZoomAction *action); + +G_END_DECLS + +#endif -- cgit