2 /* $Id: cursor.ccg,v 1.3 2005/07/10 19:24:21 murrayc Exp $ */
6 * Copyright 1998-2002 The gtkmm Development Team
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <gdk/gdkcursor.h>
28 Cursor::Cursor(CursorType cursor_type)
30 gobject_ = gdk_cursor_new((GdkCursorType)cursor_type);
33 Cursor::Cursor(const Glib::RefPtr<Pixmap>& source, const Glib::RefPtr<Pixmap>& mask,
34 const Color& fg, const Color& bg,
37 gobject_ = gdk_cursor_new_from_pixmap(source->gobj(), mask->gobj(),
38 const_cast<GdkColor*>(fg.gobj()),
39 const_cast<GdkColor*>(bg.gobj()),
43 Cursor::Cursor(const Glib::RefPtr<Display>& display, CursorType cursor_type)
45 gobject_ = gdk_cursor_new_for_display(display->gobj(), (GdkCursorType)cursor_type);
48 Cursor::Cursor(const Glib::RefPtr<Display>& display, const Glib::RefPtr<Pixbuf>& pixbuf, int x, int y)
50 gobject_ = gdk_cursor_new_from_pixbuf(display->gobj(), pixbuf->gobj(), x, y);
53 Cursor::Cursor(const Glib::RefPtr<Display>& display, const Glib::ustring& name)
55 gobject_ = gdk_cursor_new_from_name(display->gobj(), name.c_str());