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 = GtkRange.html
47 * - GtkAdjustment* -> Adjustment
53 private import gtk
.gtktypes
;
55 private import lib
.gtk
;
57 private import gtk
.Adjustment
;
62 private import gtk
.Widget
;
63 public class Range
: Widget
66 /** the main Gtk struct */
67 protected GtkRange
* gtkRange
;
70 public GtkRange
* getRangeStruct()
76 /** the main Gtk struct as a void* */
77 protected void* getStruct()
79 return cast(void*)gtkRange
;
83 * Sets our main struct and passes it to the parent class
85 public this (GtkRange
* gtkRange
)
87 super(cast(GtkWidget
*)gtkRange
);
88 this.gtkRange
= gtkRange
;
94 // imports for the signal processing
95 private import gobject
.Signals
;
96 private import gdk
.gdktypes
;
97 int[char[]] connectedSignals
;
99 void delegate(gdouble
, Range
)[] onAdjustBoundsListeners
;
100 void addOnAdjustBounds(void delegate(gdouble
, Range
) dlg
)
102 if ( !("adjust-bounds" in connectedSignals
) )
107 cast(GCallback
)&callBackAdjustBounds
,
110 cast(ConnectFlags
)0);
111 connectedSignals
["adjust-bounds"] = 1;
113 onAdjustBoundsListeners
~= dlg
;
115 extern(C
) static void callBackAdjustBounds(GtkRange
* rangeStruct
, gdouble arg1
, Range range
)
117 bit consumed
= false;
119 foreach ( void delegate(gdouble
, Range
) dlg
; range
.onAdjustBoundsListeners
)
127 gboolean
delegate(GtkScrollType
, gdouble
, Range
)[] onChangeValueListeners
;
128 void addOnChangeValue(gboolean
delegate(GtkScrollType
, gdouble
, Range
) dlg
)
130 if ( !("change-value" in connectedSignals
) )
135 cast(GCallback
)&callBackChangeValue
,
138 cast(ConnectFlags
)0);
139 connectedSignals
["change-value"] = 1;
141 onChangeValueListeners
~= dlg
;
143 extern(C
) static void callBackChangeValue(GtkRange
* rangeStruct
, GtkScrollType scroll
, gdouble value
, Range range
)
145 bit consumed
= false;
147 foreach ( gboolean
delegate(GtkScrollType
, gdouble
, Range
) dlg
; range
.onChangeValueListeners
)
149 dlg(scroll
, value
, range
);
155 void delegate(GtkScrollType
, Range
)[] onMoveSliderListeners
;
156 void addOnMoveSlider(void delegate(GtkScrollType
, Range
) dlg
)
158 if ( !("move-slider" in connectedSignals
) )
163 cast(GCallback
)&callBackMoveSlider
,
166 cast(ConnectFlags
)0);
167 connectedSignals
["move-slider"] = 1;
169 onMoveSliderListeners
~= dlg
;
171 extern(C
) static void callBackMoveSlider(GtkRange
* rangeStruct
, GtkScrollType arg1
, Range range
)
173 bit consumed
= false;
175 foreach ( void delegate(GtkScrollType
, Range
) dlg
; range
.onMoveSliderListeners
)
183 void delegate(Range
)[] onValueChangedListeners
;
184 void addOnValueChanged(void delegate(Range
) dlg
)
186 if ( !("value-changed" in connectedSignals
) )
191 cast(GCallback
)&callBackValueChanged
,
194 cast(ConnectFlags
)0);
195 connectedSignals
["value-changed"] = 1;
197 onValueChangedListeners
~= dlg
;
199 extern(C
) static void callBackValueChanged(GtkRange
* rangeStruct
, Range range
)
201 bit consumed
= false;
203 foreach ( void delegate(Range
) dlg
; range
.onValueChangedListeners
)
214 * Get the GtkAdjustment which is the "model" object for GtkRange.
215 * See gtk_range_set_adjustment() for details.
216 * The return value does not have a reference added, so should not
223 public Adjustment
getAdjustment()
225 // GtkAdjustment* gtk_range_get_adjustment (GtkRange *range);
226 return new Adjustment( gtk_range_get_adjustment(gtkRange
) );
230 * Sets the update policy for the range. GTK_UPDATE_CONTINUOUS means that
231 * anytime the range slider is moved, the range value will change and the
232 * value_changed signal will be emitted. GTK_UPDATE_DELAYED means that
233 * the value will be updated after a brief timeout where no slider motion
234 * occurs, so updates are spaced by a short time rather than
235 * continuous. GTK_UPDATE_DISCONTINUOUS means that the value will only
236 * be updated when the user releases the button and ends the slider
243 public void setUpdatePolicy(GtkUpdateType policy
)
245 // void gtk_range_set_update_policy (GtkRange *range, GtkUpdateType policy);
246 gtk_range_set_update_policy(gtkRange
, policy
);
250 * Sets the adjustment to be used as the "model" object for this range
251 * widget. The adjustment indicates the current range value, the
252 * minimum and maximum range values, the step/page increments used
253 * for keybindings and scrolling, and the page size. The page size
254 * is normally 0 for GtkScale and nonzero for GtkScrollbar, and
255 * indicates the size of the visible area of the widget being scrolled.
256 * The page size affects the size of the scrollbar slider.
262 public void setAdjustment(Adjustment adjustment
)
264 // void gtk_range_set_adjustment (GtkRange *range, GtkAdjustment *adjustment);
265 gtk_range_set_adjustment(gtkRange
, (adjustment
is null) ?
null : adjustment
.getAdjustmentStruct());
269 * Gets the value set by gtk_range_set_inverted().
273 * TRUE if the range is inverted
275 public int getInverted()
277 // gboolean gtk_range_get_inverted (GtkRange *range);
278 return gtk_range_get_inverted(gtkRange
);
282 * Ranges normally move from lower to higher values as the
283 * slider moves from top to bottom or left to right. Inverted
284 * ranges have higher values at the top or on the right rather than
285 * on the bottom or left.
289 * TRUE to invert the range
291 public void setInverted(int setting
)
293 // void gtk_range_set_inverted (GtkRange *range, gboolean setting);
294 gtk_range_set_inverted(gtkRange
, setting
);
298 * Gets the update policy of range. See gtk_range_set_update_policy().
302 * the current update policy
304 public GtkUpdateType
getUpdatePolicy()
306 // GtkUpdateType gtk_range_get_update_policy (GtkRange *range);
307 return gtk_range_get_update_policy(gtkRange
);
311 * Gets the current value of the range.
315 * current value of the range.
317 public double getValue()
319 // gdouble gtk_range_get_value (GtkRange *range);
320 return gtk_range_get_value(gtkRange
);
324 * Sets the step and page sizes for the range.
325 * The step size is used when the user clicks the GtkScrollbar
326 * arrows or moves GtkScale via arrow keys. The page size
327 * is used for example when moving via Page Up or Page Down keys.
335 public void setIncrements(double step
, double page
)
337 // void gtk_range_set_increments (GtkRange *range, gdouble step, gdouble page);
338 gtk_range_set_increments(gtkRange
, step
, page
);
342 * Sets the allowable values in the GtkRange, and clamps the range
343 * value to be between min and max. (If the range has a non-zero
344 * page size, it is clamped between min and max - page-size.)
348 * minimum range value
350 * maximum range value
352 public void setRange(double min
, double max
)
354 // void gtk_range_set_range (GtkRange *range, gdouble min, gdouble max);
355 gtk_range_set_range(gtkRange
, min
, max
);
359 * Sets the current value of the range; if the value is outside the
360 * minimum or maximum range values, it will be clamped to fit inside
361 * them. The range emits the "value_changed" signal if the value
366 * new value of the range
368 public void setValue(double value
)
370 // void gtk_range_set_value (GtkRange *range, gdouble value);
371 gtk_range_set_value(gtkRange
, value
);
376 * Sets the sensitivity policy for the stepper that points to the
377 * 'lower' end of the GtkRange's adjustment.
381 * the lower stepper's sensitivity policy.
384 public void setLowerStepperSensitivity(GtkSensitivityType sensitivity
)
386 // void gtk_range_set_lower_stepper_sensitivity (GtkRange *range, GtkSensitivityType sensitivity);
387 gtk_range_set_lower_stepper_sensitivity(gtkRange
, sensitivity
);
391 * Gets the sensitivity policy for the stepper that points to the
392 * 'lower' end of the GtkRange's adjustment.
396 * The lower stepper's sensitivity policy.
399 public GtkSensitivityType
getLowerStepperSensitivity()
401 // GtkSensitivityType gtk_range_get_lower_stepper_sensitivity (GtkRange *range);
402 return gtk_range_get_lower_stepper_sensitivity(gtkRange
);
406 * Sets the sensitivity policy for the stepper that points to the
407 * 'upper' end of the GtkRange's adjustment.
411 * the upper stepper's sensitivity policy.
414 public void setUpperStepperSensitivity(GtkSensitivityType sensitivity
)
416 // void gtk_range_set_upper_stepper_sensitivity (GtkRange *range, GtkSensitivityType sensitivity);
417 gtk_range_set_upper_stepper_sensitivity(gtkRange
, sensitivity
);
421 * Gets the sensitivity policy for the stepper that points to the
422 * 'upper' end of the GtkRange's adjustment.
426 * The upper stepper's sensitivity policy.
429 * The "adjustment" property
430 * "adjustment" GtkAdjustment : Read / Write / Construct
431 * The GtkAdjustment that contains the current value of this range object.
433 public GtkSensitivityType
getUpperStepperSensitivity()
435 // GtkSensitivityType gtk_range_get_upper_stepper_sensitivity (GtkRange *range);
436 return gtk_range_get_upper_stepper_sensitivity(gtkRange
);