// Generated by gmmproc 2.89.0 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gskmm/pathpoint.h>
#include <gskmm/private/pathpoint_p.h>

#include <cstring> // std::memset()

/* 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 <gskmm/path.h>
#include <gskmm/pathmeasure.h>

namespace Gsk
{
Gdk::Graphene::Point PathPoint::get_position(const Glib::RefPtr<const Path>& path) const
{
  Gdk::Graphene::Point position(0.0f, 0.0f);
  gsk_path_point_get_position(gobj(), const_cast<GskPath*>(path->gobj()), position.gobj());
  return position;
}

Gdk::Graphene::Vec2 PathPoint::get_tangent(const Glib::RefPtr<const Path>& path,
  PathDirection direction) const
{
  Gdk::Graphene::Vec2 tangent(0.0f, 0.0f);
  gsk_path_point_get_tangent(gobj(), const_cast<GskPath*>(path->gobj()), static_cast<GskPathDirection>(direction),
    tangent.gobj());
  return tangent;
}

std::pair<float, Gdk::Graphene::Point> PathPoint::get_curvature(const Glib::RefPtr<const Path>& path,
    PathDirection direction) const
{
  Gdk::Graphene::Point center(0.0f, 0.0f);
  const float curvature = gsk_path_point_get_curvature(gobj(), const_cast<GskPath*>(path->gobj()),
    static_cast<GskPathDirection>(direction), center.gobj());
  return {curvature, center};
}
} // namespace Gsk

namespace
{
} // anonymous namespace


namespace Glib
{

Gsk::PathPoint& wrap(GskPathPoint* object)
{
  return *reinterpret_cast<Gsk::PathPoint*>(object);
}

const Gsk::PathPoint& wrap(const GskPathPoint* object)
{
  return *reinterpret_cast<const Gsk::PathPoint*>(object);
}

} // namespace Glib


namespace Gsk
{


PathPoint::PathPoint(const PathPoint& other) noexcept
:
  gobject_(other.gobject_)
{
}

PathPoint& PathPoint::operator=(const PathPoint& other) noexcept
{
  gobject_ = other.gobject_;
  return *this;
}

PathPoint::PathPoint(PathPoint&& other) noexcept
:
  gobject_(std::move(other.gobject_))
{
  //We could wipe other.gobject_ via memset,
  //but that is not really necessary:
  //other.gobject_ = nullptr;
}

PathPoint& PathPoint::operator=(PathPoint&& other) noexcept
{
  gobject_ = std::move(other.gobject_);
  return *this;
}

// static
GType PathPoint::get_type()
{
  return gsk_path_point_get_type();
}

PathPoint::PathPoint()
{
  std::memset(&gobject_, 0, sizeof(GskPathPoint));
}

PathPoint::PathPoint(const GskPathPoint* gobject)
{
  if(gobject)
    gobject_ = *gobject;
  else
    std::memset(&gobject_, 0, sizeof(GskPathPoint));
}


bool PathPoint::equal(const PathPoint& point2) const
{
  return gsk_path_point_equal(const_cast<GskPathPoint*>(gobj()), (point2).gobj());
}

int PathPoint::compare(const PathPoint& point2) const
{
  return gsk_path_point_compare(const_cast<GskPathPoint*>(gobj()), (point2).gobj());
}

float PathPoint::get_rotation(const Glib::RefPtr<const Path>& path, PathDirection direction) const
{
  return gsk_path_point_get_rotation(const_cast<GskPathPoint*>(gobj()), const_cast<GskPath*>(Glib::unwrap(path)), static_cast<GskPathDirection>(direction));
}

float PathPoint::get_distance(const Glib::RefPtr<const PathMeasure>& measure) const
{
  return gsk_path_point_get_distance(const_cast<GskPathPoint*>(gobj()), const_cast<GskPathMeasure*>(Glib::unwrap(measure)));
}


} // namespace Gsk


