mirror of https://github.com/GNOME/gimp.git
new function which finds a proc_def in a GSList by its procedure name.
2005-05-04 Michael Natterer <mitch@gimp.org> * app/plug-in/plug-in-proc-def.[ch] (plug_in_proc_def_find): new function which finds a proc_def in a GSList by its procedure name. * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * tools/pdbgen/pdb/plug_in.pdb: use it instead of iterating and comparing manually. * app/pdb/plug_in_cmds.c: regenerated. * app/plug-in/plug-in-def.c: minor cleanups.
This commit is contained in:
parent
4882ad57d9
commit
4f2e5afc38
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2005-05-04 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/plug-in/plug-in-proc-def.[ch] (plug_in_proc_def_find): new
|
||||
function which finds a proc_def in a GSList by its procedure name.
|
||||
|
||||
* app/plug-in/plug-in-message.c
|
||||
* app/plug-in/plug-ins.c
|
||||
* tools/pdbgen/pdb/plug_in.pdb: use it instead of iterating and
|
||||
comparing manually.
|
||||
|
||||
* app/pdb/plug_in_cmds.c: regenerated.
|
||||
|
||||
* app/plug-in/plug-in-def.c: minor cleanups.
|
||||
|
||||
2005-05-04 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimpfgbgeditor.c (gimp_fg_bg_editor_button_press):
|
||||
|
|
|
@ -105,6 +105,23 @@ plug_in_proc_def_free (PlugInProcDef *proc_def)
|
|||
g_free (proc_def);
|
||||
}
|
||||
|
||||
PlugInProcDef *
|
||||
plug_in_proc_def_find (GSList *list,
|
||||
const gchar *proc_name)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
for (l = list; l; l = g_slist_next (l))
|
||||
{
|
||||
PlugInProcDef *proc_def = l->data;
|
||||
|
||||
if (! strcmp (proc_name, proc_def->db_info.name))
|
||||
return proc_def;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const ProcRecord *
|
||||
plug_in_proc_def_get_proc (const PlugInProcDef *proc_def)
|
||||
{
|
||||
|
|
|
@ -59,6 +59,9 @@ struct _PlugInProcDef
|
|||
PlugInProcDef * plug_in_proc_def_new (void);
|
||||
void plug_in_proc_def_free (PlugInProcDef *proc_def);
|
||||
|
||||
PlugInProcDef * plug_in_proc_def_find (GSList *list,
|
||||
const gchar *proc_name);
|
||||
|
||||
const ProcRecord * plug_in_proc_def_get_proc (const PlugInProcDef *proc_def);
|
||||
const gchar * plug_in_proc_def_get_progname (const PlugInProcDef *proc_def);
|
||||
gchar * plug_in_proc_def_get_label (const PlugInProcDef *proc_def,
|
||||
|
|
|
@ -342,39 +342,14 @@ plugin_menu_register_invoker (Gimp *gimp,
|
|||
if (gimp->current_plug_in)
|
||||
{
|
||||
PlugInProcDef *proc_def = NULL;
|
||||
GSList *list;
|
||||
|
||||
if (gimp->current_plug_in->plug_in_def)
|
||||
{
|
||||
for (list = gimp->current_plug_in->plug_in_def->proc_defs;
|
||||
list;
|
||||
list = g_slist_next (list))
|
||||
{
|
||||
PlugInProcDef *pd = list->data;
|
||||
|
||||
if (! strcmp (procedure_name, pd->db_info.name))
|
||||
{
|
||||
proc_def = pd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
proc_def = plug_in_proc_def_find (gimp->current_plug_in->plug_in_def->proc_defs,
|
||||
procedure_name);
|
||||
|
||||
if (! proc_def)
|
||||
{
|
||||
for (list = gimp->current_plug_in->temp_proc_defs;
|
||||
list;
|
||||
list = g_slist_next (list))
|
||||
{
|
||||
PlugInProcDef *pd = list->data;
|
||||
|
||||
if (! strcmp (procedure_name, pd->db_info.name))
|
||||
{
|
||||
proc_def = pd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
proc_def = plug_in_proc_def_find (gimp->current_plug_in->temp_proc_defs,
|
||||
procedure_name);
|
||||
|
||||
if (proc_def)
|
||||
{
|
||||
|
@ -587,23 +562,15 @@ plugin_icon_register_invoker (Gimp *gimp,
|
|||
{
|
||||
if (gimp->current_plug_in && gimp->current_plug_in->query)
|
||||
{
|
||||
GSList *list;
|
||||
PlugInProcDef *proc_def;
|
||||
|
||||
for (list = gimp->current_plug_in->plug_in_def->proc_defs;
|
||||
list;
|
||||
list = g_slist_next (list))
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
proc_def = plug_in_proc_def_find (gimp->current_plug_in->plug_in_def->proc_defs,
|
||||
procedure_name);
|
||||
|
||||
if (! strcmp (procedure_name, proc_def->db_info.name))
|
||||
{
|
||||
plug_in_proc_def_set_icon (proc_def, icon_type,
|
||||
icon_data, icon_data_length);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! list)
|
||||
if (proc_def)
|
||||
plug_in_proc_def_set_icon (proc_def, icon_type,
|
||||
icon_data, icon_data_length);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -570,7 +570,6 @@ plug_in_handle_proc_install (PlugIn *plug_in,
|
|||
PlugInDef *plug_in_def = NULL;
|
||||
PlugInProcDef *proc_def = NULL;
|
||||
ProcRecord *proc = NULL;
|
||||
GSList *tmp = NULL;
|
||||
gchar *prog = NULL;
|
||||
gboolean valid_utf8 = FALSE;
|
||||
gint i;
|
||||
|
@ -675,44 +674,31 @@ plug_in_handle_proc_install (PlugIn *plug_in,
|
|||
plug_in_def = plug_in->plug_in_def;
|
||||
prog = plug_in_def->prog;
|
||||
|
||||
tmp = plug_in_def->proc_defs;
|
||||
proc_def = plug_in_proc_def_find (plug_in_def->proc_defs,
|
||||
proc_install->name);
|
||||
if (proc_def)
|
||||
{
|
||||
plug_in_def->proc_defs = g_slist_remove (plug_in_def->proc_defs,
|
||||
proc_def);
|
||||
plug_in_proc_def_free (proc_def);
|
||||
}
|
||||
break;
|
||||
|
||||
case GIMP_TEMPORARY:
|
||||
plug_in_def = NULL;
|
||||
prog = "none";
|
||||
|
||||
tmp = plug_in->temp_proc_defs;
|
||||
proc_def = plug_in_proc_def_find (plug_in->temp_proc_defs,
|
||||
proc_install->name);
|
||||
if (proc_def)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
while (tmp)
|
||||
{
|
||||
proc_def = tmp->data;
|
||||
tmp = tmp->next;
|
||||
|
||||
if (strcmp (proc_def->db_info.name, proc_install->name) == 0)
|
||||
{
|
||||
switch (proc_install->type)
|
||||
{
|
||||
case GIMP_PLUGIN:
|
||||
case GIMP_EXTENSION:
|
||||
plug_in_def->proc_defs = g_slist_remove (plug_in_def->proc_defs,
|
||||
proc_def);
|
||||
plug_in_proc_def_free (proc_def);
|
||||
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;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
proc_def = plug_in_proc_def_new ();
|
||||
|
||||
if (proc_install->menu_path)
|
||||
|
@ -792,21 +778,15 @@ static void
|
|||
plug_in_handle_proc_uninstall (PlugIn *plug_in,
|
||||
GPProcUninstall *proc_uninstall)
|
||||
{
|
||||
GSList *tmp;
|
||||
PlugInProcDef *proc_def;
|
||||
|
||||
for (tmp = plug_in->temp_proc_defs; tmp; tmp = g_slist_next (tmp))
|
||||
proc_def = plug_in_proc_def_find (plug_in->temp_proc_defs,
|
||||
proc_uninstall->name);
|
||||
if (proc_def)
|
||||
{
|
||||
PlugInProcDef *proc_def;
|
||||
|
||||
proc_def = tmp->data;
|
||||
|
||||
if (! strcmp (proc_def->db_info.name, proc_uninstall->name))
|
||||
{
|
||||
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;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -411,7 +411,8 @@ plug_ins_file_register_magic (Gimp *gimp,
|
|||
const gchar *prefixes,
|
||||
const gchar *magics)
|
||||
{
|
||||
GSList *list;
|
||||
PlugInProcDef *proc_def;
|
||||
GSList *list;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
@ -421,49 +422,44 @@ plug_ins_file_register_magic (Gimp *gimp,
|
|||
else
|
||||
list = gimp->plug_in_proc_defs;
|
||||
|
||||
for (; list; list = list->next)
|
||||
proc_def = plug_in_proc_def_find (list, name);
|
||||
|
||||
if (proc_def)
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
proc_def->file_proc = TRUE;
|
||||
|
||||
if (strcmp (proc_def->db_info.name, name) == 0)
|
||||
{
|
||||
proc_def->file_proc = TRUE;
|
||||
if (proc_def->extensions != extensions)
|
||||
{
|
||||
if (proc_def->extensions)
|
||||
g_free (proc_def->extensions);
|
||||
proc_def->extensions = g_strdup (extensions);
|
||||
}
|
||||
|
||||
if (proc_def->extensions != extensions)
|
||||
{
|
||||
if (proc_def->extensions)
|
||||
g_free (proc_def->extensions);
|
||||
proc_def->extensions = g_strdup (extensions);
|
||||
}
|
||||
proc_def->extensions_list =
|
||||
plug_ins_extensions_parse (proc_def->extensions);
|
||||
|
||||
proc_def->extensions_list =
|
||||
plug_ins_extensions_parse (proc_def->extensions);
|
||||
if (proc_def->prefixes != prefixes)
|
||||
{
|
||||
if (proc_def->prefixes)
|
||||
g_free (proc_def->prefixes);
|
||||
proc_def->prefixes = g_strdup (prefixes);
|
||||
}
|
||||
|
||||
if (proc_def->prefixes != prefixes)
|
||||
{
|
||||
if (proc_def->prefixes)
|
||||
g_free (proc_def->prefixes);
|
||||
proc_def->prefixes = g_strdup (prefixes);
|
||||
}
|
||||
proc_def->prefixes_list =
|
||||
plug_ins_extensions_parse (proc_def->prefixes);
|
||||
|
||||
proc_def->prefixes_list =
|
||||
plug_ins_extensions_parse (proc_def->prefixes);
|
||||
if (proc_def->magics != magics)
|
||||
{
|
||||
if (proc_def->magics)
|
||||
g_free (proc_def->magics);
|
||||
proc_def->magics = g_strdup (magics);
|
||||
}
|
||||
|
||||
if (proc_def->magics != magics)
|
||||
{
|
||||
if (proc_def->magics)
|
||||
g_free (proc_def->magics);
|
||||
proc_def->magics = g_strdup (magics);
|
||||
}
|
||||
|
||||
proc_def->magics_list =
|
||||
plug_ins_extensions_parse (proc_def->magics);
|
||||
|
||||
return proc_def;
|
||||
}
|
||||
proc_def->magics_list =
|
||||
plug_ins_extensions_parse (proc_def->magics);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return proc_def;
|
||||
}
|
||||
|
||||
PlugInProcDef *
|
||||
|
@ -471,7 +467,8 @@ plug_ins_file_register_mime (Gimp *gimp,
|
|||
const gchar *name,
|
||||
const gchar *mime_type)
|
||||
{
|
||||
GSList *list;
|
||||
PlugInProcDef *proc_def;
|
||||
GSList *list;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
@ -482,21 +479,16 @@ plug_ins_file_register_mime (Gimp *gimp,
|
|||
else
|
||||
list = gimp->plug_in_proc_defs;
|
||||
|
||||
for (; list; list = list->next)
|
||||
proc_def = plug_in_proc_def_find (list, name);
|
||||
|
||||
if (proc_def)
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
|
||||
if (strcmp (proc_def->db_info.name, name) == 0)
|
||||
{
|
||||
if (proc_def->mime_type)
|
||||
g_free (proc_def->mime_type);
|
||||
proc_def->mime_type = g_strdup (mime_type);
|
||||
|
||||
return proc_def;
|
||||
}
|
||||
if (proc_def->mime_type)
|
||||
g_free (proc_def->mime_type);
|
||||
proc_def->mime_type = g_strdup (mime_type);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return proc_def;
|
||||
}
|
||||
|
||||
PlugInProcDef *
|
||||
|
@ -504,7 +496,8 @@ plug_ins_file_register_thumb_loader (Gimp *gimp,
|
|||
const gchar *load_proc,
|
||||
const gchar *thumb_proc)
|
||||
{
|
||||
GSList *list;
|
||||
PlugInProcDef *proc_def;
|
||||
GSList *list;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (load_proc, NULL);
|
||||
|
@ -515,21 +508,16 @@ plug_ins_file_register_thumb_loader (Gimp *gimp,
|
|||
else
|
||||
list = gimp->plug_in_proc_defs;
|
||||
|
||||
for (; list; list = list->next)
|
||||
proc_def = plug_in_proc_def_find (list, load_proc);
|
||||
|
||||
if (proc_def)
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
|
||||
if (strcmp (proc_def->db_info.name, load_proc) == 0)
|
||||
{
|
||||
if (proc_def->thumb_loader)
|
||||
g_free (proc_def->thumb_loader);
|
||||
proc_def->thumb_loader = g_strdup (thumb_proc);
|
||||
|
||||
return proc_def;
|
||||
}
|
||||
if (proc_def->thumb_loader)
|
||||
g_free (proc_def->thumb_loader);
|
||||
proc_def->thumb_loader = g_strdup (thumb_proc);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return proc_def;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -105,6 +105,23 @@ plug_in_proc_def_free (PlugInProcDef *proc_def)
|
|||
g_free (proc_def);
|
||||
}
|
||||
|
||||
PlugInProcDef *
|
||||
plug_in_proc_def_find (GSList *list,
|
||||
const gchar *proc_name)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
for (l = list; l; l = g_slist_next (l))
|
||||
{
|
||||
PlugInProcDef *proc_def = l->data;
|
||||
|
||||
if (! strcmp (proc_name, proc_def->db_info.name))
|
||||
return proc_def;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const ProcRecord *
|
||||
plug_in_proc_def_get_proc (const PlugInProcDef *proc_def)
|
||||
{
|
||||
|
|
|
@ -59,6 +59,9 @@ struct _PlugInProcDef
|
|||
PlugInProcDef * plug_in_proc_def_new (void);
|
||||
void plug_in_proc_def_free (PlugInProcDef *proc_def);
|
||||
|
||||
PlugInProcDef * plug_in_proc_def_find (GSList *list,
|
||||
const gchar *proc_name);
|
||||
|
||||
const ProcRecord * plug_in_proc_def_get_proc (const PlugInProcDef *proc_def);
|
||||
const gchar * plug_in_proc_def_get_progname (const PlugInProcDef *proc_def);
|
||||
gchar * plug_in_proc_def_get_label (const PlugInProcDef *proc_def,
|
||||
|
|
|
@ -56,12 +56,8 @@ plug_in_def_free (PlugInDef *plug_in_def,
|
|||
g_free (plug_in_def->help_domain_uri);
|
||||
|
||||
if (free_proc_defs)
|
||||
{
|
||||
GSList *list;
|
||||
|
||||
for (list = plug_in_def->proc_defs; list; list = list->next)
|
||||
plug_in_proc_def_free ((PlugInProcDef *) list->data);
|
||||
}
|
||||
g_slist_foreach (plug_in_def->proc_defs, (GFunc) plug_in_proc_def_free,
|
||||
NULL);
|
||||
|
||||
if (plug_in_def->proc_defs)
|
||||
g_slist_free (plug_in_def->proc_defs);
|
||||
|
@ -78,8 +74,7 @@ plug_in_def_add_proc_def (PlugInDef *plug_in_def,
|
|||
proc_def->mtime = plug_in_def->mtime;
|
||||
proc_def->prog = g_strdup (plug_in_def->prog);
|
||||
|
||||
plug_in_def->proc_defs = g_slist_append (plug_in_def->proc_defs,
|
||||
proc_def);
|
||||
plug_in_def->proc_defs = g_slist_append (plug_in_def->proc_defs, proc_def);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -570,7 +570,6 @@ plug_in_handle_proc_install (PlugIn *plug_in,
|
|||
PlugInDef *plug_in_def = NULL;
|
||||
PlugInProcDef *proc_def = NULL;
|
||||
ProcRecord *proc = NULL;
|
||||
GSList *tmp = NULL;
|
||||
gchar *prog = NULL;
|
||||
gboolean valid_utf8 = FALSE;
|
||||
gint i;
|
||||
|
@ -675,44 +674,31 @@ plug_in_handle_proc_install (PlugIn *plug_in,
|
|||
plug_in_def = plug_in->plug_in_def;
|
||||
prog = plug_in_def->prog;
|
||||
|
||||
tmp = plug_in_def->proc_defs;
|
||||
proc_def = plug_in_proc_def_find (plug_in_def->proc_defs,
|
||||
proc_install->name);
|
||||
if (proc_def)
|
||||
{
|
||||
plug_in_def->proc_defs = g_slist_remove (plug_in_def->proc_defs,
|
||||
proc_def);
|
||||
plug_in_proc_def_free (proc_def);
|
||||
}
|
||||
break;
|
||||
|
||||
case GIMP_TEMPORARY:
|
||||
plug_in_def = NULL;
|
||||
prog = "none";
|
||||
|
||||
tmp = plug_in->temp_proc_defs;
|
||||
proc_def = plug_in_proc_def_find (plug_in->temp_proc_defs,
|
||||
proc_install->name);
|
||||
if (proc_def)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
while (tmp)
|
||||
{
|
||||
proc_def = tmp->data;
|
||||
tmp = tmp->next;
|
||||
|
||||
if (strcmp (proc_def->db_info.name, proc_install->name) == 0)
|
||||
{
|
||||
switch (proc_install->type)
|
||||
{
|
||||
case GIMP_PLUGIN:
|
||||
case GIMP_EXTENSION:
|
||||
plug_in_def->proc_defs = g_slist_remove (plug_in_def->proc_defs,
|
||||
proc_def);
|
||||
plug_in_proc_def_free (proc_def);
|
||||
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;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
proc_def = plug_in_proc_def_new ();
|
||||
|
||||
if (proc_install->menu_path)
|
||||
|
@ -792,21 +778,15 @@ static void
|
|||
plug_in_handle_proc_uninstall (PlugIn *plug_in,
|
||||
GPProcUninstall *proc_uninstall)
|
||||
{
|
||||
GSList *tmp;
|
||||
PlugInProcDef *proc_def;
|
||||
|
||||
for (tmp = plug_in->temp_proc_defs; tmp; tmp = g_slist_next (tmp))
|
||||
proc_def = plug_in_proc_def_find (plug_in->temp_proc_defs,
|
||||
proc_uninstall->name);
|
||||
if (proc_def)
|
||||
{
|
||||
PlugInProcDef *proc_def;
|
||||
|
||||
proc_def = tmp->data;
|
||||
|
||||
if (! strcmp (proc_def->db_info.name, proc_uninstall->name))
|
||||
{
|
||||
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;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -105,6 +105,23 @@ plug_in_proc_def_free (PlugInProcDef *proc_def)
|
|||
g_free (proc_def);
|
||||
}
|
||||
|
||||
PlugInProcDef *
|
||||
plug_in_proc_def_find (GSList *list,
|
||||
const gchar *proc_name)
|
||||
{
|
||||
GSList *l;
|
||||
|
||||
for (l = list; l; l = g_slist_next (l))
|
||||
{
|
||||
PlugInProcDef *proc_def = l->data;
|
||||
|
||||
if (! strcmp (proc_name, proc_def->db_info.name))
|
||||
return proc_def;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const ProcRecord *
|
||||
plug_in_proc_def_get_proc (const PlugInProcDef *proc_def)
|
||||
{
|
||||
|
|
|
@ -59,6 +59,9 @@ struct _PlugInProcDef
|
|||
PlugInProcDef * plug_in_proc_def_new (void);
|
||||
void plug_in_proc_def_free (PlugInProcDef *proc_def);
|
||||
|
||||
PlugInProcDef * plug_in_proc_def_find (GSList *list,
|
||||
const gchar *proc_name);
|
||||
|
||||
const ProcRecord * plug_in_proc_def_get_proc (const PlugInProcDef *proc_def);
|
||||
const gchar * plug_in_proc_def_get_progname (const PlugInProcDef *proc_def);
|
||||
gchar * plug_in_proc_def_get_label (const PlugInProcDef *proc_def,
|
||||
|
|
|
@ -411,7 +411,8 @@ plug_ins_file_register_magic (Gimp *gimp,
|
|||
const gchar *prefixes,
|
||||
const gchar *magics)
|
||||
{
|
||||
GSList *list;
|
||||
PlugInProcDef *proc_def;
|
||||
GSList *list;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
@ -421,49 +422,44 @@ plug_ins_file_register_magic (Gimp *gimp,
|
|||
else
|
||||
list = gimp->plug_in_proc_defs;
|
||||
|
||||
for (; list; list = list->next)
|
||||
proc_def = plug_in_proc_def_find (list, name);
|
||||
|
||||
if (proc_def)
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
proc_def->file_proc = TRUE;
|
||||
|
||||
if (strcmp (proc_def->db_info.name, name) == 0)
|
||||
{
|
||||
proc_def->file_proc = TRUE;
|
||||
if (proc_def->extensions != extensions)
|
||||
{
|
||||
if (proc_def->extensions)
|
||||
g_free (proc_def->extensions);
|
||||
proc_def->extensions = g_strdup (extensions);
|
||||
}
|
||||
|
||||
if (proc_def->extensions != extensions)
|
||||
{
|
||||
if (proc_def->extensions)
|
||||
g_free (proc_def->extensions);
|
||||
proc_def->extensions = g_strdup (extensions);
|
||||
}
|
||||
proc_def->extensions_list =
|
||||
plug_ins_extensions_parse (proc_def->extensions);
|
||||
|
||||
proc_def->extensions_list =
|
||||
plug_ins_extensions_parse (proc_def->extensions);
|
||||
if (proc_def->prefixes != prefixes)
|
||||
{
|
||||
if (proc_def->prefixes)
|
||||
g_free (proc_def->prefixes);
|
||||
proc_def->prefixes = g_strdup (prefixes);
|
||||
}
|
||||
|
||||
if (proc_def->prefixes != prefixes)
|
||||
{
|
||||
if (proc_def->prefixes)
|
||||
g_free (proc_def->prefixes);
|
||||
proc_def->prefixes = g_strdup (prefixes);
|
||||
}
|
||||
proc_def->prefixes_list =
|
||||
plug_ins_extensions_parse (proc_def->prefixes);
|
||||
|
||||
proc_def->prefixes_list =
|
||||
plug_ins_extensions_parse (proc_def->prefixes);
|
||||
if (proc_def->magics != magics)
|
||||
{
|
||||
if (proc_def->magics)
|
||||
g_free (proc_def->magics);
|
||||
proc_def->magics = g_strdup (magics);
|
||||
}
|
||||
|
||||
if (proc_def->magics != magics)
|
||||
{
|
||||
if (proc_def->magics)
|
||||
g_free (proc_def->magics);
|
||||
proc_def->magics = g_strdup (magics);
|
||||
}
|
||||
|
||||
proc_def->magics_list =
|
||||
plug_ins_extensions_parse (proc_def->magics);
|
||||
|
||||
return proc_def;
|
||||
}
|
||||
proc_def->magics_list =
|
||||
plug_ins_extensions_parse (proc_def->magics);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return proc_def;
|
||||
}
|
||||
|
||||
PlugInProcDef *
|
||||
|
@ -471,7 +467,8 @@ plug_ins_file_register_mime (Gimp *gimp,
|
|||
const gchar *name,
|
||||
const gchar *mime_type)
|
||||
{
|
||||
GSList *list;
|
||||
PlugInProcDef *proc_def;
|
||||
GSList *list;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
@ -482,21 +479,16 @@ plug_ins_file_register_mime (Gimp *gimp,
|
|||
else
|
||||
list = gimp->plug_in_proc_defs;
|
||||
|
||||
for (; list; list = list->next)
|
||||
proc_def = plug_in_proc_def_find (list, name);
|
||||
|
||||
if (proc_def)
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
|
||||
if (strcmp (proc_def->db_info.name, name) == 0)
|
||||
{
|
||||
if (proc_def->mime_type)
|
||||
g_free (proc_def->mime_type);
|
||||
proc_def->mime_type = g_strdup (mime_type);
|
||||
|
||||
return proc_def;
|
||||
}
|
||||
if (proc_def->mime_type)
|
||||
g_free (proc_def->mime_type);
|
||||
proc_def->mime_type = g_strdup (mime_type);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return proc_def;
|
||||
}
|
||||
|
||||
PlugInProcDef *
|
||||
|
@ -504,7 +496,8 @@ plug_ins_file_register_thumb_loader (Gimp *gimp,
|
|||
const gchar *load_proc,
|
||||
const gchar *thumb_proc)
|
||||
{
|
||||
GSList *list;
|
||||
PlugInProcDef *proc_def;
|
||||
GSList *list;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (load_proc, NULL);
|
||||
|
@ -515,21 +508,16 @@ plug_ins_file_register_thumb_loader (Gimp *gimp,
|
|||
else
|
||||
list = gimp->plug_in_proc_defs;
|
||||
|
||||
for (; list; list = list->next)
|
||||
proc_def = plug_in_proc_def_find (list, load_proc);
|
||||
|
||||
if (proc_def)
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
|
||||
if (strcmp (proc_def->db_info.name, load_proc) == 0)
|
||||
{
|
||||
if (proc_def->thumb_loader)
|
||||
g_free (proc_def->thumb_loader);
|
||||
proc_def->thumb_loader = g_strdup (thumb_proc);
|
||||
|
||||
return proc_def;
|
||||
}
|
||||
if (proc_def->thumb_loader)
|
||||
g_free (proc_def->thumb_loader);
|
||||
proc_def->thumb_loader = g_strdup (thumb_proc);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return proc_def;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -181,39 +181,14 @@ HELP
|
|||
if (gimp->current_plug_in)
|
||||
{
|
||||
PlugInProcDef *proc_def = NULL;
|
||||
GSList *list;
|
||||
|
||||
if (gimp->current_plug_in->plug_in_def)
|
||||
{
|
||||
for (list = gimp->current_plug_in->plug_in_def->proc_defs;
|
||||
list;
|
||||
list = g_slist_next (list))
|
||||
{
|
||||
PlugInProcDef *pd = list->data;
|
||||
|
||||
if (! strcmp (procedure_name, pd->db_info.name))
|
||||
{
|
||||
proc_def = pd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
proc_def = plug_in_proc_def_find (gimp->current_plug_in->plug_in_def->proc_defs,
|
||||
procedure_name);
|
||||
|
||||
if (! proc_def)
|
||||
{
|
||||
for (list = gimp->current_plug_in->temp_proc_defs;
|
||||
list;
|
||||
list = g_slist_next (list))
|
||||
{
|
||||
PlugInProcDef *pd = list->data;
|
||||
|
||||
if (! strcmp (procedure_name, pd->db_info.name))
|
||||
{
|
||||
proc_def = pd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
proc_def = plug_in_proc_def_find (gimp->current_plug_in->temp_proc_defs,
|
||||
procedure_name);
|
||||
|
||||
if (proc_def)
|
||||
{
|
||||
|
@ -362,23 +337,15 @@ HELP
|
|||
{
|
||||
if (gimp->current_plug_in && gimp->current_plug_in->query)
|
||||
{
|
||||
GSList *list;
|
||||
PlugInProcDef *proc_def;
|
||||
|
||||
for (list = gimp->current_plug_in->plug_in_def->proc_defs;
|
||||
list;
|
||||
list = g_slist_next (list))
|
||||
{
|
||||
PlugInProcDef *proc_def = list->data;
|
||||
proc_def = plug_in_proc_def_find (gimp->current_plug_in->plug_in_def->proc_defs,
|
||||
procedure_name);
|
||||
|
||||
if (! strcmp (procedure_name, proc_def->db_info.name))
|
||||
{
|
||||
plug_in_proc_def_set_icon (proc_def, icon_type,
|
||||
icon_data, icon_data_length);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! list)
|
||||
if (proc_def)
|
||||
plug_in_proc_def_set_icon (proc_def, icon_type,
|
||||
icon_data, icon_data_length);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue