![]() |
![]() |
![]() |
Libgnomedb 4.0 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
GnomeDbCanvasGnomeDbCanvas — Base class for all the GnomeCanvas derived widgets in libgnomedb. |
GnomeDbCanvas; GnomeDbCanvasClass; 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); 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); gboolean gnome_db_canvas_auto_layout_enabled (GnomeDbCanvas *canvas); void gnome_db_canvas_perform_auto_layout (GnomeDbCanvas *canvas, gboolean animate, GnomeDbCanvasLayoutAlgorithm algorithm); void gnome_db_canvas_center (GnomeDbCanvas *canvas);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GooCanvas +----GnomeDbCanvas
This abstract class adds some basic functionnalities on top of the GnomeCanvas canvas such as:
synchronisation with a GdaGraph 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 GdaGraph object.
typedef struct { GooCanvasClass parent_class; /* virtual functions */ void (*create_canvas_items) (GnomeDbCanvas *canvas); /* create individual GnomeDbCanvasItem objects */ void (*clean_canvas_items) (GnomeDbCanvas *canvas); /* clean any extra structure, not the individual items */ void (*graph_item_added) (GnomeDbCanvas *canvas, GnomeDbGraphItem *item); void (*graph_item_dropped) (GnomeDbCanvas *canvas, GnomeDbGraphItem *item); GtkWidget *(*build_context_menu) (GnomeDbCanvas *canvas); /* signals */ void (*drag_action) (GnomeDbCanvas *canvas, GnomeDbCanvasItem *from_item, GnomeDbCanvasItem *to_item); } GnomeDbCanvasClass;
GnomeDbGraph * gnome_db_canvas_get_graph (GnomeDbCanvas *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 retrieved using a "canvas" user property of
the new scrolled window.
|
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).
|
a GnomeDbCanvas widget |
|
a GnomeDbCanvasItem object |
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.
|
a GnomeDbCanvas widget |
|
the zoom factor |
gdouble gnome_db_canvas_get_zoom_factor (GnomeDbCanvas *canvas);
Get the current zooming factor of a 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.
|
a GnomeDbCanvas widget |
Returns : |
the new zooming factor. |
gboolean gnome_db_canvas_auto_layout_enabled (GnomeDbCanvas *canvas);
Tells if canvas
has the possibility to automatically adjust its layout
using the GraphViz library.
|
a GnomeDbCanvas widget |
Returns : |
TRUE if canvas can automatically adjust its layout
|
void gnome_db_canvas_perform_auto_layout (GnomeDbCanvas *canvas, gboolean animate, GnomeDbCanvasLayoutAlgorithm algorithm);
|
|
|
|
|
void gnome_db_canvas_center (GnomeDbCanvas *canvas);
Centers the display on the layout
|
a GnomeDbCanvas widget |
"drag-action"
signalvoid user_function (GnomeDbCanvas *dbcanvas, gpointer arg1, gpointer arg2, gpointer user_data) : Run First
|
the object which received the signal. |
|
|
|
|
|
user data set when the signal handler was connected. |