aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/lib/include/evas_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/lib/include/evas_private.h')
-rw-r--r--libraries/evas/src/lib/include/evas_private.h1107
1 files changed, 1107 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/include/evas_private.h b/libraries/evas/src/lib/include/evas_private.h
new file mode 100644
index 0000000..90498d0
--- /dev/null
+++ b/libraries/evas/src/lib/include/evas_private.h
@@ -0,0 +1,1107 @@
1#ifndef EVAS_PRIVATE_H
2#define EVAS_PRIVATE_H
3
4#ifdef HAVE_CONFIG_H
5# include <config.h>
6#endif
7
8#include <Eina.h>
9#include <eina_safety_checks.h>
10#include "Evas.h"
11
12#include "../file/evas_module.h"
13#include "../file/evas_path.h"
14#include "../engines/common/evas_text_utils.h"
15#include "../engines/common/language/evas_bidi_utils.h"
16#include "../engines/common/language/evas_language_utils.h"
17
18#ifdef EVAS_MAGIC_DEBUG
19/* complain when peole pass in wrong object types etc. */
20# define MAGIC_DEBUG
21#endif
22
23#define RENDER_METHOD_INVALID 0x00000000
24
25typedef struct _Evas_Layer Evas_Layer;
26typedef struct _Evas_Size Evas_Size;
27typedef struct _Evas_Aspect Evas_Aspect;
28typedef struct _Evas_Border Evas_Border;
29typedef struct _Evas_Double_Pair Evas_Double_Pair;
30typedef struct _Evas_Size_Hints Evas_Size_Hints;
31typedef struct _Evas_Font_Dir Evas_Font_Dir;
32typedef struct _Evas_Font Evas_Font;
33typedef struct _Evas_Font_Alias Evas_Font_Alias;
34typedef struct _Evas_Font_Description Evas_Font_Description;
35typedef struct _Evas_Data_Node Evas_Data_Node;
36typedef struct _Evas_Func_Node Evas_Func_Node;
37typedef RGBA_Image_Loadopts Evas_Image_Load_Opts;
38typedef struct _Evas_Func Evas_Func;
39typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func;
40typedef struct _Evas_Image_Save_Func Evas_Image_Save_Func;
41typedef struct _Evas_Object_Func Evas_Object_Func;
42typedef struct _Evas_Intercept_Func Evas_Intercept_Func;
43typedef struct _Evas_Key_Grab Evas_Key_Grab;
44typedef struct _Evas_Callbacks Evas_Callbacks;
45typedef struct _Evas_Format Evas_Format;
46typedef struct _Evas_Map_Point Evas_Map_Point;
47typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array;
48typedef struct _Evas_Post_Callback Evas_Post_Callback;
49typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point;
50
51enum _Evas_Font_Style
52{
53 EVAS_FONT_STYLE_SLANT,
54 EVAS_FONT_STYLE_WEIGHT,
55 EVAS_FONT_STYLE_WIDTH
56};
57
58enum _Evas_Font_Slant
59{
60 EVAS_FONT_SLANT_NORMAL,
61 EVAS_FONT_SLANT_OBLIQUE,
62 EVAS_FONT_SLANT_ITALIC
63};
64
65enum _Evas_Font_Weight
66{
67 EVAS_FONT_WEIGHT_NORMAL,
68 EVAS_FONT_WEIGHT_THIN,
69 EVAS_FONT_WEIGHT_ULTRALIGHT,
70 EVAS_FONT_WEIGHT_LIGHT,
71 EVAS_FONT_WEIGHT_BOOK,
72 EVAS_FONT_WEIGHT_MEDIUM,
73 EVAS_FONT_WEIGHT_SEMIBOLD,
74 EVAS_FONT_WEIGHT_BOLD,
75 EVAS_FONT_WEIGHT_ULTRABOLD,
76 EVAS_FONT_WEIGHT_BLACK,
77 EVAS_FONT_WEIGHT_EXTRABLACK
78};
79
80enum _Evas_Font_Width
81{
82 EVAS_FONT_WIDTH_NORMAL,
83 EVAS_FONT_WIDTH_ULTRACONDENSED,
84 EVAS_FONT_WIDTH_EXTRACONDENSED,
85 EVAS_FONT_WIDTH_CONDENSED,
86 EVAS_FONT_WIDTH_SEMICONDENSED,
87 EVAS_FONT_WIDTH_SEMIEXPANDED,
88 EVAS_FONT_WIDTH_EXPANDED,
89 EVAS_FONT_WIDTH_EXTRAEXPANDED,
90 EVAS_FONT_WIDTH_ULTRAEXPANDED
91};
92
93typedef enum _Evas_Font_Style Evas_Font_Style;
94typedef enum _Evas_Font_Slant Evas_Font_Slant;
95typedef enum _Evas_Font_Weight Evas_Font_Weight;
96typedef enum _Evas_Font_Width Evas_Font_Width;
97
98/* General types - used for script type chceking */
99#define OPAQUE_TYPE(type) struct __##type { int a; }; \
100 typedef struct __##type type
101
102OPAQUE_TYPE(Evas_Font_Set); /* General type for RGBA_Font */
103OPAQUE_TYPE(Evas_Font_Instance); /* General type for RGBA_Font_Int */
104/* End of general types */
105
106#define MAGIC_EVAS 0x70777770
107#define MAGIC_OBJ 0x71777770
108#define MAGIC_OBJ_RECTANGLE 0x71777771
109#define MAGIC_OBJ_LINE 0x71777772
110#define MAGIC_OBJ_POLYGON 0x71777774
111#define MAGIC_OBJ_IMAGE 0x71777775
112#define MAGIC_OBJ_TEXT 0x71777776
113#define MAGIC_OBJ_SMART 0x71777777
114#define MAGIC_OBJ_TEXTBLOCK 0x71777778
115#define MAGIC_SMART 0x72777770
116#define MAGIC_OBJ_SHAPE 0x72777773
117#define MAGIC_OBJ_CONTAINER 0x72777774
118#define MAGIC_OBJ_CUSTOM 0x72777775
119#define MAGIC_EVAS_GL 0x72777776
120#define MAGIC_MAP 0x72777777
121
122#ifdef MAGIC_DEBUG
123# define MAGIC_CHECK_FAILED(o, t, m) \
124{evas_debug_error(); \
125 if (!o) evas_debug_input_null(); \
126 else if (((t *)o)->magic == 0) evas_debug_magic_null(); \
127 else evas_debug_magic_wrong((m), ((t *)o)->magic); \
128}
129# define MAGIC_CHECK(o, t, m) \
130{if ((!o) || (!(((t *)o)->magic == (m)))) { \
131MAGIC_CHECK_FAILED(o, t, m)
132# define MAGIC_CHECK_END() }}
133#else
134# define MAGIC_CHECK_FAILED(o, t, m)
135# define MAGIC_CHECK(o, t, m) { if (!o) {
136# define MAGIC_CHECK_END() }}
137#endif
138
139#define NEW_RECT(_r, _x, _y, _w, _h) (_r) = eina_rectangle_new(_x, _y, _w, _h);
140
141#define MERR_NONE() _evas_alloc_error = EVAS_ALLOC_ERROR_NONE
142#define MERR_FATAL() _evas_alloc_error = EVAS_ALLOC_ERROR_FATAL
143#define MERR_BAD() _evas_alloc_error = EVAS_ALLOC_ERROR_RECOVERED
144
145#define EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o) \
146 if ((o)->cur.file) \
147 { \
148 eina_stringshare_del((o)->cur.file); \
149 if ((o)->prev.file == (o)->cur.file) \
150 (o)->prev.file = NULL; \
151 (o)->cur.file = NULL; \
152 } \
153 if ((o)->cur.key) \
154 { \
155 eina_stringshare_del((o)->cur.key); \
156 if ((o)->prev.key == (o)->cur.key) \
157 (o)->prev.key = NULL; \
158 (o)->cur.key = NULL; \
159 } \
160 if ((o)->prev.file) \
161 { \
162 eina_stringshare_del((o)->prev.file); \
163 (o)->prev.file = NULL; \
164 } \
165 if ((o)->prev.key) \
166 { \
167 eina_stringshare_del((o)->prev.key); \
168 (o)->prev.key = NULL; \
169 }
170
171struct _Evas_Coord_Touch_Point
172{
173 Evas_Coord x, y; // point's x, y position
174 int id; // id in order to distinguish each point
175 Evas_Touch_Point_State state;
176};
177
178struct _Evas_Key_Grab
179{
180 char *keyname;
181 Evas_Modifier_Mask modifiers;
182 Evas_Modifier_Mask not_modifiers;
183 Evas_Object *object;
184 Eina_Bool exclusive : 1;
185 Eina_Bool just_added : 1;
186 Eina_Bool delete_me : 1;
187};
188
189struct _Evas_Intercept_Func
190{
191 struct {
192 Evas_Object_Intercept_Show_Cb func;
193 void *data;
194 } show;
195 struct {
196 Evas_Object_Intercept_Hide_Cb func;
197 void *data;
198 } hide;
199 struct {
200 Evas_Object_Intercept_Move_Cb func;
201 void *data;
202 } move;
203 struct {
204 Evas_Object_Intercept_Resize_Cb func;
205 void *data;
206 } resize;
207 struct {
208 Evas_Object_Intercept_Raise_Cb func;
209 void *data;
210 } raise;
211 struct {
212 Evas_Object_Intercept_Lower_Cb func;
213 void *data;
214 } lower;
215 struct {
216 Evas_Object_Intercept_Stack_Above_Cb func;
217 void *data;
218 } stack_above;
219 struct {
220 Evas_Object_Intercept_Stack_Below_Cb func;
221 void *data;
222 } stack_below;
223 struct {
224 Evas_Object_Intercept_Layer_Set_Cb func;
225 void *data;
226 } layer_set;
227 struct {
228 Evas_Object_Intercept_Color_Set_Cb func;
229 void *data;
230 } color_set;
231 struct {
232 Evas_Object_Intercept_Clip_Set_Cb func;
233 void *data;
234 } clip_set;
235 struct {
236 Evas_Object_Intercept_Clip_Unset_Cb func;
237 void *data;
238 } clip_unset;
239};
240
241struct _Evas_Smart_Cb_Description_Array
242{
243 unsigned int size;
244 const Evas_Smart_Cb_Description **array;
245};
246
247struct _Evas_Smart
248{
249 DATA32 magic;
250
251 int usage;
252
253 const Evas_Smart_Class *smart_class;
254
255 Evas_Smart_Cb_Description_Array callbacks;
256
257 unsigned char delete_me : 1;
258 unsigned char class_allocated : 1;
259
260};
261
262struct _Evas_Modifier
263{
264 struct {
265 int count;
266 char **list;
267 } mod;
268 Evas_Modifier_Mask mask; /* ok we have a max of 64 modifiers */
269};
270
271struct _Evas_Lock
272{
273 struct {
274 int count;
275 char **list;
276 } lock;
277 Evas_Modifier_Mask mask; /* we have a max of 64 locks */
278};
279
280struct _Evas_Post_Callback
281{
282 Evas_Object *obj;
283 Evas_Object_Event_Post_Cb func;
284 const void *data;
285 unsigned char delete_me : 1;
286};
287
288struct _Evas_Callbacks
289{
290 Eina_Inlist *callbacks;
291 int walking_list;
292 unsigned char deletions_waiting : 1;
293};
294
295struct _Evas
296{
297 EINA_INLIST;
298
299 DATA32 magic;
300
301 struct {
302 unsigned char inside : 1;
303 int mouse_grabbed;
304 DATA32 button;
305 Evas_Coord x, y;
306 struct {
307 Eina_List *in;
308 } object;
309
310 } pointer;
311
312 struct {
313 Evas_Coord x, y, w, h;
314 unsigned char changed : 1;
315 } viewport;
316
317 struct {
318 int w, h;
319 DATA32 render_method;
320 unsigned char changed : 1;
321 } output;
322
323 Eina_List *damages;
324 Eina_List *obscures;
325
326 Evas_Layer *layers;
327
328 Eina_Hash *name_hash;
329
330 int output_validity;
331
332 int walking_list;
333 int events_frozen;
334
335 struct {
336 Evas_Module *module;
337 Evas_Func *func;
338 struct {
339 void *output;
340
341 void *context;
342 } data;
343
344 void *info;
345 int info_magic;
346 } engine;
347
348 Eina_Array delete_objects;
349 Eina_Array active_objects;
350 Eina_Array restack_objects;
351 Eina_Array render_objects;
352 Eina_Array pending_objects;
353 Eina_Array obscuring_objects;
354 Eina_Array temporary_objects;
355 Eina_Array calculate_objects;
356 Eina_Array clip_changes;
357
358 Eina_Clist calc_list;
359 Eina_Clist calc_done;
360 Eina_List *video_objects;
361
362 Eina_List *post_events; // free me on evas_free
363
364 Evas_Callbacks *callbacks;
365
366 int delete_grabs;
367 int walking_grabs;
368 Eina_List *grabs;
369
370 Eina_List *font_path;
371
372 int in_smart_calc;
373 int smart_calc_count;
374
375 Evas_Object *focused;
376 void *attach_data;
377 Evas_Modifier modifiers;
378 Evas_Lock locks;
379 unsigned int last_timestamp;
380 int last_mouse_down_counter;
381 int last_mouse_up_counter;
382 int nochange;
383 Evas_Font_Hinting_Flags hinting;
384 unsigned char changed : 1;
385 unsigned char delete_me : 1;
386 unsigned char invalidate : 1;
387 unsigned char cleanup : 1;
388 unsigned char focus : 1;
389
390 Eina_List *touch_points;
391};
392
393struct _Evas_Layer
394{
395 EINA_INLIST;
396
397 short layer;
398 Evas_Object *objects;
399
400 Evas *evas;
401
402 void *engine_data;
403 int usage;
404 unsigned char delete_me : 1;
405};
406
407struct _Evas_Size
408{
409 Evas_Coord w, h;
410};
411
412struct _Evas_Aspect
413{
414 Evas_Aspect_Control mode;
415 Evas_Size size;
416};
417
418struct _Evas_Border
419{
420 Evas_Coord l, r, t, b;
421};
422
423struct _Evas_Double_Pair
424{
425 double x, y;
426};
427
428struct _Evas_Size_Hints
429{
430 Evas_Size min, max, request;
431 Evas_Aspect aspect;
432 Evas_Double_Pair align, weight;
433 Evas_Border padding;
434};
435
436struct _Evas_Map_Point
437{
438 double x, y, z, px, py;
439 double u, v;
440 unsigned char r, g, b, a;
441};
442
443struct _Evas_Map
444{
445 DATA32 magic;
446 int count; // num of points
447 Evas_Coord_Rectangle normal_geometry; // bounding box of map geom actually
448 void *surface; // surface holding map if needed
449 int surface_w, surface_h; // current surface w & h alloc
450 Evas_Coord mx, my; // mouse x, y after conversion to map space
451 struct {
452 Evas_Coord px, py, z0, foc;
453 } persp;
454 Eina_Bool alpha : 1;
455 Eina_Bool smooth : 1;
456 Evas_Map_Point points[]; // actual points
457};
458
459#if 0 // filtering disabled
460/* nash: Split into two bits */
461typedef struct Evas_Filter_Info
462{
463 Evas_Filter filter;
464 Evas_Filter_Mode mode;
465
466 Eina_Bool dirty : 1;
467
468 int datalen;
469 void *data;
470 void (*data_free)(void *);
471
472 uint8_t *key;
473 uint32_t len;
474 Filtered_Image *cached;
475} Evas_Filter_Info;
476
477typedef Eina_Bool (*Evas_Software_Filter_Fn)(Evas_Filter_Info *, RGBA_Image *, RGBA_Image *);
478
479int evas_filter_get_size(Evas_Filter_Info *info, int inw, int inh,
480 int *outw, int *outh, Eina_Bool inv);
481Eina_Bool evas_filter_always_alpha(Evas_Filter_Info *info);
482uint8_t *evas_filter_key_get(const Evas_Filter_Info *info, uint32_t *lenp);
483// expose for use in engines
484EAPI Evas_Software_Filter_Fn evas_filter_software_get(Evas_Filter_Info *info);
485void evas_filter_free(Evas_Object *o);
486#endif
487
488struct _Evas_Object
489{
490 EINA_INLIST;
491
492 DATA32 magic;
493
494 const char *type;
495 Evas_Layer *layer;
496
497 struct {
498 Evas_Map *map;
499 Evas_Object *clipper;
500 Evas_Object *mask;
501 Evas_Object *map_parent;
502 double scale;
503 Evas_Coord_Rectangle geometry;
504 struct {
505 struct {
506 Evas_Coord x, y, w, h;
507 unsigned char r, g, b, a;
508 Eina_Bool visible : 1;
509 Eina_Bool dirty : 1;
510 } clip;
511 } cache;
512 short layer;
513 struct {
514 unsigned char r, g, b, a;
515 } color;
516 Eina_Bool usemap : 1;
517 Eina_Bool visible : 1;
518 Eina_Bool have_clipees : 1;
519 Eina_Bool anti_alias : 1;
520 Evas_Render_Op render_op : 4;
521 } cur, prev;
522
523 char *name;
524
525 Evas_Intercept_Func *interceptors;
526
527 struct {
528 Eina_List *elements;
529 } data;
530
531 Eina_List *grabs;
532
533 Evas_Callbacks *callbacks;
534
535 struct {
536 Eina_List *clipees;
537 Eina_List *changes;
538 } clip;
539
540 const Evas_Object_Func *func;
541
542 void *object_data;
543
544 struct {
545 Evas_Smart *smart;
546 Evas_Object *parent;
547 } smart;
548
549 struct {
550 Eina_List *proxies;
551 void *surface;
552 int w,h;
553 Eina_Bool redraw;
554 } proxy;
555
556#if 0 // filtering disabled
557 Evas_Filter_Info *filter;
558#endif
559
560 Evas_Size_Hints *size_hints;
561
562 int last_mouse_down_counter;
563 int last_mouse_up_counter;
564 int mouse_grabbed;
565
566 int last_event;
567 Evas_Callback_Type last_event_type;
568
569 struct {
570 int in_move, in_resize;
571 } doing;
572
573 unsigned int ref;
574
575 unsigned char delete_me;
576
577 unsigned char recalculate_cycle;
578 Eina_Clist calc_entry;
579
580 Evas_Object_Pointer_Mode pointer_mode : 1;
581
582 Eina_Bool store : 1;
583 Eina_Bool pass_events : 1;
584 Eina_Bool freeze_events : 1;
585 Eina_Bool repeat_events : 1;
586 struct {
587 Eina_Bool pass_events : 1;
588 Eina_Bool pass_events_valid : 1;
589 Eina_Bool freeze_events : 1;
590 Eina_Bool freeze_events_valid : 1;
591 } parent_cache;
592 Eina_Bool restack : 1;
593 Eina_Bool is_active : 1;
594 Eina_Bool precise_is_inside : 1;
595 Eina_Bool is_static_clip : 1;
596
597 Eina_Bool render_pre : 1;
598 Eina_Bool rect_del : 1;
599 Eina_Bool mouse_in : 1;
600 Eina_Bool pre_render_done : 1;
601 Eina_Bool intercepted : 1;
602 Eina_Bool focused : 1;
603 Eina_Bool in_layer : 1;
604 Eina_Bool no_propagate : 1;
605
606 Eina_Bool changed : 1;
607 Eina_Bool changed_move : 1;
608 Eina_Bool changed_move_only : 1;
609 Eina_Bool changed_nomove : 1;
610 Eina_Bool del_ref : 1;
611};
612
613struct _Evas_Func_Node
614{
615 EINA_INLIST;
616 void (*func) ();
617 void *data;
618 Evas_Callback_Type type;
619 Evas_Callback_Priority priority;
620 unsigned char delete_me : 1;
621};
622
623struct _Evas_Data_Node
624{
625 char *key;
626 void *data;
627};
628
629struct _Evas_Font_Dir
630{
631 Eina_Hash *lookup;
632 Eina_List *fonts;
633 Eina_List *aliases;
634 DATA64 dir_mod_time;
635 DATA64 fonts_dir_mod_time;
636 DATA64 fonts_alias_mod_time;
637};
638
639struct _Evas_Font
640{
641 struct {
642 const char *prop[14];
643 } x;
644 struct {
645 const char *name;
646 } simple;
647 const char *path;
648 char type;
649};
650
651struct _Evas_Font_Alias
652{
653 const char *alias;
654 Evas_Font *fn;
655};
656
657struct _Evas_Font_Description
658{
659 int ref;
660 /* We assume everywhere this is stringshared */
661 const char *name;
662 const char *fallbacks;
663 const char *lang;
664
665 Evas_Font_Slant slant;
666 Evas_Font_Weight weight;
667 Evas_Font_Width width;
668
669 Eina_Bool is_new : 1;
670};
671
672struct _Evas_Object_Func
673{
674 void (*free) (Evas_Object *obj);
675 void (*render) (Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
676 void (*render_pre) (Evas_Object *obj);
677 void (*render_post) (Evas_Object *obj);
678
679 unsigned int (*type_id_get) (Evas_Object *obj);
680 unsigned int (*visual_id_get) (Evas_Object *obj);
681 void *(*engine_data_get) (Evas_Object *obj);
682
683 void (*store) (Evas_Object *obj);
684 void (*unstore) (Evas_Object *obj);
685
686 int (*is_visible) (Evas_Object *obj);
687 int (*was_visible) (Evas_Object *obj);
688
689 int (*is_opaque) (Evas_Object *obj);
690 int (*was_opaque) (Evas_Object *obj);
691
692 int (*is_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
693 int (*was_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
694
695 void (*coords_recalc) (Evas_Object *obj);
696
697 void (*scale_update) (Evas_Object *obj);
698
699 int (*has_opaque_rect) (Evas_Object *obj);
700 int (*get_opaque_rect) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
701
702 int (*can_map) (Evas_Object *obj);
703};
704
705struct _Evas_Func
706{
707 void *(*info) (Evas *e);
708 void (*info_free) (Evas *e, void *info);
709 int (*setup) (Evas *e, void *info);
710
711 void (*output_free) (void *data);
712 void (*output_resize) (void *data, int w, int h);
713 void (*output_tile_size_set) (void *data, int w, int h);
714 void (*output_redraws_rect_add) (void *data, int x, int y, int w, int h);
715 void (*output_redraws_rect_del) (void *data, int x, int y, int w, int h);
716 void (*output_redraws_clear) (void *data);
717 void *(*output_redraws_next_update_get) (void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch);
718 void (*output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h);
719 void (*output_flush) (void *data);
720 void (*output_idle_flush) (void *data);
721 void (*output_dump) (void *data);
722
723 void *(*context_new) (void *data);
724 Eina_Bool (*canvas_alpha_get) (void *data, void *context);
725 void (*context_free) (void *data, void *context);
726 void (*context_clip_set) (void *data, void *context, int x, int y, int w, int h);
727 void (*context_clip_clip) (void *data, void *context, int x, int y, int w, int h);
728 void (*context_clip_unset) (void *data, void *context);
729 int (*context_clip_get) (void *data, void *context, int *x, int *y, int *w, int *h);
730 void (*context_mask_set) (void *data, void *context, void *mask, int x, int y, int w, int h);
731 void (*context_mask_unset) (void *data, void *context);
732 void (*context_color_set) (void *data, void *context, int r, int g, int b, int a);
733 int (*context_color_get) (void *data, void *context, int *r, int *g, int *b, int *a);
734 void (*context_multiplier_set) (void *data, void *context, int r, int g, int b, int a);
735 void (*context_multiplier_unset) (void *data, void *context);
736 int (*context_multiplier_get) (void *data, void *context, int *r, int *g, int *b, int *a);
737 void (*context_cutout_add) (void *data, void *context, int x, int y, int w, int h);
738 void (*context_cutout_clear) (void *data, void *context);
739 void (*context_anti_alias_set) (void *data, void *context, unsigned char aa);
740 unsigned char (*context_anti_alias_get) (void *data, void *context);
741 void (*context_color_interpolation_set) (void *data, void *context, int color_space);
742 int (*context_color_interpolation_get) (void *data, void *context);
743 void (*context_render_op_set) (void *data, void *context, int render_op);
744 int (*context_render_op_get) (void *data, void *context);
745
746 void (*rectangle_draw) (void *data, void *context, void *surface, int x, int y, int w, int h);
747
748 void (*line_draw) (void *data, void *context, void *surface, int x1, int y1, int x2, int y2);
749
750 void *(*polygon_point_add) (void *data, void *context, void *polygon, int x, int y);
751 void *(*polygon_points_clear) (void *data, void *context, void *polygon);
752 void (*polygon_draw) (void *data, void *context, void *surface, void *polygon, int x, int y);
753
754 void *(*image_load) (void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
755 void *(*image_new_from_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
756 void *(*image_new_from_copied_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
757 void (*image_free) (void *data, void *image);
758 void (*image_size_get) (void *data, void *image, int *w, int *h);
759 void *(*image_size_set) (void *data, void *image, int w, int h);
760 void (*image_stride_get) (void *data, void *image, int *stride);
761 void *(*image_dirty_region) (void *data, void *image, int x, int y, int w, int h);
762 void *(*image_data_get) (void *data, void *image, int to_write, DATA32 **image_data, int *err);
763 void *(*image_data_put) (void *data, void *image, DATA32 *image_data);
764 void (*image_data_preload_request) (void *data, void *image, const void *target);
765 void (*image_data_preload_cancel) (void *data, void *image, const void *target);
766 void *(*image_alpha_set) (void *data, void *image, int has_alpha);
767 int (*image_alpha_get) (void *data, void *image);
768 void *(*image_border_set) (void *data, void *image, int l, int r, int t, int b);
769 void (*image_border_get) (void *data, void *image, int *l, int *r, int *t, int *b);
770 void (*image_draw) (void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth);
771 char *(*image_comment_get) (void *data, void *image, char *key);
772 char *(*image_format_get) (void *data, void *image);
773 void (*image_colorspace_set) (void *data, void *image, int cspace);
774 int (*image_colorspace_get) (void *data, void *image);
775 void (*image_mask_create) (void *data, void *image);
776 void *(*image_native_set) (void *data, void *image, void *native);
777 void *(*image_native_get) (void *data, void *image);
778
779 void (*image_cache_flush) (void *data);
780 void (*image_cache_set) (void *data, int bytes);
781 int (*image_cache_get) (void *data);
782
783 Evas_Font_Set *(*font_load) (void *data, const char *name, int size, Font_Rend_Flags wanted_rend);
784 Evas_Font_Set *(*font_memory_load) (void *data, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
785 Evas_Font_Set *(*font_add) (void *data, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend);
786 Evas_Font_Set *(*font_memory_add) (void *data, Evas_Font_Set *font, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
787 void (*font_free) (void *data, Evas_Font_Set *font);
788 int (*font_ascent_get) (void *data, Evas_Font_Set *font);
789 int (*font_descent_get) (void *data, Evas_Font_Set *font);
790 int (*font_max_ascent_get) (void *data, Evas_Font_Set *font);
791 int (*font_max_descent_get) (void *data, Evas_Font_Set *font);
792 void (*font_string_size_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int *w, int *h);
793 int (*font_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
794 int (*font_h_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
795 int (*font_v_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
796 int (*font_char_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
797 int (*font_char_at_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
798 void (*font_draw) (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, const Evas_Text_Props *intl_props);
799
800 void (*font_cache_flush) (void *data);
801 void (*font_cache_set) (void *data, int bytes);
802 int (*font_cache_get) (void *data);
803
804 /* Engine functions will over time expand from here */
805
806 void (*font_hinting_set) (void *data, Evas_Font_Set *font, int hinting);
807 int (*font_hinting_can_hint) (void *data, int hinting);
808
809/* void (*image_rotation_set) (void *data, void *image); */
810
811 void (*image_scale_hint_set) (void *data, void *image, int hint);
812 int (*image_scale_hint_get) (void *data, void *image);
813 int (*font_last_up_to_pos) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y);
814
815 void (*image_map_draw) (void *data, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level);
816 void *(*image_map_surface_new) (void *data, int w, int h, int alpha);
817 void (*image_map_surface_free) (void *data, void *surface);
818
819 void (*image_content_hint_set) (void *data, void *surface, int hint);
820 int (*image_content_hint_get) (void *data, void *surface);
821 int (*font_pen_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
822 Eina_Bool (*font_text_props_info_create) (void *data __UNUSED__, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
823 int (*font_right_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
824
825#if 0 // filtering disabled
826 void (*image_draw_filtered) (void *data, void *context, void *surface, void *image, Evas_Filter_Info *filter);
827 Filtered_Image *(*image_filtered_get) (void *image, uint8_t *key, size_t len);
828 Filtered_Image *(*image_filtered_save) (void *image, void *filtered, uint8_t *key, size_t len);
829 void (*image_filtered_free) (void *image, Filtered_Image *);
830#endif
831
832 /* EFL-GL Glue Layer */
833 void *(*gl_surface_create) (void *data, void *config, int w, int h);
834 int (*gl_surface_destroy) (void *data, void *surface);
835 void *(*gl_context_create) (void *data, void *share_context);
836 int (*gl_context_destroy) (void *data, void *context);
837 int (*gl_make_current) (void *data, void *surface, void *context);
838 void *(*gl_string_query) (void *data, int name);
839 void *(*gl_proc_address_get) (void *data, const char *name);
840 int (*gl_native_surface_get) (void *data, void *surface, void *native_surface);
841 void *(*gl_api_get) (void *data);
842
843 int (*image_load_error_get) (void *data, void *image);
844 int (*font_run_end_get) (void *data, Evas_Font_Set *font, Evas_Font_Instance **script_fi, Evas_Font_Instance **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len);
845
846 /* animated feature */
847 Eina_Bool (*image_animated_get) (void *data, void *image);
848 int (*image_animated_frame_count_get) (void *data, void *image);
849 Evas_Image_Animated_Loop_Hint (*image_animated_loop_type_get) (void *data, void *image);
850 int (*image_animated_loop_count_get) (void *data, void *image);
851 double (*image_animated_frame_duration_get) (void *data, void *image, int start_frame, int frame_num);
852 Eina_Bool (*image_animated_frame_set) (void *data, void *image, int frame_index);
853
854 /* max size query */
855 void (*image_max_size_get) (void *data, int *maxw, int *maxh);
856};
857
858struct _Evas_Image_Load_Func
859{
860 Eina_Bool threadable;
861 Eina_Bool (*file_head) (Image_Entry *ie, const char *file, const char *key, int *error);
862 Eina_Bool (*file_data) (Image_Entry *ie, const char *file, const char *key, int *error);
863 double (*frame_duration) (Image_Entry *ie, const char *file, const int start, const int frame_num);
864};
865
866struct _Evas_Image_Save_Func
867{
868 int (*image_save) (RGBA_Image *im, const char *file, const char *key, int quality, int compress);
869};
870
871#ifdef __cplusplus
872extern "C" {
873#endif
874
875Evas_Object *evas_object_new(Evas *e);
876void evas_object_free(Evas_Object *obj, int clean_layer);
877void evas_object_inject(Evas_Object *obj, Evas *e);
878void evas_object_release(Evas_Object *obj, int clean_layer);
879void evas_object_change(Evas_Object *obj);
880void evas_object_clip_changes_clean(Evas_Object *obj);
881void evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
882void evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj);
883void evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj);
884void evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
885void evas_rects_return_difference_rects(Eina_Array *rects, int x, int y, int w, int h, int xx, int yy, int ww, int hh);
886
887void evas_object_clip_dirty(Evas_Object *obj);
888void evas_object_recalc_clippees(Evas_Object *obj);
889Evas_Layer *evas_layer_new(Evas *e);
890void evas_layer_pre_free(Evas_Layer *lay);
891void evas_layer_free_objects(Evas_Layer *lay);
892void evas_layer_clean(Evas *e);
893Evas_Layer *evas_layer_find(Evas *e, short layer_num);
894void evas_layer_add(Evas_Layer *lay);
895void evas_layer_del(Evas_Layer *lay);
896
897int evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h);
898
899int evas_object_was_opaque(Evas_Object *obj);
900int evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
901int evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
902int evas_object_clippers_was_visible(Evas_Object *obj);
903void evas_object_clip_across_check(Evas_Object *obj);
904void evas_object_clip_across_clippees_check(Evas_Object *obj);
905void evas_object_mapped_clip_across_mark(Evas_Object *obj);
906void evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info);
907void evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info);
908Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y);
909int evas_mem_free(int mem_required);
910int evas_mem_degrade(int mem_required);
911void evas_debug_error(void);
912void evas_debug_input_null(void);
913void evas_debug_magic_null(void);
914void evas_debug_magic_wrong(DATA32 expected, DATA32 supplied);
915void evas_debug_generic(const char *str);
916const char *evas_debug_magic_string_get(DATA32 magic);
917void evas_object_smart_use(Evas_Smart *s);
918void evas_object_smart_unuse(Evas_Smart *s);
919void evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) EINA_ARG_NONNULL(1);
920Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1);
921const Evas_Smart_Cb_Description *evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE;
922
923Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj);
924void _evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading);
925void _evas_object_image_preloading_check(Evas_Object *obj);
926Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj);
927void _evas_object_image_video_overlay_show(Evas_Object *obj);
928void _evas_object_image_video_overlay_hide(Evas_Object *obj);
929void evas_object_smart_del(Evas_Object *obj);
930void evas_object_smart_cleanup(Evas_Object *obj);
931void evas_object_smart_member_raise(Evas_Object *member);
932void evas_object_smart_member_lower(Evas_Object *member);
933void evas_object_smart_member_stack_above(Evas_Object *member, Evas_Object *other);
934void evas_object_smart_member_stack_below(Evas_Object *member, Evas_Object *other);
935const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj);
936void _evas_object_smart_members_all_del(Evas_Object *obj);
937void evas_call_smarts_calculate(Evas *e);
938void *evas_mem_calloc(int size);
939void _evas_post_event_callback_call(Evas *e);
940void _evas_post_event_callback_free(Evas *e);
941void evas_event_callback_list_post_free(Eina_Inlist **list);
942void evas_object_event_callback_all_del(Evas_Object *obj);
943void evas_object_event_callback_cleanup(Evas_Object *obj);
944void evas_event_callback_all_del(Evas *e);
945void evas_event_callback_cleanup(Evas *e);
946void evas_object_inform_call_show(Evas_Object *obj);
947void evas_object_inform_call_hide(Evas_Object *obj);
948void evas_object_inform_call_move(Evas_Object *obj);
949void evas_object_inform_call_resize(Evas_Object *obj);
950void evas_object_inform_call_restack(Evas_Object *obj);
951void evas_object_inform_call_changed_size_hints(Evas_Object *obj);
952void evas_object_inform_call_image_preloaded(Evas_Object *obj);
953void evas_object_inform_call_image_unloaded(Evas_Object *obj);
954void evas_object_intercept_cleanup(Evas_Object *obj);
955int evas_object_intercept_call_show(Evas_Object *obj);
956int evas_object_intercept_call_hide(Evas_Object *obj);
957int evas_object_intercept_call_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
958int evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
959int evas_object_intercept_call_raise(Evas_Object *obj);
960int evas_object_intercept_call_lower(Evas_Object *obj);
961int evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object *above);
962int evas_object_intercept_call_stack_below(Evas_Object *obj, Evas_Object *below);
963int evas_object_intercept_call_layer_set(Evas_Object *obj, int l);
964int evas_object_intercept_call_color_set(Evas_Object *obj, int r, int g, int b, int a);
965int evas_object_intercept_call_clip_set(Evas_Object *obj, Evas_Object *clip);
966int evas_object_intercept_call_clip_unset(Evas_Object *obj);
967void evas_object_grabs_cleanup(Evas_Object *obj);
968void evas_key_grab_free(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers);
969void evas_font_dir_cache_free(void);
970const char *evas_font_dir_cache_find(char *dir, char *font);
971Eina_List *evas_font_dir_available_list(const Evas* evas);
972void evas_font_dir_available_list_free(Eina_List *available);
973void evas_font_free(Evas *evas, void *font);
974void evas_fonts_zero_free(Evas *evas);
975void evas_fonts_zero_presure(Evas *evas);
976void evas_font_name_parse(Evas_Font_Description *fdesc, const char *name);
977int evas_font_style_find(const char *start, const char *end, Evas_Font_Style style);
978Evas_Font_Description *evas_font_desc_new(void);
979Evas_Font_Description *evas_font_desc_dup(const Evas_Font_Description *fdesc);
980void evas_font_desc_unref(Evas_Font_Description *fdesc);
981int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b);
982Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc);
983void * evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size);
984void evas_font_load_hinting_set(Evas *evas, void *font, int hinting);
985void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events);
986void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b);
987void _evas_object_text_rehint(Evas_Object *obj);
988void _evas_object_textblock_rehint(Evas_Object *obj);
989
990extern int _evas_alloc_error;
991extern int _evas_event_counter;
992
993struct _Evas_Imaging_Image
994{
995 RGBA_Image *image;
996};
997
998struct _Evas_Imaging_Font
999{
1000 RGBA_Font *font;
1001};
1002
1003int evas_async_events_init(void);
1004int evas_async_events_shutdown(void);
1005int evas_async_target_del(const void *target);
1006
1007void _evas_preload_thread_init(void);
1008void _evas_preload_thread_shutdown(void);
1009Evas_Preload_Pthread *evas_preload_thread_run(void (*func_heavy)(void *data),
1010 void (*func_end)(void *data),
1011 void (*func_cancel)(void *data),
1012 const void *data);
1013Eina_Bool evas_preload_thread_cancel(Evas_Preload_Pthread *thread);
1014
1015void _evas_walk(Evas *e);
1016void _evas_unwalk(Evas *e);
1017
1018// expose for use in engines
1019EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name);
1020EAPI const char *_evas_module_libdir_get(void);
1021
1022Eina_Bool evas_render_mapped(Evas *e, Evas_Object *obj,
1023 void *context, void *surface,
1024 int off_x, int off_y, int mapped,
1025 int ecx, int ecy, int ecw, int ech);
1026void evas_render_invalidate(Evas *e);
1027void evas_render_object_recalc(Evas_Object *obj);
1028
1029Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y);
1030Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab);
1031
1032Eina_List *evas_module_engine_list(void);
1033
1034/* for updating touch point list */
1035void _evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y);
1036void _evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state);
1037void _evas_touch_point_remove(Evas *e, int id);
1038
1039/****************************************************************************/
1040/*****************************************/
1041/********************/
1042#define MPOOL 1
1043
1044#ifdef MPOOL
1045typedef struct _Evas_Mempool Evas_Mempool;
1046
1047struct _Evas_Mempool
1048{
1049 int count;
1050 int num_allocs;
1051 int num_frees;
1052 Eina_Mempool *mp;
1053};
1054# define EVAS_MEMPOOL(x) \
1055 static Evas_Mempool x = {0, 0, 0, NULL}
1056# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) \
1057 do { \
1058 if (!x.mp) { \
1059 x.mp = eina_mempool_add("chained_mempool", nam, NULL, sizeof(siz), cnt); \
1060 if (!x.mp) { \
1061 return ret; \
1062 } \
1063 } \
1064 } while (0)
1065# define EVAS_MEMPOOL_ALLOC(x, siz) \
1066 eina_mempool_malloc(x.mp, sizeof(siz))
1067# define EVAS_MEMPOOL_PREP(x, p, siz) \
1068 do { \
1069 x.count++; \
1070 x.num_allocs++; \
1071 memset(p, 0, sizeof(siz)); \
1072 } while (0)
1073# define EVAS_MEMPOOL_FREE(x, p) \
1074 do { \
1075 eina_mempool_free(x.mp, p); \
1076 x.count--; \
1077 x.num_frees++; \
1078 if (x.count <= 0) { \
1079 eina_mempool_del(x.mp); \
1080 x.mp = NULL; \
1081 x.count = 0; \
1082 } \
1083 } while (0)
1084#else
1085# define EVAS_MEMPOOL(x)
1086# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret)
1087# define EVAS_MEMPOOL_PREP(x, p, siz)
1088# define EVAS_MEMPOOL_ALLOC(x, siz) \
1089 calloc(1, sizeof(siz))
1090# define EVAS_MEMPOOL_FREE(x, p) \
1091 free(p)
1092#endif
1093/********************/
1094/*****************************************/
1095/****************************************************************************/
1096
1097#define EVAS_API_OVERRIDE(func, api, prefix) \
1098 (api)->func = prefix##func
1099#define EVAS_API_RESET(func, api) \
1100 (api)->func = NULL
1101
1102#include "evas_inline.x"
1103
1104#ifdef __cplusplus
1105}
1106#endif
1107#endif