Benjamin Otte
6f9cc94fae
cssprovider: Improve error handling for import errors
...
We don't want to include the whitespace after an import statement.
Because people tend to add newlines after @import, we report the wrong
lines for failed imports. And that's bad.
2012-01-16 18:44:43 +01:00
Benjamin Otte
1b0231b743
css: Don't import CSS too early
...
First, finish parsing the import rule including the semicolon. Then try
to actually import.
test: css/parser/at-invalid-01.css
2012-01-16 18:34:41 +01:00
Alexander Larsson
1a36414da7
Access win32 css as resource, not custom generated C code
2012-01-16 14:19:18 +01:00
Alexander Larsson
4f0cc6572b
Add Gtk resource file with the default CSS file
2012-01-16 14:19:16 +01:00
Cosimo Cecchi
ddd164c230
provider: use _gtk_css_parse_read_url() in parse_import()
...
Instead of _gtk_css_parser_read_uri(), which is going away.
2012-01-13 18:08:12 -05:00
Rui Matos
e9adaabc5e
Rename 'window-unfocused' to 'backdrop'
...
'window-unfocused' is too long and mentions "focus" which is historically
loaded with the meaning "input focus".
'backdrop' isn't generally used in GUI speak and still conveys the state the
widgets in an unfocused or background toplevel window are in.
2012-01-09 18:38:00 +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
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
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
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
544d210a61
css: Move a bunch of functions
...
... from GtkStyleProperty to GtkCssStyleProperty.
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
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
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
57379adb3c
css: Add generic support for 'inherit' and 'initial'
...
CSS3 says they work for every property, so here we go.
2012-01-09 18:37:51 +01:00
Benjamin Otte
a6ac53e2a9
css: Change prototype of _gtk_css_selector_matches()
...
Passing the length of the widget path that is relevant is not necessary
anymore, it was only useful for inheritance. Instead, we now pass the
state flags and let the selector do the state matching for us.
2012-01-09 18:37:50 +01:00
Benjamin Otte
a3225fdd42
cssprovider: Remove has_inherit flag from rulesets
...
It's not used anymore
2012-01-09 18:37:50 +01:00
Benjamin Otte
40a7618d2a
cssprovider: Don't do inheritance anymore
...
Its' done in GtkCssLookup with the help of GtkStyleContext::parent now.
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
54d2b9dbc2
cssprovider: Keep a bitmask for the properties
...
That way we can easily tell wich properties are in use.
2012-01-09 18:37:49 +01:00
Matthias Clasen
d7e8388e9d
Add a Since tag
...
gtk_css_provider_to_string is a post-3.0 addition.
Fixes bug 659516
2011-12-30 00:38:06 -05:00
Benjamin Otte
58d553c604
cssprovider: Fix leak
...
Thanks to the heroic valgrinding efforts of Olivier Sessnik, another
leak could be plugged.
2011-12-23 22:30:45 +01:00
Stef Walter
d462f86aad
GtkCssProvider: don't segfault when CSS file is not found
...
* Fix null dereference in gtk_css_provider_take_error()
* And another in gtk_css_provider_emit_error()
https://bugzilla.gnome.org/show_bug.cgi?id=664537
2011-11-30 00:23:07 -05:00
Alexander Larsson
f59836a4d0
Build in default win32 css as gtk-win32
2011-11-18 16:54:04 +01:00
Rui Matos
70f87b8bd5
gtk: Add a GTK_STATE_FLAG_WINDOW_UNFOCUSED widget state flag
...
This allows themes to style widgets differently according to whether the
toplevel window they are in is presented as focused.
https://bugzilla.gnome.org/show_bug.cgi?id=661428
2011-11-08 19:33:22 +00:00
Marc-André Lureau
3b436eec6d
css: start background-repeat
...
By default, a background image is stretched. Instead, it is worth to
have a tiled background.
This patch allows background surfaces to be repeated or not, and should
be compatible with future extensions and CSS.
https://bugzilla.gnome.org/show_bug.cgi?id=663522
2011-11-08 11:10:44 -05:00
Michael Natterer
2688ccdbc4
gtk: clean up the private horror
...
- add gtkmodulesprivate.h and move stuff there from gtkprivate.h
- add gtkprivate.c and move stuff there from gtkmain.c
- add gtkwin32.c and move stuff there from gtkmain.c
- don't redefine GTK_DATADIR and friends in gtkprivate.h
- have _gtk_get_datadir() and friends on all platforms
- remove the horrid hacks where gtkprivate.h can't be included,
or must be included later due to redefinition of the compile-time
directories
2011-10-22 23:53:55 +02:00
Cosimo Cecchi
1f2cfb5619
all: add an 'only-child' pseudo-class selector
...
Add an :only-child pseudo-class selector, which selects single children
of a parent container.
https://bugzilla.gnome.org/show_bug.cgi?id=660833
2011-10-04 11:47:47 -04:00
Benjamin Otte
b01e20f1d1
cssprovider: Remove unused enums
2011-09-26 16:00:26 +02:00
Morten Welinder
9d96830571
cssprovider: Remove outdated docs
2011-09-22 21:44:05 +02:00
Dan Winship
e028a5c090
gtkcssprovider: fix a crash in gtk_css_provider_parsing_error
...
"info" was being declared in two different scopes, and the one that
was freed wasn't the one that was set.
2011-09-09 09:37:44 -04:00
Eitan Isaacson
6eb777a8af
Change gtk_css_provider_propagate_error's signature.
...
Update to new parsing-error signal.
https://bugzilla.gnome.org/show_bug.cgi?id=657882
2011-09-02 09:19:18 -07:00
Benjamin Otte
26e9d07718
API: cssprovider: Change parsing-error signal
...
Instead of path, line and position, emit the section the error happened
in. This has a lot more information to consume.
2011-08-26 16:26:28 +02:00
Benjamin Otte
0d1b73f857
cssprovider: Store sections with parsed values
...
Also create a separate section for values to associate the values with.
Finally, use this section information when delayed-parsing a widget
style property.
2011-08-26 16:26:27 +02:00
Benjamin Otte
ebf0b6ee4d
cssprovider: Handle non-NULL-terminated data
...
Do a dumb copy if that happens.
2011-08-26 16:26:27 +02:00
Benjamin Otte
d985b95ef9
cssprovider: Keep only the curent section while parsing
...
We don't need a list of sections, the section can give us the parent
when we need it (d'oh).
2011-08-26 16:26:27 +02:00
Benjamin Otte
19c44967cb
cssprovider: Remove dead code
...
The code isn't used anymore since the introduction of rulesets.
2011-08-26 16:26:27 +02:00
Benjamin Otte
00d14e3515
API: css: Add GtkCssSection
...
This struct keeps track of an area of text in a CSS file and uses it
when specifying information. Also, the cssprovider keeps track of
sections when parsing a file.
2011-08-26 16:26:27 +02:00
Benjamin Otte
5a1f371e12
cssprovider: Fix names for first and last child pseudo class
...
The correct name is :first-child, not :first
2011-07-21 02:43:53 +02:00
Benjamin Otte
1a763044fe
cssprovider: Emit an error when parsing a binding fails
2011-07-20 02:36:44 +02:00
Benjamin Otte
b8465d289b
cssprovider: Get the location right for semicolon warnings
2011-07-20 02:36:44 +02:00
Benjamin Otte
5eefc37b3f
cssprovider: @import <string> is valid CSS
...
The parser rewrite insisted on @import url(<string>) syntax, but CSS
xplicitly allows omitting the url string.
2011-07-20 02:36:44 +02:00
Benjamin Otte
0d253b67f4
css: Make font property a shorthand
...
... and implement the CSS font properties:
- font-size
- font-style
- font-family
- font-weight
- font-variant
This is the second try at this. The first was backed out previously due
to bugginess. Let's hope this one survives a bit longer.
Also makes the font-family CSS test work again.
2011-06-15 12:52:53 +02:00
Benjamin Otte
3aa73bebea
styleproperty: Add border-*-color style properties
...
And make border-color a shorthand
2011-06-13 15:01:52 +02:00
Benjamin Otte
287069ca3c
default theme: Fix menuitem check/radio colors
2011-06-12 23:35:39 +02:00
Benjamin Otte
3712ec71d4
default theme: fix menuitem selections
2011-06-12 23:28:43 +02:00
Benjamin Otte
d7598aabe3
default theme: fix tooltip colors
2011-06-12 23:26:53 +02:00
Cosimo Cecchi
1539ade9d5
cssprovider: add a doc paragraph about box-shadow
2011-06-11 09:29:43 +02:00