Commit 4b917ea2 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Made an object out of the plug-in struct. Also change refcounting

2006-05-03  Michael Natterer  <mitch@gimp.org>

	Made an object out of the plug-in struct. Also change refcounting
	considerably:

	- gimp_plug_in_open() adds a reference that is only dropped by
	  gimp_plug_in_close().
	- temporarily ref the plug-in while handling messages.
	- remporarily ref the plug-in while a recursive main loop is
	  running.
	- each caller of gimp_plug_in_new() also unrefs the plug-in before
	  returning, the only reference that persists across functions
	  (that keeps the plug-in alive) is the one added by open().

	* app/plug-in/plug-in.[ch]
	* app/plug-in/plug-in-context.[ch]
	* app/plug-in/plug-in-message.[ch]
	* app/plug-in/plug-in-progress.[ch]: removed these files...

	* app/plug-in/gimpplugin.[ch]
	* app/plug-in/gimpplugin-context.[ch]
	* app/plug-in/gimpplugin-message.[ch]
	* app/plug-in/gimpplugin-progress.[ch]: ...and added here as GObject.

	* app/plug-in/plug-in-proc-frame.[ch]: removed...

	* app/plug-in/gimppluginprocframe.[ch]: ...and added with a namespace.

	* app/plug-in/Makefile.am
	* app/plug-in/plug-in-types.h
	* app/plug-in/gimppluginmanager-call.c
	* app/plug-in/gimppluginmanager-file.c
	* app/plug-in/gimppluginmanager.[ch]
	* app/pdb/gimppluginprocedure.c
	* app/pdb/gimptemporaryprocedure.c
	* app/pdb/gimptemporaryprocedure.h
	* tools/pdbgen/pdb/context.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/help.pdb
	* tools/pdbgen/pdb/message.pdb
	* tools/pdbgen/pdb/plug_in.pdb
	* tools/pdbgen/pdb/progress.pdb
	* tools/pdbgen/pdb/undo.pdb: changed accordingly.

	* app/pdb/context_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/help_cmds.c
	* app/pdb/message_cmds.c
	* app/pdb/plug_in_cmds.c
	* app/pdb/progress_cmds.c
	* app/pdb/undo_cmds.c: regenerated.
parent ce320fdf
2006-05-03 Michael Natterer <mitch@gimp.org>
Made an object out of the plug-in struct. Also change refcounting
considerably:
- gimp_plug_in_open() adds a reference that is only dropped by
gimp_plug_in_close().
- temporarily ref the plug-in while handling messages.
- remporarily ref the plug-in while a recursive main loop is
running.
- each caller of gimp_plug_in_new() also unrefs the plug-in before
returning, the only reference that persists across functions
(that keeps the plug-in alive) is the one added by open().
* app/plug-in/plug-in.[ch]
* app/plug-in/plug-in-context.[ch]
* app/plug-in/plug-in-message.[ch]
* app/plug-in/plug-in-progress.[ch]: removed these files...
* app/plug-in/gimpplugin.[ch]
* app/plug-in/gimpplugin-context.[ch]
* app/plug-in/gimpplugin-message.[ch]
* app/plug-in/gimpplugin-progress.[ch]: ...and added here as GObject.
* app/plug-in/plug-in-proc-frame.[ch]: removed...
* app/plug-in/gimppluginprocframe.[ch]: ...and added with a namespace.
* app/plug-in/Makefile.am
* app/plug-in/plug-in-types.h
* app/plug-in/gimppluginmanager-call.c
* app/plug-in/gimppluginmanager-file.c
* app/plug-in/gimppluginmanager.[ch]
* app/pdb/gimppluginprocedure.c
* app/pdb/gimptemporaryprocedure.c
* app/pdb/gimptemporaryprocedure.h
* tools/pdbgen/pdb/context.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/help.pdb
* tools/pdbgen/pdb/message.pdb
* tools/pdbgen/pdb/plug_in.pdb
* tools/pdbgen/pdb/progress.pdb
* tools/pdbgen/pdb/undo.pdb: changed accordingly.
* app/pdb/context_cmds.c
* app/pdb/drawable_cmds.c
* app/pdb/help_cmds.c
* app/pdb/message_cmds.c
* app/pdb/plug_in_cmds.c
* app/pdb/progress_cmds.c
* app/pdb/undo_cmds.c: regenerated.
2006-05-03 Sven Neumann <sven@gimp.org>
* plug-ins/common/gifload.c: removed some unused code, untabified.
......
......@@ -34,9 +34,9 @@
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpdatafactory.h"
#include "plug-in/gimpplugin-context.h"
#include "plug-in/gimpplugin.h"
#include "plug-in/gimppluginmanager.h"
#include "plug-in/plug-in-context.h"
#include "plug-in/plug-in.h"
static GValueArray *
......@@ -47,11 +47,13 @@ context_push_invoker (GimpProcedure *procedure,
const GValueArray *args)
{
gboolean success = TRUE;
if (gimp->plug_in_manager->current_plug_in &&
gimp->plug_in_manager->current_plug_in->open)
success = plug_in_context_push (gimp->plug_in_manager->current_plug_in);
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
success = gimp_plug_in_context_push (plug_in);
else
success = FALSE;
return gimp_procedure_get_return_values (procedure, success);
}
......@@ -63,11 +65,13 @@ context_pop_invoker (GimpProcedure *procedure,
const GValueArray *args)
{
gboolean success = TRUE;
if (gimp->plug_in_manager->current_plug_in &&
gimp->plug_in_manager->current_plug_in->open)
success = plug_in_context_pop (gimp->plug_in_manager->current_plug_in);
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
success = gimp_plug_in_context_pop (plug_in);
else
success = FALSE;
return gimp_procedure_get_return_values (procedure, success);
}
......
......@@ -41,8 +41,8 @@
#include "core/gimplayer.h"
#include "core/gimplayermask.h"
#include "gimp-intl.h"
#include "plug-in/gimpplugin.h"
#include "plug-in/gimppluginmanager.h"
#include "plug-in/plug-in.h"
static GValueArray *
......@@ -764,7 +764,7 @@ drawable_merge_shadow_invoker (GimpProcedure *procedure,
gchar *undo_desc = NULL;
if (gimp->plug_in_manager->current_plug_in)
undo_desc = plug_in_get_undo_desc (gimp->plug_in_manager->current_plug_in);
undo_desc = gimp_plug_in_get_undo_desc (gimp->plug_in_manager->current_plug_in);
if (! undo_desc)
undo_desc = g_strdup (_("Plug-In"));
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* plug-in-proc-def.c
* gimppluginprocedure.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
......@@ -35,7 +35,6 @@
#define __YES_I_NEED_GIMP_PLUG_IN_MANAGER_CALL__
#include "plug-in/gimppluginmanager-call.h"
#include "plug-in/plug-in.h"
#include "gimppluginprocedure.h"
......
......@@ -26,9 +26,9 @@
#include "core/gimp.h"
#include "plug-in/gimpplugin.h"
#define __YES_I_NEED_GIMP_PLUG_IN_MANAGER_CALL__
#include "plug-in/gimppluginmanager-call.h"
#include "plug-in/plug-in.h"
#include "gimptemporaryprocedure.h"
......@@ -128,11 +128,11 @@ gimp_temporary_procedure_get_progname (const GimpPlugInProcedure *procedure)
/* public functions */
GimpProcedure *
gimp_temporary_procedure_new (PlugIn *plug_in)
gimp_temporary_procedure_new (GimpPlugIn *plug_in)
{
GimpTemporaryProcedure *proc;
g_return_val_if_fail (plug_in != NULL, NULL);
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), NULL);
proc = g_object_new (GIMP_TYPE_TEMPORARY_PROCEDURE, NULL);
......
......@@ -39,7 +39,7 @@ struct _GimpTemporaryProcedure
{
GimpPlugInProcedure parent_instance;
PlugIn *plug_in;
GimpPlugIn *plug_in;
};
struct _GimpTemporaryProcedureClass
......@@ -50,7 +50,7 @@ struct _GimpTemporaryProcedureClass
GType gimp_temporary_procedure_get_type (void) G_GNUC_CONST;
GimpProcedure * gimp_temporary_procedure_new (PlugIn *plug_in);
GimpProcedure * gimp_temporary_procedure_new (GimpPlugIn *plug_in);
#endif /* __GIMP_TEMPORARY_PROCEDURE_H__ */
......@@ -29,9 +29,9 @@
#include "core/gimpparamspecs.h"
#include "core/gimp.h"
#include "plug-in/gimpplugin.h"
#include "plug-in/gimppluginmanager-help-domain.h"
#include "plug-in/gimppluginmanager.h"
#include "plug-in/plug-in.h"
static GValueArray *
......
......@@ -31,9 +31,9 @@
#include "core/gimp.h"
#include "gimp-intl.h"
#include "plug-in/gimpplugin-progress.h"
#include "plug-in/gimpplugin.h"
#include "plug-in/gimppluginmanager.h"
#include "plug-in/plug-in-progress.h"
#include "plug-in/plug-in.h"
static GValueArray *
......@@ -51,7 +51,8 @@ message_invoker (GimpProcedure *procedure,
if (success)
{
if (gimp->plug_in_manager->current_plug_in)
plug_in_progress_message (gimp->plug_in_manager->current_plug_in, message);
gimp_plug_in_progress_message (gimp->plug_in_manager->current_plug_in,
message);
else
gimp_message (gimp, NULL, message);
}
......
......@@ -34,11 +34,11 @@
#include "core/gimp.h"
#include "gimppluginprocedure.h"
#include "plug-in/gimpplugin.h"
#include "plug-in/gimppluginmanager-menu-branch.h"
#include "plug-in/gimppluginmanager-query.h"
#include "plug-in/gimppluginmanager.h"
#include "plug-in/plug-in-def.h"
#include "plug-in/plug-in.h"
static GValueArray *
......@@ -103,7 +103,7 @@ plugin_domain_register_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->call_mode == GIMP_PLUG_IN_CALL_QUERY)
{
......@@ -133,7 +133,7 @@ plugin_help_register_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->call_mode == GIMP_PLUG_IN_CALL_QUERY)
{
......@@ -163,12 +163,12 @@ plugin_menu_register_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in)
{
gchar *canonical = gimp_canonicalize_identifier (procedure_name);
success = plug_in_menu_register (plug_in, canonical, menu_path);
success = gimp_plug_in_menu_register (plug_in, canonical, menu_path);
g_free (canonical);
}
else
......@@ -196,7 +196,7 @@ plugin_menu_branch_register_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in)
{
......@@ -230,7 +230,7 @@ plugin_icon_register_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->call_mode == GIMP_PLUG_IN_CALL_QUERY)
{
......
......@@ -29,9 +29,9 @@
#include "core/gimpparamspecs.h"
#include "core/gimp.h"
#include "plug-in/gimpplugin-progress.h"
#include "plug-in/gimpplugin.h"
#include "plug-in/gimppluginmanager.h"
#include "plug-in/plug-in-progress.h"
#include "plug-in/plug-in.h"
static GValueArray *
......@@ -50,12 +50,12 @@ progress_init_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_start (plug_in, message, gdisplay);
gimp_plug_in_progress_start (plug_in, message, gdisplay);
}
else
success = FALSE;
......@@ -78,12 +78,12 @@ progress_update_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_set_value (plug_in, percentage);
gimp_plug_in_progress_set_value (plug_in, percentage);
}
else
success = FALSE;
......@@ -100,12 +100,12 @@ progress_pulse_invoker (GimpProcedure *procedure,
const GValueArray *args)
{
gboolean success = TRUE;
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_pulse (plug_in);
gimp_plug_in_progress_pulse (plug_in);
}
else
success = FALSE;
......@@ -127,12 +127,12 @@ progress_set_text_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
{
if (! gimp->no_interface)
plug_in_progress_set_text (plug_in, message);
gimp_plug_in_progress_set_text (plug_in, message);
}
else
success = FALSE;
......@@ -152,12 +152,12 @@ progress_get_window_handle_invoker (GimpProcedure *procedure,
GValueArray *return_vals;
gint32 window = 0;
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
{
if (! gimp->no_interface)
window = plug_in_progress_get_window (plug_in);
window = gimp_plug_in_progress_get_window (plug_in);
}
else
success = FALSE;
......@@ -184,10 +184,10 @@ progress_install_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
success = plug_in_progress_install (plug_in, progress_callback);
success = gimp_plug_in_progress_install (plug_in, progress_callback);
else
success = FALSE;
}
......@@ -209,10 +209,10 @@ progress_uninstall_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
success = plug_in_progress_uninstall (plug_in, progress_callback);
success = gimp_plug_in_progress_uninstall (plug_in, progress_callback);
else
success = FALSE;
}
......@@ -234,10 +234,10 @@ progress_cancel_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
if (plug_in && plug_in->open)
success = plug_in_progress_cancel (plug_in, progress_callback);
success = gimp_plug_in_progress_cancel (plug_in, progress_callback);
else
success = FALSE;
}
......
......@@ -31,8 +31,8 @@
#include "core/gimp.h"
#include "core/gimpimage-undo.h"
#include "core/gimpimage.h"
#include "plug-in/gimpplugin.h"
#include "plug-in/gimppluginmanager.h"
#include "plug-in/plug-in.h"
static GValueArray *
......@@ -49,11 +49,11 @@ image_undo_group_start_invoker (GimpProcedure *procedure,
if (success)
{
PlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
GimpPlugIn *plug_in = gimp->plug_in_manager->current_plug_in;
gchar *undo_desc = NULL;
if (plug_in)
undo_desc = plug_in_get_undo_desc (plug_in);
undo_desc = gimp_plug_in_get_undo_desc (plug_in);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_MISC, undo_desc);
......
......@@ -25,6 +25,14 @@ libappplug_in_a_SOURCES = \
gimpinterpreterdb.h \
gimpplugindebug.c \
gimpplugindebug.h \
gimpplugin.c \
gimpplugin.h \
gimpplugin-context.c \
gimpplugin-context.h \
gimpplugin-message.c \
gimpplugin-message.h \
gimpplugin-progress.c \
gimpplugin-progress.h \
gimppluginmanager.c \
gimppluginmanager.h \
gimppluginmanager-call.c \
......@@ -41,23 +49,15 @@ libappplug_in_a_SOURCES = \
gimppluginmanager-menu-branch.h \
gimppluginmanager-query.c \
gimppluginmanager-query.h \
gimppluginprocframe.c \
gimppluginprocframe.h \
gimppluginshm.c \
gimppluginshm.h \
\
plug-in.c \
plug-in.h \
plug-in-context.c \
plug-in-context.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-frame.c \
plug-in-proc-frame.h \
plug-in-progress.c \
plug-in-progress.h \
plug-in-rc.c \
plug-in-rc.h
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpplugin-context.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
......@@ -25,21 +27,21 @@
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "gimpplugin.h"
#include "gimpplugin-context.h"
#include "gimppluginmanager.h"
#include "plug-in.h"
#include "plug-in-context.h"
gboolean
plug_in_context_push (PlugIn *plug_in)
gimp_plug_in_context_push (GimpPlugIn *plug_in)
{
PlugInProcFrame *proc_frame;
GimpPlugInProcFrame *proc_frame;
GimpContext *parent;
GimpContext *context;
g_return_val_if_fail (plug_in != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), FALSE);
proc_frame = plug_in_get_proc_frame (plug_in);
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
if (proc_frame->context_stack)
parent = proc_frame->context_stack->data;
......@@ -56,13 +58,13 @@ plug_in_context_push (PlugIn *plug_in)
}
gboolean
plug_in_context_pop (PlugIn *plug_in)
gimp_plug_in_context_pop (GimpPlugIn *plug_in)
{
PlugInProcFrame *proc_frame;
GimpPlugInProcFrame *proc_frame;
g_return_val_if_fail (plug_in != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), FALSE);
proc_frame = plug_in_get_proc_frame (plug_in);
proc_frame = gimp_plug_in_get_proc_frame (plug_in);
if (proc_frame->context_stack)
{
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* plug-in-context.h
* gimpplugin-context.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,12 +18,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __PLUG_IN_CONTEXT_H__
#define __PLUG_IN_CONTEXT_H__
#ifndef __GIMP_PLUG_IN_CONTEXT_H__
#define __GIMP_PLUG_IN_CONTEXT_H__
gboolean plug_in_context_push (PlugIn *plug_in);
gboolean plug_in_context_pop (PlugIn *plug_in);
gboolean gimp_plug_in_context_push (GimpPlugIn *plug_in);
gboolean gimp_plug_in_context_pop (GimpPlugIn *plug_in);
#endif /* __PLUG_IN_CONTEXT_H__ */
#endif /* __GIMP_PLUG_IN_CONTEXT_H__ */
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* plug-in-message.c
* gimpplugin-message.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
......@@ -40,41 +40,46 @@
#include "pdb/gimp-pdb-compat.h"
#include "pdb/gimptemporaryprocedure.h"
#include "gimpplugin.h"
#include "gimpplugin-message.h"
#include "gimppluginmanager.h"
#include "plug-in.h"
#include "plug-in-def.h"
#include "plug-in-params.h"
/* local function prototypes */
static void plug_in_handle_quit (PlugIn *plug_in);
static void plug_in_handle_tile_req (PlugIn *plug_in,
static void gimp_plug_in_handle_quit (GimpPlugIn *plug_in);
static void gimp_plug_in_handle_tile_req (GimpPlugIn *plug_in,
GPTileReq *tile_req);
static void plug_in_handle_proc_run (PlugIn *plug_in,
static void gimp_plug_in_handle_proc_run (GimpPlugIn *plug_in,
GPProcRun *proc_run);
static void plug_in_handle_proc_return (PlugIn *plug_in,
static void gimp_plug_in_handle_proc_return (GimpPlugIn *plug_in,
GPProcReturn *proc_return);
static void plug_in_handle_temp_proc_return (PlugIn *plug_in,
static void gimp_plug_in_handle_temp_proc_return (GimpPlugIn *plug_in,
GPProcReturn *proc_return);
static void plug_in_handle_proc_install (PlugIn *plug_in,
static void gimp_plug_in_handle_proc_install (GimpPlugIn *plug_in,
GPProcInstall *proc_install);
static void plug_in_handle_proc_uninstall (PlugIn *plug_in,
static void gimp_plug_in_handle_proc_uninstall (GimpPlugIn *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);
static void gimp_plug_in_handle_extension_ack (GimpPlugIn *plug_in);
static void gimp_plug_in_handle_has_init (GimpPlugIn *plug_in);
/* public functions */
void
plug_in_handle_message (PlugIn *plug_in,
gimp_plug_in_handle_message (GimpPlugIn *plug_in,
GimpWireMessage *msg)
{
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
g_return_if_fail (plug_in->open == TRUE);
g_return_if_fail (msg != NULL);
switch (msg->type)
{
case GP_QUIT:
plug_in_handle_quit (plug_in);
gimp_plug_in_handle_quit (plug_in);
break;
case GP_CONFIG:
......@@ -82,11 +87,11 @@ plug_in_handle_message (PlugIn *plug_in,
"sent a CONFIG message. This should not happen.",
gimp_filename_to_utf8 (plug_in->name),
gimp_filename_to_utf8 (plug_in->prog));
plug_in_close (plug_in, TRUE);
gimp_plug_in_close (plug_in, TRUE);
break;
case GP_TILE_REQ:
plug_in_handle_tile_req (plug_in, msg->data);
gimp_plug_in_handle_tile_req (plug_in, msg->data);
break;
case GP_TILE_ACK:
......@@ -94,7 +99,7 @@ plug_in_handle_message (PlugIn *plug_in,
"sent a TILE_ACK message. This should not happen.",
gimp_filename_to_utf8 (plug_in->name),
gimp_filename_to_utf8 (plug_in->prog));
plug_in_close (plug_in, TRUE);
gimp_plug_in_close (plug_in, TRUE);
break;
case GP_TILE_DATA:
......@@ -102,15 +107,15 @@ plug_in_handle_message (PlugIn *plug_in,
"sent a TILE_DATA message. This should not happen.",
gimp_filename_to_utf8 (plug_in->name),
gimp_filename_to_utf8 (plug_in->prog));
plug_in_close (plug_in, TRUE);
gimp_plug_in_close (plug_in, TRUE);
break;
case GP_PROC_RUN:
plug_in_handle_proc_run (plug_in, msg->data);
gimp_plug_in_handle_proc_run (plug_in, msg->data);
break;
case GP_PROC_RETURN:
plug_in_handle_proc_return (plug_in, msg->data);
gimp_plug_in_handle_proc_return (plug_in, msg->data);
break;
case GP_TEMP_PROC_RUN:
......@@ -118,27 +123,27 @@ plug_in_handle_message (PlugIn *plug_in,
"sent a TEMP_PROC_RUN message. This should not happen.",
gimp_filename_to_utf8 (plug_in->name),
gimp_filename_to_utf8 (plug_in->prog));
plug_in_close (plug_in, TRUE);
gimp_plug_in_close (plug_in, TRUE);
break;
case GP_TEMP_PROC_RETURN:
plug_in_handle_temp_proc_return (plug_in, msg->data);
gimp_plug_in_handle_temp_proc_return (plug_in, msg->data);
break;
case GP_PROC_INSTALL:
plug_in_handle_proc_install (plug_in, msg->data);
gimp_plug_in_handle_proc_install (plug_in, msg->data);
break;
case GP_PROC_UNINSTALL:
plug_in_handle_proc_uninstall (plug_in, msg->data);
gimp_plug_in_handle_proc_uninstall (plug_in, msg->data);
break;
case GP_EXTENSION_ACK:
plug_in_handle_extension_ack (plug_in);
gimp_plug_in_handle_extension_ack (plug_in);
break;
case GP_HAS_INIT:
plug_in_handle_has_init (plug_in);
gimp_plug_in_handle_has_init (plug_in);
break;
}
}
......@@ -147,13 +152,13 @@ plug_in_handle_message (PlugIn *plug_in,
/* private functions */
static void
plug_in_handle_quit (PlugIn *plug_in)
gimp_plug_in_handle_quit (GimpPlugIn *plug_in)
{
plug_in_close (plug_in, FALSE);
gimp_plug_in_close (plug_in, FALSE);
}
static void
plug_in_handle_tile_req (PlugIn *plug_in,
gimp_plug_in_handle_tile_req (GimpPlugIn *plug_in,
GPTileReq *tile_req)
{
GPTileData tile_data;
......@@ -182,21 +187,21 @@ plug_in_handle_tile_req (PlugIn *plug_in,
if (! gp_tile_data_write (plug_in->my_write, &tile_data, plug_in))
{
g_warning ("plug_in_handle_tile_req: ERROR");
plug_in_close (plug_in, TRUE);
gimp_plug_in_close (plug_in, TRUE);
return;
}
if (! gimp_wire_read_msg (plug_in->my_read, &msg, plug_in))
{
g_warning ("plug_in_handle_tile_req: ERROR");
plug_in_close (plug_in, TRUE);
gimp_plug_in_close (plug_in, TRUE);
return;
}
if (msg.type != GP_TILE_DATA)
{
g_warning ("expected tile data and received: %d", msg.type);
plug_in_close (plug_in, TRUE);
gimp_plug_in_close (plug_in, TRUE);
return;
}
......@@ -211,7 +216,7 @@ plug_in_handle_tile_req (PlugIn *plug_in,
"requested invalid drawable (killing)",
gimp_filename_to_utf8 (plug_in->name),
gimp_filename_to_utf8 (plug_in->prog));
plug_in_close (plug_in, TRUE);
gimp_plug_in_close (plug_in, TRUE);
return;
}
......@@ -228,7 +233,7 @@ plug_in_handle_tile_req (PlugIn *plug_in,
"requested invalid tile (killing)",
gimp_filename_to_utf8 (plug_in->name),
gimp_filename_to_utf8 (plug_in->prog));