1997-11-25 06:05:25 +08:00
|
|
|
/* 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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-07-16 20:49:04 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "config.h"
|
1999-03-07 20:56:03 +08:00
|
|
|
|
2003-01-30 19:20:12 +08:00
|
|
|
#include <glib-object.h>
|
1999-06-15 06:18:02 +08:00
|
|
|
|
2001-12-01 08:14:14 +08:00
|
|
|
#include "plug-in-types.h"
|
2001-05-22 04:30:16 +08:00
|
|
|
|
2001-12-01 08:14:14 +08:00
|
|
|
#include "plug-in.h"
|
2002-03-21 01:46:13 +08:00
|
|
|
#include "plug-in-def.h"
|
2001-12-19 08:13:16 +08:00
|
|
|
#include "plug-in-proc.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-02-24 02:07:53 +08:00
|
|
|
|
|
|
|
PlugInDef *
|
2001-01-14 11:55:56 +08:00
|
|
|
plug_in_def_new (const gchar *prog)
|
2000-02-24 02:07:53 +08:00
|
|
|
{
|
|
|
|
PlugInDef *plug_in_def;
|
|
|
|
|
|
|
|
g_return_val_if_fail (prog != NULL, NULL);
|
|
|
|
|
2001-12-29 06:58:14 +08:00
|
|
|
plug_in_def = g_new0 (PlugInDef, 1);
|
2000-02-24 02:07:53 +08:00
|
|
|
|
2001-12-29 06:58:14 +08:00
|
|
|
plug_in_def->prog = g_strdup (prog);
|
2000-02-24 02:07:53 +08:00
|
|
|
|
|
|
|
return plug_in_def;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
plug_in_def_free (PlugInDef *plug_in_def,
|
|
|
|
gboolean free_proc_defs)
|
|
|
|
{
|
2003-01-18 02:07:37 +08:00
|
|
|
g_return_if_fail (plug_in_def != NULL);
|
2000-02-24 02:07:53 +08:00
|
|
|
|
|
|
|
g_free (plug_in_def->prog);
|
2001-12-29 06:58:14 +08:00
|
|
|
g_free (plug_in_def->locale_domain);
|
|
|
|
g_free (plug_in_def->locale_path);
|
|
|
|
g_free (plug_in_def->help_path);
|
2000-02-24 02:07:53 +08:00
|
|
|
|
2000-02-24 06:31:26 +08:00
|
|
|
if (free_proc_defs)
|
2000-02-24 02:07:53 +08:00
|
|
|
{
|
2003-01-18 02:07:37 +08:00
|
|
|
GSList *list;
|
|
|
|
|
2000-02-24 02:07:53 +08:00
|
|
|
for (list = plug_in_def->proc_defs; list; list = list->next)
|
2003-01-18 02:07:37 +08:00
|
|
|
plug_in_proc_def_free ((PlugInProcDef *) list->data);
|
2000-02-24 02:07:53 +08:00
|
|
|
}
|
|
|
|
|
2000-02-24 06:31:26 +08:00
|
|
|
if (plug_in_def->proc_defs)
|
|
|
|
g_slist_free (plug_in_def->proc_defs);
|
|
|
|
|
2000-02-24 02:07:53 +08:00
|
|
|
g_free (plug_in_def);
|
|
|
|
}
|
|
|
|
|
2001-11-25 04:31:15 +08:00
|
|
|
void
|
|
|
|
plug_in_def_add_proc_def (PlugInDef *plug_in_def,
|
|
|
|
PlugInProcDef *proc_def)
|
|
|
|
{
|
2003-01-18 02:07:37 +08:00
|
|
|
g_return_if_fail (plug_in_def != NULL);
|
|
|
|
|
2001-11-25 04:31:15 +08:00
|
|
|
proc_def->mtime = plug_in_def->mtime;
|
2003-01-18 02:07:37 +08:00
|
|
|
proc_def->prog = g_strdup (plug_in_def->prog);
|
2001-11-25 04:31:15 +08:00
|
|
|
|
|
|
|
plug_in_def->proc_defs = g_slist_append (plug_in_def->proc_defs,
|
|
|
|
proc_def);
|
|
|
|
}
|
2000-02-24 02:07:53 +08:00
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
void
|
|
|
|
plug_in_def_set_locale_domain_name (PlugInDef *plug_in_def,
|
|
|
|
const gchar *domain_name)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-18 02:07:37 +08:00
|
|
|
g_return_if_fail (plug_in_def != NULL);
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
if (plug_in_def->locale_domain)
|
|
|
|
g_free (plug_in_def->locale_domain);
|
|
|
|
plug_in_def->locale_domain = g_strdup (domain_name);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2002-03-21 01:46:13 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
2002-03-21 01:46:13 +08:00
|
|
|
plug_in_def_set_locale_domain_path (PlugInDef *plug_in_def,
|
|
|
|
const gchar *domain_path)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-01-18 02:07:37 +08:00
|
|
|
g_return_if_fail (plug_in_def != NULL);
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
if (plug_in_def->locale_path)
|
|
|
|
g_free (plug_in_def->locale_path);
|
|
|
|
plug_in_def->locale_path = g_strdup (domain_path);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2002-03-21 01:46:13 +08:00
|
|
|
void
|
|
|
|
plug_in_def_set_help_path (PlugInDef *plug_in_def,
|
|
|
|
const gchar *help_path)
|
2001-11-25 04:31:15 +08:00
|
|
|
{
|
2003-01-18 02:07:37 +08:00
|
|
|
g_return_if_fail (plug_in_def != NULL);
|
|
|
|
|
2001-11-25 04:31:15 +08:00
|
|
|
if (plug_in_def->help_path)
|
|
|
|
g_free (plug_in_def->help_path);
|
|
|
|
plug_in_def->help_path = g_strdup (help_path);
|
|
|
|
}
|
2003-01-18 02:07:37 +08:00
|
|
|
void
|
|
|
|
plug_in_def_set_mtime (PlugInDef *plug_in_def,
|
|
|
|
time_t mtime)
|
|
|
|
{
|
|
|
|
g_return_if_fail (plug_in_def != NULL);
|
|
|
|
|
|
|
|
plug_in_def->mtime = mtime;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
plug_in_def_set_needs_query (PlugInDef *plug_in_def,
|
|
|
|
gboolean needs_query)
|
|
|
|
{
|
|
|
|
g_return_if_fail (plug_in_def != NULL);
|
|
|
|
|
|
|
|
plug_in_def->needs_query = needs_query ? TRUE : FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
plug_in_def_set_has_init (PlugInDef *plug_in_def,
|
|
|
|
gboolean has_init)
|
|
|
|
{
|
|
|
|
g_return_if_fail (plug_in_def != NULL);
|
|
|
|
|
|
|
|
plug_in_def->has_init = has_init ? TRUE : FALSE;
|
|
|
|
}
|