mirror of https://github.com/GNOME/gimp.git
app/plug-in/Makefile.am removed...
2006-04-29 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-run.[ch]: removed... * app/plug-in/gimppluginmanager-run.[ch]: ...and added as methods of GimpPlugInManager. * app/pdb/gimppluginprocedure.c * app/pdb/gimptemporaryprocedure.c: changed accordingly.
This commit is contained in:
parent
8d33bc6100
commit
b05baea60a
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2006-04-29 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/plug-in/Makefile.am
|
||||
* app/plug-in/plug-in-run.[ch]: removed...
|
||||
|
||||
* app/plug-in/gimppluginmanager-run.[ch]: ...and added as methods
|
||||
of GimpPlugInManager.
|
||||
|
||||
* app/pdb/gimppluginprocedure.c
|
||||
* app/pdb/gimptemporaryprocedure.c: changed accordingly.
|
||||
|
||||
2006-04-29 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/dialogs/user-install-dialog.[ch]: removed unused code and
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
#include "core/gimpmarshal.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
|
||||
#define __YES_I_NEED_GIMP_PLUG_IN_MANAGER_RUN__
|
||||
#include "plug-in/gimppluginmanager-run.h"
|
||||
#include "plug-in/plug-in.h"
|
||||
#define __YES_I_NEED_PLUG_IN_RUN__
|
||||
#include "plug-in/plug-in-run.h"
|
||||
|
||||
#include "gimppluginprocedure.h"
|
||||
|
||||
|
@ -217,9 +217,9 @@ gimp_plug_in_procedure_execute (GimpProcedure *procedure,
|
|||
context, progress,
|
||||
args);
|
||||
|
||||
return plug_in_run (gimp->plug_in_manager, context, progress,
|
||||
GIMP_PLUG_IN_PROCEDURE (procedure),
|
||||
args, TRUE, FALSE, -1);
|
||||
return gimp_plug_in_manager_run (gimp->plug_in_manager, context, progress,
|
||||
GIMP_PLUG_IN_PROCEDURE (procedure),
|
||||
args, TRUE, FALSE, -1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -230,9 +230,9 @@ gimp_plug_in_procedure_execute_async (GimpProcedure *procedure,
|
|||
GValueArray *args,
|
||||
gint32 display_ID)
|
||||
{
|
||||
plug_in_run (gimp->plug_in_manager, context, progress,
|
||||
GIMP_PLUG_IN_PROCEDURE (procedure),
|
||||
args, FALSE, TRUE, display_ID);
|
||||
gimp_plug_in_manager_run (gimp->plug_in_manager, context, progress,
|
||||
GIMP_PLUG_IN_PROCEDURE (procedure),
|
||||
args, FALSE, TRUE, display_ID);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
#include "core/gimp.h"
|
||||
|
||||
#define __YES_I_NEED_GIMP_PLUG_IN_MANAGER_RUN__
|
||||
#include "plug-in/gimppluginmanager-run.h"
|
||||
#include "plug-in/plug-in.h"
|
||||
#define __YES_I_NEED_PLUG_IN_RUN__
|
||||
#include "plug-in/plug-in-run.h"
|
||||
|
||||
#include "gimptemporaryprocedure.h"
|
||||
|
||||
|
@ -94,9 +94,10 @@ gimp_temporary_procedure_execute (GimpProcedure *procedure,
|
|||
GimpProgress *progress,
|
||||
GValueArray *args)
|
||||
{
|
||||
return plug_in_run_temp (gimp->plug_in_manager, context, progress,
|
||||
GIMP_TEMPORARY_PROCEDURE (procedure),
|
||||
args);
|
||||
return gimp_plug_in_manager_run_temp (gimp->plug_in_manager,
|
||||
context, progress,
|
||||
GIMP_TEMPORARY_PROCEDURE (procedure),
|
||||
args);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -109,9 +110,10 @@ gimp_temporary_procedure_execute_async (GimpProcedure *procedure,
|
|||
{
|
||||
GValueArray *return_vals;
|
||||
|
||||
return_vals = plug_in_run_temp (gimp->plug_in_manager, context, progress,
|
||||
GIMP_TEMPORARY_PROCEDURE (procedure),
|
||||
args);
|
||||
return_vals = gimp_plug_in_manager_run_temp (gimp->plug_in_manager,
|
||||
context, progress,
|
||||
GIMP_TEMPORARY_PROCEDURE (procedure),
|
||||
args);
|
||||
|
||||
g_value_array_free (return_vals);
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ libappplug_in_a_SOURCES = \
|
|||
gimppluginmanager-locale-domain.h \
|
||||
gimppluginmanager-menu-branch.c \
|
||||
gimppluginmanager-menu-branch.h \
|
||||
gimppluginmanager-run.c \
|
||||
gimppluginmanager-run.h \
|
||||
gimppluginmanager-query.c \
|
||||
gimppluginmanager-query.h \
|
||||
gimppluginshm.c \
|
||||
|
@ -57,9 +59,7 @@ libappplug_in_a_SOURCES = \
|
|||
plug-in-progress.c \
|
||||
plug-in-progress.h \
|
||||
plug-in-rc.c \
|
||||
plug-in-rc.h \
|
||||
plug-in-run.c \
|
||||
plug-in-run.h
|
||||
plug-in-rc.h
|
||||
|
||||
EXTRA_DIST = makefile.msc
|
||||
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
#include "pdb/gimptemporaryprocedure.h"
|
||||
|
||||
#include "gimppluginmanager.h"
|
||||
#define __YES_I_NEED_GIMP_PLUG_IN_MANAGER_RUN__
|
||||
#include "gimppluginmanager-run.h"
|
||||
#include "plug-in.h"
|
||||
#include "plug-in-params.h"
|
||||
#define __YES_I_NEED_PLUG_IN_RUN__
|
||||
#include "plug-in-run.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
@ -50,14 +50,14 @@
|
|||
/* public functions */
|
||||
|
||||
GValueArray *
|
||||
plug_in_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID)
|
||||
gimp_plug_in_manager_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID)
|
||||
{
|
||||
GValueArray *return_vals = NULL;
|
||||
PlugIn *plug_in;
|
||||
|
@ -184,11 +184,11 @@ plug_in_run (GimpPlugInManager *manager,
|
|||
}
|
||||
|
||||
GValueArray *
|
||||
plug_in_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args)
|
||||
gimp_plug_in_manager_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args)
|
||||
{
|
||||
GValueArray *return_vals = NULL;
|
||||
PlugIn *plug_in;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* plug-in-run.h
|
||||
* gimppluginmanager-run.h
|
||||
*
|
||||
* 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
|
||||
|
@ -18,32 +18,32 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PLUG_IN_RUN_H__
|
||||
#define __PLUG_IN_RUN_H__
|
||||
#ifndef __GIMP_PLUG_IN_MANAGER_RUN_H__
|
||||
#define __GIMP_PLUG_IN_MANAGER_RUN_H__
|
||||
|
||||
#ifndef __YES_I_NEED_PLUG_IN_RUN__
|
||||
#error Do not use plug_in_run*(), use gimp_procedure_execute*() instead.
|
||||
#ifndef __YES_I_NEED_GIMP_PLUG_IN_MANAGER_RUN__
|
||||
#error Do not use gimp_plug_in_manager_run*(), use gimp_procedure_execute*() instead.
|
||||
#endif
|
||||
|
||||
|
||||
/* Run a plug-in as if it were a procedure database procedure
|
||||
*/
|
||||
GValueArray * plug_in_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID);
|
||||
GValueArray * gimp_plug_in_manager_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID);
|
||||
|
||||
/* Run a temp plug-in proc as if it were a procedure database procedure
|
||||
*/
|
||||
GValueArray * plug_in_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args);
|
||||
GValueArray * gimp_plug_in_manager_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args);
|
||||
|
||||
|
||||
#endif /* __PLUG_IN_RUN_H__ */
|
||||
#endif /* __GIMP_PLUG_IN_MANAGER_RUN_H__ */
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
#include "pdb/gimptemporaryprocedure.h"
|
||||
|
||||
#include "gimppluginmanager.h"
|
||||
#define __YES_I_NEED_GIMP_PLUG_IN_MANAGER_RUN__
|
||||
#include "gimppluginmanager-run.h"
|
||||
#include "plug-in.h"
|
||||
#include "plug-in-params.h"
|
||||
#define __YES_I_NEED_PLUG_IN_RUN__
|
||||
#include "plug-in-run.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
@ -50,14 +50,14 @@
|
|||
/* public functions */
|
||||
|
||||
GValueArray *
|
||||
plug_in_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID)
|
||||
gimp_plug_in_manager_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID)
|
||||
{
|
||||
GValueArray *return_vals = NULL;
|
||||
PlugIn *plug_in;
|
||||
|
@ -184,11 +184,11 @@ plug_in_run (GimpPlugInManager *manager,
|
|||
}
|
||||
|
||||
GValueArray *
|
||||
plug_in_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args)
|
||||
gimp_plug_in_manager_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args)
|
||||
{
|
||||
GValueArray *return_vals = NULL;
|
||||
PlugIn *plug_in;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* plug-in-run.h
|
||||
* gimppluginmanager-run.h
|
||||
*
|
||||
* 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
|
||||
|
@ -18,32 +18,32 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PLUG_IN_RUN_H__
|
||||
#define __PLUG_IN_RUN_H__
|
||||
#ifndef __GIMP_PLUG_IN_MANAGER_RUN_H__
|
||||
#define __GIMP_PLUG_IN_MANAGER_RUN_H__
|
||||
|
||||
#ifndef __YES_I_NEED_PLUG_IN_RUN__
|
||||
#error Do not use plug_in_run*(), use gimp_procedure_execute*() instead.
|
||||
#ifndef __YES_I_NEED_GIMP_PLUG_IN_MANAGER_RUN__
|
||||
#error Do not use gimp_plug_in_manager_run*(), use gimp_procedure_execute*() instead.
|
||||
#endif
|
||||
|
||||
|
||||
/* Run a plug-in as if it were a procedure database procedure
|
||||
*/
|
||||
GValueArray * plug_in_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID);
|
||||
GValueArray * gimp_plug_in_manager_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID);
|
||||
|
||||
/* Run a temp plug-in proc as if it were a procedure database procedure
|
||||
*/
|
||||
GValueArray * plug_in_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args);
|
||||
GValueArray * gimp_plug_in_manager_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args);
|
||||
|
||||
|
||||
#endif /* __PLUG_IN_RUN_H__ */
|
||||
#endif /* __GIMP_PLUG_IN_MANAGER_RUN_H__ */
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
#include "core/gimpmarshal.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
|
||||
#define __YES_I_NEED_GIMP_PLUG_IN_MANAGER_RUN__
|
||||
#include "plug-in/gimppluginmanager-run.h"
|
||||
#include "plug-in/plug-in.h"
|
||||
#define __YES_I_NEED_PLUG_IN_RUN__
|
||||
#include "plug-in/plug-in-run.h"
|
||||
|
||||
#include "gimppluginprocedure.h"
|
||||
|
||||
|
@ -217,9 +217,9 @@ gimp_plug_in_procedure_execute (GimpProcedure *procedure,
|
|||
context, progress,
|
||||
args);
|
||||
|
||||
return plug_in_run (gimp->plug_in_manager, context, progress,
|
||||
GIMP_PLUG_IN_PROCEDURE (procedure),
|
||||
args, TRUE, FALSE, -1);
|
||||
return gimp_plug_in_manager_run (gimp->plug_in_manager, context, progress,
|
||||
GIMP_PLUG_IN_PROCEDURE (procedure),
|
||||
args, TRUE, FALSE, -1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -230,9 +230,9 @@ gimp_plug_in_procedure_execute_async (GimpProcedure *procedure,
|
|||
GValueArray *args,
|
||||
gint32 display_ID)
|
||||
{
|
||||
plug_in_run (gimp->plug_in_manager, context, progress,
|
||||
GIMP_PLUG_IN_PROCEDURE (procedure),
|
||||
args, FALSE, TRUE, display_ID);
|
||||
gimp_plug_in_manager_run (gimp->plug_in_manager, context, progress,
|
||||
GIMP_PLUG_IN_PROCEDURE (procedure),
|
||||
args, FALSE, TRUE, display_ID);
|
||||
}
|
||||
|
||||
const gchar *
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
#include "core/gimp.h"
|
||||
|
||||
#define __YES_I_NEED_GIMP_PLUG_IN_MANAGER_RUN__
|
||||
#include "plug-in/gimppluginmanager-run.h"
|
||||
#include "plug-in/plug-in.h"
|
||||
#define __YES_I_NEED_PLUG_IN_RUN__
|
||||
#include "plug-in/plug-in-run.h"
|
||||
|
||||
#include "gimptemporaryprocedure.h"
|
||||
|
||||
|
@ -94,9 +94,10 @@ gimp_temporary_procedure_execute (GimpProcedure *procedure,
|
|||
GimpProgress *progress,
|
||||
GValueArray *args)
|
||||
{
|
||||
return plug_in_run_temp (gimp->plug_in_manager, context, progress,
|
||||
GIMP_TEMPORARY_PROCEDURE (procedure),
|
||||
args);
|
||||
return gimp_plug_in_manager_run_temp (gimp->plug_in_manager,
|
||||
context, progress,
|
||||
GIMP_TEMPORARY_PROCEDURE (procedure),
|
||||
args);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -109,9 +110,10 @@ gimp_temporary_procedure_execute_async (GimpProcedure *procedure,
|
|||
{
|
||||
GValueArray *return_vals;
|
||||
|
||||
return_vals = plug_in_run_temp (gimp->plug_in_manager, context, progress,
|
||||
GIMP_TEMPORARY_PROCEDURE (procedure),
|
||||
args);
|
||||
return_vals = gimp_plug_in_manager_run_temp (gimp->plug_in_manager,
|
||||
context, progress,
|
||||
GIMP_TEMPORARY_PROCEDURE (procedure),
|
||||
args);
|
||||
|
||||
g_value_array_free (return_vals);
|
||||
}
|
||||
|
|
|
@ -1,247 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* plug-in-run.c
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "libgimpbase/gimpbase.h"
|
||||
#include "libgimpbase/gimpprotocol.h"
|
||||
#include "libgimpbase/gimpwire.h"
|
||||
|
||||
#include "plug-in-types.h"
|
||||
|
||||
#include "config/gimpguiconfig.h"
|
||||
|
||||
#include "base/tile.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpprogress.h"
|
||||
|
||||
#include "pdb/gimptemporaryprocedure.h"
|
||||
|
||||
#include "gimppluginmanager.h"
|
||||
#include "plug-in.h"
|
||||
#include "plug-in-params.h"
|
||||
#define __YES_I_NEED_PLUG_IN_RUN__
|
||||
#include "plug-in-run.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
GValueArray *
|
||||
plug_in_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID)
|
||||
{
|
||||
GValueArray *return_vals = NULL;
|
||||
PlugIn *plug_in;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_PLUG_IN_MANAGER (manager), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_PLUG_IN_PROCEDURE (procedure), NULL);
|
||||
g_return_val_if_fail (args != NULL, NULL);
|
||||
|
||||
plug_in = plug_in_new (manager, context, progress,
|
||||
GIMP_PROCEDURE (procedure),
|
||||
procedure->prog);
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
GimpCoreConfig *core_config = manager->gimp->config;
|
||||
GimpDisplayConfig *display_config = GIMP_DISPLAY_CONFIG (core_config);
|
||||
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (core_config);
|
||||
GPConfig config;
|
||||
GPProcRun proc_run;
|
||||
gint monitor;
|
||||
|
||||
if (! plug_in_open (plug_in))
|
||||
{
|
||||
plug_in_unref (plug_in);
|
||||
goto done;
|
||||
}
|
||||
|
||||
config.version = GIMP_PROTOCOL_VERSION;
|
||||
config.tile_width = TILE_WIDTH;
|
||||
config.tile_height = TILE_HEIGHT;
|
||||
config.shm_ID = gimp_plug_in_manager_get_shm_ID (manager);
|
||||
config.check_size = display_config->transparency_size;
|
||||
config.check_type = display_config->transparency_type;
|
||||
config.show_help_button = (gui_config->use_help &&
|
||||
gui_config->show_help_button);
|
||||
config.gimp_reserved_4 = 0;
|
||||
config.gimp_reserved_5 = 0;
|
||||
config.gimp_reserved_6 = 0;
|
||||
config.gimp_reserved_7 = 0;
|
||||
config.gimp_reserved_8 = 0;
|
||||
config.install_cmap = core_config->install_cmap;
|
||||
config.show_tooltips = gui_config->show_tooltips;
|
||||
config.min_colors = CLAMP (core_config->min_colors, 27, 256);
|
||||
config.gdisp_ID = display_ID;
|
||||
config.app_name = (gchar *) g_get_application_name ();
|
||||
config.wm_class = (gchar *) gimp_get_program_class (manager->gimp);
|
||||
config.display_name = gimp_get_display_name (manager->gimp,
|
||||
display_ID, &monitor);
|
||||
config.monitor_number = monitor;
|
||||
|
||||
proc_run.name = GIMP_PROCEDURE (procedure)->original_name;
|
||||
proc_run.nparams = args->n_values;
|
||||
proc_run.params = plug_in_args_to_params (args, FALSE);
|
||||
|
||||
if (! gp_config_write (plug_in->my_write, &config, plug_in) ||
|
||||
! gp_proc_run_write (plug_in->my_write, &proc_run, plug_in) ||
|
||||
! gimp_wire_flush (plug_in->my_write, plug_in))
|
||||
{
|
||||
g_free (config.display_name);
|
||||
g_free (proc_run.params);
|
||||
|
||||
return_vals =
|
||||
gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE);
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
||||
g_free (config.display_name);
|
||||
g_free (proc_run.params);
|
||||
|
||||
plug_in_ref (plug_in);
|
||||
|
||||
/* If this is an extension,
|
||||
* wait for an installation-confirmation message
|
||||
*/
|
||||
if (GIMP_PROCEDURE (procedure)->proc_type == GIMP_EXTENSION)
|
||||
{
|
||||
plug_in->ext_main_loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
gimp_threads_leave (manager->gimp);
|
||||
g_main_loop_run (plug_in->ext_main_loop);
|
||||
gimp_threads_enter (manager->gimp);
|
||||
|
||||
/* main_loop is quit in plug_in_handle_extension_ack() */
|
||||
|
||||
g_main_loop_unref (plug_in->ext_main_loop);
|
||||
plug_in->ext_main_loop = NULL;
|
||||
}
|
||||
|
||||
/* If this plug-in is requested to run synchronously,
|
||||
* wait for its return values
|
||||
*/
|
||||
if (synchronous)
|
||||
{
|
||||
PlugInProcFrame *proc_frame = &plug_in->main_proc_frame;
|
||||
|
||||
proc_frame->main_loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
gimp_threads_leave (manager->gimp);
|
||||
g_main_loop_run (proc_frame->main_loop);
|
||||
gimp_threads_enter (manager->gimp);
|
||||
|
||||
/* main_loop is quit in plug_in_handle_proc_return() */
|
||||
|
||||
g_main_loop_unref (proc_frame->main_loop);
|
||||
proc_frame->main_loop = NULL;
|
||||
|
||||
return_vals = plug_in_proc_frame_get_return_vals (proc_frame);
|
||||
}
|
||||
|
||||
plug_in_unref (plug_in);
|
||||
}
|
||||
|
||||
done:
|
||||
if (return_vals && destroy_return_vals)
|
||||
{
|
||||
g_value_array_free (return_vals);
|
||||
return_vals = NULL;
|
||||
}
|
||||
|
||||
return return_vals;
|
||||
}
|
||||
|
||||
GValueArray *
|
||||
plug_in_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args)
|
||||
{
|
||||
GValueArray *return_vals = NULL;
|
||||
PlugIn *plug_in;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_PLUG_IN_MANAGER (manager), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_TEMPORARY_PROCEDURE (procedure), NULL);
|
||||
g_return_val_if_fail (args != NULL, NULL);
|
||||
|
||||
plug_in = procedure->plug_in;
|
||||
|
||||
if (plug_in)
|
||||
{
|
||||
PlugInProcFrame *proc_frame;
|
||||
GPProcRun proc_run;
|
||||
|
||||
proc_frame = plug_in_proc_frame_push (plug_in, context, progress,
|
||||
GIMP_PROCEDURE (procedure));
|
||||
|
||||
proc_run.name = GIMP_PROCEDURE (procedure)->original_name;
|
||||
proc_run.nparams = args->n_values;
|
||||
proc_run.params = plug_in_args_to_params (args, FALSE);
|
||||
|
||||
if (! gp_temp_proc_run_write (plug_in->my_write, &proc_run, plug_in) ||
|
||||
! gimp_wire_flush (plug_in->my_write, plug_in))
|
||||
{
|
||||
g_free (proc_run.params);
|
||||
plug_in_proc_frame_pop (plug_in);
|
||||
|
||||
return_vals =
|
||||
gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE);
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
||||
g_free (proc_run.params);
|
||||
|
||||
plug_in_ref (plug_in);
|
||||
plug_in_proc_frame_ref (proc_frame);
|
||||
|
||||
plug_in_main_loop (plug_in);
|
||||
|
||||
/* main_loop is quit and proc_frame is popped in
|
||||
* plug_in_handle_temp_proc_return()
|
||||
*/
|
||||
|
||||
return_vals = plug_in_proc_frame_get_return_vals (proc_frame);
|
||||
|
||||
plug_in_proc_frame_unref (proc_frame, plug_in);
|
||||
plug_in_unref (plug_in);
|
||||
}
|
||||
|
||||
done:
|
||||
return return_vals;
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* plug-in-run.h
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PLUG_IN_RUN_H__
|
||||
#define __PLUG_IN_RUN_H__
|
||||
|
||||
#ifndef __YES_I_NEED_PLUG_IN_RUN__
|
||||
#error Do not use plug_in_run*(), use gimp_procedure_execute*() instead.
|
||||
#endif
|
||||
|
||||
|
||||
/* Run a plug-in as if it were a procedure database procedure
|
||||
*/
|
||||
GValueArray * plug_in_run (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpPlugInProcedure *procedure,
|
||||
GValueArray *args,
|
||||
gboolean synchronous,
|
||||
gboolean destroy_return_vals,
|
||||
gint display_ID);
|
||||
|
||||
/* Run a temp plug-in proc as if it were a procedure database procedure
|
||||
*/
|
||||
GValueArray * plug_in_run_temp (GimpPlugInManager *manager,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GimpTemporaryProcedure *procedure,
|
||||
GValueArray *args);
|
||||
|
||||
|
||||
#endif /* __PLUG_IN_RUN_H__ */
|
Loading…
Reference in New Issue