From b1bc736f77117571e051b865cb3591d18ebc2759 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Tue, 16 Jan 2024 22:45:06 -0800 Subject: [PATCH] Gave ordering to all Color Filter magic tools --- magic/src/alien.c | 14 ++++++++++++-- magic/src/bloom.c | 10 ++++++++-- magic/src/cartoon.c | 7 +++++++ magic/src/colorsep.c | 8 +++++++- magic/src/fade_darken.c | 20 ++++++++++++++++++-- magic/src/negative.c | 11 +++++++++-- magic/src/tint.c | 16 ++++++++++++++-- 7 files changed, 75 insertions(+), 11 deletions(-) diff --git a/magic/src/alien.c b/magic/src/alien.c index 92bf912a3..7cf0e7d58 100644 --- a/magic/src/alien.c +++ b/magic/src/alien.c @@ -6,7 +6,7 @@ Credits: Andrew Corcoran inspired by the Alien Map GIMP plugin - Copyright (c) 2002-2023 by Bill Kendrick and others; see AUTHORS.txt + Copyright (c) 2002-2024 by Bill Kendrick and others; see AUTHORS.txt bill@newbreedsoftware.com https://tuxpaint.org/ @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: December 29, 2023 + Last updated: January 16, 2024 */ #include @@ -71,6 +71,10 @@ const int alien_groups[alien_NUM_TOOLS] = { MAGIC_TYPE_COLOR_FILTERS, }; +const int alien_orders[alien_NUM_TOOLS] = { + 601, +}; + const char *alien_descs[alien_NUM_TOOLS][2] = { {gettext_noop("Click and drag the mouse to change the colors in parts of your picture."), gettext_noop("Click to change the colors in your entire picture."),}, @@ -83,6 +87,7 @@ int alien_get_tool_count(magic_api * api); SDL_Surface *alien_get_icon(magic_api * api, int which); char *alien_get_name(magic_api * api, int which); int alien_get_group(magic_api * api, int which); +int alien_get_order(int which); char *alien_get_description(magic_api * api, int which, int mode); void alien_drag(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); @@ -150,6 +155,11 @@ int alien_get_group(magic_api * api ATTRIBUTE_UNUSED, int which) return alien_groups[which]; } +int alien_get_order(int which) +{ + return alien_orders[which]; +} + // Return our descriptions, localized: char *alien_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) { diff --git a/magic/src/bloom.c b/magic/src/bloom.c index eb95bd6a7..0539a1f23 100644 --- a/magic/src/bloom.c +++ b/magic/src/bloom.c @@ -3,7 +3,7 @@ Applies a "bloom" effect to the image. (https://en.wikipedia.org/wiki/Bloom_(shader_effect)) - Last updated: December 29, 2023 + Last updated: January 16, 2024 */ #include @@ -47,6 +47,7 @@ int bloom_get_tool_count(magic_api * api); SDL_Surface *bloom_get_icon(magic_api * api, int which); char *bloom_get_name(magic_api * api, int which); int bloom_get_group(magic_api * api, int which); +int bloom_get_order(int which); char *bloom_get_description(magic_api * api, int which, int mode); int bloom_requires_colors(magic_api * api, int which); int bloom_modes(magic_api * api, int which); @@ -107,11 +108,16 @@ char *bloom_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSE return strdup(gettext("Bloom")); } -int bloom_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED ATTRIBUTE_UNUSED) +int bloom_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) { return MAGIC_TYPE_COLOR_FILTERS; } +int bloom_get_order(int which ATTRIBUTE_UNUSED) +{ + return 900; +} + char *bloom_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { if (mode == MODE_PAINT) diff --git a/magic/src/cartoon.c b/magic/src/cartoon.c index 8680f9252..e8be10c91 100644 --- a/magic/src/cartoon.c +++ b/magic/src/cartoon.c @@ -50,6 +50,7 @@ int cartoon_get_tool_count(magic_api * api); SDL_Surface *cartoon_get_icon(magic_api * api, int which); char *cartoon_get_name(magic_api * api, int which); int cartoon_get_group(magic_api * api, int which); +int cartoon_get_order(int which); char *cartoon_get_description(magic_api * api, int which, int mode); void cartoon_apply_colors(magic_api * api, SDL_Surface * surf, int xx, int yy); void cartoon_apply_outline(magic_api * api, int xx, int yy); @@ -117,6 +118,12 @@ int cartoon_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS return MAGIC_TYPE_COLOR_FILTERS; } +// Return our orders +int cartoon_get_order(int which ATTRIBUTE_UNUSED) +{ + return 600; +} + // Return our descriptions, localized: char *cartoon_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) { diff --git a/magic/src/colorsep.c b/magic/src/colorsep.c index c53a21735..9cb3cc691 100644 --- a/magic/src/colorsep.c +++ b/magic/src/colorsep.c @@ -3,7 +3,7 @@ Color separation effect (a la red/cyan aka red/blue 3D glasses). Bill Kendrick - Last updated: December 29, 2023 + Last updated: January 16, 2024 */ #include @@ -58,6 +58,7 @@ int colorsep_get_tool_count(magic_api * api); SDL_Surface *colorsep_get_icon(magic_api * api, int which); char *colorsep_get_name(magic_api * api, int which); int colorsep_get_group(magic_api * api, int which); +int colorsep_get_order(int which); char *colorsep_get_description(magic_api * api, int which, int mode); int colorsep_requires_colors(magic_api * api, int which); int colorsep_modes(magic_api * api, int which); @@ -125,6 +126,11 @@ int colorsep_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU return MAGIC_TYPE_COLOR_FILTERS; } +int colorsep_get_order(int which) +{ + return 700 + which; +} + char *colorsep_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return strdup(gettext(colorsep_descrs[which])); diff --git a/magic/src/fade_darken.c b/magic/src/fade_darken.c index ed2113bf4..dd0dac3d8 100644 --- a/magic/src/fade_darken.c +++ b/magic/src/fade_darken.c @@ -4,7 +4,7 @@ Fade and Darken Magic Tools Plugin Tux Paint - A simple drawing program for children. - Copyright (c) 2002-2023 by Bill Kendrick and others; see AUTHORS.txt + Copyright (c) 2002-2024 by Bill Kendrick and others; see AUTHORS.txt bill@newbreedsoftware.com https://tuxpaint.org/ @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: December 29, 2023 + Last updated: January 16, 2024 */ #include @@ -52,6 +52,15 @@ char *tool_names[NUM_TOOLS] = { gettext_noop("Keep Color"), }; +int tool_orders[NUM_TOOLS] = { + 301, + 300, + 201, + 200, + 401, + 402, +}; + char *tool_descriptions[NUM_TOOLS][2] = { { gettext_noop("Click and drag the mouse to lighten parts of your picture."), @@ -112,6 +121,7 @@ Uint32 fade_darken_api_version(void); int fade_darken_get_tool_count(magic_api * api); SDL_Surface *fade_darken_get_icon(magic_api * api, int which); int fade_darken_get_group(magic_api * api, int which); +int fade_darken_get_order(int which); char *fade_darken_get_name(magic_api * api, int which); char *fade_darken_get_description(magic_api * api, int which, int mode); static void do_fade_darken(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y); @@ -182,6 +192,12 @@ int fade_darken_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ return MAGIC_TYPE_COLOR_FILTERS; } +// Return our order: +int fade_darken_get_order(int which) +{ + return tool_orders[which]; +} + // Return our description, localized: char *fade_darken_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) { diff --git a/magic/src/negative.c b/magic/src/negative.c index 82884e6e9..dbaa011b2 100644 --- a/magic/src/negative.c +++ b/magic/src/negative.c @@ -4,7 +4,7 @@ Negative Magic Tool Plugin Tux Paint - A simple drawing program for children. - Copyright (c) 2002-2023 by Bill Kendrick and others; see AUTHORS.txt + Copyright (c) 2002-2024 by Bill Kendrick and others; see AUTHORS.txt bill@newbreedsoftware.com https://tuxpaint.org/ @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: December 29, 2023 + Last updated: January 16, 2024 */ #include @@ -41,6 +41,7 @@ int negative_get_tool_count(magic_api * api); SDL_Surface *negative_get_icon(magic_api * api, int which); char *negative_get_name(magic_api * api, int which); int negative_get_group(magic_api * api, int which); +int negative_get_order(int which); char *negative_get_description(magic_api * api, int which, int mode); static void do_negative(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y); void negative_drag(magic_api * api, int which, SDL_Surface * canvas, @@ -131,6 +132,12 @@ int negative_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU return MAGIC_TYPE_COLOR_FILTERS; } +// Return our order: +int negative_get_order(int which) +{ + return 100 + which; +} + // Return our description, localized: char *negative_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) { diff --git a/magic/src/tint.c b/magic/src/tint.c index 818836264..f3d2fa7c0 100644 --- a/magic/src/tint.c +++ b/magic/src/tint.c @@ -10,7 +10,7 @@ Credits: Andrew Corcoran - Copyright (c) 2002-2023 by Bill Kendrick and others; see AUTHORS.txt + Copyright (c) 2002-2024 by Bill Kendrick and others; see AUTHORS.txt bill@newbreedsoftware.com https://tuxpaint.org/ @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: December 29, 2023 + Last updated: January 16, 2024 */ #include @@ -74,6 +74,11 @@ const char *tint_names[tint_NUM_TOOLS] = { gettext_noop("Color & White") // It does more than this but more intuitive than threshold. }; +const int tint_orders[tint_NUM_TOOLS] = { + 500, + 501, +}; + const char *tint_descs[tint_NUM_TOOLS][2] = { {gettext_noop("Click and drag the mouse around to change the color of parts of your picture."), gettext_noop("Click to change the color of your entire picture."),}, @@ -87,6 +92,7 @@ int tint_get_tool_count(magic_api * api); SDL_Surface *tint_get_icon(magic_api * api, int which); char *tint_get_name(magic_api * api, int which); int tint_get_group(magic_api * api, int which); +int tint_get_order(int which); char *tint_get_description(magic_api * api, int which, int mode); static int tint_grey(Uint8 r1, Uint8 g1, Uint8 b1); static void do_tint_pixel(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y); @@ -156,6 +162,12 @@ int tint_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) return MAGIC_TYPE_COLOR_FILTERS; } +// Return our order: +int tint_get_order(int which) +{ + return tint_orders[which]; +} + // Return our descriptions, localized: char *tint_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) {