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 = GtkProgressBar.html
27 * outFile = ProgressBar
28 * strct = GtkProgressBar
48 * - GtkAdjustment* -> Adjustment
52 module gtk
.ProgressBar
;
54 private import gtk
.gtktypes
;
56 private import lib
.gtk
;
58 private import glib
.Str
;
59 private import gtk
.Adjustment
;
63 * The GtkProgressBar is typically used to display the progress of a long
64 * running operation. It provides a visual clue that processing
65 * is underway. The GtkProgressBar can be used in two different
66 * modes: percentage mode and activity mode.
67 * When an application can determine how much work needs to take place
68 * (e.g. read a fixed number of bytes from a file) and can monitor its
69 * progress, it can use the GtkProgressBar in percentage mode and the user
70 * sees a growing bar indicating the percentage of the work that has
71 * been completed. In this mode, the application is required to call
72 * gtk_progress_bar_set_fraction() periodically to update the progress bar.
73 * When an application has no accurate way of knowing the amount of work
74 * to do, it can use the GtkProgressBar in activity mode, which shows activity
75 * by a block moving back and forth within the progress area. In this mode,
76 * the application is required to call gtk_progress_bar_pulse() perodically
77 * to update the progress bar.
78 * There is quite a bit of flexibility provided to control the appearance
79 * of the GtkProgressBar. Functions are provided to control the
80 * orientation of the bar, optional text can be displayed along with
81 * the bar, and the step size used in activity mode can be set.
83 * The GtkProgressBar/GtkProgress API in GTK 1.2 was bloated, needlessly complex
84 * and hard to use properly. Therefore GtkProgress has been deprecated
85 * completely and the GtkProgressBar API has been reduced to the following 10
86 * functions: gtk_progress_bar_new(), gtk_progress_bar_pulse(),
87 * gtk_progress_bar_set_text(), gtk_progress_bar_set_fraction(),
88 * gtk_progress_bar_set_pulse_step(), gtk_progress_bar_set_orientation(),
89 * gtk_progress_bar_get_text(), gtk_progress_bar_get_fraction(),
90 * gtk_progress_bar_get_pulse_step(), gtk_progress_bar_get_orientation().
91 * These have been grouped at the beginning of this section, followed by
92 * a large chunk of deprecated 1.2 compatibility functions.
94 private import gtk
.Progress
;
95 public class ProgressBar
: Progress
98 /** the main Gtk struct */
99 protected GtkProgressBar
* gtkProgressBar
;
102 public GtkProgressBar
* getProgressBarStruct()
104 return gtkProgressBar
;
108 /** the main Gtk struct as a void* */
109 protected void* getStruct()
111 return cast(void*)gtkProgressBar
;
115 * Sets our main struct and passes it to the parent class
117 public this (GtkProgressBar
* gtkProgressBar
)
119 super(cast(GtkProgress
*)gtkProgressBar
);
120 this.gtkProgressBar
= gtkProgressBar
;
128 * Creates a new GtkProgressBar.
134 // GtkWidget* gtk_progress_bar_new (void);
135 this(cast(GtkProgressBar
*)gtk_progress_bar_new() );
139 * Indicates that some progress is made, but you don't know how much.
140 * Causes the progress bar to enter "activity mode," where a block
141 * bounces back and forth. Each call to gtk_progress_bar_pulse()
142 * causes the block to move by a little bit (the amount of movement
143 * per pulse is determined by gtk_progress_bar_set_pulse_step()).
149 // void gtk_progress_bar_pulse (GtkProgressBar *pbar);
150 gtk_progress_bar_pulse(gtkProgressBar
);
154 * Causes the given text to appear superimposed on the progress bar.
158 * a UTF-8 string, or NULL
160 public void setText(char[] text
)
162 // void gtk_progress_bar_set_text (GtkProgressBar *pbar, const gchar *text);
163 gtk_progress_bar_set_text(gtkProgressBar
, Str
.toStringz(text
));
167 * Causes the progress bar to "fill in" the given fraction
168 * of the bar. The fraction should be between 0.0 and 1.0,
173 * fraction of the task that's been completed
175 public void setFraction(double fraction
)
177 // void gtk_progress_bar_set_fraction (GtkProgressBar *pbar, gdouble fraction);
178 gtk_progress_bar_set_fraction(gtkProgressBar
, fraction
);
182 * Sets the fraction of total progress bar length to move the
183 * bouncing block for each call to gtk_progress_bar_pulse().
187 * fraction between 0.0 and 1.0
189 public void setPulseStep(double fraction
)
191 // void gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar, gdouble fraction);
192 gtk_progress_bar_set_pulse_step(gtkProgressBar
, fraction
);
196 * Causes the progress bar to switch to a different orientation
197 * (left-to-right, right-to-left, top-to-bottom, or bottom-to-top).
201 * orientation of the progress bar
203 public void setOrientation(GtkProgressBarOrientation orientation
)
205 // void gtk_progress_bar_set_orientation (GtkProgressBar *pbar, GtkProgressBarOrientation orientation);
206 gtk_progress_bar_set_orientation(gtkProgressBar
, orientation
);
210 * Sets the mode used to ellipsize (add an ellipsis: "...") the text
211 * if there is not enough space to render the entire string.
215 * a PangoEllipsizeMode
218 public void setEllipsize(PangoEllipsizeMode mode
)
220 // void gtk_progress_bar_set_ellipsize (GtkProgressBar *pbar, PangoEllipsizeMode mode);
221 gtk_progress_bar_set_ellipsize(gtkProgressBar
, mode
);
226 * Retrieves the text displayed superimposed on the progress bar,
227 * if any, otherwise NULL. The return value is a reference
228 * to the text, not a copy of it, so will become invalid
229 * if you change the text in the progress bar.
233 * text, or NULL; this string is owned by the widget
234 * and should not be modified or freed.
236 public char[] getText()
238 // const gchar* gtk_progress_bar_get_text (GtkProgressBar *pbar);
239 return Str
.toString(gtk_progress_bar_get_text(gtkProgressBar
) );
243 * Returns the current fraction of the task that's been completed.
247 * a fraction from 0.0 to 1.0
249 public double getFraction()
251 // gdouble gtk_progress_bar_get_fraction (GtkProgressBar *pbar);
252 return gtk_progress_bar_get_fraction(gtkProgressBar
);
256 * Retrieves the pulse step set with gtk_progress_bar_set_pulse_step()
260 * a fraction from 0.0 to 1.0
262 public double getPulseStep()
264 // gdouble gtk_progress_bar_get_pulse_step (GtkProgressBar *pbar);
265 return gtk_progress_bar_get_pulse_step(gtkProgressBar
);
269 * Retrieves the current progress bar orientation.
273 * orientation of the progress bar
275 public GtkProgressBarOrientation
getOrientation()
277 // GtkProgressBarOrientation gtk_progress_bar_get_orientation (GtkProgressBar *pbar);
278 return gtk_progress_bar_get_orientation(gtkProgressBar
);
282 * Returns the ellipsizing position of the progressbar.
283 * See gtk_progress_bar_set_ellipsize().
290 public PangoEllipsizeMode
getEllipsize()
292 // PangoEllipsizeMode gtk_progress_bar_get_ellipsize (GtkProgressBar *pbar);
293 return gtk_progress_bar_get_ellipsize(gtkProgressBar
);
298 * gtk_progress_bar_new_with_adjustment is deprecated and should not be used in newly-written code.
299 * Creates a new GtkProgressBar with an associated GtkAdjustment.
305 public this (Adjustment adjustment
)
307 // GtkWidget* gtk_progress_bar_new_with_adjustment (GtkAdjustment *adjustment);
308 this(cast(GtkProgressBar
*)gtk_progress_bar_new_with_adjustment((adjustment
is null) ?
null : adjustment
.getAdjustmentStruct()) );
313 * gtk_progress_bar_set_bar_style is deprecated and should not be used in newly-written code.
314 * Sets the style of the GtkProgressBar. The default style is
315 * GTK_PROGRESS_CONTINUOUS.
319 * a GtkProgressBarStyle value indicating the desired style.
321 public void setBarStyle(GtkProgressBarStyle style
)
323 // void gtk_progress_bar_set_bar_style (GtkProgressBar *pbar, GtkProgressBarStyle style);
324 gtk_progress_bar_set_bar_style(gtkProgressBar
, style
);
330 * gtk_progress_bar_set_discrete_blocks is deprecated and should not be used in newly-written code.
331 * Sets the number of blocks that the progress bar is divided into
332 * when the style is GTK_PROGRESS_DISCRETE.
336 * number of individual blocks making up the bar.
338 public void setDiscreteBlocks(uint blocks
)
340 // void gtk_progress_bar_set_discrete_blocks (GtkProgressBar *pbar, guint blocks);
341 gtk_progress_bar_set_discrete_blocks(gtkProgressBar
, blocks
);
346 * gtk_progress_bar_set_activity_step is deprecated and should not be used in newly-written code.
347 * Sets the step value used when the progress bar is in activity
348 * mode. The step is the amount by which the progress is incremented
353 * the amount which the progress is incremented in activity
356 public void setActivityStep(uint step
)
358 // void gtk_progress_bar_set_activity_step (GtkProgressBar *pbar, guint step);
359 gtk_progress_bar_set_activity_step(gtkProgressBar
, step
);
364 * gtk_progress_bar_set_activity_blocks is deprecated and should not be used in newly-written code.
365 * Sets the number of blocks used when the progress bar is in activity
366 * mode. Larger numbers make the visible block smaller.
370 * number of blocks which can fit within the progress bar area.
372 public void setActivityBlocks(uint blocks
)
374 // void gtk_progress_bar_set_activity_blocks (GtkProgressBar *pbar, guint blocks);
375 gtk_progress_bar_set_activity_blocks(gtkProgressBar
, blocks
);
380 * gtk_progress_bar_update is deprecated and should not be used in newly-written code.
381 * This function is deprecated. Please use gtk_progress_set_value() or
382 * gtk_progress_set_percentage() instead.
386 * the new percent complete value.
388 * The "activity-blocks" property
389 * "activity-blocks" guint : Read / Write
390 * The number of blocks which can fit in the progress bar area in activity mode (Deprecated).
391 * Allowed values: >= 2
394 public void update(double percentage
)
396 // void gtk_progress_bar_update (GtkProgressBar *pbar, gdouble percentage);
397 gtk_progress_bar_update(gtkProgressBar
, percentage
);