Commit Graph

331 Commits

Author SHA1 Message Date
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
Cosimo Cecchi
3d1407a01a border-image: add support for border-image-width too
It's useful to set a slice size != border-width, as backgrounds are
clipped to border-width too.

As slices can be half-transparent and overlap the background,
this would not fill the border box properly if we only use a single
property for specifying the width.

Also, this brings us even closer to CSS3.
2011-06-09 20:01:57 -04:00
Cosimo Cecchi
a2a8d3e8f4 docs: expand the docs for border-image
https://bugzilla.gnome.org/show_bug.cgi?id=651194
2011-06-09 05:51:54 +02:00
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
a659143d55 docs: There is no font-name style property
It's "font"
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
0aa07c6fd6 cssprovider: Remove colors when resetting 2011-06-02 02:03:52 +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