Files
gimp/devel-docs/libgimpbase/html/libgimpbase-gimpmemsize.html
2018-04-19 11:58:35 -04:00

308 lines
15 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gimpmemsize: GIMP Base Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GIMP Base Library Reference Manual">
<link rel="up" href="pt01.html" title="Part I. GIMP Base Library">
<link rel="prev" href="libgimpbase-gimpenv.html" title="gimpenv">
<link rel="next" href="libgimpbase-gimpmetadata.html" title="gimpmetadata">
<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#libgimpbase-gimpmemsize.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="pt01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libgimpbase-gimpenv.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libgimpbase-gimpmetadata.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libgimpbase-gimpmemsize"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libgimpbase-gimpmemsize.top_of_page"></a>gimpmemsize</span></h2>
<p>gimpmemsize — Functions to (de)serialize a given memory size.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libgimpbase-gimpmemsize.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgimpbase-gimpmemsize.html#gimp-memsize-serialize" title="gimp_memsize_serialize ()">gimp_memsize_serialize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="libgimpbase-gimpmemsize.html#gimp-memsize-deserialize" title="gimp_memsize_deserialize ()">gimp_memsize_deserialize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgimpbase-gimpmemsize.html#gimp-memsize-to-string" title="gimp_memsize_to_string ()">gimp_memsize_to_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libgimpbase-gimpmemsize.html#GIMP-IS-PARAM-SPEC-MEMSIZE:CAPS" title="GIMP_IS_PARAM_SPEC_MEMSIZE()">GIMP_IS_PARAM_SPEC_MEMSIZE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../gobject/gobject-GParamSpec.html#GParamSpec"><span class="returnvalue">GParamSpec</span></a> *
</td>
<td class="function_name">
<a class="link" href="libgimpbase-gimpmemsize.html#gimp-param-spec-memsize" title="gimp_param_spec_memsize ()">gimp_param_spec_memsize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libgimpbase-gimpmemsize.html#GIMP-VALUE-HOLDS-MEMSIZE:CAPS" title="GIMP_VALUE_HOLDS_MEMSIZE()">GIMP_VALUE_HOLDS_MEMSIZE</a><span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgimpbase-gimpmemsize.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libgimpbase-gimpmemsize.html#GIMP-TYPE-MEMSIZE:CAPS" title="GIMP_TYPE_MEMSIZE">GIMP_TYPE_MEMSIZE</a></td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="libgimpbase-gimpmemsize.html#GIMP-TYPE-PARAM-MEMSIZE:CAPS" title="GIMP_TYPE_PARAM_MEMSIZE">GIMP_TYPE_PARAM_MEMSIZE</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libgimpbase-gimpmemsize.description"></a><h2>Description</h2>
<p>Functions to (de)serialize a given memory size.</p>
</div>
<div class="refsect1">
<a name="libgimpbase-gimpmemsize.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gimp-memsize-serialize"></a><h3>gimp_memsize_serialize ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
gimp_memsize_serialize (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> memsize</code></em>);</pre>
<p>Creates a string representation of a given memory size. This string
can be parsed by <a class="link" href="libgimpbase-gimpmemsize.html#gimp-memsize-deserialize" title="gimp_memsize_deserialize ()"><code class="function">gimp_memsize_deserialize()</code></a> and can thus be used in
config files. It should not be displayed to the user. If you need a
nice human-readable string please use <a href="../glib/glib-Miscellaneous-Utility-Functions.html#g-format-size"><code class="function">g_format_size()</code></a>.</p>
<div class="refsect3">
<a name="gimp-memsize-serialize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>memsize</p></td>
<td class="parameter_description"><p>memory size in bytes</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-memsize-serialize.returns"></a><h4>Returns</h4>
<p> A newly allocated string representation of <em class="parameter"><code>memsize</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-memsize-deserialize"></a><h3>gimp_memsize_deserialize ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gimp_memsize_deserialize (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *memsize</code></em>);</pre>
<p>Parses a string representation of a memory size as returned by
<a class="link" href="libgimpbase-gimpmemsize.html#gimp-memsize-serialize" title="gimp_memsize_serialize ()"><code class="function">gimp_memsize_serialize()</code></a>.</p>
<div class="refsect3">
<a name="gimp-memsize-deserialize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>string</p></td>
<td class="parameter_description"><p>a string as returned by <a class="link" href="libgimpbase-gimpmemsize.html#gimp-memsize-serialize" title="gimp_memsize_serialize ()"><code class="function">gimp_memsize_serialize()</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>memsize</p></td>
<td class="parameter_description"><p>return location for memory size in bytes</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-memsize-deserialize.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the <em class="parameter"><code>string</code></em>
was successfully parsed and
<em class="parameter"><code>memsize</code></em>
has been set, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-2.html#api-index-2.2">2.2</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gimp-memsize-to-string"></a><h3>gimp_memsize_to_string ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
gimp_memsize_to_string (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> memsize</code></em>);</pre>
<div class="warning"><p><code class="literal">gimp_memsize_to_string</code> is deprecated and should not be used in newly-written code.</p></div>
<p>This function is deprecated! Use <a href="../glib/glib-Miscellaneous-Utility-Functions.html#g-format-size"><code class="function">g_format_size()</code></a> instead.</p>
<div class="refsect3">
<a name="gimp-memsize-to-string.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>memsize</p></td>
<td class="parameter_description"><p>A memory size in bytes.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-memsize-to-string.returns"></a><h4>Returns</h4>
<p> A newly allocated human-readable, translated string.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GIMP-IS-PARAM-SPEC-MEMSIZE:CAPS"></a><h3>GIMP_IS_PARAM_SPEC_MEMSIZE()</h3>
<pre class="programlisting">#define GIMP_IS_PARAM_SPEC_MEMSIZE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_MEMSIZE))
</pre>
</div>
<hr>
<div class="refsect2">
<a name="gimp-param-spec-memsize"></a><h3>gimp_param_spec_memsize ()</h3>
<pre class="programlisting"><a href="../gobject/gobject-GParamSpec.html#GParamSpec"><span class="returnvalue">GParamSpec</span></a> *
gimp_param_spec_memsize (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *nick</code></em>,
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *blurb</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> minimum</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> maximum</code></em>,
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> default_value</code></em>,
<em class="parameter"><code><a href="../gobject/gobject-GParamSpec.html#GParamFlags"><span class="type">GParamFlags</span></a> flags</code></em>);</pre>
<p>Creates a param spec to hold a memory size value.
See <a href="../gobject/gobject-GParamSpec.html#g-param-spec-internal"><code class="function">g_param_spec_internal()</code></a> for more information.</p>
<div class="refsect3">
<a name="gimp-param-spec-memsize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>Canonical name of the param</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>nick</p></td>
<td class="parameter_description"><p>Nickname of the param</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>blurb</p></td>
<td class="parameter_description"><p>Brief description of param.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>minimum</p></td>
<td class="parameter_description"><p>Smallest allowed value of the parameter.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>maximum</p></td>
<td class="parameter_description"><p>Largest allowed value of the parameter.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>default_value</p></td>
<td class="parameter_description"><p>Value to use if none is assigned.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>a combination of <a href="../gobject/gobject-GParamSpec.html#GParamFlags"><span class="type">GParamFlags</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gimp-param-spec-memsize.returns"></a><h4>Returns</h4>
<p> a newly allocated <a href="../gobject/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> instance</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-4.html#api-index-2.4">2.4</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GIMP-VALUE-HOLDS-MEMSIZE:CAPS"></a><h3>GIMP_VALUE_HOLDS_MEMSIZE()</h3>
<pre class="programlisting">#define GIMP_VALUE_HOLDS_MEMSIZE(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_MEMSIZE))
</pre>
</div>
</div>
<div class="refsect1">
<a name="libgimpbase-gimpmemsize.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GIMP-TYPE-MEMSIZE:CAPS"></a><h3>GIMP_TYPE_MEMSIZE</h3>
<pre class="programlisting">#define GIMP_TYPE_MEMSIZE (gimp_memsize_get_type ())
</pre>
<p><a class="link" href="libgimpbase-gimpmemsize.html#GIMP-TYPE-MEMSIZE:CAPS" title="GIMP_TYPE_MEMSIZE"><span class="type">GIMP_TYPE_MEMSIZE</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-UINT64:CAPS"><span class="type">G_TYPE_UINT64</span></a>.</p>
</div>
<hr>
<div class="refsect2">
<a name="GIMP-TYPE-PARAM-MEMSIZE:CAPS"></a><h3>GIMP_TYPE_PARAM_MEMSIZE</h3>
<pre class="programlisting">#define GIMP_TYPE_PARAM_MEMSIZE (gimp_param_memsize_get_type ())
</pre>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.28</div>
</body>
</html>