switchin() and switchout() now accept mode.

This commit is contained in:
William Kendrick 2008-07-10 20:26:38 +00:00
parent 0b7b36c734
commit f556b503b9
34 changed files with 103 additions and 82 deletions

View file

@ -1,7 +1,7 @@
/* tp_magic_example.c
An example of a "Magic" tool plugin for Tux Paint
Last modified: 2008.07.09
Last modified: 2008.07.10
*/
@ -489,13 +489,18 @@ void example_line_callback(void * ptr, int which,
// This happens whenever a Magic tool is enabled, either because the
// user just selected it, or they just came back to "Magic" after using
// another tool (e.g., Brush or Text), and this was the most-recently
// selected Magic tool. (This also applies to momentary tools, like
// selected Magic tool.
//
// (This also applies to momentary tools, like
// Undo and Redo, and image-changing tools such as New and Open.)
//
// It also happens when a Magic tool's mode changes (it first
// receives a 'switchout()', below, for the old mode).
//
// Our example doesn't do anything when we switch to, or away from, our
// Magic tools, so we just do nothing here.
void example_switchin(magic_api * api, int which, SDL_Surface * canvas)
void example_switchin(magic_api * api, int which, int mode, SDL_Surface * canvas)
{
}
@ -504,14 +509,17 @@ void example_switchin(magic_api * api, int which, SDL_Surface * canvas)
// This happens whenever a Magic tool is disabled, either because the
// user selected a different Magic tool, or they selected a completely
// different tool (e.g., Brush or Text).
//
// (This also applies to momentary tools, like Undo and Redo, and
// image-changing tools such as New and Open, in which case the
// switchin() function will be called moments later.)
//
// It also happens when a Magic tool's mode changes (it then
// receives a 'switchin()', above, for the new mode).
//
// Our example doesn't do anything when we switch to, or away from, our
// Magic tools, so we just do nothing here.
void example_switchout(magic_api * api, int which, SDL_Surface * canvas)
void example_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas)
{
}