2 // Generated by gtkmmproc -- DO NOT MODIFY!
12 * Copyright (C) 1998-2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtkmm/widget.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkRuler GtkRuler;
34 typedef struct _GtkRulerClass GtkRulerClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 { class Ruler_Class; } // namespace Gtk
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 typedef struct _GtkVRuler GtkVRuler;
42 typedef struct _GtkVRulerClass GtkVRulerClass;
43 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
47 { class VRuler_Class; } // namespace Gtk
48 #ifndef DOXYGEN_SHOULD_SKIP_THIS
49 typedef struct _GtkHRuler GtkHRuler;
50 typedef struct _GtkHRulerClass GtkHRulerClass;
51 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
55 { class HRuler_Class; } // namespace Gtk
59 /** Base class for horizontal or vertical rulers.
61 * NOTE this widget is considered too specialized/little-used for GTK+, and will in the future be moved to some other package. If your application needs this widget, feel free to use it, as the widget does work and is useful in some applications; it's just not of general interest. However, we are not accepting new features for the widget, and it will eventually move out of the GTK+ distribution.
62 * Rulers are used to show the mouse pointer's location in a window. The ruler can either be horizontal or vertical. Within the ruler a small triangle indicates the location of the mouse relative to the horixontal or vertical ruler.
64 * This is an abstract base for Gtk::HRuler and
65 * Gtk::VRuler. Users should only instantiate those types.
70 class Ruler : public Widget
73 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74 typedef Ruler CppObjectType;
75 typedef Ruler_Class CppClassType;
76 typedef GtkRuler BaseObjectType;
77 typedef GtkRulerClass BaseClassType;
78 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 #ifndef DOXYGEN_SHOULD_SKIP_THIS
85 friend class Ruler_Class;
86 static CppClassType ruler_class_;
90 Ruler& operator=(const Ruler&);
93 explicit Ruler(const Glib::ConstructParams& construct_params);
94 explicit Ruler(GtkRuler* castitem);
96 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
99 #ifndef DOXYGEN_SHOULD_SKIP_THIS
100 static GType get_type() G_GNUC_CONST;
101 static GType get_base_type() G_GNUC_CONST;
104 ///Provides access to the underlying C GtkObject.
105 GtkRuler* gobj() { return reinterpret_cast<GtkRuler*>(gobject_); }
107 ///Provides access to the underlying C GtkObject.
108 const GtkRuler* gobj() const { return reinterpret_cast<GtkRuler*>(gobject_); }
112 //C++ methods used to invoke GTK+ virtual functions:
115 //GTK+ Virtual Functions (override these to change behaviour):
117 //Default Signal Handlers::
128 MetricType get_metric() const;
130 /** Sets the desired metric of the ruler. The possible choices are:
131 * <ul><li>Gtk::PIXELS
133 * <li>Gtk::CENTIMETERS
134 * </ul>The default metric is Gtk::PIXELS.
137 void set_metric(MetricType metric = PIXELS);
139 /** Gets the units used for a Gtk::Ruler. See set_metric().
140 * @return The units currently used for @a ruler .
142 MetricType get_metric();
144 double get_range_lower() const;
145 double get_range_upper() const;
147 /** sets the range of the ruler.
148 * <i>upper</i> and <i>lower</i> arguments denote the extents of the Ruler.
149 * <i>max_size</i> is the largest number displayed by the ruler.
150 * <i>position</i> gives the initial value of the ruler.
151 * Rulers do not have sane defaults so this function should always be called.
154 void set_range(double lower, double upper, double position, double max_size);
156 /** Retrieves values indicating the range and current position of a Gtk::Ruler.
158 * @param lower Location to store lower limit of the ruler, or <tt>0</tt>.
159 * @param upper Location to store upper limit of the ruler, or <tt>0</tt>.
160 * @param position Location to store the current position of the mark on the ruler, or <tt>0</tt>.
161 * @param max_size Location to store the maximum size of the ruler used when calculating
162 * the space to leave for the text, or <tt>0</tt>.
164 void get_range(double& lower, double& upper, double& position, double& max_size);
166 /// draw tick marks on the ruler
170 /// draw a position indicator on the ruler
174 virtual void draw_ticks_vfunc();
175 virtual void draw_pos_vfunc();
177 /** Lower limit of ruler.
179 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
180 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
181 * the value of the property changes.
183 Glib::PropertyProxy<double> property_lower() ;
185 /** Lower limit of ruler.
187 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
188 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
189 * the value of the property changes.
191 Glib::PropertyProxy_ReadOnly<double> property_lower() const;
193 /** Upper limit of ruler.
195 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
196 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
197 * the value of the property changes.
199 Glib::PropertyProxy<double> property_upper() ;
201 /** Upper limit of ruler.
203 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
204 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
205 * the value of the property changes.
207 Glib::PropertyProxy_ReadOnly<double> property_upper() const;
209 /** Position of mark on the ruler.
211 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
212 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
213 * the value of the property changes.
215 Glib::PropertyProxy<double> property_position() ;
217 /** Position of mark on the ruler.
219 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
220 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
221 * the value of the property changes.
223 Glib::PropertyProxy_ReadOnly<double> property_position() const;
225 /** Maximum size of the ruler.
227 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
228 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
229 * the value of the property changes.
231 Glib::PropertyProxy<double> property_max_size() ;
233 /** Maximum size of the ruler.
235 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
236 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
237 * the value of the property changes.
239 Glib::PropertyProxy_ReadOnly<double> property_max_size() const;
250 class VRuler : public Ruler
253 #ifndef DOXYGEN_SHOULD_SKIP_THIS
254 typedef VRuler CppObjectType;
255 typedef VRuler_Class CppClassType;
256 typedef GtkVRuler BaseObjectType;
257 typedef GtkVRulerClass BaseClassType;
258 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
262 #ifndef DOXYGEN_SHOULD_SKIP_THIS
265 friend class VRuler_Class;
266 static CppClassType vruler_class_;
269 VRuler(const VRuler&);
270 VRuler& operator=(const VRuler&);
273 explicit VRuler(const Glib::ConstructParams& construct_params);
274 explicit VRuler(GtkVRuler* castitem);
276 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
279 #ifndef DOXYGEN_SHOULD_SKIP_THIS
280 static GType get_type() G_GNUC_CONST;
281 static GType get_base_type() G_GNUC_CONST;
284 ///Provides access to the underlying C GtkObject.
285 GtkVRuler* gobj() { return reinterpret_cast<GtkVRuler*>(gobject_); }
287 ///Provides access to the underlying C GtkObject.
288 const GtkVRuler* gobj() const { return reinterpret_cast<GtkVRuler*>(gobject_); }
292 //C++ methods used to invoke GTK+ virtual functions:
295 //GTK+ Virtual Functions (override these to change behaviour):
297 //Default Signal Handlers::
314 class HRuler : public Ruler
317 #ifndef DOXYGEN_SHOULD_SKIP_THIS
318 typedef HRuler CppObjectType;
319 typedef HRuler_Class CppClassType;
320 typedef GtkHRuler BaseObjectType;
321 typedef GtkHRulerClass BaseClassType;
322 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
326 #ifndef DOXYGEN_SHOULD_SKIP_THIS
329 friend class HRuler_Class;
330 static CppClassType hruler_class_;
333 HRuler(const HRuler&);
334 HRuler& operator=(const HRuler&);
337 explicit HRuler(const Glib::ConstructParams& construct_params);
338 explicit HRuler(GtkHRuler* castitem);
340 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
343 #ifndef DOXYGEN_SHOULD_SKIP_THIS
344 static GType get_type() G_GNUC_CONST;
345 static GType get_base_type() G_GNUC_CONST;
348 ///Provides access to the underlying C GtkObject.
349 GtkHRuler* gobj() { return reinterpret_cast<GtkHRuler*>(gobject_); }
351 ///Provides access to the underlying C GtkObject.
352 const GtkHRuler* gobj() const { return reinterpret_cast<GtkHRuler*>(gobject_); }
356 //C++ methods used to invoke GTK+ virtual functions:
359 //GTK+ Virtual Functions (override these to change behaviour):
361 //Default Signal Handlers::
372 } /* namespace Gtk */
377 /** @relates Gtk::Ruler
378 * @param object The C instance
379 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
380 * @result A C++ instance that wraps this C instance.
382 Gtk::Ruler* wrap(GtkRuler* object, bool take_copy = false);
386 /** @relates Gtk::VRuler
387 * @param object The C instance
388 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
389 * @result A C++ instance that wraps this C instance.
391 Gtk::VRuler* wrap(GtkVRuler* object, bool take_copy = false);
395 /** @relates Gtk::HRuler
396 * @param object The C instance
397 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
398 * @result A C++ instance that wraps this C instance.
400 Gtk::HRuler* wrap(GtkHRuler* object, bool take_copy = false);
402 #endif /* _GTKMM_RULER_H */