Gnome::Gsk4::T-path

#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------

Class initialization

new

Initialization of a type class is simple and only needed when the standalone functions are used.

method new ( )

#------------------------------------------------------------------------------- #--[Bitfields]------------------------------------------------------------------ #-------------------------------------------------------------------------------

Bitfields

GskPathForeachFlags

Flags that can be passed to .foreach() to influence what kinds of operations the path is decomposed into.

By default, .foreach() will only emit a path with all operations flattened to straight lines to allow for maximum compatibility. The only operations emitted will be GSK_PATH_MOVE, GSK_PATH_LINE and GSK_PATH_CLOSE.

  • GSK_PATH_FOREACH_ALLOW_ONLY_LINES; The default behavior, only allow lines.

  • GSK_PATH_FOREACH_ALLOW_QUAD; Allow emission of GSK_PATH_QUAD operations

  • GSK_PATH_FOREACH_ALLOW_CUBIC; Allow emission of GSK_PATH_CUBIC operations.

  • GSK_PATH_FOREACH_ALLOW_CONIC; Allow emission of GSK_PATH_CONIC operations.

#------------------------------------------------------------------------------- #--[Callback Functions]--------------------------------------------------------- #-------------------------------------------------------------------------------

Callback Functions

PathForeachFunc

Signature

:(  GEnum $op, N-Object $pts, Int() $n-pts, Num() $weight, gpointer $user-data  )
  • op; The operation

  • pts; The points of the operation

  • n-pts; The number of points

  • weight; The weight for conic curves, or unused if not a conic curve

  • user-data; The user data provided with the function

#------------------------------------------------------------------------------- #--[Standalone Functions]------------------------------------------------------- #-------------------------------------------------------------------------------

Standalone Functions

#-------------------------------------------------------------------------------

path-parse

This is a convenience function that constructs a Gnome::Gsk4::N-Path from a serialized form.

The string is expected to be in (a superset of) [SVG path syntax](https://www.w3.org/TR/SVG11/paths.html#PathData), as e.g. produced by .to-string().

A high-level summary of the syntax:

  • M x y` Move to `(x, y)`

  • L x y` Add a line from the current point to `(x, y)`

  • Q x1 y1 x2 y2` Add a quadratic BĂ©zier from the current point to `(x2, y2)`, with control point `(x1, y1)`

  • C x1 y1 x2 y2 x3 y3` Add a cubic BĂ©zier from the current point to `(x3, y3)`, with control points `(x1, y1)` and `(x2, y2)`

  • Z Close the contour by drawing a line back to the start point

  • H x` Add a horizontal line from the current point to the given x value

  • V y` Add a vertical line from the current point to the given y value

  • T x2 y2` Add a quadratic BĂ©zier, using the reflection of the previous segments' control point as control point

  • S x2 y2 x3 y3` Add a cubic BĂ©zier, using the reflection of the previous segments' second control point as first control point

  • A rx ry r l s x y` Add an elliptical arc from the current point to `(x, y)` with radii rx and ry. See the SVG documentation for how the other parameters influence the arc.

  • O x1 y1 x2 y2 w` Add a rational quadratic BĂ©zier from the current point to `(x2, y2)` with control point `(x1, y1)` and weight w.

All the commands have lowercase variants that interpret coordinates relative to the current point.

The O command is an extension that is not supported in SVG.

method path-parse ( Str $string --> N-Object )
  • $string; a string.

Return value; a new Gnome::Gsk4::N-Path, or undefined if $string could not be parsed.

Gnome::Gsk4 v0.2.0

GSK is the rendering and scene graph API

Authors

  • Marcel Timmerman

License

Artistic-2.0

Dependencies

Gnome::Gdk4:api<2>Gnome::Graphene:api<2>Gnome::GObject:api<2>Gnome::Glib:api<2>Gnome::N:api<2>

Test Dependencies

Provides

  • Gnome::Gsk4::BlendNode
  • Gnome::Gsk4::BlurNode
  • Gnome::Gsk4::BorderNode
  • Gnome::Gsk4::CairoNode
  • Gnome::Gsk4::CairoRenderer
  • Gnome::Gsk4::ClipNode
  • Gnome::Gsk4::ColorMatrixNode
  • Gnome::Gsk4::ColorNode
  • Gnome::Gsk4::ConicGradientNode
  • Gnome::Gsk4::ContainerNode
  • Gnome::Gsk4::CrossFadeNode
  • Gnome::Gsk4::DebugNode
  • Gnome::Gsk4::GLRenderer
  • Gnome::Gsk4::GLShader
  • Gnome::Gsk4::GLShaderNode
  • Gnome::Gsk4::InsetShadowNode
  • Gnome::Gsk4::LinearGradientNode
  • Gnome::Gsk4::MaskNode
  • Gnome::Gsk4::N-RoundedRect
  • Gnome::Gsk4::N-ShaderArgsBuilder
  • Gnome::Gsk4::N-Transform
  • Gnome::Gsk4::OpacityNode
  • Gnome::Gsk4::OutsetShadowNode
  • Gnome::Gsk4::RadialGradientNode
  • Gnome::Gsk4::RenderNode
  • Gnome::Gsk4::Renderer
  • Gnome::Gsk4::RepeatNode
  • Gnome::Gsk4::RepeatingLinearGradientNode
  • Gnome::Gsk4::RepeatingRadialGradientNode
  • Gnome::Gsk4::RoundedClipNode
  • Gnome::Gsk4::ShadowNode
  • Gnome::Gsk4::T-enums
  • Gnome::Gsk4::T-glshader
  • Gnome::Gsk4::T-path
  • Gnome::Gsk4::T-rendernode
  • Gnome::Gsk4::T-roundedrect
  • Gnome::Gsk4::T-stroke
  • Gnome::Gsk4::T-transform
  • Gnome::Gsk4::T-types
  • Gnome::Gsk4::TextNode
  • Gnome::Gsk4::TextureNode
  • Gnome::Gsk4::TextureScaleNode
  • Gnome::Gsk4::TransformNode

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.