diff --git a/ChangeLog b/ChangeLog index 497469fa14..46fbf677a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Thu Jul 29 17:18:42 PDT 1999 Manish Singh + + * 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 * app/makefile.{cygwin,msc}: Add gdiplay_color. Create gimp.def diff --git a/app/core/gimpimage-guides.h b/app/core/gimpimage-guides.h index aa42492f4d..d0283c90a2 100644 --- a/app/core/gimpimage-guides.h +++ b/app/core/gimpimage-guides.h @@ -57,7 +57,7 @@ typedef enum #define COLORMAP_SIZE 768 -typedef enum { /*< chop=ORIENTATION_ >*/ +typedef enum { ORIENTATION_UNKNOWN, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL diff --git a/app/core/gimpimage-merge.h b/app/core/gimpimage-merge.h index aa42492f4d..d0283c90a2 100644 --- a/app/core/gimpimage-merge.h +++ b/app/core/gimpimage-merge.h @@ -57,7 +57,7 @@ typedef enum #define COLORMAP_SIZE 768 -typedef enum { /*< chop=ORIENTATION_ >*/ +typedef enum { ORIENTATION_UNKNOWN, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL diff --git a/app/core/gimpimage-projection.h b/app/core/gimpimage-projection.h index aa42492f4d..d0283c90a2 100644 --- a/app/core/gimpimage-projection.h +++ b/app/core/gimpimage-projection.h @@ -57,7 +57,7 @@ typedef enum #define COLORMAP_SIZE 768 -typedef enum { /*< chop=ORIENTATION_ >*/ +typedef enum { ORIENTATION_UNKNOWN, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL diff --git a/app/core/gimpimage-resize.h b/app/core/gimpimage-resize.h index aa42492f4d..d0283c90a2 100644 --- a/app/core/gimpimage-resize.h +++ b/app/core/gimpimage-resize.h @@ -57,7 +57,7 @@ typedef enum #define COLORMAP_SIZE 768 -typedef enum { /*< chop=ORIENTATION_ >*/ +typedef enum { ORIENTATION_UNKNOWN, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL diff --git a/app/core/gimpimage-scale.h b/app/core/gimpimage-scale.h index aa42492f4d..d0283c90a2 100644 --- a/app/core/gimpimage-scale.h +++ b/app/core/gimpimage-scale.h @@ -57,7 +57,7 @@ typedef enum #define COLORMAP_SIZE 768 -typedef enum { /*< chop=ORIENTATION_ >*/ +typedef enum { ORIENTATION_UNKNOWN, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index aa42492f4d..d0283c90a2 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -57,7 +57,7 @@ typedef enum #define COLORMAP_SIZE 768 -typedef enum { /*< chop=ORIENTATION_ >*/ +typedef enum { ORIENTATION_UNKNOWN, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL diff --git a/app/core/gimpprojection-construct.h b/app/core/gimpprojection-construct.h index aa42492f4d..d0283c90a2 100644 --- a/app/core/gimpprojection-construct.h +++ b/app/core/gimpprojection-construct.h @@ -57,7 +57,7 @@ typedef enum #define COLORMAP_SIZE 768 -typedef enum { /*< chop=ORIENTATION_ >*/ +typedef enum { ORIENTATION_UNKNOWN, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL diff --git a/app/gimpimage.h b/app/gimpimage.h index aa42492f4d..d0283c90a2 100644 --- a/app/gimpimage.h +++ b/app/gimpimage.h @@ -57,7 +57,7 @@ typedef enum #define COLORMAP_SIZE 768 -typedef enum { /*< chop=ORIENTATION_ >*/ +typedef enum { ORIENTATION_UNKNOWN, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL diff --git a/app/guides_cmds.c b/app/guides_cmds.c index 40e7134dab..6ec2ca5f27 100644 --- a/app/guides_cmds.c +++ b/app/guides_cmds.c @@ -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) }" } }; diff --git a/app/tools_cmds.c b/app/tools_cmds.c index c1ee947274..76e079dcb2 100644 --- a/app/tools_cmds.c +++ b/app/tools_cmds.c @@ -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, diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl index 9575b9da03..e88aeab41e 100644 --- a/tools/pdbgen/enums.pl +++ b/tools/pdbgen/enums.pl @@ -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, diff --git a/tools/pdbgen/pdb/misc_tools.pdb b/tools/pdbgen/pdb/misc_tools.pdb index 66f7f87adb..628d496942 100644 --- a/tools/pdbgen/pdb/misc_tools.pdb +++ b/tools/pdbgen/pdb/misc_tools.pdb @@ -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); diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb index 66f7f87adb..628d496942 100644 --- a/tools/pdbgen/pdb/paint_tools.pdb +++ b/tools/pdbgen/pdb/paint_tools.pdb @@ -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); diff --git a/tools/pdbgen/pdb/tools.pdb b/tools/pdbgen/pdb/tools.pdb index 66f7f87adb..628d496942 100644 --- a/tools/pdbgen/pdb/tools.pdb +++ b/tools/pdbgen/pdb/tools.pdb @@ -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); diff --git a/tools/pdbgen/pdb/transform_tools.pdb b/tools/pdbgen/pdb/transform_tools.pdb index 66f7f87adb..628d496942 100644 --- a/tools/pdbgen/pdb/transform_tools.pdb +++ b/tools/pdbgen/pdb/transform_tools.pdb @@ -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);