Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GraphenePoint

[28:7] extends: object

A point with two coordinates.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GraphenePoint (Handle = null)

    Allocates a new #graphene_point_t structure. The coordinates of the returned point are (0, 0). It's possible to chain this function with graphene_point_init() or graphene_point_init_from_point(), e.g.: |[ graphene_point_t * point_new (float x, float y) { return graphene_point_init (graphene_point_alloc (), x, y); } graphene_point_t * point_copy (const graphene_point_t *p) { return graphene_point_init_from_point (graphene_point_alloc (), p); } ]|

    • @p Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.
  • 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.
  • distance (object b)

    Computes the distance between @a and @b.

    • @p b is a #graphene_point_t.
    • @p d_x is distance component on the X axis.
    • @p d_y is distance component on the Y axis.
    • @r the distance between the two points.
  • distance_squared (object b)

    Computes the squared distance between @a and @b.

    • @p b is a #graphene_point_t.
    • @r the distance between the two points, squared.
  • equal (object b)

    Checks if the two points @a and @b point to the same coordinates. This function accounts for floating point fluctuations; if you want to control the fuzziness of the match, you can use graphene_point_near() instead.

    • @p b is a #graphene_point_t.
    • @r true if the points have the same coordinates.
  • free ()

    Frees the resources allocated by graphene_point_alloc().

    • @r None.
  • init (double x, double y)

    Initializes @p to the given @x and @y coordinates. It's safe to call this function multiple times.

    • @p x is the X coordinate.
    • @p y is the Y coordinate.
    • @r the initialized point.
  • init_from_point (object src)

    Initializes @p with the same coordinates of @src.

    • @p src is the #graphene_point_t to use.
    • @r the initialized point.
  • init_from_vec2 (object src)

    Initializes @p with the coordinates inside the given #graphene_vec2_t.

    • @p src is a #graphene_vec2_t.
    • @r the initialized point.
  • interpolate (object b, double factor)

    Linearly interpolates the coordinates of @a and @b using the given

    • @factor. ``
    • @p b is a #graphene_point_t.
    • @p factor is the linear interpolation factor.
    • @p res is return location for the interpolated point.
    • @r None.
  • near (object b, double epsilon)

    Checks whether the two points @a and @b are within the threshold of

    • @epsilon. ``
    • @p b is a #graphene_point_t.
    • @p epsilon is threshold between the two points.
    • @r true if the distance is within @epsilon.
  • to_vec2 ()

    Stores the coordinates of the given #graphene_point_t into a #graphene_vec2_t.

    • @p v is return location for the vertex.
    • @r None.

class: GraphenePointLayout

[12:14] static extends: object

Generated struct layout helper for GIR record Point.

Methods

  • layout ()

    Returns the Panama struct layout for Point.