Commit Graph

28 Commits

Author SHA1 Message Date
Benjamin Otte
2e6bb2a0c9 Revert "css: Make font property a shorthand"
The hack in gtk_style_context_get_font() was causing segfaults in
combobox code. This is not acceptable and I'm not awake enough to fix
it, so just reverting until it's fixed sanely is easiest.

This reverts commit cf6bfbdb17.
2011-06-02 02:31:44 +02:00
Benjamin Otte
1845849596 styleproperty: Move resolving code
Also, resolving now always succeeds - if it doesn't we fall back to the
default value right here, instead of later.
2011-06-02 02:03:52 +02:00
Benjamin Otte
cc3afc7c0f Revert "API: Add API to set style properties to be inherit"
Inheritance is now done using style property flags, so thereis no ned
anymore to clobber the pspec flags namespace.
Also, there is no need to expose this functionality in the public API
without exposing more of the styleproperty API.

This essentially reverts commit 9bfd3d2eec.
2011-06-02 02:03:52 +02:00
Benjamin Otte
9f0e993b60 styleproperty: Use the new flags for inheritance
Instead of gtk_style_param_set_inherit()
2011-06-02 02:03:52 +02:00
Benjamin Otte
4feddc6190 styleproperty: Add flags
This allows to set a bunch of specific features, like inheritance in
here, without having to molest the psec.
2011-06-02 02:03:52 +02:00
Benjamin Otte
fd4ffbb6da styleproperty: Add _gtk_style_property_is_inherit()
And use it instead of gtk_style_param_get_inherit()
2011-06-02 02:03:52 +02:00
Benjamin Otte
cf6bfbdb17 css: Make font property a shorthand
... and implement the CSS font properties:
- font-size
- font-style
- font-family
- font-weight
- font-variant
2011-06-02 02:03:52 +02:00
Benjamin Otte
8d77fcb2d5 styleproperty: Factor out the string print function
We print strings in lots of places.
2011-06-02 02:03:52 +02:00
Benjamin Otte
66396d2bab styleproperty: Move default value setting to styleproperty.c 2011-06-02 02:03:52 +02:00
Benjamin Otte
90ff426396 css: Add all border-radius properties
Implement all border-radisu properties as specified by
http://www.w3.org/TR/css3-background/#the-border-radius
The end goal here is to get joined buttons to really look joined.
2011-06-02 02:03:51 +02:00
Benjamin Otte
812b32e9e5 styleproperty: Add a helper function for printing doubles
We will want to print doubles more often, so add a little helper
function for it. We cannot use printf() here, because we want English
locale output.
2011-06-02 02:03:51 +02:00
Benjamin Otte
97a07a79f3 styleproperty: Make keybindings use custom parse/print functions
We don't want to use it for GPtrArray.
2011-06-02 02:03:50 +02:00
Benjamin Otte
d14fbf3254 styleproperty: Allow passing in a parse func and a print func
It's not used yet, but it's now possible to specify a custom read or
write func.
2011-06-02 02:03:50 +02:00
Benjamin Otte
715674c45b styleproperty: Rename ParseFunc and PrintFunc typedefs
Rename them to GtkStyleParseFunc and GtkStylePrintFunc, so we can export
them.
2011-06-02 02:03:50 +02:00
Benjamin Otte
d0e1e2b103 css: Move property parsing into styleproperty file
Just shuffles code around for parsing properties.
2011-06-02 02:03:50 +02:00
Benjamin Otte
5a42464547 css: Rename function to _gtk_style_property_parse_value()
... and take an optional style property as argument. This way, we can
allow custom parse functions for properties. The style property needs to
be optional so that we can use it for widget style properties, too.
2011-06-02 02:03:50 +02:00
Benjamin Otte
35488f5846 css: Rename struct variable
I want to add parse_func as something different soon.
2011-06-02 02:03:50 +02:00
Benjamin Otte
3e7f74c456 styleproperty: Change _css_value_to_string()
Name it _gtk_style_property_print_value() and actually pass it the style
property. This way, we can later change it to use custom print functions
for different style properties.
2011-06-02 02:03:50 +02:00
Benjamin Otte
02a9cb5bc0 css: Change to_string() to print()
It's preferrable to print to an existing GString instead of returning a
char* everywhere that needs to be freed later.
2011-06-02 02:03:50 +02:00
Carlos Garnacho
20433efbfa gtkcssprovider: Free shorthand border GValues in the right place
The call to gtk_border_free() within unpack_border() felt completely
in the wrong place, as the border actually pertains to the GValue
being unpacked. Plus, the GValue itself was also being leaked.
2011-05-30 19:29:22 +02:00
Carlos Garnacho
de4ca3ae13 gtkstyleproperty: Plug two leaks
In rgba_value_parse(), unref the symbolic color once we've resolved it.
In gradient_value_parse(), take the GtkGradient so we leave no dangling
references.
2011-05-30 19:21:42 +02:00
Benjamin Otte
7b94a6ff2f styleproperty: Fix memleak in unpacking code 2011-05-27 16:11:09 +02:00
Benjamin Otte
21236cf270 style: Make margin a shorthand
... and add the real properties:
- margin-top
- margin-left
- margin-bottom
- margin-right
2011-05-22 05:56:12 +02:00
Benjamin Otte
a35aa96149 style: Make padding a shorthand
... and add the real properties:
- padding-top
- padding-left
- padding-bottom
- padding-right
2011-05-22 05:56:12 +02:00
Benjamin Otte
f5c7cefcca style: Convert border-width to a shorthand
Add the corresponding properties it refers to, too:
- border-top-width
- border-left-width
- border-bottom-width
- border-right-width
2011-05-22 05:56:11 +02:00
Benjamin Otte
42a4bd1c5b style: Add support for shorthand properties
Shorthand properties are basically the same a in CSS. For storage in
style properties or the CSS provider, they are unpacked into the real
values, so it is possible to partially override them.

No properties are yet converted to the new world yet, this is just the
code for supporting them.
2011-05-22 01:25:17 +02:00
Benjamin Otte
727a839d71 styleproperties: Move the style property handling code
... from gtkstyleproperties.c to gtkstyleproperty.c
2011-05-21 22:49:43 +02:00
Benjamin Otte
5eca8f8275 css: Rename gtkcssstrfuncs file to gtkstyleproperty
The idea is to handle the style property registering etc in this file
instead of the styleproperties file. The next commits will move those
files.
2011-05-21 22:49:43 +02:00