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


#include <glibmm.h>

#include <gdkmm/dragsurface.h>
#include <gdkmm/private/dragsurface_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 <gdk/gdk.h>

namespace
{
extern "C"
{
// Hand-coded because the slot can't be called with a non-const temporary DragSurfaceSize.
static void DragSurface_signal_compute_size_callback(GdkDragSurface* self, GdkDragSurfaceSize* p0,void* data)
{
  using namespace Gdk;
  using SlotType = sigc::slot<void(DragSurfaceSize&)>;

  auto obj = dynamic_cast<DragSurface*>(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))
      {
        // This works because Gdk::DragSurfaceSize neither copies nor deletes *p0.
        DragSurfaceSize dragsurfacesize(p0);
        (*static_cast<SlotType*>(slot))(dragsurfacesize);
      }
    }
    catch (...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}
} // extern "C"
} // anonymous namespace

namespace
{


static const Glib::SignalProxyInfo DragSurface_signal_compute_size_info =
{
  "compute-size",
  (GCallback) &DragSurface_signal_compute_size_callback,
  (GCallback) &DragSurface_signal_compute_size_callback
};


} // anonymous namespace


namespace Glib
{

Glib::RefPtr<Gdk::DragSurface> wrap(GdkDragSurface* object, bool take_copy)
{
  return Glib::make_refptr_for_instance<Gdk::DragSurface>( dynamic_cast<Gdk::DragSurface*> (Glib::wrap_auto_interface<Gdk::DragSurface> ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} // namespace Glib


namespace Gdk
{


/* The *_Class implementation: */

const Glib::Interface_Class& DragSurface_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Interface_Class has to know the interface init function
    // in order to add interfaces to implementing types.
    class_init_func_ = &DragSurface_Class::iface_init_function;

    // We can not derive from another interface, and it is not necessary anyway.
    gtype_ = gdk_drag_surface_get_type();
  }

  return *this;
}

void DragSurface_Class::iface_init_function(void* g_iface, void*)
{
  const auto klass = static_cast<BaseClassType*>(g_iface);

  //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
  //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
  g_assert(klass != nullptr);


}


Glib::ObjectBase* DragSurface_Class::wrap_new(GObject* object)
{
  return new DragSurface((GdkDragSurface*)(object));
}


/* The implementation: */

DragSurface::DragSurface()
:
  Glib::Interface(dragsurface_class_.init())
{}

DragSurface::DragSurface(GdkDragSurface* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

DragSurface::DragSurface(const Glib::Interface_Class& interface_class)
: Glib::Interface(interface_class)
{
}

DragSurface::DragSurface(DragSurface&& src) noexcept
: Glib::Interface(std::move(src))
{}

DragSurface& DragSurface::operator=(DragSurface&& src) noexcept
{
  Glib::Interface::operator=(std::move(src));
  return *this;
}

DragSurface::~DragSurface() noexcept
{}

// static
void DragSurface::add_interface(GType gtype_implementer)
{
  dragsurface_class_.init().add_interface(gtype_implementer);
}

DragSurface::CppClassType DragSurface::dragsurface_class_; // initialize static member

GType DragSurface::get_type()
{
  return dragsurface_class_.init().get_type();
}


GType DragSurface::get_base_type()
{
  return gdk_drag_surface_get_type();
}


bool DragSurface::present(int width, int height)
{
  return gdk_drag_surface_present(gobj(), width, height);
}


Glib::SignalProxy<void(DragSurfaceSize&)> DragSurface::signal_compute_size()
{
  return Glib::SignalProxy<void(DragSurfaceSize&) >(this, &DragSurface_signal_compute_size_info);
}


} // namespace Gdk


