]> Pileus Git - ~andy/gtk/log
~andy/gtk
12 years agoreftests: Ensure no explicit colors are set on labels
Benjamin Otte [Tue, 3 Jan 2012 21:40:08 +0000 (22:40 +0100)]
reftests: Ensure no explicit colors are set on labels

12 years agostyleproperty: Use a custom resolve function for colors
Benjamin Otte [Tue, 3 Jan 2012 16:59:31 +0000 (17:59 +0100)]
styleproperty: Use a custom resolve function for colors

We want to make sure to fall back to the initial value of the property
if resolving fails.

This is kinda tricky, because the initial value itself might need
resolving, too.

12 years agoreftests: Fix a bunch of invalid CSS cases
Benjamin Otte [Tue, 3 Jan 2012 04:06:50 +0000 (05:06 +0100)]
reftests: Fix a bunch of invalid CSS cases

use 'transparent' instead of 'none' for colors.

12 years agocss: Handle 'currentColor' special value
Benjamin Otte [Tue, 3 Jan 2012 03:38:09 +0000 (04:38 +0100)]
css: Handle 'currentColor' special value

Computes to the value of the 'color' property, or when used on that
property, is treated as 'inherit'.

12 years agostylecontext: NMake safe to call into during lookup
Benjamin Otte [Tue, 3 Jan 2012 03:36:11 +0000 (04:36 +0100)]
stylecontext: NMake safe to call into during lookup

When resolving a lookup, we may want to query the current style context,
as in the next patch. This works now.

12 years agostyleproperty: Change order for property registration
Benjamin Otte [Tue, 3 Jan 2012 02:37:13 +0000 (03:37 +0100)]
styleproperty: Change order for property registration

Some properties depend on other properties, handle those first.

12 years agowin32: Remove GtkWin32ThemePart
Benjamin Otte [Tue, 3 Jan 2012 02:21:21 +0000 (03:21 +0100)]
win32: Remove GtkWin32ThemePart

Its job is done by GtkCssImage now.

12 years agoborderimage: Convert to using GtkCssImage
Benjamin Otte [Wed, 21 Dec 2011 16:43:31 +0000 (17:43 +0100)]
borderimage: Convert to using GtkCssImage

12 years agothemingbackground: Convert to GtkCssImage
Benjamin Otte [Tue, 3 Jan 2012 01:40:50 +0000 (02:40 +0100)]
themingbackground: Convert to GtkCssImage

The conversion is incomplete and requires some work to account for
all the CSS crazies, like repeat modes and background-size.

12 years agocsslookup: Use the new gtk_style_context_peek_property()
Benjamin Otte [Tue, 3 Jan 2012 04:06:30 +0000 (05:06 +0100)]
csslookup: Use the new gtk_style_context_peek_property()

12 years agothemingengine: Add _gtk_theming_engine_peek_property()
Benjamin Otte [Tue, 3 Jan 2012 01:35:56 +0000 (02:35 +0100)]
themingengine: Add _gtk_theming_engine_peek_property()

This is useful for getting at computed values and allows accessing
images before the code autoconverts them to a cairo pattern.

12 years agostylecontext: Add _gtk_style_context_peek_property()
Benjamin Otte [Tue, 3 Jan 2012 01:35:05 +0000 (02:35 +0100)]
stylecontext: Add _gtk_style_context_peek_property()

This allows peeking at the computed value for a property. This is useful
for looking at GtkCssImage.

12 years agotheme: Apply background merging code
Benjamin Otte [Mon, 2 Jan 2012 22:23:20 +0000 (23:23 +0100)]
theme: Apply background merging code

It was unused and untested and did not do at all what the CSS spec says.

12 years agostyleproperty: Convert background-image from pattern to GtkCssImage
Benjamin Otte [Mon, 2 Jan 2012 21:22:25 +0000 (22:22 +0100)]
styleproperty: Convert background-image from pattern to GtkCssImage

12 years agocssimage: Add a few convenience functions
Benjamin Otte [Wed, 21 Dec 2011 16:40:16 +0000 (17:40 +0100)]
cssimage: Add a few convenience functions

12 years agostyleproperty: Use factored-out gradient parser
Benjamin Otte [Tue, 20 Dec 2011 14:47:03 +0000 (15:47 +0100)]
styleproperty: Use factored-out gradient parser

12 years agowin32: Add a CssImage implementation
Benjamin Otte [Tue, 20 Dec 2011 13:44:53 +0000 (14:44 +0100)]
win32: Add a CssImage implementation

12 years agocssimage: Add GtkCssImageGradient
Benjamin Otte [Tue, 20 Dec 2011 13:46:19 +0000 (14:46 +0100)]
cssimage: Add GtkCssImageGradient

12 years agowin32: Export _gtk_win32_theme_part_create_surface()
Benjamin Otte [Tue, 20 Dec 2011 13:40:07 +0000 (14:40 +0100)]
win32: Export _gtk_win32_theme_part_create_surface()

12 years agowin32: Export _gtk_win32_lookup_htheme_by_classname()
Benjamin Otte [Tue, 20 Dec 2011 13:15:41 +0000 (14:15 +0100)]
win32: Export _gtk_win32_lookup_htheme_by_classname()

12 years agocssimage: Improve new_parse() to select right image type
Benjamin Otte [Tue, 20 Dec 2011 07:52:54 +0000 (08:52 +0100)]
cssimage: Improve new_parse() to select right image type

12 years agocss: Add _gtk_css_parser_has_prefix()
Benjamin Otte [Tue, 20 Dec 2011 07:15:18 +0000 (08:15 +0100)]
css: Add _gtk_css_parser_has_prefix()

12 years agocss: Add image implementation for urls
Benjamin Otte [Tue, 20 Dec 2011 07:00:34 +0000 (08:00 +0100)]
css: Add image implementation for urls

12 years agocss: Add GtkCssImage class
Benjamin Otte [Mon, 19 Dec 2011 21:11:20 +0000 (22:11 +0100)]
css: Add GtkCssImage class

Doesn't do anything yet, just exists.

12 years agostyle: Remove GtkStylePropertyContext again
Benjamin Otte [Mon, 2 Jan 2012 18:22:30 +0000 (19:22 +0100)]
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.

12 years agostyleproperty: Remove context arg from _gtk_style_context_query()
Benjamin Otte [Mon, 2 Jan 2012 18:14:28 +0000 (19:14 +0100)]
styleproperty: Remove context arg from _gtk_style_context_query()

12 years agostylecontext: Remove GtkStylePropertyContext from pack funcs
Benjamin Otte [Mon, 2 Jan 2012 17:39:03 +0000 (18:39 +0100)]
stylecontext: Remove GtkStylePropertyContext from pack funcs

12 years agostyleproperty: Add compute_value vfunc
Benjamin Otte [Mon, 2 Jan 2012 17:28:24 +0000 (18:28 +0100)]
styleproperty: Add compute_value vfunc

12 years agostyleproperty: Move parse/print vfuncs to GtkCssStyleProperty
Benjamin Otte [Mon, 2 Jan 2012 17:05:06 +0000 (18:05 +0100)]
styleproperty: Move parse/print vfuncs to GtkCssStyleProperty

12 years agostyleproperty: Add a compute vfunc
Benjamin Otte [Mon, 2 Jan 2012 16:50:32 +0000 (17:50 +0100)]
styleproperty: Add a compute vfunc

12 years agotests: Add test for 'initial' and 'inherit' on shorthands
Benjamin Otte [Mon, 2 Jan 2012 14:52:21 +0000 (15:52 +0100)]
tests: Add test for 'initial' and 'inherit' on shorthands

12 years agocss: Redo value resolving
Benjamin Otte [Mon, 2 Jan 2012 14:44:45 +0000 (15:44 +0100)]
css: Redo value resolving

Instead of on-demand resolvage, we now resolve during lookup. The step
is done via
  _gtk_css_style_property_compute_value()
which currently calls into
  _gtk_css_style_compute_value()
That function has all the old resolving machinery.

The only part missing for now is the handling of win32 code. It will be
added back later.

12 years agogradient: Allow resolving with contexts
Benjamin Otte [Mon, 2 Jan 2012 14:44:27 +0000 (15:44 +0100)]
gradient: Allow resolving with contexts

12 years agostylecontext: Export _gtk_style_context_resolve_color()
Benjamin Otte [Mon, 2 Jan 2012 14:43:53 +0000 (15:43 +0100)]
stylecontext: Export _gtk_style_context_resolve_color()

We'll need it soon.

12 years agocss: Pass the real context to the CSS lookup
Benjamin Otte [Mon, 2 Jan 2012 11:36:22 +0000 (12:36 +0100)]
css: Pass the real context to the CSS lookup

This will be necessary soon.

12 years agostyleproperty: Move pspec to GtkCssCustomProperty
Benjamin Otte [Mon, 2 Jan 2012 11:12:29 +0000 (12:12 +0100)]
styleproperty: Move pspec to GtkCssCustomProperty

It's only used there.

12 years agostyleproperty: Move property_parse_func member
Benjamin Otte [Mon, 2 Jan 2012 09:41:41 +0000 (10:41 +0100)]
styleproperty: Move property_parse_func member

It belongs in GtkCssCustomProperty

12 years agostyleproperty: Add custom parser for custom properties
Benjamin Otte [Mon, 2 Jan 2012 09:37:04 +0000 (10:37 +0100)]
styleproperty: Add custom parser for custom properties

In particular, move the property_parse_func handling to
GtkCssCustomProperty exclusively.

12 years agostyleproperty: Stop using pspecs
Benjamin Otte [Mon, 2 Jan 2012 10:54:13 +0000 (11:54 +0100)]
styleproperty: Stop using pspecs

The pspec type is wrong most of the time anyway.

12 years agostyleproperties: Don't validate values anymore
Benjamin Otte [Mon, 2 Jan 2012 10:53:36 +0000 (11:53 +0100)]
styleproperties: Don't validate values anymore

Pspecs are on their way out, so validation is, too.

12 years agostyleproperty: Don't use gtk_style_properties_register_property()
Benjamin Otte [Mon, 2 Jan 2012 10:27:54 +0000 (11:27 +0100)]
styleproperty: Don't use gtk_style_properties_register_property()

This would make the internal properties custom properties. And they are
not.

Also get rid of default initial values, we now specify the correct one
at all times.

12 years agostyleproperty: Make the register functin take varargs
Benjamin Otte [Mon, 2 Jan 2012 10:12:46 +0000 (11:12 +0100)]
styleproperty: Make the register functin take varargs

.. for the initial value.

12 years agostyleproperty: Don't register a property parse func
Benjamin Otte [Mon, 2 Jan 2012 09:29:13 +0000 (10:29 +0100)]
styleproperty: Don't register a property parse func

Nobody does that anymore.

12 years agostyleproperty: Move implementations to separate file
Benjamin Otte [Mon, 2 Jan 2012 09:21:57 +0000 (10:21 +0100)]
styleproperty: Move implementations to separate file

12 years agostyleproperty: Let parse_value() initialize the value
Benjamin Otte [Mon, 2 Jan 2012 09:06:47 +0000 (10:06 +0100)]
styleproperty: Let parse_value() initialize the value

... and document that behavior.

12 years agostyleproperty: Move parse func
Benjamin Otte [Mon, 2 Jan 2012 08:53:03 +0000 (09:53 +0100)]
styleproperty: Move parse func

It's specific to GtKCssStyleProperty after all.

12 years agoshorthand: Remove old parse func support
Benjamin Otte [Mon, 2 Jan 2012 08:22:35 +0000 (09:22 +0100)]
shorthand: Remove old parse func support

It's not used anymore

12 years agoshorthand: Do font parsing the new way
Benjamin Otte [Mon, 2 Jan 2012 08:19:27 +0000 (09:19 +0100)]
shorthand: Do font parsing the new way

12 years agoshorthand: Update border-image parsing
Benjamin Otte [Mon, 2 Jan 2012 03:12:41 +0000 (04:12 +0100)]
shorthand: Update border-image parsing

Also update tests. None is not a valid value...

12 years agoshorthand: Initialize unparsed values
Benjamin Otte [Mon, 2 Jan 2012 03:11:20 +0000 (04:11 +0100)]
shorthand: Initialize unparsed values

All values that the parse funcs didn't parse are initialized to
'initial'.

12 years agoshorthand: Move border-color to new parsing code
Benjamin Otte [Mon, 2 Jan 2012 02:43:48 +0000 (03:43 +0100)]
shorthand: Move border-color to new parsing code

12 years agoshorthand: Move border radius parsing to new parsing code
Benjamin Otte [Mon, 2 Jan 2012 02:05:49 +0000 (03:05 +0100)]
shorthand: Move border radius parsing to new parsing code

We also now properly allow assigning an integer value to the
border-radius property.

12 years agothemingengine: Don't use GtkBorderRadius struct
Benjamin Otte [Mon, 2 Jan 2012 01:48:35 +0000 (02:48 +0100)]
themingengine: Don't use GtkBorderRadius struct

use GtkBorderCornerRadius instead. Also, don't do NULL checks anymore,
the property is guaranteed to never return NULL.

12 years agostyleproperty: Set a default value for border-*-radius
Benjamin Otte [Mon, 2 Jan 2012 01:45:52 +0000 (02:45 +0100)]
styleproperty: Set a default value for border-*-radius

That way, we don't have to check if it is indeed set.

12 years agoroundedbox: Use GtkCssBorderCornerRadius type
Benjamin Otte [Mon, 2 Jan 2012 01:39:20 +0000 (02:39 +0100)]
roundedbox: Use GtkCssBorderCornerRadius type

GtkCssBorderRadius is going away.

12 years agoshorthand: Implement border parsing with new parse func
Benjamin Otte [Mon, 2 Jan 2012 01:33:56 +0000 (02:33 +0100)]
shorthand: Implement border parsing with new parse func

12 years agoshorthand: Allow registering a new parse func
Benjamin Otte [Mon, 2 Jan 2012 01:23:54 +0000 (02:23 +0100)]
shorthand: Allow registering a new parse func

12 years agostyleproperty: Remove _gtk_style_property_unpack()
Benjamin Otte [Mon, 2 Jan 2012 01:22:52 +0000 (02:22 +0100)]
styleproperty: Remove _gtk_style_property_unpack()

The function is no longer needed in public API

12 years agoshorthand: Redo shorthand value parsing
Benjamin Otte [Mon, 2 Jan 2012 01:05:05 +0000 (02:05 +0100)]
shorthand: Redo shorthand value parsing

The new approach does not need unpack functions anymore.

12 years agostyleproperty: Make parse_value() a vfunc
Benjamin Otte [Sun, 1 Jan 2012 23:45:29 +0000 (00:45 +0100)]
styleproperty: Make parse_value() a vfunc

12 years agostyleproperty: Move pspec to GtkCssStyleProperty
Benjamin Otte [Sun, 1 Jan 2012 23:28:56 +0000 (00:28 +0100)]
styleproperty: Move pspec to GtkCssStyleProperty

shorthands don't use pspecs anymore.

12 years agocss: Use _gtk_style_property_get_value_type() where appropriate
Benjamin Otte [Sun, 1 Jan 2012 23:23:53 +0000 (00:23 +0100)]
css: Use _gtk_style_property_get_value_type() where appropriate

12 years agostyleproperty: require property in _gtk_style_property_parse_value()
Benjamin Otte [Sun, 1 Jan 2012 23:14:23 +0000 (00:14 +0100)]
styleproperty: require property in _gtk_style_property_parse_value()

Other code uses _gtk_css_style_parse_value() instead now.

12 years agocss: Feed sections to CSS lookup code
Benjamin Otte [Sun, 1 Jan 2012 22:16:35 +0000 (23:16 +0100)]
css: Feed sections to CSS lookup code

12 years agostyleproperty: Make query() and assign() vfuncs
Benjamin Otte [Sun, 1 Jan 2012 20:58:45 +0000 (21:58 +0100)]
styleproperty: Make query() and assign() vfuncs

... and implement them in the 2 known subclasses.

12 years agostyleproperty: Move value printing to real properties
Benjamin Otte [Sun, 1 Jan 2012 17:28:27 +0000 (18:28 +0100)]
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.

12 years agocss: Split generic parse/print functions out
Benjamin Otte [Sun, 1 Jan 2012 17:14:51 +0000 (18:14 +0100)]
css: Split generic parse/print functions out

It seems to be some sort of sport for me to split them out and merge
them back in...

12 years agocss: 'transparent' is a valid color everywhere
Benjamin Otte [Sat, 31 Dec 2011 22:20:44 +0000 (23:20 +0100)]
css: 'transparent' is a valid color everywhere

12 years agocss: No longer expose internal properties
Benjamin Otte [Sat, 31 Dec 2011 22:07:13 +0000 (23:07 +0100)]
css: No longer expose internal properties

... in gtk_style_properties_lookup_property(). Those properties will
soon stop having pspecs or even being gettable and settable, so better
not tell anyone about it.

12 years agocss: Handle custom properties in a custom object
Benjamin Otte [Sat, 31 Dec 2011 22:04:32 +0000 (23:04 +0100)]
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.

12 years agoshorthand: Remove a bunch of unused functionality
Benjamin Otte [Sat, 31 Dec 2011 21:28:04 +0000 (22:28 +0100)]
shorthand: Remove a bunch of unused functionality

- The unset func is no longer used
- Shorthands can't be printed
- property_parse funcs and initial values aren't used

12 years agostyleproperties: Implement unsetting directly
Benjamin Otte [Sat, 31 Dec 2011 21:17:25 +0000 (22:17 +0100)]
styleproperties: Implement unsetting directly

With subproperties, there's no need anymore for custom unset functions.

12 years agostyleproperty: Move member variables
Benjamin Otte [Sat, 31 Dec 2011 18:59:16 +0000 (19:59 +0100)]
styleproperty: Move member variables

These variables are only relevant for style properties, but not for
shorthands, so put them there.

12 years agoshorthand: shorthands can't be inherited
Benjamin Otte [Sat, 31 Dec 2011 18:58:44 +0000 (19:58 +0100)]
shorthand: shorthands can't be inherited

... so remove the flag handling.

12 years agocss: Move a bunch of functions
Benjamin Otte [Sat, 31 Dec 2011 18:45:17 +0000 (19:45 +0100)]
css: Move a bunch of functions

... from GtkStyleProperty to GtkCssStyleProperty.

12 years agostyleproperty: Move id handling
Benjamin Otte [Sat, 31 Dec 2011 18:28:59 +0000 (19:28 +0100)]
styleproperty: Move id handling

only real style properties can have an id, so let
GtkCssStylePropertyClass handle it.

12 years agostyleproperty: Add gtk_style_property_assign()
Benjamin Otte [Sat, 31 Dec 2011 18:03:53 +0000 (19:03 +0100)]
styleproperty: Add gtk_style_property_assign()

12 years agostyleproperties: Use _gtk_style_property_get_value_type()
Benjamin Otte [Sat, 31 Dec 2011 16:58:30 +0000 (17:58 +0100)]
styleproperties: Use _gtk_style_property_get_value_type()

... and check the case where the property is not get/settable.

12 years agostyleproperty: Add GtkStyleProperty::value-type
Benjamin Otte [Sat, 31 Dec 2011 16:36:22 +0000 (17:36 +0100)]
styleproperty: Add GtkStyleProperty::value-type

12 years agostyleproperty: Use _gtk_style_property_get_name()
Benjamin Otte [Sat, 31 Dec 2011 15:40:06 +0000 (16:40 +0100)]
styleproperty: Use _gtk_style_property_get_name()

12 years agoshorthand: Add a property for all subproperties
Benjamin Otte [Sat, 31 Dec 2011 15:31:25 +0000 (16:31 +0100)]
shorthand: Add a property for all subproperties

12 years agostyleproperty: unconstify
Benjamin Otte [Sat, 31 Dec 2011 15:08:23 +0000 (16:08 +0100)]
styleproperty: unconstify

GtkStyleProperty is a real GObject now, so treat it like one and don't
use const.

12 years agostyleproperty: Remove unuse args from register()
Benjamin Otte [Sat, 31 Dec 2011 14:50:56 +0000 (15:50 +0100)]
styleproperty: Remove unuse args from register()

Those arguments are only relevant for shorthands.

12 years agostyleproperty: Add custom registration func for shorthands
Benjamin Otte [Sat, 31 Dec 2011 14:43:13 +0000 (15:43 +0100)]
styleproperty: Add custom registration func for shorthands

12 years agostyleproperty: Move shorthand declarations to new file
Benjamin Otte [Sat, 31 Dec 2011 14:05:09 +0000 (15:05 +0100)]
styleproperty: Move shorthand declarations to new file

12 years agostyleproperty: border image is not a generic conversion thingy
Benjamin Otte [Sat, 31 Dec 2011 13:55:26 +0000 (14:55 +0100)]
styleproperty: border image is not a generic conversion thingy

12 years agostyleproperty: Add a name property
Benjamin Otte [Sat, 31 Dec 2011 13:34:42 +0000 (14:34 +0100)]
styleproperty: Add a name property

And move the properties array to GtkStylePropertyClass.
Also add some docs.

12 years agostyleproperty: Get rid of _gtk_style_property_is_shorthand()
Benjamin Otte [Sat, 31 Dec 2011 12:50:03 +0000 (13:50 +0100)]
styleproperty: Get rid of _gtk_style_property_is_shorthand()

Use GTK_IS_CSS_SHORTHAND_PROPERTY() instead now that we have it.

12 years agostyleproperty: Split into shorthand and real style properties
Benjamin Otte [Sat, 31 Dec 2011 12:43:31 +0000 (13:43 +0100)]
styleproperty: Split into shorthand and real style properties

12 years agotests: Quit widget-factory when someone presses quit
Benjamin Otte [Sat, 31 Dec 2011 12:38:22 +0000 (13:38 +0100)]
tests: Quit widget-factory when someone presses quit

12 years agostyleproperty: Make this an object
Benjamin Otte [Sat, 31 Dec 2011 02:54:17 +0000 (03:54 +0100)]
styleproperty: Make this an object

12 years agostyleproperty: Add _gtk_style_property_query()
Benjamin Otte [Sat, 31 Dec 2011 00:14:47 +0000 (01:14 +0100)]
styleproperty: Add _gtk_style_property_query()

This way, we only need to export one function, not 3.

12 years agostyleproperties: Add _gtk_style_properties_peek_property()
Benjamin Otte [Sat, 31 Dec 2011 00:05:50 +0000 (01:05 +0100)]
styleproperties: Add _gtk_style_properties_peek_property()

12 years agostyleproperties: Remove unused function from private header
Benjamin Otte [Fri, 30 Dec 2011 23:54:51 +0000 (00:54 +0100)]
styleproperties: Remove unused function from private header

_gtk_style_properties_resolve_property() was added erroneously in
c09148ca09081cd009cb9a328441b4b43008e352 but was never implemented.

12 years agotests: Add a test for 'none'
Benjamin Otte [Fri, 30 Dec 2011 12:14:57 +0000 (13:14 +0100)]
tests: Add a test for 'none'

12 years agocss: 'none' is not a value background-repeat
Benjamin Otte [Fri, 30 Dec 2011 12:13:44 +0000 (13:13 +0100)]
css: 'none' is not a value background-repeat

12 years agocss: Remove generic 'none' handling
Benjamin Otte [Fri, 30 Dec 2011 11:51:03 +0000 (12:51 +0100)]
css: Remove generic 'none' handling

Includes updated tests.
Who could have thought that our tests were broken. Ooops.

12 years agowin32: Fix CSS for 'none' value going away
Benjamin Otte [Fri, 30 Dec 2011 11:53:51 +0000 (12:53 +0100)]
win32: Fix CSS for 'none' value going away

We want colors to be 'transparent' and not 'none'.

12 years agostyleproperty: Add custom 'none' handling
Benjamin Otte [Fri, 30 Dec 2011 11:44:16 +0000 (12:44 +0100)]
styleproperty: Add custom 'none' handling

The generic 'none' handling needs to go, because 'none' is not a valid
value most of the time.

12 years agoreftests: Add a test comparing inherit and initial
Benjamin Otte [Thu, 29 Dec 2011 21:05:10 +0000 (22:05 +0100)]
reftests: Add a test comparing inherit and initial

One test has all properties set to 'inherit', the other to 'initial'.
This should result in the same result, as inherit will ensure every
widget inherits the same value, and for the toplevel 'inherit' is
defined as being identical to 'initial'.