summaryrefslogtreecommitdiff
path: root/gtk/gtkcssenumvalue.c
Commit message (Collapse)AuthorAgeFilesLines
* css: Replace custom blend modes with GskBlendModeBenjamin Otte2016-12-201-19/+19
|
* Revert a mistaken changeMatthias Clasen2016-07-261-2/+2
| | | | | | I thought I needed ot rearrange the ordering of the animation-direction values for the parser, overlooking the fact that we already parse them backwards to address this very problem.
* Fix parsing of some css propertiesMatthias Clasen2016-07-031-3/+3
| | | | | | | | | | | Our property parser stops at the first match when looking for enums, so we need to order our values so that we don't end up with prefixes of longer names being found first. I noticed this when the parser tried to interpret background-blend-mode: color-burn; as "color, with junk at the end". It also affects animation-direction, which is also fixed here.
* css: add background-blend-mode supportGeorges Basile Stavracas Neto2016-07-031-0/+61
| | | | | | | | | | | | | | | | | CSS supports blend modes, in which a series of layers are merged together according to the given operation or set of operations. Support for blend modes landed on Cairo, which exposes all the commons and also the exquisites blend modes available. Adding support for blend modes, then, is just a matter of using the available Cairo operations. This patch adds the background-blend-mode CSS enum property, and adapts the background rendering code to blend the backgrounds using the available blend modes when they're set. https://bugzilla.gnome.org/show_bug.cgi?id=768305
* Fix the buildMatthias Clasen2016-05-011-1/+1
| | | | I forgot to add an include here.
* css: Use setters for font size and familyMatthias Clasen2016-05-011-18/+7
| | | | | This avoid creating pango font descriptions all the time, when the gtk-font-name setting hasn't actually changed.
* css: always get default font size in pixelsMatt Watson2016-04-121-15/+26
| | | | | | | | | | | | | | | Fixes a couple bugs... - Pixel font sizes in css would render as point sizes. - For em font sizes, where the parent size was set and not default, we would incorrectly convert a pixel value from points to pixels. We'll always grab the default font size in pixels so we don't keep confusing things. Worth noting that gtk css font-size will still behave differently than the web. Pango interprets font-size differently.
* Fix parsing of font-weightMatthias Clasen2015-12-201-2/+2
| | | | The parser was turning a 400 into a 200 and a 700 into a 500.
* css: Leftover renaming gtk-image-effect => icon-effectBenjamin Otte2015-12-041-5/+5
| | | | The previous renaming commit was incomplete, so here we go again.
* render: Split out icon-effect apply functionBenjamin Otte2015-12-041-0/+33
|
* css: Rename -gtk-image-effect to -gtk-icon-effectBenjamin Otte2015-12-021-9/+9
| | | | This is a property for icons, so we should name it as such.
* css: support text-decoration-stylePaolo Borelli2015-07-061-2/+52
| | | | | The support is limited to underline single, double and wavy, which is what pango has today.
* css: add support for text-decoration-linePaolo Borelli2015-07-061-0/+46
|
* css: Silence a clang warningMatthias Clasen2015-03-221-1/+1
| | | | | | Clang complains that this check can never be true. Since this is a argument range check which we do to catch bad input, convince clang to not complain instead of taking it out.
* cssvalue: Remove GtkCssDependenciesBenjamin Otte2015-03-181-10/+3
| | | | They are not used anymore.
* css: Implement animations for font-weight propertyBenjamin Otte2015-02-161-1/+17
|
* css: Implement "bolder" and "lighter" font weightsBenjamin Otte2015-02-161-2/+58
|
* css: Move scale to GtkStyleProviderPrivatewip/mir2Benjamin Otte2015-02-061-10/+8
| | | | | | 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-7/+7
| | | | | This is literally just renaming of the object (and the associated source files). No other changes are in there.
* css: Implement font-stretchEmmanuele Bassi2014-08-281-0/+54
| | | | | | | | | | | | | | The font-stretch CSS property is defined in the Level 3 CSS Fonts module, available at: http://dev.w3.org/csswg/css-fonts/#propdef-font-stretch It allows defining a normal, condensed, or expanded face to the font description. Pango already supports it, so this is literally just the CSS parser machinery needed to bridge our CSS to the FontDescription API. https://bugzilla.gnome.org/show_bug.cgi?id=735593
* css: Fix animation-direction parsingBenjamin Otte2014-07-071-2/+5
| | | | | We were parsig "alternate-reverse" as "alternate" and then complaining about the "-reverse" junk at the end of the value.
* Revert "Fix crash"Benjamin Otte2014-05-221-1/+0
| | | | | | This reverts commit 024c11dd66dfda5efb110f55ecec93801f21c0ed. It's not a crash fix to cause a return_val_if_fail() to happen.
* Fix crashBehdad Esfahbod2014-05-221-0/+1
|
* css: Add a -gtk-icon-style propertyBenjamin Otte2014-05-141-0/+54
| | | | | | | | | | | | | The values can be: "requested" - the style as requested "regular" - use a regular full-color icon "symbolic" - use a symbolic icon The property defaults to "requested", so no changes should be seen unless CSS overrides it. It is also inherited, so that using this CSS .toolbar { -gtk-icon-style: symbolic; } is enough to force the whole toolbar to use symbolic icons.
* css: Add a GtkCssValue for GtkCssImageEffectCosimo Cecchi2013-08-201-0/+53
| | | | | | | This will allow us to use the CSS machinery to apply a highlight or dim effect when images are prelit or insensitive. https://bugzilla.gnome.org/show_bug.cgi?id=705443
* css: Add a scale argument to css-value compute vfuncAlexander Larsson2013-07-031-0/+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.
* cssvalue: Fix the scaling factors for 'smaller' and 'larger'Benjamin Otte2012-12-011-2/+2
| | | | They were reversed. Looks like a bad case of copy/paste failure.
* cssvalue: Parse font sizes properlyBenjamin Otte2012-12-011-11/+11
| | | | | As the last CSS property, font-size now is a proper number (when it's not a keyword).
* cssvalue: Change order of valuesBenjamin Otte2012-12-011-3/+3
| | | | | This is necessary so that the (rather stupid) parsing code doesn't parse "small" and then is happy when it should instead parse "smaller".
* css: Fix dependencies for font lookupBenjamin Otte2012-12-011-0/+2
| | | | 'larger' and 'smaller' depend on the parent value. D'oh.
* css: Add more features to font-size codeBenjamin Otte2012-12-011-1/+146
| | | | | | | | We now support the keywords (like xx-small, medium, larger, smaller...) and I've changed the default value to be "medium". This required some shuffling of the "get default font size" code. But all is well now.
* css: Huge refactoring to avoid computing wrong valuesBenjamin Otte2012-09-281-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add animation enum propertiesBenjamin Otte2012-09-171-0/+163
|
* cssvalue: Pass property ID to transition functionBenjamin Otte2012-09-031-0/+1
| | | | | | | 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-3/+4
| | | | | | | | | 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-0/+1
| | | | | | | | | | | | | | | | 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/+12
| | | | | | | 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.
* Deal with non-multiple-of-100 font weightsMatthias Clasen2012-06-011-1/+4
| | | | We should not run into an assertion so easily.
* cssvalue: Add _gtk_css_value_transition()Benjamin Otte2012-04-171-0/+13
| | | | | | | 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: Add GtkCssArea to the enum valuesBenjamin Otte2012-04-171-0/+52
| | | | | | | ... and get rid of its GType. This makes it non-queryable using gtk_style_context_get() but it used to be a private struct anyway.
* cssvalue: Add enum values for the pango enumsBenjamin Otte2012-04-171-0/+154
| | | | And fix the parser to conform to the CSS spec while at it.
* cssvalue: Make border styles be their own valueBenjamin Otte2012-04-171-0/+104
... and add them via gtkcssenumvalue.[ch] which will be used for all enums.