From b13087adb91210b9a5b8888f7fa9069fc451eea0 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 30 Jun 2004 16:55:43 +0000 Subject: [PATCH] added a GimpContext parameter and use it to start plug-ins. 2004-06-30 Michael Natterer * app/plug-in/plug-ins.[ch] (plug_ins_init): added a GimpContext parameter and use it to start plug-ins. * app/core/gimp.c (gimp_real_restore): pass the user context. Restores script-fu's access to the global FG, FG, brush, ... --- ChangeLog | 8 ++++++++ app/core/gimp.c | 2 +- app/plug-in/gimppluginmanager.c | 25 +++++++++++-------------- app/plug-in/gimppluginmanager.h | 1 + app/plug-in/plug-ins.c | 25 +++++++++++-------------- app/plug-in/plug-ins.h | 1 + 6 files changed, 33 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index aed0b672a8..407c6b024f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-06-30 Michael Natterer + + * app/plug-in/plug-ins.[ch] (plug_ins_init): added a GimpContext + parameter and use it to start plug-ins. + + * app/core/gimp.c (gimp_real_restore): pass the user context. + Restores script-fu's access to the global FG, FG, brush, ... + 2004-06-30 Sven Neumann * app/core/core-enums.c diff --git a/app/core/gimp.c b/app/core/gimp.c index 70cdc4eba1..36d782479b 100644 --- a/app/core/gimp.c +++ b/app/core/gimp.c @@ -652,7 +652,7 @@ gimp_real_restore (Gimp *gimp, if (gimp->be_verbose) g_print ("INIT: gimp_real_restore\n"); - plug_ins_init (gimp, status_callback); + plug_ins_init (gimp, gimp_get_user_context (gimp), status_callback); } static gboolean diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index a9e48b23e5..b6fb4717b3 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -82,24 +82,23 @@ static PlugInProcDef * plug_ins_proc_def_insert (Gimp *gimp, void plug_ins_init (Gimp *gimp, + GimpContext *context, GimpInitStatusFunc status_callback) { - GimpContext *context; - gchar *filename; - gchar *basename; - gchar *path; - GSList *list; - GList *extensions = NULL; - gdouble n_plugins; - gdouble n_extensions; - gdouble nth; - GError *error = NULL; + gchar *filename; + gchar *basename; + gchar *path; + GSList *list; + GList *extensions = NULL; + gdouble n_plugins; + gdouble n_extensions; + gdouble nth; + GError *error = NULL; g_return_if_fail (GIMP_IS_GIMP (gimp)); + g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (status_callback != NULL); - context = gimp_context_new (gimp, "temp", NULL); - plug_in_init (gimp); /* search for binaries in the plug-in directory path */ @@ -361,8 +360,6 @@ plug_ins_init (Gimp *gimp, g_slist_free (gimp->plug_in_defs); gimp->plug_in_defs = NULL; - - g_object_unref (context); } void diff --git a/app/plug-in/gimppluginmanager.h b/app/plug-in/gimppluginmanager.h index b79b6d9d91..32a679ea9b 100644 --- a/app/plug-in/gimppluginmanager.h +++ b/app/plug-in/gimppluginmanager.h @@ -21,6 +21,7 @@ void plug_ins_init (Gimp *gimp, + GimpContext *context, GimpInitStatusFunc status_callback); void plug_ins_exit (Gimp *gimp); diff --git a/app/plug-in/plug-ins.c b/app/plug-in/plug-ins.c index a9e48b23e5..b6fb4717b3 100644 --- a/app/plug-in/plug-ins.c +++ b/app/plug-in/plug-ins.c @@ -82,24 +82,23 @@ static PlugInProcDef * plug_ins_proc_def_insert (Gimp *gimp, void plug_ins_init (Gimp *gimp, + GimpContext *context, GimpInitStatusFunc status_callback) { - GimpContext *context; - gchar *filename; - gchar *basename; - gchar *path; - GSList *list; - GList *extensions = NULL; - gdouble n_plugins; - gdouble n_extensions; - gdouble nth; - GError *error = NULL; + gchar *filename; + gchar *basename; + gchar *path; + GSList *list; + GList *extensions = NULL; + gdouble n_plugins; + gdouble n_extensions; + gdouble nth; + GError *error = NULL; g_return_if_fail (GIMP_IS_GIMP (gimp)); + g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (status_callback != NULL); - context = gimp_context_new (gimp, "temp", NULL); - plug_in_init (gimp); /* search for binaries in the plug-in directory path */ @@ -361,8 +360,6 @@ plug_ins_init (Gimp *gimp, g_slist_free (gimp->plug_in_defs); gimp->plug_in_defs = NULL; - - g_object_unref (context); } void diff --git a/app/plug-in/plug-ins.h b/app/plug-in/plug-ins.h index b79b6d9d91..32a679ea9b 100644 --- a/app/plug-in/plug-ins.h +++ b/app/plug-in/plug-ins.h @@ -21,6 +21,7 @@ void plug_ins_init (Gimp *gimp, + GimpContext *context, GimpInitStatusFunc status_callback); void plug_ins_exit (Gimp *gimp);