// Generated by gmmproc 2.86.0 -- DO NOT MODIFY!
#ifndef _GSKMM_PATHPOINT_H
#define _GSKMM_PATHPOINT_H

#include <gskmmconfig.h>


#include <glibmm/ustring.h>
#include <sigc++/sigc++.h>

/* Copyright (C) 2026 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 */


#include <gdkmm/graphene_point.h>
#include <gdkmm/graphene_vec2.h>
#include <gskmm/enums.h>
#include <gsk/gsk.h> // GskPathPoint
#include <utility> // std::pair

namespace Gsk
{
class GSKMM_API Path;
class GSKMM_API PathMeasure;

/** Represents a point on a path.
 *
 * It can be queried for properties of the path at that point,
 * such as its tangent or its curvature.
 *
 * To obtain a %Gsk::PathPoint, use Gsk::Path::get_closest_point(),
 * Gsk::Path::get_start_point(), Gsk::Path::get_end_point()
 * or Gsk::PathMeasure::get_point().
 *
 * Note that %Gsk::PathPoint structs are meant to be stack-allocated,
 * and don't hold a reference to the path object they are obtained from.
 * It is the callers responsibility to keep a reference to the path
 * as long as the %Gsk::PathPoint is used.
 *
 * @newin{4,24}
 */
class GSKMM_API PathPoint
{
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  using CppObjectType = PathPoint;
  using BaseObjectType = GskPathPoint;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

  PathPoint(const PathPoint& other) noexcept;
  PathPoint& operator=(const PathPoint& other) noexcept;

  PathPoint(PathPoint&& other) noexcept;
  PathPoint& operator=(PathPoint&& other) noexcept;

  /** Get the GType for this class, for use with the underlying GObject type system.
   */
  static GType get_type() G_GNUC_CONST;

  PathPoint();

  explicit PathPoint(const GskPathPoint* gobject); // always takes a copy

  ///Provides access to the underlying C instance.
  GskPathPoint*       gobj()       { return &gobject_; }

  ///Provides access to the underlying C instance.
  const GskPathPoint* gobj() const { return &gobject_; }

protected:
  GskPathPoint gobject_;

private:
  
  
public:
  
  /** Returns whether the two path points refer to the same
   * location on all paths.
   * 
   * Note that the start- and endpoint of a closed contour
   * will compare nonequal according to this definition.
   * Use is_closed() to find out if the
   * start- and endpoint of a concrete path refer to the
   * same location.
   * 
   * Return: true if @a point1 and @a point2 are equal
   * 
   * @newin{4,24}
   * 
   * @param point2 Another path point.
   */
  bool equal(const PathPoint& point2) const;
  
  /** Returns whether @a point1 is before or after @a point2.
   * 
   * @newin{4,24}
   * 
   * @param point2 Another path point.
   * @return -1 if @a point1 is before @a point2,
   * 1 if @a point1 is after @a point2,
   * 0 if they are equal.
   */
  int compare(const PathPoint& point2) const;

  /** Gets the position of the point.
   *
   * @newin{4,24}
   *
   * @param path The path that this @a point is on.
   * @return The coordinates of the point.
   */
  Gdk::Graphene::Point get_position(const Glib::RefPtr<const Path>& path) const;
  

  /** Gets the tangent of the path at this point.
   *
   * Note that certain points on a path may not have a single
   * tangent, such as sharp turns. At such points, there are
   * two tangents — the direction of the path going into the
   * point, and the direction coming out of it. The @a direction
   * argument lets you choose which one to get.
   *
   * If the path is just a single point (e.g. a circle with
   * radius zero), then the tangent is set to `0, 0`.
   *
   * If you want to orient something in the direction of the
   * path, get_rotation() may be more convenient to use.
   *
   * @newin{4,24}
   *
   * @param path The path that this point is on.
   * @param direction The direction for which to return the tangent.
   * @return The tangent at this point.
   */
  Gdk::Graphene::Vec2 get_tangent(const Glib::RefPtr<const Path>& path,
    PathDirection direction) const;
  

  /** Gets the direction of the tangent at a given point.
   * 
   * This is a convenience variant of get_tangent()
   * that returns the angle between the tangent and the X axis. The angle
   * can e.g. be used in
   * [gtk_snapshot_rotate()](../gtk4/method.Snapshot.rotate.html).
   * 
   * @newin{4,24}
   * 
   * @param path The path that @a point is on.
   * @param direction The direction for which to return the rotation.
   * @return The angle between the tangent and the X axis, in degrees.
   */
  float get_rotation(const Glib::RefPtr<const Path>& path, PathDirection direction) const;

  /** Calculates the curvature of the path at this point.
   *
   * Returns the center of the osculating circle as well.
   * The curvature is the inverse of the radius of the osculating circle.
   *
   * Lines have a curvature of zero (indicating an osculating circle of
   * infinite radius). In this case, the @a center is set to `0, 0`.
   *
   * Circles with a radius of zero have `INFINITY` as curvature.
   *
   * Note that certain points on a path may not have a single curvature,
   * such as sharp turns. At such points, there are two curvatures — the
   * (limit of) the curvature of the path going into the point, and the
   * (limit of) the curvature of the path coming out of it. The @a direction
   * argument lets you choose which one to get.
   *
   * <picture>
   * <source srcset="curvature-dark.png" media="(prefers-color-scheme: dark)">
   * <img alt="Osculating circle" src="curvature-light.png">
   * </picture>
   * 
   * @newin{4,24}
   * 
   * @param path The path that this point is on.
   * @param direction The direction for which to return the curvature.
   * @return {curvature, center} The curvature of the path at this point
   *         and the center of the osculating circle.
   */
  std::pair<float, Gdk::Graphene::Point> get_curvature(const Glib::RefPtr<const Path>& path,
    PathDirection direction) const;
  

  /** Returns the distance from the beginning of the path
   * to the point.
   * 
   * @newin{4,24}
   * 
   * @param measure A path measure for the path.
   * @return The distance of @a point.
   */
  float get_distance(const Glib::RefPtr<const PathMeasure>& measure) const;


};

} // namespace Gsk


namespace Glib
{

/** @relates Gsk::PathPoint
 * @param object The C instance
 * @result A C++ instance that wraps this C instance.
 */
GSKMM_API
Gsk::PathPoint& wrap(GskPathPoint* object);

/** @relates Gsk::PathPoint
 * @param object The C instance
 * @result A C++ instance that wraps this C instance.
 */
GSKMM_API
const Gsk::PathPoint& wrap(const GskPathPoint* object);

#ifndef DOXYGEN_SHOULD_SKIP_THIS
template <>
class GSKMM_API Value<Gsk::PathPoint> : public Glib::Value_Boxed<Gsk::PathPoint>
{};
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

} // namespace Glib


#endif /* _GSKMM_PATHPOINT_H */

