667 lines
23 KiB
HTML
667 lines
23 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
<title>gimpunit</title>
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
|
|
<link rel="start" href="index.html" title="GIMP Base Library Reference Manual">
|
|
<link rel="up" href="libgimpbase.html" title="Part I. 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.4 (XML mode)">
|
|
<link rel="stylesheet" href="style.css" type="text/css">
|
|
<link rel="part" href="libgimpbase.html" title="Part I. GIMP Base Library">
|
|
<link rel="index" href="ix01.html" title="Index">
|
|
<link rel="index" href="ix02.html" title="Index of new symbols in GIMP 2.2">
|
|
<link rel="index" href="ix03.html" title="Index of new symbols in GIMP 2.4">
|
|
<link rel="index" href="ix04.html" title="Index of deprecated symbols">
|
|
</head>
|
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
<table class="navigation" 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></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><span class="refentrytitle">gimpunit</span></h2>
|
|
<p>gimpunit — 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 href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a>;
|
|
gint <a href="libgimpbase-gimpunit.html#gimp-unit-get-number-of-units">gimp_unit_get_number_of_units</a> (void);
|
|
gint <a href="libgimpbase-gimpunit.html#gimp-unit-get-number-of-built-in-units">gimp_unit_get_number_of_built_in_units</a>
|
|
(void);
|
|
<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> <a href="libgimpbase-gimpunit.html#gimp-unit-new">gimp_unit_new</a> (gchar *identifier,
|
|
gdouble factor,
|
|
gint digits,
|
|
gchar *symbol,
|
|
gchar *abbreviation,
|
|
gchar *singular,
|
|
gchar *plural);
|
|
gboolean <a href="libgimpbase-gimpunit.html#gimp-unit-get-deletion-flag">gimp_unit_get_deletion_flag</a> (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
|
|
void <a href="libgimpbase-gimpunit.html#gimp-unit-set-deletion-flag">gimp_unit_set_deletion_flag</a> (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit,
|
|
gboolean deletion_flag);
|
|
gdouble <a href="libgimpbase-gimpunit.html#gimp-unit-get-factor">gimp_unit_get_factor</a> (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
|
|
gint <a href="libgimpbase-gimpunit.html#gimp-unit-get-digits">gimp_unit_get_digits</a> (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
|
|
const gchar* <a href="libgimpbase-gimpunit.html#gimp-unit-get-identifier">gimp_unit_get_identifier</a> (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
|
|
const gchar* <a href="libgimpbase-gimpunit.html#gimp-unit-get-symbol">gimp_unit_get_symbol</a> (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
|
|
const gchar* <a href="libgimpbase-gimpunit.html#gimp-unit-get-abbreviation">gimp_unit_get_abbreviation</a> (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
|
|
const gchar* <a href="libgimpbase-gimpunit.html#gimp-unit-get-singular">gimp_unit_get_singular</a> (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
|
|
const gchar* <a href="libgimpbase-gimpunit.html#gimp-unit-get-plural">gimp_unit_get_plural</a> (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);
|
|
#define <a href="libgimpbase-gimpunit.html#GIMP-TYPE-UNIT:CAPS">GIMP_TYPE_UNIT</a>
|
|
#define <a href="libgimpbase-gimpunit.html#GIMP-TYPE-PARAM-UNIT:CAPS">GIMP_TYPE_PARAM_UNIT</a>
|
|
#define <a href="libgimpbase-gimpunit.html#GIMP-IS-PARAM-SPEC-UNIT:CAPS">GIMP_IS_PARAM_SPEC_UNIT</a> (pspec)
|
|
GParamSpec* <a href="libgimpbase-gimpunit.html#gimp-param-spec-unit">gimp_param_spec_unit</a> (const gchar *name,
|
|
const gchar *nick,
|
|
const gchar *blurb,
|
|
gboolean allow_pixels,
|
|
gboolean allow_percent,
|
|
<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> default_value,
|
|
GParamFlags flags);
|
|
#define <a href="libgimpbase-gimpunit.html#GIMP-VALUE-HOLDS-UNIT:CAPS">GIMP_VALUE_HOLDS_UNIT</a> (value)
|
|
|
|
</pre>
|
|
</div>
|
|
<div class="refsect1" lang="en">
|
|
<a name="id2520737"></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="id2520821"></a><h2>Details</h2>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2520827"></a><h3>
|
|
<a name="GimpUnit"></a>enum GimpUnit</h3>
|
|
<a class="indexterm" name="id2520836"></a><pre class="programlisting">typedef enum /*< skip >*/
|
|
{
|
|
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 /*< pdb-skip >*/
|
|
} GimpUnit;
|
|
</pre>
|
|
<p>
|
|
|
|
</p>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2520856"></a><h3>
|
|
<a name="gimp-unit-get-number-of-units"></a>gimp_unit_get_number_of_units ()</h3>
|
|
<a class="indexterm" name="id2520865"></a><pre class="programlisting">gint gimp_unit_get_number_of_units (void);</pre>
|
|
<p>
|
|
Returns the number of units which are known to the <a 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>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The number of defined units.
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2520912"></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="id2520921"></a><pre class="programlisting">gint gimp_unit_get_number_of_built_in_units
|
|
(void);</pre>
|
|
<p>
|
|
Returns the number of <a 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>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The number of built-in units.
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2520971"></a><h3>
|
|
<a name="gimp-unit-new"></a>gimp_unit_new ()</h3>
|
|
<a class="indexterm" name="id2520981"></a><pre class="programlisting"><a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> gimp_unit_new (gchar *identifier,
|
|
gdouble factor,
|
|
gint digits,
|
|
gchar *symbol,
|
|
gchar *abbreviation,
|
|
gchar *singular,
|
|
gchar *plural);</pre>
|
|
<p>
|
|
Returns the integer ID of the new <a 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 <code class="literal">TRUE</code>. You will have to set it to <code class="literal">FALSE</code> with
|
|
<a 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>
|
|
<span class="term"><em class="parameter"><code>identifier</code></em> :</span></td>
|
|
<td> The unit's identifier string.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>factor</code></em> :</span></td>
|
|
<td> The unit's factor (how many units are in one inch).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>digits</code></em> :</span></td>
|
|
<td> The unit's suggested number of digits (see <a href="libgimpbase-gimpunit.html#gimp-unit-get-digits"><code class="function">gimp_unit_get_digits()</code></a>).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>symbol</code></em> :</span></td>
|
|
<td> The symbol of the unit (e.g. "''" for inch).
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>abbreviation</code></em> :</span></td>
|
|
<td> The abbreviation of the unit.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>singular</code></em> :</span></td>
|
|
<td> The singular form of the unit.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>plural</code></em> :</span></td>
|
|
<td> The plural form of the unit.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The ID of the new unit.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2529125"></a><h3>
|
|
<a name="gimp-unit-get-deletion-flag"></a>gimp_unit_get_deletion_flag ()</h3>
|
|
<a class="indexterm" name="id2529135"></a><pre class="programlisting">gboolean gimp_unit_get_deletion_flag (<a 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>
|
|
<span class="term"><em class="parameter"><code>unit</code></em> :</span></td>
|
|
<td> The unit you want to know the <em class="parameter"><code>deletion_flag</code></em> of.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></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="id2529207"></a><h3>
|
|
<a name="gimp-unit-set-deletion-flag"></a>gimp_unit_set_deletion_flag ()</h3>
|
|
<a class="indexterm" name="id2529217"></a><pre class="programlisting">void gimp_unit_set_deletion_flag (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit,
|
|
gboolean deletion_flag);</pre>
|
|
<p>
|
|
Sets a <a 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
|
|
<code class="literal">TRUE</code> 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>
|
|
<span class="term"><em class="parameter"><code>unit</code></em> :</span></td>
|
|
<td> The unit you want to set the <em class="parameter"><code>deletion_flag</code></em> for.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>deletion_flag</code></em> :</span></td>
|
|
<td> The new deletion_flag.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566090"></a><h3>
|
|
<a name="gimp-unit-get-factor"></a>gimp_unit_get_factor ()</h3>
|
|
<a class="indexterm" name="id2566099"></a><pre class="programlisting">gdouble gimp_unit_get_factor (<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> unit);</pre>
|
|
<p>
|
|
A <a 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>
|
|
<span class="term"><em class="parameter"><code>unit</code></em> :</span></td>
|
|
<td> The unit you want to know the factor of.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The unit's factor.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566185"></a><h3>
|
|
<a name="gimp-unit-get-digits"></a>gimp_unit_get_digits ()</h3>
|
|
<a class="indexterm" name="id2566194"></a><pre class="programlisting">gint gimp_unit_get_digits (<a 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>
|
|
<span class="term"><em class="parameter"><code>unit</code></em> :</span></td>
|
|
<td> The unit you want to know the digits.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The suggested number of digits.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566266"></a><h3>
|
|
<a name="gimp-unit-get-identifier"></a>gimp_unit_get_identifier ()</h3>
|
|
<a class="indexterm" name="id2566275"></a><pre class="programlisting">const gchar* gimp_unit_get_identifier (<a 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>
|
|
<span class="term"><em class="parameter"><code>unit</code></em> :</span></td>
|
|
<td> The unit you want to know the identifier of.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The unit's identifier.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566338"></a><h3>
|
|
<a name="gimp-unit-get-symbol"></a>gimp_unit_get_symbol ()</h3>
|
|
<a class="indexterm" name="id2566346"></a><pre class="programlisting">const gchar* gimp_unit_get_symbol (<a 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>
|
|
<span class="term"><em class="parameter"><code>unit</code></em> :</span></td>
|
|
<td> The unit you want to know the symbol of.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The unit's symbol.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566413"></a><h3>
|
|
<a name="gimp-unit-get-abbreviation"></a>gimp_unit_get_abbreviation ()</h3>
|
|
<a class="indexterm" name="id2566422"></a><pre class="programlisting">const gchar* gimp_unit_get_abbreviation (<a 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>
|
|
<span class="term"><em class="parameter"><code>unit</code></em> :</span></td>
|
|
<td> The unit you want to know the abbreviation of.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The unit's abbreviation.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566489"></a><h3>
|
|
<a name="gimp-unit-get-singular"></a>gimp_unit_get_singular ()</h3>
|
|
<a class="indexterm" name="id2566498"></a><pre class="programlisting">const gchar* gimp_unit_get_singular (<a 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>
|
|
<span class="term"><em class="parameter"><code>unit</code></em> :</span></td>
|
|
<td> The unit you want to know the singular form of.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The unit's singular form.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566566"></a><h3>
|
|
<a name="gimp-unit-get-plural"></a>gimp_unit_get_plural ()</h3>
|
|
<a class="indexterm" name="id2566575"></a><pre class="programlisting">const gchar* gimp_unit_get_plural (<a 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>
|
|
<span class="term"><em class="parameter"><code>unit</code></em> :</span></td>
|
|
<td> The unit you want to know the plural form of.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> The unit's plural form.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566642"></a><h3>
|
|
<a name="GIMP-TYPE-UNIT:CAPS"></a>GIMP_TYPE_UNIT</h3>
|
|
<a class="indexterm" name="id2566652"></a><pre class="programlisting">#define GIMP_TYPE_UNIT (gimp_unit_get_type ())
|
|
</pre>
|
|
<p>
|
|
<a href="libgimpbase-gimpunit.html#GIMP-TYPE-UNIT:CAPS"><span class="type">GIMP_TYPE_UNIT</span></a> is a <span class="type">GType</span> derived from <span class="type">G_TYPE_INT</span>.
|
|
</p>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566690"></a><h3>
|
|
<a name="GIMP-TYPE-PARAM-UNIT:CAPS"></a>GIMP_TYPE_PARAM_UNIT</h3>
|
|
<a class="indexterm" name="id2566699"></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="id2566716"></a><h3>
|
|
<a name="GIMP-IS-PARAM-SPEC-UNIT:CAPS"></a>GIMP_IS_PARAM_SPEC_UNIT()</h3>
|
|
<a class="indexterm" name="id2566727"></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>
|
|
<span class="term"><em class="parameter"><code>pspec</code></em> :</span></td>
|
|
<td>
|
|
|
|
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566762"></a><h3>
|
|
<a name="gimp-param-spec-unit"></a>gimp_param_spec_unit ()</h3>
|
|
<a class="indexterm" name="id2566771"></a><pre class="programlisting">GParamSpec* gimp_param_spec_unit (const gchar *name,
|
|
const gchar *nick,
|
|
const gchar *blurb,
|
|
gboolean allow_pixels,
|
|
gboolean allow_percent,
|
|
<a href="libgimpbase-gimpunit.html#GimpUnit">GimpUnit</a> default_value,
|
|
GParamFlags flags);</pre>
|
|
<p>
|
|
Creates a param spec to hold a units param.
|
|
See <code class="function">g_param_spec_internal()</code> for more information.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<div class="variablelist"><table border="0">
|
|
<col align="left" valign="top">
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>name</code></em> :</span></td>
|
|
<td> Canonical name of the param
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>nick</code></em> :</span></td>
|
|
<td> Nickname of the param
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>blurb</code></em> :</span></td>
|
|
<td> Brief desciption of param.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>allow_pixels</code></em> :</span></td>
|
|
<td> Whether "pixels" is an allowed unit.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>allow_percent</code></em> :</span></td>
|
|
<td> Whether "perecent" is an allowed unit.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>default_value</code></em> :</span></td>
|
|
<td> Unit to use if none is assigned.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><em class="parameter"><code>flags</code></em> :</span></td>
|
|
<td> a combination of <span class="type">GParamFlags</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
|
|
<td> a newly allocated <span class="type">GParamSpec</span> instance
|
|
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
<p>Since GIMP 2.4
|
|
</p>
|
|
</div>
|
|
<hr>
|
|
<div class="refsect2" lang="en">
|
|
<a name="id2566989"></a><h3>
|
|
<a name="GIMP-VALUE-HOLDS-UNIT:CAPS"></a>GIMP_VALUE_HOLDS_UNIT()</h3>
|
|
<a class="indexterm" name="id2566998"></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>
|
|
<span class="term"><em class="parameter"><code>value</code></em> :</span></td>
|
|
<td>
|
|
|
|
|
|
</td>
|
|
</tr></tbody>
|
|
</table></div>
|
|
</div>
|
|
</div>
|
|
<div class="refsect1" lang="en">
|
|
<a name="id2567035"></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>
|
|
<table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
|
|
<td align="left"><a accesskey="p" href="libgimpbase-gimpsignal.html"><b><< gimpsignal</b></a></td>
|
|
<td align="right"><a accesskey="n" href="libgimpbase-gimputils.html"><b>gimputils >></b></a></td>
|
|
</tr></table>
|
|
</body>
|
|
</html>
|