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


#include <glibmm.h>

#include <gtkmm/svg.h>
#include <gtkmm/private/svg_p.h>


/* Copyright (C) 2025 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/>.
 */

using Features = Gtk::Svg::Features;

namespace Gtk
{
Gtk::SvgErrorExtra::SvgErrorExtra(GError* gobject)
:
  SvgError(gobject)
{}

std::vector<Glib::ustring> Svg::get_state_names() const
{
  unsigned int length = 0;
  const char** state_names = gtk_svg_get_state_names(const_cast<GtkSvg*>(gobj()), &length);
  return Glib::ArrayHandler<Glib::ustring>::array_to_vector(state_names, length, Glib::OWNERSHIP_NONE);
}

} // namespace Gtk

namespace
{


extern "C" {
static void Svg_signal_error_connect_callback(GtkSvg* self, GError* p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const SvgErrorExtra&)>;

  auto obj = dynamic_cast<Svg*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(SvgErrorExtra(g_error_copy(p0))
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo Svg_signal_error_info =
{
  "error",
  (GCallback) &Svg_signal_error_connect_callback,
  (GCallback) &Svg_signal_error_connect_callback
};


} // anonymous namespace


Gtk::SvgError::SvgError(Gtk::SvgError::Code error_code, const Glib::ustring& error_message)
:
  Glib::Error (GTK_SVG_ERROR, error_code, error_message)
{}

Gtk::SvgError::SvgError(GError* gobject)
:
  Glib::Error (gobject)
{}

Gtk::SvgError::Code Gtk::SvgError::code() const
{
  return static_cast<Code>(Glib::Error::code());
}

void Gtk::SvgError::throw_func(GError* gobject)
{
  throw Gtk::SvgError(gobject);
}

// static
GType Glib::Value<Gtk::SvgError::Code>::value_type()
{
  return gtk_svg_error_get_type();
}


namespace Gtk
{


Glib::ustring SvgErrorExtra::get_element() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_svg_error_get_element(const_cast<GError*>(gobj())));
}

Glib::ustring SvgErrorExtra::get_attribute() const
{
  return Glib::convert_const_gchar_ptr_to_ustring(gtk_svg_error_get_attribute(const_cast<GError*>(gobj())));
}

const GtkSvgLocation* SvgErrorExtra::get_start() const
{
  return gtk_svg_error_get_start(const_cast<GError*>(gobj()));
}

const GtkSvgLocation* SvgErrorExtra::get_end() const
{
  return gtk_svg_error_get_end(const_cast<GError*>(gobj()));
}


} // namespace Gtk

// static
GType Glib::Value<Gtk::Svg::Features>::value_type()
{
  return gtk_svg_features_get_type();
}


namespace Glib
{

Glib::RefPtr<Gtk::Svg> wrap(GtkSvg* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gtk::Svg>( dynamic_cast<Gtk::Svg*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& Svg_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Do not derive a GType, or use a derived class:
    gtype_ = gtk_svg_get_type();

  }

  return *this;
}


Glib::ObjectBase* Svg_Class::wrap_new(GObject* object)
{
  return new Svg((GtkSvg*)object);
}


/* The implementation: */

GtkSvg* Svg::gobj_copy()
{
  reference();
  return gobj();
}

Svg::Svg(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

Svg::Svg(GtkSvg* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


Svg::Svg(Svg&& src) noexcept
: Glib::Object(std::move(src))
  , Gdk::Paintable(std::move(src))
  , SymbolicPaintable(std::move(src))
{}

Svg& Svg::operator=(Svg&& src) noexcept
{
  Glib::Object::operator=(std::move(src));
  Gdk::Paintable::operator=(std::move(src));
  SymbolicPaintable::operator=(std::move(src));
  return *this;
}


Svg::~Svg() noexcept
{}


Svg::CppClassType Svg::svg_class_; // initialize static member

GType Svg::get_type()
{
  return svg_class_.init().get_type();
}


GType Svg::get_base_type()
{
  return gtk_svg_get_type();
}

Svg::Svg()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Glib::Object(Glib::ConstructParams(svg_class_.init()))
{
  

}

Glib::RefPtr<Svg> Svg::create()
{
  return Glib::make_refptr_for_instance<Svg>( new Svg() );
}

Glib::RefPtr<Svg> Svg::create(const Glib::RefPtr<const Glib::Bytes>& bytes)
{
  return Glib::wrap(gtk_svg_new_from_bytes(const_cast<GBytes*>(Glib::unwrap<Glib::Bytes>(bytes))));
}

Glib::RefPtr<Svg> Svg::create(const std::string& path)
{
  return Glib::wrap(gtk_svg_new_from_resource(path.c_str()));
}

void Svg::load_from_bytes(const Glib::RefPtr<const Glib::Bytes>& bytes)
{
  gtk_svg_load_from_bytes(gobj(), const_cast<GBytes*>(Glib::unwrap<Glib::Bytes>(bytes)));
}

void Svg::load_from_resource(const std::string& path)
{
  gtk_svg_load_from_resource(gobj(), path.c_str());
}

Glib::RefPtr<Glib::Bytes> Svg::serialize() const
{
  return Glib::wrap(gtk_svg_serialize(const_cast<GtkSvg*>(gobj())));
}

void Svg::write_to_file(const std::string& filename) const
{
  GError* gerror = nullptr;
  gtk_svg_write_to_file(const_cast<GtkSvg*>(gobj()), filename.c_str(), &(gerror));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
}

void Svg::set_weight(double weight)
{
  gtk_svg_set_weight(gobj(), weight);
}

double Svg::get_weight() const
{
  return gtk_svg_get_weight(const_cast<GtkSvg*>(gobj()));
}

void Svg::set_state(unsigned int state)
{
  gtk_svg_set_state(gobj(), state);
}

unsigned int Svg::get_state() const
{
  return gtk_svg_get_state(const_cast<GtkSvg*>(gobj()));
}

void Svg::set_frame_clock(const Glib::RefPtr<Gdk::FrameClock>& clock)
{
  gtk_svg_set_frame_clock(gobj(), Glib::unwrap(clock));
}

void Svg::play()
{
  gtk_svg_play(gobj());
}

void Svg::pause()
{
  gtk_svg_pause(gobj());
}

void Svg::set_features(Features features)
{
  gtk_svg_set_features(gobj(), static_cast<GtkSvgFeatures>(features));
}

Features Svg::get_features() const
{
  return static_cast<Features>(gtk_svg_get_features(const_cast<GtkSvg*>(gobj())));
}


Glib::SignalProxy<void(const SvgErrorExtra&)> Svg::signal_error()
{
  return Glib::SignalProxy<void(const SvgErrorExtra&) >(this, &Svg_signal_error_info);
}


Glib::PropertyProxy< std::string > Svg::property_resource() 
{
  return Glib::PropertyProxy< std::string >(this, "resource");
}

Glib::PropertyProxy_ReadOnly< std::string > Svg::property_resource() const
{
  return Glib::PropertyProxy_ReadOnly< std::string >(this, "resource");
}

static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<Features>::value,
  "Type Features cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< Features > Svg::property_features() 
{
  return Glib::PropertyProxy< Features >(this, "features");
}

Glib::PropertyProxy_ReadOnly< Features > Svg::property_features() const
{
  return Glib::PropertyProxy_ReadOnly< Features >(this, "features");
}

Glib::PropertyProxy< bool > Svg::property_playing() 
{
  return Glib::PropertyProxy< bool >(this, "playing");
}

Glib::PropertyProxy_ReadOnly< bool > Svg::property_playing() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "playing");
}

Glib::PropertyProxy< double > Svg::property_weight() 
{
  return Glib::PropertyProxy< double >(this, "weight");
}

Glib::PropertyProxy_ReadOnly< double > Svg::property_weight() const
{
  return Glib::PropertyProxy_ReadOnly< double >(this, "weight");
}

Glib::PropertyProxy< unsigned int > Svg::property_state() 
{
  return Glib::PropertyProxy< unsigned int >(this, "state");
}

Glib::PropertyProxy_ReadOnly< unsigned int > Svg::property_state() const
{
  return Glib::PropertyProxy_ReadOnly< unsigned int >(this, "state");
}


} // namespace Gtk


