Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GskStroke

[13:7] extends: object

Collects the parameters that are needed when stroking a path.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GskStroke (line_width = null)

    Creates a new GskStroke with the given @line_width.

    • @p line_width is line width of the stroke. Must be > 0.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • copy ()

    Creates a copy of a GskStroke.

    • @r a new GskStroke. Use [method@Gsk.Stroke.free] to free it.
  • free ()

    Frees a GskStroke.

    • @r None.
  • get_dash ()

    Gets the dash array in use.

    • @p n_dash is number of elements in the array returned.
    • @r the dash array or NULL if the dash array is empty.
  • get_dash_offset ()

    Gets the dash offset.

    • @r the dash offset.
  • get_line_cap ()

    Gets the line cap used. See [enum@Gsk.LineCap] for details.

    • @r the line cap.
  • get_line_join ()

    Gets the line join used. See [enum@Gsk.LineJoin] for details.

    • @r the line join.
  • get_line_width ()

    Gets the line width used.

    • @r the line width.
  • get_miter_limit ()

    Gets the miter limit.

    • @r the miter limit.
  • set_dash (list 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 [enum@Gsk.LineCap.round] or [enum@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 [method@Gsk.Stroke.set_dash_offset].
    • @p dash is the array of dashes.
    • @p n_dash is number of elements in @dash.
    • @r None.
  • set_dash_offset (double 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 [method@Gsk.Stroke.set_dash] for more details on dashing.

    • @p offset is offset into the dash pattern.
    • @r None.
  • set_line_cap (string line_cap)

    Sets the line cap to be used when stroking. See [enum@Gsk.LineCap] for details.

    • @p line_cap is the line cap.
    • @r None.
  • set_line_join (string line_join)

    Sets the line join to be used when stroking. See [enum@Gsk.LineJoin] for details.

    • @p line_join is the line join to use.
    • @r None.
  • set_line_width (double line_width)

    Sets the line width to be used when stroking. The line width must be >= 0.

    • @p line_width is width of the line in pixels.
    • @r None.
  • set_miter_limit (double 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 [enum@Gsk.LineJoin.miter] that exceed the miter limit, the join gets rendered as if it was of type [enum@Gsk.LineJoin.bevel].

    • @p limit is the miter limit.
    • @r None.
  • to_cairo (object cr)

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

    • @p cr is the cairo context to configure.
    • @r None.