added a blacklist of operations that should not be shown. We may want to

2008-09-05  Sven Neumann  <sven@gimp.org>

	* app/tools/gimpgegltool.c: added a blacklist of operations that
	should not be shown. We may want to add more operations here.


svn path=/trunk/; revision=26878
This commit is contained in:
Sven Neumann 2008-09-05 17:11:48 +00:00 committed by Sven Neumann
parent a270381096
commit 39ed2677f6
2 changed files with 34 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2008-09-05 Sven Neumann <sven@gimp.org>
* app/tools/gimpgegltool.c: added a blacklist of operations that
should not be shown. We may want to add more operations here.
2008-09-05 Michael Natterer <mitch@gimp.org> 2008-09-05 Michael Natterer <mitch@gimp.org>
* app/plug-in/gimpplugindebug.[ch] (gimp_plug_in_debug_argv): made * app/plug-in/gimpplugindebug.[ch] (gimp_plug_in_debug_argv): made

View File

@ -221,14 +221,30 @@ gimp_gegl_tool_map (GimpImageMapTool *image_map_tool)
g_free (pspecs); g_free (pspecs);
} }
/* Builds a GList of the class structures of all subtypes static gboolean
* of type. gimp_gegl_tool_operation_blacklisted (const gchar *name)
{
static const gchar * const blacklist[] = { "introspect" };
gint i;
for (i = 0; i < G_N_ELEMENTS (blacklist); i++)
{
if (strcmp (name, blacklist[i]) == 0)
return TRUE;
}
return FALSE;
}
/* Builds a GList of the class structures of all subtypes of type.
*/ */
static GList * static GList *
gimp_get_subtype_classes (GType type, gimp_get_subtype_classes (GType type,
GList *classes) GList *classes)
{ {
GObjectClass *klass; GeglOperationClass *klass;
GType *ops; GType *ops;
guint n_ops; guint n_ops;
gint i; gint i;
@ -236,14 +252,17 @@ gimp_get_subtype_classes (GType type,
if (! type) if (! type)
return classes; return classes;
klass = g_type_class_ref (type); klass = GEGL_OPERATION_CLASS (g_type_class_ref (type));
ops = g_type_children (type, &n_ops); ops = g_type_children (type, &n_ops);
/* only add classes which have a name, this avoids /* only add classes which have a name, this avoids
* the abstract base classes * the abstract base classes
*/ */
if (GEGL_OPERATION_CLASS (klass)->name) if (klass->name)
{
if (! gimp_gegl_tool_operation_blacklisted (klass->name))
classes = g_list_prepend (classes, klass); classes = g_list_prepend (classes, klass);
}
for (i = 0; i < n_ops; i++) for (i = 0; i < n_ops; i++)
classes = gimp_get_subtype_classes (ops[i], classes); classes = gimp_get_subtype_classes (ops[i], classes);