2.11 <GskStroke>

Structure: <GskStroke>

Collects the parameters that are needed when stroking a path.

Procedures

Method: stroke:copy self ⇒ %return
Method: copy self ⇒ %return

Creates a copy of a <GskStroke>.

self

Passed: a <GskStroke>.

the stroke to copy

%return

Returned: a <GskStroke>.

a new <GskStroke>. Use stroke:free to free it

Procedure: stroke:equal? [stroke1] [stroke2] ⇒ %return

Checks if two strokes are identical.

stroke1

Passed, or left out: a foreign pointer, or a bytevector, or #f.

the first stroke

stroke2

Passed, or left out: a foreign pointer, or a bytevector, or #f.

the second stroke

%return

Returned: a boolean.

true if the two strokes are equal, false otherwise

Method: stroke:free self
Method: free self

Frees a <GskStroke>.

self

Passed: a <GskStroke>.

a stroke

Method: stroke:get-dash self ⇒ %return
Method: get-dash self ⇒ %return

Gets the dash array in use.

self

Passed: a <GskStroke>.

a stroke

%return

Returned: a f32vector, or #f.

the dash array or NULL if the dash array is empty

n-dash

Not returned: it is the length of %return.

number of elements in the array returned

Method: stroke:get-dash-offset self ⇒ %return
Method: get-dash-offset self ⇒ %return

Gets the dash offset.

self

Passed: a <GskStroke>.

a stroke

%return

Returned: a real number.

the dash offset

Method: stroke:get-line-cap self ⇒ %return
Method: get-line-cap self ⇒ %return

Gets the line cap used.

See <GskLineCap> for details.

self

Passed: a <GskStroke>.

a stroke

%return

Returned: a <GskLineCap>.

the line cap

Method: stroke:get-line-join self ⇒ %return
Method: get-line-join self ⇒ %return

Gets the line join used.

See <GskLineJoin> for details.

self

Passed: a <GskStroke>.

a stroke

%return

Returned: a <GskLineJoin>.

the line join

Method: stroke:get-line-width self ⇒ %return
Method: get-line-width self ⇒ %return

Gets the line width used.

self

Passed: a <GskStroke>.

a stroke

%return

Returned: a real number.

the line width

Method: stroke:get-miter-limit self ⇒ %return
Method: get-miter-limit self ⇒ %return

Gets the miter limit.

self

Passed: a <GskStroke>.

a stroke

%return

Returned: a real number.

the miter limit

Procedure: stroke:new line-width ⇒ %return

Creates a new <GskStroke> with the given line-width.

line-width

Passed: a real number.

line width of the stroke. Must be > 0

%return

Returned: a <GskStroke>.

a new <GskStroke>

Method: stroke:set-dash self dash
Method: set-dash self dash

Sets the dash pattern to use.

A dash pattern is specified by an array of alternating non-negative values. Each value provides the length of alternate "on" and "off" portions of the stroke.

Each "on" segment will have caps applied as if the segment were a separate contour. In particular, it is valid to use an "on" length of 0 with Gsk.LineCap.round or Gsk.LineCap.square to draw dots or squares along a path.

If n-dash is 0, if all elements in dash are 0, or if there are negative values in dash, then dashing is disabled.

If n-dash is 1, an alternating "on" and "off" pattern with the single dash length provided is assumed.

If n-dash is uneven, the dash array will be used with the first element in dash defining an "on" or "off" in alternating passes through the array.

You can specify a starting offset into the dash with stroke:set-dash-offset.

self

Passed: a <GskStroke>.

a stroke

dash

Passed: a f32vector, or a list or vector, each a real number, or #f.

the array of dashes

n-dash

Not passed: guile-gi gives the length of dash.

number of elements in dash

Method: stroke:set-dash-offset self offset
Method: set-dash-offset self offset

Sets the offset into the dash pattern where dashing should begin.

This is an offset into the length of the path, not an index into the array values of the dash array.

See stroke:set-dash for more details on dashing.

self

Passed: a <GskStroke>.

a stroke

offset

Passed: a real number.

offset into the dash pattern

Method: stroke:set-line-cap self line-cap
Method: set-line-cap self line-cap

Sets the line cap to be used when stroking.

See <GskLineCap> for details.

self

Passed: a <GskStroke>.

a stroke

line-cap

Passed: a <GskLineCap>, or one of its symbols.

the line cap

Method: stroke:set-line-join self line-join
Method: set-line-join self line-join

Sets the line join to be used when stroking.

See <GskLineJoin> for details.

self

Passed: a <GskStroke>.

a stroke

line-join

Passed: a <GskLineJoin>, or one of its symbols.

the line join to use

Method: stroke:set-line-width self line-width
Method: set-line-width self line-width

Sets the line width to be used when stroking.

The line width must be >= 0.

self

Passed: a <GskStroke>.

a stroke

line-width

Passed: a real number.

width of the line in pixels

Method: stroke:set-miter-limit self limit
Method: set-miter-limit self limit

Sets the miter limit to be used when stroking.

The miter limit is the distance from the corner where sharp turns of joins get cut off.

The limit is specfied in units of line width and must be non-negative.

For joins of type Gsk.LineJoin.miter that exceed the miter limit, the join gets rendered as if it was of type Gsk.LineJoin.bevel.

self

Passed: a <GskStroke>.

a stroke

limit

Passed: a real number.

the miter limit

Method: stroke:to-cairo self cr
Method: to-cairo self cr

A helper function that sets the stroke parameters of a cairo context from a <GskStroke>.

self

Passed: a <GskStroke>.

a stroke

cr

Passed: a <CairoContext>.

the cairo context to configure