4
>GdkPixbufLoader</TITLE
7
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
10
TITLE="The gdk-pixbuf Library"
11
HREF="index.html"><LINK
17
HREF="gdk-pixbuf-animation.html"><LINK
19
TITLE="GnomeCanvasPixbuf"
20
HREF="gnomecanvaspixbuf.html"></HEAD
55
HREF="gdk-pixbuf-animation.html"
60
><<< Previous Page</B
109
HREF="gnomecanvaspixbuf.html"
114
>Next Page >>></B
123
NAME="GDKPIXBUFLOADER">GdkPixbufLoader</H1
131
>GdkPixbufLoader -- Application-driven progressive image loading.</DIV
133
CLASS="REFSYNOPSISDIV"
146
> #include <gdk-pixbuf/gdk-pixbuf.h>
150
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-CAPS"
151
>GDK_PIXBUF_LOADER</A
154
HREF="gdkpixbufloader.html"
157
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-NEW"
158
>gdk_pixbuf_loader_new</A
161
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-WRITE"
162
>gdk_pixbuf_loader_write</A
164
HREF="gdkpixbufloader.html"
170
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-GET-PIXBUF"
171
>gdk_pixbuf_loader_get_pixbuf</A
173
HREF="gdkpixbufloader.html"
176
GdkPixbufAnimation* <A
177
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-GET-ANIMATION"
178
>gdk_pixbuf_loader_get_animation</A
181
HREF="gdkpixbufloader.html"
185
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-CLOSE"
186
>gdk_pixbuf_loader_close</A
188
HREF="gdkpixbufloader.html"
202
>Object Hierarchy</H2
213
+----GdkPixbufLoader</PRE
224
>Signal Prototypes</H2
235
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-AREA-UPDATED"
238
void user_function (<A
239
HREF="gdkpixbufloader.html"
248
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-AREA-PREPARED"
251
void user_function (<A
252
HREF="gdkpixbufloader.html"
257
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-FRAME-DONE"
260
void user_function (<A
261
HREF="gdkpixbufloader.html"
267
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-ANIMATION-DONE"
270
void user_function (<A
271
HREF="gdkpixbufloader.html"
276
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-CLOSED"
278
>" void user_function (<A
279
HREF="gdkpixbufloader.html"
282
gpointer user_data);</PRE
296
HREF="gdkpixbufloader.html"
298
> provides a way for applications to drive the
299
process of loading an image, by letting them send the image data
300
directly to the loader instead of having the loader read the data
301
from a file. Applications can use this functionality instead of
303
HREF="gdk-pixbuf-file-loading.html#GDK-PIXBUF-NEW-FROM-FILE"
304
>gdk_pixbuf_new_from_file</A
305
>() when they need to parse image data in
306
small chunks. For example, it should be used when reading an
307
image from a (potentially) slow network connection, or when
308
loading an extremely large file.
312
HREF="gdkpixbufloader.html"
314
> to load an image, just create a new one,
316
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-WRITE"
317
>gdk_pixbuf_loader_write</A
318
>() to send the data to it. When
320
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-CLOSE"
321
>gdk_pixbuf_loader_close</A
322
>() should be called to end the stream
323
and finalize everything. The loader will emit two important
324
signals throughout the process. The first, "<A
325
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-AREA-PREPARED"
328
will be called as soon as the image has enough information to
329
determine the size of the image to be used. It will pass a
335
> in. If you want to use it, you can simply ref it. In
336
addition, no actual information will be passed in yet, so the
337
pixbuf can be safely filled with any temporary graphics (or an
338
initial color) as needed. You can also call the
340
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-GET-PIXBUF"
341
>gdk_pixbuf_loader_get_pixbuf</A
342
>() once this signal has been emitted
343
and get the same pixbuf.
346
> The other signal, "<A
347
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-AREA-UPDATED"
350
called every time a region is updated. This way you can update a
351
partially completed image. Note that you do not know anything
352
about the completeness of an image from the area updated. For
353
example, in an interlaced image, you need to make several passes
354
before the image is done loading.
362
>Loading an animation</H3
364
> Loading an animation is a little more complex then loading an
365
image. In addition to the above signals, there is also a "<A
366
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-FRAME-DONE"
370
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-ANIMATION-DONE"
373
signal. The first lets the application know that it is dealing
374
with an animation, instead of a static image. It also passes a
375
GdkPixbufFrame in the signal. As before, if you want to keep
376
the frame, you need to ref it. Once the first "<A
377
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-FRAME-DONE"
380
has been emitted, you can call <A
381
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-GET-ANIMATION"
382
>gdk_pixbuf_loader_get_animation</A
384
to get the GdkPixbufAnimation struct. Each subsequent frame
385
goes through a similar lifecycle. For example "<A
386
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-AREA-PREPARED"
390
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-AREA-UPDATED"
393
emitted as many times as necessary. Finally, "<A
394
HREF="gdkpixbufloader.html#GDKPIXBUFLOADER-ANIMATION-DONE"
397
is emitted as soon as all frames are done.
415
NAME="GDK-PIXBUF-LOADER-CAPS"
417
>GDK_PIXBUF_LOADER()</H3
426
CLASS="PROGRAMLISTING"
427
>#define GDK_PIXBUF_LOADER(obj) (GTK_CHECK_CAST ((obj), GDK_TYPE_PIXBUF_LOADER, GdkPixbufLoader))</PRE
432
> Casts a GtkObject to a <A
433
HREF="gdkpixbufloader.html"
438
CLASS="INFORMALTABLE"
481
NAME="GDK-PIXBUF-LOADER-NEW"
483
>gdk_pixbuf_loader_new ()</H3
492
CLASS="PROGRAMLISTING"
494
HREF="gdkpixbufloader.html"
496
>* gdk_pixbuf_loader_new (void);</PRE
501
>Creates a new pixbuf loader object.</P
505
CLASS="INFORMALTABLE"
533
> A newly-created pixbuf loader.</TD
548
NAME="GDK-PIXBUF-LOADER-WRITE"
550
>gdk_pixbuf_loader_write ()</H3
559
CLASS="PROGRAMLISTING"
560
>gboolean gdk_pixbuf_loader_write (<A
561
HREF="gdkpixbufloader.html"
570
>This will cause a pixbuf loader to parse the next <TT
576
It will return TRUE if the data was loaded successfully, and FALSE if an
577
error occurred. In the latter case, the loader will be closed, and will not
578
accept further writes.</P
582
CLASS="INFORMALTABLE"
609
> A pixbuf loader.</TD
626
> Pointer to image data.</TD
648
> buffer in bytes.</TD
666
> TRUE if the write was successful, or FALSE if the loader
667
cannot parse the buffer.</TD
682
NAME="GDK-PIXBUF-LOADER-GET-PIXBUF"
684
>gdk_pixbuf_loader_get_pixbuf ()</H3
693
CLASS="PROGRAMLISTING"
694
>GdkPixbuf* gdk_pixbuf_loader_get_pixbuf (<A
695
HREF="gdkpixbufloader.html"
702
>Queries the GdkPixbuf that a pixbuf loader is currently creating. In general
703
it only makes sense to call this function afer the "area_prepared" signal has
704
been emitted by the loader; this means that enough data has been read to know
705
the size of the image that will be allocated. If the loader has not received
707
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-WRITE"
708
>gdk_pixbuf_loader_write</A
709
>(), then this function returns <TT
713
The returned pixbuf will be the same in all future calls to the loader, so
715
HREF="gdk-pixbuf-refcounting.html#GDK-PIXBUF-REF"
717
>() should be sufficient to continue using it. Additionally,
718
if the loader is an animation, it will return the first frame of the animation.</P
722
CLASS="INFORMALTABLE"
749
> A pixbuf loader.</TD
767
> The GdkPixbuf that the loader is creating, or <TT
771
enough data has been read to determine how to create the image buffer.</TD
786
NAME="GDK-PIXBUF-LOADER-GET-ANIMATION"
788
>gdk_pixbuf_loader_get_animation ()</H3
797
CLASS="PROGRAMLISTING"
798
>GdkPixbufAnimation* gdk_pixbuf_loader_get_animation
800
HREF="gdkpixbufloader.html"
807
>Queries the GdkPixbufAnimation that a pixbuf loader is currently creating.
808
In general it only makes sense to call this function afer the "area_prepared"
809
signal has been emitted by the loader. If the image is not an animation,
810
then it will return <TT
817
CLASS="INFORMALTABLE"
844
> A pixbuf loader</TD
862
> The GdkPixbufAnimation that the loader is loading, or <TT
866
not enough data has been read to determine the information.</TD
881
NAME="GDK-PIXBUF-LOADER-CLOSE"
883
>gdk_pixbuf_loader_close ()</H3
892
CLASS="PROGRAMLISTING"
893
>void gdk_pixbuf_loader_close (<A
894
HREF="gdkpixbufloader.html"
901
>Informs a pixbuf loader that no further writes with gdk_pixbuf_load_write()
902
will occur, so that it can free its internal loading structures.</P
906
CLASS="INFORMALTABLE"
933
> A pixbuf loader.</TD
956
NAME="GDKPIXBUFLOADER-AREA-UPDATED"
958
>The "area-updated" signal</H3
967
CLASS="PROGRAMLISTING"
968
>void user_function (<A
969
HREF="gdkpixbufloader.html"
976
gpointer user_data);</PRE
981
> This signal is emitted when a significant area of the image being
982
loaded has been updated. Normally it means that a complete
983
scanline has been read in, but it could be a different area as
984
well. Applications can use this signal to know when to repaint
985
areas of an image that is being loaded.
988
CLASS="INFORMALTABLE"
1015
>the object which received the signal.</TD
1100
>user data set when the signal handler was connected.</TD
1115
NAME="GDKPIXBUFLOADER-AREA-PREPARED"
1117
>The "area-prepared" signal</H3
1126
CLASS="PROGRAMLISTING"
1127
>void user_function (<A
1128
HREF="gdkpixbufloader.html"
1131
gpointer user_data);</PRE
1136
> This signal is emitted when the pixbuf loader has been fed the
1137
initial amount of data that is required to figure out the size and
1138
format of the image that it will create. After this signal is
1139
emitted, applications can call <A
1140
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-GET-PIXBUF"
1141
>gdk_pixbuf_loader_get_pixbuf</A
1143
fetch the partially-loaded pixbuf.
1146
CLASS="INFORMALTABLE"
1173
>the object which received the signal.</TD
1190
>user data set when the signal handler was connected.</TD
1205
NAME="GDKPIXBUFLOADER-FRAME-DONE"
1207
>The "frame-done" signal</H3
1216
CLASS="PROGRAMLISTING"
1217
>void user_function (<A
1218
HREF="gdkpixbufloader.html"
1222
gpointer user_data);</PRE
1227
> This signal is emitted when a frame is done loading. It will be
1228
emitted for each frame in an animation data stream.
1231
CLASS="INFORMALTABLE"
1258
>the object which received the signal.</TD
1292
>user data set when the signal handler was connected.</TD
1307
NAME="GDKPIXBUFLOADER-ANIMATION-DONE"
1309
>The "animation-done" signal</H3
1318
CLASS="PROGRAMLISTING"
1319
>void user_function (<A
1320
HREF="gdkpixbufloader.html"
1323
gpointer user_data);</PRE
1328
> This signal is emitted when an animation is done loading.
1331
CLASS="INFORMALTABLE"
1358
>the object which received the signal.</TD
1375
>user data set when the signal handler was connected.</TD
1390
NAME="GDKPIXBUFLOADER-CLOSED"
1392
>The "closed" signal</H3
1401
CLASS="PROGRAMLISTING"
1402
>void user_function (<A
1403
HREF="gdkpixbufloader.html"
1406
gpointer user_data);</PRE
1411
> This signal is emitted when <A
1412
HREF="gdkpixbufloader.html#GDK-PIXBUF-LOADER-CLOSE"
1413
>gdk_pixbuf_loader_close</A
1415
It can be used by different parts of an application to receive
1416
notification when an image loader is closed by the code that
1420
CLASS="INFORMALTABLE"
1447
>the object which received the signal.</TD
1464
>user data set when the signal handler was connected.</TD
1482
HREF="gdk-pixbuf-file-loading.html#GDK-PIXBUF-NEW-FROM-FILE"
1483
>gdk_pixbuf_new_from_file</A
1490
CLEAR="all"><BR><TABLE
1502
HREF="gdk-pixbuf-animation.html"
1507
><<< Previous Page</B
1556
HREF="gnomecanvaspixbuf.html"
1561
>Next Page >>></B
1584
>GnomeCanvasPixbuf</B
b'\\ No newline at end of file'