summaryrefslogtreecommitdiff
path: root/gtk/gtkcsspositionvalue.c
Commit message (Collapse)AuthorAgeFilesLines
* css: Add gtk_css_number_value_can_parse()Benjamin Otte2016-02-131-2/+2
| | | | | | Use it instead of _gtk_css_parser_has_number(). We need that once we introduce calc() support.
* cssvalue: Remove GtkCssDependenciesBenjamin Otte2015-03-181-6/+3
| | | | They are not used anymore.
* css: Move scale to GtkStyleProviderPrivatewip/mir2Benjamin Otte2015-02-061-5/+4
| | | | | | 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.
* cssstyle: Rename GtkCssComputedValues => GtkCssStyleBenjamin Otte2015-01-071-2/+2
| | | | | This is literally just renaming of the object (and the associated source files). No other changes are in there.
* css: Add a scale argument to css-value compute vfuncAlexander Larsson2013-07-031-2/+3
| | | | | | | | 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.
* Fix css parser testsMatthias Clasen2012-10-161-5/+20
| | | | | | | Parsing a shorthand background property was running into unexpected errors when trying position values where there were none. To fix this, introduce a try_parse variant of the position parse function that silently returns NULL.
* cssvalue: Print an error when failing to parse background-positionBenjamin Otte2012-10-121-1/+4
| | | | ... in the case where a completely invalid value was used.
* css: Huge refactoring to avoid computing wrong valuesBenjamin Otte2012-09-281-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cssvalue: Pass property ID to transition functionBenjamin Otte2012-09-031-2/+3
| | | | | | | This is to allow animating arrays properly. I'm not really thrilled about this solution (we leak propertys into the values again...), but it's the best I can come up with - I prefer it to having N different array types...
* cssvalue: First step of proper dependency trackingBenjamin Otte2012-08-281-4/+4
| | | | | Instead of using the EVERYTHING aka FIXME value for tdependencies, actually compute the dependencies in a bunch of simple cases.
* css: Introduce dependencies for value computationsBenjamin Otte2012-08-281-5/+8
| | | | | | | | | When values are computed, they might depend on various other values and we need to track this so we can update the values when those other values change. This is the first step in making that happen. This patch does not do any dependency tracking at all, instead it uses GTK_CSS_DEPENDS_ON_EVERYTHING as a sort of FIXME.
* css: Pass property_id to compute functionBenjamin Otte2012-08-281-2/+3
| | | | | | | | | | | | | | | | 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.
* css: Introduce _gtk_css_value_compute()Benjamin Otte2012-08-281-20/+19
| | | | | | | This commit is essentially a large reorganization. Instead of all value subtypes having their own compute function, there is the general _gtk_css_value_compute() function that then calls a vfunc on the subtype.
* csspositionvalue: make empty error value non fatalCosimo Cecchi2012-05-151-6/+12
| | | | | If there's just no value to parse (e.g. because we're parsing a shorthand property), don't error out while trying to parse a number.
* cssvalue: Add a custom value for repeatsBenjamin Otte2012-04-171-6/+0
| | | | | | In particular, that's background-repeat and border-image-repeat. Also, fix up the border-image shorthand to allow any order.
* cssvalue: Add a value for background-positionBenjamin Otte2012-04-171-0/+292