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


#include <glibmm.h>

#include <gskmm/stroke.h>
#include <gskmm/private/stroke_p.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/>.
 */

namespace Gsk
{
Stroke::Stroke(float line_width)
:
  gobject_(gsk_stroke_new(line_width))
{
}

void Stroke::set_dash(const std::vector<float>& dash)
{
  gsk_stroke_set_dash(gobj(), dash.data(), dash.size());
}

std::vector<float> Stroke::get_dash() const
{
  gsize n_dash = 0;
  const float* c_dash = gsk_stroke_get_dash(gobj(), &n_dash);
  if (!c_dash)
    return {};
  return {c_dash, c_dash+n_dash};
}
} // namespace Gsk

namespace
{
} // anonymous namespace


namespace Glib
{

Gsk::Stroke wrap(GskStroke* object, bool take_copy)
{
  return Gsk::Stroke(object, take_copy);
}

} // namespace Glib


namespace Gsk
{


// static
GType Stroke::get_type()
{
  return gsk_stroke_get_type();
}

Stroke::Stroke()
:
  gobject_ (nullptr) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
{}

Stroke::Stroke(const Stroke& other)
:
  gobject_ ((other.gobject_) ? gsk_stroke_copy(other.gobject_) : nullptr)
{}

Stroke::Stroke(Stroke&& other) noexcept
:
  gobject_(other.gobject_)
{
  other.gobject_ = nullptr;
}

Stroke& Stroke::operator=(Stroke&& other) noexcept
{
  Stroke temp (std::move(other));
  swap(temp);
  return *this;
}

Stroke::Stroke(GskStroke* gobject, bool make_a_copy)
:
  // For BoxedType wrappers, make_a_copy is true by default.  The static
  // BoxedType wrappers must always take a copy, thus make_a_copy = true
  // ensures identical behaviour if the default argument is used.
  gobject_ ((make_a_copy && gobject) ? gsk_stroke_copy(gobject) : gobject)
{}

Stroke& Stroke::operator=(const Stroke& other)
{
  Stroke temp (other);
  swap(temp);
  return *this;
}

Stroke::~Stroke() noexcept
{
  if(gobject_)
    gsk_stroke_free(gobject_);
}

void Stroke::swap(Stroke& other) noexcept
{
  std::swap(gobject_, other.gobject_);
}

GskStroke* Stroke::gobj_copy() const
{
  return gsk_stroke_copy(gobject_);
}


bool Stroke::equal(const Stroke& stroke2) const
{
  return gsk_stroke_equal(const_cast<GskStroke*>(gobj()), (stroke2).gobj());
}

void Stroke::set_line_width(float line_width)
{
  gsk_stroke_set_line_width(gobj(), line_width);
}

float Stroke::get_line_width() const
{
  return gsk_stroke_get_line_width(const_cast<GskStroke*>(gobj()));
}

void Stroke::_set_line_cap(LineCap line_cap)
{
  gsk_stroke_set_line_cap(gobj(), static_cast<GskLineCap>(line_cap));
}

LineCap Stroke::get_line_cap() const
{
  return static_cast<LineCap>(gsk_stroke_get_line_cap(const_cast<GskStroke*>(gobj())));
}

void Stroke::_set_line_join(LineJoin line_join)
{
  gsk_stroke_set_line_join(gobj(), static_cast<GskLineJoin>(line_join));
}

LineJoin Stroke::get_line_join() const
{
  return static_cast<LineJoin>(gsk_stroke_get_line_join(const_cast<GskStroke*>(gobj())));
}

void Stroke::set_miter_limit(float limit)
{
  gsk_stroke_set_miter_limit(gobj(), limit);
}

float Stroke::get_miter_limit() const
{
  return gsk_stroke_get_miter_limit(const_cast<GskStroke*>(gobj()));
}

void Stroke::set_dash_offset(float offset)
{
  gsk_stroke_set_dash_offset(gobj(), offset);
}

float Stroke::get_dash_offset() const
{
  return gsk_stroke_get_dash_offset(const_cast<GskStroke*>(gobj()));
}

void Stroke::to_cairo(const ::Cairo::RefPtr< ::Cairo::Context>& cr) const
{
  gsk_stroke_to_cairo(const_cast<GskStroke*>(gobj()), ((cr) ? (cr)->cobj() : nullptr));
}


} // namespace Gsk


