summaryrefslogtreecommitdiff
path: root/gtk/gtkcssvalue.c
Commit message (Collapse)AuthorAgeFilesLines
* css: Implement transitions for numbers of different unitsBenjamin Otte2016-02-131-1/+3
| | | | | | | We now can transition from 10px to 100%. Note that this requires a teensy tiny hack in gtk_css_value_transition(), but so be it.
* Fix a commentMatthias Clasen2015-12-281-2/+2
|
* css value: No need for atomic refcountingMatthias Clasen2015-09-121-2/+3
| | | | We are all in one thread anyway.
* cssvalue: Remove GtkCssDependenciesBenjamin Otte2015-03-181-11/+2
| | | | They are not used anymore.
* css: Move scale to GtkStyleProviderPrivatewip/mir2Benjamin Otte2015-02-061-6/+5
| | | | | | 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-5/+5
| | | | | This is literally just renaming of the object (and the associated source files). No other changes are in there.
* docs: don't use ulink. use markdown insteadWilliam Jon McCann2014-02-041-3/+2
|
* css: Add a scale argument to css-value compute vfuncAlexander Larsson2013-07-031-1/+2
| | | | | | | | 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.
* css: Use internal return_if_fail in some commonly called codeAlexander Larsson2012-12-041-12/+13
| | | | | | These are internal apis, and any external issues should have been caught by checks at public API points. We use the internal checks here because these checks show up in a non-neglible way on profiles.
* css: Huge refactoring to avoid computing wrong valuesBenjamin Otte2012-09-281-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Always consider values equal to themselvesBenjamin Otte2012-09-171-1/+5
|
* cssvalue: Pass property ID to transition functionBenjamin Otte2012-09-031-1/+2
| | | | | | | 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...
* css: Introduce dependencies for value computationsBenjamin Otte2012-08-281-5/+15
| | | | | | | | | 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.
* cssstyleproperty: Get rid of unused APIBenjamin Otte2012-08-281-0/+23
| | | | | | | Both _gtk_css_style_property_print_value() and _gtk_css_style_property_compute_value() aren't necessary anymore and are replaced by _gtk_css_value_print() and _gtk_css_value_comptue() respectively.
* css: Pass property_id to compute functionBenjamin Otte2012-08-281-1/+2
| | | | | | | | | | | | | | | | 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-0/+10
| | | | | | | 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.
* cssvalue: Split out old value handling to new typed valueBenjamin Otte2012-04-171-401/+1
| | | | | | | ... and Make this new value be a real GValue, as we don't need to save performance for these anymore (it's just used for custom properties). And I'd rather have code work for all values then be optimized for no reason.
* cssvalue: Add a border valueBenjamin Otte2012-04-171-0/+13
| | | | .. and parse border-image-slice with it.
* cssvalue: Add a cssvalue for background-sizeBenjamin Otte2012-04-171-18/+0
|
* cssvalue: Add a custom value for repeatsBenjamin Otte2012-04-171-18/+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-18/+0
|
* cssvalue: Add a css value for enginesBenjamin Otte2012-04-171-11/+0
|
* cssvalue: Add a value for border-radius corner propertiesBenjamin Otte2012-04-171-18/+0
| | | | ... and convert those properties to this value.
* cssvalue: Add _gtk_css_value_to_string()Benjamin Otte2012-04-171-0/+12
| | | | | This is a tiny wrapper around _gtk_css_value_print(). It's intended for usage in gdb and printf debugging.
* cssvalue: Add _gtk_css_value_transition()Benjamin Otte2012-04-171-0/+23
| | | | | | | Returns a value that transitions between start and end or %NULL if the values cannot be transitioned. So far, all implementations but numbers and rgba return NULL.
* cssvalue: Do a hacky conversion of font-size to a number valueBenjamin Otte2012-04-171-18/+0
| | | | | | Just store the value as px for now. The font-size property needs a complete makeover anyway.
* cssvalue: Add a custom value for stringsBenjamin Otte2012-04-171-18/+0
|
* cssvalue: Add a cssvalue for imagesBenjamin Otte2012-04-171-18/+0
|
* cssvalue: Add enum values for the pango enumsBenjamin Otte2012-04-171-21/+0
| | | | And fix the parser to conform to the CSS spec while at it.
* cssvalue: Add a custom RGBA valueBenjamin Otte2012-04-171-18/+5
| | | | | | | Note: custom CSS properties still use the default GtkCssValue and always will. So there is a difference in css values used between those, even though they both carry a GdkRGBA payload.
* cssvalue: Remove unused functionBenjamin Otte2012-04-171-7/+0
|
* shadow: Make this a GtkCssValueBenjamin Otte2012-04-171-17/+0
|
* cssvalue: Split number values into their own classBenjamin Otte2012-04-171-52/+0
|
* styleproperty: Make gtk_style_property_register() not be valistBenjamin Otte2012-04-171-0/+36
| | | | Instead, make the caller create a GtkCssValue in advance.
* cssvalue: Add _gtk_css_value_equal()Benjamin Otte2012-04-171-0/+21
| | | | | | | | | | | | | | | | For now, we return FALSE for all default css values, so this is not very useful. I also think of this as an optimization equal, not a guaranteed equal, because we don't even have a notion of what "equal" means. For example, for background-repeat, "repeat, repeat" and "repeat" are functionally equivalent. But the cssvalue has no idea that it's used for background-repeat. As a more complicated example, "repeat, no-repeat" and "repeat" are equal to what one sees as long as there's only one image listed background-image-source. But once you start transition'ing to an image with 2 sources, it's different...
* styleproperty: Make _gtk_style_property_parse_value() return a CssValueBenjamin Otte2012-04-171-13/+69
| | | | Also split out initial/inherit handling into a custom GtkCssValue class.
* cssvalue: Remove _gtk_css_value_new_take_gvalue()Benjamin Otte2012-04-171-57/+0
| | | | | Having two constructors from GValues complicates refactorings, so I'd rather not have them.
* cssvalue: Get rid of unused functionsBenjamin Otte2012-04-171-40/+0
|
* styleproperty: Make print_func take a GtkCssValueBenjamin Otte2012-04-171-33/+62
| | | | | Also, constify GtkCssValue getters, so we can pass a const GtkCssValue to the print_func.
* cssvalue: Make the structure vtable-basedBenjamin Otte2012-04-171-60/+82
| | | | Don't use real classes, just a vtable.
* cssvalue: Constify a bunch of APIsBenjamin Otte2012-04-171-6/+6
|
* cssvalue: Remove unused functionsBenjamin Otte2012-04-171-30/+0
|
* cssvalue: Re-add support for random value typesBenjamin Otte2012-04-091-7/+41
| | | | | This got lost in the CssValue transition, and apparently some people use this.
* css: Support GtkBackgroundPosition in cssvalueAlexander Larsson2012-03-171-0/+18
|
* Add some more types to GtkCssValueAlexander Larsson2012-03-081-0/+20
| | | | | Seems these types were used in the parser tests, so we need to handle them.
* Don't use GValue in GtkCssValueAlexander Larsson2012-03-081-91/+163
| | | | | | We now have complete coverage in the GtkCssValue API for type handling, so drop the GValue from internal storage and just create new ones when needed.
* Add singletons for small ints and numbersAlexander Larsson2012-03-081-5/+81
| | | | | | These represents the majority of int values in use (thousands in use in a simple app). There is no need to keep multiple instances of these around.
* css: Add GtkCssValue, an immutable refcounted css valueAlexander Larsson2012-03-081-0/+467