Don't explicitly send MotionNotify event during Resize (GeometryWindow)
[fvwm.git] / libs / Fpng.h
blob1eb3c431456ac81623c770e56a09c965a2a92405
1 /* -*-c-*- */
2 /* Copyright (C) 2002 Olivier Chapuis */
4 #ifndef FPNG_H
5 #define FPNG_H
7 /* ---------------------------- included header files ---------------------- */
9 #include "PictureBase.h"
11 #if PngSupport
12 #include <png.h>
13 #else
14 #include <setjmp.h>
15 #endif
17 /* ---------------------------- global definitions ------------------------- */
19 /* ---------------------------- global macros ------------------------------ */
21 /* ---------------------------- type definitions --------------------------- */
23 #ifndef _ZLIB_H
24 typedef unsigned char FzByte;
25 typedef unsigned int FzuInt;
26 typedef unsigned long FzuLong;
27 typedef FzByte FzBytef;
28 #ifdef __STDC__
29 typedef void *Fzvoidpf;
30 typedef void *Fzvoidp;
31 #else
32 typedef FzByte *Fzvoidpf;
33 typedef FzByte *Fzvoidp;
34 #endif
35 typedef Fzvoidpf (*Fzalloc_func) (
36 #ifdef __STDC__
37 Fzvoidpf opaque, FzuInt items, FzuInt size
38 #endif
40 typedef Fzvoidp (*Fzfree_func) (
41 #ifdef __STDC__
42 Fzvoidpf opaque, Fzvoidpf address
43 #endif
45 typedef struct Fz_stream_s {
46 FzBytef *next_in;
47 FzuInt avail_in;
48 FzuLong total_in;
49 FzBytef *next_out;
50 FzuInt avail_out;
51 FzuLong total_out;
52 char *msg;
53 struct internal_state *state;
54 Fzalloc_func zalloc;
55 Fzfree_func zfree;
56 Fzvoidpf opaque;
57 int data_type;
58 FzuLong adler;
59 FzuLong reserved;
60 } Fz_stream;
61 typedef Fz_stream *Fz_streamp;
62 #else /* _ZLIB_H */
63 #ifdef Z_PREFIX
64 typedef z_Byte FzByte;
65 typedef z_uInt FzuInt;
66 typedef z_uLong FzuLong;
67 typedef z_Bytef FzBytef;
68 typedef z_voidp Fzvoidp;
69 typedef z_voidpf Fzvoidpf;
70 typedef z_stream Fz_stream;
71 #else
72 typedef Byte FzByte;
73 typedef uInt FzuInt;
74 typedef uLong FzuLong;
75 typedef Bytef FzBytef;
76 typedef voidp Fzvoidp;
77 typedef voidpf Fzvoidpf;
78 typedef z_stream Fz_stream;
79 #endif
80 #endif /* !_ZLIB_H */
82 #if PngSupport
83 typedef png_uint_32 Fpng_uint_32;
84 typedef png_int_32 Fpng_int_32;
85 typedef png_uint_16 Fpng_uint_16;
86 typedef png_int_16 Fpng_int_16;
87 typedef png_byte Fpng_byte;
88 typedef png_size_t Fpng_size_t;
90 typedef png_struct Fpng_struct;
91 typedef png_structp Fpng_structp;
92 typedef png_structpp Fpng_structpp;
93 typedef png_info Fpng_info;
94 typedef png_infop Fpng_infop;
95 typedef png_infopp Fpng_infopp;
96 #else
97 typedef unsigned long Fpng_uint_32;
98 typedef long Fpng_int_32;
99 typedef unsigned short Fpng_uint_16;
100 typedef short Fpng_int_16;
101 typedef unsigned char Fpng_byte;
102 typedef size_t Fpng_size_t;
103 typedef void *Fpng_voidp;
104 typedef Fpng_byte *Fpng_bytep;
105 typedef Fpng_uint_32 *Fpng_uint_32p;
106 typedef Fpng_int_32 *Fpng_int_32p;
107 typedef Fpng_uint_16 *Fpng_uint_16p;
108 typedef Fpng_int_16 *Fpng_int_16p;
109 typedef const char *Fpng_const_charp;
110 typedef char *Fpng_charp;
111 typedef double *Fpng_doublep;
112 typedef Fpng_byte **Fpng_bytepp;
113 typedef Fpng_uint_32 **Fpng_uint_32pp;
114 typedef Fpng_int_32 **Fpng_int_32pp;
115 typedef Fpng_uint_16 **Fpng_uint_16pp;
116 typedef Fpng_int_16 **Fpng_int_16pp;
117 typedef const char **Fpng_const_charpp;
118 typedef char **Fpng_charpp;
119 typedef double **Fpng_doublepp;
120 typedef char ** *Fpng_charppp;
121 typedef struct Fpng_color_struct
123 Fpng_byte red;
124 Fpng_byte green;
125 Fpng_byte blue;
126 } Fpng_color;
127 typedef Fpng_color *Fpng_colorp;
128 typedef Fpng_color **Fpng_colorpp;
129 typedef struct Fpng_color_16_struct
131 Fpng_byte index;
132 Fpng_uint_16 red;
133 Fpng_uint_16 green;
134 Fpng_uint_16 blue;
135 Fpng_uint_16 gray;
136 } Fpng_color_16;
137 typedef Fpng_color_16 *Fpng_color_16p;
138 typedef Fpng_color_16 **Fpng_color_16pp;
139 typedef struct Fpng_color_8_struct
141 Fpng_byte red;
142 Fpng_byte green;
143 Fpng_byte blue;
144 Fpng_byte gray;
145 Fpng_byte alpha;
146 } Fpng_color_8;
147 typedef Fpng_color_8 *Fpng_color_8p;
148 typedef Fpng_color_8 **Fpng_color_8pp;
149 typedef struct Fpng_text_struct
151 int compression;
152 Fpng_charp key;
153 Fpng_charp text;
154 Fpng_size_t text_length;
155 } Fpng_text;
156 typedef Fpng_text *Fpng_textp;
157 typedef Fpng_text **Fpng_textpp;
158 typedef struct Fpng_time_struct
160 Fpng_uint_16 year;
161 Fpng_byte month;
162 Fpng_byte day;
163 Fpng_byte hour;
164 Fpng_byte minute;
165 Fpng_byte second;
166 } Fpng_time;
167 typedef Fpng_time *Fpng_timep;
168 typedef Fpng_time **Fpng_timepp;
169 typedef struct Fpng_info_struct
171 Fpng_uint_32 width;
172 Fpng_uint_32 height;
173 Fpng_uint_32 valid;
174 Fpng_uint_32 rowbytes;
175 Fpng_colorp palette;
176 Fpng_uint_16 num_palette;
177 Fpng_uint_16 num_trans;
178 Fpng_byte bit_depth;
179 Fpng_byte color_type;
180 Fpng_byte compression_type;
181 Fpng_byte filter_type;
182 Fpng_byte interlace_type;
183 Fpng_byte channels;
184 Fpng_byte pixel_depth;
185 Fpng_byte spare_byte;
186 Fpng_byte signature[8];
187 float gamma;
188 Fpng_byte srgb_intent;
189 int num_text;
190 int max_text;
191 Fpng_textp text;
192 Fpng_time mod_time;
193 Fpng_color_8 sig_bit;
194 Fpng_bytep trans;
195 Fpng_color_16 trans_values;
196 Fpng_color_16 background;
197 Fpng_uint_32 x_offset;
198 Fpng_uint_32 y_offset;
199 Fpng_byte offset_unit_type;
200 Fpng_uint_32 x_pixels_per_unit;
201 Fpng_uint_32 y_pixels_per_unit;
202 Fpng_byte phys_unit_type;
203 Fpng_uint_16p hist;
204 float x_white;
205 float y_white;
206 float x_red;
207 float y_red;
208 float x_green;
209 float y_green;
210 float x_blue;
211 float y_blue;
212 Fpng_charp pcal_purpose;
213 Fpng_int_32 pcal_X0;
214 Fpng_int_32 pcal_X1;
215 Fpng_charp pcal_units;
216 Fpng_charpp pcal_params;
217 Fpng_byte pcal_type;
218 Fpng_byte pcal_nparams;
219 } Fpng_info;
220 typedef Fpng_info *Fpng_infop;
221 typedef Fpng_info **Fpng_infopp;
222 typedef struct Fpng_struct_def Fpng_struct;
223 typedef Fpng_struct *Fpng_structp;
224 typedef struct Fpng_row_info_struct
226 Fpng_uint_32 width;
227 Fpng_uint_32 rowbytes;
228 Fpng_byte color_type;
229 Fpng_byte bit_depth;
230 Fpng_byte channels;
231 Fpng_byte pixel_depth;
232 } Fpng_row_info;
233 typedef Fpng_row_info *Fpng_row_infop;
234 typedef Fpng_row_info **Fpng_row_infopp;
235 typedef void (*Fpng_error_ptr)(
236 #ifdef __STDC__
237 Fpng_structp, Fpng_const_charp
238 #endif
240 typedef void (*Fpng_rw_ptr)(
241 #ifdef __STDC__
242 Fpng_structp, Fpng_bytep, Fpng_size_t
243 #endif
245 typedef void (*Fpng_flush_ptr) (
246 #ifdef __STDC__
247 Fpng_structp
248 #endif
250 typedef void (*Fpng_read_status_ptr) (
251 #ifdef __STDC__
252 Fpng_structp, Fpng_uint_32, int
253 #endif
255 typedef void (*Fpng_write_status_ptr) (
256 #ifdef __STDC__
257 Fpng_structp, Fpng_uint_32, int
258 #endif
260 typedef void (*Fpng_progressive_info_ptr) (
261 #ifdef __STDC__
262 Fpng_structp, Fpng_infop
263 #endif
265 typedef void (*Fpng_progressive_end_ptr) (
266 #ifdef __STDC__
267 Fpng_structp, Fpng_infop
268 #endif
270 typedef void (*Fpng_progressive_row_ptr) (
271 #ifdef __STDC__
272 Fpng_structp, Fpng_bytep,Fpng_uint_32, int
273 #endif
275 typedef void (*Fpng_user_transform_ptr)(
276 #ifdef __STDC__
277 Fpng_structp, Fpng_row_infop, Fpng_bytep
278 #endif
280 typedef Fpng_voidp (*Fpng_malloc_ptr) (
281 #ifdef __STDC__
282 Fpng_structp, Fpng_size_t
283 #endif
285 typedef void (*Fpng_free_ptr) (
286 #ifdef __STDC__
287 Fpng_structp, Fpng_voidp
288 #endif
290 struct png_struct_def
292 jmp_buf jmpbuf;
293 Fpng_error_ptr error_fn;
294 Fpng_error_ptr warning_fn;
295 Fpng_voidp error_ptr;
296 Fpng_rw_ptr write_data_fn;
297 Fpng_rw_ptr read_data_fn;
298 Fpng_voidp io_ptr;
299 Fpng_user_transform_ptr read_user_transform_fn;
300 Fpng_user_transform_ptr write_user_transform_fn;
301 Fpng_voidp user_transform_ptr;
302 Fpng_byte user_transform_depth;
303 Fpng_byte user_transform_channels;
304 Fpng_uint_32 mode;
305 Fpng_uint_32 flags;
306 Fpng_uint_32 transformations;
307 Fz_stream zstream;
308 Fpng_bytep zbuf;
309 Fpng_size_t zbuf_size;
310 int zlib_level;
311 int zlib_method;
312 int zlib_window_bits;
313 int zlib_mem_level;
314 int zlib_strategy;
315 Fpng_uint_32 width;
316 Fpng_uint_32 height;
317 Fpng_uint_32 num_rows;
318 Fpng_uint_32 usr_width;
319 Fpng_uint_32 rowbytes;
320 Fpng_uint_32 irowbytes;
321 Fpng_uint_32 iwidth;
322 Fpng_uint_32 row_number;
323 Fpng_bytep prev_row;
324 Fpng_bytep row_buf;
325 Fpng_bytep sub_row;
326 Fpng_bytep up_row;
327 Fpng_bytep avg_row;
328 Fpng_bytep paeth_row;
329 Fpng_row_info row_info;
330 Fpng_uint_32 idat_size;
331 Fpng_uint_32 crc;
332 Fpng_colorp palette;
333 Fpng_uint_16 num_palette;
334 Fpng_uint_16 num_trans;
335 Fpng_byte chunk_name[5];
336 Fpng_byte compression;
337 Fpng_byte filter;
338 Fpng_byte interlaced;
339 Fpng_byte pass;
340 Fpng_byte do_filter;
341 Fpng_byte color_type;
342 Fpng_byte bit_depth;
343 Fpng_byte usr_bit_depth;
344 Fpng_byte pixel_depth;
345 Fpng_byte channels;
346 Fpng_byte usr_channels;
347 Fpng_byte sig_bytes;
348 Fpng_uint_16 filler;
349 Fpng_byte background_gamma_type;
350 float background_gamma;
351 Fpng_color_16 background;
352 Fpng_color_16 background_1;
353 Fpng_flush_ptr output_flush_fn;
354 Fpng_uint_32 flush_dist;
355 Fpng_uint_32 flush_rows;
356 int gamma_shift;
357 float gamma;
358 float screen_gamma;
359 Fpng_bytep gamma_table;
360 Fpng_bytep gamma_from_1;
361 Fpng_bytep gamma_to_1;
362 Fpng_uint_16pp gamma_16_table;
363 Fpng_uint_16pp gamma_16_from_1;
364 Fpng_uint_16pp gamma_16_to_1;
365 Fpng_color_8 sig_bit;
366 Fpng_color_8 shift;
367 Fpng_bytep trans;
368 Fpng_color_16 trans_values;
369 Fpng_read_status_ptr read_row_fn;
370 Fpng_write_status_ptr write_row_fn;
371 Fpng_progressive_info_ptr info_fn;
372 Fpng_progressive_row_ptr row_fn;
373 Fpng_progressive_end_ptr end_fn;
374 Fpng_bytep save_buffer_ptr;
375 Fpng_bytep save_buffer;
376 Fpng_bytep current_buffer_ptr;
377 Fpng_bytep current_buffer;
378 Fpng_uint_32 push_length;
379 Fpng_uint_32 skip_length;
380 Fpng_size_t save_buffer_size;
381 Fpng_size_t save_buffer_max;
382 Fpng_size_t buffer_size;
383 Fpng_size_t current_buffer_size;
384 int process_mode;
385 int cur_palette;
386 Fpng_size_t current_text_size;
387 Fpng_size_t current_text_left;
388 Fpng_charp current_text;
389 Fpng_charp current_text_ptr;
390 Fpng_bytepp offset_table_ptr;
391 Fpng_bytep offset_table;
392 Fpng_uint_16 offset_table_number;
393 Fpng_uint_16 offset_table_count;
394 Fpng_uint_16 offset_table_count_free;
395 Fpng_bytep palette_lookup;
396 Fpng_bytep dither_index;
397 Fpng_uint_16p hist;
398 Fpng_byte heuristic_method;
399 Fpng_byte num_prev_filters;
400 Fpng_bytep prev_filters;
401 Fpng_uint_16p filter_weights;
402 Fpng_uint_16p inv_filter_weights;
403 Fpng_uint_16p filter_costs;
404 Fpng_uint_16p inv_filter_costs;
405 Fpng_charp time_buffer;
406 Fpng_voidp mem_ptr;
407 Fpng_malloc_ptr malloc_fn;
408 Fpng_free_ptr free_fn;
409 Fpng_byte rgb_to_gray_status;
410 Fpng_byte rgb_to_gray_red_coeff;
411 Fpng_byte rgb_to_gray_green_coeff;
412 Fpng_byte rgb_to_gray_blue_coeff;
413 Fpng_byte empty_plte_permitted;
415 typedef Fpng_struct **Fpng_structpp;
416 #endif
417 /* ---------------------------- global definitions ------------------------- */
419 #define FPNG_BYTES_TO_CHECK 4
421 #if PngSupport
423 #define FPNG_LIBPNG_VER_STRING PNG_LIBPNG_VER_STRING
424 #define FPNG_COLOR_TYPE_PALETTE PNG_COLOR_TYPE_PALETTE
425 #define FPNG_COLOR_TYPE_RGB_ALPHA PNG_COLOR_TYPE_RGB_ALPHA
426 #define FPNG_COLOR_TYPE_GRAY_ALPHA PNG_COLOR_TYPE_GRAY_ALPHA
427 #define FPNG_COLOR_TYPE_GRAY PNG_COLOR_TYPE_GRAY
428 #define FPNG_FILLER_BEFORE PNG_FILLER_BEFORE
429 #define FPNG_FILLER_AFTER PNG_FILLER_AFTER
430 #define FPNG_INFO_tRNS PNG_INFO_tRNS
432 #define Fpng_check_sig(a,b) png_check_sig(a,b)
433 #define Fpng_create_read_struct(a,b,c,d) png_create_read_struct(a,b,c,d)
434 #define Fpng_create_info_struct(a) png_create_info_struct(a)
435 #define Fpng_destroy_read_struct(a,b,c) png_destroy_read_struct(a,b,c)
436 #define Fpng_init_io(a,b) png_init_io(a,b)
437 #define Fpng_read_info(a,b) png_read_info(a,b)
438 #define Fpng_get_IHDR(a,b,c,d,e,f,g,h,i) png_get_IHDR(a,b,c,d,e,f,g,h,i)
439 #define Fpng_set_expand(a) png_set_expand(a)
440 #define Fpng_set_swap_alpha(a) png_set_swap_alpha(a)
441 #define Fpng_set_filler(a,b,c) png_set_filler(a,b,c)
442 #define Fpng_set_bgr(a) png_set_bgr(a)
443 #define Fpng_set_strip_16(a) png_set_strip_16(a)
444 #define Fpng_set_packing(a) png_set_packing(a)
445 #define Fpng_set_gray_to_rgb(a) png_set_gray_to_rgb(a)
446 #define Fpng_get_bit_depth(a,b) png_get_bit_depth(a,b)
447 #define Fpng_set_gray_1_2_4_to_8(a) png_set_gray_1_2_4_to_8(a)
448 #define Fpng_get_valid(a,b,c) png_get_valid(a,b,c)
449 #define Fpng_read_end(a,b) png_read_end(a,b)
450 #define Fpng_set_interlace_handling(a) png_set_interlace_handling(a)
451 #define Fpng_read_rows(a,b,c,d) png_read_rows(a,b,c,d)
452 #define Fpng_read_image(a,b) png_read_image(a,b)
454 #else
456 #define FPNG_LIBPNG_VER_STRING ""
457 #define FPNG_COLOR_TYPE_PALETTE 0
458 #define FPNG_COLOR_TYPE_RGB_ALPHA 1
459 #define FPNG_COLOR_TYPE_GRAY_ALPHA 2
460 #define FPNG_COLOR_TYPE_GRAY 3
461 #define FPNG_FILLER_BEFORE 6
462 #define FPNG_FILLER_AFTER 5
463 #define FPNG_INFO_tRNS 7
465 #define Fpng_check_sig(a,b) 0
466 #define Fpng_create_read_struct(a,b,c,d) NULL
467 #define Fpng_create_info_struct(a) NULL
468 #define Fpng_destroy_read_struct(a,b,c)
469 #define Fpng_init_io(a,b)
470 #define Fpng_read_info(a,b)
471 #define Fpng_get_IHDR(a,b,c,d,e,f,g,h,i)
472 #define Fpng_set_expand(a)
473 #define Fpng_set_swap_alpha(a)
474 #define Fpng_set_filler(a,b,c)
475 #define Fpng_set_bgr(a)
476 #define Fpng_set_strip_16(a)
477 #define Fpng_set_packing(a)
478 #define Fpng_set_gray_to_rgb(a)
479 #define Fpng_get_bit_depth(a,b) 0
480 #define Fpng_set_gray_1_2_4_to_8(a)
481 #define Fpng_get_valid(a,b,c) 0
482 #define Fpng_read_end(a,b)
483 #define Fpng_set_interlace_handling(a) 0
484 #define Fpng_read_rows(a,b,c,d)
485 #define Fpng_read_image(a,b)
487 #endif
489 #endif /* FPNG_H */