GOffice.CanvasStyledItem

g GObject.GInterface GObject.GInterface GOffice.StyledObject GOffice.StyledObject GObject.GInterface->GOffice.StyledObject GObject.Object GObject.Object GOffice.CanvasItem GOffice.CanvasItem GObject.Object->GOffice.CanvasItem GOffice.CanvasStyledItem GOffice.CanvasStyledItem GOffice.CanvasItem->GOffice.CanvasStyledItem GOffice.StyledObject->GOffice.CanvasStyledItem

Subclasses:

GOffice.CanvasArc, GOffice.CanvasCircle, GOffice.CanvasEllipse, GOffice.CanvasLine, GOffice.CanvasPath, GOffice.CanvasPolygon, GOffice.CanvasPolyline, GOffice.CanvasRectangle, GOffice.CanvasText

Methods

Inherited:

GOffice.CanvasItem (22), GObject.Object (37), GOffice.StyledObject (8)

Structs:

GObject.ObjectClass (5)

get_scale_line_width ()

set_cairo_line (cr)

set_scale_line_width (scale_line_width)

Virtual Methods

Inherited:

GOffice.CanvasItem (17), GObject.Object (7)

do_init_style (style)

do_style_changed (new_style)

Properties

Inherited:

GOffice.CanvasItem (2)

Name

Type

Flags

Short Description

scale-line-width

bool

r/w

Whether to scale the line width when zooming

style

GOffice.Style

r/w

A pointer to the GOffice.Style object

Signals

Inherited:

GObject.Object (1)

Name

Short Description

style-changed

The ::style-changed signal is emitted when a new style has been set on a styled item.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

base

GOffice.CanvasItem

r

priv

object

r

scale_line_width

bool

r

style

GOffice.Style

r

Class Details

class GOffice.CanvasStyledItem(**kwargs)
Bases:

GOffice.CanvasItem, GOffice.StyledObject

Abstract:

Yes

Structure:

GOffice.CanvasStyledItemClass

get_scale_line_width()
Returns:

whether the line width needs to be scaled.

Return type:

bool

This function returns True if the line width needs to be scaled. It will always return False if the line width is 0.

set_cairo_line(cr)
Parameters:

cr (cairo.Context) – cairo.Context

Returns:

True if the line is not invisible

Return type:

bool

Prepares the cairo context cr to draw a line according to the item style and canvas scale. The line width is scaled only if the scale-line-width property is set to True. This function calls GOffice.StyledObject.set_cairo_line().

If the item drawing used goc_group_cairo_transform(), scale-line-width should be False to avoid scaling twice, or GOffice.StyledObject.set_cairo_line() should be called directly instead.

set_scale_line_width(scale_line_width)
Parameters:

scale_line_width (bool) – boolean

Sets whether the line width needs to be scaled according to the current canvas resolution and the item transformation. It will be ignored if the line width is 0. Default GOffice.value is True.

do_init_style(style) virtual
Parameters:

style (GOffice.Style) –

do_style_changed(new_style) virtual
Parameters:

new_style (GOffice.Style) –

Signal Details

GOffice.CanvasStyledItem.signals.style_changed(canvas_styled_item, style)
Signal Name:

style-changed

Flags:

RUN_LAST

Parameters:

The ::style-changed signal is emitted when a new style has been set on a styled item.

Property Details

GOffice.CanvasStyledItem.props.scale_line_width
Name:

scale-line-width

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

Whether to scale the line width when zooming

GOffice.CanvasStyledItem.props.style
Name:

style

Type:

GOffice.Style

Default Value:

None

Flags:

READABLE, WRITABLE

A pointer to the GOffice.Style object