From 6be23f70fa7c25e4092ee43adc537600be449434 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Thu, 1 Jun 2000 12:20:13 +0000 Subject: [PATCH] Sven Neumann 2000-06-01 Michael Natterer Sven Neumann Completed the new file structure. Yet only few of the _pdb.[ch] files are based upon generated code and nothing is really autogenerated... * app/Makefile.am * app/gdisplay_cmds.c -> app/display_cmds.c * app/gimage_cmds.c -> app/image_cmds.c * app/gimage_mask_cmds.c -> app/selection_cmds.c * app/internal_procs.c: related change * libgimp/Makefile.am * libgimp/gimp.h * libgimp/gimp_pdb.h * libgimp/gimpdisplay_pdb.[ch] * libgimp/gimpimage_pdb.[ch] * libgimp/gimpselection_pdb.[ch]: replaced with code based on files generated using pdbgen * libgimp/gimpchannelops_pdb.[ch] * libgimp/gimpcolor_pdb.[ch] * libgimp/gimpedit_pdb.[ch] * libgimp/gimpfloatingsel_pdb.[ch] * libgimp/gimpgimprc_pdb.[ch] * libgimp/gimptexttool_pdb.[ch] * libgimp/gimptools_pdb.[ch] * libgimp/gimpundo_pdb.[ch]: new files based on generated code * libgimp/gimpgradientselect.[ch] * libgimp/gimpimage.[ch] * libgimp/gimpselection.[ch]: new files wrapping around the autogenerated PDB wrappers as found in *_pdb.[ch]. This is necessary since the number of parameters or their order is different from the PDP calls. * plug-ins/common/CEL.c: plugged memleak * plug-ins/common/aa.c: removed compiler warning * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl * tools/pdbgen/pdb/gdisplay.pdb -> display.pdb * tools/pdbgen/pdb/gimage.pdb -> image.pdb * tools/pdbgen/pdb/gimage_mask.pdb -> selection.pdb * tools/pdbgen/pdb/channel_ops.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/floating_sel.pdb * tools/pdbgen/pdb/gimprc.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/tools.pdb * tools/pdbgen/pdb/undo.pdb: made them create libgimp code --- ChangeLog | 56 + app/Makefile.am | 6 +- app/{gdisplay_cmds.c => display_cmds.c} | 2 +- app/{gimage_cmds.c => image_cmds.c} | 2 +- app/internal_procs.c | 62 +- app/{gimage_mask_cmds.c => selection_cmds.c} | 2 +- libgimp/Makefile.am | 143 +- libgimp/gimp.c | 2 + libgimp/gimp.h | 6 + libgimp/gimp_pdb.h | 9 + libgimp/gimpchannelops_pdb.c | 66 + libgimp/gimpchannelops_pdb.h | 46 + libgimp/gimpcolor_pdb.c | 269 ++++ libgimp/gimpcolor_pdb.h | 88 ++ libgimp/gimpcompat.h | 3 +- libgimp/gimpdisplay_pdb.c | 26 +- libgimp/gimpdisplay_pdb.h | 20 +- libgimp/gimpedit_pdb.c | 118 ++ libgimp/gimpedit_pdb.h | 48 + libgimp/gimpfloatingsel_pdb.c | 114 ++ libgimp/gimpfloatingsel_pdb.h | 49 + libgimp/gimpgimprc_pdb.c | 81 + libgimp/gimpgimprc_pdb.h | 45 + libgimp/gimpgradientselect.c | 31 + libgimp/gimpgradientselect.h | 42 + libgimp/gimpgradientselect_pdb.c | 8 +- libgimp/gimpgradientselect_pdb.h | 22 +- libgimp/gimpimage.c | 71 + libgimp/gimpimage.h | 48 + libgimp/gimpimage_pdb.c | 1291 +++++++++------- libgimp/gimpimage_pdb.h | 229 +-- libgimp/gimpselection.c | 34 + libgimp/gimpselection.h | 43 + libgimp/gimpselection_pdb.c | 106 +- libgimp/gimpselection_pdb.h | 35 +- libgimp/gimptexttool_pdb.c | 194 +++ libgimp/gimptexttool_pdb.h | 90 ++ libgimp/gimptools_pdb.c | 778 ++++++++++ libgimp/gimptools_pdb.h | 216 +++ libgimp/gimpundo_pdb.c | 52 + libgimp/gimpundo_pdb.h | 42 + plug-ins/common/CEL.c | 2 +- plug-ins/common/aa.c | 2 - po/ChangeLog | 4 + po/POTFILES.in | 2 +- tools/pdbgen/Makefile.am | 6 +- tools/pdbgen/groups.pl | 6 +- tools/pdbgen/pdb/channel_ops.pdb | 2 +- tools/pdbgen/pdb/color.pdb | 2 +- tools/pdbgen/pdb/edit.pdb | 2 +- tools/pdbgen/pdb/floating_sel.pdb | 2 +- tools/pdbgen/pdb/gdisplay.pdb | 94 -- tools/pdbgen/pdb/gimage.pdb | 1461 ------------------ tools/pdbgen/pdb/gimage_mask.pdb | 371 ----- tools/pdbgen/pdb/gimprc.pdb | 2 +- tools/pdbgen/pdb/image.pdb | 3 +- tools/pdbgen/pdb/misc_tools.pdb | 2 +- tools/pdbgen/pdb/paint_tools.pdb | 2 +- tools/pdbgen/pdb/text_tool.pdb | 2 +- tools/pdbgen/pdb/tools.pdb | 2 +- tools/pdbgen/pdb/transform_tools.pdb | 2 +- tools/pdbgen/pdb/undo.pdb | 2 +- 62 files changed, 3730 insertions(+), 2838 deletions(-) rename app/{gdisplay_cmds.c => display_cmds.c} (99%) rename app/{gimage_cmds.c => image_cmds.c} (99%) rename app/{gimage_mask_cmds.c => selection_cmds.c} (99%) create mode 100644 libgimp/gimpchannelops_pdb.c create mode 100644 libgimp/gimpchannelops_pdb.h create mode 100644 libgimp/gimpcolor_pdb.c create mode 100644 libgimp/gimpcolor_pdb.h create mode 100644 libgimp/gimpedit_pdb.c create mode 100644 libgimp/gimpedit_pdb.h create mode 100644 libgimp/gimpfloatingsel_pdb.c create mode 100644 libgimp/gimpfloatingsel_pdb.h create mode 100644 libgimp/gimpgimprc_pdb.c create mode 100644 libgimp/gimpgimprc_pdb.h create mode 100644 libgimp/gimpgradientselect.c create mode 100644 libgimp/gimpgradientselect.h create mode 100644 libgimp/gimpimage.c create mode 100644 libgimp/gimpimage.h create mode 100644 libgimp/gimpselection.c create mode 100644 libgimp/gimpselection.h create mode 100644 libgimp/gimptexttool_pdb.c create mode 100644 libgimp/gimptexttool_pdb.h create mode 100644 libgimp/gimptools_pdb.c create mode 100644 libgimp/gimptools_pdb.h create mode 100644 libgimp/gimpundo_pdb.c create mode 100644 libgimp/gimpundo_pdb.h delete mode 100644 tools/pdbgen/pdb/gdisplay.pdb delete mode 100644 tools/pdbgen/pdb/gimage.pdb delete mode 100644 tools/pdbgen/pdb/gimage_mask.pdb diff --git a/ChangeLog b/ChangeLog index 9a2a529ddc..1dad89eeeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,59 @@ +2000-06-01 Michael Natterer + Sven Neumann + + Completed the new file structure. Yet only few of the _pdb.[ch] + files are based upon generated code and nothing is really + autogenerated... + + * app/Makefile.am + * app/gdisplay_cmds.c -> app/display_cmds.c + * app/gimage_cmds.c -> app/image_cmds.c + * app/gimage_mask_cmds.c -> app/selection_cmds.c + * app/internal_procs.c: related change + + * libgimp/Makefile.am + * libgimp/gimp.h + * libgimp/gimp_pdb.h + * libgimp/gimpdisplay_pdb.[ch] + * libgimp/gimpimage_pdb.[ch] + * libgimp/gimpselection_pdb.[ch]: replaced with code based on files + generated using pdbgen + + * libgimp/gimpchannelops_pdb.[ch] + * libgimp/gimpcolor_pdb.[ch] + * libgimp/gimpedit_pdb.[ch] + * libgimp/gimpfloatingsel_pdb.[ch] + * libgimp/gimpgimprc_pdb.[ch] + * libgimp/gimptexttool_pdb.[ch] + * libgimp/gimptools_pdb.[ch] + * libgimp/gimpundo_pdb.[ch]: new files based on generated code + + * libgimp/gimpgradientselect.[ch] + * libgimp/gimpimage.[ch] + * libgimp/gimpselection.[ch]: new files wrapping around the + autogenerated PDB wrappers as found in *_pdb.[ch]. This is necessary + since the number of parameters or their order is different from the + PDP calls. + + * plug-ins/common/CEL.c: plugged memleak + + * plug-ins/common/aa.c: removed compiler warning + + * tools/pdbgen/Makefile.am + * tools/pdbgen/groups.pl + * tools/pdbgen/pdb/gdisplay.pdb -> display.pdb + * tools/pdbgen/pdb/gimage.pdb -> image.pdb + * tools/pdbgen/pdb/gimage_mask.pdb -> selection.pdb + + * tools/pdbgen/pdb/channel_ops.pdb + * tools/pdbgen/pdb/color.pdb + * tools/pdbgen/pdb/edit.pdb + * tools/pdbgen/pdb/floating_sel.pdb + * tools/pdbgen/pdb/gimprc.pdb + * tools/pdbgen/pdb/text_tool.pdb + * tools/pdbgen/pdb/tools.pdb + * tools/pdbgen/pdb/undo.pdb: made them create libgimp code + 2000-05-31 Michael Natterer Sven Neumann diff --git a/app/Makefile.am b/app/Makefile.am index 350faceb84..80c0c6337a 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -121,6 +121,7 @@ gimp_SOURCES = \ dialog_handler.h \ disp_callbacks.c \ disp_callbacks.h \ + display_cmds.c \ docindex.c \ docindex.h \ dodgeburn.c \ @@ -168,17 +169,14 @@ gimp_SOURCES = \ gdisplay_color.h \ gdisplay_color_ui.c \ gdisplay_color_ui.h \ - gdisplay_cmds.c \ gdisplay_ops.c \ gdisplay_ops.h \ general.c \ general.h \ gimage.c \ gimage.h \ - gimage_cmds.c \ gimage_mask.c \ gimage_mask.h \ - gimage_mask_cmds.c \ gimpbrush.c \ gimpbrush.h \ gimpbrushgenerated.c \ @@ -246,6 +244,7 @@ gimp_SOURCES = \ histogram_tool.h \ hue_saturation.c \ hue_saturation.h \ + image_cmds.c \ image_map.c \ image_map.h \ image_new.c \ @@ -380,6 +379,7 @@ gimp_SOURCES = \ scroll.h \ selection.c \ selection.h \ + selection_cmds.c \ selection_options.h \ session.h \ session.c \ diff --git a/app/gdisplay_cmds.c b/app/display_cmds.c similarity index 99% rename from app/gdisplay_cmds.c rename to app/display_cmds.c index 217dd695ac..d8a9784a6f 100644 --- a/app/gdisplay_cmds.c +++ b/app/display_cmds.c @@ -27,7 +27,7 @@ static ProcRecord display_delete_proc; static ProcRecord displays_flush_proc; void -register_gdisplay_procs (void) +register_display_procs (void) { procedural_db_register (&display_new_proc); procedural_db_register (&display_delete_proc); diff --git a/app/gimage_cmds.c b/app/image_cmds.c similarity index 99% rename from app/gimage_cmds.c rename to app/image_cmds.c index 77fe2b2fec..27f80410a8 100644 --- a/app/gimage_cmds.c +++ b/app/image_cmds.c @@ -99,7 +99,7 @@ static ProcRecord image_get_layer_by_tattoo_proc; static ProcRecord image_get_channel_by_tattoo_proc; void -register_gimage_procs (void) +register_image_procs (void) { procedural_db_register (&image_list_proc); procedural_db_register (&image_new_proc); diff --git a/app/internal_procs.c b/app/internal_procs.c index f872336b20..7fae547f5e 100644 --- a/app/internal_procs.c +++ b/app/internal_procs.c @@ -33,18 +33,17 @@ void register_channel_procs (void); void register_channel_ops_procs (void); void register_color_procs (void); void register_convert_procs (void); +void register_display_procs (void); void register_drawable_procs (void); void register_edit_procs (void); void register_fileops_procs (void); void register_floating_sel_procs (void); -void register_gdisplay_procs (void); -void register_gimage_procs (void); -void register_gimage_mask_procs (void); void register_gimprc_procs (void); void register_gradient_procs (void); void register_gradient_select_procs (void); void register_guides_procs (void); void register_help_procs (void); +void register_image_procs (void); void register_layer_procs (void); void register_message_procs (void); void register_misc_procs (void); @@ -55,6 +54,7 @@ void register_pattern_select_procs (void); void register_patterns_procs (void); void register_plug_in_procs (void); void register_procedural_db_procs (void); +void register_selection_procs (void); void register_text_tool_procs (void); void register_tools_procs (void); void register_undo_procs (void); @@ -83,72 +83,72 @@ internal_procs_init (void) app_init_update_status (NULL, _("Convert"), 0.134); register_convert_procs (); - app_init_update_status (NULL, _("Drawable procedures"), 0.143); + app_init_update_status (NULL, _("GDisplay procedures"), 0.143); + register_display_procs (); + + app_init_update_status (NULL, _("Drawable procedures"), 0.152); register_drawable_procs (); - app_init_update_status (NULL, _("Edit procedures"), 0.211); + app_init_update_status (NULL, _("Edit procedures"), 0.22); register_edit_procs (); - app_init_update_status (NULL, _("File Operations"), 0.23); + app_init_update_status (NULL, _("File Operations"), 0.239); register_fileops_procs (); - app_init_update_status (NULL, _("Floating selections"), 0.255); + app_init_update_status (NULL, _("Floating selections"), 0.264); register_floating_sel_procs (); - app_init_update_status (NULL, _("GDisplay procedures"), 0.273); - register_gdisplay_procs (); - - app_init_update_status (NULL, _("Image"), 0.283); - register_gimage_procs (); - - app_init_update_status (NULL, _("Image mask"), 0.466); - register_gimage_mask_procs (); - - app_init_update_status (NULL, _("Gimprc procedures"), 0.519); + app_init_update_status (NULL, _("Gimprc procedures"), 0.283); register_gimprc_procs (); - app_init_update_status (NULL, _("Gradients"), 0.528); + app_init_update_status (NULL, _("Gradients"), 0.292); register_gradient_procs (); - app_init_update_status (NULL, _("Gradient UI"), 0.543); + app_init_update_status (NULL, _("Gradient UI"), 0.307); register_gradient_select_procs (); - app_init_update_status (NULL, _("Guide procedures"), 0.556); + app_init_update_status (NULL, _("Guide procedures"), 0.32); register_guides_procs (); - app_init_update_status (NULL, _("Help procedures"), 0.575); + app_init_update_status (NULL, _("Help procedures"), 0.339); register_help_procs (); - app_init_update_status (NULL, _("Layer"), 0.578); + app_init_update_status (NULL, _("Image"), 0.342); + register_image_procs (); + + app_init_update_status (NULL, _("Layer"), 0.525); register_layer_procs (); - app_init_update_status (NULL, _("Interface"), 0.674); + app_init_update_status (NULL, _("Interface"), 0.621); register_message_procs (); - app_init_update_status (NULL, _("Miscellaneous"), 0.683); + app_init_update_status (NULL, _("Miscellaneous"), 0.63); register_misc_procs (); - app_init_update_status (NULL, _("Palette"), 0.689); + app_init_update_status (NULL, _("Palette"), 0.637); register_palette_procs (); - app_init_update_status (NULL, _("Parasite procedures"), 0.711); + app_init_update_status (NULL, _("Parasite procedures"), 0.658); register_parasite_procs (); - app_init_update_status (NULL, _("Paths"), 0.748); + app_init_update_status (NULL, _("Paths"), 0.696); register_paths_procs (); - app_init_update_status (NULL, _("Pattern UI"), 0.789); + app_init_update_status (NULL, _("Pattern UI"), 0.736); register_pattern_select_procs (); - app_init_update_status (NULL, _("Patterns"), 0.798); + app_init_update_status (NULL, _("Patterns"), 0.745); register_patterns_procs (); - app_init_update_status (NULL, _("Plug-in"), 0.811); + app_init_update_status (NULL, _("Plug-in"), 0.758); register_plug_in_procs (); - app_init_update_status (NULL, _("Procedural database"), 0.829); + app_init_update_status (NULL, _("Procedural database"), 0.776); register_procedural_db_procs (); + app_init_update_status (NULL, _("Image mask"), 0.801); + register_selection_procs (); + app_init_update_status (NULL, _("Text procedures"), 0.854); register_text_tool_procs (); diff --git a/app/gimage_mask_cmds.c b/app/selection_cmds.c similarity index 99% rename from app/gimage_mask_cmds.c rename to app/selection_cmds.c index 01b7d29485..420fbae616 100644 --- a/app/gimage_mask_cmds.c +++ b/app/selection_cmds.c @@ -44,7 +44,7 @@ static ProcRecord selection_load_proc; static ProcRecord selection_save_proc; void -register_gimage_mask_procs (void) +register_selection_procs (void) { procedural_db_register (&selection_bounds_proc); procedural_db_register (&selection_value_proc); diff --git a/libgimp/Makefile.am b/libgimp/Makefile.am index ce965a7770..5f61093a68 100644 --- a/libgimp/Makefile.am +++ b/libgimp/Makefile.am @@ -24,6 +24,71 @@ EXTRA_DIST = \ lib_LTLIBRARIES = libgimp.la libgimpui.la noinst_LIBRARIES = libgimpi.a +PDB_WRAPPERS_C = \ + gimpbrushes_pdb.c \ + gimpbrushselect_pdb.c \ + gimpchannel_pdb.c \ + gimpchannelops_pdb.c \ + gimpcolor_pdb.c \ + gimpconvert_pdb.c \ + gimpdisplay_pdb.c \ + gimpdrawable_pdb.c \ + gimpedit_pdb.c \ + gimpfileops_pdb.c \ + gimpfloatingsel_pdb.c \ + gimpgimprc_pdb.c \ + gimpgradient_pdb.c \ + gimpgradientselect_pdb.c \ + gimpguides_pdb.c \ + gimphelp_pdb.c \ + gimpimage_pdb.c \ + gimplayer_pdb.c \ + gimpmessage_pdb.c \ + gimppalette_pdb.c \ + gimpparasite_pdb.c \ + gimppatterns_pdb.c \ + gimppatternselect_pdb.c \ + gimpplugin_pdb.c \ + gimpproceduraldb_pdb.c \ + gimpselection_pdb.c \ + gimptexttool_pdb.c \ + gimptools_pdb.c \ + gimpundo_pdb.c \ + gimpunit_pdb.c + +PDB_WRAPPERS_H = \ + gimp_pdb.h \ + gimpbrushes_pdb.h \ + gimpbrushselect_pdb.h \ + gimpchannel_pdb.h \ + gimpchannelops_pdb.h \ + gimpcolor_pdb.h \ + gimpconvert_pdb.h \ + gimpdisplay_pdb.h \ + gimpdrawable_pdb.h \ + gimpedit_pdb.h \ + gimpfileops_pdb.h \ + gimpfloatingsel_pdb.h \ + gimpgimprc_pdb.h \ + gimpgradient_pdb.h \ + gimpgradientselect_pdb.h \ + gimpguides_pdb.h \ + gimphelp_pdb.h \ + gimpimage_pdb.h \ + gimplayer_pdb.h \ + gimpmessage_pdb.h \ + gimppalette_pdb.h \ + gimpparasite_pdb.h \ + gimppatterns_pdb.h \ + gimppatternselect_pdb.h \ + gimpplugin_pdb.h \ + gimpproceduraldb_pdb.h \ + gimpselection_pdb.h \ + gimptexttool_pdb.h \ + gimptools_pdb.h \ + gimpundo_pdb.h \ + gimpunit_pdb.h + libgimpi_a_SOURCES = \ gimpenv.c \ gimpenv.h \ @@ -80,71 +145,35 @@ endif libgimp_la_SOURCES = \ gimp.c \ gimp.h \ - gimp_pdb.h \ - gimpbrushes_pdb.c \ - gimpbrushes_pdb.h \ - gimpbrushselect_pdb.c \ - gimpbrushselect_pdb.h \ - gimpchannel_pdb.c \ - gimpchannel_pdb.h \ + ${PDB_WRAPPERS_C} \ + ${PDB_WRAPPERS_H} \ gimpcolorspace.c \ gimpcolorspace.h \ - gimpconvert_pdb.c \ - gimpconvert_pdb.h \ - gimpdisplay_pdb.c \ - gimpdisplay_pdb.h \ gimpdrawable.c \ gimpdrawable.h \ - gimpdrawable_pdb.c \ - gimpdrawable_pdb.h \ gimpenv.c \ gimpenv.h \ - gimpfileops_pdb.c \ - gimpfileops_pdb.h \ - gimpgradient_pdb.c \ - gimpgradient_pdb.h \ - gimpgradientselect_pdb.c \ - gimpgradientselect_pdb.h \ - gimpguides_pdb.c \ - gimpguides_pdb.h \ + gimpgradientselect.c \ + gimpgradientselect.h \ gimphelp.c \ - gimphelp_pdb.c \ - gimphelp_pdb.h \ - gimpimage_pdb.c \ - gimpimage_pdb.h \ - gimplayer_pdb.c \ - gimplayer_pdb.h \ + gimpimage.c \ + gimpimage.h \ gimpmatrix.c \ gimpmatrix.h \ - gimpmessage_pdb.c \ - gimpmessage_pdb.h \ - gimppalette_pdb.c \ gimpparasite.c \ gimpparasite.h \ gimpparasiteio.c \ gimpparasiteio.h \ - gimpparasite_pdb.c \ - gimpparasite_pdb.h \ - gimppatterns_pdb.c \ - gimppatterns_pdb.h \ - gimppatternselect_pdb.c \ - gimppatternselect_pdb.h \ gimppixelrgn.c \ gimppixelrgn.h \ - gimpplugin_pdb.c \ - gimpplugin_pdb.h \ - gimpproceduraldb_pdb.c \ - gimpproceduraldb_pdb.h \ gimpprotocol.c \ gimpprotocol.h \ - gimpselection_pdb.c \ - gimpselection_pdb.h \ + gimpselection.c \ + gimpselection.h \ gimpsignal.c \ gimpsignal.h \ gimptile.c \ gimptile.h \ - gimpunit_pdb.c \ - gimpunit_pdb.h \ gimpunit.c \ gimpunit.h \ gimputils.c \ @@ -178,26 +207,7 @@ libgimpui_la_SOURCES = \ gimpinclude_HEADERS = \ gimp.h \ - gimp_pdb.h \ - gimpbrushes_pdb.h \ - gimpbrushselect_pdb.h \ - gimpchannel_pdb.h \ - gimpconvert_pdb.h \ - gimpdisplay_pdb.h \ - gimpdrawable_pdb.h \ - gimpfileops_pdb.h \ - gimpgradient_pdb.h \ - gimpgradientselect_pdb.h \ - gimpguides_pdb.h \ - gimphelp_pdb.h \ - gimpimage_pdb.h \ - gimplayer_pdb.h \ - gimpmessage_pdb.h \ - gimppalette_pdb.h \ - gimpparasite_pdb.h \ - gimpplugin_pdb.h \ - gimpproceduraldb_pdb.h \ - gimpselection_pdb.h \ + ${PDB_WRAPPERS_H} \ gimpchainbutton.h \ gimpcolorbutton.h \ gimpcolordisplay.h \ @@ -211,7 +221,9 @@ gimpinclude_HEADERS = \ gimpexport.h \ gimpfeatures.h \ gimpfileselection.h \ + gimpgradientselect.h \ gimphelpui.h \ + gimpimage.h \ gimplimits.h \ gimpmath.h \ gimpmatrix.h \ @@ -220,11 +232,10 @@ gimpinclude_HEADERS = \ gimpparasite.h \ gimpparasiteio.h \ gimppatheditor.h \ - gimppatterns_pdb.h \ - gimppatternselect_pdb.h \ gimppixelrgn.h \ gimppixmap.h \ gimpquerybox.h \ + gimpselection.h \ gimpsignal.h \ gimpsizeentry.h \ gimptile.h \ diff --git a/libgimp/gimp.c b/libgimp/gimp.c index 3e1f4e7ecc..0500b4236f 100644 --- a/libgimp/gimp.c +++ b/libgimp/gimp.c @@ -1,6 +1,8 @@ /* LIBGIMP - The GIMP Library * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball * + * gimp.c + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either diff --git a/libgimp/gimp.h b/libgimp/gimp.h index 453978ad16..5e2b3f8890 100644 --- a/libgimp/gimp.h +++ b/libgimp/gimp.h @@ -30,11 +30,14 @@ #include #include #include +#include #include +#include #include #include #include #include +#include #include #include #include @@ -71,6 +74,8 @@ extern "C" { #define gimp_image_convert_grayscale gimp_convert_grayscale #define gimp_image_convert_indexed gimp_convert_indexed +#define gimp_image_duplicate gimp_channel_ops_duplicate +#define gimp_drawable_offset gimp_channel_ops_offset GIMPVAR guint gimp_major_version; GIMPVAR guint gimp_minor_version; @@ -153,6 +158,7 @@ union _GimpParamData gint32 d_selection; gint32 d_boundary; gint32 d_path; + gint32 d_unit; GimpParasite d_parasite; gint32 d_tattoo; gint32 d_status; diff --git a/libgimp/gimp_pdb.h b/libgimp/gimp_pdb.h index 6e201c7a66..6108e13ea2 100644 --- a/libgimp/gimp_pdb.h +++ b/libgimp/gimp_pdb.h @@ -25,10 +25,15 @@ #include #include #include +#include +#include #include #include #include +#include #include +#include +#include #include #include #include @@ -43,5 +48,9 @@ #include #include #include +#include +#include +#include + #endif /* __GIMP_PDB_H__ */ diff --git a/libgimp/gimpchannelops_pdb.c b/libgimp/gimpchannelops_pdb.c new file mode 100644 index 0000000000..5a4af6ef1d --- /dev/null +++ b/libgimp/gimpchannelops_pdb.c @@ -0,0 +1,66 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpchannelops_pdb.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#include "gimp.h" + +void +gimp_channel_ops_offset (gint32 drawable_ID, + gboolean wrap_around, + GimpChannelOffsetType fill_type, + gint offset_x, + gint offset_y) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_channel_ops_offset", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, wrap_around, + PARAM_INT32, fill_type, + PARAM_INT32, offset_x, + PARAM_INT32, offset_y, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +gint32 +gimp_channel_ops_duplicate (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 new_image_ID = -1; + + return_vals = gimp_run_procedure ("gimp_channel_ops_duplicate", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + new_image_ID = return_vals[1].data.d_image; + + gimp_destroy_params (return_vals, nreturn_vals); + + return new_image_ID; +} diff --git a/libgimp/gimpchannelops_pdb.h b/libgimp/gimpchannelops_pdb.h new file mode 100644 index 0000000000..4ec6b0b540 --- /dev/null +++ b/libgimp/gimpchannelops_pdb.h @@ -0,0 +1,46 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpchannelops_pdb.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#ifndef __GIMP_CHANNEL_OPS_PDB_H__ +#define __GIMP_CHANNEL_OPS_PDB_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +void gimp_channel_ops_offset (gint32 drawable_ID, + gboolean wrap_around, + GimpChannelOffsetType fill_type, + gint offset_x, + gint offset_y); +gint32 gimp_channel_ops_duplicate (gint32 image_ID); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_CHANNEL_OPS_PDB_H__ */ diff --git a/libgimp/gimpcolor_pdb.c b/libgimp/gimpcolor_pdb.c new file mode 100644 index 0000000000..66a507b0ca --- /dev/null +++ b/libgimp/gimpcolor_pdb.c @@ -0,0 +1,269 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpcolor_pdb.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#include "gimp.h" + +void +gimp_brightness_contrast (gint32 drawable_ID, + gint brightness, + gint contrast) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_brightness_contrast", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, brightness, + PARAM_INT32, contrast, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_levels (gint32 drawable_ID, + GimpChannelLutType channel, + gint low_input, + gint high_input, + gdouble gamma, + gint low_output, + gint high_output) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_levels", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, channel, + PARAM_INT32, low_input, + PARAM_INT32, high_input, + PARAM_FLOAT, gamma, + PARAM_INT32, low_output, + PARAM_INT32, high_output, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_posterize (gint32 drawable_ID, + gint levels) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_posterize", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, levels, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_desaturate (gint32 drawable_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_desaturate", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_equalize (gint32 drawable_ID, + gboolean mask_only) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_equalize", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, mask_only, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_invert (gint32 drawable_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_invert", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_curves_spline (gint32 drawable_ID, + GimpChannelLutType channel, + gint num_points, + guint8 *control_pts) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_curves_spline", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, channel, + PARAM_INT32, num_points, + PARAM_INT8ARRAY, control_pts, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_curves_explicit (gint32 drawable_ID, + GimpChannelLutType channel, + gint num_bytes, + guint8 *curve) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_curves_explicit", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, channel, + PARAM_INT32, num_bytes, + PARAM_INT8ARRAY, curve, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_color_balance (gint32 drawable_ID, + GimpTransferMode transfer_mode, + gboolean preserve_lum, + gdouble cyan_red, + gdouble magenta_green, + gdouble yellow_blue) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_color_balance", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, transfer_mode, + PARAM_INT32, preserve_lum, + PARAM_FLOAT, cyan_red, + PARAM_FLOAT, magenta_green, + PARAM_FLOAT, yellow_blue, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_histogram (gint32 drawable_ID, + GimpChannelLutType channel, + gint start_range, + gint end_range, + gdouble *mean, + gdouble *std_dev, + gdouble *median, + gdouble *pixels, + gdouble *count, + gdouble *percentile) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_histogram", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, channel, + PARAM_INT32, start_range, + PARAM_INT32, end_range, + PARAM_END); + + *mean = *std_dev = *median = *pixels = *count = *percentile = 0; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + { + *mean = return_vals[1].data.d_float; + *std_dev = return_vals[2].data.d_float; + *median = return_vals[3].data.d_float; + *pixels = return_vals[4].data.d_float; + *count = return_vals[5].data.d_float; + *percentile = return_vals[6].data.d_float; + } + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_hue_saturation (gint32 drawable_ID, + GimpHueRange hue_range, + gdouble hue_offset, + gdouble lightness, + gdouble saturation) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_hue_saturation", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, hue_range, + PARAM_FLOAT, hue_offset, + PARAM_FLOAT, lightness, + PARAM_FLOAT, saturation, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_threshold (gint32 drawable_ID, + gint low_threshold, + gint high_threshold) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_threshold", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, low_threshold, + PARAM_INT32, high_threshold, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} diff --git a/libgimp/gimpcolor_pdb.h b/libgimp/gimpcolor_pdb.h new file mode 100644 index 0000000000..04f5c4d76e --- /dev/null +++ b/libgimp/gimpcolor_pdb.h @@ -0,0 +1,88 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpcolor_pdb.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#ifndef __GIMP_COLOR_PDB_H__ +#define __GIMP_COLOR_PDB_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +void gimp_brightness_contrast (gint32 drawable_ID, + gint brightness, + gint contrast); +void gimp_levels (gint32 drawable_ID, + GimpChannelLutType channel, + gint low_input, + gint high_input, + gdouble gamma, + gint low_output, + gint high_output); +void gimp_posterize (gint32 drawable_ID, + gint levels); +void gimp_desaturate (gint32 drawable_ID); +void gimp_equalize (gint32 drawable_ID, + gboolean mask_only); +void gimp_invert (gint32 drawable_ID); +void gimp_curves_spline (gint32 drawable_ID, + GimpChannelLutType channel, + gint num_points, + guint8 *control_pts); +void gimp_curves_explicit (gint32 drawable_ID, + GimpChannelLutType channel, + gint num_bytes, + guint8 *curve); +void gimp_color_balance (gint32 drawable_ID, + GimpTransferMode transfer_mode, + gboolean preserve_lum, + gdouble cyan_red, + gdouble magenta_green, + gdouble yellow_blue); +void gimp_histogram (gint32 drawable_ID, + GimpChannelLutType channel, + gint start_range, + gint end_range, + gdouble *mean, + gdouble *std_dev, + gdouble *median, + gdouble *pixels, + gdouble *count, + gdouble *percentile); +void gimp_hue_saturation (gint32 drawable_ID, + GimpHueRange hue_range, + gdouble hue_offset, + gdouble lightness, + gdouble saturation); +void gimp_threshold (gint32 drawable_ID, + gint low_threshold, + gint high_threshold); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_COLOR_PDB_H__ */ diff --git a/libgimp/gimpcompat.h b/libgimp/gimpcompat.h index 533fda1383..5cef3d795c 100644 --- a/libgimp/gimpcompat.h +++ b/libgimp/gimpcompat.h @@ -60,8 +60,7 @@ extern "C" { #define gimp_layer_bpp gimp_drawable_bpp #define gimp_layer_type gimp_drawable_type -#define gimp_gradient_get_gradient_data(a,b,c,d) \ - gimp_gradients_get_gradient_data (a,c,b,d) +#define gimp_gradient_get_gradient_data gimp_gradients_get_gradient_data #define gimp_plugin_help_func gimp_standard_help_func diff --git a/libgimp/gimpdisplay_pdb.c b/libgimp/gimpdisplay_pdb.c index d7ca40bafd..ab59f16a21 100644 --- a/libgimp/gimpdisplay_pdb.c +++ b/libgimp/gimpdisplay_pdb.c @@ -1,5 +1,5 @@ /* LIBGIMP - The GIMP Library - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball * * gimpdisplay_pdb.c * @@ -11,7 +11,7 @@ * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the @@ -19,22 +19,22 @@ * Boston, MA 02111-1307, USA. */ -#include "gimp.h" +/* NOTE: This file is autogenerated by pdbgen.pl */ +#include "gimp.h" gint32 gimp_display_new (gint32 image_ID) { GParam *return_vals; gint nreturn_vals; - gint32 display_ID; + gint32 display_ID = -1; return_vals = gimp_run_procedure ("gimp_display_new", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); - display_ID = -1; if (return_vals[0].data.d_status == STATUS_SUCCESS) display_ID = return_vals[1].data.d_display; @@ -50,9 +50,9 @@ gimp_display_delete (gint32 display_ID) gint nreturn_vals; return_vals = gimp_run_procedure ("gimp_display_delete", - &nreturn_vals, - PARAM_DISPLAY, display_ID, - PARAM_END); + &nreturn_vals, + PARAM_DISPLAY, display_ID, + PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); } @@ -64,8 +64,8 @@ gimp_displays_flush (void) gint nreturn_vals; return_vals = gimp_run_procedure ("gimp_displays_flush", - &nreturn_vals, - PARAM_END); + &nreturn_vals, + PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); } diff --git a/libgimp/gimpdisplay_pdb.h b/libgimp/gimpdisplay_pdb.h index 445bf86e45..3be29f9d35 100644 --- a/libgimp/gimpdisplay_pdb.h +++ b/libgimp/gimpdisplay_pdb.h @@ -1,5 +1,5 @@ -/* LIBGIMP - The GIMP Library - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball * * gimpdisplay_pdb.h * @@ -7,17 +7,19 @@ * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. - */ + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ #ifndef __GIMP_DISPLAY_PDB_H__ #define __GIMP_DISPLAY_PDB_H__ @@ -29,9 +31,9 @@ extern "C" { /* For information look into the C source or the html documentation */ -gint32 gimp_display_new (gint32 image_ID); -void gimp_display_delete (gint32 display_ID); -void gimp_displays_flush (void); +gint32 gimp_display_new (gint32 image_ID); +void gimp_display_delete (gint32 display_ID); +void gimp_displays_flush (void); #ifdef __cplusplus diff --git a/libgimp/gimpedit_pdb.c b/libgimp/gimpedit_pdb.c new file mode 100644 index 0000000000..cee8e9819f --- /dev/null +++ b/libgimp/gimpedit_pdb.c @@ -0,0 +1,118 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpedit_pdb.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#include "gimp.h" + +void +gimp_edit_cut (gint32 drawable_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_edit_cut", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_edit_copy (gint32 drawable_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_edit_copy", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +gint32 +gimp_edit_paste (gint32 drawable_ID, + gboolean paste_into) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 floating_sel_ID = -1; + + return_vals = gimp_run_procedure ("gimp_edit_paste", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, paste_into, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + floating_sel_ID = return_vals[1].data.d_layer; + + gimp_destroy_params (return_vals, nreturn_vals); + + return floating_sel_ID; +} + +void +gimp_edit_clear (gint32 drawable_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_edit_clear", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_edit_fill (gint32 drawable_ID, + GimpFillType fill_type) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_edit_fill", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, fill_type, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_edit_stroke (gint32 drawable_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_edit_stroke", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} diff --git a/libgimp/gimpedit_pdb.h b/libgimp/gimpedit_pdb.h new file mode 100644 index 0000000000..2c88e7a50f --- /dev/null +++ b/libgimp/gimpedit_pdb.h @@ -0,0 +1,48 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpedit_pdb.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#ifndef __GIMP_EDIT_PDB_H__ +#define __GIMP_EDIT_PDB_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +void gimp_edit_cut (gint32 drawable_ID); +void gimp_edit_copy (gint32 drawable_ID); +gint32 gimp_edit_paste (gint32 drawable_ID, + gboolean paste_into); +void gimp_edit_clear (gint32 drawable_ID); +void gimp_edit_fill (gint32 drawable_ID, + GimpFillType fill_type); +void gimp_edit_stroke (gint32 drawable_ID); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_EDIT_PDB_H__ */ diff --git a/libgimp/gimpfloatingsel_pdb.c b/libgimp/gimpfloatingsel_pdb.c new file mode 100644 index 0000000000..01768f3467 --- /dev/null +++ b/libgimp/gimpfloatingsel_pdb.c @@ -0,0 +1,114 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpfloatingsel_pdb.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#include "gimp.h" + +void +gimp_floating_sel_remove (gint32 floating_sel_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_floating_sel_remove", + &nreturn_vals, + PARAM_LAYER, floating_sel_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_floating_sel_anchor (gint32 floating_sel_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_floating_sel_anchor", + &nreturn_vals, + PARAM_LAYER, floating_sel_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_floating_sel_to_layer (gint32 floating_sel_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_floating_sel_to_layer", + &nreturn_vals, + PARAM_LAYER, floating_sel_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_floating_sel_attach (gint32 layer_ID, + gint32 drawable_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_floating_sel_attach", + &nreturn_vals, + PARAM_LAYER, layer_ID, + PARAM_DRAWABLE, drawable_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_floating_sel_rigor (gint32 floating_sel_ID, + gboolean undo) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_floating_sel_rigor", + &nreturn_vals, + PARAM_LAYER, floating_sel_ID, + PARAM_INT32, undo, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_floating_sel_relax (gint32 floating_sel_ID, + gboolean undo) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_floating_sel_relax", + &nreturn_vals, + PARAM_LAYER, floating_sel_ID, + PARAM_INT32, undo, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} diff --git a/libgimp/gimpfloatingsel_pdb.h b/libgimp/gimpfloatingsel_pdb.h new file mode 100644 index 0000000000..c5431277db --- /dev/null +++ b/libgimp/gimpfloatingsel_pdb.h @@ -0,0 +1,49 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpfloatingsel_pdb.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#ifndef __GIMP_FLOATING_SEL_PDB_H__ +#define __GIMP_FLOATING_SEL_PDB_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +void gimp_floating_sel_remove (gint32 floating_sel_ID); +void gimp_floating_sel_anchor (gint32 floating_sel_ID); +void gimp_floating_sel_to_layer (gint32 floating_sel_ID); +void gimp_floating_sel_attach (gint32 layer_ID, + gint32 drawable_ID); +void gimp_floating_sel_rigor (gint32 floating_sel_ID, + gboolean undo); +void gimp_floating_sel_relax (gint32 floating_sel_ID, + gboolean undo); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_FLOATING_SEL_PDB_H__ */ diff --git a/libgimp/gimpgimprc_pdb.c b/libgimp/gimpgimprc_pdb.c new file mode 100644 index 0000000000..040dd4c2b9 --- /dev/null +++ b/libgimp/gimpgimprc_pdb.c @@ -0,0 +1,81 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpgimprc_pdb.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#include "gimp.h" + +gchar * +gimp_gimprc_query (gchar *token) +{ + GParam *return_vals; + gint nreturn_vals; + gchar *value = NULL; + + return_vals = gimp_run_procedure ("gimp_gimprc_query", + &nreturn_vals, + PARAM_STRING, token, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + value = g_strdup (return_vals[1].data.d_string); + + gimp_destroy_params (return_vals, nreturn_vals); + + return value; +} + +void +gimp_gimprc_set (gchar *token, + gchar *value) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_gimprc_set", + &nreturn_vals, + PARAM_STRING, token, + PARAM_STRING, value, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_get_monitor_resolution (gdouble *xres, + gdouble *yres) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_get_monitor_resolution", + &nreturn_vals, + PARAM_END); + + *xres = *yres = 1.0; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + { + *xres = return_vals[1].data.d_float; + *yres = return_vals[2].data.d_float; + } + + gimp_destroy_params (return_vals, nreturn_vals); +} diff --git a/libgimp/gimpgimprc_pdb.h b/libgimp/gimpgimprc_pdb.h new file mode 100644 index 0000000000..d4cc251705 --- /dev/null +++ b/libgimp/gimpgimprc_pdb.h @@ -0,0 +1,45 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpgimprc_pdb.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#ifndef __GIMP_GIMPRC_PDB_H__ +#define __GIMP_GIMPRC_PDB_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +gchar* gimp_gimprc_query (gchar *token); +void gimp_gimprc_set (gchar *token, + gchar *value); +void gimp_get_monitor_resolution (gdouble *xres, + gdouble *yres); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_GIMPRC_PDB_H__ */ diff --git a/libgimp/gimpgradientselect.c b/libgimp/gimpgradientselect.c new file mode 100644 index 0000000000..a44a77e5d7 --- /dev/null +++ b/libgimp/gimpgradientselect.c @@ -0,0 +1,31 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpgradientselect.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gimp.h" + +gchar * +gimp_gradients_get_gradient_data (gchar *name, + gint *width, + gint sample_size, + gdouble **grad_data) +{ + return _gimp_gradients_get_gradient_data (name, sample_size, width, grad_data); +} diff --git a/libgimp/gimpgradientselect.h b/libgimp/gimpgradientselect.h new file mode 100644 index 0000000000..04703fb19d --- /dev/null +++ b/libgimp/gimpgradientselect.h @@ -0,0 +1,42 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpgradientselect.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GIMP_GRADIENT_SELECT_H__ +#define __GIMP_GRADIENT_SELECT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +gchar * gimp_gradients_get_gradient_data (gchar *name, + gint *width, + gint sample_size, + gdouble **grad_data); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_GRADIENT_SELECT_H__ */ diff --git a/libgimp/gimpgradientselect_pdb.c b/libgimp/gimpgradientselect_pdb.c index f5f767b8e1..f208a4eed8 100644 --- a/libgimp/gimpgradientselect_pdb.c +++ b/libgimp/gimpgradientselect_pdb.c @@ -74,10 +74,10 @@ gimp_gradients_set_popup (gchar *gradients_callback, } gchar * -gimp_gradients_get_gradient_data (gchar *name, - gint sample_size, - gint *width, - gdouble **grad_data) +_gimp_gradients_get_gradient_data (gchar *name, + gint sample_size, + gint *width, + gdouble **grad_data) { GParam *return_vals; gint nreturn_vals; diff --git a/libgimp/gimpgradientselect_pdb.h b/libgimp/gimpgradientselect_pdb.h index f2ddf33480..d0fac9f596 100644 --- a/libgimp/gimpgradientselect_pdb.h +++ b/libgimp/gimpgradientselect_pdb.h @@ -31,17 +31,17 @@ extern "C" { /* For information look into the C source or the html documentation */ -void gimp_gradients_popup (gchar *gradients_callback, - gchar *popup_title, - gchar *initial_gradient, - gint sample_size); -void gimp_gradients_close_popup (gchar *gradients_callback); -void gimp_gradients_set_popup (gchar *gradients_callback, - gchar *gradient_name); -gchar* gimp_gradients_get_gradient_data (gchar *name, - gint sample_size, - gint *width, - gdouble **grad_data); +void gimp_gradients_popup (gchar *gradients_callback, + gchar *popup_title, + gchar *initial_gradient, + gint sample_size); +void gimp_gradients_close_popup (gchar *gradients_callback); +void gimp_gradients_set_popup (gchar *gradients_callback, + gchar *gradient_name); +gchar* _gimp_gradients_get_gradient_data (gchar *name, + gint sample_size, + gint *width, + gdouble **grad_data); #ifdef __cplusplus diff --git a/libgimp/gimpimage.c b/libgimp/gimpimage.c new file mode 100644 index 0000000000..ae39aed3d1 --- /dev/null +++ b/libgimp/gimpimage.c @@ -0,0 +1,71 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpimage.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gimp.h" + + +guchar * +gimp_image_get_cmap (gint32 image_ID, + gint *num_colors) +{ + gint num_bytes; + guchar *cmap; + + cmap = _gimp_image_get_cmap (image_ID, + &num_bytes); + + *num_colors = num_bytes / 3; + + return cmap; +} + +void +gimp_image_set_cmap (gint32 image_ID, + guchar *cmap, + gint num_colors) +{ + _gimp_image_set_cmap (image_ID, + num_colors * 3, + cmap); +} + +guchar * +gimp_image_get_thumbnail_data (gint32 image_ID, + gint *width, + gint *height, + gint *bpp) +{ + gint ret_width; + gint ret_height; + guchar *image_data; + gint data_size; + + _gimp_image_thumbnail (image_ID, + *width, + *height, + &ret_width, + &ret_height, + bpp, + &data_size, + image_data); + + return image_data; +} diff --git a/libgimp/gimpimage.h b/libgimp/gimpimage.h new file mode 100644 index 0000000000..d62599ab95 --- /dev/null +++ b/libgimp/gimpimage.h @@ -0,0 +1,48 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpimage.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GIMP_IMAGE_H__ +#define __GIMP_IMAGE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +guchar * gimp_image_get_cmap (gint32 image_ID, + gint *num_colors); +void gimp_image_set_cmap (gint32 image_ID, + guchar *cmap, + gint num_colors); + +guchar * gimp_image_get_thumbnail_data (gint32 image_ID, + gint *width, + gint *height, + gint *bpp); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_IMAGE_H__ */ diff --git a/libgimp/gimpimage_pdb.c b/libgimp/gimpimage_pdb.c index 3617063751..6023899527 100644 --- a/libgimp/gimpimage_pdb.c +++ b/libgimp/gimpimage_pdb.c @@ -1,5 +1,5 @@ /* LIBGIMP - The GIMP Library - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball * * gimpimage_pdb.c * @@ -11,7 +11,7 @@ * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the @@ -19,19 +19,46 @@ * Boston, MA 02111-1307, USA. */ +/* NOTE: This file is autogenerated by pdbgen.pl */ + #include #include "gimp.h" - -gint32 -gimp_image_new (guint width, - guint height, - GImageType type) +gint * +gimp_image_list (gint *num_images) { GParam *return_vals; gint nreturn_vals; - gint32 image_ID; + gint *image_ids = NULL; + + return_vals = gimp_run_procedure ("gimp_image_list", + &nreturn_vals, + PARAM_END); + + *num_images = 0; + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + { + *num_images = return_vals[1].data.d_int32; + image_ids = g_new (gint32, *num_images); + memcpy (image_ids, return_vals[2].data.d_int32array, + *num_images * sizeof (gint32)); + } + + gimp_destroy_params (return_vals, nreturn_vals); + + return image_ids; +} + +gint32 +gimp_image_new (gint width, + gint height, + GimpImageBaseType type) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 image_ID = -1; return_vals = gimp_run_procedure ("gimp_image_new", &nreturn_vals, @@ -40,7 +67,6 @@ gimp_image_new (guint width, PARAM_INT32, type, PARAM_END); - image_ID = -1; if (return_vals[0].data.d_status == STATUS_SUCCESS) image_ID = return_vals[1].data.d_image; @@ -49,26 +75,45 @@ gimp_image_new (guint width, return image_ID; } -gint32 -gimp_image_duplicate (gint32 image_ID) +void +gimp_image_resize (gint32 image_ID, + gint new_width, + gint new_height, + gint offx, + gint offy) { GParam *return_vals; gint nreturn_vals; - gint32 new_image_ID; - return_vals = gimp_run_procedure ("gimp_channel_ops_duplicate", + return_vals = gimp_run_procedure ("gimp_image_resize", &nreturn_vals, PARAM_IMAGE, image_ID, + PARAM_INT32, new_width, + PARAM_INT32, new_height, + PARAM_INT32, offx, + PARAM_INT32, offy, PARAM_END); - new_image_ID = -1; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - new_image_ID = return_vals[1].data.d_image; + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_image_scale (gint32 image_ID, + gint new_width, + gint new_height) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_image_scale", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_INT32, new_width, + PARAM_INT32, new_height, + PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); - - return (new_image_ID); -} +} void gimp_image_delete (gint32 image_ID) @@ -84,82 +129,106 @@ gimp_image_delete (gint32 image_ID) gimp_destroy_params (return_vals, nreturn_vals); } -guint -gimp_image_width (gint32 image_ID) +void +gimp_image_free_shadow (gint32 image_ID) { GParam *return_vals; gint nreturn_vals; - gint result; - return_vals = gimp_run_procedure ("gimp_image_width", + return_vals = gimp_run_procedure ("gimp_image_free_shadow", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_END); - result = 0; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - result = return_vals[1].data.d_int32; - gimp_destroy_params (return_vals, nreturn_vals); - - return result; } -guint -gimp_image_height (gint32 image_ID) +gint * +gimp_image_get_layers (gint32 image_ID, + gint *num_layers) { GParam *return_vals; gint nreturn_vals; - gint result; + gint *layer_ids = NULL; - return_vals = gimp_run_procedure ("gimp_image_height", + return_vals = gimp_run_procedure ("gimp_image_get_layers", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_END); - result = 0; + *num_layers = 0; + if (return_vals[0].data.d_status == STATUS_SUCCESS) - result = return_vals[1].data.d_int32; + { + *num_layers = return_vals[1].data.d_int32; + layer_ids = g_new (gint32, *num_layers); + memcpy (layer_ids, return_vals[2].data.d_int32array, + *num_layers * sizeof (gint32)); + } gimp_destroy_params (return_vals, nreturn_vals); - return result; + return layer_ids; } -GImageType -gimp_image_base_type (gint32 image_ID) +gint * +gimp_image_get_channels (gint32 image_ID, + gint *num_channels) { GParam *return_vals; gint nreturn_vals; - gint result; + gint *channel_ids = NULL; - return_vals = gimp_run_procedure ("gimp_image_base_type", + return_vals = gimp_run_procedure ("gimp_image_get_channels", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_END); - result = 0; + *num_channels = 0; + if (return_vals[0].data.d_status == STATUS_SUCCESS) - result = return_vals[1].data.d_int32; + { + *num_channels = return_vals[1].data.d_int32; + channel_ids = g_new (gint32, *num_channels); + memcpy (channel_ids, return_vals[2].data.d_int32array, + *num_channels * sizeof (gint32)); + } gimp_destroy_params (return_vals, nreturn_vals); - return result; + return channel_ids; +} + +void +gimp_image_unset_active_channel (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_image_unset_active_channel", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); } gint32 -gimp_image_floating_selection (gint32 image_ID) +gimp_image_pick_correlate_layer (gint32 image_ID, + gint x, + gint y) { GParam *return_vals; gint nreturn_vals; - gint32 layer_ID; + gint32 layer_ID = -1; - return_vals = gimp_run_procedure ("gimp_image_floating_selection", + return_vals = gimp_run_procedure ("gimp_image_pick_correlate_layer", &nreturn_vals, PARAM_IMAGE, image_ID, + PARAM_INT32, x, + PARAM_INT32, y, PARAM_END); - layer_ID = 0; if (return_vals[0].data.d_status == STATUS_SUCCESS) layer_ID = return_vals[1].data.d_layer; @@ -169,23 +238,135 @@ gimp_image_floating_selection (gint32 image_ID) } void -gimp_image_add_channel (gint32 image_ID, - gint32 channel_ID, - int position) +gimp_image_raise_layer (gint32 image_ID, + gint32 layer_ID) { GParam *return_vals; gint nreturn_vals; - return_vals = gimp_run_procedure ("gimp_image_add_channel", + return_vals = gimp_run_procedure ("gimp_image_raise_layer", &nreturn_vals, PARAM_IMAGE, image_ID, - PARAM_CHANNEL, channel_ID, - PARAM_INT32, position, + PARAM_LAYER, layer_ID, PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); } +void +gimp_image_lower_layer (gint32 image_ID, + gint32 layer_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_image_lower_layer", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_LAYER, layer_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_image_raise_layer_to_top (gint32 image_ID, + gint32 layer_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_image_raise_layer_to_top", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_LAYER, layer_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_image_lower_layer_to_bottom (gint32 image_ID, + gint32 layer_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_image_lower_layer_to_bottom", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_LAYER, layer_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +gint32 +gimp_image_merge_visible_layers (gint32 image_ID, + GimpMergeType merge_type) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 layer_ID = -1; + + return_vals = gimp_run_procedure ("gimp_image_merge_visible_layers", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_INT32, merge_type, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + layer_ID = return_vals[1].data.d_layer; + + gimp_destroy_params (return_vals, nreturn_vals); + + return layer_ID; +} + +gint32 +gimp_image_merge_down (gint32 image_ID, + gint32 merge_layer_ID, + GimpMergeType merge_type) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 layer_ID = -1; + + return_vals = gimp_run_procedure ("gimp_image_merge_down", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_LAYER, merge_layer_ID, + PARAM_INT32, merge_type, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + layer_ID = return_vals[1].data.d_layer; + + gimp_destroy_params (return_vals, nreturn_vals); + + return layer_ID; +} + +gint32 +gimp_image_flatten (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 layer_ID = -1; + + return_vals = gimp_run_procedure ("gimp_image_flatten", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + layer_ID = return_vals[1].data.d_layer; + + gimp_destroy_params (return_vals, nreturn_vals); + + return layer_ID; +} + void gimp_image_add_layer (gint32 image_ID, gint32 layer_ID, @@ -204,6 +385,22 @@ gimp_image_add_layer (gint32 image_ID, gimp_destroy_params (return_vals, nreturn_vals); } +void +gimp_image_remove_layer (gint32 image_ID, + gint32 layer_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_image_remove_layer", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_LAYER, layer_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + void gimp_image_add_layer_mask (gint32 image_ID, gint32 layer_ID, @@ -223,204 +420,23 @@ gimp_image_add_layer_mask (gint32 image_ID, } void -gimp_image_undo_disable (gint32 image_ID) +gimp_image_remove_layer_mask (gint32 image_ID, + gint32 layer_ID, + GimpMaskApplyMode mode) { GParam *return_vals; gint nreturn_vals; - return_vals = gimp_run_procedure ("gimp_image_undo_disable", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - gimp_destroy_params (return_vals, nreturn_vals); -} - -void -gimp_image_undo_enable (gint32 image_ID) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_image_undo_enable", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - gimp_destroy_params (return_vals, nreturn_vals); -} - -void -gimp_image_undo_freeze (gint32 image_ID) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_image_undo_freeze", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - gimp_destroy_params (return_vals, nreturn_vals); -} - -void -gimp_image_undo_thaw (gint32 image_ID) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_image_undo_thaw", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - gimp_destroy_params (return_vals, nreturn_vals); -} - -void -gimp_undo_push_group_start (gint32 image_ID) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_undo_push_group_start", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - gimp_destroy_params (return_vals, nreturn_vals); -} - -void -gimp_undo_push_group_end (gint32 image_ID) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_undo_push_group_end", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - gimp_destroy_params (return_vals, nreturn_vals); -} - -void -gimp_image_clean_all (gint32 image_ID) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_image_clean_all", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - gimp_destroy_params (return_vals, nreturn_vals); -} - -gint32 -gimp_image_flatten (gint32 image_ID) -{ - GParam *return_vals; - gint nreturn_vals; - gint32 layer_ID; - - return_vals = gimp_run_procedure ("gimp_image_flatten", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - layer_ID = -1; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - layer_ID = return_vals[1].data.d_layer; - - gimp_destroy_params (return_vals, nreturn_vals); - - return layer_ID; -} - -void -gimp_image_lower_channel (gint32 image_ID, - gint32 channel_ID) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_image_lower_channel", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_CHANNEL, channel_ID, - PARAM_END); - - gimp_destroy_params (return_vals, nreturn_vals); -} - -void -gimp_image_lower_layer (gint32 image_ID, - gint32 layer_ID) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_image_lower_layer", + return_vals = gimp_run_procedure ("gimp_image_remove_layer_mask", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_LAYER, layer_ID, + PARAM_INT32, mode, PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); } -gint32 -gimp_image_merge_visible_layers (gint32 image_ID, - GimpMergeType merge_type) -{ - GParam *return_vals; - gint nreturn_vals; - gint32 layer_ID; - - return_vals = gimp_run_procedure ("gimp_image_merge_visible_layers", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_INT32, merge_type, - PARAM_END); - - layer_ID = -1; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - layer_ID = return_vals[1].data.d_layer; - - gimp_destroy_params (return_vals, nreturn_vals); - - return layer_ID; -} - -gint32 -gimp_image_pick_correlate_layer (gint32 image_ID, - gint x, - gint y) -{ - GParam *return_vals; - gint nreturn_vals; - gint32 layer_ID; - - return_vals = gimp_run_procedure ("gimp_image_pick_correlate_layer", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_INT32, x, - PARAM_INT32, y, - PARAM_END); - - layer_ID = -1; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - layer_ID = return_vals[1].data.d_layer; - - gimp_destroy_params (return_vals, nreturn_vals); - - return layer_ID; -} - void gimp_image_raise_channel (gint32 image_ID, gint32 channel_ID) @@ -438,13 +454,13 @@ gimp_image_raise_channel (gint32 image_ID, } void -gimp_image_raise_layer (gint32 image_ID, - gint32 layer_ID) +gimp_image_lower_channel (gint32 image_ID, + gint32 layer_ID) { GParam *return_vals; gint nreturn_vals; - return_vals = gimp_run_procedure ("gimp_image_raise_layer", + return_vals = gimp_run_procedure ("gimp_image_lower_channel", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_LAYER, layer_ID, @@ -453,6 +469,24 @@ gimp_image_raise_layer (gint32 image_ID, gimp_destroy_params (return_vals, nreturn_vals); } +void +gimp_image_add_channel (gint32 image_ID, + gint32 channel_ID, + gint position) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_image_add_channel", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_CHANNEL, channel_ID, + PARAM_INT32, position, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + void gimp_image_remove_channel (gint32 image_ID, gint32 channel_ID) @@ -469,57 +503,388 @@ gimp_image_remove_channel (gint32 image_ID, gimp_destroy_params (return_vals, nreturn_vals); } +gint32 +gimp_image_active_drawable (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 drawable_ID = -1; + + return_vals = gimp_run_procedure ("gimp_image_active_drawable", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + drawable_ID = return_vals[1].data.d_drawable; + + gimp_destroy_params (return_vals, nreturn_vals); + + return drawable_ID; +} + +GimpImageBaseType +gimp_image_base_type (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + GimpImageBaseType base_type = 0; + + return_vals = gimp_run_procedure ("gimp_image_base_type", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + base_type = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return base_type; +} + +guint8 * +_gimp_image_get_cmap (gint32 image_ID, + gint *num_bytes) +{ + GParam *return_vals; + gint nreturn_vals; + guint8 *cmap = NULL; + + return_vals = gimp_run_procedure ("gimp_image_get_cmap", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + { + *num_bytes = return_vals[1].data.d_int32; + cmap = g_new (guint8, *num_bytes); + memcpy (cmap, return_vals[2].data.d_int8array, + *num_bytes * sizeof (guint8)); + } + + gimp_destroy_params (return_vals, nreturn_vals); + + return cmap; +} + void -gimp_image_remove_layer (gint32 image_ID, - gint32 layer_ID) +_gimp_image_set_cmap (gint32 image_ID, + gint num_bytes, + guint8 *cmap) { GParam *return_vals; gint nreturn_vals; - return_vals = gimp_run_procedure ("gimp_image_remove_layer", + return_vals = gimp_run_procedure ("gimp_image_set_cmap", &nreturn_vals, PARAM_IMAGE, image_ID, - PARAM_LAYER, layer_ID, + PARAM_INT32, num_bytes, + PARAM_INT8ARRAY, cmap, PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); } +gboolean +gimp_image_undo_is_enabled (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gboolean enabled = TRUE; + + return_vals = gimp_run_procedure ("gimp_image_undo_is_enabled", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + enabled = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return enabled; +} + +gboolean +gimp_image_undo_enable (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gboolean enabled = TRUE; + + return_vals = gimp_run_procedure ("gimp_image_undo_enable", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + enabled = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return enabled; +} + +gboolean +gimp_image_undo_disable (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gboolean disabled = TRUE; + + return_vals = gimp_run_procedure ("gimp_image_undo_disable", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + disabled = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return disabled; +} + +gboolean +gimp_image_undo_freeze (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gboolean frozen = TRUE; + + return_vals = gimp_run_procedure ("gimp_image_undo_freeze", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + frozen = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return frozen; +} + +gboolean +gimp_image_undo_thaw (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gboolean thawed = TRUE; + + return_vals = gimp_run_procedure ("gimp_image_undo_thaw", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + thawed = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return thawed; +} + void -gimp_image_remove_layer_mask (gint32 image_ID, - gint32 layer_ID, - gint mode) +gimp_image_clean_all (gint32 image_ID) { GParam *return_vals; gint nreturn_vals; - return_vals = gimp_run_procedure ("gimp_image_remove_layer_mask", + return_vals = gimp_run_procedure ("gimp_image_clean_all", &nreturn_vals, PARAM_IMAGE, image_ID, - PARAM_LAYER, layer_ID, - PARAM_INT32, mode, PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); } +gint32 +gimp_image_floating_selection (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 floating_sel_ID = -1; + + return_vals = gimp_run_procedure ("gimp_image_floating_selection", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + floating_sel_ID = return_vals[1].data.d_layer; + + gimp_destroy_params (return_vals, nreturn_vals); + + return floating_sel_ID; +} + +gint32 +gimp_image_floating_sel_attached_to (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 drawable_ID = -1; + + return_vals = gimp_run_procedure ("gimp_image_floating_sel_attached_to", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + drawable_ID = return_vals[1].data.d_drawable; + + gimp_destroy_params (return_vals, nreturn_vals); + + return drawable_ID; +} + void -gimp_image_resize (gint32 image_ID, - guint new_width, - guint new_height, - gint offset_x, - gint offset_y) +_gimp_image_thumbnail (gint32 image_ID, + gint width, + gint height, + gint *ret_width, + gint *ret_height, + gint *bpp, + gint *thumbnail_data_count, + guint8 **thumbnail_data) { GParam *return_vals; gint nreturn_vals; - return_vals = gimp_run_procedure ("gimp_image_resize", + return_vals = gimp_run_procedure ("gimp_image_thumbnail", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_INT32, width, + PARAM_INT32, height, + PARAM_END); + + *thumbnail_data_count = 0; + *ret_width = 0; + *ret_height = 0; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + { + *ret_width = return_vals[1].data.d_int32; + *ret_height = return_vals[2].data.d_int32; + *bpp = return_vals[3].data.d_int32; + *thumbnail_data_count = return_vals[4].data.d_int32; + *thumbnail_data = g_new (guint8, *thumbnail_data_count); + memcpy (*thumbnail_data, return_vals[5].data.d_int8array, + *thumbnail_data_count * sizeof (guint8)); + } + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_image_set_tattoo_state (gint32 image_ID, + gint tattoo) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_image_set_tattoo_state", &nreturn_vals, PARAM_IMAGE, image_ID, - PARAM_INT32, new_width, - PARAM_INT32, new_height, - PARAM_INT32, offset_x, - PARAM_INT32, offset_y, + PARAM_INT32, tattoo, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +gint +gimp_image_get_tattoo_state (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gint tattoo = 0; + + return_vals = gimp_run_procedure ("gimp_image_get_tattoo_state", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + tattoo = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return tattoo; +} + +gint +gimp_image_width (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gint width = 0; + + return_vals = gimp_run_procedure ("gimp_image_width", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + width = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return width; +} + +gint +gimp_image_height (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gint height = 0; + + return_vals = gimp_run_procedure ("gimp_image_height", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + height = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return height; +} + +gint32 +gimp_image_get_active_layer (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 active_layer_ID = -1; + + return_vals = gimp_run_procedure ("gimp_image_get_active_layer", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + active_layer_ID = return_vals[1].data.d_layer; + + gimp_destroy_params (return_vals, nreturn_vals); + + return active_layer_ID; +} + +void +gimp_image_set_active_layer (gint32 image_ID, + gint32 active_layer_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_image_set_active_layer", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_LAYER, active_layer_ID, PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); @@ -530,184 +895,35 @@ gimp_image_get_active_channel (gint32 image_ID) { GParam *return_vals; gint nreturn_vals; - gint32 channel_ID; + gint32 active_channel_ID = -1; return_vals = gimp_run_procedure ("gimp_image_get_active_channel", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_END); - channel_ID = -1; if (return_vals[0].data.d_status == STATUS_SUCCESS) - channel_ID = return_vals[1].data.d_channel; + active_channel_ID = return_vals[1].data.d_channel; gimp_destroy_params (return_vals, nreturn_vals); - return channel_ID; + return active_channel_ID; } -gint32 -gimp_image_get_active_layer (gint32 image_ID) +void +gimp_image_set_active_channel (gint32 image_ID, + gint32 active_channel_ID) { GParam *return_vals; gint nreturn_vals; - gint32 layer_ID; - return_vals = gimp_run_procedure ("gimp_image_get_active_layer", + return_vals = gimp_run_procedure ("gimp_image_set_active_channel", &nreturn_vals, PARAM_IMAGE, image_ID, + PARAM_CHANNEL, active_channel_ID, PARAM_END); - layer_ID = -1; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - layer_ID = return_vals[1].data.d_layer; - gimp_destroy_params (return_vals, nreturn_vals); - - return layer_ID; -} - -gint32* -gimp_image_get_channels (gint32 image_ID, - gint *nchannels) -{ - GParam *return_vals; - gint nreturn_vals; - gint32 *channels; - - return_vals = gimp_run_procedure ("gimp_image_get_channels", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - channels = NULL; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - { - *nchannels = return_vals[1].data.d_int32; - channels = g_new (gint32, *nchannels); - memcpy (channels, return_vals[2].data.d_int32array, *nchannels * 4); - } - - gimp_destroy_params (return_vals, nreturn_vals); - - return channels; -} - -guchar* -gimp_image_get_cmap (gint32 image_ID, - gint *ncolors) -{ - GParam *return_vals; - gint nreturn_vals; - guchar *cmap; - - return_vals = gimp_run_procedure ("gimp_image_get_cmap", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - cmap = NULL; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - { - *ncolors = return_vals[1].data.d_int32 / 3; - cmap = g_new (guchar, *ncolors * 3); - memcpy (cmap, return_vals[2].data.d_int8array, *ncolors * 3); - } - - gimp_destroy_params (return_vals, nreturn_vals); - - return cmap; -} - -gboolean -gimp_image_get_component_active (gint32 image_ID, - gint component) -{ - GParam *return_vals; - gint nreturn_vals; - gboolean result; - - return_vals = gimp_run_procedure ("gimp_image_get_component_active", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - result = FALSE; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - result = return_vals[1].data.d_int32; - - gimp_destroy_params (return_vals, nreturn_vals); - - return result; -} - -gboolean -gimp_image_get_component_visible (gint32 image_ID, - gint component) -{ - GParam *return_vals; - gint nreturn_vals; - gboolean result; - - return_vals = gimp_run_procedure ("gimp_image_get_component_visible", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - result = FALSE; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - result = return_vals[1].data.d_int32; - - gimp_destroy_params (return_vals, nreturn_vals); - - return result; -} - -gchar* -gimp_image_get_filename (gint32 image_ID) -{ - GParam *return_vals; - gint nreturn_vals; - char *filename; - - return_vals = gimp_run_procedure ("gimp_image_get_filename", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - filename = NULL; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - filename = g_strdup (return_vals[1].data.d_string); - - gimp_destroy_params (return_vals, nreturn_vals); - - return filename; -} - -gint32* -gimp_image_get_layers (gint32 image_ID, - gint *nlayers) -{ - GParam *return_vals; - gint nreturn_vals; - gint32 *layers; - - return_vals = gimp_run_procedure ("gimp_image_get_layers", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - - layers = NULL; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - { - *nlayers = return_vals[1].data.d_int32; - layers = g_new (gint32, *nlayers); - memcpy (layers, return_vals[2].data.d_int32array, *nlayers * 4); - } - - gimp_destroy_params (return_vals, nreturn_vals); - - return layers; } gint32 @@ -715,14 +931,13 @@ gimp_image_get_selection (gint32 image_ID) { GParam *return_vals; gint nreturn_vals; - gint32 selection_ID; + gint32 selection_ID = -1; return_vals = gimp_run_procedure ("gimp_image_get_selection", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_END); - selection_ID = -1; if (return_vals[0].data.d_status == STATUS_SUCCESS) selection_ID = return_vals[1].data.d_selection; @@ -731,70 +946,32 @@ gimp_image_get_selection (gint32 image_ID) return selection_ID; } -void -gimp_image_set_active_channel (gint32 image_ID, - gint32 channel_ID) +gboolean +gimp_image_get_component_active (gint32 image_ID, + GimpChannelType component) { GParam *return_vals; gint nreturn_vals; + gboolean active = TRUE; - if (channel_ID == -1) - { - return_vals = gimp_run_procedure ("gimp_image_unset_active_channel", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); - } - else - { - return_vals = gimp_run_procedure ("gimp_image_set_active_channel", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_CHANNEL, channel_ID, - PARAM_END); - } - - gimp_destroy_params (return_vals, nreturn_vals); -} - -void -gimp_image_set_active_layer (gint32 image_ID, - gint32 layer_ID) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_image_set_active_layer", + return_vals = gimp_run_procedure ("gimp_image_get_component_active", &nreturn_vals, PARAM_IMAGE, image_ID, - PARAM_LAYER, layer_ID, + PARAM_INT32, component, PARAM_END); + if (return_vals[0].data.d_status == STATUS_SUCCESS) + active = return_vals[1].data.d_int32; + gimp_destroy_params (return_vals, nreturn_vals); + + return active; } void -gimp_image_set_cmap (gint32 image_ID, - guchar *cmap, - gint ncolors) -{ - GParam *return_vals; - gint nreturn_vals; - - return_vals = gimp_run_procedure ("gimp_image_set_cmap", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_INT32, ncolors * 3, - PARAM_INT8ARRAY, cmap, - PARAM_END); - - gimp_destroy_params (return_vals, nreturn_vals); -} - -void -gimp_image_set_component_active (gint32 image_ID, - gint component, - gboolean active) +gimp_image_set_component_active (gint32 image_ID, + GimpChannelType component, + gboolean active) { GParam *return_vals; gint nreturn_vals; @@ -809,10 +986,32 @@ gimp_image_set_component_active (gint32 image_ID, gimp_destroy_params (return_vals, nreturn_vals); } +gboolean +gimp_image_get_component_visible (gint32 image_ID, + GimpChannelType component) +{ + GParam *return_vals; + gint nreturn_vals; + gboolean visible = TRUE; + + return_vals = gimp_run_procedure ("gimp_image_get_component_visible", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_INT32, component, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + visible = return_vals[1].data.d_int32; + + gimp_destroy_params (return_vals, nreturn_vals); + + return visible; +} + void -gimp_image_set_component_visible (gint32 image_ID, - gint component, - gboolean visible) +gimp_image_set_component_visible (gint32 image_ID, + GimpChannelType component, + gboolean visible) { GParam *return_vals; gint nreturn_vals; @@ -827,9 +1026,29 @@ gimp_image_set_component_visible (gint32 image_ID, gimp_destroy_params (return_vals, nreturn_vals); } +gchar * +gimp_image_get_filename (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + gchar *filename = NULL; + + return_vals = gimp_run_procedure ("gimp_image_get_filename", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + filename = g_strdup (return_vals[1].data.d_string); + + gimp_destroy_params (return_vals, nreturn_vals); + + return filename; +} + void gimp_image_set_filename (gint32 image_ID, - gchar *name) + gchar *filename) { GParam *return_vals; gint nreturn_vals; @@ -837,49 +1056,40 @@ gimp_image_set_filename (gint32 image_ID, return_vals = gimp_run_procedure ("gimp_image_set_filename", &nreturn_vals, PARAM_IMAGE, image_ID, - PARAM_STRING, name, + PARAM_STRING, filename, PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); } void -gimp_image_get_resolution (gint32 image_ID, - double *xresolution, - double *yresolution) +gimp_image_get_resolution (gint32 image_ID, + gdouble *xresolution, + gdouble *yresolution) { GParam *return_vals; gint nreturn_vals; - gdouble xres; - gdouble yres; - g_return_if_fail (xresolution && yresolution); + *xresolution = *yresolution = 1.0; return_vals = gimp_run_procedure ("gimp_image_get_resolution", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_END); - /* error return values */ - xres = 0.0; - yres = 0.0; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - { - xres = return_vals[1].data.d_float; - yres = return_vals[2].data.d_float; - } + { + *xresolution = return_vals[1].data.d_float; + *yresolution = return_vals[2].data.d_float; + } gimp_destroy_params (return_vals, nreturn_vals); - - *xresolution = xres; - *yresolution = yres; } void -gimp_image_set_resolution (gint32 image_ID, - double xresolution, - double yresolution) +gimp_image_set_resolution (gint32 image_ID, + gdouble xresolution, + gdouble yresolution) { GParam *return_vals; gint nreturn_vals; @@ -899,18 +1109,15 @@ gimp_image_get_unit (gint32 image_ID) { GParam *return_vals; gint nreturn_vals; - GimpUnit unit; + GimpUnit unit = 0; return_vals = gimp_run_procedure ("gimp_image_get_unit", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_END); - /* error return value */ - unit = GIMP_UNIT_INCH; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - unit = return_vals[1].data.d_int32; + unit = return_vals[1].data.d_unit; gimp_destroy_params (return_vals, nreturn_vals); @@ -934,12 +1141,12 @@ gimp_image_set_unit (gint32 image_ID, } gint32 -gimp_image_get_layer_by_tattoo (gint32 image_ID, - gint32 tattoo) +gimp_image_get_layer_by_tattoo (gint32 image_ID, + gint tattoo) { GParam *return_vals; gint nreturn_vals; - gint32 layer = 0; + gint32 layer_ID = -1; return_vals = gimp_run_procedure ("gimp_image_get_layer_by_tattoo", &nreturn_vals, @@ -947,22 +1154,21 @@ gimp_image_get_layer_by_tattoo (gint32 image_ID, PARAM_INT32, tattoo, PARAM_END); - layer = 0; if (return_vals[0].data.d_status == STATUS_SUCCESS) - layer = return_vals[1].data.d_layer; + layer_ID = return_vals[1].data.d_layer; gimp_destroy_params (return_vals, nreturn_vals); - return layer; + return layer_ID; } gint32 -gimp_image_get_channel_by_tattoo (gint32 image_ID, - gint32 tattoo) +gimp_image_get_channel_by_tattoo (gint32 image_ID, + gint tattoo) { GParam *return_vals; gint nreturn_vals; - gint32 channel = 0; + gint32 channel_ID = -1; return_vals = gimp_run_procedure ("gimp_image_get_channel_by_tattoo", &nreturn_vals, @@ -970,67 +1176,10 @@ gimp_image_get_channel_by_tattoo (gint32 image_ID, PARAM_INT32, tattoo, PARAM_END); - channel = 0; if (return_vals[0].data.d_status == STATUS_SUCCESS) - channel = return_vals[1].data.d_channel; + channel_ID = return_vals[1].data.d_channel; gimp_destroy_params (return_vals, nreturn_vals); - return channel; + return channel_ID; } - -guchar * -gimp_image_get_thumbnail_data (gint32 image_ID, - gint *width, - gint *height, - gint *bytes) -{ - GParam *return_vals; - gint nreturn_vals; - guchar *image_data = NULL; - - return_vals = gimp_run_procedure ("gimp_image_thumbnail", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_INT32, *width, - PARAM_INT32, *height, - PARAM_END); - - if (return_vals[0].data.d_status == STATUS_SUCCESS) - { - *width = return_vals[1].data.d_int32; - *height = return_vals[2].data.d_int32; - *bytes = return_vals[3].data.d_int32; - image_data = g_new (guchar, return_vals[4].data.d_int32); - g_memmove (image_data, return_vals[5].data.d_int32array, return_vals[4].data.d_int32); - } - - gimp_destroy_params (return_vals, nreturn_vals); - - return image_data; -} - -gint32 * -gimp_image_list (gint *nimages) -{ - GimpParam *return_vals; - gint nreturn_vals; - gint32 *images; - - return_vals = gimp_run_procedure ("gimp_image_list", - &nreturn_vals, - PARAM_END); - - images = NULL; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - { - *nimages = return_vals[1].data.d_int32; - images = g_new (gint32, *nimages); - memcpy (images, return_vals[2].data.d_int32array, *nimages * 4); - } - - gimp_destroy_params (return_vals, nreturn_vals); - - return images; -} - diff --git a/libgimp/gimpimage_pdb.h b/libgimp/gimpimage_pdb.h index f8acfaf719..9e62ebd525 100644 --- a/libgimp/gimpimage_pdb.h +++ b/libgimp/gimpimage_pdb.h @@ -1,5 +1,5 @@ /* LIBGIMP - The GIMP Library - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball * * gimpimage_pdb.h * @@ -7,17 +7,19 @@ * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. - */ + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ #ifndef __GIMP_IMAGE_PDB_H__ #define __GIMP_IMAGE_PDB_H__ @@ -29,106 +31,123 @@ extern "C" { /* For information look into the C source or the html documentation */ -gint32 gimp_image_new (guint width, - guint height, - GimpImageBaseType type); -gint32 gimp_image_duplicate (gint32 image_ID); -void gimp_image_delete (gint32 image_ID); -guint gimp_image_width (gint32 image_ID); -guint gimp_image_height (gint32 image_ID); -GimpImageBaseType gimp_image_base_type (gint32 image_ID); -gint32 gimp_image_floating_selection (gint32 image_ID); -void gimp_image_add_channel (gint32 image_ID, - gint32 channel_ID, - gint position); -void gimp_image_add_layer (gint32 image_ID, - gint32 layer_ID, - gint position); -void gimp_image_add_layer_mask (gint32 image_ID, - gint32 layer_ID, - gint32 mask_ID); -void gimp_image_clean_all (gint32 image_ID); -void gimp_image_undo_disable (gint32 image_ID); -void gimp_image_undo_enable (gint32 image_ID); -void gimp_image_undo_freeze (gint32 image_ID); -void gimp_image_undo_thaw (gint32 image_ID); -void gimp_undo_push_group_start (gint32 image_ID); -void gimp_undo_push_group_end (gint32 image_ID); -void gimp_image_clean_all (gint32 image_ID); -gint32 gimp_image_flatten (gint32 image_ID); -void gimp_image_lower_channel (gint32 image_ID, - gint32 channel_ID); -void gimp_image_lower_layer (gint32 image_ID, - gint32 layer_ID); -gint32 gimp_image_merge_visible_layers (gint32 image_ID, - GimpMergeType merge_type); -gint32 gimp_image_pick_correlate_layer (gint32 image_ID, - gint x, - gint y); -void gimp_image_raise_channel (gint32 image_ID, - gint32 channel_ID); -void gimp_image_raise_layer (gint32 image_ID, - gint32 layer_ID); -void gimp_image_remove_channel (gint32 image_ID, - gint32 channel_ID); -void gimp_image_remove_layer (gint32 image_ID, - gint32 layer_ID); -void gimp_image_remove_layer_mask (gint32 image_ID, - gint32 layer_ID, - gint mode); -void gimp_image_resize (gint32 image_ID, - guint new_width, - guint new_height, - gint offset_x, - gint offset_y); -gint32 gimp_image_get_active_channel (gint32 image_ID); -gint32 gimp_image_get_active_layer (gint32 image_ID); -gint32 * gimp_image_get_channels (gint32 image_ID, - gint *nchannels); -guchar * gimp_image_get_cmap (gint32 image_ID, - gint *ncolors); -gboolean gimp_image_get_component_active (gint32 image_ID, - gint component); -gboolean gimp_image_get_component_visible (gint32 image_ID, - gint component); -gchar * gimp_image_get_filename (gint32 image_ID); -gint32 * gimp_image_get_layers (gint32 image_ID, - gint *nlayers); -gint32 gimp_image_get_selection (gint32 image_ID); -void gimp_image_set_active_channel (gint32 image_ID, - gint32 channel_ID); -void gimp_image_set_active_layer (gint32 image_ID, - gint32 layer_ID); -void gimp_image_set_cmap (gint32 image_ID, - guchar *cmap, - gint ncolors); -void gimp_image_set_component_active (gint32 image_ID, - gint component, - gboolean active); -void gimp_image_set_component_visible (gint32 image_ID, - gint component, - gboolean visible); -void gimp_image_set_filename (gint32 image_ID, - gchar *name); -void gimp_image_set_resolution (gint32 image_ID, - gdouble xresolution, - gdouble yresolution); -void gimp_image_get_resolution (gint32 image_ID, - gdouble *xresolution, - gdouble *yresolution); -void gimp_image_set_unit (gint32 image_ID, - GimpUnit unit); -GimpUnit gimp_image_get_unit (gint32 image_ID); -gint32 gimp_image_get_layer_by_tattoo (gint32 image_ID, - gint32 tattoo); -gint32 gimp_image_get_channel_by_tattoo (gint32 image_ID, - gint32 tattoo); - -guchar * gimp_image_get_thumbnail_data (gint32 image_ID, - gint *width, - gint *height, - gint *bytes); -gint32 * gimp_image_list (gint *nimages); +gint* gimp_image_list (gint *num_images); +gint32 gimp_image_new (gint width, + gint height, + GimpImageBaseType type); +void gimp_image_resize (gint32 image_ID, + gint new_width, + gint new_height, + gint offx, + gint offy); +void gimp_image_scale (gint32 image_ID, + gint new_width, + gint new_height); +void gimp_image_delete (gint32 image_ID); +void gimp_image_free_shadow (gint32 image_ID); +gint* gimp_image_get_layers (gint32 image_ID, + gint *num_layers); +gint* gimp_image_get_channels (gint32 image_ID, + gint *num_channels); +void gimp_image_unset_active_channel (gint32 image_ID); +gint32 gimp_image_pick_correlate_layer (gint32 image_ID, + gint x, + gint y); +void gimp_image_raise_layer (gint32 image_ID, + gint32 layer_ID); +void gimp_image_lower_layer (gint32 image_ID, + gint32 layer_ID); +void gimp_image_raise_layer_to_top (gint32 image_ID, + gint32 layer_ID); +void gimp_image_lower_layer_to_bottom (gint32 image_ID, + gint32 layer_ID); +gint32 gimp_image_merge_visible_layers (gint32 image_ID, + GimpMergeType merge_type); +gint32 gimp_image_merge_down (gint32 image_ID, + gint32 merge_layer_ID, + GimpMergeType merge_type); +gint32 gimp_image_flatten (gint32 image_ID); +void gimp_image_add_layer (gint32 image_ID, + gint32 layer_ID, + gint position); +void gimp_image_remove_layer (gint32 image_ID, + gint32 layer_ID); +void gimp_image_add_layer_mask (gint32 image_ID, + gint32 layer_ID, + gint32 mask_ID); +void gimp_image_remove_layer_mask (gint32 image_ID, + gint32 layer_ID, + GimpMaskApplyMode mode); +void gimp_image_raise_channel (gint32 image_ID, + gint32 channel_ID); +void gimp_image_lower_channel (gint32 image_ID, + gint32 layer_ID); +void gimp_image_add_channel (gint32 image_ID, + gint32 channel_ID, + gint position); +void gimp_image_remove_channel (gint32 image_ID, + gint32 channel_ID); +gint32 gimp_image_active_drawable (gint32 image_ID); +GimpImageBaseType gimp_image_base_type (gint32 image_ID); +guint8* _gimp_image_get_cmap (gint32 image_ID, + gint *num_bytes); +void _gimp_image_set_cmap (gint32 image_ID, + gint num_bytes, + guint8 *cmap); +gboolean gimp_image_undo_is_enabled (gint32 image_ID); +gboolean gimp_image_undo_enable (gint32 image_ID); +gboolean gimp_image_undo_disable (gint32 image_ID); +gboolean gimp_image_undo_freeze (gint32 image_ID); +gboolean gimp_image_undo_thaw (gint32 image_ID); +void gimp_image_clean_all (gint32 image_ID); +gint32 gimp_image_floating_selection (gint32 image_ID); +gint32 gimp_image_floating_sel_attached_to (gint32 image_ID); +void _gimp_image_thumbnail (gint32 image_ID, + gint width, + gint height, + gint *ret_width, + gint *ret_height, + gint *bpp, + gint *thumbnail_data_count, + guint8 **thumbnail_data); +void gimp_image_set_tattoo_state (gint32 image_ID, + gint tattoo); +gint gimp_image_get_tattoo_state (gint32 image_ID); +gint gimp_image_width (gint32 image_ID); +gint gimp_image_height (gint32 image_ID); +gint32 gimp_image_get_active_layer (gint32 image_ID); +void gimp_image_set_active_layer (gint32 image_ID, + gint32 active_layer_ID); +gint32 gimp_image_get_active_channel (gint32 image_ID); +void gimp_image_set_active_channel (gint32 image_ID, + gint32 active_channel_ID); +gint32 gimp_image_get_selection (gint32 image_ID); +gboolean gimp_image_get_component_active (gint32 image_ID, + GimpChannelType component); +void gimp_image_set_component_active (gint32 image_ID, + GimpChannelType component, + gboolean active); +gboolean gimp_image_get_component_visible (gint32 image_ID, + GimpChannelType component); +void gimp_image_set_component_visible (gint32 image_ID, + GimpChannelType component, + gboolean visible); +gchar* gimp_image_get_filename (gint32 image_ID); +void gimp_image_set_filename (gint32 image_ID, + gchar *filename); +void gimp_image_get_resolution (gint32 image_ID, + gdouble *xresolution, + gdouble *yresolution); +void gimp_image_set_resolution (gint32 image_ID, + gdouble xresolution, + gdouble yresolution); +GimpUnit gimp_image_get_unit (gint32 image_ID); +void gimp_image_set_unit (gint32 image_ID, + GimpUnit unit); +gint32 gimp_image_get_layer_by_tattoo (gint32 image_ID, + gint tattoo); +gint32 gimp_image_get_channel_by_tattoo (gint32 image_ID, + gint tattoo); #ifdef __cplusplus diff --git a/libgimp/gimpselection.c b/libgimp/gimpselection.c new file mode 100644 index 0000000000..689ebd0b07 --- /dev/null +++ b/libgimp/gimpselection.c @@ -0,0 +1,34 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpselection.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "gimp.h" + +gint32 +gimp_selection_float (gint32 image_ID, + gint32 drawable_ID, + gint offx, + gint offy) +{ + return _gimp_selection_float (drawable_ID, + offx, + offy); +} + diff --git a/libgimp/gimpselection.h b/libgimp/gimpselection.h new file mode 100644 index 0000000000..0d7a888006 --- /dev/null +++ b/libgimp/gimpselection.h @@ -0,0 +1,43 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpselection.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GIMP_SELECTION_H__ +#define __GIMP_SELECTION_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +gint32 gimp_selection_float (gint32 image_ID, + gint32 drawable_ID, + gint offx, + gint offy); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_SELECTION_H__ */ + diff --git a/libgimp/gimpselection_pdb.c b/libgimp/gimpselection_pdb.c index 76d8aa1f22..1d58e3b8f4 100644 --- a/libgimp/gimpselection_pdb.c +++ b/libgimp/gimpselection_pdb.c @@ -1,5 +1,5 @@ /* LIBGIMP - The GIMP Library - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball * * gimpselection_pdb.c * @@ -8,10 +8,10 @@ * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * - * This library is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the @@ -19,67 +19,41 @@ * Boston, MA 02111-1307, USA. */ +/* NOTE: This file is autogenerated by pdbgen.pl */ + #include "gimp.h" - -gint32 -gimp_selection_bounds (gint32 image_ID, - gint *non_empty, - gint *x1, - gint *y1, - gint *x2, - gint *y2) +gboolean +gimp_selection_bounds (gint32 image_ID, + gboolean *non_empty, + gint *x1, + gint *y1, + gint *x2, + gint *y2) { GParam *return_vals; gint nreturn_vals; - gint result; + gboolean success; return_vals = gimp_run_procedure ("gimp_selection_bounds", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); - result = FALSE; + success = FALSE; if (return_vals[0].data.d_status == STATUS_SUCCESS) { - result = TRUE; - *non_empty = return_vals[1].data.d_int32; + success = TRUE; + + *non_empty = return_vals[1].data.d_int32; *x1 = return_vals[2].data.d_int32; *y1 = return_vals[3].data.d_int32; *x2 = return_vals[4].data.d_int32; *y2 = return_vals[5].data.d_int32; } - gimp_destroy_params (return_vals, nreturn_vals); - return result; -} - -gint32 -gimp_selection_float (gint32 image_ID, - gint32 drawable_ID, - gint32 x_offset, - gint32 y_offset) -{ - GParam *return_vals; - gint nreturn_vals; - gint32 layer_ID; - - return_vals = gimp_run_procedure ("gimp_selection_float", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_DRAWABLE, drawable_ID, - PARAM_INT32, x_offset, - PARAM_INT32, y_offset, - PARAM_END); - - layer_ID = -1; - if (return_vals[0].data.d_status == STATUS_SUCCESS) - layer_ID = return_vals[1].data.d_layer; - - gimp_destroy_params (return_vals, nreturn_vals); - - return layer_ID; + return success; } gboolean @@ -87,21 +61,45 @@ gimp_selection_is_empty (gint32 image_ID) { GParam *return_vals; gint nreturn_vals; - gboolean is_empty; - + gboolean is_empty = TRUE; + return_vals = gimp_run_procedure ("gimp_selection_is_empty", &nreturn_vals, PARAM_IMAGE, image_ID, PARAM_END); - is_empty = TRUE; + if (return_vals[0].data.d_status == STATUS_SUCCESS) - is_empty = return_vals[1].data.d_int32 ? TRUE : FALSE; + is_empty = return_vals[1].data.d_int32; gimp_destroy_params (return_vals, nreturn_vals); return is_empty; } +gint32 +_gimp_selection_float (gint32 drawable_ID, + gint offx, + gint offy) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 layer_ID = -1; + + return_vals = gimp_run_procedure ("gimp_selection_float", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, offx, + PARAM_INT32, offy, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + layer_ID = return_vals[1].data.d_layer; + + gimp_destroy_params (return_vals, nreturn_vals); + + return layer_ID; +} + void gimp_selection_none (gint32 image_ID) { @@ -109,9 +107,9 @@ gimp_selection_none (gint32 image_ID) gint nreturn_vals; return_vals = gimp_run_procedure ("gimp_selection_none", - &nreturn_vals, - PARAM_IMAGE, image_ID, - PARAM_END); + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); gimp_destroy_params (return_vals, nreturn_vals); } diff --git a/libgimp/gimpselection_pdb.h b/libgimp/gimpselection_pdb.h index 6b244d6bb9..cbfc74c458 100644 --- a/libgimp/gimpselection_pdb.h +++ b/libgimp/gimpselection_pdb.h @@ -1,5 +1,5 @@ /* LIBGIMP - The GIMP Library - * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball * * gimpselection_pdb.h * @@ -7,17 +7,19 @@ * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. - */ + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ #ifndef __GIMP_SELECTION_PDB_H__ #define __GIMP_SELECTION_PDB_H__ @@ -29,18 +31,17 @@ extern "C" { /* For information look into the C source or the html documentation */ -gint32 gimp_selection_bounds (gint32 image_ID, - gint32 *non_empty, - gint32 *x1, - gint32 *y1, - gint32 *x2, - gint32 *y2); -gint32 gimp_selection_float (gint32 image_ID, - gint32 drawable_ID, - gint32 x_offset, - gint32 y_offset); -gint32 gimp_selection_is_empty (gint32 image_ID); -void gimp_selection_none (gint32 image_ID); +gboolean gimp_selection_bounds (gint32 image_ID, + gboolean *is_empty, + gint *x1, + gint *y1, + gint *x2, + gint *y2); +gboolean gimp_selection_is_empty (gint32 image_ID); +gint32 _gimp_selection_float (gint32 drawable_ID, + gint offx, + gint offy); +void gimp_selection_none (gint32 image_ID); #ifdef __cplusplus diff --git a/libgimp/gimptexttool_pdb.c b/libgimp/gimptexttool_pdb.c new file mode 100644 index 0000000000..ef200985f1 --- /dev/null +++ b/libgimp/gimptexttool_pdb.c @@ -0,0 +1,194 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimptexttool_pdb.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#include "gimp.h" + +gint32 +gimp_text_fontname (gint32 image_ID, + gint32 drawable_ID, + gdouble x, + gdouble y, + gchar *text, + gint border, + gboolean antialias, + gdouble size, + GimpSizeType size_type, + gchar *fontname) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 text_layer_ID = -1; + + return_vals = gimp_run_procedure ("gimp_text_fontname", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_DRAWABLE, drawable_ID, + PARAM_FLOAT, x, + PARAM_FLOAT, y, + PARAM_STRING, text, + PARAM_INT32, border, + PARAM_INT32, antialias, + PARAM_FLOAT, size, + PARAM_INT32, size_type, + PARAM_STRING, fontname, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + text_layer_ID = return_vals[1].data.d_layer; + + gimp_destroy_params (return_vals, nreturn_vals); + + return text_layer_ID; +} + +void +gimp_text_get_extents_fontname (gchar *text, + gdouble size, + GimpSizeType size_type, + gchar *fontname, + gint *width, + gint *height, + gint *ascent, + gint *descent) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_text_get_extents_fontname", + &nreturn_vals, + PARAM_STRING, text, + PARAM_FLOAT, size, + PARAM_INT32, size_type, + PARAM_STRING, fontname, + PARAM_END); + + *width = *height = *ascent = *descent = 0; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + { + *width = return_vals[1].data.d_int32; + *height = return_vals[2].data.d_int32; + *ascent = return_vals[3].data.d_int32; + *descent = return_vals[4].data.d_int32; + } + + gimp_destroy_params (return_vals, nreturn_vals); +} + +gint32 +gimp_text (gint32 image_ID, + gint32 drawable_ID, + gdouble x, + gdouble y, + gchar *text, + gint border, + gboolean antialias, + gdouble size, + GimpSizeType size_type, + gchar *foundry, + gchar *family, + gchar *weight, + gchar *slant, + gchar *set_width, + gchar *spacing, + gchar *registry, + gchar *encoding) +{ + GParam *return_vals; + gint nreturn_vals; + gint32 text_layer_ID = -1; + + return_vals = gimp_run_procedure ("gimp_text", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_DRAWABLE, drawable_ID, + PARAM_FLOAT, x, + PARAM_FLOAT, y, + PARAM_STRING, text, + PARAM_INT32, border, + PARAM_INT32, antialias, + PARAM_FLOAT, size, + PARAM_INT32, size_type, + PARAM_STRING, foundry, + PARAM_STRING, family, + PARAM_STRING, weight, + PARAM_STRING, slant, + PARAM_STRING, set_width, + PARAM_STRING, spacing, + PARAM_STRING, registry, + PARAM_STRING, encoding, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + text_layer_ID = return_vals[1].data.d_layer; + + gimp_destroy_params (return_vals, nreturn_vals); + + return text_layer_ID; +} + +void +gimp_text_get_extents (gchar *text, + gdouble size, + GimpSizeType size_type, + gchar *foundry, + gchar *family, + gchar *weight, + gchar *slant, + gchar *set_width, + gchar *spacing, + gchar *registry, + gchar *encoding, + gint *width, + gint *height, + gint *ascent, + gint *descent) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_text_get_extents", + &nreturn_vals, + PARAM_STRING, text, + PARAM_FLOAT, size, + PARAM_INT32, size_type, + PARAM_STRING, foundry, + PARAM_STRING, family, + PARAM_STRING, weight, + PARAM_STRING, slant, + PARAM_STRING, set_width, + PARAM_STRING, spacing, + PARAM_STRING, registry, + PARAM_STRING, encoding, + PARAM_END); + + *width = *height = *ascent = *descent = 0; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + { + *width = return_vals[1].data.d_int32; + *height = return_vals[2].data.d_int32; + *ascent = return_vals[3].data.d_int32; + *descent = return_vals[4].data.d_int32; + } + + gimp_destroy_params (return_vals, nreturn_vals); +} diff --git a/libgimp/gimptexttool_pdb.h b/libgimp/gimptexttool_pdb.h new file mode 100644 index 0000000000..594e9cb42f --- /dev/null +++ b/libgimp/gimptexttool_pdb.h @@ -0,0 +1,90 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimptexttool_pdb.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#ifndef __GIMP_TEXT_TOOL_PDB_H__ +#define __GIMP_TEXT_TOOL_PDB_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +gint32 gimp_text_fontname (gint32 image_ID, + gint32 drawable_ID, + gdouble x, + gdouble y, + gchar *text, + gint border, + gboolean antialias, + gdouble size, + GimpSizeType size_type, + gchar *fontname); +void gimp_text_get_extents_fontname (gchar *text, + gdouble size, + GimpSizeType size_type, + gchar *fontname, + gint *width, + gint *height, + gint *ascent, + gint *descent); +gint32 gimp_text (gint32 image_ID, + gint32 drawable_ID, + gdouble x, + gdouble y, + gchar *text, + gint border, + gboolean antialias, + gdouble size, + GimpSizeType size_type, + gchar *foundry, + gchar *family, + gchar *weight, + gchar *slant, + gchar *set_width, + gchar *spacing, + gchar *registry, + gchar *encoding); +void gimp_text_get_extents (gchar *text, + gdouble size, + GimpSizeType size_type, + gchar *foundry, + gchar *family, + gchar *weight, + gchar *slant, + gchar *set_width, + gchar *spacing, + gchar *registry, + gchar *encoding, + gint *width, + gint *height, + gint *ascent, + gint *descent); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_TEXT_TOOL_PDB_H__ */ diff --git a/libgimp/gimptools_pdb.c b/libgimp/gimptools_pdb.c new file mode 100644 index 0000000000..85ae5deff1 --- /dev/null +++ b/libgimp/gimptools_pdb.c @@ -0,0 +1,778 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimptools_pdb.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#include "gimp.h" + +void +gimp_airbrush (gint32 drawable_ID, + gdouble pressure, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_airbrush", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_FLOAT, pressure, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_airbrush_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_airbrush_default", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_blend (gint32 drawable_ID, + GimpBlendMode blend_mode, + GimpLayerModeEffects paint_mode, + GimpGradientType gradient_type, + gdouble opacity, + gdouble offset, + GimpRepeatMode repeat, + gboolean supersample, + gint max_depth, + gdouble threshold, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_blend", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, blend_mode, + PARAM_INT32, paint_mode, + PARAM_INT32, gradient_type, + PARAM_FLOAT, opacity, + PARAM_FLOAT, offset, + PARAM_INT32, repeat, + PARAM_INT32, supersample, + PARAM_INT32, max_depth, + PARAM_FLOAT, threshold, + PARAM_FLOAT, x1, + PARAM_FLOAT, y1, + PARAM_FLOAT, x2, + PARAM_FLOAT, y2, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_bucket_fill (gint32 drawable_ID, + GimpBucketFillMode fill_mode, + GimpLayerModeEffects paint_mode, + gdouble opacity, + gdouble threshold, + gboolean sample_merged, + gdouble x, + gdouble y) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_bucket_fill", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, fill_mode, + PARAM_INT32, paint_mode, + PARAM_FLOAT, opacity, + PARAM_FLOAT, threshold, + PARAM_INT32, sample_merged, + PARAM_FLOAT, x, + PARAM_FLOAT, y, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_by_color_select (gint32 drawable_ID, + guchar red, + guchar green, + guchar blue, + gint threshold, + GimpChannelOps operation, + gboolean antialias, + gboolean feather, + gdouble feather_radius, + gboolean sample_merged) +{ + GParam *return_vals; + gint nreturn_vals; + guchar color[3]; + + color[0] = red; + color[1] = green; + color[2] = blue; + + return_vals = gimp_run_procedure ("gimp_by_color_select", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_COLOR, color, + PARAM_INT32, threshold, + PARAM_INT32, operation, + PARAM_INT32, antialias, + PARAM_INT32, feather, + PARAM_FLOAT, feather_radius, + PARAM_INT32, sample_merged, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_clone (gint32 drawable_ID, + gint32 src_drawable_ID, + GimpCloneType clone_type, + gdouble src_x, + gdouble src_y, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_clone", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_DRAWABLE, src_drawable_ID, + PARAM_INT32, clone_type, + PARAM_FLOAT, src_x, + PARAM_FLOAT, src_y, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_clone_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_clone_default", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_color_picker (gint32 image_ID, + gint32 drawable_ID, + gdouble x, + gdouble y, + gboolean sample_merged, + gboolean sample_average, + gdouble average_radius, + gboolean save_color, + guchar *red, + guchar *green, + guchar *blue) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_color_picker", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_DRAWABLE, drawable_ID, + PARAM_FLOAT, x, + PARAM_FLOAT, y, + PARAM_INT32, sample_merged, + PARAM_INT32, sample_average, + PARAM_FLOAT, average_radius, + PARAM_INT32, save_color, + PARAM_END); + + if (return_vals[0].data.d_status == STATUS_SUCCESS) + { + *red = return_vals[1].data.d_color.red; + *green = return_vals[1].data.d_color.green; + *blue = return_vals[1].data.d_color.blue; + } + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_convolve (gint32 drawable_ID, + gdouble pressure, + GimpConvolveType convolve_type, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_convolve", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_FLOAT, pressure, + PARAM_INT32, convolve_type, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_convolve_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_convolve_default", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_crop (gint32 image_ID, + gint new_width, + gint new_height, + gint offx, + gint offy) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_crop", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_INT32, new_width, + PARAM_INT32, new_height, + PARAM_INT32, offx, + PARAM_INT32, offy, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_dodgeburn (gint32 drawable_ID, + gdouble exposure, + GimpDodgeBurnType dodgeburn_type, + GimpDodgeBurnMode dodgeburn_mode, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_dodgeburn", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_FLOAT, exposure, + PARAM_INT32, dodgeburn_type, + PARAM_INT32, dodgeburn_mode, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_dodgeburn_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_dodgeburn_default", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_ellipse_select (gint32 image_ID, + gdouble x, + gdouble y, + gdouble width, + gdouble height, + GimpChannelOps operation, + gboolean antialias, + gboolean feather, + gdouble feather_radius) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_ellipse_select", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_FLOAT, x, + PARAM_FLOAT, y, + PARAM_FLOAT, width, + PARAM_FLOAT, height, + PARAM_INT32, operation, + PARAM_INT32, antialias, + PARAM_INT32, feather, + PARAM_FLOAT, feather_radius, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_eraser (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes, + GimpBrushApplicationMode hardness, + GimpPaintApplicationMode method) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_eraser", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_INT32, hardness, + PARAM_INT32, method, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_eraser_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_eraser_default", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +gint32 +gimp_flip (gint32 drawable_ID, + GimpOrientationType flip_type) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_flip", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, flip_type, + PARAM_END); + + drawable_ID = -1; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + drawable_ID = return_vals[1].data.d_drawable; + + gimp_destroy_params (return_vals, nreturn_vals); + + return drawable_ID; +} + +void +gimp_free_select (gint32 image_ID, + gint num_segs, + gdouble *segs, + GimpChannelOps operation, + gboolean antialias, + gboolean feather, + gdouble feather_radius) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_free_select", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_INT32, num_segs, + PARAM_FLOATARRAY, segs, + PARAM_INT32, operation, + PARAM_INT32, antialias, + PARAM_INT32, feather, + PARAM_FLOAT, feather_radius, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_fuzzy_select (gint32 drawable_ID, + gdouble x, + gdouble y, + gint threshold, + GimpChannelOps operation, + gboolean antialias, + gboolean feather, + gdouble feather_radius, + gboolean sample_merged) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_fuzzy_select", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_FLOAT, x, + PARAM_FLOAT, y, + PARAM_INT32, threshold, + PARAM_INT32, operation, + PARAM_INT32, antialias, + PARAM_INT32, feather, + PARAM_FLOAT, feather_radius, + PARAM_INT32, sample_merged, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_paintbrush (gint32 drawable_ID, + gdouble fade_out, + gint num_strokes, + gdouble *strokes, + GimpPaintApplicationMode method, + gdouble gradient_length) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_paintbrush", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_FLOAT, fade_out, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_INT32, method, + PARAM_FLOAT, gradient_length, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_paintbrush_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_paintbrush_default", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_pencil (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_pencil", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +gint32 +gimp_perspective (gint32 drawable_ID, + gboolean interpolation, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gdouble x3, + gdouble y3) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_perspective", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, interpolation, + PARAM_FLOAT, x0, + PARAM_FLOAT, y0, + PARAM_FLOAT, x1, + PARAM_FLOAT, y1, + PARAM_FLOAT, x2, + PARAM_FLOAT, y2, + PARAM_FLOAT, x3, + PARAM_FLOAT, y3, + PARAM_END); + + drawable_ID = -1; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + drawable_ID = return_vals[1].data.d_drawable; + + gimp_destroy_params (return_vals, nreturn_vals); + + return drawable_ID; +} + +void +gimp_rect_select (gint32 image_ID, + gdouble x, + gdouble y, + gdouble width, + gdouble height, + GimpChannelOps operation, + gboolean feather, + gdouble feather_radius) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_rect_select", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_FLOAT, x, + PARAM_FLOAT, y, + PARAM_FLOAT, width, + PARAM_FLOAT, height, + PARAM_INT32, operation, + PARAM_INT32, feather, + PARAM_FLOAT, feather_radius, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +gint32 +gimp_rotate (gint32 drawable_ID, + gboolean interpolation, + gdouble angle) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_rotate", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, interpolation, + PARAM_FLOAT, angle, + PARAM_END); + + drawable_ID = -1; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + drawable_ID = return_vals[1].data.d_drawable; + + gimp_destroy_params (return_vals, nreturn_vals); + + return drawable_ID; +} + +gint32 +gimp_scale (gint32 drawable_ID, + gboolean interpolation, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_scale", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, interpolation, + PARAM_FLOAT, x0, + PARAM_FLOAT, y0, + PARAM_FLOAT, x1, + PARAM_FLOAT, y1, + PARAM_END); + + drawable_ID = -1; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + drawable_ID = return_vals[1].data.d_drawable; + + gimp_destroy_params (return_vals, nreturn_vals); + + return drawable_ID; +} + +gint32 +gimp_shear (gint32 drawable_ID, + gboolean interpolation, + GimpOrientationType shear_type, + gdouble magnitude) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_shear", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, interpolation, + PARAM_INT32, shear_type, + PARAM_FLOAT, magnitude, + PARAM_END); + + drawable_ID = -1; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + drawable_ID = return_vals[1].data.d_drawable; + + gimp_destroy_params (return_vals, nreturn_vals); + + return drawable_ID; +} + +void +gimp_smudge (gint32 drawable_ID, + gdouble pressure, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_smudge", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_FLOAT, pressure, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_smudge_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_smudge_default", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, num_strokes, + PARAM_FLOATARRAY, strokes, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +gint32 +gimp_transform_2d (gint32 drawable_ID, + gboolean interpolation, + gdouble source_x, + gdouble source_y, + gdouble scale_x, + gdouble scale_y, + gdouble angle, + gdouble dest_x, + gdouble dest_y) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_transform_2d", + &nreturn_vals, + PARAM_DRAWABLE, drawable_ID, + PARAM_INT32, interpolation, + PARAM_FLOAT, source_x, + PARAM_FLOAT, source_y, + PARAM_FLOAT, scale_x, + PARAM_FLOAT, scale_y, + PARAM_FLOAT, angle, + PARAM_FLOAT, dest_x, + PARAM_FLOAT, dest_y, + PARAM_END); + drawable_ID = -1; + if (return_vals[0].data.d_status == STATUS_SUCCESS) + drawable_ID = return_vals[1].data.d_drawable; + + gimp_destroy_params (return_vals, nreturn_vals); + + return drawable_ID; +} diff --git a/libgimp/gimptools_pdb.h b/libgimp/gimptools_pdb.h new file mode 100644 index 0000000000..a9aecd3444 --- /dev/null +++ b/libgimp/gimptools_pdb.h @@ -0,0 +1,216 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimptools_pdb.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#ifndef __GIMP_TOOLS_PDB_H__ +#define __GIMP_TOOLS_PDB_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +void gimp_airbrush (gint32 drawable_ID, + gdouble pressure, + gint num_strokes, + gdouble *strokes); +void gimp_airbrush_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes); +void gimp_blend (gint32 drawable_ID, + GimpBlendMode blend_mode, + GimpLayerModeEffects paint_mode, + GimpGradientType gradient_type, + gdouble opacity, + gdouble offset, + GimpRepeatMode repeat, + gboolean supersample, + gint max_depth, + gdouble threshold, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2); +void gimp_bucket_fill (gint32 drawable_ID, + GimpBucketFillMode fill_mode, + GimpLayerModeEffects paint_mode, + gdouble opacity, + gdouble threshold, + gboolean sample_merged, + gdouble x, + gdouble y); +void gimp_by_color_select (gint32 drawable_ID, + guchar red, + guchar green, + guchar blue, + gint threshold, + GimpChannelOps operation, + gboolean antialias, + gboolean feather, + gdouble feather_radius, + gboolean sample_merged); +void gimp_clone (gint32 drawable_ID, + gint32 src_drawable_ID, + GimpCloneType clone_type, + gdouble src_x, + gdouble src_y, + gint num_strokes, + gdouble *strokes); +void gimp_clone_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes); +void gimp_color_picker (gint32 image_ID, + gint32 drawable_ID, + gdouble x, + gdouble y, + gboolean sample_merged, + gboolean sample_average, + gdouble average_radius, + gboolean save_color, + guchar *red, + guchar *green, + guchar *blue); +void gimp_convolve (gint32 drawable_ID, + gdouble pressure, + GimpConvolveType convolve_type, + gint num_strokes, + gdouble *strokes); +void gimp_convolve_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes); +void gimp_crop (gint32 image_ID, + gint new_width, + gint new_height, + gint offx, + gint offy); +void gimp_dodgeburn (gint32 drawable_ID, + gdouble exposure, + GimpDodgeBurnType dodgeburn_type, + GimpDodgeBurnMode dodgeburn_mode, + gint num_strokes, + gdouble *strokes); +void gimp_dodgeburn_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes); +void gimp_ellipse_select (gint32 image_ID, + gdouble x, + gdouble y, + gdouble width, + gdouble height, + GimpChannelOps operation, + gboolean antialias, + gboolean feather, + gdouble feather_radius); +void gimp_eraser (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes, + GimpBrushApplicationMode hardness, + GimpPaintApplicationMode method); +void gimp_eraser_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes); +gint32 gimp_flip (gint32 drawable_ID, + GimpOrientationType flip_type); +void gimp_free_select (gint32 image_ID, + gint num_segs, + gdouble *segs, + GimpChannelOps operation, + gboolean antialias, + gboolean feather, + gdouble feather_radius); +void gimp_fuzzy_select (gint32 drawable_ID, + gdouble x, + gdouble y, + gint threshold, + GimpChannelOps operation, + gboolean antialias, + gboolean feather, + gdouble feather_radius, + gboolean sample_merged); +void gimp_paintbrush (gint32 drawable_ID, + gdouble fade_out, + gint num_strokes, + gdouble *strokes, + GimpPaintApplicationMode method, + gdouble gradient_length); +void gimp_paintbrush_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes); +void gimp_pencil (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes); +gint32 gimp_perspective (gint32 drawable_ID, + gboolean interpolation, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2, + gdouble x3, + gdouble y3); +void gimp_rect_select (gint32 image_ID, + gdouble x, + gdouble y, + gdouble width, + gdouble height, + GimpChannelOps operation, + gboolean feather, + gdouble feather_radius); +gint32 gimp_rotate (gint32 drawable_ID, + gboolean interpolation, + gdouble angle); +gint32 gimp_scale (gint32 drawable_ID, + gboolean interpolation, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1); +gint32 gimp_shear (gint32 drawable_ID, + gboolean interpolation, + GimpOrientationType shear_type, + gdouble magnitude); +void gimp_smudge (gint32 drawable_ID, + gdouble pressure, + gint num_strokes, + gdouble *strokes); +void gimp_smudge_default (gint32 drawable_ID, + gint num_strokes, + gdouble *strokes); +gint32 gimp_transform_2d (gint32 drawable_ID, + gboolean interpolation, + gdouble source_x, + gdouble source_y, + gdouble scale_x, + gdouble scale_y, + gdouble angle, + gdouble dest_x, + gdouble dest_y); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_TOOLS_PDB_H__ */ diff --git a/libgimp/gimpundo_pdb.c b/libgimp/gimpundo_pdb.c new file mode 100644 index 0000000000..2950fc415f --- /dev/null +++ b/libgimp/gimpundo_pdb.c @@ -0,0 +1,52 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpundo_pdb.c + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#include "gimp.h" + +void +gimp_undo_push_group_start (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_undo_push_group_start", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} + +void +gimp_undo_push_group_end (gint32 image_ID) +{ + GParam *return_vals; + gint nreturn_vals; + + return_vals = gimp_run_procedure ("gimp_undo_push_group_end", + &nreturn_vals, + PARAM_IMAGE, image_ID, + PARAM_END); + + gimp_destroy_params (return_vals, nreturn_vals); +} diff --git a/libgimp/gimpundo_pdb.h b/libgimp/gimpundo_pdb.h new file mode 100644 index 0000000000..c8dd393e30 --- /dev/null +++ b/libgimp/gimpundo_pdb.h @@ -0,0 +1,42 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball + * + * gimpundo_pdb.h + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* NOTE: This file is autogenerated by pdbgen.pl */ + +#ifndef __GIMP_UNDO_PDB_H__ +#define __GIMP_UNDO_PDB_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* For information look into the C source or the html documentation */ + + +void gimp_undo_push_group_start (gint32 image_ID); +void gimp_undo_push_group_end (gint32 image_ID); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __GIMP_UNDO_PDB_H__ */ diff --git a/plug-ins/common/CEL.c b/plug-ins/common/CEL.c index bc9d728c0b..51aa4bfded 100644 --- a/plug-ins/common/CEL.c +++ b/plug-ins/common/CEL.c @@ -517,7 +517,7 @@ save_image (gchar *file, header[4]= 0x20; /* Work out whether to save as 8bit or 4bit */ - gimp_image_get_cmap (image, &colours); + g_free (gimp_image_get_cmap (image, &colours)); if (colours > 15) { header[5] = 8; diff --git a/plug-ins/common/aa.c b/plug-ins/common/aa.c index 960c5c4249..f0fb925929 100644 --- a/plug-ins/common/aa.c +++ b/plug-ins/common/aa.c @@ -42,8 +42,6 @@ static void gimp2aa (gint32 image, aa_context *context); static gint type_dialog (int selected); -static void type_dialog_ok_callback (GtkWidget *widget, - gpointer data); static void type_dialog_toggle_update (GtkWidget *widget, gpointer data); static void type_dialog_cancel_callback (GtkWidget *widget, diff --git a/po/ChangeLog b/po/ChangeLog index cbc65a5e44..b83b5320b9 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,7 @@ +2000-06-01 Sven Neumann + + * POTFILES.in: s/gimage_cmds/image_cmds/ + 2000-05-31 Shirasaki Yasuhiro * ja.po: Updated translation. diff --git a/po/POTFILES.in b/po/POTFILES.in index 0e9973ba27..98c4cef927 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -42,7 +42,6 @@ app/fuzzy_select.c app/gdisplay.c app/gdisplay_color_ui.c app/gdisplay_ops.c -app/gimage_cmds.c app/gimage_mask.c app/gimpbrush.c app/gimpbrushlist.c @@ -59,6 +58,7 @@ app/gradient.c app/gradient_select.c app/histogram_tool.c app/hue_saturation.c +app/image_cmds.c app/image_new.c app/indicator_area.c app/info_dialog.c diff --git a/tools/pdbgen/Makefile.am b/tools/pdbgen/Makefile.am index 8309d335f3..27942025b3 100644 --- a/tools/pdbgen/Makefile.am +++ b/tools/pdbgen/Makefile.am @@ -8,18 +8,17 @@ pdb_sources = \ pdb/channel_ops.pdb \ pdb/color.pdb \ pdb/convert.pdb \ + pdb/display.pdb \ pdb/drawable.pdb \ pdb/edit.pdb \ pdb/fileops.pdb \ pdb/floating_sel.pdb \ - pdb/gdisplay.pdb \ - pdb/gimage.pdb \ - pdb/gimage_mask.pdb \ pdb/gimprc.pdb \ pdb/gradient.pdb \ pdb/gradient_select.pdb \ pdb/guides.pdb \ pdb/help.pdb \ + pdb/image.pdb \ pdb/layer.pdb \ pdb/message.pdb \ pdb/misc.pdb \ @@ -30,6 +29,7 @@ pdb_sources = \ pdb/patterns.pdb \ pdb/plug_in.pdb \ pdb/procedural_db.pdb \ + pdb/selection.pdb \ pdb/text_tool.pdb \ pdb/tools.pdb \ pdb/undo.pdb \ diff --git a/tools/pdbgen/groups.pl b/tools/pdbgen/groups.pl index eec1b82415..ca14326152 100644 --- a/tools/pdbgen/groups.pl +++ b/tools/pdbgen/groups.pl @@ -6,18 +6,17 @@ channel_ops color convert + display drawable edit fileops floating_sel - gdisplay - gimage - gimage_mask gimprc gradient gradient_select guides help + image layer message misc @@ -28,6 +27,7 @@ patterns plug_in procedural_db + selection text_tool tools undo diff --git a/tools/pdbgen/pdb/channel_ops.pdb b/tools/pdbgen/pdb/channel_ops.pdb index e9a9feab7a..24841bfa20 100644 --- a/tools/pdbgen/pdb/channel_ops.pdb +++ b/tools/pdbgen/pdb/channel_ops.pdb @@ -87,7 +87,7 @@ CODE } @procs = qw(channel_ops_offset channel_ops_duplicate); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Channel Ops'; diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb index 78ebb082fa..851df7d0bd 100644 --- a/tools/pdbgen/pdb/color.pdb +++ b/tools/pdbgen/pdb/color.pdb @@ -765,7 +765,7 @@ CODE @procs = qw(brightness_contrast levels posterize desaturate equalize invert curves_spline curves_explicit color_balance histogram hue_saturation threshold); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Color'; diff --git a/tools/pdbgen/pdb/edit.pdb b/tools/pdbgen/pdb/edit.pdb index 819ddf499c..40c82bdc36 100644 --- a/tools/pdbgen/pdb/edit.pdb +++ b/tools/pdbgen/pdb/edit.pdb @@ -168,7 +168,7 @@ HELP $extra{app}->{decls} = "extern TileManager *global_buf;\n"; @procs = qw(edit_cut edit_copy edit_paste edit_clear edit_fill edit_stroke); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Edit procedures'; diff --git a/tools/pdbgen/pdb/floating_sel.pdb b/tools/pdbgen/pdb/floating_sel.pdb index 62faef330b..8bf8b83684 100644 --- a/tools/pdbgen/pdb/floating_sel.pdb +++ b/tools/pdbgen/pdb/floating_sel.pdb @@ -147,7 +147,7 @@ HELP @procs = qw(floating_sel_remove floating_sel_anchor floating_sel_to_layer floating_sel_attach floating_sel_rigor floating_sel_relax); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Floating selections'; diff --git a/tools/pdbgen/pdb/gdisplay.pdb b/tools/pdbgen/pdb/gdisplay.pdb deleted file mode 100644 index 783a24d988..0000000000 --- a/tools/pdbgen/pdb/gdisplay.pdb +++ /dev/null @@ -1,94 +0,0 @@ -# The GIMP -- an image manipulation program -# Copyright (C) 1995 Spencer Kimball and Peter Mattis - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# "Perlized" from C source by Manish Singh - -# The defs - -sub display_new { - $blurb = 'Create a new display for the specified image.'; - - $help = <<'HELP'; -Creates a new display for the specified image. If the image already has a -display, another is added. Multiple displays are handled transparently by the -GIMP. The newly created display is returned and can be subsequently destroyed -with a call to 'gimp-display-delete'. This procedure only makes sense for use -with the GIMP UI. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'display', type => 'display', - desc => 'The new display', alias => 'gdisp', init => 1 } - ); - - %invoke = ( - vars => [ 'guint scale = 0x101' ], - code => <<'CODE' -{ - if (gimage->layers) - success = (gdisp = gdisplay_new (gimage, scale)) != NULL; - else - success = FALSE; -} -CODE - ); -} - -sub display_delete { - $blurb = 'Delete the specified display.'; - - $help = <<'HELP'; -This procedure removes the specified display. If this is the last remaining -display for the underlying image, then the image is deleted also. -HELP - - &std_pdb_misc; - - @inargs = ( - { name => 'display', type => 'display', - desc => 'The display to delete', alias => 'gdisp' } - ); - - %invoke = ( code => 'gtk_widget_destroy (gdisp->shell);' ); -} - -sub displays_flush { - $blurb = 'Flush all internal changes to the user interface'; - - $help = <<'HELP'; -This procedure takes no arguments and returns nothing except a success status. -Its purpose is to flush all pending updates of image manipulations to the user -interface. It should be called whenever appropriate. -HELP - - &std_pdb_misc; - - %invoke = ( code => 'gdisplays_flush ();' ); -} - -@headers = qw("gdisplay.h"); - -@procs = qw(display_new display_delete displays_flush); -%exports = (app => [@procs], lib => [@procs]); - -$desc = 'GDisplay procedures'; - -1; diff --git a/tools/pdbgen/pdb/gimage.pdb b/tools/pdbgen/pdb/gimage.pdb deleted file mode 100644 index 32a2a7db69..0000000000 --- a/tools/pdbgen/pdb/gimage.pdb +++ /dev/null @@ -1,1461 +0,0 @@ -# The GIMP -- an image manipulation program -# Copyright (C) 1995 Spencer Kimball and Peter Mattis - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# "Perlized" from C source by Manish Singh - -sub layer_arg () {{ - name => 'layer', - type => 'layer', - desc => 'The layer' -}} - -sub channel_arg () {{ - name => 'channel', - type => 'channel', - desc => 'The channel' -}} - -sub new_dim_args { - foreach (qw(width height)) { - push @inargs, { name => "new_$_", type => '0 < int32', - desc => "New image $_: %%desc%%" } - } -} - -sub image_list_proc { - my $type = shift; - - $blurb = "Returns the list of ${type}s contained in the specified image."; - - $help = < "${type}_ids", type => 'int32array', init => 1, - desc => "The list of ${type}s contained in the image", - array => { name => "num_${type}s", init => 1, - desc => "The number of ${type}s contained in the image" } } - ); - - %invoke = ( - vars => [ 'GSList *list = NULL', 'int i' ], - code => <${type}s; - num_${type}s = g_slist_length (list); - - if (num_${type}s) - { - ${type}_ids = g_new (gint32, num_${type}s); - for (i = 0; i < num_${type}s; i++, list = list->next) - ${type}_ids[i] = drawable_ID (GIMP_DRAWABLE (list->data)); - } -} -CODE - ); -} - -sub type_move { - my ($type, $op, $pos) = @_; - my $extra = ""; - - if ($op =~ /_/) { - ($op, $extra) = $op =~ /([^_]+)_(.*)/; - $extra =~ s/_/ /g; - } - - my $layer = ""; - $layer = ', or the layer has no alpha channel' if $type eq 'layer'; - - $blurb = "\u$op the specified $type in the image's $type stack"; - $blurb .= " $extra of stack" if $extra; - - $help = <{desc} .= " to $op $extra"; - - if ($extra) { - $extra =~ s/ /_/g; - $extra = "_$extra"; - } - - %invoke = ( - code => "success = gimage_${op}_$type$extra (gimage, $type) != NULL;" - ); -} - -sub image_get_prop_proc { - my ($prop, $type, $desc, $func) = @_; - - $blurb = "Returns if the specified image's $desc."; - - $help = "This procedure returns if the specified image's $desc. "; - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => $prop, type => $type, - desc => "The $desc", no_declare => 1 } - ); - - my $alias = $func ? "gimage_get_$prop (gimage)" : "gimage->$prop"; - $alias = "g_strdup ($alias)" if $type eq 'string'; - $outargs[0]->{alias} .= "$alias"; - - if ($type eq 'color') { - $outargs[0]->{init} = 1; - delete @{$outargs[0]}{qw(alias no_declare)}; - - $invoke{headers} = [ qw("gimpimage.h") ]; - - $invoke{code} = "{\n color = g_new (guchar, 3);\n"; - foreach (map { "${_}_PIX" } qw(RED GREEN BLUE)) { - $invoke{code} .= " $prop\[$_] = image->col[$_];\n"; - } - $invoke{code} .= "}\n"; - } -} - -sub image_set_prop_proc { - my ($prop, $type, $desc, $func) = @_; - - $blurb = "Sets if the specified image's $desc."; - - $help = "This procedure sets if the specified image's $desc. "; - - &std_pdb_misc; - - @inargs = ( - &std_image_arg, - { name => $prop, type => $type, - desc => "The new image $desc" } - ); - - if ($type =~ /float/) { - $inargs[1]->{desc} .= ' (%%desc%%)'; - } - - $invoke{code} = $func ? "gimage_set_$prop (gimage, $prop);" - : "gimage->$prop = $prop;"; - - if ($type eq 'color') { - %invoke = ( - vars => [ 'int i' ], - code => <col[i] = $prop\[i]; -CODE - ); - } -} - -sub image_accessors { - my ($prop, $type, $desc, $func, $extra) = @_; - my (@extra, %extra); my $once = 0; - - ref($extra) ? (@extra = @$extra) : (@extra = ($extra, $extra)); - %extra = map { $once++ ? 'set' : 'get', $_ ? $_ : "" } @extra; - - foreach (sort keys %extra) { - my $proc = "image_${_}_$prop"; - - push @procs, $proc; - - eval <{desc}, $outargs[0]->{array}->{desc}) { - s/contained.*/currently open/ - } - - $blurb .= '.'; - $help .= ' in the GIMP.'; - - for ($invoke{code}) { - s/list = .*$/gimage_foreach (gimlist_cb, &list);/m; - s/DRAWABLE/IMAGE/; - s/drawable_ID/pdb_image_to_id/; - } -} - -sub image_new { - $blurb = 'Creates a new image with the specified width, height, and type.'; - - $help = <<'HELP'; -Creates a new image, undisplayed with the specified extents and type. A layer -should be created and added before this image is displayed, or subsequent calls -to 'gimp_display_new' with this image as an argument will fail. Layers can be -created using the 'gimp_layer_new' commands. They can be added to an image -using the 'gimp_image_add_layer' command. -HELP - - &std_pdb_misc; - - @inargs = ( - { name => 'type', type => 'enum GimpImageBaseType', - desc => 'The type of image: { %%desc%% }' } - ); - - foreach (qw(height width)) { - unshift @inargs, { name => $_, type => '0 < int32', - desc => "The $_ of the image" } - } - - @outargs = ( - { name => 'image', type => 'image', alias => 'gimage', init => 1, - desc => 'The ID of the newly created image' } - ); - - %invoke = ( - code => <<'CODE' -success = (gimage = gimage_new (width, height, type)) != NULL; -CODE - ); -} - -sub image_resize { - $blurb = 'Resize the image to the specified extents.'; - - $help = <<'HELP'; -This procedure resizes the image so that it's new width and height are equal to -the supplied parameters. Offsets are also provided which describe the position -of the previous image's content. No bounds checking is currently provided, so -don't supply parameters that are out of bounds. All channels within the image -are resized according to the specified parameters; this includes the image -selection mask. All layers within the image are repositioned according to the -specified offsets. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - &new_dim_args; - - foreach (qw(x y)) { - push @inargs, { name => "off$_", type => 'int32', - desc => "$_ offset between upper left corner of old and - new images: (new - old)" } - } - - %invoke = ( - headers => [ qw("cursorutil.h") ], - code => <<'CODE' -{ - gimp_add_busy_cursors_until_idle (); - gimage_resize (gimage, new_width, new_height, offx, offy); -} -CODE - ); -} - -sub image_scale { - $blurb = 'Scale the image to the specified extents.'; - - $help = <<'HELP'; -This procedure scales the image so that it's new width and height are equal to -the supplied parameters. Offsets are also provided which describe the position -of the previous image's content. No bounds checking is currently provided, so -don't supply parameters that are out of bounds. All channels within the image -are scaled according to the specified parameters; this includes the image -selection mask. All layers within the image are repositioned according to the -specified offsets. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - &new_dim_args; - - %invoke = ( - code => <<'CODE' -{ - gimp_add_busy_cursors_until_idle (); - gimage_scale (gimage, new_width, new_height); -} -CODE - ); -} - -sub image_delete { - $blurb = 'Delete the specified image.'; - - $help = <<'HELP'; -If there are no displays associated with this image it will be deleted. -This means that you can not delete an image through the PDB that was -created by the user. If the associated display was however created -through the PDB and you know the display ID, you may delete the display. -Removal of the last associated display will then delete the image. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - %invoke = ( code => 'gimage_delete (gimage);' ); -} - -sub image_free_shadow { - $blurb = "Free the specified image's shadow data (if it exists)."; - - $help = <<'HELP'; -This procedure is intended as a memory saving device. If any shadow memory has -been allocated, it will be freed automatically on a call to -'gimp_image_delete'. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - %invoke = ( code => 'gimage_free_shadow (gimage);' ); -} - -sub image_get_layers { - &image_list_proc('layer'); - - $help .= 'The order of layers is from topmost to bottommost.'; -} - -sub image_get_channels { - &image_list_proc('channel'); - - $help .= <<'HELP'; -This does not include the selection mask, or layer masks. The order is from -topmost to bottommost. -HELP -} - -sub image_unset_active_channel { - $blurb = 'Unsets the active channel in the specified image.'; - - $help = <<'HELP'; -If an active channel exists, it is unset. There then exists no active channel, -and if desired, one can be set through a call to 'Set Active Channel'. No error -is returned in the case of no existing active channel. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - %invoke = ( code => 'gimage_unset_active_channel (gimage);' ); -} - -sub image_pick_correlate_layer { - $blurb = 'Find the layer visible at the specified coordinates.'; - - $help = <<'HELP'; -This procedure finds the layer which is visible at the specified coordinates. -Layers which do not qualify are those whose extents do not pass within the -specified coordinates, or which are transparent at the specified coordinates. -This procedure will return -1 if no layer is found. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - foreach (qw(x y)) { - push @inargs, { name => $_, type => 'int32', - desc => "The $_ coordinate for the pick" } - } - - @outargs = ( - { name => 'layer', type => 'layer', init => 1, - desc => 'The layer found at the specified coordinates' } - ); - - %invoke = ( - code => 'layer = gimage_pick_correlate_layer (gimage, x, y);' - ); -} - -sub image_raise_layer { - &type_move('layer', 'raise', 'above'); - &std_pdb_misc; -} - -sub image_lower_layer { - &type_move('layer', 'lower', 'below'); - &std_pdb_misc; -} - -sub image_raise_layer_to_top { - &type_move('layer', 'raise_to_top', 'above'); - $copyright = "Wolfgang Hofer"; - $author = $copyright . ", Sven Neumann"; - $date = 1998; -} - -sub image_lower_layer_to_bottom { - &type_move('layer', 'lower_to_bottom', 'below'); - $copyright = "Wolfgang Hofer"; - $author = $copyright . ", Sven Neumann"; - $date = 1998; -} - -sub image_merge_visible_layers { - $blurb = 'Merge the visible image layers into one.'; - - $help = <<'HELP'; -This procedure combines the visible layers into a single layer using the -specified merge type. A merge type of EXPAND_AS_NECESSARY expands the final -layer to encompass the areas of the visible layers. A merge type of -CLIP_TO_IMAGE clips the final layer to the extents of the image. A merge type -of CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the bottommost -layer. -HELP - - &std_pdb_misc; - - @inargs = ( - &std_image_arg, - { name => 'merge_type', type => 'enum MergeType (no FLATTEN_IMAGE)', - desc => 'The type of merge: { %%desc%% }' } - ); - - @outargs = ( - { name => 'layer', type => 'layer', init => 1, - desc => 'The resulting layer' } - ); - - %invoke = ( - code => <<'CODE' -{ - layer = gimage_merge_visible_layers (gimage, merge_type); - success = layer != NULL; -} -CODE - ); -} - -sub image_merge_down { - $blurb = 'Merge the layer passed and the first visible layer below.'; - - $help = <<'HELP'; -This procedure combines the passed layer and the first visible layer below it -using the specified merge type. A merge type of EXPAND_AS_NECESSARY expands the -final layer to encompass the areas of the visible layers. A merge type of -CLIP_TO_IMAGE clips the final layer to the extents of the image. A merge type -of CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the bottommost -layer. -HELP - - $author = $copyright = 'Larry Ewing'; - $date = '1998'; - - @inargs = ( - &std_image_arg, - { name => 'merge_layer', type => 'layer', - desc => 'The layer to merge down from' }, - { name => 'merge_type', type => 'enum MergeType (no FLATTEN_IMAGE)', - desc => 'The type of merge: { %%desc%% }' } - ); - - @outargs = ( - { name => 'layer', type => 'layer', init => 1, - desc => 'The resulting layer' } - ); - - %invoke = ( - code => <<'CODE' -{ - layer = gimp_image_merge_down (gimage, merge_layer, merge_type); - success = layer != NULL; -} -CODE - ); -} - -sub image_flatten { - $blurb = <<'BLURB'; -Flatten all visible layers into a single layer. Discard all invisible layers. -BLURB - - $help = <<'HELP'; -This procedure combines the visible layers in a manner analogous to merging -with the CLIP_TO_IMAGE merge type. Non-visible layers are discarded, and the -resulting image is stripped of its alpha channel. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'layer', type => 'layer', init => 1, - desc => 'The resulting layer' } - ); - - %invoke = ( - code => 'success = (layer = gimage_flatten (gimage)) != NULL;' - ); -} - -sub image_add_layer { - $blurb = 'Add the specified layer to the image.'; - - $help = <<'HELP'; -This procedure adds the specified layer to the gimage at the given position. If -the position is specified as -1, then the layer is inserted at the top of the -layer stack. If the layer to be added has no alpha channel, it must be added at -position 0. The layer type must be compatible with the image base type. -HELP - - &std_pdb_misc; - - @inargs = ( - &std_image_arg, - &layer_arg, - { name => 'position', type => 'int32', - desc => 'The layer position' } - ); - - $invoke{code} = "{\n if ("; my $once = 0; - foreach (qw(color gray indexed)) { - my $base = $_ eq 'color' ? 'RGB' : uc($_); - $invoke{code} .= ' ' x 6 if $once++; - $invoke{code} .= < 'gimage_remove_layer (gimage, layer);' ); -} - -sub image_add_layer_mask { - $blurb = 'Add a layer mask to the specified layer.'; - - $help = <<'HELP'; -This procedure adds a layer mask to the specified layer. Layer masks serve as -an additional alpha channel for a layer. This procedure will fail if a number -of prerequisites aren't met. The layer cannot already have a layer mask. The -specified mask must exist and have the same dimensions as the layer. Both the -mask and the layer must have been created for use with the specified image. -HELP - - &std_pdb_misc; - - @inargs = ( - &std_image_arg, - &layer_arg, - { name => 'mask', type => 'layer_mask', - desc => 'The mask to add to the layer' } - ); - $inargs[1]->{desc} .= ' to receive the mask'; - - %invoke = ( - code => <<'CODE' -success = gimage_add_layer_mask (gimage, layer, mask) != NULL; -CODE - ); -} - -sub image_remove_layer_mask { - $blurb = 'Remove the specified layer mask from the layer.'; - - $help = <<'HELP'; -This procedure removes the specified layer mask from the layer. If the mask -doesn't exist, an error is returned. -HELP - - &std_pdb_misc; - - @inargs = ( - &std_image_arg, - &layer_arg, - { name => 'mode', type => 'enum MaskApplyMode', - desc => 'Removal mode: { %%desc%% }' } - ); - $inargs[1]->{desc} .= ' from which to remove mask'; - - %invoke = ( code => 'gimage_remove_layer_mask (gimage, layer, mode);' ); -} - -sub image_raise_channel { - &type_move('channel', 'raise', 'above'); - &std_pdb_misc; -} - -sub image_lower_channel { - &type_move('layer', 'lower', 'below'); - &std_pdb_misc; -} - -sub image_add_channel { - $blurb = 'Add the specified channel to the image.'; - - $help = <<'HELP'; -This procedure adds the specified channel to the image. The position channel is -not currently used, so the channel is always inserted at the top of the channel -stack. -HELP - - &std_pdb_misc; - - @inargs = ( - &std_image_arg, - &channel_arg, - { name => 'position', type => 'int32', - desc => 'The channel position' } - ); - - %invoke = ( - code => <<'CODE' -success = gimage_add_channel (gimage, channel, MAX (position, -1)) != NULL; -CODE - ); -} - -sub image_remove_channel { - $blurb = 'Remove the specified channel from the image.'; - - $help = <<'HELP'; -This procedure removes the specified channel from the image. If the channel -doesn't exist, an error is returned. -HELP - - &std_pdb_misc; - - @inargs = ( - &std_image_arg, - &channel_arg - ); - - %invoke = ( code => 'gimage_remove_channel (gimage, channel);' ); -} - -sub image_active_drawable { - $blurb = "Get the image's active drawable"; - - $help = <<'HELP'; -This procedure returns the ID of the image's active drawable. This can be -either a layer, a channel, or a layer mask. The active drawable is specified by -the active image channel. If that is -1, then by the active image layer. If the -active image layer has a layer mask and the layer mask is in edit mode, then -the layer mask is the active drawable. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'drawable', type => 'drawable', init => 1, - desc => 'The active drawable' } - ); - - %invoke = ( - code => <<'CODE' -success = (drawable = gimage_active_drawable (gimage)) != NULL; -CODE - ); -} - -sub image_base_type { - $blurb = 'Get the base type of the image.'; - - $help = <<'HELP'; -This procedure returns the image's base type. Layers in the image must be of -this subtype, but can have an optional alpha channel. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'base_type', type => 'enum GimpImageBaseType', init => 1, - desc => "The image's base type: { %%desc%% }" } - ); - - %invoke = ( code => 'base_type = gimage_base_type (gimage);' ); -} - -sub image_get_cmap { - $blurb = "Returns the image's colormap"; - - $help = <<'HELP'; -This procedure returns an actual pointer to the image's colormap, as well as -the number of bytes contained in the colormap. The actual number of colors in -the transmitted colormap will be "num_bytes" / 3. If the image is not of base -type INDEXED, this pointer will be NULL. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'cmap', type => 'int8array', init => 1, - desc => "The image's colormap", - array => { name => 'num_bytes', init => 1, - desc => 'Number of bytes in the colormap array: - %%desc%%' } } - ); - - %invoke = ( - code => <<'CODE' -{ - num_bytes = gimage->num_cols * 3; - cmap = g_new (guint8, num_bytes); - memcpy (cmap, gimage_cmap (gimage), num_bytes); -} -CODE - ); -} - -sub image_set_cmap { - $blurb = "Sets the entries in the image's colormap."; - - $help = <<'HELP'; -This procedure sets the entries in the specified image's colormap. The number -of entries is specified by the "num_bytes" parameter and corresponds to the -number of INT8 triples that must be contained in the "cmap" array. The actual -number of colors in the transmitted colormap is "num_bytes" / 3. -HELP - - &std_pdb_misc; - - @inargs = ( - &std_image_arg, - { name => 'cmap', type => 'int8array', - desc => "The new colormap values", - array => { name => 'num_bytes', type => '0 <= int32 <= 768', - desc => 'Number of bytes in the colormap array: - %%desc%%' } } - ); - - %invoke = ( - headers => [ qw("gdisplay.h") ], - code => <<'CODE' -{ - if (gimage->cmap) - { - g_free (gimage->cmap); - gimage->cmap = NULL; - } - if (num_bytes) - { - gimage->cmap = g_new (guchar, COLORMAP_SIZE); - memcpy (gimage->cmap, cmap, num_bytes); - } - gimage->num_cols = num_bytes / 3; - - /* A colormap alteration affects the whole image */ - gdisplays_update_area (gimage, 0, 0, gimage->width, gimage->height); -} -CODE - ); -} - -sub image_undo_is_enabled { - $blurb = "Check if the image's undo stack is enabled."; - - $help = <<'HELP'; -This procedure checks if the image's undo stack is currently enabled or -disabled. This is useful when several plugins or scripts call each other -and want to check if their caller has already used 'gimp_image_undo_disable' -or 'gimp_image_undo_freeze'. -HELP - - $author = $copyright = 'Raphael Quinet'; - $date = '1999'; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'enabled', type => 'boolean', init => 1, - desc => 'True if undo is enabled for this image' } - ); - - %invoke = ( code => 'enabled = gimp_image_undo_is_enabled (gimage);' ); -} - -sub image_undo_enable { - $blurb = "Enable the image's undo stack."; - - $help = <<'HELP'; -This procedure enables the image's undo stack, allowing subsequent operations -to store their undo steps. This is generally called in conjunction with -'gimp_image_undo_disable' to temporarily disable an image undo stack. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'enabled', type => 'boolean', - desc => 'True if the image undo has been enabled', - alias => 'success ? TRUE : FALSE', no_declare => 1 } - ); - - %invoke = ( code => 'success = gimage_enable_undo (gimage);' ); -} - -sub image_undo_disable { - $blurb = "Disable the image's undo stack."; - - $help = <<'HELP'; -This procedure disables the image's undo stack, allowing subsequent operations -to ignore their undo steps. This is generally called in conjunction with -'gimp_image_undo_enable' to temporarily disable an image undo stack. This is -advantageous because saving undo steps can be time and memory intensive. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'disabled', type => 'boolean', - desc => 'True if the image undo has been disabled', - alias => 'success ? TRUE : FALSE', no_declare => 1 } - ); - - %invoke = ( code => 'success = gimage_disable_undo (gimage);' ); -} - -sub image_undo_thaw { - $blurb = "Thaw the image's undo stack."; - - $author = $copyright = 'Adam D. Moss'; - $date = '1999'; - - $help = <<'HELP'; -This procedure thaws the image's undo stack, allowing subsequent operations to -store their undo steps. This is generally called in conjunction with -'gimp_image_undo_freeze' to temporarily freeze an image undo stack. -'gimp_image_undo_thaw' does NOT free the undo stack as -'gimp_image_undo_enable' does, so is suited for situations where one wishes to -leave the undo stack in the same state in which one found it despite -non-destructively playing with the image in the meantime. An example would be -in-situ plugin previews. Balancing freezes and thaws and ensuring image -consistancy is the responsibility of the caller. -HELP - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'thawed', type => 'boolean', - desc => 'True if the image undo has been thawed', - alias => 'success ? TRUE : FALSE', no_declare => 1 } - ); - - %invoke = ( code => 'success = gimage_thaw_undo (gimage);' ); -} - -sub image_undo_freeze { - $blurb = "Freeze the image's undo stack."; - - $author = $copyright = 'Adam D. Moss'; - $date = '1999'; - - $help = <<'HELP'; -This procedure freezes the image's undo stack, allowing subsequent operations -to ignore their undo steps. This is generally called in conjunction with -'gimp_image_undo_thaw' to temporarily disable an image undo stack. This is -advantageous because saving undo steps can be time and memory intensive. -'gimp_image_undo_{freeze,thaw}' and 'gimp_image_undo_{disable,enable}' differ -in that the former does not free up all undo steps when undo is thawed, so is -more suited to interactive in-situ previews. It is important in this case -that the image is back to the same state it was frozen in before thawing, else -'undo' behaviour is undefined. -HELP - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'frozen', type => 'boolean', - desc => 'True if the image undo has been frozen', - alias => 'success ? TRUE : FALSE', no_declare => 1 } - ); - - %invoke = ( code => 'success = gimage_freeze_undo (gimage);' ); -} - -sub image_clean_all { - $blurb = 'Set the image dirty count to 0.'; - - $help = <<'HELP'; -This procedure sets the specified image's dirty count to 0, allowing operations -to occur without having a 'dirtied' image. This is especially useful for -creating and loading images which should not initially be considered dirty, even -though layers must be created, filled, and installed in the image. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - %invoke = ( code => 'gimage_clean_all (gimage);' ); -} - -sub image_floating_selection { - $blurb = 'Return the floating selection of the image.'; - - $help = <<'HELP'; -This procedure returns the image's floating_sel, if it exists. If it doesn't -exist, -1 is returned as the layer ID. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'floating_sel', type => 'layer', init => 1, - desc => "The image's floating selection", - return_fail => -1 } - ); - - %invoke = ( code => 'floating_sel = gimage_floating_sel (gimage);' ); -} - -sub image_floating_sel_attached_to { - $blurb = 'Return the drawable the floating selection is attached to.'; - - $help = <<'HELP'; -This procedure returns the drawable the image's floating selection is attached -to, if it exists. If it doesn't exist, -1 is returned as the drawable ID. -HELP - - $author = $copyright = 'Wolfgang Hofer'; - $date = '1998'; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'drawable', type => 'drawable', init => 1, - desc => 'The drawable the floating selection is attached to', - return_fail => -1 } - ); - - %invoke = ( - headers => [ qw("layer_pvt.h") ], - vars => [ 'Layer *floating_sel' ], - code => <<'CODE' -{ - floating_sel = gimage_floating_sel (gimage); - - if (floating_sel) - drawable = GIMP_DRAWABLE (GIMP_LAYER (floating_sel)->fs.drawable); - else - drawable = NULL; -} -CODE - ); -} - -foreach (qw(width height)) { - push @procs, "image_$_"; - eval < '$_', type => 'int32', - desc => "The image's $_", - alias => 'gimage->$_', no_declare => 1 } - ); -} -SUB -} - -&image_accessors('active_layer', 'layer', 'active layer', 1, - [ <<'CODE1', <<'CODE2' ]); - $invoke{code} = "active_layer = $outargs[0]->{alias};"; - delete @{$outargs[0]}{qw(alias no_declare)}; - $outargs[0]->{return_fail} = -1; - $outargs[0]->{init} = 1; - - $help = <<'HELP'; -If there is an active layer, its ID will be returned, otherwise, -1. If a -channel is currently active, then no layer will be. If a layer mask is active, -then this will return the associated layer. -HELP -CODE1 - $help = <<'HELP'; -If the layer exists, it is set as the active layer in the image. Any previous -active layer or channel is set to inactive. An exception is a previously -existing floating selection, in which case this procedure will return an -execution error. -HELP -CODE2 - -&image_accessors('active_channel', 'channel', 'active channel', 1, - [ <<'CODE1', <<'CODE2' ]); - $invoke{code} = "active_channel = $outargs[0]->{alias};"; - delete @{$outargs[0]}{qw(alias no_declare)}; - $outargs[0]->{return_fail} = -1; - $outargs[0]->{init} = 1; - - $help = <<'HELP'; -If there is an active channel, this will return the channel ID, otherwise, -1. -HELP -CODE1 - $help = <<'HELP'; -If the channel exists, it is set as the active channel in the image. Any -previous active channel or channel is set to inactive. An exception is a -previously existing floating selection, in which case this procedure will -return an execution error. -HELP -CODE2 - -&image_accessors('selection', 'selection', 'selection', 1, - [ <<'CODE', undef ]); - $invoke{code} = "success = (selection = gimage_get_mask (gimage)) != NULL;"; - delete @{$outargs[0]}{qw(alias no_declare)}; - $outargs[0]->{desc} .= ' channel'; - $outargs[0]->{init} = 1; - - $help = <<'HELP'; -This will always return a valid ID for a selection--which is represented as a -channel internally. -HELP -CODE -$#procs--; - -my $comp_arg = <<'CODE'; - splice @inargs, 1, 0, ({ name => 'component', - type => 'enum ChannelType (no AUXILLARY_CHANNEL)', - desc => 'The image component: { %%desc%% }' }); - - $invoke{code} = <<'SUCCESS'; -{ - if (component == GRAY_CHANNEL) - success = gimage_base_type (gimage) == GRAY; - else if (component == INDEXED_CHANNEL) - success = gimage_base_type (gimage) == INDEXED; - else - success = gimage_base_type (gimage) == RGB; -} -SUCCESS -CODE - -my $comp_help = <<'CODE'; - $help =~ s/(component)/$1 (i.e. Red, Green, Blue intensity channels - in an RGB image)/; - $help =~ s/\. $/ /; - $help .= < 'modified', - visible => 'seen' -); - -foreach (sort keys %comp_action) { - my $help = $comp_help; - - $help =~ s/%%type%%/$_/e; - $help =~ s/%%action%%/$comp_action{$_}/e; - - &image_accessors("component_$_", 'boolean', "image component is $_", 1, - [ <{name} = '$_'; - \$outargs[0]->{desc} = 'Component is $_ (%%desc%%)'; - - chop \$outargs[0]->{alias}; - \$outargs[0]->{alias} .= ', component)'; - $help; -CODE1 - my \$code = <{name} = '$_'; - \$inargs[2]->{desc} = 'Component is $_ (%%desc%%)'; - $help; -CODE2 -} - -&image_accessors('filename', 'string', 'filename', 1, - [ <<'CODE', undef ]); - $help =~ s/\. $//; - $help .= <<'HELP'; ---if it was loaded or has since been saved. Otherwise, returns NULL. -HELP - - $outargs[0]->{alias} =~ s/get_//; -CODE - -&image_accessors('resolution', 'float', 'resolution', 0, - [ <<'CODE1', <<'CODE2' ]); - $help =~ s/\. $/ /; - $help .= <<'HELP'; -in dots per inch. This value is independent of any of the layers in this image. -HELP - - $author = $copyright = 'Austin Donnelly'; - $date = '1998'; - - push @outargs, { %{$outargs[0]} }; - - my $count = 0; - foreach $coord (qw(x y)) { - foreach (qw(name alias)) { - $outargs[$count]->{$_} =~ s/res/"${coord}res"/e - } - $outargs[$count++]->{desc} .= "in the $coord-axis, in dots per inch"; - } -CODE1 - $help =~ s/\. $/ /; - $help .= <<'HELP'; -in dots per inch. This value is independent of any of the layers in this image. -No scaling or resizing is performed. -HELP - - $author = $copyright = 'Austin Donnelly'; - $date = '1998'; - - push @inargs, { %{$inargs[1]} }; - - my $count = 1; undef %invoke; - foreach $coord (qw(x y)) { - my $arg = $inargs[$count]; - $arg->{name} =~ s/res/"${coord}res"/e; - $arg->{desc} .= "in the $coord-axis, in dots per inch"; - $count++; - } - - $invoke{code} = <<'CODE'; -{ - if (!FINITE (xresolution) || - xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION || - !FINITE (yresolution) || - yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION) - { - g_message (_("Image resolution is out of bounds,\n" - "using the default resolution instead.")); - success = FALSE; - } - else - { - gimage->xresolution = xresolution; - gimage->yresolution = yresolution; - } -} -CODE -CODE2 - -my $unit_help = <<'HELP'; -This value is independent of any of the layers in this image. See the -gimp_unit_* procedure definitions for the valid range of unit IDs and a -description of the unit system. -HELP - -my $unit_misc = <<'CODE'; - $author = $copyright = 'Michael Natterer'; - $date = '1998'; -CODE -&image_accessors('unit', 'unit (min GIMP_UNIT_INCH)', 'unit', 0, - [ < 'tattoo', type => 'tattoo', - desc => 'The tattoo of the $_ to find' } - ); - - \@outargs = ( - { name => '$_', type => '$_', init => 1, - desc => 'The $_ with the specified tattoo' } - ); - - \%invoke = ( - code => <<'CODE' -{ - $_ = gimp_image_get_${_}_by_tattoo (gimage, tattoo); - success = $_ != NULL; -} -CODE - ); -} -SUB -} - -sub preview_dim_args () { - my @args; - foreach (qw(width height bpp)) { - push @args, { name => $_, type => 'int32', desc => "The previews $_", init => 1 }; - } - @args; -} - -sub image_thumbnail { - $blurb = 'Get a thumbnail of an image.'; - - $help = <<'HELP'; -This function gets data from which a thumbnail of an image preview can be -created. Maximum x or y dimension is 128 pixels. The pixles are returned in the -RGB[A] format. The bpp return value gives the number of bytes in the image. The -alpha channel also returned if the image has one. -HELP - - $author = $copyright = 'Andy Thomas'; - $date = '1999'; - - @inargs = ( - &std_image_arg, - { name => 'width', type => '0 < int32', - desc => 'The thumbnail width', - alias => 'req_width' }, - { name => 'height', type => '0 < int32', - desc => 'The thumbnail height', - alias => 'req_height' } - ); - - @outargs = ( - &preview_dim_args, - { name => 'thumbnail_data', type => 'int8array', - desc => 'The thumbnail data', init => 1, - array => { name => 'thumbnail_data_count', - desc => 'The number of bytes in thumbnail data', - alias => 'num_bytes', init => 1 } } - ); - - %invoke = ( - headers => [ qw() ], - code => <<'CODE' -{ - TempBuf * buf; - gint dwidth, dheight; - - if (req_width <= 128 && req_height <= 128) - { - /* Adjust the width/height ratio */ - dwidth = gimage->width; - dheight = gimage->height; - - if (dwidth > dheight) - req_height = (req_width * dheight) / dwidth; - else - req_width = (req_height * dwidth) / dheight; - - buf = gimp_image_construct_composite_preview (gimage, - req_width, - req_height); - num_bytes = buf->height * buf->width * buf->bytes; - thumbnail_data = g_new (guint8, num_bytes); - g_memmove (thumbnail_data, temp_buf_data (buf), num_bytes); - width = buf->width; - height = buf->height; - bpp = buf->bytes; - temp_buf_free (buf); - } -} -CODE - ); -} - -sub image_get_tattoo_state { - $blurb = 'Returns the tattoo state associated with the image.'; - - $help = <<'HELP'; -This procedure returns the tattoo state of the image. Use only by -save/load plugins that wish to preserve an images tattoo state. Using this -function at other times will produce unexpected results. -HELP - - $author = $copyright = 'Andy Thomas'; - $date = '2000'; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'tattoo', type => 'int32', - desc => 'The tattoo state associated with the image', init => 1 } - ); - - %invoke = ( - code => <<'CODE' -{ -tattoo = gimp_image_get_tattoo_state(gimage); -} -CODE - ); -} - -sub image_set_tattoo_state { - $blurb = 'Set the tattoo state associated with the image.'; - - $help = <<'HELP'; -This procedure sets the tattoo state of the image. Use only by -save/load plugins that wish to preserve an images tattoo state. Using this -function at other times will produce unexpected results. A full check of -uniqueness of states in layers, channels and paths will be performed by this -procedure and a execution failure will be returned if this fails. A failure -will also be returned if the new tattoo state value is less than the maximum -tattoo value from all of the tattoos from the paths,layers and channels. After -the image data has been loaded and all the tattoos have been set then this is -the last procedure that should be called. If effectively does a status check -on the tattoo values that have been set to make sure that all is OK. -HELP - - $author = $copyright = 'Andy Thomas'; - $date = '2000'; - - @inargs = ( - &std_image_arg, - { name => 'tattoo', type => 'int32', - desc => 'The new tattoo state of the image' - } - ); - - %invoke = ( - code => <<'CODE' -{ - success = gimp_image_set_tattoo_state(gimage,tattoo); -} -CODE - ); -} - - -@headers = qw("config.h" "gimage.h" - "libgimp/gimpmath.h" "libgimp/gimpintl.h" "libgimp/gimplimits.h"); - -$extra{app}->{code} = <<'CODE'; -/* Yuup, this is somewhat unsmooth, to say the least */ - -static void -gimlist_cb (gpointer im, - gpointer data) -{ - GSList **l = (GSList **) data; - *l = g_slist_prepend (*l, im); -} -CODE - -unshift @procs, qw(image_list image_new image_resize image_scale image_delete - image_free_shadow image_get_layers image_get_channels - image_unset_active_channel image_pick_correlate_layer - image_raise_layer image_lower_layer image_raise_layer_to_top - image_lower_layer_to_bottom image_merge_visible_layers - image_merge_down image_flatten image_add_layer - image_remove_layer image_add_layer_mask - image_remove_layer_mask image_raise_channel - image_lower_channel image_add_channel image_remove_channel - image_active_drawable image_base_type image_get_cmap - image_set_cmap image_undo_is_enabled image_undo_enable - image_undo_disable image_undo_freeze image_undo_thaw - image_clean_all image_floating_selection - image_floating_sel_attached_to image_thumbnail - image_set_tattoo_state image_get_tattoo_state); -%exports = (app => [@procs], - lib => [@procs[0..4,6..11,14,16..24,26..35,37..$#procs]]); - -$desc = 'Image'; - -1; diff --git a/tools/pdbgen/pdb/gimage_mask.pdb b/tools/pdbgen/pdb/gimage_mask.pdb deleted file mode 100644 index 02c832d258..0000000000 --- a/tools/pdbgen/pdb/gimage_mask.pdb +++ /dev/null @@ -1,371 +0,0 @@ -# The GIMP -- an image manipulation program -# Copyright (C) 1995 Spencer Kimball and Peter Mattis - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# "Perlized" from C source by Manish Singh - -sub coord_args { - my ($name, $desc, $args) = @_; - foreach (qw(x y)) { - push @$args, { name => eval qq/"$name"/, type => 'int32', - desc => eval qq/"$desc"/ } - } -} - -sub selection_simple_proc { - my $op = shift; - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - %invoke = ( code => "gimage_mask_$op (gimage);" ); -} - -sub selection_change_proc { - my ($op, $arg, $type, $edge_lock) = @_; - - $blurb = "\u$op the image's selection"; - - $help = "This procedure ${op}s the selection. "; - - &std_pdb_misc; - - @inargs = ( - &std_image_arg, - { name => $arg, type => "0 <= $type", - desc => "\u$arg of $op (in pixels)" } - ); - - %invoke = ( code => "gimage_mask_$op (gimage, $arg, $arg$edge_lock);" ); -} - -# The defs - -sub selection_bounds { - $blurb = 'Find the bounding box of the current selection.'; - - $help = <<'HELP'; -This procedure returns whether there is a selection for the specified image. If -there is one, the upper left and lower right corners of the bounding box are -returned. These coordinates are relative to the image. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'non_empty', type => 'boolean', - desc => 'True if there is a selection', init => 1 } - ); - - my $count = 1; - foreach ('upper left', 'lower right') { - &coord_args("\${_}$count", - "\$_ coordinate of $_ corner of selection bounds", - \@outargs); - $count++; - } - - %invoke = ( - code => 'non_empty = gimage_mask_bounds (gimage, &x1, &y1, &x2, &y2);' - ); -} - -sub selection_value { - $blurb = 'Find the value of the selection at the specified coordinates.'; - - $help = <<'HELP'; -This procedure returns the value of the selection at the specified coordinates. -If the coordinates lie out of bounds, 0 is returned. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - &coord_args('$_', '$_ coordinate of value', \@inargs); - - @outargs = ( - { name => 'value', type => '0 <= int32 <= 255', - desc => 'Value of the selection: (%%desc%%)', - alias => 'gimage_mask_value (gimage, x, y)', no_declare => 1 } - ); -} - -sub selection_is_empty { - $blurb = 'Determine whether the selection is empty.'; - - $help = <<'HELP'; -This procedure returns non-zero if the selection for the specified image is not -empty. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg); - - @outargs = ( - { name => 'is_empty', type => 'boolean', - desc => 'Is the selection empty?', - alias => 'gimage_mask_is_empty (gimage)', no_declare => 1 } - ); -} - -sub selection_translate { - $blurb = 'Translate the selection by the specified offsets.'; - - $help = <<'HELP'; -This procedure actually translates the selection for the specified image by the -specified offsets. Regions that are translated from beyond the bounds of the -image are set to empty. Valid regions of the selection which are translated -beyond the bounds of the image because of this call are lost. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - &coord_args('off$_', '$_ offset for translation', \@inargs); - - %invoke = ( code => 'gimage_mask_translate (gimage, offx, offy);' ); -} - -sub selection_float { - $blurb = <<'BLURB'; -Float the selection from the specified drawable with initial offsets as -specified. -BLURB - - $help = <<'HELP'; -This procedure determines the region of the specified drawable that lies -beneath the current selection. The region is then cut from the drawable and the -resulting data is made into a new layer which is instantiated as a floating -selection. The offsets allow initial positioning of the new floating selection. -HELP - - &std_pdb_misc; - - @inargs = ( - { name => 'drawable', type => 'drawable', - desc => 'The drawable from which to float selection' } - ); - &coord_args('off$_', '$_ offset for translation', \@inargs); - - @outargs = ( - { name => 'layer', type => 'layer', - desc => 'The floated layer', init => 1 } - ); - - %invoke = ( - vars => [ 'GimpImage *gimage' ], - code => <<'CODE' -{ - gimage = drawable_gimage (drawable); - layer = gimage_mask_float (gimage, drawable, offx, offy); - success = layer != NULL; -} -CODE - ); -} - -sub selection_clear { - &selection_simple_proc('clear'); - - $blurb = 'Set the selection to none, clearing all previous content.'; - - $help = <<'HELP'; -This procedure sets the selection mask to empty, assigning the value 0 to every -pixel in the selection channel. -HELP -} - -sub selection_invert { - &selection_simple_proc('invert'); - - $blurb = 'Invert the selection mask.'; - - $help = <<'HELP'; -This procedure inverts the selection mask. For every pixel in the selection -channel, its new value is calculated as (255 - old_value). -HELP -} - -sub selection_sharpen { - &selection_simple_proc('sharpen'); - - $blurb = 'Sharpen the selection mask.'; - - $help = <<'HELP'; -This procedure sharpens the selection mask. For every pixel in the selection -channel, if the value is > 0, the new pixel is assigned a value of 255. This -removes any "anti-aliasing" that might exist in the selection mask's boundary. -HELP -} - -sub selection_all { - &selection_simple_proc('all'); - - $blurb = 'Select all of the image.'; - - $help = <<'HELP'; -This procedure sets the selection mask to completely encompass the image. Every -pixel in the selection channel is set to 255. -HELP -} - -sub selection_none { - &selection_simple_proc('none'); - - $blurb = 'Deselect the entire image.'; - - $help = <<'HELP'; -This procedure deselects the entire image. Every pixel in the selection channel -is set to 0. -HELP -} - -sub selection_feather { - &selection_change_proc('feather', 'radius', 'float', ''); - - $help .= 'Feathering is implemented using a gaussian blur.'; -} - -sub selection_border { - &selection_change_proc('border', 'radius', 'int32', ''); - - $help .= <<'HELP'; -Bordering creates a new selection which is defined along the boundary of the -previous selection at every point within the specified radius. -HELP -} - -sub selection_grow { - &selection_change_proc('grow', 'steps', 'int32', ''); - - $help .= <<'HELP'; -Growing involves expanding the boundary in all directions by the specified -pixel amount. -HELP -} - -sub selection_shrink { - &selection_change_proc('shrink', 'radius', 'int32', ', FALSE'); - - $help .= <<'HELP'; -Shrinking invovles trimming the existing selection boundary on all sides by the -specified number of pixels. -HELP -} - -sub selection_layer_alpha { - $blurb = <<'BLURB'; -Transfer the specified layer's alpha channel to the selection mask. -BLURB - - $help = <<'HELP'; -This procedure requires a layer with an alpha channel. The alpha channel -information is used to create a selection mask such that for any pixel in the -image defined in the specified layer, that layer pixel's alpha value is -transferred to the selection mask. If the layer is undefined at a particular -image pixel, the associated selection mask value is set to 0. -HELP - - &std_pdb_misc; - - @inargs = ( - { name => 'layer', type => 'layer', - desc => 'Layer with alpha' } - ); - - %invoke = ( - vars => [ 'GimpImage *gimage' ], - code => <<'CODE' -{ - gimage = drawable_gimage (GIMP_DRAWABLE (layer)); - gimage_mask_layer_alpha (gimage, layer); -} -CODE - ); -} - -sub selection_load { - $blurb = 'Transfer the specified channel to the selection mask.'; - - $help = <<'HELP'; -This procedure loads the specified channel into the selection mask. This -essentially involves a copy of the channel's content in to the selection mask. -Therefore, the channel must have the same width and height of the image, or an -error is returned. -HELP - - &std_pdb_misc; - - @inargs = ( - { name => 'channel', type => 'channel', - desc => 'The channel' } - ); - - %invoke = ( - vars => [ 'GimpImage *gimage' ], - code => <<'CODE' -{ - gimage = drawable_gimage (GIMP_DRAWABLE (channel)); - - if (drawable_width (GIMP_DRAWABLE (channel)) == gimage->width && - drawable_height (GIMP_DRAWABLE (channel)) == gimage->height) - gimage_mask_load (gimage, channel); - else - success = FALSE; -} -CODE - ); -} - -sub selection_save { - $blurb = 'Copy the selection mask to a new channel.'; - - $help = <<'HELP'; -This procedure copies the selection mask and stores the content in a new -channel. The new channel is automatically inserted into the image's list of -channels. -HELP - - &std_pdb_misc; - - @inargs = ( &std_image_arg ); - - @outargs = ( - { name => 'channel', type => 'channel', - desc => 'The new channel', init => 1 } - ); - - %invoke = ( - code => 'success = (channel = gimage_mask_save (gimage)) != NULL;' - ); -} - -@headers = qw("gimage_mask.h"); - -@procs = qw(selection_bounds selection_value selection_is_empty - selection_translate selection_float selection_clear - selection_invert selection_sharpen selection_all selection_none - selection_feather selection_border selection_grow selection_shrink - selection_layer_alpha selection_load selection_save); -%exports = (app => [@procs], lib => [@procs[0,2,4,9]]); - -$desc = 'Image mask'; - -1; diff --git a/tools/pdbgen/pdb/gimprc.pdb b/tools/pdbgen/pdb/gimprc.pdb index 4a46b2c755..a1d58fe551 100644 --- a/tools/pdbgen/pdb/gimprc.pdb +++ b/tools/pdbgen/pdb/gimprc.pdb @@ -127,7 +127,7 @@ CODE @headers = qw("gimprc.h"); @procs = qw(gimprc_query gimprc_set get_monitor_resolution); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Gimprc procedures'; diff --git a/tools/pdbgen/pdb/image.pdb b/tools/pdbgen/pdb/image.pdb index 32a2a7db69..da73032cfa 100644 --- a/tools/pdbgen/pdb/image.pdb +++ b/tools/pdbgen/pdb/image.pdb @@ -1453,8 +1453,7 @@ unshift @procs, qw(image_list image_new image_resize image_scale image_delete image_clean_all image_floating_selection image_floating_sel_attached_to image_thumbnail image_set_tattoo_state image_get_tattoo_state); -%exports = (app => [@procs], - lib => [@procs[0..4,6..11,14,16..24,26..35,37..$#procs]]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Image'; diff --git a/tools/pdbgen/pdb/misc_tools.pdb b/tools/pdbgen/pdb/misc_tools.pdb index 7984a5529e..c7483a91ad 100644 --- a/tools/pdbgen/pdb/misc_tools.pdb +++ b/tools/pdbgen/pdb/misc_tools.pdb @@ -1537,7 +1537,7 @@ sub ink { paintbrush paintbrush_default pencil perspective rect_select rotate scale shear smudge smudge_default transform_2d); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Tool procedures'; diff --git a/tools/pdbgen/pdb/paint_tools.pdb b/tools/pdbgen/pdb/paint_tools.pdb index 7984a5529e..c7483a91ad 100644 --- a/tools/pdbgen/pdb/paint_tools.pdb +++ b/tools/pdbgen/pdb/paint_tools.pdb @@ -1537,7 +1537,7 @@ sub ink { paintbrush paintbrush_default pencil perspective rect_select rotate scale shear smudge smudge_default transform_2d); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Tool procedures'; diff --git a/tools/pdbgen/pdb/text_tool.pdb b/tools/pdbgen/pdb/text_tool.pdb index b88a89536e..08cf020d0e 100644 --- a/tools/pdbgen/pdb/text_tool.pdb +++ b/tools/pdbgen/pdb/text_tool.pdb @@ -383,7 +383,7 @@ text_xlfd_create (gchar *foundry, CODE @procs = qw(text_fontname text_get_extents_fontname text text_get_extents); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Text procedures'; diff --git a/tools/pdbgen/pdb/tools.pdb b/tools/pdbgen/pdb/tools.pdb index 7984a5529e..c7483a91ad 100644 --- a/tools/pdbgen/pdb/tools.pdb +++ b/tools/pdbgen/pdb/tools.pdb @@ -1537,7 +1537,7 @@ sub ink { paintbrush paintbrush_default pencil perspective rect_select rotate scale shear smudge smudge_default transform_2d); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Tool procedures'; diff --git a/tools/pdbgen/pdb/transform_tools.pdb b/tools/pdbgen/pdb/transform_tools.pdb index 7984a5529e..c7483a91ad 100644 --- a/tools/pdbgen/pdb/transform_tools.pdb +++ b/tools/pdbgen/pdb/transform_tools.pdb @@ -1537,7 +1537,7 @@ sub ink { paintbrush paintbrush_default pencil perspective rect_select rotate scale shear smudge smudge_default transform_2d); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Tool procedures'; diff --git a/tools/pdbgen/pdb/undo.pdb b/tools/pdbgen/pdb/undo.pdb index ca921466b7..f66e882a7e 100644 --- a/tools/pdbgen/pdb/undo.pdb +++ b/tools/pdbgen/pdb/undo.pdb @@ -60,7 +60,7 @@ HELP @headers = qw("undo.h"); @procs = qw(undo_push_group_start undo_push_group_end); -%exports = (app => [@procs]); +%exports = (app => [@procs], lib => [@procs]); $desc = 'Undo';