Commit a3c38814 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

renamed plug_in->busy to plug_in->in_temp_proc. Added a stack of

2003-01-30  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-in.[ch]: renamed plug_in->busy to
	plug_in->in_temp_proc. Added a stack of GMainLoops to each
	plug-in. Added the "current_return_vals" to the PlugIn
	struct. Renamed plug_in_kill() to plug_in_exit(). Removed
	the stuff added below. Cleanup.

	* app/plug-in/Makefile.am
	* app/plug-in/plug-in-message.[ch]
	* app/plug-in/plug-in-run.[ch]
	* app/plug-in/plug-in-shm.[ch]: new files taking out functionality
	from the overloaded plug-in.c. Added the code back in that implements
	temp proc return messages (inside an #ifdef) because i don't
	really get why it was removed on Sep 19 1998.

	* app/plug-in/plug-ins.c: changed accordingly.

	* app/plug-in/plug-in-def.c
	* app/plug-in/plug-in-params.c: removed inclusion of <gtk/gtk.h>.

	* app/gui/file-save-dialog.c
	* app/gui/paths-dialog.c
	* app/gui/plug-in-commands.c
	* app/gui/plug-in-menus.c
	* app/pdb/procedural_db.c
	* app/widgets/gimphelp.c: changed plug-in includes accordingly.

	* app/gui/plug-in-commands.c: don't use "the_gimp" from
	"app_procs.h" but get it from the GimpItemFactory that invoked the
	plug-in callback.
parent 82109cf0
2003-01-30 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in.[ch]: renamed plug_in->busy to
plug_in->in_temp_proc. Added a stack of GMainLoops to each
plug-in. Added the "current_return_vals" to the PlugIn
struct. Renamed plug_in_kill() to plug_in_exit(). Removed
the stuff added below. Cleanup.
* app/plug-in/Makefile.am
* app/plug-in/plug-in-message.[ch]
* app/plug-in/plug-in-run.[ch]
* app/plug-in/plug-in-shm.[ch]: new files taking out functionality
from the overloaded plug-in.c. Added the code back in that implements
temp proc return messages (inside an #ifdef) because i don't
really get why it was removed on Sep 19 1998.
* app/plug-in/plug-ins.c: changed accordingly.
* app/plug-in/plug-in-def.c
* app/plug-in/plug-in-params.c: removed inclusion of <gtk/gtk.h>.
* app/gui/file-save-dialog.c
* app/gui/paths-dialog.c
* app/gui/plug-in-commands.c
* app/gui/plug-in-menus.c
* app/pdb/procedural_db.c
* app/widgets/gimphelp.c: changed plug-in includes accordingly.
* app/gui/plug-in-commands.c: don't use "the_gimp" from
"app_procs.h" but get it from the GimpItemFactory that invoked the
plug-in callback.
2003-01-30 Nathan Summers <rock@gimp.org>
 
* app/tools/gimptoolgui.[ch]: GimpToolGui, a new class descended
......
......@@ -29,15 +29,15 @@
#include "core/gimpimage.h"
#include "core/gimpitem.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-run.h"
#include "plug-in/plug-in-proc.h"
#include "widgets/gimpitemfactory.h"
#include "display/gimpdisplay.h"
#include "plug-in-commands.h"
#include "app_procs.h"
#define return_if_no_display(gdisp,data) \
if (GIMP_IS_DISPLAY (data)) \
......@@ -55,15 +55,21 @@ plug_in_run_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisplay;
ProcRecord *proc_rec;
Argument *args;
gint i;
gint gdisp_ID = -1;
gint argc = 0; /* calm down a gcc warning. */
GtkItemFactory *item_factory;
Gimp *gimp;
GimpDisplay *gdisplay;
ProcRecord *proc_rec;
Argument *args;
gint i;
gint gdisp_ID = -1;
gint argc = 0; /* calm down a gcc warning. */
item_factory = gtk_item_factory_from_widget (widget);
gimp = GIMP_ITEM_FACTORY (item_factory)->gimp;
/* get the active gdisplay */
gdisplay = gimp_context_get_display (gimp_get_user_context (the_gimp));
gdisplay = gimp_context_get_display (gimp_get_user_context (gimp));
proc_rec = (ProcRecord *) data;
......@@ -132,7 +138,7 @@ plug_in_run_cmd_callback (GtkWidget *widget,
}
/* run the plug-in procedure */
plug_in_run (the_gimp, proc_rec, args, argc, FALSE, TRUE, gdisp_ID);
plug_in_run (gimp, proc_rec, args, argc, FALSE, TRUE, gdisp_ID);
if (proc_rec->proc_type == GIMP_PLUGIN)
last_plug_in = proc_rec;
......
......@@ -38,8 +38,8 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-in-run.h"
#include "file/file-save.h"
#include "file/file-utils.h"
......@@ -245,7 +245,7 @@ file_save_ok_callback (GtkWidget *widget,
args[2].arg_type = GIMP_PDB_DRAWABLE;
args[2].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
plug_in_run (the_gimage->gimp, proc_rec, args, 3, FALSE, TRUE, 0);
plug_in_run (the_gimage->gimp, proc_rec, args, 3, FALSE, TRUE, -1);
g_free (args);
......
......@@ -38,8 +38,8 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-in-run.h"
#include "file/file-save.h"
#include "file/file-utils.h"
......@@ -245,7 +245,7 @@ file_save_ok_callback (GtkWidget *widget,
args[2].arg_type = GIMP_PDB_DRAWABLE;
args[2].value.pdb_int = gimp_item_get_ID (GIMP_ITEM (drawable));
plug_in_run (the_gimage->gimp, proc_rec, args, 3, FALSE, TRUE, 0);
plug_in_run (the_gimage->gimp, proc_rec, args, 3, FALSE, TRUE, -1);
g_free (args);
......
......@@ -46,7 +46,7 @@
#include "pdb/procedural_db.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-run.h"
#include "widgets/gimpitemfactory.h"
......
......@@ -29,15 +29,15 @@
#include "core/gimpimage.h"
#include "core/gimpitem.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-run.h"
#include "plug-in/plug-in-proc.h"
#include "widgets/gimpitemfactory.h"
#include "display/gimpdisplay.h"
#include "plug-in-commands.h"
#include "app_procs.h"
#define return_if_no_display(gdisp,data) \
if (GIMP_IS_DISPLAY (data)) \
......@@ -55,15 +55,21 @@ plug_in_run_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
GimpDisplay *gdisplay;
ProcRecord *proc_rec;
Argument *args;
gint i;
gint gdisp_ID = -1;
gint argc = 0; /* calm down a gcc warning. */
GtkItemFactory *item_factory;
Gimp *gimp;
GimpDisplay *gdisplay;
ProcRecord *proc_rec;
Argument *args;
gint i;
gint gdisp_ID = -1;
gint argc = 0; /* calm down a gcc warning. */
item_factory = gtk_item_factory_from_widget (widget);
gimp = GIMP_ITEM_FACTORY (item_factory)->gimp;
/* get the active gdisplay */
gdisplay = gimp_context_get_display (gimp_get_user_context (the_gimp));
gdisplay = gimp_context_get_display (gimp_get_user_context (gimp));
proc_rec = (ProcRecord *) data;
......@@ -132,7 +138,7 @@ plug_in_run_cmd_callback (GtkWidget *widget,
}
/* run the plug-in procedure */
plug_in_run (the_gimp, proc_rec, args, argc, FALSE, TRUE, gdisp_ID);
plug_in_run (gimp, proc_rec, args, argc, FALSE, TRUE, gdisp_ID);
if (proc_rec->proc_type == GIMP_PLUGIN)
last_plug_in = proc_rec;
......
......@@ -26,10 +26,10 @@
#include "gui-types.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-ins.h"
#include "plug-in/plug-in-def.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-in-run.h"
#include "widgets/gimpitemfactory.h"
......
......@@ -26,10 +26,10 @@
#include "gui-types.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-ins.h"
#include "plug-in/plug-in-def.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-in-run.h"
#include "widgets/gimpitemfactory.h"
......
......@@ -30,7 +30,7 @@
#include "core/gimp.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-run.h"
#include "procedural_db.h"
......
......@@ -30,7 +30,7 @@
#include "core/gimp.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-run.h"
#include "procedural_db.h"
......
......@@ -30,7 +30,7 @@
#include "core/gimp.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-run.h"
#include "procedural_db.h"
......
......@@ -30,7 +30,7 @@
#include "core/gimp.h"
#include "plug-in/plug-in.h"
#include "plug-in/plug-in-run.h"
#include "procedural_db.h"
......
......@@ -21,6 +21,8 @@ libappplug_in_a_SOURCES = \
plug-ins.h \
plug-in-def.c \
plug-in-def.h \
plug-in-message.c \
plug-in-message.h \
plug-in-params.c \
plug-in-params.h \
plug-in-proc.c \
......@@ -28,4 +30,8 @@ libappplug_in_a_SOURCES = \
plug-in-progress.c \
plug-in-progress.h \
plug-in-rc.c \
plug-in-rc.h
plug-in-rc.h \
plug-in-run.c \
plug-in-run.h \
plug-in-shm.c \
plug-in-shm.h
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __PLUG_IN_MESSAGE_H__
#define __PLUG_IN_MESSAGE_H__
void plug_in_handle_message (PlugIn *plug_in,
WireMessage *msg);
#endif /* __PLUG_IN_MESSAGE_H__ */
This diff is collapsed.
......@@ -34,8 +34,8 @@ struct _PlugIn
guint query : 1; /* Are we querying the plug-in? */
guint init : 1; /* Are we initialing the plug-in? */
guint synchronous : 1; /* Is the plug-in running synchronously? */
guint recurse : 1; /* Have we called 'gtk_main' recursively? */
guint busy : 1; /* Is the plug-in busy with a temp proc? */
guint recurse : 1; /* Do we have an own GMainLoop? */
guint in_temp_proc : 1; /* Is the plug-in busy with a temp proc? */
pid_t pid; /* Plug-ins process id */
gchar *args[7]; /* Plug-ins command line arguments */
......@@ -51,6 +51,10 @@ struct _PlugIn
GSList *temp_proc_defs; /* Temporary procedures */
GList *main_loops; /* Stack of recursive main loops */
Argument *return_vals; /* The return value we wait for */
gint n_return_vals;
GimpProgress *progress; /* Progress dialog */
PlugInDef *plug_in_def; /* Valid only during query() and init() */
......@@ -58,7 +62,7 @@ struct _PlugIn
void plug_in_init (Gimp *gimp);
void plug_in_kill (Gimp *gimp);
void plug_in_exit (Gimp *gimp);
void plug_in_call_query (Gimp *gimp,
PlugInDef *plug_in_def);
......@@ -87,28 +91,14 @@ gboolean plug_in_open (PlugIn *plug_in);
void plug_in_close (PlugIn *plug_in,
gboolean kill_it);
/* Run a plug-in as if it were a procedure database procedure
*/
Argument * plug_in_run (Gimp *gimp,
ProcRecord *proc_rec,
Argument *args,
gint argc,
gboolean synchronous,
gboolean destroy_values,
gint gdisp_ID);
/* Run the last plug-in again with the same arguments. Extensions
* are exempt from this "privelege".
*/
void plug_in_repeat (Gimp *gimp,
gint display_ID,
gint image_ID,
gint drawable_ID,
gboolean with_interface);
void plug_in_push (PlugIn *plug_in);
void plug_in_pop (void);
void plug_in_main_loop (PlugIn *plug_in);
void plug_in_main_loop_quit (PlugIn *plug_in);
extern PlugIn *current_plug_in;
extern ProcRecord *last_plug_in;
extern PlugIn *current_plug_in;
#endif /* __PLUG_IN_H__ */
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __PLUG_IN_RUN_H__
#define __PLUG_IN_RUN_H__
/* Run a plug-in as if it were a procedure database procedure
*/
Argument * plug_in_run (Gimp *gimp,
ProcRecord *proc_rec,
Argument *args,
gint argc,
gboolean synchronous,
gboolean destroy_return_vals,
gint gdisp_ID);
/* Run the last plug-in again with the same arguments. Extensions
* are exempt from this "privelege".
*/
void plug_in_repeat (Gimp *gimp,
gint display_ID,
gint image_ID,
gint drawable_ID,
gboolean with_interface);
extern ProcRecord *last_plug_in;
#endif /* __PLUG_IN_RUN_H__ */
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment