Commit Graph

20 Commits

Author SHA1 Message Date
Matthias Clasen
e7a266ad95 css color: Use gtk_internal_return_if_fail 2015-09-08 08:07:33 -04:00
Benjamin Otte
da25771e58 cssvalue: Remove GtkCssDependencies
They are not used anymore.
2015-03-18 15:23:31 +01:00
Benjamin Otte
1116914ea0 css: Move scale to GtkStyleProviderPrivate
This way, we can remove it as a separate argument from
gtk_css_value_compute() and allow computation to only depend on one
thing: the style provider.
2015-02-06 11:26:31 +01:00
Benjamin Otte
572f46067f cssstyle: Rename GtkCssComputedValues => GtkCssStyle
This is literally just renaming of the object (and the associated source
files). No other changes are in there.
2015-01-07 14:26:46 +01:00
Benjamin Otte
ec8a29b0c2 css: Remove unneeded header 2014-10-24 21:31:39 +02:00
Benjamin Otte
e6e99c4f9f css: Change currentColor handling
We now pass NULL when the current color should be the default value of
the "color" property and we haven't looked up any value yet. This way we
don't need to look it up all the time and more importantly we can
resolve the default color, which is required because it's a
GtkCssColorValue and not a GtkCssRgbaValue.

Fixes assertions triggering at Polari startup.
2013-09-06 03:04:09 +02:00
Alexander Larsson
af2c40bd54 css: Add a scale argument to css-value compute vfunc
We need to be able to compute different GtkCssImage values
depending on the scale, and we need this at compute time so that
we don't need to read any images other than the scale in used (to
e.g. calculate the image size). GtkStyleProviderPrivate is shared
for all style contexts, so its not right.
2013-07-03 14:39:25 +02:00
Benjamin Otte
cbee390148 cssvalue: At cycle detection to color resolving
The following CSS would infloop:

@define-color self @self

as it would infinitely lookup the color named "self" and try to resolve
it. This patch adds detection of such cycles to the resolve function by
keeping a list of currently resolving colors in the cycle_list variable.
2013-03-28 23:18:59 +01:00
Benjamin Otte
c25d8e3aea cssvalue: Handle named colors not resolving
If a named color references a nonexistant named color, we didn't catch
that error and ended up crashing on a NULL-dereference.
This crashed Boxes, because its CSS referenced values from the theme
that didn't exist in any theme.
2013-03-28 23:18:59 +01:00
Benjamin Otte
a763738f15 cssvalue: Remove NULL check
The value cannot ever be NULL here.
2013-01-15 15:33:53 +01:00
Benjamin Otte
301e22121a cssvalue: Move value initialization
Makes it easier to track places where tha value is not initialized.
2013-01-15 15:31:59 +01:00
Benjamin Otte
b60478bb49 cssvalue: Fix return_if_fail() calls... 2013-01-15 15:29:23 +01:00
Benjamin Otte
993e3f715f cssvalue: Remove useless call 2013-01-15 15:24:04 +01:00
Benjamin Otte
41486895d5 deprecations: Move files into deprecated/ dir 2012-11-25 04:16:43 +01:00
Benjamin Otte
9aac4dffc5 hsla: Add _gtk_hsla_shade()
We use it in multiple places, so better split it out.
2012-11-25 03:25:15 +01:00
Benjamin Otte
42dc0ea0fd styleprovider: Change function prototype
Make _gtk_style_provider_private_get_color() return a GtkCssValue (a
GtkCssColorValue to be exact) instead of GtkSymbolicColor.

With this, the symbolic color usage inside GTK is minimized.
2012-11-25 02:45:10 +01:00
Benjamin Otte
08ac1504d2 symboliccolor: Implement using GtkCssValue 2012-11-25 02:41:17 +01:00
Benjamin Otte
e5948f5713 cssvalue: Fix copy/paste error
Introduced in e3f407a7.
2012-11-20 12:11:07 +01:00
Benjamin Otte
aae2bf91cb cssvalue: Make shade() work properly again
In a previous commit, I accidentally scaled the hue instead of the
saturation. Ooops.
2012-11-10 14:25:18 +01:00
Benjamin Otte
e3f407a71d cssvalue: Add GtkCssColorValue
This is mostly copy/paste from GtkSymbolicColor and is indeed intended
to replace it.
2012-11-08 23:34:06 +01:00