Commit 3b79e36d authored by Martin Nordholts's avatar Martin Nordholts

New method to get a string representation of the image type.

* app/core/gimpimage.[ch] (gimp_image_get_type_string): New method
to get a string representation of the image type.

* app/display/gimpdisplayshell-title.c
(gimp_display_shell_format_title): Ask the GimpImage for an image
type string instead of making assumptions about its
implementation.

svn path=/trunk/; revision=27947
parent d5b91835
2009-01-25 Martin Nordholts <martinn@svn.gnome.org>
* app/core/gimpimage.[ch] (gimp_image_get_type_string): New method
to get a string representation of the image type.
* app/display/gimpdisplayshell-title.c
(gimp_display_shell_format_title): Ask the GimpImage for an image
type string instead of making assumptions about its
implementation.
2009-01-25 Martin Nordholts <martinn@svn.gnome.org>
* app/base/temp-buf.c (temp_buf_copy): Bail out if we fail to
......
......@@ -3713,6 +3713,25 @@ gimp_image_position_vectors (GimpImage *image,
return TRUE;
}
const gchar *
gimp_image_get_type_string (GimpImage *image)
{
gboolean empty = gimp_image_is_empty (image);
switch (gimp_image_base_type (image))
{
case GIMP_RGB:
return empty ? _("RGB-empty") : _("RGB");
case GIMP_GRAY:
return empty ? _("grayscale-empty") : _("grayscale");
case GIMP_INDEXED:
return empty ? _("indexed-empty") : _("indexed");
default:
return "unkown";
break;
}
}
gboolean
gimp_image_layer_boundary (const GimpImage *image,
BoundSeg **segs,
......
......@@ -544,6 +544,7 @@ gboolean gimp_image_position_vectors (GimpImage *image,
gint new_index,
gboolean push_undo,
const gchar *undo_desc);
const gchar * gimp_image_get_type_string (GimpImage *image);
gboolean gimp_image_layer_boundary (const GimpImage *image,
BoundSeg **segs,
......
......@@ -218,28 +218,7 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
break;
case 't': /* type */
{
const gchar *image_type_str = NULL;
gboolean empty = gimp_image_is_empty (image);
switch (gimp_image_base_type (image))
{
case GIMP_RGB:
image_type_str = empty ? _("RGB-empty") : _("RGB");
break;
case GIMP_GRAY:
image_type_str = empty ? _("grayscale-empty") : _("grayscale");
break;
case GIMP_INDEXED:
image_type_str = empty ? _("indexed-empty") : _("indexed");
break;
default:
g_assert_not_reached ();
break;
}
i += print (title, title_len, i, "%s", image_type_str);
}
i += print (title, title_len, i, "%s", gimp_image_get_type_string (image));
break;
case 's': /* user source zoom factor */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment