From f556b503b9cf858b94ee7839db1b2cb1be4c09e7 Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Thu, 10 Jul 2008 20:26:38 +0000 Subject: [PATCH] switchin() and switchout() now accept mode. --- docs/CHANGES.txt | 3 ++- magic/docs/README.txt | 11 ++++++++--- magic/docs/html/README.html | 11 ++++++++--- magic/docs/tp_magic_example.c | 18 +++++++++++++----- magic/src/blackAndWhite.c | 4 ++-- magic/src/blocks_chalk_drip.c | 4 ++-- magic/src/blur.c | 4 ++-- magic/src/blurAll.c | 4 ++-- magic/src/bricks.c | 4 ++-- magic/src/calligraphy.c | 4 ++-- magic/src/cartoon.c | 4 ++-- magic/src/confetti.c | 6 ++---- magic/src/distortion.c | 4 ++-- magic/src/emboss.c | 4 ++-- magic/src/fade_darken.c | 4 ++-- magic/src/fill.c | 4 ++-- magic/src/flower.c | 4 ++-- magic/src/foam.c | 4 ++-- magic/src/fold.c | 6 ++---- magic/src/glasstile.c | 4 ++-- magic/src/grass.c | 4 ++-- magic/src/kalidescope.c | 4 ++-- magic/src/light.c | 4 ++-- magic/src/metalpaint.c | 4 ++-- magic/src/mirror_flip.c | 4 ++-- magic/src/negative.c | 4 ++-- magic/src/rainbow.c | 4 ++-- magic/src/ripples.c | 4 ++-- magic/src/sharpen.c | 4 ++-- magic/src/shift.c | 4 ++-- magic/src/smudge.c | 4 ++-- magic/src/tint.c | 4 ++-- magic/src/waves.c | 4 ++-- src/tuxpaint.c | 22 ++++++++++++++-------- 34 files changed, 103 insertions(+), 82 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 6e714fa4f..844fcd018 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -33,7 +33,8 @@ $Id$ * Magic Tool Improvememnts: -------------------------- * Added "_switchin()" and "_switchout()" functions to Magic tool API, - to tell Magic tools when they are selected or deselected. + to tell Magic tools when they are selected or deselected, or when + their mode changes.. * Added "_modes()" function to Magic tool API, so Magic tool plugins can tell Tux Paint what modes it accepts, 'paint' or 'fullscreen'. diff --git a/magic/docs/README.txt b/magic/docs/README.txt index 044817d83..5193b21c7 100644 --- a/magic/docs/README.txt +++ b/magic/docs/README.txt @@ -6,7 +6,7 @@ bill@newbreedsoftware.com http://www.tuxpaint.org/ - July 5, 2007 - July 8, 2008 + July 5, 2007 - July 10, 2008 ---------------------------------------------------------------------- @@ -271,9 +271,9 @@ Interfaces Plugin event functions: - * void switchin(magic_api * api, int which, + * void switchin(magic_api * api, int which, int mode, SDL_Surface * snapshot, SDL_Surface * canvas) - void switchout(magic_api * api, int which, + void switchout(magic_api * api, int which, int mode, SDL_Surface * snapshot, SDL_Surface * canvas) switchin() is called whenever one of the plugin's Magic tools becomes active, and switchout() is called whenever one becomes @@ -290,6 +290,11 @@ Interfaces tool is first 'switched-out', and then 'switched-back-in', usually moments later. + Finally, it can also happen when the user changes the 'mode' of + a tool (i.e., from paint mode to full-image mode). First + switchout() is called for the old mode, then switchin() is + called for the new mode. + These functions allow users to interact in complicated was with Magic tools (for example, a tool that lets the user draw multiple freehand strokes, and then uses that as input such as diff --git a/magic/docs/html/README.html b/magic/docs/html/README.html index 98cbe9a87..68d799f3e 100644 --- a/magic/docs/html/README.html +++ b/magic/docs/html/README.html @@ -15,7 +15,7 @@ New Breed Software

bill@newbreedsoftware.com
http://www.tuxpaint.org/

-

July 5, 2007 - July 8, 2008

+

July 5, 2007 - July 10, 2008


@@ -352,11 +352,11 @@ then the names of your functions must begin with "zoom_"