-
-
Notifications
You must be signed in to change notification settings - Fork 623
/
Copy pathimlib2.pkg
635 lines (398 loc) · 20.3 KB
/
imlib2.pkg
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
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
$#define BUILD_X11 1
$#include <Imlib2.h>
$#include <X11/Xlib.h>
$#define _userdata void*
$#include <stddef.h>
$#include <stdint.h>
typedef void *Imlib_Context;
typedef void *Imlib_Image;
typedef void *Imlib_Color_Modifier;
typedef void *Imlib_Updates;
typedef void *Imlib_Font;
typedef void *Imlib_Color_Range;
typedef void *Imlib_Filter;
typedef void *ImlibPolygon;
typedef enum {
IMLIB_OP_COPY,
IMLIB_OP_ADD,
IMLIB_OP_SUBTRACT,
IMLIB_OP_RESHADE
} Imlib_Operation;
typedef enum {
IMLIB_TEXT_TO_RIGHT = 0,
IMLIB_TEXT_TO_LEFT = 1,
IMLIB_TEXT_TO_DOWN = 2,
IMLIB_TEXT_TO_UP = 3,
IMLIB_TEXT_TO_ANGLE = 4
} Imlib_Text_Direction;
typedef struct {
int left, right, top, bottom;
} Imlib_Border;
typedef struct {
int alpha, red, green, blue;
} Imlib_Color;
int imlib_version(void);
Imlib_Context imlib_context_new(void);
void imlib_context_free(Imlib_Context context);
void imlib_context_push(Imlib_Context context);
void imlib_context_pop(void);
Imlib_Context imlib_context_get(void);
void imlib_context_set_display(Display *display);
Display *imlib_context_get_display(void);
void imlib_context_disconnect_display(void);
void imlib_context_set_visual(Visual *visual);
Visual *imlib_context_get_visual(void);
void imlib_context_set_colormap(Colormap colormap);
Colormap imlib_context_get_colormap(void);
void imlib_context_set_drawable(Drawable drawable);
Drawable imlib_context_get_drawable(void);
void imlib_context_set_mask(Pixmap mask);
Pixmap imlib_context_get_mask(void);
void imlib_context_set_dither_mask(char dither_mask);
char imlib_context_get_dither_mask(void);
void imlib_context_set_mask_alpha_threshold(int mask_alpha_threshold);
int imlib_context_get_mask_alpha_threshold(void);
void imlib_context_set_anti_alias(char anti_alias);
char imlib_context_get_anti_alias(void);
void imlib_context_set_dither(char dither);
char imlib_context_get_dither(void);
void imlib_context_set_blend(char blend);
char imlib_context_get_blend(void);
void imlib_context_set_color_modifier(Imlib_Color_Modifier color_modifier);
Imlib_Color_Modifier imlib_context_get_color_modifier(void);
void imlib_context_set_operation(Imlib_Operation operation);
Imlib_Operation imlib_context_get_operation(void);
void imlib_context_set_font(Imlib_Font font);
Imlib_Font imlib_context_get_font(void);
void imlib_context_set_direction(Imlib_Text_Direction direction);
Imlib_Text_Direction imlib_context_get_direction(void);
void imlib_context_set_angle(double angle);
double imlib_context_get_angle(void);
void imlib_context_set_color(int red, int green, int blue, int alpha);
void imlib_context_get_color(int *red, int *green, int *blue, int *alpha);
void imlib_context_set_color_hsva(float hue, float saturation, float value,
int alpha);
void imlib_context_get_color_hsva(float *hue, float *saturation, float *value,
int *alpha);
void imlib_context_set_color_hlsa(float hue, float lightness, float saturation,
int alpha);
void imlib_context_get_color_hlsa(float *hue, float *lightness,
float *saturation, int *alpha);
void imlib_context_set_color_cmya(int cyan, int magenta, int yellow, int alpha);
void imlib_context_get_color_cmya(int *cyan, int *magenta, int *yellow,
int *alpha);
Imlib_Color *imlib_context_get_imlib_color(void);
void imlib_context_set_color_range(Imlib_Color_Range color_range);
Imlib_Color_Range imlib_context_get_color_range(void);
void imlib_context_set_image_data_memory_function(
Imlib_Image_Data_Memory_Function memory_function);
Imlib_Image_Data_Memory_Function imlib_context_get_image_data_memory_function(
void);
void imlib_context_set_progress_function(
Imlib_Progress_Function progress_function);
Imlib_Progress_Function imlib_context_get_progress_function(void);
void imlib_context_set_progress_granularity(char progress_granularity);
char imlib_context_get_progress_granularity(void);
void imlib_context_set_image(Imlib_Image image);
Imlib_Image imlib_context_get_image(void);
void imlib_context_set_cliprect(int x, int y, int w, int h);
void imlib_context_get_cliprect(int *x, int *y, int *w, int *h);
int imlib_get_cache_used(void);
int imlib_get_cache_size(void);
void imlib_set_cache_size(int bytes);
#ifndef X_DISPLAY_MISSING
int imlib_get_color_usage(void);
void imlib_set_color_usage(int max);
int imlib_get_visual_depth(Display *display, Visual *visual);
Visual *imlib_get_best_visual(Display *display, int screen, int *depth_return);
#endif
void imlib_flush_loaders(void);
int imlib_get_error(void);
Imlib_Image imlib_load_image(const char *file);
Imlib_Image imlib_load_image_immediately(const char *file);
Imlib_Image imlib_load_image_without_cache(const char *file);
Imlib_Image imlib_load_image_immediately_without_cache(const char *file);
Imlib_Image imlib_load_image_with_errno_return(const char *file,
int *error_return);
Imlib_Image imlib_load_image_fd(int fd, const char *file);
Imlib_Image imlib_load_image_mem(const char *file, const void *data,
size_t size);
void imlib_free_image(void);
void imlib_free_image_and_decache(void);
int imlib_image_get_width(void);
int imlib_image_get_height(void);
const char *imlib_image_get_filename(void);
uint32_t *imlib_image_get_data(void);
uint32_t *imlib_image_get_data_for_reading_only(void);
void imlib_image_put_back_data(uint32_t *data);
char imlib_image_has_alpha(void);
void imlib_image_set_changes_on_disk(void);
void imlib_image_get_border(Imlib_Border *border);
void imlib_image_set_border(Imlib_Border *border);
void imlib_image_set_format(const char *format);
void imlib_image_set_irrelevant_format(char irrelevant);
char *imlib_image_format(void);
void imlib_image_set_has_alpha(char has_alpha);
void imlib_image_query_pixel(int x, int y, Imlib_Color *color_return);
void imlib_image_query_pixel_hsva(int x, int y, float *hue, float *saturation,
float *value, int *alpha);
void imlib_image_query_pixel_hlsa(int x, int y, float *hue, float *lightness,
float *saturation, int *alpha);
void imlib_image_query_pixel_cmya(int x, int y, int *cyan, int *magenta,
int *yellow, int *alpha);
#ifndef X_DISPLAY_MISSING
void imlib_render_pixmaps_for_whole_image(Pixmap *pixmap_return,
Pixmap *mask_return);
void imlib_render_pixmaps_for_whole_image_at_size(Pixmap *pixmap_return,
Pixmap *mask_return,
int width, int height);
void imlib_free_pixmap_and_mask(Pixmap pixmap);
void imlib_render_image_on_drawable(int x, int y);
void imlib_render_image_on_drawable_at_size(int x, int y, int width,
int height);
void imlib_render_image_part_on_drawable_at_size(int source_x, int source_y,
int source_width,
int source_height, int x,
int y, int width, int height);
uint32_t imlib_render_get_pixel_color(void);
#endif
void imlib_blend_image_onto_image(Imlib_Image source_image, char merge_alpha,
int source_x, int source_y, int source_width,
int source_height, int destination_x,
int destination_y, int destination_width,
int destination_height);
Imlib_Image imlib_create_image(int width, int height);
Imlib_Image imlib_clone_image(void);
Imlib_Image imlib_create_cropped_image(int x, int y, int width, int height);
Imlib_Image imlib_create_cropped_scaled_image(int source_x, int source_y,
int source_width,
int source_height,
int destination_width,
int destination_height);
Imlib_Image imlib_create_image_using_data(int width, int height,
uint32_t *data);
Imlib_Image imlib_create_image_using_data_and_memory_function(
int width, int height, uint32_t *data,
Imlib_Image_Data_Memory_Function func);
Imlib_Image imlib_create_image_using_copied_data(int width, int height,
uint32_t *data);
#ifndef X_DISPLAY_MISSING
Imlib_Image imlib_create_image_from_drawable(Pixmap mask, int x, int y,
int width, int height,
char need_to_grab_x);
Imlib_Image imlib_create_image_from_ximage(XImage *image, XImage *mask, int x,
int y, int width, int height,
char need_to_grab_x);
Imlib_Image imlib_create_scaled_image_from_drawable(
Pixmap mask, int source_x, int source_y, int source_width,
int source_height, int destination_width, int destination_height,
char need_to_grab_x, char get_mask_from_shape);
char imlib_copy_drawable_to_image(Pixmap mask, int x, int y, int width,
int height, int destination_x,
int destination_y, char need_to_grab_x);
int imlib_get_ximage_cache_count_used(void);
int imlib_get_ximage_cache_count_max(void);
void imlib_set_ximage_cache_count_max(int count);
int imlib_get_ximage_cache_size_used(void);
int imlib_get_ximage_cache_size_max(void);
void imlib_set_ximage_cache_size_max(int bytes);
#endif
Imlib_Updates imlib_updates_clone(Imlib_Updates updates);
Imlib_Updates imlib_update_append_rect(Imlib_Updates updates, int x, int y,
int w, int h);
Imlib_Updates imlib_updates_merge(Imlib_Updates updates, int w, int h);
Imlib_Updates imlib_updates_merge_for_rendering(Imlib_Updates updates, int w,
int h);
void imlib_updates_free(Imlib_Updates updates);
Imlib_Updates imlib_updates_get_next(Imlib_Updates updates);
void imlib_updates_get_coordinates(Imlib_Updates updates, int *x_return,
int *y_return, int *width_return,
int *height_return);
void imlib_updates_set_coordinates(Imlib_Updates updates, int x, int y,
int width, int height);
void imlib_render_image_updates_on_drawable(Imlib_Updates updates, int x,
int y);
Imlib_Updates imlib_updates_init(void);
Imlib_Updates imlib_updates_append_updates(Imlib_Updates updates,
Imlib_Updates appended_updates);
void imlib_image_flip_horizontal(void);
void imlib_image_flip_vertical(void);
void imlib_image_flip_diagonal(void);
void imlib_image_orientate(int orientation);
void imlib_image_blur(int radius);
void imlib_image_sharpen(int radius);
void imlib_image_tile_horizontal(void);
void imlib_image_tile_vertical(void);
void imlib_image_tile(void);
void imlib_image_copy_alpha_to_image(Imlib_Image image_source, int x, int y);
void imlib_image_copy_alpha_rectangle_to_image(Imlib_Image image_source, int x,
int y, int width, int height,
int destination_x,
int destination_y);
void imlib_image_scroll_rect(int x, int y, int width, int height, int delta_x,
int delta_y);
void imlib_image_copy_rect(int x, int y, int width, int height, int new_x,
int new_y);
Imlib_Font imlib_load_font(const char *font_name);
void imlib_free_font(void);
int imlib_insert_font_into_fallback_chain(Imlib_Font font,
Imlib_Font fallback_font);
void imlib_remove_font_from_fallback_chain(Imlib_Font fallback_font);
Imlib_Font imlib_get_prev_font_in_fallback_chain(Imlib_Font fn);
Imlib_Font imlib_get_next_font_in_fallback_chain(Imlib_Font fn);
void imlib_text_draw(int x, int y, const char *text);
void imlib_text_draw_with_return_metrics(int x, int y, const char *text,
int *width_return, int *height_return,
int *horizontal_advance_return,
int *vertical_advance_return);
void imlib_get_text_size(const char *text, int *width_return,
int *height_return);
void imlib_get_text_advance(const char *text, int *horizontal_advance_return,
int *vertical_advance_return);
int imlib_get_text_inset(const char *text);
void imlib_add_path_to_font_path(const char *path);
void imlib_remove_path_from_font_path(const char *path);
char **imlib_list_font_path(int *number_return);
int imlib_text_get_index_and_location(const char *text, int x, int y,
int *char_x_return, int *char_y_return,
int *char_width_return,
int *char_height_return);
void imlib_text_get_location_at_index(const char *text, int index,
int *char_x_return, int *char_y_return,
int *char_width_return,
int *char_height_return);
char **imlib_list_fonts(int *number_return);
void imlib_free_font_list(char **font_list, int number);
int imlib_get_font_cache_size(void);
void imlib_set_font_cache_size(int bytes);
void imlib_flush_font_cache(void);
int imlib_get_font_ascent(void);
int imlib_get_font_descent(void);
int imlib_get_maximum_font_ascent(void);
int imlib_get_maximum_font_descent(void);
Imlib_Color_Modifier imlib_create_color_modifier(void);
void imlib_free_color_modifier(void);
void imlib_modify_color_modifier_gamma(double gamma_value);
void imlib_modify_color_modifier_brightness(double brightness_value);
void imlib_modify_color_modifier_contrast(double contrast_value);
void imlib_set_color_modifier_tables(uint8_t *red_table, uint8_t *green_table,
uint8_t *blue_table, uint8_t *alpha_table);
void imlib_get_color_modifier_tables(uint8_t *red_table, uint8_t *green_table,
uint8_t *blue_table, uint8_t *alpha_table);
void imlib_reset_color_modifier(void);
void imlib_apply_color_modifier(void);
void imlib_apply_color_modifier_to_rectangle(int x, int y, int width,
int height);
Imlib_Updates imlib_image_draw_pixel(int x, int y, char make_updates);
Imlib_Updates imlib_image_draw_line(int x1, int y1, int x2, int y2,
char make_updates);
void imlib_image_draw_rectangle(int x, int y, int width, int height);
void imlib_image_fill_rectangle(int x, int y, int width, int height);
ImlibPolygon imlib_polygon_new(void);
void imlib_polygon_free(ImlibPolygon poly);
void imlib_polygon_add_point(ImlibPolygon poly, int x, int y);
void imlib_image_draw_polygon(ImlibPolygon poly, unsigned char closed);
void imlib_image_fill_polygon(ImlibPolygon poly);
void imlib_polygon_get_bounds(ImlibPolygon poly, int *px1, int *py1, int *px2,
int *py2);
unsigned char imlib_polygon_contains_point(ImlibPolygon poly, int x, int y);
void imlib_image_draw_ellipse(int xc, int yc, int a, int b);
void imlib_image_fill_ellipse(int xc, int yc, int a, int b);
Imlib_Color_Range imlib_create_color_range(void);
void imlib_free_color_range(void);
void imlib_add_color_to_color_range(int distance_away);
void imlib_image_fill_color_range_rectangle(int x, int y, int width, int height,
double angle);
void imlib_image_fill_hsva_color_range_rectangle(int x, int y, int width,
int height, double angle);
void imlib_image_attach_data_value(
const char *key, void *data, int value,
Imlib_Data_Destructor_Function destructor_function);
void *imlib_image_get_attached_data(const char *key);
int imlib_image_get_attached_value(const char *key);
void imlib_image_remove_attached_data_value(const char *key);
void imlib_image_remove_and_free_attached_data_value(const char *key);
void imlib_save_image(const char *filename);
void imlib_save_image_with_errno_return(const char *filename,
int *error_return);
Imlib_Image imlib_create_rotated_image(double angle);
void imlib_rotate_image_from_buffer(double angle, Imlib_Image source_image);
void imlib_blend_image_onto_image_at_angle(Imlib_Image source_image,
char merge_alpha, int source_x,
int source_y, int source_width,
int source_height, int destination_x,
int destination_y, int angle_x,
int angle_y);
void imlib_blend_image_onto_image_skewed(
Imlib_Image source_image, char merge_alpha, int source_x, int source_y,
int source_width, int source_height, int destination_x, int destination_y,
int h_angle_x, int h_angle_y, int v_angle_x, int v_angle_y);
#ifndef X_DISPLAY_MISSING
void imlib_render_image_on_drawable_skewed(int source_x, int source_y,
int source_width, int source_height,
int destination_x, int destination_y,
int h_angle_x, int h_angle_y,
int v_angle_x, int v_angle_y);
void imlib_render_image_on_drawable_at_angle(
int source_x, int source_y, int source_width, int source_height,
int destination_x, int destination_y, int angle_x, int angle_y);
#endif
void imlib_image_filter(void);
Imlib_Filter imlib_create_filter(int initsize);
void imlib_context_set_filter(Imlib_Filter filter);
Imlib_Filter imlib_context_get_filter(void);
void imlib_free_filter(void);
void imlib_filter_set(int xoff, int yoff, int a, int r, int g, int b);
void imlib_filter_set_alpha(int xoff, int yoff, int a, int r, int g, int b);
void imlib_filter_set_red(int xoff, int yoff, int a, int r, int g, int b);
void imlib_filter_set_green(int xoff, int yoff, int a, int r, int g, int b);
void imlib_filter_set_blue(int xoff, int yoff, int a, int r, int g, int b);
void imlib_filter_constants(int a, int r, int g, int b);
void imlib_filter_divisors(int a, int r, int g, int b);
void imlib_image_clear(void);
void imlib_image_clear_color(int r, int g, int b, int a);
typedef struct {
int frame_count;
int frame_num;
int canvas_w, canvas_h;
int frame_x, frame_y;
int frame_w, frame_h;
int frame_flags;
int frame_delay;
int loop_count;
} Imlib_Frame_Info;
Imlib_Image imlib_load_image_frame(const char *file, int frame);
Imlib_Image imlib_load_image_frame_mem(const char *file, int frame,
const void *data, size_t size);
void imlib_image_get_frame_info(Imlib_Frame_Info *info);
const char *imlib_strerror(int err);
typedef enum {
IMLIB_LOAD_ERROR_NONE,
IMLIB_LOAD_ERROR_FILE_DOES_NOT_EXIST,
IMLIB_LOAD_ERROR_FILE_IS_DIRECTORY,
IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_READ,
IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT,
IMLIB_LOAD_ERROR_PATH_TOO_LONG,
IMLIB_LOAD_ERROR_PATH_COMPONENT_NON_EXISTANT,
IMLIB_LOAD_ERROR_PATH_COMPONENT_NOT_DIRECTORY,
IMLIB_LOAD_ERROR_PATH_POINTS_OUTSIDE_ADDRESS_SPACE,
IMLIB_LOAD_ERROR_TOO_MANY_SYMBOLIC_LINKS,
IMLIB_LOAD_ERROR_OUT_OF_MEMORY,
IMLIB_LOAD_ERROR_OUT_OF_FILE_DESCRIPTORS,
IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_WRITE,
IMLIB_LOAD_ERROR_OUT_OF_DISK_SPACE,
IMLIB_LOAD_ERROR_UNKNOWN,
IMLIB_LOAD_ERROR_IMAGE_READ,
IMLIB_LOAD_ERROR_IMAGE_FRAME
} Imlib_Load_Error;
Imlib_Image imlib_load_image_with_error_return(const char *file,
Imlib_Load_Error *error_return);
void imlib_save_image_with_error_return(const char *filename,
Imlib_Load_Error *error_return);
typedef enum {
IMLIB_TTF_ENCODING_ISO_8859_1,
IMLIB_TTF_ENCODING_ISO_8859_2,
IMLIB_TTF_ENCODING_ISO_8859_3,
IMLIB_TTF_ENCODING_ISO_8859_4,
IMLIB_TTF_ENCODING_ISO_8859_5
} Imlib_TTF_Encoding;