goocanvas.ItemSimple — The base class for the standard canvas items.
class goocanvas.ItemSimple(gobject.GObject): |
+-- gobject.GObject +-- goocanvas.ItemSimple
|
goocanvas.ItemSimple is implementated by goocanvas.Rect goocanvas.Ellipse goocanvas.Path goocanvas.Polyline goocanvas.Text goocanvas.Image goocanvas.Group
goocanvas.ItemSimple implements goocanvas.Item
def changed(recompute_bounds)
recompute_bounds : | If the item's bounds need to be recomputed. |
This method is intended to be used by subclasses of goocanvas.ItemSimple. It is used as a callback for the "changed" signal of the item models. It requests an update or redraw of the item as appropriate.
def check_in_path(x, y, cr, pointer_events)
x : | the x coordinate of the point. |
y : | the y coordinate of the point. |
cr : | a cairo context. |
pointer_events : | specifies which parts of the path to check. |
Returns : | True if the given point is in the current path. |
Checks if the given point is in the current path.
def check_style()
This method is intended to be used by subclasses of goocanvas.ItemSimple, typically in their update() or get_requested_area() methods. It ensures that the item's style is setup correctly. If the item has its own goocanvas.Style it makes sure the parent is set correctly. If it doesn't have its own style it uses the parent item's style.
def get_line_width()
Returns : | The item's line width. |
Gets the item's line width.
def get_path_bounds(cr, bounds)
cr : | A cairo context. |
Returns : | The goocanvas.Bounds holding the bounding box of the item in device space, converted to user space coordinates |
Calculates the bounds of the current path in device space, storing the results in a goocanvas.Bounds.
This method should be used only while implementing custom items
def paint_path(cr)
cr : | A cairo context. |
Paints the current path, using the item's style settings.
def set_model(model)
model : | The model that item will view. |
This function should be called by subclasses of goocanvas.ItemSimple in their set_model() method.
def user_bounds_to_device(cr, bounds)
cr : | a cairo context. |
bounds : | the bounds of the item, in the item's coordinate space. |
Converts the item's bounds to a bounding box in device space.
def user_bounds_to_parent(cr, bounds)
cr : | A cairo context. |
bounds : | the bounds of the item, in the item's coordinate space. |
Converts the item's bounds to a bounding box in its parent's coordinate space. If the item has no transformation matrix set then no conversion is needed. This is typically needed when implementing the get_requested_area() method for subclasses of goocanvas.ItemSimple.