From 9ce4ee8c5030a1b8c308713307170211043a06f0 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Tue, 16 Jan 2024 22:28:49 -0800 Subject: [PATCH] Gave ordering to all Picture Warps magic tools --- magic/src/fold.c | 9 ++++++++- magic/src/kaleidox.c | 8 +++++++- magic/src/mirror_flip.c | 11 +++++++++-- magic/src/perspective.c | 19 +++++++++++++++++-- magic/src/reflection.c | 10 ++++++++-- magic/src/shift.c | 11 +++++++++-- magic/src/stretch.c | 10 ++++++++-- magic/src/waves.c | 11 +++++++++-- 8 files changed, 75 insertions(+), 14 deletions(-) diff --git a/magic/src/fold.c b/magic/src/fold.c index 17971af8e..ac6d166fd 100644 --- a/magic/src/fold.c +++ b/magic/src/fold.c @@ -1,10 +1,11 @@ /* Folds the picture down from the corners. - Last updated: December 29, 2023 + Last updated: January 16, 2024 */ //optimized version soon :) +// LOL comment is from 2008-07-10 -bjk 2024.01.16 //when "folding" same corner many times it gives strange results. Now it's allowed. Let me know //if you think it shouldn't be. @@ -47,6 +48,7 @@ int fold_get_tool_count(magic_api * api); SDL_Surface *fold_get_icon(magic_api * api, int which); char *fold_get_name(magic_api * api, int which); int fold_get_group(magic_api * api, int which); +int fold_get_order(int which); char *fold_get_description(magic_api * api, int which, int mode); int fold_requires_colors(magic_api * api, int which); void fold_release(magic_api * api, int which, @@ -119,6 +121,11 @@ int fold_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) return MAGIC_TYPE_PICTURE_WARPS; } +int fold_get_order(int which ATTRIBUTE_UNUSED) +{ + return 700; +} + char *fold_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext_noop("Choose a background color and click to turn the corner of the page over.")); diff --git a/magic/src/kaleidox.c b/magic/src/kaleidox.c index c9d693c00..35fed9749 100644 --- a/magic/src/kaleidox.c +++ b/magic/src/kaleidox.c @@ -4,7 +4,7 @@ kaleidoscope. Bill Kendrick - Last updated: December 29, 2023 + Last updated: January 16, 2024 */ #include @@ -56,6 +56,7 @@ int kaleidox_get_tool_count(magic_api * api); SDL_Surface *kaleidox_get_icon(magic_api * api, int which); char *kaleidox_get_name(magic_api * api, int which); int kaleidox_get_group(magic_api * api, int which); +int kaleidox_get_order(int which); char *kaleidox_get_description(magic_api * api, int which, int mode); int kaleidox_requires_colors(magic_api * api, int which); int kaleidox_modes(magic_api * api, int which); @@ -122,6 +123,11 @@ int kaleidox_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU return MAGIC_TYPE_PICTURE_WARPS; } +int kaleidox_get_order(int which) +{ + return 800 + which; +} + char *kaleidox_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { return strdup(gettext(kaleidox_descrs[which])); diff --git a/magic/src/mirror_flip.c b/magic/src/mirror_flip.c index a3874df1e..23ab4bf84 100644 --- a/magic/src/mirror_flip.c +++ b/magic/src/mirror_flip.c @@ -4,7 +4,7 @@ Mirror and Flip 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 @@ -50,6 +50,7 @@ int mirror_flip_get_tool_count(magic_api *); SDL_Surface *mirror_flip_get_icon(magic_api *, int); char *mirror_flip_get_name(magic_api *, int); int mirror_flip_get_group(magic_api *, int); +int mirror_flip_get_order(int); char *mirror_flip_get_description(magic_api *, int, int); void mirror_flip_drag(magic_api *, int, SDL_Surface *, SDL_Surface *, int, int, int, int, SDL_Rect *); void mirror_flip_release(magic_api *, int, SDL_Surface *, SDL_Surface *, int, int, int, int, SDL_Rect *); @@ -125,6 +126,12 @@ int mirror_flip_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ return MAGIC_TYPE_PICTURE_WARPS; } +// Return our order: +int mirror_flip_get_order(int which) +{ + return 100 + which; +} + // Return our descriptions, localized: char *mirror_flip_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { diff --git a/magic/src/perspective.c b/magic/src/perspective.c index 6a5faaca3..3dc29ed8d 100644 --- a/magic/src/perspective.c +++ b/magic/src/perspective.c @@ -13,7 +13,7 @@ Panels, Tile mode of Zoom, and Rush by Bill Kendrick - Copyright (c) 2014-2023 + Copyright (c) 2014-2024 bill@newbreedsoftware.com https://tuxpaint.org/ @@ -32,7 +32,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 @@ -58,6 +58,7 @@ int perspective_get_tool_count(magic_api * api); SDL_Surface *perspective_get_icon(magic_api * api, int which); char *perspective_get_name(magic_api * api, int which); int perspective_get_group(magic_api * api, int which); +int perspective_get_order(int which); char *perspective_get_description(magic_api * api, int which, int mode); @@ -131,6 +132,14 @@ enum perspective_NUM_TOOLS }; +int perspective_orders[perspective_NUM_TOOLS] = { + 304, + 302, + 301, + 300, + 303, +}; + enum { TOP_LEFT, @@ -226,6 +235,12 @@ int perspective_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_ return MAGIC_TYPE_PICTURE_WARPS; } +// Return our order: +int perspective_get_order(int which) +{ + return perspective_orders[which]; +} + // Return our descriptions, localized: char *perspective_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) { diff --git a/magic/src/reflection.c b/magic/src/reflection.c index 5fb2e4a53..9dc0c0e41 100644 --- a/magic/src/reflection.c +++ b/magic/src/reflection.c @@ -4,7 +4,7 @@ Reflection Magic Tool Plugin Tux Paint - A simple drawing program for children. - Copyright (c) 2021-2023 by Bill Kendrick and others; see AUTHORS.txt + Copyright (c) 2021-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 @@ -57,6 +57,7 @@ int reflection_get_tool_count(magic_api * api); SDL_Surface *reflection_get_icon(magic_api * api, int which); char *reflection_get_name(magic_api * api, int which); int reflection_get_group(magic_api * api, int which); +int reflection_get_order(int which); char *reflection_get_description(magic_api * api, int which, int mode); void reflection_drag(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); @@ -119,6 +120,11 @@ int reflection_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_U return MAGIC_TYPE_PICTURE_WARPS; } +int reflection_get_order(int which ATTRIBUTE_UNUSED) +{ + return 400; +} + char *reflection_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { diff --git a/magic/src/shift.c b/magic/src/shift.c index 02500a2b8..d9312299b 100644 --- a/magic/src/shift.c +++ b/magic/src/shift.c @@ -4,7 +4,7 @@ Shift 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 @@ -50,6 +50,7 @@ int shift_get_tool_count(magic_api * api); SDL_Surface *shift_get_icon(magic_api * api, int which); char *shift_get_name(magic_api * api, int which); int shift_get_group(magic_api * api, int which); +int shift_get_order(int which); char *shift_get_description(magic_api * api, int which, int mode); void shift_drag(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); @@ -118,6 +119,12 @@ int shift_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED return MAGIC_TYPE_PICTURE_WARPS; } +// Return our order +int shift_get_order(int which ATTRIBUTE_UNUSED) +{ + return 200; +} + // Return our descriptions, localized: char *shift_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { diff --git a/magic/src/stretch.c b/magic/src/stretch.c index 7396da1a0..8ede71dce 100644 --- a/magic/src/stretch.c +++ b/magic/src/stretch.c @@ -7,7 +7,7 @@ By Bill Kendrick Some parts based on "Blind" Magic Tool by Pere Pujal Carabantes - Copyright (c) 2021-2023 + Copyright (c) 2021-2024 https://tuxpaint.org/ This program is free software; you can redistribute it and/or modify @@ -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 "tp_magic_api.h" @@ -57,6 +57,7 @@ int stretch_get_tool_count(magic_api * api); SDL_Surface *stretch_get_icon(magic_api * api, int which); char *stretch_get_name(magic_api * api, int which); int stretch_get_group(magic_api * api, int which); +int stretch_get_order(int which); char *stretch_get_description(magic_api * api, int which, int mode); int stretch_requires_colors(magic_api * api, int which); void stretch_release(magic_api * api, int which, @@ -123,6 +124,11 @@ int stretch_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS return MAGIC_TYPE_PICTURE_WARPS; } +int stretch_get_order(int which ATTRIBUTE_UNUSED) +{ + return 500; +} + char *stretch_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return strdup(gettext_noop("Click and drag to stretch part of your picture vertically or horizontally.")); diff --git a/magic/src/waves.c b/magic/src/waves.c index 24362bdfc..cfe8c15f1 100644 --- a/magic/src/waves.c +++ b/magic/src/waves.c @@ -4,7 +4,7 @@ Waves 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 @@ -46,6 +46,7 @@ int waves_get_tool_count(magic_api * api); SDL_Surface *waves_get_icon(magic_api * api, int which); char *waves_get_name(magic_api * api, int which); int waves_get_group(magic_api * api, int which); +int waves_get_order(int which); char *waves_get_description(magic_api * api, int which, int mode); void waves_drag(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); @@ -111,6 +112,12 @@ int waves_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED return MAGIC_TYPE_PICTURE_WARPS; } +// Return our order: +int waves_get_order(int which) +{ + return 600 + which; +} + // Return our names, localized: char *waves_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) {