[Nautilus-list] The final BonoboZoomable patch



Hi Maciej,

here is the final patch to use the BonoboZoomable
interface in Nautilus.

====
2000-10-22  Martin Baulig  <baulig suse de>

	Use the new Bonobo::Zoomable interface instead of Nautilus::Zoomable.

	* libnautilus/nautilus-zoomable.[ch]: Removed.
	* src/nautilus-zoomable-frame-corba.c: Removed.

	* libnautilus/nautilus-view-component.idl
	(ZoomLevels, ZoomLevelList, Zoomable, ZoomableFrame): Removed.

	* src/nautilus-view-frame-private.h
	(impl_Nautilus_ZoomableFrame_vepv, impl_Nautilus_ZoomableFrame__create):
	Removed external declarations.

	* src/nautilus-view-frame.h: include <bonobo/bonobo-zoomable-frame.h>.
	(NautilusViewFrame): Removed the `zoomable' field and changed the
	type of the `zoomable_frame' field from BonoboObject into
	BonoboZoomableFrame.

	* src/nautilus-zoom-control.c (NautilusZoomControlDetails): Added
	`has_min_zoom_level' and `has_max_zoom_level'.
	(draw_zoom_control_image): Take the new `has_min_zoom_level' and
	`has_max_zoom_level' into account when deciding whether we can zoom.
	(zoom_menu_callback): Likewise.
	(nautilus_zoom_control_button_press_event): Likewise.
	(create_zoom_menu_item): Changed the type of the `zoom_level' argument
	from double to float.

	* src/nautilus-view-frame.c (nautilus_view_frame_destroy_client):
	Don't release `view->zoomable' and set `view->history_frame' and
	`view->zoomable_frame' to NULL, not to CORBA_OBJECT_NIL.
	(zoom_level_changed_cb): New static callback function; this emits
	the ZOOM_LEVEL_CHANGED signal.
	(zoom_parameters_changed_cb): New static callback function; this
	asks the Zoomable the new new zoom level and then passes it to the
	ZOOM_PARAMETERS_CHANGED signal.
	(nautilus_view_frame_set_to_component): Before creating the Adapter, we
	query the component for "IDL:Bonobo/Zoomable:1.0" and - if it was found -
	we create the BonoboZoomableFrame, bind it to the BonoboZoomable and
	connect the  "zoom_level_changed" and the "zoom_parameters_changed" signals.
	After creating the NautilusAdapter, we already have the BonoboZoomableFrame
	if the component supports zooming; bonobo_object_add_interface() it to the
	NautilusViewFrame it not NULL.
	(nautilus_view_frame_is_zoomable): Return `view->zoomable_frame != NULL'.
	(nautilus_view_frame_get_zoom_level): Check whether view->zoomable_frame
	is not NULL and call bonobo_zoomable_frame_get_zoom_level().
	(nautilus_view_frame_set_zoom_level): Check whether view->zoomable_frame
	is not NULL and call bonobo_zoomable_frame_set_zoom_level().
	(nautilus_view_frame_get_min_zoom_level): Check whether view->zoomable_frame
	is not NULL and call bonobo_zoomable_frame_get_min_zoom_level().
	(nautilus_view_frame_get_max_zoom_level): Check whether view->zoomable_frame
	is not NULL and call bonobo_zoomable_frame_get_max_zoom_level().
	(nautilus_view_frame_get_preferred_zoom_levels): If view->zoomable_frame is
	NULL, return NULL. Otherwise bonobo_zoomable_frame_get_preferred_zoom_levels()
	returns a 0.0 terminated float array, so create a GList with its contents.
	(nautilus_view_frame_zoom_in): If view->zoomable_frame is not NULL, call
	bonobo_zoomable_frame_zoom_in().
	(nautilus_view_frame_zoom_out): If view->zoomable_frame is not NULL, call
	bonobo_zoomable_frame_zoom_out().
	(nautilus_view_frame_zoom_to_fit):  If view->zoomable_frame is not NULL, call
	bonobo_zoomable_frame_zoom_out().

	* src/file-manager/fm-directory-view.c: include <bonobo/bonobo-zoomable.h> instead
	of <libnautilus/libnautilus-zoomable.h>.
	(FMDirectoryViewDetails): Changed the type of `zoomable' to BonoboZoomable.
	(fm_directory_view_preferred_zoom_levels): Made this an array of float, not double.
	(fm_directory_view_initialize): Create a new BonoboZoomable object here.
	(zoomable_zoom_in_callback): The first argument is now a BonoboZoomable.
	(zoomable_zoom_out_callback): The first argument is now a BonoboZoomable.
	(nautilus_zoom_level_from_double): Renamed into nautilus_zoom_level_from_float().
	(zoomable_set_zoom_level_callback): The first argument is now a BonoboZoomable and
	the second one a float.
	(zoomable_zoom_to_fit_callback): The first argument is now a BonoboZoomable.
	(fm_directory_view_set_zoom_level): Call bonobo_zoomable_report_zoom_level_changed()
	instead of using nautilus_zoomable_set_zoom_level().

===

And here's the patch:

Index: libnautilus/Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus/Makefile.am,v
retrieving revision 1.84
diff -u -u -p -r1.84 Makefile.am
--- libnautilus/Makefile.am	2000/10/20 23:48:19	1.84
+++ libnautilus/Makefile.am	2000/10/22 13:04:58
@@ -45,7 +45,6 @@ libnautilusinclude_HEADERS=			\
 	nautilus-view.h				\
 	nautilus-undo.h				\
 	nautilus-undo-private.h			\
-	nautilus-zoomable.h			\
 	$(NULL)
 
 libnautilus_la_SOURCES=					\
@@ -57,7 +56,6 @@ libnautilus_la_SOURCES=					\
 	nautilus-undo-transaction.h			\
 	nautilus-undo.c					\
 	nautilus-view.c					\
-	nautilus-zoomable.c				\
 	$(NULL)
 
 $(nautilus_view_component_idl_sources): nautilus_view_component_idl_stamp
Index: libnautilus/nautilus-view-component.idl
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus/nautilus-view-component.idl,v
retrieving revision 1.30
diff -u -u -p -r1.30 nautilus-view-component.idl
--- libnautilus/nautilus-view-component.idl	2000/10/03 02:02:05	1.30
+++ libnautilus/nautilus-view-component.idl	2000/10/22 13:04:58
@@ -93,44 +93,6 @@ module Nautilus {
 		oneway void set_title (in string new_title);
 	};		
 
-	typedef float ZoomLevel;
-	typedef sequence<ZoomLevel> ZoomLevelList;
-	
-	/* The interface for something zoomable. Nautilus looks for
-	 * this interface on Bonobo controls that it uses as views. If
-	 * the interface is present, it shows a widget in the toolbar
-	 * for zooming. It's still the component's job to save the
-	 * zoom level.
-	 */
-	interface Zoomable : ::Bonobo::Unknown {
-		/* Set this attribute to make the thing zoom. */
-		attribute float zoom_level;
-
-		/* Information about the type of zooming that's supported. */
-		readonly attribute float min_zoom_level;
-		readonly attribute float max_zoom_level;
-		readonly attribute boolean is_continuous;
-		readonly attribute ZoomLevelList preferred_zoom_levels;
-		
-		/* High level operations.
-		 * These can cause a change in the zoom level.
-		 * The zoomable itself must decide what the concepts
-		 * "one level in", "one level out", and "to fit" mean.
-		 */
-		oneway void zoom_in ();
-		oneway void zoom_out ();
-		oneway void zoom_to_fit ();
-	};
-	
-	/* A zoomable has the responsibility to look for this
-	 * interface on its Bonobo control frame and call
-	 * zoom_level_changed whenever it changes the zoom level (on
-	 * its own or due to calls from the zoomable interface).
-	 */
-	interface ZoomableFrame : ::Bonobo::Unknown {
-		oneway void report_zoom_level_changed (in float zoom_level);
-	};
-
 	/* The specifications for a history list item. The structure
 	 * contains the title of the item, and the location it's for.
 	 */
Index: libnautilus/nautilus-zoomable.c
===================================================================
RCS file: nautilus-zoomable.c
diff -N nautilus-zoomable.c
--- /tmp/cvsOlPdLA	Sun Oct 22 09:05:07 2000
+++ /dev/null	Tue May  5 16:32:27 1998
@@ -1,599 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- *  libnautilus: A library for nautilus view implementations.
- *
- *  Copyright (C) 2000 Eazel, Inc.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public
- *  License along with this library; if not, write to the Free
- *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *  Author: Maciej Stachowiak <mjs eazel com>
- *
- */
-
-/* nautilus-zoomable.c */
-
-#include <config.h>
-#include "nautilus-zoomable.h"
-
-#include <libnautilus-extensions/nautilus-gtk-macros.h>
-#include <gtk/gtksignal.h>
-#include <bonobo/bonobo-main.h>
-#include <bonobo/bonobo-control.h>
-
-NautilusZoomable *foo;
-
-struct NautilusZoomableDetails {
-	BonoboControl *control;
-	
-	double zoom_level;
-	double min_zoom_level;
-	double max_zoom_level;
-	gboolean is_continuous;
-
-	Nautilus_ZoomLevel *preferred_zoom_levels;
-	int num_preferred_zoom_levels;
-	
-	Nautilus_ZoomableFrame zoomable_frame;
-};
-
-enum {
-	SET_ZOOM_LEVEL,
-	ZOOM_IN,
-	ZOOM_OUT,
-	ZOOM_TO_FIT,
-	LAST_SIGNAL
-};
-
-enum {
-	ARG_0,
-	ARG_BONOBO_CONTROL,
-	ARG_MIN_ZOOM_LEVEL,
-	ARG_MAX_ZOOM_LEVEL,
-	ARG_IS_CONTINUOUS,
-	ARG_PREFERRED_ZOOM_LEVELS,
-	ARG_NUM_PREFERRED_ZOOM_LEVELS,
-};
-
-static guint signals[LAST_SIGNAL];
-
-typedef struct {
-	POA_Nautilus_Zoomable servant;
-	gpointer bonobo_object;
-	
-	NautilusZoomable *gtk_object;
-} impl_POA_Nautilus_Zoomable;
-
-
-void                 nautilus_zoomable_real_set_bonobo_control  (NautilusZoomable           *view,
-								 BonoboControl              *bonobo_control);
-static CORBA_float  impl_Nautilus_Zoomable__get_zoom_level     (PortableServer_Servant      servant,
-								 CORBA_Environment          *ev);
-static void          impl_Nautilus_Zoomable__set_zoom_level     (PortableServer_Servant      servant,
-								 const CORBA_float           zoom_level,
-								 CORBA_Environment          *ev);
-static CORBA_float  impl_Nautilus_Zoomable__get_min_zoom_level (PortableServer_Servant      servant,
-								 CORBA_Environment          *ev);
-static CORBA_float  impl_Nautilus_Zoomable__get_max_zoom_level (PortableServer_Servant      servant,
-								 CORBA_Environment          *ev);
-static CORBA_boolean impl_Nautilus_Zoomable__get_is_continuous (PortableServer_Servant      servant,
-								 CORBA_Environment          *ev);
-static Nautilus_ZoomLevelList* impl_Nautilus_Zoomable__get_preferred_zoom_level_list
-							        (PortableServer_Servant      servant,
-								 CORBA_Environment          *ev);
-static void          impl_Nautilus_Zoomable_zoom_in             (PortableServer_Servant      servant,
-								 CORBA_Environment          *ev);
-static void          impl_Nautilus_Zoomable_zoom_out            (PortableServer_Servant      servant,
-								 CORBA_Environment          *ev);
-static void          impl_Nautilus_Zoomable_zoom_to_fit         (PortableServer_Servant      servant,
-								 CORBA_Environment          *ev);
-
-POA_Nautilus_Zoomable__epv libnautilus_Nautilus_Zoomable_epv =
-{
-	NULL,			/* _private */
-	&impl_Nautilus_Zoomable__get_zoom_level,
-	&impl_Nautilus_Zoomable__set_zoom_level,
-	&impl_Nautilus_Zoomable__get_min_zoom_level,
-	&impl_Nautilus_Zoomable__get_max_zoom_level,
-	&impl_Nautilus_Zoomable__get_is_continuous,
-	&impl_Nautilus_Zoomable__get_preferred_zoom_level_list,
-	&impl_Nautilus_Zoomable_zoom_in,
-	&impl_Nautilus_Zoomable_zoom_out,
-	&impl_Nautilus_Zoomable_zoom_to_fit
-};
-
-/* static PortableServer_ServantBase__epv base_epv; */
-static POA_Nautilus_Zoomable__vepv impl_Nautilus_Zoomable_vepv =
-{
-/*	&base_epv, */
-	NULL,
-	NULL,
-	&libnautilus_Nautilus_Zoomable_epv
-};
-
-
-GList *
-nautilus_g_list_from_ZoomLevelList (const Nautilus_ZoomLevelList *zoom_level_list)
-{
-	GList *list;
-	int i;
-	double *zoom_level_ptr;
-
-	list = NULL;
-	for (i = 0; i < zoom_level_list->_length; ++i) {
-		zoom_level_ptr = g_new (double, 1);
-		*zoom_level_ptr = zoom_level_list->_buffer[i];
-		list = g_list_prepend (list, zoom_level_ptr);
-	}
-	return g_list_reverse (list);
-}
-
-static Nautilus_ZoomLevel *
-nautilus_ZoomLevelListBuffer_from_zoom_levels (const double *zoom_levels, int num_levels)
-{
-	int i;
-	Nautilus_ZoomLevel *buffer;
-
-	buffer = CORBA_sequence_Nautilus_ZoomLevel_allocbuf (num_levels);
-	
-	for (i = 0; i < num_levels; ++i) {
-		buffer[i] = zoom_levels[i];
-	}
-
-	return buffer;
-}
-
-static CORBA_float
-impl_Nautilus_Zoomable__get_zoom_level (PortableServer_Servant      servant,
-					CORBA_Environment          *ev)
-{
-	impl_POA_Nautilus_Zoomable *zoomable;
-
-	zoomable = (impl_POA_Nautilus_Zoomable *)servant;
-
-	return zoomable->gtk_object->details->zoom_level;
-}
-
-static void 
-impl_Nautilus_Zoomable__set_zoom_level (PortableServer_Servant      servant,
-					const CORBA_float          zoom_level,
-					CORBA_Environment          *ev)
-{
-	impl_POA_Nautilus_Zoomable *zoomable;
-
-	zoomable = (impl_POA_Nautilus_Zoomable *)servant;
-
-	gtk_signal_emit (GTK_OBJECT (zoomable->gtk_object), signals[SET_ZOOM_LEVEL], zoom_level);
-	
-}
-
-static CORBA_float
-impl_Nautilus_Zoomable__get_min_zoom_level (PortableServer_Servant      servant,
-					    CORBA_Environment      *ev)
-{
-	impl_POA_Nautilus_Zoomable *zoomable;
-
-	zoomable = (impl_POA_Nautilus_Zoomable *)servant;
-
-	return zoomable->gtk_object->details->min_zoom_level;
-}
-
-static CORBA_float
-impl_Nautilus_Zoomable__get_max_zoom_level (PortableServer_Servant      servant,
-					    CORBA_Environment      *ev)
-{
-	impl_POA_Nautilus_Zoomable *zoomable;
-
-	zoomable = (impl_POA_Nautilus_Zoomable *)servant;
-
-	return zoomable->gtk_object->details->max_zoom_level;
-}
-
-static CORBA_boolean
-impl_Nautilus_Zoomable__get_is_continuous (PortableServer_Servant      servant,
-					   CORBA_Environment      *ev)
-{
-	impl_POA_Nautilus_Zoomable *zoomable;
-
-	zoomable = (impl_POA_Nautilus_Zoomable *)servant;
-
-	return zoomable->gtk_object->details->is_continuous;
-}
-
-static Nautilus_ZoomLevelList *
-impl_Nautilus_Zoomable__get_preferred_zoom_level_list (PortableServer_Servant      servant,
-					    		  CORBA_Environment      *ev)
-{
-	Nautilus_ZoomLevelList *list;
-	impl_POA_Nautilus_Zoomable *zoomable;
-
-	zoomable = (impl_POA_Nautilus_Zoomable *)servant;
-
-	list = Nautilus_ZoomLevelList__alloc ();
-	list->_maximum = zoomable->gtk_object->details->num_preferred_zoom_levels;
-	list->_length = zoomable->gtk_object->details->num_preferred_zoom_levels;
-	list->_buffer = zoomable->gtk_object->details->preferred_zoom_levels;
-	
-	/*  set_release defaults to FALSE - CORBA_sequence_set_release (list, FALSE) */ 
-
-	return list;
-}
-
-static void
-impl_Nautilus_Zoomable_zoom_in (PortableServer_Servant      servant,
-				CORBA_Environment          *ev)
-{	
-	impl_POA_Nautilus_Zoomable *zoomable;
-
-	zoomable = (impl_POA_Nautilus_Zoomable *)servant;
-
-	gtk_signal_emit (GTK_OBJECT (zoomable->gtk_object), signals[ZOOM_IN]);
-}
-
-static void
-impl_Nautilus_Zoomable_zoom_out (PortableServer_Servant      servant,
-				 CORBA_Environment *ev)
-{
-	impl_POA_Nautilus_Zoomable *zoomable;
-
-	zoomable = (impl_POA_Nautilus_Zoomable *)servant;
-
-	gtk_signal_emit (GTK_OBJECT (zoomable->gtk_object), signals[ZOOM_OUT]);
-}
-
-static void
-impl_Nautilus_Zoomable_zoom_to_fit (PortableServer_Servant      servant,
-				    CORBA_Environment *ev)
-{
-	impl_POA_Nautilus_Zoomable *zoomable;
-
-	zoomable = (impl_POA_Nautilus_Zoomable *)servant;
-
-	gtk_signal_emit (GTK_OBJECT (zoomable->gtk_object), signals[ZOOM_TO_FIT]);
-}
-
-static void
-impl_Nautilus_Zoomable__destroy (BonoboObject *obj,
-				 PortableServer_Servant      servant)
-{
-	PortableServer_ObjectId *objid;
-	CORBA_Environment ev;
-	
-	CORBA_exception_init(&ev);
-	
-	objid = PortableServer_POA_servant_to_id (bonobo_poa (), servant, &ev);
-	PortableServer_POA_deactivate_object (bonobo_poa (), objid, &ev);
-	CORBA_free (objid);
-	obj->servant = NULL;
-	
-	POA_Nautilus_Zoomable__fini (servant, &ev);
-	g_free (servant);
-	CORBA_exception_free(&ev);
-}
-
-static Nautilus_Zoomable
-impl_Nautilus_Zoomable__create (NautilusZoomable *zoomable, CORBA_Environment * ev)
-{
-	Nautilus_Zoomable retval;
-	impl_POA_Nautilus_Zoomable *servant;
-	
-	NautilusZoomableClass *zoomable_class = NAUTILUS_ZOOMABLE_CLASS (GTK_OBJECT(zoomable)->klass);
-	
-	servant = g_new0 (impl_POA_Nautilus_Zoomable, 1);
-	servant->servant.vepv = zoomable_class->vepv;
-	if (!servant->servant.vepv->Bonobo_Unknown_epv)
-		servant->servant.vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
-	POA_Nautilus_Zoomable__init ((PortableServer_Servant) servant, ev);
-	
-	servant->gtk_object = zoomable;
-	
-	retval = bonobo_object_activate_servant (BONOBO_OBJECT (zoomable), servant);
-	
-	gtk_signal_connect (GTK_OBJECT (zoomable), "destroy", impl_Nautilus_Zoomable__destroy, servant);
-	
-	return retval;
-}
-
-static void nautilus_zoomable_initialize_class (NautilusZoomableClass *klass);
-static void nautilus_zoomable_initialize       (NautilusZoomable      *zoomable);
-static void nautilus_zoomable_destroy          (NautilusZoomable      *view);
-static void nautilus_zoomable_set_arg          (GtkObject             *object,
-						GtkArg                *arg,
-						guint                  arg_id);
-static void nautilus_zoomable_get_arg          (GtkObject             *object,
-						GtkArg                *arg,
-						guint                  arg_id);
-
-NAUTILUS_DEFINE_CLASS_BOILERPLATE(NautilusZoomable, nautilus_zoomable, BONOBO_OBJECT_TYPE)
-
-/* This would go into nautilus-gtk-extensions.c, but we don't want the dependency. */
-static void
-marshal_NONE__DOUBLE (GtkObject *object,
-		      GtkSignalFunc func,
-		      gpointer func_data,
-		      GtkArg *args)
-{
-	(* (void (*)(GtkObject *, double, gpointer)) func)
-		(object,
-		 GTK_VALUE_DOUBLE (args[0]),
-		 func_data);
-}
-
-static void
-nautilus_zoomable_initialize_class (NautilusZoomableClass *klass)
-{
-	GtkObjectClass *object_class;
-	
-	object_class = (GtkObjectClass*) klass;
-	object_class->destroy = (void (*)(GtkObject*))nautilus_zoomable_destroy;
-	object_class->set_arg = nautilus_zoomable_set_arg;
-	object_class->get_arg = nautilus_zoomable_get_arg;
-	
-	parent_class = gtk_type_class (gtk_type_parent (object_class->type));
-	
-	klass->vepv = &impl_Nautilus_Zoomable_vepv;
-	
-	signals[SET_ZOOM_LEVEL] =
-		gtk_signal_new ("set_zoom_level",
-				GTK_RUN_LAST,
-				object_class->type,
-				GTK_SIGNAL_OFFSET (NautilusZoomableClass, set_zoom_level),
-				marshal_NONE__DOUBLE,
-				GTK_TYPE_NONE, 1, GTK_TYPE_DOUBLE);
-	signals[ZOOM_IN] = 
-		gtk_signal_new ("zoom_in",
-				GTK_RUN_LAST,
-				object_class->type,
-				GTK_SIGNAL_OFFSET (NautilusZoomableClass, zoom_in),
-				gtk_marshal_NONE__NONE,
-				GTK_TYPE_NONE, 0);
-	signals[ZOOM_OUT] = 
-		gtk_signal_new ("zoom_out",
-				GTK_RUN_LAST,
-				object_class->type,
-				GTK_SIGNAL_OFFSET (NautilusZoomableClass, zoom_out),
-				gtk_marshal_NONE__NONE,
-				GTK_TYPE_NONE, 0);
-	signals[ZOOM_TO_FIT] = 
-		gtk_signal_new ("zoom_to_fit",
-				GTK_RUN_LAST,
-				object_class->type,
-				GTK_SIGNAL_OFFSET (NautilusZoomableClass, zoom_to_fit),
-				gtk_marshal_NONE__NONE,
-				GTK_TYPE_NONE, 0);
-
-	gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
-	
-	gtk_object_add_arg_type ("NautilusZoomable::bonobo_control",
-				 GTK_TYPE_OBJECT,
-				 GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY,
-				 ARG_BONOBO_CONTROL);
-	gtk_object_add_arg_type ("NautilusZoomable::min_zoom_level",
-				 GTK_TYPE_DOUBLE,
-				 GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY,
-				 ARG_MIN_ZOOM_LEVEL);
-	gtk_object_add_arg_type ("NautilusZoomable::max_zoom_level",
-				 GTK_TYPE_DOUBLE,
-				 GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY,
-				 ARG_MAX_ZOOM_LEVEL);
-	gtk_object_add_arg_type ("NautilusZoomable::is_continuous",
-				 GTK_TYPE_BOOL,
-				 GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY,
-				 ARG_IS_CONTINUOUS);
-	gtk_object_add_arg_type ("NautilusZoomable::preferred_zoom_levels",
-				 GTK_TYPE_POINTER,
-				 GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY,
-				 ARG_PREFERRED_ZOOM_LEVELS);
-	gtk_object_add_arg_type ("NautilusZoomable::num_preferred_zoom_levels",
-				 GTK_TYPE_INT,
-				 GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY,
-				 ARG_NUM_PREFERRED_ZOOM_LEVELS);
-}
-
-static void
-nautilus_zoomable_set_arg (GtkObject      *object,
-			   GtkArg         *arg,
-			   guint	   arg_id)
-{
-	NautilusZoomable *zoomable;
-	
-	zoomable = NAUTILUS_ZOOMABLE (object);
-	
-	switch(arg_id) {
-	case ARG_BONOBO_CONTROL:
-		nautilus_zoomable_real_set_bonobo_control
-			(zoomable,
-			 BONOBO_CONTROL (GTK_VALUE_OBJECT (*arg)));
-		break;
-	case ARG_MIN_ZOOM_LEVEL:
-		zoomable->details->min_zoom_level = GTK_VALUE_DOUBLE (*arg);
-		break;
-	case ARG_MAX_ZOOM_LEVEL:
-		zoomable->details->max_zoom_level = GTK_VALUE_DOUBLE (*arg);
-		break;
-	case ARG_IS_CONTINUOUS:
-		zoomable->details->is_continuous = GTK_VALUE_BOOL (*arg);
-		break;
-	case ARG_PREFERRED_ZOOM_LEVELS:
-		zoomable->details->preferred_zoom_levels = GTK_VALUE_POINTER (*arg);
-		break;
-	case ARG_NUM_PREFERRED_ZOOM_LEVELS:
-		zoomable->details->num_preferred_zoom_levels = GTK_VALUE_INT (*arg);
-		break;
-	}
-}
-
-static void
-nautilus_zoomable_get_arg (GtkObject      *object,
-			   GtkArg         *arg,
-			   guint	     arg_id)
-{
-	NautilusZoomable *view;
-	
-	view = NAUTILUS_ZOOMABLE (object);
-	
-	switch(arg_id) {
-	case ARG_BONOBO_CONTROL:
-		GTK_VALUE_OBJECT (*arg) = GTK_OBJECT (nautilus_zoomable_get_bonobo_control (NAUTILUS_ZOOMABLE (object)));
-		break;
-	case ARG_MIN_ZOOM_LEVEL:
-		GTK_VALUE_DOUBLE (*arg) = NAUTILUS_ZOOMABLE (object)->details->min_zoom_level;
-		break;
-	case ARG_MAX_ZOOM_LEVEL:
-		GTK_VALUE_DOUBLE (*arg) = NAUTILUS_ZOOMABLE (object)->details->max_zoom_level;
-		break;
-	case ARG_IS_CONTINUOUS:
-		GTK_VALUE_BOOL (*arg) = NAUTILUS_ZOOMABLE (object)->details->is_continuous;
-		break;
-	case ARG_PREFERRED_ZOOM_LEVELS:
-		GTK_VALUE_POINTER (*arg) = NAUTILUS_ZOOMABLE (object)->details->preferred_zoom_levels;
-		break;
-	case ARG_NUM_PREFERRED_ZOOM_LEVELS:
-		GTK_VALUE_INT (*arg) = NAUTILUS_ZOOMABLE (object)->details->num_preferred_zoom_levels;
-		break;
-	}
-}
-
-static void
-nautilus_zoomable_initialize (NautilusZoomable *zoomable)
-{
-	CORBA_Environment ev;
-	CORBA_exception_init(&ev);
-	
-	zoomable->details = g_new0 (NautilusZoomableDetails, 1);
-	
-	bonobo_object_construct (BONOBO_OBJECT (zoomable), impl_Nautilus_Zoomable__create (zoomable, &ev));
-	
-	CORBA_exception_free(&ev);
-}
-
-NautilusZoomable *
-nautilus_zoomable_new (GtkWidget *widget, 
-		       double min_zoom_level, 
-		       double max_zoom_level, 
-		       gboolean is_continuous,
-		       double *preferred_zoom_levels,
-		       int num_preferred_zoom_levels)
-
-{
-	return nautilus_zoomable_new_from_bonobo_control
-		(bonobo_control_new (widget),
-		 min_zoom_level, 
-		 max_zoom_level,
-		 is_continuous,
-		 preferred_zoom_levels,
-		 num_preferred_zoom_levels);
-}
-
-NautilusZoomable *
-nautilus_zoomable_new_from_bonobo_control (BonoboControl *bonobo_control,
-					   double min_zoom_level, 
-					   double max_zoom_level, 
-					   gboolean is_continuous,
-					   double *preferred_zoom_levels,
-					   int	num_preferred_zoom_levels)
-{
-	NautilusZoomable *zoomable;
-	
-	zoomable = NAUTILUS_ZOOMABLE (gtk_object_new (NAUTILUS_TYPE_ZOOMABLE,
-						      "bonobo_control", bonobo_control,
-						      "min_zoom_level", min_zoom_level,
-						      "max_zoom_level", max_zoom_level,
-						      "is_continuous",  is_continuous,
-						      "preferred_zoom_levels", nautilus_ZoomLevelListBuffer_from_zoom_levels (preferred_zoom_levels, num_preferred_zoom_levels),
-						      "num_preferred_zoom_levels", num_preferred_zoom_levels,
-						      NULL));
-	
-	return zoomable;
-}
-
-static void
-nautilus_zoomable_destroy (NautilusZoomable *view)
-{
-	CORBA_free (view->details->preferred_zoom_levels);
-	g_free (view->details);
-	
-	NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, GTK_OBJECT (view));
-}
-
-static gboolean
-nautilus_zoomable_ensure_zoomable_frame (NautilusZoomable *view)
-{
-	CORBA_Environment ev;
-	
-	g_assert (NAUTILUS_IS_ZOOMABLE (view));
-	
-	CORBA_exception_init (&ev);
-	
-	if (CORBA_Object_is_nil (view->details->zoomable_frame, &ev)) {
-		view->details->zoomable_frame = Bonobo_Unknown_query_interface 
-			(bonobo_control_get_control_frame 
-			 (BONOBO_CONTROL (nautilus_zoomable_get_bonobo_control (view))),
-			 "IDL:Nautilus/ZoomableFrame:1.0", &ev);
-		if (ev._major != CORBA_NO_EXCEPTION) {
-			view->details->zoomable_frame = CORBA_OBJECT_NIL;
-		}
-		if (CORBA_Object_is_nil (view->details->zoomable_frame, &ev)) {
-			view->details->zoomable_frame = CORBA_OBJECT_NIL;
-		}
-
-		/* Don't keep a ref to the frame, because that would be circular. */
-		if (view->details->zoomable_frame != CORBA_OBJECT_NIL) {
-			Bonobo_Unknown_unref (view->details->zoomable_frame, &ev);
-		}
-	}
-	
-	CORBA_exception_free (&ev);
-
-	return view->details->zoomable_frame != CORBA_OBJECT_NIL;
-}
-
-void
-nautilus_zoomable_set_zoom_level (NautilusZoomable *view,
-				  double zoom_level)
-{
-	CORBA_Environment ev;
-	
-	g_return_if_fail (NAUTILUS_IS_ZOOMABLE (view));
-	
-	CORBA_exception_init (&ev);
-	
-	view->details->zoom_level = zoom_level;
-	
-	if (nautilus_zoomable_ensure_zoomable_frame (view)) {
-		Nautilus_ZoomableFrame_report_zoom_level_changed (view->details->zoomable_frame, zoom_level, &ev);
-		if (ev._major != CORBA_NO_EXCEPTION) {
-			CORBA_Object_release (view->details->zoomable_frame, &ev);
-			view->details->zoomable_frame = CORBA_OBJECT_NIL;
-		}
-	}
-	
-	CORBA_exception_free (&ev);
-}
-
-BonoboControl *
-nautilus_zoomable_get_bonobo_control (NautilusZoomable *view)
-{
-	return view->details->control;
-}
-
-void
-nautilus_zoomable_real_set_bonobo_control (NautilusZoomable *view,
-					   BonoboControl *bonobo_control)
-{
-	view->details->control = bonobo_control;
-	bonobo_object_add_interface (BONOBO_OBJECT (view), BONOBO_OBJECT (view->details->control));
-}
-
Index: libnautilus/nautilus-zoomable.h
===================================================================
RCS file: nautilus-zoomable.h
diff -N nautilus-zoomable.h
--- /tmp/cvsE32etI	Sun Oct 22 09:05:07 2000
+++ /dev/null	Tue May  5 16:32:27 1998
@@ -1,99 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
-
-/*
- *  libnautilus: A library for nautilus view implementations.
- *
- *  Copyright (C) 2000 Eazel, Inc.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public
- *  License along with this library; if not, write to the Free
- *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *  Author: Maciej Stachowiak <mjs eazel com>
- *
- */
-
-/* nautilus-zoomable.h: Object for implementing the Zoomable CORBA interface. */
-
-#ifndef NAUTILUS_ZOOMABLE_H
-#define NAUTILUS_ZOOMABLE_H
-
-#include <libnautilus/nautilus-view-component.h>
-#include <bonobo/bonobo-control.h>
-#include <gtk/gtkwidget.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define NAUTILUS_TYPE_ZOOMABLE		  (nautilus_zoomable_get_type ())
-#define NAUTILUS_ZOOMABLE(obj)		  (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_ZOOMABLE, NautilusZoomable))
-#define NAUTILUS_ZOOMABLE_CLASS(klass)	  (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_ZOOMABLE, NautilusZoomableClass))
-#define NAUTILUS_IS_ZOOMABLE(obj)	  (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_ZOOMABLE))
-#define NAUTILUS_IS_ZOOMABLE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_ZOOMABLE))
-
-typedef struct NautilusZoomable NautilusZoomable;
-typedef struct NautilusZoomableClass NautilusZoomableClass;
-
-struct NautilusZoomableClass
-{
-	BonoboObjectClass parent_spot;
-
-	void (*set_zoom_level)	        (NautilusZoomable *view,
-					 gdouble zoom_level);
-	void (*zoom_in)	                (NautilusZoomable *view);
-	void (*zoom_out)	        (NautilusZoomable *view);
-	void (*zoom_to_level)	        (NautilusZoomable *view,
-					 gint zoom_level);
-	void (*zoom_default)	        (NautilusZoomable *view);
-	void (*zoom_to_fit)	        (NautilusZoomable *view);
-
-	gpointer servant_init_func, servant_destroy_func, vepv;
-};
-
-typedef struct NautilusZoomableDetails NautilusZoomableDetails;
-
-struct NautilusZoomable
-{
-	BonoboObject parent;
-	NautilusZoomableDetails *details;
-};
-
-GtkType            nautilus_zoomable_get_type                  (void);
-NautilusZoomable  *nautilus_zoomable_new                       (GtkWidget       *widget, 
-							        double           min_zoom_level,
-							        double           max_zoom_level,
-							       gboolean          is_continuous,
-							       double		*preferred_zoom_levels,
-							       int num_preferred_zoom_levels);
-NautilusZoomable  *nautilus_zoomable_new_from_bonobo_control   (BonoboControl   *bonobo_control, 
-							        double           min_zoom_level,
-							        double           max_zoom_level,
-							        gboolean         is_continuous,
-							        double		*preferred_zoom_levels,
-							        int		 num_preferred_zoom_levels);
-void               nautilus_zoomable_set_parameters	       (NautilusZoomable *view,
-							        double            zoom_level,
-							        double            min_zoom_level,
-							        double            max_zoom_level);
-void               nautilus_zoomable_set_zoom_level            (NautilusZoomable *view,
-							        double            zoom_level);
-BonoboControl     *nautilus_zoomable_get_bonobo_control        (NautilusZoomable *view);
-
-GList *nautilus_g_list_from_ZoomLevelList (const Nautilus_ZoomLevelList *zoom_level_list);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gnome/nautilus/src/Makefile.am,v
retrieving revision 1.97
diff -u -u -p -r1.97 Makefile.am
--- src/Makefile.am	2000/10/20 23:48:19	1.97
+++ src/Makefile.am	2000/10/22 13:04:59
@@ -129,7 +129,6 @@ nautilus_SOURCES = \
 	nautilus-window-toolbars.c      	\
 	nautilus-window.c			\
 	nautilus-zoom-control.c			\
-	nautilus-zoomable-frame-corba.c		\
 	$(profiler_sources)			\
 	$(NULL)
 
Index: src/nautilus-view-frame-private.h
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-view-frame-private.h,v
retrieving revision 1.25
diff -u -u -p -r1.25 nautilus-view-frame-private.h
--- src/nautilus-view-frame-private.h	2000/09/29 21:34:04	1.25
+++ src/nautilus-view-frame-private.h	2000/10/22 13:04:59
@@ -39,11 +39,8 @@ typedef struct {
 } impl_POA_Nautilus_ViewFrame;
 
 extern POA_Nautilus_ViewFrame__vepv impl_Nautilus_ViewFrame_vepv;
-extern POA_Nautilus_ZoomableFrame__vepv impl_Nautilus_ZoomableFrame_vepv;
 
 BonoboObject *impl_Nautilus_ViewFrame__create                 (NautilusViewFrame *view,
-                                                               CORBA_Environment *ev);
-BonoboObject *impl_Nautilus_ZoomableFrame__create             (NautilusViewFrame *view,
                                                                CORBA_Environment *ev);
 
 /* ViewFrame */
Index: src/nautilus-view-frame.h
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-view-frame.h,v
retrieving revision 1.53
diff -u -u -p -r1.53 nautilus-view-frame.h
--- src/nautilus-view-frame.h	2000/10/13 05:56:11	1.53
+++ src/nautilus-view-frame.h	2000/10/22 13:05:00
@@ -34,6 +34,7 @@
 
 #include <bonobo/bonobo-object-client.h>
 #include <bonobo/bonobo-ui-container.h>
+#include <bonobo/bonobo-zoomable-frame.h>
 #include <libnautilus-extensions/nautilus-generous-bin.h>
 #include <libnautilus-extensions/nautilus-undo-manager.h>
 #include <libnautilus/nautilus-view-component.h>
@@ -56,12 +57,11 @@ typedef struct {
 
         /* The frame itself (from various interface points of view). */
         BonoboObject *view_frame;
-        BonoboObject *zoomable_frame;
+        BonoboZoomableFrame *zoomable_frame;
         BonoboObject *history_frame;
         
         /* The view inside the (various interfaces). */
         BonoboObjectClient *client_object;
-        Nautilus_Zoomable zoomable;
         GtkWidget *client_widget;
 } NautilusViewFrame;
 
Index: src/nautilus-zoom-control.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-zoom-control.c,v
retrieving revision 1.40
diff -u -u -p -r1.40 nautilus-zoom-control.c
--- src/nautilus-zoom-control.c	2000/10/18 13:40:00	1.40
+++ src/nautilus-zoom-control.c	2000/10/22 13:05:01
@@ -69,6 +69,8 @@ struct NautilusZoomControlDetails {
 	double zoom_level;
 	double min_zoom_level;	 
 	double max_zoom_level;
+	gboolean has_min_zoom_level;
+	gboolean has_max_zoom_level;
 	GList *preferred_zoom_levels;
 
 	int y_offset;
@@ -217,6 +219,8 @@ nautilus_zoom_control_initialize (Nautil
 	zoom_control->details->zoom_level = 1.0;
 	zoom_control->details->min_zoom_level = 0.0;
 	zoom_control->details->max_zoom_level = 2.0;
+	zoom_control->details->has_min_zoom_level = TRUE;
+	zoom_control->details->has_max_zoom_level = TRUE;
 	zoom_control->details->preferred_zoom_levels = NULL;
 
 	/* allocate the pixmap that holds the image */
@@ -378,7 +382,8 @@ draw_zoom_control_image (GtkWidget *widg
 	zoom_control = NAUTILUS_ZOOM_CONTROL (widget);
 
 	/* draw the decrement symbol if necessary, complete with prelighting */
-	if (zoom_control->details->zoom_level > zoom_control->details->min_zoom_level) {
+	if (!zoom_control->details->has_min_zoom_level ||
+	    (zoom_control->details->zoom_level > zoom_control->details->min_zoom_level)) {
 		draw_pixbuf_with_prelight (zoom_control, zoom_control->details->zoom_decrement_image,
 						box->x, box->y, PRELIGHT_MINUS);
 	} else {
@@ -401,7 +406,8 @@ draw_zoom_control_image (GtkWidget *widg
 	offset += gdk_pixbuf_get_width (zoom_control->details->zoom_body_image) + GAP_WIDTH;
 	
 	/* draw the increment symbol if necessary, complete with prelighting */
-	if (zoom_control->details->zoom_level < zoom_control->details->max_zoom_level) {
+	if (!zoom_control->details->has_max_zoom_level ||
+	    (zoom_control->details->zoom_level < zoom_control->details->max_zoom_level)) {
 		draw_pixbuf_with_prelight (zoom_control, zoom_control->details->zoom_increment_image,
 					   box->x + offset, box->y, PRELIGHT_PLUS);
 	} else {
@@ -526,6 +532,7 @@ zoom_menu_callback (GtkMenuItem *item, g
 {
 	double zoom_level;
 	NautilusZoomControl *zoom_control;
+	gboolean can_zoom;
 		
 	zoom_control = NAUTILUS_ZOOM_CONTROL (callback_data);
 
@@ -535,20 +542,27 @@ zoom_menu_callback (GtkMenuItem *item, g
 	}
 
 	zoom_level = * (double *) gtk_object_get_data (GTK_OBJECT (item), "zoom_level");
-	
-	/* Check to see if we can zoom out */
-	if ((zoom_control->details->min_zoom_level <= zoom_level && zoom_level <  zoom_control->details->zoom_level) ||
-	    (zoom_control->details->zoom_level     < zoom_level && zoom_level  <= zoom_control->details->max_zoom_level)) {
+
+	/* Assume we can zoom and then check whether we're right. */
+	can_zoom = TRUE;
+	if (zoom_control->details->has_min_zoom_level && zoom_level < zoom_control->details->min_zoom_level)
+		can_zoom = FALSE; /* no, we're below the minimum zoom level. */
+	if (zoom_control->details->has_max_zoom_level && zoom_level > zoom_control->details->max_zoom_level)
+		can_zoom = FALSE; /* no, we're beyond the upper zoom level. */
+
+	/* if we can zoom */
+	if (can_zoom) {	
 		gtk_signal_emit (GTK_OBJECT (zoom_control), signals[ZOOM_TO_LEVEL], zoom_level);
 	}
 }
 
 static GtkRadioMenuItem *
-create_zoom_menu_item (GtkMenu *menu, GtkWidget *widget, double zoom_level, GtkRadioMenuItem *previous_radio_item)
+create_zoom_menu_item (GtkMenu *menu, GtkWidget *widget, float zoom_level,
+		       GtkRadioMenuItem *previous_radio_item)
 {
 	GtkWidget *menu_item;
-	double	  *zoom_level_ptr;
-	char	  item_text[8];
+	gchar     *item_text;
+	double    *zoom_level_ptr;
 	NautilusZoomControl *zoom_control;
 	GSList	  *radio_item_group;
 
@@ -558,11 +572,12 @@ create_zoom_menu_item (GtkMenu *menu, Gt
 	 * to set toggle state of other radio items.
 	 */
 	zoom_control->details->marking_menu_items = TRUE;
-	
+
 	/* This is marked for localization in case the % sign is not
 	 * appropriate in some locale. I guess that's unlikely.
 	 */
-	g_snprintf (item_text, sizeof (item_text), _("%.0f%%"), 100.0 * zoom_level);
+	item_text = g_strdup_printf (_("%.0f%%"), 100.0 * zoom_level);
+
 	radio_item_group = previous_radio_item == NULL
 		? NULL
 		: gtk_radio_menu_item_group (previous_radio_item);
@@ -601,7 +616,7 @@ create_zoom_menu(GtkWidget *zoom_control
 
 	menu_item = NULL;
 	while (p != NULL) {
-		menu_item = create_zoom_menu_item (menu, zoom_control, * (double *) p->data, menu_item);
+		menu_item = create_zoom_menu_item (menu, zoom_control, *(float *) p->data, menu_item);
 		p = g_list_next (p);
 	}
 	
@@ -626,9 +641,13 @@ nautilus_zoom_control_button_press_event
 		return TRUE;	  
  	}
 	
-	if (event->x < (width / 3) && (zoom_control->details->zoom_level > zoom_control->details->min_zoom_level)) {
+	if ((event->x < (width / 3)) &&
+	    (!zoom_control->details->has_min_zoom_level ||
+	     (zoom_control->details->zoom_level > zoom_control->details->min_zoom_level))) {
 		gtk_signal_emit (GTK_OBJECT (widget), signals[ZOOM_OUT]);			
-	} else if ((event->x > ((2 * width) / 3)) && (zoom_control->details->zoom_level < zoom_control->details->max_zoom_level)) {
+	} else if ((event->x > ((2 * width) / 3)) &&
+		   (!zoom_control->details->has_max_zoom_level ||
+		    (zoom_control->details->zoom_level < zoom_control->details->max_zoom_level))) {
 		gtk_signal_emit (GTK_OBJECT (widget), signals[ZOOM_IN]);			
 	} else if ((event->x >= (center - (width >> 3))) && (event->x <= (center + (width >> 3)))) {
 		gtk_signal_emit (GTK_OBJECT (widget), signals[ZOOM_TO_FIT]);			
@@ -673,9 +692,13 @@ static gboolean nautilus_zoom_control_mo
 	center = width >> 1;
 
 	mode = PRELIGHT_NONE;
-	if (x_offset < (width / 3) && (zoom_control->details->zoom_level > zoom_control->details->min_zoom_level)) {
+	if ((x_offset < (width / 3)) &&
+	    (!zoom_control->details->has_min_zoom_level ||
+	     (zoom_control->details->zoom_level > zoom_control->details->min_zoom_level))) {
 		mode = PRELIGHT_MINUS;		
-	} else if ((x_offset > ((2 * width) / 3)) && (zoom_control->details->zoom_level < zoom_control->details->max_zoom_level)) {
+	} else if ((x_offset > ((2 * width) / 3)) &&
+		   (!zoom_control->details->has_max_zoom_level ||
+		    (zoom_control->details->zoom_level < zoom_control->details->max_zoom_level))) {
 		mode = PRELIGHT_PLUS;
 	} else if ((x_offset >= (center - (width >> 3))) && (x_offset <= (center + (width >> 3)))) {
 		mode = PRELIGHT_CENTER;
Index: src/nautilus-zoomable-frame-corba.c
===================================================================
RCS file: nautilus-zoomable-frame-corba.c
diff -N nautilus-zoomable-frame-corba.c
--- /tmp/cvscs5wSI	Sun Oct 22 09:05:07 2000
+++ /dev/null	Tue May  5 16:32:27 1998
@@ -1,114 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- *  Nautilus
- *
- *  Copyright (C) 1999, 2000 Red Hat, Inc.
- *  Copyright (C) 1999, 2000 Eazel, Inc.
- *
- *  Nautilus 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 of the
- *  License, or (at your option) any later version.
- *
- *  Nautilus 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *  Author: Elliot Lee <sopwith redhat com>
- *
- */
-
-/* nautilus-zoomable-frame-corba.c: CORBA server implementation of
-   Nautilus::ZoomableFrame interface of a nautilus ViewFrame. */
-
-#include <config.h>
-#include "nautilus-view-frame-private.h"
-
-#include <bonobo/bonobo-main.h>
-#include <gtk/gtksignal.h>
-#include <libnautilus/nautilus-bonobo-workarounds.h>
-
-typedef struct {
-	POA_Nautilus_ZoomableFrame servant;
-	gpointer bonobo_object;
-	
-	NautilusViewFrame *view;
-} impl_POA_Nautilus_ZoomableFrame;
-
-static void impl_Nautilus_ZoomableFrame_report_zoom_level_changed (PortableServer_Servant  servant,
-								   CORBA_float             level,
-								   CORBA_Environment      *ev);
-
-static POA_Nautilus_ZoomableFrame__epv impl_Nautilus_ZoomableFrame_epv =
-{
-	NULL,
-	impl_Nautilus_ZoomableFrame_report_zoom_level_changed,
-};
-
-static PortableServer_ServantBase__epv base_epv;
-static POA_Nautilus_ZoomableFrame__vepv impl_Nautilus_ZoomableFrame_vepv =
-{
-	&base_epv,
-	NULL,
-	&impl_Nautilus_ZoomableFrame_epv
-};
-
-static void
-impl_Nautilus_ZoomableFrame__destroy (BonoboObject *object, 
-                                      impl_POA_Nautilus_ZoomableFrame *servant)
-{
-	PortableServer_ObjectId *object_id;
-	CORBA_Environment ev;
-	
-	CORBA_exception_init (&ev);
-	
-	object_id = PortableServer_POA_servant_to_id (bonobo_poa (), servant, &ev);
-	PortableServer_POA_deactivate_object (bonobo_poa (), object_id, &ev);
-	CORBA_free (object_id);
-	object->servant = NULL;
-	
-	POA_Nautilus_ZoomableFrame__fini ((PortableServer_Servant) servant, &ev);
-	g_free (servant);
-	
-	CORBA_exception_free (&ev);
-}
-
-BonoboObject *
-impl_Nautilus_ZoomableFrame__create (NautilusViewFrame *view, 
-                                     CORBA_Environment * ev)
-{
-	BonoboObject *retval;
-	impl_POA_Nautilus_ZoomableFrame *newservant;
-	
-	newservant = g_new0 (impl_POA_Nautilus_ZoomableFrame, 1);
-	
-	impl_Nautilus_ZoomableFrame_vepv.Bonobo_Unknown_epv = nautilus_bonobo_object_get_epv ();
-	
-	newservant->servant.vepv = &impl_Nautilus_ZoomableFrame_vepv;
-	
-	newservant->view = view;
-	POA_Nautilus_ZoomableFrame__init ((PortableServer_Servant) newservant, ev);
-	
-	retval = bonobo_object_new_from_servant (newservant);
-	
-	gtk_signal_connect (GTK_OBJECT (retval), "destroy", 
-			    GTK_SIGNAL_FUNC (impl_Nautilus_ZoomableFrame__destroy), newservant);
-	
-	return retval;
-}
-
-static void
-impl_Nautilus_ZoomableFrame_report_zoom_level_changed (PortableServer_Servant servant,
-						       CORBA_float level,
-						       CORBA_Environment *ev)
-{
-	nautilus_view_frame_zoom_level_changed
-		(((impl_POA_Nautilus_ZoomableFrame *) servant)->view,
-		 level);
-}
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.312
diff -u -u -p -r1.312 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	2000/10/20 23:53:07	1.312
+++ src/file-manager/fm-directory-view.c	2000/10/22 13:05:05
@@ -33,6 +33,7 @@
 #include "fm-properties-window.h"
 #include "nautilus-trash-monitor.h"
 #include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-zoomable.h>
 #include <gtk/gtkcheckmenuitem.h>
 #include <gtk/gtkmain.h>
 #include <gtk/gtkmenu.h>
@@ -68,7 +69,6 @@
 #include <libnautilus-extensions/nautilus-string.h>
 #include <libnautilus-extensions/nautilus-view-identifier.h>
 #include <libnautilus/nautilus-bonobo-ui.h>
-#include <libnautilus/nautilus-zoomable.h>
 #include <math.h>
 #include <src/nautilus-application.h>
 
@@ -111,7 +111,7 @@ static guint signals[LAST_SIGNAL];
 struct FMDirectoryViewDetails
 {
 	NautilusView *nautilus_view;
-	NautilusZoomable *zoomable;
+	BonoboZoomable *zoomable;
 
 	NautilusDirectory *model;
 	NautilusFile *directory_as_file;
@@ -189,14 +189,14 @@ static void           open_one_in_new_wi
 										   gpointer                  callback_data);
 static void           open_one_properties_window                                  (gpointer                  data,
 										   gpointer                  callback_data);
-static void	      zoomable_set_zoom_level_callback				  (NautilusZoomable *zoomable,
-										   double level,
+static void	      zoomable_set_zoom_level_callback				  (BonoboZoomable *zoomable,
+										   float level,
 										   FMDirectoryView *view);
-static void           zoomable_zoom_in_callback                                   (NautilusZoomable         *zoomable,
+static void           zoomable_zoom_in_callback                                   (BonoboZoomable           *zoomable,
 										   FMDirectoryView          *directory_view);
-static void           zoomable_zoom_out_callback                                  (NautilusZoomable         *zoomable,
+static void           zoomable_zoom_out_callback                                  (BonoboZoomable           *zoomable,
 										   FMDirectoryView          *directory_view);
-static void           zoomable_zoom_to_fit_callback                               (NautilusZoomable         *zoomable,
+static void           zoomable_zoom_to_fit_callback                               (BonoboZoomable           *zoomable,
 										   FMDirectoryView          *directory_view);
 static void	      schedule_update_menus 					  (FMDirectoryView 	    *view);
 static void	      schedule_update_menus_callback				  (gpointer		     callback_data);
@@ -922,14 +922,14 @@ smooth_graphics_mode_changed_callback (g
 		 smooth_graphics_mode_changed, (view));
 }
 
-static double fm_directory_view_preferred_zoom_levels[] = {
-	(double) NAUTILUS_ICON_SIZE_SMALLEST	/ NAUTILUS_ICON_SIZE_STANDARD,
-	(double) NAUTILUS_ICON_SIZE_SMALLER	/ NAUTILUS_ICON_SIZE_STANDARD,
-	(double) NAUTILUS_ICON_SIZE_SMALL	/ NAUTILUS_ICON_SIZE_STANDARD,
-	(double) NAUTILUS_ICON_SIZE_STANDARD	/ NAUTILUS_ICON_SIZE_STANDARD,
-	(double) NAUTILUS_ICON_SIZE_LARGE	/ NAUTILUS_ICON_SIZE_STANDARD,
-	(double) NAUTILUS_ICON_SIZE_LARGER	/ NAUTILUS_ICON_SIZE_STANDARD,
-	(double) NAUTILUS_ICON_SIZE_LARGEST	/ NAUTILUS_ICON_SIZE_STANDARD,
+static float fm_directory_view_preferred_zoom_levels[] = {
+	(float) NAUTILUS_ICON_SIZE_SMALLEST	/ NAUTILUS_ICON_SIZE_STANDARD,
+	(float) NAUTILUS_ICON_SIZE_SMALLER	/ NAUTILUS_ICON_SIZE_STANDARD,
+	(float) NAUTILUS_ICON_SIZE_SMALL	/ NAUTILUS_ICON_SIZE_STANDARD,
+	(float) NAUTILUS_ICON_SIZE_STANDARD	/ NAUTILUS_ICON_SIZE_STANDARD,
+	(float) NAUTILUS_ICON_SIZE_LARGE	/ NAUTILUS_ICON_SIZE_STANDARD,
+	(float) NAUTILUS_ICON_SIZE_LARGER	/ NAUTILUS_ICON_SIZE_STANDARD,
+	(float) NAUTILUS_ICON_SIZE_LARGEST	/ NAUTILUS_ICON_SIZE_STANDARD
 };
 
 static void
@@ -945,13 +945,13 @@ fm_directory_view_initialize (FMDirector
 
 	directory_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (directory_view));
 
-	directory_view->details->zoomable = nautilus_zoomable_new_from_bonobo_control
-		(get_bonobo_control (directory_view),
-		 .25,
-		 4.0,
-		 FALSE,
-		 fm_directory_view_preferred_zoom_levels,
-		 NAUTILUS_N_ELEMENTS (fm_directory_view_preferred_zoom_levels));		
+	directory_view->details->zoomable = bonobo_zoomable_new ();
+	bonobo_zoomable_set_parameters_full (directory_view->details->zoomable,
+					     0.0, .25, 4.0, TRUE, TRUE, FALSE,
+					     fm_directory_view_preferred_zoom_levels, NULL,
+					     NAUTILUS_N_ELEMENTS (fm_directory_view_preferred_zoom_levels));
+	bonobo_object_add_interface (BONOBO_OBJECT (directory_view->details->nautilus_view),
+				     BONOBO_OBJECT (directory_view->details->zoomable));
 
 	gtk_signal_connect (GTK_OBJECT (directory_view->details->nautilus_view), 
 			    "stop_loading",
@@ -973,19 +973,19 @@ fm_directory_view_initialize (FMDirector
 
 	gtk_signal_connect (GTK_OBJECT (directory_view->details->zoomable), 
 			    "zoom_in",
-			    zoomable_zoom_in_callback,
+			    GTK_SIGNAL_FUNC (zoomable_zoom_in_callback),
 			    directory_view);
 	gtk_signal_connect (GTK_OBJECT (directory_view->details->zoomable), 
 			    "zoom_out", 
-			    zoomable_zoom_out_callback,
+			    GTK_SIGNAL_FUNC (zoomable_zoom_out_callback),
 			    directory_view);
 	gtk_signal_connect (GTK_OBJECT (directory_view->details->zoomable), 
 			    "set_zoom_level", 
-			    zoomable_set_zoom_level_callback,
+			    GTK_SIGNAL_FUNC (zoomable_set_zoom_level_callback),
 			    directory_view);
 	gtk_signal_connect (GTK_OBJECT (directory_view->details->zoomable), 
 			    "zoom_to_fit", 
-			    zoomable_zoom_to_fit_callback,
+			    GTK_SIGNAL_FUNC (zoomable_zoom_to_fit_callback),
 			    directory_view);
 	gtk_signal_connect_while_alive (GTK_OBJECT (nautilus_trash_monitor_get ()),
 				        "trash_state_changed",
@@ -1422,19 +1422,19 @@ zoom_default_callback (GtkMenuItem *item
 
 
 static void
-zoomable_zoom_in_callback (NautilusZoomable *zoomable, FMDirectoryView *directory_view)
+zoomable_zoom_in_callback (BonoboZoomable *zoomable, FMDirectoryView *directory_view)
 {
 	fm_directory_view_bump_zoom_level (directory_view, 1);
 }
 
 static void
-zoomable_zoom_out_callback (NautilusZoomable *zoomable, FMDirectoryView *directory_view)
+zoomable_zoom_out_callback (BonoboZoomable *zoomable, FMDirectoryView *directory_view)
 {
 	fm_directory_view_bump_zoom_level (directory_view, -1);
 }
 
 static NautilusZoomLevel
-nautilus_zoom_level_from_double(double zoom_level)
+nautilus_zoom_level_from_float(float zoom_level)
 {
 	int icon_size = floor(zoom_level * NAUTILUS_ICON_SIZE_STANDARD + 0.5);
 	
@@ -1456,13 +1456,13 @@ nautilus_zoom_level_from_double(double z
 }
 
 static void
-zoomable_set_zoom_level_callback (NautilusZoomable *zoomable, double level, FMDirectoryView *view)
+zoomable_set_zoom_level_callback (BonoboZoomable *zoomable, float level, FMDirectoryView *view)
 {
-	fm_directory_view_zoom_to_level (view, nautilus_zoom_level_from_double(level));
+	fm_directory_view_zoom_to_level (view, nautilus_zoom_level_from_float(level));
 }
 
 static void
-zoomable_zoom_to_fit_callback (NautilusZoomable *zoomable, FMDirectoryView *view)
+zoomable_zoom_to_fit_callback (BonoboZoomable *zoomable, FMDirectoryView *view)
 {
 	/* FIXME bugzilla.eazel.com 2388:
 	 * Need to really implement "zoom to fit"
@@ -1857,16 +1857,18 @@ fm_directory_view_zoom_to_level (FMDirec
 void
 fm_directory_view_set_zoom_level (FMDirectoryView *view, int zoom_level)
 {
+	float new_zoom_level;
+
 	g_return_if_fail (FM_IS_DIRECTORY_VIEW (view));
 
 	if (!fm_directory_view_supports_zooming (view)) {
 		return;
 	}
+
+	new_zoom_level = (float) nautilus_get_icon_size_for_zoom_level (zoom_level)
+		/ NAUTILUS_ICON_SIZE_STANDARD;
 
-	nautilus_zoomable_set_zoom_level
-		(view->details->zoomable,
-		 (double) nautilus_get_icon_size_for_zoom_level (zoom_level)
-		 / NAUTILUS_ICON_SIZE_STANDARD);
+	bonobo_zoomable_report_zoom_level_changed (view->details->zoomable, new_zoom_level);
 }
 
 /**
Index: src/nautilus-view-frame.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-view-frame.c,v
retrieving revision 1.100
diff -u -u -p -r1.100 nautilus-view-frame.c
--- src/nautilus-view-frame.c	2000/10/13 05:56:11	1.100
+++ src/nautilus-view-frame.c	2000/10/22 13:12:35
@@ -42,8 +42,10 @@
 #include <gtk/gtk.h>
 #include <libnautilus-extensions/nautilus-undo-manager.h>
 #include <libnautilus/nautilus-view.h>
-#include <libnautilus/nautilus-zoomable.h>
+#include <bonobo/bonobo-zoomable-frame.h>
+#include <bonobo/bonobo-zoomable.h>
 
+#include <liboaf/liboaf.h>
 
 
 enum {
@@ -248,17 +250,12 @@ nautilus_view_frame_destroy_client (Naut
 	gtk_container_remove (GTK_CONTAINER (view), view->client_widget);
 	view->client_widget = NULL;
 
-	if (!CORBA_Object_is_nil (view->zoomable, &ev)) {
-		bonobo_object_release_unref (view->zoomable, &ev);
-	}
-	view->zoomable = CORBA_OBJECT_NIL;
-
 	bonobo_object_unref (view->view_frame);
 	view->view_frame = NULL;
 	/* we can NULL those since we just unref'ed them 
 	   with the aggregate view frame. */
-	view->history_frame = CORBA_OBJECT_NIL;
-	view->zoomable_frame = CORBA_OBJECT_NIL;
+	view->history_frame = NULL;
+	view->zoomable_frame = NULL;
 
 	CORBA_exception_free (&ev);
 
@@ -596,6 +593,33 @@ check_if_view_is_gone (gpointer data)
 	return ok;
 }
 
+static void
+zoom_level_changed_cb (BonoboZoomableFrame *zframe, float zoom_level, NautilusViewFrame *view)
+{
+	g_return_if_fail (zframe != NULL);
+	g_return_if_fail (BONOBO_IS_ZOOMABLE_FRAME (zframe));
+	g_return_if_fail (view != NULL);
+	g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
+
+	gtk_signal_emit (GTK_OBJECT (view), signals[ZOOM_LEVEL_CHANGED], zoom_level);
+}
+
+static void
+zoom_parameters_changed_cb (BonoboZoomableFrame *zframe, NautilusViewFrame *view)
+{
+	float zoom_level;
+
+	g_return_if_fail (zframe != NULL);
+	g_return_if_fail (BONOBO_IS_ZOOMABLE_FRAME (zframe));
+	g_return_if_fail (view != NULL);
+	g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
+
+	zoom_level = bonobo_zoomable_frame_get_zoom_level (zframe);
+	if (zoom_level == 0.0)
+		return;
+	gtk_signal_emit (GTK_OBJECT (view), signals[ZOOM_LEVEL_CHANGED], zoom_level);
+}
+
 static gboolean
 nautilus_view_frame_set_to_component (NautilusViewFrame *view, BonoboObjectClient *component)
 {
@@ -603,8 +627,26 @@ nautilus_view_frame_set_to_component (Na
 	Nautilus_View adapted;
 	Bonobo_Control control;
 	BonoboControlFrame *control_frame;
-	
+	Bonobo_Zoomable zoomable;
+  	
+	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), FALSE);
+
+	CORBA_exception_init (&ev);
+
+	/* Add a zoomable frame interface. */
+	zoomable = bonobo_object_client_query_interface (component, "IDL:Bonobo/Zoomable:1.0", &ev);
+	if ((ev._major == CORBA_NO_EXCEPTION) && !CORBA_Object_is_nil (zoomable, &ev)) {
+		view->zoomable_frame = bonobo_zoomable_frame_new ();
+
+		gtk_signal_connect (GTK_OBJECT (view->zoomable_frame), "zoom_level_changed",
+				    GTK_SIGNAL_FUNC (zoom_level_changed_cb), view);
+		gtk_signal_connect (GTK_OBJECT (view->zoomable_frame), "zoom_parameters_changed",
+				    GTK_SIGNAL_FUNC (zoom_parameters_changed_cb), view);
 
+		bonobo_zoomable_frame_bind_to_zoomable (view->zoomable_frame, zoomable);
+		bonobo_object_release_unref (zoomable, &ev);
+	}
+
 	/* Either create an adapter or query for the Nautilus:View
 	 * interface. Either way, we don't need to keep the original
 	 * reference around once that happens.
@@ -613,7 +655,7 @@ nautilus_view_frame_set_to_component (Na
 	adapted = nautilus_component_adapter_factory_create_adapter 
 		(nautilus_component_adapter_factory_get (),
 		 component);
-	bonobo_object_unref (BONOBO_OBJECT (component));
+	bonobo_object_client_unref (component, NULL);
 
 	/* Handle case where we don't know how to host this component. */
   	if (adapted == CORBA_OBJECT_NIL) {
@@ -622,21 +664,15 @@ nautilus_view_frame_set_to_component (Na
 
 	nautilus_view_frame_destroy_client (view);
 
-	CORBA_exception_init (&ev);
-
 	/* Store the object away. */
 	view->client_object = bonobo_object_client_from_corba (adapted);
 	g_assert (!CORBA_Object_non_existent (adapted, &ev));
 
-
 	/* Get at our client's interfaces. */
 	control = bonobo_object_query_interface
 		(BONOBO_OBJECT (view->client_object),
 		 "IDL:Bonobo/Control:1.0");
 	g_assert (control != CORBA_OBJECT_NIL);
-	view->zoomable = bonobo_object_query_interface
-		(BONOBO_OBJECT (view->client_object), 
-		 "IDL:Nautilus/Zoomable:1.0");
 	
 	/* Start with a view frame interface. */
 	view->view_frame = impl_Nautilus_ViewFrame__create (view, &ev);
@@ -648,11 +684,13 @@ nautilus_view_frame_set_to_component (Na
 	bonobo_control_frame_bind_to_control (control_frame, control);
 	view->client_widget = bonobo_control_frame_get_widget (control_frame);
 
-	/* Add a zoomable frame interface. */
-	view->zoomable_frame = impl_Nautilus_ZoomableFrame__create (view, &ev);
-	bonobo_object_add_interface (BONOBO_OBJECT (view->view_frame), 
-	                             BONOBO_OBJECT (view->zoomable_frame));
+	if (view->zoomable_frame) {
+		bonobo_object_add_interface (BONOBO_OBJECT (view->view_frame), 
+					     BONOBO_OBJECT (view->zoomable_frame));
 
+		gtk_signal_emit_by_name (GTK_OBJECT (view->zoomable_frame), "zoom_parameters_changed");
+	}
+
 	/* Add a history frame interface. */
 	view->history_frame = impl_Nautilus_HistoryFrame__create (view, &ev);
 	bonobo_object_add_interface (BONOBO_OBJECT (view->view_frame), 
@@ -661,7 +699,7 @@ nautilus_view_frame_set_to_component (Na
 	/* Add an undo context interface. */
 	nautilus_undo_manager_add_interface
         	(view->undo_manager, BONOBO_OBJECT (view->view_frame));
-	
+
 	bonobo_object_release_unref (control, NULL);
 	
 	view->iid = g_strdup (view->details->activation_iid);
@@ -869,177 +907,100 @@ nautilus_view_frame_title_changed (Nauti
 gboolean
 nautilus_view_frame_is_zoomable (NautilusViewFrame *view)
 {
-	CORBA_Environment ev;
 	gboolean is_zoomable;
 	
-	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), FALSE);
+	is_zoomable = view->zoomable_frame != NULL;
 	
-	CORBA_exception_init (&ev);
-	is_zoomable = !CORBA_Object_is_nil (view->zoomable, &ev);
-	CORBA_exception_free (&ev);
-	
 	return is_zoomable;
 }
 
 gdouble
 nautilus_view_frame_get_zoom_level (NautilusViewFrame *view)
 {
-	CORBA_Environment ev;
-	double level;
-	
-	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), 0);
-	
-	CORBA_exception_init (&ev);
-	
-	if (!CORBA_Object_is_nil (view->zoomable, &ev)) {
-		level = Nautilus_Zoomable__get_zoom_level (view->zoomable, &ev);
-	} else {
-		level = 1.0;
-	}
+	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), 0.0);
 
-	CORBA_exception_free (&ev);
-	
-	return level;
+	if (view->zoomable_frame == NULL)
+		return 0.0;
+
+	return (gdouble) bonobo_zoomable_frame_get_zoom_level (view->zoomable_frame);
 }
 
 void
 nautilus_view_frame_set_zoom_level (NautilusViewFrame *view,
 				    double zoom_level)
 {
-	CORBA_Environment ev;
-	
 	g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
-	
-	CORBA_exception_init (&ev);
-	
-	if (!CORBA_Object_is_nil (view->zoomable, &ev)) {
-		Nautilus_Zoomable__set_zoom_level (view->zoomable, zoom_level, &ev);
-	} else {
-		/* do nothing */
-	}
-	
-	CORBA_exception_free (&ev);
+
+	if (view->zoomable_frame == NULL)
+		return;
+
+	bonobo_zoomable_frame_set_zoom_level (view->zoomable_frame, (float) zoom_level);
 }
 
 gdouble
 nautilus_view_frame_get_min_zoom_level (NautilusViewFrame *view)
 {
-	CORBA_Environment ev;
-	double level;
-	
-	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), 0);
-	
-	CORBA_exception_init (&ev);
-	
-	if (!CORBA_Object_is_nil (view->zoomable, &ev)) {
-		level = Nautilus_Zoomable__get_min_zoom_level (view->zoomable, &ev);
-	} else {
-		level = 1.0;
-	}
-	
-	CORBA_exception_free (&ev);
-	
-	return level;
+	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), 0.0);
+
+	if (view->zoomable_frame == NULL)
+		return 0.0;
+
+	return (gdouble) bonobo_zoomable_frame_get_min_zoom_level (view->zoomable_frame);
 }
 
 double
 nautilus_view_frame_get_max_zoom_level (NautilusViewFrame *view)
 {
-	CORBA_Environment ev;
-	double level;
-	
-	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), 0);
-	
-	CORBA_exception_init (&ev);
-	
-	if (!CORBA_Object_is_nil (view->zoomable, &ev)) {
-		level = Nautilus_Zoomable__get_max_zoom_level (view->zoomable, &ev);
-	} else {
-		level = 1.0;
-	}
-	
-	CORBA_exception_free (&ev);
+	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), 0.0);
 	
-	return level;
+	if (view->zoomable_frame == NULL)
+		return 0.0;
+
+	return (gdouble) bonobo_zoomable_frame_get_max_zoom_level (view->zoomable_frame);
 }
 
 GList *
 nautilus_view_frame_get_preferred_zoom_levels (NautilusViewFrame *view)
 {
-	CORBA_Environment ev;
-	GList *levels;
-	Nautilus_ZoomLevelList *zoom_levels;
-	
-	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), 0);
-	
-	CORBA_exception_init (&ev);
-	
-	if (!CORBA_Object_is_nil (view->zoomable, &ev)) {
-		zoom_levels = Nautilus_Zoomable__get_preferred_zoom_levels (view->zoomable, &ev);
-		levels = nautilus_g_list_from_ZoomLevelList (zoom_levels);
-		CORBA_free (zoom_levels);
-		
-	} else {
-		levels = NULL;
-	}
-	
-	CORBA_exception_free (&ev);
-	
-	return levels;
+	g_return_val_if_fail (NAUTILUS_IS_VIEW_FRAME (view), NULL);
+
+	if (view->zoomable_frame == NULL)
+		return NULL;
+
+	return bonobo_zoomable_frame_get_preferred_zoom_levels (view->zoomable_frame);
 }
 
 void
 nautilus_view_frame_zoom_in (NautilusViewFrame *view)
 {
-	CORBA_Environment ev;
-	
 	g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
-	
-	CORBA_exception_init (&ev);
-	
-	if (!CORBA_Object_is_nil (view->zoomable, &ev)) {
-		Nautilus_Zoomable_zoom_in (view->zoomable, &ev);
-	} else {
-		/* do nothing */
-	}
-	
-	CORBA_exception_free (&ev);
+
+	if (view->zoomable_frame == NULL)
+		return;
+
+	bonobo_zoomable_frame_zoom_in (view->zoomable_frame);
 }
 
 void
 nautilus_view_frame_zoom_out (NautilusViewFrame *view)
 {
-	CORBA_Environment ev;
-	
 	g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
-	
-	CORBA_exception_init (&ev);
 	
-	if (!CORBA_Object_is_nil (view->zoomable, &ev)) {
-		Nautilus_Zoomable_zoom_out (view->zoomable, &ev);
-	} else {
-		/* do nothing */
-	}
-	
-	CORBA_exception_free (&ev);
+	if (view->zoomable_frame == NULL)
+		return;
+
+	bonobo_zoomable_frame_zoom_out (view->zoomable_frame);
 }
 
 void
 nautilus_view_frame_zoom_to_fit (NautilusViewFrame *view)
 {
-	CORBA_Environment ev;
-	
 	g_return_if_fail (NAUTILUS_IS_VIEW_FRAME (view));
 	
-	CORBA_exception_init (&ev);
-	
-	if (!CORBA_Object_is_nil (view->zoomable, &ev)) {
-		Nautilus_Zoomable_zoom_to_fit (view->zoomable, &ev);
-	} else {
-		/* do nothing */
-	}
-	
-	CORBA_exception_free (&ev);
+	if (view->zoomable_frame == NULL)
+		return;
+
+	bonobo_zoomable_frame_zoom_to_fit (view->zoomable_frame);
 }
 
 const char *
-- 
Martin Baulig
martin gnome org (private)
baulig suse de (work)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]