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

app/core/core-enums.h more enum cleanup (GimpOffsetType, MergeType).

2002-03-18  Sven Neumann  <sven@gimp.org>

	* app/core/core-enums.h
	* app/core/core-types.h: more enum cleanup (GimpOffsetType, MergeType).

	* app/core/gimpdrawable-offset.c
	* app/core/gimpimage-merge.[ch]
	* app/gui/image-commands.c
	* app/gui/layers-commands.c
	* app/gui/offset-dialog.c
	* tools/pdbgen/pdb/image.pdb: changed accordingly.

	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c
	* libgimp/gimpenums.h
	* plug-ins/script-fu/script-fu-constants.c
	* tools/pdbgen/enums.pl: regenerated.
parent d68b730a
2002-03-18 Sven Neumann <sven@gimp.org>
* app/core/core-enums.h
* app/core/core-types.h: more enum cleanup (GimpOffsetType, MergeType).
* app/core/gimpdrawable-offset.c
* app/core/gimpimage-merge.[ch]
* app/gui/image-commands.c
* app/gui/layers-commands.c
* app/gui/offset-dialog.c
* tools/pdbgen/pdb/image.pdb: changed accordingly.
* app/pdb/drawable_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpenums.h
* plug-ins/script-fu/script-fu-constants.c
* tools/pdbgen/enums.pl: regenerated.
2002-03-18 Sven Neumann <sven@gimp.org>
* app/core/core-enums.h
......
......@@ -244,10 +244,10 @@ typedef struct _LayerMergeOptions LayerMergeOptions;
struct _LayerMergeOptions
{
GtkWidget *query_box;
GimpImage *gimage;
gboolean merge_visible;
MergeType merge_type;
GtkWidget *query_box;
GimpImage *gimage;
gboolean merge_visible;
GimpMergeType merge_type;
};
static void
......@@ -282,7 +282,7 @@ image_layers_merge_query (GimpImage *gimage,
options = g_new (LayerMergeOptions, 1);
options->gimage = gimage;
options->merge_visible = merge_visible;
options->merge_type = EXPAND_AS_NECESSARY;
options->merge_type = GIMP_EXPAND_AS_NECESSARY;
/* The dialog */
options->query_box =
......@@ -319,11 +319,11 @@ image_layers_merge_query (GimpImage *gimage,
GINT_TO_POINTER (options->merge_type),
_("Expanded as necessary"),
GINT_TO_POINTER (EXPAND_AS_NECESSARY), NULL,
GINT_TO_POINTER (GIMP_EXPAND_AS_NECESSARY), NULL,
_("Clipped to image"),
GINT_TO_POINTER (CLIP_TO_IMAGE), NULL,
GINT_TO_POINTER (GIMP_CLIP_TO_IMAGE), NULL,
_("Clipped to bottom layer"),
GINT_TO_POINTER (CLIP_TO_BOTTOM_LAYER), NULL,
GINT_TO_POINTER (GIMP_CLIP_TO_BOTTOM_LAYER), NULL,
NULL);
......
......@@ -220,7 +220,7 @@ layers_merge_down_cmd_callback (GtkWidget *widget,
GimpLayer *active_layer;
return_if_no_layer (gimage, active_layer);
gimp_image_merge_down (gimage, active_layer, EXPAND_AS_NECESSARY);
gimp_image_merge_down (gimage, active_layer, GIMP_EXPAND_AS_NECESSARY);
gdisplays_flush ();
}
......
......@@ -241,6 +241,20 @@ typedef enum /*< skip >*/
GIMP_MASK_DISCARD
} GimpMaskApplyMode;
typedef enum /*< skip >*/
{
GIMP_EXPAND_AS_NECESSARY,
GIMP_CLIP_TO_IMAGE,
GIMP_CLIP_TO_BOTTOM_LAYER,
GIMP_FLATTEN_IMAGE
} GimpMergeType;
typedef enum /*< skip >*/
{
GIMP_OFFSET_BACKGROUND,
GIMP_OFFSET_TRANSPARENT
} GimpOffsetType;
typedef enum /*< skip >*/
{
GIMP_SHADOWS,
......
......@@ -50,20 +50,6 @@ typedef enum /*< pdb-skip >*/
ORIENTATION_VERTICAL
} InternalOrientationType;
typedef enum
{
OFFSET_BACKGROUND,
OFFSET_TRANSPARENT
} GimpOffsetType;
typedef enum
{
EXPAND_AS_NECESSARY,
CLIP_TO_IMAGE,
CLIP_TO_BOTTOM_LAYER,
FLATTEN_IMAGE
} MergeType;
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
......
......@@ -222,7 +222,7 @@ gimp_drawable_offset (GimpDrawable *drawable,
/* Otherwise, fill the vacated regions */
else
{
if (fill_type == OFFSET_BACKGROUND)
if (fill_type == GIMP_OFFSET_BACKGROUND)
{
Gimp *gimp;
GimpRGB color;
......
......@@ -56,8 +56,8 @@
/* public functions */
GimpLayer *
gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type)
gimp_image_merge_visible_layers (GimpImage *gimage,
GimpMergeType merge_type)
{
GList *list;
GSList *merge_list = NULL;
......@@ -135,7 +135,7 @@ gimp_image_flatten (GimpImage *gimage)
merge_list = g_slist_append (merge_list, layer);
}
layer = gimp_image_merge_layers (gimage, merge_list, FLATTEN_IMAGE);
layer = gimp_image_merge_layers (gimage, merge_list, GIMP_FLATTEN_IMAGE);
g_slist_free (merge_list);
gimp_image_alpha_changed (gimage);
......@@ -146,9 +146,9 @@ gimp_image_flatten (GimpImage *gimage)
}
GimpLayer *
gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type)
gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
GimpMergeType merge_type)
{
GimpLayer *layer;
GList *list;
......@@ -198,9 +198,9 @@ gimp_image_merge_down (GimpImage *gimage,
}
GimpLayer *
gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type)
gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
GimpMergeType merge_type)
{
GList *list;
GSList *reverse_list = NULL;
......@@ -239,8 +239,8 @@ gimp_image_merge_layers (GimpImage *gimage,
switch (merge_type)
{
case EXPAND_AS_NECESSARY:
case CLIP_TO_IMAGE:
case GIMP_EXPAND_AS_NECESSARY:
case GIMP_CLIP_TO_IMAGE:
if (!count)
{
x1 = off_x;
......@@ -259,7 +259,7 @@ gimp_image_merge_layers (GimpImage *gimage,
if ((off_y + gimp_drawable_height (GIMP_DRAWABLE (layer))) > y2)
y2 = (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer)));
}
if (merge_type == CLIP_TO_IMAGE)
if (merge_type == GIMP_CLIP_TO_IMAGE)
{
x1 = CLAMP (x1, 0, gimage->width);
y1 = CLAMP (y1, 0, gimage->height);
......@@ -268,7 +268,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
break;
case CLIP_TO_BOTTOM_LAYER:
case GIMP_CLIP_TO_BOTTOM_LAYER:
if (merge_list->next == NULL)
{
x1 = off_x;
......@@ -278,7 +278,7 @@ gimp_image_merge_layers (GimpImage *gimage,
}
break;
case FLATTEN_IMAGE:
case GIMP_FLATTEN_IMAGE:
if (merge_list->next == NULL)
{
x1 = 0;
......@@ -302,7 +302,7 @@ gimp_image_merge_layers (GimpImage *gimage,
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer)));
if (merge_type == FLATTEN_IMAGE ||
if (merge_type == GIMP_FLATTEN_IMAGE ||
gimp_drawable_type (GIMP_DRAWABLE (layer)) == GIMP_INDEXED_IMAGE)
{
type = GIMP_IMAGE_TYPE_FROM_BASE_TYPE (gimp_image_base_type (gimage));
......@@ -465,7 +465,7 @@ gimp_image_merge_layers (GimpImage *gimage,
g_slist_free (reverse_list);
/* if the type is flatten, remove all the remaining layers */
if (merge_type == FLATTEN_IMAGE)
if (merge_type == GIMP_FLATTEN_IMAGE)
{
list = GIMP_LIST (gimage->layers)->list;
while (list)
......
......@@ -20,15 +20,15 @@
#define __GIMP_IMAGE_MERGE_H__
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
MergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
MergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
MergeType merge_type);
GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage,
GimpMergeType merge_type);
GimpLayer * gimp_image_merge_down (GimpImage *gimage,
GimpLayer *current_layer,
GimpMergeType merge_type);
GimpLayer * gimp_image_flatten (GimpImage *gimage);
GimpLayer * gimp_image_merge_layers (GimpImage *gimage,
GSList *merge_list,
GimpMergeType merge_type);
#endif /* __GIMP_IMAGE_MERGE_H__ */
......@@ -194,9 +194,11 @@ offset_dialog_create (GimpDrawable *drawable)
GINT_TO_POINTER (off_d->fill_type),
_("Background"),
GINT_TO_POINTER (OFFSET_BACKGROUND), NULL,
GINT_TO_POINTER (GIMP_OFFSET_BACKGROUND), NULL,
_("Transparent"),
GINT_TO_POINTER (OFFSET_TRANSPARENT), &radio_button,
GINT_TO_POINTER (GIMP_OFFSET_TRANSPARENT),
&radio_button,
NULL);
......
......@@ -244,10 +244,10 @@ typedef struct _LayerMergeOptions LayerMergeOptions;
struct _LayerMergeOptions
{
GtkWidget *query_box;
GimpImage *gimage;
gboolean merge_visible;
MergeType merge_type;
GtkWidget *query_box;
GimpImage *gimage;
gboolean merge_visible;
GimpMergeType merge_type;
};
static void
......@@ -282,7 +282,7 @@ image_layers_merge_query (GimpImage *gimage,
options = g_new (LayerMergeOptions, 1);
options->gimage = gimage;
options->merge_visible = merge_visible;
options->merge_type = EXPAND_AS_NECESSARY;
options->merge_type = GIMP_EXPAND_AS_NECESSARY;
/* The dialog */
options->query_box =
......@@ -319,11 +319,11 @@ image_layers_merge_query (GimpImage *gimage,
GINT_TO_POINTER (options->merge_type),
_("Expanded as necessary"),
GINT_TO_POINTER (EXPAND_AS_NECESSARY), NULL,
GINT_TO_POINTER (GIMP_EXPAND_AS_NECESSARY), NULL,
_("Clipped to image"),
GINT_TO_POINTER (CLIP_TO_IMAGE), NULL,
GINT_TO_POINTER (GIMP_CLIP_TO_IMAGE), NULL,
_("Clipped to bottom layer"),
GINT_TO_POINTER (CLIP_TO_BOTTOM_LAYER), NULL,
GINT_TO_POINTER (GIMP_CLIP_TO_BOTTOM_LAYER), NULL,
NULL);
......
......@@ -220,7 +220,7 @@ layers_merge_down_cmd_callback (GtkWidget *widget,
GimpLayer *active_layer;
return_if_no_layer (gimage, active_layer);
gimp_image_merge_down (gimage, active_layer, EXPAND_AS_NECESSARY);
gimp_image_merge_down (gimage, active_layer, GIMP_EXPAND_AS_NECESSARY);
gdisplays_flush ();
}
......
......@@ -194,9 +194,11 @@ offset_dialog_create (GimpDrawable *drawable)
GINT_TO_POINTER (off_d->fill_type),
_("Background"),
GINT_TO_POINTER (OFFSET_BACKGROUND), NULL,
GINT_TO_POINTER (GIMP_OFFSET_BACKGROUND), NULL,
_("Transparent"),
GINT_TO_POINTER (OFFSET_TRANSPARENT), &radio_button,
GINT_TO_POINTER (GIMP_OFFSET_TRANSPARENT),
&radio_button,
NULL);
......
......@@ -33,7 +33,6 @@
#include "base/tile-manager.h"
#include "base/tile.h"
#include "core/core-enums.h"
#include "core/core-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpdrawable-offset.h"
......@@ -1545,7 +1544,7 @@ drawable_offset_invoker (Gimp *gimp,
wrap_around = args[1].value.pdb_int ? TRUE : FALSE;
fill_type = args[2].value.pdb_int;
if (fill_type < OFFSET_BACKGROUND || fill_type > OFFSET_TRANSPARENT)
if (fill_type < GIMP_OFFSET_BACKGROUND || fill_type > GIMP_OFFSET_TRANSPARENT)
success = FALSE;
offset_x = args[3].value.pdb_int;
......@@ -1575,7 +1574,7 @@ static ProcArg drawable_offset_inargs[] =
{
GIMP_PDB_INT32,
"fill_type",
"fill vacated regions of drawable with background or transparent: OFFSET_BACKGROUND (0) or OFFSET_TRANSPARENT (1)"
"fill vacated regions of drawable with background or transparent: GIMP_OFFSET_BACKGROUND (0) or GIMP_OFFSET_TRANSPARENT (1)"
},
{
GIMP_PDB_INT32,
......
......@@ -31,7 +31,6 @@
#include "base/temp-buf.h"
#include "core/core-enums.h"
#include "core/core-types.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontainer.h"
......@@ -1265,7 +1264,7 @@ image_merge_visible_layers_invoker (Gimp *gimp,
success = FALSE;
merge_type = args[1].value.pdb_int;
if (merge_type < EXPAND_AS_NECESSARY || merge_type > CLIP_TO_BOTTOM_LAYER)
if (merge_type < GIMP_EXPAND_AS_NECESSARY || merge_type > GIMP_CLIP_TO_BOTTOM_LAYER)
success = FALSE;
if (success)
......@@ -1292,7 +1291,7 @@ static ProcArg image_merge_visible_layers_inargs[] =
{
GIMP_PDB_INT32,
"merge_type",
"The type of merge: { EXPAND_AS_NECESSARY (0), CLIP_TO_IMAGE (1), CLIP_TO_BOTTOM_LAYER (2) }"
"The type of merge: { GIMP_EXPAND_AS_NECESSARY (0), GIMP_CLIP_TO_IMAGE (1), GIMP_CLIP_TO_BOTTOM_LAYER (2) }"
}
};
......@@ -1341,7 +1340,7 @@ image_merge_down_invoker (Gimp *gimp,
success = FALSE;
merge_type = args[2].value.pdb_int;
if (merge_type < EXPAND_AS_NECESSARY || merge_type > CLIP_TO_BOTTOM_LAYER)
if (merge_type < GIMP_EXPAND_AS_NECESSARY || merge_type > GIMP_CLIP_TO_BOTTOM_LAYER)
success = FALSE;
if (success)
......@@ -1373,7 +1372,7 @@ static ProcArg image_merge_down_inargs[] =
{
GIMP_PDB_INT32,
"merge_type",
"The type of merge: { EXPAND_AS_NECESSARY (0), CLIP_TO_IMAGE (1), CLIP_TO_BOTTOM_LAYER (2) }"
"The type of merge: { GIMP_EXPAND_AS_NECESSARY (0), GIMP_CLIP_TO_IMAGE (1), GIMP_CLIP_TO_BOTTOM_LAYER (2) }"
}
};
......
......@@ -199,6 +199,14 @@ typedef enum
GIMP_MASK_DISCARD
} GimpMaskApplyMode;
typedef enum
{
GIMP_EXPAND_AS_NECESSARY,
GIMP_CLIP_TO_IMAGE,
GIMP_CLIP_TO_BOTTOM_LAYER,
GIMP_FLATTEN_IMAGE
} GimpMergeType;
typedef enum
{
GIMP_OFFSET_BACKGROUND,
......@@ -246,14 +254,6 @@ typedef enum
GIMP_MAGENTA_HUES
} GimpHueRange;
typedef enum
{
GIMP_EXPAND_AS_NECESSARY,
GIMP_CLIP_TO_IMAGE,
GIMP_CLIP_TO_BOTTOM_LAYER,
GIMP_FLATTEN_IMAGE
} GimpMergeType;
typedef enum
{
GIMP_HORIZONTAL,
......
......@@ -141,6 +141,11 @@ init_generated_constants (void)
setvar (cintern ("MASK-APPLY"), flocons (0), NIL);
setvar (cintern ("MASK-DISCARD"), flocons (1), NIL);
setvar (cintern ("EXPAND-AS-NECESSARY"), flocons (0), NIL);
setvar (cintern ("CLIP-TO-IMAGE"), flocons (1), NIL);
setvar (cintern ("CLIP-TO-BOTTOM-LAYER"), flocons (2), NIL);
setvar (cintern ("FLATTEN-IMAGE"), flocons (3), NIL);
setvar (cintern ("MESSAGE-BOX"), flocons (0), NIL);
setvar (cintern ("CONSOLE"), flocons (1), NIL);
setvar (cintern ("ERROR-CONSOLE"), flocons (2), NIL);
......@@ -220,11 +225,6 @@ init_generated_constants (void)
setvar (cintern ("BLUE-HUES"), flocons (5), NIL);
setvar (cintern ("MAGENTA-HUES"), flocons (6), NIL);
setvar (cintern ("EXPAND-AS-NECESSARY"), flocons (0), NIL);
setvar (cintern ("CLIP-TO-IMAGE"), flocons (1), NIL);
setvar (cintern ("CLIP-TO-BOTTOM-LAYER"), flocons (2), NIL);
setvar (cintern ("FLATTEN-IMAGE"), flocons (3), NIL);
setvar (cintern ("HORIZONTAL"), flocons (0), NIL);
setvar (cintern ("VERTICAL"), flocons (1), NIL);
setvar (cintern ("UNKNOWN"), flocons (2), NIL);
......
......@@ -169,23 +169,6 @@ package Gimp::CodeGen::enums;
VERTICAL => '1',
UNKNOWN => '2' }
},
GimpOffsetType =>
{ contig => 1,
header => 'core/core-types.h',
symbols => [ qw(OFFSET_BACKGROUND OFFSET_TRANSPARENT) ],
mapping => { OFFSET_BACKGROUND => '0',
OFFSET_TRANSPARENT => '1' }
},
MergeType =>
{ contig => 1,
header => 'core/core-types.h',
symbols => [ qw(EXPAND_AS_NECESSARY CLIP_TO_IMAGE
CLIP_TO_BOTTOM_LAYER FLATTEN_IMAGE) ],
mapping => { EXPAND_AS_NECESSARY => '0',
CLIP_TO_IMAGE => '1',
CLIP_TO_BOTTOM_LAYER => '2',
FLATTEN_IMAGE => '3' }
},
GimpImageBaseType =>
{ contig => 1,
header => 'core/core-enums.h',
......@@ -335,6 +318,23 @@ package Gimp::CodeGen::enums;
mapping => { GIMP_MASK_APPLY => '0',
GIMP_MASK_DISCARD => '1' }
},
GimpMergeType =>
{ contig => 1,
header => 'core/core-enums.h',
symbols => [ qw(GIMP_EXPAND_AS_NECESSARY GIMP_CLIP_TO_IMAGE
GIMP_CLIP_TO_BOTTOM_LAYER GIMP_FLATTEN_IMAGE) ],
mapping => { GIMP_EXPAND_AS_NECESSARY => '0',
GIMP_CLIP_TO_IMAGE => '1',
GIMP_CLIP_TO_BOTTOM_LAYER => '2',
GIMP_FLATTEN_IMAGE => '3' }
},
GimpOffsetType =>
{ contig => 1,
header => 'core/core-enums.h',
symbols => [ qw(GIMP_OFFSET_BACKGROUND GIMP_OFFSET_TRANSPARENT) ],
mapping => { GIMP_OFFSET_BACKGROUND => '0',
GIMP_OFFSET_TRANSPARENT => '1' }
},
GimpTransferMode =>
{ contig => 1,
header => 'core/core-enums.h',
......
......@@ -513,7 +513,8 @@ HELP
@inargs = (
&std_image_arg,
{ name => 'merge_type', type => 'enum MergeType (no FLATTEN_IMAGE)',
{ name => 'merge_type',
type => 'enum GimpMergeType (no GIMP_FLATTEN_IMAGE)',
desc => 'The type of merge: { %%desc%% }' }
);
......@@ -552,7 +553,8 @@ HELP
&std_image_arg,
{ name => 'merge_layer', type => 'layer',
desc => 'The layer to merge down from' },
{ name => 'merge_type', type => 'enum MergeType (no FLATTEN_IMAGE)',
{ name => 'merge_type',
type => 'enum GimpMergeType (no GIMP_FLATTEN_IMAGE)',
desc => 'The type of merge: { %%desc%% }' }
);
......
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