CtkGradient

CtkGradient — Gradients

Functions

Types and Values

Includes

#include <ctk/ctk.h>

Description

CtkGradient is a boxed type that represents a gradient. It is the result of parsing a gradient expression. To obtain the gradient represented by a CtkGradient, it has to be resolved with ctk_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 CtkGradients, since they are mostly used behind the scenes by CtkStyleContext and CtkCssProvider.

CtkGradient is deprecated. It was used internally by CTK’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.

Functions

ctk_gradient_new_linear ()

CtkGradient *
ctk_gradient_new_linear (gdouble x0,
                         gdouble y0,
                         gdouble x1,
                         gdouble y1);

ctk_gradient_new_linear has been deprecated since version 3.8 and should not be used in newly-written code.

CtkGradient 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 ctk_gradient_add_color_stop().

Parameters

x0

X coordinate of the starting point

 

y0

Y coordinate of the starting point

 

x1

X coordinate of the end point

 

y1

Y coordinate of the end point

 

Returns

A newly created CtkGradient

Since: 3.0


ctk_gradient_new_radial ()

CtkGradient *
ctk_gradient_new_radial (gdouble x0,
                         gdouble y0,
                         gdouble radius0,
                         gdouble x1,
                         gdouble y1,
                         gdouble radius1);

ctk_gradient_new_radial has been deprecated since version 3.8 and should not be used in newly-written code.

CtkGradient 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 ctk_gradient_add_color_stop().

Parameters

x0

X coordinate of the start circle

 

y0

Y coordinate of the start circle

 

radius0

radius of the start circle

 

x1

X coordinate of the end circle

 

y1

Y coordinate of the end circle

 

radius1

radius of the end circle

 

Returns

A newly created CtkGradient

Since: 3.0


ctk_gradient_add_color_stop ()

void
ctk_gradient_add_color_stop (CtkGradient *gradient,
                             gdouble offset,
                             CtkSymbolicColor *color);

ctk_gradient_add_color_stop has been deprecated since version 3.8 and should not be used in newly-written code.

CtkGradient is deprecated.

Adds a stop color to gradient .

Parameters

gradient

a CtkGradient

 

offset

offset for the color stop

 

color

color to use

 

Since: 3.0


ctk_gradient_ref ()

CtkGradient *
ctk_gradient_ref (CtkGradient *gradient);

ctk_gradient_ref has been deprecated since version 3.8 and should not be used in newly-written code.

CtkGradient is deprecated.

Increases the reference count of gradient .

Parameters

gradient

a CtkGradient

 

Returns

The same gradient

Since: 3.0


ctk_gradient_unref ()

void
ctk_gradient_unref (CtkGradient *gradient);

ctk_gradient_unref has been deprecated since version 3.8 and should not be used in newly-written code.

CtkGradient is deprecated.

Decreases the reference count of gradient , freeing its memory if the reference count reaches 0.

Parameters

gradient

a CtkGradient

 

Since: 3.0


ctk_gradient_resolve ()

gboolean
ctk_gradient_resolve (CtkGradient *gradient,
                      CtkStyleProperties *props,
                      cairo_pattern_t **resolved_gradient);

ctk_gradient_resolve has been deprecated since version 3.8 and should not be used in newly-written code.

CtkGradient 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 .

Parameters

gradient

a CtkGradient

 

props

CtkStyleProperties to use when resolving named colors

 

resolved_gradient

return location for the resolved pattern.

[out]

Returns

TRUE if the gradient has been resolved

Since: 3.0


ctk_gradient_resolve_for_context ()

cairo_pattern_t *
ctk_gradient_resolve_for_context (CtkGradient *gradient,
                                  CtkStyleContext *context);

ctk_gradient_resolve_for_context is deprecated and should not be used in newly-written code.


ctk_gradient_to_string ()

char *
ctk_gradient_to_string (CtkGradient *gradient);

ctk_gradient_to_string has been deprecated since version 3.8 and should not be used in newly-written code.

CtkGradient is deprecated.

Creates a string representation for gradient that is suitable for using in CTK CSS files.

Parameters

gradient

the gradient to print

 

Returns

A string representation for gradient

Types and Values

CtkGradient

typedef struct _CtkGradient CtkGradient;