![]() |
![]() |
![]() |
libccc Reference Manual | ![]() |
---|---|---|---|---|
CcViewIface; CcItem* cc_view_get_root (CcView *self); void cc_view_set_root (CcView *self, CcItem *root); gdouble cc_view_get_zoom (CcView *self); void cc_view_set_zoom (CcView *self, gdouble zoom); void cc_view_window_to_world (CcView *self, gdouble *x, gdouble *y); void cc_view_world_to_window (CcView *self, gdouble *x, gdouble *y);
typedef struct { GTypeInterface base_iface; /* vtable */ GdkGrabStatus (*grab_item) (CcView* self, CcItem* item, GdkEventMask mask, GdkCursor * cursor, guint32 time); void (*ungrab_item) (CcView * self, CcItem * item, guint32 time); void (*window_to_world) (CcView * self, gdouble * x, gdouble * y); void (*world_to_window) (CcView * self, gdouble * x, gdouble * y); void (*world_to_window_distance)(CcView * self, gdouble * x, gdouble * y); } CcViewIface;
CcItem* cc_view_get_root (CcView *self);
Get the model that's displayed by self
.
self : |
a CcView |
Returns : | the CcItem that's displayed by self , may be NULL .
|
void cc_view_set_root (CcView *self, CcItem *root);
Set root
as the model to be displayed in self
.
self : |
a CcView |
root : |
a CcItem |
gdouble cc_view_get_zoom (CcView *self);
Get the zoom of the view.
self : |
a CcView |
Returns : | the zoom of the view. |
void cc_view_set_zoom (CcView *self, gdouble zoom);
Set the zoom of the canvas.
self : |
a CcView |
zoom : |
a new zoom value |
void cc_view_window_to_world (CcView *self, gdouble *x, gdouble *y);
Convert window_x
and window_y
to world_x
and world_y
if given.
self : |
a CcView |
x : |
target for a world coordinate, may be NULL
|
y : |
target for a world coordinate, may be NULL
|