Commit Graph

103 Commits

Author SHA1 Message Date
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Benjamin Otte
41486895d5 deprecations: Move files into deprecated/ dir 2012-11-25 04:16:43 +01:00
Benjamin Otte
fb643c1c12 symboliccolor: Deprecate
Symbolic colors are an implementation detail of the CSS engine and have
been superceded by GtkCssColorValue. We don't want them clobbering the
public API. In particular because the only use I could find in the
public API is people using it to shade colors.
2012-11-25 03:43:28 +01:00
Benjamin Otte
4f9a8e6b3d symboliccolor: Remove extra includes
That header was included in way too many places.
2012-11-25 02:59:15 +01:00
Benjamin Otte
42dc0ea0fd styleprovider: Change function prototype
Make _gtk_style_provider_private_get_color() return a GtkCssValue (a
GtkCssColorValue to be exact) instead of GtkSymbolicColor.

With this, the symbolic color usage inside GTK is minimized.
2012-11-25 02:45:10 +01:00
Benjamin Otte
932794e105 styleprovider: Remove (broken) implementations of get_style
The implementations were broken and get_style() is deprecated and
documented to return NULL now.
2012-11-24 21:12:00 +01:00
Benjamin Otte
12683da8f7 gtk: Make functions static that don't need to be non-static
Also remove the starting underscore from function names where
appropriate, as those functions are static now and not exported anymore.

This is part of a bunch of fixes for gcc complaining about
-Wmissing-declarations.
2012-10-02 19:32:51 +02:00
Benjamin Otte
6443baadb9 styleprovider: Make all implementors emit the new signal
... and listen to it in the cases where they use other style providers.
2012-04-17 08:59:21 +02:00
Benjamin Otte
40283e7c27 cssvalue: Split out old value handling to new typed value
... and Make this new value be a real GValue, as we don't need to save
performance for these anymore (it's just used for custom properties).
And I'd rather have code work for all values then be optimized for no
reason.
2012-04-17 08:59:20 +02:00
Benjamin Otte
04c5fdaca6 css: Remove old animation code
Deprecate public API where appropriate and make it no-ops.
Remove all calls to it.
Get rid of the 'transition' css property.

For now, this means spinners don't animate anymore.
2012-04-17 08:59:19 +02:00
Benjamin Otte
645309e98b shadow: Also rename files 2012-04-17 08:59:14 +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
8e3e3d582f cssvalue: Get rid of unused functions 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
8dbe8c8349 syleprovider: Add a vfunc to get the changes
This way we can check what changes are even interesting for our matcher.
2012-04-17 08:59:08 +02:00
Benjamin Otte
a94b85d375 css: Make the style provider take a matcher as an input argument 2012-04-17 08:59:07 +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
bd8fefb20e styleproperties: Add a warning
GtkStyleProperties stores computed values. Make sure it does.
2012-02-02 03:14:00 +01:00
Benjamin Otte
6ba33e7af5 css: Allow bypassing the compute_value() stage
This is useful when overriding values.
2012-02-02 03:13:38 +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
aa98aca45f styleproperties: Remove color set function
Now that we do resolvage with the style context directly, this is no
longer needed.
2012-01-11 15:48:53 +01:00
Benjamin Otte
9181282d88 style: Remove GtkStylePropertyContext again
We need to solve this differently. I have no idea yet how, but I'll
invent something later.

This only affects win32 theming and that's broken anyway.
2012-01-09 18:37:56 +01:00
Benjamin Otte
32c8bbb575 styleproperty: Remove context arg from _gtk_style_context_query() 2012-01-09 18:37:56 +01:00
Benjamin Otte
799110b011 styleproperties: Don't validate values anymore
Pspecs are on their way out, so validation is, too.
2012-01-09 18:37:55 +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
30eb26087c css: Feed sections to CSS lookup code 2012-01-09 18:37:53 +01:00
Benjamin Otte
73a632a4ae css: Handle custom properties in a custom object
This way we can also get rid of the hack where we required modifying the
pspec after creation, as the name is now a separate property.
2012-01-09 18:37:53 +01:00
Benjamin Otte
674485a138 styleproperties: Implement unsetting directly
With subproperties, there's no need anymore for custom unset functions.
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
edb8bf4b1d styleproperty: Add gtk_style_property_assign() 2012-01-09 18:37:52 +01:00
Benjamin Otte
c9dc9d5a88 styleproperties: Use _gtk_style_property_get_value_type()
... and check the case where the property is not get/settable.
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
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
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
2573e72f49 styleproperties: Add _gtk_style_properties_peek_property() 2012-01-09 18:37:51 +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
38a9b28a0e styleproperties: Add a hacky function to redirect color lookups
This will soon be necessary.
FIXME: Make sure this gets removed again.
2012-01-09 18:37:49 +01:00
Benjamin Otte
d1c92c38df styleproperties: Move private struct declaration into public header 2011-12-23 00:15:59 +01:00
Alexander Larsson
abe6598a13 Add initial cut at win32 theme support for CSS
We now support -gtk-win32-theme-part(class,part,state) in background
and border-image CSS properties. This renders the corresponding
theme part using DrawThemeBackground() and acts as a base for a
CSS based windows theme.

Note that we build the parsing code even on non-win32 so that
all themese will parse the same on all arches. We draw pink instead
of the actual theme parts on non-win32 though.
2011-11-17 12:29:03 +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
7104b4b575 Remove _gtk_style_properties_peek_property
We want to move to a world where getting style properties can
allocate a new value, depending on the style property context.
In this world we can't expose "peeking" a property, as we neet
to return a ref to the property that is newly created.

So, we move the peek code into get_property and use get_property
from get_valist.
2011-11-17 12:27:22 +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
Javier Jardón
0853ce3077 Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
2011-10-15 16:45:16 +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
Cosimo Cecchi
e3dd437b67 styleproperty: turn border-image into a shorthand property
It's composed by
- border-image-source: a cairo_pattern_t holding an image from file or a
  gradient
- border-image-slice: a GtkBorder containing the slice offsets to apply
  on the image
- border-image-repeat: a GtkRepeatType for the image

We deviate from pure CSS3 in the following ways:

* border-image-width is assumed to be always 1, i.e. always equal to
  what's specified by border-width. I don't think it's a particularly
  useful property to have, but we could add it later if needed.
* border-image-outset is absent, as we can't render outside of the
  allocation yet.

https://bugzilla.gnome.org/show_bug.cgi?id=651194
2011-06-09 05:51:54 +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