Gtk.ThemingEngine¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
Theming engine name |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_object |
r |
Class Details¶
- class Gtk.ThemingEngine(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Gtk.ThemingEngine
was the object used for rendering themed content in GTK+ widgets. It used to allow overriding GTK+’s default implementation of rendering functions by allowing engines to be loaded as modules.Gtk.ThemingEngine
has been deprecated in GTK+ 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.- classmethod load(name)[source]¶
- Parameters:
name (
str
) – Theme engine name to load- Returns:
A theming engine, or
None
if the engine name doesn’t exist.- Return type:
Loads and initializes a theming engine module from the standard directories.
Deprecated since version 3.14.
- get_background_color(state)[source]¶
- Parameters:
state (
Gtk.StateFlags
) – state to retrieve the color for- Returns:
return value for the background color
- Return type:
color:
Gdk.RGBA
Gets the background color for a given state.
New in version 3.0.
Deprecated since version 3.14.
- get_border(state)[source]¶
- Parameters:
state (
Gtk.StateFlags
) – state to retrieve the border for- Returns:
return value for the border settings
- Return type:
border:
Gtk.Border
Gets the border for a given state as a
Gtk.Border
.New in version 3.0.
Deprecated since version 3.14.
- get_border_color(state)[source]¶
- Parameters:
state (
Gtk.StateFlags
) – state to retrieve the color for- Returns:
return value for the border color
- Return type:
color:
Gdk.RGBA
Gets the border color for a given state.
New in version 3.0.
Deprecated since version 3.14.
- get_color(state)[source]¶
- Parameters:
state (
Gtk.StateFlags
) – state to retrieve the color for- Returns:
return value for the foreground color
- Return type:
color:
Gdk.RGBA
Gets the foreground color for a given state.
New in version 3.0.
Deprecated since version 3.14.
- get_direction()[source]¶
- Returns:
the widget direction
- Return type:
Returns the widget direction used for rendering.
New in version 3.0.
Deprecated since version 3.8: Use
Gtk.ThemingEngine.get_state
() and check forGtk.StateFlags.DIR_LTR
andGtk.StateFlags.DIR_RTL
instead.
- get_font(state)[source]¶
- Parameters:
state (
Gtk.StateFlags
) – state to retrieve the font for- Returns:
the
Pango.FontDescription
for the given state. This object is owned by GTK+ and should not be freed.- Return type:
Returns the font description for a given state.
New in version 3.0.
Deprecated since version 3.8: Use gtk_theming_engine_get()
- get_junction_sides()[source]¶
- Returns:
the widget direction
- Return type:
Returns the widget direction used for rendering.
New in version 3.0.
Deprecated since version 3.14.
- get_margin(state)[source]¶
- Parameters:
state (
Gtk.StateFlags
) – state to retrieve the border for- Returns:
return value for the margin settings
- Return type:
margin:
Gtk.Border
Gets the margin for a given state as a
Gtk.Border
.New in version 3.0.
Deprecated since version 3.14.
- get_padding(state)[source]¶
- Parameters:
state (
Gtk.StateFlags
) – state to retrieve the padding for- Returns:
return value for the padding settings
- Return type:
padding:
Gtk.Border
Gets the padding for a given state as a
Gtk.Border
.New in version 3.0.
Deprecated since version 3.14.
- get_path()[source]¶
- Returns:
- Return type:
Returns the widget path used for style matching.
New in version 3.0.
Deprecated since version 3.14.
- get_property(property, state)[source]¶
- Parameters:
property (
str
) – the property namestate (
Gtk.StateFlags
) – state to retrieve the value for
- Returns:
return location for the property value, you must free this memory using
GObject.Value.unset
() once you are done with it.- Return type:
value:
GObject.Value
Gets a property value as retrieved from the style settings that apply to the currently rendered element.
New in version 3.0.
Deprecated since version 3.14.
- get_screen()[source]¶
- Returns:
a
Gdk.Screen
, orNone
.- Return type:
Gdk.Screen
orNone
Returns the
Gdk.Screen
to which self currently rendering to.Deprecated since version 3.14.
- get_state()[source]¶
- Returns:
the state flags
- Return type:
returns the state used when rendering.
New in version 3.0.
Deprecated since version 3.14.
- get_style_property(property_name)[source]¶
- Parameters:
property_name (
str
) – the name of the widget style property- Returns:
Return location for the property value, free with
GObject.Value.unset
() after use.- Return type:
value:
GObject.Value
Gets the value for a widget style property.
New in version 3.0.
Deprecated since version 3.14.
- has_class(style_class)[source]¶
- Parameters:
style_class (
str
) – class name to look up- Returns:
True
if self has class_name defined- Return type:
Returns
True
if the currently rendered contents have defined the given class name.New in version 3.0.
Deprecated since version 3.14.
- has_region(style_region)[source]¶
- Parameters:
style_region (
str
) – a region name- Returns:
True
if region is defined- flags:
return location for region flags
- Return type:
(
bool
, flags:Gtk.RegionFlags
)
Returns
True
if the currently rendered contents have the region defined. If flags_return is notNone
, it is set to the flags affecting the region.New in version 3.0.
Deprecated since version 3.14.
- lookup_color(color_name)[source]¶
- Parameters:
color_name (
str
) – color name to lookup- Returns:
True
if color_name was found and resolved,False
otherwise- color:
Return location for the looked up color
- Return type:
Looks up and resolves a color name in the current style’s color map.
New in version 3.0.
Deprecated since version 3.14.
- state_is_running(state)[source]¶
- Parameters:
state (
Gtk.StateType
) – a widget state- Returns:
True
if there is a running transition animation for state.- progress:
return location for the transition progress
- Return type:
Returns
True
if there is a transition animation running for the current region (seeGtk.StyleContext.push_animatable_region
()).If progress is not
None
, the animation progress will be returned there, 0.0 means the state is closest to beingFalse
, while 1.0 means it’s closest to beingTrue
. This means transition animations will run from 0 to 1 when state is being set toTrue
and from 1 to 0 when it’s being set toFalse
.New in version 3.0.
Deprecated since version 3.6: Always returns
False
- do_render_activity(cr, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –
Renders an area displaying activity, such as in
Gtk.Spinner
, orGtk.ProgressBar
.
- do_render_arrow(cr, angle, x, y, size) virtual¶
- Parameters:
cr (
cairo.Context
) –angle (
float
) –x (
float
) –y (
float
) –size (
float
) –
Renders an arrow pointing to a certain direction.
- do_render_background(cr, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –
Renders the background area of a widget region.
- do_render_check(cr, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –
Renders a checkmark, as in
Gtk.CheckButton
.
- do_render_expander(cr, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –
Renders an element what will expose/expand part of the UI, as in
Gtk.Expander
.
- do_render_extension(cr, x, y, width, height, gap_side) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –gap_side (
Gtk.PositionType
) –
Renders a extension to a box, usually a notebook tab.
- do_render_focus(cr, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –
Renders the focus indicator.
- do_render_frame(cr, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –
Renders the frame around a widget area.
- do_render_frame_gap(cr, x, y, width, height, gap_side, xy0_gap, xy1_gap) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –gap_side (
Gtk.PositionType
) –xy0_gap (
float
) –xy1_gap (
float
) –
Renders the frame around a widget area with a gap in it.
- do_render_handle(cr, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –
Renders a handle to drag UI elements, as in
Gtk.Paned
.
- do_render_icon(cr, pixbuf, x, y) virtual¶
- Parameters:
cr (
cairo.Context
) –pixbuf (
GdkPixbuf.Pixbuf
) –x (
float
) –y (
float
) –
Renders an icon given as a
GdkPixbuf.Pixbuf
.
- do_render_icon_surface(cr, surface, x, y) virtual¶
- Parameters:
cr (
cairo.Context
) –surface (
cairo.Surface
) –x (
float
) –y (
float
) –
Renders an icon given as a
cairo.Surface
.
- do_render_layout(cr, x, y, layout) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –layout (
Pango.Layout
) –
Renders a
Pango.Layout
- do_render_line(cr, x0, y0, x1, y1) virtual¶
- Parameters:
cr (
cairo.Context
) –x0 (
float
) –y0 (
float
) –x1 (
float
) –y1 (
float
) –
Renders a line between two points.
- do_render_option(cr, x, y, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –
Renders an option, as in
Gtk.RadioButton
.
- do_render_slider(cr, x, y, width, height, orientation) virtual¶
- Parameters:
cr (
cairo.Context
) –x (
float
) –y (
float
) –width (
float
) –height (
float
) –orientation (
Gtk.Orientation
) –
Renders a slider control, as in
Gtk.Scale
.
Property Details¶
- Gtk.ThemingEngine.props.name¶
- Name:
name
- Type:
- Default Value:
- Flags:
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
-Clearlooks-glossy: true;
New in version 3.0.