File: types.d

package info (click to toggle)
gtk-d 3.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 20,152 kB
  • sloc: javascript: 565; sh: 71; makefile: 25
file content (432 lines) | stat: -rw-r--r-- 11,864 bytes parent folder | download | duplicates (3)
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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
/*
 * This file is part of gtkD.
 *
 * gtkD is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version, with
 * some exceptions, please read the COPYING file.
 *
 * gtkD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with gtkD; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 */

// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage


module gdkpixbuf.c.types;

public import gio.c.types;
public import glib.c.types;
public import gobject.c.types;


/**
 * This enumeration defines the color spaces that are supported by
 * the gdk-pixbuf library.  Currently only RGB is supported.
 */
public enum GdkColorspace
{
	/**
	 * Indicates a red/green/blue additive color space.
	 */
	RGB = 0,
}
alias GdkColorspace Colorspace;

/**
 * This enumeration describes the different interpolation modes that
 * can be used with the scaling functions. @GDK_INTERP_NEAREST is
 * the fastest scaling method, but has horrible quality when
 * scaling down. @GDK_INTERP_BILINEAR is the best choice if you
 * aren't sure what to choose, it has a good speed/quality balance.
 *
 * **Note**: Cubic filtering is missing from the list; hyperbolic
 * interpolation is just as fast and results in higher quality.
 */
public enum GdkInterpType
{
	/**
	 * Nearest neighbor sampling; this is the fastest
	 * and lowest quality mode. Quality is normally unacceptable when scaling
	 * down, but may be OK when scaling up.
	 */
	NEAREST = 0,
	/**
	 * This is an accurate simulation of the PostScript
	 * image operator without any interpolation enabled.  Each pixel is
	 * rendered as a tiny parallelogram of solid color, the edges of which
	 * are implemented with antialiasing.  It resembles nearest neighbor for
	 * enlargement, and bilinear for reduction.
	 */
	TILES = 1,
	/**
	 * Best quality/speed balance; use this mode by
	 * default. Bilinear interpolation.  For enlargement, it is
	 * equivalent to point-sampling the ideal bilinear-interpolated image.
	 * For reduction, it is equivalent to laying down small tiles and
	 * integrating over the coverage area.
	 */
	BILINEAR = 2,
	/**
	 * This is the slowest and highest quality
	 * reconstruction function. It is derived from the hyperbolic filters in
	 * Wolberg's "Digital Image Warping", and is formally defined as the
	 * hyperbolic-filter sampling the ideal hyperbolic-filter interpolated
	 * image (the filter is designed to be idempotent for 1:1 pixel mapping).
	 * **Deprecated**: this interpolation filter is deprecated, as in reality
	 * it has a lower quality than the @GDK_INTERP_BILINEAR filter
	 * (Since: 2.38)
	 */
	HYPER = 3,
}
alias GdkInterpType InterpType;

/**
 * These values can be passed to
 * gdk_pixbuf_xlib_render_to_drawable_alpha() to control how the alpha
 * channel of an image should be handled.  This function can create a
 * bilevel clipping mask (black and white) and use it while painting
 * the image.  In the future, when the X Window System gets an alpha
 * channel extension, it will be possible to do full alpha
 * compositing onto arbitrary drawables.  For now both cases fall
 * back to a bilevel clipping mask.
 */
public enum GdkPixbufAlphaMode
{
	/**
	 * A bilevel clipping mask (black and white)
	 * will be created and used to draw the image.  Pixels below 0.5 opacity
	 * will be considered fully transparent, and all others will be
	 * considered fully opaque.
	 */
	BILEVEL = 0,
	/**
	 * For now falls back to #GDK_PIXBUF_ALPHA_BILEVEL.
	 * In the future it will do full alpha compositing.
	 */
	FULL = 1,
}
alias GdkPixbufAlphaMode PixbufAlphaMode;

/**
 * An error code in the #GDK_PIXBUF_ERROR domain. Many gdk-pixbuf
 * operations can cause errors in this domain, or in the #G_FILE_ERROR
 * domain.
 */
public enum GdkPixbufError
{
	/**
	 * An image file was broken somehow.
	 */
	CORRUPT_IMAGE = 0,
	/**
	 * Not enough memory.
	 */
	INSUFFICIENT_MEMORY = 1,
	/**
	 * A bad option was passed to a pixbuf save module.
	 */
	BAD_OPTION = 2,
	/**
	 * Unknown image type.
	 */
	UNKNOWN_TYPE = 3,
	/**
	 * Don't know how to perform the
	 * given operation on the type of image at hand.
	 */
	UNSUPPORTED_OPERATION = 4,
	/**
	 * Generic failure code, something went wrong.
	 */
	FAILED = 5,
	/**
	 * Only part of the animation was loaded.
	 */
	INCOMPLETE_ANIMATION = 6,
}
alias GdkPixbufError PixbufError;

/**
 * The possible rotations which can be passed to gdk_pixbuf_rotate_simple().
 * To make them easier to use, their numerical values are the actual degrees.
 */
public enum GdkPixbufRotation
{
	/**
	 * No rotation.
	 */
	NONE = 0,
	/**
	 * Rotate by 90 degrees.
	 */
	COUNTERCLOCKWISE = 90,
	/**
	 * Rotate by 180 degrees.
	 */
	UPSIDEDOWN = 180,
	/**
	 * Rotate by 270 degrees.
	 */
	CLOCKWISE = 270,
}
alias GdkPixbufRotation PixbufRotation;

/**
 * An enumeration which is used by gdk_pixdata_to_csource() to
 * determine the form of C source to be generated. The three values
 * @GDK_PIXDATA_DUMP_PIXDATA_STREAM, @GDK_PIXDATA_DUMP_PIXDATA_STRUCT
 * and @GDK_PIXDATA_DUMP_MACROS are mutually exclusive, as are
 * @GDK_PIXBUF_DUMP_GTYPES and @GDK_PIXBUF_DUMP_CTYPES. The remaining
 * elements are optional flags that can be freely added.
 */
public enum GdkPixdataDumpType
{
	/**
	 * Generate pixbuf data stream (a single
	 * string containing a serialized #GdkPixdata structure in network byte
	 * order).
	 */
	PIXDATA_STREAM = 0,
	/**
	 * Generate #GdkPixdata structure (needs
	 * the #GdkPixdata structure definition from gdk-pixdata.h).
	 */
	PIXDATA_STRUCT = 1,
	/**
	 * Generate <function>*_ROWSTRIDE</function>,
	 * <function>*_WIDTH</function>, <function>*_HEIGHT</function>,
	 * <function>*_BYTES_PER_PIXEL</function> and
	 * <function>*_RLE_PIXEL_DATA</function> or <function>*_PIXEL_DATA</function>
	 * macro definitions for the image.
	 */
	MACROS = 2,
	/**
	 * Generate GLib data types instead of
	 * standard C data types.
	 */
	GTYPES = 0,
	/**
	 * Generate standard C data types instead of
	 * GLib data types.
	 */
	CTYPES = 256,
	/**
	 * Generate static symbols.
	 */
	STATIC = 512,
	/**
	 * Generate const symbols.
	 */
	CONST = 1024,
	/**
	 * Provide a <function>*_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp)</function>
	 * macro definition  to  decode  run-length encoded image data.
	 */
	RLE_DECODER = 65536,
}
alias GdkPixdataDumpType PixdataDumpType;

/**
 * An enumeration containing three sets of flags for a #GdkPixdata struct:
 * one for the used colorspace, one for the width of the samples and one
 * for the encoding of the pixel data.
 */
public enum GdkPixdataType
{
	/**
	 * each pixel has red, green and blue samples.
	 */
	COLOR_TYPE_RGB = 1,
	/**
	 * each pixel has red, green and blue samples
	 * and an alpha value.
	 */
	COLOR_TYPE_RGBA = 2,
	/**
	 * mask for the colortype flags of the enum.
	 */
	COLOR_TYPE_MASK = 255,
	/**
	 * each sample has 8 bits.
	 */
	SAMPLE_WIDTH_8 = 65536,
	/**
	 * mask for the sample width flags of the enum.
	 */
	SAMPLE_WIDTH_MASK = 983040,
	/**
	 * the pixel data is in raw form.
	 */
	ENCODING_RAW = 16777216,
	/**
	 * the pixel data is run-length encoded. Runs may
	 * be up to 127 bytes long; their length is stored in a single byte
	 * preceding the pixel data for the run. If a run is constant, its length
	 * byte has the high bit set and the pixel data consists of a single pixel
	 * which must be repeated.
	 */
	ENCODING_RLE = 33554432,
	/**
	 * mask for the encoding flags of the enum.
	 */
	ENCODING_MASK = 251658240,
}
alias GdkPixdataType PixdataType;

struct GdkPixbuf;

struct GdkPixbufAnimation;

struct GdkPixbufAnimationIter;

struct GdkPixbufFormat;

struct GdkPixbufLoader
{
	GObject parentInstance;
	void* priv;
}

struct GdkPixbufLoaderClass
{
	GObjectClass parentClass;
	/** */
	extern(C) void function(GdkPixbufLoader* loader, int width, int height) sizePrepared;
	/** */
	extern(C) void function(GdkPixbufLoader* loader) areaPrepared;
	/** */
	extern(C) void function(GdkPixbufLoader* loader, int x, int y, int width, int height) areaUpdated;
	/** */
	extern(C) void function(GdkPixbufLoader* loader) closed;
}

struct GdkPixbufSimpleAnim;

struct GdkPixbufSimpleAnimClass;

struct GdkPixbufSimpleAnimIter;

struct GdkPixdata
{
	/**
	 * magic number. A valid #GdkPixdata structure must have
	 * #GDK_PIXBUF_MAGIC_NUMBER here.
	 */
	uint magic;
	/**
	 * less than 1 to disable length checks, otherwise
	 * #GDK_PIXDATA_HEADER_LENGTH + length of @pixel_data.
	 */
	int length;
	/**
	 * information about colorspace, sample width and
	 * encoding, in a #GdkPixdataType.
	 */
	uint pixdataType;
	/**
	 * Distance in bytes between rows.
	 */
	uint rowstride;
	/**
	 * Width of the image in pixels.
	 */
	uint width;
	/**
	 * Height of the image in pixels.
	 */
	uint height;
	/**
	 * @width x @height pixels, encoded according to @pixdata_type
	 * and @rowstride.
	 */
	ubyte* pixelData;
}

/**
 * A function of this type is responsible for freeing the pixel array
 * of a pixbuf.  The gdk_pixbuf_new_from_data() function lets you
 * pass in a pre-allocated pixel array so that a pixbuf can be
 * created from it; in this case you will need to pass in a function
 * of #GdkPixbufDestroyNotify so that the pixel data can be freed
 * when the pixbuf is finalized.
 *
 * Params:
 *     pixels = The pixel array of the pixbuf
 *         that is being finalized.
 *     data = User closure data.
 */
public alias extern(C) void function(char* pixels, void* data) GdkPixbufDestroyNotify;

/**
 * Specifies the type of the function passed to
 * gdk_pixbuf_save_to_callback().  It is called once for each block of
 * bytes that is "written" by gdk_pixbuf_save_to_callback().  If
 * successful it should return %TRUE.  If an error occurs it should set
 * @error and return %FALSE, in which case gdk_pixbuf_save_to_callback()
 * will fail with the same error.
 *
 * Params:
 *     buf = bytes to be written.
 *     count = number of bytes in @buf.
 *     error = A location to return an error.
 *     data = user data passed to gdk_pixbuf_save_to_callback().
 *
 * Returns: %TRUE if successful, %FALSE (with @error set) if failed.
 *
 * Since: 2.4
 */
public alias extern(C) int function(char* buf, size_t count, GError** error, void* data) GdkPixbufSaveFunc;

enum PIXBUF_FEATURES_H = 1;
alias GDK_PIXBUF_FEATURES_H = PIXBUF_FEATURES_H;

/**
 * Major version of gdk-pixbuf library, that is the "0" in
 * "0.8.2" for example.
 */
enum PIXBUF_MAJOR = 2;
alias GDK_PIXBUF_MAJOR = PIXBUF_MAJOR;

/**
 * Micro version of gdk-pixbuf library, that is the "2" in
 * "0.8.2" for example.
 */
enum PIXBUF_MICRO = 1;
alias GDK_PIXBUF_MICRO = PIXBUF_MICRO;

/**
 * Minor version of gdk-pixbuf library, that is the "8" in
 * "0.8.2" for example.
 */
enum PIXBUF_MINOR = 38;
alias GDK_PIXBUF_MINOR = PIXBUF_MINOR;

/**
 * Contains the full version of the gdk-pixbuf header as a string.
 * This is the version being compiled against; contrast with
 * #gdk_pixbuf_version.
 */
enum PIXBUF_VERSION = "2.38.1";
alias GDK_PIXBUF_VERSION = PIXBUF_VERSION;

/**
 * Magic number for #GdkPixdata structures.
 */
enum PIXBUF_MAGIC_NUMBER = 1197763408;
alias GDK_PIXBUF_MAGIC_NUMBER = PIXBUF_MAGIC_NUMBER;

/**
 * The length of a #GdkPixdata structure without the @pixel_data pointer.
 */
enum PIXDATA_HEADER_LENGTH = 24;
alias GDK_PIXDATA_HEADER_LENGTH = PIXDATA_HEADER_LENGTH;