/*
 * 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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gdkmm/texture.h>

_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gdk
{

/** This represents a cursor.
 */
class GDKMM_API Cursor : public Glib::Object
{
  _CLASS_GOBJECT(Cursor, GdkCursor, GDK_CURSOR, Glib::Object, GObject, , , GDKMM_API)
  _DO_NOT_DERIVE_GTYPE //We use DO_NOT_DERIVE_GTYPE because glib does not allow us to derive from a non-fundamental (abstract) type, for some reason.

protected:

public:
  //We use _WRAP_METHOD() instead of _WRAP_CREATE() and constructors,
  //because the gdk_cursor_new_*() functions actually return existing instances sometimes,
  //but constructors assume that they own the instance.
  //And we would have to have to use the gdk_cursor_new_*() functions in the constructors anyway,
  //because they do more than just call g_object_new().
  _WRAP_METHOD(static Glib::RefPtr<Cursor> create(const Glib::RefPtr<const Texture>& texture, int hotspot_x, int hotspot_y, const Glib::RefPtr<Cursor>& fallback = {}), gdk_cursor_new_from_texture)
  _WRAP_METHOD(static Glib::RefPtr<Cursor> create(const Glib::ustring& name, const Glib::RefPtr<Cursor>& fallback = {}), gdk_cursor_new_from_name)

  _WRAP_METHOD(Glib::RefPtr<Cursor> get_fallback(), gdk_cursor_get_fallback, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Cursor> get_fallback() const, gdk_cursor_get_fallback, refreturn, constversion)

  _WRAP_METHOD(Glib::ustring get_name() const, gdk_cursor_get_name)

  _WRAP_METHOD(Glib::RefPtr<Texture> get_texture(), gdk_cursor_get_texture, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Texture> get_texture() const, gdk_cursor_get_texture, refreturn, constversion)

  _WRAP_METHOD(int get_hotspot_x() const, gdk_cursor_get_hotspot_x)
  _WRAP_METHOD(int get_hotspot_y() const, gdk_cursor_get_hotspot_y)

  _WRAP_PROPERTY("fallback", Glib::RefPtr<Cursor>)
  _WRAP_PROPERTY("hotspot-x", int)
  _WRAP_PROPERTY("hotspot-y", int)
  _WRAP_PROPERTY("name", Glib::ustring)
  _WRAP_PROPERTY("texture", Glib::RefPtr<Texture>)
};

} //namespace Gdk
