libgnomecanvasmm
Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gnome::Canvas::Item Class Reference

#include <item.h>

Inheritance diagram for Gnome::Canvas::Item:
Gnome::Canvas::Group Gnome::Canvas::Line Gnome::Canvas::Pixbuf Gnome::Canvas::RichText Gnome::Canvas::Shape Gnome::Canvas::Text Gnome::Canvas::Widget Gnome::Canvas::Bpath Gnome::Canvas::Polygon Gnome::Canvas::RectEllipse Gnome::Canvas::Ellipse Gnome::Canvas::Rect

Public Member Functions

virtual ~Item ()
 
GnomeCanvasItem * gobj ()
 Provides access to the underlying C GtkObject. More...
 
const GnomeCanvasItem * gobj () const
 Provides access to the underlying C GtkObject. More...
 
void move (double dx, double dy)
 Moves a canvas item by creating an affine transformation matrix for translation by using the specified values. More...
 
void raise (int positions)
 Raises the item in its parent's stack by the specified number of positions. More...
 
void lower (int positions)
 Lowers the item in its parent's stack by the specified number of positions. More...
 
void raise_to_top ()
 Raises an item to the top of its parent's stack. More...
 
void lower_to_bottom ()
 Lowers an item to the bottom of its parent's stack. More...
 
int grab (unsigned int event_mask, const Gdk::Cursor &cursor, guint32 etime)
 
int grab (unsigned int event_mask, guint32 etime)
 
void ungrab (guint32 etime)
 Ungrabs the item, which must have been grabbed in the canvas, and ungrabs the mouse. More...
 
void w2i (double &x, double &y)
 Converts a coordinate pair from world coordinates to item-relative coordinates. More...
 
void i2w (double &x, double &y)
 Converts a coordinate pair from item-relative coordinates to world coordinates. More...
 
void grab_focus ()
 Makes the specified item take the keyboard focus, so all keyboard events will be sent to it. More...
 
void get_bounds (double &x1, double &y1, double &x2, double &y2) const
 Queries the bounding box of a canvas item. More...
 
void show ()
 Shows a canvas item. More...
 
void hide ()
 Hides a canvas item. More...
 
void affine_relative (const Art::AffineTrans &affine)
 
void affine_absolute (const Art::AffineTrans &affine)
 
Art::AffineTrans get_i2w_affine () const
 
Art::AffineTrans get_i2c_affine () const
 
void reparent (Group &new_group)
 Changes the parent of the specified item to be the new group. More...
 
Canvasget_canvas () const
 Returns the canvas we're on. More...
 
virtual void update_vfunc (double *affine, ArtSVP *clip_path, int flags)
 
virtual void realize_vfunc ()
 
virtual void unrealize_vfunc ()
 
virtual void map_vfunc ()
 
virtual void unmap_vfunc ()
 
virtual ArtUta * coverage_vfunc ()
 
virtual void draw_vfunc (const Glib::RefPtr< Gdk::Drawable > &drawable, int x, int y, int width, int height)
 
virtual void render_vfunc (GnomeCanvasBuf *buf)
 
virtual double point_vfunc (double x, double y, int cx, int cy, GnomeCanvasItem **actual_item)
 
virtual void bounds_vfunc (double *x1, double *y1, double *x2, double *y2)
 
Glib::SignalProxy1< bool,
GdkEvent * > 
signal_event ()
 
Groupget_parent_group ()
 
const Groupget_parent_group () const
 
Glib::PropertyProxy< Group * > property_parent ()
 You rarely need to use properties because there are get_ and set_ methods for almost all of them. More...
 
Glib::PropertyProxy_ReadOnly
< Group * > 
property_parent () const
 You rarely need to use properties because there are get_ and set_ methods for almost all of them. More...
 

Protected Member Functions

virtual bool on_event (GdkEvent *p1)
 
void item_construct (Group &group)
 
void item_construct (Group &group, const gchar *first_arg_name, va_list ap)
 
void set (const gchar *first_arg_name,...)
 
void request_update ()
 To be used only by item implementations. More...
 
void reset_bounds ()
 Resets the bounding box of a canvas item to an empty rectangle. More...
 
void update_svp (ArtSVP **p_svp, ArtSVP *new_svp)
 Sets the svp to the new value, requesting repaint on what's changed. More...
 
void update_svp_clip (ArtSVP **p_svp, ArtSVP *new_svp, ArtSVP *clip_svp)
 Sets the svp to the new value, clipping if necessary, and requesting repaint on what's changed. More...
 
void request_redraw_svp (const ArtSVP *svp)
 Request redraw of the svp if in aa mode, or the entire item in in xlib mode. More...
 
void update_bbox (int x1, int y1, int x2, int y2)
 Sets the bbox to the new value, requesting full repaint. More...
 

Related Functions

(Note that these are not member functions.)

Gnome::Canvas::Itemwrap (GnomeCanvasItem *object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Constructor & Destructor Documentation

virtual Gnome::Canvas::Item::~Item ( )
virtual

Member Function Documentation

void Gnome::Canvas::Item::affine_absolute ( const Art::AffineTrans affine)
void Gnome::Canvas::Item::affine_relative ( const Art::AffineTrans affine)
virtual void Gnome::Canvas::Item::bounds_vfunc ( double *  x1,
double *  y1,
double *  x2,
double *  y2 
)
virtual
virtual ArtUta* Gnome::Canvas::Item::coverage_vfunc ( )
virtual
virtual void Gnome::Canvas::Item::draw_vfunc ( const Glib::RefPtr< Gdk::Drawable > &  drawable,
int  x,
int  y,
int  width,
int  height 
)
virtual
void Gnome::Canvas::Item::get_bounds ( double &  x1,
double &  y1,
double &  x2,
double &  y2 
) const

Queries the bounding box of a canvas item.

The bounds are returned in the coordinate system of the item's parent.

Parameters
x1Leftmost edge of the bounding box (return value).
y1Upper edge of the bounding box (return value).
x2Rightmost edge of the bounding box (return value).
y2Lower edge of the bounding box (return value).
Canvas* Gnome::Canvas::Item::get_canvas ( ) const

Returns the canvas we're on.

Art::AffineTrans Gnome::Canvas::Item::get_i2c_affine ( ) const
Art::AffineTrans Gnome::Canvas::Item::get_i2w_affine ( ) const
Group* Gnome::Canvas::Item::get_parent_group ( )
const Group* Gnome::Canvas::Item::get_parent_group ( ) const
GnomeCanvasItem* Gnome::Canvas::Item::gobj ( )
inline

Provides access to the underlying C GtkObject.

const GnomeCanvasItem* Gnome::Canvas::Item::gobj ( ) const
inline

Provides access to the underlying C GtkObject.

int Gnome::Canvas::Item::grab ( unsigned int  event_mask,
const Gdk::Cursor &  cursor,
guint32  etime 
)
int Gnome::Canvas::Item::grab ( unsigned int  event_mask,
guint32  etime 
)
void Gnome::Canvas::Item::grab_focus ( )

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.

void Gnome::Canvas::Item::hide ( )

Hides a canvas item.

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

void Gnome::Canvas::Item::i2w ( double &  x,
double &  y 
)

Converts a coordinate pair from item-relative coordinates to world coordinates.

Parameters
xX coordinate to convert (input/output value).
yY coordinate to convert (input/output value).
void Gnome::Canvas::Item::item_construct ( Group group)
protected
void Gnome::Canvas::Item::item_construct ( Group group,
const gchar *  first_arg_name,
va_list  ap 
)
protected
void Gnome::Canvas::Item::lower ( 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.

Parameters
positionsNumber of steps to lower the item.
void Gnome::Canvas::Item::lower_to_bottom ( )

Lowers an item to the bottom of its parent's stack.

virtual void Gnome::Canvas::Item::map_vfunc ( )
virtual
void Gnome::Canvas::Item::move ( 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.

Parameters
dxHorizontal offset.
dyVertical offset.
virtual bool Gnome::Canvas::Item::on_event ( GdkEvent *  p1)
protectedvirtual
virtual double Gnome::Canvas::Item::point_vfunc ( double  x,
double  y,
int  cx,
int  cy,
GnomeCanvasItem **  actual_item 
)
virtual
Glib::PropertyProxy<Group*> Gnome::Canvas::Item::property_parent ( )

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly<Group*> Gnome::Canvas::Item::property_parent ( ) const

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
void Gnome::Canvas::Item::raise ( 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.

Parameters
positionsNumber of steps to raise the item.
void Gnome::Canvas::Item::raise_to_top ( )

Raises an item to the top of its parent's stack.

virtual void Gnome::Canvas::Item::realize_vfunc ( )
virtual
virtual void Gnome::Canvas::Item::render_vfunc ( GnomeCanvasBuf *  buf)
virtual
void Gnome::Canvas::Item::reparent ( Group 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.

Parameters
new_groupA canvas group.
void Gnome::Canvas::Item::request_redraw_svp ( const ArtSVP *  svp)
protected

Request redraw of the svp if in aa mode, or the entire item in in xlib mode.

Parameters
svpThe svp that needs to be redrawn.
void Gnome::Canvas::Item::request_update ( )
protected

To be used only by item implementations.

Requests that the canvas queue an update for the specified item.

void Gnome::Canvas::Item::reset_bounds ( )
protected

Resets the bounding box of a canvas item to an empty rectangle.

void Gnome::Canvas::Item::set ( const gchar *  first_arg_name,
  ... 
)
protected
void Gnome::Canvas::Item::show ( )

Shows a canvas item.

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

Glib::SignalProxy1< bool,GdkEvent* > Gnome::Canvas::Item::signal_event ( )
Prototype:
bool on_my_event(GdkEvent* p1)
void Gnome::Canvas::Item::ungrab ( guint32  etime)

Ungrabs the item, which must have been grabbed in the canvas, and ungrabs the mouse.

Parameters
etimeThe timestamp for ungrabbing the mouse.
virtual void Gnome::Canvas::Item::unmap_vfunc ( )
virtual
virtual void Gnome::Canvas::Item::unrealize_vfunc ( )
virtual
void Gnome::Canvas::Item::update_bbox ( int  x1,
int  y1,
int  x2,
int  y2 
)
protected

Sets the bbox to the new value, requesting full repaint.

Parameters
itemThe canvas item needing update.
x1Left coordinate of the new bounding box.
y1Top coordinate of the new bounding box.
x2Right coordinate of the new bounding box.
y2Bottom coordinate of the new bounding box.
void Gnome::Canvas::Item::update_svp ( ArtSVP **  p_svp,
ArtSVP *  new_svp 
)
protected

Sets the svp to the new value, requesting repaint on what's changed.

This function takes responsibility for freeing new_svp. This routine also adds the svp's bbox to the item's.

Parameters
p_svpA pointer to the existing svp.
new_svpThe new svp.
void Gnome::Canvas::Item::update_svp_clip ( ArtSVP **  p_svp,
ArtSVP *  new_svp,
ArtSVP *  clip_svp 
)
protected

Sets the svp to the new value, clipping if necessary, and requesting repaint on what's changed.

This function takes responsibility for freeing new_svp.

Parameters
p_svpA pointer to the existing svp.
new_svpThe new svp.
clip_svpA clip path, if non-null.
virtual void Gnome::Canvas::Item::update_vfunc ( double *  affine,
ArtSVP *  clip_path,
int  flags 
)
virtual
void Gnome::Canvas::Item::w2i ( double &  x,
double &  y 
)

Converts a coordinate pair from world coordinates to item-relative coordinates.

Parameters
xX coordinate to convert (input/output value).
yY coordinate to convert (input/output value).

Friends And Related Function Documentation

Gnome::Canvas::Item * wrap ( GnomeCanvasItem *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: