add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gdk / src / cursor.ccg
1 // -*- c++ -*-
2 /* $Id: cursor.ccg,v 1.3 2005/07/10 19:24:21 murrayc Exp $ */
3
4 /*
5  *
6  * Copyright 1998-2002 The gtkmm Development Team
7  *
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.
12  *
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.
17  *
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.
21  */
22
23 #include <gdk/gdkcursor.h>
24
25 namespace Gdk
26 {
27
28 Cursor::Cursor(CursorType cursor_type)
29 {
30   gobject_ = gdk_cursor_new((GdkCursorType)cursor_type);
31 }
32
33 Cursor::Cursor(const Glib::RefPtr<Pixmap>& source, const Glib::RefPtr<Pixmap>& mask,
34                                        const Color& fg, const Color& bg,
35                                        int x, int y)
36 {
37   gobject_ = gdk_cursor_new_from_pixmap(source->gobj(), mask->gobj(), 
38                                         const_cast<GdkColor*>(fg.gobj()),
39                                         const_cast<GdkColor*>(bg.gobj()),
40                                         x, y);
41 }
42
43 Cursor::Cursor(const Glib::RefPtr<Display>& display, CursorType cursor_type)
44 {
45   gobject_ = gdk_cursor_new_for_display(display->gobj(), (GdkCursorType)cursor_type);
46 }
47
48 Cursor::Cursor(const Glib::RefPtr<Display>& display, const Glib::RefPtr<Pixbuf>& pixbuf, int x, int y)
49 {
50   gobject_ = gdk_cursor_new_from_pixbuf(display->gobj(), pixbuf->gobj(), x, y);
51 }
52
53 Cursor::Cursor(const Glib::RefPtr<Display>& display, const Glib::ustring& name)
54 {
55   gobject_ = gdk_cursor_new_from_name(display->gobj(), name.c_str());
56 }      
57
58 } //namespace Gdk
59