![]() |
![]() |
![]() |
Libgnomedb Reference Manual | ![]() |
---|---|---|---|---|
GnomeDbCanvasGnomeDbCanvas — Base class for all the GnomeCanvas derived widgets in libgnomedb. |
GnomeDbCanvas; GType gnome_db_canvas_get_type (void); GnomeDbGraph* gnome_db_canvas_get_graph (GnomeDbCanvas *canvas); GtkWidget* gnome_db_canvas_set_in_scrolled_window (GnomeDbCanvas *canvas); void gnome_db_canvas_declare_item (GnomeDbCanvas *canvas, GnomeDbCanvasItem *item); GnomeDbCanvasItem* gnome_db_canvas_get_item_for_object (GnomeDbCanvas *canvas, GnomeDbBase *ref_obj); void gnome_db_canvas_set_zoom_factor (GnomeDbCanvas *canvas, gdouble n); gdouble gnome_db_canvas_get_zoom_factor (GnomeDbCanvas *canvas); gdouble gnome_db_canvas_fit_zoom_factor (GnomeDbCanvas *canvas);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkLayout +----GnomeCanvas +----GnomeDbCanvas +----GnomeDbCanvasDbRelations +----GnomeDbCanvasQueryStruct
"drag-action" void user_function (GnomeDbCanvas *dbcanvas, gpointer arg1, gpointer arg2, gpointer user_data) : Run first
This abstract class adds some basic functionnalities on top of the GnomeCanvas canvas such as:
synchronisation with a GnomeDbGraph object (to be able to save the position of each canvas item) and management of the list of items drawn on the canvas.
zoom settings
The GnomeDbCanvas widget can be used with or without any associated GnomeDbGraph object.
GnomeDbGraph* gnome_db_canvas_get_graph (GnomeDbCanvas *canvas);
canvas : |
|
Returns : |
GtkWidget* gnome_db_canvas_set_in_scrolled_window (GnomeDbCanvas *canvas);
Creates a new GtkScrolledWindow object and put canvas
in it. canvas
can be retreived using a "canvas" user property of
the new scrolled window.
canvas : |
a GnomeDbCanvas widget |
Returns : | the new scrolled window. |
void gnome_db_canvas_declare_item (GnomeDbCanvas *canvas, GnomeDbCanvasItem *item);
Declares item
to be listed by canvas
as one of its items.
This functions should be called after each GnomeDbCanvasItem is added to
canvas
.
If it was not called for one item, then that item won't be used
in canvas
's computations (no drag and drop, cleanup, etc).
canvas : |
a GnomeDbCanvas widget |
item : |
a GnomeDbCanvasItem object |
GnomeDbCanvasItem* gnome_db_canvas_get_item_for_object (GnomeDbCanvas *canvas, GnomeDbBase *ref_obj);
Get the GnomeDbCanvasItem corresponding to obj
;
canvas : |
a GnomeDbCanvas widget |
ref_obj : |
|
Returns : |
void gnome_db_canvas_set_zoom_factor (GnomeDbCanvas *canvas, gdouble n);
Sets the zooming factor of a canvas by specifying the number of pixels that correspond to one canvas unit. A zoom factor of 1.0 is the default value; greater than 1.0 makes a zoom in and lower than 1.0 makes a zoom out.
canvas : |
a GnomeDbCanvas widget |
n : |
the zoom factor |
gdouble gnome_db_canvas_get_zoom_factor (GnomeDbCanvas *canvas);
Get the current zooming factor of a canvas.
canvas : |
a GnomeDbCanvas widget |
Returns : | the zooming factor. |
gdouble gnome_db_canvas_fit_zoom_factor (GnomeDbCanvas *canvas);
Compute and set the correct zoom factor so that all the items on canvas
can be displayed
at once.
canvas : |
a GnomeDbCanvas widget |
Returns : | the new zooming factor. |
void user_function (GnomeDbCanvas *dbcanvas, gpointer arg1, gpointer arg2, gpointer user_data) : Run first
dbcanvas : |
the object which received the signal. |
arg1 : |
|
arg2 : |
|
user_data : |
user data set when the signal handler was connected. |