gimp/app/actions/plug-in-commands.c

478 lines
15 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
1997-11-25 06:05:25 +08:00
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
1997-11-25 06:05:25 +08:00
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
1997-11-25 06:05:25 +08:00
* (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, see <http://www.gnu.org/licenses/>.
1997-11-25 06:05:25 +08:00
*/
1997-11-25 06:05:25 +08:00
#include "config.h"
1999-03-07 20:56:03 +08:00
#include <string.h>
#include <gegl.h>
badly chopped into the new files below. Pass around much more "PlugIn" and 2002-03-20 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in.[ch]: badly chopped into the new files below. Pass around much more "PlugIn" and "Gimp" pointers instead of using "current_plug_in" and "the_gimp". Needs much more hacking though... :( * app/plug-in/Makefile.am * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-params.[ch] * app/plug-in/plug-in-progress.[ch] * app/plug-in/plug-ins.[ch]: new files. * app/gui/Makefile.am * app/gui/plug-in-commands.[ch] * app/gui/plug-in-menus.[ch]: ditto. * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-types.h: changed accordingly. * app/pdb/procedural_db.c: changed procedural_db_destroy_args() so it can be used from plug_in_args_destroy(). Fixed a parasite memory leak (or introduced a new SEGV, we'll see...). * app/display/Makefile.am: another "truly ugly hack" until the plug-in menu stuff is chopped even more... * app/gui/commands.[ch]: removed filters_repeat_cmd_callback() here, it is now in plug-in-commands.[ch]. * app/widgets/gimpitemfactory.[ch]: removed all gimp_menu_item_*() hacks. We have a GimpItemFactory available in most cases we used to call this functions, and can use gimp_item_factors_from_path() in all other cases. The item factory stuff needs more work anyway... * app/app_procs.c * app/gimphelp.c * app/display/gimpdisplayshell.c * app/gui/file-dialog-utils.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/menus.c * app/gui/paths-dialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/plug_in.pdb: changed accordingly (includes, renamed functions and gimp_menu_item_*() removal). * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2002-03-21 01:46:13 +08:00
#include <gtk/gtk.h>
badly chopped into the new files below. Pass around much more "PlugIn" and 2002-03-20 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in.[ch]: badly chopped into the new files below. Pass around much more "PlugIn" and "Gimp" pointers instead of using "current_plug_in" and "the_gimp". Needs much more hacking though... :( * app/plug-in/Makefile.am * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-params.[ch] * app/plug-in/plug-in-progress.[ch] * app/plug-in/plug-ins.[ch]: new files. * app/gui/Makefile.am * app/gui/plug-in-commands.[ch] * app/gui/plug-in-menus.[ch]: ditto. * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-types.h: changed accordingly. * app/pdb/procedural_db.c: changed procedural_db_destroy_args() so it can be used from plug_in_args_destroy(). Fixed a parasite memory leak (or introduced a new SEGV, we'll see...). * app/display/Makefile.am: another "truly ugly hack" until the plug-in menu stuff is chopped even more... * app/gui/commands.[ch]: removed filters_repeat_cmd_callback() here, it is now in plug-in-commands.[ch]. * app/widgets/gimpitemfactory.[ch]: removed all gimp_menu_item_*() hacks. We have a GimpItemFactory available in most cases we used to call this functions, and can use gimp_item_factors_from_path() in all other cases. The item factory stuff needs more work anyway... * app/app_procs.c * app/gimphelp.c * app/display/gimpdisplayshell.c * app/gui/file-dialog-utils.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/menus.c * app/gui/paths-dialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/plug_in.pdb: changed accordingly (includes, renamed functions and gimp_menu_item_*() removal). * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2002-03-21 01:46:13 +08:00
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
badly chopped into the new files below. Pass around much more "PlugIn" and 2002-03-20 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in.[ch]: badly chopped into the new files below. Pass around much more "PlugIn" and "Gimp" pointers instead of using "current_plug_in" and "the_gimp". Needs much more hacking though... :( * app/plug-in/Makefile.am * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-params.[ch] * app/plug-in/plug-in-progress.[ch] * app/plug-in/plug-ins.[ch]: new files. * app/gui/Makefile.am * app/gui/plug-in-commands.[ch] * app/gui/plug-in-menus.[ch]: ditto. * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-types.h: changed accordingly. * app/pdb/procedural_db.c: changed procedural_db_destroy_args() so it can be used from plug_in_args_destroy(). Fixed a parasite memory leak (or introduced a new SEGV, we'll see...). * app/display/Makefile.am: another "truly ugly hack" until the plug-in menu stuff is chopped even more... * app/gui/commands.[ch]: removed filters_repeat_cmd_callback() here, it is now in plug-in-commands.[ch]. * app/widgets/gimpitemfactory.[ch]: removed all gimp_menu_item_*() hacks. We have a GimpItemFactory available in most cases we used to call this functions, and can use gimp_item_factors_from_path() in all other cases. The item factory stuff needs more work anyway... * app/app_procs.c * app/gimphelp.c * app/display/gimpdisplayshell.c * app/gui/file-dialog-utils.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/menus.c * app/gui/paths-dialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/plug_in.pdb: changed accordingly (includes, renamed functions and gimp_menu_item_*() removal). * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2002-03-21 01:46:13 +08:00
#include "core/gimp.h"
#include "core/gimp-utils.h"
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable.h"
badly chopped into the new files below. Pass around much more "PlugIn" and 2002-03-20 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in.[ch]: badly chopped into the new files below. Pass around much more "PlugIn" and "Gimp" pointers instead of using "current_plug_in" and "the_gimp". Needs much more hacking though... :( * app/plug-in/Makefile.am * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-params.[ch] * app/plug-in/plug-in-progress.[ch] * app/plug-in/plug-ins.[ch]: new files. * app/gui/Makefile.am * app/gui/plug-in-commands.[ch] * app/gui/plug-in-menus.[ch]: ditto. * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-types.h: changed accordingly. * app/pdb/procedural_db.c: changed procedural_db_destroy_args() so it can be used from plug_in_args_destroy(). Fixed a parasite memory leak (or introduced a new SEGV, we'll see...). * app/display/Makefile.am: another "truly ugly hack" until the plug-in menu stuff is chopped even more... * app/gui/commands.[ch]: removed filters_repeat_cmd_callback() here, it is now in plug-in-commands.[ch]. * app/widgets/gimpitemfactory.[ch]: removed all gimp_menu_item_*() hacks. We have a GimpItemFactory available in most cases we used to call this functions, and can use gimp_item_factors_from_path() in all other cases. The item factory stuff needs more work anyway... * app/app_procs.c * app/gimphelp.c * app/display/gimpdisplayshell.c * app/gui/file-dialog-utils.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/menus.c * app/gui/paths-dialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/plug_in.pdb: changed accordingly (includes, renamed functions and gimp_menu_item_*() removal). * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2002-03-21 01:46:13 +08:00
#include "core/gimpimage.h"
#include "core/gimpitem.h"
replace the value union by a GValue. 2006-03-30 Michael Natterer <mitch@gimp.org> * app/pdb/procedural_db.[ch] (struct Argument): replace the value union by a GValue. (procedural_db_argument_init) (procedural_db_compat_arg_init): new functions to initialize an Argument. They call g_value_init() on the Argument's value. (procedural_db_arguments) (procedural_db_return_values): initialize the returned Argument arrays so their GValues are ready to use. Allow to get the (unsuccessful) return values of a NULL ProcRecord. (procedural_db_destroy_args): g_value_unset() the values. Added a "gboolean full_destroy" parameter. Its only effect is to destroy PDB arrays, everything else is nicely memory managed by GValue. (procedural_db_execute) (procedural_db_run_proc): do GValue stuff. Added n_args and n_return_vals parameters to execute(). (procedural_db_execute_proc): private function to execute a procedure. Validates the passed in arguments using the registered GParamSpecs before passing them to the resp. exec method. * app/plug-in/plug-in-params.[ch] (plug_in_params_to_args): needs an array of ProcArgs now in order to initialize the Arguments' GValues correctly. Passing NULL ProcArgs uses procedural_db_compat_arg_init(), so procedures (plug-ins) returning more values than expected work. (plug_in_args_to_params): do GValue stuff here too. (plug_in_args_destroy): removed this function, procedural_db_destroy_args() does the same now. * app/plug-in/plug-in-message.c (plug_in_handle_proc_run): simplified quite a bit because everything returns n_return_values now. Call plug_in_params_to_args() only of the procedure was found. (plug_in_handle_proc_return_priv): pass ProcRecs to plug_in_params_to_args(). * app/batch.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-ins.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/widgets/gimphelp.c * app/widgets/gimppdbdialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb: changed accordingly: don't g_new/g_free Argument arrays, always use procedural_db_foo() functions. Use GValue functions to get/set Arguments. * tools/pdbgen/pdb.pl: added get_value_func and set_value_func to all PDB types. Removed id_func, id_ret_func and check_func. Added flags which indicated that a type is an ID. Removed unused utility functions. * tools/pdbgen/lib.pl: use the flag instead of looking at functions and value types. * tools/pdbgen/app.pl: use the get_value_func and set_value_func to marshal inargs and outargs. Removed all checks performed on inargs because that's done by GParamSpec validation now. Added the missing bits to register excluded values with GimpParamSpecEnum. * app/pdb/*_cmds.c: regenerated.
2006-03-30 07:56:07 +08:00
#include "core/gimpparamspecs.h"
Redid the whole internal progress stuff: don't pass around 2004-08-10 Michael Natterer <mitch@gimp.org> Redid the whole internal progress stuff: don't pass around progress_callback and progress_data; instead, provide a pointer to a GimpProgressInterface which can be implemented by a variety of backends. Addresses (but not yet fixes) bugs #6010, #97266 and #135185. * app/display/Makefile.am * app/display/gimpprogress.[ch]: removed the old progress hack. * app/core/Makefile.am * app/core/core-types.h * app/core/gimpprogress.[ch]: implement GimpProgressInterface. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpprogressdialog.[ch]: the standalone progress dialog as widget implementing GimpProgressInterface. * app/display/gimpdisplay.c * app/display/gimpstatusbar.[ch] * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface implementation to these classes. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: replaced the old progress vtable entries by two new to create and destroy a GimpProgressDialog in case no other progress is available. * app/pdb/procedural_db.[ch] * app/plug-in/plug-in-run.[ch] * tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and all plug-ins. * app/plug-in/plug-in.[ch] * app/plug-in/plug-ins.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c: handle the case there the plug-in was crated with a progress as well as the case where it wasn't. * app/app_procs.c * app/batch.c * app/xcf/xcf.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/widgets/gimphelp.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: changed accordingly. * app/core/gimpimagefile.[ch] * app/display/gimpdisplayshell-dnd.c * app/gui/file-open-dialog.c * app/gui/file-open-location-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimplayertreeview.c * app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file related functions. Embed the progress in the file dialog where possible. * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-convert.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage-scale.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/core/gimplayer.c * app/core/gimpselection.c * app/vectors/gimpvectors.c: replaced callback/data by GimpProgress. * app/tools/gimpblendtool.c * app/tools/gimptransformtool.c * app/gui/convert-dialog.c * app/actions/documents-commands.c * app/actions/file-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb: changed callers accordingly. * app/pdb/*_cmds.c: regenerated.
2004-08-11 02:47:21 +08:00
#include "core/gimpprogress.h"
app/plug-in/Makefile.am app/plug-in/plug-in-types.h new object which keeps 2006-04-29 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/gimppluginmanager.[ch]: new object which keeps all plug-in related stuff that was kept in the Gimp instance. Has "menu-branch-added" and "last-plug-in-changed" signals. * app/plug-in/plug-ins.[ch]: removed, all its functions are in GimpPlugInManager now. * app/core/gimpmarshal.list: new marshaller for the new object. * app/core/gimp.[ch]: removed all plug-in related stuff and keep a GimpPlugInManager around. * app/plug-in/plug-in-data.[ch] * app/plug-in/plug-in-file.[ch] * app/plug-in/plug-in-help-domain.[ch] * app/plug-in/plug-in-locale-domain.[ch] * app/plug-in/plug-in-menu-branch.[ch] * app/plug-in/plug-ins-query.[ch]: removed... * app/plug-in/gimppluginmanager-data.[ch] * app/plug-in/gimppluginmanager-file.[ch] * app/plug-in/gimppluginmanager-help-domain.[ch] * app/plug-in/gimppluginmanager-locale-domain.[ch] * app/plug-in/gimppluginmanager-menu-branch.[ch] * app/plug-in/gimppluginmanager-query.[ch]: ...and added as methods of GimpPlugInManager. * app/plug-in/plug-in-debug.[ch] * app/plug-in/plug-in-shm.[ch]: removed... * app/plug-in/gimpplugindebug.[ch] * app/plug-in/gimppluginshm.[ch]: ...and added as properly namespeced structs with constructors and destructors. * app/core/Makefile.am * app/core/gimpenvirontable.[ch] * app/core/gimpinterpreterdb.[ch]: removed... * app/plug-in/gimpenvirontable.[ch] * app/plug-in/gimpinterpreterdb.[ch]: ...and added here unchanged. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: remove gimp_menus_create_branch() and all related stuff. * app/actions/plug-in-actions.[ch]: connect to the plug-in-manager's "menu-path-added" signal and create menu branch actions accordingly. * app/plug-in/plug-in-context.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/plug-in/plug-in.[ch] * app/app_procs.c * app/actions/file-commands.c * app/actions/plug-in-commands.c * app/core/gimpimage.c * app/dialogs/file-open-location-dialog.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/gui/gui.c * app/menus/plug-in-menus.c * app/pdb/gimppluginprocedure.c * app/pdb/gimptemporaryprocedure.c * app/widgets/gimpdnd-xds.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c * app/xcf/xcf.c * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/message.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/progress.pdb * tools/pdbgen/pdb/undo.pdb: follow above refactoring. * app/pdb/context_cmds.c * app/pdb/drawable_cmds.c * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/message_cmds.c * app/pdb/plug_in_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/progress_cmds.c * app/pdb/undo_cmds.c: regenerated.
2006-04-29 06:26:51 +08:00
#include "plug-in/gimppluginmanager.h"
#include "plug-in/gimppluginmanager-data.h"
#include "plug-in/gimppluginmanager-history.h"
#include "pdb/gimpprocedure.h"
#include "widgets/gimpbufferview.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimpdatafactoryview.h"
#include "widgets/gimpfontview.h"
#include "widgets/gimphelp-ids.h"
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
#include "widgets/gimpimageeditor.h"
#include "widgets/gimpitemtreeview.h"
#include "widgets/gimpmessagebox.h"
#include "widgets/gimpmessagedialog.h"
badly chopped into the new files below. Pass around much more "PlugIn" and 2002-03-20 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in.[ch]: badly chopped into the new files below. Pass around much more "PlugIn" and "Gimp" pointers instead of using "current_plug_in" and "the_gimp". Needs much more hacking though... :( * app/plug-in/Makefile.am * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-params.[ch] * app/plug-in/plug-in-progress.[ch] * app/plug-in/plug-ins.[ch]: new files. * app/gui/Makefile.am * app/gui/plug-in-commands.[ch] * app/gui/plug-in-menus.[ch]: ditto. * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-types.h: changed accordingly. * app/pdb/procedural_db.c: changed procedural_db_destroy_args() so it can be used from plug_in_args_destroy(). Fixed a parasite memory leak (or introduced a new SEGV, we'll see...). * app/display/Makefile.am: another "truly ugly hack" until the plug-in menu stuff is chopped even more... * app/gui/commands.[ch]: removed filters_repeat_cmd_callback() here, it is now in plug-in-commands.[ch]. * app/widgets/gimpitemfactory.[ch]: removed all gimp_menu_item_*() hacks. We have a GimpItemFactory available in most cases we used to call this functions, and can use gimp_item_factors_from_path() in all other cases. The item factory stuff needs more work anyway... * app/app_procs.c * app/gimphelp.c * app/display/gimpdisplayshell.c * app/gui/file-dialog-utils.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/menus.c * app/gui/paths-dialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/plug_in.pdb: changed accordingly (includes, renamed functions and gimp_menu_item_*() removal). * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2002-03-21 01:46:13 +08:00
#include "display/gimpdisplay.h"
#include "actions.h"
badly chopped into the new files below. Pass around much more "PlugIn" and 2002-03-20 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in.[ch]: badly chopped into the new files below. Pass around much more "PlugIn" and "Gimp" pointers instead of using "current_plug_in" and "the_gimp". Needs much more hacking though... :( * app/plug-in/Makefile.am * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-params.[ch] * app/plug-in/plug-in-progress.[ch] * app/plug-in/plug-ins.[ch]: new files. * app/gui/Makefile.am * app/gui/plug-in-commands.[ch] * app/gui/plug-in-menus.[ch]: ditto. * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-types.h: changed accordingly. * app/pdb/procedural_db.c: changed procedural_db_destroy_args() so it can be used from plug_in_args_destroy(). Fixed a parasite memory leak (or introduced a new SEGV, we'll see...). * app/display/Makefile.am: another "truly ugly hack" until the plug-in menu stuff is chopped even more... * app/gui/commands.[ch]: removed filters_repeat_cmd_callback() here, it is now in plug-in-commands.[ch]. * app/widgets/gimpitemfactory.[ch]: removed all gimp_menu_item_*() hacks. We have a GimpItemFactory available in most cases we used to call this functions, and can use gimp_item_factors_from_path() in all other cases. The item factory stuff needs more work anyway... * app/app_procs.c * app/gimphelp.c * app/display/gimpdisplayshell.c * app/gui/file-dialog-utils.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/menus.c * app/gui/paths-dialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/plug_in.pdb: changed accordingly (includes, renamed functions and gimp_menu_item_*() removal). * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2002-03-21 01:46:13 +08:00
#include "plug-in-commands.h"
#include "gimp-intl.h"
/* local function prototypes */
static void plug_in_procedure_execute (GimpPlugInProcedure *procedure,
Gimp *gimp,
GimpDisplay *display,
GValueArray *args,
gint n_args);
static gint plug_in_collect_data_args (GtkAction *action,
GimpObject *object,
GParamSpec **pspecs,
GValueArray *args,
gint n_args);
static gint plug_in_collect_image_args (GtkAction *action,
GimpImage *image,
GParamSpec **pspecs,
GValueArray *args,
gint n_args);
static gint plug_in_collect_item_args (GtkAction *action,
GimpImage *image,
GimpItem *item,
GParamSpec **pspecs,
GValueArray *args,
gint n_args);
static gint plug_in_collect_display_args (GtkAction *action,
GimpDisplay *display,
GParamSpec **pspecs,
GValueArray *args,
gint n_args);
static void plug_in_reset_all_response (GtkWidget *dialog,
gint response_id,
Gimp *gimp);
/* public functions */
badly chopped into the new files below. Pass around much more "PlugIn" and 2002-03-20 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in.[ch]: badly chopped into the new files below. Pass around much more "PlugIn" and "Gimp" pointers instead of using "current_plug_in" and "the_gimp". Needs much more hacking though... :( * app/plug-in/Makefile.am * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-params.[ch] * app/plug-in/plug-in-progress.[ch] * app/plug-in/plug-ins.[ch]: new files. * app/gui/Makefile.am * app/gui/plug-in-commands.[ch] * app/gui/plug-in-menus.[ch]: ditto. * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-types.h: changed accordingly. * app/pdb/procedural_db.c: changed procedural_db_destroy_args() so it can be used from plug_in_args_destroy(). Fixed a parasite memory leak (or introduced a new SEGV, we'll see...). * app/display/Makefile.am: another "truly ugly hack" until the plug-in menu stuff is chopped even more... * app/gui/commands.[ch]: removed filters_repeat_cmd_callback() here, it is now in plug-in-commands.[ch]. * app/widgets/gimpitemfactory.[ch]: removed all gimp_menu_item_*() hacks. We have a GimpItemFactory available in most cases we used to call this functions, and can use gimp_item_factors_from_path() in all other cases. The item factory stuff needs more work anyway... * app/app_procs.c * app/gimphelp.c * app/display/gimpdisplayshell.c * app/gui/file-dialog-utils.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/menus.c * app/gui/paths-dialog.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/plug_in.pdb: changed accordingly (includes, renamed functions and gimp_menu_item_*() removal). * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2002-03-21 01:46:13 +08:00
void
app/plug-in/plug-in-types.h renamed to GimpPlugInProcedure and made a 2006-04-05 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: renamed to GimpPlugInProcedure and made a GObject derived from GimpProcedure (instead of having a pointer to a GimpProcedure). Added image_types and file_magic utility functions taken from plug-ins.[ch]. Still lives in the same crappy files because I am undecided where to put it... * app/pdb/gimpprocedure.c (gimp_procedure_real_execute): removed switch() statement and always call the internal marshaller because GimpProcedure::execute() is properly overridden by GimpPlugInProcedure now. * app/plug-in/plug-ins.[ch]: removed the mime_type and file_magic utilities added to GimpPlugInProcedure. * app/actions/file-commands.c * app/actions/plug-in-actions.[ch] * app/actions/plug-in-commands.[ch] * app/core/gimp-gui.[ch] * app/core/gimp.[ch] * app/core/gimpimage.[ch] * app/dialogs/file-open-dialog.c * app/dialogs/file-save-dialog.c * app/dialogs/print-size-dialog.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/file/file-utils.[ch] * app/gui/gui-vtable.c * app/menus/plug-in-menus.[ch] * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-message.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/widgets/gimpactiongroup.[ch] * app/widgets/gimpdnd-xds.c * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpfileprocview.[ch] * app/widgets/gimppluginaction.[ch] * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb: changed addordingly. * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2006-04-05 16:38:33 +08:00
plug_in_run_cmd_callback (GtkAction *action,
GimpPlugInProcedure *proc,
gpointer data)
1997-11-25 06:05:25 +08:00
{
app/plug-in/plug-in-types.h renamed to GimpPlugInProcedure and made a 2006-04-05 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: renamed to GimpPlugInProcedure and made a GObject derived from GimpProcedure (instead of having a pointer to a GimpProcedure). Added image_types and file_magic utility functions taken from plug-ins.[ch]. Still lives in the same crappy files because I am undecided where to put it... * app/pdb/gimpprocedure.c (gimp_procedure_real_execute): removed switch() statement and always call the internal marshaller because GimpProcedure::execute() is properly overridden by GimpPlugInProcedure now. * app/plug-in/plug-ins.[ch]: removed the mime_type and file_magic utilities added to GimpPlugInProcedure. * app/actions/file-commands.c * app/actions/plug-in-actions.[ch] * app/actions/plug-in-commands.[ch] * app/core/gimp-gui.[ch] * app/core/gimp.[ch] * app/core/gimpimage.[ch] * app/dialogs/file-open-dialog.c * app/dialogs/file-save-dialog.c * app/dialogs/print-size-dialog.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/file/file-utils.[ch] * app/gui/gui-vtable.c * app/menus/plug-in-menus.[ch] * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-message.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/widgets/gimpactiongroup.[ch] * app/widgets/gimpdnd-xds.c * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpfileprocview.[ch] * app/widgets/gimppluginaction.[ch] * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb: changed addordingly. * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2006-04-05 16:38:33 +08:00
GimpProcedure *procedure = GIMP_PROCEDURE (proc);
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
Gimp *gimp;
GValueArray *args;
app/plug-in/plug-in-types.h renamed to GimpPlugInProcedure and made a 2006-04-05 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: renamed to GimpPlugInProcedure and made a GObject derived from GimpProcedure (instead of having a pointer to a GimpProcedure). Added image_types and file_magic utility functions taken from plug-ins.[ch]. Still lives in the same crappy files because I am undecided where to put it... * app/pdb/gimpprocedure.c (gimp_procedure_real_execute): removed switch() statement and always call the internal marshaller because GimpProcedure::execute() is properly overridden by GimpPlugInProcedure now. * app/plug-in/plug-ins.[ch]: removed the mime_type and file_magic utilities added to GimpPlugInProcedure. * app/actions/file-commands.c * app/actions/plug-in-actions.[ch] * app/actions/plug-in-commands.[ch] * app/core/gimp-gui.[ch] * app/core/gimp.[ch] * app/core/gimpimage.[ch] * app/dialogs/file-open-dialog.c * app/dialogs/file-save-dialog.c * app/dialogs/print-size-dialog.c * app/file/file-open.[ch] * app/file/file-save.[ch] * app/file/file-utils.[ch] * app/gui/gui-vtable.c * app/menus/plug-in-menus.[ch] * app/plug-in/plug-in-def.[ch] * app/plug-in/plug-in-message.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/widgets/gimpactiongroup.[ch] * app/widgets/gimpdnd-xds.c * app/widgets/gimpfiledialog.[ch] * app/widgets/gimpfileprocview.[ch] * app/widgets/gimppluginaction.[ch] * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb: changed addordingly. * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2006-04-05 16:38:33 +08:00
gint n_args = 0;
GimpDisplay *display = NULL;
added a shitload of new GTypes and corresponding GParamSpecs to use them 2006-04-03 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added a shitload of new GTypes and corresponding GParamSpecs to use them as PDB arguments. Each GimpPDBArgType has one or more corresponding GTypes in the core now. * app/pdb/gimpargument.[ch] (struct GimpArgument) (struct GimpArgumentSpec): removed "value" member because the GValue's/GParamSpec's GType carries just as much information now. (gimp_argument_type_to_pdb_arg_type): new function which maps GTypes to GimpPDBArgType. (gimp_pdb_arg_type_to_string): formerly known as procedural_db_type_name(). * app/pdb/gimpprocedure.[ch] * app/pdb/procedural_db.[ch]: completely switch to GValue. Use the new GParamSpecs for procedure arguments. GimpPDBArgType is only used for adding compat args/values of plug-in procedures. (procedural_db_run_proc): the va_list expects a sequence of (GType, value, GType, value, ..., G_TYPE_NONE) now. * app/plug-in/plug-in-params.[ch]: changed accordingly. (plug_in_param_defs_check): removed this function. * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): use plug_in_proc_args_check() instead and initialize the GimpProcedure before doing so. * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param spec types and their utility functions. Changed argument/value registration accordingly. * app/pdb/procedural-db-query.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-ins.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimphelp.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. * app/pdb/*_cmds.c: regenerated.
2006-04-04 04:54:55 +08:00
return_if_no_gimp (gimp, data);
1997-11-25 06:05:25 +08:00
args = gimp_procedure_get_arguments (procedure);
1997-11-25 06:05:25 +08:00
Changed the semantics of GIMP_EXTENSION and (to some extent) of 2003-06-19 Michael Natterer <mitch@gimp.org> Changed the semantics of GIMP_EXTENSION and (to some extent) of GIMP_PLUGIN: The old meaning of EXTENSION was "I live in the toolbox" and PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I am invoked interactively)". This is completely useless, since living in the toolbox means having "<Toolbox>" in the menu_path and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of what type of procedure we are. The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure, I am invoked, do my job and finish", while GIMP_EXTENSION means "I will install temporary procedures and I will keep running to keep them available". (A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the core that it's ready to run, or the core will block waiting for the message !!!). * configure.in: bumped version number to 1.3.16. * libgimpbase/gimpprotocol.h: increased protocol version number so old extensions will refuse to load. * app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but look at their parameters and pass them either RUN-MODE, or RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE. * app/pdb/procedural_db.c: cleaned up, better error reporting, replaced an impossible error message by g_return_if_fail() * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): better error messages. * app/plug-in/plug-in-params.c: allocate parameter arrays using g_new0() so we don't have to worry about uninitialized stuff later. * app/plug-in/plug-in-run.c (plug_in_run): wait for gimp_extension_ack() installation confirmation for ALL extensions, not just for automatically started ones. * app/plug-in/plug-ins.c: cleanup. * libgimp/gimp.[ch]: cleaned up and API-documented massively. Made all magic values given in the GPConfig message static and added accessor functions for them. Added gimp_tile_width()/height(). Added new function gimp_extension_enable() which turns on asynchronous processing of temp_proc run requests without having to enter an endless gimp_extension_process() loop. Moved all private functions to the end of the file. Added tons of g_return_if_fail() all over the place. Call gimp_run_procedure2() from gimp_run_procedure() instead of duplicating the code. Indentation, spacing, stuff... * libgimp/gimptile.[ch]: removed gimp_tile_width()/height(). * libgimp/gimpdrawable.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: use the gimp_tile_width()/height() accessor functions. * libgimp/gimp.def: added gimp_extension_enable. * libgimp/gimpmenu.c: removed evil code which connected to _readchannel manually and use gimp_extension_enable() for watching temp_procs. * plug-ins/helpbrowser/helpbrowser.c: removed the same evil code here and call gimp_extension_enable(). Call gimp_extension_ack() to let the core know that the temp_proc is installed. * plug-ins/script-fu/script-fu.c: made all procedures except the permanently running "extension_script_fu" ordinary GIMP_PLUGIN procedures. * plug-ins/common/curve_bend.c * plug-ins/common/plugindetails.c * plug-ins/common/screenshot.c * plug-ins/common/uniteditor.c * plug-ins/common/winclipboard.c * plug-ins/dbbrowser/dbbrowser.c * plug-ins/gfli/gfli.c * plug-ins/twain/twain.c * plug-ins/webbrowser/webbrowser.c * plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN procedures and renamed them from "extension_*" to "plug_in_*". Random cleanups. * app/widgets/gimphelp.c * plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
/* initialize the first argument */
g_value_set_int (&args->values[n_args], GIMP_RUN_INTERACTIVE);
n_args++;
Changed the semantics of GIMP_EXTENSION and (to some extent) of 2003-06-19 Michael Natterer <mitch@gimp.org> Changed the semantics of GIMP_EXTENSION and (to some extent) of GIMP_PLUGIN: The old meaning of EXTENSION was "I live in the toolbox" and PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I am invoked interactively)". This is completely useless, since living in the toolbox means having "<Toolbox>" in the menu_path and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of what type of procedure we are. The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure, I am invoked, do my job and finish", while GIMP_EXTENSION means "I will install temporary procedures and I will keep running to keep them available". (A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the core that it's ready to run, or the core will block waiting for the message !!!). * configure.in: bumped version number to 1.3.16. * libgimpbase/gimpprotocol.h: increased protocol version number so old extensions will refuse to load. * app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but look at their parameters and pass them either RUN-MODE, or RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE. * app/pdb/procedural_db.c: cleaned up, better error reporting, replaced an impossible error message by g_return_if_fail() * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): better error messages. * app/plug-in/plug-in-params.c: allocate parameter arrays using g_new0() so we don't have to worry about uninitialized stuff later. * app/plug-in/plug-in-run.c (plug_in_run): wait for gimp_extension_ack() installation confirmation for ALL extensions, not just for automatically started ones. * app/plug-in/plug-ins.c: cleanup. * libgimp/gimp.[ch]: cleaned up and API-documented massively. Made all magic values given in the GPConfig message static and added accessor functions for them. Added gimp_tile_width()/height(). Added new function gimp_extension_enable() which turns on asynchronous processing of temp_proc run requests without having to enter an endless gimp_extension_process() loop. Moved all private functions to the end of the file. Added tons of g_return_if_fail() all over the place. Call gimp_run_procedure2() from gimp_run_procedure() instead of duplicating the code. Indentation, spacing, stuff... * libgimp/gimptile.[ch]: removed gimp_tile_width()/height(). * libgimp/gimpdrawable.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: use the gimp_tile_width()/height() accessor functions. * libgimp/gimp.def: added gimp_extension_enable. * libgimp/gimpmenu.c: removed evil code which connected to _readchannel manually and use gimp_extension_enable() for watching temp_procs. * plug-ins/helpbrowser/helpbrowser.c: removed the same evil code here and call gimp_extension_enable(). Call gimp_extension_ack() to let the core know that the temp_proc is installed. * plug-ins/script-fu/script-fu.c: made all procedures except the permanently running "extension_script_fu" ordinary GIMP_PLUGIN procedures. * plug-ins/common/curve_bend.c * plug-ins/common/plugindetails.c * plug-ins/common/screenshot.c * plug-ins/common/uniteditor.c * plug-ins/common/winclipboard.c * plug-ins/dbbrowser/dbbrowser.c * plug-ins/gfli/gfli.c * plug-ins/twain/twain.c * plug-ins/webbrowser/webbrowser.c * plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN procedures and renamed them from "extension_*" to "plug_in_*". Random cleanups. * app/widgets/gimphelp.c * plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
switch (procedure->proc_type)
1997-11-25 06:05:25 +08:00
{
Makefile.am configure.in added new directory libgimpbase/ 2001-05-21 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool-1.4.in: added new directory libgimpbase/ * app/Makefile.am: link against the new lib. * app/appenums.h: removed the PDB enums which are in libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed. * app/apptypes.h: #include "libgimpbase/gimpbasetypes.h" * app/[lots] * app/core/[of] * app/gui/[files] * app/tools/: changed includes and all PDB types. * app/pdb/*: regenerated. * libgimp/Makefile.am: don't build libgimpi.a uglyness any more. * libgimp/gimpenv.[ch] * libgimp/gimplimits.[hh] * libgimp/gimpparasite.[ch] * libgimp/gimpparasiteio.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimpsignal.[ch] * libgimp/gimpunit.h * libgimp/gimputils.[ch] * libgimp/gimpwire.[ch]: removed... * libgimpbase/*: ...and added here as new library. * libgimp/gimp.[ch] * libgimp/gimpdrawable.[ch] * libgimp/gimpenums.h * libgimp/gimpimage.[ch] * libgimp/gimptile.c * libgimp/gimptypes.h * libgimp/gimpunit.c: changed accordingly. Added the gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and gimpimage.[ch]. * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpsizeentry.c * libgimpwidgets/gimpunitmenu.c * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly. * plug-ins/*/Makefile.am * plug-ins/common/mkgen.pl: link against libgimpbase. * tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so the enums are known to pdbgen... * tools/pdbgen/enumcode.pl: ...but don't write them out to libgimp/gimpenums.h * tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c files. Added GIMP_ to the type names ganerated in app/. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 21:58:46 +08:00
case GIMP_EXTENSION:
1997-11-25 06:05:25 +08:00
break;
Makefile.am configure.in added new directory libgimpbase/ 2001-05-21 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool-1.4.in: added new directory libgimpbase/ * app/Makefile.am: link against the new lib. * app/appenums.h: removed the PDB enums which are in libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed. * app/apptypes.h: #include "libgimpbase/gimpbasetypes.h" * app/[lots] * app/core/[of] * app/gui/[files] * app/tools/: changed includes and all PDB types. * app/pdb/*: regenerated. * libgimp/Makefile.am: don't build libgimpi.a uglyness any more. * libgimp/gimpenv.[ch] * libgimp/gimplimits.[hh] * libgimp/gimpparasite.[ch] * libgimp/gimpparasiteio.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimpsignal.[ch] * libgimp/gimpunit.h * libgimp/gimputils.[ch] * libgimp/gimpwire.[ch]: removed... * libgimpbase/*: ...and added here as new library. * libgimp/gimp.[ch] * libgimp/gimpdrawable.[ch] * libgimp/gimpenums.h * libgimp/gimpimage.[ch] * libgimp/gimptile.c * libgimp/gimptypes.h * libgimp/gimpunit.c: changed accordingly. Added the gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and gimpimage.[ch]. * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpsizeentry.c * libgimpwidgets/gimpunitmenu.c * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly. * plug-ins/*/Makefile.am * plug-ins/common/mkgen.pl: link against libgimpbase. * tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so the enums are known to pdbgen... * tools/pdbgen/enumcode.pl: ...but don't write them out to libgimp/gimpenums.h * tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c files. Added GIMP_ to the type names ganerated in app/. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 21:58:46 +08:00
case GIMP_PLUGIN:
case GIMP_TEMPORARY:
if (GIMP_IS_DATA_FACTORY_VIEW (data) ||
GIMP_IS_FONT_VIEW (data) ||
GIMP_IS_BUFFER_VIEW (data))
Changed the semantics of GIMP_EXTENSION and (to some extent) of 2003-06-19 Michael Natterer <mitch@gimp.org> Changed the semantics of GIMP_EXTENSION and (to some extent) of GIMP_PLUGIN: The old meaning of EXTENSION was "I live in the toolbox" and PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I am invoked interactively)". This is completely useless, since living in the toolbox means having "<Toolbox>" in the menu_path and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of what type of procedure we are. The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure, I am invoked, do my job and finish", while GIMP_EXTENSION means "I will install temporary procedures and I will keep running to keep them available". (A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the core that it's ready to run, or the core will block waiting for the message !!!). * configure.in: bumped version number to 1.3.16. * libgimpbase/gimpprotocol.h: increased protocol version number so old extensions will refuse to load. * app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but look at their parameters and pass them either RUN-MODE, or RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE. * app/pdb/procedural_db.c: cleaned up, better error reporting, replaced an impossible error message by g_return_if_fail() * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): better error messages. * app/plug-in/plug-in-params.c: allocate parameter arrays using g_new0() so we don't have to worry about uninitialized stuff later. * app/plug-in/plug-in-run.c (plug_in_run): wait for gimp_extension_ack() installation confirmation for ALL extensions, not just for automatically started ones. * app/plug-in/plug-ins.c: cleanup. * libgimp/gimp.[ch]: cleaned up and API-documented massively. Made all magic values given in the GPConfig message static and added accessor functions for them. Added gimp_tile_width()/height(). Added new function gimp_extension_enable() which turns on asynchronous processing of temp_proc run requests without having to enter an endless gimp_extension_process() loop. Moved all private functions to the end of the file. Added tons of g_return_if_fail() all over the place. Call gimp_run_procedure2() from gimp_run_procedure() instead of duplicating the code. Indentation, spacing, stuff... * libgimp/gimptile.[ch]: removed gimp_tile_width()/height(). * libgimp/gimpdrawable.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: use the gimp_tile_width()/height() accessor functions. * libgimp/gimp.def: added gimp_extension_enable. * libgimp/gimpmenu.c: removed evil code which connected to _readchannel manually and use gimp_extension_enable() for watching temp_procs. * plug-ins/helpbrowser/helpbrowser.c: removed the same evil code here and call gimp_extension_enable(). Call gimp_extension_ack() to let the core know that the temp_proc is installed. * plug-ins/script-fu/script-fu.c: made all procedures except the permanently running "extension_script_fu" ordinary GIMP_PLUGIN procedures. * plug-ins/common/curve_bend.c * plug-ins/common/plugindetails.c * plug-ins/common/screenshot.c * plug-ins/common/uniteditor.c * plug-ins/common/winclipboard.c * plug-ins/dbbrowser/dbbrowser.c * plug-ins/gfli/gfli.c * plug-ins/twain/twain.c * plug-ins/webbrowser/webbrowser.c * plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN procedures and renamed them from "extension_*" to "plug_in_*". Random cleanups. * app/widgets/gimphelp.c * plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContainer *container;
GimpContext *context;
GimpObject *object;
Changed the semantics of GIMP_EXTENSION and (to some extent) of 2003-06-19 Michael Natterer <mitch@gimp.org> Changed the semantics of GIMP_EXTENSION and (to some extent) of GIMP_PLUGIN: The old meaning of EXTENSION was "I live in the toolbox" and PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I am invoked interactively)". This is completely useless, since living in the toolbox means having "<Toolbox>" in the menu_path and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of what type of procedure we are. The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure, I am invoked, do my job and finish", while GIMP_EXTENSION means "I will install temporary procedures and I will keep running to keep them available". (A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the core that it's ready to run, or the core will block waiting for the message !!!). * configure.in: bumped version number to 1.3.16. * libgimpbase/gimpprotocol.h: increased protocol version number so old extensions will refuse to load. * app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but look at their parameters and pass them either RUN-MODE, or RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE. * app/pdb/procedural_db.c: cleaned up, better error reporting, replaced an impossible error message by g_return_if_fail() * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): better error messages. * app/plug-in/plug-in-params.c: allocate parameter arrays using g_new0() so we don't have to worry about uninitialized stuff later. * app/plug-in/plug-in-run.c (plug_in_run): wait for gimp_extension_ack() installation confirmation for ALL extensions, not just for automatically started ones. * app/plug-in/plug-ins.c: cleanup. * libgimp/gimp.[ch]: cleaned up and API-documented massively. Made all magic values given in the GPConfig message static and added accessor functions for them. Added gimp_tile_width()/height(). Added new function gimp_extension_enable() which turns on asynchronous processing of temp_proc run requests without having to enter an endless gimp_extension_process() loop. Moved all private functions to the end of the file. Added tons of g_return_if_fail() all over the place. Call gimp_run_procedure2() from gimp_run_procedure() instead of duplicating the code. Indentation, spacing, stuff... * libgimp/gimptile.[ch]: removed gimp_tile_width()/height(). * libgimp/gimpdrawable.c * libgimp/gimppixelrgn.c * libgimp/gimptile.c: use the gimp_tile_width()/height() accessor functions. * libgimp/gimp.def: added gimp_extension_enable. * libgimp/gimpmenu.c: removed evil code which connected to _readchannel manually and use gimp_extension_enable() for watching temp_procs. * plug-ins/helpbrowser/helpbrowser.c: removed the same evil code here and call gimp_extension_enable(). Call gimp_extension_ack() to let the core know that the temp_proc is installed. * plug-ins/script-fu/script-fu.c: made all procedures except the permanently running "extension_script_fu" ordinary GIMP_PLUGIN procedures. * plug-ins/common/curve_bend.c * plug-ins/common/plugindetails.c * plug-ins/common/screenshot.c * plug-ins/common/uniteditor.c * plug-ins/common/winclipboard.c * plug-ins/dbbrowser/dbbrowser.c * plug-ins/gfli/gfli.c * plug-ins/twain/twain.c * plug-ins/webbrowser/webbrowser.c * plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN procedures and renamed them from "extension_*" to "plug_in_*". Random cleanups. * app/widgets/gimphelp.c * plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
container = gimp_container_view_get_container (editor->view);
context = gimp_container_view_get_context (editor->view);
object = gimp_context_get_by_type (context,
gimp_container_get_children_type (container));
n_args = plug_in_collect_data_args (action, object,
procedure->args,
args, n_args);
}
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
else if (GIMP_IS_IMAGE_EDITOR (data))
{
GimpImageEditor *editor = GIMP_IMAGE_EDITOR (data);
GimpImage *image;
image = gimp_image_editor_get_image (editor);
n_args = plug_in_collect_image_args (action, image,
procedure->args,
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
args, n_args);
}
else if (GIMP_IS_ITEM_TREE_VIEW (data))
{
GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (data);
GimpImage *image;
GimpItem *item;
image = gimp_item_tree_view_get_image (view);
if (image)
item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image);
else
item = NULL;
n_args = plug_in_collect_item_args (action, image, item,
procedure->args,
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
args, n_args);
}
else
{
display = action_data_get_display (data);
n_args = plug_in_collect_display_args (action,
display,
procedure->args,
args, n_args);
}
1997-11-25 06:05:25 +08:00
break;
case GIMP_INTERNAL:
g_warning ("Unhandled procedure type.");
n_args = -1;
break;
1997-11-25 06:05:25 +08:00
}
if (n_args >= 1)
plug_in_procedure_execute (proc, gimp, display, args, n_args);
1997-11-25 06:05:25 +08:00
g_value_array_free (args);
1997-11-25 06:05:25 +08:00
}
void
Switch from GtkItemFactory to GtkUIManager. The migration is almost 2004-04-29 Michael Natterer <mitch@gimp.org> Switch from GtkItemFactory to GtkUIManager. The migration is almost complete, still stuff missing/incomplete, definitely added a bunch of new bugs... * app/actions/*-commands.[ch]: converted all callback from GtkItemFactory callbacks to GtkAction callbacks. * app/actions/debug-actions.c * app/actions/gradient-editor-actions.c * app/actions/help-actions.c * app/actions/plug-in-actions.c * app/actions/qmask-actions.c * app/actions/tool-options-actions.c: various fixes. * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-appearance.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.[ch]: move everything from GtkItemFactory to GtkUIManager. * app/gui/dialogs.[ch]: added new function dialogs_get_toolbox(). Needed because the action callbacks don't have a widget parameter and sometimes we need a parent window for showing dialogs. * app/gui/Makefile.am * app/gui/brushes-menu.[ch] * app/gui/buffers-menu.[ch] * app/gui/channels-menu.[ch] * app/gui/colormap-editor-menu.[ch] * app/gui/dialogs-menu.[ch] * app/gui/documents-menu.[ch] * app/gui/error-console-menu.[ch] * app/gui/fonts-menu.[ch] * app/gui/gradient-editor-menu.[ch] * app/gui/gradients-menu.[ch] * app/gui/images-menu.[ch] * app/gui/layers-menu.[ch] * app/gui/palette-editor-menu.[ch] * app/gui/palettes-menu.[ch] * app/gui/patterns-menu.[ch] * app/gui/qmask-menu.[ch] * app/gui/templates-menu.[ch] * app/gui/vectors-menu.[ch]: removed these files. * app/gui/gui.c: create a global UI manager for the image popup menu and the toolbox menubar. * app/gui/menus.[ch]: removed all GtkItemFactory code. * app/gui/image-menu.[ch] * app/gui/toolbox-menu.[ch]: removed everything except the trivial setup_funcs. * app/gui/file-open-menu.c * app/gui/file-save-menu.c * app/gui/tool-options-menu.c: don't use the macros from menus.h any more, they are gone. * app/gui/gui-vtable.c * app/gui/plug-in-menus.[ch]: create/destroy the dynamic plug-in menu entries. * app/tools/gimpimagemaptool.c: s/gimp_item_factory_update/ gimp_ui_manager_update/g * app/widgets/gimpuimanager.[ch]: added API to get an action group by name. * app/widgets/gimpmenufactory.c: don't choke on the item_factory entries being NULL. * app/widgets/gimpactiongroup.c: make sure booleans set using g_object_set() only have TRUE or FALSE values. * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.[ch] * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdockable.[ch] * app/widgets/gimpdocked.[ch] * app/widgets/gimpeditor.[ch] * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppaletteeditor.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c: removed all GtkItemFactory code and enable the #if 0'ed UI manager stuff. * menus/gradient-editor-menu.xml: fixed typos. * menus/image-menu.xml: duplicate everything so we have both an image menubar and an image popup menu. Badly cries for an XSL processor. * menus/toolbox-menu.xml: added an "Extensions" placeholder.
2004-04-29 20:52:29 +08:00
plug_in_repeat_cmd_callback (GtkAction *action,
gint value,
gpointer data)
{
GimpPlugInProcedure *procedure;
Gimp *gimp;
GimpDisplay *display;
GimpRunMode run_mode;
return_if_no_gimp (gimp, data);
added a shitload of new GTypes and corresponding GParamSpecs to use them 2006-04-03 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added a shitload of new GTypes and corresponding GParamSpecs to use them as PDB arguments. Each GimpPDBArgType has one or more corresponding GTypes in the core now. * app/pdb/gimpargument.[ch] (struct GimpArgument) (struct GimpArgumentSpec): removed "value" member because the GValue's/GParamSpec's GType carries just as much information now. (gimp_argument_type_to_pdb_arg_type): new function which maps GTypes to GimpPDBArgType. (gimp_pdb_arg_type_to_string): formerly known as procedural_db_type_name(). * app/pdb/gimpprocedure.[ch] * app/pdb/procedural_db.[ch]: completely switch to GValue. Use the new GParamSpecs for procedure arguments. GimpPDBArgType is only used for adding compat args/values of plug-in procedures. (procedural_db_run_proc): the va_list expects a sequence of (GType, value, GType, value, ..., G_TYPE_NONE) now. * app/plug-in/plug-in-params.[ch]: changed accordingly. (plug_in_param_defs_check): removed this function. * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): use plug_in_proc_args_check() instead and initialize the GimpProcedure before doing so. * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param spec types and their utility functions. Changed argument/value registration accordingly. * app/pdb/procedural-db-query.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-ins.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimphelp.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. * app/pdb/*_cmds.c: regenerated.
2006-04-04 04:54:55 +08:00
return_if_no_display (display, data);
run_mode = (GimpRunMode) value;
procedure = gimp_plug_in_manager_history_nth (gimp->plug_in_manager, 0);
if (procedure)
{
GValueArray *args;
gint n_args;
args = gimp_procedure_get_arguments (GIMP_PROCEDURE (procedure));
g_value_set_int (&args->values[0], run_mode);
n_args = plug_in_collect_display_args (action, display,
GIMP_PROCEDURE (procedure)->args,
args, 1);
plug_in_procedure_execute (procedure, gimp, display, args, n_args);
g_value_array_free (args);
}
}
void
plug_in_history_cmd_callback (GtkAction *action,
GimpPlugInProcedure *procedure,
gpointer data)
{
Gimp *gimp;
GimpDisplay *display;
GValueArray *args;
gint n_args;
return_if_no_gimp (gimp, data);
return_if_no_display (display, data);
args = gimp_procedure_get_arguments (GIMP_PROCEDURE (procedure));
g_value_set_int (&args->values[0], GIMP_RUN_INTERACTIVE);
n_args = plug_in_collect_display_args (action, display,
GIMP_PROCEDURE (procedure)->args,
args, 1);
plug_in_procedure_execute (procedure, gimp, display, args, n_args);
g_value_array_free (args);
}
void
plug_in_reset_all_cmd_callback (GtkAction *action,
gpointer data)
{
added a shitload of new GTypes and corresponding GParamSpecs to use them 2006-04-03 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added a shitload of new GTypes and corresponding GParamSpecs to use them as PDB arguments. Each GimpPDBArgType has one or more corresponding GTypes in the core now. * app/pdb/gimpargument.[ch] (struct GimpArgument) (struct GimpArgumentSpec): removed "value" member because the GValue's/GParamSpec's GType carries just as much information now. (gimp_argument_type_to_pdb_arg_type): new function which maps GTypes to GimpPDBArgType. (gimp_pdb_arg_type_to_string): formerly known as procedural_db_type_name(). * app/pdb/gimpprocedure.[ch] * app/pdb/procedural_db.[ch]: completely switch to GValue. Use the new GParamSpecs for procedure arguments. GimpPDBArgType is only used for adding compat args/values of plug-in procedures. (procedural_db_run_proc): the va_list expects a sequence of (GType, value, GType, value, ..., G_TYPE_NONE) now. * app/plug-in/plug-in-params.[ch]: changed accordingly. (plug_in_param_defs_check): removed this function. * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): use plug_in_proc_args_check() instead and initialize the GimpProcedure before doing so. * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param spec types and their utility functions. Changed argument/value registration accordingly. * app/pdb/procedural-db-query.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-ins.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimphelp.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. * app/pdb/*_cmds.c: regenerated.
2006-04-04 04:54:55 +08:00
Gimp *gimp;
GtkWidget *dialog;
added a shitload of new GTypes and corresponding GParamSpecs to use them 2006-04-03 Michael Natterer <mitch@gimp.org> * app/core/gimpparamspecs.[ch]: added a shitload of new GTypes and corresponding GParamSpecs to use them as PDB arguments. Each GimpPDBArgType has one or more corresponding GTypes in the core now. * app/pdb/gimpargument.[ch] (struct GimpArgument) (struct GimpArgumentSpec): removed "value" member because the GValue's/GParamSpec's GType carries just as much information now. (gimp_argument_type_to_pdb_arg_type): new function which maps GTypes to GimpPDBArgType. (gimp_pdb_arg_type_to_string): formerly known as procedural_db_type_name(). * app/pdb/gimpprocedure.[ch] * app/pdb/procedural_db.[ch]: completely switch to GValue. Use the new GParamSpecs for procedure arguments. GimpPDBArgType is only used for adding compat args/values of plug-in procedures. (procedural_db_run_proc): the va_list expects a sequence of (GType, value, GType, value, ..., G_TYPE_NONE) now. * app/plug-in/plug-in-params.[ch]: changed accordingly. (plug_in_param_defs_check): removed this function. * app/plug-in/plug-in-message.c (plug_in_handle_proc_install): use plug_in_proc_args_check() instead and initialize the GimpProcedure before doing so. * tools/pdbgen/app.pl * tools/pdbgen/pdb.pl: use the new param spec types and their utility functions. Changed argument/value registration accordingly. * app/pdb/procedural-db-query.c * app/actions/plug-in-commands.c * app/actions/vectors-commands.c * app/core/gimppdbprogress.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-ins.c * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimphelp.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. * app/pdb/*_cmds.c: regenerated.
2006-04-04 04:54:55 +08:00
return_if_no_gimp (gimp, data);
dialog = gimp_message_dialog_new (_("Reset all Filters"), GIMP_STOCK_QUESTION,
NULL, 0,
gimp_standard_help_func, NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GIMP_STOCK_RESET, GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
g_signal_connect (dialog, "response",
G_CALLBACK (plug_in_reset_all_response),
gimp);
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Do you really want to reset all "
"filters to default values?"));
gtk_widget_show (dialog);
}
/* private functions */
static void
plug_in_procedure_execute (GimpPlugInProcedure *procedure,
Gimp *gimp,
GimpDisplay *display,
GValueArray *args,
gint n_args)
{
GError *error = NULL;
gimp_value_array_truncate (args, n_args);
/* run the plug-in procedure */
gimp_procedure_execute_async (GIMP_PROCEDURE (procedure), gimp,
gimp_get_user_context (gimp),
GIMP_PROGRESS (display), args,
GIMP_OBJECT (display), &error);
if (error)
{
bumped minimum required version of GLib to 2.18.0. 2008-11-04 Sven Neumann <sven@sven> * configure.in: bumped minimum required version of GLib to 2.18.0. * INSTALL: document the updated dependency. * app/core/gimp.[ch]: introduced gimp_message_literal(), a variant of gimp_message() that takes a literal string. * app/errors.[ch]: removed format arguments from gimp_fatal_error() and gimp_terminate() and let them take a literal string instead. * app/tools/gimptool.[ch]: introduced gimp_tool_message_literal(), a variant of gimp_tool_message() that takes a literal string. * app/actions/documents-commands.c * app/actions/drawable-commands.c * app/actions/edit-commands.c * app/actions/error-console-commands.c * app/actions/file-commands.c * app/actions/gradients-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/palettes-commands.c * app/actions/plug-in-commands.c * app/actions/select-commands.c * app/actions/vectors-commands.c * app/config/gimprc.c * app/core/gimp-modules.c * app/core/gimp-parasites.c * app/core/gimp-templates.c * app/core/gimp-units.c * app/core/gimpchannel.c * app/core/gimpcontainer-filter.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpimage-convert.c * app/core/gimpimage-merge.c * app/core/gimpimage.c * app/core/gimpimagefile.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/core/gimpselection.c * app/dialogs/convert-dialog.c * app/dialogs/dialogs.c * app/dialogs/palette-import-dialog.c * app/dialogs/preferences-dialog.c * app/dialogs/quit-dialog.c * app/dialogs/stroke-dialog.c * app/display/gimpdisplayshell-dnd.c * app/file/file-open.c * app/file/file-procedure.c * app/file/file-save.c * app/file/file-utils.c * app/gegl/gimpcurvesconfig.c * app/gegl/gimplevelsconfig.c * app/gui/gui-message.c * app/gui/gui.c * app/gui/session.c * app/paint/gimpbrushcore.c * app/paint/gimpclone.c * app/paint/gimpheal.c * app/paint/gimpperspectiveclone.c * app/paint/gimpsourcecore.c * app/pdb/gimppdb-utils.c * app/pdb/gimpprocedure.c * app/plug-in/gimpplugin-message.c * app/plug-in/gimpplugin.c * app/plug-in/gimppluginmanager-restore.c * app/plug-in/gimppluginprocedure.c * app/text/gimptextlayer.c * app/tools/gimp-tools.c * app/tools/gimpaligntool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcurvestool.c * app/tools/gimpdesaturatetool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpforegroundselecttool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpgegltool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpimagemaptool-settings.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimpmeasuretool.c * app/tools/gimppainttool.c * app/tools/gimpposterizetool.c * app/tools/gimpselectiontool.c * app/tools/gimpsourcetool.c * app/tools/gimpthresholdtool.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/widgets/gimpactionview.c * app/widgets/gimpcontrollerlist.c * app/widgets/gimpcontrollers.c * app/widgets/gimpdataeditor.c * app/widgets/gimpdevices.c * app/widgets/gimpdnd-xds.c * app/widgets/gimperrordialog.c * app/widgets/gimphelp.c * app/widgets/gimpitemtreeview.c * app/widgets/gimppdbdialog.c * app/widgets/gimpsettingsbox.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/floating_sel.pdb * tools/pdbgen/pdb/image.pdb: use the _literal variants for g_set_error(), gimp_message() and gimp_tool_message(). * app/pdb/convert-cmds.c * app/pdb/edit-cmds.c * app/pdb/floating-sel-cmds.c * app/pdb/image-cmds.c: regenerated. svn path=/trunk/; revision=27548
2008-11-04 20:33:09 +08:00
gimp_message_literal (gimp,
G_OBJECT (display), GIMP_MESSAGE_ERROR,
error->message);
g_error_free (error);
}
else
{
/* remember only image plug-ins */
if (GIMP_PROCEDURE (procedure)->num_args >= 2 &&
GIMP_IS_PARAM_SPEC_IMAGE_ID (GIMP_PROCEDURE (procedure)->args[1]))
{
gimp_plug_in_manager_history_add (gimp->plug_in_manager, procedure);
}
}
}
static gint
plug_in_collect_data_args (GtkAction *action,
GimpObject *object,
GParamSpec **pspecs,
GValueArray *args,
gint n_args)
{
if (args->n_values > n_args &&
GIMP_IS_PARAM_SPEC_STRING (pspecs[n_args]))
{
if (object)
{
g_value_set_string (&args->values[n_args],
gimp_object_get_name (object));
n_args++;
}
else
{
g_warning ("Uh-oh, no active data object for the plug-in!");
return -1;
}
}
return n_args;
}
static gint
plug_in_collect_image_args (GtkAction *action,
GimpImage *image,
GParamSpec **pspecs,
GValueArray *args,
gint n_args)
{
if (args->n_values > n_args &&
GIMP_IS_PARAM_SPEC_IMAGE_ID (pspecs[n_args]))
{
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
if (image)
{
gimp_value_set_image (&args->values[n_args], image);
n_args++;
}
else
{
g_warning ("Uh-oh, no active image for the plug-in!");
return -1;
}
}
return n_args;
}
static gint
plug_in_collect_item_args (GtkAction *action,
GimpImage *image,
GimpItem *item,
GParamSpec **pspecs,
GValueArray *args,
gint n_args)
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
{
if (args->n_values > n_args &&
GIMP_IS_PARAM_SPEC_IMAGE_ID (pspecs[n_args]))
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
{
if (image)
{
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
gimp_value_set_image (&args->values[n_args], image);
n_args++;
if (args->n_values > n_args &&
GIMP_IS_PARAM_SPEC_ITEM_ID (pspecs[n_args]))
{
if (item &&
g_type_is_a (G_TYPE_FROM_INSTANCE (item),
GIMP_PARAM_SPEC_ITEM_ID (pspecs[n_args])->item_type))
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
{
gimp_value_set_item (&args->values[n_args], item);
n_args++;
}
else
{
g_warning ("Uh-oh, no active item for the plug-in!");
return -1;
}
}
}
}
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
return n_args;
}
static gint
plug_in_collect_display_args (GtkAction *action,
GimpDisplay *display,
GParamSpec **pspecs,
GValueArray *args,
gint n_args)
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
{
if (args->n_values > n_args &&
GIMP_IS_PARAM_SPEC_DISPLAY_ID (pspecs[n_args]))
{
if (display)
{
gimp_value_set_display (&args->values[n_args], GIMP_OBJECT (display));
n_args++;
}
else
{
g_warning ("Uh-oh, no active display for the plug-in!");
return -1;
}
}
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
if (args->n_values > n_args &&
GIMP_IS_PARAM_SPEC_IMAGE_ID (pspecs[n_args]))
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
{
GimpImage *image = display ? gimp_display_get_image (display) : NULL;
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
if (image)
{
gimp_value_set_image (&args->values[n_args], image);
n_args++;
if (args->n_values > n_args &&
GIMP_IS_PARAM_SPEC_DRAWABLE_ID (pspecs[n_args]))
Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and 2006-06-16 Michael Natterer <mitch@gimp.org> Allow plug-ins to register in <Layers>, <Channels>, <Vectors> and <ColormapEditor>: * app/pdb/gimppluginprocedure.c (gimp_plug_in_procedure_add_menu_path): added the argument type checks for the new locations. Factored out duplicated code. * app/menus/menus.c (menus_init): add the "plug-in" action group to the resp. UI managers. * app/menus/plug-in-menus.c (plug_in_menus_menu_path_added): support them here too. * app/widgets/gimpimageeditor.[ch] * app/widgets/gimpitemtreeview.[ch]: added get_image() functions. * app/actions/plug-in-commands.c: added new utility functions which collect plug-in arguments from GimpImageEditor and GimpItemTreeView widgets. * menus/channels-menu.xml * menus/colormap-editor-menu.xml * menus/layers-menu.xml * menus/vectors-menu.xml: added separators. * menus/image-menu.xml.in: added a "Colormap" placeholder in Colors/Map * plug-ins/common/colormap-remap.c (query): register a menu entry in <ColormapEditor> and moved the existing one to the "Colormap" placeholder. Also register an icon to make this menu item clearly distinct from the others in that menu. Unrelated: * plug-ins/common/colormap-remap.c (run): cleaned up quite a bit. Fixed last-vals code and simplified map handling. (remap_swap): removed, folded into run(). (remap_dialog): use the passed map to initialize the dialog so it starts with the last-vals. Tweaked layout to have 16 columns and simplified cell renderer creation.
2006-06-17 01:02:14 +08:00
{
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (drawable)
{
gimp_value_set_drawable (&args->values[n_args], drawable);
n_args++;
}
else
{
g_warning ("Uh-oh, no active drawable for the plug-in!");
return -1;
}
}
}
}
return n_args;
}
static void
plug_in_reset_all_response (GtkWidget *dialog,
gint response_id,
Gimp *gimp)
{
gtk_widget_destroy (dialog);
if (response_id == GTK_RESPONSE_OK)
app/plug-in/Makefile.am app/plug-in/plug-in-types.h new object which keeps 2006-04-29 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/gimppluginmanager.[ch]: new object which keeps all plug-in related stuff that was kept in the Gimp instance. Has "menu-branch-added" and "last-plug-in-changed" signals. * app/plug-in/plug-ins.[ch]: removed, all its functions are in GimpPlugInManager now. * app/core/gimpmarshal.list: new marshaller for the new object. * app/core/gimp.[ch]: removed all plug-in related stuff and keep a GimpPlugInManager around. * app/plug-in/plug-in-data.[ch] * app/plug-in/plug-in-file.[ch] * app/plug-in/plug-in-help-domain.[ch] * app/plug-in/plug-in-locale-domain.[ch] * app/plug-in/plug-in-menu-branch.[ch] * app/plug-in/plug-ins-query.[ch]: removed... * app/plug-in/gimppluginmanager-data.[ch] * app/plug-in/gimppluginmanager-file.[ch] * app/plug-in/gimppluginmanager-help-domain.[ch] * app/plug-in/gimppluginmanager-locale-domain.[ch] * app/plug-in/gimppluginmanager-menu-branch.[ch] * app/plug-in/gimppluginmanager-query.[ch]: ...and added as methods of GimpPlugInManager. * app/plug-in/plug-in-debug.[ch] * app/plug-in/plug-in-shm.[ch]: removed... * app/plug-in/gimpplugindebug.[ch] * app/plug-in/gimppluginshm.[ch]: ...and added as properly namespeced structs with constructors and destructors. * app/core/Makefile.am * app/core/gimpenvirontable.[ch] * app/core/gimpinterpreterdb.[ch]: removed... * app/plug-in/gimpenvirontable.[ch] * app/plug-in/gimpinterpreterdb.[ch]: ...and added here unchanged. * app/core/gimp-gui.[ch] * app/gui/gui-vtable.c: remove gimp_menus_create_branch() and all related stuff. * app/actions/plug-in-actions.[ch]: connect to the plug-in-manager's "menu-path-added" signal and create menu branch actions accordingly. * app/plug-in/plug-in-context.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.[ch] * app/plug-in/plug-in.[ch] * app/app_procs.c * app/actions/file-commands.c * app/actions/plug-in-commands.c * app/core/gimpimage.c * app/dialogs/file-open-location-dialog.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/gui/gui.c * app/menus/plug-in-menus.c * app/pdb/gimppluginprocedure.c * app/pdb/gimptemporaryprocedure.c * app/widgets/gimpdnd-xds.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c * app/xcf/xcf.c * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/message.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/progress.pdb * tools/pdbgen/pdb/undo.pdb: follow above refactoring. * app/pdb/context_cmds.c * app/pdb/drawable_cmds.c * app/pdb/fileops_cmds.c * app/pdb/help_cmds.c * app/pdb/message_cmds.c * app/pdb/plug_in_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/progress_cmds.c * app/pdb/undo_cmds.c: regenerated.
2006-04-29 06:26:51 +08:00
gimp_plug_in_manager_data_free (gimp->plug_in_manager);
}