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


#include <glibmm.h>

#include <gdkmm/cursor.h>
#include <gdkmm/private/cursor_p.h>


/* Copyright (C) 1998-2002 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/>.
 */

#include <gdk/gdk.h>

namespace Gdk
{

} //namespace Gdk

namespace
{
} // anonymous namespace

// static
GType Glib::Value<Gdk::CursorType>::value_type()
{
  return gdk_cursor_type_get_type();
}


namespace Glib
{

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

} /* namespace Glib */


namespace Gdk
{


/* The *_Class implementation: */

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

  }

  return *this;
}


Glib::ObjectBase* Cursor_Class::wrap_new(GObject* object)
{
  return new Cursor((GdkCursor*)object);
}


/* The implementation: */

GdkCursor* Cursor::gobj_copy()
{
  reference();
  return gobj();
}

Cursor::Cursor(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

Cursor::Cursor(GdkCursor* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


Cursor::Cursor(Cursor&& src) noexcept
: Glib::Object(std::move(src))
{}

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


Cursor::~Cursor() noexcept
{}


Cursor::CppClassType Cursor::cursor_class_; // initialize static member

GType Cursor::get_type()
{
  return cursor_class_.init().get_type();
}


GType Cursor::get_base_type()
{
  return gdk_cursor_get_type();
}


#ifndef GDKMM_DISABLE_DEPRECATED
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Glib::RefPtr<Cursor> Cursor::create(CursorType cursor_type)
{
  return Glib::wrap(gdk_cursor_new(((GdkCursorType)(cursor_type))));
}
G_GNUC_END_IGNORE_DEPRECATIONS
#endif // GDKMM_DISABLE_DEPRECATED

Glib::RefPtr<Cursor> Cursor::create(const Glib::RefPtr<Display>& display, CursorType cursor_type)
{
  return Glib::wrap(gdk_cursor_new_for_display(Glib::unwrap(display), ((GdkCursorType)(cursor_type))));
}

Glib::RefPtr<Cursor> Cursor::create(const Glib::RefPtr<Display>& display, const Glib::RefPtr<Pixbuf>& pixbuf, int x, int y)
{
  return Glib::wrap(gdk_cursor_new_from_pixbuf(Glib::unwrap(display), Glib::unwrap(pixbuf), x, y));
}

Glib::RefPtr<Cursor> Cursor::create(const Glib::RefPtr<Display>& display, const ::Cairo::RefPtr< ::Cairo::Surface>& surface, double x, double y)
{
  return Glib::wrap(gdk_cursor_new_from_surface(Glib::unwrap(display), (surface) ? const_cast<cairo_surface_t*>((surface)->cobj()) : nullptr, x, y));
}

Glib::RefPtr<Cursor> Cursor::create(const Glib::RefPtr<Display>& display, const Glib::ustring& name)
{
  return Glib::wrap(gdk_cursor_new_from_name(Glib::unwrap(display), name.c_str()));
}

Glib::RefPtr<Display> Cursor::get_display()
{
  Glib::RefPtr<Display> retvalue = Glib::wrap(gdk_cursor_get_display(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const Display> Cursor::get_display() const
{
  return const_cast<Cursor*>(this)->get_display();
}

Glib::RefPtr<Gdk::Pixbuf> Cursor::get_image()
{
  return Glib::wrap(gdk_cursor_get_image(gobj()));
}

Glib::RefPtr<const Gdk::Pixbuf> Cursor::get_image() const
{
  return const_cast<Cursor*>(this)->get_image();
}

::Cairo::RefPtr< ::Cairo::Surface> Cursor::get_surface(double& x_hot, double& y_hot)
{
  return ::Cairo::RefPtr< ::Cairo::Surface>(new ::Cairo::Surface(gdk_cursor_get_surface(gobj(), &(x_hot), &(y_hot)), true /* do not take ref */));
}

::Cairo::RefPtr<const ::Cairo::Surface> Cursor::get_surface(double& x_hot, double& y_hot) const
{
  return const_cast<Cursor*>(this)->get_surface(x_hot, y_hot);
}

CursorType Cursor::get_cursor_type() const
{
  return ((CursorType)(gdk_cursor_get_cursor_type(const_cast<GdkCursor*>(gobj()))));
}


} // namespace Gdk


