AdgGtkArea — A GtkWidget specifically designed to contain an AdgCanvas entity
AdgGtkArea; GtkWidget * adg_gtk_area_new (void); GtkWidget * adg_gtk_area_new_with_canvas (AdgCanvas *canvas); void adg_gtk_area_set_canvas (AdgGtkArea *area, AdgCanvas *canvas); AdgCanvas * adg_gtk_area_get_canvas (AdgGtkArea *area); void adg_gtk_area_set_factor (AdgGtkArea *area, gdouble factor); gdouble adg_gtk_area_get_factor (AdgGtkArea *area);
GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkDrawingArea
+----AdgGtkArea
This is a GtkDrawingArea derived object that provides an easy way
to show an ADG based canvas. The associated canvas can be set
directly with the adg_gtk_area_new_with_canvas() constructor
function or by using adg_gtk_area_set_canvas().
The default minimum size of this widget will depend on the canvas content. The global matrix of the AdgCanvas will be adjusted to expose the drawing in the proper position. The empty space around the drawing can be changed by setting the "top-margin", "right-margin", "bottom-margin" and "left-margin" properties or by using the equivalent setter methods.
The default implementation reacts to some mouse events: if you drag the mouse keeping the wheel pressed the canvas will be translated; if the mouse wheel is rotated the canvas will be scaled up or down (accordingly to the wheel direction) by the factor specified in the "factor" property.
typedef struct _AdgGtkArea AdgGtkArea;
All fields are private and should not be used directly. Use its public methods instead.
GtkWidget * adg_gtk_area_new (void);
Creates a new empty AdgGtkArea. The widget is useful only after
an AdgCanvas has been added either using the "canvas"
property or with adg_gtk_area_set_canvas().
|
Returns : |
the newly created widget |
GtkWidget * adg_gtk_area_new_with_canvas (AdgCanvas *canvas);
Creates a new AdgGtkArea and sets the "canvas" property
to canvas.
|
|
the AdgCanvas shown by this widget |
|
Returns : |
the newly created widget |
void adg_gtk_area_set_canvas (AdgGtkArea *area, AdgCanvas *canvas);
Sets a new canvas on area. The old canvas, if presents, is
unreferenced.
|
|
an AdgGtkArea |
|
|
the new AdgCanvas |
AdgCanvas * adg_gtk_area_get_canvas (AdgGtkArea *area);
Gets the canvas associated to area.
|
|
an AdgGtkArea |
|
Returns : |
the requested AdgCanvas object or NULL on errors |
void adg_gtk_area_set_factor (AdgGtkArea *area, gdouble factor);
Sets a new zoom factor to area. If the factor is less than
1, it will be clamped to 1.
|
|
an AdgGtkArea |
|
|
the new zoom factor |
gdouble adg_gtk_area_get_factor (AdgGtkArea *area);
Gets the zoom factor associated to area. The zoom factor is
directly used to zoom in (that is, the default zoom factor of
1.05 will zoom of 5% every iteration) and it is reversed while
zooming out (that is, the default factor will use 1/1.05).
|
|
an AdgGtkArea |
|
Returns : |
the requested zoom factor or 0 on error |
"canvas-changed" signalvoid user_function (AdgGtkArea *area, gpointer user_data) : Run Last / No Recursion
Emitted when the AdgGtkArea has a new canvas.
|
|
an AdgGtkArea |
|
|
user data set when the signal handler was connected. |
AdgGtkAreawas last modified by gtk-doc on Sat 24 Jul 2010 09:35:28 AM CEST