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


#include <glibmm.h>

#include <gdkmm/popup.h>
#include <gdkmm/private/popup_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
{
} // anonymous namespace


namespace Glib
{

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

} // namespace Glib


namespace Gdk
{


/* The *_Class implementation: */

const Glib::Interface_Class& Popup_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_ = &Popup_Class::iface_init_function;

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

  return *this;
}

void Popup_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* Popup_Class::wrap_new(GObject* object)
{
  return new Popup((GdkPopup*)(object));
}


/* The implementation: */

Popup::Popup()
:
  Glib::Interface(popup_class_.init())
{}

Popup::Popup(GdkPopup* castitem)
:
  Glib::Interface((GObject*)(castitem))
{}

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

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

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

Popup::~Popup() noexcept
{}

// static
void Popup::add_interface(GType gtype_implementer)
{
  popup_class_.init().add_interface(gtype_implementer);
}

Popup::CppClassType Popup::popup_class_; // initialize static member

GType Popup::get_type()
{
  return popup_class_.init().get_type();
}


GType Popup::get_base_type()
{
  return gdk_popup_get_type();
}


bool Popup::present(int width, int height, const Glib::RefPtr<PopupLayout>& layout)
{
  return gdk_popup_present(gobj(), width, height, Glib::unwrap(layout));
}

Gravity Popup::get_surface_anchor() const
{
  return static_cast<Gravity>(gdk_popup_get_surface_anchor(const_cast<GdkPopup*>(gobj())));
}

Gravity Popup::get_rect_anchor() const
{
  return static_cast<Gravity>(gdk_popup_get_rect_anchor(const_cast<GdkPopup*>(gobj())));
}

Glib::RefPtr<Surface> Popup::get_parent()
{
  auto retvalue = Glib::wrap(gdk_popup_get_parent(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Surface> Popup::get_parent() const
{
  return const_cast<Popup*>(this)->get_parent();
}

int Popup::get_position_x() const
{
  return gdk_popup_get_position_x(const_cast<GdkPopup*>(gobj()));
}

int Popup::get_position_y() const
{
  return gdk_popup_get_position_y(const_cast<GdkPopup*>(gobj()));
}

bool Popup::get_autohide() const
{
  return gdk_popup_get_autohide(const_cast<GdkPopup*>(gobj()));
}


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

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Surface> > Popup::property_parent() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Surface> >(this, "parent");
}

Glib::PropertyProxy_ReadOnly< bool > Popup::property_autohide() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "autohide");
}


} // namespace Gdk


