9 #include <eina_safety_checks.h>
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"
18 #ifdef EVAS_MAGIC_DEBUG
19 /* complain when peole pass in wrong object types etc. */
23 #define RENDER_METHOD_INVALID 0x00000000
25 typedef struct _Evas_Layer Evas_Layer;
26 typedef struct _Evas_Size Evas_Size;
27 typedef struct _Evas_Aspect Evas_Aspect;
28 typedef struct _Evas_Border Evas_Border;
29 typedef struct _Evas_Double_Pair Evas_Double_Pair;
30 typedef struct _Evas_Size_Hints Evas_Size_Hints;
31 typedef struct _Evas_Font_Dir Evas_Font_Dir;
32 typedef struct _Evas_Font Evas_Font;
33 typedef struct _Evas_Font_Alias Evas_Font_Alias;
34 typedef struct _Evas_Font_Description Evas_Font_Description;
35 typedef struct _Evas_Data_Node Evas_Data_Node;
36 typedef struct _Evas_Func_Node Evas_Func_Node;
37 typedef RGBA_Image_Loadopts Evas_Image_Load_Opts;
38 typedef struct _Evas_Func Evas_Func;
39 typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func;
40 typedef struct _Evas_Image_Save_Func Evas_Image_Save_Func;
41 typedef struct _Evas_Object_Func Evas_Object_Func;
42 typedef struct _Evas_Intercept_Func Evas_Intercept_Func;
43 typedef struct _Evas_Key_Grab Evas_Key_Grab;
44 typedef struct _Evas_Callbacks Evas_Callbacks;
45 typedef struct _Evas_Format Evas_Format;
46 typedef struct _Evas_Map_Point Evas_Map_Point;
47 typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array;
48 typedef struct _Evas_Smart_Interfaces_Array Evas_Smart_Interfaces_Array;
49 typedef struct _Evas_Post_Callback Evas_Post_Callback;
50 typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point;
54 EVAS_FONT_STYLE_SLANT,
55 EVAS_FONT_STYLE_WEIGHT,
61 EVAS_FONT_SLANT_NORMAL,
62 EVAS_FONT_SLANT_OBLIQUE,
63 EVAS_FONT_SLANT_ITALIC
66 enum _Evas_Font_Weight
68 EVAS_FONT_WEIGHT_NORMAL,
69 EVAS_FONT_WEIGHT_THIN,
70 EVAS_FONT_WEIGHT_ULTRALIGHT,
71 EVAS_FONT_WEIGHT_LIGHT,
72 EVAS_FONT_WEIGHT_BOOK,
73 EVAS_FONT_WEIGHT_MEDIUM,
74 EVAS_FONT_WEIGHT_SEMIBOLD,
75 EVAS_FONT_WEIGHT_BOLD,
76 EVAS_FONT_WEIGHT_ULTRABOLD,
77 EVAS_FONT_WEIGHT_BLACK,
78 EVAS_FONT_WEIGHT_EXTRABLACK
83 EVAS_FONT_WIDTH_NORMAL,
84 EVAS_FONT_WIDTH_ULTRACONDENSED,
85 EVAS_FONT_WIDTH_EXTRACONDENSED,
86 EVAS_FONT_WIDTH_CONDENSED,
87 EVAS_FONT_WIDTH_SEMICONDENSED,
88 EVAS_FONT_WIDTH_SEMIEXPANDED,
89 EVAS_FONT_WIDTH_EXPANDED,
90 EVAS_FONT_WIDTH_EXTRAEXPANDED,
91 EVAS_FONT_WIDTH_ULTRAEXPANDED
94 typedef enum _Evas_Font_Style Evas_Font_Style;
95 typedef enum _Evas_Font_Slant Evas_Font_Slant;
96 typedef enum _Evas_Font_Weight Evas_Font_Weight;
97 typedef enum _Evas_Font_Width Evas_Font_Width;
99 /* General types - used for script type chceking */
100 #define OPAQUE_TYPE(type) struct __##type { int a; }; \
101 typedef struct __##type type
103 OPAQUE_TYPE(Evas_Font_Set); /* General type for RGBA_Font */
104 OPAQUE_TYPE(Evas_Font_Instance); /* General type for RGBA_Font_Int */
105 /* End of general types */
107 #define MAGIC_EVAS 0x70777770
108 #define MAGIC_OBJ 0x71777770
109 #define MAGIC_OBJ_RECTANGLE 0x71777771
110 #define MAGIC_OBJ_LINE 0x71777772
111 #define MAGIC_OBJ_POLYGON 0x71777774
112 #define MAGIC_OBJ_IMAGE 0x71777775
113 #define MAGIC_OBJ_TEXT 0x71777776
114 #define MAGIC_OBJ_SMART 0x71777777
115 #define MAGIC_OBJ_TEXTBLOCK 0x71777778
116 #define MAGIC_OBJ_TEXTGRID 0x7177777A
117 #define MAGIC_SMART 0x72777770
118 #define MAGIC_OBJ_SHAPE 0x72777773
119 #define MAGIC_OBJ_CONTAINER 0x72777774
120 #define MAGIC_OBJ_CUSTOM 0x72777775
121 #define MAGIC_EVAS_GL 0x72777776
122 #define MAGIC_MAP 0x72777777
125 # define MAGIC_CHECK_FAILED(o, t, m) \
126 {evas_debug_error(); \
127 if (!o) evas_debug_input_null(); \
128 else if (((t *)o)->magic == 0) evas_debug_magic_null(); \
129 else evas_debug_magic_wrong((m), ((t *)o)->magic); \
131 # define MAGIC_CHECK(o, t, m) \
132 {if ((!o) || (!(((t *)o)->magic == (m)))) { \
133 MAGIC_CHECK_FAILED(o, t, m)
134 # define MAGIC_CHECK_END() }}
136 # define MAGIC_CHECK_FAILED(o, t, m)
137 # define MAGIC_CHECK(o, t, m) { if (!o) {
138 # define MAGIC_CHECK_END() }}
141 #define NEW_RECT(_r, _x, _y, _w, _h) (_r) = eina_rectangle_new(_x, _y, _w, _h);
143 #define MERR_NONE() _evas_alloc_error = EVAS_ALLOC_ERROR_NONE
144 #define MERR_FATAL() _evas_alloc_error = EVAS_ALLOC_ERROR_FATAL
145 #define MERR_BAD() _evas_alloc_error = EVAS_ALLOC_ERROR_RECOVERED
147 #define EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o) \
150 eina_stringshare_del((o)->cur.file); \
151 if ((o)->prev.file == (o)->cur.file) \
152 (o)->prev.file = NULL; \
153 (o)->cur.file = NULL; \
157 eina_stringshare_del((o)->cur.key); \
158 if ((o)->prev.key == (o)->cur.key) \
159 (o)->prev.key = NULL; \
160 (o)->cur.key = NULL; \
162 if ((o)->prev.file) \
164 eina_stringshare_del((o)->prev.file); \
165 (o)->prev.file = NULL; \
169 eina_stringshare_del((o)->prev.key); \
170 (o)->prev.key = NULL; \
173 struct _Evas_Coord_Touch_Point
175 Evas_Coord x, y; // point's x, y position
176 int id; // id in order to distinguish each point
177 Evas_Touch_Point_State state;
180 struct _Evas_Key_Grab
183 Evas_Modifier_Mask modifiers;
184 Evas_Modifier_Mask not_modifiers;
186 Eina_Bool exclusive : 1;
187 Eina_Bool just_added : 1;
188 Eina_Bool delete_me : 1;
191 struct _Evas_Intercept_Func
194 Evas_Object_Intercept_Show_Cb func;
198 Evas_Object_Intercept_Hide_Cb func;
202 Evas_Object_Intercept_Move_Cb func;
206 Evas_Object_Intercept_Resize_Cb func;
210 Evas_Object_Intercept_Raise_Cb func;
214 Evas_Object_Intercept_Lower_Cb func;
218 Evas_Object_Intercept_Stack_Above_Cb func;
222 Evas_Object_Intercept_Stack_Below_Cb func;
226 Evas_Object_Intercept_Layer_Set_Cb func;
230 Evas_Object_Intercept_Color_Set_Cb func;
234 Evas_Object_Intercept_Clip_Set_Cb func;
238 Evas_Object_Intercept_Clip_Unset_Cb func;
243 struct _Evas_Smart_Cb_Description_Array
246 const Evas_Smart_Cb_Description **array;
249 struct _Evas_Smart_Interfaces_Array
252 const Evas_Smart_Interface **array;
261 const Evas_Smart_Class *smart_class;
263 Evas_Smart_Cb_Description_Array callbacks;
264 Evas_Smart_Interfaces_Array interfaces;
266 unsigned char delete_me : 1;
267 unsigned char class_allocated : 1;
271 struct _Evas_Modifier
277 Evas_Modifier_Mask mask; /* ok we have a max of 64 modifiers */
286 Evas_Modifier_Mask mask; /* we have a max of 64 locks */
289 struct _Evas_Post_Callback
292 Evas_Object_Event_Post_Cb func;
294 unsigned char delete_me : 1;
297 struct _Evas_Callbacks
299 Eina_Inlist *callbacks;
301 unsigned char deletions_waiting : 1;
311 unsigned char inside : 1;
323 Evas_Coord x, y, w, h;
324 unsigned char changed : 1;
329 DATA32 render_method;
330 unsigned char changed : 1;
335 Evas_Coord x, y, w, h;
336 Eina_Bool changed : 1;
345 Eina_Hash *name_hash;
351 Evas_Event_Flags default_event_flags;
366 Eina_Array delete_objects;
367 Eina_Array active_objects;
368 Eina_Array restack_objects;
369 Eina_Array render_objects;
370 Eina_Array pending_objects;
371 Eina_Array obscuring_objects;
372 Eina_Array temporary_objects;
373 Eina_Array calculate_objects;
374 Eina_Array clip_changes;
376 Eina_Clist calc_list;
377 Eina_Clist calc_done;
378 Eina_List *video_objects;
380 Eina_List *post_events; // free me on evas_free
382 Evas_Callbacks *callbacks;
388 Eina_List *font_path;
391 int smart_calc_count;
393 Evas_Object *focused;
395 Evas_Modifier modifiers;
397 unsigned int last_timestamp;
398 int last_mouse_down_counter;
399 int last_mouse_up_counter;
401 Evas_Font_Hinting_Flags hinting;
402 unsigned char changed : 1;
403 unsigned char delete_me : 1;
404 unsigned char invalidate : 1;
405 unsigned char cleanup : 1;
406 unsigned char focus : 1;
408 Eina_List *touch_points;
416 Evas_Object *objects;
422 unsigned char delete_me : 1;
432 Evas_Aspect_Control mode;
438 Evas_Coord l, r, t, b;
441 struct _Evas_Double_Pair
446 struct _Evas_Size_Hints
448 Evas_Size min, max, request;
450 Evas_Double_Pair align, weight;
454 struct _Evas_Map_Point
456 double x, y, z, px, py;
458 unsigned char r, g, b, a;
464 int count; // num of points
465 Evas_Coord_Rectangle normal_geometry; // bounding box of map geom actually
466 void *surface; // surface holding map if needed
467 int surface_w, surface_h; // current surface w & h alloc
468 Evas_Coord mx, my; // mouse x, y after conversion to map space
470 Evas_Coord px, py, z0, foc;
473 Eina_Bool smooth : 1;
474 Evas_Map_Point points[]; // actual points
477 #if 0 // filtering disabled
478 /* nash: Split into two bits */
479 typedef struct Evas_Filter_Info
482 Evas_Filter_Mode mode;
488 void (*data_free)(void *);
492 Filtered_Image *cached;
495 typedef Eina_Bool (*Evas_Software_Filter_Fn)(Evas_Filter_Info *, RGBA_Image *, RGBA_Image *);
497 int evas_filter_get_size(Evas_Filter_Info *info, int inw, int inh,
498 int *outw, int *outh, Eina_Bool inv);
499 Eina_Bool evas_filter_always_alpha(Evas_Filter_Info *info);
500 uint8_t *evas_filter_key_get(const Evas_Filter_Info *info, uint32_t *lenp);
501 // expose for use in engines
502 EAPI Evas_Software_Filter_Fn evas_filter_software_get(Evas_Filter_Info *info);
503 void evas_filter_free(Evas_Object *o);
517 Evas_Object *clipper;
519 Evas_Object *map_parent;
521 Evas_Coord_Rectangle geometry;
522 Evas_Coord_Rectangle bounding_box;
525 Evas_Coord x, y, w, h;
526 unsigned char r, g, b, a;
527 Eina_Bool visible : 1;
533 unsigned char r, g, b, a;
535 Eina_Bool usemap : 1;
536 Eina_Bool visible : 1;
537 Eina_Bool have_clipees : 1;
538 Eina_Bool anti_alias : 1;
539 Evas_Render_Op render_op : 4;
541 Eina_Bool valid_bounding_box : 1;
542 Eina_Bool cached_surface : 1;
543 Eina_Bool parent_cached_surface : 1;
549 Evas_Intercept_Func *interceptors;
557 Evas_Callbacks *callbacks;
564 const Evas_Object_Func *func;
580 #if 0 // filtering disabled
581 Evas_Filter_Info *filter;
584 Evas_Size_Hints *size_hints;
588 int last_mouse_down_counter;
589 int last_mouse_up_counter;
593 Evas_Callback_Type last_event_type;
596 int in_move, in_resize;
599 /* ptr array + data blob holding all interfaces private data for
601 void **interface_privates;
605 unsigned char delete_me;
607 unsigned char recalculate_cycle;
608 Eina_Clist calc_entry;
610 Evas_Object_Pointer_Mode pointer_mode : 2;
613 Eina_Bool pass_events : 1;
614 Eina_Bool freeze_events : 1;
615 Eina_Bool repeat_events : 1;
617 Eina_Bool pass_events : 1;
618 Eina_Bool pass_events_valid : 1;
619 Eina_Bool freeze_events : 1;
620 Eina_Bool freeze_events_valid : 1;
622 Eina_Bool restack : 1;
623 Eina_Bool is_active : 1;
624 Eina_Bool precise_is_inside : 1;
625 Eina_Bool is_static_clip : 1;
627 Eina_Bool render_pre : 1;
628 Eina_Bool rect_del : 1;
629 Eina_Bool mouse_in : 1;
630 Eina_Bool pre_render_done : 1;
631 Eina_Bool intercepted : 1;
632 Eina_Bool focused : 1;
633 Eina_Bool in_layer : 1;
634 Eina_Bool no_propagate : 1;
636 Eina_Bool changed : 1;
637 Eina_Bool changed_move : 1;
638 Eina_Bool changed_color : 1;
639 Eina_Bool changed_map : 1;
640 Eina_Bool changed_pchange : 1;
641 Eina_Bool del_ref : 1;
643 Eina_Bool is_frame : 1;
644 Eina_Bool child_has_map : 1;
647 struct _Evas_Func_Node
652 Evas_Callback_Type type;
653 Evas_Callback_Priority priority;
654 unsigned char delete_me : 1;
657 struct _Evas_Data_Node
663 struct _Evas_Font_Dir
669 DATA64 fonts_dir_mod_time;
670 DATA64 fonts_alias_mod_time;
676 const char *prop[14];
685 struct _Evas_Font_Alias
691 struct _Evas_Font_Description
694 /* We assume everywhere this is stringshared */
696 const char *fallbacks;
699 Evas_Font_Slant slant;
700 Evas_Font_Weight weight;
701 Evas_Font_Width width;
703 Eina_Bool is_new : 1;
706 struct _Evas_Object_Func
708 void (*free) (Evas_Object *obj);
709 void (*render) (Evas_Object *obj, void *output, void *context, void *surface, int x, int y);
710 void (*render_pre) (Evas_Object *obj);
711 void (*render_post) (Evas_Object *obj);
713 unsigned int (*type_id_get) (Evas_Object *obj);
714 unsigned int (*visual_id_get) (Evas_Object *obj);
715 void *(*engine_data_get) (Evas_Object *obj);
717 void (*store) (Evas_Object *obj);
718 void (*unstore) (Evas_Object *obj);
720 int (*is_visible) (Evas_Object *obj);
721 int (*was_visible) (Evas_Object *obj);
723 int (*is_opaque) (Evas_Object *obj);
724 int (*was_opaque) (Evas_Object *obj);
726 int (*is_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
727 int (*was_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
729 void (*coords_recalc) (Evas_Object *obj);
731 void (*scale_update) (Evas_Object *obj);
733 int (*has_opaque_rect) (Evas_Object *obj);
734 int (*get_opaque_rect) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
736 int (*can_map) (Evas_Object *obj);
741 void *(*info) (Evas *e);
742 void (*info_free) (Evas *e, void *info);
743 int (*setup) (Evas *e, void *info);
745 void (*output_free) (void *data);
746 void (*output_resize) (void *data, int w, int h);
747 void (*output_tile_size_set) (void *data, int w, int h);
748 void (*output_redraws_rect_add) (void *data, int x, int y, int w, int h);
749 void (*output_redraws_rect_del) (void *data, int x, int y, int w, int h);
750 void (*output_redraws_clear) (void *data);
751 void *(*output_redraws_next_update_get) (void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch);
752 void (*output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h);
753 void (*output_flush) (void *data);
754 void (*output_idle_flush) (void *data);
755 void (*output_dump) (void *data);
757 void *(*context_new) (void *data);
758 Eina_Bool (*canvas_alpha_get) (void *data, void *context);
759 void (*context_free) (void *data, void *context);
760 void (*context_clip_set) (void *data, void *context, int x, int y, int w, int h);
761 void (*context_clip_clip) (void *data, void *context, int x, int y, int w, int h);
762 void (*context_clip_unset) (void *data, void *context);
763 int (*context_clip_get) (void *data, void *context, int *x, int *y, int *w, int *h);
764 void (*context_mask_set) (void *data, void *context, void *mask, int x, int y, int w, int h);
765 void (*context_mask_unset) (void *data, void *context);
766 void (*context_color_set) (void *data, void *context, int r, int g, int b, int a);
767 int (*context_color_get) (void *data, void *context, int *r, int *g, int *b, int *a);
768 void (*context_multiplier_set) (void *data, void *context, int r, int g, int b, int a);
769 void (*context_multiplier_unset) (void *data, void *context);
770 int (*context_multiplier_get) (void *data, void *context, int *r, int *g, int *b, int *a);
771 void (*context_cutout_add) (void *data, void *context, int x, int y, int w, int h);
772 void (*context_cutout_clear) (void *data, void *context);
773 void (*context_anti_alias_set) (void *data, void *context, unsigned char aa);
774 unsigned char (*context_anti_alias_get) (void *data, void *context);
775 void (*context_color_interpolation_set) (void *data, void *context, int color_space);
776 int (*context_color_interpolation_get) (void *data, void *context);
777 void (*context_render_op_set) (void *data, void *context, int render_op);
778 int (*context_render_op_get) (void *data, void *context);
780 void (*rectangle_draw) (void *data, void *context, void *surface, int x, int y, int w, int h);
782 void (*line_draw) (void *data, void *context, void *surface, int x1, int y1, int x2, int y2);
784 void *(*polygon_point_add) (void *data, void *context, void *polygon, int x, int y);
785 void *(*polygon_points_clear) (void *data, void *context, void *polygon);
786 void (*polygon_draw) (void *data, void *context, void *surface, void *polygon, int x, int y);
788 void *(*image_load) (void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo);
789 void *(*image_new_from_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
790 void *(*image_new_from_copied_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace);
791 void (*image_free) (void *data, void *image);
792 void (*image_size_get) (void *data, void *image, int *w, int *h);
793 void *(*image_size_set) (void *data, void *image, int w, int h);
794 void (*image_stride_get) (void *data, void *image, int *stride);
795 void *(*image_dirty_region) (void *data, void *image, int x, int y, int w, int h);
796 void *(*image_data_get) (void *data, void *image, int to_write, DATA32 **image_data, int *err);
797 void *(*image_data_put) (void *data, void *image, DATA32 *image_data);
798 void (*image_data_preload_request) (void *data, void *image, const void *target);
799 void (*image_data_preload_cancel) (void *data, void *image, const void *target);
800 void *(*image_alpha_set) (void *data, void *image, int has_alpha);
801 int (*image_alpha_get) (void *data, void *image);
802 void *(*image_border_set) (void *data, void *image, int l, int r, int t, int b);
803 void (*image_border_get) (void *data, void *image, int *l, int *r, int *t, int *b);
804 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);
805 char *(*image_comment_get) (void *data, void *image, char *key);
806 char *(*image_format_get) (void *data, void *image);
807 void (*image_colorspace_set) (void *data, void *image, int cspace);
808 int (*image_colorspace_get) (void *data, void *image);
809 Eina_Bool (*image_can_region_get) (void *data, void *image);
810 void (*image_mask_create) (void *data, void *image);
811 void *(*image_native_set) (void *data, void *image, void *native);
812 void *(*image_native_get) (void *data, void *image);
814 void (*image_cache_flush) (void *data);
815 void (*image_cache_set) (void *data, int bytes);
816 int (*image_cache_get) (void *data);
818 Evas_Font_Set *(*font_load) (void *data, const char *name, int size, Font_Rend_Flags wanted_rend);
819 Evas_Font_Set *(*font_memory_load) (void *data, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
820 Evas_Font_Set *(*font_add) (void *data, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend);
821 Evas_Font_Set *(*font_memory_add) (void *data, Evas_Font_Set *font, const char *source, const char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend);
822 void (*font_free) (void *data, Evas_Font_Set *font);
823 int (*font_ascent_get) (void *data, Evas_Font_Set *font);
824 int (*font_descent_get) (void *data, Evas_Font_Set *font);
825 int (*font_max_ascent_get) (void *data, Evas_Font_Set *font);
826 int (*font_max_descent_get) (void *data, Evas_Font_Set *font);
827 void (*font_string_size_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int *w, int *h);
828 int (*font_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
829 int (*font_h_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
830 int (*font_v_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props);
831 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);
832 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);
833 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, Evas_Text_Props *intl_props);
835 void (*font_cache_flush) (void *data);
836 void (*font_cache_set) (void *data, int bytes);
837 int (*font_cache_get) (void *data);
839 /* Engine functions will over time expand from here */
841 void (*font_hinting_set) (void *data, Evas_Font_Set *font, int hinting);
842 int (*font_hinting_can_hint) (void *data, int hinting);
844 /* void (*image_rotation_set) (void *data, void *image); */
846 void (*image_scale_hint_set) (void *data, void *image, int hint);
847 int (*image_scale_hint_get) (void *data, void *image);
848 int (*font_last_up_to_pos) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y);
850 void (*image_map_draw) (void *data, void *context, void *surface, void *image, RGBA_Map *m, int smooth, int level);
851 void *(*image_map_surface_new) (void *data, int w, int h, int alpha);
852 void (*image_map_surface_free) (void *data, void *surface);
853 void (*image_map_clean) (void *data, RGBA_Map *m);
855 void (*image_content_hint_set) (void *data, void *surface, int hint);
856 int (*image_content_hint_get) (void *data, void *surface);
857 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);
858 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, Evas_Text_Props_Mode mode);
859 int (*font_right_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props);
861 #if 0 // filtering disabled
862 void (*image_draw_filtered) (void *data, void *context, void *surface, void *image, Evas_Filter_Info *filter);
863 Filtered_Image *(*image_filtered_get) (void *image, uint8_t *key, size_t len);
864 Filtered_Image *(*image_filtered_save) (void *image, void *filtered, uint8_t *key, size_t len);
865 void (*image_filtered_free) (void *image, Filtered_Image *);
868 /* EFL-GL Glue Layer */
869 void *(*gl_surface_create) (void *data, void *config, int w, int h);
870 int (*gl_surface_destroy) (void *data, void *surface);
871 void *(*gl_context_create) (void *data, void *share_context);
872 int (*gl_context_destroy) (void *data, void *context);
873 int (*gl_make_current) (void *data, void *surface, void *context);
874 void *(*gl_string_query) (void *data, int name);
875 void *(*gl_proc_address_get) (void *data, const char *name);
876 int (*gl_native_surface_get) (void *data, void *surface, void *native_surface);
877 void *(*gl_api_get) (void *data);
878 void (*gl_img_obj_set) (void *data, void *image, int has_alpha);
880 int (*image_load_error_get) (void *data, void *image);
881 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);
883 /* animated feature */
884 Eina_Bool (*image_animated_get) (void *data, void *image);
885 int (*image_animated_frame_count_get) (void *data, void *image);
886 Evas_Image_Animated_Loop_Hint (*image_animated_loop_type_get) (void *data, void *image);
887 int (*image_animated_loop_count_get) (void *data, void *image);
888 double (*image_animated_frame_duration_get) (void *data, void *image, int start_frame, int frame_num);
889 Eina_Bool (*image_animated_frame_set) (void *data, void *image, int frame_index);
892 void (*image_max_size_get) (void *data, int *maxw, int *maxh);
895 struct _Evas_Image_Load_Func
897 Eina_Bool threadable;
898 Eina_Bool (*file_head) (Image_Entry *ie, const char *file, const char *key, int *error);
899 Eina_Bool (*file_data) (Image_Entry *ie, const char *file, const char *key, int *error);
900 double (*frame_duration) (Image_Entry *ie, const char *file, const int start, const int frame_num);
904 struct _Evas_Image_Save_Func
906 int (*image_save) (RGBA_Image *im, const char *file, const char *key, int quality, int compress);
913 Evas_Object *evas_object_new(Evas *e);
914 void evas_object_change_reset(Evas_Object *obj);
915 void evas_object_cur_prev(Evas_Object *obj);
916 void evas_object_free(Evas_Object *obj, int clean_layer);
917 void evas_object_update_bounding_box(Evas_Object *obj);
918 void evas_object_inject(Evas_Object *obj, Evas *e);
919 void evas_object_release(Evas_Object *obj, int clean_layer);
920 void evas_object_change(Evas_Object *obj);
921 void evas_object_clip_changes_clean(Evas_Object *obj);
922 void evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
923 void evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj);
924 void evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj);
925 void evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
926 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);
928 void evas_object_clip_dirty(Evas_Object *obj);
929 void evas_object_recalc_clippees(Evas_Object *obj);
930 Evas_Layer *evas_layer_new(Evas *e);
931 void evas_layer_pre_free(Evas_Layer *lay);
932 void evas_layer_free_objects(Evas_Layer *lay);
933 void evas_layer_clean(Evas *e);
934 Evas_Layer *evas_layer_find(Evas *e, short layer_num);
935 void evas_layer_add(Evas_Layer *lay);
936 void evas_layer_del(Evas_Layer *lay);
938 int evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h);
940 int evas_object_was_opaque(Evas_Object *obj);
941 int evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
942 int evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
943 int evas_object_clippers_was_visible(Evas_Object *obj);
944 void evas_object_clip_across_check(Evas_Object *obj);
945 void evas_object_clip_across_clippees_check(Evas_Object *obj);
946 void evas_object_mapped_clip_across_mark(Evas_Object *obj);
947 void evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info);
948 void evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info, int event_id);
949 Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y);
950 int evas_mem_free(int mem_required);
951 int evas_mem_degrade(int mem_required);
952 void evas_debug_error(void);
953 void evas_debug_input_null(void);
954 void evas_debug_magic_null(void);
955 void evas_debug_magic_wrong(DATA32 expected, DATA32 supplied);
956 void evas_debug_generic(const char *str);
957 const char *evas_debug_magic_string_get(DATA32 magic);
958 void evas_object_smart_use(Evas_Smart *s);
959 void evas_object_smart_unuse(Evas_Smart *s);
960 void evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) EINA_ARG_NONNULL(1);
961 Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1);
962 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;
964 Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj);
965 void _evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading);
966 void _evas_object_image_preloading_check(Evas_Object *obj);
967 Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj);
968 void _evas_object_image_video_overlay_show(Evas_Object *obj);
969 void _evas_object_image_video_overlay_hide(Evas_Object *obj);
970 void evas_object_smart_del(Evas_Object *obj);
971 void evas_object_smart_cleanup(Evas_Object *obj);
972 void evas_object_smart_member_raise(Evas_Object *member);
973 void evas_object_smart_member_lower(Evas_Object *member);
974 void evas_object_smart_member_stack_above(Evas_Object *member, Evas_Object *other);
975 void evas_object_smart_member_stack_below(Evas_Object *member, Evas_Object *other);
976 const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj);
977 void _evas_object_smart_members_all_del(Evas_Object *obj);
978 void evas_call_smarts_calculate(Evas *e);
979 void evas_object_smart_bouding_box_update(Evas_Object *obj);
980 void evas_object_smart_need_bounding_box_update(Evas_Object *obj);
981 void *evas_mem_calloc(int size);
982 void _evas_post_event_callback_call(Evas *e);
983 void _evas_post_event_callback_free(Evas *e);
984 void evas_event_callback_list_post_free(Eina_Inlist **list);
985 void evas_object_event_callback_all_del(Evas_Object *obj);
986 void evas_object_event_callback_cleanup(Evas_Object *obj);
987 void evas_event_callback_all_del(Evas *e);
988 void evas_event_callback_cleanup(Evas *e);
989 void evas_object_inform_call_show(Evas_Object *obj);
990 void evas_object_inform_call_hide(Evas_Object *obj);
991 void evas_object_inform_call_move(Evas_Object *obj);
992 void evas_object_inform_call_resize(Evas_Object *obj);
993 void evas_object_inform_call_restack(Evas_Object *obj);
994 void evas_object_inform_call_changed_size_hints(Evas_Object *obj);
995 void evas_object_inform_call_image_preloaded(Evas_Object *obj);
996 void evas_object_inform_call_image_unloaded(Evas_Object *obj);
997 void evas_object_intercept_cleanup(Evas_Object *obj);
998 int evas_object_intercept_call_show(Evas_Object *obj);
999 int evas_object_intercept_call_hide(Evas_Object *obj);
1000 int evas_object_intercept_call_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
1001 int evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
1002 int evas_object_intercept_call_raise(Evas_Object *obj);
1003 int evas_object_intercept_call_lower(Evas_Object *obj);
1004 int evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object *above);
1005 int evas_object_intercept_call_stack_below(Evas_Object *obj, Evas_Object *below);
1006 int evas_object_intercept_call_layer_set(Evas_Object *obj, int l);
1007 int evas_object_intercept_call_color_set(Evas_Object *obj, int r, int g, int b, int a);
1008 int evas_object_intercept_call_clip_set(Evas_Object *obj, Evas_Object *clip);
1009 int evas_object_intercept_call_clip_unset(Evas_Object *obj);
1010 void evas_object_grabs_cleanup(Evas_Object *obj);
1011 void evas_key_grab_free(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers);
1012 void evas_font_dir_cache_free(void);
1013 const char *evas_font_dir_cache_find(char *dir, char *font);
1014 Eina_List *evas_font_dir_available_list(const Evas* evas);
1015 void evas_font_dir_available_list_free(Eina_List *available);
1016 void evas_font_free(Evas *evas, void *font);
1017 void evas_fonts_zero_free(Evas *evas);
1018 void evas_fonts_zero_presure(Evas *evas);
1019 void evas_font_name_parse(Evas_Font_Description *fdesc, const char *name);
1020 int evas_font_style_find(const char *start, const char *end, Evas_Font_Style style);
1021 Evas_Font_Description *evas_font_desc_new(void);
1022 Evas_Font_Description *evas_font_desc_dup(const Evas_Font_Description *fdesc);
1023 void evas_font_desc_unref(Evas_Font_Description *fdesc);
1024 int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b);
1025 Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc);
1026 void * evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size);
1027 void evas_font_load_hinting_set(Evas *evas, void *font, int hinting);
1028 void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events);
1029 void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b);
1030 void _evas_object_text_rehint(Evas_Object *obj);
1031 void _evas_object_textblock_rehint(Evas_Object *obj);
1033 extern int _evas_alloc_error;
1034 extern int _evas_event_counter;
1036 struct _Evas_Imaging_Image
1041 struct _Evas_Imaging_Font
1046 int evas_async_events_init(void);
1047 int evas_async_events_shutdown(void);
1048 int evas_async_target_del(const void *target);
1050 void _evas_preload_thread_init(void);
1051 void _evas_preload_thread_shutdown(void);
1052 Evas_Preload_Pthread *evas_preload_thread_run(void (*func_heavy)(void *data),
1053 void (*func_end)(void *data),
1054 void (*func_cancel)(void *data),
1056 Eina_Bool evas_preload_thread_cancel(Evas_Preload_Pthread *thread);
1058 void _evas_walk(Evas *e);
1059 void _evas_unwalk(Evas *e);
1061 // expose for use in engines
1062 EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name);
1063 EAPI const char *_evas_module_libdir_get(void);
1065 Eina_Bool evas_render_mapped(Evas *e, Evas_Object *obj,
1066 void *context, void *surface,
1067 int off_x, int off_y, int mapped,
1068 int ecx, int ecy, int ecw, int ech);
1069 void evas_render_invalidate(Evas *e);
1070 void evas_render_object_recalc(Evas_Object *obj);
1072 Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y);
1073 Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab);
1074 void evas_object_map_update(Evas_Object *obj, int x, int y, int imagew, int imageh, int uvw, int uvh);
1076 Eina_List *evas_module_engine_list(void);
1078 /* for updating touch point list */
1079 void _evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y);
1080 void _evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state);
1081 void _evas_touch_point_remove(Evas *e, int id);
1083 /****************************************************************************/
1084 /*****************************************/
1085 /********************/
1089 typedef struct _Evas_Mempool Evas_Mempool;
1091 struct _Evas_Mempool
1098 # define EVAS_MEMPOOL(x) \
1099 static Evas_Mempool x = {0, 0, 0, NULL}
1100 # define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) \
1103 x.mp = eina_mempool_add("chained_mempool", nam, NULL, sizeof(siz), cnt); \
1109 # define EVAS_MEMPOOL_ALLOC(x, siz) \
1110 eina_mempool_malloc(x.mp, sizeof(siz))
1111 # define EVAS_MEMPOOL_PREP(x, p, siz) \
1115 memset(p, 0, sizeof(siz)); \
1117 # define EVAS_MEMPOOL_FREE(x, p) \
1119 eina_mempool_free(x.mp, p); \
1122 if (x.count <= 0) { \
1123 eina_mempool_del(x.mp); \
1129 # define EVAS_MEMPOOL(x)
1130 # define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret)
1131 # define EVAS_MEMPOOL_PREP(x, p, siz)
1132 # define EVAS_MEMPOOL_ALLOC(x, siz) \
1133 calloc(1, sizeof(siz))
1134 # define EVAS_MEMPOOL_FREE(x, p) \
1137 /********************/
1138 /*****************************************/
1139 /****************************************************************************/
1141 #define EVAS_API_OVERRIDE(func, api, prefix) \
1142 (api)->func = prefix##func
1143 #define EVAS_API_RESET(func, api) \
1146 #include "evas_inline.x"