goocanvas.ItemSimple

goocanvas.ItemSimple — The base class for the standard canvas items.

Synopsis

class goocanvas.ItemSimple(gobject.GObject):
    def check_in_path(x, y, cr, pointer_events)
def get_path_bounds(cr, bounds)
def paint_path(cr)
def set_fill_options(cr)
def set_stroke_options(cr)
def set_style(style)
def user_bounds_to_device(cr, bounds)

Ancestry

+-- gobject.GObject
    +-- goocanvas.ItemSimple

goocanvas.ItemSimple Properties

"antialias"Read / WriteThe antialiasing mode to use. Default value: cairo.ANTIALIAS_DEFAULT
"fill-color"WriteThe color to use to paint the interior of the item. Default value: None
"fill-color-rgba"WriteThe color to use to paint the interior of the item, specified as a 32-bit integer value. Default value: 0
"fill-pattern"Read / WriteThe pattern to use to paint the interior of the item.
"fill-pixbuf"WriteThe pixbuf to use to paint the interior of the item.
"fill-rule"Read / WriteThe fill rule used to determine which parts of the item are filled. Default value: cairo.FILL_RULE_WINDING
"line-cap"Read / WriteThe line cap style to use. Default value: cairo.LINE_CAP_BUTT
"line-dash"Read / WriteThe dash pattern to use.
"line-join"Read / WriteThe line join style to use. Default value: cairo.LINE_JOIN_MITER
"line-join-miter-limit"Read / WriteThe smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit. Allowed values: >= 0 Default value: 10.
"line-width"Read / WriteThe line width to use for the item's perimeter. Allowed values: >= 0 Default value: 0
"operator"Read / WriteThe compositing operator to use. Default value: cairo.OPERATOR_OVER
"stroke-color"WriteThe color to use for the item's perimeter. Default value: None
"stroke-color-rgba"WriteThe color to use for the item's perimeter, specified as a 32-bit integer value. Default value: 0
"stroke-pattern"Read / WriteThe pattern to use to paint the perimeter of the item.
"stroke-pixbuf"WriteThe pixbuf to use to draw the item's perimeter.

Known Implementation

goocanvas.ItemSimple is implementated by goocanvas.Rect goocanvas.Ellipse goocanvas.Path goocanvas.Polyline goocanvas.Text goocanvas.Image goocanvas.Group

Implemented Interfaces

goocanvas.ItemSimple implements goocanvas.Item

Description

goocanvas.ItemSimple is used as a base class for the standard canvas items. It supports a number of style properties, such as "stroke-color", "fill-color" and "line-width". It also provides a number of utility functions that subclasses can use.

Methods

goocanvas.ItemSimple.check_in_path

    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.

goocanvas.ItemSimple.get_path_bounds

    def get_path_bounds(cr, bounds)
cr :a cairo context.
bounds :the GooCanvasBounds struct to store the resulting bounding box.

Calculates the bounds of the current path in device space, storing the results in the given GooCanvasBounds struct.

goocanvas.ItemSimple.paint_path

    def paint_path(cr)
cr :a cairo context.

Paints the current path, using the item's style settings.

goocanvas.ItemSimple.set_fill_options

    def set_fill_options(cr)
cr :a cairo context.

Sets the fill options of the cairo context, according to the item's style settings.

goocanvas.ItemSimple.set_stroke_options

    def set_stroke_options(cr)
cr :a cairo context.

Sets the stroke options of the cairo context, according to the item's style settings.

goocanvas.ItemSimple.set_style

    def set_style(style)
style :a GooCanvasStyle.

Sets the style of the item.

goocanvas.ItemSimple.user_bounds_to_device

    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.