alternative to assert
[gtkD.git] / gtkD / src / gtk / Ruler.d
blob3a1acd53f5e27a78b4ca70e73364fd50370a61b1
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 * module aliases:
47 * local aliases:
50 module gtk.Ruler;
52 version(noAssert)
54 version(Tango)
56 import tango.io.Stdout; // use the tango loging?
60 private import gtkc.gtktypes;
62 private import gtkc.gtk;
69 /**
70 * Description
71 * Note
72 * This widget is considered too specialized/little-used for
73 * GTK+, and will in the future be moved to some other package. If
74 * your application needs this widget, feel free to use it, as the
75 * widget does work and is useful in some applications; it's just not
76 * of general interest. However, we are not accepting new features for
77 * the widget, and it will eventually move out of the GTK+
78 * distribution.
79 * The GTKRuler widget is a base class for horizontal and vertical rulers. Rulers
80 * are used to show the mouse pointer's location in a window. The ruler can either
81 * be horizontal or vertical on the window. Within the ruler a small triangle
82 * indicates the location of the mouse relative to the horizontal or vertical
83 * ruler. See GtkHRuler to learn how to create a new horizontal ruler. See
84 * GtkVRuler to learn how to create a new vertical ruler.
86 private import gtk.Widget;
87 public class Ruler : Widget
90 /** the main Gtk struct */
91 protected GtkRuler* gtkRuler;
94 public GtkRuler* getRulerStruct()
96 return gtkRuler;
100 /** the main Gtk struct as a void* */
101 protected void* getStruct()
103 return cast(void*)gtkRuler;
107 * Sets our main struct and passes it to the parent class
109 public this (GtkRuler* gtkRuler)
111 version(noAssert)
113 if ( gtkRuler is null )
115 int zero = 0;
116 version(Tango)
118 Stdout("struct gtkRuler is null on constructor").newline;
120 else
122 printf("struct gtkRuler is null on constructor");
124 zero = zero / zero;
127 else
129 assert(gtkRuler !is null, "struct gtkRuler is null on constructor");
131 super(cast(GtkWidget*)gtkRuler);
132 this.gtkRuler = gtkRuler;
141 * This calls the GTKMetricType to set the ruler to units defined. Available units
142 * are GTK_PIXELS, GTK_INCHES, or GTK_CENTIMETERS. The default unit of measurement
143 * is GTK_PIXELS.
144 * ruler:
145 * the gtkruler
146 * metric:
147 * the unit of measurement
149 public void setMetric(GtkMetricType metric)
151 // void gtk_ruler_set_metric (GtkRuler *ruler, GtkMetricType metric);
152 gtk_ruler_set_metric(gtkRuler, metric);
156 * This sets the range of the ruler using gfloat lower, gfloat upper, gfloat position, and gfloat max_size.
157 * ruler:
158 * the gtkruler
159 * lower:
160 * the lower limit of the ruler
161 * upper:
162 * the upper limit of the ruler
163 * position:
164 * the mark on the ruler
165 * max_size:
166 * the maximum size of the ruler
168 public void setRange(double lower, double upper, double position, double maxSize)
170 // void gtk_ruler_set_range (GtkRuler *ruler, gdouble lower, gdouble upper, gdouble position, gdouble max_size);
171 gtk_ruler_set_range(gtkRuler, lower, upper, position, maxSize);
175 * Gets the units used for a GtkRuler. See gtk_ruler_set_metric().
176 * ruler:
177 * a GtkRuler
178 * Returns:
179 * the units currently used for ruler
181 public GtkMetricType getMetric()
183 // GtkMetricType gtk_ruler_get_metric (GtkRuler *ruler);
184 return gtk_ruler_get_metric(gtkRuler);
188 * Retrieves values indicating the range and current position of a GtkRuler.
189 * See gtk_ruler_set_range().
190 * ruler:
191 * a GtkRuler
192 * lower:
193 * location to store lower limit of the ruler, or NULL
194 * upper:
195 * location to store upper limit of the ruler, or NULL
196 * position:
197 * location to store the current position of the mark on the ruler, or NULL
198 * max_size:
199 * location to store the maximum size of the ruler used when calculating
200 * the space to leave for the text, or NULL.
201 * Property Details
202 * The "lower" property
203 * "lower" gdouble : Read / Write
204 * Lower limit of ruler.
205 * Default value: 0
207 public void getRange(double* lower, double* upper, double* position, double* maxSize)
209 // void gtk_ruler_get_range (GtkRuler *ruler, gdouble *lower, gdouble *upper, gdouble *position, gdouble *max_size);
210 gtk_ruler_get_range(gtkRuler, lower, upper, position, maxSize);