summaryrefslogtreecommitdiffstats
path: root/devel-docs/libgimpbase/html/libgimpbase-gimpmemsize.html
blob: 87546912761082eaf82f26ec17b80989cad92024 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!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 Vsnapshot">
<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.33.1 (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_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</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">
<span class="returnvalue">gboolean</span>
</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">
<span class="returnvalue">gchar</span> *
</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">
<span class="returnvalue">GParamSpec</span> *
</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="other_proto_type">
<col class="other_proto_name">
</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"><span class="returnvalue">gchar</span> *
gimp_memsize_serialize (<em class="parameter"><code><span class="type">guint64</span> 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 <code class="function">g_format_size()</code>.</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"><span class="returnvalue">gboolean</span>
gimp_memsize_deserialize (<em class="parameter"><code>const <span class="type">gchar</span> *string</code></em>,
                          <em class="parameter"><code><span class="type">guint64</span> *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> <code class="literal">TRUE</code> if the <em class="parameter"><code>string</code></em>
was successfully parsed and
<em class="parameter"><code>memsize</code></em>
has been set, <code class="literal">FALSE</code> 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"><span class="returnvalue">gchar</span> *
gimp_memsize_to_string (<em class="parameter"><code><span class="type">guint64</span> 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 <code class="function">g_format_size()</code> 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"><span class="returnvalue">GParamSpec</span> *
gimp_param_spec_memsize (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>,
                         <em class="parameter"><code>const <span class="type">gchar</span> *nick</code></em>,
                         <em class="parameter"><code>const <span class="type">gchar</span> *blurb</code></em>,
                         <em class="parameter"><code><span class="type">guint64</span> minimum</code></em>,
                         <em class="parameter"><code><span class="type">guint64</span> maximum</code></em>,
                         <em class="parameter"><code><span class="type">guint64</span> default_value</code></em>,
                         <em class="parameter"><code><span class="type">GParamFlags</span> flags</code></em>);</pre>
<p>Creates a param spec to hold a memory size value.
See <code class="function">g_param_spec_internal()</code> 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 <span class="type">GParamFlags</span></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 <span class="type">GParamSpec</span> 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 <span class="type">GType</span> derived from <span class="type">G_TYPE_UINT64</span>.</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.33.1</div>
</body>
</html>