1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gdkpixbuf.c.types;
26 
27 public import gio.c.types;
28 public import glib.c.types;
29 public import gobject.c.types;
30 
31 
32 /**
33  * This enumeration defines the color spaces that are supported by
34  * the gdk-pixbuf library.
35  *
36  * Currently only RGB is supported.
37  */
38 public enum GdkColorspace
39 {
40 	/**
41 	 * Indicates a red/green/blue additive color space.
42 	 */
43 	RGB = 0,
44 }
45 alias GdkColorspace Colorspace;
46 
47 /**
48  * Interpolation modes for scaling functions.
49  *
50  * The `GDK_INTERP_NEAREST` mode is the fastest scaling method, but has
51  * horrible quality when scaling down; `GDK_INTERP_BILINEAR` is the best
52  * choice if you aren't sure what to choose, it has a good speed/quality
53  * balance.
54  *
55  * **Note**: Cubic filtering is missing from the list; hyperbolic
56  * interpolation is just as fast and results in higher quality.
57  */
58 public enum GdkInterpType
59 {
60 	/**
61 	 * Nearest neighbor sampling; this is the fastest
62 	 * and lowest quality mode. Quality is normally unacceptable when scaling
63 	 * down, but may be OK when scaling up.
64 	 */
65 	NEAREST = 0,
66 	/**
67 	 * This is an accurate simulation of the PostScript
68 	 * image operator without any interpolation enabled.  Each pixel is
69 	 * rendered as a tiny parallelogram of solid color, the edges of which
70 	 * are implemented with antialiasing.  It resembles nearest neighbor for
71 	 * enlargement, and bilinear for reduction.
72 	 */
73 	TILES = 1,
74 	/**
75 	 * Best quality/speed balance; use this mode by
76 	 * default. Bilinear interpolation.  For enlargement, it is
77 	 * equivalent to point-sampling the ideal bilinear-interpolated image.
78 	 * For reduction, it is equivalent to laying down small tiles and
79 	 * integrating over the coverage area.
80 	 */
81 	BILINEAR = 2,
82 	/**
83 	 * This is the slowest and highest quality
84 	 * reconstruction function. It is derived from the hyperbolic filters in
85 	 * Wolberg's "Digital Image Warping", and is formally defined as the
86 	 * hyperbolic-filter sampling the ideal hyperbolic-filter interpolated
87 	 * image (the filter is designed to be idempotent for 1:1 pixel mapping).
88 	 * **Deprecated**: this interpolation filter is deprecated, as in reality
89 	 * it has a lower quality than the @GDK_INTERP_BILINEAR filter
90 	 * (Since: 2.38)
91 	 */
92 	HYPER = 3,
93 }
94 alias GdkInterpType InterpType;
95 
96 /**
97  * Control the alpha channel for drawables.
98  *
99  * These values can be passed to gdk_pixbuf_xlib_render_to_drawable_alpha()
100  * in gdk-pixbuf-xlib to control how the alpha channel of an image should
101  * be handled.
102  *
103  * This function can create a bilevel clipping mask (black and white) and use
104  * it while painting the image.
105  *
106  * In the future, when the X Window System gets an alpha channel extension,
107  * it will be possible to do full alpha compositing onto arbitrary drawables.
108  * For now both cases fall back to a bilevel clipping mask.
109  *
110  * Deprecated: There is no user of GdkPixbufAlphaMode in GdkPixbuf,
111  * and the Xlib utility functions have been split out to their own
112  * library, gdk-pixbuf-xlib
113  */
114 public enum GdkPixbufAlphaMode
115 {
116 	/**
117 	 * A bilevel clipping mask (black and white)
118 	 * will be created and used to draw the image.  Pixels below 0.5 opacity
119 	 * will be considered fully transparent, and all others will be
120 	 * considered fully opaque.
121 	 */
122 	BILEVEL = 0,
123 	/**
124 	 * For now falls back to #GDK_PIXBUF_ALPHA_BILEVEL.
125 	 * In the future it will do full alpha compositing.
126 	 */
127 	FULL = 1,
128 }
129 alias GdkPixbufAlphaMode PixbufAlphaMode;
130 
131 /**
132  * An error code in the `GDK_PIXBUF_ERROR` domain.
133  *
134  * Many gdk-pixbuf operations can cause errors in this domain, or in
135  * the `G_FILE_ERROR` domain.
136  */
137 public enum GdkPixbufError
138 {
139 	/**
140 	 * An image file was broken somehow.
141 	 */
142 	CORRUPT_IMAGE = 0,
143 	/**
144 	 * Not enough memory.
145 	 */
146 	INSUFFICIENT_MEMORY = 1,
147 	/**
148 	 * A bad option was passed to a pixbuf save module.
149 	 */
150 	BAD_OPTION = 2,
151 	/**
152 	 * Unknown image type.
153 	 */
154 	UNKNOWN_TYPE = 3,
155 	/**
156 	 * Don't know how to perform the
157 	 * given operation on the type of image at hand.
158 	 */
159 	UNSUPPORTED_OPERATION = 4,
160 	/**
161 	 * Generic failure code, something went wrong.
162 	 */
163 	FAILED = 5,
164 	/**
165 	 * Only part of the animation was loaded.
166 	 */
167 	INCOMPLETE_ANIMATION = 6,
168 }
169 alias GdkPixbufError PixbufError;
170 
171 /**
172  * Flags which allow a module to specify further details about the supported
173  * operations.
174  *
175  * Since: 2.2
176  */
177 public enum GdkPixbufFormatFlags
178 {
179 	/**
180 	 * the module can write out images in the format.
181 	 */
182 	WRITABLE = 1,
183 	/**
184 	 * the image format is scalable
185 	 */
186 	SCALABLE = 2,
187 	/**
188 	 * the module is threadsafe. gdk-pixbuf
189 	 * ignores modules that are not marked as threadsafe. (Since 2.28).
190 	 */
191 	THREADSAFE = 4,
192 }
193 alias GdkPixbufFormatFlags PixbufFormatFlags;
194 
195 /**
196  * The possible rotations which can be passed to gdk_pixbuf_rotate_simple().
197  *
198  * To make them easier to use, their numerical values are the actual degrees.
199  */
200 public enum GdkPixbufRotation
201 {
202 	/**
203 	 * No rotation.
204 	 */
205 	NONE = 0,
206 	/**
207 	 * Rotate by 90 degrees.
208 	 */
209 	COUNTERCLOCKWISE = 90,
210 	/**
211 	 * Rotate by 180 degrees.
212 	 */
213 	UPSIDEDOWN = 180,
214 	/**
215 	 * Rotate by 270 degrees.
216 	 */
217 	CLOCKWISE = 270,
218 }
219 alias GdkPixbufRotation PixbufRotation;
220 
221 /**
222  * An enumeration which is used by gdk_pixdata_to_csource() to
223  * determine the form of C source to be generated. The three values
224  * @GDK_PIXDATA_DUMP_PIXDATA_STREAM, @GDK_PIXDATA_DUMP_PIXDATA_STRUCT
225  * and @GDK_PIXDATA_DUMP_MACROS are mutually exclusive, as are
226  * @GDK_PIXBUF_DUMP_GTYPES and @GDK_PIXBUF_DUMP_CTYPES. The remaining
227  * elements are optional flags that can be freely added.
228  */
229 public enum GdkPixdataDumpType
230 {
231 	/**
232 	 * Generate pixbuf data stream (a single
233 	 * string containing a serialized #GdkPixdata structure in network byte
234 	 * order).
235 	 */
236 	PIXDATA_STREAM = 0,
237 	/**
238 	 * Generate #GdkPixdata structure (needs
239 	 * the #GdkPixdata structure definition from gdk-pixdata.h).
240 	 */
241 	PIXDATA_STRUCT = 1,
242 	/**
243 	 * Generate <function>*_ROWSTRIDE</function>,
244 	 * <function>*_WIDTH</function>, <function>*_HEIGHT</function>,
245 	 * <function>*_BYTES_PER_PIXEL</function> and
246 	 * <function>*_RLE_PIXEL_DATA</function> or <function>*_PIXEL_DATA</function>
247 	 * macro definitions for the image.
248 	 */
249 	MACROS = 2,
250 	/**
251 	 * Generate GLib data types instead of
252 	 * standard C data types.
253 	 */
254 	GTYPES = 0,
255 	/**
256 	 * Generate standard C data types instead of
257 	 * GLib data types.
258 	 */
259 	CTYPES = 256,
260 	/**
261 	 * Generate static symbols.
262 	 */
263 	STATIC = 512,
264 	/**
265 	 * Generate const symbols.
266 	 */
267 	CONST = 1024,
268 	/**
269 	 * Provide a <function>*_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp)</function>
270 	 * macro definition  to  decode  run-length encoded image data.
271 	 */
272 	RLE_DECODER = 65536,
273 }
274 alias GdkPixdataDumpType PixdataDumpType;
275 
276 /**
277  * An enumeration containing three sets of flags for a #GdkPixdata struct:
278  * one for the used colorspace, one for the width of the samples and one
279  * for the encoding of the pixel data.
280  */
281 public enum GdkPixdataType
282 {
283 	/**
284 	 * each pixel has red, green and blue samples.
285 	 */
286 	COLOR_TYPE_RGB = 1,
287 	/**
288 	 * each pixel has red, green and blue samples
289 	 * and an alpha value.
290 	 */
291 	COLOR_TYPE_RGBA = 2,
292 	/**
293 	 * mask for the colortype flags of the enum.
294 	 */
295 	COLOR_TYPE_MASK = 255,
296 	/**
297 	 * each sample has 8 bits.
298 	 */
299 	SAMPLE_WIDTH_8 = 65536,
300 	/**
301 	 * mask for the sample width flags of the enum.
302 	 */
303 	SAMPLE_WIDTH_MASK = 983040,
304 	/**
305 	 * the pixel data is in raw form.
306 	 */
307 	ENCODING_RAW = 16777216,
308 	/**
309 	 * the pixel data is run-length encoded. Runs may
310 	 * be up to 127 bytes long; their length is stored in a single byte
311 	 * preceding the pixel data for the run. If a run is constant, its length
312 	 * byte has the high bit set and the pixel data consists of a single pixel
313 	 * which must be repeated.
314 	 */
315 	ENCODING_RLE = 33554432,
316 	/**
317 	 * mask for the encoding flags of the enum.
318 	 */
319 	ENCODING_MASK = 251658240,
320 }
321 alias GdkPixdataType PixdataType;
322 
323 struct GdkPixbuf;
324 
325 struct GdkPixbufAnimation
326 {
327 	GObject parentInstance;
328 }
329 
330 /**
331  * Modules supporting animations must derive a type from
332  * #GdkPixbufAnimation, providing suitable implementations of the
333  * virtual functions.
334  */
335 struct GdkPixbufAnimationClass
336 {
337 	/**
338 	 * the parent class
339 	 */
340 	GObjectClass parentClass;
341 	/**
342 	 *
343 	 * Params:
344 	 *     animation = a #GdkPixbufAnimation
345 	 * Returns: `TRUE` if the "animation" was really just an image
346 	 */
347 	extern(C) int function(GdkPixbufAnimation* animation) isStaticImage;
348 	/**
349 	 *
350 	 * Params:
351 	 *     animation = a #GdkPixbufAnimation
352 	 * Returns: unanimated image representing the animation
353 	 */
354 	extern(C) GdkPixbuf* function(GdkPixbufAnimation* animation) getStaticImage;
355 	/** */
356 	extern(C) void function(GdkPixbufAnimation* animation, int* width, int* height) getSize;
357 	/**
358 	 *
359 	 * Params:
360 	 *     animation = a #GdkPixbufAnimation
361 	 *     startTime = time when the animation starts playing
362 	 * Returns: an iterator to move over the animation
363 	 */
364 	extern(C) GdkPixbufAnimationIter* function(GdkPixbufAnimation* animation, GTimeVal* startTime) getIter;
365 }
366 
367 struct GdkPixbufAnimationIter
368 {
369 	GObject parentInstance;
370 }
371 
372 /**
373  * Modules supporting animations must derive a type from
374  * #GdkPixbufAnimationIter, providing suitable implementations of the
375  * virtual functions.
376  */
377 struct GdkPixbufAnimationIterClass
378 {
379 	/**
380 	 * the parent class
381 	 */
382 	GObjectClass parentClass;
383 	/**
384 	 *
385 	 * Params:
386 	 *     iter = an animation iterator
387 	 * Returns: delay time in milliseconds (thousandths of a second)
388 	 */
389 	extern(C) int function(GdkPixbufAnimationIter* iter) getDelayTime;
390 	/**
391 	 *
392 	 * Params:
393 	 *     iter = an animation iterator
394 	 * Returns: the pixbuf to be displayed
395 	 */
396 	extern(C) GdkPixbuf* function(GdkPixbufAnimationIter* iter) getPixbuf;
397 	/**
398 	 *
399 	 * Params:
400 	 *     iter = a #GdkPixbufAnimationIter
401 	 * Returns: `TRUE` if the frame we're on is partially loaded, or the last frame
402 	 */
403 	extern(C) int function(GdkPixbufAnimationIter* iter) onCurrentlyLoadingFrame;
404 	/**
405 	 *
406 	 * Params:
407 	 *     iter = a #GdkPixbufAnimationIter
408 	 *     currentTime = current time
409 	 * Returns: `TRUE` if the image may need updating
410 	 */
411 	extern(C) int function(GdkPixbufAnimationIter* iter, GTimeVal* currentTime) advance;
412 }
413 
414 struct GdkPixbufFormat
415 {
416 	/**
417 	 * the name of the image format
418 	 */
419 	char* name;
420 	/**
421 	 * the signature of the module
422 	 */
423 	GdkPixbufModulePattern* signature;
424 	/**
425 	 * the message domain for the `description`
426 	 */
427 	char* domain;
428 	/**
429 	 * a description of the image format
430 	 */
431 	char* description;
432 	/**
433 	 * the MIME types for the image format
434 	 */
435 	char** mimeTypes;
436 	/**
437 	 * typical filename extensions for the
438 	 * image format
439 	 */
440 	char** extensions;
441 	/**
442 	 * a combination of `GdkPixbufFormatFlags`
443 	 */
444 	uint flags;
445 	/**
446 	 * a boolean determining whether the loader is disabled`
447 	 */
448 	bool disabled;
449 	/**
450 	 * a string containing license information, typically set to
451 	 * shorthands like "GPL", "LGPL", etc.
452 	 */
453 	char* license;
454 }
455 
456 struct GdkPixbufLoader
457 {
458 	GObject parentInstance;
459 	void* priv;
460 }
461 
462 struct GdkPixbufLoaderClass
463 {
464 	GObjectClass parentClass;
465 	/** */
466 	extern(C) void function(GdkPixbufLoader* loader, int width, int height) sizePrepared;
467 	/** */
468 	extern(C) void function(GdkPixbufLoader* loader) areaPrepared;
469 	/** */
470 	extern(C) void function(GdkPixbufLoader* loader, int x, int y, int width, int height) areaUpdated;
471 	/** */
472 	extern(C) void function(GdkPixbufLoader* loader) closed;
473 }
474 
475 /**
476  * A `GdkPixbufModule` contains the necessary functions to load and save
477  * images in a certain file format.
478  *
479  * If `GdkPixbuf` has been compiled with `GModule` support, it can be extended
480  * by modules which can load (and perhaps also save) new image and animation
481  * formats.
482  *
483  * ## Implementing modules
484  *
485  * The `GdkPixbuf` interfaces needed for implementing modules are contained in
486  * `gdk-pixbuf-io.h` (and `gdk-pixbuf-animation.h` if the module supports
487  * animations). They are not covered by the same stability guarantees as the
488  * regular GdkPixbuf API. To underline this fact, they are protected by the
489  * `GDK_PIXBUF_ENABLE_BACKEND` pre-processor symbol.
490  *
491  * Each loadable module must contain a `GdkPixbufModuleFillVtableFunc` function
492  * named `fill_vtable`, which will get called when the module
493  * is loaded and must set the function pointers of the `GdkPixbufModule`.
494  *
495  * In order to make format-checking work before actually loading the modules
496  * (which may require calling `dlopen` to load image libraries), modules export
497  * their signatures (and other information) via the `fill_info` function. An
498  * external utility, `gdk-pixbuf-query-loaders`, uses this to create a text
499  * file containing a list of all available loaders and  their signatures.
500  * This file is then read at runtime by `GdkPixbuf` to obtain the list of
501  * available loaders and their signatures.
502  *
503  * Modules may only implement a subset of the functionality available via
504  * `GdkPixbufModule`. If a particular functionality is not implemented, the
505  * `fill_vtable` function will simply not set the corresponding
506  * function pointers of the `GdkPixbufModule` structure. If a module supports
507  * incremental loading (i.e. provides `begin_load`, `stop_load` and
508  * `load_increment`), it doesn't have to implement `load`, since `GdkPixbuf`
509  * can supply a generic `load` implementation wrapping the incremental loading.
510  *
511  * ## Installing modules
512  *
513  * Installing a module is a two-step process:
514  *
515  * - copy the module file(s) to the loader directory (normally
516  * `$libdir/gdk-pixbuf-2.0/$version/loaders`, unless overridden by the
517  * environment variable `GDK_PIXBUF_MODULEDIR`)
518  * - call `gdk-pixbuf-query-loaders` to update the module file (normally
519  * `$libdir/gdk-pixbuf-2.0/$version/loaders.cache`, unless overridden
520  * by the environment variable `GDK_PIXBUF_MODULE_FILE`)
521  */
522 struct GdkPixbufModule
523 {
524 	/**
525 	 * the name of the module, usually the same as the
526 	 * usual file extension for images of this type, eg. "xpm", "jpeg" or "png".
527 	 */
528 	char* moduleName;
529 	/**
530 	 * the path from which the module is loaded.
531 	 */
532 	char* modulePath;
533 	/**
534 	 * the loaded `GModule`.
535 	 */
536 	GModule* module_;
537 	/**
538 	 * a `GdkPixbufFormat` holding information about the module.
539 	 */
540 	GdkPixbufFormat* info;
541 	/** */
542 	extern(C) GdkPixbuf* function(FILE* f, GError** err) load;
543 	/** */
544 	extern(C) GdkPixbuf* function(char** data) loadXpmData;
545 	/** */
546 	extern(C) void* function(GdkPixbufModuleSizeFunc sizeFunc, GdkPixbufModulePreparedFunc preparedFunc, GdkPixbufModuleUpdatedFunc updatedFunc, void* userData, GError** err) beginLoad;
547 	/** */
548 	extern(C) int function(void* context, GError** err) stopLoad;
549 	/** */
550 	extern(C) int function(void* context, char* buf, uint size, GError** err) loadIncrement;
551 	/** */
552 	extern(C) GdkPixbufAnimation* function(FILE* f, GError** err) loadAnimation;
553 	/** */
554 	extern(C) int function(FILE* f, GdkPixbuf* pixbuf, char** paramKeys, char** paramValues, GError** err) save;
555 	/** */
556 	extern(C) int function(GdkPixbufSaveFunc saveFunc, void* userData, GdkPixbuf* pixbuf, char** optionKeys, char** optionValues, GError** err) saveToCallback;
557 	/** */
558 	extern(C) int function(const(char)* optionKey) isSaveOptionSupported;
559 	/** */
560 	extern(C) void function() Reserved1;
561 	/** */
562 	extern(C) void function() Reserved2;
563 	/** */
564 	extern(C) void function() Reserved3;
565 	/** */
566 	extern(C) void function() Reserved4;
567 }
568 
569 /**
570  * The signature prefix for a module.
571  *
572  * The signature of a module is a set of prefixes. Prefixes are encoded as
573  * pairs of ordinary strings, where the second string, called the mask, if
574  * not `NULL`, must be of the same length as the first one and may contain
575  * ' ', '!', 'x', 'z', and 'n' to indicate bytes that must be matched,
576  * not matched, "don't-care"-bytes, zeros and non-zeros, respectively.
577  *
578  * Each prefix has an associated integer that describes the relevance of
579  * the prefix, with 0 meaning a mismatch and 100 a "perfect match".
580  *
581  * Starting with gdk-pixbuf 2.8, the first byte of the mask may be '*',
582  * indicating an unanchored pattern that matches not only at the beginning,
583  * but also in the middle. Versions prior to 2.8 will interpret the '*'
584  * like an 'x'.
585  *
586  * The signature of a module is stored as an array of
587  * `GdkPixbufModulePatterns`. The array is terminated by a pattern
588  * where the `prefix` is `NULL`.
589  *
590  * ```c
591  * GdkPixbufModulePattern *signature[] = {
592  * { "abcdx", " !x z", 100 },
593  * { "bla", NULL,  90 },
594  * { NULL, NULL, 0 }
595  * };
596  * ```
597  *
598  * In the example above, the signature matches e.g. "auud\0" with
599  * relevance 100, and "blau" with relevance 90.
600  *
601  * Since: 2.2
602  */
603 struct GdkPixbufModulePattern
604 {
605 	/**
606 	 * the prefix for this pattern
607 	 */
608 	char* prefix;
609 	/**
610 	 * mask containing bytes which modify how the prefix is matched against
611 	 * test data
612 	 */
613 	char* mask;
614 	/**
615 	 * relevance of this pattern
616 	 */
617 	int relevance;
618 }
619 
620 struct GdkPixbufNonAnim;
621 
622 struct GdkPixbufSimpleAnim;
623 
624 struct GdkPixbufSimpleAnimClass;
625 
626 struct GdkPixbufSimpleAnimIter;
627 
628 struct GdkPixdata
629 {
630 	/**
631 	 * magic number. A valid `GdkPixdata` structure must have
632 	 * `GDK_PIXBUF_MAGIC_NUMBER` here
633 	 */
634 	uint magic;
635 	/**
636 	 * less than 1 to disable length checks, otherwise
637 	 * `GDK_PIXDATA_HEADER_LENGTH` plus the length of `pixel_data`
638 	 */
639 	int length;
640 	/**
641 	 * information about colorspace, sample width and
642 	 * encoding, in a `GdkPixdataType`
643 	 */
644 	uint pixdataType;
645 	/**
646 	 * Distance in bytes between rows
647 	 */
648 	uint rowstride;
649 	/**
650 	 * Width of the image in pixels
651 	 */
652 	uint width;
653 	/**
654 	 * Height of the image in pixels
655 	 */
656 	uint height;
657 	/**
658 	 * `width` x `height`
659 	 * pixels, encoded according to `pixdata_type` and `rowstride`
660 	 */
661 	ubyte* pixelData;
662 }
663 
664 /**
665  * A function of this type is responsible for freeing the pixel array
666  * of a pixbuf.
667  *
668  * The gdk_pixbuf_new_from_data() function lets you pass in a pre-allocated
669  * pixel array so that a pixbuf can be created from it; in this case you
670  * will need to pass in a function of type `GdkPixbufDestroyNotify` so that
671  * the pixel data can be freed when the pixbuf is finalized.
672  *
673  * Params:
674  *     pixels = The pixel array of the pixbuf
675  *         that is being finalized.
676  *     data = User closure data.
677  */
678 public alias extern(C) void function(char* pixels, void* data) GdkPixbufDestroyNotify;
679 
680 /**
681  * Defines the type of the function used to fill a
682  * #GdkPixbufFormat structure with information about a module.
683  *
684  * Params:
685  *     info = a #GdkPixbufFormat.
686  *
687  * Since: 2.2
688  */
689 public alias extern(C) void function(GdkPixbufFormat* info) GdkPixbufModuleFillInfoFunc;
690 
691 /**
692  * Defines the type of the function used to set the vtable of a
693  * #GdkPixbufModule when it is loaded.
694  *
695  * Params:
696  *     module_ = a #GdkPixbufModule.
697  *
698  * Since: 2.2
699  */
700 public alias extern(C) void function(GdkPixbufModule* module_) GdkPixbufModuleFillVtableFunc;
701 
702 /**
703  * Defines the type of the function that gets called once the initial
704  * setup of @pixbuf is done.
705  *
706  * #GdkPixbufLoader uses a function of this type to emit the
707  * "<link linkend="GdkPixbufLoader-area-prepared">area_prepared</link>"
708  * signal.
709  *
710  * Params:
711  *     pixbuf = the #GdkPixbuf that is currently being loaded.
712  *     anim = if an animation is being loaded, the #GdkPixbufAnimation, else %NULL.
713  *     userData = the loader.
714  *
715  * Since: 2.2
716  */
717 public alias extern(C) void function(GdkPixbuf* pixbuf, GdkPixbufAnimation* anim, void* userData) GdkPixbufModulePreparedFunc;
718 
719 /**
720  * Defines the type of the function that gets called once the size
721  * of the loaded image is known.
722  *
723  * The function is expected to set @width and @height to the desired
724  * size to which the image should be scaled. If a module has no efficient
725  * way to achieve the desired scaling during the loading of the image, it may
726  * either ignore the size request, or only approximate it - gdk-pixbuf will
727  * then perform the required scaling on the completely loaded image.
728  *
729  * If the function sets @width or @height to zero, the module should interpret
730  * this as a hint that it will be closed soon and shouldn't allocate further
731  * resources. This convention is used to implement gdk_pixbuf_get_file_info()
732  * efficiently.
733  *
734  * Params:
735  *     width = pointer to a location containing the current image width
736  *     height = pointer to a location containing the current image height
737  *     userData = the loader.
738  *
739  * Since: 2.2
740  */
741 public alias extern(C) void function(int* width, int* height, void* userData) GdkPixbufModuleSizeFunc;
742 
743 /**
744  * Defines the type of the function that gets called every time a region
745  * of @pixbuf is updated.
746  *
747  * #GdkPixbufLoader uses a function of this type to emit the
748  * "<link linkend="GdkPixbufLoader-area-updated">area_updated</link>"
749  * signal.
750  *
751  * Params:
752  *     pixbuf = the #GdkPixbuf that is currently being loaded.
753  *     x = the X origin of the updated area.
754  *     y = the Y origin of the updated area.
755  *     width = the width of the updated area.
756  *     height = the height of the updated area.
757  *     userData = the loader.
758  *
759  * Since: 2.2
760  */
761 public alias extern(C) void function(GdkPixbuf* pixbuf, int x, int y, int width, int height, void* userData) GdkPixbufModuleUpdatedFunc;
762 
763 /**
764  * Save functions used by [method@GdkPixbuf.Pixbuf.save_to_callback].
765  *
766  * This function is called once for each block of bytes that is "written"
767  * by `gdk_pixbuf_save_to_callback()`.
768  *
769  * If successful it should return `TRUE`; if an error occurs it should set
770  * `error` and return `FALSE`, in which case `gdk_pixbuf_save_to_callback()`
771  * will fail with the same error.
772  *
773  * Params:
774  *     buf = bytes to be written.
775  *     count = number of bytes in @buf.
776  *     error = A location to return an error.
777  *     data = user data passed to gdk_pixbuf_save_to_callback().
778  *
779  * Returns: `TRUE` if successful, `FALSE` otherwise
780  *
781  * Since: 2.4
782  */
783 public alias extern(C) int function(char* buf, size_t count, GError** error, void* data) GdkPixbufSaveFunc;
784 
785 import core.stdc.stdio;
786 
787 /**
788  * Major version of gdk-pixbuf library, that is the "0" in
789  * "0.8.2" for example.
790  */
791 enum PIXBUF_MAJOR = 2;
792 alias GDK_PIXBUF_MAJOR = PIXBUF_MAJOR;
793 
794 /**
795  * Micro version of gdk-pixbuf library, that is the "2" in
796  * "0.8.2" for example.
797  */
798 enum PIXBUF_MICRO = 6;
799 alias GDK_PIXBUF_MICRO = PIXBUF_MICRO;
800 
801 /**
802  * Minor version of gdk-pixbuf library, that is the "8" in
803  * "0.8.2" for example.
804  */
805 enum PIXBUF_MINOR = 42;
806 alias GDK_PIXBUF_MINOR = PIXBUF_MINOR;
807 
808 /**
809  * Contains the full version of GdkPixbuf as a string.
810  *
811  * This is the version being compiled against; contrast with
812  * `gdk_pixbuf_version`.
813  */
814 enum PIXBUF_VERSION = "2.42.6";
815 alias GDK_PIXBUF_VERSION = PIXBUF_VERSION;
816 
817 /**
818  * Magic number for #GdkPixdata structures.
819  */
820 enum PIXBUF_MAGIC_NUMBER = 1197763408;
821 alias GDK_PIXBUF_MAGIC_NUMBER = PIXBUF_MAGIC_NUMBER;
822 
823 /**
824  * The length of a #GdkPixdata structure without the @pixel_data pointer.
825  */
826 enum PIXDATA_HEADER_LENGTH = 24;
827 alias GDK_PIXDATA_HEADER_LENGTH = PIXDATA_HEADER_LENGTH;