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 = GtkCurve.html
56 import tango
.io
.Stdout
; // use the tango loging?
60 private import gtkc
.gtktypes
;
62 private import gtkc
.gtk
;
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+
79 * The GtkCurve widget allows the user to edit a curve covering a range of
80 * values. It is typically used to fine-tune color balances in graphics
81 * applications like the Gimp.
82 * The GtkCurve widget has 3 modes of operation - spline, linear and free.
83 * In spline mode the user places points on the curve which are automatically
84 * connected together into a smooth curve. In linear mode the user places points
85 * on the curve which are connected by straight lines. In free mode the user can
86 * draw the points of the curve freely, and they are not connected at all.
88 private import gtk
.DrawingArea
;
89 public class Curve
: DrawingArea
92 /** the main Gtk struct */
93 protected GtkCurve
* gtkCurve
;
96 public GtkCurve
* getCurveStruct()
102 /** the main Gtk struct as a void* */
103 protected void* getStruct()
105 return cast(void*)gtkCurve
;
109 * Sets our main struct and passes it to the parent class
111 public this (GtkCurve
* gtkCurve
)
115 if ( gtkCurve
is null )
120 Stdout("struct gtkCurve is null on constructor").newline
;
124 printf("struct gtkCurve is null on constructor");
131 assert(gtkCurve
!is null, "struct gtkCurve is null on constructor");
133 super(cast(GtkDrawingArea
*)gtkCurve
);
134 this.gtkCurve
= gtkCurve
;
140 // imports for the signal processing
141 private import gobject
.Signals
;
142 private import gtkc
.gdktypes
;
143 int[char[]] connectedSignals
;
145 void delegate(Curve
)[] onCurveTypeChangedListeners
;
146 void addOnCurveTypeChanged(void delegate(Curve
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
148 if ( !("curve-type-changed" in connectedSignals
) )
152 "curve-type-changed",
153 cast(GCallback
)&callBackCurveTypeChanged
,
157 connectedSignals
["curve-type-changed"] = 1;
159 onCurveTypeChangedListeners
~= dlg
;
161 extern(C
) static void callBackCurveTypeChanged(GtkCurve
* curveStruct
, Curve curve
)
163 bool consumed
= false;
165 foreach ( void delegate(Curve
) dlg
; curve
.onCurveTypeChangedListeners
)
176 * Creates a new GtkCurve.
182 // GtkWidget* gtk_curve_new (void);
183 this(cast(GtkCurve
*)gtk_curve_new() );
187 * Resets the curve to a straight line from the minimum x and y values to the
188 * maximum x and y values (i.e. from the bottom-left to the top-right corners).
189 * The curve type is not changed.
195 // void gtk_curve_reset (GtkCurve *curve);
196 gtk_curve_reset(gtkCurve
);
200 * Recomputes the entire curve using the given gamma value.
201 * A gamma value of 1 results in a straight line. Values greater than 1 result
202 * in a curve above the straight line. Values less than 1 result in a curve
203 * below the straight line. The curve type is changed to GTK_CURVE_TYPE_FREE.
204 * FIXME: Needs a more precise definition of gamma.
210 public void setGamma(float gamma
)
212 // void gtk_curve_set_gamma (GtkCurve *curve, gfloat gamma_);
213 gtk_curve_set_gamma(gtkCurve
, gamma
);
217 * Sets the minimum and maximum x and y values of the curve.
218 * The curve is also reset with a call to gtk_curve_reset().
222 * the minimum x value.
224 * the maximum x value.
226 * the minimum y value.
228 * the maximum y value.
230 public void setRange(float minX
, float maxX
, float minY
, float maxY
)
232 // void gtk_curve_set_range (GtkCurve *curve, gfloat min_x, gfloat max_x, gfloat min_y, gfloat max_y);
233 gtk_curve_set_range(gtkCurve
, minX
, maxX
, minY
, maxY
);
237 * Returns a vector of points representing the curve.
241 * the number of points to calculate.
243 * returns the points.
245 public void getVector(int veclen
, float[] vector
)
247 // void gtk_curve_get_vector (GtkCurve *curve, int veclen, gfloat vector[]);
248 gtk_curve_get_vector(gtkCurve
, veclen
, vector
);
252 * Sets the vector of points on the curve.
253 * The curve type is set to GTK_CURVE_TYPE_FREE.
257 * the number of points.
259 * the points on the curve.
261 public void setVector(int veclen
, float[] vector
)
263 // void gtk_curve_set_vector (GtkCurve *curve, int veclen, gfloat vector[]);
264 gtk_curve_set_vector(gtkCurve
, veclen
, vector
);
268 * Sets the type of the curve. The curve will remain unchanged except when
269 * changing from a free curve to a linear or spline curve, in which case the
270 * curve will be changed as little as possible.
274 * the type of the curve.
276 * The "curve-type" property
277 * "curve-type" GtkCurveType : Read / Write
278 * Is this curve linear, spline interpolated, or free-form.
279 * Default value: GTK_CURVE_TYPE_LINEAR
281 public void setCurveType(GtkCurveType type
)
283 // void gtk_curve_set_curve_type (GtkCurve *curve, GtkCurveType type);
284 gtk_curve_set_curve_type(gtkCurve
, type
);