![]() | ![]() | ![]() | DiaCanvas2 Reference Manual | ![]() |
---|
DiaCanvasViewDiaCanvasView — Create a view of a DiaCanvas model. |
#define DIA_CANVAS_VIEW (obj) DiaCanvasView; #define DIA_CANVAS_VIEW_ITEM_VISIBLE (obj) GtkWidget* dia_canvas_view_new (DiaCanvas *canvas, gboolean aa); GtkWidget* dia_canvas_view_aa_new (void); void dia_canvas_view_set_zoom (DiaCanvasView *view, gdouble zoom); gdouble dia_canvas_view_get_zoom (DiaCanvasView *view); void dia_canvas_view_set_canvas (DiaCanvasView *view, DiaCanvas *canvas); void dia_canvas_view_unset_canvas (DiaCanvasView *view); DiaCanvas* dia_canvas_view_get_canvas (DiaCanvasView *view); void dia_canvas_view_select_rectangle (DiaCanvasView *view, DiaRectangle *rect); void dia_canvas_view_request_update (DiaCanvasView *view); void dia_canvas_view_set_tool (DiaCanvasView *view, DiaTool *tool); DiaTool* dia_canvas_view_get_tool (DiaCanvasView *view); void dia_canvas_view_set_default_tool (DiaCanvasView *view, DiaTool *tool); DiaTool* dia_canvas_view_get_default_tool (DiaCanvasView *view); void dia_canvas_view_select (DiaCanvasView *view, DiaCanvasViewItem *item); void dia_canvas_view_select_all (DiaCanvasView *view); void dia_canvas_view_unselect (DiaCanvasView *view, DiaCanvasViewItem *item); void dia_canvas_view_unselect_all (DiaCanvasView *view); void dia_canvas_view_focus (DiaCanvasView *view, DiaCanvasViewItem *item); void dia_canvas_view_move (DiaCanvasView *view, gdouble dx, gdouble dy, DiaCanvasViewItem *originator); DiaCanvasViewItem* dia_canvas_view_find_view_item (DiaCanvasView *view, DiaCanvasItem *item); void dia_canvas_view_gdk_event_to_dia_event (DiaCanvasView *view, DiaCanvasViewItem *item, GdkEvent *gdk_event, gpointer dia_event); DiaCanvasView* dia_canvas_view_get_active_view (void);
GObject +----GtkObject +----GtkWidget +----GtkContainer +----GtkLayout +----GnomeCanvas +----DiaCanvasView
"aa" gboolean : Read / Write "active-view" DiaCanvasView : Read "canvas" DiaCanvas : Read / Write "default-tool" DiaTool : Read / Write "tool" DiaTool : Read / Write "zoom" gdouble : Read / Write
"focus-item" void user_function (DiaCanvasView *diacanvasview, DiaCanvasViewItem *arg1, gpointer user_data); "select-item" void user_function (DiaCanvasView *diacanvasview, DiaCanvasViewItem *arg1, gpointer user_data); "unselect-item" void user_function (DiaCanvasView *diacanvasview, DiaCanvasViewItem *arg1, gpointer user_data);
#define DIA_CANVAS_VIEW(obj) (GTK_CHECK_CAST ((obj), DIA_TYPE_CANVAS_VIEW, DiaCanvasView))
obj : |
typedef struct _DiaCanvasView DiaCanvasView;
Visual (interactive) representation of a diagram (DiaCanvas).
#define DIA_CANVAS_VIEW_ITEM_VISIBLE(obj) ((GTK_OBJECT_FLAGS (obj) & GNOME_CANVAS_ITEM_VISIBLE) != 0)
obj : |
GtkWidget* dia_canvas_view_new (DiaCanvas *canvas, gboolean aa);
Create a new DiaCanvasView object. In most cases you want to set aa to TRUE, since it has the most complete renderer and the best quality.
canvas : | A DiaCanvas that contains data that is to be visualized (may be NULL). |
aa : | OBSOLETE. An Anti-alias canvas is created anyway. |
Returns : | A newly create DiaCanvasView. |
GtkWidget* dia_canvas_view_aa_new (void);
Create a new anti-aliased canvas. Note that no DiaCanvas object is yet connected to the canvas view.
Returns : | A newly created DiaCanvasView. |
void dia_canvas_view_set_zoom (DiaCanvasView *view, gdouble zoom);
Set the zoom factor for the canvas. 1.0 means 100%.
view : | |
zoom : |
gdouble dia_canvas_view_get_zoom (DiaCanvasView *view);
Get the zoom factor for the view.
view : | |
Returns : |
void dia_canvas_view_set_canvas (DiaCanvasView *view, DiaCanvas *canvas);
Set the canvas to be visualized by view. You can only set a canvas if the view doesn't already have a canvas.
view : | |
canvas : |
void dia_canvas_view_unset_canvas (DiaCanvasView *view);
Disconnect the view from it's DiaCanvas.
view : |
DiaCanvas* dia_canvas_view_get_canvas (DiaCanvasView *view);
Get the DiaCanvas that is displayed in the view.
view : | |
Returns : | The canvas. |
void dia_canvas_view_select_rectangle (DiaCanvasView *view, DiaRectangle *rect);
Select all object whose bounding box is within rect.
view : | |
rect : |
void dia_canvas_view_request_update (DiaCanvasView *view);
Request an update for all items on the canvas. All shapes will be set to update state too.
view : |
void dia_canvas_view_set_tool (DiaCanvasView *view, DiaTool *tool);
Set a tool to use by this canvas view. Tools are used to override the default behavior of the view. tool may be NULL, so the tool is removed from the view.
view : | |
tool : | The DiaTool |
DiaTool* dia_canvas_view_get_tool (DiaCanvasView *view);
view : | |
Returns : | The tool or NULL if no tool is set. |
void dia_canvas_view_set_default_tool (DiaCanvasView *view, DiaTool *tool);
Set the default tool for the view. The default tool is used to do the default behavior for the view, such as moving handles and editing the diagram items.
This tool is used if no tool is set via dia_canvas_view_set_tool().
view : | |
tool : |
DiaTool* dia_canvas_view_get_default_tool (DiaCanvasView *view);
view : | |
Returns : | the default tool |
void dia_canvas_view_select (DiaCanvasView *view, DiaCanvasViewItem *item);
Select item. If the item is a composite item (item->item has DIA_COMPOSITE set), the parent is selected.
view : | |
item : |
void dia_canvas_view_select_all (DiaCanvasView *view);
Select all items on the canvas.
view : |
void dia_canvas_view_unselect (DiaCanvasView *view, DiaCanvasViewItem *item);
Unselect root and all children of root. If one of the selected items has the focus, it is de-focused.
view : | DiaCanvasView |
item : |
void dia_canvas_view_unselect_all (DiaCanvasView *view);
Do a dia_canvas_view_unselect() for all items in the canvas view.
view : |
void dia_canvas_view_focus (DiaCanvasView *view, DiaCanvasViewItem *item);
Set the focus to item. If item is not an interactive item, the focus is set to NULL.
view : | |
item : | Item to focus, may be NULL (no focused object). |
void dia_canvas_view_move (DiaCanvasView *view, gdouble dx, gdouble dy, DiaCanvasViewItem *originator);
Move all selected items.
view : | |
dx : | movement |
dy : | |
originator : | the object that recieved the event resulting in the movement. |
DiaCanvasViewItem* dia_canvas_view_find_view_item (DiaCanvasView *view, DiaCanvasItem *item);
Find the DiaCanvasViewItem that visualizes item.
view : | |
item : | Item to find. |
Returns : | The view item or NULL. |
void dia_canvas_view_gdk_event_to_dia_event (DiaCanvasView *view, DiaCanvasViewItem *item, GdkEvent *gdk_event, gpointer dia_event);
DEPRICATED
Convert a GdkEvent to a DiaEvent. DiaCanvasItem's can recieve mouse and keyboard events.
A transformation is done from the window coorsinates to item coordinates.
view : | |
item : | |
gdk_event : | The GdkEvent as it was received by the view. |
dia_event : |
DiaCanvasView* dia_canvas_view_get_active_view (void);
This function returns the view that was last edited (by mouse click or key event).
Returns : | The last used view. |
"aa" gboolean : Read / Write
Set the canvas to anti-alias or X render mode. Only during initialization. You should also have pushed the right colormap (gdk_rgb_get_cmap() for AA, gdk_imlib_cmap() for X).
Default value: FALSE
"active-view" DiaCanvasView : Read
Returns the active view, even if the view itself is not the active view.
void user_function (DiaCanvasView *diacanvasview, DiaCanvasViewItem *arg1, gpointer user_data);
diacanvasview : | the object which received the signal. |
arg1 : | |
user_data : | user data set when the signal handler was connected. |
void user_function (DiaCanvasView *diacanvasview, DiaCanvasViewItem *arg1, gpointer user_data);
diacanvasview : | the object which received the signal. |
arg1 : | |
user_data : | user data set when the signal handler was connected. |
void user_function (DiaCanvasView *diacanvasview, DiaCanvasViewItem *arg1, gpointer user_data);
diacanvasview : | the object which received the signal. |
arg1 : | |
user_data : | user data set when the signal handler was connected. |
<< Visualization and Interaction | DiaCanvasViewItem >> |