Commit Graph

22 Commits

Author SHA1 Message Date
Benjamin Otte
4f9a8e6b3d symboliccolor: Remove extra includes
That header was included in way too many places.
2012-11-25 02:59:15 +01: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
3a65fbfc13 cssvalue: Implement dependency tracking for gradients 2012-08-28 15:42:25 +02:00
Alexander Larsson
7603e6e473 css: Use GtkCssValues instead of GValue in the css machinery
Also, in places where we're computing a new CssValue based on an
old one, make sure that if nothing changes we're returning a reference
to the old one, rather than creating a new identical instance.
2012-03-08 11:03:57 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
aa98aca45f styleproperties: Remove color set function
Now that we do resolvage with the style context directly, this is no
longer needed.
2012-01-11 15:48:53 +01:00
Benjamin Otte
9181282d88 style: Remove GtkStylePropertyContext again
We need to solve this differently. I have no idea yet how, but I'll
invent something later.

This only affects win32 theming and that's broken anyway.
2012-01-09 18:37:56 +01:00
Benjamin Otte
544d210a61 css: Move a bunch of functions
... from GtkStyleProperty to GtkCssStyleProperty.
2012-01-09 18:37:52 +01:00
Benjamin Otte
4383701e25 styleproperty: unconstify
GtkStyleProperty is a real GObject now, so treat it like one and don't
use const.
2012-01-09 18:37:52 +01:00
Benjamin Otte
2573e72f49 styleproperties: Add _gtk_style_properties_peek_property() 2012-01-09 18:37:51 +01:00
Benjamin Otte
38e1c0a2d6 styleproperties: Remove unused function from private header
_gtk_style_properties_resolve_property() was added erroneously in
c09148ca09 but was never implemented.
2012-01-09 18:37:51 +01:00
Benjamin Otte
ba5e7012b1 css: Redo StyleProvider interface
We now use the GtkStleProviderPrivate interface, which hopefully is
faster and more conformant to CSS. Long term, it definitely should be
both.

I would have liked to split this up into multiple commits, but couldn't
find a way.
2012-01-09 18:37:50 +01:00
Benjamin Otte
38a9b28a0e styleproperties: Add a hacky function to redirect color lookups
This will soon be necessary.
FIXME: Make sure this gets removed again.
2012-01-09 18:37:49 +01:00
Alexander Larsson
7104b4b575 Remove _gtk_style_properties_peek_property
We want to move to a world where getting style properties can
allocate a new value, depending on the style property context.
In this world we can't expose "peeking" a property, as we neet
to return a ref to the property that is newly created.

So, we move the peek code into get_property and use get_property
from get_valist.
2011-11-17 12:27:22 +01:00
Alexander Larsson
c09148ca09 Add GtkStylePropertyContext and use it in when getting style properties
At the toplevel we have _gtk_theming_engine_get, which lets us pass
in a property context with (atm) the size to get the property for.
Then there is a lot of plumbing to push this down into the lower
layers of the style property code until finally hitting
the property resolvers.

I need this because I will be adding a property resolver for win32
theme parts, and they render differently depending on the size
(i.e. they don't scale linearly). The idea is that the code
to get the background properties will pass in the final size
and we will resolve the theme part specification to that particular
size.

If the old non-context calls are used we just hardcode a size
of 100x100.
2011-11-17 12:27:22 +01:00
Benjamin Otte
73c39f5b16 styleproperties: Add _gtk_style_properties_set_property_by_property()
... as a replacement for _gtk_style_properties_set_property_by_pspec().
We'll need that to handle shorthands.
2011-05-22 01:25:16 +02:00
Benjamin Otte
5f5cc79623 styleproperties: Adapt _gtk_style_properties_peek_property()
Optionally return the GtkStyleProperty that was looked up. This feature
isn't used yet, but will soon be.
2011-05-21 22:49:43 +02:00
Benjamin Otte
727a839d71 styleproperties: Move the style property handling code
... from gtkstyleproperties.c to gtkstyleproperty.c
2011-05-21 22:49:43 +02:00
Benjamin Otte
777a6846db styleproperties: Put gtk_style_property_lookup() in private header 2011-05-21 22:49:43 +02:00
Benjamin Otte
c1dc3e9372 css: Refactor code to do property lookups earlier
We want to ook up the property in the CSS parser, so we can do fancy
things with it. We currently don't but we want to later.
2011-05-18 22:17:57 +02:00
Benjamin Otte
3f491f7157 style: Move private function into private header
The function wasn't exported, so everybody using it would have gotten
linking failures.
2011-03-17 11:59:17 +01:00