Magic tools can now be both painted and full-image.
Negative tool now does this.
This commit is contained in:
parent
8c6fbb8cf5
commit
472692fbab
38 changed files with 453 additions and 79 deletions
|
|
@ -6,7 +6,7 @@
|
|||
bill@newbreedsoftware.com
|
||||
http://www.tuxpaint.org/
|
||||
|
||||
July 5, 2007 - July 7, 2008
|
||||
July 5, 2007 - July 8, 2008
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
|
@ -236,6 +236,24 @@ Interfaces
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
* int modes(magic_api * api, int which)
|
||||
This lets you tell Tux Paint what modes your tool can be used in
|
||||
(either as a tool the user can paint with, or a tool that
|
||||
affects the entire drawing at once)
|
||||
|
||||
You must return a value that's some combination of one or more
|
||||
of available modes:
|
||||
* MODE_PAINT
|
||||
* MODE_FULLSCREEN
|
||||
e.g., if your tool is only one that the user can paint with,
|
||||
return "MODE_PAINT". If the user can do both, return
|
||||
"MODE_PAINT | MODE_FULLSCREEN" to tell Tux Paint it can do both.
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Note: Added to Tux Paint 0.9.21; Magic API version '0x00000002'
|
||||
|
||||
* void shutdown(magic_api * api)
|
||||
The plugin should do any cleanup here. If you allocated any
|
||||
memory or used SDL_Mixer to load any sounds during init(), for
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ New Breed Software</p>
|
|||
<p><a href="mailto:bill@newbreedsoftware.com">bill@newbreedsoftware.com</a><br>
|
||||
<a href="http://www.tuxpaint.org/">http://www.tuxpaint.org/</a></p>
|
||||
|
||||
<p>July 5, 2007 - July 7, 2008</p>
|
||||
<p>July 5, 2007 - July 8, 2008</p>
|
||||
</center>
|
||||
|
||||
<hr size=2 noshade>
|
||||
|
|
@ -305,6 +305,30 @@ then the names of your functions must begin with "<code><b>zoom_</b></code>"
|
|||
contain (by your "<code>get_tool_count()</code>").<br>
|
||||
<br>
|
||||
|
||||
<li><code><b>int modes(magic_api * api,
|
||||
int which)</b></code><br>
|
||||
This lets you tell Tux Paint what modes your tool can be used in
|
||||
(either as a tool the user can paint with, or a tool that affects
|
||||
the entire drawing at once)<br>
|
||||
<br>
|
||||
You must return a value that's some combination of one or more of
|
||||
available modes:
|
||||
<ul>
|
||||
<li><code>MODE_PAINT</code>
|
||||
<li><code>MODE_FULLSCREEN</code>
|
||||
</ul>
|
||||
e.g., if your tool is only one that the user can paint with,
|
||||
return "<code>MODE_PAINT</code>". If the user can do both,
|
||||
return "<code>MODE_PAINT | MODE_FULLSCREEN</code>"
|
||||
to tell Tux Paint it can do both.<br>
|
||||
<br>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to
|
||||
contain (by your "<code>get_tool_count()</code>").<br>
|
||||
<br>
|
||||
<i>Note: Added to Tux Paint 0.9.21; Magic API version
|
||||
'0x00000002'</i><br>
|
||||
<br>
|
||||
|
||||
<li><code><b>void shutdown(magic_api * api)</b></code><br>
|
||||
The plugin should do any cleanup here. If you allocated any memory
|
||||
or used SDL_Mixer to load any sounds during <code>init()</code>,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* tp_magic_example.c
|
||||
|
||||
An example of a "Magic" tool plugin for Tux Paint
|
||||
Last modified: 2008.07.07
|
||||
Last modified: 2008.07.08
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -282,6 +282,17 @@ int example_requires_colors(magic_api * api, int which)
|
|||
}
|
||||
|
||||
|
||||
// Report what modes we work in
|
||||
|
||||
int example_modes(magic_api * api, int which)
|
||||
{
|
||||
// Both of our tools are painted (neither affect the full-screen),
|
||||
// so we're always returning 'MODE_PAINT'
|
||||
|
||||
return MODE_PAINT;
|
||||
}
|
||||
|
||||
|
||||
// Shut down
|
||||
//
|
||||
// Tux Paint is quitting. When it quits, it asks all of the plugins
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
blackAndWhite, Convert the image to greyscale or threshold it into pure black and pure white
|
||||
Tux Paint - A simple drawing program for children.
|
||||
|
||||
FIXME: Credits
|
||||
|
||||
Copyright (c) 2002-2008 by Bill Kendrick and others; see AUTHORS.txt
|
||||
bill@newbreedsoftware.com
|
||||
http://www.tuxpaint.org/
|
||||
|
|
@ -23,7 +25,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -162,7 +164,7 @@ void blackAndWhite_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void blackAndWhite_click(magic_api * api, int which,
|
||||
void blackAndWhite_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect){
|
||||
update_rect->x = 0;
|
||||
|
|
@ -211,3 +213,7 @@ void blackAndWhite_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int blackAndWhite_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_FULLSCREEN); /* FIXME - Can also be turned into a painted effect */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ static void blocks_chalk_drip_linecb(void * ptr, int which,
|
|||
void blocks_chalk_drip_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int ox, int oy, int x, int y,
|
||||
SDL_Rect * update_rect);
|
||||
void blocks_chalk_drip_click(magic_api * api, int which,
|
||||
void blocks_chalk_drip_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect);
|
||||
void blocks_chalk_drip_release(magic_api * api, int which,
|
||||
|
|
@ -285,7 +285,7 @@ void blocks_chalk_drip_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void blocks_chalk_drip_click(magic_api * api, int which,
|
||||
void blocks_chalk_drip_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -329,3 +329,7 @@ void blocks_chalk_drip_switchout(magic_api * api, int which, SDL_Surface * canva
|
|||
{
|
||||
}
|
||||
|
||||
int blocks_chalk_drip_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT); /* FIXME - Blocks and Chalk, at least, can also be turned into a full-image effect */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ void blur_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void blur_click(magic_api * api, int which,
|
||||
void blur_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -213,3 +213,7 @@ void blur_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int blur_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT); /* FIXME - Can also be turned into a full-image effect */ /* FIXME: Merge with blurAll */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
blurAll, Blur the whole image
|
||||
Tux Paint - A simple drawing program for children.
|
||||
|
||||
FIXME: Credits
|
||||
|
||||
Copyright (c) 2002-2008 by Bill Kendrick and others; see AUTHORS.txt
|
||||
bill@newbreedsoftware.com
|
||||
http://www.tuxpaint.org/
|
||||
|
|
@ -23,7 +25,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -145,7 +147,7 @@ void blurAll_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void blurAll_click(magic_api * api, int which,
|
||||
void blurAll_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect){
|
||||
update_rect->x = 0;
|
||||
|
|
@ -194,3 +196,7 @@ void blurAll_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int blurAll_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_FULLSCREEN); /* FIXME - Can also be turned into a painted effect */ /* FIXME: Merge with blur */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ void bricks_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void bricks_click(magic_api * api, int which,
|
||||
void bricks_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -302,3 +302,7 @@ void bricks_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int bricks_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -252,7 +252,7 @@ void calligraphy_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
api->playsound(calligraphy_snd, (x * 255) / canvas->w, 255);
|
||||
}
|
||||
|
||||
void calligraphy_click(magic_api * api, int which,
|
||||
void calligraphy_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -428,3 +428,7 @@ void calligraphy_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int calligraphy_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_FULLSCREEN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ void cartoon_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void cartoon_click(magic_api * api, int which,
|
||||
void cartoon_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -231,3 +231,7 @@ void cartoon_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int cartoon_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT); /* FIXME - Can also be turned into a full-image effect */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ void distortion_shutdown(magic_api * api)
|
|||
|
||||
// Affect the canvas on click:
|
||||
|
||||
void distortion_click(magic_api * api, int which,
|
||||
void distortion_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -234,3 +234,7 @@ void distortion_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int distortion_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ void emboss_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void emboss_click(magic_api * api, int which,
|
||||
void emboss_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -187,3 +187,7 @@ void emboss_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int emboss_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT); /* FIXME - Can also be turned into a full-image effect */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ static void do_fade_darken(void * ptr, int which,
|
|||
void fade_darken_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, int ox, int oy, int x, int y,
|
||||
SDL_Rect * update_rect);
|
||||
void fade_darken_click(magic_api * api, int which,
|
||||
void fade_darken_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect);
|
||||
void fade_darken_release(magic_api * api, int which,
|
||||
|
|
@ -195,7 +195,7 @@ void fade_darken_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Ask Tux Paint to call our 'do_fade_darken()' callback at a single point
|
||||
void fade_darken_click(magic_api * api, int which,
|
||||
void fade_darken_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -239,3 +239,7 @@ void fade_darken_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int fade_darken_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT); /* FIXME - Can also be turned into a full-image effect */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ void fill_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void fill_click(magic_api * api, int which,
|
||||
void fill_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -254,3 +254,7 @@ void fill_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int fill_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ void flower_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void flower_click(magic_api * api, int which,
|
||||
void flower_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -602,3 +602,7 @@ void flower_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int flower_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ void foam_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void foam_click(magic_api * api, int which,
|
||||
void foam_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -425,3 +425,7 @@ void foam_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int foam_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -218,7 +218,7 @@ void glasstile_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void glasstile_click(magic_api * api, int which,
|
||||
void glasstile_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -287,3 +287,7 @@ void glasstile_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int glasstile_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT); /* FIXME - Can also be turned into a full-image effect */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ void grass_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void grass_click(magic_api * api, int which,
|
||||
void grass_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -252,3 +252,7 @@ void grass_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int grass_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ void kalidescope_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void kalidescope_click(magic_api * api, int which,
|
||||
void kalidescope_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -172,3 +172,7 @@ void kalidescope_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int kalidescope_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ void light_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void light_click(magic_api * api, int which,
|
||||
void light_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -215,3 +215,7 @@ void light_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int light_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ void metalpaint_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void metalpaint_click(magic_api * api, int which,
|
||||
void metalpaint_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -181,3 +181,7 @@ void metalpaint_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int metalpaint_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ void mirror_flip_release(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void mirror_flip_click(magic_api * api, int which,
|
||||
void mirror_flip_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y,
|
||||
SDL_Rect * update_rect)
|
||||
|
|
@ -206,3 +206,7 @@ void mirror_flip_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int mirror_flip_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_FULLSCREEN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -125,17 +125,43 @@ void negative_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
update_rect->h = (y + 16) - update_rect->h;
|
||||
|
||||
api->playsound(negative_snd, (x * 255) / canvas->w, 255);
|
||||
|
||||
|
||||
|
||||
SDL_UnlockSurface(canvas);
|
||||
SDL_UnlockSurface(last);
|
||||
}
|
||||
|
||||
// Ask Tux Paint to call our 'do_negative()' callback at a single point
|
||||
void negative_click(magic_api * api, int which,
|
||||
void negative_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
negative_drag(api, which, canvas, last, x, y, x, y, update_rect);
|
||||
if (mode == MODE_PAINT)
|
||||
negative_drag(api, which, canvas, last, x, y, x, y, update_rect);
|
||||
else
|
||||
{
|
||||
int xx, yy;
|
||||
Uint8 r, g, b;
|
||||
|
||||
for (yy = 0; yy < canvas->h; yy++)
|
||||
{
|
||||
for (xx = 0; xx < canvas->w; xx++)
|
||||
{
|
||||
SDL_GetRGB(api->getpixel(last, xx, yy), last->format, &r, &g, &b);
|
||||
|
||||
r = 0xFF - r;
|
||||
g = 0xFF - g;
|
||||
b = 0xFF - b;
|
||||
|
||||
api->putpixel(canvas, xx, yy, SDL_MapRGB(canvas->format, r, g, b));
|
||||
}
|
||||
}
|
||||
|
||||
update_rect->x = 0;
|
||||
update_rect->y = 0;
|
||||
update_rect->w = canvas->w;
|
||||
update_rect->h = canvas->h;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -171,3 +197,7 @@ void negative_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int negative_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT | MODE_FULLSCREEN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ void rainbow_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void rainbow_click(magic_api * api, int which,
|
||||
void rainbow_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y,
|
||||
SDL_Rect * update_rect)
|
||||
|
|
@ -201,3 +201,7 @@ void rainbow_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int rainbow_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ static void ripples_linecb(void * ptr, int which,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void ripples_click(magic_api * api, int which,
|
||||
void ripples_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -185,3 +185,7 @@ void ripples_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int ripples_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
Sharpen, Trace Contour and Silhouette Magic Tool Plugin
|
||||
Tux Paint - A simple drawing program for children.
|
||||
|
||||
FIXME: Credits
|
||||
|
||||
Copyright (c) 2002-2008 by Bill Kendrick and others; see AUTHORS.txt
|
||||
bill@newbreedsoftware.com
|
||||
http://www.tuxpaint.org/
|
||||
|
|
@ -23,7 +25,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -223,7 +225,7 @@ void sharpen_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void sharpen_click(magic_api * api, int which,
|
||||
void sharpen_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -274,3 +276,7 @@ void sharpen_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int sharpen_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_FULLSCREEN); /* FIXME - Can also be turned into a painted effect */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ char * shift_get_description(magic_api * api, int which);
|
|||
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);
|
||||
void shift_click(magic_api * api, int which,
|
||||
void shift_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect);
|
||||
void shift_release(magic_api * api, int which,
|
||||
|
|
@ -284,7 +284,7 @@ static void shift_doit(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNU
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void shift_click(magic_api * api, int which,
|
||||
void shift_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -331,3 +331,7 @@ void shift_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int shift_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_FULLSCREEN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ void smudge_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void smudge_click(magic_api * api, int which,
|
||||
void smudge_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -180,3 +180,7 @@ void smudge_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int smudge_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ void tint_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void tint_click(magic_api * api, int which,
|
||||
void tint_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -186,3 +186,7 @@ void tint_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
|||
{
|
||||
}
|
||||
|
||||
int tint_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT); /* FIXME - Can also be turned into a full-image effect */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 7, 2008
|
||||
Last updated: July 8, 2008
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ void waves_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
}
|
||||
|
||||
// Affect the canvas on click:
|
||||
void waves_click(magic_api * api, int which,
|
||||
void waves_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
|
|
@ -161,3 +161,8 @@ void waves_switchin(magic_api * api, int which, SDL_Surface * canvas)
|
|||
void waves_switchout(magic_api * api, int which, SDL_Surface * canvas)
|
||||
{
|
||||
}
|
||||
|
||||
int waves_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_FULLSCREEN);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue