Gave ordering to all Pattern Painting magic tools

This commit is contained in:
Bill Kendrick 2024-01-16 22:16:14 -08:00
parent 0353c5670d
commit 3abf6f75f4
2 changed files with 24 additions and 11 deletions

View file

@ -4,7 +4,7 @@
Kaleidoscope Magic Tool Plugin Kaleidoscope Magic Tool Plugin
Tux Paint - A simple drawing program for children. 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 bill@newbreedsoftware.com
https://tuxpaint.org/ https://tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
Last updated: December 29, 2023 Last updated: January 16, 2024
*/ */
#include <stdio.h> #include <stdio.h>
@ -45,8 +45,8 @@ static int square_size = 128;
enum enum
{ {
KAL_UD,
KAL_LR, KAL_LR,
KAL_UD,
KAL_BOTH, KAL_BOTH,
KAL_PATTERN, KAL_PATTERN,
KAL_TILES, KAL_TILES,
@ -54,8 +54,8 @@ enum
}; };
char *kal_icon_names[KAL_COUNT] = { char *kal_icon_names[KAL_COUNT] = {
"symmetric_updown.png",
"symmetric_leftright.png", "symmetric_leftright.png",
"symmetric_updown.png",
"kalidescope.png", "kalidescope.png",
"kal_pattern.png", "kal_pattern.png",
"kal_tiles.png" "kal_tiles.png"
@ -69,6 +69,7 @@ int kalidescope_get_tool_count(magic_api * api);
SDL_Surface *kalidescope_get_icon(magic_api * api, int which); SDL_Surface *kalidescope_get_icon(magic_api * api, int which);
char *kalidescope_get_name(magic_api * api, int which); char *kalidescope_get_name(magic_api * api, int which);
int kalidescope_get_group(magic_api * api, int which); int kalidescope_get_group(magic_api * api, int which);
int kalidescope_get_order(int which);
char *kalidescope_get_description(magic_api * api, int which, int mode); char *kalidescope_get_description(magic_api * api, int which, int mode);
static void do_kalidescope(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y); static void do_kalidescope(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y);
void kalidescope_drag(magic_api * api, int which, SDL_Surface * canvas, void kalidescope_drag(magic_api * api, int which, SDL_Surface * canvas,
@ -124,23 +125,23 @@ char *kalidescope_get_name(magic_api * api ATTRIBUTE_UNUSED, int which)
{ {
if (which == KAL_LR) if (which == KAL_LR)
{ {
return (strdup(gettext_noop("Symmetric Left/Right"))); return (strdup(gettext("Symmetric Left/Right")));
} }
else if (which == KAL_UD) else if (which == KAL_UD)
{ {
return (strdup(gettext_noop("Symmetric Up/Down"))); return (strdup(gettext("Symmetric Up/Down")));
} }
else if (which == KAL_PATTERN) else if (which == KAL_PATTERN)
{ {
return (strdup(gettext_noop("Pattern"))); return (strdup(gettext("Pattern")));
} }
else if (which == KAL_TILES) else if (which == KAL_TILES)
{ {
return (strdup(gettext_noop("Tiles"))); return (strdup(gettext("Tiles")));
} }
else else
{ /* KAL_BOTH */ { /* KAL_BOTH */
return (strdup(gettext_noop("Kaleidoscope"))); return (strdup(gettext("Kaleidoscope")));
} }
} }
@ -150,6 +151,12 @@ int kalidescope_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_
return MAGIC_TYPE_PATTERN_PAINTING; return MAGIC_TYPE_PATTERN_PAINTING;
} }
// Return our order:
int kalidescope_get_order(int which)
{
return 100 + which;
}
// Return our descriptions, localized: // Return our descriptions, localized:
char *kalidescope_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) char *kalidescope_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED)

View file

@ -6,7 +6,7 @@
Credits: Adam 'foo-script' Rakowski <foo-script@o2.pl> Credits: Adam 'foo-script' Rakowski <foo-script@o2.pl>
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 bill@newbreedsoftware.com
https://tuxpaint.org/ https://tuxpaint.org/
@ -25,7 +25,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt) (See COPYING.txt)
Last updated: December 29, 2023 Last updated: January 16, 2024
*/ */
// sound only plays on release // sound only plays on release
@ -59,6 +59,7 @@ int rosette_get_tool_count(magic_api * api);
SDL_Surface *rosette_get_icon(magic_api * api, int which); SDL_Surface *rosette_get_icon(magic_api * api, int which);
char *rosette_get_name(magic_api * api, int which); char *rosette_get_name(magic_api * api, int which);
int rosette_get_group(magic_api * api, int which); int rosette_get_group(magic_api * api, int which);
int rosette_get_order(int which);
char *rosette_get_description(magic_api * api, int which, int mode); char *rosette_get_description(magic_api * api, int which, int mode);
int rosette_requires_colors(magic_api * api, int which); int rosette_requires_colors(magic_api * api, int which);
void rosette_release(magic_api * api, int which, void rosette_release(magic_api * api, int which,
@ -135,6 +136,11 @@ int rosette_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS
return MAGIC_TYPE_PATTERN_PAINTING; return MAGIC_TYPE_PATTERN_PAINTING;
} }
int rosette_get_order(int which)
{
return 200 + which;
}
char *rosette_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) char *rosette_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED)
{ {
if (!which) if (!which)