diff --git a/app/actions/filters-actions.c b/app/actions/filters-actions.c index e533f5dc89..4b65c41294 100644 --- a/app/actions/filters-actions.c +++ b/app/actions/filters-actions.c @@ -789,6 +789,9 @@ filters_actions_setup (GimpActionGroup *group) const gchar *op_name; gchar *label; + if (filters_actions_gegl_op_blocklisted (op_class->name)) + continue; + formatted_op_name = g_strdup (op_class->name); gimp_make_valid_action_name (formatted_op_name); action_name = g_strdup_printf ("filters-%s", formatted_op_name); @@ -1120,6 +1123,36 @@ filters_actions_update (GimpActionGroup *group, } } +gboolean +filters_actions_gegl_op_blocklisted (const gchar *operation_name) +{ + for (gint i = 0; i < G_N_ELEMENTS (filters_actions); i++) + { + const GimpStringActionEntry *action_entry = &filters_actions[i]; + + if (g_strcmp0 (operation_name, action_entry->value) == 0) + return TRUE; + } + + for (gint i = 0; i < G_N_ELEMENTS (filters_settings_actions); i++) + { + const GimpStringActionEntry *action_entry = &filters_settings_actions[i]; + + if (g_strcmp0 (operation_name, action_entry->value) == 0) + return TRUE; + } + + for (gint i = 0; i < G_N_ELEMENTS (filters_interactive_actions); i++) + { + const GimpStringActionEntry *action_entry = &filters_interactive_actions[i]; + + if (g_strcmp0 (operation_name, action_entry->value) == 0) + return TRUE; + } + + return FALSE; +} + static void filters_actions_set_tooltips (GimpActionGroup *group, const GimpStringActionEntry *entries, diff --git a/app/actions/filters-actions.h b/app/actions/filters-actions.h index 624dd0cd92..b7b20e7578 100644 --- a/app/actions/filters-actions.h +++ b/app/actions/filters-actions.h @@ -17,7 +17,7 @@ #pragma once - -void filters_actions_setup (GimpActionGroup *group); -void filters_actions_update (GimpActionGroup *group, - gpointer data); +void filters_actions_setup (GimpActionGroup *group); +void filters_actions_update (GimpActionGroup *group, + gpointer data); +gboolean filters_actions_gegl_op_blocklisted (const gchar *operation_name); diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c index bf38c3ba5b..49d35bc307 100644 --- a/app/gegl/gimp-gegl-utils.c +++ b/app/gegl/gimp-gegl-utils.c @@ -490,127 +490,8 @@ gimp_gegl_op_blacklisted (const gchar *name, }; static const gchar * const name_blacklist[] = { - /* these ops are already added to the menus via filters-actions */ - "gegl:alien-map", - "gegl:antialias", - "gegl:apply-lens", - "gegl:bayer-matrix", - "gegl:bloom", - "gegl:bump-map", - "gegl:c2g", - "gegl:cartoon", - "gegl:cell-noise", - "gegl:channel-mixer", - "gegl:checkerboard", - "gegl:color", - "gegl:color-enhance", - "gegl:color-exchange", - "gegl:color-rotate", - "gegl:color-temperature", - "gegl:color-to-alpha", - "gegl:component-extract", - "gegl:convolution-matrix", - "gegl:cubism", - "gegl:deinterlace", - "gegl:difference-of-gaussians", - "gegl:diffraction-patterns", - "gegl:displace", - "gegl:distance-transform", - "gegl:dither", - "gegl:dropshadow", - "gegl:edge", - "gegl:edge-laplace", - "gegl:edge-neon", - "gegl:edge-sobel", - "gegl:emboss", - "gegl:engrave", - "gegl:exposure", - "gegl:fattal02", - "gegl:focus-blur", - "gegl:fractal-trace", - "gegl:gaussian-blur", - "gegl:gaussian-blur-selective", - "gegl:gegl", - "gegl:grid", - "gegl:high-pass", - "gegl:hue-chroma", - "gegl:illusion", - "gegl:json:dropshadow2", - "gegl:json:grey2", - "gegl:image-gradient", - "gegl:invert-linear", - "gegl:invert-gamma", - "gegl:lens-blur", - "gegl:lens-distortion", - "gegl:lens-flare", - "gegl:linear-sinusoid", - "gegl:long-shadow", - "gegl:mantiuk06", - "gegl:maze", - "gegl:mean-curvature-blur", - "gegl:median-blur", - "gegl:mirrors", - "gegl:mono-mixer", - "gegl:mosaic", - "gegl:motion-blur-circular", - "gegl:motion-blur-linear", - "gegl:motion-blur-zoom", - "gegl:newsprint", - "gegl:noise-cie-lch", - "gegl:noise-hsv", - "gegl:noise-hurl", - "gegl:noise-pick", - "gegl:noise-reduction", - "gegl:noise-rgb", - "gegl:noise-slur", - "gegl:noise-solid", - "gegl:noise-spread", - "gegl:normal-map", - "gegl:oilify", - "gegl:panorama-projection", - "gegl:perlin-noise", - "gegl:photocopy", - "gegl:pixelize", - "gegl:plasma", - "gegl:polar-coordinates", - "gegl:recursive-transform", - "gegl:red-eye-removal", - "gegl:reinhard05", - "gegl:rgb-clip", - "gegl:ripple", - "gegl:saturation", - "gegl:sepia", - "gegl:shadows-highlights", - "gegl:shift", - "gegl:simplex-noise", - "gegl:sinus", - "gegl:slic", - "gegl:snn-mean", - "gegl:softglow", - "gegl:spherize", - "gegl:spiral", - "gegl:stereographic-projection", - "gegl:stretch-contrast", - "gegl:stretch-contrast-hsv", - "gegl:stress", - "gegl:supernova", - "gegl:texturize-canvas", - "gegl:tile-glass", - "gegl:tile-paper", - "gegl:tile-seamless", - "gegl:unsharp-mask", - "gegl:value-invert", - "gegl:value-propagate", - "gegl:variable-blur", - "gegl:video-degradation", - "gegl:vignette", - "gegl:waterpixels", - "gegl:wavelet-blur", - "gegl:waves", - "gegl:whirl-pinch", - "gegl:wind", - /* these ops are blacklisted for other reasons */ + "gegl:color", /* pointless */ "gegl:contrast-curve", "gegl:convert-format", /* pointless */ "gegl:ditto", /* pointless */ @@ -618,6 +499,8 @@ gimp_gegl_op_blacklisted (const gchar *name, "gegl:gray", /* we use gimp's op */ "gegl:hstack", /* deleted from GEGL and replaced by gegl:pack */ "gegl:introspect", /* pointless */ + "gegl:json:dropshadow2", /* has shortcomings, and duplicates gegl:dropshadow */ + "gegl:json:grey2", /* has shortcomings, and duplicates gegl:gray */ "gegl:layer", /* we use gimp's ops */ "gegl:lcms-from-profile", /* not usable here */ "gegl:linear-gradient", /* we use the blend tool */ @@ -637,6 +520,7 @@ gimp_gegl_op_blacklisted (const gchar *name, "gegl:tile", /* pointless */ "gegl:unpremul", /* pointless */ "gegl:vector-stroke", + "gegl:wavelet-blur", /* we use gimp's op wavelet-decompose */ }; gchar **categories; diff --git a/app/tools/gimpgegltool.c b/app/tools/gimpgegltool.c index 9f2cc358d1..5b6c72c907 100644 --- a/app/tools/gimpgegltool.c +++ b/app/tools/gimpgegltool.c @@ -34,6 +34,8 @@ #include "core/gimp.h" #include "core/gimptoolinfo.h" +#include "actions/filters-actions.h" + #include "widgets/gimphelp-ids.h" #include "widgets/gimppropwidgets.h" @@ -174,6 +176,9 @@ gimp_gegl_tool_dialog (GimpFilterTool *filter_tool) const gchar *title; gchar *label; + if (filters_actions_gegl_op_blocklisted (opclass->name)) + continue; + if (g_str_has_prefix (opclass->name, "gegl:")) icon_name = GIMP_ICON_GEGL;