// Generated by gmmproc 2.89.0 -- DO NOT MODIFY!
#ifndef _GDKMM_GRAPHENE_VEC2_H
#define _GDKMM_GRAPHENE_VEC2_H

#include <gdkmmconfig.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 <graphene.h>
#include <array>

namespace Gdk
{
namespace Graphene
{
class GDKMM_API Point;

/** A vector with two dimensions, x and y.
 *
 * @newin{4,24}
 */
class GDKMM_API Vec2
{
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  using CppObjectType = Vec2;
  using BaseObjectType = graphene_vec2_t;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

private:

  
public:
  Vec2();
  Vec2(float x, float y);
  explicit Vec2(const Point& src);
  explicit Vec2(const graphene_vec2_t* vec2); // always takes a copy

  /** Stores the components of this vector into an array.
   *
   * @newin{4,24}
   *
   * @return An array of floating point values with 2 elements.
   */
  std::array<float,2> to_float() const;
  

  /** Adds each component of two vectors.
   *
   * @newin{4,24}
   *
   * @param other A vector to add to this vector.
   * @return The sum of this vector and the other vector.
   */
  Vec2 add(const Vec2& other) const;
  

  /** Subtracts each component of the @a other vector from this vector.
   *
   * @newin{4,24}
   *
   * @param other A vector to subtract from this vector.
   * @return The difference between this vector and the other vector.
   */
  Vec2 subtract(const Vec2& other) const;
  

  //TODO:? Some graphene_vec2_*() methods are not wrapped in C++ code, because I
  // don't understand what they are good for. They can be added to Gdk::Graphene::Vec2
  // if anyone needs them. /kjellahl 2026-06-14
  // Vec2 multiply(const Vec2& other) const;
  // Vec2 divide(const Vec2& other) const;

  
  /** Computes the dot product of the two given vectors.
   * 
   * @newin{4,24}
   * 
   * @param other A #graphene_vec2_t.
   * @return The dot product of the vectors.
   */
  float dot(const Vec2& other) const;
  
  /** Computes the length of the given vector.
   * 
   * @newin{4,24}
   * 
   * @return The length of the vector.
   */
  float length() const;

  /** Computes the normalized vector for the given vector.
   *
   * @newin{4,24}
   *
   * @return The normalized vector.
   */
  Vec2 normalize() const;
  

  /** Multiplies all components of this vector with the given scalar @a factor.
   *
   * @newin{4,24}
   * 
   * @param factor The scalar factor.
   * @return The scaled vector.
   */
  Vec2 scale(float factor) const;
  

  /** Negates this vector.
   *
   * @newin{4,24}
   *
   * @return The negated vector.
   */
  Vec2 negate() const;
  

  /** Compares the two given #graphene_vec2_t vectors and checks
   * whether their values are within the given @a epsilon.
   * 
   * @newin{4,24}
   * 
   * @param other A #graphene_vec2_t.
   * @param epsilon The threshold between the two vectors.
   * @return `true` if the two vectors are near each other.
   */
  bool near(const Vec2& other, float epsilon) const;
  
  /** Checks whether the two given #graphene_vec2_t are equal.
   * 
   * @newin{4,24}
   * 
   * @param other A #graphene_vec2_t.
   * @return `true` if the two vectors are equal, and false otherwise.
   */
  bool equal(const Vec2& other) const;

  // Vec2 min(const Vec2& other) const;
  // Vec2 max(const Vec2& other) const;

  /** Linearly interpolates this vector and @a other using the given @a factor.
   *
   * @newin{4,24}
   *
   * @param other The other vector.
   * @param factor The interpolation factor.
   * @return The interpolated vector.
   */
  Vec2 interpolate(const Vec2& other, double factor) const;
  

  /** Retrieves the X component of the #graphene_vec2_t.
   * 
   * @newin{4,24}
   * 
   * @return The value of the X component.
   */
  float get_x() const;
  
  /** Retrieves the Y component of the #graphene_vec2_t.
   * 
   * @newin{4,24}
   * 
   * @return The value of the Y component.
   */
  float get_y() const;

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

protected:
  graphene_vec2_t gobject_;


};
} // namespace Graphene
} // namespace Gdk


#endif /* _GDKMM_GRAPHENE_VEC2_H */

