Files
gimp/devel-docs/libgimpbase/html/libgimpbase-gimpunit.html
2010-08-11 01:24:03 -04:00

754 lines
28 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>gimpunit</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="GIMP Base Library Reference Manual">
<link rel="up" href="libgimpbase.html" title="Part&#160;I.&#160;GIMP Base Library">
<link rel="prev" href="libgimpbase-gimpsignal.html" title="gimpsignal">
<link rel="next" href="libgimpbase-gimputils.html" title="gimputils">
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="libgimpbase.html" title="Part&#160;I.&#160;GIMP Base Library">
<link rel="index" href="libgimpbase-index.html" title="Index">
<link rel="index" href="libgimpbase-index-new-in-2-2.html" title="Index of new symbols in GIMP 2.2">
<link rel="index" href="libgimpbase-index-new-in-2-4.html" title="Index of new symbols in GIMP 2.4">
<link rel="index" href="libgimpbase-index-deprecated.html" title="Index of deprecated symbols">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libgimpbase-gimpsignal.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libgimpbase.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIMP Base Library Reference Manual</th>
<td><a accesskey="n" href="libgimpbase-gimputils.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2592452" class="shortcut">Top</a>
&#160;|&#160;
<a href="#id2573598" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="libgimpbase-gimpunit"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2592452"></a><span class="refentrytitle">gimpunit</span>
</h2>
<p>gimpunit &#8212; Provides a collection of predefined units and functions for creating
user-defined units.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
enum <a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a>;
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-number-of-units">gimp_unit_get_number_of_units</a> (void);
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-number-of-built-in-units">gimp_unit_get_number_of_built_in_units</a>
(void);
<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-new">gimp_unit_new</a> (<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *identifier,
<a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> factor,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> digits,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *symbol,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *abbreviation,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *singular,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *plural);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-deletion-flag">gimp_unit_get_deletion_flag</a> (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
void <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-set-deletion-flag">gimp_unit_set_deletion_flag</a> (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> deletion_flag);
<a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-factor">gimp_unit_get_factor</a> (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-digits">gimp_unit_get_digits</a> (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-identifier">gimp_unit_get_identifier</a> (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-symbol">gimp_unit_get_symbol</a> (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-abbreviation">gimp_unit_get_abbreviation</a> (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-singular">gimp_unit_get_singular</a> (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-plural">gimp_unit_get_plural</a> (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
#define <a class="link" href="libgimpbase-gimpunit.html#GIMP-TYPE-UNIT:CAPS">GIMP_TYPE_UNIT</a>
#define <a class="link" href="libgimpbase-gimpunit.html#GIMP-TYPE-PARAM-UNIT:CAPS">GIMP_TYPE_PARAM_UNIT</a>
#define <a class="link" href="libgimpbase-gimpunit.html#GIMP-IS-PARAM-SPEC-UNIT:CAPS">GIMP_IS_PARAM_SPEC_UNIT</a> (pspec)
<a
href="../gobject/gobject-GParamSpec.html#GParamSpec"
>GParamSpec</a>* <a class="link" href="libgimpbase-gimpunit.html#gimp-param-spec-unit">gimp_param_spec_unit</a> (const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *name,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *nick,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *blurb,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> allow_pixels,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> allow_percent,
<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> default_value,
<a
href="../gobject/gobject-GParamSpec.html#GParamFlags"
>GParamFlags</a> flags);
#define <a class="link" href="libgimpbase-gimpunit.html#GIMP-VALUE-HOLDS-UNIT:CAPS">GIMP_VALUE_HOLDS_UNIT</a> (value)
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2573598"></a><h2>Description</h2>
<p>
Provides a collection of predefined units and functions for creating
user-defined units.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2573615"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2573626"></a><h3>
<a name="GimpUnit"></a>enum GimpUnit</h3>
<a class="indexterm" name="id2573638"></a><pre class="programlisting">typedef enum /*&lt; skip &gt;*/
{
GIMP_UNIT_PIXEL = 0,
GIMP_UNIT_INCH = 1,
GIMP_UNIT_MM = 2,
GIMP_UNIT_POINT = 3,
GIMP_UNIT_PICA = 4,
GIMP_UNIT_END = 5,
GIMP_UNIT_PERCENT = 65536 /*&lt; pdb-skip &gt;*/
} GimpUnit;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2573658"></a><h3>
<a name="gimp-unit-get-number-of-units"></a>gimp_unit_get_number_of_units ()</h3>
<a class="indexterm" name="id2573669"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gimp_unit_get_number_of_units (void);</pre>
<p>
Returns the number of units which are known to the <a class="link" href="libgimpbase-gimpunit.html#GimpUnit"><span class="type">GimpUnit</span></a> system.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The number of defined units.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2573716"></a><h3>
<a name="gimp-unit-get-number-of-built-in-units"></a>gimp_unit_get_number_of_built_in_units ()</h3>
<a class="indexterm" name="id2573728"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gimp_unit_get_number_of_built_in_units
(void);</pre>
<p>
Returns the number of <a class="link" href="libgimpbase-gimpunit.html#GimpUnit"><span class="type">GimpUnit</span></a>'s which are hardcoded in the unit system
(UNIT_INCH, UNIT_MM, UNIT_POINT, UNIT_PICA and the two "pseudo unit"
UNIT_PIXEL).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The number of built-in units.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2573777"></a><h3>
<a name="gimp-unit-new"></a>gimp_unit_new ()</h3>
<a class="indexterm" name="id2573790"></a><pre class="programlisting"><a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> gimp_unit_new (<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *identifier,
<a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> factor,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> digits,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *symbol,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *abbreviation,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *singular,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *plural);</pre>
<p>
Returns the integer ID of the new <a class="link" href="libgimpbase-gimpunit.html#GimpUnit"><span class="type">GimpUnit</span></a>.
</p>
<p>
Note that a new unit is always created with it's deletion flag
set to <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a>. You will have to set it to <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> with
<a class="link" href="libgimpbase-gimpunit.html#gimp-unit-set-deletion-flag"><code class="function">gimp_unit_set_deletion_flag()</code></a> to make the unit definition persistent.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>identifier</code></em>&#160;:</span></p></td>
<td> The unit's identifier string.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>factor</code></em>&#160;:</span></p></td>
<td> The unit's factor (how many units are in one inch).
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>digits</code></em>&#160;:</span></p></td>
<td> The unit's suggested number of digits (see <a class="link" href="libgimpbase-gimpunit.html#gimp-unit-get-digits"><code class="function">gimp_unit_get_digits()</code></a>).
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>symbol</code></em>&#160;:</span></p></td>
<td> The symbol of the unit (e.g. "''" for inch).
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>abbreviation</code></em>&#160;:</span></p></td>
<td> The abbreviation of the unit.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>singular</code></em>&#160;:</span></p></td>
<td> The singular form of the unit.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>plural</code></em>&#160;:</span></p></td>
<td> The plural form of the unit.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The ID of the new unit.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623858"></a><h3>
<a name="gimp-unit-get-deletion-flag"></a>gimp_unit_get_deletion_flag ()</h3>
<a class="indexterm" name="id2623869"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gimp_unit_get_deletion_flag (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);</pre>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em>&#160;:</span></p></td>
<td> The unit you want to know the <em class="parameter"><code>deletion_flag</code></em> of.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The unit's <em class="parameter"><code>deletion_flag</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2623942"></a><h3>
<a name="gimp-unit-set-deletion-flag"></a>gimp_unit_set_deletion_flag ()</h3>
<a class="indexterm" name="id2627052"></a><pre class="programlisting">void gimp_unit_set_deletion_flag (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> deletion_flag);</pre>
<p>
Sets a <a class="link" href="libgimpbase-gimpunit.html#GimpUnit"><span class="type">GimpUnit</span></a>'s <em class="parameter"><code>deletion_flag</code></em>. If the <em class="parameter"><code>deletion_flag</code></em> of a unit is
<a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> when GIMP exits, this unit will not be saved in the users's
"unitrc" file.
</p>
<p>
Trying to change the <em class="parameter"><code>deletion_flag</code></em> of a built-in unit will be silently
ignored.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em>&#160;:</span></p></td>
<td> The unit you want to set the <em class="parameter"><code>deletion_flag</code></em> for.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>deletion_flag</code></em>&#160;:</span></p></td>
<td> The new deletion_flag.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627156"></a><h3>
<a name="gimp-unit-get-factor"></a>gimp_unit_get_factor ()</h3>
<a class="indexterm" name="id2627167"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gdouble"
>gdouble</a> gimp_unit_get_factor (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);</pre>
<p>
A <a class="link" href="libgimpbase-gimpunit.html#GimpUnit"><span class="type">GimpUnit</span></a>'s <em class="parameter"><code>factor</code></em> is defined to be:
</p>
<p>
distance_in_units == (<em class="parameter"><code>factor</code></em> * distance_in_inches)
</p>
<p>
Returns 0 for <em class="parameter"><code>unit</code></em> == GIMP_UNIT_PIXEL.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em>&#160;:</span></p></td>
<td> The unit you want to know the factor of.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The unit's factor.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627259"></a><h3>
<a name="gimp-unit-get-digits"></a>gimp_unit_get_digits ()</h3>
<a class="indexterm" name="id2627270"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gimp_unit_get_digits (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);</pre>
<p>
Returns the number of digits an entry field should provide to get
approximately the same accuracy as an inch input field with two digits.
</p>
<p>
Returns 0 for <em class="parameter"><code>unit</code></em> == GIMP_UNIT_PIXEL.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em>&#160;:</span></p></td>
<td> The unit you want to know the digits.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The suggested number of digits.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627343"></a><h3>
<a name="gimp-unit-get-identifier"></a>gimp_unit_get_identifier ()</h3>
<a class="indexterm" name="id2627354"></a><pre class="programlisting">const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gimp_unit_get_identifier (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);</pre>
<p>
This is an unstranslated string and must not be changed or freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em>&#160;:</span></p></td>
<td> The unit you want to know the identifier of.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The unit's identifier.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627417"></a><h3>
<a name="gimp-unit-get-symbol"></a>gimp_unit_get_symbol ()</h3>
<a class="indexterm" name="id2627428"></a><pre class="programlisting">const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gimp_unit_get_symbol (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);</pre>
<p>
This is e.g. "''" for UNIT_INCH.
</p>
<p>
NOTE: This string must not be changed or freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em>&#160;:</span></p></td>
<td> The unit you want to know the symbol of.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The unit's symbol.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627494"></a><h3>
<a name="gimp-unit-get-abbreviation"></a>gimp_unit_get_abbreviation ()</h3>
<a class="indexterm" name="id2627506"></a><pre class="programlisting">const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gimp_unit_get_abbreviation (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);</pre>
<p>
For built-in units, this function returns the translated abbreviation
of the unit.
</p>
<p>
NOTE: This string must not be changed or freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em>&#160;:</span></p></td>
<td> The unit you want to know the abbreviation of.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The unit's abbreviation.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627574"></a><h3>
<a name="gimp-unit-get-singular"></a>gimp_unit_get_singular ()</h3>
<a class="indexterm" name="id2627585"></a><pre class="programlisting">const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gimp_unit_get_singular (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);</pre>
<p>
For built-in units, this function returns the translated singular form
of the unit's name.
</p>
<p>
NOTE: This string must not be changed or freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em>&#160;:</span></p></td>
<td> The unit you want to know the singular form of.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The unit's singular form.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627652"></a><h3>
<a name="gimp-unit-get-plural"></a>gimp_unit_get_plural ()</h3>
<a class="indexterm" name="id2627664"></a><pre class="programlisting">const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gimp_unit_get_plural (<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);</pre>
<p>
For built-in units, this function returns the translated plural form
of the unit's name.
</p>
<p>
NOTE: This string must not be changed or freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>unit</code></em>&#160;:</span></p></td>
<td> The unit you want to know the plural form of.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> The unit's plural form.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627731"></a><h3>
<a name="GIMP-TYPE-UNIT:CAPS"></a>GIMP_TYPE_UNIT</h3>
<a class="indexterm" name="id2627743"></a><pre class="programlisting">#define GIMP_TYPE_UNIT (gimp_unit_get_type ())
</pre>
<p>
<a class="link" href="libgimpbase-gimpunit.html#GIMP-TYPE-UNIT:CAPS"><span class="type">GIMP_TYPE_UNIT</span></a> is a <a
href="../gobject/gobject-Type-Information.html#GType"
><span class="type">GType</span></a> derived from <a
href="../gobject/gobject-Type-Information.html#G-TYPE-INT:CAPS"
><span class="type">G_TYPE_INT</span></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627782"></a><h3>
<a name="GIMP-TYPE-PARAM-UNIT:CAPS"></a>GIMP_TYPE_PARAM_UNIT</h3>
<a class="indexterm" name="id2627793"></a><pre class="programlisting">#define GIMP_TYPE_PARAM_UNIT (gimp_param_unit_get_type ())
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627809"></a><h3>
<a name="GIMP-IS-PARAM-SPEC-UNIT:CAPS"></a>GIMP_IS_PARAM_SPEC_UNIT()</h3>
<a class="indexterm" name="id2627823"></a><pre class="programlisting">#define GIMP_IS_PARAM_SPEC_UNIT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_UNIT))
</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>pspec</code></em>&#160;:</span></p></td>
<td>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627858"></a><h3>
<a name="gimp-param-spec-unit"></a>gimp_param_spec_unit ()</h3>
<a class="indexterm" name="id2627872"></a><pre class="programlisting"><a
href="../gobject/gobject-GParamSpec.html#GParamSpec"
>GParamSpec</a>* gimp_param_spec_unit (const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *name,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *nick,
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *blurb,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> allow_pixels,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> allow_percent,
<a class="link" href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> default_value,
<a
href="../gobject/gobject-GParamSpec.html#GParamFlags"
>GParamFlags</a> flags);</pre>
<p>
Creates a param spec to hold a units param.
See <a
href="../gobject/gobject-GParamSpec.html#g-param-spec-internal"
><code class="function">g_param_spec_internal()</code></a> for more information.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
<td> Canonical name of the param
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>nick</code></em>&#160;:</span></p></td>
<td> Nickname of the param
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>blurb</code></em>&#160;:</span></p></td>
<td> Brief desciption of param.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>allow_pixels</code></em>&#160;:</span></p></td>
<td> Whether "pixels" is an allowed unit.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>allow_percent</code></em>&#160;:</span></p></td>
<td> Whether "perecent" is an allowed unit.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>default_value</code></em>&#160;:</span></p></td>
<td> Unit to use if none is assigned.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em>&#160;:</span></p></td>
<td> a combination of <a
href="../gobject/gobject-GParamSpec.html#GParamFlags"
><span class="type">GParamFlags</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
<td> a newly allocated <a
href="../gobject/gobject-GParamSpec.html#GParamSpec"
><span class="type">GParamSpec</span></a> instance
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since GIMP 2.4
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2628093"></a><h3>
<a name="GIMP-VALUE-HOLDS-UNIT:CAPS"></a>GIMP_VALUE_HOLDS_UNIT()</h3>
<a class="indexterm" name="id2628104"></a><pre class="programlisting">#define GIMP_VALUE_HOLDS_UNIT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_UNIT))
</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></p></td>
<td>
</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2628141"></a><h2>See Also</h2>
<p>
<a
href="../libgimpwidgets/GimpUnitMenu.html"
><span class="type">GimpUnitMenu</span></a>
</p>
<p>
<a
href="../libgimpwidgets/GimpSizeEntry.html"
><span class="type">GimpSizeEntry</span></a>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2628171"></a><div class="refsect2" lang="en"><a name="id2628172"></a></div>
<hr>
<div class="refsect2" lang="en"><a name="id2628173"></a></div>
</div>
</div>
</body>
</html>