Commit Graph

18 Commits

Author SHA1 Message Date
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
41486895d5 deprecations: Move files into deprecated/ dir 2012-11-25 04:16:43 +01:00
Benjamin Otte
fb643c1c12 symboliccolor: Deprecate
Symbolic colors are an implementation detail of the CSS engine and have
been superceded by GtkCssColorValue. We don't want them clobbering the
public API. In particular because the only use I could find in the
public API is people using it to shade colors.
2012-11-25 03:43:28 +01:00
Benjamin Otte
94b80cc774 symboliccolor: Change prototype of function
Makes it easier to use the function in the places where it's still used.
2012-11-24 21:56:47 +01:00
Benjamin Otte
e9dc0e391d cssimage: Fix huge memleak
When transitioning gradients, we were leaking the gradient structs. Not
good.

https://bugzilla.gnome.org/show_bug.cgi?id=687467
2012-11-06 18:04:10 +01:00
Cosimo Cecchi
9876fc4f17 css: Fix copy/paste error
Benjamin replaced start with end in a bunch of locations, but not all of
them apparently.
2012-11-06 18:04:10 +01:00
Benjamin Otte
12683da8f7 gtk: Make functions static that don't need to be non-static
Also remove the starting underscore from function names where
appropriate, as those functions are static now and not exported anymore.

This is part of a bunch of fixes for gcc complaining about
-Wmissing-declarations.
2012-10-02 19:32:51 +02:00
Benjamin Otte
4f6a55d689 cssimage: Implement proper cross-fades for gradients
This is intended mainly to speed up the current situation with spinners
on debug kernels. Because we now don't use a cross-fade to draw the
transition but instead have a real gradient that we draw, we don't need
to use the slow cross-fade code.

https://bugzilla.gnome.org/show_bug.cgi?id=684639
2012-10-02 14:16:37 +02:00
Benjamin Otte
046d004725 gradient: Add a private header file 2012-10-02 14:16:36 +02:00
Benjamin Otte
1454ba15ba css: Huge refactoring to avoid computing wrong values
Here's the shortest description of the bug I can come up with:
When computing values, we have 3 kinds of dependencies:
(1) other properties ("currentColor" or em values)
(2) inherited properties ("inherit")
(3) generic things from the theme (@keyframes or @define-color)
Previously, we passed the GtkStyleContext as an argument, because it
provided these 3 things using:
(1) _gtk_style_context_peek_property()
(2) _gtk_style_context_peek_property(gtk_style_context_get_parent())
(3) context->priv->cascade

However, this makes it impossible to lookup values other than the ones
accessible via _gtk_style_context_peek_property(). And this is exactly
what we are doing in gtk_style_context_update_cache(). So when the cache
updates encountered case (1), they were looking up the values from the
wrong style data.

So this large patch essentially does nothing but replace the
context argument in all compute functions with new arguments for the 3
cases above:
(1) values
(2) parent_values
(3) provider

We apparently have a lot of computing code.
2012-09-28 18:27:49 +02:00
Benjamin Otte
8c3caae33f cssimage: Add a hack to get antialiased circles
We like to draw circles in themes, and as radial gradients are the only
okayish way to do that, at least make them antialiased.
2012-09-18 13:26:20 +02:00
Benjamin Otte
e1a1432bd3 cssimage: Implement dependencies for images 2012-08-28 15:42:25 +02:00
Benjamin Otte
9b4ed66218 css: Pass property_id to compute function
This is a reorganization of how value computing should be done.
Previously the GtkCssStyleProperty.compute vfunc was supposed to take
care of special cases when it needed those for computation. However,
this proved to be very complicated in cases where values were nested and
only the last value (of a common type) needed to be special cased.

A common example for this was the fallback handling for unresolvable
colors.

Now, we pass the property's ID along with all compute functions so we
can do the special casing where it's necessary.
Note that no actual changes happen in this commit. This will happen in
follow-ups.
2012-08-28 15:40:56 +02:00
Benjamin Otte
c9f01ffb43 cssimage: No need to pass base file anymore
The file is now part of the GtkCssParser
2012-05-11 16:42:12 +02:00
Benjamin Otte
0111b9d507 symboliccolor: Treat it as a CssValue
.. now that it is one.
2012-04-17 08:59:20 +02:00
Benjamin Otte
1223d53a82 cssparser: Move symbolic color parser to gtksymboliccolor.c 2012-04-17 08:59:19 +02:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
f7eea0b86e cssimage: Add GtkCssImageGradient 2012-01-09 18:37:56 +01:00