diff --git a/src/st/st-icon-colors.c b/src/st/st-icon-colors.c index 21bec6ee3..8c5b8d35a 100644 --- a/src/st/st-icon-colors.c +++ b/src/st/st-icon-colors.c @@ -102,6 +102,29 @@ st_icon_colors_copy (StIconColors *colors) return copy; } +/** + * st_icon_colors_equal: + * @colors: a #StIconColors + * @other: another #StIconColors + * + * Returns: %TRUE if the #StIconColors are equal + */ +gboolean +st_icon_colors_equal (StIconColors *colors, + StIconColors *other) +{ + if (colors == other) + return TRUE; + + if (colors == NULL || other == NULL) + return FALSE; + + return clutter_color_equal (&colors->foreground, &other->foreground) && + clutter_color_equal (&colors->warning, &other->warning) && + clutter_color_equal (&colors->error, &other->error) && + clutter_color_equal (&colors->success, &other->success); +} + G_DEFINE_BOXED_TYPE (StIconColors, st_icon_colors, st_icon_colors_ref, diff --git a/src/st/st-icon-colors.h b/src/st/st-icon-colors.h index b582308a5..e994a7522 100644 --- a/src/st/st-icon-colors.h +++ b/src/st/st-icon-colors.h @@ -35,6 +35,8 @@ StIconColors *st_icon_colors_new (void); StIconColors *st_icon_colors_ref (StIconColors *colors); void st_icon_colors_unref (StIconColors *colors); StIconColors *st_icon_colors_copy (StIconColors *colors); +gboolean st_icon_colors_equal (StIconColors *colors, + StIconColors *other); G_END_DECLS