GNOME Bugzilla – Bug 635879
Change the gdk_rgba_parse() function to something usable from language bindings
Last modified: 2010-11-29 12:47:50 UTC
the GdkRGBA.parse() function inherited the wrong signature from GdkColor: gboolean gdk_rgba_parse (const char *string, GdkRGBA *color); this leads to odd, or ad hoc bindings for other languages - and with introspection it results in something that has to be special-cased. the correct function signature should be: gboolean gdk_rgba_parse (GdkRGBA *color, const char *string); which will translate into: color.parse(string) instead of: Gdk.RGBA.parse(string, color); for prior art, I submit clutter_color_from_string(), which had to be fixed for the very same reason. the patch is trivial, and I can cook it up in 5 minutes.
> the patch is trivial, and I can cook it up in 5 minut If you can do it before Monday, I can include it in 2.91.5.
Created attachment 175426 [details] [review] rgba: Invert the arguments and improve bindability 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.
Review of attachment 175426 [details] [review]: Looks easy enough. Of course, rebasing gtk-style-context will be a bit more work...
Attachment 175426 [details] pushed as 1779ae7 - rgba: Invert the arguments and improve bindability
Created attachment 175458 [details] [review] rgba: Invert the arguments and improve bindability 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.