We require a C compiler supporting C99 now. The main purpose of
these fallbacks was for MSVC. From what I can see this is now all supported
by MSVC 2015+ anyway.
The only other change this includes is to replace isnanf() with the
(type infering) C99 isnan() macro, because MSVC doesn't provide isnanf().
CSS does not do exponents, so printing numbers close to 0 as 1.234e-15
does not work.
Also up the accuracy to 17 digits because that's what everyone else
uses.
This function is a (private) function to parse a GdkRGBA accoridng to
the CSS specs. We should probably use it for gdk_rgba_parse(), but that
would change the syntax we accept there...
This also introduces a dependency of libgdk on libgtkcss.
So far, no users for this function exist.
* We don't output spaces anywhere in the code, unlike the doc suggested.
* CSS explicitly forbids whitespace between function names and lparens:
https://stackoverflow.com/questions/13877198
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
Since parse() is a method of the Gdk.RGBA class, the GdkRGBA pointer
should be the first argument, and the string the second one, to allow a
more natural binding.
https://bugzilla.gnome.org/show_bug.cgi?id=635879
CSS3 defines a somewhat odd syntax for rgba() colors - the rgb values
are integers from 0 to 255 or percentages and the a value is a
float from 0 to 1. To avoid increasing the total amount of confusion
in the world, make gdk_rgb_to_string() and gdk_rgb_parse() follow
this syntax rather than using floats for r, g, and b.
https://bugzilla.gnome.org/show_bug.cgi?id=633762
GdkRGBA is a boxed struct similar to GdkColor, with the difference
that it stores alpha information as well, and colors are stored in
[0..1] doubles, in the cairo spirit.
gdk_cairo_set_source_rgba() has been also added to allow easier handling
of this new type.