Beispiel #1
0
/**
 * gimp_color_profile_get_summary:
 * @profile: a #GimpColorProfile
 *
 * This function return a string containing a multi-line summary of
 * @profile's description, model, manufacturer and copyright, to be
 * used as detailled information about the profile in a user
 * interface.
 *
 * Return value: the @profile's summary. The returned value belongs to
 *               @profile and must not be modified or freed.
 *
 * Since: 2.10
 **/
const gchar *
gimp_color_profile_get_summary (GimpColorProfile *profile)
{
  g_return_val_if_fail (GIMP_IS_COLOR_PROFILE (profile), NULL);

  if (! profile->priv->summary)
    {
      GString     *string = g_string_new (NULL);
      const gchar *text;

      text = gimp_color_profile_get_description (profile);
      if (text)
        g_string_append (string, text);

      text = gimp_color_profile_get_model (profile);
      if (text)
        {
          if (string->len > 0)
            g_string_append (string, "\n");

          g_string_append_printf (string, _("Model: %s"), text);
        }

      text = gimp_color_profile_get_manufacturer (profile);
      if (text)
        {
          if (string->len > 0)
            g_string_append (string, "\n");

          g_string_append_printf (string, _("Manufacturer: %s"), text);
        }

      text = gimp_color_profile_get_copyright (profile);
      if (text)
        {
          if (string->len > 0)
            g_string_append (string, "\n");

          g_string_append_printf (string, _("Copyright: %s"), text);
        }

      profile->priv->summary = g_string_free (string, FALSE);
    }

  return profile->priv->summary;
}
Beispiel #2
0
/**
 * gimp_color_profile_get_summary:
 * @profile: a #GimpColorProfile
 *
 * This function return a newly allocated string containing a
 * multi-line summary of @profile's description, model, manufacturer
 * and copyright, to be used as detailled information about the
 * prpfile in a user interface.
 *
 * Return value: the @profile's summary. Free with g_free().
 *
 * Since: 2.10
 **/
gchar *
gimp_color_profile_get_summary (GimpColorProfile profile)
{
  GString *string;
  gchar   *text;

  g_return_val_if_fail (profile != NULL, NULL);

  string = g_string_new (NULL);

  text = gimp_color_profile_get_description (profile);
  if (text)
    {
      g_string_append (string, text);
      g_free (text);
    }

  text = gimp_color_profile_get_model (profile);
  if (text)
    {
      if (string->len > 0)
        g_string_append (string, "\n");

      g_string_append (string, text);
    }

  text = gimp_color_profile_get_manufacturer (profile);
  if (text)
    {
      if (string->len > 0)
        g_string_append (string, "\n");

      g_string_append (string, text);
    }

  text = gimp_color_profile_get_copyright (profile);
  if (text)
    {
      if (string->len > 0)
        g_string_append (string, "\n");

      g_string_append (string, text);
    }

  return g_string_free (string, FALSE);
}