hard code orientation constants for shear and flip too maintain backwards

* tools/pdbgen/pdb/tools.pdb: hard code orientation constants for
shear and flip too maintain backwards compatibility

* app/gimpimage.h: remove ORIENTATION chop to avoid namespace
collision

-Yosh
This commit is contained in:
Manish Singh 1999-07-30 00:20:50 +00:00
parent 21aae5c7ad
commit 46f8a629e3
16 changed files with 63 additions and 94 deletions

View File

@ -1,3 +1,11 @@
Thu Jul 29 17:18:42 PDT 1999 Manish Singh <yosh@gimp.org>
* tools/pdbgen/pdb/tools.pdb: hard code orientation constants for
shear and flip too maintain backwards compatibility
* app/gimpimage.h: remove ORIENTATION chop to avoid namespace
collision
Thu Jul 29 23:58:08 1999 Tor Lillqvist <tml@iki.fi>
* app/makefile.{cygwin,msc}: Add gdiplay_color. Create gimp.def

View File

@ -57,7 +57,7 @@ typedef enum
#define COLORMAP_SIZE 768
typedef enum { /*< chop=ORIENTATION_ >*/
typedef enum {
ORIENTATION_UNKNOWN,
ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL

View File

@ -57,7 +57,7 @@ typedef enum
#define COLORMAP_SIZE 768
typedef enum { /*< chop=ORIENTATION_ >*/
typedef enum {
ORIENTATION_UNKNOWN,
ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL

View File

@ -57,7 +57,7 @@ typedef enum
#define COLORMAP_SIZE 768
typedef enum { /*< chop=ORIENTATION_ >*/
typedef enum {
ORIENTATION_UNKNOWN,
ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL

View File

@ -57,7 +57,7 @@ typedef enum
#define COLORMAP_SIZE 768
typedef enum { /*< chop=ORIENTATION_ >*/
typedef enum {
ORIENTATION_UNKNOWN,
ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL

View File

@ -57,7 +57,7 @@ typedef enum
#define COLORMAP_SIZE 768
typedef enum { /*< chop=ORIENTATION_ >*/
typedef enum {
ORIENTATION_UNKNOWN,
ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL

View File

@ -57,7 +57,7 @@ typedef enum
#define COLORMAP_SIZE 768
typedef enum { /*< chop=ORIENTATION_ >*/
typedef enum {
ORIENTATION_UNKNOWN,
ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL

View File

@ -57,7 +57,7 @@ typedef enum
#define COLORMAP_SIZE 768
typedef enum { /*< chop=ORIENTATION_ >*/
typedef enum {
ORIENTATION_UNKNOWN,
ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL

View File

@ -57,7 +57,7 @@ typedef enum
#define COLORMAP_SIZE 768
typedef enum { /*< chop=ORIENTATION_ >*/
typedef enum {
ORIENTATION_UNKNOWN,
ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL

View File

@ -444,7 +444,7 @@ static ProcArg image_get_guide_orientation_outargs[] =
{
PDB_INT32,
"orientation",
"The guide's orientation: { HORIZONTAL (1), VERTICAL (2) }"
"The guide's orientation: { ORIENTATION_HORIZONTAL (1), ORIENTATION_VERTICAL (2) }"
}
};

View File

@ -36,7 +36,6 @@
#include "flip_tool.h"
#include "free_select.h"
#include "fuzzy_select.h"
#include "gimpimage.h"
#include "paint_core.h"
#include "paint_funcs.h"
#include "paintbrush.h"
@ -1574,7 +1573,7 @@ flip_invoker (Argument *args)
success = FALSE;
flip_type = args[1].value.pdb_int;
if (flip_type < ORIENTATION_HORIZONTAL || flip_type > ORIENTATION_VERTICAL)
if (flip_type < 0 || flip_type > 1)
success = FALSE;
if (success)
@ -1588,16 +1587,9 @@ flip_invoker (Argument *args)
float_tiles = transform_core_cut (gimage, drawable, &new_layer);
/* flip the buffer */
switch (flip_type)
{
case ORIENTATION_HORIZONTAL:
case ORIENTATION_VERTICAL:
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1, flip_type);
break;
default:
new_tiles = NULL;
break;
}
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1,
flip_type == 1 ? ORIENTATION_VERTICAL :
ORIENTATION_HORIZONTAL);
/* free the cut/copied buffer */
tile_manager_destroy (float_tiles);
@ -1632,7 +1624,7 @@ static ProcArg flip_inargs[] =
{
PDB_INT32,
"flip_type",
"Type of flip: HORIZONTAL (1) or VERTICAL (2)"
"Type of flip: HORIZONTAL (0) or VERTICAL (1)"
}
};
@ -2656,7 +2648,7 @@ shear_invoker (Argument *args)
interpolation = args[1].value.pdb_int ? TRUE : FALSE;
shear_type = args[2].value.pdb_int;
if (shear_type < ORIENTATION_HORIZONTAL || shear_type > ORIENTATION_VERTICAL)
if (shear_type < 0 || shear_type > 1)
success = FALSE;
magnitude = args[3].value.pdb_float;
@ -2677,9 +2669,9 @@ shear_invoker (Argument *args)
gimp_matrix_identity (matrix);
gimp_matrix_translate (matrix, -cx, -cy);
/* Shear matrix */
if (shear_type == ORIENTATION_HORIZONTAL)
if (shear_type == 0)
gimp_matrix_xshear (matrix, magnitude / float_tiles->height);
else if (shear_type == ORIENTATION_VERTICAL)
else if (shear_type == 1)
gimp_matrix_yshear (matrix, magnitude / float_tiles->width);
gimp_matrix_translate (matrix, +cx, +cy);
@ -2725,7 +2717,7 @@ static ProcArg shear_inargs[] =
{
PDB_INT32,
"shear_type",
"Type of shear: HORIZONTAL (1) or VERTICAL (2)"
"Type of shear: HORIZONTAL (0) or VERTICAL (1)"
},
{
PDB_FLOAT,

View File

@ -192,10 +192,7 @@ package Gimp::CodeGen::enums;
ORIENTATION_VERTICAL) ],
mapping => { ORIENTATION_UNKNOWN => '0',
ORIENTATION_HORIZONTAL => '1',
ORIENTATION_VERTICAL => '2' },
nicks => { ORIENTATION_UNKNOWN => 'UNKNOWN',
ORIENTATION_HORIZONTAL => 'HORIZONTAL',
ORIENTATION_VERTICAL => 'VERTICAL' }
ORIENTATION_VERTICAL => '2' }
},
ChannelType =>
{ contig => 1,

View File

@ -649,8 +649,8 @@ HELP
@inargs = (
&drawable_arg,
{ name => 'flip_type', type => &std_orientation_enum,
desc => 'Type of flip: %%desc%%' }
{ name => 'flip_type', type => '0 <= int32 <= 1',
desc => 'Type of flip: HORIZONTAL (0) or VERTICAL (1)' }
);
@outargs = ( &drawable_out_arg('flipped') );
@ -670,16 +670,9 @@ HELP
float_tiles = transform_core_cut (gimage, drawable, &new_layer);
/* flip the buffer */
switch (flip_type)
{
case ORIENTATION_HORIZONTAL:
case ORIENTATION_VERTICAL:
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1, flip_type);
break;
default:
new_tiles = NULL;
break;
}
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1,
flip_type == 1 ? ORIENTATION_VERTICAL :
ORIENTATION_HORIZONTAL);
/* free the cut/copied buffer */
tile_manager_destroy (float_tiles);
@ -1233,8 +1226,8 @@ HELP
&drawable_arg,
{ name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' },
{ name => 'shear_type', type => &std_orientation_enum,
desc => 'Type of shear: %%desc%%' },
{ name => 'shear_type', type => '0 <= int32 <= 1',
desc => 'Type of shear: HORIZONTAL (0) or VERTICAL (1)' },
{ name => 'magnitude', type => 'float',
desc => 'The magnitude of the shear' }
);
@ -1263,9 +1256,9 @@ HELP
gimp_matrix_identity (matrix);
gimp_matrix_translate (matrix, -cx, -cy);
/* Shear matrix */
if (shear_type == ORIENTATION_HORIZONTAL)
if (shear_type == 0)
gimp_matrix_xshear (matrix, magnitude / float_tiles->height);
else if (shear_type == ORIENTATION_VERTICAL)
else if (shear_type == 1)
gimp_matrix_yshear (matrix, magnitude / float_tiles->width);
gimp_matrix_translate (matrix, +cx, +cy);

View File

@ -649,8 +649,8 @@ HELP
@inargs = (
&drawable_arg,
{ name => 'flip_type', type => &std_orientation_enum,
desc => 'Type of flip: %%desc%%' }
{ name => 'flip_type', type => '0 <= int32 <= 1',
desc => 'Type of flip: HORIZONTAL (0) or VERTICAL (1)' }
);
@outargs = ( &drawable_out_arg('flipped') );
@ -670,16 +670,9 @@ HELP
float_tiles = transform_core_cut (gimage, drawable, &new_layer);
/* flip the buffer */
switch (flip_type)
{
case ORIENTATION_HORIZONTAL:
case ORIENTATION_VERTICAL:
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1, flip_type);
break;
default:
new_tiles = NULL;
break;
}
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1,
flip_type == 1 ? ORIENTATION_VERTICAL :
ORIENTATION_HORIZONTAL);
/* free the cut/copied buffer */
tile_manager_destroy (float_tiles);
@ -1233,8 +1226,8 @@ HELP
&drawable_arg,
{ name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' },
{ name => 'shear_type', type => &std_orientation_enum,
desc => 'Type of shear: %%desc%%' },
{ name => 'shear_type', type => '0 <= int32 <= 1',
desc => 'Type of shear: HORIZONTAL (0) or VERTICAL (1)' },
{ name => 'magnitude', type => 'float',
desc => 'The magnitude of the shear' }
);
@ -1263,9 +1256,9 @@ HELP
gimp_matrix_identity (matrix);
gimp_matrix_translate (matrix, -cx, -cy);
/* Shear matrix */
if (shear_type == ORIENTATION_HORIZONTAL)
if (shear_type == 0)
gimp_matrix_xshear (matrix, magnitude / float_tiles->height);
else if (shear_type == ORIENTATION_VERTICAL)
else if (shear_type == 1)
gimp_matrix_yshear (matrix, magnitude / float_tiles->width);
gimp_matrix_translate (matrix, +cx, +cy);

View File

@ -649,8 +649,8 @@ HELP
@inargs = (
&drawable_arg,
{ name => 'flip_type', type => &std_orientation_enum,
desc => 'Type of flip: %%desc%%' }
{ name => 'flip_type', type => '0 <= int32 <= 1',
desc => 'Type of flip: HORIZONTAL (0) or VERTICAL (1)' }
);
@outargs = ( &drawable_out_arg('flipped') );
@ -670,16 +670,9 @@ HELP
float_tiles = transform_core_cut (gimage, drawable, &new_layer);
/* flip the buffer */
switch (flip_type)
{
case ORIENTATION_HORIZONTAL:
case ORIENTATION_VERTICAL:
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1, flip_type);
break;
default:
new_tiles = NULL;
break;
}
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1,
flip_type == 1 ? ORIENTATION_VERTICAL :
ORIENTATION_HORIZONTAL);
/* free the cut/copied buffer */
tile_manager_destroy (float_tiles);
@ -1233,8 +1226,8 @@ HELP
&drawable_arg,
{ name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' },
{ name => 'shear_type', type => &std_orientation_enum,
desc => 'Type of shear: %%desc%%' },
{ name => 'shear_type', type => '0 <= int32 <= 1',
desc => 'Type of shear: HORIZONTAL (0) or VERTICAL (1)' },
{ name => 'magnitude', type => 'float',
desc => 'The magnitude of the shear' }
);
@ -1263,9 +1256,9 @@ HELP
gimp_matrix_identity (matrix);
gimp_matrix_translate (matrix, -cx, -cy);
/* Shear matrix */
if (shear_type == ORIENTATION_HORIZONTAL)
if (shear_type == 0)
gimp_matrix_xshear (matrix, magnitude / float_tiles->height);
else if (shear_type == ORIENTATION_VERTICAL)
else if (shear_type == 1)
gimp_matrix_yshear (matrix, magnitude / float_tiles->width);
gimp_matrix_translate (matrix, +cx, +cy);

View File

@ -649,8 +649,8 @@ HELP
@inargs = (
&drawable_arg,
{ name => 'flip_type', type => &std_orientation_enum,
desc => 'Type of flip: %%desc%%' }
{ name => 'flip_type', type => '0 <= int32 <= 1',
desc => 'Type of flip: HORIZONTAL (0) or VERTICAL (1)' }
);
@outargs = ( &drawable_out_arg('flipped') );
@ -670,16 +670,9 @@ HELP
float_tiles = transform_core_cut (gimage, drawable, &new_layer);
/* flip the buffer */
switch (flip_type)
{
case ORIENTATION_HORIZONTAL:
case ORIENTATION_VERTICAL:
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1, flip_type);
break;
default:
new_tiles = NULL;
break;
}
new_tiles = flip_tool_flip (gimage, drawable, float_tiles, -1,
flip_type == 1 ? ORIENTATION_VERTICAL :
ORIENTATION_HORIZONTAL);
/* free the cut/copied buffer */
tile_manager_destroy (float_tiles);
@ -1233,8 +1226,8 @@ HELP
&drawable_arg,
{ name => 'interpolation', type => 'boolean',
desc => 'Whether to use interpolation' },
{ name => 'shear_type', type => &std_orientation_enum,
desc => 'Type of shear: %%desc%%' },
{ name => 'shear_type', type => '0 <= int32 <= 1',
desc => 'Type of shear: HORIZONTAL (0) or VERTICAL (1)' },
{ name => 'magnitude', type => 'float',
desc => 'The magnitude of the shear' }
);
@ -1263,9 +1256,9 @@ HELP
gimp_matrix_identity (matrix);
gimp_matrix_translate (matrix, -cx, -cy);
/* Shear matrix */
if (shear_type == ORIENTATION_HORIZONTAL)
if (shear_type == 0)
gimp_matrix_xshear (matrix, magnitude / float_tiles->height);
else if (shear_type == ORIENTATION_VERTICAL)
else if (shear_type == 1)
gimp_matrix_yshear (matrix, magnitude / float_tiles->width);
gimp_matrix_translate (matrix, +cx, +cy);