Benjamin Otte
de3111f1ff
API: Add all border styles from CSS 3
2012-01-09 18:37:59 +01:00
Benjamin Otte
fd3afa3606
styleproperty: Simplify code
...
Merge 1-line function into only caller
2012-01-09 18:37:59 +01:00
Benjamin Otte
3d6a76a866
tests: Add a test for all the border shorthands
...
Too much fun with random test generation, so I did a big one.
2012-01-09 18:37:59 +01:00
Paolo Borelli
c167b4129e
Also add border-{top|right|bottom|left} shorthands
2012-01-09 18:37:59 +01:00
Paolo Borelli
0120aaace5
Add the border css shorthand
2012-01-09 18:37:59 +01:00
Benjamin Otte
f021291423
tests: Fix for changes in this branch
...
The expected results are now more correct, but still not perfect.
2012-01-09 18:37:59 +01:00
Paolo Borelli
6525ed76e0
Rename parse_border
...
For consistency we will use this name for the boder shorthand.
2012-01-09 18:37:59 +01:00
Paolo Borelli
04ea69ab38
Add reftets for border-style property
2012-01-09 18:37:59 +01:00
Benjamin Otte
cc2446d29b
reftests: Add a CSS file to reset properties to default values
...
We can use this to be independant of themes. See the comment at the top
of the file
2012-01-09 18:37:59 +01:00
Paolo Borelli
b8aea82743
Use the border-style subproperties for drawing
...
Use the newly introduced per-side property to draw frames.
2012-01-09 18:37:59 +01:00
Benjamin Otte
2c5a8420b5
Set border-width to 0 in compute function
...
This reverts commit c276f53796
and
implements the same feature using the compute function.
A nice side effect is that gtk_style_property_get_border() and
gtk_style_property_get("border") to the same thing now.
2012-01-09 18:37:58 +01:00
Paolo Borelli
e69f14cf2b
Add border-{top|left|bottom|right}-style properties
...
Add all the border-style subproperties and turn border-style itself in a
shorthand.
2012-01-09 18:37:58 +01:00
Benjamin Otte
066f3be659
themingengine: Remove an optimization
...
We optimize the case later on, so no need to do it here.
2012-01-09 18:37:58 +01:00
Benjamin Otte
0e48cc6dae
spinbutton: Pass the right size
...
We need a better diffrentiation between icon sizes - ie GtkIconSize vs
pixel size. Or more CSS.
2012-01-09 18:37:58 +01:00
Benjamin Otte
bbf5fe179d
background: Implement all options of background-repeat
2012-01-09 18:37:58 +01:00
Benjamin Otte
af8c7ebecd
tests: Add test for background-repeat
2012-01-09 18:37:58 +01:00
Benjamin Otte
bc9373fb43
styleproperty: Parse all values for background-repeat
...
... and its component in the background property.
2012-01-09 18:37:58 +01:00
Benjamin Otte
77af93bad9
reftests: Add a test for 'background'
...
It just tests all the permutations to make sure my idea for implementing
random ordering actually works.
It does (at least currently).
2012-01-09 18:37:58 +01:00
Benjamin Otte
181ac0280d
shorthand: Implement the 'background' shorthand
...
Weee, shorthands are now really trivial \o/
2012-01-09 18:37:58 +01:00
Benjamin Otte
a43553ab86
cssimage: Add _gtk_css_image_can_parse()
...
Looks at the first token of the stream to see if this looks like an
image declaration. If it does: return %TRUE.
2012-01-09 18:37:58 +01:00
Benjamin Otte
4b7ca9602d
background: Simplify background-repeat
...
It used to be a struct, now it's just an enum
2012-01-09 18:37:58 +01:00
Benjamin Otte
07aa7f6b20
css: Remove GtkCssBorderRadius
...
It's not used anymore.
2012-01-09 18:37:58 +01:00
Paolo Borelli
fee09e726f
Introduce _gtk_css_parser_try_length
...
This starts to introduce the proper API abstraction for when we will
support different units
2012-01-09 18:37:58 +01:00
Benjamin Otte
fce45757cb
borderimage: Change memory management
...
Making it a on-stack object simplifies things a lot.
2012-01-09 18:37:58 +01:00
Benjamin Otte
9b47a6a4e3
border-image: Remove pack/unpack functions
...
They are not used anymore. Also, it's no longer necessary to register
GtkBorderImage as a custom GType.
2012-01-09 18:37:58 +01:00
Benjamin Otte
96abf8c725
shorthand: Make border-image unget/settable
2012-01-09 18:37:57 +01:00
Benjamin Otte
f014d4f02e
shorthand: Don't require pack/unpack functions
...
When using G_TYPE_NONE as the shorthand's type, the property is not
gettable/settable using regular APIs, so it essentially doesn't exist.
As it should be.
2012-01-09 18:37:57 +01:00
Benjamin Otte
84bc280440
borderimage: Add _gtk_border_image_new_for_context()
...
and use it.
2012-01-09 18:37:57 +01:00
Benjamin Otte
cee05fbeb8
borderimage: Remove unused enums
2012-01-09 18:37:57 +01:00
Benjamin Otte
cc3e4c4eec
reftests: Ensure no explicit colors are set on labels
2012-01-09 18:37:57 +01:00
Benjamin Otte
af8dd87867
styleproperty: Use a custom resolve function for colors
...
We want to make sure to fall back to the initial value of the property
if resolving fails.
This is kinda tricky, because the initial value itself might need
resolving, too.
2012-01-09 18:37:57 +01:00
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