Commit Graph

82 Commits

Author SHA1 Message Date
Benjamin Otte
1170ecfd2e cssvalue: Convert border-image-width to border value 2012-04-17 08:59:19 +02:00
Benjamin Otte
56f79fecce cssvalue: Add a border value
.. and parse border-image-slice with it.
2012-04-17 08:59:18 +02:00
Benjamin Otte
cfc6462730 cssvalue: Add a cssvalue for background-size 2012-04-17 08:59:18 +02:00
Benjamin Otte
f785f7177c cssvalue: Add a custom value for repeats
In particular, that's background-repeat and border-image-repeat.

Also, fix up the border-image shorthand to allow any order.
2012-04-17 08:59:18 +02:00
Benjamin Otte
5377169ef3 cssvalue: Add a value for background-position 2012-04-17 08:59:18 +02:00
Benjamin Otte
aed7600425 cssvalue: Add a css value for engines 2012-04-17 08:59:18 +02:00
Benjamin Otte
4f63c1c7ca cssstyleproperty: Convert binding sets
Instead of keeping a custom GPtrArray, keep it as a GtkCssArrayValue of
GtkCssStringValue. This way, we gain equality comparisons and print
functions for free.
2012-04-17 08:59:18 +02:00
Benjamin Otte
edbc8e4f57 cssvalue: Add a value for border-radius corner properties
... and convert those properties to this value.
2012-04-17 08:59:18 +02:00
Benjamin Otte
05f2249d08 css: Make outline-offset a number property 2012-04-17 08:59:18 +02:00
Benjamin Otte
c366b5b8b7 shadow: Add equal and transition support
... and enable transitions for the shadow properties.
2012-04-17 08:59:18 +02:00
Benjamin Otte
ac6d61f6bb cssvalue: Add GtkCssShadowsValue
This is necessary because shadows get treated differently from other
lists when transitioning.
2012-04-17 08:59:18 +02:00
Benjamin Otte
ca17270187 cssvalue: Make GtkCssShadowValue only hold one shadow
All the properties now are a GtkCssArrayValue of GtkCssSadowValue.
GtkCssArrayValue already does everything we want, so no need to
duplicate its funtionality.
2012-04-17 08:59:17 +02:00
Benjamin Otte
b9ebe8c226 cssarrayvalue: Redo parsing arrays
Does 3 things:
1) Introduce a "none" array signleton
2) Get rid of memleaks in error paths
3) Reduce code in parse funcs
2012-04-17 08:59:17 +02:00
Benjamin Otte
a8efb784d7 cssstyleproperty: Mark all animatable properties
Only the ones that can be animated are marked of course. So more work is
needed.
This is important for
  transition-property: all;
because it'll just animate all the properties that can be.
2012-04-17 08:59:17 +02:00
Benjamin Otte
ed45a3c2f0 cssstyleproperty: Add _gtk_css_style_property_is_animated() 2012-04-17 08:59:17 +02:00
Benjamin Otte
9e4341f730 css: Move enum to the only source file using it 2012-04-17 08:59:17 +02:00
Benjamin Otte
41ce29767c cssstyleproperty: Add transition properties 2012-04-17 08:59:16 +02:00
Benjamin Otte
31565139ba stylecontext: Convert _gtk_style_context_peek_property()
Take the property id instead of the name.
2012-04-17 08:59:15 +02:00
Benjamin Otte
5d8789680e css: Add an enum for all the style properties
So instead of using
  _gtk_css_style_property_get_id (GTK_CSS_STYLE_PROPERTY
        (_gtk_style_property_lookup ("name")))
one can now use
  GTK_CSS_PROPERTY_NAME

Esaier, eh?
2012-04-17 08:59:15 +02:00
Benjamin Otte
bf92f2f7ac cssvalue: Do a hacky conversion of font-size to a number value
Just store the value as px for now.

The font-size property needs a complete makeover anyway.
2012-04-17 08:59:15 +02:00
Benjamin Otte
ad05604b3e cssvalue: Convert 'font-family'
It's now a CssArrayValue filled with CssStringValue
2012-04-17 08:59:15 +02:00
Benjamin Otte
4ba9be5b97 cssvalue: Add GtkCssArea to the enum values
... 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.
2012-04-17 08:59:15 +02:00
Benjamin Otte
8c49cd97a7 cssvalue: Add a cssvalue for images 2012-04-17 08:59:14 +02:00
Benjamin Otte
d63b11e56b cssvalue: Add enum values for the pango enums
And fix the parser to conform to the CSS spec while at it.
2012-04-17 08:59:14 +02:00
Benjamin Otte
b65d17dda8 cssvalue: Make border styles be their own value
... and add them via gtkcssenumvalue.[ch] which will be used for all
enums.
2012-04-17 08:59:14 +02:00
Benjamin Otte
58b6d492b8 cssvalue: Add a custom RGBA value
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.
2012-04-17 08:59:14 +02:00
Benjamin Otte
dcec7a5529 cssstyleproperty: Make assign_value a vfunc 2012-04-17 08:59:14 +02:00
Benjamin Otte
645309e98b shadow: Also rename files 2012-04-17 08:59:14 +02:00
Benjamin Otte
ec5c77a552 shadow: Rename to GtkCssShadowValue
I don't want to confuse css values with other stuff, so there.
2012-04-17 08:59:13 +02:00
Benjamin Otte
96948576bd shadow: Move parse function into GtkShadow
This way, we have less public API.
And gtkcssstylepropertyimpl.c looks less scary (only 1624 lines now).
2012-04-17 08:59:13 +02:00
Benjamin Otte
ccd443796c shadow: Make this a GtkCssValue 2012-04-17 08:59:13 +02:00
Benjamin Otte
ca4a080c8a stylepropertyimpl: Make shadows unqueryable
Normal APIs couldn't use GtkShadow anyway as the type was private.
2012-04-17 08:59:13 +02:00
Benjamin Otte
a33df2d1d6 cssvalue: Split number values into their own class 2012-04-17 08:59:13 +02:00
Benjamin Otte
f7c0c7677b cssstyleproperty: Make query func a vfunc
This will be needed soon.
2012-04-17 08:59:13 +02:00
Benjamin Otte
c8e57d63ec cssstyelproperty: Rempove specified-type and computed-type props
This removes the necessity to keep a GType associated with style
properties and code can now make use of GtkCssValue completely.
2012-04-17 08:59:13 +02:00
Benjamin Otte
75a5f04352 styleproperty: Remove default parse function
... and assert every style property brings its own.
2012-04-17 08:59:13 +02:00
Benjamin Otte
a5d001b2ba stylepropertyimpl: Add remaining parse functions 2012-04-17 08:59:12 +02:00
Benjamin Otte
7fbc583b88 css: Move shadow parse/print/compute funcs
They don't belong in the style funcs, as those are for custom
properties, and the shadow type is private.
2012-04-17 08:59:12 +02:00
Benjamin Otte
dd144c2bad stylepropertyimpl: Add parse funcs for enums 2012-04-17 08:59:12 +02:00
Benjamin Otte
86a387f571 stylepropertyimpl: Add color parsing function
This is in preparation for removing the specified type and computed type
properties from GtkCssStyleProperty, which is in preparation for really
using GtkCssValue classes and not GTypes.
2012-04-17 08:59:12 +02:00
Benjamin Otte
bc9060a591 styleproperty: Make gtk_style_property_register() not be valist
Instead, make the caller create a GtkCssValue in advance.
2012-04-17 08:59:12 +02:00
Benjamin Otte
9b7640b898 styleproperty: Make _gtk_style_property_parse_value() return a CssValue
Also split out initial/inherit handling into a custom GtkCssValue class.
2012-04-17 08:59:11 +02:00
Benjamin Otte
df45983fcb cssvalue: Remove _gtk_css_value_new_take_gvalue()
Having two constructors from GValues complicates refactorings, so I'd
rather not have them.
2012-04-17 08:59:11 +02:00
Benjamin Otte
58e4fdf911 styleproperty: Make print_func take a GtkCssValue
Also, constify GtkCssValue getters, so we can pass a const GtkCssValue
to the print_func.
2012-04-17 08:59:11 +02:00
Benjamin Otte
3cdb9c91ca styleproperty: Add support for equal_func 2012-04-17 08:59:11 +02:00
Benjamin Otte
5bbf59b519 cssvalue: Constify a bunch of APIs 2012-04-17 08:59:10 +02:00
Benjamin Otte
8b5910f8d7 styleproperty: Fix thinko
Introduced in 8243b16ad7 - seems I wasn't
really on top of my own capabilities on Saturday.
2012-04-09 20:33:46 +02:00
Benjamin Otte
8243b16ad7 styleproperty: Save some memory
Only create a new CssValue when we actually need one.
2012-04-09 03:14:51 +02:00
Alexander Larsson
e65a2709a3 css: Support background-position property 2012-03-17 05:13:22 +01:00
Alexander Larsson
616cc5b96d Use GtkCssValue in symbolic color resolving
We now store the symbolic colors as a GtkCssValue which means that
we can reuse the color when resolving and storing the color in
the computed values in the style context.

Additionally we keep a last_resolved GtkCssValue cache in the
GtkSymbolicColor, and if resolving the color returns the same as
last time we reuse the old value. This further increases sharing
of Css Values.
2012-03-08 14:52:10 +01:00