alternative to assert
[gtkD.git] / src / gtk / Ruler.d
blob8c5933d2030be0f50e18d3cee66a33aed58478dc
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkRuler.html
26 * outPack = gtk
27 * outFile = Ruler
28 * strct = GtkRuler
29 * realStrct=
30 * ctorStrct=
31 * clss = Ruler
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_ruler_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * structWrap:
46 * local aliases:
49 module gtk.Ruler;
51 private import gtk.gtktypes;
53 private import lib.gtk;
56 /**
57 * Description
58 * Note
59 * This widget is considered too specialized/little-used for
60 * GTK+, and will in the future be moved to some other package. If
61 * your application needs this widget, feel free to use it, as the
62 * widget does work and is useful in some applications; it's just not
63 * of general interest. However, we are not accepting new features for
64 * the widget, and it will eventually move out of the GTK+
65 * distribution.
66 * The GTKRuler widget is a base class for horizontal and vertical rulers. Rulers
67 * are used to show the mouse pointer's location in a window. The ruler can either
68 * be horizontal or vertical on the window. Within the ruler a small triangle
69 * indicates the location of the mouse relative to the horizontal or vertical
70 * ruler. See GtkHRuler to learn how to create a new horizontal ruler. See
71 * GtkVRuler to learn how to create a new vertical ruler.
73 private import gtk.Widget;
74 public class Ruler : Widget
77 /** the main Gtk struct */
78 protected GtkRuler* gtkRuler;
81 public GtkRuler* getRulerStruct()
83 return gtkRuler;
87 /** the main Gtk struct as a void* */
88 protected void* getStruct()
90 return cast(void*)gtkRuler;
93 /**
94 * Sets our main struct and passes it to the parent class
96 public this (GtkRuler* gtkRuler)
98 super(cast(GtkWidget*)gtkRuler);
99 this.gtkRuler = gtkRuler;
108 * This calls the GTKMetricType to set the ruler to units defined. Available units
109 * are GTK_PIXELS, GTK_INCHES, or GTK_CENTIMETERS. The default unit of measurement
110 * is GTK_PIXELS.
111 * ruler:
112 * the gtkruler
113 * metric:
114 * the unit of measurement
116 public void setMetric(GtkMetricType metric)
118 // void gtk_ruler_set_metric (GtkRuler *ruler, GtkMetricType metric);
119 gtk_ruler_set_metric(gtkRuler, metric);
123 * This sets the range of the ruler using gfloat lower, gfloat upper, gfloat position, and gfloat max_size.
124 * ruler:
125 * the gtkruler
126 * lower:
127 * the lower limit of the ruler
128 * upper:
129 * the upper limit of the ruler
130 * position:
131 * the mark on the ruler
132 * max_size:
133 * the maximum size of the ruler
135 public void setRange(double lower, double upper, double position, double maxSize)
137 // void gtk_ruler_set_range (GtkRuler *ruler, gdouble lower, gdouble upper, gdouble position, gdouble max_size);
138 gtk_ruler_set_range(gtkRuler, lower, upper, position, maxSize);
142 * Gets the units used for a GtkRuler. See gtk_ruler_set_metric().
143 * ruler:
144 * a GtkRuler
145 * Returns:
146 * the units currently used for ruler
148 public GtkMetricType getMetric()
150 // GtkMetricType gtk_ruler_get_metric (GtkRuler *ruler);
151 return gtk_ruler_get_metric(gtkRuler);
155 * Retrieves values indicating the range and current position of a GtkRuler.
156 * See gtk_ruler_set_range().
157 * ruler:
158 * a GtkRuler
159 * lower:
160 * location to store lower limit of the ruler, or NULL
161 * upper:
162 * location to store upper limit of the ruler, or NULL
163 * position:
164 * location to store the current position of the mark on the ruler, or NULL
165 * max_size:
166 * location to store the maximum size of the ruler used when calculating
167 * the space to leave for the text, or NULL.
168 * Property Details
169 * The "lower" property
170 * "lower" gdouble : Read / Write
171 * Lower limit of ruler.
172 * Default value: 0
174 public void getRange(double* lower, double* upper, double* position, double* maxSize)
176 // void gtk_ruler_get_range (GtkRuler *ruler, gdouble *lower, gdouble *upper, gdouble *position, gdouble *max_size);
177 gtk_ruler_get_range(gtkRuler, lower, upper, position, maxSize);