The function was not selector-specific, so putting it with all the other
utility functions makes more sense.
Also use the utility function in the node declaration printing.
We want to differentiate what requires recreating the
texture and what doesn't. In particular, the current
flags are not handling symbolic icons right.
The idea is that this reduce the amount of frequently
changing state that css nodes are sensitive to.
This is going to reduce the amount of style recomputation.
This avoids invalidating the size of all widgets when updating CSS
transforms.
In theory, we don't even have to allocate the widget itself, because we
didn't change its size. But we have no way to track that.
Now that queue_draw() isn't restricted to clip anymore, we don't need to
care about clip in the CSS engine either.
We do keep GTK_CSS_AFFECTS_CLIP around though because GtkWindow does
care for the window's size.
This is just lots of renaming.
The interface remains private, so the public API does not change, apart
from removing the definition of the Interface object to avoid
subclassing.
It was used to mark css properties that affect widgets with text, but it
caused unnecessary invalidations. E.g. 'color' was marked as
AFFECTS_TEXT but changing just the color of a label should not
automatically queue a resize, which is what the code in
gtk_widget_real_style_updated does.
Replace this flag with GTK_CSS_AFFECTS_TEXT_SIZE and
GTK_CSS_AFFECTS_TEXT_CLIP, which GtkWidget can use only if the widget
actually has text.
As Benjamin says, ident should only be used if any value
is valid, which is not the case here. So use enums instead,
which should also be more efficient. To handle the more
complicated cases like font-variant-ligatures, we have to
introduce flags-like values.
Drop the current css2-style font-variant property and
replace it with a shorthand as specified in the css3 fonts
module. Currently, we fully support the font-variant-ligatures,
font-variant-position, font-variant-caps, font-variant-numeric
and font-variant-east-asian subproperties. font-variant-alternatives
is only partially supported.
We now have GTK_CSS_AFFECTS_CONTENT for properties that have an effect
on content rendering.
Using GTK_CSS_AFFECTS_ICON is wrong for icon-transform and icon-filter
as they don't change the icon, just how the icon is rendered, so we use
GTK_CSS_AFFECTS_CONTENT for those.
We also introduce GTK_CSS_AFFECTS_POSTEFFECT for opacity and filter -
properties that affect the whole drawing of the widget by applying an
effect after everything is said and done.
It's using a GtkCssPositionValue, even though that name is wrong. But
the functionality of managing 2 lengths is exactly what we want.
Nobody is using this yet.
Grips have long been unused in GTK, so remove all support for them.
This removes the GTK_STYLE_CLASS_GRIP and the special
gtk_render_handle() code for drawing those grips.
CSS supports blend modes, in which a series of layers are
merged together according to the given operation or set of
operations.
Support for blend modes landed on Cairo, which exposes all
the commons and also the exquisites blend modes available.
Adding support for blend modes, then, is just a matter of
using the available Cairo operations.
This patch adds the background-blend-mode CSS enum property,
and adapts the background rendering code to blend the backgrounds
using the available blend modes when they're set.
https://bugzilla.gnome.org/show_bug.cgi?id=768305
This is in preparation for calc(), as calc(50% - 5px) is valid CSS
but has 2 units. Instead, add a function to query a value's dimension
(so we can differentiate lengths from numbers) and add a function to
query if the value contains percentages.