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


#include <glibmm.h>

#include <gtkmm/svgwidget.h>
#include <gtkmm/private/svgwidget_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 <https://www.gnu.org/licenses/>.
 */

namespace
{


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

  auto obj = dynamic_cast<SvgWidget*>(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(error))
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

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


extern "C" {
static void SvgWidget_signal_activate_connect_callback(GtkSvgWidget* self, const gchar* id,const gchar* href,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::ustring&, const Glib::ustring&)>;

  auto obj = dynamic_cast<SvgWidget*>(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))(Glib::convert_const_gchar_ptr_to_ustring(id)
, Glib::convert_const_gchar_ptr_to_ustring(href)
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"

static const Glib::SignalProxyInfo SvgWidget_signal_activate_info =
{
  "activate",
  (GCallback) &SvgWidget_signal_activate_connect_callback,
  (GCallback) &SvgWidget_signal_activate_connect_callback
};


} // anonymous namespace


namespace Glib
{

Gtk::SvgWidget* wrap(GtkSvgWidget* object, bool take_copy)
{
  return dynamic_cast<Gtk::SvgWidget *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}

} /* namespace Glib */

namespace Gtk
{


/* The *_Class implementation: */

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

  }

  return *this;
}


Glib::ObjectBase* SvgWidget_Class::wrap_new(GObject* o)
{
  return manage(new SvgWidget((GtkSvgWidget*)(o)));

}


/* The implementation: */

SvgWidget::SvgWidget(const Glib::ConstructParams& construct_params)
:
  Gtk::Widget(construct_params)
{
  }

SvgWidget::SvgWidget(GtkSvgWidget* castitem)
:
  Gtk::Widget((GtkWidget*)(castitem))
{
  }


SvgWidget::SvgWidget(SvgWidget&& src) noexcept
: Gtk::Widget(std::move(src))
{}

SvgWidget& SvgWidget::operator=(SvgWidget&& src) noexcept
{
  Gtk::Widget::operator=(std::move(src));
  return *this;
}

SvgWidget::~SvgWidget() noexcept
{
  destroy_();
}

SvgWidget::CppClassType SvgWidget::svgwidget_class_; // initialize static member

GType SvgWidget::get_type()
{
  return svgwidget_class_.init().get_type();
}


GType SvgWidget::get_base_type()
{
  return gtk_svg_widget_get_type();
}


SvgWidget::SvgWidget()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  Gtk::Widget(Glib::ConstructParams(svgwidget_class_.init()))
{
  

}

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

void SvgWidget::set_stylesheet(const Glib::RefPtr<const Glib::Bytes>& bytes)
{
  gtk_svg_widget_set_stylesheet(gobj(), const_cast<GBytes*>(Glib::unwrap<Glib::Bytes>(bytes)));
}

Glib::RefPtr<Glib::Bytes> SvgWidget::get_stylesheet() const
{
  auto retvalue = Glib::wrap(gtk_svg_widget_get_stylesheet(const_cast<GtkSvgWidget*>(gobj())));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

void SvgWidget::set_state(unsigned int state)
{
  gtk_svg_widget_set_state(gobj(), state);
}

unsigned int SvgWidget::get_state() const
{
  return gtk_svg_widget_get_state(const_cast<GtkSvgWidget*>(gobj()));
}


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


Glib::SignalProxy<void(const Glib::ustring&, const Glib::ustring&)> SvgWidget::signal_activate()
{
  return Glib::SignalProxy<void(const Glib::ustring&, const Glib::ustring&) >(this, &SvgWidget_signal_activate_info);
}


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

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

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

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

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

Glib::PropertyProxy< Glib::RefPtr<Glib::Bytes> > SvgWidget::property_stylesheet() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Glib::Bytes> >(this, "stylesheet");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Glib::Bytes> > SvgWidget::property_stylesheet() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Glib::Bytes> >(this, "stylesheet");
}


} // namespace Gtk


