Commit Graph

64 Commits

Author SHA1 Message Date
Benjamin Otte
dd83f9ca86 API: Remove API to set CSS properties from GValues
This API was only used in GtkModifierStyle and GtkStyleProperties and
they are both on their way out.

CSS properties must now be set using strings via the regular parser API.
2016-10-16 18:17:21 +02:00
Matthias Clasen
e71f7d713e Add a transfer annotation
This was confusing me momentarily, so add an explicit annotation.
2015-12-28 22:37:22 -05:00
Matthias Clasen
38e5a805dc css style property: Use gtk_internal_return_if_fail 2015-09-08 08:07:34 -04:00
Philip Withnall
3d88899072 gtk: Fix various tiny typos in documentation comments
e.g. Invalid syntax in introspection annotations, typos in object names,
accidentally using a gtk-doc comment for an internal function.
2015-02-18 11:38:37 +00:00
Benjamin Otte
aa1b7fab9c css: Remove _gtk_css_style_property_changes_affect_size()
... and _gtk_css_style_property_changes_affect_font().

Replace it with _gtk_css_style_property_get_mask_affecting().
2015-01-27 05:04:34 +01:00
Benjamin Otte
c42e54e949 css: Add _gtk_css_style_property_get_mask_affecting()
Computes a bitmask for all properties that affect the given flags.
2015-01-27 05:04:34 +01:00
Benjamin Otte
ffff7b055b css: Remove GtkCssStyleProperty::affects-size
... and GtkCssStyleProperty::affects-font properties. Code now uses
GtkCssStyleProperty::affects instead.
2015-01-27 05:04:34 +01:00
Benjamin Otte
c0650057c1 css: Add GtkCssStyleProperty::affects property 2015-01-27 05:04:34 +01:00
Sebastian Keller
728bce2cf8 css: Move "border-style: none" special case to CssValueNumber
This fixes the background being shifted by the border-width even though
the border-style was none.
2015-01-21 16:20:42 +01:00
Matthias Clasen
385e6beafe Fix the build
Some forgotten include path adjustments.
2014-10-24 16:12:33 -04:00
Benjamin Otte
3a72e2fb24 css: Implement "unset"
Quoting the spec:
  If the cascaded value of a property is the unset keyword,
  then if it is an inherited property, this is treated as
  inherit, and if it is not, this is treated as initial.

Spec in question:
  http://dev.w3.org/csswg/css-cascade/

Also use unset in the reset-to-defaults.css we use to reset css in
reftests.
2014-05-11 03:23:55 +02:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
5dd751f006 docs: don't use ulink. use markdown instead 2014-02-04 18:53:51 -05:00
Cosimo Cecchi
17a3325b2d cssstyleproperty: remove unused variable 2012-12-13 21:54:50 -05:00
Alexander Larsson
d8fae21b1c css: Avoid looking up the GtkCssStyleProperty class a lot
Instead of constantly looking up the class we just stash it away in
class_init.
2012-12-10 14:49:51 +01:00
Alexander Larsson
6dfee46cdb css: Add _gtk_css_style_property_affects_font
This checks if a style_update affects the font.
2012-12-06 21:14:02 +01:00
Benjamin Otte
8560ff88cd styleproperty: Add _gtk_css_style_property_changes_affect_size()
This gives fast access to the question of wether a style update requires
a resize.
2012-11-30 20:37:46 +01:00
Benjamin Otte
a5770cef36 styleproperty: Add an affects-size property
This property will be used to avoid gtk_widget_queue_resize() calls in
favor of gtk_widget_queue_draw().
2012-11-30 20:10:23 +01:00
Benjamin Otte
25271fe781 css: Move special case code for border widths
We need to store the border widths independant of them being set to 0 by
border styles, because otherwise we'd need to track that dependency and
recompute on changes, and I don't want to add more entries to
GtkCssDependencies just for this special case.

By moving the code that does the setting to 0 from the compute stage to
the query stage, we can achieve this.

Now we need to just be aware that the actual value stored is not set to
0 when we use gtk_css_computed_values_get_value().
2012-10-02 14:16:35 +02:00
Benjamin Otte
6dc3113edc cssstyleproperty: Get rid of unused API
Both _gtk_css_style_property_print_value() and
_gtk_css_style_property_compute_value() aren't necessary anymore and are
replaced by _gtk_css_value_print() and _gtk_css_value_comptue()
respectively.
2012-08-28 15:40:57 +02:00
Benjamin Otte
bc5d383b9d cssstyleproperty: Call _compute() in the compute function
... instead pof just reffing the value.
2012-08-28 15:40:57 +02:00
Benjamin Otte
a7f238138e styleproperty: Remove base argument
from _gtk_style_property_parse_value(). The GtkCssParser takes care of
that now.
2012-05-11 16:42:12 +02:00
Benjamin Otte
6ee237ea59 cssstyleproperty: Remove base argument
from parse functions.
2012-05-11 16:42:12 +02:00
Benjamin Otte
2fec112422 styleproperty: Remove equal_func vfunc
Equality tests are done with _gtk_css_value_equal(). There is no need to
do it per-property, equal values will still be equal.

This essentially reverts 24f5d54329e028347bd76af42e86ed190c1229a2 and
92c7a7171e1240b6d961ee5b6f9ab6b596e98904.
2012-04-17 08:59:20 +02:00
Benjamin Otte
ed45a3c2f0 cssstyleproperty: Add _gtk_css_style_property_is_animated() 2012-04-17 08:59:17 +02:00
Benjamin Otte
dcec7a5529 cssstyleproperty: Make assign_value a vfunc 2012-04-17 08:59:14 +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
0fdc287339 styleproperty: Simplify compute_value function
The compute_value fallback path is only needed for custom properties,
the real style properties have custom compute functions if they need
them already.
2012-04-17 08:59:12 +02:00
Benjamin Otte
ffe50c3b67 cssvalue: Add _gtk_css_value_equal()
For now, we return FALSE for all default css values, so this is not very
useful.

I also think of this as an optimization equal, not a guaranteed equal,
because we don't even have a notion of what "equal" means.

For example, for background-repeat, "repeat, repeat" and "repeat"
are functionally equivalent. But the cssvalue has no idea that it's used
for background-repeat.
As a more complicated example, "repeat, no-repeat" and "repeat" are
equal to what one sees as long as there's only one image listed
background-image-source. But once you start transition'ing to an image
with 2 sources, it's different...
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
718ceaec45 css: Remove _gtk_css_style_property_is_specified_type()
That check is going to be refactored away.
2012-04-17 08:59:11 +02:00
Benjamin Otte
5ac9ba714a styleproperty: Make _gtk_style_property_query() take a GValue
... and don't make it return a GtkCssValue. We want to use this for
compat with the old GValue APIs after all...
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
115c34498e styleproperty: Add a function to compare values for equality
and default to never compare them as equal.
2012-04-17 08:59:10 +02:00
Benjamin Otte
555cf516fd styleproperty: 3rd hotfix for a 3-line patch
I really should not write code sometimes...

Copy/paste error this time.
2012-04-10 16:55:05 +02:00
Benjamin Otte
43c56d70ea csscustomproperty: Redo RGBA/Color parsing
This fixes custom parse functions returning RGBA values where we
expected symbolic colors.
2012-04-09 03:09:44 +02:00
Alexander Larsson
7603e6e473 css: Use GtkCssValues instead of GValue in the css machinery
Also, in places where we're computing a new CssValue based on an
old one, make sure that if nothing changes we're returning a reference
to the old one, rather than creating a new identical instance.
2012-03-08 11:03:57 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
e84af235ee css: Implement padding as numbers
Also remove the now unused border parsing function for shorthands.
2012-02-02 03:14:02 +01:00
Benjamin Otte
a81ac3d5cd css: Add a check function for specified types
... and use it.

It seems kinda necessary for the refactoring I'm about to do...
2012-02-02 03:14:00 +01:00
Benjamin Otte
5e5e8367ce css: Initialize value before calling compute function 2012-02-02 03:13:38 +01:00
Benjamin Otte
f7e0ce3b28 css: Initialize values to their specified type
.. when parsing.
2012-02-02 03:13:38 +01:00
Benjamin Otte
9fa764abec styleproperty: Introduce "specified type" and "computed type"
Make the types explicit. This way, we can actually do useful stuff with
them (like sanity checks, d'oh).
2012-02-02 03:13:34 +01:00
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
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
fd3afa3606 styleproperty: Simplify code
Merge 1-line function into only caller
2012-01-09 18:37:59 +01:00
Benjamin Otte
0bc170cd84 styleproperty: Convert background-image from pattern to GtkCssImage 2012-01-09 18:37:56 +01:00