1 #ifndef EVAS_PRIVATE_H
2 #define EVAS_PRIVATE_H
3
4 #ifdef HAVE_CONFIG_H
5 # include <config.h>
6 #endif
7
8 #ifndef EFL_CANVAS_OBJECT_PROTECTED
9 # define EFL_CANVAS_OBJECT_PROTECTED
10 #endif
11
12 #include "Evas.h"
13 #include "Eet.h"
14
15 #include "../file/evas_module.h"
16 #include "../file/evas_path.h"
17
18
19 #ifdef EAPI
20 # undef EAPI
21 #endif
22
23 #ifdef _WIN32
24 # ifdef EFL_BUILD
25 # ifdef DLL_EXPORT
26 # define EAPI __declspec(dllexport)
27 # else
28 # define EAPI
29 # endif
30 # else
31 # define EAPI __declspec(dllimport)
32 # endif
33 #else
34 # ifdef __GNUC__
35 # if __GNUC__ >= 4
36 # define EAPI __attribute__ ((visibility("default")))
37 # else
38 # define EAPI
39 # endif
40 # else
41 # define EAPI
42 # endif
43 #endif
44
45 /* save typing */
46 #define ENFN obj->layer->evas->engine.func
47 #define ENC _evas_engine_context(obj->layer->evas)
48
49 #include "canvas/evas_canvas_eo.h"
50 #include "canvas/evas_text_eo.h"
51 #include "canvas/evas_textgrid_eo.h"
52 #include "canvas/evas_line_eo.h"
53 #include "canvas/evas_box_eo.h"
54 #include "canvas/evas_table_eo.h"
55 #include "canvas/evas_grid_eo.h"
56
57 #define RENDER_METHOD_INVALID 0x00000000
58
59 typedef struct _Evas_Layer Evas_Layer;
60 typedef struct _Evas_Size Evas_Size;
61 typedef struct _Evas_Aspect Evas_Aspect;
62 typedef struct _Evas_Border Evas_Border;
63 typedef struct _Evas_Bool_Pair Evas_Bool_Pair;
64 typedef struct _Evas_Double_Pair Evas_Double_Pair;
65 typedef struct _Evas_Size_Hints Evas_Size_Hints;
66 typedef struct _Evas_Data_Node Evas_Data_Node;
67 typedef struct _Evas_Func Evas_Func;
68 typedef struct _Evas_Image_Save_Func Evas_Image_Save_Func;
69 typedef struct _Evas_Vg_Load_Func Evas_Vg_Load_Func;
70 typedef struct _Evas_Vg_Save_Func Evas_Vg_Save_Func;
71 typedef struct _Evas_Object_Func Evas_Object_Func;
72 typedef struct _Evas_Intercept_Func Evas_Intercept_Func;
73 typedef struct _Evas_Key_Grab Evas_Key_Grab;
74 typedef struct _Evas_Format Evas_Format;
75 typedef struct _Evas_Map_Point Evas_Map_Point;
76 typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array;
77 typedef struct _Evas_Smart_Interfaces_Array Evas_Smart_Interfaces_Array;
78 typedef enum _Evas_Object_Intercept_Cb_Type Evas_Object_Intercept_Cb_Type;
79 typedef struct _Evas_Post_Callback Evas_Post_Callback;
80 typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point;
81 typedef struct _Evas_Object_Proxy_Data Evas_Object_Proxy_Data;
82 typedef struct _Evas_Object_Map_Data Evas_Object_Map_Data;
83 typedef struct _Evas_Object_Events_Data Evas_Object_Events_Data;
84 typedef struct _Evas_Proxy_Render_Data Evas_Proxy_Render_Data;
85 typedef struct _Evas_Object_Mask_Data Evas_Object_Mask_Data;
86 typedef struct _Evas_Object_Pointer_Data Evas_Object_Pointer_Data;
87
88 typedef struct _Evas_Smart_Data Evas_Smart_Data;
89 typedef struct _Efl_Object_Event_Grabber_Data Efl_Object_Event_Grabber_Data;
90
91
92 typedef struct _Evas_Object_Protected_State Evas_Object_Protected_State;
93 typedef struct _Evas_Object_Protected_Data Evas_Object_Protected_Data;
94
95 /* gfx filters typedef only */
96 typedef struct _Evas_Filter_Program Evas_Filter_Program;
97 typedef struct _Evas_Filter_Context Evas_Filter_Context;
98 typedef struct _Evas_Object_Filter_Data Evas_Object_Filter_Data;
99 typedef struct _Evas_Filter_Data_Binding Evas_Filter_Data_Binding;
100 typedef struct _Evas_Pointer_Data Evas_Pointer_Data;
101 typedef struct _Evas_Filter_Command Evas_Filter_Command;
102 typedef enum _Evas_Filter_Support Evas_Filter_Support;
103
104 typedef struct _Vg_File_Data Vg_File_Data;
105 typedef struct _Vg_File_Anim_Data Vg_File_Anim_Data;
106 typedef struct _Vg_File_Anim_Data_Marker Vg_File_Anim_Data_Marker;
107
108 /* General types - used for script type chceking */
109 #define OPAQUE_TYPE(type) struct __##type { int a; }; \
110 typedef struct __##type type
111
112 OPAQUE_TYPE(Evas_Font_Set); /* General type for RGBA_Font */
113 OPAQUE_TYPE(Evas_Font_Instance); /* General type for RGBA_Font_Int */
114 /* End of general types */
115
116 #define MAGIC_EVAS 0x70777770
117 #define MAGIC_OBJ 0x71737723
118 #define MAGIC_SMART 0x7c6977c5
119 #define MAGIC_OBJ_SHAPE 0x747297f7
120 #define MAGIC_EVAS_GL 0x77976718
121 #define MAGIC_MAP 0x7575177d
122 #define MAGIC_DEV 0x7d773738
123
124 #define EVAS_TYPE_CHECK(obj, ...) \
125 do { \
126 if (!efl_isa((obj), EVAS_CANVAS_CLASS)) \
127 { \
128 CRI("non-Evas passed to %s", __func__); \
129 return __VA_ARGS__; \
130 } \
131 } \
132 while (0)
133
134 #ifdef EINA_MAGIC_DEBUG
135
136
137 # define MAGIC_CHECK_FAILED(o, t, m) \
138 {evas_debug_error(); \
139 if (!o) evas_debug_input_null(); \
140 }
141 # define MAGIC_CHECK(o, t, m) \
142 {if (EINA_UNLIKELY(!o)) { \
143 MAGIC_CHECK_FAILED(o, t, m)
144 # define MAGIC_CHECK_END() }}
145 #else
146 # define MAGIC_CHECK_FAILED(o, t, m)
147 # define MAGIC_CHECK(o, t, m) { if (!o) {
148 # define MAGIC_CHECK_END() }}
149 #endif
150
151 // helper function for legacy EAPI implementations
152 #define EVAS_OBJ_GET_OR_RETURN(o, ...) ({ \
153 Evas_Object_Protected_Data *_obj = efl_isa(o, EFL_CANVAS_OBJECT_CLASS) ? \
154 efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS) : NULL; \
155 if (!_obj) { MAGIC_CHECK_FAILED(o,0,0) return __VA_ARGS__; } \
156 _obj; })
157
158 #define NEW_RECT(_r, _x, _y, _w, _h) (_r) = eina_rectangle_new(_x, _y, _w, _h);
159
160 #define MERR_NONE() _evas_alloc_error = EVAS_ALLOC_ERROR_NONE
161 #define MERR_FATAL() _evas_alloc_error = EVAS_ALLOC_ERROR_FATAL
162 #define MERR_BAD() _evas_alloc_error = EVAS_ALLOC_ERROR_RECOVERED
163
164 /* DEBUG mode: fail, but normally just ERR(). This also returns if NULL. */
165 #ifdef DEBUG
166 #define EVAS_OBJECT_LEGACY_API(_eo, ...) \
167 do { Evas_Object_Protected_Data *_o = efl_data_scope_get(_eo, EFL_CANVAS_OBJECT_CLASS); \
168 if (EINA_UNLIKELY(!_o)) return __VA_ARGS__; \
169 if (EINA_UNLIKELY(!_o->legacy)) { \
170 char buf[1024]; snprintf(buf, sizeof(buf), "Calling legacy API on EO object '%s' is not permitted!", efl_class_name_get(_o->object)); \
171 EINA_SAFETY_ERROR(buf); \
172 return __VA_ARGS__; \
173 } } while (0)
174 #else
175 #define EVAS_OBJECT_LEGACY_API(_eo, ...) \
176 do { Evas_Object_Protected_Data *_o = efl_data_scope_get(_eo, EFL_CANVAS_OBJECT_CLASS); \
177 if (EINA_UNLIKELY(!_o)) return __VA_ARGS__; \
178 if (EINA_UNLIKELY(!_o->legacy.ctor)) { \
179 char buf[1024]; snprintf(buf, sizeof(buf), "Calling legacy API on EO object '%s' is not permitted!", efl_class_name_get(_o->object)); \
180 EINA_SAFETY_ERROR(buf); \
181 } } while (0)
182 #endif
183
184 #define EVAS_LEGACY_API(_obj, _e, ...) \
185 Evas_Public_Data *_e = efl_data_scope_safe_get((_obj), EVAS_CANVAS_CLASS); \
186 if (!_e) return __VA_ARGS__
187
188 #define EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(cur, prev) \
189 if (cur->key) \
190 { \
191 eina_stringshare_del(cur->key); \
192 if (prev->key == cur->key) \
193 prev->key = NULL; \
194 cur->key = NULL; \
195 } \
196 if (prev->key) \
197 { \
198 eina_stringshare_del(prev->key); \
199 prev->key = NULL; \
200 }
201
202 struct _Evas_Coord_Touch_Point
203 {
204 double x, y;
205 int id; // id in order to distinguish each point
206 Evas_Touch_Point_State state;
207 };
208
209 struct _Evas_Key_Grab
210 {
211 char *keyname;
212 Evas_Modifier_Mask modifiers;
213 Evas_Modifier_Mask not_modifiers;
214 Evas_Object *object;
215 Eina_Bool exclusive : 1;
216 Eina_Bool just_added : 1;
217 Eina_Bool delete_me : 1;
218 Eina_Bool is_active : 1;
219 };
220
221 struct _Evas_Intercept_Func
222 {
223 struct {
224 Evas_Object_Intercept_Show_Cb func;
225 void *data;
226 Eina_Bool intercepted;
227 } show;
228 struct {
229 Evas_Object_Intercept_Hide_Cb func;
230 void *data;
231 Eina_Bool intercepted;
232 } hide;
233 struct {
234 Evas_Object_Intercept_Move_Cb func;
235 void *data;
236 Eina_Bool intercepted;
237 } move;
238 struct {
239 Evas_Object_Intercept_Resize_Cb func;
240 void *data;
241 Eina_Bool intercepted;
242 } resize;
243 struct {
244 Evas_Object_Intercept_Raise_Cb func;
245 void *data;
246 Eina_Bool intercepted;
247 } raise;
248 struct {
249 Evas_Object_Intercept_Lower_Cb func;
250 void *data;
251 Eina_Bool intercepted;
252 } lower;
253 struct {
254 Evas_Object_Intercept_Stack_Above_Cb func;
255 void *data;
256 Eina_Bool intercepted;
257 } stack_above;
258 struct {
259 Evas_Object_Intercept_Stack_Below_Cb func;
260 void *data;
261 Eina_Bool intercepted;
262 } stack_below;
263 struct {
264 Evas_Object_Intercept_Layer_Set_Cb func;
265 void *data;
266 Eina_Bool intercepted;
267 } layer_set;
268 struct {
269 Evas_Object_Intercept_Color_Set_Cb func;
270 void *data;
271 Eina_Bool intercepted;
272 } color_set;
273 struct {
274 Evas_Object_Intercept_Clip_Set_Cb func;
275 void *data;
276 Eina_Bool intercepted;
277 } clip_set;
278 struct {
279 Evas_Object_Intercept_Clip_Unset_Cb func;
280 void *data;
281 Eina_Bool intercepted;
282 } clip_unset;
283 struct {
284 Evas_Object_Intercept_Focus_Set_Cb func;
285 void *data;
286 Eina_Bool intercepted;
287 } focus_set;
288 struct {
289 Evas_Object_Intercept_Device_Focus_Set_Cb func;
290 void *data;
291 Eina_Bool intercepted;
292 } device_focus_set;
293 };
294
295 struct _Evas_Smart_Cb_Description_Array
296 {
297 unsigned int size;
298 const Evas_Smart_Cb_Description **array;
299 };
300
301 struct _Evas_Smart_Interfaces_Array
302 {
303 unsigned int size;
304 const Evas_Smart_Interface **array;
305 };
306
307 struct _Evas_Smart
308 {
309 DATA32 magic;
310
311 int usage;
312
313 const Evas_Smart_Class *smart_class;
314
315 Evas_Smart_Cb_Description_Array callbacks;
316 Evas_Smart_Interfaces_Array interfaces;
317
318 unsigned char delete_me : 1;
319 unsigned char class_allocated : 1;
320
321 };
322
323 struct _Evas_Modifier
324 {
325 struct {
326 int count;
327 char **list;
328 } mod;
329 Eina_Hash *masks; /* we have a max of 64 modifiers per seat */
330 Evas_Public_Data *e;
331 };
332
333 struct _Evas_Lock
334 {
335 struct {
336 int count;
337 char **list;
338 } lock;
339 Eina_Hash *masks; /* we have a max of 64 locks per seat */
340 Evas_Public_Data *e;
341 };
342
343 struct _Evas_Post_Callback
344 {
345 Evas_Object_Event_Post_Cb func;
346 const void *data;
347 int event_id;
348 Evas_Callback_Type type;
349 unsigned char delete_me : 1;
350 };
351
352 // somehow this has bugs ... and i am not sure why...
353 //#define INLINE_ACTIVE_GEOM 1
354
355 typedef struct
356 {
357 #ifdef INLINE_ACTIVE_GEOM
358 Eina_Rectangle rect;
359 #endif
360 Evas_Object_Protected_Data *obj;
361 } Evas_Active_Entry;
362
363 typedef struct Evas_Pointer_Seat
364 {
365 EINA_INLIST;
366 Evas_Device *seat;
367 Eina_Inlist *pointers;
368 struct {
369 Eina_List *in;
370 } object;
371 Evas_Coord x, y;
372 Evas_Point prev;
373 int mouse_grabbed;
374 int downs;
375 int nogrep;
376 unsigned char inside : 1;
377 } Evas_Pointer_Seat;
378
379 struct _Evas_Pointer_Data
380 {
381 EINA_INLIST;
382 Evas_Device *pointer;
383 DATA32 button;
384 Evas_Pointer_Seat *seat;
385 };
386
387 typedef struct _Evas_Post_Render_Job
388 {
389 EINA_INLIST;
390 void (*func)(void *);
391 void *data;
392 } Evas_Post_Render_Job;
393
394 struct _Evas_Public_Data
395 {
396 EINA_INLIST;
397
398 DATA32 magic;
399 Evas *evas;
400
401 Eina_Inlist *seats;
402
403 struct {
404 Evas_Coord x, y, w, h;
405 unsigned char changed : 1;
406 } viewport;
407
408 struct {
409 int w, h;
410 DATA32 render_method;
411 Eina_Bool legacy : 1;
412 } output;
413
414 struct
415 {
416 Evas_Coord x, y, w, h;
417 Eina_Bool changed : 1;
418 } framespace;
419
420 Eina_List *damages;
421 Eina_List *obscures;
422
423 Evas_Layer *layers;
424
425 Eina_Hash *name_hash;
426
427 // locking so we can implement async rendering threads
428 Eina_Lock lock_objects;
429
430 int output_validity;
431
432 Evas_Event_Flags default_event_flags;
433
434 struct {
435 Evas_Module *module;
436 Evas_Func *func;
437 } engine;
438
439 struct {
440 Eina_Spinlock lock;
441 } render;
442
443 Eina_Array delete_objects;
444 Eina_Inarray active_objects;
445 Eina_Array restack_objects;
446 Eina_Array render_objects;
447 Eina_Array pending_objects;
448 Eina_Array obscuring_objects;
449 Eina_Array temporary_objects;
450 Eina_Array snapshot_objects;
451 Eina_Array clip_changes;
452 Eina_Array scie_unref_queue;
453 Eina_Array image_unref_queue;
454 Eina_Array glyph_unref_queue;
455 Eina_Array texts_unref_queue;
456 Eina_Array map_clip_objects;
457 Eina_List *finalize_objects;
458 Eina_Array render_post_change_objects;
459
460 struct {
461 Evas_Post_Render_Job *jobs;
462 Eina_Spinlock lock;
463 } post_render;
464
465 Eina_Clist calc_list;
466 Eina_Clist calc_done;
467 Eina_List *video_objects;
468
469 Eina_List *post_events; // free me on evas_free
470
471 Eina_Inlist *callbacks;
472 Eina_Inlist *deferred_callbacks;
473
474 int delete_grabs;
475 int walking_grabs;
476 Eina_List *grabs;
477
478 Eina_List *font_path;
479
480 Eina_Inarray *update_del_redirect_array;
481
482 int in_smart_calc;
483 int smart_calc_count;
484
485 Eo *gesture_manager;
486 void *gmd;
487 Eo *pending_default_focus_obj;
488 Eina_Hash *focused_objects; //Key - seat; value - the focused object
489 Eina_List *focused_by; //Which seat has the canvas focus
490 void *attach_data;
491 Evas_Modifier modifiers;
492 Evas_Lock locks;
493 unsigned int last_timestamp;
494 int last_mouse_down_counter;
495 int last_mouse_up_counter;
496 int nochange;
497 Evas_Font_Hinting_Flags hinting;
498 Evas_Callback_Type current_event;
499 int running_post_events;
500
501 Eina_List *touch_points;
502 Eina_List *devices;
503 Eina_Array *cur_device;
504
505 void *backend;
506 Ector_Surface *ector;
507 Eina_List *outputs;
508
509 Evas_Device *default_seat;
510 Evas_Device *default_mouse;
511 Evas_Device *default_keyboard;
512
513 Eina_List *rendering;
514
515 unsigned char changed : 1;
516 unsigned char delete_me : 1;
517 unsigned char invalidate : 1;
518 unsigned char cleanup : 1;
519 Eina_Bool is_frozen : 1;
520 Eina_Bool inside_post_render : 1;
521 Eina_Bool devices_modified : 1;
522 Eina_Bool cb_render_pre : 1;
523
524 Eina_Bool cb_render_post : 1;
525 Eina_Bool cb_render_flush_pre : 1;
526 Eina_Bool cb_render_flush_post : 1;
527 };
528
529 struct _Evas_Layer
530 {
531 EINA_INLIST;
532
533 short layer;
534 Evas_Object_Protected_Data *objects;
535
536 Evas_Public_Data *evas;
537
538 void *engine_data;
539 Eina_List *removes;
540 int usage;
541 int walking_objects;
542 unsigned char delete_me : 1;
543 };
544
545 struct _Evas_Size
546 {
547 Evas_Coord w, h;
548 };
549
550 struct _Evas_Aspect
551 {
552 Evas_Aspect_Control mode;
553 Eina_Size2D size;
554 };
555
556 struct _Evas_Border
557 {
558 Evas_Coord l, r, t, b;
559 };
560
561 struct _Evas_Bool_Pair
562 {
563 Eina_Bool x, y;
564 };
565
566 struct _Evas_Double_Pair
567 {
568 double x, y;
569 };
570
571 struct _Evas_Size_Hints
572 {
573 Evas_Size request;
574 Eina_Size2D min, user_min, max, user_max;
575 Evas_Aspect aspect;
576 Evas_Double_Pair align, weight;
577 Evas_Border padding;
578 Evas_Bool_Pair fill;
579 Evas_Display_Mode dispmode;
580 };
581
582 struct _Evas_Map_Point
583 {
584 double x, y, z, px, py;
585 double u, v;
586 unsigned char r, g, b, a;
587 };
588
589 struct _Evas_Map
590 {
591 DATA32 magic;
592 int count; // num of points
593 Eina_Rectangle normal_geometry; // bounding box of map geom actually
594 // void *surface; // surface holding map if needed
595 // int surface_w, surface_h; // current surface w & h alloc
596 double mx, my; // mouse x, y after conversion to map space
597 struct {
598 Evas_Coord px, py, z0, foc;
599 } persp;
600 Eina_Bool alpha : 1;
601 Eina_Bool smooth : 1;
602 struct {
603 Eina_Bool enabled : 1;
604 Evas_Coord diff_x, diff_y;
605 } move_sync;
606 Evas_Map_Point points[]; // actual points
607 };
608
609 struct _Evas_Object_Proxy_Data
610 {
611 Eina_List *proxies;
612 void *surface;
613 int w,h;
614 Eina_List *src_event_in;
615 Eina_Bool redraw : 1;
616 Eina_Bool is_proxy : 1;
617 Eina_Bool src_invisible : 1;
618 Eina_Bool src_events: 1;
619 };
620
621 struct _Evas_Object_Map_Data
622 {
623 // WARNING - you cannot change the below cur/prev layout, content or size
624 // unless you also update evas_object_main.c _map_same() func
625 struct {
626 Evas_Map *map;
627 Evas_Object *map_parent;
628
629 Eina_Bool usemap : 1;
630 Eina_Bool valid_map : 1;
631 } cur, prev;
632 void *surface; // surface holding map if needed
633 int surface_w, surface_h; // current surface w & h alloc
634
635 Evas_Map *cache_map;
636 RGBA_Map *spans;
637 };
638
639 // Mask clipper information
640 struct _Evas_Object_Mask_Data
641 {
642 void *surface;
643 int w, h;
644 Eina_Bool is_mask : 1;
645 Eina_Bool redraw : 1;
646 Eina_Bool is_alpha : 1;
647 Eina_Bool is_scaled : 1;
648 };
649
650 struct _Evas_Object_Events_Data
651 {
652 /*
653 The list below contain the seats (Efl.Input.Devices) which this
654 object allows events to be reported (Mouse, Keybord and focus events).
655 */
656 Eina_List *events_whitelist; /* Efl_Input_Device */
657
658 Eina_List *focused_by_seats; /* Efl_Input_Device */
659 Eina_Inlist *pointer_grabs; /* Evas_Object_Pointer_Data */
660
661 Evas_Object *parent; /* An Efl.Canvas.Object.Event.Grabber */
662 };
663
664 struct _Evas_Object_Protected_State
665 {
666 Evas_Object_Protected_Data *clipper;
667
668 Eina_Rectangle geometry;
669 struct {
670 struct {
671 Evas_Coord x, y, w, h;
672 unsigned char r, g, b, a;
673 Eina_Bool visible : 1;
674 Eina_Bool dirty : 1;
675 } clip;
676 } cache;
677 struct {
678 unsigned char r, g, b, a;
679 } color;
680
681 double scale;
682
683 short layer;
684
685 Evas_Render_Op render_op : 4;
686
687 Eina_Bool visible : 1;
688 Eina_Bool have_clipees : 1;
689 Eina_Bool anti_alias : 1;
690 Eina_Bool valid_bounding_box : 1;
691 Eina_Bool snapshot : 1;
692 Eina_Bool has_fixed_size : 1;
693 };
694
695 struct _Evas_Object_Pointer_Data {
696 EINA_INLIST;
697
698 Evas_Object_Protected_Data *obj;
699 Evas_Pointer_Data *evas_pdata;
700 Evas_Object_Pointer_Mode pointer_mode;
701 int mouse_grabbed;
702 Eina_Bool mouse_in;
703 };
704
705 struct _Evas_Object_Protected_Data
706 {
707 EINA_INLIST;
708
709 const char *type;
710 Evas_Layer *layer;
711
712 const Evas_Object_Protected_State *cur;
713 const Evas_Object_Protected_State *prev;
714
715 char *name;
716
717 Evas_Intercept_Func *interceptors;
718 Eina_List *grabs;
719
720 Eina_Inlist *callbacks;
721
722 struct {
723 Eina_List *clipees;
724 Eina_List *cache_clipees_answer;
725 Eina_List *changes;
726 Evas_Object_Protected_Data *mask, *prev_mask;
727 } clip;
728
729 const Evas_Object_Func *func;
730 void *private_data;
731
732 struct {
733 Evas_Smart *smart;
734 Evas_Object *parent;
735 Evas_Smart_Data *parent_data;
736 Evas_Object_Protected_Data *parent_object_data;
737 } smart;
738
739 // Eina_Cow pointer be careful when writing to it
740 const Evas_Object_Proxy_Data *proxy;
741 const Evas_Object_Map_Data *map;
742 const Evas_Object_Mask_Data *mask;
743 const Evas_Object_Events_Data *events;
744
745 // Pointer to the Evas_Object itself
746 Evas_Object *object;
747
748 Evas_Object *anim_player;
749
750 Evas_Size_Hints *size_hints;
751
752 int last_mouse_down_counter;
753 int last_mouse_up_counter;
754 int last_event_id;
755 Evas_Callback_Type last_event_type;
756
757 struct {
758 int in_move, in_resize;
759 } doing;
760
761 unsigned int ref;
762
763 unsigned int animator_ref;
764 uint64_t callback_mask;
765
766 unsigned char no_change_render;
767 unsigned char delete_me;
768
769 Eina_Bool render_pre : 1;
770 Eina_Bool rect_del : 1;
771
772 Eina_Bool is_active : 1;
773 Eina_Bool changed : 1;
774 Eina_Bool in_pending_objects : 1;
775 Eina_Bool restack : 1;
776 Eina_Bool is_smart : 1;
777 Eina_Bool is_event_parent : 1;
778 Eina_Bool pass_events : 1;
779 Eina_Bool store : 1;
780
781 Eina_Bool changed_move : 1;
782 Eina_Bool changed_color : 1;
783 Eina_Bool changed_map : 1;
784 Eina_Bool changed_pchange : 1;
785 Eina_Bool changed_src_visible : 1;
786 Eina_Bool freeze_events : 1;
787 Eina_Bool repeat_events : 1;
788 Eina_Bool no_propagate : 1;
789
790 Eina_Bool del_ref : 1;
791 Eina_Bool need_surface_clear : 1;
792 Eina_Bool pre_render_done : 1;
793 Eina_Bool precise_is_inside : 1;
794 Eina_Bool is_static_clip : 1;
795
796 Eina_Bool in_layer : 1;
797 Eina_Bool is_frame : 1;
798 Eina_Bool is_frame_top : 1; // this is the frame edje
799 Eina_Bool child_has_map : 1;
800 Eina_Bool efl_del_called : 1;
801 Eina_Bool no_render : 1; // since 1.15
802
803 Eina_Bool snapshot_needs_redraw : 1;
804 Eina_Bool snapshot_no_obscure : 1;
805 Eina_Bool is_image_object : 1;
806 Eina_Bool gfx_mapping_has : 1;
807 Eina_Bool gfx_mapping_update : 1;
808
809 struct {
810 Eina_Bool ctor : 1; // used legacy constructor
811 Eina_Bool visible_set : 1; // visibility manually set
812 Eina_Bool weight_set : 1; // weight manually set
813 Eina_Bool finalized : 1; // object fully constructed
814 } legacy;
815
816 struct {
817 Eina_Bool pass_events : 1;
818 Eina_Bool pass_events_valid : 1;
819 Eina_Bool freeze_events : 1;
820 Eina_Bool freeze_events_valid : 1;
821 Eina_Bool src_invisible : 1;
822 Eina_Bool src_invisible_valid : 1;
823 } parent_cache;
824
825 Eina_Bool events_filter_enabled : 1;
826 Eina_Bool is_pointer_inside_legacy : 1;
827 Eina_Bool is_filter_object : 1;
828 };
829
830 struct _Evas_Data_Node
831 {
832 char *key;
833 void *data;
834 };
835
836 struct _Efl_Canvas_Output
837 {
838 Eo *canvas;
839
840 Evas_Engine_Info *info;
841 void *output;
842
843 Eina_List *planes;
844 Eina_List *updates;
845
846 Eina_Rectangle geometry;
847
848 int info_magic;
849
850 unsigned short lock;
851
852 Eina_Bool changed : 1;
853 };
854
855 struct _Evas_Object_Func
856 {
857 void (*free) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
858 void (*render) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
859 void *engine, void *output, void *context, void *surface,
860 int x, int y, Eina_Bool do_async);
861 void (*render_pre) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
862 void (*render_post) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
863
864 void *(*engine_data_get) (Evas_Object *obj);
865
866 int (*is_visible) (Evas_Object *obj);
867 int (*was_visible) (Evas_Object *obj);
868
869 int (*is_opaque) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
870 int (*was_opaque) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
871
872 int (*is_inside) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
873 Evas_Coord x, Evas_Coord y);
874 int (*was_inside) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
875 Evas_Coord x, Evas_Coord y);
876
877 void (*coords_recalc) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
878
879 int (*has_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
880 int (*get_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
881 Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
882
883 int (*can_map) (Evas_Object *obj);
884 // new - add to prepare list during render if object needs some pre-render
885 // preparation - may include rendering content to buffer or loading data
886 // from disk or uploading to texture etc.
887 void (*render_prepare) (Evas_Object *obj, Evas_Object_Protected_Data *pd, Eina_Bool do_async);
888 int (*is_on_plane) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
889 int (*plane_changed) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
890 };
891
892 struct _Evas_Func
893 {
894 void *(*engine_new) (void);
895 void (*engine_free) (void *engine);
896
897 void (*output_info_setup) (void *info);
898 void *(*output_setup) (void *engine, void *info, unsigned int w, unsigned int h);
899 int (*output_update) (void *engine, void *data, void *info, unsigned int w, unsigned int h);
900 void (*output_free) (void *engine, void *data);
901 void (*output_resize) (void *engine, void *data, int w, int h);
902
903 /* The redraws are automatically propagated on all output */
904 void (*output_redraws_rect_add) (void *engine, int x, int y, int w, int h);
905 void (*output_redraws_rect_del) (void *engine, int x, int y, int w, int h);
906
907 void (*output_redraws_clear) (void *engine, void *data);
908 void *(*output_redraws_next_update_get) (void *engine, void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch);
909 void (*output_redraws_next_update_push) (void *engine, void *data, void *surface, int x, int y, int w, int h, Evas_Render_Mode render_mode);
910 void (*output_flush) (void *engine, void *data, Evas_Render_Mode render_mode);
911 void (*output_idle_flush) (void *engine, void *data);
912 void (*output_dump) (void *engine, void *data);
913
914 void *(*context_new) (void *engine);
915 void *(*context_dup) (void *engine, void *context);
916 Eina_Bool (*canvas_alpha_get) (void *engine);
917 void (*context_free) (void *engine, void *context);
918 void (*context_clip_set) (void *engine, void *context, int x, int y, int w, int h);
919 void (*context_clip_image_set) (void *engine, void *context, void *surface, int x, int y, Evas_Public_Data *evas, Eina_Bool do_async);
920 void (*context_clip_image_unset) (void *engine, void *context);
921 void (*context_clip_image_get) (void *engine, void *context, void **surface, int *x, int *y); /* incref surface if not NULL */
922 void (*context_clip_clip) (void *engine, void *context, int x, int y, int w, int h);
923 void (*context_clip_unset) (void *engine, void *context);
924 int (*context_clip_get) (void *engine, void *context, int *x, int *y, int *w, int *h);
925 void (*context_color_set) (void *engine, void *context, int r, int g, int b, int a);
926 int (*context_color_get) (void *engine, void *context, int *r, int *g, int *b, int *a);
927 void (*context_multiplier_set) (void *engine, void *context, int r, int g, int b, int a);
928 void (*context_multiplier_unset) (void *engine, void *context);
929 int (*context_multiplier_get) (void *engine, void *context, int *r, int *g, int *b, int *a);
930 void (*context_cutout_add) (void *engine, void *context, int x, int y, int w, int h);
931 void (*context_cutout_clear) (void *engine, void *context);
932 void (*context_cutout_target) (void *engine, void *context, int x, int y, int w, int h);
933 void (*context_anti_alias_set) (void *engine, void *context, unsigned char aa);
934 unsigned char (*context_anti_alias_get) (void *engine, void *context);
935 void (*context_color_interpolation_set) (void *engine, void *context, int color_space);
936 int (*context_color_interpolation_get) (void *engine, void *context);
937 void (*context_render_op_set) (void *engine, void *context, int render_op);
938 int (*context_render_op_get) (void *engine, void *context);
939
940 void (*rectangle_draw) (void *engine, void *data, void *context, void *surface, int x, int y, int w, int h, Eina_Bool do_async);
941
942 void (*line_draw) (void *engine, void *data, void *context, void *surface, int x1, int y1, int x2, int y2, Eina_Bool do_async);
943
944 void *(*polygon_point_add) (void *engine, void *polygon, int x, int y);
945 void *(*polygon_points_clear) (void *engine, void *polygon);
946 void (*polygon_draw) (void *engine, void *data, void *context, void *surface, void *polygon, int x, int y, Eina_Bool do_async);
947
948 void *(*image_load) (void *engine, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
949 void *(*image_mmap) (void *engine, Eina_File *f, const char *key, int *error, Evas_Image_Load_Opts *lo);
950 void *(*image_new_from_data) (void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace);
951 void *(*image_new_from_copied_data) (void *engine, int w, int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace);
952 void (*image_free) (void *engine, void *image);
953 void *(*image_ref) (void *engine, void *image);
954 void (*image_size_get) (void *engine, void *image, int *w, int *h);
955 void *(*image_size_set) (void *engine, void *image, int w, int h);
956 void (*image_stride_get) (void *engine, void *image, int *stride);
957 void *(*image_dirty_region) (void *engine, void *image, int x, int y, int w, int h);
958 void *(*image_data_get) (void *engine, void *image, int to_write, DATA32 **image_data, int *err, Eina_Bool *tofree);
959 void *(*image_data_put) (void *engine, void *image, DATA32 *image_data);
960 Eina_Bool (*image_data_direct_get) (void *engine, void *image, int plane, Eina_Slice *slice, Evas_Colorspace *cspace, Eina_Bool load, Eina_Bool *tofree);
961 void (*image_data_preload_request) (void *engine, void *image, const Eo *target);
962 void (*image_data_preload_cancel) (void *engine, void *image, const Eo *target, Eina_Bool force);
963 void *(*image_alpha_set) (void *engine, void *image, int has_alpha);
964 int (*image_alpha_get) (void *engine, void *image);
965 void *(*image_orient_set) (void *engine, void *image, Evas_Image_Orient orient);
966 Evas_Image_Orient (*image_orient_get) (void *engine, void *image);
967 Eina_Bool (*image_draw) (void *engine, 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, Eina_Bool do_async);
968 void (*image_colorspace_set) (void *engine, void *image, Evas_Colorspace cspace);
969 Evas_Colorspace (*image_colorspace_get) (void *engine, void *image);
970 Evas_Colorspace (*image_file_colorspace_get)(void *engine, void *image);
971 Eina_Bool (*image_can_region_get) (void *engine, void *image);
972
973 /* image data map/unmap: direct or indirect access to pixels data */
974 Eina_Bool (*image_data_map) (void *engine, void **image, Eina_Rw_Slice *slice, int *stride, int x, int y, int w, int h, Evas_Colorspace cspace, Efl_Gfx_Buffer_Access_Mode mode, int plane);
975 Eina_Bool (*image_data_unmap) (void *engine, void *image, const Eina_Rw_Slice *slice);
976 int (*image_data_maps_get) (void *engine, const void *image, const Eina_Rw_Slice **slices);
977 Eina_Bool (*image_content_region_get) (void *engine, void *image, Eina_Rectangle *content);
978 Eina_Bool (*image_stretch_region_get) (void *engine, void *image, uint8_t **horizontal, uint8_t **vertical);
979
980 /* new api for direct data set (not put) */
981 void *(*image_data_slice_add) (void *engine, void *image, const Eina_Slice *slice, Eina_Bool copy, int w, int h, int stride, Evas_Colorspace space, int plane, Eina_Bool alpha);
982
983 void (*image_prepare) (void *engine, void *image);
984
985 void *(*image_surface_noscale_new) (void *engine, int w, int h, int alpha);
986
987 int (*image_native_init) (void *engine, Evas_Native_Surface_Type type);
988 void (*image_native_shutdown) (void *engine, Evas_Native_Surface_Type type);
989 void *(*image_native_set) (void *engine, void *image, void *native);
990 void *(*image_native_get) (void *engine, void *image);
991
992 void (*image_cache_flush) (void *engine);
993 void (*image_cache_set) (void *engine, int bytes);
994 int (*image_cache_get) (void *engine);
995
996 void *(*image_plane_assign) (void *data, void *image, int x, int y);
997 void (*image_plane_release) (void *data, void *image, void *plane);
998
999 Evas_Font_Set *(*font_load) (void *engine, const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
1000 Evas_Font_Set *(*font_memory_load) (void *engine, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
1001 Evas_Font_Set *(*font_add) (void *engine, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
1002 Evas_Font_Set *(*font_memory_add) (void *engine, Evas_Font_Set *font, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
1003 void (*font_free) (void *engine, Evas_Font_Set *font);
1004 int (*font_ascent_get) (void *engine, Evas_Font_Set *font);
1005 int (*font_descent_get) (void *engine, Evas_Font_Set *font);
1006 int (*font_max_ascent_get) (void *engine, Evas_Font_Set *font);
1007 int (*font_max_descent_get) (void *engine, Evas_Font_Set *font);
1008 void (*font_string_size_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int *w, int *h);
1009 int (*font_inset_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *text_props);
1010 int (*font_h_advance_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
1011 int (*font_v_advance_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
1012 int (*font_char_coords_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
1013 int (*font_char_at_coords_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
1014 Eina_Bool (*font_draw) (void *engine, void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, Evas_Text_Props *intl_props, Eina_Bool do_async);
1015 void (*font_cache_flush) (void *engine);
1016 void (*font_cache_set) (void *engine, int bytes);
1017 int (*font_cache_get) (void *engine);
1018
1019 /* Engine functions will over time expand from here */
1020
1021 void (*font_hinting_set) (void *engine, Evas_Font_Set *font, int hinting);
1022 int (*font_hinting_can_hint) (void *engine, int hinting);
1023
1024 void (*image_scale_hint_set) (void *engine, void *image, int hint);
1025 int (*image_scale_hint_get) (void *engine, void *image);
1026 int (*font_last_up_to_pos) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y, int width_offset);
1027
1028 Eina_Bool (*image_map_draw) (void *engine, void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level, Eina_Bool do_async);
1029 void *(*image_map_surface_new) (void *engine, int w, int h, int alpha);
1030 void (*image_map_clean) (void *engine, RGBA_Map *m);
1031 void *(*image_scaled_update) (void *engine, void *scaled, void *image, int dst_w, int dst_h, Eina_Bool smooth, Evas_Colorspace cspace);
1032
1033 void (*image_content_hint_set) (void *engine, void *surface, int hint);
1034 int (*font_pen_coords_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
1035 Eina_Bool (*font_text_props_info_create) (void *engine, 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, Evas_Text_Props_Mode mode, const char *lang);
1036 int (*font_right_inset_get) (void *engine, Evas_Font_Set *font, const Evas_Text_Props *text_props);
1037
1038 /* EFL-GL Glue Layer */
1039 Eina_Bool (*gl_supports_evas_gl) (void *engine);
1040 void *(*gl_output_set) (void *engine, void *output);
1041 void *(*gl_surface_create) (void *engine, void *config, int w, int h);
1042 void *(*gl_pbuffer_surface_create) (void *engine, void *config, int w, int h, int const *attrib_list);
1043 int (*gl_surface_destroy) (void *engine, void *surface);
1044 void *(*gl_context_create) (void *engine, void *share_context, int version, void *(*native_context_get)(void *ctx), void *(*engine_data_get)(void *evasgl));
1045 int (*gl_context_destroy) (void *engine, void *context);
1046 int (*gl_make_current) (void *engine, void *surface, void *context);
1047 const char *(*gl_string_query) (void *engine, int name);
1048 void *(*gl_proc_address_get) (void *engine, const char *name);
1049 int (*gl_native_surface_get) (void *engine, void *surface, void *native_surface);
1050 void *(*gl_api_get) (void *engine, int version);
1051 void (*gl_direct_override_get) (void *engine, Eina_Bool *override, Eina_Bool *force_off);
1052 void (*gl_get_pixels_set) (void *engine, void *get_pixels, void *get_pixels_data, void *obj);
1053 Eina_Bool (*gl_surface_lock) (void *engine, void *surface);
1054 Eina_Bool (*gl_surface_read_pixels) (void *engine, void *surface, int x, int y, int w, int h, Evas_Colorspace cspace, void *pixels);
1055 Eina_Bool (*gl_surface_unlock) (void *engine, void *surface);
1056 int (*gl_error_get) (void *engine);
1057 void *(*gl_current_context_get) (void *engine);
1058 void *(*gl_current_surface_get) (void *engine);
1059 int (*gl_rotation_angle_get) (void *engine);
1060 Eina_Bool (*gl_surface_query) (void *engine, void *surface, int attr, void *value);
1061 Eina_Bool (*gl_surface_direct_renderable_get) (void *engine, void *output, Evas_Native_Surface *ns, Eina_Bool *override, void *surface);
1062 void (*gl_image_direct_set) (void *engine, void *image, Eina_Bool direct);
1063 int (*gl_image_direct_get) (void *engine, void *image);
1064 void (*gl_get_pixels_pre) (void *engine, void *output);
1065 void (*gl_get_pixels_post) (void *engine, void *output);
1066
1067 int (*image_load_error_get) (void *engine, void *image);
1068 int (*font_run_end_get) (void *engine, 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);
1069
1070 /* animated feature */
1071 Eina_Bool (*image_animated_get) (void *engine, void *image);
1072 int (*image_animated_frame_count_get) (void *engine, void *image);
1073 Evas_Image_Animated_Loop_Hint (*image_animated_loop_type_get) (void *engine, void *image);
1074 int (*image_animated_loop_count_get) (void *engine, void *image);
1075 double (*image_animated_frame_duration_get) (void *engine, void *image, int start_frame, int frame_num);
1076 Eina_Bool (*image_animated_frame_set) (void *engine, void *image, int frame_index);
1077 int (*image_animated_frame_get) (void *engine, void *image);
1078
1079 /* max size query */
1080 void (*image_max_size_get) (void *engine, int *maxw, int *maxh);
1081
1082 /* multiple font draws */
1083 Eina_Bool (*multi_font_draw) (void *engine, void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, Evas_Font_Array *texts, Eina_Bool do_async);
1084
1085 Eina_Bool (*pixel_alpha_get) (void *image, int x, int y, DATA8 *alpha, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
1086
1087 void (*context_flush) (void *engine);
1088
1089 Ector_Surface *(*ector_create) (void *engine);
1090 void (*ector_destroy) (void *engine, Ector_Surface *surface);
1091 Ector_Buffer *(*ector_buffer_wrap) (void *engine, Evas *e, void *engine_image);
1092 Ector_Buffer *(*ector_buffer_new) (void *engine, Evas *e, int width, int height, Efl_Gfx_Colorspace cspace, Ector_Buffer_Flag flags);
1093 Eina_Bool (*ector_begin) (void *engine, void *output, void *context, Ector_Surface *ector, int x, int y, Eina_Bool do_async);
1094 void (*ector_renderer_draw) (void *engine, void *output, void *context, Ector_Renderer *r, Eina_Array *clips, Eina_Bool do_async);
1095 void (*ector_end) (void *engine, void *output, void *context, Ector_Surface *ector, Eina_Bool do_async);
1096
1097 void *(*ector_surface_create) (void *engine, int w, int h, int *error);
1098 void (*ector_surface_destroy) (void *engine, void *surface);
1099 void (*ector_surface_cache_set) (void *engine, void *key, void *surface);
1100 void *(*ector_surface_cache_get) (void *engine, void *key);
1101 void (*ector_surface_cache_drop) (void *engine, void *key);
1102
1103 Evas_Filter_Support (*gfx_filter_supports) (void *engine, Evas_Filter_Command *cmd);
1104 Eina_Bool (*gfx_filter_process) (void *engine, Evas_Filter_Command *cmd);
1105
1106 void (*font_glyphs_gc_collect) (void *engine, float ratio, int *texture_size, int *atlas_size, Eina_Bool only_when_requested);
1107
1108 unsigned int info_size;
1109 };
1110
1111 struct _Evas_Image_Save_Func
1112 {
1113 int (*image_save) (RGBA_Image *im, const char *file, const char *key, int quality, int compress, const char *encoding);
1114 };
1115
1116 struct _Vg_File_Anim_Data_Marker
1117 {
1118 Eina_Stringshare *name;
1119 int startframe;
1120 int endframe;
1121 };
1122
1123 struct _Vg_File_Anim_Data
1124 {
1125 unsigned int frame_num; //current frame number
1126 unsigned int frame_cnt; //total frame count
1127 float duration; //animation duration
1128 Eina_Inarray *markers; //array of Vg_File_Anim_Data_Marker
1129 };
1130
1131 struct _Vg_File_Data
1132 {
1133 Efl_VG *root;
1134 Evas_Vg_Load_Func *loader;
1135 Eina_Rectangle view_box;
1136 Vg_File_Anim_Data *anim_data; //only when animation supported.
1137 int ref;
1138 int w, h; //default size
1139 Eina_List *vp_list; //Value providers.
1140
1141 void *loader_data; //loader specific local data
1142
1143 Eina_Bool static_viewbox: 1;
1144 Eina_Bool preserve_aspect : 1; //Used in SVG
1145
1146 Eina_Bool shareable: 1;
1147 };
1148
1149 struct _Evas_Vg_Load_Func
1150 {
1151 Vg_File_Data *(*file_open) (Eina_File *file, const char *key, int *error);
1152 Eina_Bool (*file_close) (Vg_File_Data *vfd);
1153 Eina_Bool (*file_data) (Vg_File_Data *vfd);
1154 };
1155
1156 struct _Evas_Vg_Save_Func
1157 {
1158 Evas_Load_Error (*file_save) (Vg_File_Data *vfd, const char *file, const char *key, int compress);
1159 };
1160
1161 #ifdef __cplusplus
1162 extern "C" {
1163 #endif
1164
1165 Evas_Object *evas_object_new(Evas *e);
1166 void evas_object_change_reset(Evas_Object_Protected_Data *obj);
1167 void evas_object_clip_recalc_do(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *clipper);
1168 void evas_object_cur_prev(Evas_Object_Protected_Data *obj);
1169 void evas_object_free(Evas_Object_Protected_Data *obj, Eina_Bool clean_layer);
1170 void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Smart_Data *s);
1171 void evas_object_inject(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas *e);
1172 void evas_object_release(Evas_Object *obj, Evas_Object_Protected_Data *pd, int clean_layer);
1173 void evas_object_change(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1174 void evas_object_content_change(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1175 void evas_object_clip_changes_clean(Evas_Object_Protected_Data *obj);
1176 void evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
1177 void evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj);
1178 void evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj, Evas_Object_Protected_Data *pd);
1179 void evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
1180 void evas_rects_return_difference_rects(Eina_Array *rects, int x, int y, int w, int h, int xx, int yy, int ww, int hh);
1181 Evas_Object_Pointer_Data *_evas_object_pointer_data_get(Evas_Pointer_Data *evas_pdata, Evas_Object_Protected_Data *obj);
1182
1183 void evas_object_clip_dirty_do(Evas_Object_Protected_Data *pd);
1184 void evas_object_recalc_clippees(Evas_Object_Protected_Data *pd);
1185 Evas_Layer *evas_layer_new(Evas *e);
1186 void _evas_layer_flush_removes(Evas_Layer *lay);
1187 void evas_layer_pre_free(Evas_Layer *lay);
1188 void evas_layer_free_objects(Evas_Layer *lay);
1189 void evas_layer_clean(Evas *e);
1190 Evas_Layer *evas_layer_find(Evas *e, short layer_num);
1191 void evas_layer_add(Evas_Layer *lay);
1192 void evas_layer_del(Evas_Layer *lay);
1193
1194 int evas_object_was_in_output_rect(Evas_Object *obj, Evas_Object_Protected_Data *pd, int x, int y, int w, int h);
1195
1196 int evas_object_was_opaque(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1197 int evas_object_is_inside(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord x, Evas_Coord y);
1198 int evas_object_was_inside(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Coord x, Evas_Coord y);
1199 void evas_object_clip_across_check(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1200 void evas_object_clip_across_clippees_check(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1201 void evas_object_mapped_clip_across_mark(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1202 void evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info);
1203 void evas_object_callbacks_finalized(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj);
1204 void evas_object_callbacks_event_catcher_add(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const Efl_Callback_Array_Item *array);
1205 void evas_object_callbacks_event_catcher_del(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const Efl_Callback_Array_Item *array);
1206 void evas_object_callbacks_shutdown(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj);
1207
1208 void evas_object_event_callback_call(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Callback_Type type, void *event_info, int event_id, const Efl_Event_Description *efl_event_desc);
1209 Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y);
1210 void evas_debug_error(void);
1211 void evas_debug_input_null(void);
1212 void evas_debug_generic(const char *str);
1213 const char *evas_debug_magic_string_get(DATA32 magic);
1214 void evas_render_update_del(Evas_Public_Data *e, int x, int y, int w, int h);
1215 void evas_render_object_render_cache_free(Evas_Object *eo_obj, void *data);
1216
1217 void evas_object_smart_use(Evas_Smart *s);
1218 void evas_object_smart_unuse(Evas_Smart *s);
1219 void evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) EINA_ARG_NONNULL(1);
1220 Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1);
1221 const 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;
1222
1223 Evas_Object *_evas_object_image_source_get(Evas_Object *obj);
1224 Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj);
1225 Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj);
1226 void _evas_object_image_video_overlay_show(Evas_Object *obj);
1227 void _evas_object_image_video_overlay_hide(Evas_Object *obj);
1228 void _evas_object_image_video_overlay_do(Evas_Object *obj);
1229 Eina_Bool _evas_object_image_can_use_plane(Evas_Object_Protected_Data *obj, Efl_Canvas_Output *output);
1230 void _evas_object_image_plane_release(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Efl_Canvas_Output *output);
1231 void _evas_object_image_free(Evas_Object *obj);
1232 void evas_object_smart_bounding_box_get(Evas_Object_Protected_Data *obj, Eina_Rectangle *cur_bounding_box, Eina_Rectangle *prev_bounding_box);
1233 void evas_object_smart_del(Evas_Object *obj);
1234 void evas_object_smart_cleanup(Evas_Object *obj);
1235 void evas_object_smart_member_raise(Evas_Object *member);
1236 void evas_object_smart_member_lower(Evas_Object *member);
1237 void evas_object_smart_member_stack_above(Evas_Object *member, Evas_Object *other);
1238 void evas_object_smart_member_stack_below(Evas_Object *member, Evas_Object *other);
1239 void evas_object_smart_render_cache_clear(Evas_Object *eo_obj);
1240 void *evas_object_smart_render_cache_get(const Evas_Object *eo_obj);
1241 void evas_object_smart_render_cache_set(Evas_Object *eo_obj, void *data);
1242
1243 const Eina_List *evas_object_event_grabber_members_list(const Eo *eo_obj);
1244
1245 const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj);
1246 void _efl_canvas_group_group_members_all_del(Evas_Object *eo_obj);
1247 void _evas_object_smart_clipped_init(Evas_Object *eo_obj);
1248 void evas_object_smart_clipped_smart_move(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y);
1249 void _evas_object_smart_clipped_smart_move_internal(Evas_Object *eo_obj, Evas_Coord x, Evas_Coord y);
1250 void evas_call_smarts_calculate(Evas *e);
1251 void evas_object_smart_bounding_box_update(Evas_Object_Protected_Data *obj);
1252 void evas_object_smart_need_bounding_box_update(Evas_Smart_Data *o, Evas_Object_Protected_Data *obj);
1253 Eina_Bool evas_object_smart_changed_get(Evas_Object_Protected_Data *obj);
1254 void evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s);
1255 void _evas_post_event_callback_call_real(Evas *e, Evas_Public_Data* e_pd, int min_event_id);
1256 #define _evas_post_event_callback_call(e, pd, id) do { \
1257 if (!pd->delete_me && pd->post_events) _evas_post_event_callback_call_real(e, pd, id); } while (0)
1258 void _evas_post_event_callback_free(Evas *e);
1259 void evas_event_callback_list_post_free(Eina_Inlist **list);
1260 void evas_object_event_callback_all_del(Evas_Object *obj);
1261 void evas_object_event_callback_cleanup(Evas_Object *obj);
1262 void evas_event_callback_all_del(Evas *e);
1263 void evas_event_callback_cleanup(Evas *e);
1264 void evas_object_inform_call_show(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1265 void evas_object_inform_call_hide(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1266 void evas_object_inform_call_move(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1267 void evas_object_inform_call_resize(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1268 void evas_object_inform_call_restack(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1269 void evas_object_inform_call_changed_size_hints(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1270 void evas_object_inform_call_image_preloaded(Evas_Object *obj);
1271 void evas_object_inform_call_image_unloaded(Evas_Object *obj);
1272 void evas_object_inform_call_image_resize(Evas_Object *obj);
1273 void evas_object_intercept_cleanup(Evas_Object *obj);
1274 Evas_Object_Pointer_Data *evas_object_pointer_data_find(Evas_Object_Protected_Data *obj,
1275 Efl_Input_Device *pointer);
1276 void evas_object_pointer_grab_del(Evas_Object_Protected_Data *obj,
1277 Evas_Object_Pointer_Data *pdata);
1278 void evas_object_grabs_cleanup(Evas_Object *obj, Evas_Object_Protected_Data *pd);
1279 void evas_key_grab_free(Evas_Object *obj, Evas_Object_Protected_Data *pd, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers);
1280 void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events, Eina_Bool source_invisible);
1281 void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b);
1282 void _evas_object_text_rehint(Evas_Object *obj);
1283 void _evas_object_textblock_rehint(Evas_Object *obj);
1284
1285 Eina_Bool _evas_object_intercept_call_evas(Evas_Object_Protected_Data *obj, Evas_Object_Intercept_Cb_Type cb_type, int internal, ...);
1286
1287 void evas_unref_queue_image_put(Evas_Public_Data *pd, void *image);
1288 void evas_unref_queue_glyph_put(Evas_Public_Data *pd, void *glyph);
1289 void evas_unref_queue_texts_put(Evas_Public_Data *pd, void *glyph);
1290 void evas_post_render_job_add(Evas_Public_Data *pd, void (*func)(void *), void *data);
1291 void evas_render_post_change_object_push(Evas_Object_Protected_Data *obj);
1292
1293 void evas_draw_image_map_async_check(Evas_Object_Protected_Data *obj,
1294 void *engine, void *data, void *context, void *surface,
1295 void *image, RGBA_Map *m, int smooth,
1296 int level, Eina_Bool do_async);
1297 void evas_font_draw_async_check(Evas_Object_Protected_Data *obj,
1298 void *engine, void *data, void *context, void *surface,
1299 Evas_Font_Set *font,
1300 int x, int y, int w, int h, int ow, int oh,
1301 Evas_Text_Props *intl_props, Eina_Bool do_async);
1302
1303 void _efl_canvas_object_clipper_prev_reset(Evas_Object_Protected_Data *obj, Eina_Bool cur_prev);
1304
1305 Eina_Bool _efl_canvas_object_clipper_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *eo_clip, Evas_Object_Protected_Data *clip);
1306 Eina_Bool _efl_canvas_object_clipper_unset_block(Eo *eo_obj, Evas_Object_Protected_Data *obj);
1307 Eina_Bool _efl_canvas_object_efl_gfx_entity_size_set_block(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h, Eina_Bool internal);
1308
1309 void _evas_focus_device_invalidate_cb(void *data, const Efl_Event *ev);
1310
1311 /* Filters */
1312 void evas_filter_init(void);
1313 void evas_filter_shutdown(void);
1314
1315 /* Efl.Gfx.Mapping */
1316 void _efl_gfx_mapping_init(void);
1317 void _efl_gfx_mapping_shutdown(void);
1318 void _efl_gfx_mapping_update(Eo *eo_obj);
1319
1320 /* Ector */
1321 Ector_Surface *evas_ector_get(Evas_Public_Data *evas);
1322
1323 /* Filter functions */
1324 Eina_Bool evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, void *engine, void *output, void *context, void *surface, int x, int y, Eina_Bool do_async, Eina_Bool alpha);
1325
1326 extern int _evas_alloc_error;
1327 extern int _evas_event_counter;
1328
1329 struct _Evas_Imaging_Image
1330 {
1331 RGBA_Image *image;
1332 };
1333
1334 struct _Evas_Imaging_Font
1335 {
1336 RGBA_Font *font;
1337 };
1338
1339 struct _Evas_Proxy_Render_Data
1340 {
1341 Evas_Object_Protected_Data *proxy_obj;
1342 Evas_Object_Protected_Data *src_obj;
1343 Evas_Object *eo_proxy;
1344 Evas_Object *eo_src;
1345 Eina_Bool source_clip : 1;
1346 };
1347
1348 void _evas_canvas_event_init(Evas *eo_e, Evas_Public_Data *e);
1349 void _evas_canvas_event_shutdown(Evas *eo_e, Evas_Public_Data *e);
1350 void _evas_canvas_event_pointer_in_rect_mouse_move_feed(Evas_Public_Data *edata,
1351 Evas_Object *obj,
1352 Evas_Object_Protected_Data *obj_data,
1353 int w, int h,
1354 Eina_Bool in_objects_list,
1355 void *data);
1356 void _evas_canvas_event_pointer_in_list_mouse_move_feed(Evas_Public_Data *edata,
1357 Eina_List *was,
1358 Evas_Object *obj,
1359 Evas_Object_Protected_Data *obj_data,
1360 int w, int h,
1361 Eina_Bool xor_rule,
1362 void *data);
1363 void _evas_canvas_event_pointer_move_event_dispatch(Evas_Public_Data *edata,
1364 Evas_Pointer_Data *pdata,
1365 void *data);
1366 int evas_async_events_init(void);
1367 int evas_async_events_shutdown(void);
1368 int evas_async_target_del(const void *target);
1369
1370 EAPI int evas_thread_main_loop_begin(void);
1371 EAPI int evas_thread_main_loop_end(void);
1372
1373 void _evas_preload_thread_init(void);
1374 void _evas_preload_thread_shutdown(void);
1375 Evas_Preload_Pthread *evas_preload_thread_run(void (*func_heavy)(void *data),
1376 void (*func_end)(void *data),
1377 void (*func_cancel)(void *data),
1378 const void *data);
1379 Eina_Bool evas_preload_thread_cancel(Evas_Preload_Pthread *thread);
1380 Eina_Bool evas_preload_thread_cancelled_is(Evas_Preload_Pthread *thread);
1381 Eina_Bool evas_preload_pthread_wait(Evas_Preload_Pthread *work, double wait);
1382
1383 void _evas_walk(Evas_Public_Data *e_pd);
1384 void _evas_unwalk(Evas_Public_Data *e_pd);
1385
1386 EAPI void evas_module_task_register(Eina_Bool (*cancelled)(void *data), void *data);
1387 EAPI void evas_module_task_unregister(void);
1388
1389 // expose for use in engines
1390 EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name, size_t info);
1391 EAPI const char *_evas_module_libdir_get(void);
1392 const char *_evas_module_datadir_get(void);
1393 EAPI Eina_List *_evas_canvas_image_data_unset(Evas *eo_e);
1394 EAPI void _evas_canvas_image_data_regenerate(Eina_List *list);
1395 void _evas_image_preload_update(Eo *eo_obj, Eina_File *f);
1396 Eina_Bool evas_render_mapped(Evas_Public_Data *e, Evas_Object *obj,
1397 Evas_Object_Protected_Data *source_pd,
1398 void *context, void *output, void *surface,
1399 int off_x, int off_y,
1400 int mapped, int ecx, int ecy, int ecw, int ech,
1401 Evas_Proxy_Render_Data *proxy_render_data,
1402 int level, Eina_Bool do_async);
1403 void evas_render_invalidate(Evas *e);
1404 void evas_render_object_recalc(Evas_Object_Protected_Data *obj);
1405 void evas_render_proxy_subrender(Evas *eo_e, void *output, Evas_Object *eo_source, Evas_Object *eo_proxy, Evas_Object_Protected_Data *proxy_obj, Eina_Bool source_clip, Eina_Bool do_async);
1406
1407 Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y);
1408 Eina_Bool evas_map_coords_get(const Evas_Map *m, double x, double y, double *mx, double *my, int grab);
1409 Eina_Bool evas_object_map_update(Evas_Object *obj, int x, int y, int imagew, int imageh, int uvw, int uvh);
1410 void evas_map_object_move_diff_set(Evas_Map *m, Evas_Coord diff_x, Evas_Coord diff_y);
1411
1412 Eina_List *evas_module_engine_list(void);
1413
1414 /* for updating touch point list */
1415 void _evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y);
1416 void _evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state);
1417 void _evas_touch_point_remove(Evas *e, int id);
1418
1419 void _evas_device_cleanup(Evas *e);
1420 Evas_Device *_evas_device_top_get(const Evas *e);
1421
1422 /* legacy/eo events */
1423 Efl_Input_Event *efl_input_event_instance_get(const Eo *klass, Eo *owner);
1424 void efl_input_event_instance_clean(Eo *klass);
1425
1426 void *efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Callback_Type type, Evas_Event_Flags **pflags);
1427 void *efl_input_key_legacy_info_fill(Efl_Input_Key *evt, Evas_Event_Flags **pflags);
1428 void *efl_input_hold_legacy_info_fill(Efl_Input_Hold *evt, Evas_Event_Flags **pflags);
1429
1430 Eina_Bool evas_vg_loader_svg(Evas_Object *vg, const Eina_File *f, const char *key EINA_UNUSED);
1431
1432 void *_evas_object_image_surface_get(Evas_Object_Protected_Data *obj, Eina_Bool create);
1433 void _evas_filter_radius_get(Evas_Object_Protected_Data *obj, int *l, int *r, int *t, int *b);
1434 Eina_Bool _evas_filter_obscured_regions_set(Evas_Object_Protected_Data *obj, const Eina_Tiler *tiler);
1435 Eina_Bool _evas_image_proxy_source_clip_get(const Eo *eo_obj);
1436
1437 void _evas_focus_dispatch_event(Evas_Object_Protected_Data *obj,
1438 Efl_Input_Device *seat, Eina_Bool in);
1439 Evas_Pointer_Data *_evas_pointer_data_by_device_get(Evas_Public_Data *edata, Efl_Input_Device *pointer);
1440 Evas_Pointer_Data *_evas_pointer_data_add(Evas_Public_Data *edata, Efl_Input_Device *pointer);
1441 void _evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer, Eina_Bool nofree);
1442 Eina_List *_evas_pointer_list_in_rect_get(Evas_Public_Data *edata,
1443 Evas_Object *obj,
1444 Evas_Object_Protected_Data *obj_data,
1445 int w, int h);
1446
1447 void efl_canvas_output_info_get(Evas_Public_Data *e, Efl_Canvas_Output *output);
1448
1449 void evas_object_pixels_get_force(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
1450
1451 // Gesture Manager
1452 void _efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event);
1453 void _efl_canvas_gesture_manager_callback_del_hook(void *data, Eo *target, const Efl_Event_Description *type);
1454 void _efl_canvas_gesture_manager_callback_add_hook(void *data, Eo *target, const Efl_Event_Description *type);
1455
1456 //evas focus functions
1457 void evas_focus_init(void);
1458 void evas_focus_shutdown(void);
1459
1460 void _deferred_callbacks_process(Evas *eo_e, Evas_Public_Data *e);
1461
1462 extern Eina_Cow *evas_object_proxy_cow;
1463 extern Eina_Cow *evas_object_map_cow;
1464 extern Eina_Cow *evas_object_state_cow;
1465
1466 extern Eina_Cow *evas_object_image_pixels_cow;
1467 extern Eina_Cow *evas_object_image_load_opts_cow;
1468 extern Eina_Cow *evas_object_image_state_cow;
1469 extern Eina_Cow *evas_object_mask_cow;
1470 extern Eina_Cow *evas_object_events_cow;
1471
1472 Eina_Error _evas_load_error_to_efl_gfx_image_load_error(Evas_Load_Error err);
1473 Evas_Load_Error _efl_gfx_image_load_error_to_evas_load_error(Eina_Error err);
1474
1475 # define EINA_COW_STATE_WRITE_BEGIN(Obj, Write, State) \
1476 EINA_COW_WRITE_BEGIN(evas_object_state_cow, Obj->State, \
1477 Evas_Object_Protected_State, Write)
1478
1479 # define EINA_COW_STATE_WRITE_END(Obj, Write, State) \
1480 eina_cow_done(evas_object_state_cow, ((const Eina_Cow_Data**)&(Obj->State)), \
1481 Write, EINA_FALSE); \
1482 } \
1483 while (0);
1484
1485 /* BEGIN: events to maintain compatibility with legacy */
1486 EWAPI extern const Efl_Event_Description _EFL_GFX_ENTITY_EVENT_SHOW;
1487 #define EFL_GFX_ENTITY_EVENT_SHOW (&(_EFL_GFX_ENTITY_EVENT_SHOW))
1488 EWAPI extern const Efl_Event_Description _EFL_GFX_ENTITY_EVENT_HIDE;
1489 #define EFL_GFX_ENTITY_EVENT_HIDE (&(_EFL_GFX_ENTITY_EVENT_HIDE))
1490 EWAPI extern const Efl_Event_Description _EFL_GFX_ENTITY_EVENT_IMAGE_PRELOAD;
1491 #define EFL_GFX_IMAGE_EVENT_IMAGE_PRELOAD (&(_EFL_GFX_ENTITY_EVENT_IMAGE_PRELOAD))
1492 EWAPI extern const Efl_Event_Description _EFL_GFX_ENTITY_EVENT_IMAGE_UNLOAD;
1493 #define EFL_GFX_IMAGE_EVENT_IMAGE_UNLOAD (&(_EFL_GFX_ENTITY_EVENT_IMAGE_UNLOAD))
1494 /* END: events to maintain compatibility with legacy */
1495
1496 /****************************************************************************/
1497 /*****************************************/
1498 /********************/
1499 #define MPOOL 1
1500
1501 #ifdef MPOOL
1502 typedef struct _Evas_Mempool Evas_Mempool;
1503
1504 struct _Evas_Mempool
1505 {
1506 int count;
1507 int num_allocs;
1508 int num_frees;
1509 Eina_Mempool *mp;
1510 };
1511 # define EVAS_MEMPOOL(x) \
1512 static Evas_Mempool x = {0, 0, 0, NULL}
1513 # define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) \
1514 do { \
1515 if (!x.mp) { \
1516 const char *tmp, *choice = "chained_mempool"; \
1517 tmp = getenv("EINA_MEMPOOL"); \
1518 if (tmp && tmp[0]) choice = tmp; \
1519 x.mp = eina_mempool_add(choice, nam, NULL, sizeof(siz), cnt); \
1520 if (!x.mp) { \
1521 return ret; \
1522 } \
1523 } \
1524 } while (0)
1525 # define EVAS_MEMPOOL_ALLOC(x, siz) \
1526 eina_mempool_malloc(x.mp, sizeof(siz))
1527 # define EVAS_MEMPOOL_PREP(x, p, siz) \
1528 do { \
1529 x.count++; \
1530 x.num_allocs++; \
1531 memset(p, 0, sizeof(siz)); \
1532 } while (0)
1533 # define EVAS_MEMPOOL_FREE(x, p) \
1534 do { \
1535 eina_mempool_free(x.mp, p); \
1536 x.count--; \
1537 x.num_frees++; \
1538 if (x.count <= 0) { \
1539 eina_mempool_del(x.mp); \
1540 x.mp = NULL; \
1541 x.count = 0; \
1542 } \
1543 } while (0)
1544 #else
1545 # define EVAS_MEMPOOL(x)
1546 # define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret)
1547 # define EVAS_MEMPOOL_PREP(x, p, siz)
1548 # define EVAS_MEMPOOL_ALLOC(x, siz) \
1549 calloc(1, sizeof(siz))
1550 # define EVAS_MEMPOOL_FREE(x, p) \
1551 free(p)
1552 #endif
1553 /********************/
1554 /*****************************************/
1555 /****************************************************************************/
1556
1557 #define EVAS_API_OVERRIDE(func, api, prefix) \
1558 (api)->func = prefix##func
1559 #define EVAS_API_RESET(func, api) \
1560 (api)->func = NULL
1561
1562 static inline Efl_Gfx_Render_Op
_evas_to_gfx_render_op(Evas_Render_Op rop)1563 _evas_to_gfx_render_op(Evas_Render_Op rop)
1564 {
1565 if (rop == EVAS_RENDER_COPY)
1566 return EFL_GFX_RENDER_OP_COPY;
1567 return EFL_GFX_RENDER_OP_BLEND;
1568 }
1569
1570 static inline Evas_Render_Op
_gfx_to_evas_render_op(Efl_Gfx_Render_Op rop)1571 _gfx_to_evas_render_op(Efl_Gfx_Render_Op rop)
1572 {
1573 if (rop == EFL_GFX_RENDER_OP_COPY)
1574 return EVAS_RENDER_COPY;
1575 return EVAS_RENDER_BLEND;
1576 }
1577
1578 #include "evas_inline.x"
1579
1580 #ifdef __cplusplus
1581 }
1582 #endif
1583
1584 #undef EAPI
1585 #define EAPI
1586
1587 #endif
1588
1589