mirror of https://github.com/GNOME/gimp.git
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:
parent
a270381096
commit
39ed2677f6
|
@ -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>
|
||||
|
||||
* app/plug-in/gimpplugindebug.[ch] (gimp_plug_in_debug_argv): made
|
||||
|
|
|
@ -221,29 +221,48 @@ gimp_gegl_tool_map (GimpImageMapTool *image_map_tool)
|
|||
g_free (pspecs);
|
||||
}
|
||||
|
||||
/* Builds a GList of the class structures of all subtypes
|
||||
* of type.
|
||||
static gboolean
|
||||
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 *
|
||||
gimp_get_subtype_classes (GType type,
|
||||
GList *classes)
|
||||
{
|
||||
GObjectClass *klass;
|
||||
GType *ops;
|
||||
guint n_ops;
|
||||
gint i;
|
||||
GeglOperationClass *klass;
|
||||
GType *ops;
|
||||
guint n_ops;
|
||||
gint i;
|
||||
|
||||
if (!type)
|
||||
if (! type)
|
||||
return classes;
|
||||
|
||||
klass = g_type_class_ref (type);
|
||||
klass = GEGL_OPERATION_CLASS (g_type_class_ref (type));
|
||||
ops = g_type_children (type, &n_ops);
|
||||
|
||||
/* only add classes which have a name, this avoids
|
||||
* the abstract base classes
|
||||
*/
|
||||
if (GEGL_OPERATION_CLASS (klass)->name)
|
||||
classes = g_list_prepend (classes, klass);
|
||||
if (klass->name)
|
||||
{
|
||||
if (! gimp_gegl_tool_operation_blacklisted (klass->name))
|
||||
classes = g_list_prepend (classes, klass);
|
||||
}
|
||||
|
||||
for (i = 0; i < n_ops; i++)
|
||||
classes = gimp_get_subtype_classes (ops[i], classes);
|
||||
|
|
Loading…
Reference in New Issue