summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstyle.c
Commit message (Collapse)AuthorAgeFilesLines
* gtk: Clean up docs syntaxMatthias Clasen2021-05-221-2/+2
| | | | Replace leftover gtk-doc syntax (#Type) with backquotes.
* css: Fix text-decoration-line supportMatthias Clasen2021-01-261-10/+7
| | | | | | | | | | | | This property needs to be treated as flags, not as enum, since it should be possible to specify more than one value, e.g. text-decoration-line: underline overline; Tests included. Fixes: #3621
* css: Support overlineMatthias Clasen2021-01-261-0/+13
| | | | | We can support text-decoration-line: overline, since pango supports it now.
* css: Implement transform-originMatthias Clasen2021-01-241-0/+2
| | | | | | | Implement most of transform-origin. We only handle the xy components currently, which lets us reuse the position value implementation that is used for background-position.
* Replace "gint" with "int"Benjamin Otte2020-07-251-1/+1
|
* css: Drop a few dynamic type checksTimm Bäder2020-05-101-2/+0
| | | | We hit these code paths a lot
* css: Drop the -gtk-icon-theme propertyMatthias Clasen2020-04-221-2/+0
| | | | | We want to always use the current icon theme, and only have the minimum amount of custom properties.
* cssstyle: Only create PangoAttrList if there are attribtuesTimm Bäder2020-04-171-46/+55
| | | | | | Don't allocate a new GString if we never need it and therefore don't create the PangoAttrList if we have no attributes anyway. Update callers to handle the possible NULL return value.
* css: Remove outline border radius propertiesTimm Bäder2020-02-081-8/+0
| | | | | | | | These are always set to the same value as the corresponding border radius properties. They are also non-standard, so remove them and replace them with the border radius properties everywhere. Fixes #2414
* css: Make some local variables constTimm Bäder2020-02-051-2/+2
|
* css: Fix the initial values optimizationMatthias Clasen2020-02-041-15/+6
| | | | | | | Fix up the index computation. We have duplicate entries in the type enum, so to go from one of the 'initial' types to it corresponding type you subtract one, but to find the size array entry for a type, you divide by 2.
* Make it easy to recognize initial style valuesMatthias Clasen2020-02-011-2/+13
| | | | | Reuse the type field in GtkCssValues to make initial style values easily recognizable.
* Build fix for GtkCssValuesMatthias Clasen2020-01-311-4/+11
|
* Use style values directlyMatthias Clasen2020-01-291-28/+21
| | | | | | | Replace uses of gtk_css_style_get_value with direct access, throughout the tree. We don't replace all uses, just those where we are dealing with a fixed property. Be careful to handle the currentColor special case for color properties.
* css: Split styles into groupsMatthias Clasen2020-01-291-2/+299
| | | | | | | | Introduce refcounted structs for groups of related css properties, and use them to store the style values. Both GtkCssStaticStyle and GtkCssAnimatedStyle fill in the structs in GtkCssStyle, and we can avoid vfuncs for value access, which should be much faster. We can even start accessing style->core->color directly.
* cssstyle: set font variations in get_pango_font()Timm Bäder2020-01-181-1/+7
| | | | | Doesn't make sense to set all the css values on the font description in there except for the font variations, so do these here as well.
* cssstyle: Implement get_pango_font() directlyTimm Bäder2020-01-181-12/+39
| | | | | Instead of going through the slow GValue code path. This function was unused, so use it in GtkWidget's update_pango_context() now.
* Remove GtkCssRgbaValueTimm Bäder2020-01-181-3/+3
| | | | | | | | The differenciation between a literal color value and an RGBA value caused problems in various situations. Just treat the two the same but don't allow access to the rgba value of a non-literal color value. This gets rid of around 1.6k rgba values in the widget-factory.
* Revisit gtk_css_style_get_static_style one more timeMatthias Clasen2020-01-161-7/+0
| | | | Move the implementation to where it belongs.
* Change the signature of gtk_css_style_get_static_styleMatthias Clasen2020-01-161-3/+3
| | | | It is clearer if this function returns a GtkCssStaticStyle.
* css: Add gtk_css_style_get_static_styleMatthias Clasen2020-01-161-0/+15
| | | | | This lets us avoid poking directly at the GtkCssAnimatedStyle struct in gtkcssnode.c.
* cssstyle: Remove unused _add_differenceTimm Bäder2019-09-091-24/+0
|
* css: Move gtkcsssection.[ch] into gtk/cssBenjamin Otte2019-04-121-1/+0
|
* csssection: Make printing functions publicBenjamin Otte2019-04-121-2/+2
|
* Remove debug spewMatthias Clasen2017-12-211-2/+0
|
* Implement font-feature-settingsMatthias Clasen2017-12-201-0/+12
| | | | This is a missing part of the CSS font level 3 module.
* build: Enable -Wswitch-enum and -Wswitch-defaultBenjamin Otte2017-10-061-5/+13
| | | | | | | | | | | | | | | | | | | This patch makes that work using 1 of 2 options: 1. Add all missing enums to the switch statement or 2. Cast the switch argument to a uint to avoid having to do that (mostly for GdkEventType). I even found a bug while doing that: clearing a GtkImage with a surface did not notify thae surface property. The reason for enabling this flag even though it is tedious at times is that it is very useful when adding values to an enum, because it makes GTK immediately warn about all the switch statements where this enum is relevant. And I expect changes to enums to be frequent during the GTK4 development cycle.
* css: Use enums instead of idents for font-variant propertiesMatthias Clasen2017-09-181-115/+126
| | | | | | | | As Benjamin says, ident should only be used if any value is valid, which is not the case here. So use enums instead, which should also be more efficient. To handle the more complicated cases like font-variant-ligatures, we have to introduce flags-like values.
* Fix a typoMatthias Clasen2017-09-181-4/+4
| | | | | The property is called font-variant-alternates, not -alternatives. Correct this everywhere.
* css: Implement font-variant-east-asianMatthias Clasen2017-09-181-0/+26
| | | | This is translated to the corresponding OpenType features.
* css: Implement font-variant-alternativesMatthias Clasen2017-09-181-0/+10
| | | | | | This is only a partial implementation, since we don't support @font-feature-values. The only supported value is historical-forms, for now.
* css: Implement font-variant-numericMatthias Clasen2017-09-181-0/+24
| | | | This gets translated to the corresponding OpenType features.
* css: Implement font-variant-capsMatthias Clasen2017-09-181-0/+33
| | | | This gets translated to the corresponding OpenType features.
* css: Implement font-variant-positionMatthias Clasen2017-09-181-0/+14
| | | | This gets translated to the corresponding OpenType features.
* css: Implement font-variant-ligaturesMatthias Clasen2017-09-181-2/+36
| | | | This gets translated into corresponding OpenType features.
* css: Implement font-kerningMatthias Clasen2017-09-181-0/+7
| | | | This gets translated to the OpenType feature kern.
* Skip dynamic type check in css value gettersAlexander Larsson2017-01-111-2/+0
| | | | | | This gets called a lot during snapshotting, and this change alone brings down snapshot time by almost 10% in a syntethic snapshot test.
* Add a function to get a font from a css styleMatthias Clasen2016-06-031-0/+19
| | | | | | | | Similar in spirit to gtk_style_context_get (ctx, state, "font", ...) but avoids the need for a style context. This will be used to for css-styled text rendering from css subnodes.
* Add a function to turn a css style into pango attributesMatthias Clasen2016-06-031-0/+76
| | | | | | | This is _gtk_style_context_get_pango_attributes, decoupled from the GtkStyleContext. This will be used to drive css-styled text rendering from css subnodes of widgets, e.g. for the value in GtkScale.
* cssstyle: fix a compiler warningCosimo Cecchi2016-01-031-2/+2
|
* Improve formatting of CSS style printsMatthias Clasen2016-01-031-1/+20
| | | | | Add a newline after CSS properties, so things don't run into each other.
* Redo CSS style printingMatthias Clasen2016-01-031-9/+23
| | | | | | | | | | | Drop the custom style printing implementation in gtkcssnode.c and instead reuse the existing gtk_css_style_print function, extending it a bit to suit our needs. Instead of computing values, just recognize initial values by having no CSS section. Also do away with the show-initial flag, and just always filter out initial values. The flag can come back when it is needed.
* css style: Accumulate changes in placeMatthias Clasen2015-09-281-7/+9
| | | | | This avoids allocating a temporary bitmask, and lets us avoid some value comparisons altogether.
* cssstyle: Add gtk_css_style_is_static()Benjamin Otte2015-03-181-0/+16
| | | | | | | Gets rid of the need to do if (ANIMATED_STYLE() && animated_style_is_static(ANIMATED_STYLE(style))
* cssstyle: Add optimizationBenjamin Otte2015-03-181-0/+3
| | | | There is no difference between a style and itself.
* cssstyle: Move function from vfunc to static funcBenjamin Otte2015-01-071-17/+0
| | | | | compute_dependencies() is only used internally by GtkCssStaticStyle, so there's no need to have it elsewhere.
* cssstyle: Split into GtkCssStyle and GtkCssAnimatedStyleBenjamin Otte2015-01-071-521/+17
| | | | | | | | GtkCssStyle is the base class to be used for all types of styles that do exist. GtkCssAnimatedStyle is the only implementation so far, that is exactly a copy/paste of the old GtkCssStyle code.
* cssstyle: Rename GtkCssComputedValues => GtkCssStyleBenjamin Otte2015-01-071-0/+657
This is literally just renaming of the object (and the associated source files). No other changes are in there.