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


#include <glibmm.h>

#include <gtkmm/dragsource.h>
#include <gtkmm/private/dragsource_p.h>


/* Copyright (C) 2020 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 <gtk/gtk.h>

namespace
{


static GdkContentProvider* DragSource_signal_prepare_callback(GtkDragSource* self, gdouble p0,gdouble p1,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<Glib::RefPtr<Gdk::ContentProvider>(double, double)>;

  auto obj = dynamic_cast<DragSource*>(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))
        return Glib::unwrap_copy((*static_cast<SlotType*>(slot))(p0
, p1
));
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }

  using RType = GdkContentProvider*;
  return RType();
}

static GdkContentProvider* DragSource_signal_prepare_notify_callback(GtkDragSource* self, gdouble p0,gdouble p1, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(double, double)>;

  auto obj = dynamic_cast<DragSource*>(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))(p0
, p1
);
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = GdkContentProvider*;
  return RType();
}

static const Glib::SignalProxyInfo DragSource_signal_prepare_info =
{
  "prepare",
  (GCallback) &DragSource_signal_prepare_callback,
  (GCallback) &DragSource_signal_prepare_notify_callback
};


static void DragSource_signal_drag_begin_callback(GtkDragSource* self, GdkDrag* p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gdk::Drag>&)>;

  auto obj = dynamic_cast<DragSource*>(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::wrap(p0, true)
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}

static const Glib::SignalProxyInfo DragSource_signal_drag_begin_info =
{
  "drag-begin",
  (GCallback) &DragSource_signal_drag_begin_callback,
  (GCallback) &DragSource_signal_drag_begin_callback
};


static void DragSource_signal_drag_end_callback(GtkDragSource* self, GdkDrag* p0,gboolean p1,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gdk::Drag>&, bool)>;

  auto obj = dynamic_cast<DragSource*>(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::wrap(p0, true)
, p1
);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}

static const Glib::SignalProxyInfo DragSource_signal_drag_end_info =
{
  "drag-end",
  (GCallback) &DragSource_signal_drag_end_callback,
  (GCallback) &DragSource_signal_drag_end_callback
};


static gboolean DragSource_signal_drag_cancel_callback(GtkDragSource* self, GdkDrag* p0,GdkDragCancelReason p1,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<bool(const Glib::RefPtr<Gdk::Drag>&, Gdk::DragCancelReason)>;

  auto obj = dynamic_cast<DragSource*>(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))
        return static_cast<int>((*static_cast<SlotType*>(slot))(Glib::wrap(p0, true)
, static_cast<Gdk::DragCancelReason>(p1)
));
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }

  using RType = gboolean;
  return RType();
}

static gboolean DragSource_signal_drag_cancel_notify_callback(GtkDragSource* self, GdkDrag* p0,GdkDragCancelReason p1, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gdk::Drag>&, Gdk::DragCancelReason)>;

  auto obj = dynamic_cast<DragSource*>(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::wrap(p0, true)
, static_cast<Gdk::DragCancelReason>(p1)
);
    }
    catch(...)
    {
      Glib::exception_handlers_invoke();
    }
  }

  using RType = gboolean;
  return RType();
}

static const Glib::SignalProxyInfo DragSource_signal_drag_cancel_info =
{
  "drag-cancel",
  (GCallback) &DragSource_signal_drag_cancel_callback,
  (GCallback) &DragSource_signal_drag_cancel_notify_callback
};


} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gtk::DragSource> wrap(GtkDragSource* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gtk::DragSource>( dynamic_cast<Gtk::DragSource*> (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& DragSource_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &DragSource_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gtk_drag_source_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:

  }

  return *this;
}


void DragSource_Class::class_init_function(void* g_class, void* class_data)
{
  const auto klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* DragSource_Class::wrap_new(GObject* object)
{
  return new DragSource((GtkDragSource*)object);
}


/* The implementation: */

GtkDragSource* DragSource::gobj_copy()
{
  reference();
  return gobj();
}

DragSource::DragSource(const Glib::ConstructParams& construct_params)
:
  GestureSingle(construct_params)
{

}

DragSource::DragSource(GtkDragSource* castitem)
:
  GestureSingle((GtkGestureSingle*)(castitem))
{}


DragSource::DragSource(DragSource&& src) noexcept
: GestureSingle(std::move(src))
{}

DragSource& DragSource::operator=(DragSource&& src) noexcept
{
  GestureSingle::operator=(std::move(src));
  return *this;
}


DragSource::~DragSource() noexcept
{}


DragSource::CppClassType DragSource::dragsource_class_; // initialize static member

GType DragSource::get_type()
{
  return dragsource_class_.init().get_type();
}


GType DragSource::get_base_type()
{
  return gtk_drag_source_get_type();
}


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

}

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

void DragSource::set_content(const Glib::RefPtr<Gdk::ContentProvider>& content)
{
  gtk_drag_source_set_content(gobj(), Glib::unwrap(content));
}

Glib::RefPtr<Gdk::ContentProvider> DragSource::get_content()
{
  auto retvalue = Glib::wrap(gtk_drag_source_get_content(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Gdk::ContentProvider> DragSource::get_content() const
{
  return const_cast<DragSource*>(this)->get_content();
}

void DragSource::set_actions(Gdk::DragAction actions)
{
  gtk_drag_source_set_actions(gobj(), static_cast<GdkDragAction>(actions));
}

Gdk::DragAction DragSource::get_actions() const
{
  return static_cast<Gdk::DragAction>(gtk_drag_source_get_actions(const_cast<GtkDragSource*>(gobj())));
}

void DragSource::set_icon(const Glib::RefPtr<const Gdk::Paintable>& paintable, int hot_x, int hot_y)
{
  gtk_drag_source_set_icon(gobj(), const_cast<GdkPaintable*>(Glib::unwrap(paintable)), hot_x, hot_y);
}

void DragSource::drag_cancel()
{
  gtk_drag_source_drag_cancel(gobj());
}

Glib::RefPtr<Gdk::Drag> DragSource::get_drag()
{
  auto retvalue = Glib::wrap(gtk_drag_source_get_drag(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Gdk::Drag> DragSource::get_drag() const
{
  return const_cast<DragSource*>(this)->get_drag();
}


Glib::SignalProxy<Glib::RefPtr<Gdk::ContentProvider>(double, double)> DragSource::signal_prepare()
{
  return Glib::SignalProxy<Glib::RefPtr<Gdk::ContentProvider>(double, double) >(this, &DragSource_signal_prepare_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<Gdk::Drag>&)> DragSource::signal_drag_begin()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<Gdk::Drag>&) >(this, &DragSource_signal_drag_begin_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<Gdk::Drag>&, bool)> DragSource::signal_drag_end()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<Gdk::Drag>&, bool) >(this, &DragSource_signal_drag_end_info);
}


Glib::SignalProxy<bool(const Glib::RefPtr<Gdk::Drag>&, Gdk::DragCancelReason)> DragSource::signal_drag_cancel()
{
  return Glib::SignalProxy<bool(const Glib::RefPtr<Gdk::Drag>&, Gdk::DragCancelReason) >(this, &DragSource_signal_drag_cancel_info);
}


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

Glib::PropertyProxy< Glib::RefPtr<Gdk::ContentProvider> > DragSource::property_content() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Gdk::ContentProvider> >(this, "content");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::ContentProvider> > DragSource::property_content() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::ContentProvider> >(this, "content");
}

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

Glib::PropertyProxy< Gdk::DragAction > DragSource::property_actions() 
{
  return Glib::PropertyProxy< Gdk::DragAction >(this, "actions");
}

Glib::PropertyProxy_ReadOnly< Gdk::DragAction > DragSource::property_actions() const
{
  return Glib::PropertyProxy_ReadOnly< Gdk::DragAction >(this, "actions");
}


} // namespace Gtk


