| Top |
CtkThemingEngine was the object used for rendering themed content in CTK+ widgets. It used to allow overriding CTK+'s default implementation of rendering functions by allowing engines to be loaded as modules.
CtkThemingEngine has been deprecated in CTK+ 3.14 and will be ignored for rendering. The advancements in CSS theming are good enough to allow themers to achieve their goals without the need to modify source code.
void ctk_theming_engine_get (CtkThemingEngine *engine,CtkStateFlags state,...);
ctk_theming_engine_get has been deprecated since version 3.14 and should not be used in newly-written code.
Retrieves several style property values that apply to the currently rendered element.
engine |
||
state |
state to retrieve values for |
|
... |
property name /return value pairs, followed by |
Since: 3.0
CtkTextDirection
ctk_theming_engine_get_direction (CtkThemingEngine *engine);
ctk_theming_engine_get_direction has been deprecated since version 3.8 and should not be used in newly-written code.
Use ctk_theming_engine_get_state() and
check for CTK_STATE_FLAG_DIR_LTR and
CTK_STATE_FLAG_DIR_RTL instead.
Returns the widget direction used for rendering.
Since: 3.0
CtkJunctionSides
ctk_theming_engine_get_junction_sides (CtkThemingEngine *engine);
ctk_theming_engine_get_junction_sides has been deprecated since version 3.14 and should not be used in newly-written code.
Returns the widget direction used for rendering.
Since: 3.0
const CtkWidgetPath *
ctk_theming_engine_get_path (CtkThemingEngine *engine);
ctk_theming_engine_get_path has been deprecated since version 3.14 and should not be used in newly-written code.
Returns the widget path used for style matching.
Since: 3.0
void ctk_theming_engine_get_property (CtkThemingEngine *engine,const gchar *property,CtkStateFlags state,GValue *value);
ctk_theming_engine_get_property has been deprecated since version 3.14 and should not be used in newly-written code.
Gets a property value as retrieved from the style settings that apply to the currently rendered element.
engine |
||
property |
the property name |
|
state |
state to retrieve the value for |
|
value |
return location for the property value,
you must free this memory using |
[out][transfer full] |
Since: 3.0
CdkScreen *
ctk_theming_engine_get_screen (CtkThemingEngine *engine);
ctk_theming_engine_get_screen has been deprecated since version 3.14 and should not be used in newly-written code.
Returns the CdkScreen to which engine
currently rendering to.
CtkStateFlags
ctk_theming_engine_get_state (CtkThemingEngine *engine);
ctk_theming_engine_get_state has been deprecated since version 3.14 and should not be used in newly-written code.
returns the state used when rendering.
Since: 3.0
void ctk_theming_engine_get_style (CtkThemingEngine *engine,...);
ctk_theming_engine_get_style has been deprecated since version 3.14 and should not be used in newly-written code.
Retrieves several widget style properties from engine
according
to the currently rendered content’s style.
Since: 3.0
void ctk_theming_engine_get_style_property (CtkThemingEngine *engine,const gchar *property_name,GValue *value);
ctk_theming_engine_get_style_property has been deprecated since version 3.14 and should not be used in newly-written code.
Gets the value for a widget style property.
engine |
||
property_name |
the name of the widget style property |
|
value |
Return location for the property value, free with
|
[out] |
Since: 3.0
void ctk_theming_engine_get_style_valist (CtkThemingEngine *engine,va_list args);
ctk_theming_engine_get_style_valist has been deprecated since version 3.14 and should not be used in newly-written code.
Retrieves several widget style properties from engine
according to the
currently rendered content’s style.
Since: 3.0
void ctk_theming_engine_get_valist (CtkThemingEngine *engine,CtkStateFlags state,va_list args);
ctk_theming_engine_get_valist has been deprecated since version 3.14 and should not be used in newly-written code.
Retrieves several style property values that apply to the currently rendered element.
engine |
||
state |
state to retrieve values for |
|
args |
va_list of property name/return location pairs, followed by |
Since: 3.0
void ctk_theming_engine_get_color (CtkThemingEngine *engine,CtkStateFlags state,CdkRGBA *color);
ctk_theming_engine_get_color has been deprecated since version 3.14 and should not be used in newly-written code.
Gets the foreground color for a given state.
engine |
||
state |
state to retrieve the color for |
|
color |
return value for the foreground color. |
[out] |
Since: 3.0
void ctk_theming_engine_get_background_color (CtkThemingEngine *engine,CtkStateFlags state,CdkRGBA *color);
ctk_theming_engine_get_background_color has been deprecated since version 3.14 and should not be used in newly-written code.
Gets the background color for a given state.
engine |
||
state |
state to retrieve the color for |
|
color |
return value for the background color. |
[out] |
Since: 3.0
void ctk_theming_engine_get_border_color (CtkThemingEngine *engine,CtkStateFlags state,CdkRGBA *color);
ctk_theming_engine_get_border_color has been deprecated since version 3.14 and should not be used in newly-written code.
Gets the border color for a given state.
engine |
||
state |
state to retrieve the color for |
|
color |
return value for the border color. |
[out] |
Since: 3.0
void ctk_theming_engine_get_border (CtkThemingEngine *engine,CtkStateFlags state,CtkBorder *border);
ctk_theming_engine_get_border has been deprecated since version 3.14 and should not be used in newly-written code.
Gets the border for a given state as a CtkBorder.
engine |
||
state |
state to retrieve the border for |
|
border |
return value for the border settings. |
[out] |
Since: 3.0
void ctk_theming_engine_get_padding (CtkThemingEngine *engine,CtkStateFlags state,CtkBorder *padding);
ctk_theming_engine_get_padding has been deprecated since version 3.14 and should not be used in newly-written code.
Gets the padding for a given state as a CtkBorder.
engine |
||
state |
state to retrieve the padding for |
|
padding |
return value for the padding settings. |
[out] |
Since: 3.0
void ctk_theming_engine_get_margin (CtkThemingEngine *engine,CtkStateFlags state,CtkBorder *margin);
ctk_theming_engine_get_margin has been deprecated since version 3.14 and should not be used in newly-written code.
Gets the margin for a given state as a CtkBorder.
engine |
||
state |
state to retrieve the border for |
|
margin |
return value for the margin settings. |
[out] |
Since: 3.0
const PangoFontDescription * ctk_theming_engine_get_font (CtkThemingEngine *engine,CtkStateFlags state);
ctk_theming_engine_get_font has been deprecated since version 3.8 and should not be used in newly-written code.
Returns the font description for a given state.
the PangoFontDescription for the given state. This object is owned by CTK+ and should not be freed.
[transfer none]
Since: 3.0
gboolean ctk_theming_engine_has_class (CtkThemingEngine *engine,const gchar *style_class);
ctk_theming_engine_has_class has been deprecated since version 3.14 and should not be used in newly-written code.
Returns TRUE if the currently rendered contents have
defined the given class name.
Since: 3.0
gboolean ctk_theming_engine_has_region (CtkThemingEngine *engine,const gchar *style_region,CtkRegionFlags *flags);
ctk_theming_engine_has_region has been deprecated since version 3.14 and should not be used in newly-written code.
Returns TRUE if the currently rendered contents have the
region defined. If flags_return
is not NULL, it is set
to the flags affecting the region.
engine |
||
style_region |
a region name |
|
flags |
return location for region flags. |
[out][allow-none] |
Since: 3.0
gboolean ctk_theming_engine_lookup_color (CtkThemingEngine *engine,const gchar *color_name,CdkRGBA *color);
ctk_theming_engine_lookup_color has been deprecated since version 3.14 and should not be used in newly-written code.
Looks up and resolves a color name in the current style’s color map.
engine |
||
color_name |
color name to lookup |
|
color |
Return location for the looked up color. |
[out] |
Since: 3.0
gboolean ctk_theming_engine_state_is_running (CtkThemingEngine *engine,CtkStateType state,gdouble *progress);
ctk_theming_engine_state_is_running has been deprecated since version 3.6 and should not be used in newly-written code.
Always returns FALSE
Returns TRUE if there is a transition animation running for the
current region (see ctk_style_context_push_animatable_region()).
If progress
is not NULL, the animation progress will be returned
there, 0.0 means the state is closest to being FALSE, while 1.0 means
it’s closest to being TRUE. This means transition animations will
run from 0 to 1 when state
is being set to TRUE and from 1 to 0 when
it’s being set to FALSE.
Since: 3.0
CtkThemingEngine *
ctk_theming_engine_load (const gchar *name);
ctk_theming_engine_load has been deprecated since version 3.14 and should not be used in newly-written code.
Loads and initializes a theming engine module from the standard directories.
void ctk_theming_engine_register_property (const gchar *name_space,CtkStylePropertyParser parse_func,GParamSpec *pspec);
ctk_theming_engine_register_property has been deprecated since version 3.8 and should not be used in newly-written code.
Code should use the default properties provided by CSS.
Registers a property so it can be used in the CSS file format,
on the CSS file the property will look like
"-${name_space
}-${property_name}". being
${property_name} the given to pspec
. name_space
will usually
be the theme engine name.
For any type a parse_func
may be provided, being this function
used for turning any property value (between “:” and “;”) in
CSS to the GValue needed. For basic types there is already
builtin parsing support, so NULL may be provided for these
cases.
Engines must ensure property registration happens exactly once, usually CTK+ deals with theming engines as singletons, so this should be guaranteed to happen once, but bear this in mind when creating CtkThemeEngines yourself.
In order to make use of the custom registered properties in the CSS file, make sure the engine is loaded first by specifying the engine property, either in a previous rule or within the same one.
1 2 3 4 |
* { engine: someengine; -SomeEngine-custom-property: 2; } |
[skip]
name_space |
namespace for the property name |
|
parse_func |
parsing function to use, or |
[nullable] |
pspec |
the GParamSpec for the new property |
Since: 3.0
struct CtkThemingEngineClass {
GObjectClass parent_class;
void (* render_line) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x0,
gdouble y0,
gdouble x1,
gdouble y1);
void (* render_background) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
void (* render_frame) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
void (* render_frame_gap) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
CtkPositionType gap_side,
gdouble xy0_gap,
gdouble xy1_gap);
void (* render_extension) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
CtkPositionType gap_side);
void (* render_check) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
void (* render_option) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
void (* render_arrow) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble angle,
gdouble x,
gdouble y,
gdouble size);
void (* render_expander) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
void (* render_focus) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
void (* render_layout) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
PangoLayout *layout);
void (* render_slider) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
CtkOrientation orientation);
void (* render_handle) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
void (* render_activity) (CtkThemingEngine *engine,
cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height);
GdkPixbuf * (* render_icon_pixbuf) (CtkThemingEngine *engine,
const CtkIconSource *source,
CtkIconSize size);
void (* render_icon) (CtkThemingEngine *engine,
cairo_t *cr,
GdkPixbuf *pixbuf,
gdouble x,
gdouble y);
void (* render_icon_surface) (CtkThemingEngine *engine,
cairo_t *cr,
cairo_surface_t *surface,
gdouble x,
gdouble y);
};
Base class for theming engines.
Renders a line between two points. |
||
Renders the background area of a widget region. |
||
Renders the frame around a widget area. |
||
Renders the frame around a widget area with a gap in it. |
||
Renders a extension to a box, usually a notebook tab. |
||
Renders a checkmark, as in CtkCheckButton. |
||
Renders an option, as in CtkRadioButton. |
||
Renders an arrow pointing to a certain direction. |
||
Renders an element what will expose/expand part of the UI, as in CtkExpander. |
||
Renders the focus indicator. |
||
Renders a PangoLayout |
||
Renders a slider control, as in CtkScale. |
||
Renders a handle to drag UI elements, as in CtkPaned. |
||
Renders an area displaying activity, such as in CtkSpinner, or CtkProgressBar. |
||
Renders an icon as a GdkPixbuf. |
||
Renders an icon given as a GdkPixbuf. |
||
Renders an icon given as a cairo_surface_t. |
“name” property “name” char *
The theming engine name, this name will be used when registering custom properties, for a theming engine named "Clearlooks" registering a "glossy" custom property, it could be referenced in the CSS file as
1 |
-Clearlooks-glossy: true; |
Owner: CtkThemingEngine
Flags: Read / Write / Construct Only
Default value: NULL
Since: 3.0