![]() |
![]() |
![]() |
libccc Reference Manual | ![]() |
---|---|---|---|---|
#include <ccc.h> enum CcZoomMode; CcView; 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 const*self, gdouble *x, gdouble *y); void cc_view_world_to_window (CcView const*self, gdouble *x, gdouble *y); CcItem* cc_view_get_focus (const CcView *self); CcDRect* cc_view_get_scrolled_region (CcView *self); gint cc_view_grab_item (CcView *self, CcItem *item, GdkEventMask mask, GdkCursor *cursor, guint32 time); void cc_view_set_focus (CcView *self, CcItem *focus); void cc_view_set_scrolled_region (CcView *self, CcDRect const*scrolled_region); void cc_view_ungrab_item (CcView *self, CcItem *item, guint32 time); void cc_view_world_to_window_distance (CcView const*self, gdouble *x, gdouble *y);
"focus" CcItem : Read / Write "root" CcItem : Read / Write "scrolled-region" CcDRect : Read / Write "zoom" gdouble : Read / Write / Construct "zoom-mode" CcZoomMode : Read / Write
typedef enum { CC_ZOOM_PIXELS, CC_ZOOM_WIDTH, CC_ZOOM_HEIGHT, CC_ZOOM_AUTO } CcZoomMode;
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 const* self, gdouble * x, gdouble * y); void (*world_to_window) (CcView const* self, gdouble * x, gdouble * y); void (*world_to_window_distance)(CcView const* self, gdouble * x, gdouble * y); } CcViewIface;
CcItem* cc_view_get_root (CcView *self);
Get the model that's displayed by self
.
void cc_view_set_root (CcView *self, CcItem *root);
Set root
as the model to be displayed in self
.
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 const*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
|
void cc_view_world_to_window (CcView const*self, gdouble *x, gdouble *y);
Convert x
and y
to window coordinates if given.
self : |
a CcView |
x : |
target for a window coordinate, may be NULL
|
y : |
target for a window coordinate, may be NULL
|
CcDRect* cc_view_get_scrolled_region (CcView *self);
Get the scrolled region of this view.
self : |
a CcView |
Returns : | the scrolled region of this view. |
gint cc_view_grab_item (CcView *self, CcItem *item, GdkEventMask mask, GdkCursor *cursor, guint32 time);
Grab the item.
void cc_view_set_scrolled_region (CcView *self, CcDRect const*scrolled_region);
Set scrolled_region
as the region to be displayed and/or reachable with
scrollbars.
void cc_view_ungrab_item (CcView *self, CcItem *item, guint32 time);
self : |
|
item : |
|
time : |