mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-10-06 01:12:40 +02:00
app: Separate GEGL op blacklist based on filter actions
In an upcoming commit a new user of gimp_gegl_get_op_classes will expect a list of all operations supported/allowed in GIMP and not just the ones that are not exposed in the GUI. With the same change, this switches from maintaining a list of operations exposed as an action, this now uses the actions themselves for the filtering. During this I found some operations that were in the "exposed in GUI sub-list" were in-fact not exposed but were straight up blocked. I moved them to the appropriate sub-list along with the justifications I found in the commit history.
This commit is contained in:
@@ -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,
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user