// Generated by gmmproc 2.89.0 -- DO NOT MODIFY!
#ifndef _GSKMM_PATHMEASURE_H
#define _GSKMM_PATHMEASURE_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 <glibmm/refptr.h>
#include <gskmm/pathpoint.h>
#include <gsk/gsk.h> // GskPathMeasure
#include <optional>

namespace Gsk
{
class GSKMM_API Path;

/** Performs measurements on paths such as determining the length of the path.
 *
 * Many measuring operations require sampling the path length
 * at intermediate points. Therefore, a %Gsk::PathMeasure has
 * a tolerance that determines what precision is required
 * for such approximations.
 *
 * @newin{4,24}
 */
class GSKMM_API PathMeasure final
{
  // GskPathMeasure is registered as a boxed type, but it has custom
  // reference-counting instead of copy/free functions, so we use it via RefPtr.
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  using CppObjectType = PathMeasure;
  using BaseObjectType = GskPathMeasure;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


  /** Increment the reference count for this object.
   * You should never need to do this manually - use the object via a RefPtr instead.
   */
  void reference()   const;

  /** Decrement the reference count for this object.
   * You should never need to do this manually - use the object via a RefPtr instead.
   */
  void unreference() const;

  ///Provides access to the underlying C instance.
  GskPathMeasure*       gobj();

  ///Provides access to the underlying C instance.
  const GskPathMeasure* gobj() const;

  ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
  GskPathMeasure* gobj_copy() const;

  PathMeasure() = delete;

  // noncopyable
  PathMeasure(const PathMeasure&) = delete;
  PathMeasure& operator=(const PathMeasure&) = delete;

protected:
  // Do not derive this.  Gsk::PathMeasure can neither be constructed nor deleted.

  void operator delete(void*, std::size_t);

private:

  // Necessary if used in _WRAP_PROPERTY: _IS_REFCOUNTED_BOXEDTYPE dnl// Generate a Glib::Value specialization
  

public:
  
  /** Creates a measure object for the given @a path with the
   * default tolerance.
   * 
   * @newin{4,24}
   * 
   * @param path The path to measure.
   * @return A new `Gsk::PathMeasure` representing @a path.
   */
  static Glib::RefPtr<PathMeasure> create(const Glib::RefPtr<const Path>& path);
  
  /** Creates a measure object for the given @a path and @a tolerance.
   * 
   * @newin{4,24}
   * 
   * @param path The path to measure.
   * @param tolerance The tolerance for measuring operations.
   * @return A new `Gsk::PathMeasure` representing @a path.
   */
  static Glib::RefPtr<PathMeasure> create(const Glib::RefPtr<const Path>& path, float tolerance);
  // Gsk::Path is immutable. No need for a non-const get-method.
  
  /** Returns the path that the measure was created for.
   * 
   * @newin{4,24}
   * 
   * @return The path of @a self.
   */
  Glib::RefPtr<Path> get_path() const;
  
  /** Returns the tolerance that the measure was created with.
   * 
   * @newin{4,24}
   * 
   * @return The tolerance of @a self.
   */
  float get_tolerance() const;
  
  /** Gets the length of the path being measured.
   * 
   * The length is cached, so this function does not do any work.
   * 
   * @newin{4,24}
   * 
   * @return The length of the path measured by @a self.
   */
  float get_length() const;

  /** Gets the point at the given distance into the path.
   *
   * An empty path has no points, so no value is returned in that case.
   *
   * @newin{4,24}
   *
   * @param distance The distance.
   * @return The point, if it was set.
   */
  std::optional<PathPoint> get_point(float distance);
  

};

} // namespace Gsk


namespace Glib
{

/** A Glib::wrap() method for this object.
 *
 * @param object The C instance.
 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 * @result A C++ instance that wraps this C instance.
 *
 * @relates Gsk::PathMeasure
 */
GSKMM_API
Glib::RefPtr<Gsk::PathMeasure> wrap(GskPathMeasure* object, bool take_copy = false);

} // namespace Glib


#endif /* _GSKMM_PATHMEASURE_H */

