Put more Magic tools into their groups

...WIP
This commit is contained in:
Bill Kendrick 2021-09-21 00:07:14 -07:00
parent 12b503be9c
commit 448a4b4487
8 changed files with 72 additions and 12 deletions

View file

@ -6,7 +6,7 @@
Credits: Andrew Corcoran <akanewbie@gmail.com> inspired by the Alien Map GIMP plugin Credits: Andrew Corcoran <akanewbie@gmail.com> inspired by the Alien Map GIMP plugin
Copyright (c) 2002-2019 by Bill Kendrick and others; see AUTHORS.txt Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com bill@newbreedsoftware.com
http://www.tuxpaint.org/ http://www.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: August 29, 2019 Last updated: September 20, 2021
$Id$ $Id$
*/ */
@ -68,6 +68,10 @@ const char *alien_names[alien_NUM_TOOLS] = {
gettext_noop("Color Shift"), gettext_noop("Color Shift"),
}; };
const int alien_groups[alien_NUM_TOOLS] = {
MAGIC_TYPE_COLOR_FILTERS,
};
const char *alien_descs[alien_NUM_TOOLS][2] = { 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 and drag the mouse to change the colors in parts of your picture."),
gettext_noop("Click to change the colors in your entire picture."),}, gettext_noop("Click to change the colors in your entire picture."),},
@ -79,6 +83,7 @@ int alien_init(magic_api * api);
int alien_get_tool_count(magic_api * api); int alien_get_tool_count(magic_api * api);
SDL_Surface *alien_get_icon(magic_api * api, int which); SDL_Surface *alien_get_icon(magic_api * api, int which);
char *alien_get_name(magic_api * api, int which); char *alien_get_name(magic_api * api, int which);
int alien_get_group(magic_api * api, int which);
char *alien_get_description(magic_api * api, int which, int mode); char *alien_get_description(magic_api * api, int which, int mode);
void alien_drag(magic_api * api, int which, SDL_Surface * canvas, 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); SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect);
@ -136,6 +141,11 @@ char *alien_get_name(magic_api * api ATTRIBUTE_UNUSED, int which)
return (strdup(gettext_noop(alien_names[which]))); return (strdup(gettext_noop(alien_names[which])));
} }
int alien_get_group(magic_api * api ATTRIBUTE_UNUSED, int which)
{
return alien_groups[which];
}
// Return our descriptions, localized: // Return our descriptions, localized:
char *alien_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) char *alien_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode)
{ {

View file

@ -6,7 +6,7 @@
Credits: Bill Kendrick<bill@newbreedsoftware.com> & Andrew Corcoran <akanewbie@gmail.com> Credits: Bill Kendrick<bill@newbreedsoftware.com> & Andrew Corcoran <akanewbie@gmail.com>
Copyright (c) 2002-2008 by Bill Kendrick and others; see AUTHORS.txt Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com bill@newbreedsoftware.com
http://www.tuxpaint.org/ http://www.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: July 8, 2008 Last updated: September 20, 2021
$Id$ $Id$
*/ */
@ -44,6 +44,7 @@ int blur_init(magic_api * api);
int blur_get_tool_count(magic_api * api); int blur_get_tool_count(magic_api * api);
SDL_Surface *blur_get_icon(magic_api * api, int which); SDL_Surface *blur_get_icon(magic_api * api, int which);
char *blur_get_name(magic_api * api, int which); char *blur_get_name(magic_api * api, int which);
int blur_get_group(magic_api * api, int which);
char *blur_get_description(magic_api * api, int which, int mode); char *blur_get_description(magic_api * api, int which, int mode);
void blur_drag(magic_api * api, int which, SDL_Surface * canvas, void blur_drag(magic_api * api, int which, SDL_Surface * canvas,
SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect);
@ -80,6 +81,10 @@ const char *blur_names[blur_NUM_TOOLS] = {
gettext_noop("Blur"), gettext_noop("Blur"),
}; };
const int blur_groups[blur_NUM_TOOLS] = {
MAGIC_TYPE_DISTORTS,
};
const char *blur_descs[blur_NUM_TOOLS][2] = { const char *blur_descs[blur_NUM_TOOLS][2] = {
{gettext_noop("Click and drag the mouse around to blur the image."), {gettext_noop("Click and drag the mouse around to blur the image."),
gettext_noop("Click to blur the entire image.")}, gettext_noop("Click to blur the entire image.")},
@ -125,6 +130,12 @@ char *blur_get_name(magic_api * api ATTRIBUTE_UNUSED, int which)
return (strdup(gettext_noop(blur_names[which]))); return (strdup(gettext_noop(blur_names[which])));
} }
// Return our group
int blur_get_group(magic_api * api ATTRIBUTE_UNUSED, int which)
{
return blur_groups[which];
}
// Return our descriptions, localized: // Return our descriptions, localized:
char *blur_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode) char *blur_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode)
{ {

View file

@ -6,7 +6,7 @@
Albert Cahalan <albert@users.sf.net> Albert Cahalan <albert@users.sf.net>
Copyright (c) 2002-2008 by Bill Kendrick and others; see AUTHORS.txt Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com bill@newbreedsoftware.com
http://www.tuxpaint.org/ http://www.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: July 8, 2008 Last updated: September 20, 2021
$Id$ $Id$
*/ */
@ -60,6 +60,7 @@ Uint32 bricks_api_version(void);
int bricks_get_tool_count(magic_api * api); int bricks_get_tool_count(magic_api * api);
SDL_Surface *bricks_get_icon(magic_api * api, int which); SDL_Surface *bricks_get_icon(magic_api * api, int which);
char *bricks_get_name(magic_api * api, int which); char *bricks_get_name(magic_api * api, int which);
int bricks_get_group(magic_api * api, int which);
char *bricks_get_description(magic_api * api, int which, int mode); char *bricks_get_description(magic_api * api, int which, int mode);
void bricks_drag(magic_api * api, int which, SDL_Surface * canvas, void bricks_drag(magic_api * api, int which, SDL_Surface * canvas,
SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect);
@ -120,6 +121,12 @@ char *bricks_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS
return (strdup(gettext_noop("Bricks"))); return (strdup(gettext_noop("Bricks")));
} }
// Return our group (both the same):
int bricks_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
{
return MAGIC_TYPE_PAINTING;
}
// Return our descriptions, localized: // Return our descriptions, localized:
char *bricks_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED) char *bricks_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED)
{ {

View file

@ -4,7 +4,7 @@
Cartoon Magic Tool Plugin Cartoon Magic Tool Plugin
Tux Paint - A simple drawing program for children. Tux Paint - A simple drawing program for children.
Copyright (c) 2002-2008 by Bill Kendrick and others; see AUTHORS.txt Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com bill@newbreedsoftware.com
http://www.tuxpaint.org/ http://www.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: July 8, 2008 Last updated: September 21, 2021
$Id$ $Id$
*/ */
@ -48,6 +48,7 @@ Uint32 cartoon_api_version(void);
int cartoon_get_tool_count(magic_api * api); int cartoon_get_tool_count(magic_api * api);
SDL_Surface *cartoon_get_icon(magic_api * api, int which); SDL_Surface *cartoon_get_icon(magic_api * api, int which);
char *cartoon_get_name(magic_api * api, int which); char *cartoon_get_name(magic_api * api, int which);
int cartoon_get_group(magic_api * api, int which);
char *cartoon_get_description(magic_api * api, int which, int mode); char *cartoon_get_description(magic_api * api, int which, int mode);
static void do_cartoon(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y); static void do_cartoon(void *ptr, int which, SDL_Surface * canvas, SDL_Surface * last, int x, int y);
void cartoon_drag(magic_api * api, int which, SDL_Surface * canvas, void cartoon_drag(magic_api * api, int which, SDL_Surface * canvas,
@ -103,6 +104,12 @@ char *cartoon_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
return (strdup(gettext_noop("Cartoon"))); return (strdup(gettext_noop("Cartoon")));
} }
// Return our groups
int cartoon_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
{
return MAGIC_TYPE_COLOR_FILTERS;
}
// Return our descriptions, localized: // Return our descriptions, localized:
char *cartoon_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) char *cartoon_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
{ {

View file

@ -42,6 +42,7 @@ int checkerboard_init(magic_api * api);
int checkerboard_get_tool_count(magic_api * api); int checkerboard_get_tool_count(magic_api * api);
SDL_Surface *checkerboard_get_icon(magic_api * api, int which); SDL_Surface *checkerboard_get_icon(magic_api * api, int which);
char *checkerboard_get_name(magic_api * api, int which); char *checkerboard_get_name(magic_api * api, int which);
int checkerboard_get_group(magic_api * api, int which);
char *checkerboard_get_description(magic_api * api, int which, int mode); char *checkerboard_get_description(magic_api * api, int which, int mode);
int checkerboard_requires_colors(magic_api * api, int which); int checkerboard_requires_colors(magic_api * api, int which);
void checkerboard_release(magic_api * api, int which, void checkerboard_release(magic_api * api, int which,
@ -99,6 +100,11 @@ char *checkerboard_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUT
return strdup(gettext_noop("Checkerboard")); return strdup(gettext_noop("Checkerboard"));
} }
int checkerboard_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
{
return MAGIC_TYPE_PICTURE_DECORATIONS;
}
char *checkerboard_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) char *checkerboard_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
{ {
return return
@ -124,7 +130,7 @@ void checkerboard_shutdown(magic_api * api ATTRIBUTE_UNUSED)
// Interactivity functions // Interactivity functions
void checkerboard_drag(magic_api * api, int which, SDL_Surface * canvas, void checkerboard_drag(magic_api * api, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas,
SDL_Surface * snapshot, SDL_Surface * snapshot,
int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED, int ox ATTRIBUTE_UNUSED, int oy ATTRIBUTE_UNUSED,
int x, int y, SDL_Rect * update_rect) int x, int y, SDL_Rect * update_rect)
@ -219,7 +225,7 @@ void checkerboard_drag(magic_api * api, int which, SDL_Surface * canvas,
api->playsound(checkerboard_snd, 128, 255); api->playsound(checkerboard_snd, 128, 255);
} }
void checkerboard_click(magic_api * api, int which, int mode, void checkerboard_click(magic_api * api, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
SDL_Surface * canvas, SDL_Surface * last, SDL_Surface * canvas, SDL_Surface * last,
int x, int y, int x, int y,
SDL_Rect * update_rect) SDL_Rect * update_rect)

View file

@ -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: September 18, 2021 Last updated: September 20, 2021
$Id$ $Id$
*/ */
@ -43,6 +43,7 @@ int emboss_init(magic_api * api);
int emboss_get_tool_count(magic_api * api); int emboss_get_tool_count(magic_api * api);
SDL_Surface *emboss_get_icon(magic_api * api, int which); SDL_Surface *emboss_get_icon(magic_api * api, int which);
char *emboss_get_name(magic_api * api, int which); char *emboss_get_name(magic_api * api, int which);
int emboss_get_group(magic_api * api, int which);
char *emboss_get_description(magic_api * api, int which, int mode); char *emboss_get_description(magic_api * api, int which, int mode);
void emboss_drag(magic_api * api, int which, SDL_Surface * canvas, void emboss_drag(magic_api * api, int which, SDL_Surface * canvas,
@ -101,6 +102,12 @@ char *emboss_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUS
return (strdup(gettext_noop("Emboss"))); return (strdup(gettext_noop("Emboss")));
} }
// Return our groups:
int emboss_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
{
return MAGIC_TYPE_DISTORTS;
}
// Return our descriptions, localized: // Return our descriptions, localized:
char *emboss_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) char *emboss_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
{ {

View file

@ -1,7 +1,7 @@
/* /*
* Folds the picture down from the corners. * Folds the picture down from the corners.
* *
* Last updated: 2019-08-29 * Last updated: 2021-09-20
*/ */
//optimized version soon :) //optimized version soon :)
@ -43,6 +43,7 @@ int fold_init(magic_api * api);
int fold_get_tool_count(magic_api * api); int fold_get_tool_count(magic_api * api);
SDL_Surface *fold_get_icon(magic_api * api, int which); SDL_Surface *fold_get_icon(magic_api * api, int which);
char *fold_get_name(magic_api * api, int which); char *fold_get_name(magic_api * api, int which);
int fold_get_group(magic_api * api, int which);
char *fold_get_description(magic_api * api, int which, int mode); char *fold_get_description(magic_api * api, int which, int mode);
int fold_requires_colors(magic_api * api, int which); int fold_requires_colors(magic_api * api, int which);
void fold_release(magic_api * api, int which, void fold_release(magic_api * api, int which,
@ -103,6 +104,11 @@ char *fold_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED
return (gettext_noop("Fold")); return (gettext_noop("Fold"));
} }
int fold_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
{
return MAGIC_TYPE_PICTURE_WARPS;
}
char *fold_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) 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.")); return strdup(gettext_noop("Choose a background color and click to turn the corner of the page over."));

View file

@ -42,6 +42,7 @@ int tv_init(magic_api * api);
int tv_get_tool_count(magic_api * api); int tv_get_tool_count(magic_api * api);
SDL_Surface *tv_get_icon(magic_api * api, int which); SDL_Surface *tv_get_icon(magic_api * api, int which);
char *tv_get_name(magic_api * api, int which); char *tv_get_name(magic_api * api, int which);
int tv_get_group(magic_api * api, int which);
char *tv_get_description(magic_api * api, int which, int mode); char *tv_get_description(magic_api * api, int which, int mode);
int tv_requires_colors(magic_api * api, int which); int tv_requires_colors(magic_api * api, int which);
void tv_release(magic_api * api, int which, void tv_release(magic_api * api, int which,
@ -98,6 +99,11 @@ char *tv_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
return strdup(gettext_noop("TV")); return strdup(gettext_noop("TV"));
} }
int tv_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
{
return MAGIC_TYPE_DISTORTS;
}
char *tv_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) char *tv_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode)
{ {
if (mode == MODE_PAINT) if (mode == MODE_PAINT)