]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml
Commit autogenerated changes, so patches will make sense.
[~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() or gdk_pixbuf_animation_new_from_file() 
14     when they need to parse image data in
15     small chunks.  For example, it should be used when reading an
16     image from a (potentially) slow network connection, or when
17     loading an extremely large file.
18   </para>
19
20   <para>
21     To use #GdkPixbufLoader to load an image, just create a new one,
22     and call gdk_pixbuf_loader_write() to send the data to it.  When
23     done, gdk_pixbuf_loader_close() should be called to end the stream
24     and finalize everything.  The loader will emit three important
25     signals throughout the process.  The first, "<link
26     linkend="GdkPixbufLoader-size-prepared">size_prepared</link>",
27     will be called as soon as the image has enough information to
28     determine the size of the image to be used. If you want to scale
29     the image while loading it, you can call gdk_pixbuf_loader_set_size()
30     in response to this signal.
31     </para>
32
33     <para>The second signal, "<link
34     linkend="GdkPixbufLoader-area-prepared">area_prepared</link>",
35     will be called as soon as the pixbuf of the desired has been 
36     allocated.  You can obtain it by calling gdk_pixbuf_loader_get_pixbuf(). 
37     If you want to use it, simply ref it.  
38     In addition, no actual information will be passed in yet, so the
39     pixbuf can be safely filled with any temporary graphics (or an
40     initial color) as needed.  You can also call
41     gdk_pixbuf_loader_get_pixbuf() later and get the same pixbuf.
42   </para>
43
44   <para>
45     The last signal, "<link
46     linkend="GdkPixbufLoader-area-updated">area_updated</link>" gets
47     called every time a region is updated.  This way you can update a
48     partially completed image.  Note that you do not know anything
49     about the completeness of an image from the area updated.  For
50     example, in an interlaced image, you need to make several passes
51     before the image is done loading.
52   </para>
53
54   <refsect2>
55     <title>Loading an animation</title>
56
57     <para>
58       Loading an animation is almost as easy as loading an
59       image.  Once the first "<link
60       linkend="GdkPixbufLoader-area-prepared">area_prepared</link>" signal
61       has been emitted, you can call gdk_pixbuf_loader_get_animation()
62       to get the #GdkPixbufAnimation struct and gdk_pixbuf_animation_get_iter()
63       to get an #GdkPixbufAnimationIter for displaying it. 
64     </para>
65   </refsect2>
66
67 <!-- ##### SECTION See_Also ##### -->
68   <para>
69     gdk_pixbuf_new_from_file(), gdk_pixbuf_animation_new_from_file()
70   </para>
71
72 <!-- ##### STRUCT GdkPixbufLoader ##### -->
73 <para>
74 The <structname>GdkPixbufLoader</structname> struct contains only private
75 fields. 
76 </para>
77
78
79 <!-- ##### FUNCTION gdk_pixbuf_loader_new ##### -->
80 <para>
81
82 </para>
83
84 @Returns: 
85
86
87 <!-- ##### FUNCTION gdk_pixbuf_loader_new_with_type ##### -->
88 <para>
89
90 </para>
91
92 @image_type: 
93 @error: 
94 @Returns: 
95
96
97 <!-- ##### FUNCTION gdk_pixbuf_loader_new_with_mime_type ##### -->
98 <para>
99
100 </para>
101
102 @mime_type: 
103 @error: 
104 @Returns: 
105
106
107 <!-- ##### FUNCTION gdk_pixbuf_loader_get_format ##### -->
108 <para>
109
110 </para>
111
112 @loader: 
113 @Returns: 
114
115
116 <!-- ##### FUNCTION gdk_pixbuf_loader_write ##### -->
117 <para>
118
119 </para>
120
121 @loader: 
122 @buf: 
123 @count: 
124 @error: 
125 @Returns: 
126
127
128 <!-- ##### FUNCTION gdk_pixbuf_loader_set_size ##### -->
129 <para>
130
131 </para>
132
133 @loader: 
134 @width: 
135 @height: 
136
137
138 <!-- ##### FUNCTION gdk_pixbuf_loader_get_pixbuf ##### -->
139 <para>
140
141 </para>
142
143 @loader: 
144 @Returns: 
145
146
147 <!-- ##### FUNCTION gdk_pixbuf_loader_get_animation ##### -->
148 <para>
149
150 </para>
151
152 @loader: 
153 @Returns: 
154
155
156 <!-- ##### FUNCTION gdk_pixbuf_loader_close ##### -->
157 <para>
158
159 </para>
160
161 @loader: 
162 @error: 
163 @Returns: 
164
165
166 <!-- ##### SIGNAL GdkPixbufLoader::area-prepared ##### -->
167   <para>
168     This signal is emitted when the pixbuf loader has allocated the pixbuf
169     in the desired size.  After this signal is emitted, applications can 
170     call gdk_pixbuf_loader_get_pixbuf() to fetch the partially-loaded pixbuf.
171   </para>
172
173 @gdkpixbufloader: the object which received the signal.
174
175 <!-- ##### SIGNAL GdkPixbufLoader::area-updated ##### -->
176   <para>
177     This signal is emitted when a significant area of the image being
178     loaded has been updated.  Normally it means that a complete
179     scanline has been read in, but it could be a different area as
180     well.  Applications can use this signal to know when to repaint
181     areas of an image that is being loaded.
182   </para>
183
184 @gdkpixbufloader: Loader which emitted the signal.
185 @arg1: 
186 @arg2: 
187 @arg3: 
188 @arg4: 
189 <!-- # Unused Parameters # -->
190 @x: X offset of upper-left corner of the updated area.
191 @y: Y offset of upper-left corner of the updated area.
192 @width: Width of updated area.
193 @height: Height of updated area.
194
195 <!-- ##### SIGNAL GdkPixbufLoader::closed ##### -->
196   <para>
197     This signal is emitted when gdk_pixbuf_loader_close() is called.
198     It can be used by different parts of an application to receive
199     notification when an image loader is closed by the code that
200     drives it.
201   </para>
202
203 @gdkpixbufloader: the object which received the signal.
204
205 <!--
206 Local variables:
207 mode: sgml
208 sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
209 End:
210 -->
211
212 <!-- ##### SIGNAL GdkPixbufLoader::size-prepared ##### -->
213   <para>
214     This signal is emitted when the pixbuf loader has been fed the
215     initial amount of data that is required to figure out the size
216     of the image that it will create.  Applications can call  
217     gdk_pixbuf_loader_set_size() in response to this signal to set
218     the desired size to which the image should be scaled.
219   </para>
220
221 @gdkpixbufloader: the object which received the signal.
222 @arg1: 
223 @arg2: 
224 <!-- # Unused Parameters # -->
225 @width: the original width of the image
226 @height: the original height of the image
227