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 = GtkCurve.html
51 private import gtk
.gtktypes
;
53 private import lib
.gtk
;
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+
66 * The GtkCurve widget allows the user to edit a curve covering a range of
67 * values. It is typically used to fine-tune color balances in graphics
68 * applications like the Gimp.
69 * The GtkCurve widget has 3 modes of operation - spline, linear and free.
70 * In spline mode the user places points on the curve which are automatically
71 * connected together into a smooth curve. In linear mode the user places points
72 * on the curve which are connected by straight lines. In free mode the user can
73 * draw the points of the curve freely, and they are not connected at all.
75 private import gtk
.DrawingArea
;
76 public class Curve
: DrawingArea
79 /** the main Gtk struct */
80 protected GtkCurve
* gtkCurve
;
83 public GtkCurve
* getCurveStruct()
89 /** the main Gtk struct as a void* */
90 protected void* getStruct()
92 return cast(void*)gtkCurve
;
96 * Sets our main struct and passes it to the parent class
98 public this (GtkCurve
* gtkCurve
)
100 super(cast(GtkDrawingArea
*)gtkCurve
);
101 this.gtkCurve
= gtkCurve
;
107 // imports for the signal processing
108 private import gobject
.Signals
;
109 private import gdk
.gdktypes
;
110 int[char[]] connectedSignals
;
112 void delegate(Curve
)[] onCurveTypeChangedListeners
;
113 void addOnCurveTypeChanged(void delegate(Curve
) dlg
)
115 if ( !("curve-type-changed" in connectedSignals
) )
119 "curve-type-changed",
120 cast(GCallback
)&callBackCurveTypeChanged
,
123 cast(ConnectFlags
)0);
124 connectedSignals
["curve-type-changed"] = 1;
126 onCurveTypeChangedListeners
~= dlg
;
128 extern(C
) static void callBackCurveTypeChanged(GtkCurve
* curveStruct
, Curve curve
)
130 bit consumed
= false;
132 foreach ( void delegate(Curve
) dlg
; curve
.onCurveTypeChangedListeners
)
143 * Creates a new GtkCurve.
149 // GtkWidget* gtk_curve_new (void);
150 this(cast(GtkCurve
*)gtk_curve_new() );
154 * Resets the curve to a straight line from the minimum x and y values to the
155 * maximum x and y values (i.e. from the bottom-left to the top-right corners).
156 * The curve type is not changed.
162 // void gtk_curve_reset (GtkCurve *curve);
163 gtk_curve_reset(gtkCurve
);
167 * Recomputes the entire curve using the given gamma value.
168 * A gamma value of 1 results in a straight line. Values greater than 1 result
169 * in a curve above the straight line. Values less than 1 result in a curve
170 * below the straight line. The curve type is changed to GTK_CURVE_TYPE_FREE.
171 * FIXME: Needs a more precise definition of gamma.
177 public void setGamma(float gamma
)
179 // void gtk_curve_set_gamma (GtkCurve *curve, gfloat gamma_);
180 gtk_curve_set_gamma(gtkCurve
, gamma
);
184 * Sets the minimum and maximum x and y values of the curve.
185 * The curve is also reset with a call to gtk_curve_reset().
189 * the minimum x value.
191 * the maximum x value.
193 * the minimum y value.
195 * the maximum y value.
197 public void setRange(float minX
, float maxX
, float minY
, float maxY
)
199 // void gtk_curve_set_range (GtkCurve *curve, gfloat min_x, gfloat max_x, gfloat min_y, gfloat max_y);
200 gtk_curve_set_range(gtkCurve
, minX
, maxX
, minY
, maxY
);
204 * Returns a vector of points representing the curve.
208 * the number of points to calculate.
210 * returns the points.
212 public void getVector(int veclen
, float[] vector
)
214 // void gtk_curve_get_vector (GtkCurve *curve, int veclen, gfloat vector[]);
215 gtk_curve_get_vector(gtkCurve
, veclen
, vector
);
219 * Sets the vector of points on the curve.
220 * The curve type is set to GTK_CURVE_TYPE_FREE.
224 * the number of points.
226 * the points on the curve.
228 public void setVector(int veclen
, float[] vector
)
230 // void gtk_curve_set_vector (GtkCurve *curve, int veclen, gfloat vector[]);
231 gtk_curve_set_vector(gtkCurve
, veclen
, vector
);
235 * Sets the type of the curve. The curve will remain unchanged except when
236 * changing from a free curve to a linear or spline curve, in which case the
237 * curve will be changed as little as possible.
241 * the type of the curve.
243 * The "curve-type" property
244 * "curve-type" GtkCurveType : Read / Write
245 * Is this curve linear, spline interpolated, or free-form.
246 * Default value: GTK_CURVE_TYPE_LINEAR
248 public void setCurveType(GtkCurveType type
)
250 // void gtk_curve_set_curve_type (GtkCurve *curve, GtkCurveType type);
251 gtk_curve_set_curve_type(gtkCurve
, type
);