diff options
author | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-11-28 18:49:47 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-11-28 19:01:51 +0000 |
commit | 1779ae79a13029a4efb77b2ab4b39393a3a9c9b8 (patch) | |
tree | a6a00ed2d8e00b590c959be16b67ae7003308588 /gdk/tests | |
parent | b0bf2b5202782526edcba678c6239baecf897b16 (diff) | |
download | gtk+-1779ae79a13029a4efb77b2ab4b39393a3a9c9b8.tar.gz |
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.
https://bugzilla.gnome.org/show_bug.cgi?id=635879
Diffstat (limited to 'gdk/tests')
-rw-r--r-- | gdk/tests/gdk-color.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gdk/tests/gdk-color.c b/gdk/tests/gdk-color.c index 2dbe2ad248..008f425e28 100644 --- a/gdk/tests/gdk-color.c +++ b/gdk/tests/gdk-color.c @@ -8,17 +8,17 @@ test_color_parse (void) GdkRGBA expected; gboolean res; - res = gdk_rgba_parse ("foo", &color); + res = gdk_rgba_parse (&color, "foo"); g_assert (!res); - res = gdk_rgba_parse ("", &color); + res = gdk_rgba_parse (&color, ""); g_assert (!res); expected.red = 100/255.; expected.green = 90/255.; expected.blue = 80/255.; expected.alpha = 0.1; - res = gdk_rgba_parse ("rgba(100,90,80,0.1)", &color); + res = gdk_rgba_parse (&color, "rgba(100,90,80,0.1)"); g_assert (res); g_assert (gdk_rgba_equal (&color, &expected)); @@ -26,11 +26,11 @@ test_color_parse (void) expected.green = 0.3; expected.blue = 0.2; expected.alpha = 0.1; - res = gdk_rgba_parse ("rgba(40%,30%,20%,0.1)", &color); + res = gdk_rgba_parse (&color, "rgba(40%,30%,20%,0.1)"); g_assert (res); g_assert (gdk_rgba_equal (&color, &expected)); - res = gdk_rgba_parse ("rgba( 40 % , 30 % , 20 % , 0.1 )", &color); + res = gdk_rgba_parse (&color, "rgba( 40 % , 30 % , 20 % , 0.1 )"); g_assert (res); g_assert (gdk_rgba_equal (&color, &expected)); @@ -38,7 +38,7 @@ test_color_parse (void) expected.green = 0.0; expected.blue = 0.0; expected.alpha = 1.0; - res = gdk_rgba_parse ("red", &color); + res = gdk_rgba_parse (&color, "red"); g_assert (res); g_assert (gdk_rgba_equal (&color, &expected)); @@ -46,7 +46,7 @@ test_color_parse (void) expected.green = 0x8080 / 65535.; expected.blue = 1.0; expected.alpha = 1.0; - res = gdk_rgba_parse ("#0080ff", &color); + res = gdk_rgba_parse (&color, "#0080ff"); g_assert (res); g_assert (gdk_rgba_equal (&color, &expected)); } @@ -71,7 +71,7 @@ test_color_to_string (void) orig = g_strdup (setlocale (LC_ALL, NULL)); res = gdk_rgba_to_string (&rgba); - gdk_rgba_parse (res, &out); + gdk_rgba_parse (&out, res); g_assert (gdk_rgba_equal (&rgba, &out)); setlocale (LC_ALL, "de_DE.utf-8"); |