Klasse Stroke

Alle implementierten Schnittstellen:
PointerInterface

public class Stroke extends Record
Collects the parameters that are needed when stroking a path.

https://docs.gtk.org/gsk4/struct.Stroke.html

  • Konstruktordetails

    • Stroke

      public Stroke(PointerContainer pointer)
    • Stroke

      public Stroke(float line_width)
      Creates a new `GskStroke` with the given @line_width.
      Parameter:
      line_width - line width of the stroke. Must be > 0
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • copy

      public Stroke copy()
      Creates a copy of a `GskStroke`.
      Gibt zurück:
      a new `GskStroke`. Use [method@Gsk.Stroke.free] to free it
    • free

      public void free()
      Frees a `GskStroke`.
    • getDashOffset

      public float getDashOffset()
      Gets the dash offset.
      Gibt zurück:
      the dash offset
    • getLineCap

      public int getLineCap()
      Gets the line cap used.

      See [enum@Gsk.LineCap] for details.
      Gibt zurück:
      the line cap
    • getLineJoin

      public int getLineJoin()
      Gets the line join used.

      See [enum@Gsk.LineJoin] for details.
      Gibt zurück:
      the line join
    • getLineWidth

      public float getLineWidth()
      Gets the line width used.
      Gibt zurück:
      the line width
    • getMiterLimit

      public float getMiterLimit()
      Gets the miter limit.
      Gibt zurück:
      the miter limit
    • setDashOffset

      public void setDashOffset(float 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.
      Parameter:
      offset - offset into the dash pattern
    • setLineCap

      public void setLineCap(int line_cap)
      Sets the line cap to be used when stroking.

      See [enum@Gsk.LineCap] for details.
      Parameter:
      line_cap - the line cap
    • setLineJoin

      public void setLineJoin(int line_join)
      Sets the line join to be used when stroking.

      See [enum@Gsk.LineJoin] for details.
      Parameter:
      line_join - the line join to use
    • setLineWidth

      public void setLineWidth(float line_width)
      Sets the line width to be used when stroking.

      The line width must be > 0.
      Parameter:
      line_width - width of the line in pixels
    • setMiterLimit

      public void setMiterLimit(float 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].
      Parameter:
      limit - the miter limit
    • toCairo

      public void toCairo(@Nonnull Context cr)
      A helper function that sets the stroke parameters
      of a cairo context from a `GskStroke`.
      Parameter:
      cr - the cairo context to configure
    • equal

      public static boolean equal(@Nullable Pointer stroke1, @Nullable Pointer stroke2)
      Checks if two strokes are identical.
      Parameter:
      stroke1 - the first stroke
      stroke2 - the second stroke
      Gibt zurück:
      true if the two strokes are equal, false otherwise
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()