Commit a611f063 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

removed GimpImageBaseType enum ...

2001-12-11  Sven Neumann  <sven@gimp.org>

	* app/core/core-types.h: removed GimpImageBaseType enum ...

	* app/core/core-enums.h: and added it here with proper namespace
	(enum values prefixed with GIMP_).

	* app/gimprc.c
	* app/core/gimpcoreconfig.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpdrawable-preview.c
	* app/core/gimpdrawable.c
	* app/core/gimpedit.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-mask.c
	* app/core/gimpimage-merge.c
	* app/core/gimpimage-new.c
	* app/core/gimpimage-projection.c
	* app/core/gimpimage.c
	* app/core/gimplayer.c
	* app/core/gimppalette-import.c
	* app/display/gimpdisplay-handlers.c
	* app/display/gimpdisplayshell-dnd.c
	* app/display/gimpdisplayshell.c
	* app/file/file-utils.c
	* app/gui/colormap-dialog.c
	* app/gui/convert-dialog.c
	* app/gui/info-window.c
	* app/gui/layers-commands.c
	* app/gui/palette-import-dialog.c
	* app/gui/preferences-dialog.c
	* app/gui/toolbox.c
	* app/tools/gimpclonetool.c
	* app/tools/gimppainttool.c
	* app/widgets/gimpchannellistview.c
	* tools/pdbgen/Makefile.am
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/image.pdb: changed accordingly.

	* tools/pdbgen/enums.pl
	* app/pdb/convert_cmds.c
	* app/pdb/image_cmds.c
	* libgimp/gimpconvert_pdb.c
	* libgimp/gimpimage_pdb.c: regenerated.

	* app/config/Makefile.am
	* app/config/gimpconfig-params.h
	* app/config/gimpconfig-serialize.c
	* app/config/gimpcoreconfig.[ch]: added more stuff to GimpCoreConfig.
parent 3bd3300d
2001-12-11 Sven Neumann <sven@gimp.org>
* app/core/core-types.h: removed GimpImageBaseType enum ...
* app/core/core-enums.h: and added it here with proper namespace
(enum values prefixed with GIMP_).
* app/gimprc.c
* app/core/gimpcoreconfig.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-preview.c
* app/core/gimpdrawable.c
* app/core/gimpedit.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-new.c
* app/core/gimpimage-projection.c
* app/core/gimpimage.c
* app/core/gimplayer.c
* app/core/gimppalette-import.c
* app/display/gimpdisplay-handlers.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell.c
* app/file/file-utils.c
* app/gui/colormap-dialog.c
* app/gui/convert-dialog.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/gui/preferences-dialog.c
* app/gui/toolbox.c
* app/tools/gimpclonetool.c
* app/tools/gimppainttool.c
* app/widgets/gimpchannellistview.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/pdb/convert.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly.
* tools/pdbgen/enums.pl
* app/pdb/convert_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpconvert_pdb.c
* libgimp/gimpimage_pdb.c: regenerated.
* app/config/Makefile.am
* app/config/gimpconfig-params.h
* app/config/gimpconfig-serialize.c
* app/config/gimpcoreconfig.[ch]: added more stuff to GimpCoreConfig.
2001-12-10 Sven Neumann <sven@gimp.org>
* libgimpbase/Makefile.am
......
......@@ -1258,7 +1258,7 @@ layers_menu_update (GtkItemFactory *factory,
alpha = layer && gimp_layer_has_alpha (layer);
lp = ! gimp_image_is_empty (gimage);
indexed = (gimp_image_base_type (gimage) == INDEXED);
indexed = (gimp_image_base_type (gimage) == GIMP_INDEXED);
for (list = GIMP_LIST (gimage->layers)->list;
list;
......
......@@ -40,13 +40,14 @@ INCLUDES = @STRIP_BEGIN@ \
#
noinst_PROGRAMS = test-config
test_config_DEPENDENCIES = @STRIP_BEGIN@ \
libappconfig.a \
../base/libappbase.a \
test_config_DEPENDENCIES = @STRIP_BEGIN@ \
libappconfig.a \
../base/libappbase.a \
../core/libappcore.a \
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
@STRIP_END@
test_config_LDADD = @STRIP_BEGIN@ \
$(GLIB_LIBS) \
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
$(test_config_DEPENDENCIES) \
test_config_LDADD = @STRIP_BEGIN@ \
$(GLIB_LIBS) \
$(test_config_DEPENDENCIES) \
@STRIP_END@
......@@ -51,20 +51,20 @@ GParamSpec * gimp_param_spec_path (const gchar *name,
/* some convenience macros to install object properties */
#define GIMP_CONFIG_INSTALL_PROP_UINT(class, id, name, min, max, default)\
#define GIMP_CONFIG_INSTALL_PROP_BOOLEAN(class, id, name, default)\
g_object_class_install_property (class, id,\
g_param_spec_uint (name, NULL, NULL,\
min, max, default,\
g_param_spec_boolean (name, NULL, NULL,\
default,\
G_PARAM_READWRITE | G_PARAM_CONSTRUCT))
#define GIMP_CONFIG_INSTALL_PROP_ENUM(class, id, name, enum_type, default)\
g_object_class_install_property (class, id,\
g_param_spec_enum (name, NULL, NULL,\
enum_type, default,\
G_PARAM_READWRITE | G_PARAM_CONSTRUCT))
#define GIMP_CONFIG_INSTALL_PROP_BOOLEAN(class, id, name, default)\
#define GIMP_CONFIG_INSTALL_PROP_INT(class, id, name, min, max, default)\
g_object_class_install_property (class, id,\
g_param_spec_boolean (name, NULL, NULL,\
default,\
g_param_spec_int (name, NULL, NULL,\
min, max, default,\
G_PARAM_READWRITE | G_PARAM_CONSTRUCT))
#define GIMP_CONFIG_INSTALL_PROP_MEMSIZE(class, id, name, min, max, default)\
g_object_class_install_property (class, id,\
......@@ -76,6 +76,16 @@ GParamSpec * gimp_param_spec_path (const gchar *name,
gimp_param_spec_path (name, NULL, NULL,\
default,\
G_PARAM_READWRITE | G_PARAM_CONSTRUCT))
#define GIMP_CONFIG_INSTALL_PROP_STRING(class, id, name, default)\
g_object_class_install_property (class, id,\
g_param_spec_string (name, NULL, NULL,\
default,\
G_PARAM_READWRITE | G_PARAM_CONSTRUCT))
#define GIMP_CONFIG_INSTALL_PROP_UINT(class, id, name, min, max, default)\
g_object_class_install_property (class, id,\
g_param_spec_uint (name, NULL, NULL,\
min, max, default,\
G_PARAM_READWRITE | G_PARAM_CONSTRUCT))
#endif /* __GIMP_CONFIG_PARAMS_H__ */
......@@ -114,8 +114,10 @@ gimp_config_serialize_properties (GObject *object,
}
else
{
/* FIXME: emit warning but try to continue */
g_assert_not_reached ();
g_warning ("couldn't serialize property %s::%s of type %s",
g_type_name (G_TYPE_FROM_INSTANCE (object)),
prop_spec->name,
g_type_name (prop_spec->value_type));
}
g_value_unset (&value);
......
......@@ -58,7 +58,13 @@ enum
PROP_BRUSH_PATH,
PROP_PATTERN_PATH,
PROP_PALETTE_PATH,
PROP_GRADIENT_PATH
PROP_GRADIENT_PATH,
PROP_DEFAULT_BRUSH,
PROP_DEFAULT_PATTERN,
PROP_DEFAULT_PALETTE,
PROP_DEFAULT_GRADIENT,
PROP_DEFAULT_COMMENT,
PROP_DEFAULT_IMAGE_TYPE
};
static GObjectClass *parent_class = NULL;
......@@ -122,6 +128,24 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_GRADIENT_PATH,
"gradient-path",
BUILD_DATA_PATH ("gradients"));
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_BRUSH,
"default-brush",
NULL);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_PATTERN,
"default-pattern",
NULL);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_PATTERN,
"default-palette",
NULL);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_GRADIENT,
"default-gradient",
NULL);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_COMMENT,
"default-comment",
NULL);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_DEFAULT_IMAGE_TYPE,
"default-image-type",
GIMP_TYPE_IMAGE_BASE_TYPE, GIMP_RGB);
}
static void
......@@ -160,6 +184,29 @@ gimp_core_config_set_property (GObject *object,
g_free (core_config->gradient_path);
core_config->gradient_path = g_value_dup_string (value);
break;
case PROP_DEFAULT_BRUSH:
g_free (core_config->default_brush);
core_config->default_brush = g_value_dup_string (value);
break;
case PROP_DEFAULT_PATTERN:
g_free (core_config->default_pattern);
core_config->default_pattern = g_value_dup_string (value);
break;
case PROP_DEFAULT_PALETTE:
g_free (core_config->default_palette);
core_config->default_palette = g_value_dup_string (value);
break;
case PROP_DEFAULT_GRADIENT:
g_free (core_config->default_gradient);
core_config->default_gradient = g_value_dup_string (value);
break;
case PROP_DEFAULT_COMMENT:
g_free (core_config->default_comment);
core_config->default_comment = g_value_dup_string (value);
break;
case PROP_DEFAULT_IMAGE_TYPE:
core_config->default_image_type = g_value_get_enum (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -196,6 +243,24 @@ gimp_core_config_get_property (GObject *object,
case PROP_GRADIENT_PATH:
g_value_set_string (value, core_config->gradient_path);
break;
case PROP_DEFAULT_BRUSH:
g_value_set_string (value, core_config->default_brush);
break;
case PROP_DEFAULT_PATTERN:
g_value_set_string (value, core_config->default_pattern);
break;
case PROP_DEFAULT_PALETTE:
g_value_set_string (value, core_config->default_palette);
break;
case PROP_DEFAULT_GRADIENT:
g_value_set_string (value, core_config->default_gradient);
break;
case PROP_DEFAULT_COMMENT:
g_value_set_string (value, core_config->default_comment);
break;
case PROP_DEFAULT_IMAGE_TYPE:
g_value_set_enum (value, core_config->default_image_type);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......
......@@ -48,6 +48,33 @@ struct _GimpCoreConfig
gchar *pattern_path;
gchar *palette_path;
gchar *gradient_path;
gchar *default_brush;
gchar *default_pattern;
gchar *default_palette;
gchar *default_gradient;
gchar *default_comment;
GimpImageBaseType default_image_type;
/* the remaining fields are not yet implemented as properties
gint default_width;
gint default_height;
GimpUnit default_units;
gdouble default_xresolution;
gdouble default_yresolution;
GimpUnit default_resolution_units;
gint levels_of_undo;
gchar *pluginrc_path;
gchar *module_db_load_inhibit;
gint thumbnail_mode;
*/
};
struct _GimpCoreConfigClass
......
......@@ -22,12 +22,23 @@
/* These enums that are registered with the type system. */
#define GIMP_TYPE_IMAGE_BASE_TYPE (gimp_image_base_type_get_type ())
GType gimp_image_base_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_RGB,
GIMP_GRAY,
GIMP_INDEXED
} GimpImageBaseType;
#define GIMP_TYPE_PREVIEW_SIZE (gimp_preview_size_get_type ())
GType gimp_preview_size_get_type (void) G_GNUC_CONST;
typedef enum
typedef enum /*< pdb-skip >*/
{
GIMP_PREVIEW_SIZE_NONE = 0,
GIMP_PREVIEW_SIZE_TINY = 16,
......@@ -41,5 +52,4 @@ typedef enum
GIMP_PREVIEW_SIZE_GIGANTIC = 256
} GimpPreviewSize;
#endif /* __CORE_TYPES_H__ */
......@@ -34,13 +34,6 @@
/* enums */
typedef enum
{
RGB,
GRAY,
INDEXED
} GimpImageBaseType;
typedef enum
{
RGB_GIMAGE, /*< nick=RGB_IMAGE >*/
......
......@@ -236,11 +236,11 @@ gimp_edit_paste_as_new (Gimp *gimp,
GimpImage *gimage;
GimpLayer *layer;
/* create a new image (always of type RGB) */
/* create a new image (always of type GIMP_RGB) */
gimage = gimp_create_image (gimp,
tile_manager_width (paste),
tile_manager_height (paste),
RGB,
GIMP_RGB,
TRUE);
gimp_image_undo_disable (gimage);
......
......@@ -48,7 +48,7 @@ gimp_core_config_init (Gimp *gimp)
gimp->config->default_gradient = NULL;
gimp->config->default_comment = NULL;
gimp->config->default_type = RGB;
gimp->config->default_type = GIMP_RGB;
gimp->config->default_width = 256;
gimp->config->default_height = 256;
gimp->config->default_units = GIMP_UNIT_INCH;
......
......@@ -171,7 +171,7 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable,
gimp_rgb_get_uchar (color, &tmp_col[0], &tmp_col[1], &tmp_col[2]);
gimp_image_transform_color (gimage, drawable, tmp_col, col, RGB);
gimp_image_transform_color (gimage, drawable, tmp_col, col, GIMP_RGB);
}
else if (fill_mode == PATTERN_BUCKET_FILL)
{
......@@ -200,7 +200,8 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable,
while (size--)
{
gimp_image_transform_color (gimage, drawable, d1, d2,
(pattern->mask->bytes == 3) ? RGB : GRAY);
(pattern->mask->bytes == 3) ?
GIMP_RGB : GIMP_GRAY);
d1 += pattern->mask->bytes;
d2 += pat_buf->bytes;
}
......
......@@ -101,7 +101,7 @@ gimp_drawable_preview_private (GimpDrawable *drawable,
gint subsample;
TempBuf *ret_buf;
type = RGB;
type = GIMP_RGB;
bytes = 0;
/* The easy way */
......@@ -117,15 +117,15 @@ gimp_drawable_preview_private (GimpDrawable *drawable,
switch (gimp_drawable_type (drawable))
{
case RGB_GIMAGE: case RGBA_GIMAGE:
type = RGB;
type = GIMP_RGB;
bytes = gimp_drawable_bytes (drawable);
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
type = GRAY;
type = GIMP_GRAY;
bytes = gimp_drawable_bytes (drawable);
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
type = INDEXED;
type = GIMP_INDEXED;
bytes = (gimp_drawable_type (drawable) == INDEXED_GIMAGE) ? 3 : 4;
break;
}
......@@ -297,7 +297,7 @@ gimp_drawable_preview_scale (GimpImageBaseType type,
tot_frac = x_frac[frac++] * y_frac;
/* If indexed, transform the color to RGB */
if (type == INDEXED)
if (type == GIMP_INDEXED)
{
map_to_color (2, cmap, s, rgb);
......
......@@ -547,7 +547,7 @@ gimp_drawable_fill (GimpDrawable *drawable,
&c[RED_PIX],
&c[GREEN_PIX],
&c[BLUE_PIX]);
gimp_image_transform_color (gimage, drawable, c, &i, RGB);
gimp_image_transform_color (gimage, drawable, c, &i, GIMP_RGB);
c[INDEXED_PIX] = i;
if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE)
gimp_rgba_get_uchar (color,
......@@ -558,7 +558,8 @@ gimp_drawable_fill (GimpDrawable *drawable,
break;
default:
g_warning ("%s: Cannot fill unknown image type.", G_GNUC_PRETTY_FUNCTION);
g_warning ("%s: Cannot fill unknown image type.",
G_GNUC_PRETTY_FUNCTION);
break;
}
......
......@@ -236,11 +236,11 @@ gimp_edit_paste_as_new (Gimp *gimp,
GimpImage *gimage;
GimpLayer *layer;
/* create a new image (always of type RGB) */
/* create a new image (always of type GIMP_RGB) */
gimage = gimp_create_image (gimp,
tile_manager_width (paste),
tile_manager_height (paste),
RGB,
GIMP_RGB,
TRUE);
gimp_image_undo_disable (gimage);
......
......@@ -712,12 +712,13 @@ gimp_image_convert (GimpImage *gimage,
gimage->base_type = new_type;
/* Convert to indexed? Build histogram if necessary. */
if (new_type == INDEXED)
if (new_type == GIMP_INDEXED)
{
int i;
/* don't dither if the input is grayscale and we are simply mapping every color */
if (old_type == GRAY && num_cols == 256 && palette_type == MAKE_PALETTE)
if (old_type == GIMP_GRAY &&
num_cols == 256 && palette_type == MAKE_PALETTE)
dither = NO_DITHER;
quantobj = initialize_median_cut (old_type, num_cols, dither,
......@@ -725,7 +726,7 @@ gimp_image_convert (GimpImage *gimage,
if (palette_type == MAKE_PALETTE)
{
if (old_type == GRAY)
if (old_type == GIMP_GRAY)
zero_histogram_gray (quantobj->histogram);
else
zero_histogram_rgb (quantobj->histogram);
......@@ -744,7 +745,7 @@ gimp_image_convert (GimpImage *gimage,
{
layer = (GimpLayer *) list->data;
if (old_type == GRAY)
if (old_type == GIMP_GRAY)
generate_histogram_gray (quantobj->histogram, layer, alpha_dither);
else
generate_histogram_rgb (quantobj->histogram, layer, num_cols, alpha_dither);
......@@ -757,7 +758,7 @@ gimp_image_convert (GimpImage *gimage,
}
if (
(old_type == RGB) &&
(old_type == GIMP_RGB) &&
(!needs_quantize) &&
(palette_type == MAKE_PALETTE)
)
......@@ -796,7 +797,7 @@ gimp_image_convert (GimpImage *gimage,
/* Initialise data which must persist across indexed layer iterations */
switch (new_type)
{
case INDEXED:
case GIMP_INDEXED:
if (quantobj->second_pass_init)
(* quantobj->second_pass_init) (quantobj);
break;
......@@ -814,15 +815,15 @@ gimp_image_convert (GimpImage *gimage,
has_alpha = gimp_layer_has_alpha (layer);
switch (new_type)
{
case RGB:
case GIMP_RGB:
new_layer_type = (has_alpha) ? RGBA_GIMAGE : RGB_GIMAGE;
new_layer_bytes = (has_alpha) ? 4 : 3;
break;
case GRAY:
case GIMP_GRAY:
new_layer_type = (has_alpha) ? GRAYA_GIMAGE : GRAY_GIMAGE;
new_layer_bytes = (has_alpha) ? 2 : 1;
break;
case INDEXED:
case GIMP_INDEXED:
new_layer_type = (has_alpha) ? INDEXEDA_GIMAGE : INDEXED_GIMAGE;
new_layer_bytes = (has_alpha) ? 2 : 1;
break;
......@@ -836,13 +837,13 @@ gimp_image_convert (GimpImage *gimage,
switch (new_type)
{
case RGB:
case GIMP_RGB:
rgb_converter (layer, new_tiles, old_type);
break;
case GRAY:
case GIMP_GRAY:
grayscale_converter (layer, new_tiles, old_type);
break;
case INDEXED:
case GIMP_INDEXED:
(* quantobj->second_pass) (quantobj, layer, new_tiles);
break;
default:
......@@ -859,7 +860,7 @@ gimp_image_convert (GimpImage *gimage,
}
/* colourmap stuff */
if (new_type == INDEXED)
if (new_type == GIMP_INDEXED)
{
if (gimage->cmap)
g_free (gimage->cmap);
......@@ -968,7 +969,7 @@ rgb_converter (GimpLayer *layer,
switch (old_type)
{
case GRAY:
case GIMP_GRAY:
for (row = 0; row < srcPR.h; row++)
{
s = src;
......@@ -989,7 +990,7 @@ rgb_converter (GimpLayer *layer,
dest += destPR.rowstride;
}
break;
case INDEXED:
case GIMP_INDEXED:
cmap = gimp_drawable_cmap (GIMP_DRAWABLE(layer));
for (row = 0; row < srcPR.h; row++)
{
......@@ -1042,7 +1043,7 @@ grayscale_converter (GimpLayer *layer,
switch (old_type)
{
case RGB:
case GIMP_RGB:
for (row = 0; row < srcPR.h; row++)
{
s = src;
......@@ -1060,7 +1061,7 @@ grayscale_converter (GimpLayer *layer,
dest += destPR.rowstride;
}
break;
case INDEXED:
case GIMP_INDEXED:
cmap = gimp_drawable_cmap (GIMP_DRAWABLE(layer));
for (row = 0; row < srcPR.h; row++)
{
......@@ -3439,7 +3440,7 @@ initialize_median_cut (int type,
/* Initialize the data structures */
quantobj = g_malloc (sizeof (QuantizeObj));
if (type == GRAY && palette_type == MAKE_PALETTE)
if (type == GIMP_GRAY && palette_type == MAKE_PALETTE)
quantobj->histogram = g_malloc (sizeof (ColorFreq) * 256);
else
quantobj->histogram = g_malloc (sizeof (ColorFreq) *
......@@ -3452,7 +3453,7 @@ initialize_median_cut (int type,
switch (type)
{
case GRAY:
case GIMP_GRAY:
switch (palette_type)
{
case MAKE_PALETTE:
......@@ -3521,7 +3522,7 @@ initialize_median_cut (int type,
break;
}
break;
case RGB:
case GIMP_RGB:
switch (palette_type)
{
case MAKE_PALETTE:
......
......@@ -176,8 +176,9 @@ gimp_image_duplicate (GimpImage *gimage)
floating_sel_attach (floating_layer, new_floating_sel_drawable);
/* Copy the colormap if necessary */
if (new_gimage->base_type == INDEXED)
if (new_gimage->base_type == GIMP_INDEXED)
memcpy (new_gimage->cmap, gimage->cmap, gimage->num_cols * 3);
new_gimage->num_cols = gimage->num_cols;
/* copy state of all color channels */
......
......@@ -240,27 +240,27 @@ gimp_image_mask_extract (GimpImage *gimage,
{
case RGB_GIMAGE: case RGBA_GIMAGE:
bytes = add_alpha ? 4 : drawable->bytes;
type = RGB;
type = GIMP_RGB;
break;
case GRAY_GIMAGE: case GRAYA_GIMAGE:
bytes = add_alpha ? 2 : drawable->bytes;
type = GRAY;
type = GIMP_GRAY;
break;
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
if (keep_indexed)
{
bytes = add_alpha ? 2 : drawable->bytes;
type = GRAY;
type = GIMP_GRAY;
}
else
{
bytes = add_alpha ? 4 : drawable->bytes;
type = INDEXED;
type = GIMP_INDEXED;
}
break;
default:
bytes = 3;
type = RGB;
type = GIMP_RGB;
break;
}
......@@ -319,7 +319,7 @@ gimp_image_mask_extract (GimpImage *gimage,
else
{
/* If the layer is indexed...we need to extract pixels */
if (type == INDEXED && !keep_indexed)
if (type == GIMP_INDEXED && !keep_indexed)
extract_from_region (&srcPR, &destPR, NULL,
gimp_drawable_cmap (drawable),
bg, type,
......
......@@ -307,9 +307,9 @@ gimp_image_merge_layers (GimpImage *gimage,
{
switch (gimp_image_base_type (gimage))
{
case RGB: type = RGB_GIMAGE; break;
case GRAY: type = GRAY_GIMAGE; break;
case INDEXED: type = INDEXED_GIMAGE; break;
case GIMP_RGB: type = RGB_GIMAGE; break;
case GIMP_GRAY: type = GRAY_GIMAGE; break;
case GIMP_INDEXED: type = INDEXED_GIMAGE; break;
}
merge_layer = gimp_layer_new (gimage, (x2 - x1), (y2 - y1),
......
......@@ -49,14 +49,14 @@ gimp_image_new_init (Gimp *gimp)
/* Available Image Base Types */
new_type = g_new (GimpImageBaseTypeName, 1);
new_type->type = RGB;
new_type->type = GIMP_RGB;
new_type->name = _("RGB");
gimp->image_base_type_names = g_list_append (gimp->image_base_type_names,
new_type);
new_type = g_new (GimpImageBaseTypeName, 1);
new_type->type = GRAY;
new_type->type = GIMP_GRAY;
new_type->name = _("Grayscale");
gimp->image_base_type_names = g_list_append (gimp->image_base_type_names,
......@@ -146,12 +146,13 @@ gimp_image_new_values_new (Gimp *gimp,
values->type = gimp_image_base_type (gimage);
if (values->type == INDEXED)
values->type = RGB; /* no indexed images */
if (values->type == GIMP_INDEXED)
values->type = GIMP_RGB; /* no indexed images */
}
else
{
memcpy (values, &gimp->image_new_last_values, sizeof (GimpImageNewValues));
memcpy (values, &gimp->image_new_last_values,
sizeof (GimpImageNewValues));
}
if (gimp->global_buffer && gimp->have_current_cut_buffer)
......@@ -193,7 +194,7 @@ gimp_image_new_calculate_size (GimpImageNewValues *values)
size =
width * height *
((values->type == RGB ? 3 : 1) + /* bytes per pixel */
((values->type == GIMP_RGB ? 3 : 1) + /* bytes per pixel */
(values->fill_type == TRANSPARENT_FILL ? 1 : 0)); /* alpha channel */
return size;
......@@ -240,10 +241,10 @@ gimp_image_new_create_image (Gimp *gimp,
case FOREGROUND_FILL:
case BACKGROUND_FILL:
case WHITE_FILL:
type = (values->type == RGB) ? RGB_GIMAGE : GRAY_GIMAGE;
type = (values->type == GIMP_RGB) ? RGB_GIMAGE : GRAY_GIMAGE;
break;
case TRANSPARENT_FILL:
type = (values->type == RGB) ? RGBA_GIMAGE : GRAYA_GIMAGE;
type = (values->type == GIMP_RGB) ? RGBA_GIMAGE : GRAYA_GIMAGE;
break;
default:
type = RGB_GIMAGE;
......
......@@ -104,12 +104,12 @@ gimp_image_projection_allocate (GimpImage *gimage)
*/
switch (gimp_image_base_type (gimage))
{
case RGB:
case INDEXED:
case GIMP_RGB:
case GIMP_INDEXED:
gimage->proj_bytes = 4;
gimage->proj_type = RGBA_GIMAGE;
break;
case GRAY:
case GIMP_GRAY:
gimage->proj_bytes = 2;