Magic tools can now be both painted and full-image.

Negative tool now does this.
This commit is contained in:
William Kendrick 2008-07-09 02:46:54 +00:00
parent 8c6fbb8cf5
commit 472692fbab
38 changed files with 453 additions and 79 deletions

View file

@ -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

View file

@ -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&nbsp;*&nbsp;api,
int&nbsp;which)</b></code><br>
This lets you tell Tux&nbsp;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&nbsp;|&nbsp;MODE_FULLSCREEN</code>"
to tell Tux&nbsp;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&nbsp;Paint 0.9.21; Magic API version
'0x00000002'</i><br>
<br>
<li><code><b>void shutdown(magic_api&nbsp;*&nbsp;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>,

View file

@ -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