Sync MAGIC-API after some tweaks

This commit is contained in:
Bill Kendrick 2023-04-19 14:53:35 -07:00
parent a0b720b3ad
commit a0bb47d9da
10 changed files with 225 additions and 90 deletions

View file

@ -212,6 +212,10 @@ Magic Tool Plugin API Documentation
Note: Called once by Tux Paint, at startup. It is called after Note: Called once by Tux Paint, at startup. It is called after
your "init()", if it succeeded. your "init()", if it succeeded.
Note: You may wish to resond differently, based on whether certain
features have been disabled (e.g., 'paint' versus 'entire picture'
controls, or 'Magic sizes' controls).
int modes(magic_api * api, int which) int modes(magic_api * api, int which)
This lets you tell Tux Paint what modes your tool can be used in; This lets you tell Tux Paint what modes your tool can be used in;
@ -319,20 +323,28 @@ Magic Tool Plugin API Documentation
if the 'Magic' tool should not offer sizing options. Returning '1' if the 'Magic' tool should not offer sizing options. Returning '1'
is the same as returning '0'. is the same as returning '0'.
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
Uint8 default_size(magic_api * api, int which, int mode) Uint8 default_size(magic_api * api, int which, int mode)
Return the default size the 'Magic' tool accepts, in the given Return the default size the 'Magic' tool should start out with, in
mode. This will be the default setting for the tool the first time the given mode. This will be the default setting for the tool the
it is used during a Tux Paint session. If Tux Paint is being first time it is used during a Tux Paint session. If Tux Paint is
invoked with the sizing option disabled, this will be the only being invoked with the sizing option disabled, this will be the
size requested by Tux Paint. Return a number between '1' and the only size requested by Tux Paint. Return a number between '1' and
amount you returned in accepted_sizes(). the amount you returned in accepted_sizes().
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
void shutdown(magic_api * api) void shutdown(magic_api * api)
@ -1029,10 +1041,16 @@ macOS
* alpha: See "RGBA" * alpha: See "RGBA"
* &: See "ampersand" * &: See "ampersand"
* ampersand: "&". A symbol in C that allows you to refer to the memory * ampersand (pointers): "&". A symbol in C that allows you to refer to
address of a variable; that is, a pointer. (For example, consider "int the memory address of a variable; that is, a pointer. (For example,
i;". Later, "&i" refers to the memory where "i" is stored, not the consider "int i;". Later, "&i" refers to the memory where "i" is
value of "i" itself; it is a 'pointer to "i"'.) See also: "star" stored, not the value of "i" itself; it is a 'pointer to "i"'.) See
also: "star"
* ampersand (bitwise operator): "&". A symbol in C that acts as a
bitwise "and" operator. Only bits set in both values will be returned.
For example, "11 & 6" compares the binary values '1011' to '0110'.
Only the bit in the 2's place is set, so the result is 2 ('0010'). See
also: "bit"
* API: Application Programming Interface. TBD * API: Application Programming Interface. TBD
* argument: A value sent to a function. * argument: A value sent to a function.
* arrow: "->". A symbol in C that references an element within a pointer * arrow: "->". A symbol in C that references an element within a pointer

View file

@ -305,6 +305,8 @@
This should return the number of Magic tools this plugin provides to Tux Paint. </p> This should return the number of Magic tools this plugin provides to Tux Paint. </p>
<p> <p>
<b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p> <b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p>
<p>
<b>Note:</b> You may wish to resond differently, based on whether certain features have been disabled (e.g., 'paint' versus 'entire picture' controls, or 'Magic sizes' controls). </p>
</dd> </dd>
<dt><code><b>int modes(magic_api * api, int which)</b></code></dt> <dt><code><b>int modes(magic_api * api, int which)</b></code></dt>
@ -400,15 +402,19 @@
<p> <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> 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt> <dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
<dd> <dd>
<p> <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> Return the default size the 'Magic' tool should start out with, 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>void shutdown(magic_api * api)</b></code></dt> <dt><code><b>void shutdown(magic_api * api)</b></code></dt>
@ -1141,8 +1147,11 @@
<b><code>&amp;</code>:</b> <b><code>&amp;</code>:</b>
See "ampersand" </li> See "ampersand" </li>
<li> <li>
<b>ampersand:</b> <b>ampersand (pointers):</b>
"<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li> "<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li>
<li>
<b>ampersand (bitwise operator):</b>
"<code>&amp;</code>". A symbol in C that acts as a bitwise "and" operator. Only bits set in both values will be returned. For example, "<code>11 &amp; 6</code>" compares the binary values '1011' to '0110'. Only the bit in the 2's place is set, so the result is <code>2</code> ('0010'). See also: "bit" </li>
<li> <li>
<b>API:</b> <b>API:</b>
Application Programming Interface. <i>TBD</i> Application Programming Interface. <i>TBD</i>

View file

@ -212,6 +212,10 @@ Magic Tool Plugin API Documentation
Note: Called once by Tux Paint, at startup. It is called after Note: Called once by Tux Paint, at startup. It is called after
your "init()", if it succeeded. your "init()", if it succeeded.
Note: You may wish to resond differently, based on whether certain
features have been disabled (e.g., 'paint' versus 'entire picture'
controls, or 'Magic sizes' controls).
int modes(magic_api * api, int which) int modes(magic_api * api, int which)
This lets you tell Tux Paint what modes your tool can be used in; This lets you tell Tux Paint what modes your tool can be used in;
@ -319,20 +323,28 @@ Magic Tool Plugin API Documentation
if the 'Magic' tool should not offer sizing options. Returning '1' if the 'Magic' tool should not offer sizing options. Returning '1'
is the same as returning '0'. is the same as returning '0'.
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
Uint8 default_size(magic_api * api, int which, int mode) Uint8 default_size(magic_api * api, int which, int mode)
Return the default size the 'Magic' tool accepts, in the given Return the default size the 'Magic' tool should start out with, in
mode. This will be the default setting for the tool the first time the given mode. This will be the default setting for the tool the
it is used during a Tux Paint session. If Tux Paint is being first time it is used during a Tux Paint session. If Tux Paint is
invoked with the sizing option disabled, this will be the only being invoked with the sizing option disabled, this will be the
size requested by Tux Paint. Return a number between '1' and the only size requested by Tux Paint. Return a number between '1' and
amount you returned in accepted_sizes(). the amount you returned in accepted_sizes().
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
void shutdown(magic_api * api) void shutdown(magic_api * api)
@ -1029,10 +1041,16 @@ macOS
* alpha: See "RGBA" * alpha: See "RGBA"
* &: See "ampersand" * &: See "ampersand"
* ampersand: "&". A symbol in C that allows you to refer to the memory * ampersand (pointers): "&". A symbol in C that allows you to refer to
address of a variable; that is, a pointer. (For example, consider "int the memory address of a variable; that is, a pointer. (For example,
i;". Later, "&i" refers to the memory where "i" is stored, not the consider "int i;". Later, "&i" refers to the memory where "i" is
value of "i" itself; it is a 'pointer to "i"'.) See also: "star" stored, not the value of "i" itself; it is a 'pointer to "i"'.) See
also: "star"
* ampersand (bitwise operator): "&". A symbol in C that acts as a
bitwise "and" operator. Only bits set in both values will be returned.
For example, "11 & 6" compares the binary values '1011' to '0110'.
Only the bit in the 2's place is set, so the result is 2 ('0010'). See
also: "bit"
* API: Application Programming Interface. TBD * API: Application Programming Interface. TBD
* argument: A value sent to a function. * argument: A value sent to a function.
* arrow: "->". A symbol in C that references an element within a pointer * arrow: "->". A symbol in C that references an element within a pointer

View file

@ -305,6 +305,8 @@
This should return the number of Magic tools this plugin provides to Tux Paint. </p> This should return the number of Magic tools this plugin provides to Tux Paint. </p>
<p> <p>
<b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p> <b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p>
<p>
<b>Note:</b> You may wish to resond differently, based on whether certain features have been disabled (e.g., 'paint' versus 'entire picture' controls, or 'Magic sizes' controls). </p>
</dd> </dd>
<dt><code><b>int modes(magic_api * api, int which)</b></code></dt> <dt><code><b>int modes(magic_api * api, int which)</b></code></dt>
@ -400,15 +402,19 @@
<p> <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> 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt> <dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
<dd> <dd>
<p> <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> Return the default size the 'Magic' tool should start out with, 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>void shutdown(magic_api * api)</b></code></dt> <dt><code><b>void shutdown(magic_api * api)</b></code></dt>
@ -1141,8 +1147,11 @@
<b><code>&amp;</code>:</b> <b><code>&amp;</code>:</b>
See "ampersand" </li> See "ampersand" </li>
<li> <li>
<b>ampersand:</b> <b>ampersand (pointers):</b>
"<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li> "<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li>
<li>
<b>ampersand (bitwise operator):</b>
"<code>&amp;</code>". A symbol in C that acts as a bitwise "and" operator. Only bits set in both values will be returned. For example, "<code>11 &amp; 6</code>" compares the binary values '1011' to '0110'. Only the bit in the 2's place is set, so the result is <code>2</code> ('0010'). See also: "bit" </li>
<li> <li>
<b>API:</b> <b>API:</b>
Application Programming Interface. <i>TBD</i> Application Programming Interface. <i>TBD</i>

View file

@ -212,6 +212,10 @@ Magic Tool Plugin API Documentation
Note: Called once by Tux Paint, at startup. It is called after Note: Called once by Tux Paint, at startup. It is called after
your "init()", if it succeeded. your "init()", if it succeeded.
Note: You may wish to resond differently, based on whether certain
features have been disabled (e.g., 'paint' versus 'entire picture'
controls, or 'Magic sizes' controls).
int modes(magic_api * api, int which) int modes(magic_api * api, int which)
This lets you tell Tux Paint what modes your tool can be used in; This lets you tell Tux Paint what modes your tool can be used in;
@ -319,20 +323,28 @@ Magic Tool Plugin API Documentation
if the 'Magic' tool should not offer sizing options. Returning '1' if the 'Magic' tool should not offer sizing options. Returning '1'
is the same as returning '0'. is the same as returning '0'.
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
Uint8 default_size(magic_api * api, int which, int mode) Uint8 default_size(magic_api * api, int which, int mode)
Return the default size the 'Magic' tool accepts, in the given Return the default size the 'Magic' tool should start out with, in
mode. This will be the default setting for the tool the first time the given mode. This will be the default setting for the tool the
it is used during a Tux Paint session. If Tux Paint is being first time it is used during a Tux Paint session. If Tux Paint is
invoked with the sizing option disabled, this will be the only being invoked with the sizing option disabled, this will be the
size requested by Tux Paint. Return a number between '1' and the only size requested by Tux Paint. Return a number between '1' and
amount you returned in accepted_sizes(). the amount you returned in accepted_sizes().
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
void shutdown(magic_api * api) void shutdown(magic_api * api)
@ -1029,10 +1041,16 @@ macOS
* alpha: See "RGBA" * alpha: See "RGBA"
* &: See "ampersand" * &: See "ampersand"
* ampersand: "&". A symbol in C that allows you to refer to the memory * ampersand (pointers): "&". A symbol in C that allows you to refer to
address of a variable; that is, a pointer. (For example, consider "int the memory address of a variable; that is, a pointer. (For example,
i;". Later, "&i" refers to the memory where "i" is stored, not the consider "int i;". Later, "&i" refers to the memory where "i" is
value of "i" itself; it is a 'pointer to "i"'.) See also: "star" stored, not the value of "i" itself; it is a 'pointer to "i"'.) See
also: "star"
* ampersand (bitwise operator): "&". A symbol in C that acts as a
bitwise "and" operator. Only bits set in both values will be returned.
For example, "11 & 6" compares the binary values '1011' to '0110'.
Only the bit in the 2's place is set, so the result is 2 ('0010'). See
also: "bit"
* API: Application Programming Interface. TBD * API: Application Programming Interface. TBD
* argument: A value sent to a function. * argument: A value sent to a function.
* arrow: "->". A symbol in C that references an element within a pointer * arrow: "->". A symbol in C that references an element within a pointer

View file

@ -305,6 +305,8 @@
This should return the number of Magic tools this plugin provides to Tux Paint. </p> This should return the number of Magic tools this plugin provides to Tux Paint. </p>
<p> <p>
<b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p> <b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p>
<p>
<b>Note:</b> You may wish to resond differently, based on whether certain features have been disabled (e.g., 'paint' versus 'entire picture' controls, or 'Magic sizes' controls). </p>
</dd> </dd>
<dt><code><b>int modes(magic_api * api, int which)</b></code></dt> <dt><code><b>int modes(magic_api * api, int which)</b></code></dt>
@ -400,15 +402,19 @@
<p> <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> 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt> <dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
<dd> <dd>
<p> <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> Return the default size the 'Magic' tool should start out with, 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>void shutdown(magic_api * api)</b></code></dt> <dt><code><b>void shutdown(magic_api * api)</b></code></dt>
@ -1141,8 +1147,11 @@
<b><code>&amp;</code>:</b> <b><code>&amp;</code>:</b>
See "ampersand" </li> See "ampersand" </li>
<li> <li>
<b>ampersand:</b> <b>ampersand (pointers):</b>
"<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li> "<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li>
<li>
<b>ampersand (bitwise operator):</b>
"<code>&amp;</code>". A symbol in C that acts as a bitwise "and" operator. Only bits set in both values will be returned. For example, "<code>11 &amp; 6</code>" compares the binary values '1011' to '0110'. Only the bit in the 2's place is set, so the result is <code>2</code> ('0010'). See also: "bit" </li>
<li> <li>
<b>API:</b> <b>API:</b>
Application Programming Interface. <i>TBD</i> Application Programming Interface. <i>TBD</i>

View file

@ -212,6 +212,10 @@ Magic Tool Plugin API Documentation
Note: Called once by Tux Paint, at startup. It is called after Note: Called once by Tux Paint, at startup. It is called after
your "init()", if it succeeded. your "init()", if it succeeded.
Note: You may wish to resond differently, based on whether certain
features have been disabled (e.g., 'paint' versus 'entire picture'
controls, or 'Magic sizes' controls).
int modes(magic_api * api, int which) int modes(magic_api * api, int which)
This lets you tell Tux Paint what modes your tool can be used in; This lets you tell Tux Paint what modes your tool can be used in;
@ -319,20 +323,28 @@ Magic Tool Plugin API Documentation
if the 'Magic' tool should not offer sizing options. Returning '1' if the 'Magic' tool should not offer sizing options. Returning '1'
is the same as returning '0'. is the same as returning '0'.
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
Uint8 default_size(magic_api * api, int which, int mode) Uint8 default_size(magic_api * api, int which, int mode)
Return the default size the 'Magic' tool accepts, in the given Return the default size the 'Magic' tool should start out with, in
mode. This will be the default setting for the tool the first time the given mode. This will be the default setting for the tool the
it is used during a Tux Paint session. If Tux Paint is being first time it is used during a Tux Paint session. If Tux Paint is
invoked with the sizing option disabled, this will be the only being invoked with the sizing option disabled, this will be the
size requested by Tux Paint. Return a number between '1' and the only size requested by Tux Paint. Return a number between '1' and
amount you returned in accepted_sizes(). the amount you returned in accepted_sizes().
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
void shutdown(magic_api * api) void shutdown(magic_api * api)
@ -1029,10 +1041,16 @@ macOS
* alpha: See "RGBA" * alpha: See "RGBA"
* &: See "ampersand" * &: See "ampersand"
* ampersand: "&". A symbol in C that allows you to refer to the memory * ampersand (pointers): "&". A symbol in C that allows you to refer to
address of a variable; that is, a pointer. (For example, consider "int the memory address of a variable; that is, a pointer. (For example,
i;". Later, "&i" refers to the memory where "i" is stored, not the consider "int i;". Later, "&i" refers to the memory where "i" is
value of "i" itself; it is a 'pointer to "i"'.) See also: "star" stored, not the value of "i" itself; it is a 'pointer to "i"'.) See
also: "star"
* ampersand (bitwise operator): "&". A symbol in C that acts as a
bitwise "and" operator. Only bits set in both values will be returned.
For example, "11 & 6" compares the binary values '1011' to '0110'.
Only the bit in the 2's place is set, so the result is 2 ('0010'). See
also: "bit"
* API: Application Programming Interface. TBD * API: Application Programming Interface. TBD
* argument: A value sent to a function. * argument: A value sent to a function.
* arrow: "->". A symbol in C that references an element within a pointer * arrow: "->". A symbol in C that references an element within a pointer

View file

@ -305,6 +305,8 @@
This should return the number of Magic tools this plugin provides to Tux Paint. </p> This should return the number of Magic tools this plugin provides to Tux Paint. </p>
<p> <p>
<b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p> <b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p>
<p>
<b>Note:</b> You may wish to resond differently, based on whether certain features have been disabled (e.g., 'paint' versus 'entire picture' controls, or 'Magic sizes' controls). </p>
</dd> </dd>
<dt><code><b>int modes(magic_api * api, int which)</b></code></dt> <dt><code><b>int modes(magic_api * api, int which)</b></code></dt>
@ -400,15 +402,19 @@
<p> <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> 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt> <dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
<dd> <dd>
<p> <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> Return the default size the 'Magic' tool should start out with, 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>void shutdown(magic_api * api)</b></code></dt> <dt><code><b>void shutdown(magic_api * api)</b></code></dt>
@ -1141,8 +1147,11 @@
<b><code>&amp;</code>:</b> <b><code>&amp;</code>:</b>
See "ampersand" </li> See "ampersand" </li>
<li> <li>
<b>ampersand:</b> <b>ampersand (pointers):</b>
"<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li> "<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li>
<li>
<b>ampersand (bitwise operator):</b>
"<code>&amp;</code>". A symbol in C that acts as a bitwise "and" operator. Only bits set in both values will be returned. For example, "<code>11 &amp; 6</code>" compares the binary values '1011' to '0110'. Only the bit in the 2's place is set, so the result is <code>2</code> ('0010'). See also: "bit" </li>
<li> <li>
<b>API:</b> <b>API:</b>
Application Programming Interface. <i>TBD</i> Application Programming Interface. <i>TBD</i>

View file

@ -212,6 +212,10 @@ Magic Tool Plugin API Documentation
Note: Called once by Tux Paint, at startup. It is called after Note: Called once by Tux Paint, at startup. It is called after
your "init()", if it succeeded. your "init()", if it succeeded.
Note: You may wish to resond differently, based on whether certain
features have been disabled (e.g., 'paint' versus 'entire picture'
controls, or 'Magic sizes' controls).
int modes(magic_api * api, int which) int modes(magic_api * api, int which)
This lets you tell Tux Paint what modes your tool can be used in; This lets you tell Tux Paint what modes your tool can be used in;
@ -319,20 +323,28 @@ Magic Tool Plugin API Documentation
if the 'Magic' tool should not offer sizing options. Returning '1' if the 'Magic' tool should not offer sizing options. Returning '1'
is the same as returning '0'. is the same as returning '0'.
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
Uint8 default_size(magic_api * api, int which, int mode) Uint8 default_size(magic_api * api, int which, int mode)
Return the default size the 'Magic' tool accepts, in the given Return the default size the 'Magic' tool should start out with, in
mode. This will be the default setting for the tool the first time the given mode. This will be the default setting for the tool the
it is used during a Tux Paint session. If Tux Paint is being first time it is used during a Tux Paint session. If Tux Paint is
invoked with the sizing option disabled, this will be the only being invoked with the sizing option disabled, this will be the
size requested by Tux Paint. Return a number between '1' and the only size requested by Tux Paint. Return a number between '1' and
amount you returned in accepted_sizes(). the amount you returned in accepted_sizes().
Note: Called once for each Magic tool your plugin claims to Note: For each Magic tool your plugin claims to contain (reported
contain (by your "get_tool_count()"). by your "get_tool_count()" function), this function will be called
for each mode the tool claims to support (reported by your
"modes()" function).
Note: Added to Tux Paint 0.9.30; Magic API version 0x00000008.
void shutdown(magic_api * api) void shutdown(magic_api * api)
@ -1029,10 +1041,16 @@ macOS
* alpha: See "RGBA" * alpha: See "RGBA"
* &: See "ampersand" * &: See "ampersand"
* ampersand: "&". A symbol in C that allows you to refer to the memory * ampersand (pointers): "&". A symbol in C that allows you to refer to
address of a variable; that is, a pointer. (For example, consider "int the memory address of a variable; that is, a pointer. (For example,
i;". Later, "&i" refers to the memory where "i" is stored, not the consider "int i;". Later, "&i" refers to the memory where "i" is
value of "i" itself; it is a 'pointer to "i"'.) See also: "star" stored, not the value of "i" itself; it is a 'pointer to "i"'.) See
also: "star"
* ampersand (bitwise operator): "&". A symbol in C that acts as a
bitwise "and" operator. Only bits set in both values will be returned.
For example, "11 & 6" compares the binary values '1011' to '0110'.
Only the bit in the 2's place is set, so the result is 2 ('0010'). See
also: "bit"
* API: Application Programming Interface. TBD * API: Application Programming Interface. TBD
* argument: A value sent to a function. * argument: A value sent to a function.
* arrow: "->". A symbol in C that references an element within a pointer * arrow: "->". A symbol in C that references an element within a pointer

View file

@ -305,6 +305,8 @@
This should return the number of Magic tools this plugin provides to Tux Paint. </p> This should return the number of Magic tools this plugin provides to Tux Paint. </p>
<p> <p>
<b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p> <b>Note:</b> Called once by Tux Paint, at startup. It is called after your "<code>init()</code>", if it succeeded. </p>
<p>
<b>Note:</b> You may wish to resond differently, based on whether certain features have been disabled (e.g., 'paint' versus 'entire picture' controls, or 'Magic sizes' controls). </p>
</dd> </dd>
<dt><code><b>int modes(magic_api * api, int which)</b></code></dt> <dt><code><b>int modes(magic_api * api, int which)</b></code></dt>
@ -400,15 +402,19 @@
<p> <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> 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt> <dt><code><b>Uint8 default_size(magic_api * api, int which, int mode)</b></code></dt>
<dd> <dd>
<p> <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> Return the default size the 'Magic' tool should start out with, 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> <p>
<b>Note:</b> Called once for each Magic tool your plugin claims to contain (by your "<code>get_tool_count()</code>"). </p> <b>Note:</b> For each Magic tool your plugin claims to contain (reported by your "<code>get_tool_count()</code>" function), this function will be called for each mode the tool claims to support (reported by your "<code>modes()</code>" function). </p>
<p>
<b>Note:</b> Added to Tux Paint 0.9.30; Magic API version 0x00000008. </p>
</dd> </dd>
<dt><code><b>void shutdown(magic_api * api)</b></code></dt> <dt><code><b>void shutdown(magic_api * api)</b></code></dt>
@ -1141,8 +1147,11 @@
<b><code>&amp;</code>:</b> <b><code>&amp;</code>:</b>
See "ampersand" </li> See "ampersand" </li>
<li> <li>
<b>ampersand:</b> <b>ampersand (pointers):</b>
"<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li> "<code>&amp;</code>". A symbol in C that allows you to refer to the memory address of a variable; that is, a pointer. (For example, consider "<code>int i;</code>". Later, "<code>&amp;i</code>" refers to the memory where "<code>i</code>" is stored, not the value of "<code>i</code>" itself; it is a 'pointer to "<code>i</code>"'.) See also: "star" </li>
<li>
<b>ampersand (bitwise operator):</b>
"<code>&amp;</code>". A symbol in C that acts as a bitwise "and" operator. Only bits set in both values will be returned. For example, "<code>11 &amp; 6</code>" compares the binary values '1011' to '0110'. Only the bit in the 2's place is set, so the result is <code>2</code> ('0010'). See also: "bit" </li>
<li> <li>
<b>API:</b> <b>API:</b>
Application Programming Interface. <i>TBD</i> Application Programming Interface. <i>TBD</i>