Re: Proposal of a Bonobo::Zoomable interface



Martin Baulig <martin home-of-linux org> writes:

> Darin Adler <darin eazel com> writes:
> 
> > on 9/26/00 8:14 AM, Martin Baulig at martin home-of-linux org wrote:
> > 
> > > This is basically copied from Nautilus::Zoomable, but I added a way to
> > > find out whether there is a minimum/maximum zoom level (`has_min_zoom_level').
> > > 
> > > How do you like this ?
> > 
> > We (the Nautilus team) would love to see the Zoomable interface in Bonobo.
> > Martin's proposal leaves out the ZoomableFrame interface, which is used by
> > the object to report zoom level changes to the container.
> 
> Well, this whole thing started at the hotel bar in Nuernberg for me since
> I wanted to add zooming to the eog component when it is used in nautilus.
> After reading some Nautilus source code and drinking some Pinacolada's I
> realized that it'd be a mess to require -lnautilus for every single component
> which wants to be zoomable in Nautilus and that the only clean way to do this
> is to do this in Bonobo .... :-)
> 
> >     /* A zoomable has the responsibility to look for this
> >      * interface on its Bonobo 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);
> >     };
> 
> Oh, yes. I'm gonna implement this as well.
> 
> In the Bonobo GTK-Object abstraction layer, this also becomes quite useful
> when you want to invoke methods on the Bonobo::Zoomable, for instance
> 
>         void    bonobo_zoomable_frame_zoom_in   (BonoboZoomableFrame *frame);
> 
> which will then talk to the component's Bonobo::Zoomable CORBA object.
> 

One other thing to look out for: right now, the Nautilus::Zoomable
interface depends on being add_interface'd to a Bonobo::Cotrol to work
well, since the implementation gets at the ZoomableFrame by doing a
query_interface on the Control's ControlFrame. While this keeps things
relatively simple and convenient for Nautilus, where we know Controls
are the only thing we care about, the concept of zooming is actually
more general than that, and could in theory apply to things that don't
even have a GUI. So perhaps it would make more sense to add an
explicit set_zoomable_frame call (and perhaps rebame ZoomableFrame to
ZoomableListener or something).

Another alternative is to use PropertyBags and listeners as Torsten
suggested; one thing that's a down side to that is that important more
of the interface will be defined only by convention and not by
IDL. This would require the client to handle more possible exceptional
cases, such as one of the zoomable properties not being set in the
property bag, or being set to the wrong type.

 - Maciej




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