1997-11-25 06:05:25 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-07-16 20:49:04 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "config.h"
|
1999-03-07 20:56:03 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <string.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
#include <glib-object.h>
|
1998-08-29 07:01:46 +08:00
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
|
|
|
#include "libgimpbase/gimpprotocol.h"
|
|
|
|
#include "libgimpbase/gimpwire.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
|
2001-12-01 08:14:14 +08:00
|
|
|
#include "plug-in-types.h"
|
2001-05-22 04:30:16 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
#include "base/tile.h"
|
|
|
|
#include "base/tile-manager.h"
|
|
|
|
|
2001-07-11 20:39:49 +08:00
|
|
|
#include "core/gimp.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpdrawable.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
|
2001-12-01 08:14:14 +08:00
|
|
|
#include "plug-in.h"
|
2002-03-21 01:46:13 +08:00
|
|
|
#include "plug-ins.h"
|
|
|
|
#include "plug-in-def.h"
|
|
|
|
#include "plug-in-params.h"
|
2001-12-19 08:13:16 +08:00
|
|
|
#include "plug-in-proc.h"
|
2003-01-30 19:20:12 +08:00
|
|
|
#include "plug-in-shm.h"
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
typedef struct _PlugInBlocked PlugInBlocked;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
struct _PlugInBlocked
|
|
|
|
{
|
|
|
|
PlugIn *plug_in;
|
2000-02-25 00:11:26 +08:00
|
|
|
gchar *proc_name;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* local function prototypes */
|
|
|
|
|
|
|
|
static void plug_in_handle_quit (PlugIn *plug_in);
|
|
|
|
static void plug_in_handle_tile_req (PlugIn *plug_in,
|
|
|
|
GPTileReq *tile_req);
|
|
|
|
static void plug_in_handle_proc_run (PlugIn *plug_in,
|
|
|
|
GPProcRun *proc_run);
|
|
|
|
static void plug_in_handle_proc_return_priv (PlugIn *plug_in,
|
|
|
|
GPProcReturn *proc_return);
|
|
|
|
static void plug_in_handle_proc_return (PlugIn *plug_in,
|
|
|
|
GPProcReturn *proc_return);
|
|
|
|
#ifdef ENABLE_TEMP_RETURN
|
|
|
|
static void plug_in_handle_temp_proc_return (PlugIn *plug_in,
|
|
|
|
GPProcReturn *proc_return);
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
2003-01-30 19:20:12 +08:00
|
|
|
static void plug_in_handle_proc_install (PlugIn *plug_in,
|
|
|
|
GPProcInstall *proc_install);
|
|
|
|
static void plug_in_handle_proc_uninstall (PlugIn *plug_in,
|
|
|
|
GPProcUninstall *proc_uninstall);
|
|
|
|
static void plug_in_handle_extension_ack (PlugIn *plug_in);
|
|
|
|
static void plug_in_handle_has_init (PlugIn *plug_in);
|
1999-03-07 20:56:03 +08:00
|
|
|
|
1999-05-07 04:56:07 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* private variables */
|
2000-07-16 20:49:04 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
static GSList *blocked_plug_ins = NULL;
|
1999-05-07 04:56:07 +08:00
|
|
|
|
2001-10-20 00:41:09 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
/* public functions */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
void
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_handle_message (PlugIn *plug_in,
|
|
|
|
WireMessage *msg)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
switch (msg->type)
|
|
|
|
{
|
|
|
|
case GP_QUIT:
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_handle_quit (plug_in);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_CONFIG:
|
2003-01-30 19:20:12 +08:00
|
|
|
g_warning ("plug_in_handle_message: "
|
2000-07-16 20:49:04 +08:00
|
|
|
"received a config message (should not happen)");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_TILE_REQ:
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_handle_tile_req (plug_in, msg->data);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_TILE_ACK:
|
2003-01-30 19:20:12 +08:00
|
|
|
g_warning ("plug_in_handle_message: "
|
2000-07-16 20:49:04 +08:00
|
|
|
"received a tile ack message (should not happen)");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_TILE_DATA:
|
2003-01-30 19:20:12 +08:00
|
|
|
g_warning ("plug_in_handle_message: "
|
2000-07-16 20:49:04 +08:00
|
|
|
"received a tile data message (should not happen)");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_PROC_RUN:
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_handle_proc_run (plug_in, msg->data);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_PROC_RETURN:
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_handle_proc_return (plug_in, msg->data);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_TEMP_PROC_RUN:
|
2003-01-30 19:20:12 +08:00
|
|
|
g_warning ("plug_in_handle_message: "
|
2000-07-16 20:49:04 +08:00
|
|
|
"received a temp proc run message (should not happen)");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_TEMP_PROC_RETURN:
|
2003-01-30 19:20:12 +08:00
|
|
|
#ifdef ENABLE_TEMP_RETURN
|
|
|
|
plug_in_handle_temp_proc_return (plug_in, msg->data);
|
|
|
|
#else
|
|
|
|
g_warning ("plug_in_handle_message: "
|
|
|
|
"received a temp proc return message (should not happen)");
|
|
|
|
plug_in_close (plug_in, TRUE);
|
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_PROC_INSTALL:
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_handle_proc_install (plug_in, msg->data);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_PROC_UNINSTALL:
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_handle_proc_uninstall (plug_in, msg->data);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GP_EXTENSION_ACK:
|
2002-05-21 18:58:50 +08:00
|
|
|
plug_in_handle_extension_ack (plug_in);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2002-05-21 18:58:50 +08:00
|
|
|
|
2002-02-12 15:59:16 +08:00
|
|
|
case GP_HAS_INIT:
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_handle_has_init (plug_in);
|
2002-05-21 18:58:50 +08:00
|
|
|
break;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_handle_quit (PlugIn *plug_in)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_handle_tile_req (PlugIn *plug_in,
|
|
|
|
GPTileReq *tile_req)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
GPTileData tile_data;
|
|
|
|
GPTileData *tile_info;
|
|
|
|
WireMessage msg;
|
1997-11-25 06:05:25 +08:00
|
|
|
TileManager *tm;
|
2000-05-17 20:29:38 +08:00
|
|
|
Tile *tile;
|
2003-01-30 19:20:12 +08:00
|
|
|
gint shm_ID;
|
|
|
|
|
|
|
|
shm_ID = plug_in_shm_get_ID (plug_in->gimp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (tile_req->drawable_ID == -1)
|
|
|
|
{
|
2002-05-21 18:58:50 +08:00
|
|
|
/* this branch communicates with libgimp/gimptile.c:gimp_tile_put() */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
tile_data.drawable_ID = -1;
|
2000-07-16 20:49:04 +08:00
|
|
|
tile_data.tile_num = 0;
|
|
|
|
tile_data.shadow = 0;
|
|
|
|
tile_data.bpp = 0;
|
|
|
|
tile_data.width = 0;
|
|
|
|
tile_data.height = 0;
|
|
|
|
tile_data.use_shm = (shm_ID == -1) ? FALSE : TRUE;
|
|
|
|
tile_data.data = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-05-17 01:41:38 +08:00
|
|
|
if (! gp_tile_data_write (plug_in->my_write, &tile_data, plug_in))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug_in_handle_tile_req: ERROR");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2002-05-17 01:41:38 +08:00
|
|
|
if (! wire_read_msg (plug_in->my_read, &msg, plug_in))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug_in_handle_tile_req: ERROR");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (msg.type != GP_TILE_DATA)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("expected tile data and received: %d", msg.type);
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
tile_info = msg.data;
|
|
|
|
|
|
|
|
if (tile_info->shadow)
|
2002-03-21 01:46:13 +08:00
|
|
|
tm = gimp_drawable_shadow ((GimpDrawable *)
|
|
|
|
gimp_item_get_by_ID (plug_in->gimp,
|
|
|
|
tile_info->drawable_ID));
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2002-03-21 01:46:13 +08:00
|
|
|
tm = gimp_drawable_data ((GimpDrawable *)
|
|
|
|
gimp_item_get_by_ID (plug_in->gimp,
|
|
|
|
tile_info->drawable_ID));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!tm)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug-in requested invalid drawable (killing)");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1998-08-16 03:17:36 +08:00
|
|
|
tile = tile_manager_get (tm, tile_info->tile_num, TRUE, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
if (!tile)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug-in requested invalid tile (killing)");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tile_data.use_shm)
|
2003-01-30 19:20:12 +08:00
|
|
|
memcpy (tile_data_pointer (tile, 0, 0),
|
|
|
|
plug_in_shm_get_addr (plug_in->gimp),
|
|
|
|
tile_size (tile));
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2003-01-30 19:20:12 +08:00
|
|
|
memcpy (tile_data_pointer (tile, 0, 0),
|
|
|
|
tile_info->data,
|
|
|
|
tile_size (tile));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-07-10 10:43:12 +08:00
|
|
|
tile_release (tile, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
wire_destroy (&msg);
|
2002-05-17 01:41:38 +08:00
|
|
|
if (! gp_tile_ack_write (plug_in->my_write, plug_in))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug_in_handle_tile_req: ERROR");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-05-21 18:58:50 +08:00
|
|
|
/* this branch communicates with libgimp/gimptile.c:gimp_tile_get() */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (tile_req->shadow)
|
2002-03-21 01:46:13 +08:00
|
|
|
tm = gimp_drawable_shadow ((GimpDrawable *)
|
|
|
|
gimp_item_get_by_ID (plug_in->gimp,
|
|
|
|
tile_req->drawable_ID));
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2002-03-21 01:46:13 +08:00
|
|
|
tm = gimp_drawable_data ((GimpDrawable *)
|
|
|
|
gimp_item_get_by_ID (plug_in->gimp,
|
|
|
|
tile_req->drawable_ID));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
if (! tm)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug-in requested invalid drawable (killing)");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1998-08-16 03:17:36 +08:00
|
|
|
tile = tile_manager_get (tm, tile_req->tile_num, TRUE, FALSE);
|
2002-03-21 01:46:13 +08:00
|
|
|
if (! tile)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug-in requested invalid tile (killing)");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
tile_data.drawable_ID = tile_req->drawable_ID;
|
2000-05-17 20:29:38 +08:00
|
|
|
tile_data.tile_num = tile_req->tile_num;
|
|
|
|
tile_data.shadow = tile_req->shadow;
|
|
|
|
tile_data.bpp = tile_bpp (tile);
|
|
|
|
tile_data.width = tile_ewidth (tile);
|
|
|
|
tile_data.height = tile_eheight (tile);
|
|
|
|
tile_data.use_shm = (shm_ID == -1) ? FALSE : TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (tile_data.use_shm)
|
2003-01-30 19:20:12 +08:00
|
|
|
memcpy (plug_in_shm_get_addr (plug_in->gimp),
|
|
|
|
tile_data_pointer (tile, 0, 0),
|
|
|
|
tile_size (tile));
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
1998-08-12 01:35:34 +08:00
|
|
|
tile_data.data = tile_data_pointer (tile, 0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-05-17 01:41:38 +08:00
|
|
|
if (! gp_tile_data_write (plug_in->my_write, &tile_data, plug_in))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_message ("plug_in_handle_tile_req: ERROR");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1998-07-10 10:43:12 +08:00
|
|
|
tile_release (tile, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-05-17 01:41:38 +08:00
|
|
|
if (! wire_read_msg (plug_in->my_read, &msg, plug_in))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_message ("plug_in_handle_tile_req: ERROR");
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (msg.type != GP_TILE_ACK)
|
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("expected tile ack and received: %d", msg.type);
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
wire_destroy (&msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_handle_proc_run (PlugIn *plug_in,
|
2002-03-21 01:46:13 +08:00
|
|
|
GPProcRun *proc_run)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-12-05 21:02:18 +08:00
|
|
|
const gchar *proc_name = NULL;
|
|
|
|
ProcRecord *proc_rec;
|
|
|
|
Argument *args;
|
|
|
|
Argument *return_vals;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-05-16 19:45:30 +08:00
|
|
|
proc_rec = procedural_db_lookup (plug_in->gimp, proc_run->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-05 21:02:18 +08:00
|
|
|
if (! proc_rec)
|
|
|
|
{
|
|
|
|
proc_name = g_hash_table_lookup (plug_in->gimp->procedural_compat_ht,
|
|
|
|
proc_run->name);
|
|
|
|
|
|
|
|
if (proc_name)
|
2003-12-06 01:08:35 +08:00
|
|
|
{
|
|
|
|
proc_rec = procedural_db_lookup (plug_in->gimp, proc_name);
|
|
|
|
|
|
|
|
if (plug_in->gimp->pdb_compat_mode == GIMP_PDB_COMPAT_WARN)
|
|
|
|
{
|
|
|
|
g_message ("WARNING: Plug-In '%s'\n\n(%s)\n\n"
|
|
|
|
"called deprecated procedure '%s'.\n"
|
|
|
|
"It should call '%s' instead!",
|
|
|
|
plug_in->name, plug_in->prog,
|
|
|
|
proc_run->name, proc_name);
|
|
|
|
}
|
|
|
|
}
|
2003-12-05 21:02:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (! proc_name)
|
|
|
|
proc_name = proc_run->name;
|
|
|
|
|
|
|
|
args = plug_in_params_to_args (proc_run->params, proc_run->nparams, FALSE);
|
|
|
|
|
2003-02-11 20:07:31 +08:00
|
|
|
plug_in_push (plug_in->gimp, plug_in);
|
2003-02-03 21:21:31 +08:00
|
|
|
|
|
|
|
/* Execute the procedure even if procedural_db_lookup() returned NULL,
|
|
|
|
* procedural_db_execute() will return appropriate error return_vals.
|
|
|
|
*/
|
2003-12-05 21:02:18 +08:00
|
|
|
return_vals = procedural_db_execute (plug_in->gimp, proc_name, args);
|
2003-02-03 21:21:31 +08:00
|
|
|
|
2003-02-11 20:07:31 +08:00
|
|
|
plug_in_pop (plug_in->gimp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (return_vals)
|
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
GPProcReturn proc_return;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_return.name = proc_run->name;
|
|
|
|
|
|
|
|
if (proc_rec)
|
|
|
|
{
|
|
|
|
proc_return.nparams = proc_rec->num_values + 1;
|
2003-01-30 19:20:12 +08:00
|
|
|
proc_return.params = plug_in_args_to_params (return_vals,
|
|
|
|
proc_return.nparams,
|
|
|
|
FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
proc_return.nparams = 1;
|
2003-01-30 19:20:12 +08:00
|
|
|
proc_return.params = plug_in_args_to_params (return_vals, 1, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2002-05-17 01:41:38 +08:00
|
|
|
if (! gp_proc_return_write (plug_in->my_write, &proc_return, plug_in))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_warning ("plug_in_handle_proc_run: ERROR");
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
plug_in_args_destroy (args, proc_run->nparams, FALSE);
|
2003-01-30 19:20:12 +08:00
|
|
|
|
|
|
|
if (proc_rec)
|
|
|
|
plug_in_args_destroy (return_vals, proc_rec->num_values + 1, TRUE);
|
|
|
|
else
|
|
|
|
plug_in_args_destroy (return_vals, 1, TRUE);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
plug_in_params_destroy (proc_return.params, proc_return.nparams, FALSE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
PlugInBlocked *blocked;
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
blocked = g_new0 (PlugInBlocked, 1);
|
|
|
|
|
2002-05-16 19:45:30 +08:00
|
|
|
blocked->plug_in = plug_in;
|
1997-11-25 06:05:25 +08:00
|
|
|
blocked->proc_name = g_strdup (proc_run->name);
|
2002-03-21 01:46:13 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
blocked_plug_ins = g_slist_prepend (blocked_plug_ins, blocked);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in_handle_proc_return_priv (PlugIn *plug_in,
|
|
|
|
GPProcReturn *proc_return)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-06-24 02:27:03 +08:00
|
|
|
if (plug_in->recurse_main_loop || plug_in->temp_main_loops)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in->return_vals = plug_in_params_to_args (proc_return->params,
|
|
|
|
proc_return->nparams,
|
|
|
|
TRUE);
|
|
|
|
plug_in->n_return_vals = proc_return->nparams;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
for (list = blocked_plug_ins; list; list = g_slist_next (list))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-30 19:20:12 +08:00
|
|
|
PlugInBlocked *blocked;
|
|
|
|
|
|
|
|
blocked = (PlugInBlocked *) list->data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-11-14 23:33:40 +08:00
|
|
|
if (blocked->proc_name && proc_return->name &&
|
2001-01-14 23:18:37 +08:00
|
|
|
strcmp (blocked->proc_name, proc_return->name) == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-05-16 19:45:30 +08:00
|
|
|
if (! gp_proc_return_write (blocked->plug_in->my_write,
|
2002-05-17 01:41:38 +08:00
|
|
|
proc_return,
|
|
|
|
blocked->plug_in))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-06 07:41:45 +08:00
|
|
|
g_message ("plug_in_handle_proc_run: ERROR");
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_close (blocked->plug_in, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
2002-05-16 19:45:30 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
blocked_plug_ins = g_slist_remove (blocked_plug_ins, blocked);
|
|
|
|
g_free (blocked->proc_name);
|
|
|
|
g_free (blocked);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
static void
|
|
|
|
plug_in_handle_proc_return (PlugIn *plug_in,
|
|
|
|
GPProcReturn *proc_return)
|
|
|
|
{
|
|
|
|
plug_in_handle_proc_return_priv (plug_in, proc_return);
|
|
|
|
|
2003-06-24 02:27:03 +08:00
|
|
|
if (plug_in->recurse_main_loop)
|
|
|
|
g_main_loop_quit (plug_in->recurse_main_loop);
|
2003-01-30 19:20:12 +08:00
|
|
|
|
|
|
|
plug_in_close (plug_in, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef ENABLE_TEMP_RETURN
|
|
|
|
static void
|
|
|
|
plug_in_handle_temp_proc_return (PlugIn *plug_in,
|
|
|
|
GPProcReturn *proc_return)
|
|
|
|
{
|
2003-06-24 02:27:03 +08:00
|
|
|
if (plug_in->temp_main_loops)
|
2003-02-03 21:21:31 +08:00
|
|
|
{
|
|
|
|
plug_in_handle_proc_return_priv (plug_in, proc_return);
|
|
|
|
|
|
|
|
plug_in_main_loop_quit (plug_in);
|
|
|
|
}
|
|
|
|
else
|
2003-01-30 19:20:12 +08:00
|
|
|
{
|
|
|
|
g_warning ("plug_in_handle_temp_proc_return: "
|
2003-02-03 21:21:31 +08:00
|
|
|
"received a temp_proc_return mesage while not running "
|
|
|
|
"a temp proc (should not happen)");
|
2003-01-30 19:20:12 +08:00
|
|
|
plug_in_close (plug_in, TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_handle_proc_install (PlugIn *plug_in,
|
2002-03-21 01:46:13 +08:00
|
|
|
GPProcInstall *proc_install)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-12-11 00:38:16 +08:00
|
|
|
PlugInDef *plug_in_def = NULL;
|
2003-01-20 20:17:32 +08:00
|
|
|
PlugInProcDef *proc_def = NULL;
|
|
|
|
ProcRecord *proc = NULL;
|
|
|
|
GSList *tmp = NULL;
|
|
|
|
gchar *prog = NULL;
|
|
|
|
gboolean valid_utf8 = FALSE;
|
2002-12-11 00:38:16 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* Argument checking
|
1997-11-25 06:05:25 +08:00
|
|
|
* --only sanity check arguments when the procedure requests a menu path
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (proc_install->menu_path)
|
|
|
|
{
|
|
|
|
if (strncmp (proc_install->menu_path, "<Toolbox>", 9) == 0)
|
|
|
|
{
|
|
|
|
if ((proc_install->nparams < 1) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[0].type != GIMP_PDB_INT32))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
2003-11-14 23:33:40 +08:00
|
|
|
"attempted to install <Toolbox> procedure \"%s\" "
|
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
|
|
|
"which does not take the standard <Toolbox> Plug-In "
|
|
|
|
"args.\n"
|
|
|
|
"(INT32)",
|
2003-02-11 09:21:21 +08:00
|
|
|
plug_in->name,
|
|
|
|
plug_in->prog,
|
2000-05-17 20:29:38 +08:00
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (strncmp (proc_install->menu_path, "<Image>", 7) == 0)
|
|
|
|
{
|
|
|
|
if ((proc_install->nparams < 3) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
|
|
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
|
|
|
(proc_install->params[2].type != GIMP_PDB_DRAWABLE))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
2003-11-14 23:33:40 +08:00
|
|
|
"attempted to install <Image> procedure \"%s\" "
|
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
|
|
|
"which does not take the standard <Image> Plug-In "
|
|
|
|
"args.\n"
|
|
|
|
"(INT32, IMAGE, DRAWABLE)",
|
2003-02-11 09:21:21 +08:00
|
|
|
plug_in->name,
|
|
|
|
plug_in->prog,
|
2000-05-17 20:29:38 +08:00
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (strncmp (proc_install->menu_path, "<Load>", 6) == 0)
|
|
|
|
{
|
|
|
|
if ((proc_install->nparams < 3) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
|
|
|
(proc_install->params[1].type != GIMP_PDB_STRING) ||
|
|
|
|
(proc_install->params[2].type != GIMP_PDB_STRING))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
2003-11-14 23:33:40 +08:00
|
|
|
"attempted to install <Load> procedure \"%s\" "
|
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
|
|
|
"which does not take the standard <Load> Plug-In "
|
|
|
|
"args.\n"
|
|
|
|
"(INT32, STRING, STRING)",
|
2003-02-11 09:21:21 +08:00
|
|
|
plug_in->name,
|
|
|
|
plug_in->prog,
|
2000-05-17 20:29:38 +08:00
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (strncmp (proc_install->menu_path, "<Save>", 6) == 0)
|
|
|
|
{
|
|
|
|
if ((proc_install->nparams < 5) ||
|
2001-09-03 08:26:06 +08:00
|
|
|
(proc_install->params[0].type != GIMP_PDB_INT32) ||
|
|
|
|
(proc_install->params[1].type != GIMP_PDB_IMAGE) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[2].type != GIMP_PDB_DRAWABLE) ||
|
2001-09-03 08:26:06 +08:00
|
|
|
(proc_install->params[3].type != GIMP_PDB_STRING) ||
|
2001-05-21 21:58:46 +08:00
|
|
|
(proc_install->params[4].type != GIMP_PDB_STRING))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
2003-11-14 23:33:40 +08:00
|
|
|
"attempted to install <Save> procedure \"%s\" "
|
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
|
|
|
"which does not take the standard <Save> Plug-In "
|
|
|
|
"args.\n"
|
|
|
|
"(INT32, IMAGE, DRAWABLE, STRING, STRING)",
|
2003-02-11 09:21:21 +08:00
|
|
|
plug_in->name,
|
|
|
|
plug_in->prog,
|
2000-05-17 20:29:38 +08:00
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
2003-11-14 23:33:40 +08:00
|
|
|
"attempted to install procedure \"%s\" "
|
2000-05-17 20:29:38 +08:00
|
|
|
"in an invalid menu location.\n"
|
|
|
|
"Use either \"<Toolbox>\", \"<Image>\", "
|
1999-09-23 19:49:16 +08:00
|
|
|
"\"<Load>\", or \"<Save>\".",
|
2003-02-11 09:21:21 +08:00
|
|
|
plug_in->name,
|
|
|
|
plug_in->prog,
|
2000-05-17 20:29:38 +08:00
|
|
|
proc_install->name);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* Sanity check for array arguments */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-11-14 23:33:40 +08:00
|
|
|
for (i = 1; i < proc_install->nparams; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
if ((proc_install->params[i].type == GIMP_PDB_INT32ARRAY ||
|
2001-09-03 08:26:06 +08:00
|
|
|
proc_install->params[i].type == GIMP_PDB_INT8ARRAY ||
|
2001-05-21 21:58:46 +08:00
|
|
|
proc_install->params[i].type == GIMP_PDB_FLOATARRAY ||
|
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
|
|
|
proc_install->params[i].type == GIMP_PDB_STRINGARRAY)
|
2001-09-03 08:26:06 +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
|
|
|
proc_install->params[i-1].type != GIMP_PDB_INT32)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-17 20:29:38 +08:00
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
2003-11-14 23:33:40 +08:00
|
|
|
"attempted to install procedure \"%s\" "
|
|
|
|
"which fails to comply with the array parameter "
|
|
|
|
"passing standard. Argument %d is noncompliant.",
|
2003-02-11 09:21:21 +08:00
|
|
|
plug_in->name,
|
|
|
|
plug_in->prog,
|
2000-05-17 20:29:38 +08:00
|
|
|
proc_install->name, i);
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2001-09-03 08:26:06 +08:00
|
|
|
|
|
|
|
/* Sanity check strings for UTF-8 validity */
|
|
|
|
|
2003-11-14 23:33:40 +08:00
|
|
|
if ((proc_install->menu_path == NULL ||
|
2001-09-03 08:26:06 +08:00
|
|
|
g_utf8_validate (proc_install->menu_path, -1, NULL)) &&
|
|
|
|
(g_utf8_validate (proc_install->name, -1, NULL)) &&
|
2003-11-14 23:33:40 +08:00
|
|
|
(proc_install->blurb == NULL ||
|
2001-09-03 08:26:06 +08:00
|
|
|
g_utf8_validate (proc_install->blurb, -1, NULL)) &&
|
2003-11-14 23:33:40 +08:00
|
|
|
(proc_install->help == NULL ||
|
2001-09-03 08:26:06 +08:00
|
|
|
g_utf8_validate (proc_install->help, -1, NULL)) &&
|
|
|
|
(proc_install->author == NULL ||
|
|
|
|
g_utf8_validate (proc_install->author, -1, NULL)) &&
|
2003-11-14 23:33:40 +08:00
|
|
|
(proc_install->copyright == NULL ||
|
2001-09-03 08:26:06 +08:00
|
|
|
g_utf8_validate (proc_install->copyright, -1, NULL)) &&
|
|
|
|
(proc_install->date == NULL ||
|
|
|
|
g_utf8_validate (proc_install->date, -1, NULL)))
|
|
|
|
{
|
2003-01-20 20:17:32 +08:00
|
|
|
valid_utf8 = TRUE;
|
2001-09-03 08:26:06 +08:00
|
|
|
|
2003-01-20 20:17:32 +08:00
|
|
|
for (i = 0; i < proc_install->nparams && valid_utf8; i++)
|
2001-09-03 08:26:06 +08:00
|
|
|
{
|
|
|
|
if (! (g_utf8_validate (proc_install->params[i].name, -1, NULL) &&
|
2003-11-14 23:33:40 +08:00
|
|
|
(proc_install->params[i].description == NULL ||
|
2001-09-03 08:26:06 +08:00
|
|
|
g_utf8_validate (proc_install->params[i].description, -1, NULL))))
|
2003-01-20 20:17:32 +08:00
|
|
|
valid_utf8 = FALSE;
|
2001-09-03 08:26:06 +08:00
|
|
|
}
|
2003-01-30 19:20:12 +08:00
|
|
|
|
2003-01-20 20:17:32 +08:00
|
|
|
for (i = 0; i < proc_install->nreturn_vals && valid_utf8; i++)
|
2001-09-03 08:26:06 +08:00
|
|
|
{
|
|
|
|
if (! (g_utf8_validate (proc_install->return_vals[i].name, -1, NULL) &&
|
|
|
|
(proc_install->return_vals[i].description == NULL ||
|
|
|
|
g_utf8_validate (proc_install->return_vals[i].description, -1, NULL))))
|
2003-01-20 20:17:32 +08:00
|
|
|
valid_utf8 = FALSE;
|
2001-09-03 08:26:06 +08:00
|
|
|
}
|
|
|
|
}
|
2003-11-14 23:33:40 +08:00
|
|
|
|
2003-01-20 20:17:32 +08:00
|
|
|
if (! valid_utf8)
|
2001-09-03 08:26:06 +08:00
|
|
|
{
|
|
|
|
g_message ("Plug-In \"%s\"\n(%s)\n"
|
2003-11-14 23:33:40 +08:00
|
|
|
"attempted to install a procedure with invalid UTF-8 strings.",
|
2003-02-11 09:21:21 +08:00
|
|
|
plug_in->name,
|
|
|
|
plug_in->prog);
|
2001-09-03 08:26:06 +08:00
|
|
|
return;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* Initialization */
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (proc_install->type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PLUGIN:
|
|
|
|
case GIMP_EXTENSION:
|
2003-01-18 02:07:37 +08:00
|
|
|
plug_in_def = plug_in->plug_in_def;
|
|
|
|
prog = plug_in_def->prog;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
tmp = plug_in_def->proc_defs;
|
|
|
|
break;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_TEMPORARY:
|
2003-01-18 02:07:37 +08:00
|
|
|
plug_in_def = NULL;
|
|
|
|
prog = "none";
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-05-16 19:45:30 +08:00
|
|
|
tmp = plug_in->temp_proc_defs;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (tmp)
|
|
|
|
{
|
|
|
|
proc_def = tmp->data;
|
|
|
|
tmp = tmp->next;
|
|
|
|
|
|
|
|
if (strcmp (proc_def->db_info.name, proc_install->name) == 0)
|
|
|
|
{
|
2003-02-03 21:21:31 +08:00
|
|
|
switch (proc_install->type)
|
2003-01-18 02:07:37 +08:00
|
|
|
{
|
2003-02-03 21:21:31 +08:00
|
|
|
case GIMP_PLUGIN:
|
|
|
|
case GIMP_EXTENSION:
|
2003-01-18 02:07:37 +08:00
|
|
|
plug_in_def->proc_defs = g_slist_remove (plug_in_def->proc_defs,
|
|
|
|
proc_def);
|
|
|
|
plug_in_proc_def_free (proc_def);
|
2003-02-03 21:21:31 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_TEMPORARY:
|
|
|
|
plug_in->temp_proc_defs = g_slist_remove (plug_in->temp_proc_defs,
|
|
|
|
proc_def);
|
|
|
|
plug_ins_temp_proc_def_remove (plug_in->gimp, proc_def);
|
|
|
|
break;
|
2003-01-18 02:07:37 +08:00
|
|
|
}
|
2000-02-25 00:11:26 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-01-18 02:07:37 +08:00
|
|
|
proc_def = plug_in_proc_def_new ();
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-02-03 21:21:31 +08:00
|
|
|
proc_def->prog = g_strdup (prog);
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc_def->menu_path = g_strdup (proc_install->menu_path);
|
|
|
|
proc_def->accelerator = NULL;
|
|
|
|
proc_def->extensions = NULL;
|
|
|
|
proc_def->prefixes = NULL;
|
|
|
|
proc_def->magics = NULL;
|
|
|
|
proc_def->image_types = g_strdup (proc_install->image_types);
|
2002-03-21 01:46:13 +08:00
|
|
|
proc_def->image_types_val = plug_ins_image_types_parse (proc_def->image_types);
|
1999-01-31 09:08:26 +08:00
|
|
|
/* Install temp one use todays time */
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc_def->mtime = time (NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
/* The procedural database procedure */
|
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
proc = &proc_def->db_info;
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->name = g_strdup (proc_install->name);
|
|
|
|
proc->blurb = g_strdup (proc_install->blurb);
|
|
|
|
proc->help = g_strdup (proc_install->help);
|
|
|
|
proc->author = g_strdup (proc_install->author);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->copyright = g_strdup (proc_install->copyright);
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->date = g_strdup (proc_install->date);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->proc_type = proc_install->type;
|
|
|
|
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->num_args = proc_install->nparams;
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->num_values = proc_install->nreturn_vals;
|
|
|
|
|
2003-01-18 02:07:37 +08:00
|
|
|
proc->args = g_new0 (ProcArg, proc->num_args);
|
|
|
|
proc->values = g_new0 (ProcArg, proc->num_values);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
for (i = 0; i < proc->num_args; i++)
|
|
|
|
{
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->args[i].arg_type = proc_install->params[i].type;
|
|
|
|
proc->args[i].name = g_strdup (proc_install->params[i].name);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->args[i].description = g_strdup (proc_install->params[i].description);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < proc->num_values; i++)
|
|
|
|
{
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
proc->values[i].arg_type = proc_install->return_vals[i].type;
|
|
|
|
proc->values[i].name = g_strdup (proc_install->return_vals[i].name);
|
1997-11-25 06:05:25 +08:00
|
|
|
proc->values[i].description = g_strdup (proc_install->return_vals[i].description);
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (proc_install->type)
|
|
|
|
{
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_PLUGIN:
|
|
|
|
case GIMP_EXTENSION:
|
2003-01-18 02:07:37 +08:00
|
|
|
plug_in_def->proc_defs = g_slist_prepend (plug_in_def->proc_defs,
|
|
|
|
proc_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
2001-05-21 21:58:46 +08:00
|
|
|
case GIMP_TEMPORARY:
|
2003-01-18 02:07:37 +08:00
|
|
|
plug_in->temp_proc_defs = g_slist_prepend (plug_in->temp_proc_defs,
|
|
|
|
proc_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-05-16 19:45:30 +08:00
|
|
|
proc->exec_method.temporary.plug_in = plug_in;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-08-26 00:28:46 +08:00
|
|
|
plug_ins_temp_proc_def_add (plug_in->gimp, proc_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_handle_proc_uninstall (PlugIn *plug_in,
|
2002-03-21 01:46:13 +08:00
|
|
|
GPProcUninstall *proc_uninstall)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-18 02:07:37 +08:00
|
|
|
GSList *tmp;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-05-21 18:58:50 +08:00
|
|
|
for (tmp = plug_in->temp_proc_defs; tmp; tmp = g_slist_next (tmp))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-18 02:07:37 +08:00
|
|
|
PlugInProcDef *proc_def;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_def = tmp->data;
|
|
|
|
|
2002-05-21 18:58:50 +08:00
|
|
|
if (! strcmp (proc_def->db_info.name, proc_uninstall->name))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in->temp_proc_defs = g_slist_remove (plug_in->temp_proc_defs,
|
|
|
|
proc_def);
|
2003-01-18 02:07:37 +08:00
|
|
|
plug_ins_temp_proc_def_remove (plug_in->gimp, proc_def);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-03-21 01:46:13 +08:00
|
|
|
|
2002-05-21 18:58:50 +08:00
|
|
|
static void
|
|
|
|
plug_in_handle_extension_ack (PlugIn *plug_in)
|
|
|
|
{
|
2003-06-24 02:27:03 +08:00
|
|
|
if (plug_in->ext_main_loop)
|
2003-02-03 21:21:31 +08:00
|
|
|
{
|
2003-06-24 02:27:03 +08:00
|
|
|
g_main_loop_quit (plug_in->ext_main_loop);
|
2003-02-03 21:21:31 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("plug_in_handle_extension_ack: "
|
|
|
|
"received an extension_ack message while not starting "
|
|
|
|
"an extension (should not happen)");
|
|
|
|
plug_in_close (plug_in, TRUE);
|
|
|
|
}
|
2002-05-21 18:58:50 +08:00
|
|
|
}
|
|
|
|
|
2002-02-12 15:59:16 +08:00
|
|
|
static void
|
2002-05-16 19:45:30 +08:00
|
|
|
plug_in_handle_has_init (PlugIn *plug_in)
|
2002-02-12 15:59:16 +08:00
|
|
|
{
|
2003-01-18 02:07:37 +08:00
|
|
|
if (plug_in->query)
|
2003-02-03 21:21:31 +08:00
|
|
|
{
|
|
|
|
plug_in_def_set_has_init (plug_in->plug_in_def, TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("plug_in_handle_has_init: "
|
|
|
|
"received a has_init message while not in query() "
|
|
|
|
"(should not happen)");
|
|
|
|
plug_in_close (plug_in, TRUE);
|
|
|
|
}
|
2002-02-12 15:59:16 +08:00
|
|
|
}
|