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


#include <glibmm.h>

#include <gtkmm/droptargetasync.h>
#include <gtkmm/private/droptargetasync_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 <giomm/slot_async.h>
#include <gtk/gtk.h>

namespace Gtk
{
Glib::RefPtr<DropTargetAsync> DropTargetAsync::create(
  const Glib::RefPtr<const Gdk::ContentFormats>& formats, Gdk::DragAction actions)
{
  // gtk_drop_target_async_new() drops our reference from formats. (transfer full)
  if (formats)
    formats->reference();
  return Glib::wrap(gtk_drop_target_async_new(
    const_cast<GdkContentFormats*>(Glib::unwrap(formats)),
    static_cast<GdkDragAction>(actions)));
}

Glib::RefPtr<DropTargetAsync> DropTargetAsync::create(Gdk::DragAction actions)
{
  return Glib::wrap(gtk_drop_target_async_new(nullptr, static_cast<GdkDragAction>(actions)));
}
}

namespace
{


static gboolean DropTargetAsync_signal_accept_callback(GtkDropTargetAsync* self, GdkDrop* p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<bool(const Glib::RefPtr<Gdk::Drop>&)>;

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

  using RType = gboolean;
  return RType();
}

static gboolean DropTargetAsync_signal_accept_notify_callback(GtkDropTargetAsync* self, GdkDrop* p0, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gdk::Drop>&)>;

  auto obj = dynamic_cast<DropTargetAsync*>(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();
    }
  }

  using RType = gboolean;
  return RType();
}

static const Glib::SignalProxyInfo DropTargetAsync_signal_accept_info =
{
  "accept",
  (GCallback) &DropTargetAsync_signal_accept_callback,
  (GCallback) &DropTargetAsync_signal_accept_notify_callback
};


static GdkDragAction DropTargetAsync_signal_drag_enter_callback(GtkDropTargetAsync* self, GdkDrop* p0,gdouble p1,gdouble p2,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<Gdk::DragAction(const Glib::RefPtr<Gdk::Drop>&, double, double)>;

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

  using RType = GdkDragAction;
  return RType();
}

static GdkDragAction DropTargetAsync_signal_drag_enter_notify_callback(GtkDropTargetAsync* self, GdkDrop* p0,gdouble p1,gdouble p2, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gdk::Drop>&, double, double)>;

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

  using RType = GdkDragAction;
  return RType();
}

static const Glib::SignalProxyInfo DropTargetAsync_signal_drag_enter_info =
{
  "drag-enter",
  (GCallback) &DropTargetAsync_signal_drag_enter_callback,
  (GCallback) &DropTargetAsync_signal_drag_enter_notify_callback
};


static GdkDragAction DropTargetAsync_signal_drag_motion_callback(GtkDropTargetAsync* self, GdkDrop* p0,gdouble p1,gdouble p2,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<Gdk::DragAction(const Glib::RefPtr<Gdk::Drop>&, double, double)>;

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

  using RType = GdkDragAction;
  return RType();
}

static GdkDragAction DropTargetAsync_signal_drag_motion_notify_callback(GtkDropTargetAsync* self, GdkDrop* p0,gdouble p1,gdouble p2, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gdk::Drop>&, double, double)>;

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

  using RType = GdkDragAction;
  return RType();
}

static const Glib::SignalProxyInfo DropTargetAsync_signal_drag_motion_info =
{
  "drag-motion",
  (GCallback) &DropTargetAsync_signal_drag_motion_callback,
  (GCallback) &DropTargetAsync_signal_drag_motion_notify_callback
};


static void DropTargetAsync_signal_drag_leave_callback(GtkDropTargetAsync* self, GdkDrop* p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gdk::Drop>&)>;

  auto obj = dynamic_cast<DropTargetAsync*>(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 DropTargetAsync_signal_drag_leave_info =
{
  "drag-leave",
  (GCallback) &DropTargetAsync_signal_drag_leave_callback,
  (GCallback) &DropTargetAsync_signal_drag_leave_callback
};


static gboolean DropTargetAsync_signal_drop_callback(GtkDropTargetAsync* self, GdkDrop* p0,gdouble p1,gdouble p2,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<bool(const Glib::RefPtr<Gdk::Drop>&, double, double)>;

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

  using RType = gboolean;
  return RType();
}

static gboolean DropTargetAsync_signal_drop_notify_callback(GtkDropTargetAsync* self, GdkDrop* p0,gdouble p1,gdouble p2, void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(const Glib::RefPtr<Gdk::Drop>&, double, double)>;

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

  using RType = gboolean;
  return RType();
}

static const Glib::SignalProxyInfo DropTargetAsync_signal_drop_info =
{
  "drop",
  (GCallback) &DropTargetAsync_signal_drop_callback,
  (GCallback) &DropTargetAsync_signal_drop_notify_callback
};


} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gtk::DropTargetAsync> wrap(GtkDropTargetAsync* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gtk::DropTargetAsync>( dynamic_cast<Gtk::DropTargetAsync*> (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& DropTargetAsync_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_ = &DropTargetAsync_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_drop_target_async_get_type());

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

  }

  return *this;
}


void DropTargetAsync_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* DropTargetAsync_Class::wrap_new(GObject* object)
{
  return new DropTargetAsync((GtkDropTargetAsync*)object);
}


/* The implementation: */

GtkDropTargetAsync* DropTargetAsync::gobj_copy()
{
  reference();
  return gobj();
}

DropTargetAsync::DropTargetAsync(const Glib::ConstructParams& construct_params)
:
  EventController(construct_params)
{

}

DropTargetAsync::DropTargetAsync(GtkDropTargetAsync* castitem)
:
  EventController((GtkEventController*)(castitem))
{}


DropTargetAsync::DropTargetAsync(DropTargetAsync&& src) noexcept
: EventController(std::move(src))
{}

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


DropTargetAsync::~DropTargetAsync() noexcept
{}


DropTargetAsync::CppClassType DropTargetAsync::droptargetasync_class_; // initialize static member

GType DropTargetAsync::get_type()
{
  return droptargetasync_class_.init().get_type();
}


GType DropTargetAsync::get_base_type()
{
  return gtk_drop_target_async_get_type();
}


void DropTargetAsync::set_formats(const Glib::RefPtr<const Gdk::ContentFormats>& formats)
{
  gtk_drop_target_async_set_formats(gobj(), const_cast<GdkContentFormats*>(Glib::unwrap(formats)));
}

Glib::RefPtr<Gdk::ContentFormats> DropTargetAsync::get_formats()
{
  auto retvalue = Glib::wrap(gtk_drop_target_async_get_formats(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Gdk::ContentFormats> DropTargetAsync::get_formats() const
{
  return const_cast<DropTargetAsync*>(this)->get_formats();
}

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

Gdk::DragAction DropTargetAsync::get_actions() const
{
  return static_cast<Gdk::DragAction>(gtk_drop_target_async_get_actions(const_cast<GtkDropTargetAsync*>(gobj())));
}

void DropTargetAsync::reject_drop(const Glib::RefPtr<Gdk::Drop>& drop)
{
  gtk_drop_target_async_reject_drop(gobj(), Glib::unwrap(drop));
}


Glib::SignalProxy<bool(const Glib::RefPtr<Gdk::Drop>&)> DropTargetAsync::signal_accept()
{
  return Glib::SignalProxy<bool(const Glib::RefPtr<Gdk::Drop>&) >(this, &DropTargetAsync_signal_accept_info);
}


Glib::SignalProxy<Gdk::DragAction(const Glib::RefPtr<Gdk::Drop>&, double, double)> DropTargetAsync::signal_drag_enter()
{
  return Glib::SignalProxy<Gdk::DragAction(const Glib::RefPtr<Gdk::Drop>&, double, double) >(this, &DropTargetAsync_signal_drag_enter_info);
}


Glib::SignalProxy<Gdk::DragAction(const Glib::RefPtr<Gdk::Drop>&, double, double)> DropTargetAsync::signal_drag_motion()
{
  return Glib::SignalProxy<Gdk::DragAction(const Glib::RefPtr<Gdk::Drop>&, double, double) >(this, &DropTargetAsync_signal_drag_motion_info);
}


Glib::SignalProxy<void(const Glib::RefPtr<Gdk::Drop>&)> DropTargetAsync::signal_drag_leave()
{
  return Glib::SignalProxy<void(const Glib::RefPtr<Gdk::Drop>&) >(this, &DropTargetAsync_signal_drag_leave_info);
}


Glib::SignalProxy<bool(const Glib::RefPtr<Gdk::Drop>&, double, double)> DropTargetAsync::signal_drop()
{
  return Glib::SignalProxy<bool(const Glib::RefPtr<Gdk::Drop>&, double, double) >(this, &DropTargetAsync_signal_drop_info);
}


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 > DropTargetAsync::property_actions() 
{
  return Glib::PropertyProxy< Gdk::DragAction >(this, "actions");
}

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

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

Glib::PropertyProxy< Glib::RefPtr<Gdk::ContentFormats> > DropTargetAsync::property_formats() 
{
  return Glib::PropertyProxy< Glib::RefPtr<Gdk::ContentFormats> >(this, "formats");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::ContentFormats> > DropTargetAsync::property_formats() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::ContentFormats> >(this, "formats");
}


} // namespace Gtk


