Sync docs & more info re: forthcoming Magic size feature
This commit is contained in:
parent
8cd00d279e
commit
84bfec3365
12 changed files with 233 additions and 10 deletions
|
|
@ -25,8 +25,12 @@ https://tuxpaint.org/
|
|||
* Improvements to Magic tools:
|
||||
----------------------------
|
||||
* WIP Support for sizes in Magic tools via the plugin API.
|
||||
WIP Adds a new UI element for setting sizes in the Magic tool.
|
||||
WIP May be disabled with the "nomagicsizes" option.
|
||||
Closes https://sourceforge.net/p/tuxpaint/feature-requests/220/
|
||||
Note: Bumps `TP_MAGIC_API_VERSION` to 0x00000008.
|
||||
WIP Plugins' "init()" functions are sent a new "disabled_features"
|
||||
argument containing bitmask of Magic-relevant disabled features.
|
||||
Bill Kendrick <bill@newbreedsoftware.com>
|
||||
|
||||
* Other Improvements:
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ Magic Tool Plugin API Documentation
|
|||
|
||||
Note: Called once by Tux Paint, at startup. It is called first.
|
||||
|
||||
int init(magic_api * api)
|
||||
int init(magic_api * api, Uint32 disabled_features)
|
||||
|
||||
The plugin should do any initialization here. Return '1' if
|
||||
initialization was successful, or '0' if not (and Tux Paint will
|
||||
|
|
@ -187,6 +187,21 @@ Magic Tool Plugin API Documentation
|
|||
"api_version()", if Tux Paint believes your plugin to be
|
||||
compatible.
|
||||
|
||||
The disabled_features value contains bits set for any Tux Paint
|
||||
features relevant to Magic tools which have been disabled in this
|
||||
session. Test using the C bitwise 'and' operator, '&'. The
|
||||
features are defined in tp_magic_api.h:
|
||||
* MAGIC_FEATURE_SIZE: Magic tool size (Magic tool size)
|
||||
Your Magic tool(s) may wish to react differently depending on
|
||||
whether one or more features have been disabled. (For example, the
|
||||
"Brick" Magic tool always offered two tool variations: large and
|
||||
small. With the addition of the size feature, only one tool is
|
||||
necessary. However, with the size option disabled, the plugin is
|
||||
able to revert back to providing two separate tools.)
|
||||
|
||||
Note: Changed most recently in Tux Paint 0.9.30; Magic API version
|
||||
0x00000008.
|
||||
|
||||
int get_tool_count(magic_api * api)
|
||||
|
||||
This should return the number of Magic tools this plugin provides
|
||||
|
|
@ -304,6 +319,18 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
int default_size(magic_api * api, int which)
|
||||
|
||||
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().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
void shutdown(magic_api * api)
|
||||
|
||||
The plugin should do any cleanup here. If you allocated any memory
|
||||
|
|
|
|||
|
|
@ -281,12 +281,20 @@
|
|||
<b>Note:</b> Called once by Tux Paint, at startup. It is called first. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int init(magic_api * api)</b></code></dt>
|
||||
<dt><code><b>int init(magic_api * api, Uint32 disabled_features)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
The plugin should do any initialization here. Return '1' if initialization was successful, or '0' if not (and Tux Paint will not present any 'Magic' tools from the plugin). </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once by Tux Paint, at startup. It is called after "<code>api_version()</code>", if Tux Paint believes your plugin to be compatible. </p>
|
||||
<p>
|
||||
The <code>disabled_features</code> value contains bits set for any Tux Paint features relevant to Magic tools which have been disabled in this session. Test using the C bitwise 'and' operator, '<code>&</code>'. The features are defined in <code>tp_magic_api.h</code>: <ul>
|
||||
<li>
|
||||
<code>MAGIC_FEATURE_SIZE</code>: Magic tool size (Magic tool size) </li>
|
||||
</ul>
|
||||
Your Magic tool(s) may wish to react differently depending on whether one or more features have been disabled. (For example, the "Brick" Magic tool always offered two tool variations: large and small. With the addition of the size feature, only one tool is necessary. However, with the size option disabled, the plugin is able to revert back to providing two separate tools.) </p>
|
||||
<p>
|
||||
<b>Note:</b> Changed most recently in Tux Paint 0.9.30; Magic API version 0x00000008. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int get_tool_count(magic_api * api)</b></code></dt>
|
||||
|
|
@ -393,6 +401,14 @@
|
|||
<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>int default_size(magic_api * api, int which)</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>
|
||||
<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>void shutdown(magic_api * api)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ Magic Tool Plugin API Documentation
|
|||
|
||||
Note: Called once by Tux Paint, at startup. It is called first.
|
||||
|
||||
int init(magic_api * api)
|
||||
int init(magic_api * api, Uint32 disabled_features)
|
||||
|
||||
The plugin should do any initialization here. Return '1' if
|
||||
initialization was successful, or '0' if not (and Tux Paint will
|
||||
|
|
@ -187,6 +187,21 @@ Magic Tool Plugin API Documentation
|
|||
"api_version()", if Tux Paint believes your plugin to be
|
||||
compatible.
|
||||
|
||||
The disabled_features value contains bits set for any Tux Paint
|
||||
features relevant to Magic tools which have been disabled in this
|
||||
session. Test using the C bitwise 'and' operator, '&'. The
|
||||
features are defined in tp_magic_api.h:
|
||||
* MAGIC_FEATURE_SIZE: Magic tool size (Magic tool size)
|
||||
Your Magic tool(s) may wish to react differently depending on
|
||||
whether one or more features have been disabled. (For example, the
|
||||
"Brick" Magic tool always offered two tool variations: large and
|
||||
small. With the addition of the size feature, only one tool is
|
||||
necessary. However, with the size option disabled, the plugin is
|
||||
able to revert back to providing two separate tools.)
|
||||
|
||||
Note: Changed most recently in Tux Paint 0.9.30; Magic API version
|
||||
0x00000008.
|
||||
|
||||
int get_tool_count(magic_api * api)
|
||||
|
||||
This should return the number of Magic tools this plugin provides
|
||||
|
|
@ -304,6 +319,18 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
int default_size(magic_api * api, int which)
|
||||
|
||||
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().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
void shutdown(magic_api * api)
|
||||
|
||||
The plugin should do any cleanup here. If you allocated any memory
|
||||
|
|
|
|||
|
|
@ -281,12 +281,20 @@
|
|||
<b>Note:</b> Called once by Tux Paint, at startup. It is called first. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int init(magic_api * api)</b></code></dt>
|
||||
<dt><code><b>int init(magic_api * api, Uint32 disabled_features)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
The plugin should do any initialization here. Return '1' if initialization was successful, or '0' if not (and Tux Paint will not present any 'Magic' tools from the plugin). </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once by Tux Paint, at startup. It is called after "<code>api_version()</code>", if Tux Paint believes your plugin to be compatible. </p>
|
||||
<p>
|
||||
The <code>disabled_features</code> value contains bits set for any Tux Paint features relevant to Magic tools which have been disabled in this session. Test using the C bitwise 'and' operator, '<code>&</code>'. The features are defined in <code>tp_magic_api.h</code>: <ul>
|
||||
<li>
|
||||
<code>MAGIC_FEATURE_SIZE</code>: Magic tool size (Magic tool size) </li>
|
||||
</ul>
|
||||
Your Magic tool(s) may wish to react differently depending on whether one or more features have been disabled. (For example, the "Brick" Magic tool always offered two tool variations: large and small. With the addition of the size feature, only one tool is necessary. However, with the size option disabled, the plugin is able to revert back to providing two separate tools.) </p>
|
||||
<p>
|
||||
<b>Note:</b> Changed most recently in Tux Paint 0.9.30; Magic API version 0x00000008. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int get_tool_count(magic_api * api)</b></code></dt>
|
||||
|
|
@ -393,6 +401,14 @@
|
|||
<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>int default_size(magic_api * api, int which)</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>
|
||||
<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>void shutdown(magic_api * api)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ Magic Tool Plugin API Documentation
|
|||
|
||||
Note: Called once by Tux Paint, at startup. It is called first.
|
||||
|
||||
int init(magic_api * api)
|
||||
int init(magic_api * api, Uint32 disabled_features)
|
||||
|
||||
The plugin should do any initialization here. Return '1' if
|
||||
initialization was successful, or '0' if not (and Tux Paint will
|
||||
|
|
@ -187,6 +187,21 @@ Magic Tool Plugin API Documentation
|
|||
"api_version()", if Tux Paint believes your plugin to be
|
||||
compatible.
|
||||
|
||||
The disabled_features value contains bits set for any Tux Paint
|
||||
features relevant to Magic tools which have been disabled in this
|
||||
session. Test using the C bitwise 'and' operator, '&'. The
|
||||
features are defined in tp_magic_api.h:
|
||||
* MAGIC_FEATURE_SIZE: Magic tool size (Magic tool size)
|
||||
Your Magic tool(s) may wish to react differently depending on
|
||||
whether one or more features have been disabled. (For example, the
|
||||
"Brick" Magic tool always offered two tool variations: large and
|
||||
small. With the addition of the size feature, only one tool is
|
||||
necessary. However, with the size option disabled, the plugin is
|
||||
able to revert back to providing two separate tools.)
|
||||
|
||||
Note: Changed most recently in Tux Paint 0.9.30; Magic API version
|
||||
0x00000008.
|
||||
|
||||
int get_tool_count(magic_api * api)
|
||||
|
||||
This should return the number of Magic tools this plugin provides
|
||||
|
|
@ -304,6 +319,18 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
int default_size(magic_api * api, int which)
|
||||
|
||||
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().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
void shutdown(magic_api * api)
|
||||
|
||||
The plugin should do any cleanup here. If you allocated any memory
|
||||
|
|
|
|||
|
|
@ -281,12 +281,20 @@
|
|||
<b>Note:</b> Called once by Tux Paint, at startup. It is called first. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int init(magic_api * api)</b></code></dt>
|
||||
<dt><code><b>int init(magic_api * api, Uint32 disabled_features)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
The plugin should do any initialization here. Return '1' if initialization was successful, or '0' if not (and Tux Paint will not present any 'Magic' tools from the plugin). </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once by Tux Paint, at startup. It is called after "<code>api_version()</code>", if Tux Paint believes your plugin to be compatible. </p>
|
||||
<p>
|
||||
The <code>disabled_features</code> value contains bits set for any Tux Paint features relevant to Magic tools which have been disabled in this session. Test using the C bitwise 'and' operator, '<code>&</code>'. The features are defined in <code>tp_magic_api.h</code>: <ul>
|
||||
<li>
|
||||
<code>MAGIC_FEATURE_SIZE</code>: Magic tool size (Magic tool size) </li>
|
||||
</ul>
|
||||
Your Magic tool(s) may wish to react differently depending on whether one or more features have been disabled. (For example, the "Brick" Magic tool always offered two tool variations: large and small. With the addition of the size feature, only one tool is necessary. However, with the size option disabled, the plugin is able to revert back to providing two separate tools.) </p>
|
||||
<p>
|
||||
<b>Note:</b> Changed most recently in Tux Paint 0.9.30; Magic API version 0x00000008. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int get_tool_count(magic_api * api)</b></code></dt>
|
||||
|
|
@ -393,6 +401,14 @@
|
|||
<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>int default_size(magic_api * api, int which)</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>
|
||||
<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>void shutdown(magic_api * api)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ Magic Tool Plugin API Documentation
|
|||
|
||||
Note: Called once by Tux Paint, at startup. It is called first.
|
||||
|
||||
int init(magic_api * api)
|
||||
int init(magic_api * api, Uint32 disabled_features)
|
||||
|
||||
The plugin should do any initialization here. Return '1' if
|
||||
initialization was successful, or '0' if not (and Tux Paint will
|
||||
|
|
@ -187,6 +187,21 @@ Magic Tool Plugin API Documentation
|
|||
"api_version()", if Tux Paint believes your plugin to be
|
||||
compatible.
|
||||
|
||||
The disabled_features value contains bits set for any Tux Paint
|
||||
features relevant to Magic tools which have been disabled in this
|
||||
session. Test using the C bitwise 'and' operator, '&'. The
|
||||
features are defined in tp_magic_api.h:
|
||||
* MAGIC_FEATURE_SIZE: Magic tool size (Magic tool size)
|
||||
Your Magic tool(s) may wish to react differently depending on
|
||||
whether one or more features have been disabled. (For example, the
|
||||
"Brick" Magic tool always offered two tool variations: large and
|
||||
small. With the addition of the size feature, only one tool is
|
||||
necessary. However, with the size option disabled, the plugin is
|
||||
able to revert back to providing two separate tools.)
|
||||
|
||||
Note: Changed most recently in Tux Paint 0.9.30; Magic API version
|
||||
0x00000008.
|
||||
|
||||
int get_tool_count(magic_api * api)
|
||||
|
||||
This should return the number of Magic tools this plugin provides
|
||||
|
|
@ -304,6 +319,18 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
int default_size(magic_api * api, int which)
|
||||
|
||||
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().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
void shutdown(magic_api * api)
|
||||
|
||||
The plugin should do any cleanup here. If you allocated any memory
|
||||
|
|
|
|||
|
|
@ -281,12 +281,20 @@
|
|||
<b>Note:</b> Called once by Tux Paint, at startup. It is called first. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int init(magic_api * api)</b></code></dt>
|
||||
<dt><code><b>int init(magic_api * api, Uint32 disabled_features)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
The plugin should do any initialization here. Return '1' if initialization was successful, or '0' if not (and Tux Paint will not present any 'Magic' tools from the plugin). </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once by Tux Paint, at startup. It is called after "<code>api_version()</code>", if Tux Paint believes your plugin to be compatible. </p>
|
||||
<p>
|
||||
The <code>disabled_features</code> value contains bits set for any Tux Paint features relevant to Magic tools which have been disabled in this session. Test using the C bitwise 'and' operator, '<code>&</code>'. The features are defined in <code>tp_magic_api.h</code>: <ul>
|
||||
<li>
|
||||
<code>MAGIC_FEATURE_SIZE</code>: Magic tool size (Magic tool size) </li>
|
||||
</ul>
|
||||
Your Magic tool(s) may wish to react differently depending on whether one or more features have been disabled. (For example, the "Brick" Magic tool always offered two tool variations: large and small. With the addition of the size feature, only one tool is necessary. However, with the size option disabled, the plugin is able to revert back to providing two separate tools.) </p>
|
||||
<p>
|
||||
<b>Note:</b> Changed most recently in Tux Paint 0.9.30; Magic API version 0x00000008. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int get_tool_count(magic_api * api)</b></code></dt>
|
||||
|
|
@ -393,6 +401,14 @@
|
|||
<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>int default_size(magic_api * api, int which)</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>
|
||||
<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>void shutdown(magic_api * api)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ Magic Tool Plugin API Documentation
|
|||
|
||||
Note: Called once by Tux Paint, at startup. It is called first.
|
||||
|
||||
int init(magic_api * api)
|
||||
int init(magic_api * api, Uint32 disabled_features)
|
||||
|
||||
The plugin should do any initialization here. Return '1' if
|
||||
initialization was successful, or '0' if not (and Tux Paint will
|
||||
|
|
@ -187,6 +187,21 @@ Magic Tool Plugin API Documentation
|
|||
"api_version()", if Tux Paint believes your plugin to be
|
||||
compatible.
|
||||
|
||||
The disabled_features value contains bits set for any Tux Paint
|
||||
features relevant to Magic tools which have been disabled in this
|
||||
session. Test using the C bitwise 'and' operator, '&'. The
|
||||
features are defined in tp_magic_api.h:
|
||||
* MAGIC_FEATURE_SIZE: Magic tool size (Magic tool size)
|
||||
Your Magic tool(s) may wish to react differently depending on
|
||||
whether one or more features have been disabled. (For example, the
|
||||
"Brick" Magic tool always offered two tool variations: large and
|
||||
small. With the addition of the size feature, only one tool is
|
||||
necessary. However, with the size option disabled, the plugin is
|
||||
able to revert back to providing two separate tools.)
|
||||
|
||||
Note: Changed most recently in Tux Paint 0.9.30; Magic API version
|
||||
0x00000008.
|
||||
|
||||
int get_tool_count(magic_api * api)
|
||||
|
||||
This should return the number of Magic tools this plugin provides
|
||||
|
|
@ -304,6 +319,18 @@ Magic Tool Plugin API Documentation
|
|||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
int default_size(magic_api * api, int which)
|
||||
|
||||
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().
|
||||
|
||||
Note: Called once for each Magic tool your plugin claims to
|
||||
contain (by your "get_tool_count()").
|
||||
|
||||
void shutdown(magic_api * api)
|
||||
|
||||
The plugin should do any cleanup here. If you allocated any memory
|
||||
|
|
|
|||
|
|
@ -281,12 +281,20 @@
|
|||
<b>Note:</b> Called once by Tux Paint, at startup. It is called first. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int init(magic_api * api)</b></code></dt>
|
||||
<dt><code><b>int init(magic_api * api, Uint32 disabled_features)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
The plugin should do any initialization here. Return '1' if initialization was successful, or '0' if not (and Tux Paint will not present any 'Magic' tools from the plugin). </p>
|
||||
<p>
|
||||
<b>Note:</b> Called once by Tux Paint, at startup. It is called after "<code>api_version()</code>", if Tux Paint believes your plugin to be compatible. </p>
|
||||
<p>
|
||||
The <code>disabled_features</code> value contains bits set for any Tux Paint features relevant to Magic tools which have been disabled in this session. Test using the C bitwise 'and' operator, '<code>&</code>'. The features are defined in <code>tp_magic_api.h</code>: <ul>
|
||||
<li>
|
||||
<code>MAGIC_FEATURE_SIZE</code>: Magic tool size (Magic tool size) </li>
|
||||
</ul>
|
||||
Your Magic tool(s) may wish to react differently depending on whether one or more features have been disabled. (For example, the "Brick" Magic tool always offered two tool variations: large and small. With the addition of the size feature, only one tool is necessary. However, with the size option disabled, the plugin is able to revert back to providing two separate tools.) </p>
|
||||
<p>
|
||||
<b>Note:</b> Changed most recently in Tux Paint 0.9.30; Magic API version 0x00000008. </p>
|
||||
</dd>
|
||||
|
||||
<dt><code><b>int get_tool_count(magic_api * api)</b></code></dt>
|
||||
|
|
@ -393,6 +401,14 @@
|
|||
<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>int default_size(magic_api * api, int which)</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>
|
||||
<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>void shutdown(magic_api * api)</b></code></dt>
|
||||
<dd>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -184,5 +184,9 @@ enum {
|
|||
MAGIC_TYPE_ARTISTIC
|
||||
};
|
||||
|
||||
/* Magic-relevant Tux Paint features (which may be reported as disabled) */
|
||||
|
||||
#define MAGIC_FEATURE_SIZE 0x00000001
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue