Commit Graph

30554 Commits

Author SHA1 Message Date
Benjamin Otte
d10f851201 reftests: Fix a bunch of invalid CSS cases
use 'transparent' instead of 'none' for colors.
2012-01-09 18:37:57 +01:00
Benjamin Otte
839b0f5317 css: Handle 'currentColor' special value
Computes to the value of the 'color' property, or when used on that
property, is treated as 'inherit'.
2012-01-09 18:37:57 +01:00
Benjamin Otte
84d294ee7f stylecontext: NMake safe to call into during lookup
When resolving a lookup, we may want to query the current style context,
as in the next patch. This works now.
2012-01-09 18:37:57 +01:00
Benjamin Otte
6dfab12e1b styleproperty: Change order for property registration
Some properties depend on other properties, handle those first.
2012-01-09 18:37:57 +01:00
Benjamin Otte
d021ed7c5e win32: Remove GtkWin32ThemePart
Its job is done by GtkCssImage now.
2012-01-09 18:37:57 +01:00
Benjamin Otte
37b11b6c8a borderimage: Convert to using GtkCssImage 2012-01-09 18:37:57 +01:00
Benjamin Otte
52af00686b themingbackground: Convert to GtkCssImage
The conversion is incomplete and requires some work to account for
all the CSS crazies, like repeat modes and background-size.
2012-01-09 18:37:57 +01:00
Benjamin Otte
60b8b7a398 csslookup: Use the new gtk_style_context_peek_property() 2012-01-09 18:37:57 +01:00
Benjamin Otte
53b4fd69db themingengine: Add _gtk_theming_engine_peek_property()
This is useful for getting at computed values and allows accessing
images before the code autoconverts them to a cairo pattern.
2012-01-09 18:37:57 +01:00
Benjamin Otte
2c8ef919ae stylecontext: Add _gtk_style_context_peek_property()
This allows peeking at the computed value for a property. This is useful
for looking at GtkCssImage.
2012-01-09 18:37:56 +01:00
Benjamin Otte
a35df38443 theme: Apply background merging code
It was unused and untested and did not do at all what the CSS spec says.
2012-01-09 18:37:56 +01:00
Benjamin Otte
0bc170cd84 styleproperty: Convert background-image from pattern to GtkCssImage 2012-01-09 18:37:56 +01:00
Benjamin Otte
2bb899b5c0 cssimage: Add a few convenience functions 2012-01-09 18:37:56 +01:00
Benjamin Otte
cdd4ed6600 styleproperty: Use factored-out gradient parser 2012-01-09 18:37:56 +01:00
Benjamin Otte
2a6c168235 win32: Add a CssImage implementation 2012-01-09 18:37:56 +01:00
Benjamin Otte
f7eea0b86e cssimage: Add GtkCssImageGradient 2012-01-09 18:37:56 +01:00
Benjamin Otte
8f42f8c554 win32: Export _gtk_win32_theme_part_create_surface() 2012-01-09 18:37:56 +01:00
Benjamin Otte
590b125ffc win32: Export _gtk_win32_lookup_htheme_by_classname() 2012-01-09 18:37:56 +01:00
Benjamin Otte
950b95af40 cssimage: Improve new_parse() to select right image type 2012-01-09 18:37:56 +01:00
Benjamin Otte
38be9fe879 css: Add _gtk_css_parser_has_prefix() 2012-01-09 18:37:56 +01:00
Benjamin Otte
11ec705133 css: Add image implementation for urls 2012-01-09 18:37:56 +01:00
Benjamin Otte
b3389a017a css: Add GtkCssImage class
Doesn't do anything yet, just exists.
2012-01-09 18:37:56 +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
32c8bbb575 styleproperty: Remove context arg from _gtk_style_context_query() 2012-01-09 18:37:56 +01:00
Benjamin Otte
a9d1be0bef stylecontext: Remove GtkStylePropertyContext from pack funcs 2012-01-09 18:37:56 +01:00
Benjamin Otte
e8cb6f3165 styleproperty: Add compute_value vfunc 2012-01-09 18:37:55 +01:00
Benjamin Otte
c3d337312a styleproperty: Move parse/print vfuncs to GtkCssStyleProperty 2012-01-09 18:37:55 +01:00
Benjamin Otte
22a65bcd82 styleproperty: Add a compute vfunc 2012-01-09 18:37:55 +01:00
Benjamin Otte
232d9226f9 tests: Add test for 'initial' and 'inherit' on shorthands 2012-01-09 18:37:55 +01:00
Benjamin Otte
e87cf5d789 css: Redo value resolving
Instead of on-demand resolvage, we now resolve during lookup. The step
is done via
  _gtk_css_style_property_compute_value()
which currently calls into
  _gtk_css_style_compute_value()
That function has all the old resolving machinery.

The only part missing for now is the handling of win32 code. It will be
added back later.
2012-01-09 18:37:55 +01:00
Benjamin Otte
29382c1305 gradient: Allow resolving with contexts 2012-01-09 18:37:55 +01:00
Benjamin Otte
4576653006 stylecontext: Export _gtk_style_context_resolve_color()
We'll need it soon.
2012-01-09 18:37:55 +01:00
Benjamin Otte
f2dc63cc6a css: Pass the real context to the CSS lookup
This will be necessary soon.
2012-01-09 18:37:55 +01:00
Benjamin Otte
91202ef497 styleproperty: Move pspec to GtkCssCustomProperty
It's only used there.
2012-01-09 18:37:55 +01:00
Benjamin Otte
3375dd2a5f styleproperty: Move property_parse_func member
It belongs in GtkCssCustomProperty
2012-01-09 18:37:55 +01:00
Benjamin Otte
61042d155c styleproperty: Add custom parser for custom properties
In particular, move the property_parse_func handling to
GtkCssCustomProperty exclusively.
2012-01-09 18:37:55 +01:00
Benjamin Otte
22e9588dad styleproperty: Stop using pspecs
The pspec type is wrong most of the time anyway.
2012-01-09 18:37:55 +01:00
Benjamin Otte
799110b011 styleproperties: Don't validate values anymore
Pspecs are on their way out, so validation is, too.
2012-01-09 18:37:55 +01:00
Benjamin Otte
65f6925dd1 styleproperty: Don't use gtk_style_properties_register_property()
This would make the internal properties custom properties. And they are
not.

Also get rid of default initial values, we now specify the correct one
at all times.
2012-01-09 18:37:55 +01:00
Benjamin Otte
4b4792f65d styleproperty: Make the register functin take varargs
.. for the initial value.
2012-01-09 18:37:55 +01:00
Benjamin Otte
09b25facb0 styleproperty: Don't register a property parse func
Nobody does that anymore.
2012-01-09 18:37:54 +01:00
Benjamin Otte
8bcfa6ef78 styleproperty: Move implementations to separate file 2012-01-09 18:37:54 +01:00
Benjamin Otte
2d46618e08 styleproperty: Let parse_value() initialize the value
... and document that behavior.
2012-01-09 18:37:54 +01:00
Benjamin Otte
70af2cb2e3 styleproperty: Move parse func
It's specific to GtKCssStyleProperty after all.
2012-01-09 18:37:54 +01:00
Benjamin Otte
47a27a00f5 shorthand: Remove old parse func support
It's not used anymore
2012-01-09 18:37:54 +01:00
Benjamin Otte
069cb74691 shorthand: Do font parsing the new way 2012-01-09 18:37:54 +01:00
Benjamin Otte
f6422513b1 shorthand: Update border-image parsing
Also update tests. None is not a valid value...
2012-01-09 18:37:54 +01:00
Benjamin Otte
a0606d513c shorthand: Initialize unparsed values
All values that the parse funcs didn't parse are initialized to
'initial'.
2012-01-09 18:37:54 +01:00
Benjamin Otte
442040876a shorthand: Move border-color to new parsing code 2012-01-09 18:37:54 +01:00
Benjamin Otte
cd4470cfd3 shorthand: Move border radius parsing to new parsing code
We also now properly allow assigning an integer value to the
border-radius property.
2012-01-09 18:37:54 +01:00