File: gimpfileops.xml

package info (click to toggle)
gimp 2.2.13-1etch4
  • links: PTS
  • area: main
  • in suites: etch
  • size: 94,832 kB
  • ctags: 47,113
  • sloc: ansic: 524,858; xml: 36,798; lisp: 9,870; sh: 9,409; makefile: 7,923; python: 2,674; perl: 2,589; yacc: 520; lex: 334
file content (299 lines) | stat: -rw-r--r-- 16,224 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="libgimp-gimpfileops">
<refmeta>
<refentrytitle role="top_of_page">gimpfileops</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGIMP Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>gimpfileops</refname>
<refpurpose>File operations (load, save, etc.)</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>



<link linkend="gchar">gchar</link>*      <link linkend="gimp-temp-name">gimp_temp_name</link>                  (const <link linkend="gchar">gchar</link> *extension);
<link linkend="gint32">gint32</link>      <link linkend="gimp-file-load">gimp_file_load</link>                  (<link linkend="GimpRunMode">GimpRunMode</link> run_mode,
                                             const <link linkend="gchar">gchar</link> *filename,
                                             const <link linkend="gchar">gchar</link> *raw_filename);
<link linkend="gboolean">gboolean</link>    <link linkend="gimp-file-save">gimp_file_save</link>                  (<link linkend="GimpRunMode">GimpRunMode</link> run_mode,
                                             <link linkend="gint32">gint32</link> image_ID,
                                             <link linkend="gint32">gint32</link> drawable_ID,
                                             const <link linkend="gchar">gchar</link> *filename,
                                             const <link linkend="gchar">gchar</link> *raw_filename);
<link linkend="gboolean">gboolean</link>    <link linkend="gimp-register-magic-load-handler">gimp_register_magic_load_handler</link>
                                            (const <link linkend="gchar">gchar</link> *procedure_name,
                                             const <link linkend="gchar">gchar</link> *extensions,
                                             const <link linkend="gchar">gchar</link> *prefixes,
                                             const <link linkend="gchar">gchar</link> *magics);
<link linkend="gboolean">gboolean</link>    <link linkend="gimp-register-load-handler">gimp_register_load_handler</link>      (const <link linkend="gchar">gchar</link> *procedure_name,
                                             const <link linkend="gchar">gchar</link> *extensions,
                                             const <link linkend="gchar">gchar</link> *prefixes);
<link linkend="gboolean">gboolean</link>    <link linkend="gimp-register-save-handler">gimp_register_save_handler</link>      (const <link linkend="gchar">gchar</link> *procedure_name,
                                             const <link linkend="gchar">gchar</link> *extensions,
                                             const <link linkend="gchar">gchar</link> *prefixes);
<link linkend="gboolean">gboolean</link>    <link linkend="gimp-register-file-handler-mime">gimp_register_file_handler_mime</link> (const <link linkend="gchar">gchar</link> *procedure_name,
                                             const <link linkend="gchar">gchar</link> *mime_type);
<link linkend="gboolean">gboolean</link>    <link linkend="gimp-register-thumbnail-loader">gimp_register_thumbnail_loader</link>  (const <link linkend="gchar">gchar</link> *load_proc,
                                             const <link linkend="gchar">gchar</link> *thumb_proc);
</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
File operations (load, save, etc.)

</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="gimp-temp-name" role="function"/>gimp_temp_name ()</title>
<indexterm><primary>gimp_temp_name</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*      gimp_temp_name                  (const <link linkend="gchar">gchar</link> *extension);</programlisting>
<para>
Generates a unique filename.
</para>
<para>
Generates a unique filename using the temp path supplied in the
user's gimprc.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>extension</parameter>&nbsp;:</term>
<listitem><simpara> The extension the file will have.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The new temp filename.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-file-load" role="function"/>gimp_file_load ()</title>
<indexterm><primary>gimp_file_load</primary></indexterm><programlisting><link linkend="gint32">gint32</link>      gimp_file_load                  (<link linkend="GimpRunMode">GimpRunMode</link> run_mode,
                                             const <link linkend="gchar">gchar</link> *filename,
                                             const <link linkend="gchar">gchar</link> *raw_filename);</programlisting>
<para>
Loads a file by invoking the right load handler.
</para>
<para>
This procedure invokes the correct file load handler using magic if
possible, and falling back on the file's extension and/or prefix if
not. The name of the file to load is typically a full pathname, and
the name entered is what the user actually typed before prepending a
directory path. The reason for this is that if the user types
http://www.xcf/~gimp/ he wants to fetch a URL, and the full pathname
will not look like a URL.\"</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>run_mode</parameter>&nbsp;:</term>
<listitem><simpara> The run mode.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
<listitem><simpara> The name of the file to load.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>raw_filename</parameter>&nbsp;:</term>
<listitem><simpara> The name as entered by the user.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The output image.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-file-save" role="function"/>gimp_file_save ()</title>
<indexterm><primary>gimp_file_save</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gimp_file_save                  (<link linkend="GimpRunMode">GimpRunMode</link> run_mode,
                                             <link linkend="gint32">gint32</link> image_ID,
                                             <link linkend="gint32">gint32</link> drawable_ID,
                                             const <link linkend="gchar">gchar</link> *filename,
                                             const <link linkend="gchar">gchar</link> *raw_filename);</programlisting>
<para>
Saves a file by extension.
</para>
<para>
This procedure invokes the correct file save handler according to
the file's extension and/or prefix. The name of the file to save is
typically a full pathname, and the name entered is what the user
actually typed before prepending a directory path. The reason for
this is that if the user types http://www.xcf/~gimp/ she wants to
fetch a URL, and the full pathname will not look like a URL.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>run_mode</parameter>&nbsp;:</term>
<listitem><simpara> The run mode.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>image_ID</parameter>&nbsp;:</term>
<listitem><simpara> Input image.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>drawable_ID</parameter>&nbsp;:</term>
<listitem><simpara> Drawable to save.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter>&nbsp;:</term>
<listitem><simpara> The name of the file to save the image in.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>raw_filename</parameter>&nbsp;:</term>
<listitem><simpara> The name as entered by the user.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-register-magic-load-handler" role="function"/>gimp_register_magic_load_handler ()</title>
<indexterm><primary>gimp_register_magic_load_handler</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gimp_register_magic_load_handler
                                            (const <link linkend="gchar">gchar</link> *procedure_name,
                                             const <link linkend="gchar">gchar</link> *extensions,
                                             const <link linkend="gchar">gchar</link> *prefixes,
                                             const <link linkend="gchar">gchar</link> *magics);</programlisting>
<para>
Registers a file load handler procedure.
</para>
<para>
Registers a procedural database procedure to be called to load files
of a particular file format using magic file information.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>procedure_name</parameter>&nbsp;:</term>
<listitem><simpara> The name of the procedure to be used for loading.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>extensions</parameter>&nbsp;:</term>
<listitem><simpara> comma separated list of extensions this handler can load (i.e. \"jpg,jpeg\").
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prefixes</parameter>&nbsp;:</term>
<listitem><simpara> comma separated list of prefixes this handler can load (i.e. \"http:,ftp:\").
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>magics</parameter>&nbsp;:</term>
<listitem><simpara> comma separated list of magic file information this handler can load (i.e. \"0,string,GIF\").
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-register-load-handler" role="function"/>gimp_register_load_handler ()</title>
<indexterm><primary>gimp_register_load_handler</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gimp_register_load_handler      (const <link linkend="gchar">gchar</link> *procedure_name,
                                             const <link linkend="gchar">gchar</link> *extensions,
                                             const <link linkend="gchar">gchar</link> *prefixes);</programlisting>
<para>
Registers a file load handler procedure.
</para>
<para>
Registers a procedural database procedure to be called to load files
of a particular file format.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>procedure_name</parameter>&nbsp;:</term>
<listitem><simpara> The name of the procedure to be used for loading.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>extensions</parameter>&nbsp;:</term>
<listitem><simpara> comma separated list of extensions this handler can load (i.e. \"jpg,jpeg\").
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prefixes</parameter>&nbsp;:</term>
<listitem><simpara> comma separated list of prefixes this handler can load (i.e. \"http:,ftp:\").
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-register-save-handler" role="function"/>gimp_register_save_handler ()</title>
<indexterm><primary>gimp_register_save_handler</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gimp_register_save_handler      (const <link linkend="gchar">gchar</link> *procedure_name,
                                             const <link linkend="gchar">gchar</link> *extensions,
                                             const <link linkend="gchar">gchar</link> *prefixes);</programlisting>
<para>
Registers a file save handler procedure.
</para>
<para>
Registers a procedural database procedure to be called to save files
in a particular file format.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>procedure_name</parameter>&nbsp;:</term>
<listitem><simpara> The name of the procedure to be used for saving.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>extensions</parameter>&nbsp;:</term>
<listitem><simpara> comma separated list of extensions this handler can save (i.e. \"jpg,jpeg\").
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prefixes</parameter>&nbsp;:</term>
<listitem><simpara> comma separated list of prefixes this handler can save (i.e. \"http:,ftp:\").
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-register-file-handler-mime" role="function" condition="since:GIMP 2.2"/>gimp_register_file_handler_mime ()</title>
<indexterm role="GIMP 2.2"><primary>gimp_register_file_handler_mime</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gimp_register_file_handler_mime (const <link linkend="gchar">gchar</link> *procedure_name,
                                             const <link linkend="gchar">gchar</link> *mime_type);</programlisting>
<para>
Associates a MIME type with a file handler procedure.
</para>
<para>
Registers a MIME type for a file handler procedure. This allows GIMP
to determine the MIME type of the file opened or saved using this
procedure.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>procedure_name</parameter>&nbsp;:</term>
<listitem><simpara> The name of the procedure to associate a MIME type with.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>mime_type</parameter>&nbsp;:</term>
<listitem><simpara> A single MIME type, like for example \"image/jpeg\".
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success.

</simpara></listitem></varlistentry>
</variablelist><para>Since  GIMP 2.2
</para></refsect2>
<refsect2>
<title><anchor id="gimp-register-thumbnail-loader" role="function" condition="since:GIMP 2.2"/>gimp_register_thumbnail_loader ()</title>
<indexterm role="GIMP 2.2"><primary>gimp_register_thumbnail_loader</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gimp_register_thumbnail_loader  (const <link linkend="gchar">gchar</link> *load_proc,
                                             const <link linkend="gchar">gchar</link> *thumb_proc);</programlisting>
<para>
Associates a thumbnail loader with a file load procedure.
</para>
<para>
Some file formats allow for embedded thumbnails, other file formats
contain a scalable image or provide the image data in different
resolutions. A file plug-in for such a format may register a special
procedure that allows GIMP to load a thumbnail preview of the image.
This procedure is then associated with the standard load procedure
using this function.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>load_proc</parameter>&nbsp;:</term>
<listitem><simpara> The name of the procedure the thumbnail loader with.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>thumb_proc</parameter>&nbsp;:</term>
<listitem><simpara> The name of the thumbnail load procedure.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success.

</simpara></listitem></varlistentry>
</variablelist><para>Since  GIMP 2.2
</para></refsect2>

</refsect1>




</refentry>