mirror of https://github.com/GNOME/gimp.git
export enum GimpRotationType to libgimp.
2003-12-09 Michael Natterer <mitch@gimp.org> * app/core/core-enums.h: export enum GimpRotationType to libgimp. * tools/pdbgen/pdb/image.pdb: added gimp_image_rotate() PDB wrapper. * app/pdb/image_cmds.c * app/pdb/internal_procs.c * libgimp/gimpenums.h * libgimp/gimpimage_pdb.[ch] * plug-ins/pygimp/gimpenums.py * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated. 2003-12-09 Michael Natterer <mitch@gimp.org> * libgimp/libgimp-sections.txt * libgimp/tmpl/gimpenums.sgml * libgimp/tmpl/gimpimage.sgml: added gimp_image_rotate().
This commit is contained in:
parent
cc5701a42a
commit
e009182a1e
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2003-12-09 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/core/core-enums.h: export enum GimpRotationType to libgimp.
|
||||
|
||||
* tools/pdbgen/pdb/image.pdb: added gimp_image_rotate() PDB wrapper.
|
||||
|
||||
* app/pdb/image_cmds.c
|
||||
* app/pdb/internal_procs.c
|
||||
* libgimp/gimpenums.h
|
||||
* libgimp/gimpimage_pdb.[ch]
|
||||
* plug-ins/pygimp/gimpenums.py
|
||||
* plug-ins/script-fu/script-fu-constants.c
|
||||
* tools/pdbgen/enums.pl: regenerated.
|
||||
|
||||
2003-12-08 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* Makefile.am
|
||||
|
|
|
@ -274,7 +274,7 @@ typedef enum
|
|||
|
||||
GType gimp_rotation_type_get_type (void) G_GNUC_CONST;
|
||||
|
||||
typedef enum /*< pdb-skip >*/
|
||||
typedef enum
|
||||
{
|
||||
GIMP_ROTATE_90,
|
||||
GIMP_ROTATE_180,
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "core/gimpimage-flip.h"
|
||||
#include "core/gimpimage-merge.h"
|
||||
#include "core/gimpimage-resize.h"
|
||||
#include "core/gimpimage-rotate.h"
|
||||
#include "core/gimpimage-scale.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
|
@ -65,6 +66,7 @@ static ProcRecord image_resize_proc;
|
|||
static ProcRecord image_scale_proc;
|
||||
static ProcRecord image_crop_proc;
|
||||
static ProcRecord image_flip_proc;
|
||||
static ProcRecord image_rotate_proc;
|
||||
static ProcRecord image_get_layers_proc;
|
||||
static ProcRecord image_get_channels_proc;
|
||||
static ProcRecord image_get_active_drawable_proc;
|
||||
|
@ -128,6 +130,7 @@ register_image_procs (Gimp *gimp)
|
|||
procedural_db_register (gimp, &image_scale_proc);
|
||||
procedural_db_register (gimp, &image_crop_proc);
|
||||
procedural_db_register (gimp, &image_flip_proc);
|
||||
procedural_db_register (gimp, &image_rotate_proc);
|
||||
procedural_db_register (gimp, &image_get_layers_proc);
|
||||
procedural_db_register (gimp, &image_get_channels_proc);
|
||||
procedural_db_register (gimp, &image_get_active_drawable_proc);
|
||||
|
@ -930,7 +933,7 @@ static ProcRecord image_flip_proc =
|
|||
{
|
||||
"gimp_image_flip",
|
||||
"Flips the image horizontally or vertically.",
|
||||
"This procedure flips (mirrors) the images.",
|
||||
"This procedure flips (mirrors) the image.",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"Spencer Kimball & Peter Mattis",
|
||||
"1995-1996",
|
||||
|
@ -942,6 +945,60 @@ static ProcRecord image_flip_proc =
|
|||
{ { image_flip_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_rotate_invoker (Gimp *gimp,
|
||||
Argument *args)
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
GimpImage *gimage;
|
||||
gint32 rotate_type;
|
||||
|
||||
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
|
||||
if (! GIMP_IS_IMAGE (gimage))
|
||||
success = FALSE;
|
||||
|
||||
rotate_type = args[1].value.pdb_int;
|
||||
if (rotate_type < GIMP_ROTATE_90 || rotate_type > GIMP_ROTATE_270)
|
||||
success = FALSE;
|
||||
|
||||
if (success)
|
||||
{
|
||||
gimp_image_rotate (gimage, rotate_type, NULL, NULL);
|
||||
}
|
||||
|
||||
return procedural_db_return_args (&image_rotate_proc, success);
|
||||
}
|
||||
|
||||
static ProcArg image_rotate_inargs[] =
|
||||
{
|
||||
{
|
||||
GIMP_PDB_IMAGE,
|
||||
"image",
|
||||
"The image"
|
||||
},
|
||||
{
|
||||
GIMP_PDB_INT32,
|
||||
"rotate_type",
|
||||
"Angle of rotation: GIMP_ROTATE_90 (0), GIMP_ROTATE_180 (1), GIMP_ROTATE_270 (2)"
|
||||
}
|
||||
};
|
||||
|
||||
static ProcRecord image_rotate_proc =
|
||||
{
|
||||
"gimp_image_rotate",
|
||||
"Rotates the image by the spacified degrees.",
|
||||
"This procedure rotates the image.",
|
||||
"Michael Natterer",
|
||||
"Michael Natterer",
|
||||
"2003",
|
||||
GIMP_INTERNAL,
|
||||
2,
|
||||
image_rotate_inargs,
|
||||
0,
|
||||
NULL,
|
||||
{ { image_rotate_invoker } }
|
||||
};
|
||||
|
||||
static Argument *
|
||||
image_get_layers_invoker (Gimp *gimp,
|
||||
Argument *args)
|
||||
|
|
|
@ -69,7 +69,7 @@ void register_transform_tools_procs (Gimp *gimp);
|
|||
void register_undo_procs (Gimp *gimp);
|
||||
void register_unit_procs (Gimp *gimp);
|
||||
|
||||
/* 346 procedures registered total */
|
||||
/* 347 procedures registered total */
|
||||
|
||||
void
|
||||
internal_procs_init (Gimp *gimp,
|
||||
|
@ -93,82 +93,82 @@ internal_procs_init (Gimp *gimp,
|
|||
(* status_callback) (NULL, _("Convert"), 0.104);
|
||||
register_convert_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Display procedures"), 0.113);
|
||||
(* status_callback) (NULL, _("Display procedures"), 0.112);
|
||||
register_display_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Drawable procedures"), 0.124);
|
||||
register_drawable_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Edit procedures"), 0.217);
|
||||
(* status_callback) (NULL, _("Edit procedures"), 0.216);
|
||||
register_edit_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("File Operations"), 0.234);
|
||||
(* status_callback) (NULL, _("File Operations"), 0.233);
|
||||
register_fileops_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Floating selections"), 0.257);
|
||||
(* status_callback) (NULL, _("Floating selections"), 0.256);
|
||||
register_floating_sel_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Font UI"), 0.275);
|
||||
(* status_callback) (NULL, _("Font UI"), 0.274);
|
||||
register_font_select_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Fonts"), 0.283);
|
||||
(* status_callback) (NULL, _("Fonts"), 0.282);
|
||||
register_fonts_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Gimprc procedures"), 0.289);
|
||||
(* status_callback) (NULL, _("Gimprc procedures"), 0.288);
|
||||
register_gimprc_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Gradient UI"), 0.306);
|
||||
(* status_callback) (NULL, _("Gradient UI"), 0.305);
|
||||
register_gradient_select_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Gradients"), 0.315);
|
||||
(* status_callback) (NULL, _("Gradients"), 0.314);
|
||||
register_gradients_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Guide procedures"), 0.335);
|
||||
(* status_callback) (NULL, _("Guide procedures"), 0.334);
|
||||
register_guides_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Help procedures"), 0.353);
|
||||
(* status_callback) (NULL, _("Help procedures"), 0.352);
|
||||
register_help_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Image"), 0.355);
|
||||
(* status_callback) (NULL, _("Image"), 0.354);
|
||||
register_image_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Layer"), 0.526);
|
||||
(* status_callback) (NULL, _("Layer"), 0.527);
|
||||
register_layer_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Message procedures"), 0.601);
|
||||
(* status_callback) (NULL, _("Message procedures"), 0.602);
|
||||
register_message_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Miscellaneous"), 0.61);
|
||||
(* status_callback) (NULL, _("Miscellaneous"), 0.611);
|
||||
register_misc_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Misc Tool procedures"), 0.616);
|
||||
(* status_callback) (NULL, _("Misc Tool procedures"), 0.617);
|
||||
register_misc_tools_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Paint Tool procedures"), 0.624);
|
||||
(* status_callback) (NULL, _("Paint Tool procedures"), 0.625);
|
||||
register_paint_tools_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Palette"), 0.668);
|
||||
(* status_callback) (NULL, _("Palette"), 0.669);
|
||||
register_palette_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Palette UI"), 0.685);
|
||||
(* status_callback) (NULL, _("Palette UI"), 0.686);
|
||||
register_palette_select_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Palettes"), 0.694);
|
||||
(* status_callback) (NULL, _("Palettes"), 0.695);
|
||||
register_palettes_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Parasite procedures"), 0.708);
|
||||
(* status_callback) (NULL, _("Parasite procedures"), 0.709);
|
||||
register_parasite_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Paths"), 0.743);
|
||||
(* status_callback) (NULL, _("Paths"), 0.744);
|
||||
register_paths_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Pattern UI"), 0.786);
|
||||
(* status_callback) (NULL, _("Pattern UI"), 0.787);
|
||||
register_pattern_select_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Patterns"), 0.795);
|
||||
register_patterns_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Plug-in"), 0.809);
|
||||
(* status_callback) (NULL, _("Plug-in"), 0.81);
|
||||
register_plug_in_procs (gimp);
|
||||
|
||||
(* status_callback) (NULL, _("Procedural database"), 0.827);
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2003-12-09 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* libgimp/libgimp-sections.txt
|
||||
* libgimp/tmpl/gimpenums.sgml
|
||||
* libgimp/tmpl/gimpimage.sgml: added gimp_image_rotate().
|
||||
|
||||
2003-12-08 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* libgimp/libgimp-sections.txt
|
||||
|
|
|
@ -79,6 +79,7 @@ GimpMergeType
|
|||
GimpOrientationType
|
||||
GimpPaintApplicationMode
|
||||
GimpRepeatMode
|
||||
GimpRotationType
|
||||
GimpRunMode
|
||||
GimpSizeType
|
||||
GimpTransferMode
|
||||
|
@ -316,6 +317,7 @@ gimp_image_width
|
|||
gimp_image_height
|
||||
gimp_image_free_shadow
|
||||
gimp_image_flip
|
||||
gimp_image_rotate
|
||||
gimp_image_resize
|
||||
gimp_image_scale
|
||||
gimp_image_crop
|
||||
|
|
|
@ -284,6 +284,15 @@ Enums and definitions.
|
|||
@GIMP_REPEAT_SAWTOOTH:
|
||||
@GIMP_REPEAT_TRIANGULAR:
|
||||
|
||||
<!-- ##### ENUM GimpRotationType ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GIMP_ROTATE_90:
|
||||
@GIMP_ROTATE_180:
|
||||
@GIMP_ROTATE_270:
|
||||
|
||||
<!-- ##### ENUM GimpRunMode ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -100,6 +100,16 @@ and operations involving multiple layers.
|
|||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_image_rotate ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@image_ID:
|
||||
@rotate_type:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gimp_image_resize ##### -->
|
||||
<para>
|
||||
|
||||
|
|
|
@ -243,6 +243,13 @@ typedef enum
|
|||
GIMP_REPEAT_TRIANGULAR
|
||||
} GimpRepeatMode;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_ROTATE_90,
|
||||
GIMP_ROTATE_180,
|
||||
GIMP_ROTATE_270
|
||||
} GimpRotationType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GIMP_RUN_INTERACTIVE,
|
||||
|
|
|
@ -437,7 +437,7 @@ gimp_image_crop (gint32 image_ID,
|
|||
*
|
||||
* Flips the image horizontally or vertically.
|
||||
*
|
||||
* This procedure flips (mirrors) the images.
|
||||
* This procedure flips (mirrors) the image.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*/
|
||||
|
@ -462,6 +462,38 @@ gimp_image_flip (gint32 image_ID,
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_rotate:
|
||||
* @image_ID: The image.
|
||||
* @rotate_type: Angle of rotation.
|
||||
*
|
||||
* Rotates the image by the spacified degrees.
|
||||
*
|
||||
* This procedure rotates the image.
|
||||
*
|
||||
* Returns: TRUE on success.
|
||||
*/
|
||||
gboolean
|
||||
gimp_image_rotate (gint32 image_ID,
|
||||
GimpRotationType rotate_type)
|
||||
{
|
||||
GimpParam *return_vals;
|
||||
gint nreturn_vals;
|
||||
gboolean success = TRUE;
|
||||
|
||||
return_vals = gimp_run_procedure ("gimp_image_rotate",
|
||||
&nreturn_vals,
|
||||
GIMP_PDB_IMAGE, image_ID,
|
||||
GIMP_PDB_INT32, rotate_type,
|
||||
GIMP_PDB_END);
|
||||
|
||||
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
||||
|
||||
gimp_destroy_params (return_vals, nreturn_vals);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_image_get_layers:
|
||||
* @image_ID: The image.
|
||||
|
|
|
@ -54,6 +54,8 @@ gboolean gimp_image_crop (gint32 ima
|
|||
gint offy);
|
||||
gboolean gimp_image_flip (gint32 image_ID,
|
||||
GimpOrientationType flip_type);
|
||||
gboolean gimp_image_rotate (gint32 image_ID,
|
||||
GimpRotationType rotate_type);
|
||||
gint* gimp_image_get_layers (gint32 image_ID,
|
||||
gint *num_layers);
|
||||
gint* gimp_image_get_channels (gint32 image_ID,
|
||||
|
|
|
@ -245,6 +245,11 @@ REPEAT_NONE = 0
|
|||
REPEAT_SAWTOOTH = 1
|
||||
REPEAT_TRIANGULAR = 2
|
||||
|
||||
# GimpRotationType
|
||||
ROTATE_90 = 0
|
||||
ROTATE_180 = 1
|
||||
ROTATE_270 = 2
|
||||
|
||||
# GimpRunMode
|
||||
RUN_INTERACTIVE = 0
|
||||
RUN_NONINTERACTIVE = 1
|
||||
|
|
|
@ -206,6 +206,10 @@ init_generated_constants (void)
|
|||
setvar (cintern ("REPEAT-SAWTOOTH"), flocons (1), NIL);
|
||||
setvar (cintern ("REPEAT-TRIANGULAR"), flocons (2), NIL);
|
||||
|
||||
setvar (cintern ("ROTATE-90"), flocons (0), NIL);
|
||||
setvar (cintern ("ROTATE-180"), flocons (1), NIL);
|
||||
setvar (cintern ("ROTATE-270"), flocons (2), NIL);
|
||||
|
||||
setvar (cintern ("RUN-INTERACTIVE"), flocons (0), NIL);
|
||||
setvar (cintern ("RUN-NONINTERACTIVE"), flocons (1), NIL);
|
||||
setvar (cintern ("RUN-WITH-LAST-VALS"), flocons (2), NIL);
|
||||
|
|
|
@ -317,6 +317,14 @@ package Gimp::CodeGen::enums;
|
|||
GIMP_ORIENTATION_VERTICAL => '1',
|
||||
GIMP_ORIENTATION_UNKNOWN => '2' }
|
||||
},
|
||||
GimpRotationType =>
|
||||
{ contig => 1,
|
||||
header => 'core/core-enums.h',
|
||||
symbols => [ qw(GIMP_ROTATE_90 GIMP_ROTATE_180 GIMP_ROTATE_270) ],
|
||||
mapping => { GIMP_ROTATE_90 => '0',
|
||||
GIMP_ROTATE_180 => '1',
|
||||
GIMP_ROTATE_270 => '2' }
|
||||
},
|
||||
GimpRepeatMode =>
|
||||
{ contig => 1,
|
||||
header => 'core/core-enums.h',
|
||||
|
|
|
@ -432,7 +432,7 @@ sub image_flip {
|
|||
$blurb = 'Flips the image horizontally or vertically.';
|
||||
|
||||
$help = <<'HELP';
|
||||
This procedure flips (mirrors) the images.
|
||||
This procedure flips (mirrors) the image.
|
||||
HELP
|
||||
|
||||
&std_pdb_misc;
|
||||
|
@ -453,6 +453,28 @@ CODE
|
|||
);
|
||||
}
|
||||
|
||||
sub image_rotate {
|
||||
$blurb = 'Rotates the image by the spacified degrees.';
|
||||
$help = 'This procedure rotates the image.';
|
||||
$author = $copyright = 'Michael Natterer';
|
||||
$date = '2003';
|
||||
|
||||
@inargs = (
|
||||
&std_image_arg,
|
||||
{ name => 'rotate_type', type => 'enum GimpRotationType',
|
||||
desc => 'Angle of rotation: %%desc%%' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
headers => [ qw("core/gimpimage-rotate.h") ],
|
||||
code => <<'CODE'
|
||||
{
|
||||
gimp_image_rotate (gimage, rotate_type, NULL, NULL);
|
||||
}
|
||||
CODE
|
||||
);
|
||||
}
|
||||
|
||||
sub image_free_shadow {
|
||||
$blurb = "Free the specified image's shadow data (if it exists).";
|
||||
|
||||
|
@ -1442,7 +1464,7 @@ unshift @procs, qw(image_list image_new image_duplicate image_delete
|
|||
image_base_type
|
||||
image_width image_height
|
||||
image_free_shadow
|
||||
image_resize image_scale image_crop image_flip
|
||||
image_resize image_scale image_crop image_flip image_rotate
|
||||
image_get_layers image_get_channels
|
||||
image_get_active_drawable
|
||||
image_unset_active_channel
|
||||
|
@ -1458,7 +1480,7 @@ unshift @procs, qw(image_list image_new image_duplicate image_delete
|
|||
image_get_cmap image_set_cmap
|
||||
image_clean_all image_is_dirty
|
||||
image_thumbnail);
|
||||
%exports = (app => [@procs], lib => [@procs[0..31,34..58]]);
|
||||
%exports = (app => [@procs], lib => [@procs[0..32,35..59]]);
|
||||
|
||||
$desc = 'Image';
|
||||
|
||||
|
|
Loading…
Reference in New Issue