Commit 7590b2da authored by Nick Lamb /GIMP's avatar Nick Lamb /GIMP

Fixed #2169 and as a side-effect discovered that RGB_IMAGE means

something quite different for app vs plug-ins. The one in app is
now called RGB_IMAGE_OK to differentiate them.
parent 1c830d9c
Thu Oct 14 04:59:11 BST 1999 Nick Lamb <njl195@zepler.org>
* app/plug_in.h
* app/fileops.c
* app/plug_in.c
Fixed #2169 and as a side-effect discovered that RGB_IMAGE means
something quite different for app vs plug-ins. The one in app is
now called RGB_IMAGE_OK to differentiate them.
* app/image_new.c: Still using RGB_IMAGE instead of GIMAGE (!)
Mon Oct 18 21:24:47 BST 1999 Andy Thomas <alt@gimp.org>
* app/bezier_select.c
......
......@@ -1257,22 +1257,22 @@ plug_in_set_menu_sensitivity (GimpImageType type)
switch (type)
{
case RGB_GIMAGE:
sensitive = proc_def->image_types_val & RGB_IMAGE;
sensitive = proc_def->image_types_val & RGB_IMAGE_OK;
break;
case RGBA_GIMAGE:
sensitive = proc_def->image_types_val & RGBA_IMAGE;
sensitive = proc_def->image_types_val & RGBA_IMAGE_OK;
break;
case GRAY_GIMAGE:
sensitive = proc_def->image_types_val & GRAY_IMAGE;
sensitive = proc_def->image_types_val & GRAY_IMAGE_OK;
break;
case GRAYA_GIMAGE:
sensitive = proc_def->image_types_val & GRAYA_IMAGE;
sensitive = proc_def->image_types_val & GRAYA_IMAGE_OK;
break;
case INDEXED_GIMAGE:
sensitive = proc_def->image_types_val & INDEXED_IMAGE;
sensitive = proc_def->image_types_val & INDEXED_IMAGE_OK;
break;
case INDEXEDA_GIMAGE:
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE;
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE_OK;
break;
default:
sensitive = FALSE;
......@@ -3114,7 +3114,7 @@ plug_in_image_types_parse (char *image_types)
int types;
if (!image_types)
return (RGB_IMAGE | GRAY_IMAGE | INDEXED_IMAGE);
return (RGB_IMAGE_OK | GRAY_IMAGE_OK | INDEXED_IMAGE_OK);
types = 0;
......@@ -3130,47 +3130,47 @@ plug_in_image_types_parse (char *image_types)
{
if (strncmp (image_types, "RGBA", 4) == 0)
{
types |= RGBA_IMAGE;
types |= RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB*", 4) == 0)
{
types |= RGB_IMAGE | RGBA_IMAGE;
types |= RGB_IMAGE_OK | RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB", 3) == 0)
{
types |= RGB_IMAGE;
types |= RGB_IMAGE_OK;
image_types += 3;
}
else if (strncmp (image_types, "GRAYA", 5) == 0)
{
types |= GRAYA_IMAGE;
types |= GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY*", 5) == 0)
{
types |= GRAY_IMAGE | GRAYA_IMAGE;
types |= GRAY_IMAGE_OK | GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY", 4) == 0)
{
types |= GRAY_IMAGE;
types |= GRAY_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "INDEXEDA", 8) == 0)
{
types |= INDEXEDA_IMAGE;
types |= INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED*", 8) == 0)
{
types |= INDEXED_IMAGE | INDEXEDA_IMAGE;
types |= INDEXED_IMAGE_OK | INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED", 7) == 0)
{
types |= INDEXED_IMAGE;
types |= INDEXED_IMAGE_OK;
image_types += 7;
}
else
......
......@@ -518,16 +518,25 @@ file_save_as_callback (GtkWidget *widget,
save_options, FALSE, FALSE, 5);
}
switch (gdisplay->gimage->base_type)
switch (gimage_base_type_with_alpha (gdisplay->gimage))
{
case RGB:
file_update_menus (save_procs, RGB_IMAGE);
case RGB_GIMAGE:
file_update_menus (save_procs, RGB_IMAGE_OK);
break;
case GRAY:
file_update_menus (save_procs, GRAY_IMAGE);
case RGBA_GIMAGE:
file_update_menus (save_procs, RGBA_IMAGE_OK);
break;
case INDEXED:
file_update_menus (save_procs, INDEXED_IMAGE);
case GRAY_GIMAGE:
file_update_menus (save_procs, GRAY_IMAGE_OK);
break;
case GRAYA_GIMAGE:
file_update_menus (save_procs, GRAYA_IMAGE_OK);
break;
case INDEXED_GIMAGE:
file_update_menus (save_procs, INDEXED_IMAGE_OK);
break;
case INDEXEDA_GIMAGE:
file_update_menus (save_procs, INDEXEDA_IMAGE_OK);
break;
}
......
......@@ -1257,22 +1257,22 @@ plug_in_set_menu_sensitivity (GimpImageType type)
switch (type)
{
case RGB_GIMAGE:
sensitive = proc_def->image_types_val & RGB_IMAGE;
sensitive = proc_def->image_types_val & RGB_IMAGE_OK;
break;
case RGBA_GIMAGE:
sensitive = proc_def->image_types_val & RGBA_IMAGE;
sensitive = proc_def->image_types_val & RGBA_IMAGE_OK;
break;
case GRAY_GIMAGE:
sensitive = proc_def->image_types_val & GRAY_IMAGE;
sensitive = proc_def->image_types_val & GRAY_IMAGE_OK;
break;
case GRAYA_GIMAGE:
sensitive = proc_def->image_types_val & GRAYA_IMAGE;
sensitive = proc_def->image_types_val & GRAYA_IMAGE_OK;
break;
case INDEXED_GIMAGE:
sensitive = proc_def->image_types_val & INDEXED_IMAGE;
sensitive = proc_def->image_types_val & INDEXED_IMAGE_OK;
break;
case INDEXEDA_GIMAGE:
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE;
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE_OK;
break;
default:
sensitive = FALSE;
......@@ -3114,7 +3114,7 @@ plug_in_image_types_parse (char *image_types)
int types;
if (!image_types)
return (RGB_IMAGE | GRAY_IMAGE | INDEXED_IMAGE);
return (RGB_IMAGE_OK | GRAY_IMAGE_OK | INDEXED_IMAGE_OK);
types = 0;
......@@ -3130,47 +3130,47 @@ plug_in_image_types_parse (char *image_types)
{
if (strncmp (image_types, "RGBA", 4) == 0)
{
types |= RGBA_IMAGE;
types |= RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB*", 4) == 0)
{
types |= RGB_IMAGE | RGBA_IMAGE;
types |= RGB_IMAGE_OK | RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB", 3) == 0)
{
types |= RGB_IMAGE;
types |= RGB_IMAGE_OK;
image_types += 3;
}
else if (strncmp (image_types, "GRAYA", 5) == 0)
{
types |= GRAYA_IMAGE;
types |= GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY*", 5) == 0)
{
types |= GRAY_IMAGE | GRAYA_IMAGE;
types |= GRAY_IMAGE_OK | GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY", 4) == 0)
{
types |= GRAY_IMAGE;
types |= GRAY_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "INDEXEDA", 8) == 0)
{
types |= INDEXEDA_IMAGE;
types |= INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED*", 8) == 0)
{
types |= INDEXED_IMAGE | INDEXEDA_IMAGE;
types |= INDEXED_IMAGE_OK | INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED", 7) == 0)
{
types |= INDEXED_IMAGE;
types |= INDEXED_IMAGE_OK;
image_types += 7;
}
else
......
......@@ -1257,22 +1257,22 @@ plug_in_set_menu_sensitivity (GimpImageType type)
switch (type)
{
case RGB_GIMAGE:
sensitive = proc_def->image_types_val & RGB_IMAGE;
sensitive = proc_def->image_types_val & RGB_IMAGE_OK;
break;
case RGBA_GIMAGE:
sensitive = proc_def->image_types_val & RGBA_IMAGE;
sensitive = proc_def->image_types_val & RGBA_IMAGE_OK;
break;
case GRAY_GIMAGE:
sensitive = proc_def->image_types_val & GRAY_IMAGE;
sensitive = proc_def->image_types_val & GRAY_IMAGE_OK;
break;
case GRAYA_GIMAGE:
sensitive = proc_def->image_types_val & GRAYA_IMAGE;
sensitive = proc_def->image_types_val & GRAYA_IMAGE_OK;
break;
case INDEXED_GIMAGE:
sensitive = proc_def->image_types_val & INDEXED_IMAGE;
sensitive = proc_def->image_types_val & INDEXED_IMAGE_OK;
break;
case INDEXEDA_GIMAGE:
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE;
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE_OK;
break;
default:
sensitive = FALSE;
......@@ -3114,7 +3114,7 @@ plug_in_image_types_parse (char *image_types)
int types;
if (!image_types)
return (RGB_IMAGE | GRAY_IMAGE | INDEXED_IMAGE);
return (RGB_IMAGE_OK | GRAY_IMAGE_OK | INDEXED_IMAGE_OK);
types = 0;
......@@ -3130,47 +3130,47 @@ plug_in_image_types_parse (char *image_types)
{
if (strncmp (image_types, "RGBA", 4) == 0)
{
types |= RGBA_IMAGE;
types |= RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB*", 4) == 0)
{
types |= RGB_IMAGE | RGBA_IMAGE;
types |= RGB_IMAGE_OK | RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB", 3) == 0)
{
types |= RGB_IMAGE;
types |= RGB_IMAGE_OK;
image_types += 3;
}
else if (strncmp (image_types, "GRAYA", 5) == 0)
{
types |= GRAYA_IMAGE;
types |= GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY*", 5) == 0)
{
types |= GRAY_IMAGE | GRAYA_IMAGE;
types |= GRAY_IMAGE_OK | GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY", 4) == 0)
{
types |= GRAY_IMAGE;
types |= GRAY_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "INDEXEDA", 8) == 0)
{
types |= INDEXEDA_IMAGE;
types |= INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED*", 8) == 0)
{
types |= INDEXED_IMAGE | INDEXEDA_IMAGE;
types |= INDEXED_IMAGE_OK | INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED", 7) == 0)
{
types |= INDEXED_IMAGE;
types |= INDEXED_IMAGE_OK;
image_types += 7;
}
else
......
......@@ -208,7 +208,7 @@ image_new_create_image (const GimpImageNewValues *values)
type = (values->type == RGB) ? RGBA_GIMAGE : GRAYA_GIMAGE;
break;
default:
type = RGB_IMAGE;
type = RGB_GIMAGE;
break;
}
......
......@@ -1257,22 +1257,22 @@ plug_in_set_menu_sensitivity (GimpImageType type)
switch (type)
{
case RGB_GIMAGE:
sensitive = proc_def->image_types_val & RGB_IMAGE;
sensitive = proc_def->image_types_val & RGB_IMAGE_OK;
break;
case RGBA_GIMAGE:
sensitive = proc_def->image_types_val & RGBA_IMAGE;
sensitive = proc_def->image_types_val & RGBA_IMAGE_OK;
break;
case GRAY_GIMAGE:
sensitive = proc_def->image_types_val & GRAY_IMAGE;
sensitive = proc_def->image_types_val & GRAY_IMAGE_OK;
break;
case GRAYA_GIMAGE:
sensitive = proc_def->image_types_val & GRAYA_IMAGE;
sensitive = proc_def->image_types_val & GRAYA_IMAGE_OK;
break;
case INDEXED_GIMAGE:
sensitive = proc_def->image_types_val & INDEXED_IMAGE;
sensitive = proc_def->image_types_val & INDEXED_IMAGE_OK;
break;
case INDEXEDA_GIMAGE:
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE;
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE_OK;
break;
default:
sensitive = FALSE;
......@@ -3114,7 +3114,7 @@ plug_in_image_types_parse (char *image_types)
int types;
if (!image_types)
return (RGB_IMAGE | GRAY_IMAGE | INDEXED_IMAGE);
return (RGB_IMAGE_OK | GRAY_IMAGE_OK | INDEXED_IMAGE_OK);
types = 0;
......@@ -3130,47 +3130,47 @@ plug_in_image_types_parse (char *image_types)
{
if (strncmp (image_types, "RGBA", 4) == 0)
{
types |= RGBA_IMAGE;
types |= RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB*", 4) == 0)
{
types |= RGB_IMAGE | RGBA_IMAGE;
types |= RGB_IMAGE_OK | RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB", 3) == 0)
{
types |= RGB_IMAGE;
types |= RGB_IMAGE_OK;
image_types += 3;
}
else if (strncmp (image_types, "GRAYA", 5) == 0)
{
types |= GRAYA_IMAGE;
types |= GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY*", 5) == 0)
{
types |= GRAY_IMAGE | GRAYA_IMAGE;
types |= GRAY_IMAGE_OK | GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY", 4) == 0)
{
types |= GRAY_IMAGE;
types |= GRAY_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "INDEXEDA", 8) == 0)
{
types |= INDEXEDA_IMAGE;
types |= INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED*", 8) == 0)
{
types |= INDEXED_IMAGE | INDEXEDA_IMAGE;
types |= INDEXED_IMAGE_OK | INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED", 7) == 0)
{
types |= INDEXED_IMAGE;
types |= INDEXED_IMAGE_OK;
image_types += 7;
}
else
......
......@@ -1257,22 +1257,22 @@ plug_in_set_menu_sensitivity (GimpImageType type)
switch (type)
{
case RGB_GIMAGE:
sensitive = proc_def->image_types_val & RGB_IMAGE;
sensitive = proc_def->image_types_val & RGB_IMAGE_OK;
break;
case RGBA_GIMAGE:
sensitive = proc_def->image_types_val & RGBA_IMAGE;
sensitive = proc_def->image_types_val & RGBA_IMAGE_OK;
break;
case GRAY_GIMAGE:
sensitive = proc_def->image_types_val & GRAY_IMAGE;
sensitive = proc_def->image_types_val & GRAY_IMAGE_OK;
break;
case GRAYA_GIMAGE:
sensitive = proc_def->image_types_val & GRAYA_IMAGE;
sensitive = proc_def->image_types_val & GRAYA_IMAGE_OK;
break;
case INDEXED_GIMAGE:
sensitive = proc_def->image_types_val & INDEXED_IMAGE;
sensitive = proc_def->image_types_val & INDEXED_IMAGE_OK;
break;
case INDEXEDA_GIMAGE:
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE;
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE_OK;
break;
default:
sensitive = FALSE;
......@@ -3114,7 +3114,7 @@ plug_in_image_types_parse (char *image_types)
int types;
if (!image_types)
return (RGB_IMAGE | GRAY_IMAGE | INDEXED_IMAGE);
return (RGB_IMAGE_OK | GRAY_IMAGE_OK | INDEXED_IMAGE_OK);
types = 0;
......@@ -3130,47 +3130,47 @@ plug_in_image_types_parse (char *image_types)
{
if (strncmp (image_types, "RGBA", 4) == 0)
{
types |= RGBA_IMAGE;
types |= RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB*", 4) == 0)
{
types |= RGB_IMAGE | RGBA_IMAGE;
types |= RGB_IMAGE_OK | RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB", 3) == 0)
{
types |= RGB_IMAGE;
types |= RGB_IMAGE_OK;
image_types += 3;
}
else if (strncmp (image_types, "GRAYA", 5) == 0)
{
types |= GRAYA_IMAGE;
types |= GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY*", 5) == 0)
{
types |= GRAY_IMAGE | GRAYA_IMAGE;
types |= GRAY_IMAGE_OK | GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY", 4) == 0)
{
types |= GRAY_IMAGE;
types |= GRAY_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "INDEXEDA", 8) == 0)
{
types |= INDEXEDA_IMAGE;
types |= INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED*", 8) == 0)
{
types |= INDEXED_IMAGE | INDEXEDA_IMAGE;
types |= INDEXED_IMAGE_OK | INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED", 7) == 0)
{
types |= INDEXED_IMAGE;
types |= INDEXED_IMAGE_OK;
image_types += 7;
}
else
......
......@@ -1257,22 +1257,22 @@ plug_in_set_menu_sensitivity (GimpImageType type)
switch (type)
{
case RGB_GIMAGE:
sensitive = proc_def->image_types_val & RGB_IMAGE;
sensitive = proc_def->image_types_val & RGB_IMAGE_OK;
break;
case RGBA_GIMAGE:
sensitive = proc_def->image_types_val & RGBA_IMAGE;
sensitive = proc_def->image_types_val & RGBA_IMAGE_OK;
break;
case GRAY_GIMAGE:
sensitive = proc_def->image_types_val & GRAY_IMAGE;
sensitive = proc_def->image_types_val & GRAY_IMAGE_OK;
break;
case GRAYA_GIMAGE:
sensitive = proc_def->image_types_val & GRAYA_IMAGE;
sensitive = proc_def->image_types_val & GRAYA_IMAGE_OK;
break;
case INDEXED_GIMAGE:
sensitive = proc_def->image_types_val & INDEXED_IMAGE;
sensitive = proc_def->image_types_val & INDEXED_IMAGE_OK;
break;
case INDEXEDA_GIMAGE:
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE;
sensitive = proc_def->image_types_val & INDEXEDA_IMAGE_OK;
break;
default:
sensitive = FALSE;
......@@ -3114,7 +3114,7 @@ plug_in_image_types_parse (char *image_types)
int types;
if (!image_types)
return (RGB_IMAGE | GRAY_IMAGE | INDEXED_IMAGE);
return (RGB_IMAGE_OK | GRAY_IMAGE_OK | INDEXED_IMAGE_OK);
types = 0;
......@@ -3130,47 +3130,47 @@ plug_in_image_types_parse (char *image_types)
{
if (strncmp (image_types, "RGBA", 4) == 0)
{
types |= RGBA_IMAGE;
types |= RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB*", 4) == 0)
{
types |= RGB_IMAGE | RGBA_IMAGE;
types |= RGB_IMAGE_OK | RGBA_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "RGB", 3) == 0)
{
types |= RGB_IMAGE;
types |= RGB_IMAGE_OK;
image_types += 3;
}
else if (strncmp (image_types, "GRAYA", 5) == 0)
{
types |= GRAYA_IMAGE;
types |= GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY*", 5) == 0)
{
types |= GRAY_IMAGE | GRAYA_IMAGE;
types |= GRAY_IMAGE_OK | GRAYA_IMAGE_OK;
image_types += 5;
}
else if (strncmp (image_types, "GRAY", 4) == 0)
{
types |= GRAY_IMAGE;
types |= GRAY_IMAGE_OK;
image_types += 4;
}
else if (strncmp (image_types, "INDEXEDA", 8) == 0)
{
types |= INDEXEDA_IMAGE;
types |= INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED*", 8) == 0)
{
types |= INDEXED_IMAGE | INDEXEDA_IMAGE;
types |= INDEXED_IMAGE_OK | INDEXEDA_IMAGE_OK;
image_types += 8;
}
else if (strncmp (image_types, "INDEXED", 7) == 0)
{
types |= INDEXED_IMAGE;
types |= INDEXED_IMAGE_OK;
image_types += 7;