// Generated by gtkmmproc -- DO NOT MODIFY!


#include <glibmm.h>

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


/*
 * Copyright 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 <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 klass:
    gtype_ = CppClassParent::CppObjectType::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::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();
}


Glib::RefPtr<Cursor> Cursor::create(CursorType cursor_type)
{
  return Glib::wrap(gdk_cursor_new(((GdkCursorType)(cursor_type))));
}


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 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();
}

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


} // namespace Gdk


