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
35488f5846
css: Rename struct variable
...
I want to add parse_func as something different soon.
2011-06-02 02:03:50 +02:00
Carlos Garnacho
b68172b2c6
gtkstyleproperties: zero GValue out before using G_VALUE_COLLECT_INIT()
...
Fixes invalid reads in valgrind
2011-05-30 19:18:41 +02:00
Benjamin Otte
0b653abcd4
styleproperties: Remove unused priv variables
2011-05-27 16:11:10 +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
70e654f1a5
stylepropertis: Use set_by_property() in set_valist()
...
... instead of duplicating code. This causes an extra g_value_copy().
If that turns out to be a performance issue, we can invent something
that handles this (like passing a gboolean take_value).
The reason for this duplication deletion is that we want to complicate
the setting code to handle shorthands by unpacking them and storing the
separate values.
2011-05-22 01:25:16 +02:00
Benjamin Otte
73c39f5b16
styleproperties: Add _gtk_style_properties_set_property_by_property()
...
... as a replacement for _gtk_style_properties_set_property_by_pspec().
We'll need that to handle shorthands.
2011-05-22 01:25:16 +02:00
Benjamin Otte
b67ae42ecd
styleproperties: Use peek_property() in get_valist()
2011-05-22 01:23:43 +02:00
Benjamin Otte
0a368fe622
styleproperties: Validate values when setting them
...
Note that validation is not necessary when resolving, because all values
are valid for those cases.
2011-05-22 01:23:36 +02:00
Benjamin Otte
e7db090620
styleproperties: Remove needless check
2011-05-21 22:49:43 +02:00
Benjamin Otte
b889f499a7
styleproperties: Use peek_property in get_property
...
... instead of duplicating the code.
2011-05-21 22:49:43 +02:00
Benjamin Otte
5f5cc79623
styleproperties: Adapt _gtk_style_properties_peek_property()
...
Optionally return the GtkStyleProperty that was looked up. This feature
isn't used yet, but will soon be.
2011-05-21 22:49:43 +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
777a6846db
styleproperties: Put gtk_style_property_lookup() in private header
2011-05-21 22:49:43 +02:00
Benjamin Otte
0f211f78a5
styleproperties: Class ref no longer necessary
...
Now that we initialize the pspecs on-demand, we can avoid the class ref.
2011-05-21 22:49:43 +02:00
Benjamin Otte
85e900b522
styleproperties: Init the default properties when they're needed
...
Instead of initing the default style properties in the class_init
func of the style properties, init them when they are first needed -
when they are queried or when new ones are registered.
That way, they will always be available.
2011-05-21 22:49:42 +02:00
Benjamin Otte
a2200e8971
styleproperties: constify gtk_style_property_lookup()
2011-05-21 22:49:42 +02:00
Benjamin Otte
1bd065fa4d
styleproperties: Rename the storage struct for style pspecs
...
PropertyNode => GtkStyleProperty
2011-05-21 22:49:42 +02:00
Cosimo Cecchi
c3f3e4a670
styleproperties: resolve properties of type GTK_TYPE_SHADOW
...
https://bugzilla.gnome.org/show_bug.cgi?id=649314
2011-05-20 18:49:50 -04:00
Cosimo Cecchi
016f540931
styleproperties: add a "text-shadow" style property
...
And document its use in the CSS parser gtk-doc.
https://bugzilla.gnome.org/show_bug.cgi?id=649314
2011-05-20 18:44:15 -04:00
Benjamin Otte
c1dc3e9372
css: Refactor code to do property lookups earlier
...
We want to ook up the property in the CSS parser, so we can do fancy
things with it. We currently don't but we want to later.
2011-05-18 22:17:57 +02:00
Benjamin Otte
82399bf457
styleproperties: Speed up by not optimizing
...
g_quark_try_string() takes a lock and then does a hashtable lookup. So
just using a string hash table for properties is faster.
2011-05-18 22:17:57 +02:00
Benjamin Otte
4c92fb2b5d
styleproperties: Speed up style_property_lookup()
...
Use the already existing bsearch version instead of iterating the array
manually.
2011-05-18 22:17:57 +02:00
Benjamin Otte
beba515243
styleproperties: Use the pspec as the hash table key
...
The code used the quarked name before, but when we already have the
pspec we want to have a lookup that does not involve quarking. And
lookup is equally fast if we only have the name.
2011-05-18 22:17:57 +02:00
Benjamin Otte
f04f943708
styleproperties: Mark "color" and "font" as inherit
...
Keeping it identical to CSS 2.1 again
2011-05-18 22:17:57 +02:00
Benjamin Otte
9bfd3d2eec
API: Add API to set style properties to be inherit
...
The API is not used anywhere yet.
2011-05-18 22:17:57 +02:00
Cosimo Cecchi
ec2055d1b0
Revert "styleproperties: don't force replacing the font description"
...
It turns out the bug is more complicated than I originally understood.
Not replacing the font description fields while merging here makes it
impossible for application's CSS to override fonts.
This reverts commit 89c1d93b68
.
https://bugzilla.gnome.org/show_bug.cgi?id=645458
2011-03-23 09:59:58 -04:00
Cosimo Cecchi
2ae6becef9
styleproperties: don't force replacing the font description
...
Otherwise custom fonts will always get overridden by the default stored
in GtkSettings when merging them.
https://bugzilla.gnome.org/show_bug.cgi?id=644975
2011-03-17 14:34:44 -04:00
Javier Jardón
db97f8660a
Use faster new G_VALUE_COLLECT_INIT variant instead G_VALUE_COLLECT
...
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=641621
2011-02-07 13:14:47 +00:00
Carlos Garnacho
d39f0411be
Add the gtk-key-bindings CSS parser property.
...
This property takes a list of binding set names to have these
stored as a GPtrArray containing GtkBindingSets. this property
is handled so merging GtkStyleProperties will merge both
GtkBindingSet lists.
2011-01-30 21:24:51 -05:00
Pavel Holejsovsky
374e76a19d
[GI] Mark unintrospectable constructs as (skip)
...
Also adds 'Rename to:' annotation to some constructs replacing the
skipped ones.
2011-01-20 13:57:21 +01:00
Pavel Holejsovsky
2f0d40335b
[GI] Add missing (transfer) annotations
2011-01-20 13:57:18 +01:00
Matthias Clasen
6869ff26f3
Make GtkBorder style properties have a non-NULL default
...
https://bugzilla.gnome.org/show_bug.cgi?id=639625
2011-01-19 21:24:30 -05:00
Carlos Garnacho
2f207ca749
Make selectors with no explicit state from higher priority GtkStyleProviders override lower ones with a state.
...
This makes overriding information from the themes more intuitive
2011-01-17 04:44:29 +01:00
Matthias Clasen
4b10167ce6
Set a default value for rgba style properties
2010-12-21 18:18:34 -05:00
Carlos Garnacho
ca7fe1cb73
GtkStyleProperties: Assign default value for the font property
...
This fixes a failure when running make test, where style queries
happened before there was even an screen.
2010-12-20 13:55:37 +01:00
Carlos Garnacho
bacb7906f2
Add helper API for getting colors/borders in GtkStyleContext/GtkThemingEngine
2010-12-04 15:39:55 +01:00
Carlos Garnacho
3e8d138ed6
GtkStyleProperties: Refactor color/gradient resolution
2010-12-04 15:39:55 +01:00
Carlos Garnacho
cf0bd12e6c
GtkStyleProperties: Turn border-width into a GtkBorder property.
...
All current users of this CSS property have been updated to deal
with a GtkBorder.
Also a 0 border width has been set in the default CSS to ensure
GtkStyleContext and GtkThemingEngine always provide a non-NULL
pointer for this property.
2010-12-04 15:39:52 +01:00
Matthias Clasen
e598f17871
Some header cleanups
...
Move GtkGradient to their own files, also move GtkBorder out of
gtkstyle.h, so that header can be all deprecated.
2010-12-04 15:39:47 +01:00
Matthias Clasen
5e26fb75a0
Add GtkStyleProperties to the docs
2010-12-04 15:39:22 +01:00
Carlos Garnacho
62ee0956e3
GtkStyleProperties: Use GParamSpec for properties registration.
2010-12-04 15:39:06 +01:00
Carlos Garnacho
bcf81a0e23
Handle looping transition animations.
2010-12-04 15:39:05 +01:00
Carlos Garnacho
d865cf4b38
GtkStyleProperties: Handle GdkColor types.
...
Just in case.
2010-12-04 15:39:04 +01:00
Carlos Garnacho
1fb6cc8d77
Use the correct cairo-gobject.h include path.
2010-12-04 15:38:56 +01:00
Carlos Garnacho
fb8de847df
GtkStyleProperties: Merge font descriptions on merge()
...
This is necessary so incomplete font descriptions are ensured to have
family and size.
2010-12-04 15:38:34 +01:00
Carlos Garnacho
4acc20abc1
s/GtkStyleSet/GtkStyleProperties/
...
The former name had oddities such as gtk_style_set_set() and such,
so the new name is nicer in that regard and not much longer.
2010-12-04 15:38:29 +01:00