]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml
new function, turns off decorations for a window.
[~andy/gtk] / docs / reference / gdk-pixbuf / tmpl / gdk-pixbuf-loader.sgml
1 <!-- ##### SECTION Title ##### -->
2 GdkPixbufLoader
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Application-driven progressive image loading.
6
7 <!-- ##### SECTION Long_Description ##### -->
8   <para>
9     #GdkPixbufLoader provides a way for applications to drive the
10     process of loading an image, by letting them send the image data
11     directly to the loader instead of having the loader read the data
12     from a file.  Applications can use this functionality instead of
13     gdk_pixbuf_new_from_file() when they need to parse image data in
14     small chunks.  For example, it should be used when reading an
15     image from a (potentially) slow network connection, or when
16     loading an extremely large file.
17   </para>
18
19   <para>
20     To use #GdkPixbufLoader to load an image, just create a new one,
21     and call gdk_pixbuf_loader_write() to send the data to it.  When
22     done, gdk_pixbuf_loader_close() should be called to end the stream
23     and finalize everything.  The loader will emit two important
24     signals throughout the process.  The first, "<link
25     linkend="GdkPixbufLoader-area-prepared">area_prepared</link>",
26     will be called as soon as the image has enough information to
27     determine the size of the image to be used.  It will pass a
28     @GdkPixbuf in.  If you want to use it, you can simply ref it.  In
29     addition, no actual information will be passed in yet, so the
30     pixbuf can be safely filled with any temporary graphics (or an
31     initial color) as needed.  You can also call the
32     gdk_pixbuf_loader_get_pixbuf() once this signal has been emitted
33     and get the same pixbuf.
34   </para>
35
36   <para>
37     The other signal, "<link
38     linkend="GdkPixbufLoader-area-updated">area_updated</link>" gets
39     called every time a region is updated.  This way you can update a
40     partially completed image.  Note that you do not know anything
41     about the completeness of an image from the area updated.  For
42     example, in an interlaced image, you need to make several passes
43     before the image is done loading.
44   </para>
45
46   <refsect2>
47     <title>Loading an animation</title>
48
49     <para>
50       Loading an animation is a little more complex then loading an
51       image.  In addition to the above signals, there is also a "<link
52       linkend="GdkPixbufLoader-frame-done">frame_done</link>" signal,
53       as well as an "<link
54       linkend="GdkPixbufLoader-animation-done">animation_done</link>"
55       signal.  The first lets the application know that it is dealing
56       with an animation, instead of a static image.  It also passes a
57       #GdkPixbufFrame in the signal.  As before, if you want to keep
58       the frame, you need to ref it.  Once the first "<link
59       linkend="GdkPixbufLoader-frame-done">frame_done</link>" signal
60       has been emitted, you can call gdk_pixbuf_loader_get_animation()
61       to get the #GdkPixbufAnimation struct.  Each subsequent frame
62       goes through a similar lifecycle.  For example "<link
63       linkend="GdkPixbufLoader-area-prepared">area_prepared</link>" is
64       re-emitted.  Then "<link
65       linkend="GdkPixbufLoader-area-updated">area_updated</link>" is
66       emitted as many times as necessary.  Finally, "<link
67       linkend="GdkPixbufLoader-animation-done">animation_done</link>"
68       is emitted as soon as all frames are done.
69     </para>
70   </refsect2>
71
72 <!-- ##### SECTION See_Also ##### -->
73   <para>
74     gdk_pixbuf_new_from_file()
75   </para>
76
77 <!-- ##### FUNCTION gdk_pixbuf_loader_new ##### -->
78 <para>
79
80 </para>
81
82 @Returns: 
83
84
85 <!-- ##### FUNCTION gdk_pixbuf_loader_new_with_type ##### -->
86 <para>
87
88 </para>
89
90 @image_type: 
91 @error: 
92 @Returns: 
93
94
95 <!-- ##### FUNCTION gdk_pixbuf_loader_write ##### -->
96 <para>
97
98 </para>
99
100 @loader: 
101 @buf: 
102 @count: 
103 @error: 
104 @Returns: 
105
106
107 <!-- ##### FUNCTION gdk_pixbuf_loader_get_pixbuf ##### -->
108 <para>
109
110 </para>
111
112 @loader: 
113 @Returns: 
114
115
116 <!-- ##### FUNCTION gdk_pixbuf_loader_get_animation ##### -->
117 <para>
118
119 </para>
120
121 @loader: 
122 @Returns: 
123
124
125 <!-- ##### FUNCTION gdk_pixbuf_loader_close ##### -->
126 <para>
127
128 </para>
129
130 @loader: 
131 @error: 
132 @Returns: 
133
134
135 <!-- ##### SIGNAL GdkPixbufLoader::animation-done ##### -->
136   <para>
137     This signal is emitted when an animation is done loading.
138   </para>
139
140 @gdkpixbufloader: the object which received the signal.
141 <!-- # Unused Parameters # -->
142 @loader: Loader which emitted the signal.
143
144 <!-- ##### SIGNAL GdkPixbufLoader::area-prepared ##### -->
145   <para>
146     This signal is emitted when the pixbuf loader has been fed the
147     initial amount of data that is required to figure out the size and
148     format of the image that it will create.  After this signal is
149     emitted, applications can call gdk_pixbuf_loader_get_pixbuf() to
150     fetch the partially-loaded pixbuf.
151   </para>
152
153 @gdkpixbufloader: the object which received the signal.
154 <!-- # Unused Parameters # -->
155 @loader: Loader which emitted the signal.
156
157 <!-- ##### SIGNAL GdkPixbufLoader::area-updated ##### -->
158   <para>
159     This signal is emitted when a significant area of the image being
160     loaded has been updated.  Normally it means that a complete
161     scanline has been read in, but it could be a different area as
162     well.  Applications can use this signal to know when to repaint
163     areas of an image that is being loaded.
164   </para>
165
166 @gdkpixbufloader: the object which received the signal.
167 @arg1: 
168 @arg2: 
169 @arg3: 
170 @arg4: 
171 <!-- # Unused Parameters # -->
172 @loader: Loader which emitted the signal.
173 @x: X offset of upper-left corner of the updated area.
174 @y: Y offset of upper-left corner of the updated area.
175 @width: Width of updated area.
176 @height: Height of updated area.
177
178 <!-- ##### SIGNAL GdkPixbufLoader::closed ##### -->
179   <para>
180     This signal is emitted when gdk_pixbuf_loader_close() is called.
181     It can be used by different parts of an application to receive
182     notification when an image loader is closed by the code that
183     drives it.
184   </para>
185
186 @gdkpixbufloader: the object which received the signal.
187 <!-- # Unused Parameters # -->
188 @loader: Loader which emitted the signal.
189
190 <!--
191 Local variables:
192 mode: sgml
193 sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
194 End:
195 -->
196
197 <!-- ##### SIGNAL GdkPixbufLoader::frame-done ##### -->
198   <para>
199     This signal is emitted when a frame is done loading.  It will be
200     emitted for each frame in an animation data stream.
201   </para>
202
203 @gdkpixbufloader: the object which received the signal.
204 @arg1: 
205 <!-- # Unused Parameters # -->
206 @loader: Loader which emitted the signal.
207 @frame: Frame which just completed loading.
208