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