GnomeCanvasItem

Name

GnomeCanvasItem — one line description goes here.

Synopsis


#include <gnome.h>


struct      GnomeCanvasItem
GnomeCanvasItem* gnome_canvas_item_new      (GnomeCanvasGroup *parent,
                                             GtkType type,
                                             const gchar *first_arg_name,
                                             ...);
GnomeCanvasItem* gnome_canvas_item_newv     (GnomeCanvasGroup *parent,
                                             GtkType type,
                                             guint nargs,
                                             GtkArg *args);
void        gnome_canvas_item_construct     (GnomeCanvasItem *item,
                                             GnomeCanvasGroup *parent,
                                             const gchar *first_arg_name,
                                             va_list args);
void        gnome_canvas_item_constructv    (GnomeCanvasItem *item,
                                             GnomeCanvasGroup *parent,
                                             guint nargs,
                                             GtkArg *args);
void        gnome_canvas_item_set           (GnomeCanvasItem *item,
                                             const gchar *first_arg_name,
                                             ...);
void        gnome_canvas_item_setv          (GnomeCanvasItem *item,
                                             guint nargs,
                                             GtkArg *args);
void        gnome_canvas_item_set_valist    (GnomeCanvasItem *item,
                                             const gchar *first_arg_name,
                                             va_list var_args);
void        gnome_canvas_item_move          (GnomeCanvasItem *item,
                                             double dx,
                                             double dy);
void        gnome_canvas_item_affine_relative
                                            (GnomeCanvasItem *item,
                                             const double affine[6]);
void        gnome_canvas_item_affine_absolute
                                            (GnomeCanvasItem *item,
                                             const double affine[6]);
void        gnome_canvas_item_scale         (GnomeCanvasItem *item,
                                             double x,
                                             double y,
                                             double scale_x,
                                             double scale_y);
void        gnome_canvas_item_rotate        (GnomeCanvasItem *item,
                                             double x,
                                             double y,
                                             double angle);
void        gnome_canvas_item_raise         (GnomeCanvasItem *item,
                                             int positions);
void        gnome_canvas_item_lower         (GnomeCanvasItem *item,
                                             int positions);
void        gnome_canvas_item_raise_to_top  (GnomeCanvasItem *item);
void        gnome_canvas_item_lower_to_bottom
                                            (GnomeCanvasItem *item);
void        gnome_canvas_item_show          (GnomeCanvasItem *item);
void        gnome_canvas_item_hide          (GnomeCanvasItem *item);
int         gnome_canvas_item_grab          (GnomeCanvasItem *item,
                                             unsigned int event_mask,
                                             GdkCursor *cursor,
                                             guint32 etime);
void        gnome_canvas_item_ungrab        (GnomeCanvasItem *item,
                                             guint32 etime);
void        gnome_canvas_item_w2i           (GnomeCanvasItem *item,
                                             double *x,
                                             double *y);
void        gnome_canvas_item_i2w           (GnomeCanvasItem *item,
                                             double *x,
                                             double *y);
void        gnome_canvas_item_i2w_affine    (GnomeCanvasItem *item,
                                             double affine[6]);
void        gnome_canvas_item_i2c_affine    (GnomeCanvasItem *item,
                                             double affine[6]);
void        gnome_canvas_item_reparent      (GnomeCanvasItem *item,
                                             GnomeCanvasGroup *new_group);
void        gnome_canvas_item_grab_focus    (GnomeCanvasItem *item);
void        gnome_canvas_item_get_bounds    (GnomeCanvasItem *item,
                                             double *x1,
                                             double *y1,
                                             double *x2,
                                             double *y2);
void        gnome_canvas_item_request_update
                                            (GnomeCanvasItem *item);

Object Hierarchy


  GtkObject
   +----GnomeCanvasItem

Signal Prototypes


'event'     gboolean    user_function      (GnomeCanvasItem *canvasitem,
                                            GdkEvent *event,
                                            gpointer user_data);

Description

Details


GnomeCanvasItem

struct GnomeCanvasItem;


gnome_canvas_item_new()

GnomeCanvasItem* gnome_canvas_item_new      (GnomeCanvasGroup *parent,
                                             GtkType 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.

parent : The parent group for the new item.type : The object type of the item.first_arg_name : A list of object argument name/value pairs, NULL-terminated, used to configure the item. For example, "fill_color", "black", "width_units", 5.0, NULL.... : Returns : The newly-created item.


gnome_canvas_item_newv()

GnomeCanvasItem* gnome_canvas_item_newv     (GnomeCanvasGroup *parent,
                                             GtkType type,
                                             guint nargs,
                                             GtkArg *args);

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 is used to configure the item.

parent : The parent group for the new item.type : The object type of the item.nargs : The number of arguments used to configure the item.args : The list of arguments used to configure the item.Returns : The newly-created 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.

item : The item to construct.parent : The parent group for the item.first_arg_name : The name of the first argument for configuring the item.args : The list of arguments used to configure the item.


gnome_canvas_item_constructv()

void        gnome_canvas_item_constructv    (GnomeCanvasItem *item,
                                             GnomeCanvasGroup *parent,
                                             guint nargs,
                                             GtkArg *args);

Constructs a canvas item; meant for use only by item implementations.

item : The item to construct.parent : The parent group for the item.nargs : The number of arguments used to configure the item.args : The list of arguments used to configure the item.


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.

item : The item to configure.first_arg_name : The list of object argument name/value pairs used to configure the item.... : 


gnome_canvas_item_setv()

void        gnome_canvas_item_setv          (GnomeCanvasItem *item,
                                             guint nargs,
                                             GtkArg *args);

Configures a canvas item. The arguments in the item are set to the specified values, and the item is repainted as appropriate.

item : The item to configure.nargs : The number of arguments used to configure the item.args : The arguments used to configure the item.


gnome_canvas_item_set_valist()

void        gnome_canvas_item_set_valist    (GnomeCanvasItem *item,
                                             const gchar *first_arg_name,
                                             va_list var_args);

Configures a canvas item. The arguments in the item are set to the specified values, and the item is repainted as appropriate.

item : The item to configure.first_arg_name : The name of the first argument used to configure the item.var_args : 


gnome_canvas_item_move()

void        gnome_canvas_item_move          (GnomeCanvasItem *item,
                                             double dx,
                                             double dy);

Moves a canvas item by the specified distance, which must be specified in canvas units.

item : The item to move.dx : The horizontal distance.dy : The vertical distance.


gnome_canvas_item_affine_relative()

void        gnome_canvas_item_affine_relative
                                            (GnomeCanvasItem *item,
                                             const double affine[6]);

Apply a relative affine transformation to the item.

item : The item to transform.affine : the affine with which to transform the item


gnome_canvas_item_affine_absolute()

void        gnome_canvas_item_affine_absolute
                                            (GnomeCanvasItem *item,
                                             const double affine[6]);

Apply an absolute affine transformation to the item.

item : The item to transform.affine : the affine with which to replace the transform of the item


gnome_canvas_item_scale()

void        gnome_canvas_item_scale         (GnomeCanvasItem *item,
                                             double x,
                                             double y,
                                             double scale_x,
                                             double scale_y);

item : x : y : scale_x : scale_y : 


gnome_canvas_item_rotate()

void        gnome_canvas_item_rotate        (GnomeCanvasItem *item,
                                             double x,
                                             double y,
                                             double angle);

item : x : y : angle : 


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.

item : The item to raise in its parent's stack.positions : The number of steps to raise the item.


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.

item : The item to lower in its parent's stack.positions : The number of steps to lower the item.


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.

item : The item to raise in 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.

item : The item to lower in its parent's stack.


gnome_canvas_item_show()

void        gnome_canvas_item_show          (GnomeCanvasItem *item);

Shows an item. If the item was already shown, then no action is taken.

item : The item to show.


gnome_canvas_item_hide()

void        gnome_canvas_item_hide          (GnomeCanvasItem *item);

Hides an item. If the item was already hidden, then no action is taken.

item : The item to hide.


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.

item : The item to grab.event_mask : Mask of events that will be sent to this item.cursor : If non-NULL, the cursor that will be used while the grab is active.etime : The timestamp required for grabbing the mouse, or GDK_CURRENT_TIME.Returns : If an item was already grabbed, it returns AlreadyGrabbed. If the specified item is not visible, then it returns GrabNotViewable. Else, it returns the result of calling gdk_pointer_grab().


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.

item : The item that was grabbed in the canvas.etime : The timestamp for ungrabbing the mouse.


gnome_canvas_item_w2i()

void        gnome_canvas_item_w2i           (GnomeCanvasItem *item,
                                             double *x,
                                             double *y);

Converts from world coordinates to item-relative coordinates. The converted coordinates are returned in the same variables.

item : The item whose coordinate system will be used for conversion.x : the X world coordinate to convert to item-relative coordinates.y : the Y world coordinate to convert to item-relative coordinates.


gnome_canvas_item_i2w()

void        gnome_canvas_item_i2w           (GnomeCanvasItem *item,
                                             double *x,
                                             double *y);

Converts from item-relative coordinates to world coordinates. The converted coordinates are returned in the same variables.

item : The item whose coordinate system will be used for conversion.x : If non-NULL, the X item-relative coordinate to convert to world coordinates.y : If non-NULL, the Y item-relative coordinate to convert 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 item-relative coordinates to world coordinates.

item : The item whose coordinate system will be used for conversion.affine : The affine transform used to convert item 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 coordinates.

item : The item whose coordinate system will be used for conversion.affine : The affine transform used to convert item to canvas 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.

item : The item whose parent should be changed.new_group : The new parent group.


gnome_canvas_item_grab_focus()

void        gnome_canvas_item_grab_focus    (GnomeCanvasItem *item);

Makes the specified item take the keyboard focus. If the canvas itself did not have the focus, it sets it as well.

item : The item to which keyboard events should be sent.


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 the specified item. The bounds are returned in item-relative coordinates.

item : The item to query the bounding box for.x1 : If non-NULL, returns the leftmost edge of the bounding box.y1 : If non-NULL, returns the upper edge of the bounding box.x2 : If non-NULL, returns the rightmost edge of the bounding box.y2 : If non-NULL, returns the lower edge of the bounding box.


gnome_canvas_item_request_update()

void        gnome_canvas_item_request_update
                                            (GnomeCanvasItem *item);

Request that the update method of the item gets called sometime before the next render (generally from the idle loop).

item : 

Signals


The 'event' signal

gboolean    user_function                  (GnomeCanvasItem *canvasitem,
                                            GdkEvent *event,
                                            gpointer user_data);

canvasitem :the object which received the signal.event : user_data :user data set when the signal handler was connected.Returns