From 12b503be9c246aedd2a3df9753379bc93dc06db5 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Mon, 20 Sep 2021 23:47:31 -0700 Subject: [PATCH] Adding more Magic tools to their groups... WIP --- magic/src/blind.c | 6 ++++++ magic/src/calligraphy.c | 11 +++++++++-- magic/src/realrainbow.c | 8 +++++++- magic/src/shift.c | 11 +++++++++-- magic/src/snow.c | 10 ++++++++-- magic/src/waves.c | 9 ++++++++- 6 files changed, 47 insertions(+), 8 deletions(-) diff --git a/magic/src/blind.c b/magic/src/blind.c index 9ca509699..0abc0e34d 100644 --- a/magic/src/blind.c +++ b/magic/src/blind.c @@ -58,6 +58,7 @@ int blind_init(magic_api * api); int blind_get_tool_count(magic_api * api); SDL_Surface *blind_get_icon(magic_api * api, int which); char *blind_get_name(magic_api * api, int which); +int blind_get_group(magic_api * api, int which); char *blind_get_description(magic_api * api, int which, int mode); int blind_requires_colors(magic_api * api, int which); void blind_release(magic_api * api, int which, @@ -115,6 +116,11 @@ char *blind_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSE return strdup(gettext_noop("Blind")); } +int blind_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +{ + return MAGIC_TYPE_PICTURE_DECORATIONS; +} + char *blind_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) { return diff --git a/magic/src/calligraphy.c b/magic/src/calligraphy.c index d2a529386..b2a1d882f 100644 --- a/magic/src/calligraphy.c +++ b/magic/src/calligraphy.c @@ -4,7 +4,7 @@ Calligraphy Magic Tool Plugin Tux Paint - A simple drawing program for children. - 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 http://www.tuxpaint.org/ @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: August 29, 2019 + Last updated: September 20, 2021 $Id$ */ @@ -57,6 +57,7 @@ Uint32 calligraphy_api_version(void); int calligraphy_get_tool_count(magic_api * api); SDL_Surface *calligraphy_get_icon(magic_api * api, int which); char *calligraphy_get_name(magic_api * api, int which); +int calligraphy_get_group(magic_api * api, int which); char *calligraphy_get_description(magic_api * api, int which, int mode); void calligraphy_drag(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, int ox, int oy, int x, int y, SDL_Rect * update_rect); @@ -124,6 +125,12 @@ char *calligraphy_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE return (strdup(gettext_noop("Calligraphy"))); } +// Return our group +int calligraphy_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +{ + return MAGIC_TYPE_PAINTING; +} + // Return our description, localized: char *calligraphy_get_description(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) diff --git a/magic/src/realrainbow.c b/magic/src/realrainbow.c index d4c9ece7e..0c3ee6e01 100644 --- a/magic/src/realrainbow.c +++ b/magic/src/realrainbow.c @@ -6,7 +6,7 @@ by Bill Kendrick Math assistance by Jeff Newmiller - 2009.04.02 - 2014.08.14 + 2009.04.02 - 2021.09.20 FIXME: * Color/alpha art needs improvement. @@ -35,6 +35,7 @@ int realrainbow_init(magic_api * api); int realrainbow_get_tool_count(magic_api * api); SDL_Surface *realrainbow_get_icon(magic_api * api, int which); char *realrainbow_get_name(magic_api * api, int which); +int realrainbow_get_group(magic_api * api, int which); char *realrainbow_get_description(magic_api * api, int which, int mode); int realrainbow_modes(magic_api * api, int which); int realrainbow_requires_colors(magic_api * api, int which); @@ -100,6 +101,11 @@ char *realrainbow_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) return (strdup(gettext_noop("ROYGBIV Rainbow"))); } +int realrainbow_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +{ + return MAGIC_TYPE_ARTISTIC; +} + char *realrainbow_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 590b8ff40..eedc101c0 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-2008 by Bill Kendrick and others; see AUTHORS.txt + Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt bill@newbreedsoftware.com http://www.tuxpaint.org/ @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: July 8, 2008 + Last updated: September 20, 2021 $Id$ */ @@ -50,6 +50,7 @@ int shift_init(magic_api * api); 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); 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); @@ -106,6 +107,12 @@ char *shift_get_name(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSE return (strdup(gettext_noop("Shift"))); } +// Return our group +int shift_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +{ + return MAGIC_TYPE_PICTURE_WARPS; +} + // 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/snow.c b/magic/src/snow.c index 6083b1108..3efa8d918 100644 --- a/magic/src/snow.c +++ b/magic/src/snow.c @@ -6,7 +6,7 @@ Credits: Andrew Corcoran - Copyright (c) 2002-2007 by Bill Kendrick and others; see AUTHORS.txt + Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt bill@newbreedsoftware.com http://www.tuxpaint.org/ @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - Last updated: June 6, 2008 + Last updated: September 20, 2021 $Id$ */ @@ -82,6 +82,7 @@ int snow_init(magic_api * api); int snow_get_tool_count(magic_api * api); SDL_Surface *snow_get_icon(magic_api * api, int which); char *snow_get_name(magic_api * api, int which); +int snow_get_group(magic_api * api, int which); char *snow_get_description(magic_api * api, int which); static void do_snow(void *ptr, SDL_Surface * canvas, SDL_Surface * last, int which, int snowAmount); void snow_drag(magic_api * api, int which, SDL_Surface * canvas, @@ -157,6 +158,11 @@ char *snow_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) return (strdup(gettext_noop(snow_names[which]))); } +int snow_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +{ + return MAGIC_TYPE_PICTURE_DECORATIONS; /* Because we affect the whole image, and not just around the mouse */ +} + // Return our descriptions, localized: char *snow_get_description(magic_api * api ATTRIBUTE_UNUSED, int which) { diff --git a/magic/src/waves.c b/magic/src/waves.c index a4fcfd40c..ac3c19993 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-2008 by Bill Kendrick and others; see AUTHORS.txt + Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt bill@newbreedsoftware.com http://www.tuxpaint.org/ @@ -43,6 +43,7 @@ int waves_init(magic_api * api); 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); 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); @@ -97,6 +98,12 @@ SDL_Surface *waves_get_icon(magic_api * api, int which) return (IMG_Load(fname)); } +// Return our group (both the same): +int waves_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) +{ + return MAGIC_TYPE_PICTURE_WARPS; +} + // Return our names, localized: char *waves_get_name(magic_api * api ATTRIBUTE_UNUSED, int which) {