Benjamin Otte
5939baa556
styleproperty: Make query function take a vfunc
...
This way we can use different methods to query properties and aren't
bound to a GtkStyleProperties object.
2012-01-11 15:48:54 +01:00
Benjamin Otte
e603992ac7
shorthand: Move pack funcs from base class
...
Also make the vfuncs take the shorthand as an argument.
2012-01-11 15:48:53 +01:00
Benjamin Otte
c4566da282
styleproperty: Call style properties init function in more places
...
In particular, call it when querying properties by id. This is necessary
for make check to not die.
2012-01-09 22:08:48 +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
c3d337312a
styleproperty: Move parse/print vfuncs to GtkCssStyleProperty
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
8bcfa6ef78
styleproperty: Move implementations to separate file
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
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
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
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
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
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
7a4bbc8f35
styleproperty: Add GtkStyleProperty::value-type
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
4e79ed7f4f
styleproperty: Add a name property
...
And move the properties array to GtkStylePropertyClass.
Also add some docs.
2012-01-09 18:37:52 +01:00
Benjamin Otte
81b2bb0ade
styleproperty: Get rid of _gtk_style_property_is_shorthand()
...
Use GTK_IS_CSS_SHORTHAND_PROPERTY() instead now that we have it.
2012-01-09 18:37:51 +01:00
Benjamin Otte
78dc75a350
styleproperty: Make this an object
2012-01-09 18:37:51 +01:00
Benjamin Otte
3e24b5dbbe
styleproperty: Add _gtk_style_property_query()
...
This way, we only need to export one function, not 3.
2012-01-09 18:37:51 +01:00
Benjamin Otte
5a815e2159
styleproperty: Add _gtk_style_property_get_initial_value()
2012-01-09 18:37:50 +01:00
Benjamin Otte
aa4925480d
styleproperty: Pass initial value explicitly
2012-01-09 18:37:50 +01:00
Benjamin Otte
ba5e7012b1
css: Redo StyleProvider interface
...
We now use the GtkStleProviderPrivate interface, which hopefully is
faster and more conformant to CSS. Long term, it definitely should be
both.
I would have liked to split this up into multiple commits, but couldn't
find a way.
2012-01-09 18:37:50 +01:00
Benjamin Otte
cdb3f05bf1
css: Add _gtk_style_property_get_count()
2012-01-09 18:37:49 +01:00
Benjamin Otte
eb38591c91
css: Add _gtk_style_property_get_id()
2012-01-09 18:37:49 +01:00
Benjamin Otte
f6cf447cad
styleproperty: Assign a unique id to every styleproperty
2012-01-09 18:37:49 +01:00
Alexander Larsson
8b644b40b1
make _gtk_style_property_resolve copy the result to an output value
...
This is preparation for allowing it to return a newly created
value, rather than just copying one.
2011-11-17 12:27:23 +01:00
Alexander Larsson
c09148ca09
Add GtkStylePropertyContext and use it in when getting style properties
...
At the toplevel we have _gtk_theming_engine_get, which lets us pass
in a property context with (atm) the size to get the property for.
Then there is a lot of plumbing to push this down into the lower
layers of the style property code until finally hitting
the property resolvers.
I need this because I will be adding a property resolver for win32
theme parts, and they render differently depending on the size
(i.e. they don't scale linearly). The idea is that the code
to get the background properties will pass in the final size
and we will resolve the theme part specification to that particular
size.
If the old non-context calls are used we just hardcode a size
of 100x100.
2011-11-17 12:27:22 +01:00
Benjamin Otte
68ebc77a9a
styleproperties: Add an unset vfunc to style properties
...
This makes unsetting work for shorthands.
2011-07-19 11:58:22 +02:00
Benjamin Otte
ba7d1c2104
styleproperty: Make default_value() take a state
...
Because of this, resolve() needs to take a state, too. This is so that
we can have default values depend on other values (like border color).
2011-06-13 15:01:52 +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
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
66396d2bab
styleproperty: Move default value setting to styleproperty.c
2011-06-02 02:03:52 +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
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
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