diff --git a/ChangeLog b/ChangeLog index 2e7ea76bdd..8599474448 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2001-12-13 Sven Neumann + + * app/config/gimpconfig-deserialize.h + * app/config/gimpconfig-serialize.c: fixed typos. + + * app/core/core-enums.h + * app/core/core-types.h: converted ChannelType enum to GimpChannelType + and moved it to core-enums.h. + + * app/core/gimpimage.[ch] + * app/widgets/gimpchannellistview.c + * app/widgets/gimpcomponentlistitem.[ch] + * tools/pdbgen/pdb/image.pdb: changed accordingly. + + * app/pdb/image_cmds.c + * libgimp/gimpenums.h + * plug-ins/script-fu/script-fu-constants.c + * tools/pdbgen/enums.pl: regenerated. + 2001-12-13 Sven Neumann * app/config/gimpconfig-deserialize.c diff --git a/app/config/gimpconfig-deserialize.h b/app/config/gimpconfig-deserialize.h index a2e6c87ee4..48bdef8c00 100644 --- a/app/config/gimpconfig-deserialize.h +++ b/app/config/gimpconfig-deserialize.h @@ -1,7 +1,7 @@ /* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * - * Object peoperties deserialization routines + * Object properties deserialization routines * Copyright (C) 2001 Sven Neumann * * This program is free software; you can redistribute it and/or modify diff --git a/app/config/gimpconfig-serialize.c b/app/config/gimpconfig-serialize.c index 6112b7689d..c1a9bda7b8 100644 --- a/app/config/gimpconfig-serialize.c +++ b/app/config/gimpconfig-serialize.c @@ -1,7 +1,7 @@ /* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * - * Object propoerties serialization routines + * Object properties serialization routines * Copyright (C) 2001 Sven Neumann * * This program is free software; you can redistribute it and/or modify diff --git a/app/core/core-enums.h b/app/core/core-enums.h index 9af75a21d7..38674933c5 100644 --- a/app/core/core-enums.h +++ b/app/core/core-enums.h @@ -71,6 +71,16 @@ typedef enum /*< pdb-skip >*/ * non-registered enums; register them if needed */ +typedef enum /*< skip >*/ +{ + GIMP_RED_CHANNEL, + GIMP_GREEN_CHANNEL, + GIMP_BLUE_CHANNEL, + GIMP_GRAY_CHANNEL, + GIMP_INDEXED_CHANNEL, + GIMP_ALPHA_CHANNEL +} GimpChannelType; + typedef enum /*< skip >*/ { GIMP_LINEAR, diff --git a/app/core/core-types.h b/app/core/core-types.h index 1004b6c60f..265be3463e 100644 --- a/app/core/core-types.h +++ b/app/core/core-types.h @@ -34,16 +34,6 @@ /* enums */ -typedef enum -{ - RED_CHANNEL, - GREEN_CHANNEL, - BLUE_CHANNEL, - GRAY_CHANNEL, - INDEXED_CHANNEL, - ALPHA_CHANNEL -} ChannelType; - typedef enum /*< chop=ADD_ >*/ { ADD_WHITE_MASK, diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index cce8575a18..4eb7cb43f2 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -906,7 +906,7 @@ gimp_image_get_combination_mode (GimpImageType dest_type, } gint -gimp_image_get_ID (GimpImage *gimage) +gimp_image_get_ID (const GimpImage *gimage) { g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); @@ -1119,9 +1119,9 @@ gimp_image_mask_changed (GimpImage *gimage) } void -gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, - gboolean active) +gimp_image_set_component_active (GimpImage *gimage, + GimpChannelType type, + gboolean active) { gint pixel = -1; @@ -1129,12 +1129,12 @@ gimp_image_set_component_active (GimpImage *gimage, switch (type) { - case RED_CHANNEL: pixel = RED_PIX; break; - case GREEN_CHANNEL: pixel = GREEN_PIX; break; - case BLUE_CHANNEL: pixel = BLUE_PIX; break; - case GRAY_CHANNEL: pixel = GRAY_PIX; break; - case INDEXED_CHANNEL: pixel = INDEXED_PIX; break; - case ALPHA_CHANNEL: + case GIMP_RED_CHANNEL: pixel = RED_PIX; break; + case GIMP_GREEN_CHANNEL: pixel = GREEN_PIX; break; + case GIMP_BLUE_CHANNEL: pixel = BLUE_PIX; break; + case GIMP_GRAY_CHANNEL: pixel = GRAY_PIX; break; + case GIMP_INDEXED_CHANNEL: pixel = INDEXED_PIX; break; + case GIMP_ALPHA_CHANNEL: switch (gimp_image_base_type (gimage)) { case GIMP_RGB: pixel = ALPHA_PIX; break; @@ -1164,17 +1164,17 @@ gimp_image_set_component_active (GimpImage *gimage, gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type) + GimpChannelType type) { /* No sanity checking here... */ switch (type) { - case RED_CHANNEL: return gimage->active[RED_PIX]; break; - case GREEN_CHANNEL: return gimage->active[GREEN_PIX]; break; - case BLUE_CHANNEL: return gimage->active[BLUE_PIX]; break; - case GRAY_CHANNEL: return gimage->active[GRAY_PIX]; break; - case INDEXED_CHANNEL: return gimage->active[INDEXED_PIX]; break; - case ALPHA_CHANNEL: + case GIMP_RED_CHANNEL: return gimage->active[RED_PIX]; break; + case GIMP_GREEN_CHANNEL: return gimage->active[GREEN_PIX]; break; + case GIMP_BLUE_CHANNEL: return gimage->active[BLUE_PIX]; break; + case GIMP_GRAY_CHANNEL: return gimage->active[GRAY_PIX]; break; + case GIMP_INDEXED_CHANNEL: return gimage->active[INDEXED_PIX]; break; + case GIMP_ALPHA_CHANNEL: switch (gimp_image_base_type (gimage)) { case GIMP_RGB: return gimage->active[ALPHA_PIX]; break; @@ -1191,9 +1191,9 @@ gimp_image_get_component_active (const GimpImage *gimage, } void -gimp_image_get_active_components (GimpImage *gimage, - GimpDrawable *drawable, - gint *active) +gimp_image_get_active_components (const GimpImage *gimage, + const GimpDrawable *drawable, + gint *active) { GimpLayer *layer; gint i; @@ -1224,9 +1224,9 @@ gimp_image_get_active_components (GimpImage *gimage, } void -gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, - gboolean visible) +gimp_image_set_component_visible (GimpImage *gimage, + GimpChannelType type, + gboolean visible) { gint pixel = -1; @@ -1234,12 +1234,12 @@ gimp_image_set_component_visible (GimpImage *gimage, switch (type) { - case RED_CHANNEL: pixel = RED_PIX; break; - case GREEN_CHANNEL: pixel = GREEN_PIX; break; - case BLUE_CHANNEL: pixel = BLUE_PIX; break; - case GRAY_CHANNEL: pixel = GRAY_PIX; break; - case INDEXED_CHANNEL: pixel = INDEXED_PIX; break; - case ALPHA_CHANNEL: + case GIMP_RED_CHANNEL: pixel = RED_PIX; break; + case GIMP_GREEN_CHANNEL: pixel = GREEN_PIX; break; + case GIMP_BLUE_CHANNEL: pixel = BLUE_PIX; break; + case GIMP_GRAY_CHANNEL: pixel = GRAY_PIX; break; + case GIMP_INDEXED_CHANNEL: pixel = INDEXED_PIX; break; + case GIMP_ALPHA_CHANNEL: switch (gimp_image_base_type (gimage)) { case GIMP_RGB: pixel = ALPHA_PIX; break; @@ -1266,17 +1266,17 @@ gimp_image_set_component_visible (GimpImage *gimage, gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type) + GimpChannelType type) { /* No sanity checking here... */ switch (type) { - case RED_CHANNEL: return gimage->visible[RED_PIX]; break; - case GREEN_CHANNEL: return gimage->visible[GREEN_PIX]; break; - case BLUE_CHANNEL: return gimage->visible[BLUE_PIX]; break; - case GRAY_CHANNEL: return gimage->visible[GRAY_PIX]; break; - case INDEXED_CHANNEL: return gimage->visible[INDEXED_PIX]; break; - case ALPHA_CHANNEL: + case GIMP_RED_CHANNEL: return gimage->visible[RED_PIX]; break; + case GIMP_GREEN_CHANNEL: return gimage->visible[GREEN_PIX]; break; + case GIMP_BLUE_CHANNEL: return gimage->visible[BLUE_PIX]; break; + case GIMP_GRAY_CHANNEL: return gimage->visible[GRAY_PIX]; break; + case GIMP_INDEXED_CHANNEL: return gimage->visible[INDEXED_PIX]; break; + case GIMP_ALPHA_CHANNEL: switch (gimp_image_base_type (gimage)) { case GIMP_RGB: return gimage->visible[ALPHA_PIX]; break; diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 112308f912..356966d2d9 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -158,9 +158,9 @@ struct _GimpImageClass void (* active_layer_changed) (GimpImage *gimage); void (* active_channel_changed) (GimpImage *gimage); void (* component_visibility_changed) (GimpImage *gimage, - ChannelType channel); + GimpChannelType channel); void (* component_active_changed) (GimpImage *gimage, - ChannelType channel); + GimpChannelType channel); void (* mask_changed) (GimpImage *gimage); void (* resolution_changed) (GimpImage *gimage); void (* unit_changed) (GimpImage *gimage); @@ -199,7 +199,7 @@ GimpImageType gimp_image_base_type_with_alpha (const GimpImage *gimage); CombinationMode gimp_image_get_combination_mode (GimpImageType dest_type, gint src_bytes); -gint gimp_image_get_ID (GimpImage *gimage); +gint gimp_image_get_ID (const GimpImage *gimage); GimpImage * gimp_image_get_by_ID (Gimp *gimp, gint id); @@ -240,19 +240,19 @@ GimpChannel * gimp_image_get_mask (const GimpImage *gimage); void gimp_image_mask_changed (GimpImage *gimage); void gimp_image_set_component_active (GimpImage *gimage, - ChannelType type, + GimpChannelType type, gboolean active); gboolean gimp_image_get_component_active (const GimpImage *gimage, - ChannelType type); -void gimp_image_get_active_components (GimpImage *gimage, - GimpDrawable *drawable, + GimpChannelType type); +void gimp_image_get_active_components (const GimpImage *gimage, + const GimpDrawable *drawable, gint *active); void gimp_image_set_component_visible (GimpImage *gimage, - ChannelType type, + GimpChannelType type, gboolean visible); gboolean gimp_image_get_component_visible (const GimpImage *gimage, - ChannelType type); + GimpChannelType type); void gimp_image_mode_changed (GimpImage *gimage); void gimp_image_alpha_changed (GimpImage *gimage); diff --git a/app/pdb/image_cmds.c b/app/pdb/image_cmds.c index c57a420004..d4c60cc3c7 100644 --- a/app/pdb/image_cmds.c +++ b/app/pdb/image_cmds.c @@ -3213,14 +3213,14 @@ image_get_component_active_invoker (Gimp *gimp, success = FALSE; component = args[1].value.pdb_int; - if (component < GREEN_CHANNEL || component > ALPHA_CHANNEL) + if (component < GIMP_GREEN_CHANNEL || component > GIMP_ALPHA_CHANNEL) success = FALSE; if (success) { - if (component == GRAY_CHANNEL) + if (component == GIMP_GRAY_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_GRAY; - else if (component == INDEXED_CHANNEL) + else if (component == GIMP_INDEXED_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_INDEXED; else success = gimp_image_base_type (gimage) == GIMP_RGB; @@ -3244,7 +3244,7 @@ static ProcArg image_get_component_active_inargs[] = { GIMP_PDB_INT32, "component", - "The image component: { RED_CHANNEL (0), GREEN_CHANNEL (1), BLUE_CHANNEL (2), GRAY_CHANNEL (3), INDEXED_CHANNEL (4), ALPHA_CHANNEL (5) }" + "The image component: { GIMP_RED_CHANNEL (0), GIMP_GREEN_CHANNEL (1), GIMP_BLUE_CHANNEL (2), GIMP_GRAY_CHANNEL (3), GIMP_INDEXED_CHANNEL (4), GIMP_ALPHA_CHANNEL (5) }" } }; @@ -3287,16 +3287,16 @@ image_set_component_active_invoker (Gimp *gimp, success = FALSE; component = args[1].value.pdb_int; - if (component < GREEN_CHANNEL || component > ALPHA_CHANNEL) + if (component < GIMP_GREEN_CHANNEL || component > GIMP_ALPHA_CHANNEL) success = FALSE; active = args[2].value.pdb_int ? TRUE : FALSE; if (success) { - if (component == GRAY_CHANNEL) + if (component == GIMP_GRAY_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_GRAY; - else if (component == INDEXED_CHANNEL) + else if (component == GIMP_INDEXED_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_INDEXED; else success = gimp_image_base_type (gimage) == GIMP_RGB; @@ -3318,7 +3318,7 @@ static ProcArg image_set_component_active_inargs[] = { GIMP_PDB_INT32, "component", - "The image component: { RED_CHANNEL (0), GREEN_CHANNEL (1), BLUE_CHANNEL (2), GRAY_CHANNEL (3), INDEXED_CHANNEL (4), ALPHA_CHANNEL (5) }" + "The image component: { GIMP_RED_CHANNEL (0), GIMP_GREEN_CHANNEL (1), GIMP_BLUE_CHANNEL (2), GIMP_GRAY_CHANNEL (3), GIMP_INDEXED_CHANNEL (4), GIMP_ALPHA_CHANNEL (5) }" }, { GIMP_PDB_INT32, @@ -3357,14 +3357,14 @@ image_get_component_visible_invoker (Gimp *gimp, success = FALSE; component = args[1].value.pdb_int; - if (component < GREEN_CHANNEL || component > ALPHA_CHANNEL) + if (component < GIMP_GREEN_CHANNEL || component > GIMP_ALPHA_CHANNEL) success = FALSE; if (success) { - if (component == GRAY_CHANNEL) + if (component == GIMP_GRAY_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_GRAY; - else if (component == INDEXED_CHANNEL) + else if (component == GIMP_INDEXED_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_INDEXED; else success = gimp_image_base_type (gimage) == GIMP_RGB; @@ -3388,7 +3388,7 @@ static ProcArg image_get_component_visible_inargs[] = { GIMP_PDB_INT32, "component", - "The image component: { RED_CHANNEL (0), GREEN_CHANNEL (1), BLUE_CHANNEL (2), GRAY_CHANNEL (3), INDEXED_CHANNEL (4), ALPHA_CHANNEL (5) }" + "The image component: { GIMP_RED_CHANNEL (0), GIMP_GREEN_CHANNEL (1), GIMP_BLUE_CHANNEL (2), GIMP_GRAY_CHANNEL (3), GIMP_INDEXED_CHANNEL (4), GIMP_ALPHA_CHANNEL (5) }" } }; @@ -3431,16 +3431,16 @@ image_set_component_visible_invoker (Gimp *gimp, success = FALSE; component = args[1].value.pdb_int; - if (component < GREEN_CHANNEL || component > ALPHA_CHANNEL) + if (component < GIMP_GREEN_CHANNEL || component > GIMP_ALPHA_CHANNEL) success = FALSE; visible = args[2].value.pdb_int ? TRUE : FALSE; if (success) { - if (component == GRAY_CHANNEL) + if (component == GIMP_GRAY_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_GRAY; - else if (component == INDEXED_CHANNEL) + else if (component == GIMP_INDEXED_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_INDEXED; else success = gimp_image_base_type (gimage) == GIMP_RGB; @@ -3462,7 +3462,7 @@ static ProcArg image_set_component_visible_inargs[] = { GIMP_PDB_INT32, "component", - "The image component: { RED_CHANNEL (0), GREEN_CHANNEL (1), BLUE_CHANNEL (2), GRAY_CHANNEL (3), INDEXED_CHANNEL (4), ALPHA_CHANNEL (5) }" + "The image component: { GIMP_RED_CHANNEL (0), GIMP_GREEN_CHANNEL (1), GIMP_BLUE_CHANNEL (2), GIMP_GRAY_CHANNEL (3), GIMP_INDEXED_CHANNEL (4), GIMP_ALPHA_CHANNEL (5) }" }, { GIMP_PDB_INT32, diff --git a/app/widgets/gimpchannellistview.c b/app/widgets/gimpchannellistview.c index a0f9f00b72..2703b86f95 100644 --- a/app/widgets/gimpchannellistview.c +++ b/app/widgets/gimpchannellistview.c @@ -372,12 +372,12 @@ gimp_channel_list_view_toselection_extended_clicked (GtkWidget *widget static void gimp_channel_list_view_create_components (GimpChannelListView *view) { - GimpImage *gimage; - GtkWidget *list_item; - gint n_components = 0; - ChannelType components[MAX_CHANNELS]; - GList *list = NULL; - gint i; + GimpImage *gimage; + GtkWidget *list_item; + gint n_components = 0; + GimpChannelType components[MAX_CHANNELS]; + GList *list = NULL; + gint i; gimage = GIMP_DRAWABLE_LIST_VIEW (view)->gimage; @@ -385,23 +385,23 @@ gimp_channel_list_view_create_components (GimpChannelListView *view) { case GIMP_RGB: n_components = 3; - components[0] = RED_CHANNEL; - components[1] = GREEN_CHANNEL; - components[2] = BLUE_CHANNEL; + components[0] = GIMP_RED_CHANNEL; + components[1] = GIMP_GREEN_CHANNEL; + components[2] = GIMP_BLUE_CHANNEL; break; case GIMP_GRAY: n_components = 1; - components[0] = GRAY_CHANNEL; + components[0] = GIMP_GRAY_CHANNEL; break; case GIMP_INDEXED: n_components = 1; - components[0] = INDEXED_CHANNEL; + components[0] = GIMP_INDEXED_CHANNEL; break; } - components[n_components++] = ALPHA_CHANNEL; + components[n_components++] = GIMP_ALPHA_CHANNEL; for (i = 0; i < n_components; i++) { diff --git a/app/widgets/gimpchanneltreeview.c b/app/widgets/gimpchanneltreeview.c index a0f9f00b72..2703b86f95 100644 --- a/app/widgets/gimpchanneltreeview.c +++ b/app/widgets/gimpchanneltreeview.c @@ -372,12 +372,12 @@ gimp_channel_list_view_toselection_extended_clicked (GtkWidget *widget static void gimp_channel_list_view_create_components (GimpChannelListView *view) { - GimpImage *gimage; - GtkWidget *list_item; - gint n_components = 0; - ChannelType components[MAX_CHANNELS]; - GList *list = NULL; - gint i; + GimpImage *gimage; + GtkWidget *list_item; + gint n_components = 0; + GimpChannelType components[MAX_CHANNELS]; + GList *list = NULL; + gint i; gimage = GIMP_DRAWABLE_LIST_VIEW (view)->gimage; @@ -385,23 +385,23 @@ gimp_channel_list_view_create_components (GimpChannelListView *view) { case GIMP_RGB: n_components = 3; - components[0] = RED_CHANNEL; - components[1] = GREEN_CHANNEL; - components[2] = BLUE_CHANNEL; + components[0] = GIMP_RED_CHANNEL; + components[1] = GIMP_GREEN_CHANNEL; + components[2] = GIMP_BLUE_CHANNEL; break; case GIMP_GRAY: n_components = 1; - components[0] = GRAY_CHANNEL; + components[0] = GIMP_GRAY_CHANNEL; break; case GIMP_INDEXED: n_components = 1; - components[0] = INDEXED_CHANNEL; + components[0] = GIMP_INDEXED_CHANNEL; break; } - components[n_components++] = ALPHA_CHANNEL; + components[n_components++] = GIMP_ALPHA_CHANNEL; for (i = 0; i < n_components; i++) { diff --git a/app/widgets/gimpcomponentlistitem.c b/app/widgets/gimpcomponentlistitem.c index 14bd786855..a490908075 100644 --- a/app/widgets/gimpcomponentlistitem.c +++ b/app/widgets/gimpcomponentlistitem.c @@ -43,22 +43,24 @@ static void gimp_component_list_item_class_init (GimpComponentListItemClass *klass); static void gimp_component_list_item_init (GimpComponentListItem *list_item); -static void gimp_component_list_item_set_viewable (GimpListItem *list_item, - GimpViewable *viewable); +static void gimp_component_list_item_set_viewable (GimpListItem *list_item, + GimpViewable *viewable); -static void gimp_component_list_item_eye_toggled (GtkWidget *widget, - gpointer data); +static void gimp_component_list_item_eye_toggled (GtkWidget *widget, + gpointer data); -static void gimp_component_list_item_visibility_changed (GimpImage *gimage, - ChannelType channel, - gpointer data); +static void gimp_component_list_item_visibility_changed + (GimpImage *gimage, + GimpChannelType channel, + gpointer data); -static void gimp_component_list_item_active_changed (GimpImage *gimage, - ChannelType channel, - gpointer data); +static void gimp_component_list_item_active_changed + (GimpImage *gimage, + GimpChannelType channel, + gpointer data); -static gchar * gimp_component_list_item_get_name (GtkWidget *widget, - gchar **tooltip); +static gchar * gimp_component_list_item_get_name (GtkWidget *widget, + gchar **tooltip); static GimpListItemClass *parent_class = NULL; @@ -137,17 +139,15 @@ gimp_component_list_item_init (GimpComponentListItem *list_item) } GtkWidget * -gimp_component_list_item_new (GimpImage *gimage, - gint preview_size, - ChannelType channel) +gimp_component_list_item_new (GimpImage *gimage, + gint preview_size, + GimpChannelType channel) { GimpListItem *list_item; g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); g_return_val_if_fail (preview_size > 0 && preview_size <= 256, NULL); - g_return_val_if_fail (channel >= RED_CHANNEL && channel <= ALPHA_CHANNEL, - NULL); - + list_item = g_object_new (GIMP_TYPE_COMPONENT_LIST_ITEM, NULL); list_item->preview_size = preview_size; @@ -185,15 +185,16 @@ gimp_component_list_item_set_viewable (GimpListItem *list_item, switch (component_item->channel) { - case RED_CHANNEL: pixel = RED_PIX; break; - case GREEN_CHANNEL: pixel = GREEN_PIX; break; - case BLUE_CHANNEL: pixel = BLUE_PIX; break; - case GRAY_CHANNEL: pixel = GRAY_PIX; break; - case INDEXED_CHANNEL: pixel = INDEXED_PIX; break; - case ALPHA_CHANNEL: pixel = ALPHA_PIX; break; + case GIMP_RED_CHANNEL: pixel = RED_PIX; break; + case GIMP_GREEN_CHANNEL: pixel = GREEN_PIX; break; + case GIMP_BLUE_CHANNEL: pixel = BLUE_PIX; break; + case GIMP_GRAY_CHANNEL: pixel = GRAY_PIX; break; + case GIMP_INDEXED_CHANNEL: pixel = INDEXED_PIX; break; + case GIMP_ALPHA_CHANNEL: pixel = ALPHA_PIX; break; default: pixel = 0; + g_assert_not_reached (); } GIMP_IMAGE_PREVIEW (list_item->preview)->channel = pixel; @@ -277,9 +278,9 @@ gimp_component_list_item_eye_toggled (GtkWidget *widget, } static void -gimp_component_list_item_visibility_changed (GimpImage *gimage, - ChannelType channel, - gpointer data) +gimp_component_list_item_visibility_changed (GimpImage *gimage, + GimpChannelType channel, + gpointer data) { GimpComponentListItem *component_item; GimpListItem *list_item; @@ -293,7 +294,8 @@ gimp_component_list_item_visibility_changed (GimpImage *gimage, list_item = GIMP_LIST_ITEM (data); toggle = GTK_TOGGLE_BUTTON (component_item->eye_button); - visible = gimp_image_get_component_visible (gimage, component_item->channel); + visible = gimp_image_get_component_visible (gimage, + component_item->channel); if (visible != toggle->active) { @@ -323,9 +325,9 @@ gimp_component_list_item_visibility_changed (GimpImage *gimage, } static void -gimp_component_list_item_active_changed (GimpImage *gimage, - ChannelType channel, - gpointer data) +gimp_component_list_item_active_changed (GimpImage *gimage, + GimpChannelType channel, + gpointer data) { GimpComponentListItem *component_item; gboolean active; @@ -356,12 +358,14 @@ gimp_component_list_item_get_name (GtkWidget *widget, switch (component_item->channel) { - case RED_CHANNEL: return g_strdup (_("Red")); break; - case GREEN_CHANNEL: return g_strdup (_("Green")); break; - case BLUE_CHANNEL: return g_strdup (_("Blue")); break; - case GRAY_CHANNEL: return g_strdup (_("Gray")); break; - case INDEXED_CHANNEL: return g_strdup (_("Indexed")); break; - case ALPHA_CHANNEL: return g_strdup (_("Alpha")); break; - default: return g_strdup ("EEK"); break; + case GIMP_RED_CHANNEL: return g_strdup (_("Red")); break; + case GIMP_GREEN_CHANNEL: return g_strdup (_("Green")); break; + case GIMP_BLUE_CHANNEL: return g_strdup (_("Blue")); break; + case GIMP_GRAY_CHANNEL: return g_strdup (_("Gray")); break; + case GIMP_INDEXED_CHANNEL: return g_strdup (_("Indexed")); break; + case GIMP_ALPHA_CHANNEL: return g_strdup (_("Alpha")); break; + + default: + return g_strdup (_("EEEEK")); } } diff --git a/app/widgets/gimpcomponentlistitem.h b/app/widgets/gimpcomponentlistitem.h index dfa04e8edd..6f89ad42b9 100644 --- a/app/widgets/gimpcomponentlistitem.h +++ b/app/widgets/gimpcomponentlistitem.h @@ -37,11 +37,10 @@ typedef struct _GimpComponentListItemClass GimpComponentListItemClass; struct _GimpComponentListItem { - GimpListItem parent_instance; + GimpListItem parent_instance; - ChannelType channel; - - GtkWidget *eye_button; + GimpChannelType channel; + GtkWidget *eye_button; }; struct _GimpComponentListItemClass @@ -52,9 +51,9 @@ struct _GimpComponentListItemClass GType gimp_component_list_item_get_type (void) G_GNUC_CONST; -GtkWidget * gimp_component_list_item_new (GimpImage *gimage, - gint preview_size, - ChannelType channel); +GtkWidget * gimp_component_list_item_new (GimpImage *gimage, + gint preview_size, + GimpChannelType channel); diff --git a/libgimp/gimpenums.h b/libgimp/gimpenums.h index 63bf595389..7d81bd51cf 100644 --- a/libgimp/gimpenums.h +++ b/libgimp/gimpenums.h @@ -55,16 +55,6 @@ typedef enum GIMP_INTERSECT } GimpChannelOps; -typedef enum -{ - GIMP_RED_CHANNEL, - GIMP_GREEN_CHANNEL, - GIMP_BLUE_CHANNEL, - GIMP_GRAY_CHANNEL, - GIMP_INDEXED_CHANNEL, - GIMP_ALPHA_CHANNEL -} GimpChannelType; - typedef enum { GIMP_IMAGE_CLONE, @@ -119,6 +109,16 @@ typedef enum GIMP_ALPHA_LUT } GimpChannelLutType; +typedef enum +{ + GIMP_RED_CHANNEL, + GIMP_GREEN_CHANNEL, + GIMP_BLUE_CHANNEL, + GIMP_GRAY_CHANNEL, + GIMP_INDEXED_CHANNEL, + GIMP_ALPHA_CHANNEL +} GimpChannelType; + typedef enum { GIMP_NORMAL_CONVOL, diff --git a/libgimpconfig/gimpconfig-deserialize.h b/libgimpconfig/gimpconfig-deserialize.h index a2e6c87ee4..48bdef8c00 100644 --- a/libgimpconfig/gimpconfig-deserialize.h +++ b/libgimpconfig/gimpconfig-deserialize.h @@ -1,7 +1,7 @@ /* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * - * Object peoperties deserialization routines + * Object properties deserialization routines * Copyright (C) 2001 Sven Neumann * * This program is free software; you can redistribute it and/or modify diff --git a/libgimpconfig/gimpconfig-serialize.c b/libgimpconfig/gimpconfig-serialize.c index 6112b7689d..c1a9bda7b8 100644 --- a/libgimpconfig/gimpconfig-serialize.c +++ b/libgimpconfig/gimpconfig-serialize.c @@ -1,7 +1,7 @@ /* The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * - * Object propoerties serialization routines + * Object properties serialization routines * Copyright (C) 2001 Sven Neumann * * This program is free software; you can redistribute it and/or modify diff --git a/plug-ins/script-fu/script-fu-constants.c b/plug-ins/script-fu/script-fu-constants.c index 8666b0c972..fcd81b9754 100644 --- a/plug-ins/script-fu/script-fu-constants.c +++ b/plug-ins/script-fu/script-fu-constants.c @@ -42,13 +42,6 @@ init_generated_constants (void) setvar (cintern ("REPLACE"), flocons (2), NIL); setvar (cintern ("INTERSECT"), flocons (3), NIL); - setvar (cintern ("RED-CHANNEL"), flocons (0), NIL); - setvar (cintern ("GREEN-CHANNEL"), flocons (1), NIL); - setvar (cintern ("BLUE-CHANNEL"), flocons (2), NIL); - setvar (cintern ("GRAY-CHANNEL"), flocons (3), NIL); - setvar (cintern ("INDEXED-CHANNEL"), flocons (4), NIL); - setvar (cintern ("ALPHA-CHANNEL"), flocons (5), NIL); - setvar (cintern ("IMAGE-CLONE"), flocons (0), NIL); setvar (cintern ("PATTERN-CLONE"), flocons (1), NIL); @@ -82,6 +75,13 @@ init_generated_constants (void) setvar (cintern ("BLUE-LUT"), flocons (3), NIL); setvar (cintern ("ALPHA-LUT"), flocons (4), NIL); + setvar (cintern ("RED-CHANNEL"), flocons (0), NIL); + setvar (cintern ("GREEN-CHANNEL"), flocons (1), NIL); + setvar (cintern ("BLUE-CHANNEL"), flocons (2), NIL); + setvar (cintern ("GRAY-CHANNEL"), flocons (3), NIL); + setvar (cintern ("INDEXED-CHANNEL"), flocons (4), NIL); + setvar (cintern ("ALPHA-CHANNEL"), flocons (5), NIL); + setvar (cintern ("NORMAL-CONVOL"), flocons (0), NIL); setvar (cintern ("ABSOLUTE-CONVOL"), flocons (1), NIL); setvar (cintern ("NEGATIVE-CONVOL"), flocons (2), NIL); diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl index 0084112e0f..fa17b74422 100644 --- a/tools/pdbgen/enums.pl +++ b/tools/pdbgen/enums.pl @@ -170,18 +170,6 @@ package Gimp::CodeGen::enums; GIMP_BLUE_LUT => '3', GIMP_ALPHA_LUT => '4' } }, - ChannelType => - { contig => 1, - header => 'core/core-types.h', - symbols => [ qw(RED_CHANNEL GREEN_CHANNEL BLUE_CHANNEL - GRAY_CHANNEL INDEXED_CHANNEL ALPHA_CHANNEL) ], - mapping => { RED_CHANNEL => '0', - GREEN_CHANNEL => '1', - BLUE_CHANNEL => '2', - GRAY_CHANNEL => '3', - INDEXED_CHANNEL => '4', - ALPHA_CHANNEL => '5' } - }, AddMaskType => { contig => 1, header => 'core/core-types.h', @@ -298,6 +286,19 @@ package Gimp::CodeGen::enums; GIMP_GRAY => '1', GIMP_INDEXED => '2' } }, + GimpChannelType => + { contig => 1, + header => 'core/core-enums.h', + symbols => [ qw(GIMP_RED_CHANNEL GIMP_GREEN_CHANNEL + GIMP_BLUE_CHANNEL GIMP_GRAY_CHANNEL + GIMP_INDEXED_CHANNEL GIMP_ALPHA_CHANNEL) ], + mapping => { GIMP_RED_CHANNEL => '0', + GIMP_GREEN_CHANNEL => '1', + GIMP_BLUE_CHANNEL => '2', + GIMP_GRAY_CHANNEL => '3', + GIMP_INDEXED_CHANNEL => '4', + GIMP_ALPHA_CHANNEL => '5' } + }, GimpGradientType => { contig => 1, header => 'core/core-enums.h', diff --git a/tools/pdbgen/pdb/image.pdb b/tools/pdbgen/pdb/image.pdb index d7d9cbacef..60a0b9a446 100644 --- a/tools/pdbgen/pdb/image.pdb +++ b/tools/pdbgen/pdb/image.pdb @@ -1152,14 +1152,14 @@ $#procs--; my $comp_arg = <<'CODE'; splice @inargs, 1, 0, ({ name => 'component', - type => 'enum ChannelType (no AUXILLARY_CHANNEL)', + type => 'enum GimpChannelType (no AUXILLARY_CHANNEL)', desc => 'The image component: { %%desc%% }' }); $invoke{code} = <<'SUCCESS'; { - if (component == GRAY_CHANNEL) + if (component == GIMP_GRAY_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_GRAY; - else if (component == INDEXED_CHANNEL) + else if (component == GIMP_INDEXED_CHANNEL) success = gimp_image_base_type (gimage) == GIMP_INDEXED; else success = gimp_image_base_type (gimage) == GIMP_RGB;