Commit Graph

30271 Commits

Author SHA1 Message Date
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
Benjamin Otte
8ab426e6d5 themingengine: Don't use GtkBorderRadius struct
use GtkBorderCornerRadius instead. Also, don't do NULL checks anymore,
the property is guaranteed to never return NULL.
2012-01-09 18:37:54 +01:00
Benjamin Otte
ea6a898344 styleproperty: Set a default value for border-*-radius
That way, we don't have to check if it is indeed set.
2012-01-09 18:37:54 +01:00
Benjamin Otte
fdb3abefc3 roundedbox: Use GtkCssBorderCornerRadius type
GtkCssBorderRadius is going away.
2012-01-09 18:37:54 +01:00
Benjamin Otte
13aac54d19 shorthand: Implement border parsing with new parse func 2012-01-09 18:37:54 +01:00
Benjamin Otte
148d8fbca8 shorthand: Allow registering a new parse func 2012-01-09 18:37:54 +01:00
Benjamin Otte
14994e3fc9 styleproperty: Remove _gtk_style_property_unpack()
The function is no longer needed in public API
2012-01-09 18:37:54 +01:00
Benjamin Otte
01548bfcbe shorthand: Redo shorthand value parsing
The new approach does not need unpack functions anymore.
2012-01-09 18:37:53 +01:00
Benjamin Otte
e876d9fed5 styleproperty: Make parse_value() a vfunc 2012-01-09 18:37:53 +01:00
Benjamin Otte
4821e52cf2 styleproperty: Move pspec to GtkCssStyleProperty
shorthands don't use pspecs anymore.
2012-01-09 18:37:53 +01:00
Benjamin Otte
5ae00c3755 css: Use _gtk_style_property_get_value_type() where appropriate 2012-01-09 18:37:53 +01:00
Benjamin Otte
389531d15d styleproperty: require property in _gtk_style_property_parse_value()
Other code uses _gtk_css_style_parse_value() instead now.
2012-01-09 18:37:53 +01:00
Benjamin Otte
30eb26087c css: Feed sections to CSS lookup code 2012-01-09 18:37:53 +01:00
Benjamin Otte
79a171de0a styleproperty: Make query() and assign() vfuncs
... and implement them in the 2 known subclasses.
2012-01-09 18:37:53 +01:00
Benjamin Otte
b904679a11 styleproperty: Move value printing to real properties
We can't print shorthands, so don't try.
In particular, I want to get away from shorthands being representable
using GValue, and this function kinda requires that.
2012-01-09 18:37:53 +01:00
Benjamin Otte
078fc725e0 css: Split generic parse/print functions out
It seems to be some sort of sport for me to split them out and merge
them back in...
2012-01-09 18:37:53 +01:00
Benjamin Otte
f5fafb18c9 css: 'transparent' is a valid color everywhere 2012-01-09 18:37:53 +01:00
Benjamin Otte
36e1bcac3c css: No longer expose internal properties
... in gtk_style_properties_lookup_property(). Those properties will
soon stop having pspecs or even being gettable and settable, so better
not tell anyone about it.
2012-01-09 18:37:53 +01:00
Benjamin Otte
73a632a4ae css: Handle custom properties in a custom object
This way we can also get rid of the hack where we required modifying the
pspec after creation, as the name is now a separate property.
2012-01-09 18:37:53 +01:00
Benjamin Otte
55a38f4746 shorthand: Remove a bunch of unused functionality
- The unset func is no longer used
- Shorthands can't be printed
- property_parse funcs and initial values aren't used
2012-01-09 18:37:53 +01:00
Benjamin Otte
674485a138 styleproperties: Implement unsetting directly
With subproperties, there's no need anymore for custom unset functions.
2012-01-09 18:37:53 +01:00
Benjamin Otte
341a738dc6 styleproperty: Move member variables
These variables are only relevant for style properties, but not for
shorthands, so put them there.
2012-01-09 18:37:53 +01:00
Benjamin Otte
d9c5d37e56 shorthand: shorthands can't be inherited
... so remove the flag handling.
2012-01-09 18:37:52 +01:00
Benjamin Otte
544d210a61 css: Move a bunch of functions
... from GtkStyleProperty to GtkCssStyleProperty.
2012-01-09 18:37:52 +01:00
Benjamin Otte
0a3ac5efbc styleproperty: Move id handling
only real style properties can have an id, so let
GtkCssStylePropertyClass handle it.
2012-01-09 18:37:52 +01:00
Benjamin Otte
edb8bf4b1d styleproperty: Add gtk_style_property_assign() 2012-01-09 18:37:52 +01:00
Benjamin Otte
c9dc9d5a88 styleproperties: Use _gtk_style_property_get_value_type()
... and check the case where the property is not get/settable.
2012-01-09 18:37:52 +01:00
Benjamin Otte
7a4bbc8f35 styleproperty: Add GtkStyleProperty::value-type 2012-01-09 18:37:52 +01:00
Benjamin Otte
7a76694780 styleproperty: Use _gtk_style_property_get_name() 2012-01-09 18:37:52 +01:00
Benjamin Otte
2128b356b2 shorthand: Add a property for all subproperties 2012-01-09 18:37:52 +01:00
Benjamin Otte
4383701e25 styleproperty: unconstify
GtkStyleProperty is a real GObject now, so treat it like one and don't
use const.
2012-01-09 18:37:52 +01:00
Benjamin Otte
a3a580d53e styleproperty: Remove unuse args from register()
Those arguments are only relevant for shorthands.
2012-01-09 18:37:52 +01:00
Benjamin Otte
927b922208 styleproperty: Add custom registration func for shorthands 2012-01-09 18:37:52 +01:00
Benjamin Otte
d4344164ac styleproperty: Move shorthand declarations to new file 2012-01-09 18:37:52 +01:00