Gradient

GtkGradient is a boxed type that represents a gradient. It is the result of parsing a gradient expression. To obtain the gradient represented by a GtkGradient, it has to be resolved with gtk_gradient_resolve(), which replaces all symbolic color references by the colors they refer to (in a given context) and constructs a cairo_pattern_t value.

It is not normally necessary to deal directly with GtkGradients, since they are mostly used behind the scenes by GtkStyleContext and GtkCssProvider.

GtkGradient is deprecated. It was used internally by GTK's CSS engine to represent gradients. As its handling is not conforming to modern web standards, it is not used anymore. If you want to use gradients in your own code, please use Cairo directly.

Constructors

this
this(GtkGradient* gtkGradient)

Sets our main struct and passes it to the parent class

this
this(double x0, double y0, double x1, double y1)

Warning gtk_gradient_new_linear has been deprecated since version 3.8 and should not be used in newly-written code. GtkGradient is deprecated. Creates a new linear gradient along the line defined by (x0, y0) and (x1, y1). Before using the gradient a number of stop colors must be added through gtk_gradient_add_color_stop().

this
this(double x0, double y0, double radius0, double x1, double y1, double radius1)

Warning gtk_gradient_new_radial has been deprecated since version 3.8 and should not be used in newly-written code. GtkGradient is deprecated. Creates a new radial gradient along the two circles defined by (x0, y0, radius0) and (x1, y1, radius1). Before using the gradient a number of stop colors must be added through gtk_gradient_add_color_stop().

Destructor

~this
~this()
Undocumented in source.

Members

Functions

addColorStop
void addColorStop(double offset, SymbolicColor color)

Warning gtk_gradient_add_color_stop has been deprecated since version 3.8 and should not be used in newly-written code. GtkGradient is deprecated. Adds a stop color to gradient.

doref
Gradient doref()

Warning gtk_gradient_ref has been deprecated since version 3.8 and should not be used in newly-written code. GtkGradient is deprecated. Increases the reference count of gradient.

getGradientStruct
GtkGradient* getGradientStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

resolve
int resolve(StyleProperties props, Pattern resolvedGradient)

Warning gtk_gradient_resolve has been deprecated since version 3.8 and should not be used in newly-written code. GtkGradient is deprecated. If gradient is resolvable, resolved_gradient will be filled in with the resolved gradient as a cairo_pattern_t, and TRUE will be returned. Generally, if gradient can't be resolved, it is due to it being defined on top of a named color that doesn't exist in props.

resolveForContext
Pattern resolveForContext(StyleContext context)
toString
string toString()

Warning gtk_gradient_to_string has been deprecated since version 3.8 and should not be used in newly-written code. GtkGradient is deprecated. Creates a string representation for gradient that is suitable for using in GTK CSS files.

unref
void unref()

Warning gtk_gradient_unref has been deprecated since version 3.8 and should not be used in newly-written code. GtkGradient is deprecated. Decreases the reference count of gradient, freeing its memory if the reference count reaches 0.

Variables

gtkGradient
GtkGradient* gtkGradient;

the main Gtk struct

Meta