Bonobo API Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# BonoboZoomable

## Name

BonoboZoomable -- An interface for Controls that can zoom their contents

## Synopsis

    typedef     BonoboZoomable;
    typedef     BonoboZoomableClass;
    POA_Bonobo_Zoomable__epv* bonobo_zoomable_get_epv
                                                (void);
    Bonobo_Zoomable bonobo_zoomable_corba_object_create
                                                (BonoboObject *object);
    BonoboZoomable* bonobo_zoomable_new         (void);
    BonoboZoomable* bonobo_zoomable_construct   (BonoboZoomable *zoomable,
                                                 Bonobo_Zoomable corba_zoomable);
    void        bonobo_zoomable_set_parameters  (BonoboZoomable *zoomable,
                                                 float zoom_level,
                                                 float min_zoom_level,
                                                 float max_zoom_level,
                                                 gboolean has_min_zoom_level,
                                                 gboolean has_max_zoom_level);
    void        bonobo_zoomable_set_parameters_full
                                                (BonoboZoomable *zoomable,
                                                 float zoom_level,
                                                 float min_zoom_level,
                                                 float max_zoom_level,
                                                 gboolean has_min_zoom_level,
                                                 gboolean has_max_zoom_level,
                                                 gboolean is_continuous,
                                                 float *preferred_zoom_levels,
                                                 const gchar **preferred_zoom_level_names,
                                                 gint num_preferred_zoom_levels);
    void        bonobo_zoomable_report_zoom_level_changed
                                                (BonoboZoomable *zoomable,
                                                 float new_zoom_level);
    void        bonobo_zoomable_report_zoom_parameters_changed
                                                (BonoboZoomable *zoomable);
    void        bonobo_zoomable_add_preferred_zoom_level
                                                (BonoboZoomable *zoomable,
                                                 float zoom_level,
                                                 const gchar *zoom_level_name);

## Description

## Details

### BonoboZoomable

    typedef struct {
            BonoboObject		object;

    	BonoboZoomablePrivate	*priv;
    } BonoboZoomable;

### BonoboZoomableClass

    typedef struct {
    	BonoboObjectClass	parent;

    	void (*set_frame)	(BonoboZoomable *zoomable);
    	void (*set_zoom_level)	(BonoboZoomable *zoomable,
    				 float zoom_level);

    	void (*zoom_in)		(BonoboZoomable *zoomable);
    	void (*zoom_out)	(BonoboZoomable *zoomable);
    	void (*zoom_to_fit)	(BonoboZoomable *zoomable);
    	void (*zoom_to_default)	(BonoboZoomable *zoomable);
    } BonoboZoomableClass;

### bonobo_zoomable_get_epv ()

    POA_Bonobo_Zoomable__epv* bonobo_zoomable_get_epv
                                                (void);

Returns : | The EPV for the default BonoboZoomable implementation.

### bonobo_zoomable_corba_object_create ()

    Bonobo_Zoomable bonobo_zoomable_corba_object_create
                                                (BonoboObject *object);

`object` : |
Returns : |

### bonobo_zoomable_new ()

    BonoboZoomable* bonobo_zoomable_new         (void);

Create a new bonobo-zoomable implementing BonoboObject interface.

Returns : |

### bonobo_zoomable_construct ()

    BonoboZoomable* bonobo_zoomable_construct   (BonoboZoomable *zoomable,
                                                 Bonobo_Zoomable corba_zoomable);

Construct a newly created BonoboZoomable pointed to by `zoomable`, and associate it with `corba_p`

`zoomable` : | the zoomable
`corba_zoomable` : |
Returns : | a newly constructed zoomable or NULL on error

### bonobo_zoomable_set_parameters ()

    void        bonobo_zoomable_set_parameters  (BonoboZoomable *zoomable,
                                                 float zoom_level,
                                                 float min_zoom_level,
                                                 float max_zoom_level,
                                                 gboolean has_min_zoom_level,
                                                 gboolean has_max_zoom_level);

This is a simple version of @bonobo_zoomable_set_parameters_full() for components which support continuous zooming. It does not override any of the parameters which can only be set by the _full version.

`zoomable` : |
`zoom_level` : |
`min_zoom_level` : |
`max_zoom_level` : |
`has_min_zoom_level` : |
`has_max_zoom_level` : |

### bonobo_zoomable_set_parameters_full ()

    void        bonobo_zoomable_set_parameters_full
                                                (BonoboZoomable *zoomable,
                                                 float zoom_level,
                                                 float min_zoom_level,
                                                 float max_zoom_level,
                                                 gboolean has_min_zoom_level,
                                                 gboolean has_max_zoom_level,
                                                 gboolean is_continuous,
                                                 float *preferred_zoom_levels,
                                                 const gchar **preferred_zoom_level_names,
                                                 gint num_preferred_zoom_levels);

This is used by the component to set new zooming parameters (and to set the initial zooming parameters including the initial zoom level after creating the BonoboZoomable) - for instance after loading a new file.

If any of the zoom parameters such as the minimum or maximum zoom level has changed, it is likely that the zoom level has become invalid as well - at least, the container must query it in any case, so we set it here.

`zoomable` : |
`zoom_level` : |
`min_zoom_level` : |
`max_zoom_level` : |
`has_min_zoom_level` : |
`has_max_zoom_level` : |
`is_continuous` : |
`preferred_zoom_levels` : |
`preferred_zoom_level_names` : |
`num_preferred_zoom_levels` : |

### bonobo_zoomable_report_zoom_level_changed ()

    void        bonobo_zoomable_report_zoom_level_changed
                                                (BonoboZoomable *zoomable,
                                                 float new_zoom_level);

`new_zoom_level`: The new zoom level.

Reports the BonoboZoomableFrame that the zoom level has changed (but the other zoom parameters are still the same).

This is called after the component has successfully completed a zooming operation - the `new_zoom_level` may have been modified from what the container requested to match what the component actually displays at the moment.

`zoomable` : |
`new_zoom_level` : |

### bonobo_zoomable_report_zoom_parameters_changed ()

    void        bonobo_zoomable_report_zoom_parameters_changed
                                                (BonoboZoomable *zoomable);

Reports the BonoboZoomableFrame that the zoom parameters have changed; this also includes the zoom level.

On the container side (the BonoboZoomableFrame) this implies that the zoom level has changed as well, so you need to query the BonoboZoomable for the new zoom level as well.

`zoomable` : |

### bonobo_zoomable_add_preferred_zoom_level ()

    void        bonobo_zoomable_add_preferred_zoom_level
                                                (BonoboZoomable *zoomable,
                                                 float zoom_level,
                                                 const gchar *zoom_level_name);

This appends a new zoom level's name and value to the internal list of these.

`zoomable` : | the zoomable
`zoom_level` : | the new level
`zoom_level_name` : | the new level's name

<<< Previous Page | Home | Up | Next Page >>>
Strange stuff | BonoboZoomableFrame