Magic size capabilites on a per-mode basis
e.g., useful to set size for paint-mode blur, but meaningless for fullscreen-mode blur.
This commit is contained in:
parent
5bbfd91c2c
commit
b2535d59ba
13 changed files with 173 additions and 133 deletions
|
|
@ -312,23 +312,24 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 accepted_sizes(magic_api * api, int which)
|
||||
Uint8 accepted_sizes(magic_api * api, int which, int mode)
|
||||
|
||||
Return how many size variations the 'Magic' tool accepts. Return a
|
||||
'0' if the 'Magic' tool should not offer sizing options. Returning
|
||||
'1' is the same as returning '0'.
|
||||
Return how many size variations the 'Magic' tool accepts, in the
|
||||
given mode (i.e., 'MODE_PAINT' or 'MODE_FULLSCREEN). Return a '0'
|
||||
if the 'Magic' tool should not offer sizing options. Returning '1'
|
||||
is the same as returning '0'.
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 default_size(magic_api * api, int which)
|
||||
Uint8 default_size(magic_api * api, int which, int mode)
|
||||
|
||||
Return the default size the 'Magic' tool accepts. This will be the
|
||||
default setting for the tool the first time it is used during a
|
||||
Tux Paint session. If Tux Paint is being invoked with the sizing
|
||||
option disabled, this will be the only size requested by Tux
|
||||
Paint. Return a number between '1' and the amount you returned in
|
||||
accepted_sizes().
|
||||
Return the default size the 'Magic' tool accepts, in the given
|
||||
mode. This will be the default setting for the tool the first time
|
||||
it is used during a Tux Paint session. If Tux Paint is being
|
||||
invoked with the sizing option disabled, this will be the only
|
||||
size requested by Tux Paint. Return a number between '1' and the
|
||||
amount you returned in accepted_sizes().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
|
@ -405,7 +406,7 @@ Magic Tool Plugin API Documentation
|
|||
Note: Changed most recently in Tux Paint 0.9.29; Magic API version
|
||||
0x00000007.
|
||||
|
||||
void set_size(magic_api * api, int which, SDL_Surface * canvas,
|
||||
void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect)
|
||||
|
||||
Tux Paint will call this function to inform the plugin of the
|
||||
|
|
|
|||
|
|
@ -395,18 +395,18 @@
|
|||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return how many size variations the 'Magic' tool accepts. Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
Return how many size variations the 'Magic' tool accepts, in the given mode (i.e., '<code>MODE_PAINT</code>' or '<code>MODE_FULLSCREEN</code>). Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return the default size the 'Magic' tool accepts. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
Return the default size the 'Magic' tool accepts, in the given mode. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
|
@ -457,7 +457,7 @@
|
|||
<b>Note:</b> Changed most recently in Tux Paint 0.9.29; Magic API version 0x00000007. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>void set_size(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dt><code><b>void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Tux Paint will call this function to inform the plugin of the 'Magic' tool size option chosen. (It will be called whenever one of the plugin's Magic tools that accept sizes becomes active, and whenever the user picks a new size while such a tool is currently active.) </p>
|
||||
|
|
|
|||
|
|
@ -312,23 +312,24 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 accepted_sizes(magic_api * api, int which)
|
||||
Uint8 accepted_sizes(magic_api * api, int which, int mode)
|
||||
|
||||
Return how many size variations the 'Magic' tool accepts. Return a
|
||||
'0' if the 'Magic' tool should not offer sizing options. Returning
|
||||
'1' is the same as returning '0'.
|
||||
Return how many size variations the 'Magic' tool accepts, in the
|
||||
given mode (i.e., 'MODE_PAINT' or 'MODE_FULLSCREEN). Return a '0'
|
||||
if the 'Magic' tool should not offer sizing options. Returning '1'
|
||||
is the same as returning '0'.
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 default_size(magic_api * api, int which)
|
||||
Uint8 default_size(magic_api * api, int which, int mode)
|
||||
|
||||
Return the default size the 'Magic' tool accepts. This will be the
|
||||
default setting for the tool the first time it is used during a
|
||||
Tux Paint session. If Tux Paint is being invoked with the sizing
|
||||
option disabled, this will be the only size requested by Tux
|
||||
Paint. Return a number between '1' and the amount you returned in
|
||||
accepted_sizes().
|
||||
Return the default size the 'Magic' tool accepts, in the given
|
||||
mode. This will be the default setting for the tool the first time
|
||||
it is used during a Tux Paint session. If Tux Paint is being
|
||||
invoked with the sizing option disabled, this will be the only
|
||||
size requested by Tux Paint. Return a number between '1' and the
|
||||
amount you returned in accepted_sizes().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
|
@ -405,7 +406,7 @@ Magic Tool Plugin API Documentation
|
|||
Note: Changed most recently in Tux Paint 0.9.29; Magic API version
|
||||
0x00000007.
|
||||
|
||||
void set_size(magic_api * api, int which, SDL_Surface * canvas,
|
||||
void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect)
|
||||
|
||||
Tux Paint will call this function to inform the plugin of the
|
||||
|
|
|
|||
|
|
@ -395,18 +395,18 @@
|
|||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return how many size variations the 'Magic' tool accepts. Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
Return how many size variations the 'Magic' tool accepts, in the given mode (i.e., '<code>MODE_PAINT</code>' or '<code>MODE_FULLSCREEN</code>). Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return the default size the 'Magic' tool accepts. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
Return the default size the 'Magic' tool accepts, in the given mode. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
|
@ -457,7 +457,7 @@
|
|||
<b>Note:</b> Changed most recently in Tux Paint 0.9.29; Magic API version 0x00000007. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>void set_size(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dt><code><b>void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Tux Paint will call this function to inform the plugin of the 'Magic' tool size option chosen. (It will be called whenever one of the plugin's Magic tools that accept sizes becomes active, and whenever the user picks a new size while such a tool is currently active.) </p>
|
||||
|
|
|
|||
|
|
@ -312,23 +312,24 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 accepted_sizes(magic_api * api, int which)
|
||||
Uint8 accepted_sizes(magic_api * api, int which, int mode)
|
||||
|
||||
Return how many size variations the 'Magic' tool accepts. Return a
|
||||
'0' if the 'Magic' tool should not offer sizing options. Returning
|
||||
'1' is the same as returning '0'.
|
||||
Return how many size variations the 'Magic' tool accepts, in the
|
||||
given mode (i.e., 'MODE_PAINT' or 'MODE_FULLSCREEN). Return a '0'
|
||||
if the 'Magic' tool should not offer sizing options. Returning '1'
|
||||
is the same as returning '0'.
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 default_size(magic_api * api, int which)
|
||||
Uint8 default_size(magic_api * api, int which, int mode)
|
||||
|
||||
Return the default size the 'Magic' tool accepts. This will be the
|
||||
default setting for the tool the first time it is used during a
|
||||
Tux Paint session. If Tux Paint is being invoked with the sizing
|
||||
option disabled, this will be the only size requested by Tux
|
||||
Paint. Return a number between '1' and the amount you returned in
|
||||
accepted_sizes().
|
||||
Return the default size the 'Magic' tool accepts, in the given
|
||||
mode. This will be the default setting for the tool the first time
|
||||
it is used during a Tux Paint session. If Tux Paint is being
|
||||
invoked with the sizing option disabled, this will be the only
|
||||
size requested by Tux Paint. Return a number between '1' and the
|
||||
amount you returned in accepted_sizes().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
|
@ -405,7 +406,7 @@ Magic Tool Plugin API Documentation
|
|||
Note: Changed most recently in Tux Paint 0.9.29; Magic API version
|
||||
0x00000007.
|
||||
|
||||
void set_size(magic_api * api, int which, SDL_Surface * canvas,
|
||||
void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect)
|
||||
|
||||
Tux Paint will call this function to inform the plugin of the
|
||||
|
|
|
|||
|
|
@ -395,18 +395,18 @@
|
|||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return how many size variations the 'Magic' tool accepts. Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
Return how many size variations the 'Magic' tool accepts, in the given mode (i.e., '<code>MODE_PAINT</code>' or '<code>MODE_FULLSCREEN</code>). Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return the default size the 'Magic' tool accepts. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
Return the default size the 'Magic' tool accepts, in the given mode. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
|
@ -457,7 +457,7 @@
|
|||
<b>Note:</b> Changed most recently in Tux Paint 0.9.29; Magic API version 0x00000007. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>void set_size(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dt><code><b>void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Tux Paint will call this function to inform the plugin of the 'Magic' tool size option chosen. (It will be called whenever one of the plugin's Magic tools that accept sizes becomes active, and whenever the user picks a new size while such a tool is currently active.) </p>
|
||||
|
|
|
|||
|
|
@ -312,23 +312,24 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 accepted_sizes(magic_api * api, int which)
|
||||
Uint8 accepted_sizes(magic_api * api, int which, int mode)
|
||||
|
||||
Return how many size variations the 'Magic' tool accepts. Return a
|
||||
'0' if the 'Magic' tool should not offer sizing options. Returning
|
||||
'1' is the same as returning '0'.
|
||||
Return how many size variations the 'Magic' tool accepts, in the
|
||||
given mode (i.e., 'MODE_PAINT' or 'MODE_FULLSCREEN). Return a '0'
|
||||
if the 'Magic' tool should not offer sizing options. Returning '1'
|
||||
is the same as returning '0'.
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 default_size(magic_api * api, int which)
|
||||
Uint8 default_size(magic_api * api, int which, int mode)
|
||||
|
||||
Return the default size the 'Magic' tool accepts. This will be the
|
||||
default setting for the tool the first time it is used during a
|
||||
Tux Paint session. If Tux Paint is being invoked with the sizing
|
||||
option disabled, this will be the only size requested by Tux
|
||||
Paint. Return a number between '1' and the amount you returned in
|
||||
accepted_sizes().
|
||||
Return the default size the 'Magic' tool accepts, in the given
|
||||
mode. This will be the default setting for the tool the first time
|
||||
it is used during a Tux Paint session. If Tux Paint is being
|
||||
invoked with the sizing option disabled, this will be the only
|
||||
size requested by Tux Paint. Return a number between '1' and the
|
||||
amount you returned in accepted_sizes().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
|
@ -405,7 +406,7 @@ Magic Tool Plugin API Documentation
|
|||
Note: Changed most recently in Tux Paint 0.9.29; Magic API version
|
||||
0x00000007.
|
||||
|
||||
void set_size(magic_api * api, int which, SDL_Surface * canvas,
|
||||
void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect)
|
||||
|
||||
Tux Paint will call this function to inform the plugin of the
|
||||
|
|
|
|||
|
|
@ -395,18 +395,18 @@
|
|||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return how many size variations the 'Magic' tool accepts. Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
Return how many size variations the 'Magic' tool accepts, in the given mode (i.e., '<code>MODE_PAINT</code>' or '<code>MODE_FULLSCREEN</code>). Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return the default size the 'Magic' tool accepts. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
Return the default size the 'Magic' tool accepts, in the given mode. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
|
@ -457,7 +457,7 @@
|
|||
<b>Note:</b> Changed most recently in Tux Paint 0.9.29; Magic API version 0x00000007. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>void set_size(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dt><code><b>void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Tux Paint will call this function to inform the plugin of the 'Magic' tool size option chosen. (It will be called whenever one of the plugin's Magic tools that accept sizes becomes active, and whenever the user picks a new size while such a tool is currently active.) </p>
|
||||
|
|
|
|||
|
|
@ -312,23 +312,24 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 accepted_sizes(magic_api * api, int which)
|
||||
Uint8 accepted_sizes(magic_api * api, int which, int mode)
|
||||
|
||||
Return how many size variations the 'Magic' tool accepts. Return a
|
||||
'0' if the 'Magic' tool should not offer sizing options. Returning
|
||||
'1' is the same as returning '0'.
|
||||
Return how many size variations the 'Magic' tool accepts, in the
|
||||
given mode (i.e., 'MODE_PAINT' or 'MODE_FULLSCREEN). Return a '0'
|
||||
if the 'Magic' tool should not offer sizing options. Returning '1'
|
||||
is the same as returning '0'.
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
Uint8 default_size(magic_api * api, int which)
|
||||
Uint8 default_size(magic_api * api, int which, int mode)
|
||||
|
||||
Return the default size the 'Magic' tool accepts. This will be the
|
||||
default setting for the tool the first time it is used during a
|
||||
Tux Paint session. If Tux Paint is being invoked with the sizing
|
||||
option disabled, this will be the only size requested by Tux
|
||||
Paint. Return a number between '1' and the amount you returned in
|
||||
accepted_sizes().
|
||||
Return the default size the 'Magic' tool accepts, in the given
|
||||
mode. This will be the default setting for the tool the first time
|
||||
it is used during a Tux Paint session. If Tux Paint is being
|
||||
invoked with the sizing option disabled, this will be the only
|
||||
size requested by Tux Paint. Return a number between '1' and the
|
||||
amount you returned in accepted_sizes().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
|
@ -405,7 +406,7 @@ Magic Tool Plugin API Documentation
|
|||
Note: Changed most recently in Tux Paint 0.9.29; Magic API version
|
||||
0x00000007.
|
||||
|
||||
void set_size(magic_api * api, int which, SDL_Surface * canvas,
|
||||
void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 size, SDL_Rect * update_rect)
|
||||
|
||||
Tux Paint will call this function to inform the plugin of the
|
||||
|
|
|
|||
|
|
@ -395,18 +395,18 @@
|
|||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 accepted_sizes(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return how many size variations the 'Magic' tool accepts. Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
Return how many size variations the 'Magic' tool accepts, in the given mode (i.e., '<code>MODE_PAINT</code>' or '<code>MODE_FULLSCREEN</code>). Return a '0' if the 'Magic' tool should not offer sizing options. Returning '1' is the same as returning '0'. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which)</b></code></dt>
|
||||
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Return the default size the 'Magic' tool accepts. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
Return the default size the 'Magic' tool accepts, in the given mode. This will be the default setting for the tool the first time it is used during a Tux Paint session. If Tux Paint is being invoked with the sizing option disabled, this will be the only size requested by Tux Paint. Return a number between '1' and the amount you returned in <code>accepted_sizes()</code>. </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p>
|
||||
</dd>
|
||||
|
|
@ -457,7 +457,7 @@
|
|||
<b>Note:</b> Changed most recently in Tux Paint 0.9.29; Magic API version 0x00000007. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>void set_size(magic_api * api, int which, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dt><code><b>void set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size, SDL_Rect * update_rect) </b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
Tux Paint will call this function to inform the plugin of the 'Magic' tool size option chosen. (It will be called whenever one of the plugin's Magic tools that accept sizes becomes active, and whenever the user picks a new size while such a tool is currently active.) </p>
|
||||
|
|
|
|||
|
|
@ -55,11 +55,11 @@ void blur_release(magic_api * api, int which, SDL_Surface * canvas,
|
|||
void blur_shutdown(magic_api * api);
|
||||
void blur_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
void blur_set_size(magic_api * api, int which, SDL_Surface * canvas,
|
||||
void blur_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 sz, SDL_Rect * update_rect);
|
||||
int blur_requires_colors(magic_api * api, int which);
|
||||
Uint8 blur_accepted_sizes(magic_api * api, int which);
|
||||
Uint8 blur_default_size(magic_api * api, int which);
|
||||
Uint8 blur_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 blur_default_size(magic_api * api, int which, int mode);
|
||||
void blur_switchin(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas);
|
||||
void blur_switchout(magic_api * api, int which, int mode,
|
||||
|
|
@ -319,7 +319,7 @@ void blur_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED
|
|||
}
|
||||
|
||||
// Record the size from Tux Paint:
|
||||
void blur_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||
void blur_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED,
|
||||
Uint8 sz, SDL_Rect * update_rect ATTRIBUTE_UNUSED) {
|
||||
blur_RADIUS = sz * 4;
|
||||
|
|
@ -333,11 +333,14 @@ int blur_requires_colors(magic_api * api ATTRIBUTE_UNUSED,
|
|||
}
|
||||
|
||||
|
||||
Uint8 blur_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) {
|
||||
Uint8 blur_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode) {
|
||||
if (mode == MODE_PAINT)
|
||||
return 8;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
Uint8 blur_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED) {
|
||||
Uint8 blur_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED) {
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,12 +83,13 @@ void kalidescope_release(magic_api * api, int which, SDL_Surface * canvas,
|
|||
SDL_Rect * update_rect);
|
||||
void kalidescope_shutdown(magic_api * api);
|
||||
int kalidescope_requires_colors(magic_api * api, int which);
|
||||
Uint8 kalidescope_accepted_sizes(magic_api * api, int which);
|
||||
Uint8 kalidescope_default_size(magic_api * api, int which);
|
||||
Uint8 kalidescope_accepted_sizes(magic_api * api, int which, int mode);
|
||||
Uint8 kalidescope_default_size(magic_api * api, int which, int mode);
|
||||
void kalidescope_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||
void kalidescope_set_size(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * last, Uint8 sz, SDL_Rect * update_rect);
|
||||
void kalidescope_set_size(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * last,
|
||||
Uint8 sz, SDL_Rect * update_rect);
|
||||
void kalidescope_switchin(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas);
|
||||
void kalidescope_switchout(magic_api * api, int which, int mode,
|
||||
|
|
@ -307,20 +308,21 @@ void kalidescope_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
|||
|
||||
// Use sizes:
|
||||
Uint8 kalidescope_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED)
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return KAL_MAX_SIZE;
|
||||
}
|
||||
|
||||
Uint8 kalidescope_default_size(magic_api * api ATTRIBUTE_UNUSED,
|
||||
int which ATTRIBUTE_UNUSED)
|
||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return KAL_DEF_SIZE;
|
||||
}
|
||||
|
||||
// Record the size from Tux Paint:
|
||||
void kalidescope_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED,
|
||||
SDL_Surface * last ATTRIBUTE_UNUSED, Uint8 sz, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
||||
void kalidescope_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||
SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED,
|
||||
Uint8 sz, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
||||
{
|
||||
kalidescope_sz = (sz * 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1567,11 +1567,11 @@ typedef struct magic_funcs_s
|
|||
SDL_Surface *(*get_icon)(magic_api *, int);
|
||||
char *(*get_description)(magic_api *, int, int);
|
||||
int (*requires_colors)(magic_api *, int);
|
||||
Uint8 (*accepted_sizes)(magic_api *, int);
|
||||
Uint8 (*default_size)(magic_api *, int);
|
||||
Uint8 (*accepted_sizes)(magic_api *, int, int);
|
||||
Uint8 (*default_size)(magic_api *, int, int);
|
||||
int (*modes)(magic_api *, int);
|
||||
void (*set_color)(magic_api *, int, SDL_Surface *, SDL_Surface *, Uint8, Uint8, Uint8, SDL_Rect *);
|
||||
void (*set_size)(magic_api *, int, SDL_Surface *, SDL_Surface *, Uint8, SDL_Rect *);
|
||||
void (*set_size)(magic_api *, int, int, SDL_Surface *, SDL_Surface *, Uint8, SDL_Rect *);
|
||||
int (*init)(magic_api *, Uint32);
|
||||
Uint32(*api_version) (void);
|
||||
void (*shutdown)(magic_api *);
|
||||
|
|
@ -1594,9 +1594,9 @@ typedef struct magic_s
|
|||
int mode; /* Current mode (paint or fullscreen) */
|
||||
int avail_modes; /* Available modes (paint &/or fullscreen) */
|
||||
int colors; /* Whether magic tool accepts colors */
|
||||
int sizes; /* Whether magic tool accepts sizes */
|
||||
int default_size; /* Magic tool's default size setting */
|
||||
int size; /* Magic tool's size setting */
|
||||
int sizes[MAX_MODES]; /* Whether magic tool accepts sizes */
|
||||
int default_size[MAX_MODES]; /* Magic tool's default size setting */
|
||||
int size[MAX_MODES]; /* Magic tool's size setting */
|
||||
int group; /* Which group of magic tools this lives in */
|
||||
char *name; /* Name of magic tool */
|
||||
char *tip[MAX_MODES]; /* Description of magic tool, in each possible mode */
|
||||
|
|
@ -4543,15 +4543,19 @@ static void mainloop(void)
|
|||
}
|
||||
playsound(screen, 0, SND_CLICK, 0, SNDPOS_CENTER, SNDDIST_NEAR);
|
||||
} else if (!disable_magic_sizes) {
|
||||
if (magics[grp][cur].sizes > 1) {
|
||||
int mode;
|
||||
|
||||
mode = magic_modeint(magics[grp][cur].mode);
|
||||
|
||||
if (magics[grp][cur].sizes[mode] > 1) {
|
||||
int old_size, new_size;
|
||||
|
||||
old_size = magics[grp][cur].size;
|
||||
old_size = magics[grp][cur].size[mode];
|
||||
|
||||
new_size = ((magics[grp][cur].sizes * (event.button.x - (WINDOW_WIDTH - r_ttoolopt.w))) / r_ttoolopt.w) + 1;
|
||||
new_size = ((magics[grp][cur].sizes[mode] * (event.button.x - (WINDOW_WIDTH - r_ttoolopt.w))) / r_ttoolopt.w) + 1;
|
||||
|
||||
if (new_size != old_size) {
|
||||
magics[grp][cur].size = new_size;
|
||||
magics[grp][cur].size[mode] = new_size;
|
||||
magic_set_size();
|
||||
|
||||
draw_magic();
|
||||
|
|
@ -10554,25 +10558,27 @@ static void draw_magic(void)
|
|||
|
||||
if (!disable_magic_sizes)
|
||||
{
|
||||
int grp, cur;
|
||||
int grp, cur, mode;
|
||||
|
||||
grp = magic_group;
|
||||
cur = cur_magic[magic_group];
|
||||
mode = magic_modeint(magics[grp][cur].mode);
|
||||
|
||||
if (magics[grp][cur].sizes > 1) {
|
||||
int i, xx, yy;
|
||||
if (magics[grp][cur].sizes[mode] > 1) {
|
||||
int i, xx, yy, sizes;
|
||||
float x_per, y_per;
|
||||
SDL_Surface * blnk, * btn;
|
||||
|
||||
x_per = (float) r_ttoolopt.w / (float) magics[grp][cur].sizes;
|
||||
y_per = (float) button_h / (float) (magics[grp][cur].sizes + 1);
|
||||
sizes = magics[grp][cur].sizes[mode];
|
||||
x_per = (float) r_ttoolopt.w / (float) sizes;
|
||||
y_per = (float) button_h / (float) (sizes + 1);
|
||||
|
||||
for (i = 1; i < magics[grp][cur].sizes + 1; i++)
|
||||
for (i = 1; i < sizes + 1; i++)
|
||||
{
|
||||
xx = ceil(x_per);
|
||||
yy = ceil(y_per * (float) i);
|
||||
|
||||
if (i <= magics[grp][cur].size)
|
||||
if (i <= magics[grp][cur].size[mode])
|
||||
btn = thumbnail(img_btn_down, xx, yy, 0);
|
||||
else
|
||||
btn = thumbnail(img_btn_up, xx, yy, 0);
|
||||
|
|
@ -22835,22 +22841,45 @@ static void load_magic_plugins(void)
|
|||
magics[group][idx].colors =
|
||||
magic_funcs[num_plugin_files].requires_colors
|
||||
(magic_api_struct, i);
|
||||
magics[group][idx].sizes =
|
||||
|
||||
for (j = 0; j < MAX_MODES; j++)
|
||||
{
|
||||
int mode_bit;
|
||||
|
||||
mode_bit = 0;
|
||||
|
||||
if (j == 1 && magics[group][idx].avail_modes & MODE_FULLSCREEN) {
|
||||
mode_bit = MODE_FULLSCREEN;
|
||||
} else {
|
||||
if (magics[group][idx].avail_modes & MODE_PAINT) {
|
||||
mode_bit = MODE_PAINT;
|
||||
} else if (magics[group][idx].avail_modes & MODE_ONECLICK) {
|
||||
mode_bit = MODE_ONECLICK;
|
||||
} else if (magics[group][idx].avail_modes & MODE_PAINT_WITH_PREVIEW) {
|
||||
mode_bit = MODE_PAINT_WITH_PREVIEW;
|
||||
}
|
||||
}
|
||||
|
||||
if (mode_bit != 0) {
|
||||
magics[group][idx].sizes[j] =
|
||||
magic_funcs[num_plugin_files].accepted_sizes
|
||||
(magic_api_struct, i);
|
||||
if (magic_funcs[num_plugin_files].accepted_sizes) {
|
||||
magics[group][idx].default_size =
|
||||
(magic_api_struct, i, mode_bit);
|
||||
if (magics[group][idx].sizes[j] > 1) {
|
||||
magics[group][idx].default_size[j] =
|
||||
magic_funcs[num_plugin_files].default_size
|
||||
(magic_api_struct, i);
|
||||
if (magics[group][idx].default_size < 1 ||
|
||||
magics[group][idx].default_size > magics[group][idx].sizes) {
|
||||
(magic_api_struct, i, mode_bit);
|
||||
if (magics[group][idx].default_size[j] < 1 ||
|
||||
magics[group][idx].default_size[j] > magics[group][idx].sizes[j]) {
|
||||
fprintf(stderr,
|
||||
"Warning: plugin %s mode # %d default size (%d) out of range (1-%d)\n",
|
||||
fname, i, magics[group][idx].default_size, magics[group][idx].sizes);
|
||||
magics[group][idx].default_size = 1;
|
||||
"Warning: plugin %s tool # %d for %d mode (%x) default size (%d) out of range (1-%d)\n",
|
||||
fname, i, j, mode_bit, magics[group][idx].default_size[j], magics[group][idx].sizes[j]);
|
||||
magics[group][idx].default_size[j] = 1;
|
||||
}
|
||||
magics[group][idx].size = magics[group][idx].default_size;
|
||||
magics[group][idx].size[j] = magics[group][idx].default_size[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (magics[group][idx].avail_modes & MODE_PAINT)
|
||||
magics[group][idx].mode = MODE_PAINT;
|
||||
else if (magics[group][idx].avail_modes & MODE_ONECLICK)
|
||||
|
|
@ -27249,9 +27278,10 @@ static void magic_set_size() {
|
|||
magic_funcs[magics[magic_group][cur_magic[magic_group]].handle_idx].
|
||||
set_size(magic_api_struct,
|
||||
magics[magic_group][cur_magic[magic_group]].idx,
|
||||
magics[magic_group][cur_magic[magic_group]].mode,
|
||||
canvas,
|
||||
last,
|
||||
magics[magic_group][cur_magic[magic_group]].size,
|
||||
magics[magic_group][cur_magic[magic_group]].size[magic_modeint(magics[magic_group][cur_magic[magic_group]].mode)],
|
||||
&update_rect);
|
||||
|
||||
if (update_rect.w > 0 && update_rect.h > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue