Details
GNOME_CANVAS_EPSILON
#define GNOME_CANVAS_EPSILON 1e-10 |
GNOME_CANVAS_COLOR()
#define GNOME_CANVAS_COLOR(r, g, b) ((((int) (r) & 0xff) << 24) \
| (((int) (g) & 0xff) << 16) \
| (((int) (b) & 0xff) << 8) \
| 0xff) |
GNOME_CANVAS_COLOR_A()
#define GNOME_CANVAS_COLOR_A(r, g, b, a) ((((int) (r) & 0xff) << 24) \
| (((int) (g) & 0xff) << 16) \
| (((int) (b) & 0xff) << 8) \
| ((int) (a) & 0xff)) |
GnomeCanvasBuf
struct GnomeCanvasBuf {
guchar *buf; /* 24 bit RGB buffer for rendering */
int buf_rowstride; /* The rowstride for buf */
ArtIRect rect; /* The rectangle describing the
* rendering area.
*/
guint32 bg_color; /* The background color in 0xrrggbb */
/* Invariant: at least one of the following flags is true. */
unsigned int is_bg : 1; /* Set when the render rectangle area is
* the solid color bg_color.
*/
unsigned int is_buf : 1; /* Set when the render rectangle area is
* represented by the buf
*/
}; |
gnome_canvas_new()
GtkWidget* gnome_canvas_new (void); |
Creates a new empty canvas. If the user wishes to use the image item inside this canvas, then
the gdk_imlib visual and colormap should be pushed into Gtk+'s stack before calling this
function, and they can be popped afterwards.
gnome_canvas_new_aa()
GtkWidget* gnome_canvas_new_aa (void); |
Creates a new antialiased empty canvas. You want to push the GdkRgb colormap and visual for this.
gnome_canvas_root()
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 the 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 scroll region of the canvas.
gnome_canvas_set_pixels_per_unit()
void gnome_canvas_set_pixels_per_unit
(GnomeCanvas *canvas,
double n); |
Sets the zooming factor of the 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 the 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 the canvas.
gnome_canvas_update_now()
Forces an immediate redraw or update of the canvas. If the canvas does not have
any pending 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()
Looks for the item that is under the specified position (given 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.
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 area, specified as a
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.
gnome_canvas_w2c_affine()
void gnome_canvas_w2c_affine (GnomeCanvas *canvas,
double affine[6]); |
Gets the affine transform that converts world coordinates into 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. Usually only needed
by item implementations.
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. Usually only needed
by item implementations. This version results in double coordinates, which
are useful in antialiased implementations.
gnome_canvas_c2w()
void gnome_canvas_c2w (GnomeCanvas *canvas,
int cx,
int cy,
double *wx,
double *wy); |
Converts canvas pixel coordinates to world coordinates. Usually only needed
by item implementations.
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. Use this when you need to
convert from 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,
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_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. This is
typically only needed by item implementations.