Details
GNOME_CANVAS_EPSILON
#define GNOME_CANVAS_EPSILON 1e-10 |
GNOME_CANVAS_COLOR()
#define GNOME_CANVAS_COLOR(r, g, b) |
GNOME_CANVAS_COLOR_A()
#define GNOME_CANVAS_COLOR_A(r, g, b, a) |
GnomeCanvasBuf
typedef struct {
/* 24-bit RGB buffer for rendering */
guchar *buf;
/* Rectangle describing the rendering area */
ArtIRect rect;
/* Rowstride for the buffer */
int buf_rowstride;
/* Background color, given as 0xrrggbb */
guint32 bg_color;
/* Invariant: at least one of the following flags is true. */
/* Set when the render rectangle area is the solid color bg_color */
unsigned int is_bg : 1;
/* Set when the render rectangle area is represented by the buf */
unsigned int is_buf : 1;
} GnomeCanvasBuf; |
gnome_canvas_item_new ()
GnomeCanvasItem* gnome_canvas_item_new (GnomeCanvasGroup *parent,
GType type,
const gchar *first_arg_name,
...); |
Creates a new canvas item with parent as its parent group. The item is
created at the top of its parent's stack, and starts up as visible. The item
is of the specified type, for example, it can be
gnome_canvas_rect_get_type(). The list of object arguments/value pairs is
used to configure the item.
gnome_canvas_item_construct ()
void gnome_canvas_item_construct (GnomeCanvasItem *item,
GnomeCanvasGroup *parent,
const gchar *first_arg_name,
va_list args); |
Constructs a canvas item; meant for use only by item implementations.
gnome_canvas_item_set ()
void gnome_canvas_item_set (GnomeCanvasItem *item,
const gchar *first_arg_name,
...); |
Configures a canvas item. The arguments in the item are set to the specified
values, and the item is repainted as appropriate.
gnome_canvas_item_set_valist ()
void gnome_canvas_item_set_valist (GnomeCanvasItem *item,
const gchar *first_arg_name,
va_list args); |
Configures a canvas item. The arguments in the item are set to the specified
values, and the item is repainted as appropriate.
gnome_canvas_item_move ()
void gnome_canvas_item_move (GnomeCanvasItem *item,
double dx,
double dy); |
Moves a canvas item by creating an affine transformation matrix for
translation by using the specified values. This happens in item
local coordinate system, so if you have nontrivial transform, it
most probably does not do, what you want.
gnome_canvas_item_affine_relative ()
void gnome_canvas_item_affine_relative
(GnomeCanvasItem *item,
const double affine[6]); |
Combines the specified affine transformation matrix with the item's current
transformation. NULL affine is not allowed.
gnome_canvas_item_affine_absolute ()
void gnome_canvas_item_affine_absolute
(GnomeCanvasItem *item,
const double affine[6]); |
Makes the item's affine transformation matrix be equal to the specified
matrix. NULL affine is treated as identity.
gnome_canvas_item_raise ()
void gnome_canvas_item_raise (GnomeCanvasItem *item,
int positions); |
Raises the item in its parent's stack by the specified number of positions.
If the number of positions is greater than the distance to the top of the
stack, then the item is put at the top.
gnome_canvas_item_lower ()
void gnome_canvas_item_lower (GnomeCanvasItem *item,
int positions); |
Lowers the item in its parent's stack by the specified number of positions.
If the number of positions is greater than the distance to the bottom of the
stack, then the item is put at the bottom.
gnome_canvas_item_raise_to_top ()
void gnome_canvas_item_raise_to_top (GnomeCanvasItem *item); |
Raises an item to the top of its parent's stack.
gnome_canvas_item_lower_to_bottom ()
void gnome_canvas_item_lower_to_bottom
(GnomeCanvasItem *item); |
Lowers an item to the bottom of its parent's stack.
gnome_canvas_item_show ()
void gnome_canvas_item_show (GnomeCanvasItem *item); |
Shows a canvas item. If the item was already shown, then no action is taken.
gnome_canvas_item_hide ()
void gnome_canvas_item_hide (GnomeCanvasItem *item); |
Hides a canvas item. If the item was already hidden, then no action is
taken.
gnome_canvas_item_grab ()
int gnome_canvas_item_grab (GnomeCanvasItem *item,
unsigned int event_mask,
GdkCursor *cursor,
guint32 etime); |
Specifies that all events that match the specified event mask should be sent
to the specified item, and also grabs the mouse by calling
gdk_pointer_grab(). The event mask is also used when grabbing the pointer.
If cursor is not NULL, then that cursor is used while the grab is active.
The etime parameter is the timestamp required for grabbing the mouse.
Return value: If an item was already grabbed, it returns GDK_GRAB_ALREADY_GRABBED. If
the specified item was hidden by calling gnome_canvas_item_hide(), then it
gnome_canvas_item_ungrab ()
void gnome_canvas_item_ungrab (GnomeCanvasItem *item,
guint32 etime); |
Ungrabs the item, which must have been grabbed in the canvas, and ungrabs the
mouse.
gnome_canvas_item_w2i ()
void gnome_canvas_item_w2i (GnomeCanvasItem *item,
double *x,
double *y); |
Converts a coordinate pair from world coordinates to item-relative
coordinates.
gnome_canvas_item_i2w ()
void gnome_canvas_item_i2w (GnomeCanvasItem *item,
double *x,
double *y); |
Converts a coordinate pair from item-relative coordinates to world
coordinates.
gnome_canvas_item_i2w_affine ()
void gnome_canvas_item_i2w_affine (GnomeCanvasItem *item,
double affine[6]); |
Gets the affine transform that converts from the item's coordinate system to
world coordinates.
gnome_canvas_item_i2c_affine ()
void gnome_canvas_item_i2c_affine (GnomeCanvasItem *item,
double affine[6]); |
Gets the affine transform that converts from item-relative coordinates to
canvas pixel coordinates.
gnome_canvas_item_reparent ()
void gnome_canvas_item_reparent (GnomeCanvasItem *item,
GnomeCanvasGroup *new_group); |
Changes the parent of the specified item to be the new group. The item keeps
its group-relative coordinates as for its old parent, so the item may change
its absolute position within the canvas.
gnome_canvas_item_grab_focus ()
void gnome_canvas_item_grab_focus (GnomeCanvasItem *item); |
Makes the specified item take the keyboard focus, so all keyboard events will
be sent to it. If the canvas widget itself did not have the focus, it grabs
it as well.
gnome_canvas_item_get_bounds ()
void gnome_canvas_item_get_bounds (GnomeCanvasItem *item,
double *x1,
double *y1,
double *x2,
double *y2); |
Queries the bounding box of a canvas item. The bounds are returned in the
coordinate system of the item's parent.
gnome_canvas_item_request_update ()
void gnome_canvas_item_request_update
(GnomeCanvasItem *item); |
To be used only by item implementations. Requests that the canvas queue an
update for the specified item.
GNOME_TYPE_CANVAS_GROUP
#define GNOME_TYPE_CANVAS_GROUP (gnome_canvas_group_get_type ()) |
GNOME_CANVAS_GROUP()
#define GNOME_CANVAS_GROUP(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_CANVAS_GROUP, GnomeCanvasGroup)) |
GNOME_CANVAS_GROUP_CLASS()
#define GNOME_CANVAS_GROUP_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS_GROUP, GnomeCanvasGroupClass)) |
GNOME_IS_CANVAS_GROUP()
#define GNOME_IS_CANVAS_GROUP(obj) (GTK_CHECK_TYPE ((obj), GNOME_TYPE_CANVAS_GROUP)) |
GNOME_IS_CANVAS_GROUP_CLASS()
#define GNOME_IS_CANVAS_GROUP_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_CANVAS_GROUP)) |
GNOME_CANVAS_GROUP_GET_CLASS()
#define GNOME_CANVAS_GROUP_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GNOME_TYPE_CANVAS_GROUP, GnomeCanvasGroupClass)) |
gnome_canvas_group_get_type ()
GType gnome_canvas_group_get_type (void); |
Registers the &GnomeCanvasGroup class if necessary, and returns the type ID
associated to it.
GNOME_TYPE_CANVAS
#define GNOME_TYPE_CANVAS (gnome_canvas_get_type ()) |
GNOME_CANVAS()
#define GNOME_CANVAS(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_CANVAS, GnomeCanvas)) |
GNOME_CANVAS_CLASS()
#define GNOME_CANVAS_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_TYPE_CANVAS, GnomeCanvasClass)) |
GNOME_IS_CANVAS()
#define GNOME_IS_CANVAS(obj) (GTK_CHECK_TYPE ((obj), GNOME_TYPE_CANVAS)) |
GNOME_IS_CANVAS_CLASS()
#define GNOME_IS_CANVAS_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_CANVAS)) |
GNOME_CANVAS_GET_CLASS()
#define GNOME_CANVAS_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GNOME_TYPE_CANVAS, GnomeCanvasClass)) |
gnome_canvas_get_type ()
GType gnome_canvas_get_type (void); |
Registers the &GnomeCanvas class if necessary, and returns the type ID
associated to it.
gnome_canvas_new ()
Creates a new empty canvas in non-antialiased mode. If you wish to use the
&GnomeCanvasImage item inside this canvas, then you must push the gdk_imlib
visual and colormap before calling this function, and they can be popped
afterwards.
gnome_canvas_new_aa ()
Creates a new empty canvas in antialiased mode. You should push the GdkRGB
visual and colormap before calling this functions, and they can be popped
afterwards.
gnome_canvas_root ()
GnomeCanvasGroup* gnome_canvas_root (GnomeCanvas *canvas); |
Queries the root group of a canvas.
gnome_canvas_set_scroll_region ()
void gnome_canvas_set_scroll_region (GnomeCanvas *canvas,
double x1,
double y1,
double x2,
double y2); |
Sets the scrolling region of a canvas to the specified rectangle. The canvas
will then be able to scroll only within this region. The view of the canvas
is adjusted as appropriate to display as much of the new region as possible.
gnome_canvas_get_scroll_region ()
void gnome_canvas_get_scroll_region (GnomeCanvas *canvas,
double *x1,
double *y1,
double *x2,
double *y2); |
Queries the scrolling region of a canvas.
gnome_canvas_set_pixels_per_unit ()
void gnome_canvas_set_pixels_per_unit
(GnomeCanvas *canvas,
double n); |
Sets the zooming factor of a canvas by specifying the number of pixels that
correspond to one canvas unit.
gnome_canvas_scroll_to ()
void gnome_canvas_scroll_to (GnomeCanvas *canvas,
int cx,
int cy); |
Makes a canvas scroll to the specified offsets, given in canvas pixel units.
The canvas will adjust the view so that it is not outside the scrolling
region. This function is typically not used, as it is better to hook
scrollbars to the canvas layout's scrolling adjusments.
gnome_canvas_get_scroll_offsets ()
void gnome_canvas_get_scroll_offsets (GnomeCanvas *canvas,
int *cx,
int *cy); |
Queries the scrolling offsets of a canvas. The values are returned in canvas
pixel units.
gnome_canvas_update_now ()
void gnome_canvas_update_now (GnomeCanvas *canvas); |
Forces an immediate update and redraw of a canvas. If the canvas does not
have any pending update or redraw requests, then no action is taken. This is
typically only used by applications that need explicit control of when the
display is updated, like games. It is not needed by normal applications.
gnome_canvas_get_item_at ()
GnomeCanvasItem* gnome_canvas_get_item_at (GnomeCanvas *canvas,
double x,
double y); |
Looks for the item that is under the specified position, which must be
specified in world coordinates.
gnome_canvas_request_redraw_uta ()
void gnome_canvas_request_redraw_uta (GnomeCanvas *canvas,
ArtUta *uta); |
Informs a canvas that the specified area, given as a microtile array, needs
to be repainted. To be used only by item implementations.
gnome_canvas_request_redraw ()
void gnome_canvas_request_redraw (GnomeCanvas *canvas,
int x1,
int y1,
int x2,
int y2); |
Convenience function that informs a canvas that the specified rectangle needs
to be repainted. This function converts the rectangle to a microtile array
and feeds it to gnome_canvas_request_redraw_uta(). The rectangle includes
x1 and y1, but not x2 and y2. To be used only by item implementations.
gnome_canvas_w2c_affine ()
void gnome_canvas_w2c_affine (GnomeCanvas *canvas,
double affine[6]); |
Gets the affine transform that converts from world coordinates to canvas
pixel coordinates.
gnome_canvas_w2c ()
void gnome_canvas_w2c (GnomeCanvas *canvas,
double wx,
double wy,
int *cx,
int *cy); |
Converts world coordinates into canvas pixel coordinates.
gnome_canvas_w2c_d ()
void gnome_canvas_w2c_d (GnomeCanvas *canvas,
double wx,
double wy,
double *cx,
double *cy); |
Converts world coordinates into canvas pixel coordinates. This version
gnome_canvas_c2w ()
void gnome_canvas_c2w (GnomeCanvas *canvas,
int cx,
int cy,
double *wx,
double *wy); |
Converts canvas pixel coordinates to world coordinates.
gnome_canvas_window_to_world ()
void gnome_canvas_window_to_world (GnomeCanvas *canvas,
double winx,
double winy,
double *worldx,
double *worldy); |
Converts window-relative coordinates into world coordinates. You can use
this when you need to convert mouse coordinates into world coordinates, for
example.
gnome_canvas_world_to_window ()
void gnome_canvas_world_to_window (GnomeCanvas *canvas,
double worldx,
double worldy,
double *winx,
double *winy); |
Converts world coordinates into window-relative coordinates.
gnome_canvas_get_color ()
int gnome_canvas_get_color (GnomeCanvas *canvas,
const char *spec,
GdkColor *color); |
Allocates a color based on the specified X color specification. As a
convenience to item implementations, it returns TRUE if the color was
allocated, or FALSE if the specification was NULL. A NULL color
specification is considered as "transparent" by the canvas.
gnome_canvas_get_color_pixel ()
gulong gnome_canvas_get_color_pixel (GnomeCanvas *canvas,
guint rgba); |
Allocates a color from the RGBA value passed into this function. The alpha
opacity value is discarded, since normal X colors do not support it.
gnome_canvas_set_stipple_origin ()
void gnome_canvas_set_stipple_origin (GnomeCanvas *canvas,
GdkGC *gc); |
Sets the stipple origin of the specified GC as is appropriate for the canvas,
so that it will be aligned with other stipple patterns used by canvas items.
This is typically only needed by item implementations.
gnome_canvas_set_dither ()
void gnome_canvas_set_dither (GnomeCanvas *canvas,
GdkRgbDither dither); |
Controls dithered rendering for antialiased canvases. The value of
dither should be GDK_RGB_DITHER_NONE, GDK_RGB_DITHER_NORMAL, or
GDK_RGB_DITHER_MAX. The default canvas setting is
GDK_RGB_DITHER_NORMAL.
gnome_canvas_get_dither ()
Returns the type of dithering used to render an antialiased canvas.