add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gdk / gdkmm / cursor.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GDKMM_CURSOR_H
4 #define _GDKMM_CURSOR_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* drawable.h
12  *
13  * Copyright (C) 1998-2002 The gtkmm Development Team
14  *
15  * This library is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU Library General Public
17  * License as published by the Free Software Foundation; either
18  * version 2 of the License, or (at your option) any later version.
19  *
20  * This library is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23  * Library General Public License for more details.
24  *
25  * You should have received a copy of the GNU Library General Public
26  * License along with this library; if not, write to the Free
27  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28  */
29
30 #include <gdkmm/color.h>
31 #include <gdkmm/bitmap.h>
32 #include <gdkmm/display.h>
33 #include <gdkmm/pixbuf.h>
34
35
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 extern "C" { typedef struct _GdkCursor GdkCursor; }
38 #endif
39
40 namespace Gdk
41 {
42
43
44 /** @addtogroup gdkmmEnums Enums and Flags */
45
46 /**
47  * @ingroup gdkmmEnums
48  */
49 enum CursorType
50 {
51   X_CURSOR = 0,
52   ARROW = 2,
53   BASED_ARROW_DOWN = 4,
54   BASED_ARROW_UP = 6,
55   BOAT = 8,
56   BOGOSITY = 10,
57   BOTTOM_LEFT_CORNER = 12,
58   BOTTOM_RIGHT_CORNER = 14,
59   BOTTOM_SIDE = 16,
60   BOTTOM_TEE = 18,
61   BOX_SPIRAL = 20,
62   CENTER_PTR = 22,
63   CIRCLE = 24,
64   CLOCK = 26,
65   COFFEE_MUG = 28,
66   CROSS = 30,
67   CROSS_REVERSE = 32,
68   CROSSHAIR = 34,
69   DIAMOND_CROSS = 36,
70   DOT = 38,
71   DOTBOX = 40,
72   DOUBLE_ARROW = 42,
73   DRAFT_LARGE = 44,
74   DRAFT_SMALL = 46,
75   DRAPED_BOX = 48,
76   EXCHANGE = 50,
77   FLEUR = 52,
78   GOBBLER = 54,
79   GUMBY = 56,
80   HAND1 = 58,
81   HAND2 = 60,
82   HEART = 62,
83   ICON = 64,
84   IRON_CROSS = 66,
85   LEFT_PTR = 68,
86   LEFT_SIDE = 70,
87   LEFT_TEE = 72,
88   LEFTBUTTON = 74,
89   LL_ANGLE = 76,
90   LR_ANGLE = 78,
91   MAN = 80,
92   MIDDLEBUTTON = 82,
93   MOUSE = 84,
94   PENCIL = 86,
95   PIRATE = 88,
96   PLUS = 90,
97   QUESTION_ARROW = 92,
98   RIGHT_PTR = 94,
99   RIGHT_SIDE = 96,
100   RIGHT_TEE = 98,
101   RIGHTBUTTON = 100,
102   RTL_LOGO = 102,
103   SAILBOAT = 104,
104   SB_DOWN_ARROW = 106,
105   SB_H_DOUBLE_ARROW = 108,
106   SB_LEFT_ARROW = 110,
107   SB_RIGHT_ARROW = 112,
108   SB_UP_ARROW = 114,
109   SB_V_DOUBLE_ARROW = 116,
110   SHUTTLE = 118,
111   SIZING = 120,
112   SPIDER = 122,
113   SPRAYCAN = 124,
114   STAR = 126,
115   TARGET = 128,
116   TCROSS = 130,
117   TOP_LEFT_ARROW = 132,
118   TOP_LEFT_CORNER = 134,
119   TOP_RIGHT_CORNER = 136,
120   TOP_SIDE = 138,
121   TOP_TEE = 140,
122   TREK = 142,
123   UL_ANGLE = 144,
124   UMBRELLA = 146,
125   UR_ANGLE = 148,
126   WATCH = 150,
127   XTERM = 152,
128   LAST_CURSOR = 153,
129   CURSOR_IS_PIXMAP = -1
130 };
131
132 } // namespace Gdk
133
134
135 #ifndef DOXYGEN_SHOULD_SKIP_THIS
136 namespace Glib
137 {
138
139 template <>
140 class Value<Gdk::CursorType> : public Glib::Value_Enum<Gdk::CursorType>
141 {
142 public:
143   static GType value_type() G_GNUC_CONST;
144 };
145
146 } // namespace Glib
147 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
148
149
150 namespace Gdk
151 {
152
153
154 /** This represents a cursor.
155  */
156 class Cursor
157 {
158   public:
159 #ifndef DOXYGEN_SHOULD_SKIP_THIS
160   typedef Cursor CppObjectType;
161   typedef GdkCursor BaseObjectType;
162
163   static GType get_type() G_GNUC_CONST;
164 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
165
166   Cursor();
167
168   explicit Cursor(GdkCursor* gobject, bool make_a_copy = true);
169
170   Cursor(const Cursor& other);
171   Cursor& operator=(const Cursor& other);
172
173   ~Cursor();
174
175   void swap(Cursor& other);
176
177   ///Provides access to the underlying C instance.
178   GdkCursor*       gobj()       { return gobject_; }
179
180   ///Provides access to the underlying C instance.
181   const GdkCursor* gobj() const { return gobject_; }
182
183   ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
184   GdkCursor* gobj_copy() const;
185
186 protected:
187   GdkCursor* gobject_;
188
189 private:
190
191   
192 public:
193   explicit Cursor(CursorType cursor_type);
194   Cursor(const Glib::RefPtr<Pixmap>& source, const Glib::RefPtr<Pixmap>& mask,
195          const Color& fg, const Color& bg,
196          int x, int y);
197   explicit Cursor(const Glib::RefPtr<Display>& display, CursorType cursor_type);
198   Cursor(const Glib::RefPtr<Display>& display, const Glib::RefPtr<Pixbuf>& pixbuf, int x, int y);
199   explicit Cursor(const Glib::RefPtr<Display>& display, const Glib::ustring& name);
200
201   
202   /** Returns: the Gdk::Display associated to @a cursor 
203    * @return The Gdk::Display associated to @a cursor 
204    * 
205    * @newin2p2.
206    */
207   Glib::RefPtr<Display> get_display();
208   
209   /** Returns: the Gdk::Display associated to @a cursor 
210    * @return The Gdk::Display associated to @a cursor 
211    * 
212    * @newin2p2.
213    */
214   Glib::RefPtr<const Display> get_display() const;
215
216   
217   /** Returns: a Gdk::Pixbuf representing @a cursor , or <tt>0</tt>
218    * @return A Gdk::Pixbuf representing @a cursor , or <tt>0</tt>
219    * 
220    * @newin2p8.
221    */
222   Glib::RefPtr<Gdk::Pixbuf> get_image();
223   
224   /** Returns: a Gdk::Pixbuf representing @a cursor , or <tt>0</tt>
225    * @return A Gdk::Pixbuf representing @a cursor , or <tt>0</tt>
226    * 
227    * @newin2p8.
228    */
229   Glib::RefPtr<const Gdk::Pixbuf> get_image() const;
230
231
232 };
233
234 } //namespace Gdk
235
236
237 namespace Gdk
238 {
239
240 /** @relates Gdk::Cursor
241  * @param lhs The left-hand side
242  * @param rhs The right-hand side
243  */
244 inline void swap(Cursor& lhs, Cursor& rhs)
245   { lhs.swap(rhs); }
246
247 } // namespace Gdk
248
249 namespace Glib
250 {
251
252 /** A Glib::wrap() method for this object.
253  * 
254  * @param object The C instance.
255  * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
256  * @result A C++ instance that wraps this C instance.
257  *
258  * @relates Gdk::Cursor
259  */
260 Gdk::Cursor wrap(GdkCursor* object, bool take_copy = false);
261
262 #ifndef DOXYGEN_SHOULD_SKIP_THIS
263 template <>
264 class Value<Gdk::Cursor> : public Glib::Value_Boxed<Gdk::Cursor>
265 {};
266 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
267
268 } // namespace Glib
269
270
271 #endif /* _GDKMM_CURSOR_H */
272